Merge branch 'feature_intent' into feature_intent_container_tree

Conflicts:
	.gitlab-ci.yml
	cura/Machines/MaterialManager.py
	cura/Machines/VariantManager.py
	cura/Settings/ContainerManager.py
	cura/Settings/MachineManager.py
	tests/TestMachineManager.py
This commit is contained in:
Ghostkeeper 2019-08-13 14:59:05 +02:00
commit 6a8e1557c3
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
1383 changed files with 33204 additions and 35215 deletions

View file

@ -191,13 +191,16 @@ class XmlMaterialProfile(InstanceContainer):
## End Name Block
for key, value in metadata.items():
builder.start(key) # type: ignore
key_to_use = key
if key in self._metadata_tags_that_have_cura_namespace:
key_to_use = "cura:" + key_to_use
builder.start(key_to_use) # type: ignore
if value is not None: #Nones get handled well by the builder.
#Otherwise the builder always expects a string.
#Deserialize expects the stringified version.
value = str(value)
builder.data(value)
builder.end(key)
builder.end(key_to_use)
builder.end("metadata")
## End Metadata Block
@ -878,7 +881,7 @@ class XmlMaterialProfile(InstanceContainer):
machine_compatibility = cls._parseCompatibleValue(entry.text)
for identifier in machine.iterfind("./um:machine_identifier", cls.__namespaces):
machine_id_list = product_id_map.get(identifier.get("product"), [])
machine_id_list = product_id_map.get(identifier.get("product", ""), [])
if not machine_id_list:
machine_id_list = cls.getPossibleDefinitionIDsFromName(identifier.get("product"))
@ -910,7 +913,7 @@ class XmlMaterialProfile(InstanceContainer):
result_metadata.append(new_material_metadata)
buildplates = machine.iterfind("./um:buildplate", cls.__namespaces)
buildplate_map = {} # type: Dict[str, Dict[str, bool]]
buildplate_map = {} # type: Dict[str, Dict[str, bool]]
buildplate_map["buildplate_compatible"] = {}
buildplate_map["buildplate_recommended"] = {}
for buildplate in buildplates:
@ -1095,6 +1098,8 @@ class XmlMaterialProfile(InstanceContainer):
def __str__(self):
return "<XmlMaterialProfile '{my_id}' ('{name}') from base file '{base_file}'>".format(my_id = self.getId(), name = self.getName(), base_file = self.getMetaDataEntry("base_file"))
_metadata_tags_that_have_cura_namespace = {"pva_compatible", "breakaway_compatible"}
# Map XML file setting names to internal names
__material_settings_setting_map = {
"print temperature": "default_material_print_temperature",
@ -1108,11 +1113,11 @@ class XmlMaterialProfile(InstanceContainer):
"surface energy": "material_surface_energy",
"shrinkage percentage": "material_shrinkage_percentage",
"build volume temperature": "build_volume_temperature",
"anti ooze retracted position": "material_anti_ooze_retracted_position",
"anti ooze retract position": "material_anti_ooze_retracted_position",
"anti ooze retract speed": "material_anti_ooze_retraction_speed",
"break preparation retracted position": "material_break_preparation_retracted_position",
"break preparation position": "material_break_preparation_retracted_position",
"break preparation speed": "material_break_preparation_speed",
"break retracted position": "material_break_retracted_position",
"break position": "material_break_retracted_position",
"break speed": "material_break_speed",
"break temperature": "material_break_temperature"
}