From 6dc2df25f7fe3851bdbe73e6b655128e1176c432 Mon Sep 17 00:00:00 2001 From: alfrix Date: Sat, 2 Sep 2023 17:37:18 -0300 Subject: [PATCH] job_status: patch print_time estimating too early --- panels/job_status.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/panels/job_status.py b/panels/job_status.py index fa6a5d0e..fdc2ece4 100644 --- a/panels/job_status.py +++ b/panels/job_status.py @@ -661,6 +661,7 @@ class Panel(ScreenPanel): else: # At the begining file and filament are innacurate estimated = slicer_time + if estimated < 1: if file_time is None: return @@ -669,12 +670,16 @@ class Panel(ScreenPanel): estimated = file_time if estimated < 1: return + progress = min(max(print_duration / estimated, 0), 1) + if progress >=1: + estimated = file_time + progress = min(max(print_duration / estimated, 0), 1) self.labels["est_time"].set_label(self.format_time(estimated)) self.labels["time_left"].set_label(self.format_eta(estimated, print_duration)) remaining_label = f"{self.labels['left'].get_text()} {self.labels['time_left'].get_text()}" self.buttons['left'].set_label(remaining_label) - self.update_progress(min(max(print_duration / estimated, 0), 1)) + self.update_progress(progress) def update_progress(self, progress: float): self.progress = progress