From 65e87625466d50a8c7dd4f3234b899e8028abdde Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 5 Jan 2018 11:53:38 +0100 Subject: [PATCH 1/9] Fix layer height slider update issue CURA-4758 --- resources/qml/SidebarSimple.qml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 7aca25160a..74c2bf1ec1 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -70,6 +70,18 @@ Item onActiveVariantChanged: qualityModel.update() } + Connections { + target: base + onVisibleChanged: + { + // update needs to be called when the widgets are visible, otherwise the step width calculation + // will fail because the width of an invisible item is 0. + if (visible) { + qualityModel.update(); + } + } + } + ListModel { id: qualityModel From 223d9b6025f8d74cef42b9e0b3edbc5e20c90e43 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 5 Jan 2018 11:54:17 +0100 Subject: [PATCH 2/9] Update QtQuick import versions CURA-4758 --- resources/qml/Sidebar.qml | 2 +- resources/qml/SidebarAdvanced.qml | 5 ++--- resources/qml/SidebarSimple.qml | 8 ++++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index e6e0fee023..e1c0a07f89 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -3,7 +3,7 @@ import QtQuick 2.8 import QtQuick.Controls 2.1 -import QtQuick.Layouts 1.1 +import QtQuick.Layouts 1.3 import UM 1.2 as UM import Cura 1.0 as Cura diff --git a/resources/qml/SidebarAdvanced.qml b/resources/qml/SidebarAdvanced.qml index 95f218639b..f214e425b1 100644 --- a/resources/qml/SidebarAdvanced.qml +++ b/resources/qml/SidebarAdvanced.qml @@ -1,9 +1,8 @@ // Copyright (c) 2015 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.0 - -import QtQuick.Controls 1.2 +import QtQuick 2.8 +import QtQuick.Controls 2.1 import "Settings" diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 74c2bf1ec1..7e86b10207 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -1,10 +1,10 @@ // Copyright (c) 2017 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 -import QtQuick.Layouts 1.1 +import QtQuick 2.8 +import QtQuick.Controls 1.4 +import QtQuick.Controls.Styles 1.4 +import QtQuick.Layouts 1.3 import UM 1.2 as UM import Cura 1.2 as Cura From 8c98ab027a7c53dd9840f17abc14316c04a16095 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 5 Jan 2018 11:54:46 +0100 Subject: [PATCH 3/9] Fix code style CURA-4758 --- resources/qml/SidebarSimple.qml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 7e86b10207..ac124c8911 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -11,7 +11,7 @@ import Cura 1.2 as Cura Item { - id: base; + id: base signal showTooltip(Item item, point location, string text); signal hideTooltip(); @@ -115,7 +115,7 @@ Item if (Cura.SimpleModeSettingsManager.isProfileUserCreated) { qualityModel.qualitySliderActiveIndex = -1 } else { - qualityModel.qualitySliderActiveIndex = i + qualityModel.qualitySliderActiveIndex = i } qualityModel.existingQualityProfile = 1 @@ -195,11 +195,10 @@ Item text: { var result = "" - if(Cura.MachineManager.activeMachine != null){ + if (Cura.MachineManager.activeMachine != null) { + result = Cura.ProfilesModel.getItem(index).layer_height_without_unit - var result = Cura.ProfilesModel.getItem(index).layer_height_without_unit - - if(result == undefined) + if (result == undefined) result = "" } return result From b20c6c6ac7a123c7da0b1c486e3af87a27f6391f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 5 Jan 2018 13:02:00 +0100 Subject: [PATCH 4/9] Use isinstance instead of type checking for SceneNode isinstance also checks for subclasses. In our case, SceneNode was just extended to CuraSceneNode so this test was failing. Contributes to issue CURA-4766. --- cura/Settings/ExtruderManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Settings/ExtruderManager.py b/cura/Settings/ExtruderManager.py index 32e3867300..351843ae14 100755 --- a/cura/Settings/ExtruderManager.py +++ b/cura/Settings/ExtruderManager.py @@ -270,7 +270,7 @@ class ExtruderManager(QObject): return [] # Get the extruders of all printable meshes in the scene - meshes = [node for node in DepthFirstIterator(scene_root) if type(node) is SceneNode and node.isSelectable()] + meshes = [node for node in DepthFirstIterator(scene_root) if isinstance(node, SceneNode) and node.isSelectable()] for mesh in meshes: extruder_stack_id = mesh.callDecoration("getActiveExtruder") if not extruder_stack_id: From fefb20deb786d94ca807e6011ea9ca21d62bca46 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 5 Jan 2018 13:33:40 +0100 Subject: [PATCH 5/9] Don't start slicing again if you can't slice Contributes to issue CURA-4766. --- plugins/CuraEngineBackend/CuraEngineBackend.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 74dd515951..ff6c196c2d 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -204,7 +204,6 @@ class CuraEngineBackend(QObject, Backend): if self._process_layers_job: Logger.log("d", " ## Process layers job still busy, trying later") - self._invokeSlice() return # see if we really have to slice @@ -214,7 +213,6 @@ class CuraEngineBackend(QObject, Backend): num_objects = self._numObjects() if build_plate_to_be_sliced not in num_objects or num_objects[build_plate_to_be_sliced] == 0: Logger.log("d", "Build plate %s has 0 objects to be sliced, skipping", build_plate_to_be_sliced) - self._invokeSlice() return self._stored_layer_data = [] From a8ad956c927df2eaa4140ee88eacb69851bd07f8 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 5 Jan 2018 13:34:39 +0100 Subject: [PATCH 6/9] Erase gcode of build plates that are determined to be empty You don't want to start a new slice, but you should still erase the g-code there. Contributes to issue CURA-4525. --- plugins/CuraEngineBackend/CuraEngineBackend.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index ff6c196c2d..4491008997 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -206,12 +206,16 @@ class CuraEngineBackend(QObject, Backend): Logger.log("d", " ## Process layers job still busy, trying later") return + if not hasattr(self._scene, "gcode_list"): + self._scene.gcode_list = {} + # see if we really have to slice active_build_plate = Application.getInstance().getBuildPlateModel().activeBuildPlate build_plate_to_be_sliced = self._build_plates_to_be_sliced.pop(0) Logger.log("d", "Going to slice build plate [%s]!" % build_plate_to_be_sliced) num_objects = self._numObjects() if build_plate_to_be_sliced not in num_objects or num_objects[build_plate_to_be_sliced] == 0: + self._scene.gcode_list[build_plate_to_be_sliced] = [] Logger.log("d", "Build plate %s has 0 objects to be sliced, skipping", build_plate_to_be_sliced) return @@ -229,8 +233,6 @@ class CuraEngineBackend(QObject, Backend): self.processingProgress.emit(0.0) self.backendStateChange.emit(BackendState.NotStarted) - if not hasattr(self._scene, "gcode_list"): - self._scene.gcode_list = {} self._scene.gcode_list[build_plate_to_be_sliced] = [] #[] indexed by build plate number self._slicing = True self.slicingStarted.emit() From a717960695bb35789e166ab1d6281d317bef50ff Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 5 Jan 2018 13:46:05 +0100 Subject: [PATCH 7/9] Disallow negative branch angles The engine can't really handle that any more. Contributes to issue CURA-4523. --- resources/definitions/fdmprinter.def.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index e3a1c0892a..6eef6b1e9b 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3854,12 +3854,11 @@ "support_tree_branch_diameter_angle": { "label": "Tree Support Branch Diameter Angle", - "description": "The angle of the branches' diameter as they gradually become thicker towards the bottom. An angle of 0 will cause the branches to have uniform thickness over their length. A negative angle makes them thinner towards the bottom, so be careful as they might disappear. A small positive angle can increase stability of the tree support.", + "description": "The angle of the branches' diameter as they gradually become thicker towards the bottom. An angle of 0 will cause the branches to have uniform thickness over their length. A bit of an angle can increase stability of the tree support.", "unit": "°", "type": "float", - "minimum_value": "-89.9999", + "minimum_value": "0", "maximum_value": "89.9999", - "minimum_value_warning": "0", "maximum_value_warning": "15", "default_value": 5, "limit_to_extruder": "support_infill_extruder_nr", From 5dad6cab2c546d0d04ea92f5b909be912f4282d6 Mon Sep 17 00:00:00 2001 From: Aleksei S Date: Fri, 5 Jan 2018 14:00:23 +0100 Subject: [PATCH 8/9] If the model is:some per mesh settings or outside of the buildplate show message, CURA-4525 --- plugins/CuraEngineBackend/CuraEngineBackend.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 4491008997..44c39db69f 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -357,6 +357,18 @@ class CuraEngineBackend(QObject, Backend): else: self.backendStateChange.emit(BackendState.NotStarted) + if job.getResult() == StartSliceJob.StartJobResult.NothingToSlice: + if Application.getInstance().platformActivity: + self._error_message = Message(catalog.i18nc("@info:status", "Nothing to slice because none of the models fit the build volume. Please scale or rotate models to fit."), + title = catalog.i18nc("@info:title", "Unable to slice")) + self._error_message.show() + self.backendStateChange.emit(BackendState.Error) + else: + self.backendStateChange.emit(BackendState.NotStarted) + pass + self._invokeSlice() + return + # Preparation completed, send it to the backend. self._socket.sendMessage(job.getSliceMessage()) From 784a17149f48da575a7b8f5a2e1be4e78a9d1a69 Mon Sep 17 00:00:00 2001 From: Aleksei S Date: Fri, 5 Jan 2018 15:20:42 +0100 Subject: [PATCH 9/9] Don't show save to file if not possible to slice CURA-4525 --- plugins/CuraEngineBackend/CuraEngineBackend.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 44c39db69f..0ca500ecec 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -198,7 +198,6 @@ class CuraEngineBackend(QObject, Backend): self._slice_start_time = time() if not self._build_plates_to_be_sliced: self.processingProgress.emit(1.0) - self.backendStateChange.emit(BackendState.Done) Logger.log("w", "Slice unnecessary, nothing has changed that needs reslicing.") return