Compare commits

...

2 Commits

Author SHA1 Message Date
3eef7e9e37 ctrl_panel: Add polarity option in output settings 2024-10-07 16:35:23 +08:00
ed9d067bee QVariantList -> list 2024-10-07 16:35:20 +08:00
3 changed files with 22 additions and 7 deletions

View File

@ -165,7 +165,7 @@ class CtrlPanel(QObject):
auto_tuner_param = inner_param.opts["pid_autotune"]
self.autotuners.set_params(auto_tuner_param, ch, new_value)
@pyqtSlot("QVariantList")
@pyqtSlot(list)
def update_pid(self, pid_settings):
for settings in pid_settings:
channel = settings["channel"]
@ -189,7 +189,7 @@ class CtrlPanel(QObject):
"Output Config", "Control Method", "Set Temperature"
).setValue(settings["target"])
@pyqtSlot("QVariantList")
@pyqtSlot(list)
def update_report(self, report_data):
for settings in report_data:
channel = settings["channel"]
@ -209,7 +209,7 @@ class CtrlPanel(QObject):
settings["tec_i"] * 1000
)
@pyqtSlot("QVariantList")
@pyqtSlot(list)
def update_thermistor(self, sh_data):
for sh_param in sh_data:
channel = sh_param["channel"]
@ -224,11 +224,14 @@ class CtrlPanel(QObject):
sh_param["params"]["b"]
)
@pyqtSlot("QVariantList")
@pyqtSlot(list)
def update_pwm(self, pwm_data):
for pwm_params in pwm_data:
channel = pwm_params["channel"]
with QSignalBlocker(self.params[channel]):
self.params[channel].child(
"Output Config", "Polarity"
).setValue(pwm_params["polarity"])
self.params[channel].child(
"Output Config", "Limits", "Max Voltage Difference"
).setValue(pwm_params["max_v"]["value"])
@ -239,7 +242,7 @@ class CtrlPanel(QObject):
"Output Config", "Limits", "Max Heating Current"
).setValue(pwm_params["max_i_neg"]["value"] * 1000)
@pyqtSlot("QVariantList")
@pyqtSlot(list)
def update_postfilter(self, postfilter_data):
for postfilter_params in postfilter_data:
channel = postfilter_params["channel"]

View File

@ -18,6 +18,18 @@
"expanded":true,
"type":"group",
"children":[
{
"name": "Polarity",
"type": "list",
"limits": {
"Normal": "normal",
"Reversed": "reversed"
},
"thermostat:set_param": {
"topic": "pwm",
"field": "polarity"
}
},
{
"name":"Control Method",
"type":"mutex",
@ -332,4 +344,4 @@
"tip":"Load config from flash"
}
]
}
}

View File

@ -10,7 +10,7 @@ class ZeroLimitsWarningView(QObject):
self._lbl = limit_warning
self._style = style
@pyqtSlot("QVariantList")
@pyqtSlot(list)
def set_limits_warning(self, pwm_data: list):
channels_zeroed_limits = [set() for i in range(self._thermostat.NUM_CHANNELS)]