From cd4774565b318faace7371a0d04e67d61ed26f64 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 14 Jul 2016 18:44:29 +0200 Subject: [PATCH 01/10] Add missing copyright notice --- cura/Settings/ContainerSettingsModel.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cura/Settings/ContainerSettingsModel.py b/cura/Settings/ContainerSettingsModel.py index 9ec19ed7fb..a0bdb7f41f 100644 --- a/cura/Settings/ContainerSettingsModel.py +++ b/cura/Settings/ContainerSettingsModel.py @@ -1,3 +1,6 @@ +# Copyright (c) 2016 Ultimaker B.V. +# Cura is released under the terms of the AGPLv3 or higher. + from UM.Application import Application from UM.Qt.ListModel import ListModel From 528aa2d96195778ea7d245818a558c5ae6619432 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Fri, 1 Jul 2016 22:21:48 +0200 Subject: [PATCH 02/10] JSON feat: Gradual Infill Steps and Gradual Infill Step Height (CURA-836) --- resources/definitions/fdmprinter.def.json | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 6c39aaa330..18960b8e08 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1006,6 +1006,28 @@ "value": "layer_height", "settable_per_mesh": true }, + "gradual_infill_steps": + { + "label": "Gradual Infill Steps", + "description": "Number of times to reduce the infill density by half when getting further below top surfaces. Areas which are closer to top surfaces get a higher density, up to the Infill Density.", + "default_value": 0, + "type": "int", + "minimum_value": "0", + "maximum_value_warning": "7", + "settable_per_mesh": true + }, + "gradual_infill_step_height": + { + "label": "Gradual Infill Step Height", + "description": "The height of infill of a given density before switching to half the density.", + "unit": "mm", + "type": "float", + "default_value": 5.0, + "minimum_value": "0.0001", + "maximum_value_warning": "100", + "enabled": "n_infill_steps > 0", + "settable_per_mesh": true + }, "infill_before_walls": { "label": "Infill Before Walls", From 59648569919e5aa44454bd4f302574c1ecf8f957 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Mon, 4 Jul 2016 14:22:14 +0200 Subject: [PATCH 03/10] JSON fix: n_infill_steps ==> gradual_infill_steps (CURA-836) --- resources/definitions/fdmprinter.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 18960b8e08..cc855df3fa 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1025,7 +1025,7 @@ "default_value": 5.0, "minimum_value": "0.0001", "maximum_value_warning": "100", - "enabled": "n_infill_steps > 0", + "enabled": "gradual_infill_steps > 0", "settable_per_mesh": true }, "infill_before_walls": From 3e97e008af0c19b8c6b573f012591e967abc9495 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Thu, 14 Jul 2016 18:08:16 +0200 Subject: [PATCH 04/10] JSON fix: gradual infill has max value; warning value may be a bit lower (CURA-836) --- resources/definitions/fdmprinter.def.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index cc855df3fa..e108fadeda 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1013,7 +1013,8 @@ "default_value": 0, "type": "int", "minimum_value": "0", - "maximum_value_warning": "7", + "maximum_value_warning": "4", + "maximum_value": "19", "settable_per_mesh": true }, "gradual_infill_step_height": From 8029139358340f2bd1a58df63cd34a4d2be6d6ef Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Fri, 15 Jul 2016 13:54:56 +0200 Subject: [PATCH 05/10] JSON fix: making max gradual infill steps lower to allow for engine not crashing when setting the infill to a low percentage (CURA-836) --- resources/definitions/fdmprinter.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index e108fadeda..724919c07a 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1014,7 +1014,7 @@ "type": "int", "minimum_value": "0", "maximum_value_warning": "4", - "maximum_value": "19", + "maximum_value": "17", "settable_per_mesh": true }, "gradual_infill_step_height": From c2fab4da4728aa95e07f93b6f5cbb79aad28cae8 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 18 Jul 2016 10:25:51 +0200 Subject: [PATCH 06/10] Print information handles single extrusion machines correctly again CURA-1931 and CURA-1038 --- cura/PrintInformation.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index 6ba1274a49..4dedf9db16 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -89,8 +89,12 @@ class PrintInformation(QObject): for index, amount in enumerate(material_amounts): ## Find the right extruder stack. As the list isn't sorted because it's a annoying generator, we do some # list comprehension filtering to solve this for us. - extruder_stack = [extruder for extruder in extruder_stacks if extruder.getMetaDataEntry("position") == str(index)][0] - density = extruder_stack.getMetaDataEntry("properties", {}).get("density", 0) + if extruder_stacks: # Multi extrusion machine + extruder_stack = [extruder for extruder in extruder_stacks if extruder.getMetaDataEntry("position") == str(index)][0] + density = extruder_stack.getMetaDataEntry("properties", {}).get("density", 0) + else: # Machine with no extruder stacks + density = Application.getInstance().getGlobalContainerStack().getMetaDataEntry("properties", {}).get("density", 0) + self._material_weights.append(float(amount) * float(density)) self._material_lengths.append(round((amount / (math.pi * r ** 2)) / 1000, 2)) self.materialLengthsChanged.emit() From 48d39ce3876937b414f76d6bcee70d06bf86565a Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 18 Jul 2016 11:46:12 +0200 Subject: [PATCH 07/10] material_guid is now also a setting in fdmprinter CURA-1836 --- plugins/CuraEngineBackend/StartSliceJob.py | 15 ++++++++------- resources/definitions/fdmprinter.def.json | 8 ++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index 5b715230e2..a726e239e0 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -174,18 +174,19 @@ class StartSliceJob(Job): def _buildExtruderMessage(self, stack): message = self._slice_message.addRepeatedMessage("extruders") message.id = int(stack.getMetaDataEntry("position")) + + material_instance_container = stack.findContainer({"type": "material"}) + for key in stack.getAllKeys(): setting = message.getMessage("settings").addRepeatedMessage("settings") setting.name = key - setting.value = str(stack.getProperty(key, "value")).encode("utf-8") + if key == "material_guid" and material_instance_container: + # Also send the material GUID. This is a setting in fdmprinter, but we have no interface for it. + setting.value = str(material_instance_container.getMetaDataEntry("GUID", "")).encode("utf-8") + else: + setting.value = str(stack.getProperty(key, "value")).encode("utf-8") Job.yieldThread() - # ALso send the material GUID as a setting. - material_instance_container = stack.findContainer({"type": "material"}) - if material_instance_container: - setting = message.getMessage("settings").addRepeatedMessage("settings") - setting.name = "material_GUID" - setting.value = str(material_instance_container.getMetaDataEntry("GUID", "")).encode("utf-8") ## Sends all global settings to the engine. # # The settings are taken from the global stack. This does not include any diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 8833c175f3..c54b8e85f4 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -57,6 +57,14 @@ "settable_per_extruder": false, "settable_per_meshgroup": false }, + "material_guid": + { + "label": "Material GUID", + "description": "GUID of the material. This is set automatically. ", + "default_value": "", + "type": "str", + "enabled": false + }, "material_bed_temp_wait": { "label": "Wait for bed heatup", From 3e908824b9f2de309605cea892c9942a0a7f8c4a Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 18 Jul 2016 15:16:20 +0200 Subject: [PATCH 08/10] Added workaround for singleton not getting shortcuts CURA-1603 --- resources/qml/Cura.qml | 58 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index f70dffa3cc..38019de8e2 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -506,6 +506,64 @@ UM.MainWindow onTriggered: preferences.getCurrentItem().showProfileNameDialog() } + // Workaround for shortcuts not working for singletons. + // The main window eats all the events, so we need to pass them manually. + Action + { + shortcut: StandardKey.Undo + onTriggered: Cura.Actions.undo.trigger() + } + Action + { + shortcut: StandardKey.Redo + onTriggered: Cura.Actions.redo.trigger() + } + Action + { + shortcut: StandardKey.Quit + onTriggered: Cura.Actions.quit.trigger() + } + Action + { + shortcut: StandardKey.Help + onTriggered: Cura.Actions.help.trigger() + } + Action + { + shortcut: StandardKey.Delete + onTriggered: Cura.Actions.delete.trigger() + } + Action + { + shortcut: "Ctrl+G" + onTriggered: Cura.Actions.groupObjects.trigger() + } + Action + { + shortcut: "Ctrl+Shift+G" + onTriggered: Cura.Actions.unGroupObjects.trigger() + } + Action + { + shortcut: "Ctrl+Alt+G" + onTriggered: Cura.Actions.mergeObjects.trigger() + } + Action + { + shortcut: "Ctrl+D" + onTriggered: Cura.Actions.deleteAll.trigger() + } + Action + { + shortcut: StandardKey.Open + onTriggered: Cura.Actions.open.trigger() + } + Action + { + shortcut: StandardKey.WhatsThis + onTriggered: Cura.Actions.showEngineLog.trigger() + } + Menu { id: objectContextMenu; From 3e4ff9241ed4444f41e402a983c7f690ad89ca84 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 18 Jul 2016 15:38:57 +0200 Subject: [PATCH 09/10] Moved the BlurSettings signal to cura main window This reduces the number of focus changes from O(N) to O(1) by the blur event --- resources/qml/Cura.qml | 11 +++++++++++ resources/qml/Settings/SettingItem.qml | 9 --------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 38019de8e2..604f8e0b92 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -506,6 +506,17 @@ UM.MainWindow onTriggered: preferences.getCurrentItem().showProfileNameDialog() } + // BlurSettings is a way to force the focus away from any of the setting items. + // We need to do this in order to keep the bindings intact. + Connections + { + target: Cura.MachineManager + onBlurSettings: + { + contentItem.focus = true + } + } + // Workaround for shortcuts not working for singletons. // The main window eats all the events, so we need to pass them manually. Action diff --git a/resources/qml/Settings/SettingItem.qml b/resources/qml/Settings/SettingItem.qml index 69272764c9..a7bdabb3c5 100644 --- a/resources/qml/Settings/SettingItem.qml +++ b/resources/qml/Settings/SettingItem.qml @@ -248,14 +248,5 @@ Item { } } - Connections - { - target: Cura.MachineManager - onBlurSettings: - { - revertButton.focus = true - } - } - UM.I18nCatalog { id: catalog; name: "cura" } } From 31901606b892a4a5235eaabd1b44f9137f304ea1 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 18 Jul 2016 16:01:18 +0200 Subject: [PATCH 10/10] Properly translate default profiles Otherwise the machine instance doesn't get loaded. Contributes to issue CURA-844. --- .../VersionUpgrade21to22/VersionUpgrade21to22.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/VersionUpgrade/VersionUpgrade21to22/VersionUpgrade21to22.py b/plugins/VersionUpgrade/VersionUpgrade21to22/VersionUpgrade21to22.py index a45a4a6e79..2493e23405 100644 --- a/plugins/VersionUpgrade/VersionUpgrade21to22/VersionUpgrade21to22.py +++ b/plugins/VersionUpgrade/VersionUpgrade21to22/VersionUpgrade21to22.py @@ -18,7 +18,11 @@ _printer_translations = { _profile_translations = { "PLA": "generic_pla", "ABS": "generic_abs", - "CPE": "generic_cpe" + "CPE": "generic_cpe", + "Low Quality": "low", + "Normal Quality": "normal", + "High Quality": "high", + "Ulti Quality": "high" #This one doesn't have an equivalent. Map it to high. } ## How to translate setting names from the old version to the new.