new GPR parameters and some UI fixes
This commit is contained in:
@@ -21,6 +21,10 @@ from python_app.orchestration.shm_reader import ShmRingReader
|
||||
class AppWindowPipelineMixin:
|
||||
"""Controls start/stop, readers, and periodic polling of pipeline rings."""
|
||||
|
||||
def _processor_requires_restart(self, run_signature: tuple[object, ...]) -> bool:
|
||||
"""Return whether alive `data_processor` was started with different stable run settings."""
|
||||
return self._supervisor.is_processor_running() and self._processor_run_signature != run_signature
|
||||
|
||||
def _start_single_capture(self) -> None:
|
||||
"""Start acquisition in single-capture mode."""
|
||||
self._start_run(single_capture=True)
|
||||
@@ -40,11 +44,15 @@ class AppWindowPipelineMixin:
|
||||
try:
|
||||
processor_was_running = self._supervisor.is_processor_running()
|
||||
config = self._build_config()
|
||||
run_signature = self._build_run_history_signature(config)
|
||||
if self._processor_requires_restart(run_signature):
|
||||
self._log("Restarting data_processor because stable run settings changed")
|
||||
self._stop_all_processes()
|
||||
processor_was_running = False
|
||||
if not processor_was_running:
|
||||
self._reset_runtime_history()
|
||||
|
||||
self._validate_processing_mode_constraints(config)
|
||||
run_signature = self._build_run_history_signature(config)
|
||||
radar_key = self._radar_key(config)
|
||||
|
||||
missing_assets = [
|
||||
@@ -102,6 +110,7 @@ class AppWindowPipelineMixin:
|
||||
self._raw_reader = ShmRingReader(config.rings.raw_tap.name)
|
||||
self._pre_reader = ShmRingReader(config.rings.preprocessed_tap.name)
|
||||
self._result_reader = ShmRingReader(config.rings.results.name)
|
||||
self._processor_run_signature = run_signature
|
||||
self._single_capture_active = single_capture
|
||||
self._single_capture_start_ns = None
|
||||
self._single_capture_seen_raw = False
|
||||
@@ -138,6 +147,7 @@ class AppWindowPipelineMixin:
|
||||
return
|
||||
|
||||
was_running = self._supervisor.is_running()
|
||||
processor_only_running = self._supervisor.is_processor_running() and not was_running
|
||||
if was_running:
|
||||
self._stop_run()
|
||||
|
||||
@@ -145,6 +155,15 @@ class AppWindowPipelineMixin:
|
||||
if self._radar_mode.currentText() == "native":
|
||||
self._refresh_radar_limits_from_device()
|
||||
config = self._build_config()
|
||||
run_signature = self._build_run_history_signature(config)
|
||||
if processor_only_running and self._processor_requires_restart(run_signature):
|
||||
self._stop_all_processes()
|
||||
self._reset_runtime_history()
|
||||
self._history_run_signature = None
|
||||
self._log(
|
||||
"Stable run settings changed; stopped data_processor because cached history no longer "
|
||||
"matches the current config"
|
||||
)
|
||||
self._prepare_radar_for_native_acquisition(config)
|
||||
self._log(
|
||||
"Radar settings applied: "
|
||||
@@ -213,6 +232,7 @@ class AppWindowPipelineMixin:
|
||||
self._single_capture_start_ns = None
|
||||
self._single_capture_seen_raw = False
|
||||
self._single_capture_target_collection_id = None
|
||||
self._processor_run_signature = None
|
||||
self._update_history_indicator()
|
||||
self._status_label.setText("Status: idle")
|
||||
if was_running:
|
||||
|
||||
Reference in New Issue
Block a user