mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-08 06:23:59 -06:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
47fcec8271
3 changed files with 22 additions and 9 deletions
|
@ -89,8 +89,12 @@ class PrintInformation(QObject):
|
|||
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
|
||||
# list comprehension filtering to solve this for us.
|
||||
extruder_stack = [extruder for extruder in extruder_stacks if extruder.getMetaDataEntry("position") == str(index)][0]
|
||||
density = extruder_stack.getMetaDataEntry("properties", {}).get("density", 0)
|
||||
if extruder_stacks: # Multi extrusion machine
|
||||
extruder_stack = [extruder for extruder in extruder_stacks if extruder.getMetaDataEntry("position") == str(index)][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_lengths.append(round((amount / (math.pi * r ** 2)) / 1000, 2))
|
||||
self.materialLengthsChanged.emit()
|
||||
|
|
|
@ -174,18 +174,19 @@ class StartSliceJob(Job):
|
|||
def _buildExtruderMessage(self, stack):
|
||||
message = self._slice_message.addRepeatedMessage("extruders")
|
||||
message.id = int(stack.getMetaDataEntry("position"))
|
||||
|
||||
material_instance_container = stack.findContainer({"type": "material"})
|
||||
|
||||
for key in stack.getAllKeys():
|
||||
setting = message.getMessage("settings").addRepeatedMessage("settings")
|
||||
setting.name = key
|
||||
setting.value = str(stack.getProperty(key, "value")).encode("utf-8")
|
||||
if key == "material_guid" and material_instance_container:
|
||||
# Also send the material GUID. This is a setting in fdmprinter, but we have no interface for it.
|
||||
setting.value = str(material_instance_container.getMetaDataEntry("GUID", "")).encode("utf-8")
|
||||
else:
|
||||
setting.value = str(stack.getProperty(key, "value")).encode("utf-8")
|
||||
Job.yieldThread()
|
||||
|
||||
# ALso send the material GUID as a setting.
|
||||
material_instance_container = stack.findContainer({"type": "material"})
|
||||
if material_instance_container:
|
||||
setting = message.getMessage("settings").addRepeatedMessage("settings")
|
||||
setting.name = "material_GUID"
|
||||
setting.value = str(material_instance_container.getMetaDataEntry("GUID", "")).encode("utf-8")
|
||||
## Sends all global settings to the engine.
|
||||
#
|
||||
# The settings are taken from the global stack. This does not include any
|
||||
|
|
|
@ -57,6 +57,14 @@
|
|||
"settable_per_extruder": false,
|
||||
"settable_per_meshgroup": false
|
||||
},
|
||||
"material_guid":
|
||||
{
|
||||
"label": "Material GUID",
|
||||
"description": "GUID of the material. This is set automatically. ",
|
||||
"default_value": "",
|
||||
"type": "str",
|
||||
"enabled": false
|
||||
},
|
||||
"material_bed_temp_wait":
|
||||
{
|
||||
"label": "Wait for bed heatup",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue