forked from M-Labs/thermostat
Move channelGraph stuff inside LiveDataPlotter
This commit is contained in:
parent
0cf685a3a1
commit
bb2ca2c7f8
@ -10,8 +10,12 @@ pg.setConfigOptions(antialias=True)
|
|||||||
|
|
||||||
|
|
||||||
class LiveDataPlotter(QObject):
|
class LiveDataPlotter(QObject):
|
||||||
def __init__(self, live_plots):
|
def __init__(self, thermostat, live_plots):
|
||||||
super().__init__()
|
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.NUM_CHANNELS = len(live_plots)
|
||||||
self.graphs = []
|
self.graphs = []
|
||||||
|
@ -115,15 +115,13 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
)
|
)
|
||||||
|
|
||||||
self.channel_graphs = LiveDataPlotter(
|
self.channel_graphs = LiveDataPlotter(
|
||||||
|
self.thermostat,
|
||||||
[
|
[
|
||||||
[getattr(self, f"ch{ch}_t_graph"), getattr(self, f"ch{ch}_i_graph")]
|
[getattr(self, f"ch{ch}_t_graph"), getattr(self, f"ch{ch}_i_graph")]
|
||||||
for ch in range(self.NUM_CHANNELS)
|
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_options_menu = PlotOptionsMenu(self.channel_graphs)
|
||||||
self.plot_settings.setMenu(self.plot_options_menu)
|
self.plot_settings.setMenu(self.plot_options_menu)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user