Commit 1fec6357 authored by Guillaume Seguin's avatar Guillaume Seguin

Merge branch 'experimental' of github.com:kliment/Printrun into experimental

parents a4759865 d8277e61
...@@ -185,7 +185,6 @@ class gviz(wx.Panel): ...@@ -185,7 +185,6 @@ class gviz(wx.Panel):
def layerdown(self): def layerdown(self):
if self.layerindex > 0: if self.layerindex > 0:
self.layerindex -= 1 self.layerindex -= 1
# Display layer info on statusbar (Jezmy)
self.parent.SetStatusText("Layer %d - Going Down - Z = %.03f mm" % (self.layerindex + 1, self.layers[self.layerindex]), 0) self.parent.SetStatusText("Layer %d - Going Down - Z = %.03f mm" % (self.layerindex + 1, self.layers[self.layerindex]), 0)
self.dirty = 1 self.dirty = 1
wx.CallAfter(self.Refresh) wx.CallAfter(self.Refresh)
...@@ -353,7 +352,6 @@ class gviz(wx.Panel): ...@@ -353,7 +352,6 @@ class gviz(wx.Panel):
arc = [_x(start_pos[0]), _y(start_pos[1]), arc = [_x(start_pos[0]), _y(start_pos[1]),
_x(target[0]), _y(target[1]), _x(target[0]), _y(target[1]),
_x(start_pos[0] + target[5]), _y(start_pos[1] + target[6])] _x(start_pos[0] + target[5]), _y(start_pos[1] + target[6])]
# FIXME : verify this works : why not reverse endpoints 4, 5
if gline.command == "G2": # clockwise, reverse endpoints if gline.command == "G2": # clockwise, reverse endpoints
arc[0], arc[1], arc[2], arc[3] = arc[2], arc[3], arc[0], arc[1] arc[0], arc[1], arc[2], arc[3] = arc[2], arc[3], arc[0], arc[1]
...@@ -378,12 +376,12 @@ class gviz(wx.Panel): ...@@ -378,12 +376,12 @@ class gviz(wx.Panel):
def _x(x): def _x(x):
return x - self.build_dimensions[3] return x - self.build_dimensions[3]
start_pos = self.hilightpos[:] if hilight else self.lastpos[:]
if gline.command not in ["G0", "G1", "G2", "G3"]: if gline.command not in ["G0", "G1", "G2", "G3"]:
return return
target = self.hilightpos[:] if hilight else self.lastpos[:] start_pos = self.hilightpos[:] if hilight else self.lastpos[:]
target = start_pos[:]
target[5] = 0.0 target[5] = 0.0
target[6] = 0.0 target[6] = 0.0
if gline.x != None: target[0] = gline.x if gline.x != None: target[0] = gline.x
...@@ -417,6 +415,7 @@ class gviz(wx.Panel): ...@@ -417,6 +415,7 @@ class gviz(wx.Panel):
if gline.command == "G2": # clockwise, reverse endpoints if gline.command == "G2": # clockwise, reverse endpoints
arc[0], arc[1], arc[2], arc[3] = arc[2], arc[3], arc[0], arc[1] arc[0], arc[1], arc[2], arc[3] = arc[2], arc[3], arc[0], arc[1]
if not hilight:
self.arcs[z].append(arc) self.arcs[z].append(arc)
self.arcpens[z].append(self.arcpen) self.arcpens[z].append(self.arcpen)
else: else:
......
...@@ -121,7 +121,7 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -121,7 +121,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self.skeinp = None self.skeinp = None
self.monitor_interval = 3 self.monitor_interval = 3
self.paused = False self.paused = False
self.sentlines = Queue.Queue(30) self.sentlines = Queue.Queue(0)
self.cpbuttons = [ self.cpbuttons = [
SpecialButton(_("Motors off"), ("M84"), (250, 250, 250), None, 0, _("Switch all motors off")), SpecialButton(_("Motors off"), ("M84"), (250, 250, 250), None, 0, _("Switch all motors off")),
SpecialButton(_("Check temp"), ("M105"), (225, 200, 200), (2, 5), (1, 1), _("Check current hotend temperature")), SpecialButton(_("Check temp"), ("M105"), (225, 200, 200), (2, 5), (1, 1), _("Check current hotend temperature")),
...@@ -256,7 +256,7 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -256,7 +256,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
pass pass
try: try:
self.sentlines.put_nowait(line) self.sentlines.put_nowait(line)
except: except Queue.Full:
pass pass
#threading.Thread(target = self.gviz.addgcode, args = (line, 1)).start() #threading.Thread(target = self.gviz.addgcode, args = (line, 1)).start()
#self.gwindow.p.addgcode(line, hilight = 1) #self.gwindow.p.addgcode(line, hilight = 1)
...@@ -1091,11 +1091,8 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -1091,11 +1091,8 @@ class PronterWindow(MainWindow, pronsole.pronsole):
break break
time.sleep(0.25) time.sleep(0.25)
while not self.sentlines.empty(): while not self.sentlines.empty():
try:
gc = self.sentlines.get_nowait() gc = self.sentlines.get_nowait()
wx.CallAfter(self.gviz.addgcode, gc, 1) wx.CallAfter(self.gviz.addgcode, gc, 1)
except:
break
wx.CallAfter(self.status.SetStatusText, _("Not connected to printer.")) wx.CallAfter(self.status.SetStatusText, _("Not connected to printer."))
def capture(self, func, *args, **kwargs): def capture(self, func, *args, **kwargs):
......
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