Commit c317d3e2 authored by D1plo1d's avatar D1plo1d

Adding a option to disable the horribly slow gcode parser

parent 461fa29f
......@@ -155,14 +155,15 @@ class GCode(object):
depth = None
height = None
def __init__(self,data):
def __init__(self,data, preprocess = True):
self.lines = [Line(l2) for l2 in
(l.strip() for l in data)
if l2]
self._preprocess_lines()
self.filament_length = self._preprocess_extrusion()
self._create_layers()
self._preprocess_layers()
if preprocess == True:
self._preprocess_lines()
self.filament_length = self._preprocess_extrusion()
self._create_layers()
self._preprocess_layers()
def __len__(self):
return len(self.line_idxs)
......
......@@ -593,7 +593,8 @@ class Prontserve(pronsole.pronsole, EventEmitter):
elif len(self.jobs.list) > 0:
print "Starting the next print job"
self.current_job = self.jobs.list.pop(0)
gc = gcoder.GCode(self.current_job['body'].split("\n"))
lines = self.current_job['body'].split("\n")
gc = gcoder.GCode(lines, preprocess=False)
self.p.startprint(gc)
self.p.paused = False
self.fire("job_started", self.jobs.sanitize(self.current_job))
......
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