mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Receive time estimates per feature
This commit is contained in:
parent
eb52e4fb7e
commit
f15aa66751
3 changed files with 52 additions and 13 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue