Cat
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
AppFrame.AppFrame Class Reference
Inheritance diagram for AppFrame.AppFrame:

Public Member Functions

def __init__ (self, app, parent, title)
 
def getControl (self, xmlid)
 
def makeMenuBar (self)
 
def makeToolBar (self)
 
def onIdle (self, event)
 
def onCloseConfirm (self, event)
 
def onClose (self, event)
 
def onExit (self, event)
 
def onHelp (self, event)
 
def onAbout (self, event)
 
def onAutoCheck (self, event)
 
def onStopOnError (self, event)
 
def onFileCheck (self, event)
 
def onLogCheck (self, event)
 
def eventCtrl (self, event)
 
def runCtrl (self, event)
 
def printFreq (self, event)
 
def plotFreq (self, event)
 
def onEnter (self, event)
 
def onLoad (self, event)
 
def onEdit (self, event)
 
def deleteHardware (self, event)
 
def onExpand (self, event)
 
def onCollapse (self, event)
 
def onReLoad (self, event)
 
def onConfigure (self, event)
 
def onInit (self, event)
 
def onDelete (self, event)
 
def onStart (self, event)
 
def onSingle (self, event)
 
def plot (self, proc, force)
 
def BuildElementList (self)
 
def BuildProcessusList (self)
 
def update (self)
 
def ElementList (self)
 
def updateCombo (self, event)
 
def updateOutputLevel (self, event)
 
def procComboUpdate (self, element)
 

Public Attributes

 MB_CONF
 
 MB_GRAPH
 
 MB_LOG
 
 TB_CONF
 
 TB_GRAPH
 
 TB_LOG
 
 cfgpanels
 
 objs
 
 paths
 
 path
 
 panel
 
 treeContainer
 
 vbox
 
 tree
 
 elementCombo
 
 procCombo
 
 menuBar
 
 toolBar
 
 listElement
 

Static Public Attributes

string overviewText = "CAT Main Window"
 

Detailed Description

Definition at line 54 of file AppFrame.py.

Constructor & Destructor Documentation

◆ __init__()

def AppFrame.AppFrame.__init__ (   self,
  app,
  parent,
  title 
)

Definition at line 56 of file AppFrame.py.

56  def __init__(self, app, parent, title):
57  wx.Frame.__init__(self, parent, wx.NewId(), title, size=(500, 650))
58 
59  self.MB_CONF=wx.NewId()
60  self.MB_GRAPH=wx.NewId()
61  self.MB_LOG=wx.NewId()
62 
63  self.TB_CONF=wx.NewId()
64  self.TB_GRAPH=wx.NewId()
65  self.TB_LOG=wx.NewId()
66 
67  self.cfgpanels=list()
68  self.objs=list()
69  self.paths=list()
70 
71  global cat
72  cat=app
73 
74  self.path=os.path.join(os.environ.get("CATPATH"),"CatPython","python")
75  sizeX=wx.SystemSettings.GetMetric( wx.SYS_SCREEN_X );
76  sizeY=wx.SystemSettings.GetMetric( wx.SYS_SCREEN_Y );
77  self.makeMenuBar()
78  self.makeToolBar()
79  res=xrc.XmlResource(os.path.join(self.path,"xrc/AppPanel.xrc"))
80  self.panel=res.LoadPanel(self, "AppPanel")
81 # self.makeFrames()
82 
83  for window, items in _windows:
84  show=items[0]
85  Pt=wx.Point(items[1][0]*sizeX,items[1][1]*sizeY)
86  Sz=wx.Size(items[2][0]*sizeX,items[2][1]*sizeY)
87  if window=='App':
88  self.Move(Pt)
89  self.SetSize(Sz)
90  # if window=='Cfg':
91  # self.cfgFrame.Move(Pt)
92  # self.cfgFrame.SetSize(Sz)
93  # self.cfgState=show
94  # self.cfgFrame.Show(show)
95  # self.toolBar.ToggleTool(self.TB_CONF, show)
96  # menuItem = self.menuBar.FindItemById(self.MB_CONF)
97  # menuItem.Check(show)
98 
99  # if window=='Gph':
100  # self.gphFrame.Move(Pt)
101  # self.gphFrame.SetSize(Sz)
102  # self.gphState=show
103  # self.gphFrame.Show(show)
104  # self.toolBar.ToggleTool(self.TB_GRAPH, show)
105  # menuItem = self.menuBar.FindItemById(self.MB_GRAPH)
106  # menuItem.Check(show)
107 
108  # if window=='Log':
109  # self.logFrame.Move(Pt)
110  # self.logFrame.SetSize(Sz)
111  # self.logState=show
112  # self.logFrame.Show(show)
113  # self.toolBar.ToggleTool(self.TB_LOG, show)
114  # menuItem = self.menuBar.FindItemById(self.MB_LOG)
115  # menuItem.Check(show)
116 
117  self.treeContainer=xrc.XRCCTRL(self, 'TreePanel')
118  self.vbox=wx.BoxSizer(wx.VERTICAL)
119 
120  self.tree=TreeCtrlPanel(self.treeContainer)
121 
122  self.vbox.Add(self.tree,1,wx.EXPAND)
123  self.treeContainer.SetSizer( self.vbox )
124 
125 # self.tree
126 # self.treeMap = {}
127 
128 # self.BuildTreeImageList()
129  #self.tree.SetExpansionState(self.expansionState)
130 # self.tree.Bind(wx.EVT_TREE_ITEM_EXPANDED, self.OnItemExpanded)
131 # self.tree.Bind(wx.EVT_TREE_ITEM_COLLAPSED, self.OnItemCollapsed)
132 # self.tree.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnSelChanged)
133 # self.tree.Bind(wx.EVT_LEFT_DOWN, self.OnTreeLeftDown)
134 
135  self.elementCombo=self.getControl("elementCombo")
136  self.procCombo=self.getControl("procCombo")
137  self.Bind(wx.EVT_COMBOBOX, self.updateCombo, id=xrc.XRCID("elementCombo"))
138  self.Bind(wx.EVT_BUTTON, self.onLoad, id=xrc.XRCID("openConfFile"))
139  self.Bind(wx.EVT_BUTTON, self.onEdit, id=xrc.XRCID("onEdit"))
140  self.Bind(wx.EVT_SPINCTRL, self.runCtrl, id=xrc.XRCID("runCtrl"))
141  self.Bind(wx.EVT_SPINCTRL, self.eventCtrl, id=xrc.XRCID("eventCtrl"))
142  self.Bind(wx.EVT_SPINCTRL, self.printFreq, id=xrc.XRCID("printFreq"))
143  self.Bind(wx.EVT_SPINCTRL, self.plotFreq, id=xrc.XRCID("plotFreq"))
144  self.Bind(wx.EVT_TEXT_ENTER, self.onEnter, id=xrc.XRCID("cmdline"))
145  self.Bind(wx.EVT_BUTTON, self.onEnter, id=xrc.XRCID("onEnter"))
146  self.Bind(wx.EVT_BUTTON, self.onExpand, id=xrc.XRCID("onExpand"))
147  self.Bind(wx.EVT_BUTTON, self.onCollapse, id=xrc.XRCID("onCollapse"))
148  self.Bind(wx.EVT_BUTTON, self.deleteHardware, id=xrc.XRCID("deleteHardware"))
149  self.Bind(wx.EVT_TOGGLEBUTTON, self.onAutoCheck, id=xrc.XRCID("autoCheck"))
150  self.Bind(wx.EVT_TOGGLEBUTTON, self.onStopOnError, id=xrc.XRCID("stoponerror"))
151  self.Bind(wx.EVT_TOGGLEBUTTON, self.onLogCheck, id=xrc.XRCID("logCheck"))
152  self.Bind(wx.EVT_TOGGLEBUTTON, self.onFileCheck, id=xrc.XRCID("fileCheck"))
153  self.Bind(wx.EVT_COMBOBOX, self.updateOutputLevel, id=xrc.XRCID("outputLevel"))
154  self.update()
155 
def __init__(self, dict)
Definition: wrapper.py:56

Member Function Documentation

◆ BuildElementList()

def AppFrame.AppFrame.BuildElementList (   self)

Definition at line 511 of file AppFrame.py.

511  def BuildElementList(self):
512  def sublevel(list, element):
513  if (element.hasChildren()):
514  newlist=[]
515  children=element.children()
516  for child in range(len(children)):
517  newlist.append(children[child].name())
518  if (children[child].hasChildren()):
519  sublevel(newlist,children[child])
520  list.append(newlist)
521  list=[]
522  list.append(cat.computer().name())
523  sublevel(list,cat.computer())
524  return list
525 

◆ BuildProcessusList()

def AppFrame.AppFrame.BuildProcessusList (   self)

Definition at line 527 of file AppFrame.py.

527  def BuildProcessusList(self):
528  list=[]
529  listPtr=cat.procDb().list()
530  for proc in range(len(listPtr)):
531  list.append(listPtr[proc].name())
532  return list
533 

◆ deleteHardware()

def AppFrame.AppFrame.deleteHardware (   self,
  event 
)

Definition at line 392 of file AppFrame.py.

References tree.GetItem(), AppFrame.AppFrame.tree, Croc.Croc.update(), Computer.Computer.update(), EmulateFE.EmulateFE.update(), A3PE_BitFlip.A3PE_BitFlip.update(), InterfaceWrap.update(), ElementWrap.update(), ProcDataBase.update(), TestI2C.TestI2C.update(), TestSPI.TestSPI.update(), TestUSB.TestUSB.update(), StorageFifo.StorageFifo.update(), StorageFifoAcquisition.StorageFifoAcquisition.update(), TestSuite.TestSuite.update(), ADCMeasurement.CurrentMeasurement.update(), CurrentMeasurement.CurrentMeasurement.update(), UsbFTInterfaceTest.UsbFTInterfaceTest.update(), Interface.update(), IOobject.update(), Croc.update(), UsbI2cBus.update(), UsbSpiBus.update(), UsbMLI2cBus.update(), UsbMLSpiBus.update(), CU_v1.update(), Proto40MHz_v1.update(), Element.update(), Computer.update(), FEB_v1.update(), SeqPGA.update(), Acquisition.Acquisition.update(), NI6008.update(), Proto40MHz_v1.Proto40MHz_v1.update(), ProtoFEB_v1.ProtoFEB_v1.update(), FePGA.update(), Phaser.update(), UsbFTMLInterface.update(), UsbFTInterface.update(), MSOxxxx.update(), ICPhaser.update(), ICECALv3.update(), LSDelayChipV1.update(), A3PE.update(), and AppFrame.AppFrame.update().

392  def deleteHardware(self, event):
393  objtype=self.tree.GetItem()
394  cat.warning("Removing object "+objtype[0]+" of type "+objtype[1])
395  element=cat.computer().child(objtype[0])
396  if (element!=0):
397  cat.computer().delChild(element)
398  self.update()
399 
def GetItem(self)
self.root = self.tree.AddRoot("The Root Item") self.tree.SetPyData(self.root, None) self...
Definition: tree.py:89

◆ ElementList()

def AppFrame.AppFrame.ElementList (   self)

Definition at line 578 of file AppFrame.py.

References AppFrame.AppFrame.path.

578  def ElementList(self):
579  def sublevel(list, element):
580  if (element.hasChildren()):
581  children=element.children()
582  for child in range(len(children)):
583  if (len(cat.procDb().list(children[child]))>0):
584  list.append(children[child].path(""))
585  if (children[child].hasChildren()):
586  sublevel(list,children[child])
587 
588  list=[]
589  list.append(cat.computer().path(""))
590  sublevel(list,cat.computer())
591  return list
592 

◆ eventCtrl()

def AppFrame.AppFrame.eventCtrl (   self,
  event 
)

Definition at line 284 of file AppFrame.py.

References AppFrame.AppFrame.getControl().

284  def eventCtrl(self,event):
285  cat.options().setNEvtMax(self.getControl("eventCtrl").GetValue())
286 

◆ getControl()

def AppFrame.AppFrame.getControl (   self,
  xmlid 
)
Retrieves the given control (within a dialog) by its xmlid

Definition at line 156 of file AppFrame.py.

Referenced by AppFrame.AppFrame.eventCtrl(), ProtoFEB_v1.ProtoFEB_v1.isReady(), Proto40MHz_v1.Proto40MHz_v1.isReady(), Acquisition.Acquisition.onApply(), Proto40MHz_v1.Proto40MHz_v1.onapplyaxlatency(), ProtoFEB_v1.ProtoFEB_v1.onapplyaxlatency(), ProtoFEB_v1.ProtoFEB_v1.onapplyaxlength(), Proto40MHz_v1.Proto40MHz_v1.onapplyaxlength(), ProtoFEB_v1.ProtoFEB_v1.onapplyCh(), Proto40MHz_v1.Proto40MHz_v1.onapplyCh(), Proto40MHz_v1.Proto40MHz_v1.onapplyclockdiv(), ProtoFEB_v1.ProtoFEB_v1.onapplyclockdiv(), Proto40MHz_v1.Proto40MHz_v1.onapplydelay(), ProtoFEB_v1.ProtoFEB_v1.onapplydelay(), Proto40MHz_v1.Proto40MHz_v1.onapplyfifodepth(), ProtoFEB_v1.ProtoFEB_v1.onapplyfifodepth(), Proto40MHz_v1.Proto40MHz_v1.onapplyfreq(), ProtoFEB_v1.ProtoFEB_v1.onapplyfreq(), Proto40MHz_v1.Proto40MHz_v1.onapplynumber(), ProtoFEB_v1.ProtoFEB_v1.onapplynumber(), ProtoFEB_v1.ProtoFEB_v1.onapplytrig(), Proto40MHz_v1.Proto40MHz_v1.onapplytrig(), AppFrame.AppFrame.onAutoCheck(), Acquisition.Acquisition.onDeadtime(), Acquisition.Acquisition.onDepth(), Proto40MHz_v1.Proto40MHz_v1.onenableAll(), ProtoFEB_v1.ProtoFEB_v1.onenableAll(), AppFrame.AppFrame.onEnter(), AppFrame.AppFrame.onFileCheck(), AppFrame.AppFrame.onLogCheck(), Acquisition.Acquisition.onMax(), Acquisition.Acquisition.onMin(), Proto40MHz_v1.Proto40MHz_v1.onModeAX(), ProtoFEB_v1.ProtoFEB_v1.onModeAX(), Proto40MHz_v1.Proto40MHz_v1.onModeCh(), ProtoFEB_v1.ProtoFEB_v1.onModeCh(), Acquisition.Acquisition.onNBins(), Acquisition.Acquisition.onNSample(), Proto40MHz_v1.Proto40MHz_v1.onPipeline(), ProtoFEB_v1.ProtoFEB_v1.onPipeline(), Acquisition.Acquisition.onSample(), AppFrame.AppFrame.onSingle(), Acquisition.Acquisition.onSoftTrig(), ProtoFEB_v1.ProtoFEB_v1.onSoftTrig(), Proto40MHz_v1.Proto40MHz_v1.onSoftTrig(), AppFrame.AppFrame.onStart(), AppFrame.AppFrame.onStopOnError(), Acquisition.Acquisition.onTree(), Acquisition.Acquisition.onTrend(), Proto40MHz_v1.Proto40MHz_v1.onunableAll(), ProtoFEB_v1.ProtoFEB_v1.onunableAll(), element.element.parent(), proc.proc.parent(), AppFrame.AppFrame.plotFreq(), AppFrame.AppFrame.printFreq(), AppFrame.AppFrame.runCtrl(), Acquisition.Acquisition.update(), Proto40MHz_v1.Proto40MHz_v1.update(), ProtoFEB_v1.ProtoFEB_v1.update(), AppFrame.AppFrame.update(), and AppFrame.AppFrame.updateOutputLevel().

156  def getControl(self, xmlid):
157  '''Retrieves the given control (within a dialog) by its xmlid'''
158  control = self.FindWindowById(xrc.XRCID(xmlid))
159 # print xmlid
160 # print xrc.XRCID(xmlid)
161 # print control
162  if control == None and self.GetMenuBar() != None: # see if on the menubar
163  control = self.GetMenuBar().FindItemById(xrc.XRCID(xmlid))
164  assert control != None, 'Programming error: a control with xml id ' + xmlid + ' was not found.'
165  return control
166 

◆ makeMenuBar()

def AppFrame.AppFrame.makeMenuBar (   self)

Definition at line 167 of file AppFrame.py.

167  def makeMenuBar(self):
168  MB_FILE=wx.NewId()
169  MB_CLOSE=wx.NewId()
170  #
171  file=wx.Menu()
172  file.Append(MB_FILE,"&File","Open new configuration file")
173  file.Append(MB_CLOSE,"&Close","Close configuration file")
174  file.Append(wx.ID_EXIT, "E&xit", "Terminate the program")
175  windows=wx.Menu()
176 # windows.AppendCheckItem(self.MB_CONF,"&Configuration window","Configuration window")
177 # windows.AppendCheckItem(self.MB_GRAPH,"&Graphic window","Graphic window")
178 # windows.AppendCheckItem(self.MB_LOG,"&Log window","Log window")
179  help=wx.Menu()
180  help.Append(wx.ID_ABOUT, "&About","More information about this program")
181  help.AppendSeparator()
182  help.Append(wx.ID_HELP, "&Help", "CAT application help")
183  self.menuBar=wx.MenuBar(wx.MB_DOCKABLE)
184  self.menuBar.Append(file , "&File")
185  self.menuBar.Append(windows, "&Windows")
186  self.menuBar.Append(help , "&Help")
187  self.SetMenuBar(self.menuBar)
188  self.Bind(wx.EVT_MENU, self.onExit , id=wx.ID_EXIT )
189  self.Bind(wx.EVT_MENU, self.onAbout , id=wx.ID_ABOUT )
190  self.Bind(wx.EVT_MENU, self.onHelp , id=wx.ID_HELP )
191 # self.Bind(wx.EVT_MENU, self.onCheckGraph, id=self.MB_GRAPH )
192 # self.Bind(wx.EVT_MENU, self.onCheckLog , id=self.MB_LOG )
193 # self.Bind(wx.EVT_MENU, self.onCheckConf , id=self.MB_CONF )
194  self.Bind(wx.EVT_MENU, self.onLoad , id=MB_FILE )
195  self.Bind(wx.EVT_MENU, self.onClose , id=MB_CLOSE )
196 

◆ makeToolBar()

def AppFrame.AppFrame.makeToolBar (   self)

Definition at line 197 of file AppFrame.py.

197  def makeToolBar(self):
198  TB_OPEN=wx.NewId()
199  TB_RELOAD=wx.NewId()
200  TB_CONFIGURE=wx.NewId()
201  TB_INIT=wx.NewId()
202  TB_DELETE=wx.NewId()
203  TB_START=wx.NewId()
204  TB_SINGLE=wx.NewId()
205  TB_EXIT=wx.NewId()
206  #
207  self.toolBar = self.CreateToolBar(wx.TB_DOCKABLE)
208  self.toolBar.AddLabelTool(TB_OPEN , '', wx.Bitmap(os.path.join(self.path,"xrc/icons/fileopen.png")))
209  self.toolBar.AddLabelTool(TB_RELOAD, '', wx.Bitmap(os.path.join(self.path,"xrc/icons/reload.png")))
210  self.toolBar.AddLabelTool(TB_CONFIGURE, '', wx.Bitmap(os.path.join(self.path,"xrc/icons/conf.png")))
211  self.toolBar.AddLabelTool(TB_INIT, '', wx.Bitmap(os.path.join(self.path,"xrc/icons/init.png")))
212  self.toolBar.AddLabelTool(TB_DELETE, '', wx.Bitmap(os.path.join(self.path,"xrc/icons/delete.png")))
213  self.toolBar.AddSeparator()
214 # self.toolBar.AddCheckLabelTool(self.TB_CONF, '', wx.Bitmap(os.path.join(self.path,"xrc/icons/config.png")))
215  self.toolBar.AddCheckLabelTool(self.TB_GRAPH, '', wx.Bitmap(os.path.join(self.path,"xrc/icons/graph.png")))
216 # self.toolBar.AddCheckLabelTool(self.TB_LOG, '', wx.Bitmap(os.path.join(self.path,"xrc/icons/log.png")))
217  self.toolBar.AddSeparator()
218  self.toolBar.AddLabelTool(TB_START, '', wx.Bitmap(os.path.join(self.path,"xrc/icons/start.png")))
219  self.toolBar.AddLabelTool(TB_SINGLE, '', wx.Bitmap(os.path.join(self.path,"xrc/icons/single.png")))
220  self.toolBar.AddSeparator()
221  self.toolBar.AddLabelTool(wx.ID_EXIT, '', wx.Bitmap(os.path.join(self.path,"xrc/icons/exit.png")))
222  self.toolBar.Realize()
223  self.Bind(wx.EVT_TOOL, self.onExit , id=wx.ID_EXIT)
224 # self.Bind(wx.EVT_TOOL, self.onCheckGraph, id=self.TB_GRAPH)
225 # self.Bind(wx.EVT_TOOL, self.onCheckLog , id=self.TB_LOG)
226 # self.Bind(wx.EVT_TOOL, self.onCheckConf , id=self.TB_CONF)
227  self.Bind(wx.EVT_TOOL, self.onLoad , id=TB_OPEN)
228  self.Bind(wx.EVT_TOOL, self.onReLoad , id=TB_RELOAD)
229  self.Bind(wx.EVT_TOOL, self.onConfigure , id=TB_CONFIGURE)
230  self.Bind(wx.EVT_TOOL, self.onInit , id=TB_INIT)
231  self.Bind(wx.EVT_TOOL, self.onDelete , id=TB_DELETE)
232  self.Bind(wx.EVT_TOOL, self.onStart , id=TB_START)
233  self.Bind(wx.EVT_TOOL, self.onSingle , id=TB_SINGLE)
234 
235 # def makeFrames(self):
236 # self.logFrame=LogFrame(cat, self, "Log window")
237 # self.cfgFrame=ConfFrame(cat, self, "Configuration window")
238 # self.gphFrame=GraphFrame(cat, self, "Graphical window")
239 

◆ onAbout()

def AppFrame.AppFrame.onAbout (   self,
  event 
)
About

Definition at line 265 of file AppFrame.py.

265  def onAbout(self, event):
266  '''About'''
267  print "about"
268 

◆ onAutoCheck()

def AppFrame.AppFrame.onAutoCheck (   self,
  event 
)

Definition at line 269 of file AppFrame.py.

References AppFrame.AppFrame.getControl().

269  def onAutoCheck(self, event):
270  cat.options().setRunNumberMgr(self.getControl("autoCheck").GetValue())
271  print cat.options().runNumberMgr()
272 

◆ onClose()

def AppFrame.AppFrame.onClose (   self,
  event 
)
Closes the application

Definition at line 252 of file AppFrame.py.

252  def onClose(self, event):
253  '''Closes the application'''
254  self.Destroy()
255 

◆ onCloseConfirm()

def AppFrame.AppFrame.onCloseConfirm (   self,
  event 
)
Closes the application

Definition at line 245 of file AppFrame.py.

245  def onCloseConfirm(self, event):
246  '''Closes the application'''
247  dlg = wx.MessageDialog(self, "Exit the program?", "Exit", wx.YES_NO | wx.ICON_QUESTION)
248  if dlg.ShowModal() == wx.ID_YES:
249  dlg.Destroy() # frame
250  self.Destroy()
251 

◆ onCollapse()

def AppFrame.AppFrame.onCollapse (   self,
  event 
)

Definition at line 403 of file AppFrame.py.

References tree.CollapseAll(), and AppFrame.AppFrame.tree.

403  def onCollapse(self, event):
404  self.tree.CollapseAll()
405 
def CollapseAll(self)
Definition: tree.py:301

◆ onConfigure()

def AppFrame.AppFrame.onConfigure (   self,
  event 
)

Definition at line 411 of file AppFrame.py.

411  def onConfigure(self, event):
412  print "Not implemented yet"
413 

◆ onDelete()

def AppFrame.AppFrame.onDelete (   self,
  event 
)

Definition at line 417 of file AppFrame.py.

References shell.clear().

417  def onDelete(self, event):
418  cat.computer().clear()
419 
def clear(path='')
Definition: shell.py:172

◆ onEdit()

def AppFrame.AppFrame.onEdit (   self,
  event 
)

Definition at line 369 of file AppFrame.py.

References AppFrame.AppFrame.cfgpanels, tree.GetItem(), AppFrame.AppFrame.objs, AppFrame.AppFrame.paths, AppFrame.AppFrame.tree, and AppFrame.AppFrame.update().

369  def onEdit(self, event):
370  objtype=self.tree.GetItem()
371 # print "objtype is : ",objtype
372  objpanel=-1
373  for i in range(len(self.objs)):
374  if objtype[0]==self.paths[i]:
375  self.cfgpanels[objpanel].update()
376  self.cfgpanels[objpanel].Show(True)
377  return
378 
379  self.paths.append(objtype[0])
380  if (objtype[1]=='Element'):
381  self.objs.append(cat.computer().child(objtype[0]))
382  self.cfgpanels.append(CfgFrame(cat, self, self.objs[-1], objtype[0], "element"))
383 
384  if (objtype[1]=='Processus'):
385  list = cat.procDb().list()
386  for p in range(len(list)):
387  if list[p].name()==objtype[0]:
388  self.objs.append(list[p])
389  self.cfgpanels.append(CfgFrame(cat, self, self.objs[-1], objtype[0], "proc"))
390  break
391 
def GetItem(self)
self.root = self.tree.AddRoot("The Root Item") self.tree.SetPyData(self.root, None) self...
Definition: tree.py:89

◆ onEnter()

def AppFrame.AppFrame.onEnter (   self,
  event 
)

Definition at line 296 of file AppFrame.py.

References AppFrame.AppFrame.getControl().

296  def onEnter(self,event):
297  cmd=self.getControl("cmdline").GetValue()
298  self.getControl("cmdline").SetValue("")
299  exec(cmd)
300 

◆ onExit()

def AppFrame.AppFrame.onExit (   self,
  event 
)
Exit the app

Definition at line 256 of file AppFrame.py.

256  def onExit(self, event):
257  '''Exit the app'''
258  self.Close(True)
259 # exit(2)
260 

◆ onExpand()

def AppFrame.AppFrame.onExpand (   self,
  event 
)

Definition at line 400 of file AppFrame.py.

References tree.ExpandAll(), and AppFrame.AppFrame.tree.

400  def onExpand(self, event):
401  self.tree.ExpandAll()
402 
def ExpandAll(self)
Definition: tree.py:298

◆ onFileCheck()

def AppFrame.AppFrame.onFileCheck (   self,
  event 
)

Definition at line 276 of file AppFrame.py.

References AppFrame.AppFrame.getControl().

276  def onFileCheck(self, event):
277  cat.options().setDataStorage(self.getControl("fileCheck").GetValue())
278  print cat.options().dataStorage()
279 

◆ onHelp()

def AppFrame.AppFrame.onHelp (   self,
  event 
)
Help

Definition at line 261 of file AppFrame.py.

261  def onHelp(self, event):
262  '''Help'''
263  print "help"
264 

◆ onIdle()

def AppFrame.AppFrame.onIdle (   self,
  event 
)
Responds to idle time in the system

Definition at line 240 of file AppFrame.py.

240  def onIdle(self, event):
241  '''Responds to idle time in the system'''
242  # when the timer says it's time, we do the actual downloading in the main thread (wx doesn't work well in secondary threads)
243  print "onIdle"
244 

◆ onInit()

def AppFrame.AppFrame.onInit (   self,
  event 
)

Definition at line 414 of file AppFrame.py.

References shell.init().

414  def onInit(self, event):
415  init()
416 
def init()
Definition: shell.py:203

◆ onLoad()

def AppFrame.AppFrame.onLoad (   self,
  event 
)

Definition at line 328 of file AppFrame.py.

References Croc.Croc.update(), Computer.Computer.update(), A3PE_BitFlip.A3PE_BitFlip.update(), EmulateFE.EmulateFE.update(), InterfaceWrap.update(), ElementWrap.update(), ProcDataBase.update(), TestI2C.TestI2C.update(), TestSPI.TestSPI.update(), TestUSB.TestUSB.update(), StorageFifoAcquisition.StorageFifoAcquisition.update(), TestSuite.TestSuite.update(), StorageFifo.StorageFifo.update(), ADCMeasurement.CurrentMeasurement.update(), CurrentMeasurement.CurrentMeasurement.update(), UsbFTInterfaceTest.UsbFTInterfaceTest.update(), Interface.update(), IOobject.update(), Croc.update(), UsbI2cBus.update(), UsbSpiBus.update(), UsbMLI2cBus.update(), UsbMLSpiBus.update(), CU_v1.update(), Proto40MHz_v1.update(), Element.update(), Computer.update(), FEB_v1.update(), SeqPGA.update(), Acquisition.Acquisition.update(), NI6008.update(), ProtoFEB_v1.ProtoFEB_v1.update(), Proto40MHz_v1.Proto40MHz_v1.update(), FePGA.update(), Phaser.update(), UsbFTInterface.update(), UsbFTMLInterface.update(), MSOxxxx.update(), ICPhaser.update(), ICECALv3.update(), LSDelayChipV1.update(), A3PE.update(), and AppFrame.AppFrame.update().

328  def onLoad(self, event):
329  path=[]
330  dlg = wx.FileDialog(
331  self, message="Choose a file",
332  defaultDir=os.getcwd(),
333  defaultFile="",
334  wildcard="Python source (*.py)|*.py|" "All files (*.*)|*.*",
335  style=wx.OPEN | wx.CHANGE_DIR
336  )
337 
338  # Show the dialog and retrieve the user response. If it is the OK response,
339  # process the data.
340  if dlg.ShowModal() == wx.ID_OK:
341  # This returns a Python list of files that were selected.
342  path = dlg.GetPaths()
343  # Destroy the dialog. Don't do this until you are done with it!
344  # BAD things can happen otherwise!
345  dlg.Destroy()
346  if len(path)==1:
347  filename=str(path[0])
348  execfile(filename)
349  cat.options().setDefFile(filename)
350  cat.computer().tree()
351  self.update()
352 
Definition: tree.py:1

◆ onLogCheck()

def AppFrame.AppFrame.onLogCheck (   self,
  event 
)

Definition at line 280 of file AppFrame.py.

References AppFrame.AppFrame.getControl().

280  def onLogCheck(self, event):
281  cat.options().setLogStorage(self.getControl("logCheck").GetValue())
282  print cat.options().logStorage()
283 

◆ onReLoad()

def AppFrame.AppFrame.onReLoad (   self,
  event 
)

◆ onSingle()

def AppFrame.AppFrame.onSingle (   self,
  event 
)

Definition at line 489 of file AppFrame.py.

References AppFrame.AppFrame.elementCombo, AppFrame.AppFrame.getControl(), AppFrame.AppFrame.listElement, AppFrame.AppFrame.plot(), and AppFrame.AppFrame.procCombo.

489  def onSingle(self, event):
490  cat.options().setStorageDir(str(self.getControl("fileCtrl").GetValue()))
491  cat.options().setStoragePath(str(self.getControl("pathCtrl").GetValue()))
492  item=self.elementCombo.GetSelection()
493  element=cat.computer().child(self.listElement[item])
494  list=cat.procDb().list(element)
495  processus=list[self.procCombo.GetSelection()]
496  cat.prepare(processus.name(),element,1)
497  cat.loop()
498  cat.terminate()
499  self.plot(processus,False)
500  self.getControl("runCtrl").SetValue(cat.options().runNumber())
501 
502 

◆ onStart()

def AppFrame.AppFrame.onStart (   self,
  event 
)

Definition at line 420 of file AppFrame.py.

References AppFrame.AppFrame.elementCombo, AppFrame.AppFrame.getControl(), AppFrame.AppFrame.listElement, AppFrame.AppFrame.plotFreq(), and AppFrame.AppFrame.procCombo.

420  def onStart(self, event):
421  cat.options().setStorageDir(str(self.getControl("fileCtrl").GetValue()))
422  cat.options().setStoragePath(str(self.getControl("pathCtrl").GetValue()))
423  item=self.elementCombo.GetSelection()
424  element=cat.computer().child(self.listElement[item])
425  list=cat.procDb().list(element)
426  processus=list[self.procCombo.GetSelection()]
427  nevt=self.getControl("eventCtrl").GetValue()
428 
429  dlg = wx.ProgressDialog(processus.title(),
430  processus.name(),
431  maximum = abs(nevt),
432  parent=self,
433  style = wx.PD_CAN_ABORT
434  | wx.PD_APP_MODAL
435  | wx.PD_ELAPSED_TIME
436  | wx.PD_ESTIMATED_TIME
437  | wx.PD_REMAINING_TIME
438  )
439  plts = None
440  module = None
441  processus.setElement(element)
442  wrap = wrapper(cat, processus, "proc")
443 
444  online = cat.options().plotFreq()
445 
446  if (wrap.ok):
447  module = wrap.GetActive()
448  if module and online!=0 :
449  plts = module.createPlots(cat, processus, cat.options().runNumber())
450 
451  keepGoing = True
452 
453  timing = -1
454  if (nevt<0):
455  timing = time.time()
456  evt = abs(nevt)
457 
458  ievt=0
459  status=Code.SUCCESS
460  dlg.Update(ievt, " Initializing"+processus.name())
461  cat.prepare(processus.name(),element,nevt)
462  while (keepGoing):
463  ievt+=1
464  status=cat.loop()
465  if online>0 and plt:
466  if module and ievt%online==0:
467  module.updatePlots(plts, processus)
468  if timing>=0:
469  elapsed = time.time() - timing
470  (keepGoing, skip)=dlg.Update(elapsed,"Running "+processus.name())
471  if elapsed > evt: keepGoing = False
472  else:
473  (keepGoing, skip)=dlg.Update(ievt,"Running "+processus.name())
474  if ievt >= evt: keepGoing = False
475  dlg.Update(evt,"Finalizing "+processus.name())
476  cat.terminate()
477 
478  if module and online==0:
479  plts = module.createPlots(cat, processus, cat.options().runNumber())
480  if plts :
481  module.updatePlots(plts, processus)
482 
483  dlg.Destroy()
484 
485 # self.plot(processus,False)
486 # self.getControl("runCtrl").SetValue(cat.options().runNumber())
487 
488 

◆ onStopOnError()

def AppFrame.AppFrame.onStopOnError (   self,
  event 
)

Definition at line 273 of file AppFrame.py.

References AppFrame.AppFrame.getControl().

273  def onStopOnError(self, event):
274  cat.options().setStopOnError(self.getControl("stoponerror").GetValue())
275 

◆ plot()

def AppFrame.AppFrame.plot (   self,
  proc,
  force 
)

Definition at line 503 of file AppFrame.py.

Referenced by AppFrame.AppFrame.onSingle().

503  def plot(self, proc, force):
504  self.gphFrame.onPlot(proc)
505  if (force):
506  self.gphFrame.Show(True)
507  self.gphFrame.show=True
508 
509 

◆ plotFreq()

def AppFrame.AppFrame.plotFreq (   self,
  event 
)

Definition at line 293 of file AppFrame.py.

References AppFrame.AppFrame.getControl().

Referenced by AppFrame.AppFrame.onStart(), and AppFrame.AppFrame.update().

293  def plotFreq(self,event):
294  cat.options().setPlotFreq(self.getControl("plotFreq").GetValue())
295 

◆ printFreq()

def AppFrame.AppFrame.printFreq (   self,
  event 
)

Definition at line 290 of file AppFrame.py.

References AppFrame.AppFrame.getControl().

Referenced by AppFrame.AppFrame.update().

290  def printFreq(self,event):
291  cat.options().setPrintFreq(self.getControl("printFreq").GetValue())
292 

◆ procComboUpdate()

def AppFrame.AppFrame.procComboUpdate (   self,
  element 
)

Definition at line 617 of file AppFrame.py.

References AppFrame.AppFrame.procCombo.

Referenced by AppFrame.AppFrame.updateCombo().

617  def procComboUpdate(self, element):
618  self.procCombo.Clear()
619  self.procCombo.Remove(0,self.procCombo.GetLastPosition()+1)
620  list=cat.procDb().list(element)
621  for i in range(len(list)):
622  self.procCombo.Append(list[i].name())
623  self.procCombo.SetSelection(0)
624 
625 #----------------------------------------------------------------------------
626 

◆ runCtrl()

def AppFrame.AppFrame.runCtrl (   self,
  event 
)

Definition at line 287 of file AppFrame.py.

References AppFrame.AppFrame.getControl().

287  def runCtrl(self,event):
288  cat.options().setRunNumber(self.getControl("runCtrl").GetValue())
289 

◆ update()

def AppFrame.AppFrame.update (   self)

Definition at line 534 of file AppFrame.py.

References AppFrame.AppFrame.elementCombo, AppFrame.AppFrame.getControl(), AppFrame.AppFrame.plotFreq(), and AppFrame.AppFrame.printFreq().

Referenced by AppFrame.AppFrame.deleteHardware(), ConfFrame.ConfFrame.onChange(), GraphFrame.GraphFrame.onChange(), CfgFrame.CfgFrame.onChange(), ConfFrame.ConfFrame.onEdit(), AppFrame.AppFrame.onEdit(), AppFrame.AppFrame.onLoad(), ConfFrame.ConfFrame.onReLoad(), GraphFrame.GraphFrame.onReLoad(), CfgFrame.CfgFrame.onReLoad(), and AppFrame.AppFrame.onReLoad().

534  def update(self):
535  # Update options
536  self.getControl("cdffileCtrl").SetValue(cat.options().defFile());
537  self.getControl("printFreq").SetValue(cat.options().printFreq())
538  self.getControl("plotFreq").SetValue(cat.options().plotFreq())
539  self.getControl("eventCtrl").SetValue(cat.options().nEvtMax())
540  self.getControl("runCtrl").SetValue(cat.options().runNumber())
541  self.getControl("errorCtrl").SetValue(str(cat.options().nErrors()))
542  self.getControl("fileCtrl").SetValue(cat.options().storageDir())
543  self.getControl("pathCtrl").SetValue(cat.options().storagePath())
544  self.getControl("stoponerror").SetValue(cat.options().stopOnError())
545  self.getControl("autoCheck").SetValue(cat.options().runNumberMgr())
546  self.getControl("fileCheck").SetValue(cat.options().dataStorage())
547  self.getControl("logCheck").SetValue(cat.options().logStorage())
548  level=cat.options().logOutputLevel()
549  combo=self.getControl("outputLevel")
550  if level==MsgLevel.VERBOSE:
551  combo.SetSelection(0)
552  if level==MsgLevel.DEBUG:
553  combo.SetSelection(1)
554  if level==MsgLevel.INFO:
555  combo.SetSelection(2)
556  if level==MsgLevel.WARNING:
557  combo.SetSelection(3)
558  if level==MsgLevel.ERROR:
559  combo.SetSelection(4)
560  if level==MsgLevel.FATAL:
561  combo.SetSelection(5)
562  # Tree control
563 # self.RecreateTree()
564 # self.tree.SelectItem(self.root)
565  self.elementCombo.Clear()
566  self.listElement=self.ElementList()
567  index = 0
568  current = 0
569  for i in self.listElement:
570  if (i==cat.current().path("")):
571  current=index
572  index=index+1
573  self.elementCombo.Append(i)
574  self.elementCombo.SetSelection(current)
575  self.procComboUpdate(cat.current());
576  self.tree.RecreateTree(self.BuildElementList(), self.BuildProcessusList())
577 
def RecreateTree(self, myElements, myProcessus)
Definition: tree.py:224

◆ updateCombo()

def AppFrame.AppFrame.updateCombo (   self,
  event 
)

Definition at line 593 of file AppFrame.py.

References AppFrame.AppFrame.listElement, and AppFrame.AppFrame.procComboUpdate().

593  def updateCombo(self, event):
594  item=event.GetSelection()
595  if item==0:
596  element=cat.computer()
597  else:
598  element=cat.computer().child(self.listElement[item])
599  self.procComboUpdate(element)
600 

◆ updateOutputLevel()

def AppFrame.AppFrame.updateOutputLevel (   self,
  event 
)

Definition at line 601 of file AppFrame.py.

References AppFrame.AppFrame.getControl().

601  def updateOutputLevel(self, event):
602  level=self.getControl("outputLevel").GetValue()
603  if level=="Verbose":
604  cat.options().setLogOutputLevel(MsgLevel.VERBOSE)
605  if level=="Debug":
606  cat.options().setLogOutputLevel(MsgLevel.DEBUG)
607  if level=="Info":
608  cat.options().setLogOutputLevel(MsgLevel.INFO)
609  if level=="Warning":
610  cat.options().setLogOutputLevel(MsgLevel.WARNING)
611  if level=="Error":
612  cat.options().setLogOutputLevel(MsgLevel.ERROR)
613  if level=="Fatal Error":
614  cat.options().setLogOutputLevel(MsgLevel.FATAL)
615  print cat.options().logOutputLevel()
616 

Member Data Documentation

◆ cfgpanels

AppFrame.AppFrame.cfgpanels

Definition at line 67 of file AppFrame.py.

Referenced by AppFrame.AppFrame.onEdit().

◆ elementCombo

AppFrame.AppFrame.elementCombo

◆ listElement

AppFrame.AppFrame.listElement

◆ MB_CONF

AppFrame.AppFrame.MB_CONF

Definition at line 59 of file AppFrame.py.

◆ MB_GRAPH

AppFrame.AppFrame.MB_GRAPH

Definition at line 60 of file AppFrame.py.

◆ MB_LOG

AppFrame.AppFrame.MB_LOG

Definition at line 61 of file AppFrame.py.

◆ menuBar

AppFrame.AppFrame.menuBar

Definition at line 183 of file AppFrame.py.

◆ objs

◆ overviewText

string AppFrame.AppFrame.overviewText = "CAT Main Window"
static

Definition at line 55 of file AppFrame.py.

◆ panel

◆ path

AppFrame.AppFrame.path

◆ paths

◆ procCombo

AppFrame.AppFrame.procCombo

◆ TB_CONF

AppFrame.AppFrame.TB_CONF

Definition at line 63 of file AppFrame.py.

◆ TB_GRAPH

AppFrame.AppFrame.TB_GRAPH

Definition at line 64 of file AppFrame.py.

◆ TB_LOG

AppFrame.AppFrame.TB_LOG

Definition at line 65 of file AppFrame.py.

◆ toolBar

AppFrame.AppFrame.toolBar

Definition at line 207 of file AppFrame.py.

◆ tree

◆ treeContainer

AppFrame.AppFrame.treeContainer

Definition at line 117 of file AppFrame.py.

◆ vbox

AppFrame.AppFrame.vbox

Definition at line 118 of file AppFrame.py.


The documentation for this class was generated from the following file: