diff --git a/client/brewpi_gui.py b/client/brewpi_gui.py index 1d4be02..5d647ef 100755 --- a/client/brewpi_gui.py +++ b/client/brewpi_gui.py @@ -1181,7 +1181,11 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow): def update_status_step_label(self): if self.sud_step_descr: - text = "Step {}: {}".format(self.sud_step_index, self.sud_step_descr) + # +1: sud_step_index is the 0-based index Sud.index uses, but + # StepPlate (the Progress tab) labels steps 1-based - match it + # here so the status bar doesn't announce a step one number + # below what the Progress tab shows for the same step. + text = "Step {}: {}".format(self.sud_step_index + 1, self.sud_step_descr) if self.sud_step_type == 'hold': remaining = max(self.sud_hold_remaining, 0.0) text += " ({:.0f}:{:02.0f} remaining)".format(remaining // 60, remaining % 60) diff --git a/components/pid/temp_controller_base.py b/components/pid/temp_controller_base.py index 6712989..0437b6a 100644 --- a/components/pid/temp_controller_base.py +++ b/components/pid/temp_controller_base.py @@ -160,14 +160,28 @@ class TempControllerBase(APid): elif not self.enabled: state_next = States.IDLE elif self.state == States.IDLE: - # Just (re-)enabled - land in HOLD; the very next tick's - # threshold check (below) moves it on to HEAT/COOL if the gap - # actually warrants it. pid_heat was frozen (see process_pid()) - # and possibly stale for as long as we were disabled - start it - # clean rather than resuming wherever it last left off. - state_next = States.HOLD + # Just (re-)enabled - resolve straight to HEAT/COOL/HOLD against + # the real gap, the same threshold check the HOLD branch below + # uses, rather than landing in HOLD and waiting for the next + # tick to correct it: is_holding() is read synchronously within + # this very same call chain (tasks/sud.py's SudTask.on_step_ + # changed() pushes the new step's setpoint via set_theta_soll(), + # which calls this method directly), so an unconditional HOLD + # here gets mistaken for "ramp already reached" and can finish + # a freshly (re-)started step instantly - see SudTask. + # on_process()'s is_holding() check. pid_heat/pid_cool were + # frozen (see process_pid()) and possibly stale for as long as + # we were disabled - start whichever one matters clean rather + # than resuming wherever it last left off. self.pid_hold.reset() self.pid_heat.reset() + self.pid_cool.reset() + if diff >= self.thresholds['HoldHeat']: + state_next = States.HEAT + elif diff <= -self.thresholds['HoldCool']: + state_next = States.COOL + else: + state_next = States.HOLD elif self.state == States.HOLD: if diff >= self.thresholds['HoldHeat']: state_next = States.HEAT