From 5873f1d4d09206261f27bb12c6527a7fa9aeb123 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 2 Jun 2016 11:22:39 +0200 Subject: [PATCH 01/15] Limit layer processing to 99% to indicate more stuff needs to happen Fixes CURA-1644 --- plugins/CuraEngineBackend/ProcessSlicedLayersJob.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py b/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py index d3053f9175..77a42f6b3e 100644 --- a/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py +++ b/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py @@ -96,7 +96,7 @@ class ProcessSlicedLayersJob(Job): Job.yieldThread() Job.yieldThread() current_layer += 1 - progress = (current_layer / layer_count) * 100 + progress = (current_layer / layer_count) * 99 # TODO: Rebuild the layer data mesh once the layer has been processed. # This needs some work in LayerData so we can add the new layers instead of recreating the entire mesh. From 070e791b94dcc9197e7a865d4e055b0dd26b1635 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 2 Jun 2016 11:23:18 +0200 Subject: [PATCH 02/15] Add a preference to change LayerView top layers between 1 and 5 Fixes CURA-1643 --- plugins/LayerView/LayerView.py | 16 +++++++++++++++- resources/qml/ViewPage.qml | 27 +++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/plugins/LayerView/LayerView.py b/plugins/LayerView/LayerView.py index 27bb7f022c..b5f152e825 100644 --- a/plugins/LayerView/LayerView.py +++ b/plugins/LayerView/LayerView.py @@ -12,6 +12,7 @@ from UM.Math.Color import Color from UM.Mesh.MeshData import MeshData from UM.Job import Job from UM.Message import Message +from UM.Preferences import Preferences from UM.View.RenderBatch import RenderBatch from UM.View.GL.OpenGL import OpenGL @@ -44,7 +45,10 @@ class LayerView(View): self._top_layers_job = None self._activity = False - self._solid_layers = 1 + Preferences.getInstance().addPreference("view/top_layer_count", 1) + Preferences.getInstance().preferenceChanged.connect(self._onPreferencesChanged) + + self._solid_layers = int(Preferences.getInstance().getValue("view/top_layer_count")) self._top_layer_timer = QTimer() self._top_layer_timer.setInterval(50) @@ -212,6 +216,16 @@ class LayerView(View): self._top_layers_job = None + def _onPreferencesChanged(self, preference): + if preference != "view/top_layer_count": + return + + self._solid_layers = int(Preferences.getInstance().getValue("view/top_layer_count")) + + self._current_layer_mesh = None + self._current_layer_jumps = None + self._top_layer_timer.start() + class _CreateTopLayersJob(Job): def __init__(self, scene, layer_number, solid_layers): super().__init__() diff --git a/resources/qml/ViewPage.qml b/resources/qml/ViewPage.qml index ee0c74904a..3860f8f304 100644 --- a/resources/qml/ViewPage.qml +++ b/resources/qml/ViewPage.qml @@ -19,6 +19,7 @@ UM.PreferencesPage { UM.Preferences.resetPreference("view/show_overhang"); UM.Preferences.resetPreference("view/center_on_select"); + UM.Preferences.resetPreference("view/top_layer_count"); } Column @@ -57,12 +58,38 @@ UM.PreferencesPage } } + UM.TooltipArea { + width: childrenRect.width; + height: childrenRect.height; + text: catalog.i18nc("@info:tooltip","Displays") + + CheckBox + { + id: topLayerCheckbox + text: catalog.i18nc("@action:button","Display five top layers in layer view."); + checked: UM.Preferences.getValue("view/top_layer_count") == 5 + onClicked: + { + if(UM.Preferences.getValue("view/top_layer_count") == 5) + { + UM.Preferences.setValue("view/top_layer_count", 1) + } + else + { + UM.Preferences.setValue("view/top_layer_count", 5) + } + } + } + } + Connections { target: UM.Preferences onPreferenceChanged: { overhangCheckbox.checked = boolCheck(UM.Preferences.getValue("view/show_overhang")) centerCheckbox.checked = boolCheck(UM.Preferences.getValue("view/center_on_select")) + topLayerCheckbox = UM.Preferences.getValue("view/top_layer_count") == 5 + } } } From 02b8fa90437d5aac8875ce52145344affa8d7dec Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 2 Jun 2016 12:46:01 +0200 Subject: [PATCH 03/15] Add missing tooltip CURA-1643 --- resources/qml/ViewPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/ViewPage.qml b/resources/qml/ViewPage.qml index 3860f8f304..1763325e18 100644 --- a/resources/qml/ViewPage.qml +++ b/resources/qml/ViewPage.qml @@ -61,7 +61,7 @@ UM.PreferencesPage UM.TooltipArea { width: childrenRect.width; height: childrenRect.height; - text: catalog.i18nc("@info:tooltip","Displays") + text: catalog.i18nc("@info:tooltip","Display 5 top layers in layer view or only the top-most layer. Rendering 5 layers takes longer, but may show more information.") CheckBox { From 6257fe41d531d46476c207689b2a1375bf5fb192 Mon Sep 17 00:00:00 2001 From: Aldo Hoeben Date: Thu, 2 Jun 2016 14:50:02 +0200 Subject: [PATCH 04/15] Remove unsanctioned PLA profile --- .../ultimaker2+/pla_0.4_ulti.curaprofile | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 resources/profiles/ultimaker2+/pla_0.4_ulti.curaprofile diff --git a/resources/profiles/ultimaker2+/pla_0.4_ulti.curaprofile b/resources/profiles/ultimaker2+/pla_0.4_ulti.curaprofile deleted file mode 100644 index 5cb807de01..0000000000 --- a/resources/profiles/ultimaker2+/pla_0.4_ulti.curaprofile +++ /dev/null @@ -1,23 +0,0 @@ -[general] -version = 1 -name = Ulti Quality -machine_type = ultimaker2plus -machine_variant = 0.4 mm -material = PLA -weight = -4 - -[settings] -line_width = 0.35 -layer_height = 0.04 -layer_height_0 = 0.26 -wall_thickness = 1.4 -top_bottom_thickness = 1.12 -infill_sparse_density = 25 -retraction_amount = 5.5 -retraction_extrusion_window = 6 -speed_print = 30 -speed_infill = 50 -speed_wall_x = 40 -speed_topbottom = 20 -speed_layer_0 = 25 -cool_min_layer_time_fan_speed_max = 15 From 889844e34bfd5733aa23e58a392ca9f2f031cfd3 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Tue, 7 Jun 2016 11:39:23 +0200 Subject: [PATCH 05/15] profiles: speed changes (extra overrides) (CURA-1662) --- resources/profiles/ultimaker2+/abs_0.4_fast.curaprofile | 2 ++ resources/profiles/ultimaker2+/abs_0.4_high.curaprofile | 1 + resources/profiles/ultimaker2+/abs_0.4_normal.curaprofile | 1 + resources/profiles/ultimaker2+/abs_0.6_normal.curaprofile | 1 + resources/profiles/ultimaker2+/cpe_0.4_fast.curaprofile | 1 + resources/profiles/ultimaker2+/cpe_0.4_high.curaprofile | 1 + resources/profiles/ultimaker2+/cpe_0.4_normal.curaprofile | 1 + resources/profiles/ultimaker2+/pla_0.4_fast.curaprofile | 2 ++ resources/profiles/ultimaker2+/pla_0.4_high.curaprofile | 1 + resources/profiles/ultimaker2+/pla_0.4_normal.curaprofile | 1 + resources/profiles/ultimaker2+/pla_0.6_normal.curaprofile | 3 +++ resources/profiles/ultimaker2+/pla_0.8_normal.curaprofile | 1 + 12 files changed, 16 insertions(+) diff --git a/resources/profiles/ultimaker2+/abs_0.4_fast.curaprofile b/resources/profiles/ultimaker2+/abs_0.4_fast.curaprofile index 50018372b5..96e99f8a3d 100644 --- a/resources/profiles/ultimaker2+/abs_0.4_fast.curaprofile +++ b/resources/profiles/ultimaker2+/abs_0.4_fast.curaprofile @@ -12,6 +12,8 @@ wall_thickness = 0.7 top_bottom_thickness = 0.75 infill_sparse_density = 18 speed_print = 55 +speed_wall = 40 +speed_topbottom = 30 speed_travel = 150 speed_layer_0 = 30 cool_min_layer_time = 3 diff --git a/resources/profiles/ultimaker2+/abs_0.4_high.curaprofile b/resources/profiles/ultimaker2+/abs_0.4_high.curaprofile index 341c9cc34f..66a72e17bf 100644 --- a/resources/profiles/ultimaker2+/abs_0.4_high.curaprofile +++ b/resources/profiles/ultimaker2+/abs_0.4_high.curaprofile @@ -12,6 +12,7 @@ wall_thickness = 1.05 top_bottom_thickness = 0.72 infill_sparse_density = 22 speed_print = 45 +speed_wall = 30 cool_min_layer_time = 3 cool_fan_speed_min = 20 cool_min_speed = 10 diff --git a/resources/profiles/ultimaker2+/abs_0.4_normal.curaprofile b/resources/profiles/ultimaker2+/abs_0.4_normal.curaprofile index d8fce8a4dd..c6baaf448e 100644 --- a/resources/profiles/ultimaker2+/abs_0.4_normal.curaprofile +++ b/resources/profiles/ultimaker2+/abs_0.4_normal.curaprofile @@ -12,6 +12,7 @@ wall_thickness = 1.05 top_bottom_thickness = 0.8 infill_sparse_density = 20 speed_print = 45 +speed_wall = 30 cool_min_layer_time = 3 cool_fan_speed_min = 20 cool_min_speed = 10 diff --git a/resources/profiles/ultimaker2+/abs_0.6_normal.curaprofile b/resources/profiles/ultimaker2+/abs_0.6_normal.curaprofile index 5512450471..9699b4e0c9 100644 --- a/resources/profiles/ultimaker2+/abs_0.6_normal.curaprofile +++ b/resources/profiles/ultimaker2+/abs_0.6_normal.curaprofile @@ -12,6 +12,7 @@ wall_thickness = 1.59 top_bottom_thickness = 1.2 infill_sparse_density = 20 speed_print = 40 +speed_infill = 55 cool_min_layer_time = 3 cool_fan_speed_min = 50 cool_min_speed = 20 diff --git a/resources/profiles/ultimaker2+/cpe_0.4_fast.curaprofile b/resources/profiles/ultimaker2+/cpe_0.4_fast.curaprofile index f9050e5ce5..550b8f46e3 100644 --- a/resources/profiles/ultimaker2+/cpe_0.4_fast.curaprofile +++ b/resources/profiles/ultimaker2+/cpe_0.4_fast.curaprofile @@ -12,6 +12,7 @@ wall_thickness = 0.7 top_bottom_thickness = 0.75 infill_sparse_density = 18 speed_print = 45 +speed_wall = 40 speed_travel = 150 speed_layer_0 = 30 cool_min_layer_time = 3 diff --git a/resources/profiles/ultimaker2+/cpe_0.4_high.curaprofile b/resources/profiles/ultimaker2+/cpe_0.4_high.curaprofile index 377ab5b257..88db3c4bec 100644 --- a/resources/profiles/ultimaker2+/cpe_0.4_high.curaprofile +++ b/resources/profiles/ultimaker2+/cpe_0.4_high.curaprofile @@ -12,6 +12,7 @@ wall_thickness = 1.05 top_bottom_thickness = 0.72 infill_sparse_density = 22 speed_print = 45 +speed_wall = 30 cool_min_layer_time = 2 cool_fan_speed_min = 80 cool_min_speed = 15 diff --git a/resources/profiles/ultimaker2+/cpe_0.4_normal.curaprofile b/resources/profiles/ultimaker2+/cpe_0.4_normal.curaprofile index e8142405ff..91a82753ac 100644 --- a/resources/profiles/ultimaker2+/cpe_0.4_normal.curaprofile +++ b/resources/profiles/ultimaker2+/cpe_0.4_normal.curaprofile @@ -12,6 +12,7 @@ wall_thickness = 1.05 top_bottom_thickness = 0.8 infill_sparse_density = 20 speed_print = 45 +speed_wall = 30 cool_min_layer_time = 3 cool_fan_speed_min = 80 cool_min_speed = 10 diff --git a/resources/profiles/ultimaker2+/pla_0.4_fast.curaprofile b/resources/profiles/ultimaker2+/pla_0.4_fast.curaprofile index 06e401c139..c03c8ce621 100644 --- a/resources/profiles/ultimaker2+/pla_0.4_fast.curaprofile +++ b/resources/profiles/ultimaker2+/pla_0.4_fast.curaprofile @@ -12,6 +12,8 @@ wall_thickness = 0.7 top_bottom_thickness = 0.75 infill_sparse_density = 18 speed_print = 60 +speed_wall = 50 +speed_topbottom = 30 speed_travel = 150 speed_layer_0 = 30 cool_min_layer_time = 5 diff --git a/resources/profiles/ultimaker2+/pla_0.4_high.curaprofile b/resources/profiles/ultimaker2+/pla_0.4_high.curaprofile index 5e2f762354..7cba49b71e 100644 --- a/resources/profiles/ultimaker2+/pla_0.4_high.curaprofile +++ b/resources/profiles/ultimaker2+/pla_0.4_high.curaprofile @@ -12,5 +12,6 @@ wall_thickness = 1.05 top_bottom_thickness = 0.72 infill_sparse_density = 22 speed_print = 50 +speed_topbottom = 20 cool_min_layer_time = 5 cool_min_speed = 10 diff --git a/resources/profiles/ultimaker2+/pla_0.4_normal.curaprofile b/resources/profiles/ultimaker2+/pla_0.4_normal.curaprofile index 689a3251b2..4989b0e780 100644 --- a/resources/profiles/ultimaker2+/pla_0.4_normal.curaprofile +++ b/resources/profiles/ultimaker2+/pla_0.4_normal.curaprofile @@ -12,5 +12,6 @@ wall_thickness = 1.05 top_bottom_thickness = 0.8 infill_sparse_density = 20 speed_print = 50 +speed_topbottom = 20 cool_min_layer_time = 5 cool_min_speed = 10 diff --git a/resources/profiles/ultimaker2+/pla_0.6_normal.curaprofile b/resources/profiles/ultimaker2+/pla_0.6_normal.curaprofile index 188ed42a95..767a3d5ef5 100644 --- a/resources/profiles/ultimaker2+/pla_0.6_normal.curaprofile +++ b/resources/profiles/ultimaker2+/pla_0.6_normal.curaprofile @@ -12,5 +12,8 @@ wall_thickness = 1.59 top_bottom_thickness = 1.2 infill_sparse_density = 20 speed_print = 55 +speed_wall = 40 +speed_wall_0 = 25 +speed_topbottom = 20 cool_min_layer_time = 5 cool_min_speed = 10 diff --git a/resources/profiles/ultimaker2+/pla_0.8_normal.curaprofile b/resources/profiles/ultimaker2+/pla_0.8_normal.curaprofile index 92cb4a6054..a8d50c78df 100644 --- a/resources/profiles/ultimaker2+/pla_0.8_normal.curaprofile +++ b/resources/profiles/ultimaker2+/pla_0.8_normal.curaprofile @@ -12,5 +12,6 @@ wall_thickness = 2.1 top_bottom_thickness = 1.2 infill_sparse_density = 20 speed_print = 40 +speed_wall_0 = 25 cool_min_layer_time = 5 cool_min_speed = 10 From b14b05d6fb5615b5c8fc30f228d430b4017a4fcc Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Tue, 7 Jun 2016 12:12:14 +0200 Subject: [PATCH 06/15] JSON: upped the retraction_count_max further up to 90 (CURA-1662) --- resources/machines/fdmprinter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/machines/fdmprinter.json b/resources/machines/fdmprinter.json index 2b172d1720..a523627b7d 100644 --- a/resources/machines/fdmprinter.json +++ b/resources/machines/fdmprinter.json @@ -760,7 +760,7 @@ "retraction_count_max": { "label": "Maximum Retraction Count", "description": "This setting limits the number of retractions occurring within the minimum extrusion distance window. Further retractions within this window will be ignored. This avoids retracting repeatedly on the same piece of filament, as that can flatten the filament and cause grinding issues.", - "default": 45, + "default": 90, "min_value": "0", "max_value_warning": "100", "type": "int", From 8a7e549a27c6b6f9fe28c7d944097f093fdf1224 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Wed, 8 Jun 2016 15:40:15 +0200 Subject: [PATCH 07/15] Merge fix of 2.1 Max Retraction count 45 ==> 90 wasn't taken along --- resources/definitions/fdmprinter.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 29db032aa1..8be258c79e 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -890,7 +890,7 @@ "retraction_count_max": { "label": "Maximum Retraction Count", "description": "This setting limits the number of retractions occurring within the minimum extrusion distance window. Further retractions within this window will be ignored. This avoids retracting repeatedly on the same piece of filament, as that can flatten the filament and cause grinding issues.", - "default_value": 45, + "default_value": 90, "minimum_value": "0", "maximum_value_warning": "100", "type": "int", From cc7369c59476aa49bb7c515dc6dca2d4ce75db83 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Wed, 8 Jun 2016 15:43:22 +0200 Subject: [PATCH 08/15] profiles fix: duplicated UM2+ profile changes from 2.1 to the UM2E+ profiles (CURA-1662) --- .../ultimaker2_extended_plus/um2ep_abs_0.4_fast.inst.cfg | 2 ++ .../ultimaker2_extended_plus/um2ep_abs_0.4_high.inst.cfg | 1 + .../ultimaker2_extended_plus/um2ep_abs_0.4_normal.inst.cfg | 1 + .../ultimaker2_extended_plus/um2ep_abs_0.6_normal.inst.cfg | 1 + .../ultimaker2_extended_plus/um2ep_cpe_0.4_fast.inst.cfg | 1 + .../ultimaker2_extended_plus/um2ep_cpe_0.4_high.inst.cfg | 1 + .../ultimaker2_extended_plus/um2ep_cpe_0.4_normal.inst.cfg | 1 + 7 files changed, 8 insertions(+) diff --git a/resources/quality/ultimaker2_extended_plus/um2ep_abs_0.4_fast.inst.cfg b/resources/quality/ultimaker2_extended_plus/um2ep_abs_0.4_fast.inst.cfg index f554c7f058..139c8cb976 100644 --- a/resources/quality/ultimaker2_extended_plus/um2ep_abs_0.4_fast.inst.cfg +++ b/resources/quality/ultimaker2_extended_plus/um2ep_abs_0.4_fast.inst.cfg @@ -15,6 +15,8 @@ wall_thickness = 0.7 top_bottom_thickness = 0.75 infill_sparse_density = 18 speed_print = 55 +speed_wall = 40 +speed_topbottom = 30 speed_travel = 150 speed_layer_0 = 30 cool_min_layer_time = 3 diff --git a/resources/quality/ultimaker2_extended_plus/um2ep_abs_0.4_high.inst.cfg b/resources/quality/ultimaker2_extended_plus/um2ep_abs_0.4_high.inst.cfg index c1a8136cf5..8d021f4d91 100644 --- a/resources/quality/ultimaker2_extended_plus/um2ep_abs_0.4_high.inst.cfg +++ b/resources/quality/ultimaker2_extended_plus/um2ep_abs_0.4_high.inst.cfg @@ -15,6 +15,7 @@ wall_thickness = 1.05 top_bottom_thickness = 0.72 infill_sparse_density = 22 speed_print = 45 +speed_wall = 30 cool_min_layer_time = 3 cool_fan_speed_min = 20 cool_min_speed = 10 diff --git a/resources/quality/ultimaker2_extended_plus/um2ep_abs_0.4_normal.inst.cfg b/resources/quality/ultimaker2_extended_plus/um2ep_abs_0.4_normal.inst.cfg index eabc9827a1..3f89bdeee6 100644 --- a/resources/quality/ultimaker2_extended_plus/um2ep_abs_0.4_normal.inst.cfg +++ b/resources/quality/ultimaker2_extended_plus/um2ep_abs_0.4_normal.inst.cfg @@ -15,6 +15,7 @@ wall_thickness = 1.05 top_bottom_thickness = 0.8 infill_sparse_density = 20 speed_print = 45 +speed_wall = 30 cool_min_layer_time = 3 cool_fan_speed_min = 20 cool_min_speed = 10 diff --git a/resources/quality/ultimaker2_extended_plus/um2ep_abs_0.6_normal.inst.cfg b/resources/quality/ultimaker2_extended_plus/um2ep_abs_0.6_normal.inst.cfg index 64e0ec72fb..ea67bcc0b2 100644 --- a/resources/quality/ultimaker2_extended_plus/um2ep_abs_0.6_normal.inst.cfg +++ b/resources/quality/ultimaker2_extended_plus/um2ep_abs_0.6_normal.inst.cfg @@ -15,6 +15,7 @@ wall_thickness = 1.59 top_bottom_thickness = 1.2 infill_sparse_density = 20 speed_print = 40 +speed_infill = 55 cool_min_layer_time = 3 cool_fan_speed_min = 50 cool_min_speed = 20 diff --git a/resources/quality/ultimaker2_extended_plus/um2ep_cpe_0.4_fast.inst.cfg b/resources/quality/ultimaker2_extended_plus/um2ep_cpe_0.4_fast.inst.cfg index ae9b437010..5f402d50aa 100644 --- a/resources/quality/ultimaker2_extended_plus/um2ep_cpe_0.4_fast.inst.cfg +++ b/resources/quality/ultimaker2_extended_plus/um2ep_cpe_0.4_fast.inst.cfg @@ -15,6 +15,7 @@ wall_thickness = 0.7 top_bottom_thickness = 0.75 infill_sparse_density = 18 speed_print = 45 +speed_wall = 40 speed_travel = 150 speed_layer_0 = 30 cool_min_layer_time = 3 diff --git a/resources/quality/ultimaker2_extended_plus/um2ep_cpe_0.4_high.inst.cfg b/resources/quality/ultimaker2_extended_plus/um2ep_cpe_0.4_high.inst.cfg index e3fa254a74..2b35097f66 100644 --- a/resources/quality/ultimaker2_extended_plus/um2ep_cpe_0.4_high.inst.cfg +++ b/resources/quality/ultimaker2_extended_plus/um2ep_cpe_0.4_high.inst.cfg @@ -15,6 +15,7 @@ wall_thickness = 1.05 top_bottom_thickness = 0.72 infill_sparse_density = 22 speed_print = 45 +speed_wall = 30 cool_min_layer_time = 2 cool_fan_speed_min = 80 cool_min_speed = 15 diff --git a/resources/quality/ultimaker2_extended_plus/um2ep_cpe_0.4_normal.inst.cfg b/resources/quality/ultimaker2_extended_plus/um2ep_cpe_0.4_normal.inst.cfg index 48e767e1cb..41e9fab6d3 100644 --- a/resources/quality/ultimaker2_extended_plus/um2ep_cpe_0.4_normal.inst.cfg +++ b/resources/quality/ultimaker2_extended_plus/um2ep_cpe_0.4_normal.inst.cfg @@ -15,6 +15,7 @@ wall_thickness = 1.05 top_bottom_thickness = 0.8 infill_sparse_density = 20 speed_print = 45 +speed_wall = 30 cool_min_layer_time = 3 cool_fan_speed_min = 80 cool_min_speed = 10 From 860846880212c89f2b0aca718b23b15acba4a3e8 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 8 Jun 2016 16:32:39 +0200 Subject: [PATCH 09/15] Add a method to get the id of the current user profile CURA-1668 --- cura/MachineManagerModel.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cura/MachineManagerModel.py b/cura/MachineManagerModel.py index 2738bfd764..e719c05743 100644 --- a/cura/MachineManagerModel.py +++ b/cura/MachineManagerModel.py @@ -105,7 +105,7 @@ class MachineManagerModel(QObject): @pyqtSlot(str, str) def addMachine(self, name, definition_id): - definitions = UM.Settings.ContainerRegistry.getInstance().findDefinitionContainers(id=definition_id) + definitions = UM.Settings.ContainerRegistry.getInstance().findDefinitionContainers(id = definition_id) if definitions: definition = definitions[0] name = self._createUniqueName("machine", "", name, definition.getName()) @@ -205,6 +205,13 @@ class MachineManagerModel(QObject): def isGlobalStackValid(self): return self._global_stack_valid + @pyqtProperty(str, notify = globalContainerChanged) + def activeUserProfileId(self): + if self._global_container_stack: + return self._global_container_stack.getTop().getId() + + return "" + @pyqtProperty(str, notify = globalContainerChanged) def activeMachineName(self): if self._global_container_stack: From 1131623278227f9e7ab4db9b5fd42ff54a27f961 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Wed, 8 Jun 2016 16:33:58 +0200 Subject: [PATCH 10/15] Disable the property editor when the value of the setting is not used Contributes to CURA-1278 --- resources/qml/Settings/SettingItem.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/qml/Settings/SettingItem.qml b/resources/qml/Settings/SettingItem.qml index 9ed75bdecf..8160489b01 100644 --- a/resources/qml/Settings/SettingItem.qml +++ b/resources/qml/Settings/SettingItem.qml @@ -205,6 +205,8 @@ Item { { id: controlContainer; + enabled: provider.isValueUsed + anchors.right: parent.right; anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.verticalCenter: parent.verticalCenter; From 485ae53660d5c234084403ab7d13125470ca7bcf Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 8 Jun 2016 16:35:10 +0200 Subject: [PATCH 11/15] Show quality profile and user profile settings side-by-side on Profiles manager Introduces ContainerSettingsModel, which can combine the settings of instances from multiple containers into one model. Towards CURA-1668 --- cura/ContainerSettingsModel.py | 104 +++++++++++++++++++++ cura/CuraApplication.py | 3 + resources/qml/Preferences/ProfilesPage.qml | 11 ++- 3 files changed, 115 insertions(+), 3 deletions(-) create mode 100644 cura/ContainerSettingsModel.py diff --git a/cura/ContainerSettingsModel.py b/cura/ContainerSettingsModel.py new file mode 100644 index 0000000000..23d20cd6e2 --- /dev/null +++ b/cura/ContainerSettingsModel.py @@ -0,0 +1,104 @@ +from UM.Application import Application +from UM.Qt.ListModel import ListModel + +from PyQt5.QtCore import pyqtProperty, Qt, pyqtSignal, pyqtSlot, QUrl + +from UM.Settings.ContainerRegistry import ContainerRegistry +from UM.Settings.InstanceContainer import InstanceContainer + +class ContainerSettingsModel(ListModel): + LabelRole = Qt.UserRole + 1 + CategoryRole = Qt.UserRole + 2 + UnitRole = Qt.UserRole + 3 + ValuesRole = Qt.UserRole + 4 + + def __init__(self, parent = None): + super().__init__(parent) + self.addRoleName(self.LabelRole, "label") + self.addRoleName(self.CategoryRole, "category") + self.addRoleName(self.UnitRole, "unit") + self.addRoleName(self.ValuesRole, "values") + + self._container_ids = [] + self._container = None + + self._global_container_stack = None + Application.getInstance().globalContainerStackChanged.connect(self._onGlobalContainerChanged) + self._update() + + def _onGlobalContainerChanged(self): + if self._global_container_stack: + self._global_container_stack.containersChanged.disconnect(self._onInstanceContainersChanged) + self._global_container_stack.propertyChanged.disconnect(self._onGlobalPropertyChanged) + + self._global_container_stack = Application.getInstance().getGlobalContainerStack() + + if self._global_container_stack: + Preferences.getInstance().setValue("cura/active_machine", self._global_container_stack.getId()) + self._global_container_stack.containersChanged.connect(self._onInstanceContainersChanged) + self._global_container_stack.propertyChanged.connect(self._onGlobalPropertyChanged) + + self._update() + + def _onGlobalPropertyChanged(self, key, property_name): + if property_name == "value": + self._update() + + def _onInstanceContainersChanged(self, container): + self._update() + + def _update(self): + self.clear() + + if len(self._container_ids) == 0: + return + + keys = [] + containers = [] + for container_id in self._container_ids: + container = ContainerRegistry.getInstance().findContainers(id = container_id) + if not container: + return + + keys = keys + list(container[0].getAllKeys()) + containers.append(container[0]) + + keys = list(set(keys)) + keys.sort() + + for key in keys: + definition = None + category = None + values = [] + for container in containers: + + instance = container.getInstance(key) + if instance: + definition = instance.definition + + # Traverse up to find the category + category = definition + while category.type != "category": + category = category.parent + + values.append(container.getProperty(key, "value")) + else: + values.append("") + + self.appendItem({ + "key": key, + "values": values, + "label": definition.label, + "unit": definition.unit, + "category": category.label + }) + + ## Set the id of the container which has the settings this model should list. + def setContainers(self, container_ids): + self._container_ids = container_ids + self._update() + + containersChanged = pyqtSignal() + @pyqtProperty("QVariantList", fset = setContainers, notify = containersChanged) + def containers(self): + return self.container_ids \ No newline at end of file diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 8acd3eda2a..9abfabc7b2 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -42,6 +42,7 @@ from . import MultiMaterialDecorator from . import ZOffsetDecorator from . import CuraSplashScreen from . import MachineManagerModel +from . import ContainerSettingsModel from PyQt5.QtCore import pyqtSlot, QUrl, pyqtSignal, pyqtProperty, QEvent, Q_ENUMS from PyQt5.QtGui import QColor, QIcon @@ -400,6 +401,8 @@ class CuraApplication(QtApplication): qmlRegisterType(ExtrudersModel.ExtrudersModel, "Cura", 1, 0, "ExtrudersModel") + qmlRegisterType(ContainerSettingsModel.ContainerSettingsModel, "Cura", 1, 0, "ContainerSettingsModel") + qmlRegisterSingletonType(QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, "Actions.qml")), "Cura", 1, 0, "Actions") engine.rootContext().setContextProperty("ExtruderManager", ExtruderManager.ExtruderManager.getInstance()) diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index ed9c20f65f..ee7653f96e 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -128,16 +128,21 @@ UM.ManagementPage anchors.bottom: parent.bottom ListView { - model: base.currentItem ? base.currentItem.settings: null + model: Cura.ContainerSettingsModel{ containers: [base.currentItem.id, Cura.MachineManager.activeUserProfileId] } delegate: Row { + property variant setting: model spacing: UM.Theme.getSize("default_margin").width Label { text: model.label elide: Text.ElideMiddle width: scrollView.width / 100 * 40 } - Label { - text: model.value.toString() + Repeater { + model: setting.values.length + Label { + text: setting.values[index].toString() + width: scrollView.width / 100 * 10 + } } Label { text: model.unit From 7dbafa06d1ae2b53e77726dee45662d721470ccb Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 8 Jun 2016 16:00:52 +0200 Subject: [PATCH 12/15] Make SidebarHeader use ExtrudersModel This model is also used by the extruder selection drop-downs, and it's automatically filled already so that was double logic. Contributes to issues CURA-340 and CURA-1278. --- resources/qml/SidebarHeader.qml | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 237746ac0d..75f5393d57 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -104,7 +104,7 @@ Item anchors.leftMargin: model.index * (extruderSelection.width / machineExtruderCount.properties.value) anchors.verticalCenter: parent.verticalCenter width: parent.width / machineExtruderCount.properties.value - text: model.text + text: model.name exclusiveGroup: extruderMenuGroup; checkable: true; checked: base.currentExtruderIndex == index @@ -138,10 +138,11 @@ Item } } ExclusiveGroup { id: extruderMenuGroup; } - ListView{ + ListView + { id: extrudersList property var index: 0 - model: extrudersListModel + model: Cura.ExtrudersModel {} delegate: wizardDelegate anchors.top: parent.top anchors.left: parent.left @@ -149,28 +150,6 @@ Item } } - ListModel - { - id: extrudersListModel - Component.onCompleted: populateExtruderModel() - } - Connections - { - id: machineChange - target: Cura.MachineManager - onGlobalContainerChanged: populateExtruderModel() - } - - function populateExtruderModel() - { - extrudersListModel.clear(); - for(var extruder = 0; extruder < machineExtruderCount.properties.value ; extruder++) { - extrudersListModel.append({ - text: catalog.i18nc("@label", "Extruder %1").arg(extruder + 1) - }) - } - } - Rectangle { id: variantRow anchors.top: extruderSelection.visible ? extruderSelection.bottom : machineSelectionRow.bottom From 4d418a7c1a94ddfe11a3f3e6b252821b9e077d73 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 8 Jun 2016 16:26:57 +0200 Subject: [PATCH 13/15] When switching active extruder, get the extruder train from definition id Not from extruder container stack ID. Contributes to issues CURA-340 and CURA-1278. --- cura/ExtruderManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/ExtruderManager.py b/cura/ExtruderManager.py index b4d05d7e6c..c8a07a4000 100644 --- a/cura/ExtruderManager.py +++ b/cura/ExtruderManager.py @@ -36,7 +36,7 @@ class ExtruderManager(QObject): if not UM.Application.getInstance().getGlobalContainerStack(): return None #No active machine, so no active extruder. try: - return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()][str(self._active_extruder_index)] + return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getBottom().getId()][str(self._active_extruder_index)] except KeyError: #Extruder index could be -1 if the global tab is selected, or the entry doesn't exist if the machine definition is wrong. return None From da467b9b2806af69fb55f51f2b8a73b095c69cd6 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 8 Jun 2016 16:45:20 +0200 Subject: [PATCH 14/15] Only shown the current settings column when the currently active quality profile is selected CURA-1668 --- resources/qml/Preferences/ProfilesPage.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index ee7653f96e..3307c1e2a5 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -93,7 +93,7 @@ UM.ManagementPage Row { id: currentSettingsActions - visible: base.currentItem.id == -1 || currentItem.id == Cura.MachineManager.activeQualityId + visible: currentItem.id == Cura.MachineManager.activeQualityId anchors.left: parent.left anchors.top: profileName.bottom @@ -128,7 +128,7 @@ UM.ManagementPage anchors.bottom: parent.bottom ListView { - model: Cura.ContainerSettingsModel{ containers: [base.currentItem.id, Cura.MachineManager.activeUserProfileId] } + model: Cura.ContainerSettingsModel{ containers: (currentItem.id == Cura.MachineManager.activeQualityId) ? [base.currentItem.id, Cura.MachineManager.activeUserProfileId] : [base.currentItem.id] } delegate: Row { property variant setting: model spacing: UM.Theme.getSize("default_margin").width From 07b51d0ca8813f95a76e252651113bf398c68010 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 8 Jun 2016 17:04:04 +0200 Subject: [PATCH 15/15] Strike out profile value if it is overridden by the current setting CURA-1668 --- resources/qml/Preferences/ProfilesPage.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index 3307c1e2a5..14569464d6 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -142,6 +142,8 @@ UM.ManagementPage Label { text: setting.values[index].toString() width: scrollView.width / 100 * 10 + font.strikeout: index < setting.values.length - 1 && setting.values[index + 1] != "" + opacity: font.strikeout ? 0.5 : 1 } } Label {