mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Fix confusion around the use of the word "global"
This commit is contained in:
parent
944318d44a
commit
5550fe0da8
1 changed files with 11 additions and 11 deletions
|
@ -111,7 +111,7 @@ class XmlMaterialProfile(InstanceContainer):
|
|||
# container.setDirty(True)
|
||||
|
||||
## Overridden from InstanceContainer
|
||||
# base file: global settings + supported machines
|
||||
# base file: common settings + supported machines
|
||||
# machine / variant combination: only changes for itself.
|
||||
def serialize(self):
|
||||
registry = ContainerRegistry.getInstance()
|
||||
|
@ -426,7 +426,7 @@ class XmlMaterialProfile(InstanceContainer):
|
|||
meta_data["base_file"] = self.id
|
||||
meta_data["status"] = "unknown" # TODO: Add material verfication
|
||||
|
||||
global_setting_values = {}
|
||||
common_setting_values = {}
|
||||
|
||||
inherits = data.find("./um:inherits", self.__namespaces)
|
||||
if inherits is not None:
|
||||
|
@ -458,7 +458,7 @@ class XmlMaterialProfile(InstanceContainer):
|
|||
meta_data[tag_name] = entry.text
|
||||
|
||||
if tag_name in self.__material_metadata_setting_map:
|
||||
global_setting_values[self.__material_metadata_setting_map[tag_name]] = entry.text
|
||||
common_setting_values[self.__material_metadata_setting_map[tag_name]] = entry.text
|
||||
|
||||
if "description" not in meta_data:
|
||||
meta_data["description"] = ""
|
||||
|
@ -473,33 +473,33 @@ class XmlMaterialProfile(InstanceContainer):
|
|||
property_values[tag_name] = entry.text
|
||||
|
||||
if tag_name in self.__material_properties_setting_map:
|
||||
global_setting_values[self.__material_properties_setting_map[tag_name]] = entry.text
|
||||
common_setting_values[self.__material_properties_setting_map[tag_name]] = entry.text
|
||||
|
||||
meta_data["approximate_diameter"] = round(float(property_values.get("diameter", 2.85))) # In mm
|
||||
meta_data["properties"] = property_values
|
||||
|
||||
self.setDefinition(ContainerRegistry.getInstance().findDefinitionContainers(id = "fdmprinter")[0])
|
||||
|
||||
global_compatibility = True
|
||||
common_compatibility = True
|
||||
settings = data.iterfind("./um:settings/um:setting", self.__namespaces)
|
||||
for entry in settings:
|
||||
key = entry.get("key")
|
||||
if key in self.__material_settings_setting_map:
|
||||
global_setting_values[self.__material_settings_setting_map[key]] = entry.text
|
||||
common_setting_values[self.__material_settings_setting_map[key]] = entry.text
|
||||
elif key in self.__unmapped_settings:
|
||||
if key == "hardware compatible":
|
||||
global_compatibility = parseBool(entry.text)
|
||||
common_compatibility = parseBool(entry.text)
|
||||
else:
|
||||
Logger.log("d", "Unsupported material setting %s", key)
|
||||
self._cached_values = global_setting_values
|
||||
self._cached_values = common_setting_values # from InstanceContainer ancestor
|
||||
|
||||
meta_data["compatible"] = global_compatibility
|
||||
meta_data["compatible"] = common_compatibility
|
||||
self.setMetaData(meta_data)
|
||||
self._dirty = False
|
||||
|
||||
machines = data.iterfind("./um:settings/um:machine", self.__namespaces)
|
||||
for machine in machines:
|
||||
machine_compatibility = global_compatibility
|
||||
machine_compatibility = common_compatibility
|
||||
machine_setting_values = {}
|
||||
settings = machine.iterfind("./um:setting", self.__namespaces)
|
||||
for entry in settings:
|
||||
|
@ -512,7 +512,7 @@ class XmlMaterialProfile(InstanceContainer):
|
|||
else:
|
||||
Logger.log("d", "Unsupported material setting %s", key)
|
||||
|
||||
cached_machine_setting_properties = global_setting_values.copy()
|
||||
cached_machine_setting_properties = common_setting_values.copy()
|
||||
cached_machine_setting_properties.update(machine_setting_values)
|
||||
|
||||
identifiers = machine.iterfind("./um:machine_identifier", self.__namespaces)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue