From 8004c5967447c231805adbc280674eb6566b907a Mon Sep 17 00:00:00 2001 From: Jason <83615043+JJassonn69@users.noreply.github.com> Date: Sat, 2 May 2026 16:34:20 +0545 Subject: [PATCH] =?UTF-8?q?fix(gui):=20P-4=20=E2=80=94=20dashboard=20NUM?= =?UTF-8?q?=5FRANGE=5FBINS=2064=20=E2=86=92=20512=20(import=20from=20radar?= =?UTF-8?q?=5Fprotocol)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dashboard.py:77 had a stale `NUM_RANGE_BINS = 64` literal from pre-PR-F. Range-Doppler canvas was mis-sized: parser at radar_protocol.py:425 already enforces 512, so production frames would never have rendered correctly even with P-2/P-3 in place. Fix: drop the local literals; re-export NUM_RANGE_BINS / NUM_DOPPLER_BINS through v7/hardware.py (which already re-exports the rest of radar_protocol) and import them in dashboard.py. Single source of truth. Also fixed two stale "(64x32)" docstrings: module-header tab description and `_on_frame_ready` docstring. Regression: 228/228 (test_v7 111 + test_GUI_V65_Tk 117). Ruff clean. --- 9_Firmware/9_3_GUI/v7/dashboard.py | 10 ++++------ 9_Firmware/9_3_GUI/v7/hardware.py | 2 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/9_Firmware/9_3_GUI/v7/dashboard.py b/9_Firmware/9_3_GUI/v7/dashboard.py index 31e5cb9..50c2a09 100644 --- a/9_Firmware/9_3_GUI/v7/dashboard.py +++ b/9_Firmware/9_3_GUI/v7/dashboard.py @@ -2,7 +2,7 @@ v7.dashboard — Main application window for the PLFM Radar GUI V7. RadarDashboard is a QMainWindow with six tabs: - 1. Main View — Range-Doppler matplotlib canvas (64x32), device combos, + 1. Main View — Range-Doppler matplotlib canvas (512x48), device combos, Start/Stop, targets table 2. Map View — Embedded Leaflet map + sidebar 3. FPGA Control — Full FPGA register control panel (all 27 opcodes incl. AGC, @@ -62,6 +62,8 @@ from .hardware import ( StatusResponse, DataRecorder, STM32USBInterface, + NUM_RANGE_BINS, + NUM_DOPPLER_BINS, ) from .processing import RadarProcessor, USBPacketParser from .workers import RadarDataWorker, GPSDataWorker, TargetSimulator, ReplayWorker @@ -73,10 +75,6 @@ if TYPE_CHECKING: logger = logging.getLogger(__name__) -# Frame dimensions from FPGA (mirrors radar_protocol.NUM_*; PR-F/PR-Q) -NUM_RANGE_BINS = 64 -NUM_DOPPLER_BINS = 48 - # Force C locale (period as decimal separator) for all QDoubleSpinBox instances. _C_LOCALE = QLocale(QLocale.Language.C) _C_LOCALE.setNumberOptions(QLocale.NumberOption.RejectGroupSeparator) @@ -1665,7 +1663,7 @@ class RadarDashboard(QMainWindow): @pyqtSlot(object) def _on_frame_ready(self, frame: RadarFrame): - """Handle a complete 64x32 radar frame from production acquisition.""" + """Handle a complete radar frame (NUM_RANGE_BINS x NUM_DOPPLER_BINS) from production acquisition.""" # noqa: E501 self._current_frame = frame self._frame_count += 1 diff --git a/9_Firmware/9_3_GUI/v7/hardware.py b/9_Firmware/9_3_GUI/v7/hardware.py index d36aa1a..07fd387 100644 --- a/9_Firmware/9_3_GUI/v7/hardware.py +++ b/9_Firmware/9_3_GUI/v7/hardware.py @@ -32,6 +32,8 @@ from radar_protocol import ( # noqa: F401 — re-exported for v7 package RadarFrame, StatusResponse, DataRecorder, + NUM_RANGE_BINS, + NUM_DOPPLER_BINS, ) logger = logging.getLogger(__name__)