mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-19 03:47:29 +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
|
||||
QualityGroupRole = Qt.UserRole + 6
|
||||
QualityChangesGroupRole = Qt.UserRole + 7
|
||||
IsExperimentalRole = Qt.UserRole + 8
|
||||
|
||||
def __init__(self, parent = None):
|
||||
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.QualityGroupRole, "quality_group")
|
||||
self.addRoleName(self.QualityChangesGroupRole, "quality_changes_group")
|
||||
self.addRoleName(self.IsExperimentalRole, "is_experimental")
|
||||
|
||||
self._application = Application.getInstance()
|
||||
self._machine_manager = self._application.getMachineManager()
|
||||
@ -74,7 +76,8 @@ class QualityProfilesDropDownMenuModel(ListModel):
|
||||
"layer_height": layer_height,
|
||||
"layer_height_unit": self._layer_height_unit,
|
||||
"available": quality_group.is_available,
|
||||
"quality_group": quality_group}
|
||||
"quality_group": quality_group,
|
||||
"is_experimental": quality_group.is_experimental}
|
||||
|
||||
item_list.append(item)
|
||||
|
||||
|
@ -4,6 +4,9 @@
|
||||
from typing import Dict, Optional, List, Set
|
||||
|
||||
from PyQt5.QtCore import QObject, pyqtSlot
|
||||
|
||||
from UM.Util import parseBool
|
||||
|
||||
from cura.Machines.ContainerNode import ContainerNode
|
||||
|
||||
|
||||
@ -29,6 +32,7 @@ class QualityGroup(QObject):
|
||||
self.nodes_for_extruders = {} # type: Dict[int, ContainerNode]
|
||||
self.quality_type = quality_type
|
||||
self.is_available = False
|
||||
self.is_experimental = False
|
||||
|
||||
@pyqtSlot(result = str)
|
||||
def getName(self) -> str:
|
||||
@ -51,3 +55,17 @@ class QualityGroup(QObject):
|
||||
for extruder_node in self.nodes_for_extruders.values():
|
||||
result.append(extruder_node)
|
||||
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():
|
||||
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
|
||||
break
|
||||
|
||||
@ -337,7 +337,7 @@ class QualityManager(QObject):
|
||||
|
||||
quality_group = quality_group_dict[quality_type]
|
||||
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
|
||||
# and use the material/variant specific qualities.
|
||||
@ -367,7 +367,7 @@ class QualityManager(QObject):
|
||||
if node and node.quality_type_map:
|
||||
for quality_type, quality_node in node.quality_type_map.items():
|
||||
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
|
||||
break
|
||||
|
||||
|
@ -616,6 +616,14 @@ class MachineManager(QObject):
|
||||
is_supported = self._current_quality_group.is_available
|
||||
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.
|
||||
#
|
||||
# The current set-up signifies the global stack and all extruder stacks,
|
||||
|
@ -17,18 +17,21 @@ Menu
|
||||
|
||||
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
|
||||
checked: Cura.MachineManager.activeQualityOrQualityChangesName == model.name
|
||||
exclusiveGroup: group
|
||||
onTriggered: {
|
||||
Cura.MachineManager.setQualityGroup(model.quality_group)
|
||||
}
|
||||
onTriggered: Cura.MachineManager.setQualityGroup(model.quality_group)
|
||||
visible: model.available
|
||||
}
|
||||
|
||||
onObjectAdded: menu.insertItem(index, object);
|
||||
onObjectRemoved: menu.removeItem(object);
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
||||
|
||||
MenuSeparator
|
||||
|
@ -64,11 +64,18 @@ Item
|
||||
activeFocusOnPress: true
|
||||
menu: ProfileMenu { }
|
||||
|
||||
function generateActiveQualityText () {
|
||||
var result = Cura.MachineManager.activeQualityOrQualityChangesName;
|
||||
function generateActiveQualityText ()
|
||||
{
|
||||
var result = Cura.MachineManager.activeQualityOrQualityChangesName
|
||||
if (Cura.MachineManager.isActiveQualityExperimental)
|
||||
{
|
||||
result += " (Experimental)"
|
||||
}
|
||||
|
||||
if (Cura.MachineManager.isActiveQualitySupported) {
|
||||
if (Cura.MachineManager.activeQualityLayerHeight > 0) {
|
||||
if (Cura.MachineManager.isActiveQualitySupported)
|
||||
{
|
||||
if (Cura.MachineManager.activeQualityLayerHeight > 0)
|
||||
{
|
||||
result += " <font color=\"" + UM.Theme.getColor("text_detail") + "\">"
|
||||
result += " - "
|
||||
result += Cura.MachineManager.activeQualityLayerHeight + "mm"
|
||||
|
@ -10,6 +10,7 @@ quality_type = normal
|
||||
weight = 0
|
||||
material = generic_pc
|
||||
variant = AA 0.25
|
||||
is_experimental = True
|
||||
|
||||
[values]
|
||||
acceleration_enabled = True
|
||||
|
@ -10,6 +10,7 @@ quality_type = normal
|
||||
weight = 0
|
||||
material = generic_pp
|
||||
variant = AA 0.25
|
||||
is_experimental = True
|
||||
|
||||
[values]
|
||||
acceleration_enabled = True
|
||||
|
@ -10,6 +10,7 @@ quality_type = draft
|
||||
weight = -2
|
||||
material = generic_cpe_plus
|
||||
variant = AA 0.8
|
||||
is_experimental = True
|
||||
|
||||
[values]
|
||||
brim_width = 14
|
||||
|
@ -10,6 +10,7 @@ quality_type = superdraft
|
||||
weight = -4
|
||||
material = generic_cpe_plus
|
||||
variant = AA 0.8
|
||||
is_experimental = True
|
||||
|
||||
[values]
|
||||
brim_width = 14
|
||||
|
@ -10,6 +10,7 @@ quality_type = verydraft
|
||||
weight = -3
|
||||
material = generic_cpe_plus
|
||||
variant = AA 0.8
|
||||
is_experimental = True
|
||||
|
||||
[values]
|
||||
brim_width = 14
|
||||
|
@ -10,6 +10,7 @@ quality_type = draft
|
||||
weight = 0
|
||||
material = generic_pc
|
||||
variant = AA 0.8
|
||||
is_experimental = True
|
||||
|
||||
[values]
|
||||
brim_width = 14
|
||||
|
@ -10,6 +10,7 @@ quality_type = superdraft
|
||||
weight = -2
|
||||
material = generic_pc
|
||||
variant = AA 0.8
|
||||
is_experimental = True
|
||||
|
||||
[values]
|
||||
brim_width = 14
|
||||
|
@ -10,6 +10,7 @@ quality_type = verydraft
|
||||
weight = -1
|
||||
material = generic_pc
|
||||
variant = AA 0.8
|
||||
is_experimental = True
|
||||
|
||||
[values]
|
||||
brim_width = 14
|
||||
|
@ -10,6 +10,7 @@ quality_type = normal
|
||||
weight = 0
|
||||
material = generic_pc
|
||||
variant = AA 0.25
|
||||
is_experimental = True
|
||||
|
||||
[values]
|
||||
acceleration_enabled = True
|
||||
|
@ -10,6 +10,7 @@ quality_type = normal
|
||||
weight = 0
|
||||
material = generic_pp
|
||||
variant = AA 0.25
|
||||
is_experimental = True
|
||||
|
||||
[values]
|
||||
acceleration_enabled = True
|
||||
|
@ -10,6 +10,7 @@ quality_type = draft
|
||||
weight = -2
|
||||
material = generic_cpe_plus
|
||||
variant = AA 0.8
|
||||
is_experimental = True
|
||||
|
||||
[values]
|
||||
brim_width = 14
|
||||
|
@ -10,6 +10,7 @@ quality_type = superdraft
|
||||
weight = -4
|
||||
material = generic_cpe_plus
|
||||
variant = AA 0.8
|
||||
is_experimental = True
|
||||
|
||||
[values]
|
||||
brim_width = 14
|
||||
|
@ -10,6 +10,7 @@ quality_type = verydraft
|
||||
weight = -3
|
||||
material = generic_cpe_plus
|
||||
variant = AA 0.8
|
||||
is_experimental = True
|
||||
|
||||
[values]
|
||||
brim_width = 14
|
||||
|
@ -10,6 +10,7 @@ quality_type = draft
|
||||
weight = 0
|
||||
material = generic_pc
|
||||
variant = AA 0.8
|
||||
is_experimental = True
|
||||
|
||||
[values]
|
||||
brim_width = 14
|
||||
|
@ -10,6 +10,7 @@ quality_type = superdraft
|
||||
weight = -2
|
||||
material = generic_pc
|
||||
variant = AA 0.8
|
||||
is_experimental = True
|
||||
|
||||
[values]
|
||||
brim_width = 14
|
||||
|
@ -10,6 +10,7 @@ quality_type = verydraft
|
||||
weight = -1
|
||||
material = generic_pc
|
||||
variant = AA 0.8
|
||||
is_experimental = True
|
||||
|
||||
[values]
|
||||
brim_width = 14
|
||||
|
@ -11,6 +11,7 @@ weight = -2
|
||||
material = generic_cpe_plus
|
||||
variant = AA 0.8
|
||||
buildplate = Aluminum
|
||||
is_experimental = True
|
||||
|
||||
[values]
|
||||
brim_width = 14
|
||||
|
@ -11,6 +11,7 @@ weight = 0
|
||||
material = generic_pc
|
||||
variant = AA 0.8
|
||||
buildplate = Aluminum
|
||||
is_experimental = True
|
||||
|
||||
[values]
|
||||
brim_width = 10
|
||||
|
@ -480,7 +480,7 @@
|
||||
"toolbox_footer_button": [8.0, 2.5],
|
||||
"toolbox_showcase_spacing": [1.0, 1.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_back_column": [6.0, 1.0],
|
||||
"toolbox_back_button": [4.0, 2.0],
|
||||
|
Loading…
x
Reference in New Issue
Block a user