job_status: patch print_time estimating too early
This commit is contained in:
parent
a6866e8a0f
commit
6dc2df25f7
@ -661,6 +661,7 @@ class Panel(ScreenPanel):
|
|||||||
else:
|
else:
|
||||||
# At the begining file and filament are innacurate
|
# At the begining file and filament are innacurate
|
||||||
estimated = slicer_time
|
estimated = slicer_time
|
||||||
|
|
||||||
if estimated < 1:
|
if estimated < 1:
|
||||||
if file_time is None:
|
if file_time is None:
|
||||||
return
|
return
|
||||||
@ -669,12 +670,16 @@ class Panel(ScreenPanel):
|
|||||||
estimated = file_time
|
estimated = file_time
|
||||||
if estimated < 1:
|
if estimated < 1:
|
||||||
return
|
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["est_time"].set_label(self.format_time(estimated))
|
||||||
self.labels["time_left"].set_label(self.format_eta(estimated, print_duration))
|
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()}"
|
remaining_label = f"{self.labels['left'].get_text()} {self.labels['time_left'].get_text()}"
|
||||||
self.buttons['left'].set_label(remaining_label)
|
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):
|
def update_progress(self, progress: float):
|
||||||
self.progress = progress
|
self.progress = progress
|
||||||
|
Loading…
x
Reference in New Issue
Block a user