Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Prado Gesto <d.pradogesto@ultimaker.com>2017-10-05 16:45:14 +0300
committerDiego Prado Gesto <d.pradogesto@ultimaker.com>2017-10-05 16:45:14 +0300
commit80ae45ac13ff6d77a098799f2f3a7f41f84e9aee (patch)
tree50bc6c475d0a381df9b67ad4411446782c881eb9 /cura/Settings
parent5e970fa5a544b208aff24c5a87e3e9b7b45fd747 (diff)
Add some comments to better understand the code - CURA-4404
Diffstat (limited to 'cura/Settings')
-rw-r--r--cura/Settings/ProfilesModel.py3
-rw-r--r--cura/Settings/QualityAndUserProfilesModel.py11
-rw-r--r--cura/Settings/UserProfilesModel.py3
3 files changed, 15 insertions, 2 deletions
diff --git a/cura/Settings/ProfilesModel.py b/cura/Settings/ProfilesModel.py
index fb3e107ee6..bf1993b184 100644
--- a/cura/Settings/ProfilesModel.py
+++ b/cura/Settings/ProfilesModel.py
@@ -100,6 +100,9 @@ class ProfilesModel(InstanceContainersModel):
extruder_stacks = extruder_manager.getActiveExtruderStacks()
if multiple_extrusion:
# Place the active extruder at the front of the list.
+ # This is a workaround checking if there is an active_extruder or not before moving it to the front of the list.
+ # Actually, when a printer has multiple extruders, should exist always an active_extruder. However, in some
+ # cases the active_extruder is still None.
if active_extruder in extruder_stacks:
extruder_stacks.remove(active_extruder)
new_extruder_stacks = []
diff --git a/cura/Settings/QualityAndUserProfilesModel.py b/cura/Settings/QualityAndUserProfilesModel.py
index 51b4c1bb1a..f2728aff14 100644
--- a/cura/Settings/QualityAndUserProfilesModel.py
+++ b/cura/Settings/QualityAndUserProfilesModel.py
@@ -33,8 +33,15 @@ class QualityAndUserProfilesModel(ProfilesModel):
extruder_stacks = extruder_manager.getActiveExtruderStacks()
if multiple_extrusion:
# Place the active extruder at the front of the list.
- extruder_stacks.remove(active_extruder)
- extruder_stacks = [active_extruder] + extruder_stacks
+ # This is a workaround checking if there is an active_extruder or not before moving it to the front of the list.
+ # Actually, when a printer has multiple extruders, should exist always an active_extruder. However, in some
+ # cases the active_extruder is still None.
+ if active_extruder in extruder_stacks:
+ extruder_stacks.remove(active_extruder)
+ new_extruder_stacks = []
+ if active_extruder is not None:
+ new_extruder_stacks = [active_extruder]
+ extruder_stacks = new_extruder_stacks + 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.
diff --git a/cura/Settings/UserProfilesModel.py b/cura/Settings/UserProfilesModel.py
index 223900306b..587e27f359 100644
--- a/cura/Settings/UserProfilesModel.py
+++ b/cura/Settings/UserProfilesModel.py
@@ -33,6 +33,9 @@ class UserProfilesModel(ProfilesModel):
extruder_stacks = extruder_manager.getActiveExtruderStacks()
if multiple_extrusion:
# Place the active extruder at the front of the list.
+ # This is a workaround checking if there is an active_extruder or not before moving it to the front of the list.
+ # Actually, when a printer has multiple extruders, should exist always an active_extruder. However, in some
+ # cases the active_extruder is still None.
if active_extruder in extruder_stacks:
extruder_stacks.remove(active_extruder)
new_extruder_stacks = []