Revert "Revert "Enable prime tower mode according to materials types""

This reverts commit b99762776e.
This commit is contained in:
c.lamboo 2024-02-22 12:50:53 +01:00
parent d009839f9e
commit c8f9f179d9
2 changed files with 27 additions and 8 deletions

View file

@ -579,8 +579,9 @@ class XmlMaterialProfile(InstanceContainer):
meta_data[tag_name] = entry.text
for tag_name, value in meta_data.items():
if tag_name in self.__material_metadata_setting_map:
common_setting_values[self.__material_metadata_setting_map[tag_name]] = entry.text
common_setting_values[self.__material_metadata_setting_map[tag_name]] = value
if "description" not in meta_data:
meta_data["description"] = ""
@ -1222,7 +1223,9 @@ class XmlMaterialProfile(InstanceContainer):
"diameter": "material_diameter"
}
__material_metadata_setting_map = {
"GUID": "material_guid"
"GUID": "material_guid",
"material": "material_type",
"brand": "material_brand",
}
# Map of recognised namespaces with a proper prefix.

View file

@ -76,6 +76,22 @@
"type": "str",
"enabled": false
},
"material_type":
{
"label": "Material Type",
"description": "The type of material used.",
"default_value": "",
"type": "str",
"enabled": false
},
"material_brand":
{
"label": "Material Brand",
"description": "The brand of material used.",
"default_value": "",
"type": "str",
"enabled": false
},
"material_diameter":
{
"label": "Diameter",
@ -6781,14 +6797,14 @@
"prime_tower_mode":
{
"label": "Prime Tower",
"description": "<html>Print a tower next to the model, which serves to prime the material after each nozzle switch.<ul><li><b>None:</b> do not generate a prime tower</li><li><b>Bucket:</b> generate a bucket in which secondary materials are primed</li><li><b>Sparse:</b> generate a prime tower as sparse as possible. This will save time and filament, but is only possible if the used materials adhere to each other.</li></ul></html>",
"description": "<html>Print a tower next to the model, which serves to prime the material after each nozzle switch.<ul><li><b>None:</b> do not generate a prime tower</li><li><b>Normal:</b> generate a bucket in which secondary materials are primed</li><li><b>Interleaved:</b> generate a prime tower as sparse as possible. This will save time and filament, but is only possible if the used materials adhere to each other.</li></ul></html>",
"type": "enum",
"value": "'optimized' if all(material_type == extruderValues('material_type')[0] for material_type in extruderValues('material_type')) else 'optimized_consistent'",
"value": "'none' if (extruders_enabled_count < 2) else ('interleaved' if (all(material_type_var == extruderValues('material_type')[0] for material_type_var in extruderValues('material_type')) and all(material_brand_var == extruderValues('material_brand')[0] for material_brand_var in extruderValues('material_brand'))) else 'normal')",
"options":
{
"none": "None",
"bucket": "Bucket",
"sparse": "Sparse"
"normal": "Normal",
"interleaved": "Interleaved"
},
"default_value": "none",
"enabled": "extruders_enabled_count > 1",
@ -6833,7 +6849,7 @@
"default_value": 5,
"minimum_value": "line_width",
"maximum_value_warning": "10.0",
"enabled": "resolveOrValue('prime_tower_mode') == 'sparse' or resolveOrValue('prime_tower_mode') == 'bucket'",
"enabled": "resolveOrValue('prime_tower_mode') != 'none'",
"settable_per_mesh": false,
"settable_per_extruder": true
},