fix graph and white background added

This commit is contained in:
Ayzen
2026-10-15 14:46:06 +03:00
parent 5102ed751c
commit 9a9b8ce5c7
35 changed files with 730 additions and 463 deletions
@@ -209,6 +209,44 @@ class FedBackSweepsTest(_ProcessorTestCase):
self._live_writer.write(self._live)
self.assertEqual(self._published_ids(_SWEEPS), expected)
def test_sweep_failing_to_recompute_does_not_stall_new_input(self) -> None:
self._live.processor_mode = "gpr"
self._live.gpr_input_positions = self._live.gpr_output_positions = [0]
self._live.gpr_background_subtract_enabled = False
self._live.tx_geometry = [{"output_pos": 0, "x_m": 0.0, "y_m": 0.0, "z_m": 0.0}]
self._live.rx_geometry = [{"input_pos": 0, "x_m": 0.0, "y_m": 0.0, "z_m": 0.0}]
self._live_writer.write(self._live)
start = time.monotonic_ns()
self._push([_sweep(1, start)])
self._result_for_revision(0, 1)
failing = _sweep(2, start + 1_000_000)
failing.traces[0].capture_end_ns = failing.traces[0].capture_start_ns # GPR rejects an empty trace window
self._push([failing])
deadline = time.monotonic() + _TIMEOUT_S
while self._input._read_u64(32) != self._input._read_u64(24): # now the newest retained sweep
self.assertLess(time.monotonic(), deadline, self._stderr_path.read_text())
time.sleep(.01)
# Both arrive while the processor is stopped past its 100 ms live-file check, so on
# resuming it recomputes that failing sweep before it takes the next one.
self._processor.send_signal(signal.SIGSTOP)
os.waitpid(self._processor.pid, os.WUNTRACED)
try:
self._live.settings_revision = 1
self._live_writer.write(self._live)
self._push([_sweep(3, start + 2_000_000)])
time.sleep(.2)
finally:
self._processor.send_signal(signal.SIGCONT)
self._result_for_revision(1, 3)
def test_bscan_band_without_two_sweep_points_gives_an_empty_profile(self) -> None:
self._live.bscan_start_freq_mhz, self._live.bscan_stop_freq_mhz = 7000.0, 8000.0 # sweep is 1-6 GHz
self._live.settings_revision = 1
self._live_writer.write(self._live)
self._push([_sweep(1, time.monotonic_ns())])
payload = self._result_for_revision(1, 1).blocks[0].payloads[0]
self.assertEqual((payload.processing_name, payload.frequency_hz.size, payload.trace.size), ("bscan", 0, 0))
def test_live_geometry_recomputes_retained_gpr_without_restarting(self) -> None:
self._live.processor_mode = "gpr"
self._live.gpr_input_positions = [0]