Commit 7f69b8d4 authored by Guillaume Seguin's avatar Guillaume Seguin

Fix #474 (G4 parsing was lagging behind gcoder changes)

parent e6fc52ae
...@@ -494,11 +494,12 @@ class GCode(object): ...@@ -494,11 +494,12 @@ class GCode(object):
if line.command not in ["G1", "G0", "G4"]: if line.command not in ["G1", "G0", "G4"]:
continue continue
if line.command == "G4": if line.command == "G4":
moveduration = line.p moveduration = P(line)
if not moveduration: if not moveduration:
continue continue
else: else:
moveduration /= 1000.0 moveduration /= 1000.0
totalduration += moveduration
else: else:
x = line.x if line.x is not None else lastx x = line.x if line.x is not None else lastx
y = line.y if line.y is not None else lasty y = line.y if line.y is not None else lasty
...@@ -552,13 +553,13 @@ class GCode(object): ...@@ -552,13 +553,13 @@ class GCode(object):
lastdx = dx lastdx = dx
lastdy = dy lastdy = dy
totalduration += moveduration totalduration += moveduration
lastx = x lastx = x
lasty = y lasty = y
lastz = z lastz = z
laste = e laste = e
lastf = f lastf = f
layer.duration = totalduration - layerbeginduration layer.duration = totalduration - layerbeginduration
layerbeginduration = totalduration layerbeginduration = totalduration
......
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