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

Public Member Functions

def __init__ (self, app, parent, title)
 
def getControl (self, panel, xmlid)
 
def makeToolBar (self)
 
def onIdle (self, event)
 
def onChange (self, event)
 
def onIconize (self, event)
 
def onReLoad (self, event)
 
def onPrint (self, event)
 
def onSave (self, event)
 
def onClose (self, event)
 
def onCloseAll (self, event)
 
def onPlot (self, obj)
 
def update (self)
 

Public Attributes

 figId
 
 parent
 
 app
 
 path
 
 panel
 
 notebook
 
 panels
 
 objs
 
 figs
 
 toolBar
 

Static Public Attributes

string overviewText = "CAT Graphical Window"
 

Detailed Description

Definition at line 25 of file GraphFrame.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 27 of file GraphFrame.py.

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

Member Function Documentation

◆ getControl()

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

Definition at line 44 of file GraphFrame.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().

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

◆ makeToolBar()

def GraphFrame.GraphFrame.makeToolBar (   self)

Definition at line 50 of file GraphFrame.py.

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

◆ onChange()

def GraphFrame.GraphFrame.onChange (   self,
  event 
)

◆ onClose()

def GraphFrame.GraphFrame.onClose (   self,
  event 
)

Definition at line 90 of file GraphFrame.py.

References GraphFrame.GraphFrame.figs, ConfFrame.ConfFrame.notebook, GraphFrame.GraphFrame.notebook, ConfFrame.ConfFrame.objs, GraphFrame.GraphFrame.objs, AppFrame.AppFrame.objs, ConfFrame.ConfFrame.panels, and GraphFrame.GraphFrame.panels.

90  def onClose(self, event):
91  pos=self.notebook.GetSelection()
92  self.notebook.DeletePage(pos)
93 # self.panels(pos).killFigure()
94 # self.panels(pos).Destroy()
95  self.panels.pop(pos)
96  self.objs.pop(pos)
97  self.figs.pop(pos)
98 

◆ onCloseAll()

def GraphFrame.GraphFrame.onCloseAll (   self,
  event 
)

Definition at line 99 of file GraphFrame.py.

References GraphFrame.GraphFrame.figs, ConfFrame.ConfFrame.notebook, GraphFrame.GraphFrame.notebook, ConfFrame.ConfFrame.objs, GraphFrame.GraphFrame.objs, AppFrame.AppFrame.objs, ConfFrame.ConfFrame.panels, and GraphFrame.GraphFrame.panels.

99  def onCloseAll(self, event):
100  self.notebook.DeleteAllPages()
101  self.panels=[]
102  self.objs =[]
103  self.figs =[]
104 

◆ onIconize()

def GraphFrame.GraphFrame.onIconize (   self,
  event 
)

Definition at line 77 of file GraphFrame.py.

References CfgFrame.CfgFrame.parent, ConfFrame.ConfFrame.parent, and GraphFrame.GraphFrame.parent.

77  def onIconize(self, event):
78  self.parent.gphFrame.Show(False)
79  self.parent.gphState=False
80 

◆ onIdle()

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

Definition at line 69 of file GraphFrame.py.

69  def onIdle(self, event):
70  '''Responds to idle time in the system'''
71  # when the timer says it's time, we do the actual downloading in the main thread (wx doesn't work well in secondary threads)
72  print "hello"
73 

◆ onPlot()

def GraphFrame.GraphFrame.onPlot (   self,
  obj 
)

Definition at line 105 of file GraphFrame.py.

References CfgFrame.CfgFrame.app, ConfFrame.ConfFrame.app, GraphFrame.GraphFrame.app, GraphFrame.GraphFrame.figId, GraphFrame.GraphFrame.figs, ConfFrame.ConfFrame.notebook, GraphFrame.GraphFrame.notebook, ConfFrame.ConfFrame.objs, GraphFrame.GraphFrame.objs, AppFrame.AppFrame.objs, ConfFrame.ConfFrame.panels, and GraphFrame.GraphFrame.panels.

105  def onPlot(self, obj):
106  wrap=wrapper(self.app,obj,"proc")
107  if (wrap.ok):
108  module=wrap.GetActive()
109  panel=module.Plot(self.app,obj,self.notebook,self.figId)
110  if panel!=None :
111  self.figId+=1
112  self.panels.append(panel)
113  self.objs.append(obj)
114  self.figs.append(panel)
115  self.notebook.AddPage(panel,obj.name(),True)
116 

◆ onPrint()

def GraphFrame.GraphFrame.onPrint (   self,
  event 
)

Definition at line 84 of file GraphFrame.py.

84  def onPrint(self, event):
85  print "printing..."
86 

◆ onReLoad()

def GraphFrame.GraphFrame.onReLoad (   self,
  event 
)

◆ onSave()

def GraphFrame.GraphFrame.onSave (   self,
  event 
)

Definition at line 87 of file GraphFrame.py.

87  def onSave(self, event):
88  print "save..."
89 

◆ update()

def GraphFrame.GraphFrame.update (   self)

Definition at line 117 of file GraphFrame.py.

References GraphFrame.GraphFrame.figs, ConfFrame.ConfFrame.notebook, and GraphFrame.GraphFrame.notebook.

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

117  def update(self):
118  pos=self.notebook.GetSelection()
119  self.figs[pos].current()
120 
121 #----------------------------------------------------------------------------
122 
123 
124 
125 

Member Data Documentation

◆ app

GraphFrame.GraphFrame.app

Definition at line 31 of file GraphFrame.py.

Referenced by GraphFrame.GraphFrame.onPlot().

◆ figId

GraphFrame.GraphFrame.figId

Definition at line 29 of file GraphFrame.py.

Referenced by GraphFrame.GraphFrame.onPlot().

◆ figs

◆ notebook

◆ objs

GraphFrame.GraphFrame.objs

◆ overviewText

string GraphFrame.GraphFrame.overviewText = "CAT Graphical Window"
static

Definition at line 26 of file GraphFrame.py.

◆ panel

◆ panels

GraphFrame.GraphFrame.panels

◆ parent

GraphFrame.GraphFrame.parent

Definition at line 30 of file GraphFrame.py.

Referenced by GraphFrame.GraphFrame.onIconize().

◆ path

GraphFrame.GraphFrame.path

Definition at line 32 of file GraphFrame.py.

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

◆ toolBar

GraphFrame.GraphFrame.toolBar

Definition at line 56 of file GraphFrame.py.


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