From 21a71f288e1bf9d181712f7c1382ced06c236295 Mon Sep 17 00:00:00 2001 From: Daid Date: Tue, 19 Jun 2012 21:57:16 +0200 Subject: [PATCH] Added G4 to GCode reader. Fixes #132 --- .gitignore | 1 - Cura/util/gcodeInterpreter.py | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 78b5a66..2bd3ae3 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 b715050..2d92e9f 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