From 3eb030cb2d69cff9e085c9713017fceb00984ac7 Mon Sep 17 00:00:00 2001 From: andrei Date: Thu, 14 Nov 2024 20:59:21 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA=D1=83?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=D0=B7=D0=BD=D0=B0=D0=BA=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B5=D1=85=D0=BD=D0=BE=D0=BB=D0=BE=D0=B3=D0=B8=D1=87=D0=B5?= =?UTF-8?q?=D1=81=D0=BA=D0=BE=D0=B3=D0=BE=20=D0=B3=D1=80=D0=B0=D1=84=D0=B8?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B8=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80?= =?UTF-8?q?=D0=BA=D1=83=20=D0=BD=D0=B0=D0=BB=D0=B8=D1=87=D0=B8=D1=8F=20?= =?UTF-8?q?=D1=81=D0=B8=D0=B3=D0=BD=D0=B0=D0=BB=D0=B0=20=D0=B2=20=D0=B4?= =?UTF-8?q?=D0=B0=D1=82=D0=B0=D1=84=D1=80=D0=B5=D0=B9=D0=BC=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gui/widgets/plot.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gui/widgets/plot.py b/src/gui/widgets/plot.py index 0b2a22a..8bfec83 100644 --- a/src/gui/widgets/plot.py +++ b/src/gui/widgets/plot.py @@ -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)