Move channelGraph stuff inside LiveDataPlotter

This commit is contained in:
atse 2024-08-27 15:43:19 +08:00
parent 0cf685a3a1
commit bb2ca2c7f8
2 changed files with 6 additions and 4 deletions

View File

@ -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 = []

View File

@ -115,15 +115,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)