added gpr speed tracking

This commit is contained in:
Ayzen
2026-04-01 22:05:04 +03:00
parent 669205d8f8
commit 4b78c2808d
20 changed files with 1165 additions and 47 deletions
@@ -165,6 +165,8 @@ class AppWindowConfigMixin:
comp_power=0.2,
start_freq_mhz=3000.0,
stop_freq_mhz=6000.0,
speed_m_s=0.0,
look_angle_deg=0.0,
background_subtract_enabled=True,
background_mean_count=10,
),
@@ -217,6 +219,8 @@ class AppWindowConfigMixin:
comp_power=float(self._gpr_comp_power.value()),
start_freq_mhz=float(self._gpr_start_freq_mhz.value()),
stop_freq_mhz=float(self._gpr_stop_freq_mhz.value()),
speed_m_s=float(self._gpr_speed_m_s.value()),
look_angle_deg=float(self._gpr_look_angle_deg.value()),
background_subtract_enabled=bool(self._gpr_background_subtract_enabled.isChecked()),
background_mean_count=int(self._gpr_background_mean_count.value()),
),
@@ -315,7 +319,7 @@ class AppWindowConfigMixin:
details=self._capture_state_details(),
)
return
if self._supervisor.is_running() or self._supervisor.is_processor_running():
if self._supervisor.is_running():
self._show_error(
"Stop all pipeline processes before loading a config profile",
details=self._process_state_details(),
@@ -332,23 +336,26 @@ class AppWindowConfigMixin:
return
try:
self._load_config_profile(Path(selected_path))
normalized_path = self._normalize_profile_path(Path(selected_path))
profile = GuiProfileModel.load_from_path(normalized_path)
processor_running = self._supervisor.is_processor_running()
self._apply_loaded_profile(profile, normalized_path)
profile_kind = "legacy run config" if profile.gui is None else "full GUI profile"
message = (
f"Config profile loaded: path={normalized_path}, "
f"kind={profile_kind}, "
f"combos={len(self._defaults_config.combos)}, "
f"processing_mode={self._processing_mode.currentText()}"
)
if processor_running:
message += (
"; data_processor is still running, so live processing settings were applied immediately "
"and stable settings are now staged in the UI for the next Start"
)
self._log(message)
except Exception as exc: # noqa: BLE001
self._show_exception("Failed to load config profile", exc)
def _load_config_profile(self, profile_path: Path) -> None:
"""Load config profile from `profile_path` and atomically apply it to the UI."""
normalized_path = self._normalize_profile_path(profile_path)
profile = GuiProfileModel.load_from_path(normalized_path)
self._apply_loaded_profile(profile, normalized_path)
profile_kind = "legacy run config" if profile.gui is None else "full GUI profile"
self._log(
f"Config profile loaded: path={normalized_path}, "
f"kind={profile_kind}, "
f"combos={len(self._defaults_config.combos)}, "
f"processing_mode={self._processing_mode.currentText()}"
)
def _apply_loaded_profile(self, profile: GuiProfileModel, profile_path: Path) -> None:
"""Apply already parsed profile to GUI state without restarting the pipeline."""
config = profile.run_config.clone()
@@ -395,6 +402,8 @@ class AppWindowConfigMixin:
self._gpr_comp_power,
self._gpr_start_freq_mhz,
self._gpr_stop_freq_mhz,
self._gpr_speed_m_s,
self._gpr_look_angle_deg,
self._gpr_background_subtract_enabled,
self._gpr_background_mean_count,
self._save_count,
@@ -455,6 +464,8 @@ class AppWindowConfigMixin:
self._gpr_comp_power.setValue(float(gui_state.processing.gpr.comp_power))
self._gpr_start_freq_mhz.setValue(float(gui_state.processing.gpr.start_freq_mhz))
self._gpr_stop_freq_mhz.setValue(float(gui_state.processing.gpr.stop_freq_mhz))
self._gpr_speed_m_s.setValue(float(gui_state.processing.gpr.speed_m_s))
self._gpr_look_angle_deg.setValue(float(gui_state.processing.gpr.look_angle_deg))
self._gpr_background_subtract_enabled.setChecked(
bool(gui_state.processing.gpr.background_subtract_enabled)
)
@@ -567,6 +578,8 @@ class AppWindowConfigMixin:
gpr_comp_power=float(self._gpr_comp_power.value()),
gpr_start_freq_mhz=float(self._gpr_start_freq_mhz.value()),
gpr_stop_freq_mhz=float(self._gpr_stop_freq_mhz.value()),
gpr_speed_m_s=float(self._gpr_speed_m_s.value()),
gpr_look_angle_deg=float(self._gpr_look_angle_deg.value()),
gpr_background_subtract_enabled=bool(self._gpr_background_subtract_enabled.isChecked()),
gpr_background_mean_count=int(self._gpr_background_mean_count.value()),
history_command_seq=int(self._history_command_seq),
@@ -640,6 +653,8 @@ class AppWindowConfigMixin:
f"outputs={self._gpr_output_positions_input.text().strip() or '<all>'}, "
f"depth={self._gpr_min_depth_m.value():g}..{self._gpr_max_depth_m.value():g} m, "
f"freq={self._gpr_start_freq_mhz.value():g}..{self._gpr_stop_freq_mhz.value():g} MHz, "
f"speed={self._gpr_speed_m_s.value():g} m/s, "
f"look_angle={self._gpr_look_angle_deg.value():g} deg, "
f"background_subtract={self._gpr_background_subtract_enabled.isChecked()}, "
f"mean_count={self._gpr_background_mean_count.value()})"
)