Merge remote-tracking branch 'origin/3.3'

This commit is contained in:
Lipu Fei 2018-04-25 12:55:21 +02:00
commit ec9be7a103
19 changed files with 77 additions and 34 deletions

View file

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

View file

@ -74,6 +74,7 @@ class MachineManager(QObject):
self._stacks_have_errors = None # type:Optional[bool] 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_definition_changes_container = ContainerRegistry.getInstance().findContainers(id = "empty_definition_changes")[0]
self._empty_variant_container = ContainerRegistry.getInstance().findContainers(id = "empty_variant")[0] self._empty_variant_container = ContainerRegistry.getInstance().findContainers(id = "empty_variant")[0]
self._empty_material_container = ContainerRegistry.getInstance().findContainers(id = "empty_material")[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 ## 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): 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 = {} material_dict = {}
for position, extruder in global_stack.extruders.items(): for position, extruder in global_stack.extruders.items():
material_dict[position] = extruder.material.getMetaDataEntry("base_file") material_dict[position] = extruder.material.getMetaDataEntry("base_file")
@ -318,7 +326,7 @@ class MachineManager(QObject):
if global_quality_changes.getId() != "empty_quality_changes": if global_quality_changes.getId() != "empty_quality_changes":
quality_changes_groups = self._application.getQualityManager().getQualityChangesGroups(global_stack) quality_changes_groups = self._application.getQualityManager().getQualityChangesGroups(global_stack)
new_quality_changes_group = quality_changes_groups.get(global_quality_changes_name) 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) self._setQualityChangesGroup(new_quality_changes_group)
same_quality_found = True same_quality_found = True
Logger.log("i", "Machine '%s' quality changes set to '%s'", 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) Logger.log("d", "Current quality type = [%s]", current_quality_type)
if not self.activeMaterialsCompatible(): if not self.activeMaterialsCompatible():
Logger.log("i", "Active materials are not compatible, setting all qualities to empty (Not Supported).") if current_quality_type is not None:
self._setEmptyQuality() Logger.log("i", "Active materials are not compatible, setting all qualities to empty (Not Supported).")
self._setEmptyQuality()
return return
if not available_quality_types: if not available_quality_types:
Logger.log("i", "No available quality types found, setting all qualities to empty (Not Supported).") if self._current_quality_changes_group is None:
self._setEmptyQuality() Logger.log("i", "No available quality types found, setting all qualities to empty (Not Supported).")
self._setEmptyQuality()
return return
if current_quality_type in available_quality_types: if current_quality_type in available_quality_types:

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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

View file

@ -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

View file

@ -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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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