From c9588d173f16ddee76ac5a3b1a752650e97255d4 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 20 May 2019 12:18:38 +0200 Subject: [PATCH 1/6] Add monitor column to theme Contributes to CL-1329 --- .../UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml | 4 ++-- plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml | 4 ++-- resources/themes/cura-light/theme.json | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml index d80f2e5b9f..470eb84ac3 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml @@ -51,7 +51,7 @@ Item { anchors.verticalCenter: parent.verticalCenter height: 18 * screenScaleFactor // TODO: Theme! - width: 216 * screenScaleFactor // TODO: Theme! (Should match column size) + width: UM.Theme.getSize("monitor_column").width Rectangle { color: UM.Theme.getColor("monitor_skeleton_loading") @@ -79,7 +79,7 @@ Item { anchors.verticalCenter: parent.verticalCenter height: 18 * screenScaleFactor // TODO: Theme! - width: 216 * screenScaleFactor // TODO: Theme! (Should match column size) + width: UM.Theme.getSize("monitor_column").width Rectangle { color: UM.Theme.getColor("monitor_skeleton_loading") diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml index 6025d7acfe..8460425190 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml @@ -120,7 +120,7 @@ Item elide: Text.ElideRight font: UM.Theme.getFont("medium") // 14pt, regular anchors.verticalCenter: parent.verticalCenter - width: 216 * screenScaleFactor // TODO: Theme! (Should match column size) + width: UM.Theme.getSize("monitor_column").width // FIXED-LINE-HEIGHT: height: 18 * screenScaleFactor // TODO: Theme! @@ -135,7 +135,7 @@ Item elide: Text.ElideRight font: UM.Theme.getFont("medium") // 14pt, regular anchors.verticalCenter: parent.verticalCenter - width: 216 * screenScaleFactor // TODO: Theme! (Should match column size) + width: UM.Theme.getSize("monitor_column").width // FIXED-LINE-HEIGHT: height: 18 * screenScaleFactor // TODO: Theme! diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index d1c4600f27..5cb41bb7c1 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -618,6 +618,7 @@ "monitor_shadow_offset": [0.15, 0.15], "monitor_empty_state_offset": [5.6, 5.6], "monitor_empty_state_size": [35.0, 25.0], - "monitor_external_link_icon": [1.16, 1.16] + "monitor_external_link_icon": [1.16, 1.16], + "monitor_column": [18.0, 1.0] } } From 3b7b554f1a86138ea373a0fc9f2a1281ade832cd Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 20 May 2019 12:18:55 +0200 Subject: [PATCH 2/6] Update MonitorPrintJobProgressBar.qml Contributes to CL-1329 --- .../resources/qml/MonitorPrintJobProgressBar.qml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml index bcc7f9a358..e6d09b68f6 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml @@ -28,9 +28,12 @@ Item anchors { verticalCenter: parent.verticalCenter + left: parent.left } value: printJob ? printJob.progress : 0 + width: UM.Theme.getSize("monitor_column").width } + Label { id: percentLabel @@ -38,6 +41,7 @@ Item { left: progressBar.right leftMargin: 18 * screenScaleFactor // TODO: Theme! + verticalCenter: parent.verticalCenter } text: printJob ? Math.round(printJob.progress * 100) + "%" : "0%" color: printJob && printJob.isActive ? UM.Theme.getColor("monitor_text_primary") : UM.Theme.getColor("monitor_text_disabled") @@ -56,6 +60,7 @@ Item { left: percentLabel.right leftMargin: 18 * screenScaleFactor // TODO: Theme! + verticalCenter: parent.verticalCenter } color: UM.Theme.getColor("monitor_text_primary") font: UM.Theme.getFont("medium") // 14pt, regular From f7d0bcd0d402982512fca3113496a28f4f752440 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 20 May 2019 14:40:41 +0200 Subject: [PATCH 3/6] Prevent modifier meshes from blocking one at a time slicing CURA-6030 --- cura/Scene/ConvexHullDecorator.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cura/Scene/ConvexHullDecorator.py b/cura/Scene/ConvexHullDecorator.py index 1aae97942a..2d8224eecc 100644 --- a/cura/Scene/ConvexHullDecorator.py +++ b/cura/Scene/ConvexHullDecorator.py @@ -66,6 +66,10 @@ class ConvexHullDecorator(SceneNodeDecorator): node.boundingBoxChanged.connect(self._onChanged) + per_object_stack = node.callDecoration("getStack") + if per_object_stack: + per_object_stack.propertyChanged.connect(self._onSettingValueChanged) + self._onChanged() ## Force that a new (empty) object is created upon copy. @@ -76,7 +80,8 @@ class ConvexHullDecorator(SceneNodeDecorator): def getConvexHull(self) -> Optional[Polygon]: if self._node is None: return None - + if self._node.callDecoration("isNonPrintingMesh"): + return None hull = self._compute2DConvexHull() if self._global_stack and self._node is not None and hull is not None: @@ -106,7 +111,8 @@ class ConvexHullDecorator(SceneNodeDecorator): def getConvexHullHead(self) -> Optional[Polygon]: if self._node is None: return None - + if self._node.callDecoration("isNonPrintingMesh"): + return None if self._global_stack: if self._global_stack.getProperty("print_sequence", "value") == "one_at_a_time" and not self.hasGroupAsParent(self._node): head_with_fans = self._compute2DConvexHeadMin() @@ -122,6 +128,9 @@ class ConvexHullDecorator(SceneNodeDecorator): def getConvexHullBoundary(self) -> Optional[Polygon]: if self._node is None: return None + + if self._node.callDecoration("isNonPrintingMesh"): + return None if self._global_stack: if self._global_stack.getProperty("print_sequence", "value") == "one_at_a_time" and not self.hasGroupAsParent(self._node): @@ -398,4 +407,4 @@ class ConvexHullDecorator(SceneNodeDecorator): ## Settings that change the convex hull. # # If these settings change, the convex hull should be recalculated. - _influencing_settings = {"xy_offset", "xy_offset_layer_0", "mold_enabled", "mold_width"} + _influencing_settings = {"xy_offset", "xy_offset_layer_0", "mold_enabled", "mold_width", "anti_overhang_mesh", "infill_mesh", "cutting_mesh"} From 7be3863d51725331717b330eac713e13b320e5d5 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 20 May 2019 10:59:34 +0200 Subject: [PATCH 4/6] Put override logic in Python instead of QML Contributes to CL-1259 --- .../UM3NetworkPrinting/src/ConfigurationChangeModel.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/UM3NetworkPrinting/src/ConfigurationChangeModel.py b/plugins/UM3NetworkPrinting/src/ConfigurationChangeModel.py index ef8a212b76..6645115fbc 100644 --- a/plugins/UM3NetworkPrinting/src/ConfigurationChangeModel.py +++ b/plugins/UM3NetworkPrinting/src/ConfigurationChangeModel.py @@ -3,11 +3,16 @@ from PyQt5.QtCore import pyqtSignal, pyqtProperty, QObject, pyqtSlot +BLOCKING_CHANGE_TYPES = [ + "material_insert", "buildplate_change" +] + class ConfigurationChangeModel(QObject): def __init__(self, type_of_change: str, index: int, target_name: str, origin_name: str) -> None: super().__init__() self._type_of_change = type_of_change # enum = ["material", "print_core_change"] + self._can_override = False if self._type_of_change in BLOCKING_CHANGE_TYPES else True self._index = index self._target_name = target_name self._origin_name = origin_name @@ -27,3 +32,7 @@ class ConfigurationChangeModel(QObject): @pyqtProperty(str, constant = True) def originName(self) -> str: return self._origin_name + + @pyqtProperty(bool, constant = True) + def canOverride(self) -> bool: + return self._can_override \ No newline at end of file From 0c9f3a18423382564d2846596a24d8ecd4987993 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 20 May 2019 10:59:51 +0200 Subject: [PATCH 5/6] Update MonitorConfigOverrideDialog.qml Contributes to CL-1259 --- .../qml/MonitorConfigOverrideDialog.qml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml index cba36412b6..d380915633 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml @@ -30,6 +30,26 @@ UM.Dialog OutputDevice.forceSendJob(printer.activePrintJob.key) overrideConfirmationDialog.close() } + visible: + { + // Don't show the button if we're missing a printer or print job + if (!printer || !printer.activePrintJob) + { + return false + } + + // Check each required change... + for (var i = 0; i < printer.activePrintJob.configurationChanges.length; i++) + { + var change = printer.activePrintJob.configurationChanges[i] + // If that type of change is in the list of blocking changes, hide the button + if (!change.canOverride) + { + return false + } + } + return true + } }, Button { From 5a8b70ad0ced8198300d9991c0fbcd851bba6cfe Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 20 May 2019 15:12:08 +0200 Subject: [PATCH 6/6] Simplify can_override conditional Contributes to CL-1259 --- plugins/UM3NetworkPrinting/src/ConfigurationChangeModel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/src/ConfigurationChangeModel.py b/plugins/UM3NetworkPrinting/src/ConfigurationChangeModel.py index 6645115fbc..7136d8b93f 100644 --- a/plugins/UM3NetworkPrinting/src/ConfigurationChangeModel.py +++ b/plugins/UM3NetworkPrinting/src/ConfigurationChangeModel.py @@ -12,7 +12,7 @@ class ConfigurationChangeModel(QObject): super().__init__() self._type_of_change = type_of_change # enum = ["material", "print_core_change"] - self._can_override = False if self._type_of_change in BLOCKING_CHANGE_TYPES else True + self._can_override = self._type_of_change not in BLOCKING_CHANGE_TYPES self._index = index self._target_name = target_name self._origin_name = origin_name