Merge branch 'master' into feature_intent_container_tree

This commit is contained in:
Diego Prado Gesto 2019-09-10 11:08:21 +02:00
commit b18565d9cf
153 changed files with 12828 additions and 252 deletions

View file

@ -34,6 +34,8 @@ from cura.Settings.CuraContainerStack import _ContainerIndexes
from cura.CuraApplication import CuraApplication
from cura.Utils.Threading import call_on_qt_thread
from PyQt5.QtCore import QCoreApplication
from .WorkspaceDialog import WorkspaceDialog
i18n_catalog = i18nCatalog("cura")
@ -231,6 +233,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
else:
Logger.log("w", "Unknown definition container type %s for %s",
definition_container_type, definition_container_file)
QCoreApplication.processEvents() # Ensure that the GUI does not freeze.
Job.yieldThread()
if machine_definition_container_count != 1:
@ -257,6 +260,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
containers_found_dict["material"] = True
if not self._container_registry.isReadOnly(container_id): # Only non readonly materials can be in conflict
material_conflict = True
QCoreApplication.processEvents() # Ensure that the GUI does not freeze.
Job.yieldThread()
# Check if any quality_changes instance container is in conflict.
@ -326,7 +330,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
# Ignore certain instance container types
Logger.log("w", "Ignoring instance container [%s] with type [%s]", container_id, container_type)
continue
QCoreApplication.processEvents() # Ensure that the GUI does not freeze.
Job.yieldThread()
if self._machine_info.quality_changes_info.global_info is None:
@ -405,7 +409,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
variant_id = parser["containers"][str(index_map_version[_ContainerIndexes.Variant])]
if variant_id not in ("empty", "empty_variant"):
self._machine_info.variant_info = instance_container_info_dict[variant_id]
QCoreApplication.processEvents() # Ensure that the GUI does not freeze.
Job.yieldThread()
# if the global stack is found, we check if there are conflicts in the extruder stacks
@ -661,6 +665,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
definition_container = self._container_registry.findDefinitionContainers(id = "fdmprinter")[0] #Fall back to defaults.
self._container_registry.addContainer(definition_container)
Job.yieldThread()
QCoreApplication.processEvents() # Ensure that the GUI does not freeze.
Logger.log("d", "Workspace loading is checking materials...")
# Get all the material files and check if they exist. If not, add them.
@ -710,6 +715,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
material_container.setDirty(True)
self._container_registry.addContainer(material_container)
Job.yieldThread()
QCoreApplication.processEvents() # Ensure that the GUI does not freeze.
# Handle quality changes if any
self._processQualityChanges(global_stack)