mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-19 09:10:47 +08:00
Merge pull request #4883 from Ultimaker/CURA-5879_experimental_qualities
CURA-5879 experimental qualities
This commit is contained in:
commit
adf16310c7
@ -21,6 +21,7 @@ class QualityProfilesDropDownMenuModel(ListModel):
|
|||||||
AvailableRole = Qt.UserRole + 5
|
AvailableRole = Qt.UserRole + 5
|
||||||
QualityGroupRole = Qt.UserRole + 6
|
QualityGroupRole = Qt.UserRole + 6
|
||||||
QualityChangesGroupRole = Qt.UserRole + 7
|
QualityChangesGroupRole = Qt.UserRole + 7
|
||||||
|
IsExperimentalRole = Qt.UserRole + 8
|
||||||
|
|
||||||
def __init__(self, parent = None):
|
def __init__(self, parent = None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
@ -32,6 +33,7 @@ class QualityProfilesDropDownMenuModel(ListModel):
|
|||||||
self.addRoleName(self.AvailableRole, "available") #Whether the quality profile is available in our current nozzle + material.
|
self.addRoleName(self.AvailableRole, "available") #Whether the quality profile is available in our current nozzle + material.
|
||||||
self.addRoleName(self.QualityGroupRole, "quality_group")
|
self.addRoleName(self.QualityGroupRole, "quality_group")
|
||||||
self.addRoleName(self.QualityChangesGroupRole, "quality_changes_group")
|
self.addRoleName(self.QualityChangesGroupRole, "quality_changes_group")
|
||||||
|
self.addRoleName(self.IsExperimentalRole, "is_experimental")
|
||||||
|
|
||||||
self._application = Application.getInstance()
|
self._application = Application.getInstance()
|
||||||
self._machine_manager = self._application.getMachineManager()
|
self._machine_manager = self._application.getMachineManager()
|
||||||
@ -74,7 +76,8 @@ class QualityProfilesDropDownMenuModel(ListModel):
|
|||||||
"layer_height": layer_height,
|
"layer_height": layer_height,
|
||||||
"layer_height_unit": self._layer_height_unit,
|
"layer_height_unit": self._layer_height_unit,
|
||||||
"available": quality_group.is_available,
|
"available": quality_group.is_available,
|
||||||
"quality_group": quality_group}
|
"quality_group": quality_group,
|
||||||
|
"is_experimental": quality_group.is_experimental}
|
||||||
|
|
||||||
item_list.append(item)
|
item_list.append(item)
|
||||||
|
|
||||||
|
@ -4,6 +4,9 @@
|
|||||||
from typing import Dict, Optional, List, Set
|
from typing import Dict, Optional, List, Set
|
||||||
|
|
||||||
from PyQt5.QtCore import QObject, pyqtSlot
|
from PyQt5.QtCore import QObject, pyqtSlot
|
||||||
|
|
||||||
|
from UM.Util import parseBool
|
||||||
|
|
||||||
from cura.Machines.ContainerNode import ContainerNode
|
from cura.Machines.ContainerNode import ContainerNode
|
||||||
|
|
||||||
|
|
||||||
@ -29,6 +32,7 @@ class QualityGroup(QObject):
|
|||||||
self.nodes_for_extruders = {} # type: Dict[int, ContainerNode]
|
self.nodes_for_extruders = {} # type: Dict[int, ContainerNode]
|
||||||
self.quality_type = quality_type
|
self.quality_type = quality_type
|
||||||
self.is_available = False
|
self.is_available = False
|
||||||
|
self.is_experimental = False
|
||||||
|
|
||||||
@pyqtSlot(result = str)
|
@pyqtSlot(result = str)
|
||||||
def getName(self) -> str:
|
def getName(self) -> str:
|
||||||
@ -51,3 +55,17 @@ class QualityGroup(QObject):
|
|||||||
for extruder_node in self.nodes_for_extruders.values():
|
for extruder_node in self.nodes_for_extruders.values():
|
||||||
result.append(extruder_node)
|
result.append(extruder_node)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def setGlobalNode(self, node: "ContainerNode") -> None:
|
||||||
|
self.node_for_global = node
|
||||||
|
|
||||||
|
# Update is_experimental flag
|
||||||
|
is_experimental = parseBool(node.getMetaDataEntry("is_experimental", False))
|
||||||
|
self.is_experimental |= is_experimental
|
||||||
|
|
||||||
|
def setExtruderNode(self, position: int, node: "ContainerNode") -> None:
|
||||||
|
self.nodes_for_extruders[position] = node
|
||||||
|
|
||||||
|
# Update is_experimental flag
|
||||||
|
is_experimental = parseBool(node.getMetaDataEntry("is_experimental", False))
|
||||||
|
self.is_experimental |= is_experimental
|
||||||
|
@ -235,7 +235,7 @@ class QualityManager(QObject):
|
|||||||
|
|
||||||
for quality_type, quality_node in node.quality_type_map.items():
|
for quality_type, quality_node in node.quality_type_map.items():
|
||||||
quality_group = QualityGroup(quality_node.getMetaDataEntry("name", ""), quality_type)
|
quality_group = QualityGroup(quality_node.getMetaDataEntry("name", ""), quality_type)
|
||||||
quality_group.node_for_global = quality_node
|
quality_group.setGlobalNode(quality_node)
|
||||||
quality_group_dict[quality_type] = quality_group
|
quality_group_dict[quality_type] = quality_group
|
||||||
break
|
break
|
||||||
|
|
||||||
@ -337,7 +337,7 @@ class QualityManager(QObject):
|
|||||||
|
|
||||||
quality_group = quality_group_dict[quality_type]
|
quality_group = quality_group_dict[quality_type]
|
||||||
if position not in quality_group.nodes_for_extruders:
|
if position not in quality_group.nodes_for_extruders:
|
||||||
quality_group.nodes_for_extruders[position] = quality_node
|
quality_group.setExtruderNode(position, quality_node)
|
||||||
|
|
||||||
# If the machine has its own specific qualities, for extruders, it should skip the global qualities
|
# If the machine has its own specific qualities, for extruders, it should skip the global qualities
|
||||||
# and use the material/variant specific qualities.
|
# and use the material/variant specific qualities.
|
||||||
@ -367,7 +367,7 @@ class QualityManager(QObject):
|
|||||||
if node and node.quality_type_map:
|
if node and node.quality_type_map:
|
||||||
for quality_type, quality_node in node.quality_type_map.items():
|
for quality_type, quality_node in node.quality_type_map.items():
|
||||||
quality_group = QualityGroup(quality_node.getMetaDataEntry("name", ""), quality_type)
|
quality_group = QualityGroup(quality_node.getMetaDataEntry("name", ""), quality_type)
|
||||||
quality_group.node_for_global = quality_node
|
quality_group.setGlobalNode(quality_node)
|
||||||
quality_group_dict[quality_type] = quality_group
|
quality_group_dict[quality_type] = quality_group
|
||||||
break
|
break
|
||||||
|
|
||||||
|
@ -616,6 +616,14 @@ class MachineManager(QObject):
|
|||||||
is_supported = self._current_quality_group.is_available
|
is_supported = self._current_quality_group.is_available
|
||||||
return is_supported
|
return is_supported
|
||||||
|
|
||||||
|
@pyqtProperty(bool, notify = activeQualityGroupChanged)
|
||||||
|
def isActiveQualityExperimental(self) -> bool:
|
||||||
|
is_experimental = False
|
||||||
|
if self._global_container_stack:
|
||||||
|
if self._current_quality_group:
|
||||||
|
is_experimental = self._current_quality_group.is_experimental
|
||||||
|
return is_experimental
|
||||||
|
|
||||||
## Returns whether there is anything unsupported in the current set-up.
|
## Returns whether there is anything unsupported in the current set-up.
|
||||||
#
|
#
|
||||||
# The current set-up signifies the global stack and all extruder stacks,
|
# The current set-up signifies the global stack and all extruder stacks,
|
||||||
|
@ -17,18 +17,21 @@ Menu
|
|||||||
|
|
||||||
MenuItem
|
MenuItem
|
||||||
{
|
{
|
||||||
text: (model.layer_height != "") ? model.name + " - " + model.layer_height + model.layer_height_unit : model.name
|
text:
|
||||||
|
{
|
||||||
|
var full_text = (model.layer_height != "") ? model.name + " - " + model.layer_height + model.layer_height_unit : model.name
|
||||||
|
full_text += model.is_experimental ? " - Experimental" : ""
|
||||||
|
return full_text
|
||||||
|
}
|
||||||
checkable: true
|
checkable: true
|
||||||
checked: Cura.MachineManager.activeQualityOrQualityChangesName == model.name
|
checked: Cura.MachineManager.activeQualityOrQualityChangesName == model.name
|
||||||
exclusiveGroup: group
|
exclusiveGroup: group
|
||||||
onTriggered: {
|
onTriggered: Cura.MachineManager.setQualityGroup(model.quality_group)
|
||||||
Cura.MachineManager.setQualityGroup(model.quality_group)
|
|
||||||
}
|
|
||||||
visible: model.available
|
visible: model.available
|
||||||
}
|
}
|
||||||
|
|
||||||
onObjectAdded: menu.insertItem(index, object);
|
onObjectAdded: menu.insertItem(index, object)
|
||||||
onObjectRemoved: menu.removeItem(object);
|
onObjectRemoved: menu.removeItem(object)
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuSeparator
|
MenuSeparator
|
||||||
|
@ -64,11 +64,18 @@ Item
|
|||||||
activeFocusOnPress: true
|
activeFocusOnPress: true
|
||||||
menu: ProfileMenu { }
|
menu: ProfileMenu { }
|
||||||
|
|
||||||
function generateActiveQualityText () {
|
function generateActiveQualityText ()
|
||||||
var result = Cura.MachineManager.activeQualityOrQualityChangesName;
|
{
|
||||||
|
var result = Cura.MachineManager.activeQualityOrQualityChangesName
|
||||||
|
if (Cura.MachineManager.isActiveQualityExperimental)
|
||||||
|
{
|
||||||
|
result += " (Experimental)"
|
||||||
|
}
|
||||||
|
|
||||||
if (Cura.MachineManager.isActiveQualitySupported) {
|
if (Cura.MachineManager.isActiveQualitySupported)
|
||||||
if (Cura.MachineManager.activeQualityLayerHeight > 0) {
|
{
|
||||||
|
if (Cura.MachineManager.activeQualityLayerHeight > 0)
|
||||||
|
{
|
||||||
result += " <font color=\"" + UM.Theme.getColor("text_detail") + "\">"
|
result += " <font color=\"" + UM.Theme.getColor("text_detail") + "\">"
|
||||||
result += " - "
|
result += " - "
|
||||||
result += Cura.MachineManager.activeQualityLayerHeight + "mm"
|
result += Cura.MachineManager.activeQualityLayerHeight + "mm"
|
||||||
|
@ -10,6 +10,7 @@ quality_type = normal
|
|||||||
weight = 0
|
weight = 0
|
||||||
material = generic_pc
|
material = generic_pc
|
||||||
variant = AA 0.25
|
variant = AA 0.25
|
||||||
|
is_experimental = True
|
||||||
|
|
||||||
[values]
|
[values]
|
||||||
acceleration_enabled = True
|
acceleration_enabled = True
|
||||||
|
@ -10,6 +10,7 @@ quality_type = normal
|
|||||||
weight = 0
|
weight = 0
|
||||||
material = generic_pp
|
material = generic_pp
|
||||||
variant = AA 0.25
|
variant = AA 0.25
|
||||||
|
is_experimental = True
|
||||||
|
|
||||||
[values]
|
[values]
|
||||||
acceleration_enabled = True
|
acceleration_enabled = True
|
||||||
|
@ -10,6 +10,7 @@ quality_type = draft
|
|||||||
weight = -2
|
weight = -2
|
||||||
material = generic_cpe_plus
|
material = generic_cpe_plus
|
||||||
variant = AA 0.8
|
variant = AA 0.8
|
||||||
|
is_experimental = True
|
||||||
|
|
||||||
[values]
|
[values]
|
||||||
brim_width = 14
|
brim_width = 14
|
||||||
|
@ -10,6 +10,7 @@ quality_type = superdraft
|
|||||||
weight = -4
|
weight = -4
|
||||||
material = generic_cpe_plus
|
material = generic_cpe_plus
|
||||||
variant = AA 0.8
|
variant = AA 0.8
|
||||||
|
is_experimental = True
|
||||||
|
|
||||||
[values]
|
[values]
|
||||||
brim_width = 14
|
brim_width = 14
|
||||||
|
@ -10,6 +10,7 @@ quality_type = verydraft
|
|||||||
weight = -3
|
weight = -3
|
||||||
material = generic_cpe_plus
|
material = generic_cpe_plus
|
||||||
variant = AA 0.8
|
variant = AA 0.8
|
||||||
|
is_experimental = True
|
||||||
|
|
||||||
[values]
|
[values]
|
||||||
brim_width = 14
|
brim_width = 14
|
||||||
|
@ -10,6 +10,7 @@ quality_type = draft
|
|||||||
weight = 0
|
weight = 0
|
||||||
material = generic_pc
|
material = generic_pc
|
||||||
variant = AA 0.8
|
variant = AA 0.8
|
||||||
|
is_experimental = True
|
||||||
|
|
||||||
[values]
|
[values]
|
||||||
brim_width = 14
|
brim_width = 14
|
||||||
|
@ -10,6 +10,7 @@ quality_type = superdraft
|
|||||||
weight = -2
|
weight = -2
|
||||||
material = generic_pc
|
material = generic_pc
|
||||||
variant = AA 0.8
|
variant = AA 0.8
|
||||||
|
is_experimental = True
|
||||||
|
|
||||||
[values]
|
[values]
|
||||||
brim_width = 14
|
brim_width = 14
|
||||||
|
@ -10,6 +10,7 @@ quality_type = verydraft
|
|||||||
weight = -1
|
weight = -1
|
||||||
material = generic_pc
|
material = generic_pc
|
||||||
variant = AA 0.8
|
variant = AA 0.8
|
||||||
|
is_experimental = True
|
||||||
|
|
||||||
[values]
|
[values]
|
||||||
brim_width = 14
|
brim_width = 14
|
||||||
|
@ -10,6 +10,7 @@ quality_type = normal
|
|||||||
weight = 0
|
weight = 0
|
||||||
material = generic_pc
|
material = generic_pc
|
||||||
variant = AA 0.25
|
variant = AA 0.25
|
||||||
|
is_experimental = True
|
||||||
|
|
||||||
[values]
|
[values]
|
||||||
acceleration_enabled = True
|
acceleration_enabled = True
|
||||||
|
@ -10,6 +10,7 @@ quality_type = normal
|
|||||||
weight = 0
|
weight = 0
|
||||||
material = generic_pp
|
material = generic_pp
|
||||||
variant = AA 0.25
|
variant = AA 0.25
|
||||||
|
is_experimental = True
|
||||||
|
|
||||||
[values]
|
[values]
|
||||||
acceleration_enabled = True
|
acceleration_enabled = True
|
||||||
|
@ -10,6 +10,7 @@ quality_type = draft
|
|||||||
weight = -2
|
weight = -2
|
||||||
material = generic_cpe_plus
|
material = generic_cpe_plus
|
||||||
variant = AA 0.8
|
variant = AA 0.8
|
||||||
|
is_experimental = True
|
||||||
|
|
||||||
[values]
|
[values]
|
||||||
brim_width = 14
|
brim_width = 14
|
||||||
|
@ -10,6 +10,7 @@ quality_type = superdraft
|
|||||||
weight = -4
|
weight = -4
|
||||||
material = generic_cpe_plus
|
material = generic_cpe_plus
|
||||||
variant = AA 0.8
|
variant = AA 0.8
|
||||||
|
is_experimental = True
|
||||||
|
|
||||||
[values]
|
[values]
|
||||||
brim_width = 14
|
brim_width = 14
|
||||||
|
@ -10,6 +10,7 @@ quality_type = verydraft
|
|||||||
weight = -3
|
weight = -3
|
||||||
material = generic_cpe_plus
|
material = generic_cpe_plus
|
||||||
variant = AA 0.8
|
variant = AA 0.8
|
||||||
|
is_experimental = True
|
||||||
|
|
||||||
[values]
|
[values]
|
||||||
brim_width = 14
|
brim_width = 14
|
||||||
|
@ -10,6 +10,7 @@ quality_type = draft
|
|||||||
weight = 0
|
weight = 0
|
||||||
material = generic_pc
|
material = generic_pc
|
||||||
variant = AA 0.8
|
variant = AA 0.8
|
||||||
|
is_experimental = True
|
||||||
|
|
||||||
[values]
|
[values]
|
||||||
brim_width = 14
|
brim_width = 14
|
||||||
|
@ -10,6 +10,7 @@ quality_type = superdraft
|
|||||||
weight = -2
|
weight = -2
|
||||||
material = generic_pc
|
material = generic_pc
|
||||||
variant = AA 0.8
|
variant = AA 0.8
|
||||||
|
is_experimental = True
|
||||||
|
|
||||||
[values]
|
[values]
|
||||||
brim_width = 14
|
brim_width = 14
|
||||||
|
@ -10,6 +10,7 @@ quality_type = verydraft
|
|||||||
weight = -1
|
weight = -1
|
||||||
material = generic_pc
|
material = generic_pc
|
||||||
variant = AA 0.8
|
variant = AA 0.8
|
||||||
|
is_experimental = True
|
||||||
|
|
||||||
[values]
|
[values]
|
||||||
brim_width = 14
|
brim_width = 14
|
||||||
|
@ -11,6 +11,7 @@ weight = -2
|
|||||||
material = generic_cpe_plus
|
material = generic_cpe_plus
|
||||||
variant = AA 0.8
|
variant = AA 0.8
|
||||||
buildplate = Aluminum
|
buildplate = Aluminum
|
||||||
|
is_experimental = True
|
||||||
|
|
||||||
[values]
|
[values]
|
||||||
brim_width = 14
|
brim_width = 14
|
||||||
|
@ -11,6 +11,7 @@ weight = 0
|
|||||||
material = generic_pc
|
material = generic_pc
|
||||||
variant = AA 0.8
|
variant = AA 0.8
|
||||||
buildplate = Aluminum
|
buildplate = Aluminum
|
||||||
|
is_experimental = True
|
||||||
|
|
||||||
[values]
|
[values]
|
||||||
brim_width = 10
|
brim_width = 10
|
||||||
|
@ -480,7 +480,7 @@
|
|||||||
"toolbox_footer_button": [8.0, 2.5],
|
"toolbox_footer_button": [8.0, 2.5],
|
||||||
"toolbox_showcase_spacing": [1.0, 1.0],
|
"toolbox_showcase_spacing": [1.0, 1.0],
|
||||||
"toolbox_header_tab": [8.0, 4.0],
|
"toolbox_header_tab": [8.0, 4.0],
|
||||||
"toolbox_detail_header": [1.0, 14.0],
|
"toolbox_detail_header": [1.0, 14.0],https://github.com/Ultimaker/Cura/pull/4883
|
||||||
"toolbox_detail_tile": [1.0, 8.0],
|
"toolbox_detail_tile": [1.0, 8.0],
|
||||||
"toolbox_back_column": [6.0, 1.0],
|
"toolbox_back_column": [6.0, 1.0],
|
||||||
"toolbox_back_button": [4.0, 2.0],
|
"toolbox_back_button": [4.0, 2.0],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user