From: daid Date: Fri, 16 Mar 2012 12:43:49 +0000 (+0100) Subject: Report actual amount of filament pressed forward, even after final retraction. X-Git-Tag: RC1~77 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=d271198e48203f2cd0eed1dffdd44e88a7b8aca1;p=cura.git Report actual amount of filament pressed forward, even after final retraction. --- diff --git a/SkeinPyPy_NewUI/newui/gcodeInterpreter.py b/SkeinPyPy_NewUI/newui/gcodeInterpreter.py index ea9ed5ab..f9f4ed74 100644 --- a/SkeinPyPy_NewUI/newui/gcodeInterpreter.py +++ b/SkeinPyPy_NewUI/newui/gcodeInterpreter.py @@ -12,6 +12,7 @@ class gcode(): posOffset = util3d.Vector3() currentE = 0.0 totalExtrusion = 0.0 + maxExtrusion = 0.0 pathList = [] scale = 1.0 posAbs = True @@ -69,6 +70,8 @@ class gcode(): moveType = 'retract' totalExtrusion += e currentE += e + if totalExtrusion > maxExtrusion: + maxExtrusion = totalExtrusion if currentPath['type'] != moveType or currentPath['pathType'] != pathType: pathList.append(currentPath) currentPath = {'type': moveType, 'pathType': pathType, 'list': [currentPath['list'][-1]], 'layerNr': layerNr} @@ -134,8 +137,8 @@ class gcode(): print "Unknown M code:" + str(M) self.layerCount = layerNr self.pathList = pathList - self.totalExtrusion = totalExtrusion - print "Extruded a total of: %d mm of filament" % (self.totalExtrusion) + self.extrusionAmount = extrusionAmount + print "Extruded a total of: %d mm of filament" % (self.extrusionAmount) def getCodeInt(self, str, id): m = re.search(id + '([^\s]+)', str)