diff --git a/python_app/gui/controllers/app_window_preprocess_mixin.py b/python_app/gui/controllers/app_window_preprocess_mixin.py index 0a9c8bb..143b6af 100644 --- a/python_app/gui/controllers/app_window_preprocess_mixin.py +++ b/python_app/gui/controllers/app_window_preprocess_mixin.py @@ -725,18 +725,18 @@ class AppWindowPreprocessMixin: ) -> None: """Save amplitude/phase PNGs for every captured combo across all radar configs. - The live preview only shows the last config of each combo, so this persists a - graph for the other configs too, under the store's ``preview_png/`` tree. The + The live preview only shows one trace per config, so this persists a graph for + every config and every combo (port) under the store's ``preview_png/`` tree. + Iterating per config over its full trace set (not the per-batch preview trace) + is what makes matrix radars save all ports instead of only the last one. The set is already saved by the time we get here, so any rendering failure is logged but never aborts the save. """ channel = preprocess_asset_channel(kind) display_name = preprocess_asset_display_name(kind) - # batch.traces and saved_sets are both ordered by the session's radar - # variants, so index i refers to the same config in both. saved_count = 0 - for batch in session.captured_batches(): - for trace, saved in zip(batch.traces, saved_sets): + for saved in saved_sets: + for trace in session.traces_for_radar_key(saved.radar_key): combo_label = f"input={trace.combo.input} output={trace.combo.output}" try: png_path = self._store.preview_png_dir(kind, set_name, saved.radar_key) / ( diff --git a/python_app/workflows/multi_radar_capture_workflow.py b/python_app/workflows/multi_radar_capture_workflow.py index 3796c99..09aa0d3 100644 --- a/python_app/workflows/multi_radar_capture_workflow.py +++ b/python_app/workflows/multi_radar_capture_workflow.py @@ -313,6 +313,15 @@ class MultiRadarSequentialCaptureSession: """Return completed combo batches in capture order.""" return list(self._captured_batches) + def traces_for_radar_key(self, radar_key: str) -> list[TraceData]: + """Return every captured trace (one per combo) for one radar variant. + + Unlike a batch's ``traces`` (one entry per variant, holding only the + preview trace), this returns the full per-combo set, so matrix radars + expose all ports rather than just the last one. + """ + return list(self._traces_by_radar_key.get(radar_key, [])) + def radar_variant_count(self) -> int: """Return how many radar variants are captured per combo.""" return len(self._radar_variants)