send_command: Simplify "pid_autotune" parameters

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

View File

@ -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",

View File

@ -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: