Reset TC setpoints and stirrer to schedule on resume from pause

On resume from PAUSED, on_step_changed does not re-fire (same step
continues), so any manual TC/stirrer adjustments made while paused
would persist into the run. Explicitly re-apply the current step's
temperature, heatrate, and stirrer config on the resume path in
SudTask.recv().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SH2D4LRuCnhLSzoYerAfJX
This commit is contained in:
2026-06-28 10:36:26 +02:00
co-authored by Claude Sonnet 4.6
parent 35e50f5644
commit 05358e7c4c
+17
View File
@@ -435,6 +435,23 @@ class SudTask(ATask):
self.sud.start()
if fresh_start:
asyncio.create_task(self.send_forecast(self.sud.save()))
else:
# Resume from PAUSED: re-apply current step's schedule
# parameters so any manual TC/stirrer changes made while
# paused are overwritten by the schedule on play.
index = self.sud.index
if index is not None and 0 <= index < len(self.sud.schedule):
step = self.sud.schedule[index]
ramp = step.get('ramp')
hold = step.get('hold')
ramping = self.sud.state == SudState.RAMPING
if step.get('temperature') is not None:
self.tc.set_theta_soll(step['temperature'])
if ramping and ramp:
self.tc.set_heatrate_soll(ramp['rate'])
phase = ramp if ramping else hold
if phase is not None:
self.apply_stirrer(phase)
elif 'Confirm' in pair[0]:
# Sud.confirm() synchronously fires on_step_changed() for
# the now-current step, which schedules the forecast