mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Add some logging and documentation to XmlMaterialProfile
Contributes to CURA-339
This commit is contained in:
parent
803dcdcec7
commit
e0fab7aa11
1 changed files with 9 additions and 0 deletions
|
@ -45,6 +45,8 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
self.addMetaDataEntry("material", material.text)
|
||||
self.addMetaDataEntry("color_name", color.text)
|
||||
|
||||
continue
|
||||
|
||||
self.addMetaDataEntry(tag_name, entry.text)
|
||||
|
||||
property_values = {}
|
||||
|
@ -78,6 +80,8 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
if key in self.__material_property_setting_map:
|
||||
self.setProperty(self.__material_property_setting_map[key], "value", entry.text, self._definition)
|
||||
global_setting_values[self.__material_property_setting_map[key]] = entry.text
|
||||
else:
|
||||
Logger.log("d", "Unsupported material setting %s", key)
|
||||
|
||||
machines = data.iterfind("./um:settings/um:machine", self.__namespaces)
|
||||
for machine in machines:
|
||||
|
@ -87,6 +91,8 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
key = entry.get("key")
|
||||
if key in self.__material_property_setting_map:
|
||||
machine_setting_values[self.__material_property_setting_map[key]] = entry.text
|
||||
else:
|
||||
Logger.log("d", "Unsupported material setting %s", key)
|
||||
|
||||
identifiers = machine.iterfind("./um:machine_identifier", self.__namespaces)
|
||||
for identifier in identifiers:
|
||||
|
@ -116,12 +122,15 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
UM.Settings.ContainerRegistry.getInstance().addContainer(new_material)
|
||||
|
||||
|
||||
|
||||
# Map XML file setting names to internal names
|
||||
__material_property_setting_map = {
|
||||
"print temperature": "material_print_temperature",
|
||||
"heated bed temperature": "material_bed_temperature",
|
||||
"standby temperature": "material_standby_temperature",
|
||||
}
|
||||
|
||||
# Map XML file product names to internal ids
|
||||
__product_id_map = {
|
||||
"Ultimaker2": "ultimaker2",
|
||||
"Ultimaker2+": "ultimaker2_plus",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue