implemented lost data ignoration. (control by IGNORE_LOST)
This commit is contained in:
10
main.py
10
main.py
@ -61,6 +61,9 @@ GAP_THRESHOLD_MULTIPLIER = 1.5
|
||||
# Начальное время опроса файлов (в миллисекундах)
|
||||
DEFAULT_FILE_POLL_INTERVAL_MS = 80 # 100 мс
|
||||
|
||||
# Игнорировать пропущенные данные (не добавлять GAP-колонки)
|
||||
IGNORE_LOST = True
|
||||
|
||||
|
||||
# ================================================================================
|
||||
# ВСПОМОГАТЕЛЬНЫЕ ФУНКЦИИ
|
||||
@ -322,6 +325,9 @@ class DataAnalyzerApp:
|
||||
os.makedirs(self.data_dir, exist_ok=True)
|
||||
os.chdir(self.data_dir)
|
||||
|
||||
# Настройка: игнорировать пропуски кадров
|
||||
self.ignore_lost = IGNORE_LOST
|
||||
|
||||
# Инициализируем с существующими файлами
|
||||
existing_files = sorted([
|
||||
f for f in os.listdir()
|
||||
@ -1006,11 +1012,13 @@ class DataAnalyzerApp:
|
||||
|
||||
timestamp = datetime.now().strftime("%H:%M:%S.%f")[:-3]
|
||||
print(
|
||||
f"[{timestamp}] ⚠️ Gap detected: {time_diff_ms:.1f}ms (missing ~{missing_count} columns, threshold: {self.time_gap_threshold_ms:.0f}ms)")
|
||||
f"[{timestamp}] ⚠️ Gap detected: {time_diff_ms:.1f}ms (missing ~{missing_count} columns, threshold: {self.time_gap_threshold_ms:.0f}ms)"
|
||||
+ (" — ignored" if self.ignore_lost else ""))
|
||||
|
||||
# ✓ ИСПРАВЛЕНИЕ: Увеличиваем счётчик пропущенных кадров
|
||||
self.gap_frames_count += missing_count
|
||||
|
||||
if not self.ignore_lost:
|
||||
last_size = len(self.B_scan_data[-1]) if self.B_scan_data else height
|
||||
for i in range(missing_count):
|
||||
zero_col = np.zeros(last_size)
|
||||
|
||||
Reference in New Issue
Block a user