GUI: Refactor send_command #4

Merged
linuswck merged 6 commits from gui_dev-refactor-send_command into gui_dev 2024-10-07 13:03:38 +08:00
2 changed files with 5 additions and 19 deletions
Showing only changes of commit 5c8d9c7cce - Show all commits

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: