From 19cd8f4edccf012f19debf257e0404e6e47b1ce9 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 29 Apr 2019 13:27:46 +0200 Subject: [PATCH 1/3] Better naming for hasMachineTypeName() CURA-6449 --- cura/Machines/Models/DiscoveredPrintersModel.py | 4 ++-- cura/Settings/MachineManager.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cura/Machines/Models/DiscoveredPrintersModel.py b/cura/Machines/Models/DiscoveredPrintersModel.py index d548b0980c..e639ee2d25 100644 --- a/cura/Machines/Models/DiscoveredPrintersModel.py +++ b/cura/Machines/Models/DiscoveredPrintersModel.py @@ -70,7 +70,7 @@ class DiscoveredPrinter(QObject): # In ClusterUM3OutputDevice, 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 machine_manager.hasMachineTypeName(self._machine_type): + if machine_manager.hasHumanReadableMachineTypeName(self._machine_type): readable_type = self._machine_type else: readable_type = machine_manager.getMachineTypeNameFromId(self._machine_type) @@ -82,7 +82,7 @@ class DiscoveredPrinter(QObject): def isUnknownMachineType(self) -> bool: from cura.CuraApplication import CuraApplication machine_manager = CuraApplication.getInstance().getMachineManager() - if machine_manager.hasMachineTypeName(self._machine_type): + if machine_manager.hasHumanReadableMachineTypeName(self._machine_type): readable_type = self._machine_type else: readable_type = machine_manager.getMachineTypeNameFromId(self._machine_type) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index d35ce116ac..24d63d5164 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -1640,7 +1640,10 @@ class MachineManager(QObject): return abbr_machine - def hasMachineTypeName(self, machine_type_name: str) -> bool: + # Checks if the given machine type name in the available machine list. + # The machine type is a code name such as "ultimaker_3", while the machine type name is the human-readable name of + # the machine type, which is "Ultimaker 3" for "ultimaker_3". + def hasHumanReadableMachineTypeName(self, machine_type_name: str) -> bool: results = self._container_registry.findDefinitionContainersMetadata(name = machine_type_name) return len(results) > 0 From 56c0cae71f764f6a7e94d1cc757395a85bc6f0e2 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 29 Apr 2019 15:13:01 +0200 Subject: [PATCH 2/3] DoubleClick and drag no longer contradict eachother for expandable component CURA-6478 --- resources/qml/ExpandableComponent.qml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index 8803c08b19..b3fe3fa763 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -268,23 +268,32 @@ Item right: contentHeader.xPosCloseButton } property var clickPos: Qt.point(0, 0) - + property bool dragging: false onPressed: { clickPos = Qt.point(mouse.x, mouse.y); + dragging = true } onPositionChanged: { - var delta = Qt.point(mouse.x - clickPos.x, mouse.y - clickPos.y); - if (delta.x !== 0 || delta.y !== 0) + if(dragging) { - contentContainer.trySetPosition(contentContainer.x + delta.x, contentContainer.y + delta.y); + var delta = Qt.point(mouse.x - clickPos.x, mouse.y - clickPos.y); + if (delta.x !== 0 || delta.y !== 0) + { + contentContainer.trySetPosition(contentContainer.x + delta.x, contentContainer.y + delta.y); + } } } + onReleased: + { + dragging = false + } onDoubleClicked: { + dragging = false contentContainer.trySetPosition(0, 0); } From 3f47ffeae77e831dc0e8351b5643a3a95f1cba6f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 30 Apr 2019 10:50:57 +0200 Subject: [PATCH 3/3] Use only the active extruders when sending slice message Fixes #5671 --- plugins/CuraEngineBackend/StartSliceJob.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index b88a4a33d2..8ce3110a93 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -256,10 +256,7 @@ class StartSliceJob(Job): self._buildGlobalInheritsStackMessage(stack) # Build messages for extruder stacks - # Send the extruder settings in the order of extruder positions. Somehow, if you send e.g. extruder 3 first, - # then CuraEngine can slice with the wrong settings. This I think should be fixed in CuraEngine as well. - extruder_stack_list = sorted(list(global_stack.extruders.items()), key = lambda item: int(item[0])) - for _, extruder_stack in extruder_stack_list: + for extruder_stack in global_stack.extruderList: self._buildExtruderMessage(extruder_stack) for group in filtered_object_groups: