Commit 06e3a02d authored by Guillaume Seguin's avatar Guillaume Seguin

Fix used filament estimation

Compute the max of all total lengths
parent c6104d56
...@@ -235,7 +235,8 @@ class GCode(object): ...@@ -235,7 +235,8 @@ class GCode(object):
self.height = zmax - zmin self.height = zmax - zmin
def filament_length(self): def filament_length(self):
total_e = 0 total_e = 0
max_e = 0
cur_e = 0 cur_e = 0
for line in self.lines: for line in self.lines:
...@@ -249,8 +250,9 @@ class GCode(object): ...@@ -249,8 +250,9 @@ class GCode(object):
else: else:
total_e += line.e - cur_e total_e += line.e - cur_e
cur_e = line.e cur_e = line.e
max_e = max(max_e, total_e)
return total_e return max_e
def estimate_duration(self): def estimate_duration(self):
lastx = lasty = lastz = laste = lastf = 0.0 lastx = lasty = lastz = laste = lastf = 0.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment