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:
authorGhostkeeper <rubend@tutanota.com>2017-09-22 13:58:20 +0300
committerGhostkeeper <rubend@tutanota.com>2017-09-22 13:58:20 +0300
commit2020e355a2558a6dc3cde29e0e5693ad57604bd2 (patch)
tree9c279225cbd988952a13f6d7a88dbba9a71ca449 /cura/Settings
parentbf6c6891c4cf91ebf87ff9046fd6fc4037cc86bd (diff)
parent0fa3bdd68b868a45690b86c07666ae8a4486d9a6 (diff)
Merge branch '3.0' of github.com:Ultimaker/Cura into 3.0
Contributes to issue CURA-4357.
Diffstat (limited to 'cura/Settings')
-rw-r--r--cura/Settings/ProfilesModel.py28
1 files changed, 8 insertions, 20 deletions
diff --git a/cura/Settings/ProfilesModel.py b/cura/Settings/ProfilesModel.py
index e39ed949b0..c7348ea920 100644
--- a/cura/Settings/ProfilesModel.py
+++ b/cura/Settings/ProfilesModel.py
@@ -110,12 +110,11 @@ class ProfilesModel(InstanceContainersModel):
# active machine and material, and later yield the right ones.
tmp_all_quality_items = OrderedDict()
for item in super()._recomputeItems():
- profile = container_registry.findContainers(id = item["id"])
+ profile = container_registry.findContainers(id=item["id"])
quality_type = profile[0].getMetaDataEntry("quality_type") if profile else ""
if quality_type not in tmp_all_quality_items:
- tmp_all_quality_items[quality_type] = {"suitable_container": None,
- "all_containers": []}
+ tmp_all_quality_items[quality_type] = {"suitable_container": None, "all_containers": []}
tmp_all_quality_items[quality_type]["all_containers"].append(item)
if tmp_all_quality_items[quality_type]["suitable_container"] is None and profile[0] in qualities:
@@ -126,25 +125,14 @@ class ProfilesModel(InstanceContainersModel):
for key in reversed(tmp_all_quality_items.keys()):
all_quality_items[key] = tmp_all_quality_items[key]
- # First the suitable containers are set in the model
- containers = []
- for data_item in all_quality_items.values():
- suitable_item = data_item["suitable_container"]
- if suitable_item is None:
- suitable_item = data_item["all_containers"][0]
- containers.append(suitable_item)
-
- # Once the suitable containers are collected, the rest of the containers are appended
for data_item in all_quality_items.values():
- for item in data_item["all_containers"]:
- if item not in containers:
- containers.append(item)
+ item = data_item["suitable_container"]
+ if item is None:
+ item = data_item["all_containers"][0]
- # Now all the containers are set
- for item in containers:
profile = container_registry.findContainers(id = item["id"])
if not profile:
- item["layer_height"] = "" #Can't update a profile that is unknown.
+ item["layer_height"] = "" # Can't update a profile that is unknown.
item["available"] = False
yield item
continue
@@ -152,13 +140,13 @@ class ProfilesModel(InstanceContainersModel):
profile = profile[0]
item["available"] = profile in qualities
- #Easy case: This profile defines its own layer height.
+ # Easy case: This profile defines its own layer height.
if profile.hasProperty("layer_height", "value"):
self._setItemLayerHeight(item, profile.getProperty("layer_height", "value"), unit)
yield item
continue
- #Quality-changes profile that has no value for layer height. Get the corresponding quality profile and ask that profile.
+ # Quality-changes profile that has no value for layer height. Get the corresponding quality profile and ask that profile.
quality_type = profile.getMetaDataEntry("quality_type", None)
if quality_type:
quality_results = machine_manager.determineQualityAndQualityChangesForQualityType(quality_type)