From 67d10ef0a226f3ee14d2e30d1621887f188a7fa5 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 29 Feb 2016 15:51:40 +0100 Subject: [PATCH 01/17] UpdateTopLayer timer is now only triggered when max layers changes CURA-969 --- plugins/LayerView/LayerView.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/LayerView/LayerView.py b/plugins/LayerView/LayerView.py index daf96d9b2e..e86590e1d0 100644 --- a/plugins/LayerView/LayerView.py +++ b/plugins/LayerView/LayerView.py @@ -158,8 +158,7 @@ class LayerView(View): else: self.setLayer(int(self._max_layers)) self.maxLayersChanged.emit() - - self._top_layer_timer.start() + self._top_layer_timer.start() maxLayersChanged = Signal() currentLayerNumChanged = Signal() From 06afed5283131e03a45f7e9828a76f89f4eb0bcd Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 29 Feb 2016 16:11:48 +0100 Subject: [PATCH 02/17] Loading files now uses home folder as default location CURA-906 --- cura/CuraApplication.py | 4 ++++ resources/qml/Cura.qml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 6e4527feec..f8bf5da148 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -129,6 +129,10 @@ class CuraApplication(QtApplication): continue self._recent_files.append(QUrl.fromLocalFile(f)) + + @pyqtSlot(result = QUrl) + def getDefaultSavePath(self): + return QUrl.fromLocalFile(os.path.expanduser("~/")) ## Handle loading of all plugin types (and the backend explicitly) # \sa PluginRegistery diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index cdd97b84cb..76a367607a 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -667,7 +667,7 @@ UM.MainWindow //TODO: Support multiple file selection, workaround bug in KDE file dialog //selectMultiple: true nameFilters: UM.MeshFileHandler.supportedReadFileTypes; - + folder: Printer.getDefaultSavePath() onAccepted: { //Because several implementations of the file dialog only update the folder From f8d7b9ddfa7775ae847a7e0c0ee946642d4c060a Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Mon, 29 Feb 2016 16:14:46 +0100 Subject: [PATCH 03/17] JSON: wall line count should be 1 for magic spiralize (CURA-961) --- 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 b90fd5348a..4e8a8fbcc7 100644 --- a/resources/machines/fdmprinter.json +++ b/resources/machines/fdmprinter.json @@ -366,7 +366,7 @@ "min_value": "0", "type": "int", "visible": false, - "inherit_function": "max(1, round((wall_thickness - wall_line_width_0) / wall_line_width_x) + 1)" + "inherit_function": "1 if magic_spiralize else max(1, round((wall_thickness - wall_line_width_0) / wall_line_width_x) + 1)" } } }, From f276dd02825e59fe6da15553c271fb93e0634962 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Mon, 29 Feb 2016 17:21:26 +0100 Subject: [PATCH 04/17] JSON: fix dual extrusion global_only (CURA-458) --- .../machines/dual_extrusion_printer.json | 45 ++++++++++++------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/resources/machines/dual_extrusion_printer.json b/resources/machines/dual_extrusion_printer.json index ec26b38d8b..f0650039e9 100644 --- a/resources/machines/dual_extrusion_printer.json +++ b/resources/machines/dual_extrusion_printer.json @@ -33,7 +33,8 @@ "max_value_warning": "150", "default": 60, "visible": false, - "enabled": "prime_tower_enable" + "enabled": "prime_tower_enable", + "global_only": true } } }, @@ -49,7 +50,8 @@ "default": 0.4, "type": "float", "visible": false, - "enabled": "prime_tower_enable" + "enabled": "prime_tower_enable", + "global_only": true } } } @@ -76,7 +78,8 @@ "type": "int", "default": 0, "min_value": "0", - "max_value": "16" + "max_value": "16", + "global_only": true }, "support_extruder_nr": { "label": "Support Extruder", @@ -84,7 +87,8 @@ "type": "int", "default": 0, "min_value": "0", - "max_value": "16" + "max_value": "16", + "global_only": true }, "support_extruder_nr_layer_0": { "label": "First Layer Support Extruder", @@ -93,7 +97,8 @@ "default": 0, "min_value": "0", "max_value": "16", - "inherit_function": "support_extruder_nr" + "inherit_function": "support_extruder_nr", + "global_only": true }, "support_roof_extruder_nr": { "label": "Support Roof Extruder", @@ -103,7 +108,8 @@ "min_value": "0", "max_value": "16", "inherit_function": "support_extruder_nr", - "enabled": "support_roof_enable" + "enabled": "support_roof_enable", + "global_only": true } } }, @@ -112,7 +118,8 @@ "description": "Print a tower next to the print which serves to prime the material after each nozzle switch.", "type": "boolean", "visible": true, - "default": false + "default": false, + "global_only": true }, "prime_tower_size": { "label": "Prime Tower Size", @@ -124,7 +131,8 @@ "min_value": "0", "max_value_warning": "20", "inherit_function": "15 if prime_tower_enable else 0", - "enabled": "prime_tower_enable" + "enabled": "prime_tower_enable", + "global_only": true }, "prime_tower_position_x": { "label": "Prime Tower X Position", @@ -135,7 +143,8 @@ "default": 200, "min_value_warning": "-1000", "max_value_warning": "1000", - "enabled": "prime_tower_enable" + "enabled": "prime_tower_enable", + "global_only": true }, "prime_tower_position_y": { "label": "Prime Tower Y Position", @@ -146,7 +155,8 @@ "default": 200, "min_value_warning": "-1000", "max_value_warning": "1000", - "enabled": "prime_tower_enable" + "enabled": "prime_tower_enable", + "global_only": true }, "prime_tower_flow": { "label": "Prime Tower Flow", @@ -158,20 +168,23 @@ "min_value": "5", "min_value_warning": "50", "max_value_warning": "150", - "enabled": "prime_tower_enable" + "enabled": "prime_tower_enable", + "global_only": true }, "prime_tower_wipe_enabled": { "label": "Wipe Nozzle on Prime tower", "description": "After printing the prime tower with the one nozzle, wipe the oozed material from the other nozzle off on the prime tower.", "type": "boolean", "default": false, - "enabled": "prime_tower_enable" + "enabled": "prime_tower_enable", + "global_only": true }, "ooze_shield_enabled": { "label": "Enable Ooze Shield", "description": "Enable exterior ooze shield. This will create a shell around the object which is likely to wipe a second nozzle if it's at the same height as the first nozzle.", "type": "boolean", - "default": false + "default": false, + "global_only": true }, "ooze_shield_angle": { "label": "Ooze Shield Angle", @@ -182,7 +195,8 @@ "max_value": "90", "default": 60, "visible": false, - "enabled": "ooze_shield_enabled" + "enabled": "ooze_shield_enabled", + "global_only": true }, "ooze_shield_dist": { "label": "Ooze Shields Distance", @@ -193,7 +207,8 @@ "max_value_warning": "30", "default": 2, "visible": false, - "enabled": "ooze_shield_enabled" + "enabled": "ooze_shield_enabled", + "global_only": true } } }, From 451e3bd3776cb0ab76a90069af21d13355fc9b2d Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Mon, 29 Feb 2016 17:39:37 +0100 Subject: [PATCH 05/17] JSON: fix more dual extrusion global_only (CURA-458) --- resources/machines/dual_extrusion_printer.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/resources/machines/dual_extrusion_printer.json b/resources/machines/dual_extrusion_printer.json index f0650039e9..6d562adfb7 100644 --- a/resources/machines/dual_extrusion_printer.json +++ b/resources/machines/dual_extrusion_printer.json @@ -235,7 +235,8 @@ "max_value_warning": "100", "visible": false, "inherit_function": "machine_heat_zone_length", - "enabled": "retraction_enable" + "enabled": "retraction_enable", + "global_only": true }, "switch_extruder_retraction_speeds": { "label": "Nozzle Switch Retraction Speed", @@ -248,6 +249,7 @@ "visible": false, "inherit": false, "enabled": "retraction_enable", + "global_only": true, "children": { "switch_extruder_retraction_speed": { "label": "Nozzle Switch Retract Speed", @@ -258,7 +260,8 @@ "min_value": "0.1", "max_value_warning": "300", "visible": false, - "enabled": "retraction_enable" + "enabled": "retraction_enable", + "global_only": true }, "switch_extruder_prime_speed": { "label": "Nozzle Switch Prime Speed", @@ -269,7 +272,8 @@ "min_value": "0.1", "max_value_warning": "300", "visible": false, - "enabled": "retraction_enable" + "enabled": "retraction_enable", + "global_only": true } } } From 804af3cddae4c9a71c72ae95c9376f19372990b1 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Mon, 29 Feb 2016 17:41:19 +0100 Subject: [PATCH 06/17] JSON: fix global_only problems (CURA-458) draft shield, support, coasting, auto temp, combing, platform adhesion, speed slowdown layers, travel speed --- resources/machines/fdmprinter.json | 75 ++++++++++++++++++++---------- 1 file changed, 50 insertions(+), 25 deletions(-) diff --git a/resources/machines/fdmprinter.json b/resources/machines/fdmprinter.json index 9d63939781..20ec26f223 100644 --- a/resources/machines/fdmprinter.json +++ b/resources/machines/fdmprinter.json @@ -281,7 +281,8 @@ "max_value_warning": "5", "default": 0.4, "type": "float", - "visible": false + "visible": false, + "global_only": true }, "skin_line_width": { "label": "Top/bottom line width", @@ -315,7 +316,8 @@ "default": 0.4, "type": "float", "visible": false, - "enabled": "support_enable" + "enabled": "support_enable", + "global_only": true }, "support_roof_line_width": { "label": "Support Roof line width", @@ -326,7 +328,8 @@ "max_value_warning": "machine_nozzle_size * 2", "type": "float", "visible": false, - "enabled": "support_roof_enable" + "enabled": "support_roof_enable", + "global_only": true } } } @@ -631,7 +634,8 @@ "type": "boolean", "default": false, "visible": false, - "enabled": "False" + "enabled": "False", + "global_only": true }, "material_print_temperature": { "label": "Printing Temperature", @@ -649,7 +653,8 @@ "unit": "", "type": "string", "default": "[[3.5,200],[7.0,240]]", - "enabled": "material_flow_dependent_temperature" + "enabled": "material_flow_dependent_temperature", + "global_only": true }, "material_extrusion_cool_down_speed": { "label": "Extrusion Cool Down Speed Modifier", @@ -902,7 +907,8 @@ "max_value_warning": "150", "visible": false, "inherit": true, - "enabled": "support_roof_enable" + "enabled": "support_roof_enable", + "global_only": true }, "speed_support_roof": { "label": "Support Roof Speed", @@ -915,7 +921,8 @@ "visible": false, "inherit": false, "enabled": "support_roof_enable", - "inherit_function": "parent_value / 60 * 40" + "inherit_function": "parent_value / 60 * 40", + "global_only": true } } } @@ -929,7 +936,8 @@ "default": 120, "min_value": "0.1", "max_value_warning": "300", - "inherit_function": "speed_print if magic_spiralize else 120" + "inherit_function": "speed_print if magic_spiralize else 120", + "global_only": true }, "speed_layer_0": { "label": "Bottom Layer Speed", @@ -950,7 +958,8 @@ "min_value": "0.1", "max_value_warning": "300", "visible": false, - "inherit_function": "speed_layer_0" + "inherit_function": "speed_layer_0", + "global_only": true }, "speed_slowdown_layers": { "label": "Number of Slower Layers", @@ -959,7 +968,8 @@ "default": 4, "min_value": "0", "max_value_warning": "300", - "visible": false + "visible": false, + "global_only": true } } }, @@ -973,7 +983,8 @@ "description": "Combing keeps the head within the interior of the print whenever possible when traveling from one part of the print to another and does not use retraction. If combing is disabled, the print head moves straight from the start point to the end point and it will always retract.", "type": "boolean", "default": true, - "visible": false + "visible": false, + "global_only": true }, "travel_avoid_other_parts": { "label": "Avoid Printed Parts", @@ -1004,7 +1015,8 @@ "description": "Coasting replaces the last part of an extrusion path with a travel path. The oozed material is used to lay down the last piece of the extrusion path in order to reduce stringing.", "type": "boolean", "default": false, - "visible": false + "visible": false, + "global_only": true }, "coasting_volume": { "label": "Coasting Volume", @@ -1016,7 +1028,8 @@ "max_value_warning": "2.0", "visible": false, "inherit": false, - "enabled": "coasting_enable" + "enabled": "coasting_enable", + "global_only": true }, "coasting_min_volume": { "label": "Minimal Volume Before Coasting", @@ -1027,7 +1040,8 @@ "min_value": "0", "max_value_warning": "10.0", "visible": false, - "enabled": "coasting_enable" + "enabled": "coasting_enable", + "global_only": true }, "coasting_speed": { "label": "Coasting Speed", @@ -1039,7 +1053,8 @@ "max_value_warning": "100", "visible": false, "inherit": false, - "enabled": "coasting_enable" + "enabled": "coasting_enable", + "global_only": true } } }, @@ -1162,7 +1177,8 @@ "label": "Enable Draft Shield", "description": "Enable exterior draft shield. This will create a wall around the object which traps (hot) air and shields against gusts of wind. Especially useful for materials which warp easily.", "type": "boolean", - "default": false + "default": false, + "global_only": true }, "draft_shield_dist": { "label": "Draft Shield X/Y Distance", @@ -1173,7 +1189,8 @@ "max_value_warning": "100", "default": 10, "visible": false, - "enabled": "draft_shield_enabled" + "enabled": "draft_shield_enabled", + "global_only": true }, "draft_shield_height_limitation": { "label": "Draft Shield Limitation", @@ -1185,7 +1202,8 @@ }, "default": "full", "visible": false, - "enabled": "draft_shield_enabled" + "enabled": "draft_shield_enabled", + "global_only": true }, "draft_shield_height": { "label": "Draft Shield Height", @@ -1197,7 +1215,8 @@ "default": 0, "inherit_function": "9999 if draft_shield_height_limitation == 'full' and draft_shield_enabled else 0.0", "visible": false, - "enabled": "draft_shield_height_limitation == \"limited\"" + "enabled": "draft_shield_height_limitation == \"limited\"", + "global_only": true } } }, @@ -1386,6 +1405,7 @@ "min_value": "0", "max_value_warning": "100", "enabled":"support_roof_enable", + "global_only": true, "children": { "support_roof_line_distance": { "label": "Support Roof Line Distance", @@ -1396,7 +1416,8 @@ "min_value": "0", "visible": false, "inherit_function": "0 if parent_value == 0 else (support_roof_line_width * 100) / parent_value", - "enabled": "support_roof_enable" + "enabled": "support_roof_enable", + "global_only": true } } }, @@ -1413,7 +1434,8 @@ "zigzag": "Zig Zag" }, "default": "concentric", - "enabled": "support_roof_enable" + "enabled": "support_roof_enable", + "global_only": true }, "support_use_towers": { "label": "Use towers", @@ -1473,7 +1495,8 @@ }, "default": "zigzag", "visible": false, - "enabled": "support_enable" + "enabled": "support_enable", + "global_only": true }, "support_connect_zigzags": { "label": "Connect ZigZags", @@ -1481,7 +1504,8 @@ "type": "boolean", "default": true, "visible": false, - "enabled": "support_enable" + "enabled": "support_enable", + "global_only": true }, "support_infill_rate": { "label": "Fill Amount", @@ -1493,7 +1517,7 @@ "default": 15, "visible": false, "enabled": "support_enable", - + "global_only": true, "children": { "support_line_distance": { "label": "Line distance", @@ -1504,7 +1528,8 @@ "default": 2.66, "visible": false, "enabled": "support_enable", - "inherit_function": "(support_line_width * 100) / parent_value" + "inherit_function": "(support_line_width * 100) / parent_value", + "global_only": true } } } From e0afc1535a4d824a925d3a17bb2b8da07fab9f6a Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 1 Mar 2016 02:05:25 +0100 Subject: [PATCH 07/17] Add a busy property to LayerView that indicates whether we are currently building top layers Contributes to CURA-957 --- plugins/LayerView/LayerView.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/LayerView/LayerView.py b/plugins/LayerView/LayerView.py index e86590e1d0..db4e520e55 100644 --- a/plugins/LayerView/LayerView.py +++ b/plugins/LayerView/LayerView.py @@ -51,6 +51,8 @@ class LayerView(View): self._top_layer_timer.setSingleShot(True) self._top_layer_timer.timeout.connect(self._startUpdateTopLayers) + self._busy = False + def getActivity(self): return self._activity @@ -63,6 +65,16 @@ class LayerView(View): def getMaxLayers(self): return self._max_layers + busyChanged = Signal() + + def isBusy(self): + return self._busy + + def setBusy(self, busy): + if busy != self._busy: + self._busy = busy + self.busyChanged.emit() + def resetLayerData(self): self._current_layer_mesh = None self._current_layer_jumps = None @@ -183,11 +195,15 @@ class LayerView(View): return True def _startUpdateTopLayers(self): + self.setBusy(True) + self._top_layers_job = _CreateTopLayersJob(self._controller.getScene(), self._current_layer_num, self._solid_layers) self._top_layers_job.finished.connect(self._updateCurrentLayerMesh) self._top_layers_job.start() def _updateCurrentLayerMesh(self, job): + self.setBusy(False) + if not job.getResult(): return From c684e96ef174a532b45627af3ee8d70ee6d2d8e9 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 1 Mar 2016 02:06:16 +0100 Subject: [PATCH 08/17] Expose the new busy property to QML Contributes to CURA-957 --- plugins/LayerView/LayerViewProxy.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/LayerView/LayerViewProxy.py b/plugins/LayerView/LayerViewProxy.py index 3d4d1d8278..bb9554ebf1 100644 --- a/plugins/LayerView/LayerViewProxy.py +++ b/plugins/LayerView/LayerViewProxy.py @@ -33,6 +33,15 @@ class LayerViewProxy(QObject): active_view = self._controller.getActiveView() if type(active_view) == LayerView.LayerView.LayerView: return active_view.getCurrentLayer() + + busyChanged = pyqtSignal() + @pyqtProperty(bool, notify = busyChanged) + def busy(self): + active_view = self._controller.getActiveView() + if type(active_view) == LayerView.LayerView.LayerView: + return active_view.isBusy() + + return False @pyqtSlot(int) def setCurrentLayer(self, layer_num): @@ -49,9 +58,13 @@ class LayerViewProxy(QObject): def _onMaxLayersChanged(self): self.maxLayersChanged.emit() + + def _onBusyChanged(self): + self.busyChanged.emit() def _onActiveViewChanged(self): active_view = self._controller.getActiveView() if type(active_view) == LayerView.LayerView.LayerView: active_view.currentLayerNumChanged.connect(self._onLayerChanged) active_view.maxLayersChanged.connect(self._onMaxLayersChanged) + active_view.busyChanged.connect(self._onBusyChanged) From f2d98cfba3e07b91edb832ae8db1a3aef3a98305 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 1 Mar 2016 02:07:39 +0100 Subject: [PATCH 09/17] Do not show a message when processing top layers but rather leave it up to QML Contributes to CURA-957 --- plugins/LayerView/LayerView.py | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/plugins/LayerView/LayerView.py b/plugins/LayerView/LayerView.py index db4e520e55..4738aedea3 100644 --- a/plugins/LayerView/LayerView.py +++ b/plugins/LayerView/LayerView.py @@ -133,11 +133,6 @@ class LayerView(View): self._top_layer_timer.start() - if self._top_layers_job: - self._top_layers_job.finished.disconnect(self._updateCurrentLayerMesh) - self._top_layers_job.cancel() - self._top_layers_job = None - self.currentLayerNumChanged.emit() currentLayerNumChanged = Signal() @@ -195,6 +190,10 @@ class LayerView(View): return True def _startUpdateTopLayers(self): + if self._top_layers_job: + self._top_layers_job.finished.disconnect(self._updateCurrentLayerMesh) + self._top_layers_job.cancel() + self.setBusy(True) self._top_layers_job = _CreateTopLayersJob(self._controller.getScene(), self._current_layer_num, self._solid_layers) @@ -232,10 +231,6 @@ class _CreateTopLayersJob(Job): if self._cancel or not layer_data: return - message = Message(catalog.i18nc("@info:status", "Processing Layers"), 0, False, -1) - - start_time = time.clock() - layer_mesh = MeshData() for i in range(self._solid_layers): layer_number = self._layer_number - i @@ -246,7 +241,6 @@ class _CreateTopLayersJob(Job): layer = layer_data.getLayer(layer_number).createMesh() except Exception as e: print(e) - message.hide() return if not layer or layer.getVertices() is None: @@ -260,24 +254,19 @@ class _CreateTopLayersJob(Job): layer_mesh.addColors(layer.getColors() * brightness) if self._cancel: - message.hide() return - now = time.clock() - if now - start_time > 0.5: - # If the entire process takes longer than 500ms, display a message indicating that we're busy. - message.show() + Job.yieldThread() if self._cancel: - message.hide() return + Job.yieldThread() jump_mesh = layer_data.getLayer(self._layer_number).createJumps() if not jump_mesh or jump_mesh.getVertices() is None: jump_mesh = None self.setResult({ "layers": layer_mesh, "jumps": jump_mesh }) - message.hide() def cancel(self): self._cancel = True From 110c3fa75435895c5e53ac4ba2a98cb091106af9 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 1 Mar 2016 02:09:06 +0100 Subject: [PATCH 10/17] Do not react to all Scene changes in LayerView but just childrenChanged When the layer data is updated, a new node is attached to the scene root. We can thus watch for only children changes since everything else can be ignored. Contributes to CURA-938 --- plugins/LayerView/LayerView.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/LayerView/LayerView.py b/plugins/LayerView/LayerView.py index 4738aedea3..a9890e30eb 100644 --- a/plugins/LayerView/LayerView.py +++ b/plugins/LayerView/LayerView.py @@ -36,7 +36,7 @@ class LayerView(View): self._num_layers = 0 self._layer_percentage = 0 # what percentage of layers need to be shown (SLider gives value between 0 - 100) self._proxy = LayerViewProxy.LayerViewProxy() - self._controller.getScene().sceneChanged.connect(self._onSceneChanged) + self._controller.getScene().getRoot().childrenChanged.connect(self._onSceneChanged) self._max_layers = 10 self._current_layer_num = 10 self._current_layer_mesh = None From 363fb0c4dda96804c826846b73e424907c9fb164 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 1 Mar 2016 02:10:21 +0100 Subject: [PATCH 11/17] Remove layer view slider style from Cura theme's style file Since it is a plugin, it should not be in the main theme. Contributes to CURA-957 --- resources/themes/cura/styles.qml | 62 ++------------------------------ 1 file changed, 3 insertions(+), 59 deletions(-) diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index d1cd8d1872..60677870bc 100644 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -351,6 +351,8 @@ QtObject { border.width: Theme.getSize("default_lining").width; border.color: Theme.getColor("slider_groove_border"); + radius: width / 2; + Rectangle { anchors { left: parent.left; @@ -359,6 +361,7 @@ QtObject { } color: Theme.getColor("slider_groove_fill"); width: (control.value / (control.maximumValue - control.minimumValue)) * parent.width; + radius: width / 2; } } handle: Rectangle { @@ -370,65 +373,6 @@ QtObject { } } - property Component layerViewSlider: Component { - SliderStyle { - groove: Rectangle { - id: layerSliderGroove - implicitWidth: control.width; - implicitHeight: Theme.getSize("slider_groove").height; - radius: width/2; - - color: Theme.getColor("slider_groove"); - border.width: Theme.getSize("default_lining").width; - border.color: Theme.getColor("slider_groove_border"); - Rectangle { - anchors { - left: parent.left; - top: parent.top; - bottom: parent.bottom; - } - color: Theme.getColor("slider_groove_fill"); - width: (control.value / (control.maximumValue - control.minimumValue)) * parent.width; - radius: width/2 - } - } - handle: Rectangle { - id: layerSliderControl - width: Theme.getSize("slider_handle").width; - height: Theme.getSize("slider_handle").height; - color: control.hovered ? Theme.getColor("slider_handle_hover") : Theme.getColor("slider_handle"); - Behavior on color { ColorAnimation { duration: 50; } } - TextField { - id: valueLabel - property string maxValue: control.maximumValue + 1 - text: control.value + 1 - horizontalAlignment: TextInput.AlignHCenter - onEditingFinished: { - if (valueLabel.text != ''){ - control.value = valueLabel.text - 1 - } - } - validator: IntValidator {bottom: 1; top: control.maximumValue + 1;} - visible: UM.LayerView.getLayerActivity && Printer.getPlatformActivity ? true : false - anchors.top: layerSliderControl.bottom - anchors.topMargin: width/2 - Theme.getSize("default_margin").width/2 - anchors.horizontalCenter: layerSliderControl.horizontalCenter - rotation: 90 - style: TextFieldStyle{ - textColor: Theme.getColor("setting_control_text"); - font: Theme.getFont("default"); - background: Rectangle { - implicitWidth: control.maxValue.length * valueLabel.font.pixelSize + Theme.getSize("default_margin").width - implicitHeight: Theme.getSize("slider_handle").height + Theme.getSize("default_margin").width - border.width: Theme.getSize("default_lining").width; - border.color: Theme.getColor("slider_groove_border"); - } - } - } - } - } - } - property Component text_field: Component { TextFieldStyle { textColor: Theme.getColor("setting_control_text"); From 3afd3f22099eee543aaeef45590e9c01c3fcfb81 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 1 Mar 2016 02:11:26 +0100 Subject: [PATCH 12/17] Use the right style for the layer view slider and add a busy indicator to the current layer field Contributes to CURA-957 --- plugins/LayerView/LayerView.qml | 63 ++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/plugins/LayerView/LayerView.qml b/plugins/LayerView/LayerView.qml index b26d301648..e8af832267 100644 --- a/plugins/LayerView/LayerView.qml +++ b/plugins/LayerView/LayerView.qml @@ -25,11 +25,72 @@ Item maximumValue: UM.LayerView.numLayers; stepSize: 1 + property real pixelsPerStep: ((height - UM.Theme.getSize("slider_handle").height) / (maximumValue - minimumValue)) * stepSize; + value: UM.LayerView.currentLayer onValueChanged: UM.LayerView.setCurrentLayer(value) - style: UM.Theme.styles.layerViewSlider + style: UM.Theme.styles.slider; + + Rectangle + { + x: parent.width + UM.Theme.getSize("default_margin").width; + y: parent.height - (parent.value * parent.pixelsPerStep) - UM.Theme.getSize("slider_handle").height * 1.25; + + height: UM.Theme.getSize("slider_handle").height + UM.Theme.getSize("default_margin").height + width: valueLabel.width + (busyIndicator.visible ? busyIndicator.width : 0) + UM.Theme.getSize("default_margin").width + Behavior on height { NumberAnimation { duration: 50; } } + + border.width: UM.Theme.getSize("default_lining").width; + border.color: UM.Theme.getColor("slider_groove_border"); + + visible: UM.LayerView.getLayerActivity && Printer.getPlatformActivity ? true : false + + TextField + { + id: valueLabel + property string maxValue: slider.maximumValue + 1 + text: slider.value + 1 + horizontalAlignment: TextInput.AlignRight; + onEditingFinished: + { + if(valueLabel.text != '') + { + slider.value = valueLabel.text - 1 + } + } + validator: IntValidator { bottom: 1; top: slider.maximumValue + 1; } + + anchors.left: parent.left; + anchors.leftMargin: UM.Theme.getSize("default_margin").width / 2; + anchors.verticalCenter: parent.verticalCenter; + + width: UM.Theme.getSize("line").width * maxValue.length; + + style: TextFieldStyle + { + textColor: UM.Theme.getColor("setting_control_text"); + font: UM.Theme.getFont("default"); + background: Item { } + } + } + + BusyIndicator + { + id: busyIndicator; + anchors.right: parent.right; + anchors.rightMargin: UM.Theme.getSize("default_margin").width / 2; + anchors.verticalCenter: parent.verticalCenter; + + width: UM.Theme.getSize("slider_handle").height; + height: width; + + running: UM.LayerView.busy; + visible: UM.LayerView.busy; + } + } } + Rectangle { anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter From fa59416dc4bf3db76ae44304fbf44083f22cc227 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 1 Mar 2016 09:30:33 +0100 Subject: [PATCH 13/17] Added warning to logging if no one at a time print is possible CURA-972 --- plugins/CuraEngineBackend/StartSliceJob.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index a45c18271f..7c35bca36b 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -61,6 +61,8 @@ class StartSliceJob(Job): if temp_list: object_groups.append(temp_list) Job.yieldThread() + if len(object_groups) == 0: + Logger.log("w", "No objects suitable for one at a time found, or no correct order found") else: temp_list = [] for node in DepthFirstIterator(self._scene.getRoot()): From 51ad89471102f55475532b0803b4fcb75db7e39b Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Tue, 1 Mar 2016 10:34:00 +0100 Subject: [PATCH 14/17] Properly disable Per Object Settings toolbutton on first start On an empty profile, the cura/active_mode preference is not set so the code disabling the button was not called. Fixes CURA-901 --- plugins/PerObjectSettingsTool/PerObjectSettingsTool.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsTool.py b/plugins/PerObjectSettingsTool/PerObjectSettingsTool.py index 0e415a1a96..70b3d8bbe8 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsTool.py +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsTool.py @@ -17,6 +17,7 @@ class PerObjectSettingsTool(Tool): self.setExposedProperties("Model", "SelectedIndex") Preferences.getInstance().preferenceChanged.connect(self._onPreferenceChanged) + self._onPreferenceChanged("cura/active_mode") def event(self, event): return False From ff3bca19ac3a272b45baddf7ec2e55526ffe92ee Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 1 Mar 2016 10:40:35 +0100 Subject: [PATCH 15/17] Renamed getdefaultsavepath --- cura/CuraApplication.py | 2 +- resources/qml/Cura.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index f8bf5da148..5b2cf49db2 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -131,7 +131,7 @@ class CuraApplication(QtApplication): self._recent_files.append(QUrl.fromLocalFile(f)) @pyqtSlot(result = QUrl) - def getDefaultSavePath(self): + def getDefaultPath(self): return QUrl.fromLocalFile(os.path.expanduser("~/")) ## Handle loading of all plugin types (and the backend explicitly) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 76a367607a..279a9180e0 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -667,7 +667,7 @@ UM.MainWindow //TODO: Support multiple file selection, workaround bug in KDE file dialog //selectMultiple: true nameFilters: UM.MeshFileHandler.supportedReadFileTypes; - folder: Printer.getDefaultSavePath() + folder: Printer.getDefaultPath() onAccepted: { //Because several implementations of the file dialog only update the folder From 41d00af345c873012b53306ac35cce9a4796ffe4 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 1 Mar 2016 10:57:29 +0100 Subject: [PATCH 16/17] Moved timer back again, as arjen fixed the real issue --- plugins/LayerView/LayerView.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/LayerView/LayerView.py b/plugins/LayerView/LayerView.py index a9890e30eb..385936391c 100644 --- a/plugins/LayerView/LayerView.py +++ b/plugins/LayerView/LayerView.py @@ -165,7 +165,7 @@ class LayerView(View): else: self.setLayer(int(self._max_layers)) self.maxLayersChanged.emit() - self._top_layer_timer.start() + self._top_layer_timer.start() maxLayersChanged = Signal() currentLayerNumChanged = Signal() From f05eaf6d9c6d07054b88e20259ad4eb62d78c4b9 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 1 Mar 2016 11:04:59 +0100 Subject: [PATCH 17/17] Too high objects (in one at a time) are now greyed out CURA-972 --- cura/PlatformPhysics.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index 3933802135..df841bd71d 100644 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -60,12 +60,16 @@ class PlatformPhysics: build_volume_bounding_box = copy.deepcopy(self._build_volume.getBoundingBox()) build_volume_bounding_box.setBottom(-9001) # Ignore intersections with the bottom + node._outside_buildarea = False # Mark the node as outside the build volume if the bounding box test fails. if build_volume_bounding_box.intersectsBox(bbox) != AxisAlignedBox.IntersectionResult.FullIntersection: node._outside_buildarea = True else: - node._outside_buildarea = False + # When printing one at a time too high objects are not printable. + if Application.getInstance().getMachineManager().getWorkingProfile().getSettingValue("print_sequence") == "one_at_a_time": + if node.getBoundingBox().height > Application.getInstance().getMachineManager().getWorkingProfile().getSettingValue("gantry_height"): + node._outside_buildarea = True # Move it downwards if bottom is above platform move_vector = Vector()