Commit d0a0ffbd authored by Guillaume Seguin's avatar Guillaume Seguin

Fix and cleanup used filament length measurement

parent 1dcf7be5
...@@ -303,17 +303,17 @@ class GCode(object): ...@@ -303,17 +303,17 @@ class GCode(object):
cur_e = 0 cur_e = 0
for line in self.lines: for line in self.lines:
if line.e != None:
continue
if line.command() == "G92": if line.command() == "G92":
if line.e != None: cur_e = line.e
total_e += cur_e elif line.is_move():
cur_e = line.e
elif line.is_move() and line.e:
if line.relative_e: if line.relative_e:
cur_e += line.e total_e += line.e
else: else:
total_e += line.e - cur_e
cur_e = line.e cur_e = line.e
return total_e return total_e
......
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