feat: добавил обработку признака технологического графика и проверку наличия сигнала в датафрейме
This commit is contained in:
parent
b2458bec15
commit
3eb030cb2d
@ -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)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user