feat: добавил обработку признака технологического графика и проверку наличия сигнала в датафрейме

This commit is contained in:
Андрей Скирченко 2024-11-14 20:59:21 +03:00
parent b2458bec15
commit 3eb030cb2d

View File

@ -12,6 +12,7 @@ class PlotWidget(BasePlotWidget):
layout = QVBoxLayout()
time_axis = dataframe["time"]
print(max(time_axis))
for channel, signals in self._plot_channels.items():
plot_widget = pg.PlotWidget(title=channel)
@ -20,12 +21,13 @@ class PlotWidget(BasePlotWidget):
legend.setParentItem(plot_widget.graphicsItem())
for signal in signals:
plot = plot_widget.plot(time_axis, dataframe[signal["name"]], pen=signal["pen"])
if signal["zoom"]:
max_value = max(dataframe[signal["name"]])
plot_widget.setYRange(max_value - 150, max_value)
plot_widget.setInteractive(False)
legend.addItem(plot, signal["name"])
if signal["name"] in dataframe.columns.tolist():
plot = plot_widget.plot(time_axis, dataframe[signal["name"]], pen=signal["pen"])
if signal["zoom"] and max(time_axis) < 5.0:
max_value = max(dataframe[signal["name"]])
plot_widget.setYRange(max_value - 200, max_value)
plot_widget.setInteractive(False)
legend.addItem(plot, signal["name"])
layout.addWidget(plot_widget)