Try to remove timing issues when preparing next line to send

master
Gina Häußge 2013-05-23 22:37:02 +02:00
parent 245d9651b6
commit da90b2d738
1 changed files with 29 additions and 27 deletions

View File

@ -205,6 +205,7 @@ class MachineCom(object):
self._resendDelta = None
self._lastLines = []
self._sendNextLock = threading.Lock()
self._sendingLock = threading.Lock()
self.thread = threading.Thread(target=self._monitor)
@ -644,6 +645,7 @@ class MachineCom(object):
self.close(True)
def _sendNext(self):
with self._sendNextLock:
if self._gcodePos >= len(self._gcodeList):
self._changeState(self.STATE_OPERATIONAL)
return
@ -686,7 +688,7 @@ class MachineCom(object):
self._printSection = 'CUSTOM'
self._changeState(self.STATE_PRINTING)
self._printStartTime = time.time()
for i in xrange(0, 6):
#for i in xrange(0, 6):
self._sendNext()
def cancelPrint(self):