diff --git a/cura/PrinterOutputDevice.py b/cura/PrinterOutputDevice.py index 80b1d800fc..98ba4a19a8 100644 --- a/cura/PrinterOutputDevice.py +++ b/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: diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 9b69b56ce8..1d6d339e29 100755 --- a/cura/Settings/MachineManager.py +++ b/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: diff --git a/resources/qml/Menus/ProfileMenu.qml b/resources/qml/Menus/ProfileMenu.qml index 5b9a5a3b73..ffd3c556b6 100644 --- a/resources/qml/Menus/ProfileMenu.qml +++ b/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) diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index 7459ab6afc..1726087e97 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/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: { diff --git a/resources/quality/vertex_delta_k8800/k8800_ABS_Extreme_Quality.inst.cfg b/resources/quality/vertex_delta_k8800/k8800_ABS_Extreme_Quality.inst.cfg index 30c2749ac6..e5eb35bede 100644 --- a/resources/quality/vertex_delta_k8800/k8800_ABS_Extreme_Quality.inst.cfg +++ b/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 diff --git a/resources/quality/vertex_delta_k8800/k8800_ABS_High_Quality.inst.cfg b/resources/quality/vertex_delta_k8800/k8800_ABS_High_Quality.inst.cfg index 102901ab3d..82cb6e1dd8 100644 --- a/resources/quality/vertex_delta_k8800/k8800_ABS_High_Quality.inst.cfg +++ b/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 diff --git a/resources/quality/vertex_delta_k8800/k8800_ABS_Normal_Quality.inst.cfg b/resources/quality/vertex_delta_k8800/k8800_ABS_Normal_Quality.inst.cfg index f2e699f571..274adf3faf 100644 --- a/resources/quality/vertex_delta_k8800/k8800_ABS_Normal_Quality.inst.cfg +++ b/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 diff --git a/resources/quality/vertex_delta_k8800/k8800_Global_Extreme_Quality.inst.cfg b/resources/quality/vertex_delta_k8800/k8800_Global_Extreme_Quality.inst.cfg new file mode 100644 index 0000000000..0de8c5143c --- /dev/null +++ b/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 diff --git a/resources/quality/vertex_delta_k8800/k8800_Global_High_Quality.inst.cfg b/resources/quality/vertex_delta_k8800/k8800_Global_High_Quality.inst.cfg new file mode 100644 index 0000000000..33e65329e9 --- /dev/null +++ b/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 diff --git a/resources/quality/vertex_delta_k8800/k8800_Global_Normal_Quality.inst.cfg b/resources/quality/vertex_delta_k8800/k8800_Global_Normal_Quality.inst.cfg new file mode 100644 index 0000000000..f6a6d8c8f3 --- /dev/null +++ b/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 diff --git a/resources/quality/vertex_delta_k8800/k8800_PET_Extreme_Quality.inst.cfg b/resources/quality/vertex_delta_k8800/k8800_PET_Extreme_Quality.inst.cfg index 1f98ded1db..08f8d03c78 100644 --- a/resources/quality/vertex_delta_k8800/k8800_PET_Extreme_Quality.inst.cfg +++ b/resources/quality/vertex_delta_k8800/k8800_PET_Extreme_Quality.inst.cfg @@ -11,8 +11,7 @@ weight = 2 material = Vertex_Delta_PET [values] -layer_height = 0.05 -layer_height_0 = 0.2 +layer_height_0 = 0.2 material_final_print_temperature = 240 material_initial_print_temperature = 240 diff --git a/resources/quality/vertex_delta_k8800/k8800_PET_High_Quality.inst.cfg b/resources/quality/vertex_delta_k8800/k8800_PET_High_Quality.inst.cfg index f050c741c2..f9b33153c0 100644 --- a/resources/quality/vertex_delta_k8800/k8800_PET_High_Quality.inst.cfg +++ b/resources/quality/vertex_delta_k8800/k8800_PET_High_Quality.inst.cfg @@ -11,8 +11,7 @@ weight = 1 material = Vertex_Delta_PET [values] -layer_height = 0.1 -layer_height_0 = 0.2 +layer_height_0 = 0.2 material_final_print_temperature = 240 material_initial_print_temperature = 240 diff --git a/resources/quality/vertex_delta_k8800/k8800_PET_Normal_Quality.inst.cfg b/resources/quality/vertex_delta_k8800/k8800_PET_Normal_Quality.inst.cfg index faeb8343fb..38d6513fe5 100644 --- a/resources/quality/vertex_delta_k8800/k8800_PET_Normal_Quality.inst.cfg +++ b/resources/quality/vertex_delta_k8800/k8800_PET_Normal_Quality.inst.cfg @@ -11,8 +11,7 @@ weight = 0 material = Vertex_Delta_PET [values] -layer_height = 0.2 -layer_height_0 = 0.2 +layer_height_0 = 0.2 material_final_print_temperature = 240 material_initial_print_temperature = 240 diff --git a/resources/quality/vertex_delta_k8800/k8800_PLA_Extreme_Quality.inst.cfg b/resources/quality/vertex_delta_k8800/k8800_PLA_Extreme_Quality.inst.cfg index f5ac232d06..bcd0b97c9d 100644 --- a/resources/quality/vertex_delta_k8800/k8800_PLA_Extreme_Quality.inst.cfg +++ b/resources/quality/vertex_delta_k8800/k8800_PLA_Extreme_Quality.inst.cfg @@ -11,8 +11,7 @@ weight = 2 material = Vertex_Delta_PLA [values] -layer_height = 0.05 -layer_height_0 = 0.2 +layer_height_0 = 0.2 material_final_print_temperature = 200 material_initial_print_temperature = 200 diff --git a/resources/quality/vertex_delta_k8800/k8800_PLA_High_Quality.inst.cfg b/resources/quality/vertex_delta_k8800/k8800_PLA_High_Quality.inst.cfg index 63ed8389db..6399e47ce7 100644 --- a/resources/quality/vertex_delta_k8800/k8800_PLA_High_Quality.inst.cfg +++ b/resources/quality/vertex_delta_k8800/k8800_PLA_High_Quality.inst.cfg @@ -11,8 +11,7 @@ weight = 1 material = Vertex_Delta_PLA [values] -layer_height = 0.1 -layer_height_0 = 0.2 +layer_height_0 = 0.2 material_final_print_temperature = 200 material_initial_print_temperature = 200 diff --git a/resources/quality/vertex_delta_k8800/k8800_PLA_Normal_Quality.inst.cfg b/resources/quality/vertex_delta_k8800/k8800_PLA_Normal_Quality.inst.cfg index e84cbabade..4b6d47e242 100644 --- a/resources/quality/vertex_delta_k8800/k8800_PLA_Normal_Quality.inst.cfg +++ b/resources/quality/vertex_delta_k8800/k8800_PLA_Normal_Quality.inst.cfg @@ -11,8 +11,7 @@ weight = 0 material = Vertex_Delta_PLA [values] -layer_height = 0.2 -layer_height_0 = 0.2 +layer_height_0 = 0.2 material_final_print_temperature = 200 material_initial_print_temperature = 200 diff --git a/resources/quality/vertex_delta_k8800/k8800_TPU_Extreme_Quality.inst.cfg b/resources/quality/vertex_delta_k8800/k8800_TPU_Extreme_Quality.inst.cfg index a2e8a334f7..53fa411dc5 100644 --- a/resources/quality/vertex_delta_k8800/k8800_TPU_Extreme_Quality.inst.cfg +++ b/resources/quality/vertex_delta_k8800/k8800_TPU_Extreme_Quality.inst.cfg @@ -11,8 +11,7 @@ weight = 2 material = Vertex_Delta_TPU [values] -layer_height = 0.05 -layer_height_0 = 0.2 +layer_height_0 = 0.2 material_final_print_temperature = 220 material_initial_print_temperature = 220 diff --git a/resources/quality/vertex_delta_k8800/k8800_TPU_High_Quality.inst.cfg b/resources/quality/vertex_delta_k8800/k8800_TPU_High_Quality.inst.cfg index 4598332ba6..b782c39cbf 100644 --- a/resources/quality/vertex_delta_k8800/k8800_TPU_High_Quality.inst.cfg +++ b/resources/quality/vertex_delta_k8800/k8800_TPU_High_Quality.inst.cfg @@ -11,8 +11,7 @@ weight = 1 material = Vertex_Delta_TPU [values] -layer_height = 0.1 -layer_height_0 = 0.2 +layer_height_0 = 0.2 material_final_print_temperature = 220 material_initial_print_temperature = 220 diff --git a/resources/quality/vertex_delta_k8800/k8800_TPU_Normal_Quality.inst.cfg b/resources/quality/vertex_delta_k8800/k8800_TPU_Normal_Quality.inst.cfg index 7a8a964b1c..d8898ed203 100644 --- a/resources/quality/vertex_delta_k8800/k8800_TPU_Normal_Quality.inst.cfg +++ b/resources/quality/vertex_delta_k8800/k8800_TPU_Normal_Quality.inst.cfg @@ -11,8 +11,7 @@ weight = 0 material = Vertex_Delta_TPU [values] -layer_height = 0.2 -layer_height_0 = 0.2 +layer_height_0 = 0.2 material_final_print_temperature = 220 material_initial_print_temperature = 220