mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Interpret material compatible 'unknown' as 'yes'
We decide whether it is unknown (or unsupported) based on the availability of profiles for it. Contributes to issue EM-1662.
This commit is contained in:
parent
95b825a4c5
commit
d6941fef2f
1 changed files with 8 additions and 5 deletions
|
@ -8,7 +8,6 @@ import xml.etree.ElementTree as ET
|
|||
|
||||
from UM.Resources import Resources
|
||||
from UM.Logger import Logger
|
||||
from UM.Util import parseBool
|
||||
from cura.CuraApplication import CuraApplication
|
||||
|
||||
import UM.Dictionary
|
||||
|
@ -485,7 +484,7 @@ class XmlMaterialProfile(InstanceContainer):
|
|||
common_setting_values[self.__material_settings_setting_map[key]] = entry.text
|
||||
elif key in self.__unmapped_settings:
|
||||
if key == "hardware compatible":
|
||||
common_compatibility = parseBool(entry.text)
|
||||
common_compatibility = self._parseCompatibleValue(entry.text)
|
||||
else:
|
||||
Logger.log("d", "Unsupported material setting %s", key)
|
||||
self._cached_values = common_setting_values # from InstanceContainer ancestor
|
||||
|
@ -505,7 +504,7 @@ class XmlMaterialProfile(InstanceContainer):
|
|||
machine_setting_values[self.__material_settings_setting_map[key]] = entry.text
|
||||
elif key in self.__unmapped_settings:
|
||||
if key == "hardware compatible":
|
||||
machine_compatibility = parseBool(entry.text)
|
||||
machine_compatibility = self._parseCompatibleValue(entry.text)
|
||||
else:
|
||||
Logger.log("d", "Unsupported material setting %s", key)
|
||||
|
||||
|
@ -568,7 +567,7 @@ class XmlMaterialProfile(InstanceContainer):
|
|||
hotend_setting_values[self.__material_settings_setting_map[key]] = entry.text
|
||||
elif key in self.__unmapped_settings:
|
||||
if key == "hardware compatible":
|
||||
hotend_compatibility = parseBool(entry.text)
|
||||
hotend_compatibility = self._parseCompatibleValue(entry.text)
|
||||
else:
|
||||
Logger.log("d", "Unsupported material setting %s", key)
|
||||
|
||||
|
@ -609,6 +608,10 @@ class XmlMaterialProfile(InstanceContainer):
|
|||
else:
|
||||
return material_name
|
||||
|
||||
## Parse the value of the "material compatible" property.
|
||||
def _parseCompatibleValue(self, value: str):
|
||||
return value in {"yes", "unknown"}
|
||||
|
||||
# Map XML file setting names to internal names
|
||||
__material_settings_setting_map = {
|
||||
"print temperature": "default_material_print_temperature",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue