mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Fix variant vs nozzle
CURA-333
This commit is contained in:
parent
3d53bc38b7
commit
cb05f75f6a
1 changed files with 20 additions and 20 deletions
|
@ -111,7 +111,7 @@ class ExtruderManager(QObject):
|
||||||
## Creates a container stack for an extruder train.
|
## Creates a container stack for an extruder train.
|
||||||
#
|
#
|
||||||
# The container stack has an extruder definition at the bottom, which is
|
# The container stack has an extruder definition at the bottom, which is
|
||||||
# linked to a machine definition. Then it has a nozzle profile, a material
|
# linked to a machine definition. Then it has a variant profile, a material
|
||||||
# profile, a quality profile and a user profile, in that order.
|
# profile, a quality profile and a user profile, in that order.
|
||||||
#
|
#
|
||||||
# The resulting container stack is added to the registry.
|
# The resulting container stack is added to the registry.
|
||||||
|
@ -136,29 +136,29 @@ class ExtruderManager(QObject):
|
||||||
container_stack.addMetaDataEntry("position", position)
|
container_stack.addMetaDataEntry("position", position)
|
||||||
container_stack.addContainer(extruder_definition)
|
container_stack.addContainer(extruder_definition)
|
||||||
|
|
||||||
#Find the nozzle to use for this extruder.
|
#Find the variant to use for this extruder.
|
||||||
nozzle = container_registry.getEmptyInstanceContainer()
|
variant = container_registry.getEmptyInstanceContainer()
|
||||||
if machine_definition.getMetaDataEntry("has_nozzles", default = "False") == "True":
|
if machine_definition.getMetaDataEntry("has_variants", default = "False") == "True":
|
||||||
#First add any nozzle. Later, overwrite with preference if the preference is valid.
|
#First add any variant. Later, overwrite with preference if the preference is valid.
|
||||||
nozzles = container_registry.findInstanceContainers(machine = machine_id, type = "nozzle")
|
variants = container_registry.findInstanceContainers(machine = machine_id, type = "variant")
|
||||||
if len(nozzles) >= 1:
|
if len(variants) >= 1:
|
||||||
nozzle = nozzles[0]
|
variant = variants[0]
|
||||||
preferred_nozzle_id = machine_definition.getMetaDataEntry("preferred_nozzle")
|
preferred_variant_id = machine_definition.getMetaDataEntry("preferred_variant")
|
||||||
if preferred_nozzle_id:
|
if preferred_variant_id:
|
||||||
preferred_nozzles = container_registry.findInstanceContainers(id = preferred_nozzle_id, type = "nozzle")
|
preferred_variants = container_registry.findInstanceContainers(id = preferred_variant_id, type = "variant")
|
||||||
if len(preferred_nozzles) >= 1:
|
if len(preferred_variants) >= 1:
|
||||||
nozzle = preferred_nozzles[0]
|
variant = preferred_variants[0]
|
||||||
else:
|
else:
|
||||||
UM.Logger.log("w", "The preferred nozzle \"%s\" of machine %s doesn't exist or is not a nozzle profile.", preferred_nozzle_id, machine_id)
|
UM.Logger.log("w", "The preferred variant \"%s\" of machine %s doesn't exist or is not a variant profile.", preferred_variant_id, machine_id)
|
||||||
#And leave it at the default nozzle.
|
#And leave it at the default variant.
|
||||||
container_stack.addContainer(nozzle)
|
container_stack.addContainer(variant)
|
||||||
|
|
||||||
#Find a material to use for this nozzle.
|
#Find a material to use for this variant.
|
||||||
material = container_registry.getEmptyInstanceContainer()
|
material = container_registry.getEmptyInstanceContainer()
|
||||||
if machine_definition.getMetaDataEntry("has_materials", default = "False") == "True":
|
if machine_definition.getMetaDataEntry("has_materials", default = "False") == "True":
|
||||||
#First add any material. Later, overwrite with preference if the preference is valid.
|
#First add any material. Later, overwrite with preference if the preference is valid.
|
||||||
if machine_definition.getMetaDataEntry("has_nozzle_materials", default = "False") == "True":
|
if machine_definition.getMetaDataEntry("has_variant_materials", default = "False") == "True":
|
||||||
materials = container_registry.findInstanceContainers(type = "material", machine = machine_id, nozzle = nozzle.getId())
|
materials = container_registry.findInstanceContainers(type = "material", machine = machine_id, variant = variant.getId())
|
||||||
else:
|
else:
|
||||||
materials = container_registry.findInstanceContainers(type = "material", machine = machine_id)
|
materials = container_registry.findInstanceContainers(type = "material", machine = machine_id)
|
||||||
if len(materials) >= 1:
|
if len(materials) >= 1:
|
||||||
|
@ -175,7 +175,7 @@ class ExtruderManager(QObject):
|
||||||
|
|
||||||
#Find a quality to use for this extruder.
|
#Find a quality to use for this extruder.
|
||||||
quality = container_registry.getEmptyInstanceContainer()
|
quality = container_registry.getEmptyInstanceContainer()
|
||||||
|
|
||||||
#First add any quality. Later, overwrite with preference if the preference is valid.
|
#First add any quality. Later, overwrite with preference if the preference is valid.
|
||||||
qualities = container_registry.findInstanceContainers(type = "quality")
|
qualities = container_registry.findInstanceContainers(type = "quality")
|
||||||
if len(qualities) >= 1:
|
if len(qualities) >= 1:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue