From: Daid Date: Tue, 19 Jun 2012 19:57:16 +0000 (+0200) Subject: Added G4 to GCode reader. Fixes #132 X-Git-Tag: 12.07~41 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=21a71f288e1bf9d181712f7c1382ced06c236295;p=cura.git Added G4 to GCode reader. Fixes #132 --- diff --git a/.gitignore b/.gitignore index 78b5a669..2bd3ae3e 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,6 @@ Cura/preferences.ini cura.sh pypy python -drivers printrun.bat cura.bat object-mirror.png diff --git a/Cura/util/gcodeInterpreter.py b/Cura/util/gcodeInterpreter.py index b7150505..2d92e9fc 100644 --- a/Cura/util/gcodeInterpreter.py +++ b/Cura/util/gcodeInterpreter.py @@ -158,6 +158,13 @@ class gcode(object): newPos = pos.copy() newPos.e = totalExtrusion currentPath.list.append(newPos) + elif G == 4: #Delay + S = self.getCodeFloat(line, 'S') + if S is not None: + totalMoveTimeMinute += S / 60 + P = self.getCodeFloat(line, 'P') + if P is not None: + totalMoveTimeMinute += P / 60 / 1000 elif G == 20: #Units are inches scale = 25.4 elif G == 21: #Units are mm