Commit 523a2a4f authored by Kliment Yanev's avatar Kliment Yanev

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

parents 8237b634 8bdb86f6
...@@ -1116,7 +1116,7 @@ class pronsole(cmd.Cmd): ...@@ -1116,7 +1116,7 @@ class pronsole(cmd.Cmd):
if(self.sdprinting): if(self.sdprinting):
self.p.send_now("M27") self.p.send_now("M27")
time.sleep(interval) time.sleep(interval)
print (self.tempreadings.replace("\r","").replace("T","Hotend").replace("B","Bed").replace("\n","").replace("ok ","")) #print (self.tempreadings.replace("\r","").replace("T","Hotend").replace("B","Bed").replace("\n","").replace("ok ",""))
if(self.p.printing): if(self.p.printing):
print "Print progress: ", 100*float(self.p.queueindex)/len(self.p.mainqueue), "%" print "Print progress: ", 100*float(self.p.queueindex)/len(self.p.mainqueue), "%"
......
...@@ -39,6 +39,8 @@ StringIO=cStringIO ...@@ -39,6 +39,8 @@ StringIO=cStringIO
thread=threading.Thread thread=threading.Thread
winsize=(800,500) winsize=(800,500)
layerindex=0 layerindex=0
global buttonSize
buttonSize = (70, 25) # Define sizes for the buttons on top rows
if os.name=="nt": if os.name=="nt":
winsize=(800,530) winsize=(800,530)
try: try:
...@@ -498,30 +500,30 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -498,30 +500,30 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
#lower section contains the rest of the window - manual controls, console, visualizations #lower section contains the rest of the window - manual controls, console, visualizations
#TOP ROW: #TOP ROW:
uts=self.uppertopsizer=wx.BoxSizer(wx.HORIZONTAL) uts=self.uppertopsizer=wx.BoxSizer(wx.HORIZONTAL)
self.rescanbtn=wx.Button(self.panel,-1,_("Port"),style=wx.BU_EXACTFIT) self.rescanbtn=wx.Button(self.panel,-1,_("Port"),size=(70, 25))
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) style=wx.CB_DROPDOWN, size=(100, 25))
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"],
style=wx.CB_DROPDOWN) style=wx.CB_DROPDOWN, size=(100, 25))
try: try:
self.baud.SetValue("115200") self.baud.SetValue("115200")
self.baud.SetValue(str(self.settings.baudrate)) self.baud.SetValue(str(self.settings.baudrate))
except: except:
pass pass
uts.Add(self.baud) uts.Add(self.baud)
self.connectbtn=wx.Button(self.panel,-1,_("Connect"),style=wx.BU_EXACTFIT) self.connectbtn=wx.Button(self.panel,-1,_("Connect"), size=buttonSize)
uts.Add(self.connectbtn) uts.Add(self.connectbtn)
self.connectbtn.SetToolTipString(_("Connect to the printer")) self.connectbtn.SetToolTipString(_("Connect to the printer"))
self.connectbtn.Bind(wx.EVT_BUTTON,self.connect) self.connectbtn.Bind(wx.EVT_BUTTON,self.connect)
self.resetbtn=wx.Button(self.panel,-1,_("Reset"),style=wx.BU_EXACTFIT) self.resetbtn=wx.Button(self.panel,-1,_("Reset"), size=buttonSize)
self.resetbtn.Bind(wx.EVT_BUTTON,self.reset) self.resetbtn.Bind(wx.EVT_BUTTON,self.reset)
uts.Add(self.resetbtn) uts.Add(self.resetbtn)
#self.minibtn=wx.Button(self.panel,-1,_("Mini mode"),style=wx.BU_EXACTFIT) #self.minibtn=wx.Button(self.panel,-1,_("Mini mode"),style=wx.BU_EXACTFIT)
...@@ -535,23 +537,21 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -535,23 +537,21 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
#SECOND ROW #SECOND ROW
ubs=self.upperbottomsizer=uts#wx.BoxSizer(wx.HORIZONTAL) ubs=self.upperbottomsizer=uts#wx.BoxSizer(wx.HORIZONTAL)
self.loadbtn=wx.Button(self.panel,-1,_("Load file"),style=wx.BU_EXACTFIT) self.loadbtn=wx.Button(self.panel,-1,_("Load file"), size=buttonSize)
self.loadbtn.Bind(wx.EVT_BUTTON,self.loadfile) self.loadbtn.Bind(wx.EVT_BUTTON,self.loadfile)
ubs.Add(self.loadbtn) ubs.Add(self.loadbtn)
self.platebtn=wx.Button(self.panel,-1,_("Compose"),style=wx.BU_EXACTFIT) self.platebtn=wx.Button(self.panel,-1,_("Compose"), size=buttonSize)
self.platebtn.Bind(wx.EVT_BUTTON,self.plate) self.platebtn.Bind(wx.EVT_BUTTON,self.plate)
#self.printerControls.append(self.uploadbtn) #self.printerControls.append(self.uploadbtn)
ubs.Add(self.platebtn) ubs.Add(self.platebtn)
self.sdbtn=wx.Button(self.panel,-1,_("SD"),style=wx.BU_EXACTFIT) self.sdbtn=wx.Button(self.panel,-1,_("SD"), size=buttonSize)
self.sdbtn.Bind(wx.EVT_BUTTON,self.sdmenu) self.sdbtn.Bind(wx.EVT_BUTTON,self.sdmenu)
self.printerControls.append(self.sdbtn) self.printerControls.append(self.sdbtn)
ubs.Add(self.sdbtn) ubs.Add(self.sdbtn)
self.printbtn=wx.Button(self.panel,-1,_("Print"),style=wx.BU_EXACTFIT) self.printbtn=wx.Button(self.panel,-1,_("Print"), size=buttonSize)
self.printbtn.Bind(wx.EVT_BUTTON,self.printfile)
self.printbtn.Disable() self.printbtn.Disable()
ubs.Add(self.printbtn) ubs.Add(self.printbtn)
self.pausebtn=wx.Button(self.panel,-1,_("Pause"),style=wx.BU_EXACTFIT) self.pausebtn=wx.Button(self.panel,-1,_("Pause"), size=buttonSize)
self.pausebtn.Bind(wx.EVT_BUTTON,self.pause)
ubs.Add(self.pausebtn) ubs.Add(self.pausebtn)
#Right full view #Right full view
lrs=self.lowerrsizer=wx.BoxSizer(wx.VERTICAL) lrs=self.lowerrsizer=wx.BoxSizer(wx.VERTICAL)
...@@ -1298,9 +1298,10 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -1298,9 +1298,10 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
pass pass
tstring=l.rstrip() tstring=l.rstrip()
#print tstring #print tstring
if (tstring!="ok" and tstring!="wait"): if (tstring!="ok") and (tstring!="wait") and ("ok T:" not in tstring):
print "[" + time.strftime('%H:%M:%S',time.localtime(time.time())) + "] " + tstring # print "*"+tstring+"*"
#wx.CallAfter(self.logbox.AppendText,tstring+"\n") # print "[" + time.strftime('%H:%M:%S',time.localtime(time.time())) + "] " + tstring
wx.CallAfter(self.logbox.AppendText,tstring+"\n")
for i in self.recvlisteners: for i in self.recvlisteners:
i(l) i(l)
......
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