mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 14:09:02 +08:00
Don't make QualityChangesGroup hold ContainerNodes
It can't hold ContainerNodes since the quality changes are no longer nodes in any tree. This now makes it hold metadata instead. Contributes to issue CURA-6600.
This commit is contained in:
parent
430bcc90a8
commit
bcd450daa0
@ -1,12 +1,23 @@
|
|||||||
# Copyright (c) 2019 Ultimaker B.V.
|
# Copyright (c) 2019 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 .QualityGroup import QualityGroup
|
from PyQt5.QtCore import QObject
|
||||||
|
from typing import Any, Dict, Optional
|
||||||
|
|
||||||
class QualityChangesGroup(QualityGroup):
|
## Data struct to group several quality changes instance containers together.
|
||||||
|
#
|
||||||
|
# Each group represents one "custom profile" as the user sees it, which
|
||||||
|
# contains an instance container for the global stack and one instance
|
||||||
|
# container per extruder.
|
||||||
|
class QualityChangesGroup(QObject):
|
||||||
def __init__(self, name: str, quality_type: str, intent_category: str, parent = None) -> None:
|
def __init__(self, name: str, quality_type: str, intent_category: str, parent = None) -> None:
|
||||||
super().__init__(name, quality_type, parent)
|
super().__init__(parent)
|
||||||
|
self.name = name
|
||||||
|
self.quality_type = quality_type
|
||||||
self.intent_category = intent_category
|
self.intent_category = intent_category
|
||||||
|
self.is_available = False
|
||||||
|
self.metadata_for_global = None # type: Optional[str]
|
||||||
|
self.metadata_per_extruder = {} # type: Dict[int, Dict[str, Any]]
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return "%s[<%s>, available = %s]" % (self.__class__.__name__, self.name, self.is_available)
|
return "{class_name}[{name}, available = {is_available}]".format(class_name = self.__class__.__name__, name = self.name, is_available = self.is_available)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user