This commit is contained in:
awe
2026-04-27 18:28:56 +03:00
parent c40df97085
commit 75bc502fe1
4 changed files with 74 additions and 16 deletions

View File

@ -7,7 +7,7 @@ from typing import Optional
import numpy as np
from rfg_adc_plotter.constants import FFT_LEN, SWEEP_FREQ_MAX_GHZ, SWEEP_FREQ_MIN_GHZ, WF_WIDTH
from rfg_adc_plotter.constants import FFT_LEN, SWEEP_FREQ_MAX_GHZ, SWEEP_FREQ_MIN_GHZ
from rfg_adc_plotter.processing.fft import compute_distance_axis, compute_fft_mag_row, fft_mag_to_db
@ -93,7 +93,7 @@ class RingBuffer:
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))
target_width = max(1, int(sweep_width))
changed = False
if self.ring is None or self.ring_time is None or self.ring_fft is None:
self.width = target_width