mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Fix workspace reader not taking upgrade into account
CURA-7517
This commit is contained in:
parent
daa6b4f28d
commit
5a77595807
1 changed files with 7 additions and 1 deletions
|
@ -368,15 +368,20 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
machine_name = self._getMachineNameFromSerializedStack(serialized)
|
machine_name = self._getMachineNameFromSerializedStack(serialized)
|
||||||
self._machine_info.metadata_dict = self._getMetaDataDictFromSerializedStack(serialized)
|
self._machine_info.metadata_dict = self._getMetaDataDictFromSerializedStack(serialized)
|
||||||
|
|
||||||
|
# Check if the definition has been changed (this usually happens due to an upgrade)
|
||||||
|
id_list = self._getContainerIdListFromSerialized(serialized)
|
||||||
|
if id_list[7] != machine_definition_id:
|
||||||
|
machine_definition_id = id_list[7]
|
||||||
|
|
||||||
stacks = self._container_registry.findContainerStacks(name = machine_name, type = "machine")
|
stacks = self._container_registry.findContainerStacks(name = machine_name, type = "machine")
|
||||||
self._is_same_machine_type = True
|
self._is_same_machine_type = True
|
||||||
existing_global_stack = None
|
existing_global_stack = None
|
||||||
|
|
||||||
if stacks:
|
if stacks:
|
||||||
global_stack = stacks[0]
|
global_stack = stacks[0]
|
||||||
existing_global_stack = global_stack
|
existing_global_stack = global_stack
|
||||||
containers_found_dict["machine"] = True
|
containers_found_dict["machine"] = True
|
||||||
# Check if there are any changes at all in any of the container stacks.
|
# Check if there are any changes at all in any of the container stacks.
|
||||||
id_list = self._getContainerIdListFromSerialized(serialized)
|
|
||||||
for index, container_id in enumerate(id_list):
|
for index, container_id in enumerate(id_list):
|
||||||
# take into account the old empty container IDs
|
# take into account the old empty container IDs
|
||||||
container_id = self._old_empty_profile_id_dict.get(container_id, container_id)
|
container_id = self._old_empty_profile_id_dict.get(container_id, container_id)
|
||||||
|
@ -661,6 +666,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
definition_container_files = [name for name in cura_file_names if name.endswith(self._definition_container_suffix)]
|
definition_container_files = [name for name in cura_file_names if name.endswith(self._definition_container_suffix)]
|
||||||
for definition_container_file in definition_container_files:
|
for definition_container_file in definition_container_files:
|
||||||
container_id = self._stripFileToId(definition_container_file)
|
container_id = self._stripFileToId(definition_container_file)
|
||||||
|
|
||||||
definitions = self._container_registry.findDefinitionContainersMetadata(id = container_id)
|
definitions = self._container_registry.findDefinitionContainersMetadata(id = container_id)
|
||||||
if not definitions:
|
if not definitions:
|
||||||
definition_container = DefinitionContainer(container_id)
|
definition_container = DefinitionContainer(container_id)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue