added gpr speed tracking
This commit is contained in:
@@ -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()})"
|
||||
)
|
||||
|
||||
@@ -39,10 +39,10 @@ class AppWindowPipelineMixin:
|
||||
|
||||
try:
|
||||
processor_was_running = self._supervisor.is_processor_running()
|
||||
config = self._build_config()
|
||||
if not processor_was_running:
|
||||
self._reset_runtime_history()
|
||||
|
||||
config = self._build_config()
|
||||
self._validate_processing_mode_constraints(config)
|
||||
run_signature = self._build_run_history_signature(config)
|
||||
radar_key = self._radar_key(config)
|
||||
|
||||
@@ -191,6 +191,18 @@ def build_processing_group(owner) -> QGroupBox:
|
||||
owner._gpr_stop_freq_mhz.setSingleStep(10.0)
|
||||
owner._gpr_stop_freq_mhz.setValue(float(gpr_live_defaults.stop_freq_mhz))
|
||||
|
||||
owner._gpr_speed_m_s = QDoubleSpinBox()
|
||||
owner._gpr_speed_m_s.setDecimals(3)
|
||||
owner._gpr_speed_m_s.setRange(-100.0, 100.0)
|
||||
owner._gpr_speed_m_s.setSingleStep(0.01)
|
||||
owner._gpr_speed_m_s.setValue(float(gpr_live_defaults.speed_m_s))
|
||||
|
||||
owner._gpr_look_angle_deg = QDoubleSpinBox()
|
||||
owner._gpr_look_angle_deg.setDecimals(2)
|
||||
owner._gpr_look_angle_deg.setRange(-90.0, 90.0)
|
||||
owner._gpr_look_angle_deg.setSingleStep(0.1)
|
||||
owner._gpr_look_angle_deg.setValue(float(gpr_live_defaults.look_angle_deg))
|
||||
|
||||
owner._gpr_background_subtract_enabled = QCheckBox("Subtract mean of previous collections")
|
||||
owner._gpr_background_subtract_enabled.setChecked(bool(gpr_live_defaults.background_subtract_enabled))
|
||||
|
||||
@@ -209,6 +221,8 @@ def build_processing_group(owner) -> QGroupBox:
|
||||
gpr_form.addRow("Comp power", owner._gpr_comp_power)
|
||||
gpr_form.addRow("Start MHz", owner._gpr_start_freq_mhz)
|
||||
gpr_form.addRow("Stop MHz", owner._gpr_stop_freq_mhz)
|
||||
gpr_form.addRow("Speed m/s", owner._gpr_speed_m_s)
|
||||
gpr_form.addRow("Look angle deg", owner._gpr_look_angle_deg)
|
||||
gpr_form.addRow(owner._gpr_background_subtract_enabled)
|
||||
gpr_form.addRow("Mean count", owner._gpr_background_mean_count)
|
||||
owner._processing_mode_pages.addWidget(gpr_page)
|
||||
@@ -236,6 +250,8 @@ def build_processing_group(owner) -> QGroupBox:
|
||||
owner._gpr_comp_power.valueChanged.connect(owner._on_processing_live_settings_changed)
|
||||
owner._gpr_start_freq_mhz.valueChanged.connect(owner._on_processing_live_settings_changed)
|
||||
owner._gpr_stop_freq_mhz.valueChanged.connect(owner._on_processing_live_settings_changed)
|
||||
owner._gpr_speed_m_s.valueChanged.connect(owner._on_processing_live_settings_changed)
|
||||
owner._gpr_look_angle_deg.valueChanged.connect(owner._on_processing_live_settings_changed)
|
||||
owner._gpr_background_subtract_enabled.toggled.connect(owner._on_processing_live_settings_changed)
|
||||
owner._gpr_background_mean_count.valueChanged.connect(owner._on_processing_live_settings_changed)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user