Browse Source

Merge remote-tracking branch 'origin/3.3'

Lipu Fei 6 years ago
parent
commit
ec9be7a103

+ 5 - 1
cura/PrinterOutputDevice.py

@@ -1,6 +1,6 @@
 # Copyright (c) 2018 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
-
+from UM.Decorators import deprecated
 from UM.i18n import i18nCatalog
 from UM.OutputDevice.OutputDevice import OutputDevice
 from PyQt5.QtCore import pyqtProperty, QObject, QTimer, pyqtSignal, QVariant
@@ -175,6 +175,10 @@ class PrinterOutputDevice(QObject, OutputDevice):
     def acceptsCommands(self):
         return self._accepts_commands
 
+    @deprecated("Please use the protected function instead", "3.2")
+    def setAcceptsCommands(self, accepts_commands):
+        self._setAcceptsCommands(accepts_commands)
+
     ##  Set a flag to signal the UI that the printer is not (yet) ready to receive commands
     def _setAcceptsCommands(self, accepts_commands):
         if self._accepts_commands != accepts_commands:

+ 15 - 5
cura/Settings/MachineManager.py

@@ -74,6 +74,7 @@ class MachineManager(QObject):
 
         self._stacks_have_errors = None  # type:Optional[bool]
 
+        self._empty_container = ContainerRegistry.getInstance().getEmptyInstanceContainer()
         self._empty_definition_changes_container = ContainerRegistry.getInstance().findContainers(id = "empty_definition_changes")[0]
         self._empty_variant_container = ContainerRegistry.getInstance().findContainers(id = "empty_variant")[0]
         self._empty_material_container = ContainerRegistry.getInstance().findContainers(id = "empty_material")[0]
@@ -301,6 +302,13 @@ class MachineManager(QObject):
 
     ## Given a global_stack, make sure that it's all valid by searching for this quality group and applying it again
     def _initMachineState(self, global_stack):
+        # Some stacks can have empty definition_changes containers which will cause problems.
+        # Make sure that all stacks here have non-empty definition_changes containers.
+        for stack in [global_stack] + list(global_stack.extruders.values()):
+            if isinstance(stack.definitionChanges, type(self._empty_container)):
+                from cura.Settings.CuraStackBuilder import CuraStackBuilder
+                CuraStackBuilder.createDefinitionChangesContainer(stack, stack.getId() + "_settings")
+
         material_dict = {}
         for position, extruder in global_stack.extruders.items():
             material_dict[position] = extruder.material.getMetaDataEntry("base_file")
@@ -318,7 +326,7 @@ class MachineManager(QObject):
         if global_quality_changes.getId() != "empty_quality_changes":
             quality_changes_groups = self._application.getQualityManager().getQualityChangesGroups(global_stack)
             new_quality_changes_group = quality_changes_groups.get(global_quality_changes_name)
-            if new_quality_changes_group is not None and new_quality_changes_group.is_available:
+            if new_quality_changes_group is not None:
                 self._setQualityChangesGroup(new_quality_changes_group)
                 same_quality_found = True
                 Logger.log("i", "Machine '%s' quality changes set to '%s'",
@@ -1148,13 +1156,15 @@ class MachineManager(QObject):
 
         Logger.log("d", "Current quality type = [%s]", current_quality_type)
         if not self.activeMaterialsCompatible():
-            Logger.log("i", "Active materials are not compatible, setting all qualities to empty (Not Supported).")
-            self._setEmptyQuality()
+            if current_quality_type is not None:
+                Logger.log("i", "Active materials are not compatible, setting all qualities to empty (Not Supported).")
+                self._setEmptyQuality()
             return
 
         if not available_quality_types:
-            Logger.log("i", "No available quality types found, setting all qualities to empty (Not Supported).")
-            self._setEmptyQuality()
+            if self._current_quality_changes_group is None:
+                Logger.log("i", "No available quality types found, setting all qualities to empty (Not Supported).")
+                self._setEmptyQuality()
             return
 
         if current_quality_type in available_quality_types:

+ 1 - 2
resources/qml/Menus/ProfileMenu.qml

@@ -51,8 +51,7 @@ Menu
         MenuItem
         {
             text: model.name
-            checkable: model.available
-            enabled: model.available
+            checkable: true
             checked: Cura.MachineManager.activeQualityOrQualityChangesName == model.name
             exclusiveGroup: group
             onTriggered: Cura.MachineManager.setQualityChangesGroup(model.quality_changes_group)

+ 2 - 2
resources/qml/Preferences/ProfilesPage.qml

@@ -71,7 +71,7 @@ Item
         {
             text: catalog.i18nc("@action:button", "Activate")
             iconName: "list-activate"
-            enabled: !isCurrentItemActivated && base.currentItem.quality_group != undefined
+            enabled: !isCurrentItemActivated
             onClicked: {
                 if (base.currentItem.is_read_only) {
                     Cura.MachineManager.setQualityGroup(base.currentItem.quality_group);
@@ -101,7 +101,7 @@ Item
         {
             text: catalog.i18nc("@label", "Duplicate")
             iconName: "list-add"
-            enabled: !base.canCreateProfile && base.currentItem.quality_group != undefined
+            enabled: !base.canCreateProfile
             visible: !base.canCreateProfile
 
             onClicked: {

+ 1 - 2
resources/quality/vertex_delta_k8800/k8800_ABS_Extreme_Quality.inst.cfg

@@ -11,8 +11,7 @@ weight = 2
 material = Vertex_Delta_ABS
 
 [values]
-layer_height = 0.05
-layer_height_0 = 0.2 
+layer_height_0 = 0.2
 
 material_final_print_temperature = 250
 material_initial_print_temperature = 250

+ 1 - 2
resources/quality/vertex_delta_k8800/k8800_ABS_High_Quality.inst.cfg

@@ -11,8 +11,7 @@ weight = 1
 material = Vertex_Delta_ABS
 
 [values]
-layer_height = 0.1
-layer_height_0 = 0.2 
+layer_height_0 = 0.2
 
 material_final_print_temperature = 250
 material_initial_print_temperature = 250

+ 1 - 2
resources/quality/vertex_delta_k8800/k8800_ABS_Normal_Quality.inst.cfg

@@ -11,8 +11,7 @@ weight = 0
 material = Vertex_Delta_ABS
 
 [values]
-layer_height = 0.2
-layer_height_0 = 0.2 
+layer_height_0 = 0.2
 
 material_final_print_temperature = 250
 material_initial_print_temperature = 250

+ 14 - 0
resources/quality/vertex_delta_k8800/k8800_Global_Extreme_Quality.inst.cfg

@@ -0,0 +1,14 @@
+[general]
+version = 3
+name = Extreme
+definition = vertex_delta_k8800
+
+[metadata]
+setting_version = 4
+type = quality
+quality_type = extreme
+weight = 2
+global_quality = True
+
+[values]
+layer_height = 0.05

+ 14 - 0
resources/quality/vertex_delta_k8800/k8800_Global_High_Quality.inst.cfg

@@ -0,0 +1,14 @@
+[general]
+version = 3
+name = High
+definition = vertex_delta_k8800
+
+[metadata]
+setting_version = 4
+type = quality
+quality_type = high
+weight = 1
+global_quality = True
+
+[values]
+layer_height = 0.1

+ 14 - 0
resources/quality/vertex_delta_k8800/k8800_Global_Normal_Quality.inst.cfg

@@ -0,0 +1,14 @@
+[general]
+version = 3
+name = Normal
+definition = vertex_delta_k8800
+
+[metadata]
+setting_version = 4
+type = quality
+quality_type = normal
+weight = 0
+global_quality = True
+
+[values]
+layer_height = 0.2

Some files were not shown because too many files changed in this diff