mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-07 22:13:58 -06:00
Merge branch 'master' into libArachne_rebased
Conflicts: cura/CuraApplication.py: Setting version fdmprinter and fdmextruder: Setting version intents, qualities and variants: Setting version Changelog: 4.9.1 was added, should be below Arachne changes
This commit is contained in:
commit
611208368c
1015 changed files with 103196 additions and 86144 deletions
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.1",
|
||||
"description": "Upgrades configurations from Cura 2.1 to Cura 2.2.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.1",
|
||||
"description": "Upgrades configurations from Cura 2.2 to Cura 2.4.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.1",
|
||||
"description": "Upgrades configurations from Cura 2.5 to Cura 2.6.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.1",
|
||||
"description": "Upgrades configurations from Cura 2.6 to Cura 2.7.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.1",
|
||||
"description": "Upgrades configurations from Cura 2.7 to Cura 3.0.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.1",
|
||||
"description": "Upgrades configurations from Cura 3.0 to Cura 3.1.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.1",
|
||||
"description": "Upgrades configurations from Cura 3.2 to Cura 3.3.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.1",
|
||||
"description": "Upgrades configurations from Cura 3.3 to Cura 3.4.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.1",
|
||||
"description": "Upgrades configurations from Cura 3.4 to Cura 3.5.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.0",
|
||||
"description": "Upgrades configurations from Cura 3.5 to Cura 4.0.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.1",
|
||||
"description": "Upgrades configurations from Cura 4.0 to Cura 4.1.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.0",
|
||||
"description": "Upgrades configurations from Cura 4.1 to Cura 4.2.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.0",
|
||||
"description": "Upgrades configurations from Cura 4.2 to Cura 4.3.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.0",
|
||||
"description": "Upgrades configurations from Cura 4.3 to Cura 4.4.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.0",
|
||||
"description": "Upgrades configurations from Cura 4.4 to Cura 4.5.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.0",
|
||||
"description": "Upgrades configurations from Cura 4.5 to Cura 4.6.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.0",
|
||||
"description": "Upgrades configurations from Cura 4.6.0 to Cura 4.6.2.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.0",
|
||||
"description": "Upgrades configurations from Cura 4.6.2 to Cura 4.7.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.0",
|
||||
"description": "Upgrades configurations from Cura 4.7 to Cura 4.8.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.0",
|
||||
"description": "Upgrades configurations from Cura 4.8 to Cura 4.9.",
|
||||
"api": "7.5.0",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,178 @@
|
|||
# Copyright (c) 2019 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import configparser
|
||||
import io
|
||||
import os.path # To get the file ID.
|
||||
from typing import Dict, List, Tuple
|
||||
|
||||
from UM.VersionUpgrade import VersionUpgrade
|
||||
|
||||
|
||||
class VersionUpgrade49to410(VersionUpgrade):
|
||||
"""
|
||||
Upgrades configurations from the state they were in at version 4.9 to the state they should be in at version 4.10.
|
||||
"""
|
||||
|
||||
_renamed_profiles = {
|
||||
# Definitions.
|
||||
"twotrees_bluer" : "two_trees_bluer",
|
||||
|
||||
# Upgrade for people who had the original TwoTrees Bluer profiles from 4.9 and earlier.
|
||||
"twotrees_bluer_extruder_0": "two_trees_base_extruder_0",
|
||||
"twotrees_bluer_extruder_1": "two_trees_base_extruder_0"
|
||||
}
|
||||
|
||||
_quality_changes_to_two_trees_base = {
|
||||
"twotrees_bluer_extruder_0",
|
||||
"twotrees_bluer_extruder_1",
|
||||
"twotrees_bluer"
|
||||
}
|
||||
|
||||
# Default variant to select for legacy TwoTrees printers, now that we have variants.
|
||||
_default_variants = {
|
||||
"twotrees_bluer_extruder_0" : "two_trees_bluer_0.4",
|
||||
"twotrees_bluer_extruder_1" : "two_trees_bluer_0.4"
|
||||
}
|
||||
|
||||
_two_trees_bluer_quality_type_conversion = {
|
||||
"high" : "ultra",
|
||||
"normal" : "super",
|
||||
"fast" : "standard",
|
||||
"draft" : "standard",
|
||||
"extra_fast" : "low",
|
||||
"coarse" : "draft",
|
||||
"extra_coarse": "draft"
|
||||
}
|
||||
|
||||
_two_trees_quality_per_material = {
|
||||
# Since legacy TwoTrees printers didn't have different variants, we always pick the 0.4mm variant.
|
||||
"generic_abs_175" : {
|
||||
"high" : "two_trees_0.4_ABS_super",
|
||||
"normal" : "two_trees_0.4_ABS_super",
|
||||
"fast" : "two_trees_0.4_ABS_super",
|
||||
"draft" : "two_trees_0.4_ABS_standard",
|
||||
"extra_fast" : "two_trees_0.4_ABS_low",
|
||||
"coarse" : "two_trees_0.4_ABS_low",
|
||||
"extra_coarse": "two_trees_0.4_ABS_low"
|
||||
},
|
||||
"generic_petg_175": {
|
||||
"high" : "two_trees_0.4_PETG_super",
|
||||
"normal" : "two_trees_0.4_PETG_super",
|
||||
"fast" : "two_trees_0.4_PETG_super",
|
||||
"draft" : "two_trees_0.4_PETG_standard",
|
||||
"extra_fast" : "two_trees_0.4_PETG_low",
|
||||
"coarse" : "two_trees_0.4_PETG_low",
|
||||
"extra_coarse": "two_trees_0.4_PETG_low"
|
||||
},
|
||||
"generic_pla_175" : {
|
||||
"high" : "two_trees_0.4_PLA_super",
|
||||
"normal" : "two_trees_0.4_PLA_super",
|
||||
"fast" : "two_trees_0.4_PLA_super",
|
||||
"draft" : "two_trees_0.4_PLA_standard",
|
||||
"extra_fast" : "two_trees_0.4_PLA_low",
|
||||
"coarse" : "two_trees_0.4_PLA_low",
|
||||
"extra_coarse": "two_trees_0.4_PLA_low"
|
||||
},
|
||||
"generic_tpu_175" : {
|
||||
"high" : "two_trees_0.4_TPU_super",
|
||||
"normal" : "two_trees_0.4_TPU_super",
|
||||
"fast" : "two_trees_0.4_TPU_super",
|
||||
"draft" : "two_trees_0.4_TPU_standard",
|
||||
"extra_fast" : "two_trees_0.4_TPU_standard",
|
||||
"coarse" : "two_trees_0.4_TPU_standard",
|
||||
"extra_coarse": "two_trees_0.4_TPU_standard"
|
||||
},
|
||||
"empty_material" : { # For the global stack.
|
||||
"high" : "two_trees_global_super",
|
||||
"normal" : "two_trees_global_super",
|
||||
"fast" : "two_trees_global_super",
|
||||
"draft" : "two_trees_global_standard",
|
||||
"extra_fast" : "two_trees_global_low",
|
||||
"coarse" : "two_trees_global_low",
|
||||
"extra_coarse": "two_trees_global_low"
|
||||
}
|
||||
}
|
||||
|
||||
_deltacomb_quality_type_conversion = {
|
||||
"a" : "D005",
|
||||
"b" : "D010",
|
||||
"c" : "D015",
|
||||
"d" : "D020",
|
||||
"e" : "D030",
|
||||
"f" : "D045",
|
||||
"g" : "D060"
|
||||
}
|
||||
|
||||
def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
|
||||
"""Upgrades instance containers to have the new version number.
|
||||
|
||||
This renames the renamed settings in the containers.
|
||||
"""
|
||||
parser = configparser.ConfigParser(interpolation = None, comment_prefixes = ())
|
||||
parser.read_string(serialized)
|
||||
|
||||
# Update setting version number.
|
||||
if "metadata" not in parser:
|
||||
parser["metadata"] = {}
|
||||
parser["metadata"]["setting_version"] = "17"
|
||||
|
||||
if "general" not in parser:
|
||||
parser["general"] = {}
|
||||
# Certain instance containers (such as definition changes) reference to a certain definition container
|
||||
# Since a number of those changed name, we also need to update those.
|
||||
old_definition = parser.get("general", "definition", fallback = "")
|
||||
if old_definition in self._renamed_profiles:
|
||||
parser["general"]["definition"] = self._renamed_profiles[old_definition]
|
||||
|
||||
# For quality-changes profiles made for TwoTrees Bluer printers, change the definition to the two_trees_base and make sure that the quality is something we have a profile for.
|
||||
if parser.get("metadata", "type", fallback = "") == "quality_changes":
|
||||
for possible_printer in self._quality_changes_to_two_trees_base:
|
||||
if os.path.basename(filename).startswith(possible_printer + "_"):
|
||||
parser["general"]["definition"] = "two_trees_base"
|
||||
parser["metadata"]["quality_type"] = self._two_trees_bluer_quality_type_conversion.get(parser.get("metadata", "quality_type", fallback = "fast"), "standard")
|
||||
break
|
||||
|
||||
if os.path.basename(filename).startswith("deltacomb_"):
|
||||
parser["general"]["definition"] = "deltacomb_base"
|
||||
parser["metadata"]["quality_type"] = self._deltacomb_quality_type_conversion.get(parser.get("metadata", "quality_type", fallback = "c"), "D015")
|
||||
break
|
||||
|
||||
result = io.StringIO()
|
||||
parser.write(result)
|
||||
return [filename], [result.getvalue()]
|
||||
|
||||
def upgradeStack(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
|
||||
"""Upgrades stacks to have the new version number."""
|
||||
|
||||
parser = configparser.ConfigParser(interpolation = None)
|
||||
parser.read_string(serialized)
|
||||
|
||||
# Update setting version number.
|
||||
if "metadata" not in parser:
|
||||
parser["metadata"] = {}
|
||||
parser["metadata"]["setting_version"] = "17"
|
||||
|
||||
# Change renamed profiles.
|
||||
if "containers" in parser:
|
||||
definition_id = parser["containers"]["7"]
|
||||
if definition_id in self._quality_changes_to_two_trees_base:
|
||||
material_id = parser["containers"]["4"]
|
||||
old_quality_id = parser["containers"]["3"]
|
||||
if parser["metadata"].get("type", "machine") == "extruder_train":
|
||||
if parser["containers"]["5"] == "empty_variant":
|
||||
if definition_id in self._default_variants:
|
||||
parser["containers"]["5"] = self._default_variants[definition_id] # For legacy TwoTrees printers, change the variant to 0.4.
|
||||
|
||||
# Also change the quality to go along with it.
|
||||
if material_id in self._two_trees_quality_per_material and old_quality_id in self._two_trees_quality_per_material[material_id]:
|
||||
parser["containers"]["3"] = self._two_trees_quality_per_material[material_id][old_quality_id]
|
||||
stack_copy = {} # type: Dict[str, str] # Make a copy so that we don't modify the dict we're iterating over.
|
||||
stack_copy.update(parser["containers"])
|
||||
for position, profile_id in stack_copy.items():
|
||||
if profile_id in self._renamed_profiles:
|
||||
parser["containers"][position] = self._renamed_profiles[profile_id]
|
||||
|
||||
result = io.StringIO()
|
||||
parser.write(result)
|
||||
return [filename], [result.getvalue()]
|
55
plugins/VersionUpgrade/VersionUpgrade49to410/__init__.py
Normal file
55
plugins/VersionUpgrade/VersionUpgrade49to410/__init__.py
Normal file
|
@ -0,0 +1,55 @@
|
|||
# Copyright (c) 2020 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from typing import Any, Dict, TYPE_CHECKING
|
||||
|
||||
from . import VersionUpgrade49to410
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from UM.Application import Application
|
||||
|
||||
upgrade = VersionUpgrade49to410.VersionUpgrade49to410()
|
||||
|
||||
|
||||
def getMetaData() -> Dict[str, Any]:
|
||||
return {
|
||||
"version_upgrade": {
|
||||
# From To Upgrade function
|
||||
("machine_stack", 5000016): ("machine_stack", 5000017, upgrade.upgradeStack),
|
||||
("extruder_train", 5000016): ("extruder_train", 5000017, upgrade.upgradeStack),
|
||||
("definition_changes", 4000016): ("definition_changes", 4000017, upgrade.upgradeInstanceContainer),
|
||||
("quality_changes", 4000016): ("quality_changes", 4000017, upgrade.upgradeInstanceContainer),
|
||||
("quality", 4000016): ("quality", 4000017, upgrade.upgradeInstanceContainer),
|
||||
("user", 4000016): ("user", 4000017, upgrade.upgradeInstanceContainer),
|
||||
},
|
||||
"sources": {
|
||||
"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}
|
8
plugins/VersionUpgrade/VersionUpgrade49to410/plugin.json
Normal file
8
plugins/VersionUpgrade/VersionUpgrade49to410/plugin.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"name": "Version Upgrade 4.9 to 4.10",
|
||||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.0",
|
||||
"description": "Upgrades configurations from Cura 4.9 to Cura 4.10.",
|
||||
"api": "7.6.0",
|
||||
"i18n-catalog": "cura"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue