From accd205185e246a7f906f88d7e76355131548f5d Mon Sep 17 00:00:00 2001 From: Victor <3372598+victornpb@users.noreply.github.com> Date: Tue, 2 Jun 2020 00:02:24 -0300 Subject: [PATCH 1/5] Added 76800 baud rate --- plugins/USBPrinting/AutoDetectBaudJob.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/USBPrinting/AutoDetectBaudJob.py b/plugins/USBPrinting/AutoDetectBaudJob.py index 36e9637c47..04fe64baaa 100644 --- a/plugins/USBPrinting/AutoDetectBaudJob.py +++ b/plugins/USBPrinting/AutoDetectBaudJob.py @@ -18,7 +18,7 @@ class AutoDetectBaudJob(Job): def __init__(self, serial_port: int) -> None: super().__init__() self._serial_port = serial_port - self._all_baud_rates = [115200, 250000, 500000, 230400, 57600, 38400, 19200, 9600] + self._all_baud_rates = [115200, 250000, 500000, 230400, 76800, 57600, 38400, 19200, 9600] def run(self) -> None: Logger.log("d", "Auto detect baud rate started.") From 63e7e2b382657362b115de4325f46ef0d4d9a96b Mon Sep 17 00:00:00 2001 From: Victor <3372598+victornpb@users.noreply.github.com> Date: Tue, 2 Jun 2020 00:03:12 -0300 Subject: [PATCH 2/5] Added 76800 baud rate --- plugins/USBPrinting/USBPrinterOutputDevice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/USBPrinting/USBPrinterOutputDevice.py b/plugins/USBPrinting/USBPrinterOutputDevice.py index bfc5385a81..f8d344839c 100644 --- a/plugins/USBPrinting/USBPrinterOutputDevice.py +++ b/plugins/USBPrinting/USBPrinterOutputDevice.py @@ -58,7 +58,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice): self._baud_rate = baud_rate - self._all_baud_rates = [115200, 250000, 500000, 230400, 57600, 38400, 19200, 9600] + self._all_baud_rates = [115200, 250000, 500000, 230400, 76800, 57600, 38400, 19200, 9600] # Instead of using a timer, we really need the update to be as a thread, as reading from serial can block. self._update_thread = Thread(target = self._update, daemon = True, name = "USBPrinterUpdate") From d0534c04764fcf4c79697a94c081669b0c8fd525 Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Tue, 2 Jun 2020 15:23:35 +0200 Subject: [PATCH 3/5] Update _remote_clusters dict when cloud printer is removed from Cura CURA-7457 --- .../src/Cloud/CloudOutputDeviceManager.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py index c562f7988e..2fc3171c04 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py @@ -9,6 +9,7 @@ from PyQt5.QtNetwork import QNetworkReply from UM import i18nCatalog from UM.Logger import Logger # To log errors talking to the API. from UM.Message import Message +from UM.Settings.Interfaces import ContainerInterface from UM.Signal import Signal from cura.API import Account from cura.API.Account import SyncState @@ -49,6 +50,8 @@ class CloudOutputDeviceManager: self._syncing = False + CuraApplication.getInstance().getContainerRegistry().containerRemoved.connect(self._printerRemoved) + def start(self): """Starts running the cloud output device manager, thus periodically requesting cloud data.""" @@ -287,3 +290,16 @@ class CloudOutputDeviceManager: output_device_manager = CuraApplication.getInstance().getOutputDeviceManager() if device.key not in output_device_manager.getOutputDeviceIds(): output_device_manager.addOutputDevice(device) + + def _printerRemoved(self, container: ContainerInterface) -> None: + """ + Callback connected to the containerRemoved signal. Invoked when a cloud printer is removed from Cura to remove + the printer's reference from the _remote_clusters. + + :param container: The ContainerInterface passed to this function whenever the ContainerRemoved signal is emitted + :return: None + """ + if isinstance(container, GlobalStack): + printer_clusters_map = {cluster.name: cluster_id for cluster_id, cluster in self._remote_clusters.items()} + if container.name in printer_clusters_map: + del self._remote_clusters[printer_clusters_map[container.name]] From 6d1d6ca1aa74a54492b964b6ec175fa0900e4613 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 3 Jun 2020 10:51:31 +0200 Subject: [PATCH 4/5] Add warning for Support Wall Line Count if breaking up support in chunks It will be hard to break it up then. Fixes #7841. --- resources/definitions/fdmprinter.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 9ab33b3a6c..a1598a0aa6 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -4219,7 +4219,7 @@ "default_value": 1, "minimum_value": "0", "minimum_value_warning": "1 if support_pattern == 'concentric' else 0", - "maximum_value_warning": "3", + "maximum_value_warning": "0 if (support_skip_some_zags and support_pattern == 'zigzag') else 3", "type": "int", "value": "1 if support_tree_enable else (1 if (support_pattern == 'grid' or support_pattern == 'triangles' or support_pattern == 'concentric') else 0)", "enabled": "support_enable or support_tree_enable", From be9aec624aaa9447b5a7fa5f2bc2852a4347ded7 Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Wed, 3 Jun 2020 11:13:21 +0200 Subject: [PATCH 5/5] Use the um_cloud_cluster_id metadata when removing the cloud printer CURA-7457 --- .../src/Cloud/CloudOutputDeviceManager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py index 2fc3171c04..7ee8322ba1 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py @@ -300,6 +300,6 @@ class CloudOutputDeviceManager: :return: None """ if isinstance(container, GlobalStack): - printer_clusters_map = {cluster.name: cluster_id for cluster_id, cluster in self._remote_clusters.items()} - if container.name in printer_clusters_map: - del self._remote_clusters[printer_clusters_map[container.name]] + container_cluster_id = container.getMetaDataEntry(self.META_CLUSTER_ID, None) + if container_cluster_id in self._remote_clusters.keys(): + del self._remote_clusters[container_cluster_id]