Fix used filament estimation

Compute the max of all total lengths
master
Guillaume Seguin 2013-05-18 20:20:53 +02:00
parent c6104d56ef
commit 06e3a02d4f
1 changed files with 4 additions and 2 deletions

View File

@ -235,7 +235,8 @@ class GCode(object):
self.height = zmax - zmin
def filament_length(self):
total_e = 0
total_e = 0
max_e = 0
cur_e = 0
for line in self.lines:
@ -249,8 +250,9 @@ class GCode(object):
else:
total_e += line.e - cur_e
cur_e = line.e
max_e = max(max_e, total_e)
return total_e
return max_e
def estimate_duration(self):
lastx = lasty = lastz = laste = lastf = 0.0