Commit 06146d1d authored by sumpfralle's avatar sumpfralle

prevent jumping timing estimation


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@706 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent b69e28ad
...@@ -2580,6 +2580,14 @@ class ProjectGui: ...@@ -2580,6 +2580,14 @@ class ProjectGui:
if eta_full > 0: if eta_full > 0:
eta_delta = eta_full - (time.time() - self._progress_start_time) eta_delta = eta_full - (time.time() - self._progress_start_time)
eta_delta = int(round(eta_delta)) eta_delta = int(round(eta_delta))
if hasattr(self, "_last_eta_delta"):
previous_eta_delta = self._last_eta_delta
if eta_delta == previous_eta_delta + 1:
# We are currently toggling between two numbers.
# We want to avoid screen flicker, thus we just live
# with the slight inaccuracy.
eta_delta = self._last_eta_delta
self._last_eta_delta = eta_delta
eta_delta_obj = datetime.timedelta(seconds=eta_delta) eta_delta_obj = datetime.timedelta(seconds=eta_delta)
eta_text = "%s remaining ..." % str(eta_delta_obj) eta_text = "%s remaining ..." % str(eta_delta_obj)
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment