fix(v7): store WaveformConfig on self; add set_waveform parity; fix magic 32
- Move WaveformConfig() from per-frame local in _run_host_dsp to
self._waveform in __init__, mirroring ReplayWorker pattern.
- Add set_waveform() to RadarDataWorker for injection symmetry with
ReplayWorker.set_waveform() — live path is now configurable.
- Replace hardcoded fallback 32 with self._waveform.n_doppler_bins.
- Update AST contract tests: WaveformConfig() check moves to __init__
parse; attribute chains updated from ("wf", ...) to
("self", "_waveform", ...) to match renamed accessor.
This commit is contained in:
@@ -84,6 +84,7 @@ class RadarDataWorker(QThread):
|
||||
self._recorder = recorder
|
||||
self._gps = gps_data_ref
|
||||
self._settings = settings or RadarSettings()
|
||||
self._waveform = WaveformConfig()
|
||||
self._running = False
|
||||
|
||||
# Frame queue for production RadarAcquisition → this thread
|
||||
@@ -97,6 +98,9 @@ class RadarDataWorker(QThread):
|
||||
self._byte_count = 0
|
||||
self._error_count = 0
|
||||
|
||||
def set_waveform(self, wf: "WaveformConfig") -> None:
|
||||
self._waveform = wf
|
||||
|
||||
def stop(self):
|
||||
self._running = False
|
||||
if self._acquisition:
|
||||
@@ -169,8 +173,8 @@ class RadarDataWorker(QThread):
|
||||
The FPGA already does: FFT, MTI, CFAR, DC notch.
|
||||
Host-side DSP adds: clustering, tracking, geo-coordinate mapping.
|
||||
|
||||
Bin-to-physical conversion uses WaveformConfig defaults to keep
|
||||
live and replay units aligned (same source of truth as ReplayWorker).
|
||||
Bin-to-physical conversion uses self._waveform (WaveformConfig) to keep
|
||||
live and replay units aligned. Override via set_waveform() if needed.
|
||||
"""
|
||||
targets: list[RadarTarget] = []
|
||||
|
||||
@@ -180,10 +184,9 @@ class RadarDataWorker(QThread):
|
||||
|
||||
# Extract detections from FPGA CFAR flags
|
||||
det_indices = np.argwhere(frame.detections > 0)
|
||||
wf = WaveformConfig()
|
||||
r_res = wf.range_resolution_m
|
||||
v_res = wf.velocity_resolution_mps
|
||||
n_doppler = frame.detections.shape[1] if frame.detections.ndim == 2 else 32
|
||||
r_res = self._waveform.range_resolution_m
|
||||
v_res = self._waveform.velocity_resolution_mps
|
||||
n_doppler = frame.detections.shape[1] if frame.detections.ndim == 2 else self._waveform.n_doppler_bins
|
||||
doppler_center = n_doppler // 2
|
||||
|
||||
for idx in det_indices:
|
||||
|
||||
Reference in New Issue
Block a user