mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 19:29:02 +08:00
Merge branch '4.7' of github.com:Ultimaker/Cura into 4.7
This commit is contained in:
commit
af9a078d41
@ -260,7 +260,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
if machine_definition_container_count != 1:
|
||||
return WorkspaceReader.PreReadResult.failed # Not a workspace file but ordinary 3MF.
|
||||
|
||||
material_labels = []
|
||||
material_ids_to_names_map = {}
|
||||
material_conflict = False
|
||||
xml_material_profile = self._getXmlProfileClass()
|
||||
reverse_material_id_dict = {}
|
||||
@ -276,7 +276,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
reverse_map = {metadata["id"]: container_id for metadata in metadata_list}
|
||||
reverse_material_id_dict.update(reverse_map)
|
||||
|
||||
material_labels.append(self._getMaterialLabelFromSerialized(serialized))
|
||||
material_ids_to_names_map[container_id] = self._getMaterialLabelFromSerialized(serialized)
|
||||
if self._container_registry.findContainersMetadata(id = container_id): #This material already exists.
|
||||
containers_found_dict["material"] = True
|
||||
if not self._container_registry.isReadOnly(container_id): # Only non readonly materials can be in conflict
|
||||
@ -443,6 +443,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
QCoreApplication.processEvents() # Ensure that the GUI does not freeze.
|
||||
Job.yieldThread()
|
||||
|
||||
materials_in_extruders_dict = {} # Which material is in which extruder
|
||||
|
||||
# if the global stack is found, we check if there are conflicts in the extruder stacks
|
||||
for extruder_stack_file in extruder_stack_files:
|
||||
serialized = archive.open(extruder_stack_file).read().decode("utf-8")
|
||||
@ -468,6 +470,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
if material_id not in ("empty", "empty_material"):
|
||||
root_material_id = reverse_material_id_dict[material_id]
|
||||
extruder_info.root_material_id = root_material_id
|
||||
materials_in_extruders_dict[position] = material_ids_to_names_map[reverse_material_id_dict[material_id]]
|
||||
|
||||
definition_changes_id = parser["containers"][str(_ContainerIndexes.DefinitionChanges)]
|
||||
if definition_changes_id not in ("empty", "empty_definition_changes"):
|
||||
@ -496,6 +499,10 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
machine_conflict = True
|
||||
break
|
||||
|
||||
# Now we know which material is in which extruder. Let's use that to sort the material_labels according to
|
||||
# their extruder position
|
||||
material_labels = [material_name for pos, material_name in sorted(materials_in_extruders_dict.items())]
|
||||
|
||||
num_visible_settings = 0
|
||||
try:
|
||||
temp_preferences = Preferences()
|
||||
|
@ -63,6 +63,7 @@ Item
|
||||
id: waitingIndicator
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
running: searchingForCloudPrinters
|
||||
palette.dark: UM.Theme.getColor("text")
|
||||
}
|
||||
Label
|
||||
{
|
||||
|
@ -41,6 +41,7 @@ Item
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
text: catalog.i18nc("@label", "There is no printer found over your network.")
|
||||
color: UM.Theme.getColor("text")
|
||||
renderType: Text.NativeRendering
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
visible: networkPrinterListView.count == 0 // Do not show if there are discovered devices.
|
||||
|
Loading…
x
Reference in New Issue
Block a user