projector version
This commit is contained in:
@@ -283,6 +283,19 @@ class ProcessSupervisor:
|
||||
|
||||
def _acquisition_command(self, config_path: Path) -> list[str]:
|
||||
"""Return acquisition producer command selected by radar.model."""
|
||||
# A configured replay dataset overrides the model's normal producer:
|
||||
# recorded snapshots are replayed into the raw ring instead of
|
||||
# acquiring from (mock) hardware.
|
||||
replay_dir = self._read_replay_dataset_dir(config_path)
|
||||
if replay_dir:
|
||||
logger.debug("Selecting replay producer for dataset_dir=%s", replay_dir)
|
||||
return [
|
||||
sys.executable,
|
||||
"-m",
|
||||
"python_app.scripts.replay_raw_producer",
|
||||
"--config",
|
||||
str(config_path),
|
||||
]
|
||||
radar_model = self._read_radar_model(config_path)
|
||||
logger.debug("Selecting acquisition producer for radar.model=%s", radar_model)
|
||||
if radar_model in {"librevna_multi", "sn9000"}:
|
||||
@@ -318,6 +331,20 @@ class ProcessSupervisor:
|
||||
return "librevna"
|
||||
return str(radar_payload.get("model", "librevna"))
|
||||
|
||||
@staticmethod
|
||||
def _read_replay_dataset_dir(config_path: Path) -> str:
|
||||
"""Read `radar.replay.dataset_dir` cheaply, '' when replay is off."""
|
||||
payload = json.loads(config_path.read_text(encoding="utf-8"))
|
||||
if not isinstance(payload, dict):
|
||||
return ""
|
||||
radar_payload = payload.get("radar")
|
||||
if not isinstance(radar_payload, dict):
|
||||
return ""
|
||||
replay_payload = radar_payload.get("replay")
|
||||
if not isinstance(replay_payload, dict):
|
||||
return ""
|
||||
return str(replay_payload.get("dataset_dir", "")).strip()
|
||||
|
||||
def _stop_processes(self, names: Iterable[str]) -> None:
|
||||
"""Gracefully terminate processes, then force-kill on per-process timeout."""
|
||||
ordered_names = list(names)
|
||||
@@ -591,6 +618,7 @@ class ProcessSupervisor:
|
||||
"build/bin/sweep_orchestrator",
|
||||
"python_app.scripts.matrix_raw_producer",
|
||||
"python_app.scripts.kamil_adc_raw_producer",
|
||||
"python_app.scripts.replay_raw_producer",
|
||||
)
|
||||
try:
|
||||
raw = (Path("/proc") / str(pid) / "cmdline").read_bytes()
|
||||
|
||||
Reference in New Issue
Block a user