feat: добавил обработку признака технологического графика и проверку наличия сигнала в датафрейме
This commit is contained in:
parent
b2458bec15
commit
3eb030cb2d
@ -12,6 +12,7 @@ class PlotWidget(BasePlotWidget):
|
|||||||
layout = QVBoxLayout()
|
layout = QVBoxLayout()
|
||||||
|
|
||||||
time_axis = dataframe["time"]
|
time_axis = dataframe["time"]
|
||||||
|
print(max(time_axis))
|
||||||
|
|
||||||
for channel, signals in self._plot_channels.items():
|
for channel, signals in self._plot_channels.items():
|
||||||
plot_widget = pg.PlotWidget(title=channel)
|
plot_widget = pg.PlotWidget(title=channel)
|
||||||
@ -20,12 +21,13 @@ class PlotWidget(BasePlotWidget):
|
|||||||
legend.setParentItem(plot_widget.graphicsItem())
|
legend.setParentItem(plot_widget.graphicsItem())
|
||||||
|
|
||||||
for signal in signals:
|
for signal in signals:
|
||||||
plot = plot_widget.plot(time_axis, dataframe[signal["name"]], pen=signal["pen"])
|
if signal["name"] in dataframe.columns.tolist():
|
||||||
if signal["zoom"]:
|
plot = plot_widget.plot(time_axis, dataframe[signal["name"]], pen=signal["pen"])
|
||||||
max_value = max(dataframe[signal["name"]])
|
if signal["zoom"] and max(time_axis) < 5.0:
|
||||||
plot_widget.setYRange(max_value - 150, max_value)
|
max_value = max(dataframe[signal["name"]])
|
||||||
plot_widget.setInteractive(False)
|
plot_widget.setYRange(max_value - 200, max_value)
|
||||||
legend.addItem(plot, signal["name"])
|
plot_widget.setInteractive(False)
|
||||||
|
legend.addItem(plot, signal["name"])
|
||||||
|
|
||||||
layout.addWidget(plot_widget)
|
layout.addWidget(plot_widget)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user