From b9fb9385c214c4b7b4070b1df9002f66384fcaa3 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 30 Jun 2015 11:33:49 +0200 Subject: [PATCH] Assume the engine sends material amount in mm3 and calculate length based on that Contributes to Asana issue 38958940640344 --- cura/PrintInformation.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index d0346fbbb5..4b318259ed 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -9,6 +9,8 @@ from UM.Resources import Resources from UM.Scene.SceneNode import SceneNode from UM.Qt.Duration import Duration +import math + ## A class for processing and calculating minimum, currrent and maximum print time. # # This class contains all the logic relating to calculation and slicing for the @@ -146,7 +148,9 @@ class PrintInformation(QObject): self._current_print_time.setDuration(time) self.currentPrintTimeChanged.emit() - self._material_amount = round(amount / 10) / 100 + # Material amount is sent as an amount of mm^3, so calculate length from that + r = self._current_settings.getSettingValueByKey("material_diameter") / 2 + self._material_amount = round((amount / (math.pi * r ** 2)) / 1000, 1) self.materialAmountChanged.emit() if not self._enabled: