From 3eef7e9e372550df73671ad2abca8796d81e182d Mon Sep 17 00:00:00 2001 From: atse Date: Mon, 7 Oct 2024 16:23:26 +0800 Subject: [PATCH] ctrl_panel: Add polarity option in output settings --- pytec/pytec/gui/view/ctrl_panel.py | 3 +++ pytec/pytec/gui/view/param_tree.json | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/pytec/pytec/gui/view/ctrl_panel.py b/pytec/pytec/gui/view/ctrl_panel.py index b3a9294..97bf2ac 100644 --- a/pytec/pytec/gui/view/ctrl_panel.py +++ b/pytec/pytec/gui/view/ctrl_panel.py @@ -229,6 +229,9 @@ class CtrlPanel(QObject): 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"]) diff --git a/pytec/pytec/gui/view/param_tree.json b/pytec/pytec/gui/view/param_tree.json index 28ce704..c93ef36 100644 --- a/pytec/pytec/gui/view/param_tree.json +++ b/pytec/pytec/gui/view/param_tree.json @@ -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" } ] - } \ No newline at end of file + }