send_command: Simplify "pid_autotune" parameters

This commit is contained in:
atse 2024-08-14 13:14:44 +08:00
parent 278898fad2
commit 5c8d9c7cce
2 changed files with 5 additions and 19 deletions

View File

@ -284,10 +284,7 @@
"value":20, "value":20,
"step":0.1, "step":0.1,
"format":"{value:.4f} °C", "format":"{value:.4f} °C",
"pid_autotune":[ "pid_autotune":"target_temp"
"target_temp",
"ch"
]
}, },
{ {
"name":"Test Current", "name":"Test Current",
@ -300,10 +297,7 @@
2000 2000
], ],
"suffix":"mA", "suffix":"mA",
"pid_autotune":[ "pid_autotune":"test_current"
"test_current",
"ch"
]
}, },
{ {
"name":"Temperature Swing", "name":"Temperature Swing",
@ -312,10 +306,7 @@
"step":0.1, "step":0.1,
"prefix":"±", "prefix":"±",
"format":"{value:.4f} °C", "format":"{value:.4f} °C",
"pid_autotune":[ "pid_autotune":"temp_swing"
"temp_swing",
"ch"
]
}, },
{ {
"name":"Lookback", "name":"Lookback",
@ -323,10 +314,7 @@
"value":3.0, "value":3.0,
"step":0.1, "step":0.1,
"format":"{value:.4f} s", "format":"{value:.4f} s",
"pid_autotune":[ "pid_autotune":"lookback"
"lookback",
"ch"
]
}, },
{ {
"name":"Run", "name":"Run",

View File

@ -285,9 +285,7 @@ class MainWindow(QtWidgets.QMainWindow):
inner_param.setOpts(lock=False) inner_param.setOpts(lock=False)
if "pid_autotune" in inner_param.opts: if "pid_autotune" in inner_param.opts:
auto_tuner_param = inner_param.opts["pid_autotune"][0] auto_tuner_param = inner_param.opts["pid_autotune"]
if inner_param.opts["pid_autotune"][1] != "ch":
ch = inner_param.opts["pid_autotune"][1]
self.autotuners.set_params(auto_tuner_param, ch, new_value) self.autotuners.set_params(auto_tuner_param, ch, new_value)
if "activaters" in inner_param.opts: if "activaters" in inner_param.opts: