mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 15:37:27 -06:00
Merge branch '2.5' of github.com:Ultimaker/Cura
This commit is contained in:
commit
ea3acd6c35
1 changed files with 7 additions and 1 deletions
|
@ -5,6 +5,7 @@ from PyQt5.QtCore import QObject, pyqtSignal, pyqtProperty
|
||||||
from UM.FlameProfiler import pyqtSlot
|
from UM.FlameProfiler import pyqtSlot
|
||||||
|
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
|
from UM.Logger import Logger
|
||||||
from UM.Qt.Duration import Duration
|
from UM.Qt.Duration import Duration
|
||||||
from UM.Preferences import Preferences
|
from UM.Preferences import Preferences
|
||||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||||
|
@ -109,7 +110,12 @@ class PrintInformation(QObject):
|
||||||
return self._material_costs
|
return self._material_costs
|
||||||
|
|
||||||
def _onPrintDurationMessage(self, total_time, material_amounts):
|
def _onPrintDurationMessage(self, total_time, material_amounts):
|
||||||
self._current_print_time.setDuration(total_time)
|
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)
|
||||||
|
|
||||||
self.currentPrintTimeChanged.emit()
|
self.currentPrintTimeChanged.emit()
|
||||||
|
|
||||||
self._material_amounts = material_amounts
|
self._material_amounts = material_amounts
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue