This commit is contained in:
atse 2023-08-23 14:53:00 +08:00
parent ef87225339
commit 4c839f079b

View File

@ -133,10 +133,10 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
'suffix': '°C', 'param': [('pid', ch, 'target')]},
]},
{'name': 'Output Config', 'expanded': False, 'type': 'group', 'children': [
{'name': 'Max Current', 'type': 'float', 'value': 0, 'step': 0.1, 'limits': (0, 3), 'siPrefix': True, 'prefix': '±',
{'name': 'Max Absolute Current', 'type': 'float', 'value': 0, 'step': 0.1, 'limits': (0, 3), 'siPrefix': True,
'suffix': 'A', 'commands': [f'pwm {ch} max_i_pos {{value}}', f'pwm {ch} max_i_neg {{value}}',
f'pid {ch} output_min -{{value}}', f'pid {ch} output_max {{value}}']},
{'name': 'Max Voltage', 'type': 'float', 'value': 0, 'step': 0.1, 'limits': (0, 5), 'siPrefix': True,
{'name': 'Max Absolute Voltage', 'type': 'float', 'value': 0, 'step': 0.1, 'limits': (0, 5), 'siPrefix': True,
'suffix': 'V', 'param': [('pwm', ch, 'max_v')]},
]},
{'name': 'Thermistor Config', 'expanded': False, 'type': 'group', 'children': [
@ -642,8 +642,8 @@ 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", "Max Voltage").setValue(pwm_params["max_v"]["value"])
self.params[channel].child("Output Config", "Max Current").setValue(pwm_params["max_i_pos"]["value"])
self.params[channel].child("Output Config", "Max Absolute Voltage").setValue(pwm_params["max_v"]["value"])
self.params[channel].child("Output Config", "Max Absolute Current").setValue(pwm_params["max_i_pos"]["value"])
@pyqtSlot(list)
def update_postfilter(self, postfilter_data):