From 5c8d9c7cce56598b955c0a1d01b0fab056d38a3b Mon Sep 17 00:00:00 2001 From: atse Date: Wed, 14 Aug 2024 13:14:44 +0800 Subject: [PATCH] send_command: Simplify "pid_autotune" parameters --- pytec/pytec/gui/view/param_tree.json | 20 ++++---------------- pytec/tec_qt.py | 4 +--- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/pytec/pytec/gui/view/param_tree.json b/pytec/pytec/gui/view/param_tree.json index bf490dc..fff0a0d 100644 --- a/pytec/pytec/gui/view/param_tree.json +++ b/pytec/pytec/gui/view/param_tree.json @@ -284,10 +284,7 @@ "value":20, "step":0.1, "format":"{value:.4f} °C", - "pid_autotune":[ - "target_temp", - "ch" - ] + "pid_autotune":"target_temp" }, { "name":"Test Current", @@ -300,10 +297,7 @@ 2000 ], "suffix":"mA", - "pid_autotune":[ - "test_current", - "ch" - ] + "pid_autotune":"test_current" }, { "name":"Temperature Swing", @@ -312,10 +306,7 @@ "step":0.1, "prefix":"±", "format":"{value:.4f} °C", - "pid_autotune":[ - "temp_swing", - "ch" - ] + "pid_autotune":"temp_swing" }, { "name":"Lookback", @@ -323,10 +314,7 @@ "value":3.0, "step":0.1, "format":"{value:.4f} s", - "pid_autotune":[ - "lookback", - "ch" - ] + "pid_autotune":"lookback" }, { "name":"Run", diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index bb9f60e..70103fa 100644 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -285,9 +285,7 @@ class MainWindow(QtWidgets.QMainWindow): inner_param.setOpts(lock=False) if "pid_autotune" in inner_param.opts: - auto_tuner_param = inner_param.opts["pid_autotune"][0] - if inner_param.opts["pid_autotune"][1] != "ch": - ch = inner_param.opts["pid_autotune"][1] + auto_tuner_param = inner_param.opts["pid_autotune"] self.autotuners.set_params(auto_tuner_param, ch, new_value) if "activaters" in inner_param.opts: