From e1266ceb1fd5832364b02b3d54ab4cb2df2c4df9 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Aug 2017 10:23:35 +0200 Subject: [PATCH 1/2] Change Ultimaker manufacturer to Ultimaker B.V. The material profiles are sent to UM3 with a manufacturer that's obtained from the printer definition rather than the material definition. The printer definition was 'Ultimaker' rather than 'Ultimaker B.V.' and the printer checked against this. Contributes to issue CURA-4159. --- resources/definitions/fdmextruder.def.json | 4 ++-- resources/definitions/fdmprinter.def.json | 2 +- resources/definitions/ultimaker.def.json | 2 +- resources/definitions/ultimaker2.def.json | 2 +- resources/definitions/ultimaker2_extended.def.json | 2 +- resources/definitions/ultimaker2_extended_plus.def.json | 2 +- resources/definitions/ultimaker2_go.def.json | 2 +- resources/definitions/ultimaker2_plus.def.json | 2 +- resources/definitions/ultimaker3.def.json | 2 +- resources/definitions/ultimaker3_extended.def.json | 2 +- resources/definitions/ultimaker_original.def.json | 2 +- resources/definitions/ultimaker_original_dual.def.json | 2 +- resources/definitions/ultimaker_original_plus.def.json | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/resources/definitions/fdmextruder.def.json b/resources/definitions/fdmextruder.def.json index bf235d76eb..59ac6c172e 100644 --- a/resources/definitions/fdmextruder.def.json +++ b/resources/definitions/fdmextruder.def.json @@ -5,8 +5,8 @@ "metadata": { "type": "extruder", - "author": "Ultimaker B.V.", - "manufacturer": "Ultimaker", + "author": "Ultimaker", + "manufacturer": "Ultimaker B.V.", "setting_version": 1, "visible": false }, diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 40f8d0fd21..954e1a49f9 100755 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -7,7 +7,7 @@ "type": "machine", "author": "Ultimaker B.V.", "category": "Ultimaker", - "manufacturer": "Ultimaker", + "manufacturer": "Ultimaker B.V.", "setting_version": 1, "file_formats": "text/x-gcode;application/x-stl-ascii;application/x-stl-binary;application/x-wavefront-obj;application/x3g", "visible": false, diff --git a/resources/definitions/ultimaker.def.json b/resources/definitions/ultimaker.def.json index 124b3c5c0a..adf0ec8054 100644 --- a/resources/definitions/ultimaker.def.json +++ b/resources/definitions/ultimaker.def.json @@ -5,7 +5,7 @@ "inherits": "fdmprinter", "metadata": { "author": "Ultimaker", - "manufacturer": "Ultimaker", + "manufacturer": "Ultimaker B.V.", "visible": false }, "overrides": { diff --git a/resources/definitions/ultimaker2.def.json b/resources/definitions/ultimaker2.def.json index d8126f9488..f1db386e0d 100644 --- a/resources/definitions/ultimaker2.def.json +++ b/resources/definitions/ultimaker2.def.json @@ -6,7 +6,7 @@ "metadata": { "visible": true, "author": "Ultimaker", - "manufacturer": "Ultimaker", + "manufacturer": "Ultimaker B.V.", "category": "Ultimaker", "weight": 3, "file_formats": "text/x-gcode", diff --git a/resources/definitions/ultimaker2_extended.def.json b/resources/definitions/ultimaker2_extended.def.json index ac9d98c5eb..687369d559 100644 --- a/resources/definitions/ultimaker2_extended.def.json +++ b/resources/definitions/ultimaker2_extended.def.json @@ -5,7 +5,7 @@ "inherits": "ultimaker2", "metadata": { "author": "Ultimaker", - "manufacturer": "Ultimaker", + "manufacturer": "Ultimaker B.V.", "category": "Ultimaker", "weight": 3, "file_formats": "text/x-gcode", diff --git a/resources/definitions/ultimaker2_extended_plus.def.json b/resources/definitions/ultimaker2_extended_plus.def.json index 4490b67957..15256064f3 100644 --- a/resources/definitions/ultimaker2_extended_plus.def.json +++ b/resources/definitions/ultimaker2_extended_plus.def.json @@ -5,7 +5,7 @@ "inherits": "ultimaker2_plus", "metadata": { "author": "Ultimaker", - "manufacturer": "Ultimaker", + "manufacturer": "Ultimaker B.V.", "category": "Ultimaker", "quality_definition": "ultimaker2_plus", "weight": 2, diff --git a/resources/definitions/ultimaker2_go.def.json b/resources/definitions/ultimaker2_go.def.json index 5873dfbc90..0803a91571 100644 --- a/resources/definitions/ultimaker2_go.def.json +++ b/resources/definitions/ultimaker2_go.def.json @@ -5,7 +5,7 @@ "inherits": "ultimaker2", "metadata": { "author": "Ultimaker", - "manufacturer": "Ultimaker", + "manufacturer": "Ultimaker B.V.", "category": "Ultimaker", "weight": 3, "file_formats": "text/x-gcode", diff --git a/resources/definitions/ultimaker2_plus.def.json b/resources/definitions/ultimaker2_plus.def.json index d8169b9abb..ef5420e77a 100644 --- a/resources/definitions/ultimaker2_plus.def.json +++ b/resources/definitions/ultimaker2_plus.def.json @@ -5,7 +5,7 @@ "inherits": "ultimaker2", "metadata": { "author": "Ultimaker", - "manufacturer": "Ultimaker", + "manufacturer": "Ultimaker B.V.", "category": "Ultimaker", "weight": 1, "file_formats": "text/x-gcode", diff --git a/resources/definitions/ultimaker3.def.json b/resources/definitions/ultimaker3.def.json index 61d185a978..ba1caeddb5 100644 --- a/resources/definitions/ultimaker3.def.json +++ b/resources/definitions/ultimaker3.def.json @@ -5,7 +5,7 @@ "inherits": "ultimaker", "metadata": { "author": "Ultimaker", - "manufacturer": "Ultimaker", + "manufacturer": "Ultimaker B.V.", "category": "Ultimaker", "visible": true, "file_formats": "text/x-gcode", diff --git a/resources/definitions/ultimaker3_extended.def.json b/resources/definitions/ultimaker3_extended.def.json index 0de95f78b8..7cf90a1a90 100644 --- a/resources/definitions/ultimaker3_extended.def.json +++ b/resources/definitions/ultimaker3_extended.def.json @@ -5,7 +5,7 @@ "inherits": "ultimaker3", "metadata": { "author": "Ultimaker", - "manufacturer": "Ultimaker", + "manufacturer": "Ultimaker B.V.", "category": "Ultimaker", "quality_definition": "ultimaker3", "visible": true, diff --git a/resources/definitions/ultimaker_original.def.json b/resources/definitions/ultimaker_original.def.json index 8a00e9ed1b..82f309cc13 100644 --- a/resources/definitions/ultimaker_original.def.json +++ b/resources/definitions/ultimaker_original.def.json @@ -6,7 +6,7 @@ "metadata": { "visible": true, "author": "Ultimaker", - "manufacturer": "Ultimaker", + "manufacturer": "Ultimaker B.V.", "category": "Ultimaker", "weight": 4, "file_formats": "text/x-gcode", diff --git a/resources/definitions/ultimaker_original_dual.def.json b/resources/definitions/ultimaker_original_dual.def.json index b047198225..38dd2f0a04 100644 --- a/resources/definitions/ultimaker_original_dual.def.json +++ b/resources/definitions/ultimaker_original_dual.def.json @@ -6,7 +6,7 @@ "metadata": { "visible": true, "author": "Ultimaker", - "manufacturer": "Ultimaker", + "manufacturer": "Ultimaker B.V.", "category": "Ultimaker", "weight": 4, "file_formats": "text/x-gcode", diff --git a/resources/definitions/ultimaker_original_plus.def.json b/resources/definitions/ultimaker_original_plus.def.json index 89cc7aa67a..013e8bd717 100644 --- a/resources/definitions/ultimaker_original_plus.def.json +++ b/resources/definitions/ultimaker_original_plus.def.json @@ -5,7 +5,7 @@ "inherits": "ultimaker_original", "metadata": { "author": "Ultimaker", - "manufacturer": "Ultimaker", + "manufacturer": "Ultimaker B.V.", "category": "Ultimaker", "weight": 4, "file_formats": "text/x-gcode", From b03847447fa697f0a45b8fe72644ea041d27b664 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Aug 2017 11:13:23 +0200 Subject: [PATCH 2/2] Take manufacturer from XML profile if available Otherwise we fall back to the manufacturer in the machine definition. If that fails too, we fall back to Unknown (rather than an empty string). Contributes to issue CURA-4157. --- plugins/XmlMaterialProfile/XmlMaterialProfile.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index f920a6bd49..41d45cfc9b 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -229,7 +229,10 @@ class XmlMaterialProfile(InstanceContainer): product = definition_id builder.start("machine") - builder.start("machine_identifier", { "manufacturer": definition.getMetaDataEntry("manufacturer", ""), "product": product}) + builder.start("machine_identifier", { + "manufacturer": container.getMetaDataEntry("machine_manufacturer", definition.getMetaDataEntry("manufacturer", "Unknown")), + "product": product + }) builder.end("machine_identifier") for instance in container.findInstances(): @@ -540,6 +543,8 @@ class XmlMaterialProfile(InstanceContainer): definition = definitions[0] + machine_manufacturer = identifier.get("manufacturer", definition.getMetaDataEntry("manufacturer", "Unknown")) #If the XML material doesn't specify a manufacturer, use the one in the actual printer definition. + if machine_compatibility: new_material_id = self.id + "_" + machine_id @@ -551,6 +556,7 @@ class XmlMaterialProfile(InstanceContainer): new_material.setDefinition(definition) # Don't use setMetadata, as that overrides it for all materials with same base file new_material.getMetaData()["compatible"] = machine_compatibility + new_material.getMetaData()["machine_manufacturer"] = machine_manufacturer new_material.setCachedValues(cached_machine_setting_properties) @@ -597,6 +603,7 @@ class XmlMaterialProfile(InstanceContainer): new_hotend_material.addMetaDataEntry("variant", variant_containers[0].id) # Don't use setMetadata, as that overrides it for all materials with same base file new_hotend_material.getMetaData()["compatible"] = hotend_compatibility + new_hotend_material.getMetaData()["machine_manufacturer"] = machine_manufacturer cached_hotend_setting_properties = cached_machine_setting_properties.copy() cached_hotend_setting_properties.update(hotend_setting_values)