From 05358e7c4c7a48ad0e5e2ad8cd146dfa7294acee Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Sun, 28 Jun 2026 10:36:26 +0200 Subject: [PATCH] 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 Claude-Session: https://claude.ai/code/session_01SH2D4LRuCnhLSzoYerAfJX --- tasks/sud.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tasks/sud.py b/tasks/sud.py index 1c9b22b..344ac94 100644 --- a/tasks/sud.py +++ b/tasks/sud.py @@ -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