fix(gui): P-4 — dashboard NUM_RANGE_BINS 64 → 512 (import from radar_protocol)

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.
This commit is contained in:
Jason
2026-05-02 16:34:20 +05:45
parent 9fbb7150b0
commit 8004c59674
2 changed files with 6 additions and 6 deletions
+4 -6
View File
@@ -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
+2
View File
@@ -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__)