Merge remote-tracking branch 'origin/maintenance' into maintenance

This commit is contained in:
Gina Häußge committed 2019-03-18 17:06:26 +01:00
commit 6e069211cc
8 files changed
+125 -70

No files matched your search

@@ -628,7 +628,7 @@ class VirtualPrinter(object):
self._setPosition(data)
def _gcode_G28(self, data):
self._performMove(data)
self._home(data)
def _gcode_G0(self, data):
# simulate reprap buffered commands via a Queue with maxsize which internally simulates the moves
@@ -1056,10 +1056,10 @@ class VirtualPrinter(object):
self._waitForHeatup("chamber", only_wait_if_higher)
def _performMove(self, line):
matchX = re.search("X([0-9.]+)", line)
matchY = re.search("Y([0-9.]+)", line)
matchZ = re.search("Z([0-9.]+)", line)
matchE = re.search("E([0-9.]+)", line)
matchX = re.search("X(-?[0-9.]+)", line)
matchY = re.search("Y(-?[0-9.]+)", line)
matchZ = re.search("Z(-?[0-9.]+)", line)
matchE = re.search("E(-?[0-9.]+)", line)
matchF = re.search("F([0-9.]+)", line)
duration = 0.0
@@ -1141,10 +1141,10 @@ class VirtualPrinter(object):
time.sleep(duration)
def _setPosition(self, line):
matchX = re.search("X([0-9.]+)", line)
matchY = re.search("Y([0-9.]+)", line)
matchZ = re.search("Z([0-9.]+)", line)
matchE = re.search("E([0-9.]+)", line)
matchX = re.search("X(-?[0-9.]+)", line)
matchY = re.search("Y(-?[0-9.]+)", line)
matchZ = re.search("Z(-?[0-9.]+)", line)
matchE = re.search("E(-?[0-9.]+)", line)
if matchX is None and matchY is None and matchZ is None and matchE is None:
self._lastX = self._lastY = self._lastZ = self._lastE[self.currentExtruder] = 0
@@ -1170,6 +1170,30 @@ class VirtualPrinter(object):
except:
pass
def _home(self, line):
x = y = z = e = None
if "X" in line:
x = True
if "Y" in line:
y = True
if "Z" in line:
z = True
if "E" in line:
e = True
if x is None and y is None and z is None and e is None:
self._lastX = self._lastY = self._lastZ = self._lastE[self.currentExtruder] = 0
else:
if x:
self._lastX = 0
if y:
self._lastY = 0
if z:
self._lastZ = 0
if e:
self._lastE = 0
def _writeSdFile(self, filename):
if filename.startswith("/"):
filename = filename[1:]