Commit c8ed2fb3 authored by Guillaume Seguin's avatar Guillaume Seguin

Start refactoring of excluder logic

parent 46c2805d
......@@ -407,17 +407,23 @@ class PronterWindow(MainWindow, pronsole.pronsole):
return
self.sentlines.put_nowait(line)
def preprintsendcb(self, gline):
def is_excluded_move(self, gline):
if not gline.is_move or not self.excluder or not self.excluder.rectangles:
return gline
return False
if gline.x == None and gline.y == None:
return gline
return False
for (x0, y0, x1, y1) in self.excluder.rectangles:
if x0 <= gline.current_x <= x1 and y0 <= gline.current_y <= y1:
return True
return False
def preprintsendcb(self, gline):
if self.is_excluded_move(gline):
if gline.e != None and not gline.relative_e:
return gcoder.Line("G92 E%.5f" % gline.e)
else:
return None
else:
return gline
def printsentcb(self, gline):
......
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