diff --git a/pytec/pytec/gui/view/live_plot_view.py b/pytec/pytec/gui/view/live_plot_view.py index 0e1f306..2243263 100644 --- a/pytec/pytec/gui/view/live_plot_view.py +++ b/pytec/pytec/gui/view/live_plot_view.py @@ -10,8 +10,12 @@ pg.setConfigOptions(antialias=True) class LiveDataPlotter(QObject): - def __init__(self, live_plots): + def __init__(self, thermostat, live_plots): super().__init__() + self._thermostat = thermostat + + self._thermostat.report_update.connect(self.update_report) + self._thermostat.pid_update.connect(self.update_pid) self.NUM_CHANNELS = len(live_plots) self.graphs = [] diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index 7d8c679..ab91f62 100755 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -117,15 +117,13 @@ class MainWindow(QtWidgets.QMainWindow): ) self.channel_graphs = LiveDataPlotter( + self.thermostat, [ [getattr(self, f"ch{ch}_t_graph"), getattr(self, f"ch{ch}_i_graph")] for ch in range(self.NUM_CHANNELS) ] ) - self.thermostat.report_update.connect(self.channel_graphs.update_report) - self.thermostat.pid_update.connect(self.channel_graphs.update_pid) - self.plot_options_menu = PlotOptionsMenu(self.channel_graphs) self.plot_settings.setMenu(self.plot_options_menu)