mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-21 05:37:50 -06:00
Some more documentation
This commit is contained in:
parent
7a907aa713
commit
ab1044de7b
2 changed files with 12 additions and 2 deletions
|
@ -28,6 +28,11 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
## Overridden from ContainerRegistry
|
## Overridden from ContainerRegistry
|
||||||
|
#
|
||||||
|
# Adds a container to the registry.
|
||||||
|
#
|
||||||
|
# This will also try to convert a ContainerStack to either Extruder or
|
||||||
|
# Global stack based on metadata information.
|
||||||
@override(ContainerRegistry)
|
@override(ContainerRegistry)
|
||||||
def addContainer(self, container):
|
def addContainer(self, container):
|
||||||
# Note: Intentional check with type() because we want to ignore subclasses
|
# Note: Intentional check with type() because we want to ignore subclasses
|
||||||
|
@ -295,6 +300,7 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||||
return parseBool(global_container_stack.getMetaDataEntry("has_machine_quality", False))
|
return parseBool(global_container_stack.getMetaDataEntry("has_machine_quality", False))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
## Convert an "old-style" pure ContainerStack to either an Extruder or Global stack.
|
||||||
def _convertContainerStack(self, container):
|
def _convertContainerStack(self, container):
|
||||||
assert type(container) == ContainerStack
|
assert type(container) == ContainerStack
|
||||||
|
|
||||||
|
|
|
@ -426,8 +426,6 @@ class CuraContainerStack(ContainerStack):
|
||||||
# - Otherwise, if the machine definition has a metadata entry "preferred_material", try to find a material that matches the specified ID.
|
# - Otherwise, if the machine definition has a metadata entry "preferred_material", try to find a material that matches the specified ID.
|
||||||
#
|
#
|
||||||
# \return The container that should be used as default, or None if nothing was found or the machine does not use materials.
|
# \return The container that should be used as default, or None if nothing was found or the machine does not use materials.
|
||||||
#
|
|
||||||
#
|
|
||||||
def findDefaultMaterial(self) -> Optional[ContainerInterface]:
|
def findDefaultMaterial(self) -> Optional[ContainerInterface]:
|
||||||
definition = self._getMachineDefinition()
|
definition = self._getMachineDefinition()
|
||||||
if not definition.getMetaDataEntry("has_materials"):
|
if not definition.getMetaDataEntry("has_materials"):
|
||||||
|
@ -467,6 +465,12 @@ class CuraContainerStack(ContainerStack):
|
||||||
Logger.log("w", "Could not find a valid material for stack {stack}", stack = self.id)
|
Logger.log("w", "Could not find a valid material for stack {stack}", stack = self.id)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
## Find the quality that should be used as "default" quality.
|
||||||
|
#
|
||||||
|
# This will search for qualities that match the current definition and pick the preferred one,
|
||||||
|
# if specified by the machine definition.
|
||||||
|
#
|
||||||
|
# \return The container that should be used as default, or None if nothing was found.
|
||||||
def findDefaultQuality(self) -> Optional[ContainerInterface]:
|
def findDefaultQuality(self) -> Optional[ContainerInterface]:
|
||||||
definition = self._getMachineDefinition()
|
definition = self._getMachineDefinition()
|
||||||
registry = ContainerRegistry.getInstance()
|
registry = ContainerRegistry.getInstance()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue