mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 06:09:00 +08:00
Assume the engine sends material amount in mm3 and calculate length based on that
Contributes to Asana issue 38958940640344
This commit is contained in:
parent
f6f3eba3ff
commit
b9fb9385c2
@ -9,6 +9,8 @@ from UM.Resources import Resources
|
|||||||
from UM.Scene.SceneNode import SceneNode
|
from UM.Scene.SceneNode import SceneNode
|
||||||
from UM.Qt.Duration import Duration
|
from UM.Qt.Duration import Duration
|
||||||
|
|
||||||
|
import math
|
||||||
|
|
||||||
## A class for processing and calculating minimum, currrent and maximum print time.
|
## 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
|
# 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._current_print_time.setDuration(time)
|
||||||
self.currentPrintTimeChanged.emit()
|
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()
|
self.materialAmountChanged.emit()
|
||||||
|
|
||||||
if not self._enabled:
|
if not self._enabled:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user