From 4f9fab94188f1597f6505eb03811de4f8a6bfbec Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 2 Aug 2016 14:49:57 +0200 Subject: [PATCH 1/2] Set the right default extruder for the main property provider Fixes CURA-2024 --- resources/qml/Settings/SettingView.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 009dbf09a9..978e2dcaed 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -125,7 +125,7 @@ ScrollView { id: provider - containerStackId: delegate.stackId + containerStackId: Cura.MachineManager.activeMachineId key: model.key ? model.key : "" watchedProperties: [ "value", "enabled", "state", "validationState", "settable_per_extruder" ] storeIndex: 0 From 0f1c59c92599772b739a0e74f94150508ac208a1 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 2 Aug 2016 15:20:03 +0200 Subject: [PATCH 2/2] 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 --- plugins/GCodeWriter/GCodeWriter.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/GCodeWriter/GCodeWriter.py b/plugins/GCodeWriter/GCodeWriter.py index 8e3be15ffe..c2a932b68c 100644 --- a/plugins/GCodeWriter/GCodeWriter.py +++ b/plugins/GCodeWriter/GCodeWriter.py @@ -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()