From 15864cb412283df3b30c9f1ec599212a6306703b Mon Sep 17 00:00:00 2001 From: Ayzen Date: Mon, 6 Oct 2025 18:31:18 +0300 Subject: [PATCH] added all data to bscan --- .../core/processors/configs/bscan_config.json | 2 +- .../processors/configs/magnitude_config.json | 2 +- .../implementations/bscan_processor.py | 17 ++++++++++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/vna_system/core/processors/configs/bscan_config.json b/vna_system/core/processors/configs/bscan_config.json index fd4a9f7..9e825ed 100644 --- a/vna_system/core/processors/configs/bscan_config.json +++ b/vna_system/core/processors/configs/bscan_config.json @@ -1,6 +1,6 @@ { "open_air": false, - "axis": "real", + "axis": "abs", "cut": 0.292, "max": 2.3, "gain": 0.3, diff --git a/vna_system/core/processors/configs/magnitude_config.json b/vna_system/core/processors/configs/magnitude_config.json index 1514069..75db2aa 100644 --- a/vna_system/core/processors/configs/magnitude_config.json +++ b/vna_system/core/processors/configs/magnitude_config.json @@ -3,5 +3,5 @@ "y_max": 40, "autoscale": true, "show_magnitude": true, - "show_phase": false + "show_phase": true } \ No newline at end of file diff --git a/vna_system/core/processors/implementations/bscan_processor.py b/vna_system/core/processors/implementations/bscan_processor.py index 279ae2a..d737513 100644 --- a/vna_system/core/processors/implementations/bscan_processor.py +++ b/vna_system/core/processors/implementations/bscan_processor.py @@ -216,15 +216,26 @@ class BScanProcessor(BaseProcessor): if len(self._plot_history) > self._max_history: self._plot_history = self._plot_history[-self._max_history :] + # Collect all plot history data + with self._lock: + all_time_domain = [record["time_domain_data"] for record in self._plot_history] + all_distance = [record["distance_data"] for record in self._plot_history] + all_sweep_numbers = [record["sweep_number"] for record in self._plot_history] + all_timestamps = [record["timestamp"] for record in self._plot_history] + return { - "time_domain_data": analysis["time_data"].tolist(), - "distance_data": analysis["distance"].tolist(), + "time_domain_data": analysis["time_data"].tolist(), # Latest sweep + "distance_data": analysis["distance"].tolist(), # Latest sweep "frequency_range": analysis["freq_range"], "reference_used": bool(self._config["open_air"] and reference_data is not None), "axis_type": self._config["axis"], - # "data_limitation": self._config["data_limitation"], "points_processed": int(complex_data.size), "plot_history_count": len(self._plot_history), + # Full history data + "all_time_domain_data": all_time_domain, + "all_distance_data": all_distance, + "all_sweep_numbers": all_sweep_numbers, + "all_timestamps": all_timestamps, } except Exception as exc: # noqa: BLE001