Merge remote-tracking branch 'upstream/master' into master-CURA-2079

This commit is contained in:
Thomas Karl Pietrowski 2016-08-14 17:43:26 +02:00
commit 8179fabf1d
11 changed files with 50 additions and 25 deletions

View file

@ -186,7 +186,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
return
programmer = stk500v2.Stk500v2()
programmer.progressCallback = self.setProgress
programmer.progress_callback = self.setProgress
try:
programmer.connect(self._serial_port)
@ -307,7 +307,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
self.setConnectionState(ConnectionState.connected)
self._listen_thread.start() # Start listening
Logger.log("i", "Established printer connection on port %s" % self._serial_port)
return
return
self._sendCommand("M105") # Send M105 as long as we are listening, otherwise we end up in an undefined state
@ -335,7 +335,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
self._connect_thread = threading.Thread(target = self._connect)
self._connect_thread.daemon = True
self.setConnectionState(ConnectionState.closed)
if self._serial is not None:
try:
@ -564,7 +564,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
ret = self._serial.readline()
except Exception as e:
Logger.log("e", "Unexpected error while reading serial port. %s" % e)
self._setErrorState("Printer has been disconnected")
self._setErrorState("Printer has been disconnected")
self.close()
return None
return ret