Properly restart sd prints

Fixes #258
This commit is contained in:
Gina Häußge 2013-09-23 21:57:54 +02:00
parent 8ff48ed88d
commit 076c6764a0

View file

@ -331,6 +331,7 @@ class MachineCom(object):
if self._currentFile is None: if self._currentFile is None:
raise ValueError("No file selected for printing") raise ValueError("No file selected for printing")
wasPaused = self.isPaused()
self._printSection = "CUSTOM" self._printSection = "CUSTOM"
self._changeState(self.STATE_PRINTING) self._changeState(self.STATE_PRINTING)
eventManager().fire("PrintStarted", self._currentFile.getFilename()) eventManager().fire("PrintStarted", self._currentFile.getFilename())
@ -338,7 +339,7 @@ class MachineCom(object):
try: try:
self._currentFile.start() self._currentFile.start()
if self.isSdFileSelected(): if self.isSdFileSelected():
if self.isPaused(): if wasPaused:
self.sendCommand("M26 S0") self.sendCommand("M26 S0")
self._currentFile.setFilepos(0) self._currentFile.setFilepos(0)
self.sendCommand("M24") self.sendCommand("M24")