From 2020ff5622e6dbd7d97917d4464616fb66a8ab07 Mon Sep 17 00:00:00 2001 From: Simon Edwards Date: Mon, 13 Feb 2017 13:27:10 +0100 Subject: [PATCH 1/2] Removed the debug which we no longer need. CURA-3335 Single instance Cura and model reloading --- cura/CuraApplication.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 49f1bac716..e5eee35746 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -439,7 +439,6 @@ class CuraApplication(QtApplication): self.__single_instance_server = QLocalServer() self.__single_instance_server.newConnection.connect(self._singleInstanceServerNewConnection) self.__single_instance_server.listen("ultimaker-cura") - Logger.log("d","Single-instance: Listening on: " + repr(self.__single_instance_server.fullServerName())) def _singleInstanceServerNewConnection(self): Logger.log("i", "New connection recevied on our single-instance server") @@ -447,11 +446,9 @@ class CuraApplication(QtApplication): if remote_cura_connection is not None: def readCommands(): - Logger.log("d", "Single-instance: readCommands()") line = remote_cura_connection.readLine() while len(line) != 0: # There is also a .canReadLine() try: - Logger.log("d", "Single-instance: Read command line: " + repr(line)) payload = json.loads(str(line, encoding="ASCII").strip()) command = payload["command"] @@ -482,11 +479,6 @@ class CuraApplication(QtApplication): line = remote_cura_connection.readLine() remote_cura_connection.readyRead.connect(readCommands) - def disconnected(): - Logger.log("d", "Single-instance: Disconnected") - readCommands() - Logger.log("d", "Single-instance: Finished disconnected") - remote_cura_connection.disconnected.connect(disconnected) # Get any last commands before it is destroyed. ## Perform any checks before creating the main application. # From a3af887d3f6a9bd6ef16c6a3f675b6ec08b93756 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 13 Feb 2017 13:46:30 +0100 Subject: [PATCH 2/2] Add support for WSH USB driver when not filtering USB-only This support was included when filtering for USB only, but not the case when we are not filtering. I don't like this bit of code much since we should just define a list of paths to check and iterate over it, so that we can re-use the data and prevent syncing mistakes like this. --- plugins/USBPrinting/USBPrinterOutputDeviceManager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/USBPrinting/USBPrinterOutputDeviceManager.py b/plugins/USBPrinting/USBPrinterOutputDeviceManager.py index 666ec4c856..67e21e1abe 100644 --- a/plugins/USBPrinting/USBPrinterOutputDeviceManager.py +++ b/plugins/USBPrinting/USBPrinterOutputDeviceManager.py @@ -1,4 +1,4 @@ -# Copyright (c) 2015 Ultimaker B.V. +# Copyright (c) 2017 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.Signal import Signal, signalemitter @@ -270,7 +270,7 @@ class USBPrinterOutputDeviceManager(QObject, OutputDevicePlugin, Extension): base_list = base_list + glob.glob("/dev/ttyUSB*") + glob.glob("/dev/ttyACM*") + glob.glob("/dev/cu.usb*") + glob.glob("/dev/tty.wchusb*") + glob.glob("/dev/cu.wchusb*") base_list = filter(lambda s: "Bluetooth" not in s, base_list) # Filter because mac sometimes puts them in the list else: - base_list = base_list + glob.glob("/dev/ttyUSB*") + glob.glob("/dev/ttyACM*") + glob.glob("/dev/cu.*") + glob.glob("/dev/tty.usb*") + glob.glob("/dev/rfcomm*") + glob.glob("/dev/serial/by-id/*") + base_list = base_list + glob.glob("/dev/ttyUSB*") + glob.glob("/dev/ttyACM*") + glob.glob("/dev/cu.*") + glob.glob("/dev/tty.usb*") + glob.glob("/dev/tty.wchusb*") + glob.glob("/dev/cu.wchusb*") + glob.glob("/dev/rfcomm*") + glob.glob("/dev/serial/by-id/*") return list(base_list) _instance = None