Browse Source

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.
Ghostkeeper 8 years ago
parent
commit
7b41e844cc
1 changed files with 10 additions and 0 deletions
  1. 10 0
      plugins/USBPrinting/USBPrinterOutputDevice.py

+ 10 - 0
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")