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

Public Member Functions

def __init__ (self, app, parent, title)
 
def getControl (self, panel, xmlid)
 
def makeToolBar (self)
 
def onIdle (self, event)
 
def onIconize (self, event)
 
def onChange (self, event)
 
def onReLoad (self, event)
 
def onClose (self, event)
 
def onCloseAll (self, event)
 
def onEdit (self, obj, path, type)
 
def update (self)
 

Public Attributes

 parent
 
 app
 
 path
 
 panel
 
 notebook
 
 panels
 
 objs
 
 paths
 
 wraps
 
 confs
 
 toolBar
 

Static Public Attributes

string overviewText = "CAT Configuration Window"
 

Detailed Description

Definition at line 23 of file ConfFrame.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 25 of file ConfFrame.py.

25  def __init__(self,app,parent,title):
26  wx.Frame.__init__(self, parent, wx.NewId(), title)
27  self.parent=parent
28  self.app=app
29  self.path=os.path.join(os.environ.get("CATPATH"), "CatPython", "python")
30  self.makeToolBar()
31  res=xrc.XmlResource(os.path.join(self.path,"xrc/ConfPanel.xrc"))
32  self.panel=res.LoadPanel(self, "ConfPanel")
33 # self.notebook=xrc.XRCCTRL(self, 'notebook')
34  self.notebook=self.getControl(self.panel,'notebook')
35  self.panels=list()
36  self.objs=list()
37  self.paths=list()
38  self.wraps=list()
39  self.confs=list()
40  self.Bind(wx.EVT_CLOSE, self.onIconize)
41  self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.onChange)
42 
def __init__(self, dict)
Definition: wrapper.py:56

Member Function Documentation

◆ getControl()

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

Definition at line 43 of file ConfFrame.py.

Referenced by Proto40MHz_v1.Proto40MHz_v1.isReady(), ProtoFEB_v1.ProtoFEB_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(), Acquisition.Acquisition.onDeadtime(), Acquisition.Acquisition.onDepth(), Proto40MHz_v1.Proto40MHz_v1.onenableAll(), ProtoFEB_v1.ProtoFEB_v1.onenableAll(), Acquisition.Acquisition.onMax(), Acquisition.Acquisition.onMin(), Proto40MHz_v1.Proto40MHz_v1.onModeAX(), ProtoFEB_v1.ProtoFEB_v1.onModeAX(), ProtoFEB_v1.ProtoFEB_v1.onModeCh(), Proto40MHz_v1.Proto40MHz_v1.onModeCh(), Acquisition.Acquisition.onNBins(), Acquisition.Acquisition.onNSample(), ProtoFEB_v1.ProtoFEB_v1.onPipeline(), Proto40MHz_v1.Proto40MHz_v1.onPipeline(), Acquisition.Acquisition.onSample(), Acquisition.Acquisition.onSoftTrig(), ProtoFEB_v1.ProtoFEB_v1.onSoftTrig(), Proto40MHz_v1.Proto40MHz_v1.onSoftTrig(), Acquisition.Acquisition.onTree(), Acquisition.Acquisition.onTrend(), Proto40MHz_v1.Proto40MHz_v1.onunableAll(), ProtoFEB_v1.ProtoFEB_v1.onunableAll(), element.element.parent(), proc.proc.parent(), Acquisition.Acquisition.update(), ProtoFEB_v1.ProtoFEB_v1.update(), and Proto40MHz_v1.Proto40MHz_v1.update().

43  def getControl(self, panel, xmlid):
44  '''Retrieves the given control (within a dialog) by its xmlid'''
45  control = panel.FindWindowById(xrc.XRCID(xmlid))
46  assert control != None, 'Programming error: a control with xml id ' + xmlid + ' was not found.'
47  return control
48 
49 

◆ makeToolBar()

def ConfFrame.ConfFrame.makeToolBar (   self)

Definition at line 50 of file ConfFrame.py.

50  def makeToolBar(self):
51  TB_RELOAD=wx.NewId()
52  TB_CLOSEALL=wx.NewId()
53  TB_CLOSE=wx.NewId()
54  #
55  self.toolBar = self.CreateToolBar(wx.TB_DOCKABLE)
56  self.toolBar.AddLabelTool(TB_CLOSEALL, '', wx.Bitmap(os.path.join(self.path,"xrc/icons/closeall.png")))
57  self.toolBar.AddLabelTool(TB_CLOSE , '', wx.Bitmap(os.path.join(self.path,"xrc/icons/close.png")))
58  self.toolBar.AddSeparator()
59  self.toolBar.AddLabelTool(TB_RELOAD, '', wx.Bitmap(os.path.join(self.path,"xrc/icons/reload.png")))
60  self.toolBar.Realize()
61  self.Bind(wx.EVT_TOOL, self.onReLoad , id=TB_RELOAD)
62  self.Bind(wx.EVT_TOOL, self.onCloseAll , id=TB_CLOSEALL)
63  self.Bind(wx.EVT_TOOL, self.onClose , id=TB_CLOSE)
64 

◆ onChange()

def ConfFrame.ConfFrame.onChange (   self,
  event 
)

◆ onClose()

def ConfFrame.ConfFrame.onClose (   self,
  event 
)

Definition at line 79 of file ConfFrame.py.

References ConfFrame.ConfFrame.confs, ConfFrame.ConfFrame.notebook, ConfFrame.ConfFrame.objs, AppFrame.AppFrame.objs, ConfFrame.ConfFrame.panels, ConfFrame.ConfFrame.paths, AppFrame.AppFrame.paths, and ConfFrame.ConfFrame.wraps.

79  def onClose(self, event):
80  pos=self.notebook.GetSelection()
81  self.notebook.DeletePage(pos)
82  self.panels.pop(pos)
83  self.objs.pop(pos)
84  self.paths.pop(pos)
85  self.wraps.pop(pos)
86  self.confs.pop(pos)
87 

◆ onCloseAll()

def ConfFrame.ConfFrame.onCloseAll (   self,
  event 
)

Definition at line 88 of file ConfFrame.py.

References ConfFrame.ConfFrame.confs, ConfFrame.ConfFrame.notebook, ConfFrame.ConfFrame.objs, AppFrame.AppFrame.objs, ConfFrame.ConfFrame.panels, ConfFrame.ConfFrame.paths, AppFrame.AppFrame.paths, and ConfFrame.ConfFrame.wraps.

88  def onCloseAll(self, event):
89  self.notebook.DeleteAllPages()
90  self.panels=[]
91  self.objs =[]
92  self.paths=[]
93  self.wraps=[]
94  self.confs=[]
95 

◆ onEdit()

def ConfFrame.ConfFrame.onEdit (   self,
  obj,
  path,
  type 
)

Definition at line 96 of file ConfFrame.py.

References CfgFrame.CfgFrame.app, ConfFrame.ConfFrame.app, ConfFrame.ConfFrame.confs, ConfFrame.ConfFrame.notebook, ConfFrame.ConfFrame.objs, AppFrame.AppFrame.objs, ConfFrame.ConfFrame.panels, ConfFrame.ConfFrame.paths, AppFrame.AppFrame.paths, Croc.Croc.update(), Computer.Computer.update(), A3PE_BitFlip.A3PE_BitFlip.update(), EmulateFE.EmulateFE.update(), InterfaceWrap.update(), ElementWrap.update(), ProcDataBase.update(), TestUSB.TestUSB.update(), TestI2C.TestI2C.update(), TestSPI.TestSPI.update(), TestSuite.TestSuite.update(), StorageFifo.StorageFifo.update(), StorageFifoAcquisition.StorageFifoAcquisition.update(), CurrentMeasurement.CurrentMeasurement.update(), ADCMeasurement.CurrentMeasurement.update(), UsbFTInterfaceTest.UsbFTInterfaceTest.update(), Interface.update(), IOobject.update(), Croc.update(), UsbI2cBus.update(), UsbSpiBus.update(), UsbMLSpiBus.update(), UsbMLI2cBus.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(), CfgFrame.CfgFrame.update(), MSOxxxx.update(), ICPhaser.update(), ICECALv3.update(), ConfFrame.ConfFrame.update(), LSDelayChipV1.update(), A3PE.update(), AppFrame.AppFrame.update(), and ConfFrame.ConfFrame.wraps.

96  def onEdit(self, obj, path, type):
97  objpanel=-1
98  for i in range(len(self.objs)):
99  if path==self.paths[i]:
100  objpanel=i
101  if objpanel!=-1:
102  self.notebook.SetSelection(objpanel)
103  self.update()
104  else:
105 # if (type=='element'):
106 # res=xrc.XmlResource(os.path.join(self.path,"xrc/ElementMain.xrc"))
107 # elif (type=='proc'):
108 # res=xrc.XmlResource(os.path.join(self.path,"xrc/ProcMain.xrc"))
109  #panel=res.LoadPanel(self.notebook,"NotebookId")
110  #self.panels.append(panel)
111  self.objs.append(obj)
112  self.paths.append(path)
113  wrap=wrapper(self.app,obj,type)
114  self.wraps.append(wrap)
115 #
116 # if (type=='element'):
117 # namectrl=self.getControl(panel,'ObjName')
118 # pathctrl=self.getControl(panel,'ObjPath')
119 # namectrl.SetValue(obj.name())
120 # pathctrl.SetValue(path)
121 # elif (type=='proc'):
122 # namectrl=self.getControl(panel,'ProcName')
123 # pathctrl=self.getControl(panel,'ProcPath')
124 # namectrl.SetValue(obj.name())
125 # pathctrl.SetValue(obj.type())
126  module=wrap.GetActive()
127  panel=module.Edit(self.app,obj,self.notebook,wrap.GetFilePath())
128  self.panels.append(panel)
129  self.confs.append(panel)
130  self.notebook.AddPage(panel.page(),obj.name(),True)
131 # self.notebook.Fit()
132 # self.notebook.SetSize(self.GetSize())
133  self.Layout()
134 # panel.Fit()
135 # print "panel size=",panel.GetSize()
136 # print "notebook size=",self.notebook.GetSize()
137 

◆ onIconize()

def ConfFrame.ConfFrame.onIconize (   self,
  event 
)

Definition at line 69 of file ConfFrame.py.

69  def onIconize(self, event):
70  self.parent.cfgFrame.Show(False)
71  self.parent.cfgState=False
72 

◆ onIdle()

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

Definition at line 65 of file ConfFrame.py.

65  def onIdle(self, event):
66  '''Responds to idle time in the system'''
67  # when the timer says it's time, we do the actual downloading in the main thread (wx doesn't work well in secondary threads)
68 

◆ onReLoad()

def ConfFrame.ConfFrame.onReLoad (   self,
  event 
)

◆ update()

def ConfFrame.ConfFrame.update (   self)

Definition at line 138 of file ConfFrame.py.

References ConfFrame.ConfFrame.notebook, and ConfFrame.ConfFrame.panels.

Referenced by ConfFrame.ConfFrame.onChange(), GraphFrame.GraphFrame.onChange(), ConfFrame.ConfFrame.onEdit(), ConfFrame.ConfFrame.onReLoad(), and GraphFrame.GraphFrame.onReLoad().

138  def update(self):
139  pos=self.notebook.GetSelection()
140  self.panels[pos].update()
141 
142 #----------------------------------------------------------------------------
143 
144 
145 
146 

Member Data Documentation

◆ app

ConfFrame.ConfFrame.app

Definition at line 28 of file ConfFrame.py.

Referenced by ConfFrame.ConfFrame.onEdit(), and GraphFrame.GraphFrame.onPlot().

◆ confs

ConfFrame.ConfFrame.confs

◆ notebook

◆ objs

◆ overviewText

string ConfFrame.ConfFrame.overviewText = "CAT Configuration Window"
static

Definition at line 24 of file ConfFrame.py.

◆ panel

◆ panels

◆ parent

ConfFrame.ConfFrame.parent

Definition at line 27 of file ConfFrame.py.

Referenced by GraphFrame.GraphFrame.onIconize().

◆ path

ConfFrame.ConfFrame.path

Definition at line 29 of file ConfFrame.py.

Referenced by element.element.loadxrc(), and proc.proc.loadxrc().

◆ paths

ConfFrame.ConfFrame.paths

◆ toolBar

ConfFrame.ConfFrame.toolBar

Definition at line 55 of file ConfFrame.py.

◆ wraps

ConfFrame.ConfFrame.wraps

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