From d667a0ff56c7edec93f6dd89be1755be1911620c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20=27Ax=27=20H=C5=AFla?= Date: Fri, 1 Mar 2013 17:55:25 +0100 Subject: [PATCH] Fix filament measurement for relative extruders --- octoprint/util/gcodeInterpreter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/octoprint/util/gcodeInterpreter.py b/octoprint/util/gcodeInterpreter.py index f515c2b..e272a1f 100644 --- a/octoprint/util/gcodeInterpreter.py +++ b/octoprint/util/gcodeInterpreter.py @@ -159,8 +159,11 @@ class gcode(object): moveType = 'extrude' if e < 0: moveType = 'retract' - totalExtrusion += e - currentE - currentE = e + if posAbsExtruder: + totalExtrusion += e - currentE + currentE = e + else: + totalExtrusion += e if totalExtrusion > maxExtrusion: maxExtrusion = totalExtrusion if moveType == 'move' and oldPos.z != pos.z: