forked from M-Labs/thermostat
More general activater
This commit is contained in:
parent
d8b1e7e964
commit
da794080c6
@ -212,8 +212,8 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||||||
{'name': 'Temperature', 'type': 'float', 'suffix': '°C', 'decimals': 6, 'readonly': True},
|
{'name': 'Temperature', 'type': 'float', 'suffix': '°C', 'decimals': 6, 'readonly': True},
|
||||||
{'name': 'Current through TEC', 'type': 'float', 'suffix': 'mA', 'decimals': 6, 'readonly': True},
|
{'name': 'Current through TEC', 'type': 'float', 'suffix': 'mA', 'decimals': 6, 'readonly': True},
|
||||||
{'name': 'Output Config', 'expanded': True, 'type': 'group', 'children': [
|
{'name': 'Output Config', 'expanded': True, 'type': 'group', 'children': [
|
||||||
{'name': 'Control Method', 'type': 'mutex', 'limits': {'Constant Current': False, 'Temperature PID': True},
|
{'name': 'Control Method', 'type': 'mutex', 'limits': ['Constant Current', 'Temperature PID'],
|
||||||
'activater': ('pwm', ch, 'pid'), 'children': [
|
'activaters': [None, ('pwm', ch, 'pid')], 'children': [
|
||||||
{'name': 'Set Current', 'type': 'float', 'value': 0, 'step': 100, 'limits': (-3000, 3000), 'triggerOnShow': True,
|
{'name': 'Set Current', 'type': 'float', 'value': 0, 'step': 100, 'limits': (-3000, 3000), 'triggerOnShow': True,
|
||||||
'decimals': 6, 'suffix': 'mA', 'param': ('pwm', ch, 'i_set')},
|
'decimals': 6, 'suffix': 'mA', 'param': ('pwm', ch, 'i_set')},
|
||||||
{'name': 'Set Temperature', 'type': 'float', 'value': 25, 'step': 0.1, 'limits': (-273, 300),
|
{'name': 'Set Temperature', 'type': 'float', 'value': 25, 'step': 0.1, 'limits': (-273, 300),
|
||||||
@ -671,9 +671,10 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||||||
else:
|
else:
|
||||||
set_param_args = (*thermostat_param, data)
|
set_param_args = (*thermostat_param, data)
|
||||||
await self.client.set_param(*set_param_args)
|
await self.client.set_param(*set_param_args)
|
||||||
if inner_param.opts.get('activater', None) is not None:
|
if inner_param.opts.get('activaters', None) is not None:
|
||||||
if data:
|
activater = inner_param.opts['activaters'][inner_param.opts['limits'].index(data)]
|
||||||
await self.client.set_param(*inner_param.opts['activater'])
|
if activater is not None:
|
||||||
|
await self.client.set_param(*activater)
|
||||||
|
|
||||||
|
|
||||||
def _set_param_tree(self):
|
def _set_param_tree(self):
|
||||||
@ -792,7 +793,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||||||
channel = settings["channel"]
|
channel = settings["channel"]
|
||||||
self.channel_graphs[channel].plot_append(settings)
|
self.channel_graphs[channel].plot_append(settings)
|
||||||
with QSignalBlocker(self.params[channel]):
|
with QSignalBlocker(self.params[channel]):
|
||||||
self.params[channel].child("Output Config", "Control Method").setValue(settings["pid_engaged"])
|
self.params[channel].child("Output Config", "Control Method").setValue("Temperature PID" if settings["pid_engaged"] else "Constant Current")
|
||||||
self.channel_graphs[channel].t_line.setVisible(settings["pid_engaged"])
|
self.channel_graphs[channel].t_line.setVisible(settings["pid_engaged"])
|
||||||
self.params[channel].child("Output Config", "Control Method", "Set Current").setValue(settings["i_set"] * 1000)
|
self.params[channel].child("Output Config", "Control Method", "Set Current").setValue(settings["i_set"] * 1000)
|
||||||
if settings['temperature'] is not None and settings['tec_i'] is not None:
|
if settings['temperature'] is not None and settings['tec_i'] is not None:
|
||||||
|
Loading…
Reference in New Issue
Block a user