Merge remote branch 'kliment/master' into experimental
commit
0e7c70dbdf
4
gviz.py
4
gviz.py
|
@ -248,7 +248,7 @@ class gviz(wx.Panel):
|
||||||
self.pens[ target[2] ] += [self.mainpen if target[3] != self.lastpos[3] else self.travelpen]
|
self.pens[ target[2] ] += [self.mainpen if target[3] != self.lastpos[3] else self.travelpen]
|
||||||
self.lastpos = target
|
self.lastpos = target
|
||||||
else:
|
else:
|
||||||
self.hilight += line
|
self.hilight += [line]
|
||||||
self.hilightpos = target
|
self.hilightpos = target
|
||||||
self.dirty = 1
|
self.dirty = 1
|
||||||
|
|
||||||
|
@ -266,7 +266,7 @@ class gviz(wx.Panel):
|
||||||
self.arcpens[ target[2] ] += [self.arcpen]
|
self.arcpens[ target[2] ] += [self.arcpen]
|
||||||
self.lastpos = target
|
self.lastpos = target
|
||||||
else:
|
else:
|
||||||
self.hilightarcs += arc
|
self.hilightarcs += [arc]
|
||||||
self.hilightpos = target
|
self.hilightpos = target
|
||||||
self.dirty = 1
|
self.dirty = 1
|
||||||
|
|
||||||
|
|
|
@ -382,6 +382,22 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
|
||||||
def OnExit(self, event):
|
def OnExit(self, event):
|
||||||
self.Close()
|
self.Close()
|
||||||
|
|
||||||
|
def rescanports(self,event=None):
|
||||||
|
scan=self.scanserial()
|
||||||
|
portslist=list(scan)
|
||||||
|
if self.settings.port != "" and self.settings.port not in portslist:
|
||||||
|
portslist += [self.settings.port]
|
||||||
|
self.serialport.Clear()
|
||||||
|
self.serialport.AppendItems(portslist)
|
||||||
|
try:
|
||||||
|
if self.settings.port in scan:
|
||||||
|
self.serialport.SetValue(self.settings.port)
|
||||||
|
elif len(portslist)>0:
|
||||||
|
self.serialport.SetValue(portslist[0])
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def popwindow(self):
|
def popwindow(self):
|
||||||
# this list will contain all controls that should be only enabled
|
# this list will contain all controls that should be only enabled
|
||||||
# when we're connected to a printer
|
# when we're connected to a printer
|
||||||
|
@ -392,21 +408,14 @@ 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)
|
||||||
uts.Add(wx.StaticText(self.panel,-1,_("Port:"),pos=(0,5)),wx.TOP|wx.LEFT,5)
|
self.rescanbtn=wx.Button(self.panel,-1,_("Port"),pos=(380,0))
|
||||||
scan=self.scanserial()
|
self.rescanbtn.Bind(wx.EVT_BUTTON,self.rescanports)
|
||||||
portslist=list(scan)
|
|
||||||
if self.settings.port != "" and self.settings.port not in portslist:
|
uts.Add(self.rescanbtn,wx.TOP|wx.LEFT,5)
|
||||||
portslist += [self.settings.port]
|
|
||||||
self.serialport = wx.ComboBox(self.panel, -1,
|
self.serialport = wx.ComboBox(self.panel, -1,
|
||||||
choices=portslist,
|
choices=[],
|
||||||
style=wx.CB_DROPDOWN|wx.CB_SORT|wx.CB_READONLY, pos=(50,0))
|
style=wx.CB_DROPDOWN|wx.CB_READONLY, pos=(50,0))
|
||||||
try:
|
self.rescanports()
|
||||||
if self.settings.port in scan:
|
|
||||||
self.serialport.SetValue(self.settings.port)
|
|
||||||
elif len(portslist)>0:
|
|
||||||
self.serialport.SetValue(portslist[0])
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
uts.Add(self.serialport)
|
uts.Add(self.serialport)
|
||||||
uts.Add(wx.StaticText(self.panel,-1,"@",pos=(250,5)),wx.RIGHT,5)
|
uts.Add(wx.StaticText(self.panel,-1,"@",pos=(250,5)),wx.RIGHT,5)
|
||||||
self.baud = wx.ComboBox(self.panel, -1,
|
self.baud = wx.ComboBox(self.panel, -1,
|
||||||
|
|
Loading…
Reference in New Issue