From 288b94352b9b2138bf75c744301e0c50a4fa85ba Mon Sep 17 00:00:00 2001 From: atse Date: Tue, 16 Jul 2024 11:29:41 +0800 Subject: [PATCH] Expand PID Settings on PID engage --- pytec/pytec/gui/view/ctrl_panel.py | 7 +++++++ pytec/pytec/gui/view/param_tree.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pytec/pytec/gui/view/ctrl_panel.py b/pytec/pytec/gui/view/ctrl_panel.py index c702a7b..f9de8af 100644 --- a/pytec/pytec/gui/view/ctrl_panel.py +++ b/pytec/pytec/gui/view/ctrl_panel.py @@ -57,6 +57,13 @@ class CtrlPanel(QObject): for handle in sigActivated_handles[ch]: param.child(*handle[0]).sigActivated.connect(handle[1]) + self.params[ch].child("output", "control_method").sigValueChanged.connect( + lambda param, value: param.parent() + .parent() + .child("pid") + .setOpts(expanded=(value == "temperature_pid")) + ) + def _indicate_usage(param, control_method="constant_current"): for item in param.child("i_set").items: is_constant_current = control_method == "constant_current" diff --git a/pytec/pytec/gui/view/param_tree.json b/pytec/pytec/gui/view/param_tree.json index 1c14479..e2d531b 100644 --- a/pytec/pytec/gui/view/param_tree.json +++ b/pytec/pytec/gui/view/param_tree.json @@ -281,7 +281,7 @@ { "name": "pid", "title": "PID Settings", - "expanded": true, + "expanded": false, "type": "group", "tip": "Settings of PID parameters and clamping", "children": [