mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-10 15:25:09 -06:00
Make QualityChangesGroup depend on intent
This is probably the main implementation of CURA-6600.
This commit is contained in:
parent
1febfde3cc
commit
430bcc90a8
1 changed files with 3 additions and 24 deletions
|
@ -1,33 +1,12 @@
|
|||
# Copyright (c) 2018 Ultimaker B.V.
|
||||
# Copyright (c) 2019 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from UM.Application import Application
|
||||
from UM.ConfigurationErrorMessage import ConfigurationErrorMessage
|
||||
|
||||
from .QualityGroup import QualityGroup
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from cura.Machines.QualityNode import QualityNode
|
||||
|
||||
|
||||
class QualityChangesGroup(QualityGroup):
|
||||
def __init__(self, name: str, quality_type: str, parent = None) -> None:
|
||||
def __init__(self, name: str, quality_type: str, intent_category: str, parent = None) -> None:
|
||||
super().__init__(name, quality_type, parent)
|
||||
self._container_registry = Application.getInstance().getContainerRegistry()
|
||||
|
||||
def addNode(self, node: "QualityNode") -> None:
|
||||
extruder_position = node.container.getMetaDataEntry("position")
|
||||
|
||||
if extruder_position is None and self.node_for_global is not None or extruder_position in self.nodes_for_extruders: #We would be overwriting another node.
|
||||
ConfigurationErrorMessage.getInstance().addFaultyContainers(node.container_id)
|
||||
return
|
||||
|
||||
if extruder_position is None: # Then we're a global quality changes profile.
|
||||
self.node_for_global = node
|
||||
else: # This is an extruder's quality changes profile.
|
||||
self.nodes_for_extruders[extruder_position] = node
|
||||
self.intent_category = intent_category
|
||||
|
||||
def __str__(self) -> str:
|
||||
return "%s[<%s>, available = %s]" % (self.__class__.__name__, self.name, self.is_available)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue