Commit 70b68879 authored by kliment's avatar kliment

Merge pull request #269 from Traumflug/experimental

Add debug option to menu
parents 8b83ba62 24e2fa93
# Sample .pronsolerc file - copy this into your home directory and rename it to .pronsolerc # Sample .pronsolerc file - copy this into your home directory and rename it to .pronsolerc
!print "Loaded " + self.rc_filename !print "Loaded " + self.rc_filename
macro loud
!if self.p.loud:
!self.p.loud = 0
!if hasattr(self,"cur_button") and self.cur_button is not None:
!self.onecmd('button %d "loud (off)" /c green loud' % self.cur_button)
!else:
!self.p.loud = 1
!if hasattr(self,"cur_button") and self.cur_button is not None:
!self.onecmd('button %d "loud (on)" /c yellow loud' % self.cur_button)
button 0 "loud (off)" /c "green" loud
macro fan macro fan
!global _fan !global _fan
!if '_fan' in globals() and _fan: !if '_fan' in globals() and _fan:
...@@ -24,4 +13,4 @@ macro fan ...@@ -24,4 +13,4 @@ macro fan
M106 M106
!if hasattr(self,"cur_button") and self.cur_button is not None: !if hasattr(self,"cur_button") and self.cur_button is not None:
!self.onecmd('button %d "fan (on)" /c yellow fan' % self.cur_button) !self.onecmd('button %d "fan (on)" /c yellow fan' % self.cur_button)
button 1 "fan (off)" /c "green" fan button 0 "fan (off)" /c "green" fan
...@@ -874,14 +874,16 @@ class pronsole(cmd.Cmd): ...@@ -874,14 +874,16 @@ class pronsole(cmd.Cmd):
def default(self,l): def default(self,l):
if(l[0] in self.commandprefixes.upper()): if(l[0] in self.commandprefixes.upper()):
if(self.p and self.p.online): if(self.p and self.p.online):
print "SENDING:"+l if(not self.p.loud):
print "SENDING:"+l
self.p.send_now(l) self.p.send_now(l)
else: else:
print "Printer is not online." print "Printer is not online."
return return
elif(l[0] in self.commandprefixes.lower()): elif(l[0] in self.commandprefixes.lower()):
if(self.p and self.p.online): if(self.p and self.p.online):
print "SENDING:"+l.upper() if(not self.p.loud):
print "SENDING:"+l.upper()
self.p.send_now(l.upper()) self.p.send_now(l.upper())
else: else:
print "Printer is not online." print "Printer is not online."
......
...@@ -436,6 +436,12 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -436,6 +436,12 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.Bind(wx.EVT_MENU, lambda *e:options(self), m.Append(-1,_("&Options"),_(" Options dialog"))) self.Bind(wx.EVT_MENU, lambda *e:options(self), m.Append(-1,_("&Options"),_(" Options dialog")))
self.Bind(wx.EVT_MENU, lambda x:threading.Thread(target=lambda :self.do_skein("set")).start(), m.Append(-1,_("Slicing Settings"),_(" Adjust slicing settings"))) self.Bind(wx.EVT_MENU, lambda x:threading.Thread(target=lambda :self.do_skein("set")).start(), m.Append(-1,_("Slicing Settings"),_(" Adjust slicing settings")))
mItem = m.AppendCheckItem(-1, _("Debug G-code"),
_("Print all G-code sent to and received from the printer."))
m.Check(mItem.GetId(), self.p.loud)
self.Bind(wx.EVT_MENU, self.setloud, mItem)
#try: #try:
# from SkeinforgeQuickEditDialog import SkeinforgeQuickEditDialog # from SkeinforgeQuickEditDialog import SkeinforgeQuickEditDialog
# self.Bind(wx.EVT_MENU, lambda *e:SkeinforgeQuickEditDialog(self), m.Append(-1,_("SFACT Quick Settings"),_(" Quickly adjust SFACT settings for active profile"))) # self.Bind(wx.EVT_MENU, lambda *e:SkeinforgeQuickEditDialog(self), m.Append(-1,_("SFACT Quick Settings"),_(" Quickly adjust SFACT settings for active profile")))
...@@ -543,14 +549,15 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -543,14 +549,15 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.rescanbtn=wx.Button(self.panel,-1,_("Port"),size=buttonSize) self.rescanbtn=wx.Button(self.panel,-1,_("Port"),size=buttonSize)
self.rescanbtn.SetToolTip(wx.ToolTip("Communication Settings\nClick to rescan ports")) self.rescanbtn.SetToolTip(wx.ToolTip("Communication Settings\nClick to rescan ports"))
self.rescanbtn.Bind(wx.EVT_BUTTON,self.rescanports) self.rescanbtn.Bind(wx.EVT_BUTTON,self.rescanports)
uts.Add(self.rescanbtn,0,wx.TOP|wx.LEFT,0) uts.Add(self.rescanbtn,0,wx.TOP|wx.LEFT,0)
self.serialport = wx.ComboBox(self.panel, -1, self.serialport = wx.ComboBox(self.panel, -1,
choices=self.scanserial(), choices=self.scanserial(),
style=wx.CB_DROPDOWN, size=(100, 25)) style=wx.CB_DROPDOWN, size=(100, 25))
self.serialport.SetToolTip(wx.ToolTip("Select Port Printer is connected to")) self.serialport.SetToolTip(wx.ToolTip("Select Port Printer is connected to"))
self.rescanports() self.rescanports()
uts.Add(self.serialport) uts.Add(self.serialport)
uts.Add(wx.StaticText(self.panel,-1,"@"),0,wx.RIGHT|wx.ALIGN_CENTER,0) uts.Add(wx.StaticText(self.panel,-1,"@"),0,wx.RIGHT|wx.ALIGN_CENTER,0)
self.baud = wx.ComboBox(self.panel, -1, self.baud = wx.ComboBox(self.panel, -1,
choices=["2400", "9600", "19200", "38400", "57600", "115200", "250000"], choices=["2400", "9600", "19200", "38400", "57600", "115200", "250000"],
...@@ -562,20 +569,22 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -562,20 +569,22 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
except: except:
pass pass
uts.Add(self.baud) uts.Add(self.baud)
self.connectbtn=wx.Button(self.panel,-1,_("Connect"), size=buttonSize) self.connectbtn=wx.Button(self.panel,-1,_("Connect"), size=buttonSize)
uts.Add(self.connectbtn)
self.connectbtn.SetToolTip(wx.ToolTip("Connect to the printer")) self.connectbtn.SetToolTip(wx.ToolTip("Connect to the printer"))
self.connectbtn.Bind(wx.EVT_BUTTON,self.connect) self.connectbtn.Bind(wx.EVT_BUTTON,self.connect)
uts.Add(self.connectbtn)
self.resetbtn=wx.Button(self.panel,-1,_("Reset"),style=wx.BU_EXACTFIT,size=(-1,buttonSize[1])) self.resetbtn=wx.Button(self.panel,-1,_("Reset"),style=wx.BU_EXACTFIT,size=(-1,buttonSize[1]))
self.resetbtn.Bind(wx.EVT_BUTTON,self.reset) self.resetbtn.Bind(wx.EVT_BUTTON,self.reset)
self.resetbtn.SetToolTip(wx.ToolTip("Reset the printer")) self.resetbtn.SetToolTip(wx.ToolTip("Reset the printer"))
uts.Add(self.resetbtn) uts.Add(self.resetbtn)
#self.minibtn=wx.Button(self.panel,-1,_("Mini mode"),style=wx.BU_EXACTFIT)
#self.minibtn.Bind(wx.EVT_BUTTON,self.toggleview)
#uts.Add((25,-1)) #uts.Add((25,-1))
#uts.Add((15,-1),flag=wx.EXPAND) #uts.Add((15,-1),flag=wx.EXPAND)
#self.minibtn=wx.Button(self.panel,-1,_("Mini mode"),style=wx.BU_EXACTFIT)
#self.minibtn.Bind(wx.EVT_BUTTON,self.toggleview)
#uts.Add(self.minibtn,0,wx.ALIGN_CENTER) #uts.Add(self.minibtn,0,wx.ALIGN_CENTER)
#SECOND ROW #SECOND ROW
...@@ -1314,7 +1323,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -1314,7 +1323,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
else: else:
wx.CallAfter(self.graph.StopPlotting) wx.CallAfter(self.graph.StopPlotting)
def setloud(self,e):
self.p.loud=e.IsChecked()
def sendline(self,e): def sendline(self,e):
command=self.commandbox.GetValue() command=self.commandbox.GetValue()
......
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