From c74e3a0a0b8f98582b979e29658205019cd09c99 Mon Sep 17 00:00:00 2001 From: Matthias Urlichs Date: Sun, 27 Jan 2019 19:14:38 +0100 Subject: [PATCH] don't multiply with -1 --- src/octoprint/printer/estimation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/octoprint/printer/estimation.py b/src/octoprint/printer/estimation.py index 9b10899ba..c301c9ea9 100644 --- a/src/octoprint/printer/estimation.py +++ b/src/octoprint/printer/estimation.py @@ -126,7 +126,7 @@ class PrintTimeEstimator(object): printTimeLeftOrigin = "estimate" # combine - totalPrintTime = (1.0 - sub_progress) * statisticalTotalPrintTime \ + totalPrintTime = - sub_progress * statisticalTotalPrintTime \ + sub_progress * estimatedTotalPrintTime printTimeLeft = None @@ -204,7 +204,7 @@ class TimeEstimationHelper(object): if old_average_total: self._distances.append(abs(self.average_total - old_average_total)) - if -1.0 * self._threshold < self.average_distance < self._threshold: + if -self._threshold < self.average_distance < self._threshold: self._stable_counter += 1 else: self._stable_counter = -1