mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 21:13:58 -06:00
Show configuration error when extruder positions don't match
When any extruder position doesn't match when adding a container, don't add any of the extruders. Don't add faulty half-data to the registry! Contributes to issue CURA-5045.
This commit is contained in:
parent
013bb04a7d
commit
d6205d5d85
1 changed files with 4 additions and 2 deletions
|
@ -88,8 +88,8 @@ class CuraStackBuilder:
|
|||
extruder_definition = registry.findDefinitionContainers(id = extruder_definition_id)[0]
|
||||
position_in_extruder_def = extruder_definition.getMetaDataEntry("position")
|
||||
if position_in_extruder_def != position:
|
||||
raise RuntimeError("Extruder position [%s] defined in extruder definition [%s] is not the same as in machine definition [%s] position [%s]" %
|
||||
(position_in_extruder_def, extruder_definition_id, definition_id, position))
|
||||
ConfigurationErrorMessage.getInstance().addFaultyContainers(extruder_definition_id)
|
||||
return None #Don't return any container stack then, not the rest of the extruders either.
|
||||
|
||||
new_extruder_id = registry.uniqueName(extruder_definition_id)
|
||||
new_extruder = cls.createExtruderStack(
|
||||
|
@ -104,6 +104,8 @@ class CuraStackBuilder:
|
|||
)
|
||||
new_extruder.setNextStack(new_global_stack)
|
||||
new_global_stack.addExtruder(new_extruder)
|
||||
|
||||
for new_extruder in new_global_stack.extruders.values(): #Only register the extruders if we're sure that all of them are correct.
|
||||
registry.addContainer(new_extruder)
|
||||
|
||||
preferred_quality_type = machine_definition.getMetaDataEntry("preferred_quality_type")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue