mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 18:57:52 -06:00
Print information handles single extrusion machines correctly again
CURA-1931 and CURA-1038
This commit is contained in:
parent
56efb92f3e
commit
c2fab4da47
1 changed files with 6 additions and 2 deletions
|
@ -89,8 +89,12 @@ class PrintInformation(QObject):
|
||||||
for index, amount in enumerate(material_amounts):
|
for index, amount in enumerate(material_amounts):
|
||||||
## Find the right extruder stack. As the list isn't sorted because it's a annoying generator, we do some
|
## Find the right extruder stack. As the list isn't sorted because it's a annoying generator, we do some
|
||||||
# list comprehension filtering to solve this for us.
|
# list comprehension filtering to solve this for us.
|
||||||
|
if extruder_stacks: # Multi extrusion machine
|
||||||
extruder_stack = [extruder for extruder in extruder_stacks if extruder.getMetaDataEntry("position") == str(index)][0]
|
extruder_stack = [extruder for extruder in extruder_stacks if extruder.getMetaDataEntry("position") == str(index)][0]
|
||||||
density = extruder_stack.getMetaDataEntry("properties", {}).get("density", 0)
|
density = extruder_stack.getMetaDataEntry("properties", {}).get("density", 0)
|
||||||
|
else: # Machine with no extruder stacks
|
||||||
|
density = Application.getInstance().getGlobalContainerStack().getMetaDataEntry("properties", {}).get("density", 0)
|
||||||
|
|
||||||
self._material_weights.append(float(amount) * float(density))
|
self._material_weights.append(float(amount) * float(density))
|
||||||
self._material_lengths.append(round((amount / (math.pi * r ** 2)) / 1000, 2))
|
self._material_lengths.append(round((amount / (math.pi * r ** 2)) / 1000, 2))
|
||||||
self.materialLengthsChanged.emit()
|
self.materialLengthsChanged.emit()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue