Add diff part to retract too because of things like G1 X-10 Y-10 Z1 E-5

(cherry picked from commit de325c3)
This commit is contained in:
Salandora 2016-07-01 18:28:50 +02:00 committed by Gina Häußge
parent 6e42e3e0ef
commit 2ae2405792

View file

@ -164,7 +164,12 @@ class gcode(object):
time2 = abs(e / feedRateXY)
totalMoveTimeMinute += max(time1, time2)
elif moveType == "retract":
totalMoveTimeMinute += abs(e / feedRateXY)
diffX = oldPos[0] - pos[0]
diffY = oldPos[1] - pos[1]
diffZ = oldPos[1] - pos[1]
time1 = math.sqrt(diffX * diffX + diffY * diffY + diffZ * diffZ) / feedRateXY
time2 = abs(e / feedRateXY)
totalMoveTimeMinute += max(time1, time2)
if moveType == 'move' and oldPos[2] != pos[2]:
if oldPos[2] > pos[2] and abs(oldPos[2] - pos[2]) > 5.0 and pos[2] < 1.0: