We now recieve material estimation per extruder

CURA-1687
This commit is contained in:
Jaime van Kessel 2016-07-04 17:11:03 +02:00
parent 90fa0f0564
commit 318182495a
5 changed files with 29 additions and 19 deletions

View file

@ -44,7 +44,7 @@ class PrintInformation(QObject):
self._current_print_time = Duration(None, self)
self._material_amount = -1
self._material_amounts = []
self._backend = Application.getInstance().getBackend()
if self._backend:
@ -62,21 +62,22 @@ class PrintInformation(QObject):
def currentPrintTime(self):
return self._current_print_time
materialAmountChanged = pyqtSignal()
materialAmountsChanged = pyqtSignal()
@pyqtProperty(float, notify = materialAmountChanged)
def materialAmount(self):
return self._material_amount
@pyqtProperty("QVariantList", notify = materialAmountsChanged)
def materialAmounts(self):
return self._material_amounts
def _onPrintDurationMessage(self, time, amount):
#if self._slice_pass == self.SlicePass.CurrentSettings:
self._current_print_time.setDuration(time)
def _onPrintDurationMessage(self, total_time, material_amounts):
self._current_print_time.setDuration(total_time)
self.currentPrintTimeChanged.emit()
# Material amount is sent as an amount of mm^3, so calculate length from that
r = Application.getInstance().getGlobalContainerStack().getProperty("material_diameter", "value") / 2
self._material_amount = round((amount / (math.pi * r ** 2)) / 1000, 2)
self.materialAmountChanged.emit()
self._material_amounts = []
for amount in material_amounts:
self._material_amounts.append(round((amount / (math.pi * r ** 2)) / 1000, 2))
self.materialAmountsChanged.emit()
@pyqtSlot(str)
def setJobName(self, name):