From 99fe8ec7aa23e1917a2963a6bede652dcfc0caf5 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Wed, 6 Mar 2019 10:56:31 +0100 Subject: [PATCH 1/5] Improve cloud flow pop up logic Contributes to CL-CL-1272 --- .../src/UM3OutputDevicePlugin.py | 92 ++++++++++--------- 1 file changed, 49 insertions(+), 43 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py b/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py index 3fce903b1a..7855673fe8 100644 --- a/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py +++ b/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py @@ -454,50 +454,27 @@ class UM3OutputDevicePlugin(OutputDevicePlugin): def _onCloudFlowPossible(self) -> None: # Cloud flow is possible, so show the message if not self._start_cloud_flow_message: - self._start_cloud_flow_message = Message( - text = i18n_catalog.i18nc("@info:status", "Send and monitor print jobs from anywhere using your Ultimaker account."), - lifetime = 0, - image_source = QUrl.fromLocalFile(os.path.join( - PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"), - "resources", "svg", "cloud-flow-start.svg" - )), - image_caption = i18n_catalog.i18nc("@info:status", "Connect to Ultimaker Cloud"), - option_text = i18n_catalog.i18nc("@action", "Don't ask me again for this printer."), - option_state = False - ) - self._start_cloud_flow_message.addAction("", i18n_catalog.i18nc("@action", "Get started"), "", "") - self._start_cloud_flow_message.optionToggled.connect(self._onDontAskMeAgain) - self._start_cloud_flow_message.actionTriggered.connect(self._onCloudFlowStarted) - self._start_cloud_flow_message.show() - return + self._createCloudFlowStartMessage() + if not self._start_cloud_flow_message.visible: + self._start_cloud_flow_message.show() def _onCloudPrintingConfigured(self) -> None: - if self._start_cloud_flow_message: + # Hide the cloud flow start message if it was hanging around already + # For example: if the user already had the browser openen and made the association themselves + if self._start_cloud_flow_message and self._start_cloud_flow_message.visible: self._start_cloud_flow_message.hide() - self._start_cloud_flow_message = None - # Show the successful pop-up - if not self._start_cloud_flow_message: - self._cloud_flow_complete_message = Message( - text = i18n_catalog.i18nc("@info:status", "You can now send and monitor print jobs from anywhere using your Ultimaker account."), - lifetime = 30, - image_source = QUrl.fromLocalFile(os.path.join( - PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"), - "resources", "svg", "cloud-flow-completed.svg" - )), - image_caption = i18n_catalog.i18nc("@info:status", "Connected!") - ) - # Don't show the review connection link if we're not on the local network - if self._application.getMachineManager().activeMachineHasNetworkConnection: - self._cloud_flow_complete_message.addAction("", i18n_catalog.i18nc("@action", "Review your connection"), "", "", 1) # TODO: Icon - self._cloud_flow_complete_message.actionTriggered.connect(self._onReviewCloudConnection) + # Cloud flow is complete, so show the message + if not self._cloud_flow_complete_message: + self._createCloudFlowCompleteMessage() + if not self._cloud_flow_complete_message.visible: self._cloud_flow_complete_message.show() - - # Set the machine's cloud flow as complete so we don't ask the user again and again for cloud connected printers - active_machine = self._application.getMachineManager().activeMachine - if active_machine: - active_machine.setMetaDataEntry("do_not_show_cloud_message", True) - return + + # Set the machine's cloud flow as complete so we don't ask the user again and again for cloud connected printers + active_machine = self._application.getMachineManager().activeMachine + if active_machine: + active_machine.setMetaDataEntry("do_not_show_cloud_message", True) + return def _onDontAskMeAgain(self, checked: bool) -> None: active_machine = self._application.getMachineManager().activeMachine # type: Optional["GlobalStack"] @@ -523,11 +500,40 @@ class UM3OutputDevicePlugin(OutputDevicePlugin): return def _onMachineSwitched(self) -> None: - if self._start_cloud_flow_message is not None: + # Hide any left over messages + if self._start_cloud_flow_message is not None and self._start_cloud_flow_message.visible: self._start_cloud_flow_message.hide() - self._start_cloud_flow_message = None - if self._cloud_flow_complete_message is not None: + if self._cloud_flow_complete_message is not None and self._cloud_flow_complete_message.visible: self._cloud_flow_complete_message.hide() - self._cloud_flow_complete_message = None + # Check for cloud flow again with newly selected machine self.checkCloudFlowIsPossible() + + def _createCloudFlowStartMessage(self): + self._start_cloud_flow_message = Message( + text = i18n_catalog.i18nc("@info:status", "Send and monitor print jobs from anywhere using your Ultimaker account."), + lifetime = 0, + image_source = QUrl.fromLocalFile(os.path.join( + PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"), + "resources", "svg", "cloud-flow-start.svg" + )), + image_caption = i18n_catalog.i18nc("@info:status", "Connect to Ultimaker Cloud"), + option_text = i18n_catalog.i18nc("@action", "Don't ask me again for this printer."), + option_state = False + ) + self._start_cloud_flow_message.addAction("", i18n_catalog.i18nc("@action", "Get started"), "", "") + self._start_cloud_flow_message.optionToggled.connect(self._onDontAskMeAgain) + self._start_cloud_flow_message.actionTriggered.connect(self._onCloudFlowStarted) + + def _createCloudFlowCompleteMessage(self): + self._cloud_flow_complete_message = Message( + text = i18n_catalog.i18nc("@info:status", "You can now send and monitor print jobs from anywhere using your Ultimaker account."), + lifetime = 30, + image_source = QUrl.fromLocalFile(os.path.join( + PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"), + "resources", "svg", "cloud-flow-completed.svg" + )), + image_caption = i18n_catalog.i18nc("@info:status", "Connected!") + ) + self._cloud_flow_complete_message.addAction("", i18n_catalog.i18nc("@action", "Review your connection"), "", "", 1) # TODO: Icon + self._cloud_flow_complete_message.actionTriggered.connect(self._onReviewCloudConnection) \ No newline at end of file From 9c3f67a9edd97c63011ebbe87d9fe55daf6d3f1a Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Wed, 6 Mar 2019 12:26:38 +0100 Subject: [PATCH 2/5] Code style Contributes to CL-1272 --- plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py b/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py index 7855673fe8..7a22e11274 100644 --- a/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py +++ b/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py @@ -455,7 +455,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin): # Cloud flow is possible, so show the message if not self._start_cloud_flow_message: self._createCloudFlowStartMessage() - if not self._start_cloud_flow_message.visible: + if self._start_cloud_flow_message and not self._start_cloud_flow_message.visible: self._start_cloud_flow_message.show() def _onCloudPrintingConfigured(self) -> None: @@ -467,7 +467,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin): # Cloud flow is complete, so show the message if not self._cloud_flow_complete_message: self._createCloudFlowCompleteMessage() - if not self._cloud_flow_complete_message.visible: + if self._cloud_flow_complete_message and not self._cloud_flow_complete_message.visible: self._cloud_flow_complete_message.show() # Set the machine's cloud flow as complete so we don't ask the user again and again for cloud connected printers From ec203da1cd1f94e02ff7783753c5040e06f1cc9d Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 11 Mar 2019 13:54:49 +0100 Subject: [PATCH 3/5] Make sure to show printers even if queue is empty Contributes to CL-1281 --- .../resources/qml/MonitorStage.qml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml index 59cbda7172..e68418c21a 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml @@ -50,7 +50,17 @@ Component MonitorCarousel { id: carousel - printers: OutputDevice.receivedPrintJobs ? OutputDevice.printers : [null] + printers: + { + // When printing over the cloud we don't recieve print jobs until there is one, so + // unless there's at least one print job we'll be stuck with skeleton loading + // indefinitely. + if (Cura.MachineManager.activeMachineIsUsingCloudConnection || OutputDevice.receivedPrintJobs) + { + return OutputDevice.printers + } + return [null] + } } } From 6392ab8d055642b6373d3d061b70dfdbe4ea522e Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 11 Mar 2019 16:30:04 +0100 Subject: [PATCH 4/5] Handle "" and None as hot-end and material IDs Contributes to CL-1282 --- cura/Settings/MachineManager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index bb83a5f25a..52d69a2d3d 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -1390,8 +1390,9 @@ class MachineManager(QObject): need_to_show_message = False for extruder_configuration in configuration.extruderConfigurations: - extruder_has_hotend = extruder_configuration.hotendID != "" - extruder_has_material = extruder_configuration.material.guid != "" + # We support "" or None, since the cloud uses None instead of empty strings + extruder_has_hotend = extruder_configuration.hotendID and extruder_configuration.hotendID != "" + extruder_has_material = extruder_configuration.material.guid and extruder_configuration.material.guid != "" # If the machine doesn't have a hotend or material, disable this extruder if not extruder_has_hotend or not extruder_has_material: From e33ec5c32407137b455aa54545f30c5b3ef7fc44 Mon Sep 17 00:00:00 2001 From: THeijmans Date: Mon, 11 Mar 2019 14:42:10 +0100 Subject: [PATCH 5/5] Fixing the UM2+ speeds Fixing the very high print speeds in UM2+ profiles --- .../quality/ultimaker2_plus/um2p_abs_0.4_high.inst.cfg | 2 +- .../quality/ultimaker2_plus/um2p_cpe_0.4_fast.inst.cfg | 6 +++--- .../quality/ultimaker2_plus/um2p_cpe_0.4_high.inst.cfg | 2 +- .../quality/ultimaker2_plus/um2p_nylon_0.6_fast.inst.cfg | 2 +- resources/quality/ultimaker2_plus/um2p_pc_0.4_fast.inst.cfg | 2 +- resources/quality/ultimaker2_plus/um2p_pc_0.6_fast.inst.cfg | 2 +- resources/quality/ultimaker2_plus/um2p_pp_0.4_fast.inst.cfg | 4 ++-- resources/quality/ultimaker2_plus/um2p_pp_0.6_fast.inst.cfg | 4 ++-- .../quality/ultimaker2_plus/um2p_tpu_0.6_fast.inst.cfg | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/resources/quality/ultimaker2_plus/um2p_abs_0.4_high.inst.cfg b/resources/quality/ultimaker2_plus/um2p_abs_0.4_high.inst.cfg index 7910ed350d..8ade043aac 100644 --- a/resources/quality/ultimaker2_plus/um2p_abs_0.4_high.inst.cfg +++ b/resources/quality/ultimaker2_plus/um2p_abs_0.4_high.inst.cfg @@ -23,4 +23,4 @@ speed_wall = =math.ceil(speed_print * 30 / 45) top_bottom_thickness = 0.72 wall_thickness = 1.05 speed_topbottom = =math.ceil(speed_print * 15 / 45) -speed_infill = =math.ceil(speed_print * 80 / 45) +speed_infill = =math.ceil(speed_print * 45 / 45) diff --git a/resources/quality/ultimaker2_plus/um2p_cpe_0.4_fast.inst.cfg b/resources/quality/ultimaker2_plus/um2p_cpe_0.4_fast.inst.cfg index ecfeab0201..af44933cec 100644 --- a/resources/quality/ultimaker2_plus/um2p_cpe_0.4_fast.inst.cfg +++ b/resources/quality/ultimaker2_plus/um2p_cpe_0.4_fast.inst.cfg @@ -23,7 +23,7 @@ speed_travel = 150 speed_wall = =math.ceil(speed_print * 40 / 45) top_bottom_thickness = 0.75 wall_thickness = 0.7 -speed_wall_0 = =math.ceil(speed_print * 40 / 45) +speed_wall_0 = =math.ceil(speed_print * 30 / 45) speed_topbottom = =math.ceil(speed_print * 30 / 45) -speed_wall_x = =math.ceil(speed_print * 80 / 45) -speed_infill = =math.ceil(speed_print * 100 / 45) +speed_wall_x = =math.ceil(speed_print * 40 / 45) +speed_infill = =math.ceil(speed_print * 45 / 45) diff --git a/resources/quality/ultimaker2_plus/um2p_cpe_0.4_high.inst.cfg b/resources/quality/ultimaker2_plus/um2p_cpe_0.4_high.inst.cfg index 01b39b2589..d9d6e137d9 100644 --- a/resources/quality/ultimaker2_plus/um2p_cpe_0.4_high.inst.cfg +++ b/resources/quality/ultimaker2_plus/um2p_cpe_0.4_high.inst.cfg @@ -23,4 +23,4 @@ speed_wall = =math.ceil(speed_print * 30 / 45) top_bottom_thickness = 0.72 wall_thickness = 1.05 speed_topbottom = =math.ceil(speed_print * 15 / 45) -speed_infill = =math.ceil(speed_print * 80 / 45) +speed_infill = =math.ceil(speed_print * 45 / 45) diff --git a/resources/quality/ultimaker2_plus/um2p_nylon_0.6_fast.inst.cfg b/resources/quality/ultimaker2_plus/um2p_nylon_0.6_fast.inst.cfg index 39a8fc9973..4c2a0a5e52 100644 --- a/resources/quality/ultimaker2_plus/um2p_nylon_0.6_fast.inst.cfg +++ b/resources/quality/ultimaker2_plus/um2p_nylon_0.6_fast.inst.cfg @@ -45,4 +45,4 @@ support_xy_distance = 0.7 support_z_distance = =layer_height * 2 top_bottom_thickness = 1.2 wall_thickness = 1.2 -speed_infill = =math.ceil(speed_print * 100 / 55) +speed_infill = =math.ceil(speed_print * 55 / 55) diff --git a/resources/quality/ultimaker2_plus/um2p_pc_0.4_fast.inst.cfg b/resources/quality/ultimaker2_plus/um2p_pc_0.4_fast.inst.cfg index c089bbea33..77f967b3e4 100644 --- a/resources/quality/ultimaker2_plus/um2p_pc_0.4_fast.inst.cfg +++ b/resources/quality/ultimaker2_plus/um2p_pc_0.4_fast.inst.cfg @@ -37,4 +37,4 @@ support_pattern = lines support_z_distance = 0.19 wall_thickness = 1.2 speed_topbottom = =math.ceil(speed_print * 30 / 45) -speed_infill = =math.ceil(speed_print * 100 / 45) +speed_infill = =math.ceil(speed_print * 45 / 45) diff --git a/resources/quality/ultimaker2_plus/um2p_pc_0.6_fast.inst.cfg b/resources/quality/ultimaker2_plus/um2p_pc_0.6_fast.inst.cfg index 48918392e0..3136c90965 100644 --- a/resources/quality/ultimaker2_plus/um2p_pc_0.6_fast.inst.cfg +++ b/resources/quality/ultimaker2_plus/um2p_pc_0.6_fast.inst.cfg @@ -42,4 +42,4 @@ support_pattern = lines support_z_distance = 0.21 top_bottom_thickness = 0.75 wall_thickness = 1.06 -speed_infill = =math.ceil(speed_print * 100 / 45) +speed_infill = =math.ceil(speed_print * 45 / 45) diff --git a/resources/quality/ultimaker2_plus/um2p_pp_0.4_fast.inst.cfg b/resources/quality/ultimaker2_plus/um2p_pp_0.4_fast.inst.cfg index bc22bdcdea..3e92a6cac4 100644 --- a/resources/quality/ultimaker2_plus/um2p_pp_0.4_fast.inst.cfg +++ b/resources/quality/ultimaker2_plus/um2p_pp_0.4_fast.inst.cfg @@ -68,5 +68,5 @@ travel_avoid_distance = 3 wall_0_inset = 0 wall_line_width_x = =round(line_width * 0.38 / 0.38, 2) wall_thickness = 0.76 -speed_wall_x = =math.ceil(speed_print * 80 / 25) -speed_infill = =math.ceil(speed_print * 100 / 25) +speed_wall_x = =math.ceil(speed_print * 25 / 25) +speed_infill = =math.ceil(speed_print * 25 / 25) diff --git a/resources/quality/ultimaker2_plus/um2p_pp_0.6_fast.inst.cfg b/resources/quality/ultimaker2_plus/um2p_pp_0.6_fast.inst.cfg index ad9bc82810..2f6870d38b 100644 --- a/resources/quality/ultimaker2_plus/um2p_pp_0.6_fast.inst.cfg +++ b/resources/quality/ultimaker2_plus/um2p_pp_0.6_fast.inst.cfg @@ -69,5 +69,5 @@ travel_avoid_distance = 3 wall_0_inset = 0 wall_line_width_x = =round(line_width * 0.57 / 0.57, 2) wall_thickness = 1.14 -speed_wall_x = =math.ceil(speed_print * 80 / 25) -speed_infill = =math.ceil(speed_print * 100 / 25) +speed_wall_x = =math.ceil(speed_print * 25 / 25) +speed_infill = =math.ceil(speed_print * 25 / 25) diff --git a/resources/quality/ultimaker2_plus/um2p_tpu_0.6_fast.inst.cfg b/resources/quality/ultimaker2_plus/um2p_tpu_0.6_fast.inst.cfg index cef0fcabbe..8bab286ca2 100644 --- a/resources/quality/ultimaker2_plus/um2p_tpu_0.6_fast.inst.cfg +++ b/resources/quality/ultimaker2_plus/um2p_tpu_0.6_fast.inst.cfg @@ -42,4 +42,4 @@ support_xy_distance = 0.7 support_z_distance = =layer_height * 2 top_bottom_thickness = 1.2 wall_thickness = 1.14 -speed_infill = =math.ceil(speed_print * 100 / 45) +speed_infill = =math.ceil(speed_print * 45 / 45)