Moved totalExtrusion calculation into existing branches, added calculation of currentE for relative extruders (in case GCODE switches back to absolute)
parent
766e9f0e7f
commit
c1f2866a94
|
@ -154,16 +154,15 @@ class gcode(object):
|
||||||
moveType = 'extrude'
|
moveType = 'extrude'
|
||||||
if e < currentE:
|
if e < currentE:
|
||||||
moveType = 'retract'
|
moveType = 'retract'
|
||||||
|
totalExtrusion += e - currentE
|
||||||
|
currentE = e
|
||||||
else:
|
else:
|
||||||
if e > 0:
|
if e > 0:
|
||||||
moveType = 'extrude'
|
moveType = 'extrude'
|
||||||
if e < 0:
|
if e < 0:
|
||||||
moveType = 'retract'
|
moveType = 'retract'
|
||||||
if posAbsExtruder:
|
|
||||||
totalExtrusion += e - currentE
|
|
||||||
currentE = e
|
|
||||||
else:
|
|
||||||
totalExtrusion += e
|
totalExtrusion += e
|
||||||
|
currentE += e
|
||||||
if totalExtrusion > maxExtrusion:
|
if totalExtrusion > maxExtrusion:
|
||||||
maxExtrusion = totalExtrusion
|
maxExtrusion = totalExtrusion
|
||||||
if moveType == 'move' and oldPos.z != pos.z:
|
if moveType == 'move' and oldPos.z != pos.z:
|
||||||
|
|
Loading…
Reference in New Issue