diff options
author | Chris ter Beke <ctbeke@gmail.com> | 2017-10-26 10:23:27 +0300 |
---|---|---|
committer | Chris ter Beke <ctbeke@gmail.com> | 2017-10-26 10:23:27 +0300 |
commit | b95ba24530b8ec98a8c524c46d9d644499e5cc74 (patch) | |
tree | 06994bd4746dd8ff111b901a7a6b441e5e1d3436 /cura/QualityManager.py | |
parent | c679f4aa6b121a660eb08de1e24f24280ba5619a (diff) |
Remove some changes, debugging - CURA-4451
WIP - CURA-4451
correctly show not supported when any of the extruders has a not supported profile - CURA-4451
Clean up and add comments - CURA-4451
Diffstat (limited to 'cura/QualityManager.py')
-rw-r--r-- | cura/QualityManager.py | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/cura/QualityManager.py b/cura/QualityManager.py index b6d47d919b..0312c50daf 100644 --- a/cura/QualityManager.py +++ b/cura/QualityManager.py @@ -87,7 +87,7 @@ class QualityManager: qualities = set(quality_type_dict.values())
for material_container in material_containers[1:]:
next_quality_type_dict = self.__fetchQualityTypeDictForMaterial(machine_definition, material_container)
- qualities.update(set(next_quality_type_dict.values()))
+ qualities.intersection_update(set(next_quality_type_dict.values()))
return list(qualities)
@@ -178,12 +178,32 @@ class QualityManager: def findAllUsableQualitiesForMachineAndExtruders(self, global_container_stack: "GlobalStack", extruder_stacks: List["ExtruderStack"]) -> List[InstanceContainer]:
global_machine_definition = global_container_stack.getBottom()
+ machine_manager = Application.getInstance().getMachineManager()
+ active_stack_id = machine_manager.activeStackId
+
+ materials = []
+
+ # TODO: fix this
if extruder_stacks:
- # Multi-extruder machine detected.
- materials = [stack.material for stack in extruder_stacks]
+ # Multi-extruder machine detected
+ for stack in extruder_stacks:
+ if stack.getId() == active_stack_id and machine_manager.newMaterial:
+ materials.append(machine_manager.newMaterial)
+ else:
+ materials.append(stack.material)
else:
- # Machine with one extruder.
- materials = [global_container_stack.material]
+ # Machine with one extruder
+ if global_container_stack.getId() == active_stack_id and machine_manager.newMaterial:
+ materials.append(machine_manager.newMaterial)
+ else:
+ materials.append(global_container_stack.material)
+
+ # if extruder_stacks:
+ # # Multi-extruder machine detected.
+ # materials = [stack.material for stack in extruder_stacks]
+ # else:
+ # # Machine with one extruder.
+ # materials = [global_container_stack.material]
quality_types = self.findAllQualityTypesForMachineAndMaterials(global_machine_definition, materials)
|