Merge branch '15.06'

* 15.06:
  Also add the parent class' command line arguments
  Only process the layer data if the layer view is active.
  Write to the correct variable so bed temperature is properly updated
  Correct a copy-paste error in getConnectionList
  Properly close all open USB connections on shut down
  Catch errors when trying to close the connection thread
  Enlarge the zone where you can use scrolling to look trough the layer mode.
  tiniest detail concerning the padding of the layer count label
  Adds layer count
This commit is contained in:
Arjen Hiemstra 2015-07-10 13:10:15 +02:00
commit fec2207b50
8 changed files with 166 additions and 16 deletions

View file

@ -46,6 +46,8 @@ class USBPrinterManager(QObject, SignalEmitter, Extension):
## Add menu item to top menu of the application.
self.setMenuName("Firmware")
self.addMenuItem(i18n_catalog.i18n("Update Firmware"), self.updateAllFirmware)
Application.getInstance().applicationShuttingDown.connect(self._onApplicationShuttingDown)
pyqtError = pyqtSignal(str, arguments = ["error"])
processingProgress = pyqtSignal(float, arguments = ["amount"])
@ -170,7 +172,7 @@ class USBPrinterManager(QObject, SignalEmitter, Extension):
## Callback for bed temperature change
def onBedTemperature(self, serial_port,temperature):
self._bed_temperature = temperature
self._bed_temp = temperature
self.pyqtBedTemperature.emit(temperature)
## Callback for error
@ -280,15 +282,19 @@ class USBPrinterManager(QObject, SignalEmitter, Extension):
i = 0
while True:
values = winreg.EnumValue(key, i)
if not base_list or "USBSER" in values[0]:
if not only_list_usb or "USBSER" in values[0]:
base_list += [values[1]]
i += 1
except Exception as e:
pass
if base_list:
base_list = base_list + glob.glob("/dev/ttyUSB*") + glob.glob("/dev/ttyACM*") + glob.glob("/dev/cu.usb*")
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/*")
if only_list_usb:
base_list = base_list + glob.glob("/dev/ttyUSB*") + glob.glob("/dev/ttyACM*") + glob.glob("/dev/cu.usb*")
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/*")
return base_list
def _onApplicationShuttingDown(self):
for connection in self._printer_connections:
connection.close()