Moved totalExtrusion calculation into existing branches, added calculation of currentE for relative extruders (in case GCODE switches back to absolute)

master
Gina Häußge 2013-03-02 13:39:44 +01:00
parent 766e9f0e7f
commit c1f2866a94
1 changed files with 3 additions and 4 deletions

View File

@ -154,16 +154,15 @@ class gcode(object):
moveType = 'extrude'
if e < currentE:
moveType = 'retract'
totalExtrusion += e - currentE
currentE = e
else:
if e > 0:
moveType = 'extrude'
if e < 0:
moveType = 'retract'
if posAbsExtruder:
totalExtrusion += e - currentE
currentE = e
else:
totalExtrusion += e
currentE += e
if totalExtrusion > maxExtrusion:
maxExtrusion = totalExtrusion
if moveType == 'move' and oldPos.z != pos.z: