Move sigActivatedHandle to CtrlPanel

This commit is contained in:
atse 2024-08-26 15:22:41 +08:00
parent e82e561d14
commit 7e235c3fea
2 changed files with 12 additions and 11 deletions

View File

@ -59,6 +59,12 @@ class CtrlPanel(QObject):
for ch, param in enumerate(self.params): for ch, param in enumerate(self.params):
param.sigTreeStateChanged.connect(self.send_command) 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]: for handle in sigActivated_handles[ch]:
param.child(*handle[0]).sigActivated.connect(handle[1]) param.child(*handle[0]).sigActivated.connect(handle[1])
@ -86,6 +92,12 @@ class CtrlPanel(QObject):
font.setBold(True) font.setBold(True)
item.setFont(0, font) 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): def change_params_title(self, channel, path, title):
self.params[channel].child(*path).setOpts(title=title) self.params[channel].child(*path).setOpts(title=title)

View File

@ -83,8 +83,6 @@ class MainWindow(QtWidgets.QMainWindow):
param_tree_sigActivated_handles = [ param_tree_sigActivated_handles = [
[ [
[["save"], partial(self.thermostat.save_cfg, ch)],
[["load"], partial(self.thermostat.load_cfg, ch)],
[ [
["pid", "pid_autotune", "run_pid"], ["pid", "pid_autotune", "run_pid"],
partial(self.pid_autotune_request, ch), partial(self.pid_autotune_request, ch),
@ -110,17 +108,8 @@ class MainWindow(QtWidgets.QMainWindow):
) )
self.thermostat.fan_update.connect(self.fan_update) 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.autotuners.tick)
self.thermostat.report_update.connect(self.pid_autotune_handler) 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.thermostat.interval_update.connect(
self.autotuners.update_sampling_interval self.autotuners.update_sampling_interval
) )