Merge branch 'master' into feature_intent

Conflicts:
	resources/bundled_packages/cura.json -> 4.1 to 4.2 upgrade package added simultaneously
	tests/TestMachineManager.py -> Due to changes in conftest.py
	tests/conftest.py -> Simultaneously expanding the magic mocks to have some correct properties
This commit is contained in:
Ghostkeeper 2019-08-13 14:43:28 +02:00
commit 20201c65e6
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
1386 changed files with 33217 additions and 35219 deletions

View file

@ -127,7 +127,7 @@ class MachineErrorChecker(QObject):
# Populate the (stack, key) tuples to check
self._stacks_and_keys_to_check = deque()
for stack in [global_stack] + list(global_stack.extruders.values()):
for stack in global_stack.extruders.values():
for key in stack.getAllKeys():
self._stacks_and_keys_to_check.append((stack, key))

View file

@ -93,7 +93,7 @@ class MaterialManager(QObject):
self._container_registry.findContainersMetadata(type = "material") if
metadata.get("GUID")} # type: Dict[str, Dict[str, Any]]
self._material_group_map = dict() # type: Dict[str, MaterialGroup]
self._material_group_map = dict()
# Map #1
# root_material_id -> MaterialGroup
@ -120,7 +120,7 @@ class MaterialManager(QObject):
# Map #1.5
# GUID -> material group list
self._guid_material_groups_map = defaultdict(list) # type: Dict[str, List[MaterialGroup]]
self._guid_material_groups_map = defaultdict(list)
for root_material_id, material_group in self._material_group_map.items():
guid = material_group.root_material_node.getMetaDataEntry("GUID", "")
self._guid_material_groups_map[guid].append(material_group)
@ -202,7 +202,7 @@ class MaterialManager(QObject):
# Map #4
# "machine" -> "nozzle name" -> "buildplate name" -> "root material ID" -> specific material InstanceContainer
self._diameter_machine_nozzle_buildplate_material_map = dict() # type: Dict[str, Dict[str, MaterialNode]]
self._diameter_machine_nozzle_buildplate_material_map = dict()
for material_metadata in material_metadatas.values():
self.__addMaterialMetadataIntoLookupTree(material_metadata)

View file

@ -75,7 +75,7 @@ class DiscoveredPrinter(QObject):
def readableMachineType(self) -> str:
from cura.CuraApplication import CuraApplication
machine_manager = CuraApplication.getInstance().getMachineManager()
# In ClusterUM3OutputDevice, when it updates a printer information, it updates the machine type using the field
# In LocalClusterOutputDevice, when it updates a printer information, it updates the machine type using the field
# "machine_variant", and for some reason, it's not the machine type ID/codename/... but a human-readable string
# like "Ultimaker 3". The code below handles this case.
if self._hasHumanReadableMachineTypeName(self._machine_type):

View file

@ -85,7 +85,14 @@ class VariantManager:
if variant_definition not in self._machine_to_buildplate_dict_map:
self._machine_to_buildplate_dict_map[variant_definition] = OrderedDict()
variant_container = self._container_registry.findContainers(type = "variant", id = variant_metadata["id"])[0]
try:
variant_container = self._container_registry.findContainers(type = "variant", id = variant_metadata["id"])[0]
except IndexError as e:
# It still needs to break, but we want to know what variant ID made it break.
msg = "Unable to find build plate variant with the id [%s]" % variant_metadata["id"]
Logger.logException("e", msg)
raise IndexError(msg)
buildplate_type = variant_container.getProperty("machine_buildplate_type", "value")
if buildplate_type not in self._machine_to_buildplate_dict_map[variant_definition]:
self._machine_to_variant_dict_map[variant_definition][buildplate_type] = dict()