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
1 changed files with 3 additions and 3 deletions
Showing only changes of commit be77a6f205 - Show all commits

View File

@ -266,7 +266,7 @@ class MainWindow(QtWidgets.QMainWindow):
for inner_param, change, data in changes: for inner_param, change, data in changes:
if change == "value": if change == "value":
if inner_param.opts.get("param", None) is not None: if "param" in inner_param.opts:
if inner_param.opts.get("suffix", None) == "mA": if inner_param.opts.get("suffix", None) == "mA":
data /= 1000 # Given in mA data /= 1000 # Given in mA
@ -282,13 +282,13 @@ class MainWindow(QtWidgets.QMainWindow):
await self.client.set_param(*set_param_args) await self.client.set_param(*set_param_args)
param.child(*param.childPath(inner_param)).setOpts(lock=False) param.child(*param.childPath(inner_param)).setOpts(lock=False)
if inner_param.opts.get("pid_autotune", None) is not None: if "pid_autotune" in inner_param.opts:
auto_tuner_param = inner_param.opts["pid_autotune"][0] auto_tuner_param = inner_param.opts["pid_autotune"][0]
if inner_param.opts["pid_autotune"][1] != "ch": if inner_param.opts["pid_autotune"][1] != "ch":
ch = inner_param.opts["pid_autotune"][1] ch = inner_param.opts["pid_autotune"][1]
self.autotuners.set_params(auto_tuner_param, ch, data) self.autotuners.set_params(auto_tuner_param, ch, data)
if inner_param.opts.get("activaters", None) is not None: if "activaters" in inner_param.opts:
activater = inner_param.opts["activaters"][ activater = inner_param.opts["activaters"][
inner_param.opts["limits"].index(data) inner_param.opts["limits"].index(data)
] ]