mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-23 06:09:38 +08:00
Fix recommended mode
CURA-6706
This commit is contained in:
parent
2033f24a17
commit
d99386cf2e
@ -65,14 +65,26 @@ class IntentModel(ListModel):
|
|||||||
|
|
||||||
material_nodes = self._getActiveMaterials()
|
material_nodes = self._getActiveMaterials()
|
||||||
|
|
||||||
layer_heights_added = [] # type: List[float]
|
added_quality_type_set = set() # type: Set[str]
|
||||||
|
|
||||||
for material_node in material_nodes:
|
for material_node in material_nodes:
|
||||||
intents = self._getIntentsForMaterial(material_node, quality_groups)
|
intents = self._getIntentsForMaterial(material_node, quality_groups)
|
||||||
for intent in intents:
|
for intent in intents:
|
||||||
if intent["layer_height"] not in layer_heights_added:
|
if intent["quality_type"] not in added_quality_type_set:
|
||||||
new_items.append(intent)
|
new_items.append(intent)
|
||||||
layer_heights_added.append(intent["layer_height"])
|
added_quality_type_set.add(intent["quality_type"])
|
||||||
|
|
||||||
|
# Now that we added all intents that we found something for, ensure that we set add ticks (and layer_heights)
|
||||||
|
# for all groups that we don't have anything for (and set it to not available)
|
||||||
|
for quality_type, quality_group in quality_groups.items():
|
||||||
|
# Add the intents that are of the correct category
|
||||||
|
if quality_type not in added_quality_type_set:
|
||||||
|
layer_height = fetchLayerHeight(quality_group)
|
||||||
|
new_items.append({"name": "Unavailable",
|
||||||
|
"quality_type": quality_type,
|
||||||
|
"layer_height": layer_height,
|
||||||
|
"intent_category": self._intent_category,
|
||||||
|
"available": False})
|
||||||
|
added_quality_type_set.add(quality_type)
|
||||||
|
|
||||||
new_items = sorted(new_items, key = lambda x: x["layer_height"])
|
new_items = sorted(new_items, key = lambda x: x["layer_height"])
|
||||||
self.setItems(new_items)
|
self.setItems(new_items)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user