Commit e0747488 authored by Guillaume Seguin's avatar Guillaume Seguin

Start merging GCoder with GCodeAnalyzer

parent 0e24f2b5
...@@ -34,6 +34,7 @@ import gcoder ...@@ -34,6 +34,7 @@ import gcoder
class GCodeAnalyzer(): class GCodeAnalyzer():
def __init__(self): def __init__(self):
self.gcoder = gcoder.GCode([])
self.x = 0 self.x = 0
self.y = 0 self.y = 0
self.z = 0 self.z = 0
...@@ -61,8 +62,7 @@ class GCodeAnalyzer(): ...@@ -61,8 +62,7 @@ class GCodeAnalyzer():
self.hasHomeZ = False self.hasHomeZ = False
def Analyze(self, gcode): def Analyze(self, gcode):
gline = gcoder.Line(gcode) gline = self.gcoder.append(gcode, store = False)
split_raw = gcoder.split(gline)
if gline.command.startswith(";@"): return # code is a host command if gline.command.startswith(";@"): return # code is a host command
try: try:
code_g = int(gline.command[1:]) if gline.command.startswith("G") else None code_g = int(gline.command[1:]) if gline.command.startswith("G") else None
...@@ -71,7 +71,6 @@ class GCodeAnalyzer(): ...@@ -71,7 +71,6 @@ class GCodeAnalyzer():
# If we fail to parse the code number, this is probably not a # If we fail to parse the code number, this is probably not a
# standard G-Code but rather a host command, so return immediately # standard G-Code but rather a host command, so return immediately
return return
gcoder.parse_coordinates(gline, split_raw, self.imperial)
#get movement codes #get movement codes
if gline.is_move: if gline.is_move:
......
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