Commit bcc9bf92 authored by Guillaume Seguin's avatar Guillaume Seguin

Use tool command in pronterface and restore tool on connect

parent 643766ff
...@@ -375,6 +375,9 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -375,6 +375,9 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self.connectbtn.SetToolTip(wx.ToolTip("Disconnect from the printer")) self.connectbtn.SetToolTip(wx.ToolTip("Disconnect from the printer"))
self.connectbtn.Bind(wx.EVT_BUTTON, self.disconnect) self.connectbtn.Bind(wx.EVT_BUTTON, self.disconnect)
if hasattr(self, "extrudersel"):
self.do_tool(self.extrudersel.GetValue())
for i in self.printerControls: for i in self.printerControls:
i.Enable() i.Enable()
...@@ -843,9 +846,7 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -843,9 +846,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
wx.CallAfter(self.btemp.SetInsertionPoint, 0) wx.CallAfter(self.btemp.SetInsertionPoint, 0)
def tool_change(self, event): def tool_change(self, event):
new_tool = int(self.extrudersel.GetValue()) self.do_tool(self.extrudersel.GetValue())
if self.p.online:
self.p.send_now("T%d" % new_tool)
def showwin(self, event): def showwin(self, event):
if self.fgcode: if self.fgcode:
......
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