Allow a Sud step to combine a ramp and a hold

A step can now carry both 'ramp' and 'hold': it ramps to the target
temp, then holds there for the given duration, instead of needing two
separate schedule entries. Sud.temp_reached() switches such a step
from its ramp phase into its hold phase in place (re-firing the
step-changed callback so SudTask/demo_sud re-apply the hold's stirrer
settings); user_wait_for_continue still applies once the whole step -
both phases - is done.

Merges sud_0010.json's three ramp/hold pairs into combined steps.
This commit is contained in:
2026-06-21 09:01:04 +02:00
parent 56de5cf4d6
commit 9bd9889cb0
6 changed files with 57 additions and 37 deletions
+3 -2
View File
@@ -130,7 +130,8 @@ class SudForecastPlot(FigureCanvasQTAgg):
def _estimate_course(schedule, start_theta):
"""Walks the schedule, accumulating (t, theta) waypoints: ramps take
abs(delta)/rate minutes at the declared rate, holds last for their
duration at the temperature the preceding ramp reached."""
duration at the temperature the preceding ramp reached. A step may
carry both - ramp then hold - contributing both segments in turn."""
t = [0.0]
theta = [start_theta]
for step in schedule:
@@ -142,7 +143,7 @@ class SudForecastPlot(FigureCanvasQTAgg):
if rate > 0:
t.append(t[-1] + abs(target - theta[-1]) / rate * 60.0)
theta.append(target)
elif hold is not None:
if hold is not None:
t.append(t[-1] + hold.get('duration', 0) * 60.0)
theta.append(theta[-1])
return t, theta