diff --git a/octoprint/printer.py b/octoprint/printer.py index 5b4f3c8..3f64d56 100644 --- a/octoprint/printer.py +++ b/octoprint/printer.py @@ -177,6 +177,7 @@ class Printer(): if (self._comm is not None and self._comm.isPrinting()) or (self._gcodeLoader is not None): return + self._sdFile = None self._setJobData(None, None) onGcodeLoadedCallback = self._onGcodeLoaded diff --git a/octoprint/util/comm.py b/octoprint/util/comm.py index 01c77f7..207eb74 100644 --- a/octoprint/util/comm.py +++ b/octoprint/util/comm.py @@ -781,6 +781,8 @@ class MachineCom(object): def printGCode(self, gcodeList): if not self.isOperational() or self.isPrinting(): return + if self._sdPrinting: + self._sdPrinting = False self._gcodeList = gcodeList self._gcodePos = 0 self._printSection = 'CUSTOM' @@ -814,6 +816,7 @@ class MachineCom(object): if self.isOperational(): self._changeState(self.STATE_OPERATIONAL) if self._sdPrinting: + self._sdPrinting = False self.sendCommand("M25") # pause print self.sendCommand("M26 S0") # reset position in file to byte 0 @@ -838,12 +841,6 @@ class MachineCom(object): result.update(self._feedRateModifier) return result - def enableSdPrinting(self, enable): - if self.isPrinting(): - return - - self._sdPrinting = enable - def getSdFiles(self): return self._sdFiles