From 88af79509ffefdf6a64097caff90323392a7dbc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 22 Apr 2015 11:41:52 +0200 Subject: [PATCH] Delect selected files upon comm disconnect in the printer handler Should solve #861 --- src/octoprint/printer/standard.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/octoprint/printer/standard.py b/src/octoprint/printer/standard.py index 5d248cda..03e169cd 100644 --- a/src/octoprint/printer/standard.py +++ b/src/octoprint/printer/standard.py @@ -762,6 +762,13 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback): self._analysisQueue.resume() # printing done, put those cpu cycles to good use elif self._comm is not None and state == self._comm.STATE_PRINTING: self._analysisQueue.pause() # do not analyse files while printing + elif state == self._comm.STATE_CLOSED or state == self._comm.STATE_CLOSED_WITH_ERROR: + if self._comm is not None: + self._comm = None + + self._setProgressData(0, None, None, None) + self._setCurrentZ(None) + self._setJobData(None, None, None) self._setState(state)