Hibernate communication with printer during active G4 on Repetier

Should hopefully solve #1506
This commit is contained in:
Gina Häußge committed 2017-02-17 13:52:16 +01:00
1 parent 7beabf953c
commit 216f05d553
6 files changed
+52 -7

No files matched your search

@@ -92,6 +92,7 @@ class VirtualPrinter(object):
self._supportF = settings().getBoolean(["devel", "virtualPrinter", "supportF"])
self._sendWait = settings().getBoolean(["devel", "virtualPrinter", "sendWait"])
self._sendBusy = settings().getBoolean(["devel", "virtualPrinter", "sendBusy"])
self._waitInterval = settings().getFloat(["devel", "virtualPrinter", "waitInterval"])
self._echoOnM117 = settings().getBoolean(["devel", "virtualPrinter", "echoOnM117"])
@@ -451,6 +452,24 @@ class VirtualPrinter(object):
_gcode_G2 = _gcode_G0
_gcode_G3 = _gcode_G0
def _gcode_G4(self, data):
matchS = re.search('S([0-9]+)', data)
matchP = re.search('P([0-9]+)', data)
_timeout = 0
if matchP:
_timeout = float(matchP.group(1)) / 1000.0
elif matchS:
_timeout = float(matchS.group(1))
if self._sendBusy:
until = time.time() + _timeout
while time.time() < until:
time.sleep(1.0)
self._send("busy:processing")
else:
time.sleep(_timeout)
##~~ further helpers
def _calculate_checksum(self, line):