From 16764f47507192f4573cf470c08963e43bf8a716 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 22 Aug 2017 17:37:23 +0200 Subject: [PATCH 1/2] Create user containers for newly created custom FDM printer extruders CURA-4188 The newly created extruder stacks don't have user containers, so the user changes cannot be saved. This fix makes sure that in the upgrade, user containers will be created. --- .../VersionUpgrade25to26.py | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/plugins/VersionUpgrade/VersionUpgrade25to26/VersionUpgrade25to26.py b/plugins/VersionUpgrade/VersionUpgrade25to26/VersionUpgrade25to26.py index 88de81d10b..5b3632a095 100644 --- a/plugins/VersionUpgrade/VersionUpgrade25to26/VersionUpgrade25to26.py +++ b/plugins/VersionUpgrade/VersionUpgrade25to26/VersionUpgrade25to26.py @@ -204,6 +204,9 @@ class VersionUpgrade25to26(VersionUpgrade): # create a definition changes container for this stack definition_changes_parser = self._getCustomFdmPrinterDefinitionChanges(stack_id) definition_changes_id = definition_changes_parser["general"]["name"] + # create a user settings container + user_settings_parser = self._getCustomFdmPrinterUserSettings(stack_id) + user_settings_id = user_settings_parser["general"]["name"] parser = configparser.ConfigParser() parser.add_section("general") @@ -217,7 +220,7 @@ class VersionUpgrade25to26(VersionUpgrade): parser["metadata"]["position"] = str(position) parser.add_section("containers") - parser["containers"]["0"] = "empty" + parser["containers"]["0"] = user_settings_id parser["containers"]["1"] = "empty_quality_changes" parser["containers"]["2"] = quality_id parser["containers"]["3"] = material_id @@ -229,15 +232,22 @@ class VersionUpgrade25to26(VersionUpgrade): definition_changes_parser.write(definition_changes_output) definition_changes_filename = quote_plus(definition_changes_id) + ".inst.cfg" + user_settings_output = io.StringIO() + user_settings_parser.write(user_settings_output) + user_settings_filename = quote_plus(user_settings_id) + ".inst.cfg" + extruder_output = io.StringIO() parser.write(extruder_output) extruder_filename = quote_plus(stack_id) + ".extruder.cfg" extruder_stack_dir = Resources.getPath(CuraApplication.ResourceTypes.ExtruderStack) definition_changes_dir = Resources.getPath(CuraApplication.ResourceTypes.DefinitionChangesContainer) + user_settings_dir = Resources.getPath(CuraApplication.ResourceTypes.UserInstanceContainer) with open(os.path.join(definition_changes_dir, definition_changes_filename), "w") as f: f.write(definition_changes_output.getvalue()) + with open(os.path.join(user_settings_dir, user_settings_filename), "w") as f: + f.write(user_settings_output.getvalue()) with open(os.path.join(extruder_stack_dir, extruder_filename), "w") as f: f.write(extruder_output.getvalue()) @@ -261,3 +271,25 @@ class VersionUpgrade25to26(VersionUpgrade): parser.add_section("values") return parser + + ## Creates a user settings container which doesn't contain anything for the Custom FDM Printers. + # The container ID will be automatically generated according to the given stack name. + def _getCustomFdmPrinterUserSettings(self, stack_id: str): + # For the extruder stacks created in the upgrade, also create user_settings containers so the user changes + # will be saved. + user_settings_id = stack_id + "_user" + + parser = configparser.ConfigParser() + parser.add_section("general") + parser["general"]["version"] = str(2) + parser["general"]["name"] = user_settings_id + parser["general"]["definition"] = "custom" + + parser.add_section("metadata") + parser["metadata"]["extruder"] = stack_id + parser["metadata"]["type"] = "user" + parser["metadata"]["setting_version"] = str(1) + + parser.add_section("values") + + return parser From 90860c67c29a92a1dc25bffda0775198ab7b536d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 23 Aug 2017 09:23:04 +0200 Subject: [PATCH 2/2] Minor tweaks suggested by fieldOfView See the comments in this commit: https://github.com/Ultimaker/Cura/commit/c4d23437f2ef5889405bd987247f3bccbb11935a --- plugins/ChangeLogPlugin/ChangeLog.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/ChangeLogPlugin/ChangeLog.txt b/plugins/ChangeLogPlugin/ChangeLog.txt index 3e101919d4..97651ecd1c 100755 --- a/plugins/ChangeLogPlugin/ChangeLog.txt +++ b/plugins/ChangeLogPlugin/ChangeLog.txt @@ -36,7 +36,7 @@ A dark theme for Cura. Select this theme to reduce eyestrain when working in dar The top bar user interface been improved so that “Prepare” and “Print” have moved from the right side of the interface to the left side. *New keyboard shortcuts -Models can now be manipulated on the build plate using hotkeys Q, A, Z, W, and tab keys. Q selects “move”, A selects “scale”, Z selects “rotate”, and W selects “mirror”. Use the tab key to navigate between interfaces. +Models can now be manipulated on the build plate using hotkeys Q, A, Z, W, and tab keys. Q selects “move”, A selects “scale”, Z selects “rotate”, and W selects “mirror”. Use the tab key to navigate between settings. *Plugin browser Easily download and install plugins using an integrated plugin browser. Go to “Extensions > Plugin Browser > Browse plugins” to select it. @@ -61,7 +61,7 @@ Polish language support added. This can be selected in the preferences menu. - Crashes when adding printers - Jerk fixes - Z-hop over-extrusion - +- Material diameter in machine settings *3rd party printers - Peopoly Moai