Skip to content

Commit 08fae9c

Browse files
committed
fixes #591
1 parent 20b6e4d commit 08fae9c

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/astroprint/printer/marlin/comm.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def getStateString(self):
235235
return "Closed with Error: %s" % (self.getShortErrorString())
236236
#if self._state == self.STATE_TRANSFERING_FILE:
237237
# return "Transfering file to SD"
238-
if self._state == self. STATE_NOT_READY_TO_PRINT:
238+
if self._state == self.STATE_NOT_READY_TO_PRINT:
239239
return "Not ready to print"
240240
return "?%d?" % (self._state)
241241

@@ -256,6 +256,9 @@ def isClosedOrError(self):
256256
def isError(self):
257257
return self._state == self.STATE_ERROR or self._state == self.STATE_CLOSED_WITH_ERROR
258258

259+
def isWaitingForBedClean(self):
260+
return self._state == self.STATE_NOT_READY_TO_PRINT
261+
259262
def isOperational(self):
260263
return self._state == self.STATE_OPERATIONAL or self._state == self.STATE_PRINTING or self._state == self.STATE_PAUSED #or self._state == self.STATE_TRANSFERING_FILE
261264

@@ -361,7 +364,7 @@ def sendCommand(self, cmd):
361364
cmd = cmd.encode('ascii', 'replace')
362365
if self.isPrinting() or self._pauseInProgress:
363366
self._commandQueue.appendleft(cmd)
364-
elif self.isOperational():
367+
elif self.isOperational() or self.isWaitingForBedClean():
365368
self._sendCommand(cmd)
366369

367370
def startPrint(self):
@@ -982,7 +985,7 @@ def _monitor(self):
982985
self._callback.disconnect()
983986

984987
### Operational
985-
elif self._state == self.STATE_OPERATIONAL or self._state == self.STATE_PAUSED:
988+
elif self._state in [self.STATE_OPERATIONAL, self.STATE_PAUSED, self.STATE_NOT_READY_TO_PRINT]:
986989
#Request the temperature on comm timeout (every 5 seconds) when we are not printing.
987990
if line == "" or "wait" in lineLower or "ok" in lineLower:
988991
if self._resendDelta is not None:

src/astroprint/printer/s3g/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def getStateString(self):
9696
return "Closed with Error: %s" % (self.getShortErrorString())
9797
if self._state == self.STATE_TRANSFERING_FILE:
9898
return "Transfering file to SD"
99-
if self._state == self. STATE_NOT_READY_TO_PRINT:
99+
if self._state == self.STATE_NOT_READY_TO_PRINT:
100100
return "Not ready to print"
101101
return "?%d?" % (self._state)
102102

0 commit comments

Comments
 (0)