Add an enable/disable switch for the temperature controller
New TempControllerBase.enabled (default False) forces y=0 in process_pid() when off, same mechanism as the existing cooling override - the controller tries not to drive the heater at all. tasks/tempctrl.py: new 'Enable' recv command and 'Enabled' broadcast on the TempCtrl channel. tasks/sud.py: SudTask now enables the controller on any non-IDLE/DONE Sud state and disables it (forcing power back to 0) on IDLE/DONE, so automatic mode owns it for the duration of a run and hands back manual control once it stops/finishes. gui: new "Enabled" checkbox on the Manual tab's Controller group, synced from the server; the temp/heatrate setpoint controls are disabled whenever the controller itself is disabled.
This commit is contained in:
@@ -96,6 +96,14 @@ class SudTask(ATask):
|
||||
if value in (SudState.DONE, SudState.IDLE):
|
||||
self.stirrer.set_duty_cycle(1.0)
|
||||
self.stirrer.set_speed(0)
|
||||
# A finished/stopped run no longer owns the controller - hand
|
||||
# control back to manual mode (off by default there too).
|
||||
self.tc.set_enabled(False)
|
||||
else:
|
||||
# Any other state (RAMPING/HOLDING/WAIT_USER/PAUSED) means a
|
||||
# run is in progress and needs the controller actively driving
|
||||
# the heater.
|
||||
self.tc.set_enabled(True)
|
||||
|
||||
def on_user_message_changed(self, value):
|
||||
asyncio.create_task(self.send({'UserMessage': value}))
|
||||
|
||||
Reference in New Issue
Block a user