Browse Source

Merge branch 'master' of https://github.com/Ultimaker/Cura

Diego Prado Gesto 7 years ago
parent
commit
eda781ce7b

+ 1 - 1
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:

+ 16 - 5
plugins/CuraEngineBackend/CuraEngineBackend.py

@@ -198,23 +198,24 @@ 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
 
         if self._process_layers_job:
             Logger.log("d", "  ## Process layers job still busy, trying later")
-            self._invokeSlice()
             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)
-            self._invokeSlice()
             return
 
         self._stored_layer_data = []
@@ -231,8 +232,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()
@@ -357,6 +356,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())
 

+ 2 - 3
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",

+ 1 - 1
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

+ 2 - 3
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"
 

+ 21 - 10
resources/qml/SidebarSimple.qml

@@ -1,17 +1,17 @@
 // 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
 
 Item
 {
-    id: base;
+    id: base
 
     signal showTooltip(Item item, point location, string text);
     signal hideTooltip();
@@ -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
@@ -103,7 +115,7 @@ Item
                                 if (Cura.SimpleModeSettingsManager.isProfileUserCreated) {
                                     qualityModel.qualitySliderActiveIndex = -1
                                 } else {
-                                     qualityModel.qualitySliderActiveIndex = i
+                                    qualityModel.qualitySliderActiveIndex = i
                                 }
 
                                  qualityModel.existingQualityProfile = 1
@@ -183,11 +195,10 @@ Item
                             text:
                             {
                                 var result = ""
-                                if(Cura.MachineManager.activeMachine != null){
-
-                                    var result = Cura.ProfilesModel.getItem(index).layer_height_without_unit
+                                if (Cura.MachineManager.activeMachine != null) {
+                                    result = Cura.ProfilesModel.getItem(index).layer_height_without_unit
 
-                                    if(result == undefined)
+                                    if (result == undefined)
                                         result = ""
                                 }
                                 return result