material_guid is now also a setting in fdmprinter

CURA-1836
This commit is contained in:
Jaime van Kessel 2016-07-18 11:46:12 +02:00
parent a17cf59699
commit 48d39ce387
2 changed files with 16 additions and 7 deletions

View file

@ -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
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

View file

@ -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",