mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Move getMachineDefinitionIDForQualitySearch() into QualityManager.py
This commit is contained in:
parent
4a202d6728
commit
07824c21e1
6 changed files with 28 additions and 30 deletions
|
@ -1,25 +0,0 @@
|
|||
from UM.Util import parseBool
|
||||
|
||||
|
||||
#
|
||||
# Gets the machine definition ID that can be used to search for Quality containers that are suitable for the given
|
||||
# machine. The rule is as follows:
|
||||
# 1. By default, the machine definition ID for quality container search will be "fdmprinter", which is the generic
|
||||
# machine.
|
||||
# 2. If a machine has its own machine quality (with "has_machine_quality = True"), we should use the given machine's
|
||||
# own machine definition ID for quality search.
|
||||
# Example: for an Ultimaker 3, the definition ID should be "ultimaker3".
|
||||
# 3. When condition (2) is met, AND the machine has "quality_definition" defined in its definition file, then the
|
||||
# definition ID specified in "quality_definition" should be used.
|
||||
# Example: for an Ultimaker 3 Extended, it has "quality_definition = ultimaker3". This means Ultimaker 3 Extended
|
||||
# shares the same set of qualities profiles as Ultimaker 3.
|
||||
#
|
||||
def getMachineDefinitionIDForQualitySearch(machine: "GlobalStack", default_definition_id: str = "fdmprinter") -> str:
|
||||
machine_definition_id = default_definition_id
|
||||
if parseBool(machine.getMetaDataEntry("has_machine_quality", False)):
|
||||
# Only use the machine's own quality definition ID if this machine has machine quality.
|
||||
machine_definition_id = machine.getMetaDataEntry("quality_definition")
|
||||
if machine_definition_id is None:
|
||||
machine_definition_id = machine.definition.getId()
|
||||
|
||||
return machine_definition_id
|
|
@ -12,7 +12,6 @@ from UM.Util import parseBool
|
|||
|
||||
from cura.Machines.ContainerGroup import ContainerGroup
|
||||
from cura.Machines.ContainerNode import ContainerNode
|
||||
from cura.Machines.MachineTools import getMachineDefinitionIDForQualitySearch
|
||||
|
||||
|
||||
#
|
||||
|
@ -402,3 +401,27 @@ class QualityManager(QObject):
|
|||
break
|
||||
|
||||
return quality_group_dict
|
||||
|
||||
|
||||
#
|
||||
# Gets the machine definition ID that can be used to search for Quality containers that are suitable for the given
|
||||
# machine. The rule is as follows:
|
||||
# 1. By default, the machine definition ID for quality container search will be "fdmprinter", which is the generic
|
||||
# machine.
|
||||
# 2. If a machine has its own machine quality (with "has_machine_quality = True"), we should use the given machine's
|
||||
# own machine definition ID for quality search.
|
||||
# Example: for an Ultimaker 3, the definition ID should be "ultimaker3".
|
||||
# 3. When condition (2) is met, AND the machine has "quality_definition" defined in its definition file, then the
|
||||
# definition ID specified in "quality_definition" should be used.
|
||||
# Example: for an Ultimaker 3 Extended, it has "quality_definition = ultimaker3". This means Ultimaker 3 Extended
|
||||
# shares the same set of qualities profiles as Ultimaker 3.
|
||||
#
|
||||
def getMachineDefinitionIDForQualitySearch(machine: "GlobalStack", default_definition_id: str = "fdmprinter") -> str:
|
||||
machine_definition_id = default_definition_id
|
||||
if parseBool(machine.getMetaDataEntry("has_machine_quality", False)):
|
||||
# Only use the machine's own quality definition ID if this machine has machine quality.
|
||||
machine_definition_id = machine.getMetaDataEntry("quality_definition")
|
||||
if machine_definition_id is None:
|
||||
machine_definition_id = machine.definition.getId()
|
||||
|
||||
return machine_definition_id
|
||||
|
|
|
@ -29,7 +29,7 @@ from UM.i18n import i18nCatalog
|
|||
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
from cura.Settings.ExtruderStack import ExtruderStack
|
||||
from cura.Machines.MachineTools import getMachineDefinitionIDForQualitySearch
|
||||
from cura.Machines.QualityManager import getMachineDefinitionIDForQualitySearch
|
||||
|
||||
catalog = i18nCatalog("cura")
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ from . import GlobalStack
|
|||
from .ExtruderManager import ExtruderManager
|
||||
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.Machines.MachineTools import getMachineDefinitionIDForQualitySearch
|
||||
from cura.Machines.QualityManager import getMachineDefinitionIDForQualitySearch
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
catalog = i18nCatalog("cura")
|
||||
|
|
|
@ -24,7 +24,7 @@ from UM.Settings.InstanceContainer import InstanceContainer
|
|||
from UM.Settings.SettingFunction import SettingFunction
|
||||
from UM.Signal import postponeSignals, CompressTechnique
|
||||
|
||||
from cura.Machines.MachineTools import getMachineDefinitionIDForQualitySearch
|
||||
from cura.Machines.QualityManager import getMachineDefinitionIDForQualitySearch
|
||||
|
||||
from cura.PrinterOutputDevice import PrinterOutputDevice
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
|
|
@ -22,7 +22,7 @@ from cura.Scene.CuraSceneNode import CuraSceneNode
|
|||
from cura.Scene.BuildPlateDecorator import BuildPlateDecorator
|
||||
from cura.Scene.SliceableObjectDecorator import SliceableObjectDecorator
|
||||
from cura.Scene.ZOffsetDecorator import ZOffsetDecorator
|
||||
from cura.Machines.MachineTools import getMachineDefinitionIDForQualitySearch
|
||||
from cura.Machines.QualityManager import getMachineDefinitionIDForQualitySearch
|
||||
|
||||
MYPY = False
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue