fix: добавлена обработка исключения (трейс начинается не с oncoming)

This commit is contained in:
Andrew 2024-12-09 17:24:30 +03:00
parent 8968e3d57a
commit 4262450df1
6 changed files with 7 additions and 5 deletions

View File

@ -51,7 +51,7 @@
0.075
],
"time_capture": [
100000.0
1000.0
],
"UML_time_scaler": [
1000.0

View File

@ -50,6 +50,8 @@ class PassportFormer(BasePointPassportFormer):
time_is_valid = not dataframe["time"].isna().all()
if time_is_valid:
idx_shift = True if events[self._stages[-1]][1][0] == 0 else False
for i in range(point_quantity):
operator_settings = {
@ -65,7 +67,8 @@ class PassportFormer(BasePointPassportFormer):
ideal_data = self._build_ideal_data(idealDataBuilder=idealDataBuilder, params=params_list)
self._ideal_data_cashe[cache_key] = ideal_data
print(f"Cache miss. Computed and cached.")
point_timeframe = [events[self._stages[0]][0][i], events[self._stages[-1]][1][i+1]]
idx = i+1 if idx_shift else i
point_timeframe = [events[self._stages[0]][0][i], events[self._stages[-1]][1][idx]]
point_events = {key: [value[0][i], value[1][i]] for key, value in events.items()}

View File

@ -3,9 +3,7 @@ from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel
import pyqtgraph as pg
import numpy as np
from typing import Optional, Any
from PyQt5.QtOpenGL import QGLWidget
from utils.base.base import BasePlotWidget
@ -104,6 +102,7 @@ class PlotWidget(BasePlotWidget):
# Оптимизация отображения графиков
plot_widget.setDownsampling(auto=True, mode='peak')
plot_widget.showGrid(x=True, y=True)
plot_widget.setClipToView(True)
legend = pg.LegendItem((80, 60), offset=(70, 20))
legend.setParentItem(plot_widget.graphicsItem())
return plot_widget, legend
@ -198,7 +197,7 @@ class PlotWidget(BasePlotWidget):
Собирает графический виджет для одного набора данных.
Параметр `data` предполагается списком: [dataframe, points_pocket, tesla_time].
"""
widget = QGLWidget()
widget = QWidget()
layout = QVBoxLayout(widget)
dataframe, points_pocket, tesla_time = data