Browse Source

Merge branch 'CURA-8466_version_upgrade_50' of github.com:Ultimaker/Cura

Jaime van Kessel 2 years ago
parent
commit
820734aad7

+ 1 - 1
cura/CuraApplication.py

@@ -127,7 +127,7 @@ class CuraApplication(QtApplication):
     # SettingVersion represents the set of settings available in the machine/extruder definitions.
     # You need to make sure that this version number needs to be increased if there is any non-backwards-compatible
     # changes of the settings.
-    SettingVersion = 19
+    SettingVersion = 20
 
     Created = False
 

+ 23 - 15
plugins/VersionUpgrade/VersionUpgrade49to50/VersionUpgrade49to50.py → plugins/VersionUpgrade/VersionUpgrade413to50/VersionUpgrade413to50.py

@@ -1,4 +1,4 @@
-# Copyright (c) 2021 Ultimaker B.V.
+# Copyright (c) 2022 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 import configparser
@@ -11,14 +11,19 @@ _removed_settings = {
     "travel_compensate_overlapping_walls_0_enabled",
     "travel_compensate_overlapping_walls_x_enabled",
     "fill_perimeter_gaps",
+    "filter_out_tiny_gaps",
     "wall_min_flow",
     "wall_min_flow_retract",
-    "speed_equalize_flow_enabled",
-    "speed_equalize_flow_min"
+    "speed_equalize_flow_max"
+}
+
+_transformed_settings = {  # These settings have been changed to a new topic, but may have different data type. Used only for setting visibility; the rest is handled separately.
+    "outer_inset_first": "inset_direction",
+    "speed_equalize_flow_enabled": "speed_equalize_flow_width_factor"
 }
 
 
-class VersionUpgrade49to50(VersionUpgrade):
+class VersionUpgrade413to50(VersionUpgrade):
     def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
         """
         Upgrades preferences to remove from the visibility list the settings that were removed in this version.
@@ -34,7 +39,7 @@ class VersionUpgrade49to50(VersionUpgrade):
         parser.read_string(serialized)
 
         # Update version number.
-        parser["metadata"]["setting_version"] = "18"
+        parser["metadata"]["setting_version"] = "20"
 
         # Remove deleted settings from the visible settings list.
         if "general" in parser and "visible_settings" in parser["general"]:
@@ -43,10 +48,11 @@ class VersionUpgrade49to50(VersionUpgrade):
                 if removed in visible_settings:
                     visible_settings.remove(removed)
 
-            # Replace Outer Before Inner Walls with equivalent.
-            if "outer_inset_first" in visible_settings:
-                visible_settings.remove("outer_inset_first")
-                visible_settings.add("inset_direction")
+            # Replace equivalent settings that have been transformed.
+            for old, new in _transformed_settings.items():
+                if old in visible_settings:
+                    visible_settings.remove(old)
+                    visible_settings.add(new)
 
             parser["general"]["visible_settings"] = ";".join(visible_settings)
 
@@ -71,7 +77,7 @@ class VersionUpgrade49to50(VersionUpgrade):
         parser.read_string(serialized)
 
         # Update version number.
-        parser["metadata"]["setting_version"] = "18"
+        parser["metadata"]["setting_version"] = "20"
 
         if "values" in parser:
             # Remove deleted settings from the instance containers.
@@ -86,9 +92,12 @@ class VersionUpgrade49to50(VersionUpgrade):
                     old_value = old_value[1:]
                 parser["values"]["inset_direction"] = f"='outside_in' if ({old_value}) else 'inside_out'"  # Makes it work both with plain setting values and formulas.
 
-            # Disable Fuzzy Skin as it doesn't work with with the libArachne walls
-            if "magic_fuzzy_skin_enabled" in parser["values"]:
-                parser["values"]["magic_fuzzy_skin_enabled"] = "False"
+            # Replace Equalize Filament Flow with equivalent setting.
+            if "speed_equalize_flow_enabled" in parser["values"]:
+                old_value = parser["values"]["speed_equalize_flow_enabled"]
+                if old_value.startswith("="):  # Was already a formula.
+                    old_value = old_value[1:]
+                parser["values"]["speed_equalize_flow_width_factor"] = f"=100 if ({old_value}) else 0"  # If it used to be enabled, set it to 100%. Otherwise 0%.
 
         result = io.StringIO()
         parser.write(result)
@@ -110,8 +119,7 @@ class VersionUpgrade49to50(VersionUpgrade):
         if "metadata" not in parser:
             parser["metadata"] = {}
 
-        parser["general"]["version"] = "5"
-        parser["metadata"]["setting_version"] = "18"
+        parser["metadata"]["setting_version"] = "20"
 
         result = io.StringIO()
         parser.write(result)

+ 11 - 13
plugins/VersionUpgrade/VersionUpgrade49to50/__init__.py → plugins/VersionUpgrade/VersionUpgrade413to50/__init__.py

@@ -1,28 +1,26 @@
-# Copyright (c) 2020 Ultimaker B.V.
+# Copyright (c) 2022 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 from typing import Any, Dict, TYPE_CHECKING
 
-from . import VersionUpgrade49to50
+from . import VersionUpgrade413to50
 
 if TYPE_CHECKING:
     from UM.Application import Application
 
-upgrade = VersionUpgrade49to50.VersionUpgrade49to50()
+upgrade = VersionUpgrade413to50.VersionUpgrade413to50()
 
 def getMetaData() -> Dict[str, Any]:
-    return {  # Since there is no VersionUpgrade from 48 to 49 yet, upgrade the 48 profiles to 50.
+    return {
         "version_upgrade": {
             # From                           To                              Upgrade function
-            ("preferences", 6000016):        ("preferences", 6000018,        upgrade.upgradePreferences),
-            ("machine_stack", 5000016):      ("machine_stack", 5000018,      upgrade.upgradeStack),
-            ("extruder_train", 5000016):     ("extruder_train", 5000018,     upgrade.upgradeStack),
-            ("machine_stack", 4000018):      ("machine_stack", 5000018,      upgrade.upgradeStack),  # We made a mistake in the arachne beta 1
-            ("extruder_train", 4000018):     ("extruder_train", 5000018,     upgrade.upgradeStack),  # We made a mistake in the arachne beta 1
-            ("definition_changes", 4000016): ("definition_changes", 4000018, upgrade.upgradeInstanceContainer),
-            ("quality_changes", 4000016):    ("quality_changes", 4000018,    upgrade.upgradeInstanceContainer),
-            ("quality", 4000016):            ("quality", 4000018,            upgrade.upgradeInstanceContainer),
-            ("user", 4000016):               ("user", 4000018,               upgrade.upgradeInstanceContainer),
+            ("preferences", 7000019):        ("preferences", 7000020,        upgrade.upgradePreferences),
+            ("machine_stack", 5000019):      ("machine_stack", 5000020,      upgrade.upgradeStack),
+            ("extruder_train", 5000019):     ("extruder_train", 5000020,     upgrade.upgradeStack),
+            ("definition_changes", 4000019): ("definition_changes", 4000020, upgrade.upgradeInstanceContainer),
+            ("quality_changes", 4000019):    ("quality_changes", 4000020,    upgrade.upgradeInstanceContainer),
+            ("quality", 4000019):            ("quality", 4000020,            upgrade.upgradeInstanceContainer),
+            ("user", 4000019):               ("user", 4000020,               upgrade.upgradeInstanceContainer),
         },
         "sources": {
             "preferences": {

+ 8 - 0
plugins/VersionUpgrade/VersionUpgrade413to50/plugin.json

@@ -0,0 +1,8 @@
+{
+    "name": "Version Upgrade 4.13 to 5.0",
+    "author": "Ultimaker B.V.",
+    "version": "1.0.0",
+    "description": "Upgrades configurations from Cura 4.13 to Cura 5.0.",
+    "api": "7.9.0",
+    "i18n-catalog": "cura"
+}

+ 0 - 8
plugins/VersionUpgrade/VersionUpgrade49to50/plugin.json

@@ -1,8 +0,0 @@
-{
-    "name": "Version Upgrade 4.9 to 5.0",
-    "author": "Ultimaker B.V.",
-    "version": "1.0.0",
-    "description": "Upgrades configurations from Cura 4.9 to Cura 5.0.",
-    "api": "7.4.0",
-    "i18n-catalog": "cura"
-}

+ 1 - 1
resources/definitions/fdmextruder.def.json

@@ -6,7 +6,7 @@
         "type": "extruder",
         "author": "Ultimaker",
         "manufacturer": "Unknown",
-        "setting_version": 19,
+        "setting_version": 20,
         "visible": false,
         "position": "0"
     },

+ 2 - 27
resources/definitions/fdmprinter.def.json

@@ -6,7 +6,7 @@
         "type": "machine",
         "author": "Unknown",
         "manufacturer": "Unknown",
-        "setting_version": 19,
+        "setting_version": 20,
         "file_formats": "text/x-gcode;model/stl;application/x-wavefront-obj;application/x3g",
         "visible": false,
         "has_materials": true,
@@ -1088,21 +1088,6 @@
                         }
                     }
                 },
-                "beading_strategy_type":
-                {
-                    "label": "Variable Line Strategy",
-                    "description": "Strategy to use to print the width of a part with a number of walls. This determines how many walls it will use for a certain total width, and how wide each of these lines are. \"Center Deviation\" will print all walls at the nominal line width except the central one(s), causing big variations in the center but very consistent outsides. \"Distributed\" distributes the width equally over all walls. \"Inward Distributed\" is a balance between the other two, distributing the changes in width over all walls but keeping the walls on the outside slightly more consistent.",
-                    "type": "enum",
-                    "enabled": false,
-                    "options":
-                    {
-                        "center_deviation": "Center Deviation",
-                        "distributed": "Distributed",
-                        "inward_distributed": "Inward Distributed"
-                    },
-                    "default_value": "inward_distributed",
-                    "limit_to_extruder": "wall_0_extruder_nr"
-                },
                 "wall_transition_length":
                 {
                     "label": "Wall Transition Length",
@@ -1123,8 +1108,7 @@
                     "type": "int",
                     "maximum_value": "999999",
                     "default_value": 1,
-                    "minimum_value": "1",
-                    "enabled": "beading_strategy_type == 'inward_distributed'"
+                    "minimum_value": "1"
                 },
                 "wall_transition_angle":
                 {
@@ -1205,15 +1189,6 @@
                     "limit_to_extruder": "infill_extruder_nr",
                     "settable_per_mesh": true
                 },
-                "filter_out_tiny_gaps":
-                {
-                    "label": "Filter Out Tiny Gaps",
-                    "description": "Filter out tiny gaps to reduce blobs on outside of model.",
-                    "type": "bool",
-                    "default_value": true,
-                    "limit_to_extruder": "wall_0_extruder_nr",
-                    "settable_per_mesh": true
-                },
                 "min_wall_line_width":
                 {
                     "label": "Minimum Wall Line Width",

+ 1 - 1
resources/intent/deltacomb/ABS/deltacomb_DBE0.40_ABS_accurate_B.inst.cfg

@@ -4,7 +4,7 @@ name = Accurate
 definition = deltacomb_base
 
 [metadata]
-setting_version = 19
+setting_version = 20
 type = intent
 quality_type = D010
 intent_category = engineering

+ 1 - 1
resources/intent/deltacomb/ABS/deltacomb_DBE0.40_ABS_accurate_C.inst.cfg

@@ -4,7 +4,7 @@ name = Accurate
 definition = deltacomb_base
 
 [metadata]
-setting_version = 19
+setting_version = 20
 type = intent
 quality_type = D015
 intent_category = engineering

+ 1 - 1
resources/intent/deltacomb/ABS/deltacomb_DBE0.40_ABS_accurate_D.inst.cfg

@@ -4,7 +4,7 @@ name = Accurate
 definition = deltacomb_base
 
 [metadata]
-setting_version = 19
+setting_version = 20
 type = intent
 quality_type = D020
 intent_category = engineering

Some files were not shown because too many files changed in this diff