From 7e235c3fea74eb4f1d4f1b0ba06319de6ebaf067 Mon Sep 17 00:00:00 2001 From: atse Date: Mon, 26 Aug 2024 15:22:41 +0800 Subject: [PATCH] Move sigActivatedHandle to CtrlPanel --- pytec/pytec/gui/view/ctrl_panel.py | 12 ++++++++++++ pytec/tec_qt.py | 11 ----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pytec/pytec/gui/view/ctrl_panel.py b/pytec/pytec/gui/view/ctrl_panel.py index 2ef9061..94f4400 100644 --- a/pytec/pytec/gui/view/ctrl_panel.py +++ b/pytec/pytec/gui/view/ctrl_panel.py @@ -59,6 +59,12 @@ class CtrlPanel(QObject): for ch, param in enumerate(self.params): param.sigTreeStateChanged.connect(self.send_command) + param.child("save").sigActivated.connect( + partial(self.thermostat.save_cfg, ch) + ) + param.child("load").sigActivated.connect( + partial(self.thermostat.load_cfg, ch) + ) for handle in sigActivated_handles[ch]: param.child(*handle[0]).sigActivated.connect(handle[1]) @@ -86,6 +92,12 @@ class CtrlPanel(QObject): font.setBold(True) item.setFont(0, font) + self.thermostat.pid_update.connect(self.update_pid) + self.thermostat.report_update.connect(self.update_report) + self.thermostat.thermistor_update.connect(self.update_thermistor) + self.thermostat.pwm_update.connect(self.update_pwm) + self.thermostat.postfilter_update.connect(self.update_postfilter) + def change_params_title(self, channel, path, title): self.params[channel].child(*path).setOpts(title=title) diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index 68ea433..f595d88 100755 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -83,8 +83,6 @@ class MainWindow(QtWidgets.QMainWindow): param_tree_sigActivated_handles = [ [ - [["save"], partial(self.thermostat.save_cfg, ch)], - [["load"], partial(self.thermostat.load_cfg, ch)], [ ["pid", "pid_autotune", "run_pid"], partial(self.pid_autotune_request, ch), @@ -110,17 +108,8 @@ class MainWindow(QtWidgets.QMainWindow): ) self.thermostat.fan_update.connect(self.fan_update) - self.thermostat.report_update.connect(self.ctrl_panel_view.update_report) self.thermostat.report_update.connect(self.autotuners.tick) self.thermostat.report_update.connect(self.pid_autotune_handler) - self.thermostat.pid_update.connect(self.ctrl_panel_view.update_pid) - self.thermostat.pwm_update.connect(self.ctrl_panel_view.update_pwm) - self.thermostat.thermistor_update.connect( - self.ctrl_panel_view.update_thermistor - ) - self.thermostat.postfilter_update.connect( - self.ctrl_panel_view.update_postfilter - ) self.thermostat.interval_update.connect( self.autotuners.update_sampling_interval )