Merge branch '2.3' of https://github.com/Ultimaker/Cura into 2.3

This commit is contained in:
fieldOfView 2016-10-13 11:31:20 +02:00
commit 3a55ec324c
3 changed files with 24 additions and 4 deletions

View file

@ -131,7 +131,8 @@ class QualityManager:
#
# \param global_container_stack \type{ContainerStack} the global machine definition
# \param extruder_stacks \type{List[ContainerStack]} the list of extruder stacks
# \return \type{List[InstanceContainer]} the list of the matching qualities
# \return \type{List[InstanceContainer]} the list of the matching qualities. The quality profiles
# return come from the first extruder in the given list of extruders.
def findAllUsableQualitiesForMachineAndExtruders(self, global_container_stack, extruder_stacks):
global_machine_definition = global_container_stack.getBottom()

View file

@ -28,5 +28,15 @@ class ProfilesModel(InstanceContainersModel):
if global_container_stack is None:
return []
# Get the list of extruders and place the selected extruder at the front of the list.
extruder_manager = ExtruderManager.getInstance()
active_extruder = extruder_manager.getActiveExtruderStack()
extruder_stacks = extruder_manager.getActiveExtruderStacks()
if active_extruder in extruder_stacks:
extruder_stacks.remove(active_extruder)
extruder_stacks = [active_extruder] + extruder_stacks
# Fetch the list of useable qualities across all extruders.
# The actual list of quality profiles come from the first extruder in the extruder list.
return QualityManager.getInstance().findAllUsableQualitiesForMachineAndExtruders(global_container_stack,
ExtruderManager.getInstance().getActiveExtruderStacks())
extruder_stacks)

View file

@ -25,9 +25,18 @@ class QualityAndUserProfilesModel(ProfilesModel):
machine_definition = quality_manager.getParentMachineDefinition(global_container_stack.getBottom())
quality_changes_list = quality_manager.findAllQualityChangesForMachine(machine_definition)
# Fetch the list of qualities
# Get the list of extruders and place the selected extruder at the front of the list.
extruder_manager = ExtruderManager.getInstance()
active_extruder = extruder_manager.getActiveExtruderStack()
extruder_stacks = extruder_manager.getActiveExtruderStacks()
if active_extruder in extruder_stacks:
extruder_stacks.remove(active_extruder)
extruder_stacks = [active_extruder] + extruder_stacks
# Fetch the list of useable qualities across all extruders.
# The actual list of quality profiles come from the first extruder in the extruder list.
quality_list = QualityManager.getInstance().findAllUsableQualitiesForMachineAndExtruders(global_container_stack,
ExtruderManager.getInstance().getActiveExtruderStacks())
extruder_stacks)
# Filter the quality_change by the list of available quality_types
quality_type_set = set([x.getMetaDataEntry("quality_type") for x in quality_list])