mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
Merge branch 'master' into qt6_beyond_the_splash
# Conflicts: # cura/PrinterOutput/PrinterOutputDevice.py
This commit is contained in:
commit
b2b1961b57
4332 changed files with 4436 additions and 4446 deletions
|
@ -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)
|
|
@ -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
plugins/VersionUpgrade/VersionUpgrade413to50/plugin.json
Normal file
8
plugins/VersionUpgrade/VersionUpgrade413to50/plugin.json
Normal file
|
@ -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"
|
||||
}
|
|
@ -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"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue