diff --git a/client/brewpi_gui.py b/client/brewpi_gui.py index e30fcc2..28dfa4b 100755 --- a/client/brewpi_gui.py +++ b/client/brewpi_gui.py @@ -783,13 +783,27 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow): # fresh for this run. self.forecast_history = [] elif self.sud_state not in SUD_RUNNING_STATES and self.sud_state != SUD_PAUSED_STATE: + was_running = self.sud_start_time is not None self.sud_start_time = None self.sud_paused_total = 0.0 self.sud_pause_started_at = None # on_plot_timer() only redraws the dynamic forecast while - # sud_start_time is set - revert to the static view now, - # rather than leaving the last dynamic draw frozen. - if self.sud_schedule: + # sud_start_time is set. + if was_running: + # A run just finished or was stopped - leave the + # dynamic view's last frame (the actual measured + # history) up rather than recomputing a "static" + # plan from here, which would walk the *whole* + # original schedule again starting from wherever + # the brew happens to have ended up (e.g. close to + # the last step's target), producing a nonsensical + # total. + pass + elif self.sud_schedule: + # Fresh load (or reconnecting to an already-idle + # server) - no run has happened yet, so the upfront + # plan starting from the current temperature is + # exactly right. start_theta = self.plot_temp_ist if self.plot_temp_ist else 20.0 self.forecast_plot.show_schedule(self.sud_schedule, start_theta, self.sud_name)