fix(gui): P-1 — RadarDataWorker __init__ initialises runtime attrs

Audit P-1 (2026-05-02): _frame_queue, _acquisition, and frame counters
were stranded inside set_waveform() due to indentation drift.  The
dashboard constructs RadarDataWorker and calls .start() directly
without ever calling set_waveform, so live FT2232H acquisition crashes
with AttributeError on first frame access in run().

Move the init block back into __init__; set_waveform now only sets
self._waveform.  Add TestRadarDataWorkerInit covering both:
- attrs present after bare __init__ (no set_waveform required)
- set_waveform does not reset runtime counters

Test result: test_v7 102/102 PASS in radar_venv (was 100/100 + 2 new).
This commit is contained in:
Jason
2026-05-02 16:08:24 +05:45
parent 3d2ffc3f2c
commit fcbf243aba
2 changed files with 34 additions and 3 deletions
+3 -3
View File
@@ -91,9 +91,6 @@ class RadarDataWorker(QThread):
self._waveform = WaveformConfig()
self._running = False
def set_waveform(self, wf) -> None:
self._waveform = wf
# Frame queue for production RadarAcquisition → this thread
self._frame_queue: queue.Queue = queue.Queue(maxsize=4)
@@ -105,6 +102,9 @@ class RadarDataWorker(QThread):
self._byte_count = 0
self._error_count = 0
def set_waveform(self, wf) -> None:
self._waveform = wf
def stop(self):
self._running = False
if self._acquisition: