mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
Remove some changes, debugging - CURA-4451
This commit is contained in:
parent
c679f4aa6b
commit
7bf854aa0f
11 changed files with 35 additions and 132 deletions
|
@ -272,6 +272,7 @@ class CuraApplication(QtApplication):
|
|||
empty_quality_container.setName("Not Supported")
|
||||
empty_quality_container.addMetaDataEntry("quality_type", "normal")
|
||||
empty_quality_container.addMetaDataEntry("type", "quality")
|
||||
empty_quality_container.addMetaDataEntry("supported", False)
|
||||
ContainerRegistry.getInstance().addContainer(empty_quality_container)
|
||||
empty_quality_changes_container = copy.deepcopy(empty_container)
|
||||
empty_quality_changes_container._id = "empty_quality_changes"
|
||||
|
|
|
@ -927,7 +927,8 @@ class MachineManager(QObject):
|
|||
for stack in stacks:
|
||||
material = stack.material
|
||||
quality = quality_manager.findQualityByQualityType(quality_type, global_machine_definition, [material])
|
||||
if not quality: #No quality profile is found for this quality type.
|
||||
if not quality:
|
||||
# No quality profile is found for this quality type.
|
||||
quality = self._empty_quality_container
|
||||
result.append({"stack": stack, "quality": quality, "quality_changes": empty_quality_changes})
|
||||
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
# Copyright (c) 2017 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from UM.Signal import signalemitter
|
||||
|
||||
from UM.Settings.InstanceContainer import InstanceContainer
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase
|
||||
|
||||
|
||||
## A container for not supported profiles.
|
||||
#
|
||||
#
|
||||
@signalemitter
|
||||
class NotSupportedProfileContainer(InstanceContainer):
|
||||
|
||||
def __init__(self, container_id: str, machine_id: str, material_id: str, *args, **kwargs):
|
||||
super().__init__(container_id, *args, **kwargs)
|
||||
|
||||
# self._id = str(container_id) # type: str
|
||||
# self._name = "Not supported" # type: str
|
||||
|
||||
self.setMetaData({
|
||||
"setting_version": 3,
|
||||
"supported": False,
|
||||
"type": "quality",
|
||||
"weight": "0",
|
||||
"material": material_id
|
||||
})
|
||||
|
||||
# register this container
|
||||
ContainerRegistry.getInstance().addContainer(self)
|
||||
|
||||
# set printer definition
|
||||
definition = ContainerRegistry.getInstance().findDefinitionContainers(id = machine_id)
|
||||
self.setDefinition(definition[0])
|
||||
|
||||
|
||||
# register the container mime type
|
||||
not_support_instance_mime = MimeType(
|
||||
name = "application/x-cura-notsupportedinstancecontainer",
|
||||
comment = "Cura Not Supported Instance Container",
|
||||
suffixes = []
|
||||
)
|
||||
|
||||
MimeTypeDatabase.addMimeType(not_support_instance_mime)
|
||||
ContainerRegistry.addContainerTypeByName(NotSupportedProfileContainer, "not_supported_instance", not_support_instance_mime.name)
|
|
@ -11,7 +11,6 @@ from UM.Settings.Models.InstanceContainersModel import InstanceContainersModel
|
|||
|
||||
from cura.QualityManager import QualityManager
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
from cura.Settings.NotSupportedProfileContainer import NotSupportedProfileContainer
|
||||
|
||||
|
||||
## QML Model for listing the current list of valid quality profiles.
|
||||
|
@ -20,14 +19,12 @@ class ProfilesModel(InstanceContainersModel):
|
|||
LayerHeightRole = Qt.UserRole + 1001
|
||||
LayerHeightWithoutUnitRole = Qt.UserRole + 1002
|
||||
AvailableRole = Qt.UserRole + 1003
|
||||
NotSupportedRole = Qt.UserRole + 1004
|
||||
|
||||
def __init__(self, parent = None):
|
||||
super().__init__(parent)
|
||||
self.addRoleName(self.LayerHeightRole, "layer_height")
|
||||
self.addRoleName(self.LayerHeightWithoutUnitRole, "layer_height_without_unit")
|
||||
self.addRoleName(self.AvailableRole, "available")
|
||||
self.addRoleName(self.NotSupportedRole, "not_supported")
|
||||
|
||||
Application.getInstance().globalContainerStackChanged.connect(self._update)
|
||||
|
||||
|
@ -74,12 +71,9 @@ class ProfilesModel(InstanceContainersModel):
|
|||
# The actual list of quality profiles come from the first extruder in the extruder list.
|
||||
result = QualityManager.getInstance().findAllUsableQualitiesForMachineAndExtruders(global_container_stack, extruder_stacks)
|
||||
|
||||
# If not qualities are found we dynamically create an empty container with name "Not Supported"
|
||||
if len(result) == 0:
|
||||
machine_id = global_container_stack.definition.getId()
|
||||
material_id = extruder_stacks[0].material.getId()
|
||||
container_id = machine_id + "_" + material_id + "_not_supported"
|
||||
not_supported_container = NotSupportedProfileContainer(container_id, machine_id, material_id)
|
||||
# If not qualities are found we dynamically create a not supported container for this machine + material combination
|
||||
not_supported_container = ContainerRegistry.getInstance().findContainers(id = "empty_quality")[0]
|
||||
result.append(not_supported_container)
|
||||
return result
|
||||
|
||||
|
@ -127,8 +121,7 @@ class ProfilesModel(InstanceContainersModel):
|
|||
extruder_stacks = new_extruder_stacks + extruder_stacks
|
||||
|
||||
# Get a list of usable/available qualities for this machine and material
|
||||
qualities = QualityManager.getInstance().findAllUsableQualitiesForMachineAndExtruders(global_container_stack,
|
||||
extruder_stacks)
|
||||
qualities = QualityManager.getInstance().findAllUsableQualitiesForMachineAndExtruders(global_container_stack, extruder_stacks)
|
||||
|
||||
container_registry = ContainerRegistry.getInstance()
|
||||
machine_manager = Application.getInstance().getMachineManager()
|
||||
|
@ -177,8 +170,7 @@ class ProfilesModel(InstanceContainersModel):
|
|||
if not profile:
|
||||
self._setItemLayerHeight(item, "", "")
|
||||
item["available"] = False
|
||||
item["not_supported"] = True
|
||||
yield item
|
||||
yield None
|
||||
continue
|
||||
|
||||
profile = profile[0]
|
||||
|
@ -187,7 +179,6 @@ class ProfilesModel(InstanceContainersModel):
|
|||
# Easy case: This profile defines its own layer height.
|
||||
if profile.hasProperty("layer_height", "value"):
|
||||
self._setItemLayerHeight(item, profile.getProperty("layer_height", "value"), unit)
|
||||
item["not_supported"] = False
|
||||
yield item
|
||||
continue
|
||||
|
||||
|
@ -206,7 +197,6 @@ class ProfilesModel(InstanceContainersModel):
|
|||
quality = None
|
||||
if quality and quality.hasProperty("layer_height", "value"):
|
||||
self._setItemLayerHeight(item, quality.getProperty("layer_height", "value"), unit)
|
||||
item["not_supported"] = False
|
||||
yield item
|
||||
continue
|
||||
|
||||
|
@ -217,7 +207,6 @@ class ProfilesModel(InstanceContainersModel):
|
|||
if not skip_until_container or skip_until_container == ContainerRegistry.getInstance().getEmptyInstanceContainer(): #No variant in stack.
|
||||
skip_until_container = global_container_stack.getBottom()
|
||||
self._setItemLayerHeight(item, global_container_stack.getRawProperty("layer_height", "value", skip_until_container = skip_until_container.getId()), unit) # Fall through to the currently loaded material.
|
||||
item["not_supported"] = False
|
||||
yield item
|
||||
|
||||
def _setItemLayerHeight(self, item, value, unit):
|
||||
|
|
|
@ -11,8 +11,11 @@
|
|||
"file_formats": "text/x-gcode",
|
||||
"platform": "builder_premium_platform.stl",
|
||||
"platform_offset": [-126, -36, 117],
|
||||
|
||||
"has_machine_quality": true,
|
||||
"preferred_quality": "*Normal*",
|
||||
"preferred_material": "*pla*",
|
||||
"preferred_quality": "*normal*",
|
||||
|
||||
"machine_extruder_trains":
|
||||
{
|
||||
"0": "builder_premium_small_rear",
|
||||
|
|
|
@ -17,12 +17,12 @@ Menu
|
|||
|
||||
MenuItem
|
||||
{
|
||||
text: model.name + (model.layer_height != "" ? (" - " + model.layer_height) : "")
|
||||
text: model.name + " - " + model.layer_height
|
||||
checkable: true
|
||||
checked: Cura.MachineManager.activeQualityChangesId == "" && Cura.MachineManager.activeQualityType == model.metadata.quality_type
|
||||
checked: Cura.MachineManager.activeQualityId == model.id
|
||||
exclusiveGroup: group
|
||||
onTriggered: Cura.MachineManager.setActiveQuality(model.id)
|
||||
visible: model.available || model.not_supported
|
||||
visible: model.available
|
||||
}
|
||||
|
||||
onObjectAdded: menu.insertItem(index, object);
|
||||
|
|
|
@ -63,10 +63,14 @@ Item
|
|||
menu: ProfileMenu { }
|
||||
|
||||
function generateActiveQualityText () {
|
||||
var result = ""
|
||||
var result = catalog.i18nc("@", "No Profile Available") // default text
|
||||
|
||||
if (Cura.MachineManager.activeQualityName) {
|
||||
result += Cura.MachineManager.activeQualityName
|
||||
console.log("Cura.MachineManager.activeQualityName", Cura.MachineManager.activeQualityName)
|
||||
console.log("Cura.ProfilesModel.rowCount()", Cura.ProfilesModel.rowCount())
|
||||
console.log("Cura.MachineManager.isActiveQualitySupported", Cura.MachineManager.isActiveQualitySupported)
|
||||
|
||||
if (Cura.MachineManager.activeQualityName && Cura.ProfilesModel.rowCount() > 0) {
|
||||
result = Cura.MachineManager.activeQualityName
|
||||
|
||||
if (Cura.MachineManager.activeQualityLayerHeight > 0) {
|
||||
result += " <font color=\"" + UM.Theme.getColor("text_detail") + "\">"
|
||||
|
|
|
@ -245,35 +245,29 @@ Column
|
|||
color: UM.Theme.getColor("text");
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
ToolButton
|
||||
{
|
||||
id: materialSelection
|
||||
|
||||
text: Cura.MachineManager.activeMaterialName
|
||||
tooltip: Cura.MachineManager.activeMaterialName
|
||||
visible: Cura.MachineManager.hasMaterials
|
||||
property var valueError:
|
||||
{
|
||||
var data = Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeMaterialId, "compatible")
|
||||
if(data == "False")
|
||||
{
|
||||
return true
|
||||
}
|
||||
else
|
||||
{
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
property var valueWarning: ! Cura.MachineManager.isActiveQualitySupported
|
||||
|
||||
enabled: !extrudersList.visible || base.currentExtruderIndex > -1
|
||||
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
width: parent.width * 0.7 + UM.Theme.getSize("sidebar_margin").width
|
||||
anchors.right: parent.right
|
||||
style: UM.Theme.styles.sidebar_header_button
|
||||
activeFocusOnPress: true;
|
||||
menu: MaterialMenu {
|
||||
extruderIndex: base.currentExtruderIndex
|
||||
}
|
||||
|
||||
menu: MaterialMenu { extruderIndex: base.currentExtruderIndex }
|
||||
property var valueError: !isMaterialSupported()
|
||||
property var valueWarning: ! Cura.MachineManager.isActiveQualitySupported
|
||||
|
||||
function isMaterialSupported () {
|
||||
return Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeMaterialId, "compatible") == "True"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
[general]
|
||||
version = 2
|
||||
name = Not Supported
|
||||
definition = ultimaker3
|
||||
|
||||
[metadata]
|
||||
weight = 0
|
||||
type = quality
|
||||
quality_type = normal
|
||||
material = generic_pva_ultimaker3_AA_0.4
|
||||
supported = False
|
||||
setting_version = 3
|
||||
|
||||
[values]
|
|
@ -1,14 +0,0 @@
|
|||
[general]
|
||||
version = 2
|
||||
name = Not Supported
|
||||
definition = ultimaker3
|
||||
|
||||
[metadata]
|
||||
weight = 0
|
||||
type = quality
|
||||
quality_type = normal
|
||||
material = generic_pva_ultimaker3_AA_0.8
|
||||
supported = False
|
||||
setting_version = 3
|
||||
|
||||
[values]
|
|
@ -1,14 +0,0 @@
|
|||
[general]
|
||||
version = 2
|
||||
name = Not Supported
|
||||
definition = ultimaker3
|
||||
|
||||
[metadata]
|
||||
weight = 0
|
||||
type = quality
|
||||
quality_type = superdraft
|
||||
material = generic_pva_ultimaker3_AA_0.8
|
||||
supported = False
|
||||
setting_version = 3
|
||||
|
||||
[values]
|
Loading…
Add table
Add a link
Reference in a new issue