cut the range feature

This commit is contained in:
awe
2026-03-12 18:50:26 +03:00
parent 5054f8d3d7
commit b70df8c1bd
6 changed files with 307 additions and 26 deletions

View File

@ -38,6 +38,20 @@ class RingBuffer:
def fft_symmetric(self) -> bool:
return self.fft_mode == "symmetric"
def reset(self) -> None:
"""Drop all buffered sweeps and derived FFT state."""
self.width = 0
self.head = 0
self.ring = None
self.ring_time = None
self.ring_fft = None
self.x_shared = None
self.distance_axis = None
self.last_fft_db = None
self.last_freqs = None
self.y_min_fft = None
self.y_max_fft = None
def ensure_init(self, sweep_width: int) -> bool:
"""Allocate or resize buffers. Returns True when geometry changed."""
target_width = max(int(sweep_width), int(WF_WIDTH))

View File

@ -14,6 +14,10 @@ from rfg_adc_plotter.types import SweepAuxCurves, SweepInfo
@dataclass
class RuntimeState:
ring: RingBuffer
range_min_ghz: float = 0.0
range_max_ghz: float = 0.0
full_current_freqs: Optional[np.ndarray] = None
full_current_sweep_raw: Optional[np.ndarray] = None
current_freqs: Optional[np.ndarray] = None
current_distances: Optional[np.ndarray] = None
current_sweep_raw: Optional[np.ndarray] = None