Properly switch between file and sd printing
parent
45fef79e3d
commit
bb954c50d2
|
@ -177,6 +177,7 @@ class Printer():
|
||||||
if (self._comm is not None and self._comm.isPrinting()) or (self._gcodeLoader is not None):
|
if (self._comm is not None and self._comm.isPrinting()) or (self._gcodeLoader is not None):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self._sdFile = None
|
||||||
self._setJobData(None, None)
|
self._setJobData(None, None)
|
||||||
|
|
||||||
onGcodeLoadedCallback = self._onGcodeLoaded
|
onGcodeLoadedCallback = self._onGcodeLoaded
|
||||||
|
|
|
@ -781,6 +781,8 @@ class MachineCom(object):
|
||||||
def printGCode(self, gcodeList):
|
def printGCode(self, gcodeList):
|
||||||
if not self.isOperational() or self.isPrinting():
|
if not self.isOperational() or self.isPrinting():
|
||||||
return
|
return
|
||||||
|
if self._sdPrinting:
|
||||||
|
self._sdPrinting = False
|
||||||
self._gcodeList = gcodeList
|
self._gcodeList = gcodeList
|
||||||
self._gcodePos = 0
|
self._gcodePos = 0
|
||||||
self._printSection = 'CUSTOM'
|
self._printSection = 'CUSTOM'
|
||||||
|
@ -814,6 +816,7 @@ class MachineCom(object):
|
||||||
if self.isOperational():
|
if self.isOperational():
|
||||||
self._changeState(self.STATE_OPERATIONAL)
|
self._changeState(self.STATE_OPERATIONAL)
|
||||||
if self._sdPrinting:
|
if self._sdPrinting:
|
||||||
|
self._sdPrinting = False
|
||||||
self.sendCommand("M25") # pause print
|
self.sendCommand("M25") # pause print
|
||||||
self.sendCommand("M26 S0") # reset position in file to byte 0
|
self.sendCommand("M26 S0") # reset position in file to byte 0
|
||||||
|
|
||||||
|
@ -838,12 +841,6 @@ class MachineCom(object):
|
||||||
result.update(self._feedRateModifier)
|
result.update(self._feedRateModifier)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def enableSdPrinting(self, enable):
|
|
||||||
if self.isPrinting():
|
|
||||||
return
|
|
||||||
|
|
||||||
self._sdPrinting = enable
|
|
||||||
|
|
||||||
def getSdFiles(self):
|
def getSdFiles(self):
|
||||||
return self._sdFiles
|
return self._sdFiles
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue