Merge branch '15.10' of https://github.com/Ultimaker/Cura into 15.10

This commit is contained in:
Tamara Hogenhout 2015-10-26 13:59:13 +01:00
commit 75151b2a02
2 changed files with 13 additions and 1 deletions

View File

@ -123,6 +123,7 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter):
progressChanged = pyqtSignal()
extruderTemperatureChanged = pyqtSignal()
bedTemperatureChanged = pyqtSignal()
firmwareUpdateComplete = pyqtSignal()
endstopStateChanged = pyqtSignal(str ,bool, arguments = ["key","state"])

View File

@ -54,6 +54,15 @@ class USBPrinterManager(QObject, SignalEmitter, OutputDevicePlugin, Extension):
addConnectionSignal = Signal()
printerConnectionStateChanged = pyqtSignal()
progressChanged = pyqtSignal()
@pyqtProperty(float, notify = progressChanged)
def progress(self):
progress = 0
for name, connection in self._printer_connections.items():
progress += connection.progress
return progress / len(self._printer_connections)
def start(self):
self._check_updates = True
self._update_thread.start()
@ -91,6 +100,7 @@ class USBPrinterManager(QObject, SignalEmitter, OutputDevicePlugin, Extension):
try:
self._printer_connections[printer_connection].updateFirmware(Resources.getPath(CuraApplication.ResourceTypes.Firmware, self._getDefaultFirmwareName()))
except FileNotFoundError:
Logger.log("w", "No firmware found for printer %s", printer_connection)
continue
@pyqtSlot(str, result = bool)
@ -154,6 +164,7 @@ class USBPrinterManager(QObject, SignalEmitter, OutputDevicePlugin, Extension):
connection = PrinterConnection.PrinterConnection(serial_port)
connection.connect()
connection.connectionStateChanged.connect(self._onPrinterConnectionStateChanged)
connection.progressChanged.connect(self.progressChanged)
self._printer_connections[serial_port] = connection
def _onPrinterConnectionStateChanged(self, serial_port):