Improve name

This commit is contained in:
atse 2023-10-16 11:28:13 +08:00
parent d60172d7eb
commit bf0cb9ef05

View File

@ -220,11 +220,11 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
'suffix': '°C', 'param': ('pid', ch, 'target')},
]},
{'name': 'Limits', 'expanded': False, 'type': 'group', 'children': [
{'name': 'Max Current', 'type': 'float', 'value': 0, 'step': 100, 'decimals': 6, 'limits': (0, 3000),
{'name': 'Max Cooling Current', 'type': 'float', 'value': 0, 'step': 100, 'decimals': 6, 'limits': (0, 3000),
'suffix': 'mA', 'param': ('pwm', ch, 'max_i_pos')},
{'name': 'Min Current', 'type': 'float', 'value': 0, 'step': 100, 'decimals': 6, 'limits': (-3000, 0),
'suffix': 'mA', 'param': ('pwm', ch, 'max_i_neg', '-')},
{'name': 'Max Absolute Voltage', 'type': 'float', 'value': 0, 'step': 0.1, 'limits': (0, 5), 'siPrefix': True,
{'name': 'Max Heating Current', 'type': 'float', 'value': 0, 'step': 100, 'decimals': 6, 'limits': (0, 3000),
'suffix': 'mA', 'param': ('pwm', ch, 'max_i_neg')},
{'name': 'Max Voltage Difference', 'type': 'float', 'value': 0, 'step': 0.1, 'limits': (0, 5), 'siPrefix': True,
'suffix': 'V', 'param': ('pwm', ch, 'max_v')},
]}
]},
@ -664,15 +664,10 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
if inner_param.opts.get("param", None) is not None:
if inner_param.name() == 'Control Method' and not data:
return
thermostat_param = inner_param.opts["param"]
if 'Current' in inner_param.name():
data /= 1000 # Given in mA
if len(thermostat_param) == 4:
if thermostat_param[3] == '-':
data = -data
thermostat_param = thermostat_param[:3]
thermostat_param = inner_param.opts["param"]
if inner_param.name() == 'Postfilter Rate':
set_param_args = (*thermostat_param, *data)
elif inner_param.name() == 'Control Method':
@ -821,9 +816,9 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
for pwm_params in pwm_data:
channel = pwm_params["channel"]
with QSignalBlocker(self.params[channel]):
self.params[channel].child("Output Config", "Limits", "Max Absolute Voltage").setValue(pwm_params["max_v"]["value"])
self.params[channel].child("Output Config", "Limits", "Max Current").setValue(pwm_params["max_i_pos"]["value"] * 1000)
self.params[channel].child("Output Config", "Limits", "Min Current").setValue(-pwm_params["max_i_neg"]["value"] * 1000)
self.params[channel].child("Output Config", "Limits", "Max Voltage Difference").setValue(pwm_params["max_v"]["value"])
self.params[channel].child("Output Config", "Limits", "Max Cooling Current").setValue(pwm_params["max_i_pos"]["value"] * 1000)
self.params[channel].child("Output Config", "Limits", "Max Heating Current").setValue(pwm_params["max_i_neg"]["value"] * 1000)
for limit in "max_i_pos", "max_i_neg", "max_v":
if pwm_params[limit]["value"] == 0.0: