-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into CURA-12335_expose-bottom-skin-settings
- Loading branch information
Showing
194 changed files
with
4,213 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
plugins/VersionUpgrade/VersionUpgrade59to510/VersionUpgrade59to510.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import configparser | ||
import io | ||
from typing import Dict, Tuple, List | ||
|
||
from UM.VersionUpgrade import VersionUpgrade | ||
|
||
_RENAMED_SETTINGS = { | ||
"wall_overhang_speed_factor": "wall_overhang_speed_factors" | ||
} # type: Dict[str, str] | ||
|
||
_NEW_SETTING_VERSION = "25" | ||
|
||
|
||
class VersionUpgrade59to510(VersionUpgrade): | ||
def upgradePreferences(self, serialized: str, filename: str): | ||
parser = configparser.ConfigParser(interpolation = None) | ||
parser.read_string(serialized) | ||
|
||
# Fix 'renamed'(ish) settings for visibility | ||
if "visible_settings" in parser["general"]: | ||
all_setting_keys = parser["general"]["visible_settings"].strip().split(";") | ||
if all_setting_keys: | ||
for idx, key in enumerate(all_setting_keys): | ||
if key in _RENAMED_SETTINGS: | ||
all_setting_keys[idx] = _RENAMED_SETTINGS[key] | ||
parser["general"]["visible_settings"] = ";".join(all_setting_keys) | ||
|
||
# Update version number. | ||
parser["metadata"]["setting_version"] = _NEW_SETTING_VERSION | ||
|
||
result = io.StringIO() | ||
parser.write(result) | ||
return [filename], [result.getvalue()] | ||
|
||
def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: | ||
parser = configparser.ConfigParser(interpolation = None, comment_prefixes = ()) | ||
parser.read_string(serialized) | ||
|
||
# Update version number. | ||
parser["metadata"]["setting_version"] = _NEW_SETTING_VERSION | ||
|
||
if "values" in parser: | ||
for old_name, new_name in _RENAMED_SETTINGS.items(): | ||
if old_name in parser["values"]: | ||
parser["values"][new_name] = parser["values"][old_name] | ||
del parser["values"][old_name] | ||
if "wall_overhang_speed_factors" in parser["values"]: | ||
old_value = float(parser["values"]["wall_overhang_speed_factors"]) | ||
new_value = [max(1, int(round(old_value)))] | ||
parser["values"]["wall_overhang_speed_factor"] = str(new_value) | ||
|
||
result = io.StringIO() | ||
parser.write(result) | ||
return [filename], [result.getvalue()] | ||
|
||
def upgradeStack(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: | ||
parser = configparser.ConfigParser(interpolation = None) | ||
parser.read_string(serialized) | ||
|
||
# Update version number. | ||
if "metadata" not in parser: | ||
parser["metadata"] = {} | ||
|
||
parser["metadata"]["setting_version"] = _NEW_SETTING_VERSION | ||
|
||
result = io.StringIO() | ||
parser.write(result) | ||
return [filename], [result.getvalue()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Copyright (c) 2024 UltiMaker | ||
# Cura is released under the terms of the LGPLv3 or higher. | ||
|
||
from typing import Any, Dict, TYPE_CHECKING | ||
|
||
from . import VersionUpgrade59to510 | ||
|
||
if TYPE_CHECKING: | ||
from UM.Application import Application | ||
|
||
upgrade = VersionUpgrade59to510.VersionUpgrade59to510() | ||
|
||
def getMetaData() -> Dict[str, Any]: | ||
return { | ||
"version_upgrade": { | ||
# From To Upgrade function | ||
("preferences", 7000024): ("preferences", 7000025, upgrade.upgradePreferences), | ||
("machine_stack", 6000024): ("machine_stack", 6000025, upgrade.upgradeStack), | ||
("extruder_train", 6000024): ("extruder_train", 6000025, upgrade.upgradeStack), | ||
("definition_changes", 4000024): ("definition_changes", 4000025, upgrade.upgradeInstanceContainer), | ||
("quality_changes", 4000024): ("quality_changes", 4000025, upgrade.upgradeInstanceContainer), | ||
("quality", 4000024): ("quality", 4000025, upgrade.upgradeInstanceContainer), | ||
("user", 4000024): ("user", 4000025, upgrade.upgradeInstanceContainer), | ||
("intent", 4000024): ("intent", 4000025, upgrade.upgradeInstanceContainer), | ||
}, | ||
"sources": { | ||
"preferences": { | ||
"get_version": upgrade.getCfgVersion, | ||
"location": {"."} | ||
}, | ||
"machine_stack": { | ||
"get_version": upgrade.getCfgVersion, | ||
"location": {"./machine_instances"} | ||
}, | ||
"extruder_train": { | ||
"get_version": upgrade.getCfgVersion, | ||
"location": {"./extruders"} | ||
}, | ||
"definition_changes": { | ||
"get_version": upgrade.getCfgVersion, | ||
"location": {"./definition_changes"} | ||
}, | ||
"quality_changes": { | ||
"get_version": upgrade.getCfgVersion, | ||
"location": {"./quality_changes"} | ||
}, | ||
"quality": { | ||
"get_version": upgrade.getCfgVersion, | ||
"location": {"./quality"} | ||
}, | ||
"user": { | ||
"get_version": upgrade.getCfgVersion, | ||
"location": {"./user"} | ||
} | ||
} | ||
} | ||
|
||
|
||
def register(app: "Application") -> Dict[str, Any]: | ||
return {"version_upgrade": upgrade} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "Version Upgrade 5.9 to 5.10", | ||
"author": "Ultimaker B.V.", | ||
"version": "1.0.0", | ||
"description": "Upgrades configurations from Cura 5.9 to Cura 5.10", | ||
"api": 8, | ||
"i18n-catalog": "cura" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.