From bf0cb9ef0515e3ae51c19a0860d60ab6cf7afa9c Mon Sep 17 00:00:00 2001 From: atse Date: Mon, 16 Oct 2023 11:28:13 +0800 Subject: [PATCH] Improve name --- pytec/tec_qt.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index 51c5a76..b6922c3 100644 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -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: