Commit bb40ce9c authored by Guillaume Seguin's avatar Guillaume Seguin

Name extruders starting from 0 and bind tool selector

parent 4423c7a0
......@@ -141,12 +141,13 @@ def add_extra_controls(self, root, parentpanel, extra_buttons = None):
ebuttonssizer = wx.BoxSizer(wx.HORIZONTAL)
if root.settings.extruders > 1:
ebuttonssizer.Add(wx.StaticText(ebuttonspanel, -1, _("Tool:")), flag = wx.ALIGN_CENTER)
choices = [str(i) for i in range(1, root.settings.extruders + 1)]
choices = [str(i) for i in range(0, root.settings.extruders)]
root.extrudersel = wx.ComboBox(ebuttonspanel, -1, choices = choices,
style = wx.CB_DROPDOWN | wx.CB_READONLY,
size = (50, -1))
root.extrudersel.SetToolTip(wx.ToolTip("Select current extruder"))
root.extrudersel.SetValue("1")
root.extrudersel.SetValue(choices[0])
root.extrudersel.Bind(wx.EVT_COMBOBOX, root.tool_change)
ebuttonssizer.Add(root.extrudersel)
ebuttonspanel.SetSizer(ebuttonssizer)
self.Add(ebuttonspanel, pos = (base_line + 2, 0), span = (1, 5), flag = wx.EXPAND)
......
......@@ -842,6 +842,11 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self.do_bedtemp("")
wx.CallAfter(self.btemp.SetInsertionPoint, 0)
def tool_change(self, event):
new_tool = int(self.extrudersel.GetValue())
if self.p.online:
self.p.send_now("T%d" % new_tool)
def showwin(self, event):
if self.fgcode:
self.gwindow.Show(True)
......
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