Cancel the print when the printer sends message (b'!!') about a fatal error.

This commit is contained in:
Simon Lundell 2018-02-23 18:19:11 +01:00
parent b1be25e8d8
commit b3f0292ce6

View file

@ -298,6 +298,9 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
self._printers[0].updateTargetBedTemperature(float(match[1]))
if self._is_printing:
if line.startswith(b'!!'):
Logger.log('e', "Printer signals fatal error. Cancelling print. {}".format(line))
self.cancelPrint()
if b"ok" in line:
if not self._command_queue.empty():
self._sendCommand(self._command_queue.get())