diff options
author | 14bitVoid <14bitvoid@protonmail.com> | 2017-05-05 01:05:17 +0300 |
---|---|---|
committer | 14bitVoid <14bitvoid@protonmail.com> | 2017-05-05 01:05:17 +0300 |
commit | f15aa667510bb6ffe472fa7fd1801d060555b142 (patch) | |
tree | c6b45025ef7d00388652aee4ab04596499e09975 /cura/PrintInformation.py | |
parent | eb52e4fb7e873c33cfdcc579bfa25c3b6b22b248 (diff) |
Receive time estimates per feature
Diffstat (limited to 'cura/PrintInformation.py')
-rw-r--r-- | cura/PrintInformation.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index ab63e4034d..cd1a194254 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -111,12 +111,14 @@ class PrintInformation(QObject): def materialCosts(self): return self._material_costs - def _onPrintDurationMessage(self, total_time, material_amounts): - if total_time != total_time: # Check for NaN. Engine can sometimes give us weird values. - Logger.log("w", "Received NaN for print duration message") - self._current_print_time.setDuration(0) - else: - self._current_print_time.setDuration(total_time) + def _onPrintDurationMessage(self, time_per_feature, material_amounts): + total_time = 0 + for feature, time in time_per_feature.items(): + if time != time: # Check for NaN. Engine can sometimes give us weird values. + Logger.log("w", "Received NaN for print duration message") + continue + total_time += time + self._current_print_time.setDuration(total_time) self.currentPrintTimeChanged.emit() |