From 6f5dfafbfbce0bd95f609ed0cca60864308f24fd Mon Sep 17 00:00:00 2001 From: awe Date: Tue, 3 Feb 2026 19:06:26 +0300 Subject: [PATCH] fix matplotlib --- rfg_adc_plotter/visualization/matplotlib_backend.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rfg_adc_plotter/visualization/matplotlib_backend.py b/rfg_adc_plotter/visualization/matplotlib_backend.py index f3d56f8..e1c8878 100644 --- a/rfg_adc_plotter/visualization/matplotlib_backend.py +++ b/rfg_adc_plotter/visualization/matplotlib_backend.py @@ -67,6 +67,10 @@ def run_matplotlib(args): ref_in_file = getattr(args, 'ref_in', None) ref_out_saved = False # Флаг, что медиана уже сохранена + # DEBUG: Проверяем что параметр установлен + if ref_out_file: + print(f"[ref-out] Автосохранение включено, файл: {ref_out_file}") + # Автоматическая загрузка медианы при старте if ref_in_file: try: @@ -593,12 +597,17 @@ def run_matplotlib(args): # Автоматическое сохранение медианы при накоплении 1000+ свипов if ref_out_file and not ref_out_saved and ring is not None: filled_count = np.count_nonzero(~np.isnan(ring[:, 0])) + # DEBUG: Выводим прогресс каждые 100 свипов + if filled_count % 100 == 0 and filled_count > 0: + print(f"[ref-out] Прогресс: {filled_count}/1000 свипов накоплено") if filled_count >= 1000: + print(f"[ref-out] Достигнуто 1000 свипов, начинаем сохранение...") try: # Получаем последние 1000 свипов ordered = ring if head == 0 else np.roll(ring, -head, axis=0) recent_sweeps = ordered[-1000:, :] median_sweep = np.nanmedian(recent_sweeps, axis=0) + print(f"[ref-out] Медиана вычислена, размер: {len(median_sweep)}") # Сохраняем в файл with open(ref_out_file, 'w', newline='') as f: