Prevents manual commands from interupting other commands
parent
456ded3f36
commit
9b2d166c6c
|
@ -197,7 +197,7 @@ class MachineCom(object):
|
||||||
self._currentLine = 1
|
self._currentLine = 1
|
||||||
self._resendDelta = None
|
self._resendDelta = None
|
||||||
self._lastLines = []
|
self._lastLines = []
|
||||||
|
self._sending = False
|
||||||
self.thread = threading.Thread(target=self._monitor)
|
self.thread = threading.Thread(target=self._monitor)
|
||||||
self.thread.daemon = True
|
self.thread.daemon = True
|
||||||
self.thread.start()
|
self.thread.start()
|
||||||
|
@ -537,6 +537,10 @@ class MachineCom(object):
|
||||||
|
|
||||||
def _sendCommand(self, cmd, sendChecksum=False):
|
def _sendCommand(self, cmd, sendChecksum=False):
|
||||||
cmd = cmd.upper()
|
cmd = cmd.upper()
|
||||||
|
#Wait for current send to finish.
|
||||||
|
while self._sending:
|
||||||
|
pass
|
||||||
|
self._sending = True
|
||||||
if self._serial is None:
|
if self._serial is None:
|
||||||
return
|
return
|
||||||
if 'M109' in cmd or 'M190' in cmd:
|
if 'M109' in cmd or 'M190' in cmd:
|
||||||
|
@ -621,6 +625,8 @@ class MachineCom(object):
|
||||||
self._log("Unexpected error while writing serial port: %s" % (getExceptionString()))
|
self._log("Unexpected error while writing serial port: %s" % (getExceptionString()))
|
||||||
self._errorValue = getExceptionString()
|
self._errorValue = getExceptionString()
|
||||||
self.close(True)
|
self.close(True)
|
||||||
|
#clear sending flag
|
||||||
|
self._sending = False
|
||||||
|
|
||||||
def _sendNext(self):
|
def _sendNext(self):
|
||||||
if self._gcodePos >= len(self._gcodeList):
|
if self._gcodePos >= len(self._gcodeList):
|
||||||
|
|
Loading…
Reference in New Issue