mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Properly catch when either extruder or global quality is not properly set
Cornercase, but it avoids bubbling odd error messages to the UI. Fixes CURA-1997
This commit is contained in:
parent
4f9fab9418
commit
0f1c59c925
1 changed files with 8 additions and 0 deletions
|
@ -90,12 +90,20 @@ class GCodeWriter(MeshWriter):
|
|||
prefix_length = len(prefix)
|
||||
|
||||
container_with_profile = stack.findContainer({"type": "quality"})
|
||||
if not container_with_profile:
|
||||
Logger.log("e", "No valid quality profile found, not writing settings to GCode!")
|
||||
return ""
|
||||
|
||||
flat_global_container = self._createFlattenedContainerInstance(stack.getTop(),container_with_profile)
|
||||
serialized = flat_global_container.serialize()
|
||||
data = {"global_quality": serialized}
|
||||
|
||||
for extruder in ExtruderManager.getInstance().getMachineExtruders(stack.getId()):
|
||||
extruder_quality = extruder.findContainer({"type": "quality"})
|
||||
if not extruder_quality:
|
||||
Logger.log("w", "No extruder quality profile found, not writing quality for extruder %s to file!", extruder.getId())
|
||||
continue
|
||||
|
||||
flat_extruder_quality = self._createFlattenedContainerInstance(extruder.getTop(), extruder_quality)
|
||||
|
||||
extruder_serialized = flat_extruder_quality.serialize()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue