From 7b41e844cc6f0832d8ff9496761a38a771de38cd Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 2 Feb 2017 15:19:56 +0100 Subject: [PATCH] Fix name and address for USB printing devices As address it uses the serial port, which would be COM# for Windows and /dev/ttyUSB# for Linux. I don't know what it would display there on OSX, probably a drive directory. Contributes to issue CURA-3161. --- plugins/USBPrinting/USBPrinterOutputDevice.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/USBPrinting/USBPrinterOutputDevice.py b/plugins/USBPrinting/USBPrinterOutputDevice.py index e344caee1d..e30ba613bc 100644 --- a/plugins/USBPrinting/USBPrinterOutputDevice.py +++ b/plugins/USBPrinting/USBPrinterOutputDevice.py @@ -124,6 +124,16 @@ class USBPrinterOutputDevice(PrinterOutputDevice): def _homeBed(self): self._sendCommand("G28 Z") + ## A name for the device. + @pyqtProperty(str, constant = True) + def name(self): + return self.getName() + + ## The address of the device. + @pyqtProperty(str, constant = True) + def address(self): + return self._serial_port + def startPrint(self): self.writeStarted.emit(self) gcode_list = getattr( Application.getInstance().getController().getScene(), "gcode_list")