From 22c1a118a869adb2f7c0939e7cce54820cde5f3d Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 20 Jul 2017 10:28:07 +0200 Subject: [PATCH 1/5] Fix conflict detection when there is no definition_changes CURA-4053 An old project file doesn't have the definition_changes container in the stacks. When this is the case, Cura should also check if the definition changes container in an existing stack is empty or not for project file loading conflict detection. --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index eb45b9ef3d..aca3948813 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -256,6 +256,9 @@ class ThreeMFWorkspaceReader(WorkspaceReader): container_id = self._old_empty_profile_id_dict.get(container_id, container_id) # HACK: there used to be 5, now we have one more 5 - definition changes if len(id_list) == 6 and index == 5: + if global_stack.getContainer(5).getId() != "empty": + machine_conflict = True + break index = 6 if global_stack.getContainer(index).getId() != container_id: machine_conflict = True @@ -294,6 +297,9 @@ class ThreeMFWorkspaceReader(WorkspaceReader): container_id = self._old_empty_profile_id_dict.get(container_id, container_id) # HACK: there used to be 5, now we have one more 5 - definition changes if len(id_list) == 6 and index == 5: + if existing_extruder_stack.getContainer(5).getId() != "empty": + machine_conflict = True + break index = 6 if existing_extruder_stack.getContainer(index).getId() != container_id: machine_conflict = True From b839cb74f4f02586649aa38bb2b3063cb3216e51 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 20 Jul 2017 12:01:21 +0200 Subject: [PATCH 2/5] Do not only check if activeMaterialId is None, also check for empty Fixes CURA-4065 --- cura/Settings/CuraContainerRegistry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Settings/CuraContainerRegistry.py b/cura/Settings/CuraContainerRegistry.py index ed63e10909..52760d7782 100644 --- a/cura/Settings/CuraContainerRegistry.py +++ b/cura/Settings/CuraContainerRegistry.py @@ -282,7 +282,7 @@ class CuraContainerRegistry(ContainerRegistry): profile.setDefinition(self._activeQualityDefinition()) if self._machineHasOwnMaterials(): active_material_id = self._activeMaterialId() - if active_material_id: # only update if there is an active material + if active_material_id and active_material_id != "empty": # only update if there is an active material profile.addMetaDataEntry("material", active_material_id) quality_type_criteria["material"] = active_material_id From 121fc170647ae2fe01dae42bfe41a3c30ebee034 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 20 Jul 2017 15:15:03 +0200 Subject: [PATCH 3/5] Multiply objects dialog is now application modal CURA-3768 --- resources/qml/Menus/ContextMenu.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Menus/ContextMenu.qml b/resources/qml/Menus/ContextMenu.qml index 915d320f41..86e146cb17 100755 --- a/resources/qml/Menus/ContextMenu.qml +++ b/resources/qml/Menus/ContextMenu.qml @@ -78,6 +78,7 @@ Menu Dialog { id: multiplyDialog + modality: Qt.ApplicationModal title: catalog.i18ncp("@title:window", "Multiply Selected Model", "Multiply Selected Models", UM.Selection.selectionCount) From 4d0c46508aa0e2ec76459c597ea5c059b10a6c56 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 20 Jul 2017 15:17:46 +0200 Subject: [PATCH 4/5] Fixed incorrect naming of printcores in error messages CURA-3734 --- plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index b309691e81..5a7fb3a409 100755 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -645,7 +645,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): # Only check for mistakes if there is material length information. if print_information.materialLengths: - # Check if print cores / materials are loaded at all. Any failure in these results in an Error. + # Check if PrintCores / materials are loaded at all. Any failure in these results in an Error. for index in range(0, self._num_extruders): if index < len(print_information.materialLengths) and print_information.materialLengths[index] != 0: if self._json_printer_state["heads"][0]["extruders"][index]["hotend"]["id"] == "": @@ -677,7 +677,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): if variant: if variant.getName() != core_name: Logger.log("w", "Extruder %s has a different Cartridge (%s) as Cura (%s)", index + 1, core_name, variant.getName()) - warnings.append(i18n_catalog.i18nc("@label", "Different print core (Cura: {0}, Printer: {1}) selected for extruder {2}".format(variant.getName(), core_name, index + 1))) + warnings.append(i18n_catalog.i18nc("@label", "Different PrintCore (Cura: {0}, Printer: {1}) selected for extruder {2}".format(variant.getName(), core_name, index + 1))) material = extruder_manager.getExtruderStack(index).findContainer({"type": "material"}) if material: @@ -699,7 +699,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): is_offset_calibrated = True if not is_offset_calibrated: - warnings.append(i18n_catalog.i18nc("@label", "Print core {0} is not properly calibrated. XY calibration needs to be performed on the printer.").format(index + 1)) + warnings.append(i18n_catalog.i18nc("@label", "PrintCore {0} is not properly calibrated. XY calibration needs to be performed on the printer.").format(index + 1)) else: Logger.log("w", "There was no material usage found. No check to match used material with machine is done.") @@ -1176,7 +1176,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): i18n_catalog.i18nc("@label", "Would you like to use your current printer configuration in Cura?"), i18n_catalog.i18nc("@label", - "The print cores and/or materials on your printer differ from those within your current project. For the best result, always slice for the print cores and materials that are inserted in your printer."), + "The PrintCores and/or materials on your printer differ from those within your current project. For the best result, always slice for the PrintCores and materials that are inserted in your printer."), buttons=QMessageBox.Yes + QMessageBox.No, icon=QMessageBox.Question, callback=callback From 326c4cc4a420883fdf971193bb5acd94f01f4f7f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 21 Jul 2017 10:15:20 +0200 Subject: [PATCH 5/5] Removed code duplication CURA-4053 --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index aca3948813..56b8c62d28 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -254,12 +254,6 @@ class ThreeMFWorkspaceReader(WorkspaceReader): for index, container_id in enumerate(id_list): # take into account the old empty container IDs container_id = self._old_empty_profile_id_dict.get(container_id, container_id) - # HACK: there used to be 5, now we have one more 5 - definition changes - if len(id_list) == 6 and index == 5: - if global_stack.getContainer(5).getId() != "empty": - machine_conflict = True - break - index = 6 if global_stack.getContainer(index).getId() != container_id: machine_conflict = True break @@ -295,12 +289,6 @@ class ThreeMFWorkspaceReader(WorkspaceReader): for index, container_id in enumerate(id_list): # take into account the old empty container IDs container_id = self._old_empty_profile_id_dict.get(container_id, container_id) - # HACK: there used to be 5, now we have one more 5 - definition changes - if len(id_list) == 6 and index == 5: - if existing_extruder_stack.getContainer(5).getId() != "empty": - machine_conflict = True - break - index = 6 if existing_extruder_stack.getContainer(index).getId() != container_id: machine_conflict = True break @@ -875,6 +863,10 @@ class ThreeMFWorkspaceReader(WorkspaceReader): container_list = container_string.split(",") container_ids = [container_id for container_id in container_list if container_id != ""] + if len(container_ids) == 5: + # Hack; We used to not save the definition changes. Fix this. + container_ids.insert(4, "empty") + return container_ids def _getMachineNameFromSerializedStack(self, serialized):