mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-22 06:03:57 -06:00
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:
commit
fec2207b50
8 changed files with 166 additions and 16 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue