CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController Class Reference
Inheritance diagram for Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController:
Vispa.Plugins.Browser.BrowserTabController.BrowserTabController Vispa.Main.TabController.TabController Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController

Public Member Functions

def __init__
 
def activated
 
def close
 
def first
 
def goto
 
def isBusy
 
def last
 
def navigate
 
def next
 
def previous
 
def readFile
 
def refresh
 
def setDataAccessor
 
def updateEventNumberDisplay
 
- Public Member Functions inherited from Vispa.Plugins.Browser.BrowserTabController.BrowserTabController
def __init__
 
def activated
 
def boxContentDialog
 
def cancel
 
def centerView
 
def centerViewMenuButtonClicked
 
def close
 
def currentCenterViewClassId
 
def dataAccessor
 
def enableCenterViewSelectionMenu
 
def filter
 
def filterDialog
 
def filtered
 
def find
 
def isBusy
 
def loadIni
 
def onSelected
 
def onTreeViewSelected
 
def saveImage
 
def saveIni
 
def scriptChanged
 
def select
 
def setDataAccessor
 
def setEditable
 
def setTab
 
def setZoom
 
def showBoxContentDialog
 
def switchCenterView
 
def treeViewMenuButtonClicked
 
def updateCenterView
 
def updateContent
 
def updateTreeView
 
def updateViewMenu
 
def zoom
 
- Public Member Functions inherited from Vispa.Main.TabController.TabController
def __init__
 
def activated
 
def addUndoEvent
 
def allowClose
 
def allowSelectAll
 
def cancel
 
def checkModificationTimestamp
 
def close
 
def copy
 
def cut
 
def dumpUndoEvents
 
def enableUndo
 
def filename
 
def find
 
def getFileBasename
 
def isCopyPasteEnabled
 
def isEditable
 
def isFindEnabled
 
def isModified
 
def open
 
def paste
 
def plugin
 
def readFile
 
def redo
 
def redoEvents
 
def refresh
 
def resetZoomButtonPressedBefore
 
def save
 
def selectAll
 
def setAllowSelectAll
 
def setCopyPasteEnabled
 
def setEditable
 
def setFilename
 
def setFindEnabled
 
def setLastSavedStateEvent
 
def setModified
 
def setTab
 
def setZoom
 
def staticSupportedFileTypes
 
def supportedFileFilters
 
def supportedFileTypes
 
def supportsUndo
 
def tab
 
def undo
 
def undoEvents
 
def updateContent
 
def updateLabel
 
def writeFile
 
def zoom
 
def zoomAll
 
def zoomChanged
 
def zoomDialog
 
def zoomHundred
 
def zoomUser
 

Private Attributes

 _fileModifcationTimestamp
 
 _navigateTo
 
 _thread
 

Additional Inherited Members

- Static Public Attributes inherited from Vispa.Main.TabController.TabController
tuple staticSupportedFileTypes = staticmethod(staticSupportedFileTypes)
 
int TAB_LABEL_MAX_LENGTH = 20
 

Detailed Description

The EventBrowserTabController supplies functionality for browsing objects in an EventBrowserTab and navigating through events.

Definition at line 13 of file EventBrowserTabController.py.

Constructor & Destructor Documentation

def Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.__init__ (   self,
  plugin 
)

Member Function Documentation

def Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.activated (   self)
Show event menu when tab is shown.

Definition at line 38 of file EventBrowserTabController.py.

References Vispa.Main.TabController.TabController.isEditable(), PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.plugin, lhef::FastJetAlgorithmWrapper.plugin, Vispa.Main.TabController.TabController.plugin(), Vispa.Main.Application.Application.plugin(), and Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.updateEventNumberDisplay().

38 
39  def activated(self):
40  """ Show event menu when tab is shown.
41  """
42  BrowserTabController.activated(self)
44  if not self.isEditable():
45  self.plugin().application().showPluginMenu(self.plugin().navigateMenu())
46  self.plugin().application().showPluginToolBar(self.plugin().navigateToolBar())
def Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.close (   self)
Close data file.

Definition at line 25 of file EventBrowserTabController.py.

References Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.dataAccessor().

Referenced by lumiQTWidget.ApplicationWindow.fileQuit(), Vispa.Gui.BoxContentDialog.BoxContentDialog.keyPressEvent(), Vispa.Gui.FindDialog.FindDialog.keyPressEvent(), and Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.navigate().

25 
26  def close(self):
27  """ Close data file.
28  """
29  result=BrowserTabController.close(self)
30  if result:
31  self.dataAccessor().close()
32  return result
def Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.first (   self)
Navigate and to first event.

Definition at line 100 of file EventBrowserTabController.py.

References Vispa.Gui.TextDialog.TextDialog.cancel, Vispa.Main.TabController.TabController.cancel(), Vispa.Main.Application.Application.cancel(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.dataAccessor(), and Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.navigate().

101  def first(self):
102  """ Navigate and to first event.
103  """
104  logging.debug(__name__ + ": first")
105  self.cancel()
106  currentEvent=self.dataAccessor().eventNumber()
107  if currentEvent>1:
108  self.navigate(1)
def Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.goto (   self,
  number = None 
)
Ask event number in dialog and navigate and to event.

Definition at line 142 of file EventBrowserTabController.py.

References Vispa.Gui.TextDialog.TextDialog.cancel, Vispa.Main.TabController.TabController.cancel(), Vispa.Main.Application.Application.cancel(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.dataAccessor(), Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.navigate(), PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.plugin, lhef::FastJetAlgorithmWrapper.plugin, Vispa.Main.TabController.TabController.plugin(), and Vispa.Main.Application.Application.plugin().

143  def goto(self, number=None):
144  """ Ask event number in dialog and navigate and to event.
145  """
146  logging.debug(__name__ + ": goto")
147  if self._dataAccessor.numberOfEvents():
148  max = self._dataAccessor.numberOfEvents()
149  else:
150  max = sys.maxint
151  if number!=None:
152  ok=(number>=1, number<=max)
153  else:
154  if hasattr(QInputDialog, "getInteger"):
155  # Qt 4.3
156  (number, ok) = QInputDialog.getInteger(self.plugin().application().mainWindow(), "Goto...", "Enter event number:", self._dataAccessor.eventNumber(), 1, max)
157  else:
158  # Qt 4.5
159  (number, ok) = QInputDialog.getInt(self.plugin().application().mainWindow(), "Goto...", "Enter event number:", self._dataAccessor.eventNumber(), 1, max)
160  if ok:
161  self.cancel()
162  currentEvent=self.dataAccessor().eventNumber()
163  if currentEvent!=number:
164  self.navigate(number)
def Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.isBusy (   self)

Definition at line 66 of file EventBrowserTabController.py.

References Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController._thread, and Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController._thread.

66 
67  def isBusy(self):
68  return BrowserTabController.isBusy(self) or\
69  (self._thread and self._thread.isRunning())
def Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.last (   self)
Navigate and to last event.

Definition at line 130 of file EventBrowserTabController.py.

References Vispa.Gui.TextDialog.TextDialog.cancel, Vispa.Main.TabController.TabController.cancel(), Vispa.Main.Application.Application.cancel(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.dataAccessor(), and Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.navigate().

131  def last(self):
132  """ Navigate and to last event.
133  """
134  logging.debug(__name__ + ": last")
135  self.cancel()
136  currentEvent=self.dataAccessor().eventNumber()
137  allEvents=self.dataAccessor().numberOfEvents()
138  if allEvents==None:
139  allEvents=sys.maxint
140  if currentEvent<allEvents:
141  self.navigate(allEvents)
def Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.navigate (   self,
  to 
)

Definition at line 70 of file EventBrowserTabController.py.

References Vispa.Main.TabController.TabController._filename, MuonGeometryArrange._filename, TrackerGeometryCompare._filename, Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController._navigateTo, Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.close(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.dataAccessor(), edm::ELlog4cplus.emit(), HcalHTRData.isBusy(), stor::DiskWriterResources.isBusy(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.isBusy(), PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.plugin, lhef::FastJetAlgorithmWrapper.plugin, Vispa.Main.TabController.TabController.plugin(), Vispa.Main.Application.Application.plugin(), SurveyDataReader.readFile(), SurveyInputTextReader.readFile(), DeviationsFromFileSensor2D.readFile(), edm::IEventProcessor.readFile(), edm::InputSource.readFile(), Vispa.Main.TabController.TabController.readFile(), edm::EventProcessor.readFile(), DQMStore.readFile(), Vispa.Main.TabController.TabController.updateContent(), and Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.updateEventNumberDisplay().

Referenced by Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.first(), Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.goto(), Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.last(), Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.next(), and Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.previous().

70 
71  def navigate(self,to):
72  # remember if navigation is ongoing
73  navigating=self._navigateTo
74  # set where to navigate
75  self._navigateTo=to
76  # if navigation is ongoing return
77  if navigating!=None:
78  return
79  # if window is busy navigate later
80  if self.isBusy():
81  self.emit(SIGNAL("navigate"),to)
82  return
83  update=False
84  while self._navigateTo!=None:
85  current=self._navigateTo
86  if self._navigateTo==0:
87  statusMessage = self.plugin().application().startWorking("Reopening file")
88  self.dataAccessor().close()
89  self.readFile(self._filename)
90  else:
91  statusMessage = self.plugin().application().startWorking("Navigate in file")
92  if self._dataAccessor.goto(self._navigateTo):
93  update=True
94  if current==self._navigateTo:
95  self._navigateTo=None
96  if update:
97  self.updateContent()
99  self.plugin().application().stopWorking(statusMessage)
def Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.next (   self)
Navigate and to next event.

Definition at line 118 of file EventBrowserTabController.py.

References Vispa.Gui.TextDialog.TextDialog.cancel, Vispa.Main.TabController.TabController.cancel(), Vispa.Main.Application.Application.cancel(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.dataAccessor(), and Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.navigate().

Referenced by BeautifulSoup.PageElement._invert().

119  def next(self):
120  """ Navigate and to next event.
121  """
122  logging.debug(__name__ + ": next")
123  self.cancel()
124  currentEvent=self.dataAccessor().eventNumber()
125  allEvents=self.dataAccessor().numberOfEvents()
126  if allEvents==None:
127  allEvents=sys.maxint
128  if currentEvent<allEvents:
129  self.navigate(currentEvent+1)
def Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.previous (   self)
Navigate and to previous event.

Definition at line 109 of file EventBrowserTabController.py.

References Vispa.Gui.TextDialog.TextDialog.cancel, Vispa.Main.TabController.TabController.cancel(), Vispa.Main.Application.Application.cancel(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.dataAccessor(), and Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.navigate().

Referenced by BeautifulSoup.PageElement._invert().

110  def previous(self):
111  """ Navigate and to previous event.
112  """
113  logging.debug(__name__ + ": previous")
114  self.cancel()
115  currentEvent=self.dataAccessor().eventNumber()
116  if currentEvent>1:
117  self.navigate(currentEvent-1)
def Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.readFile (   self,
  filename 
)
Reads in the file in a separate thread.

Definition at line 53 of file EventBrowserTabController.py.

References Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController._thread, Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController._thread, Vispa.Gui.TextDialog.TextDialog.cancel, Vispa.Main.TabController.TabController.cancel(), Vispa.Main.Application.Application.cancel(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.dataAccessor(), and Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.updateEventNumberDisplay().

53 
54  def readFile(self, filename):
55  """ Reads in the file in a separate thread.
56  """
57  self.cancel()
58  self._thread = ThreadChain(self.dataAccessor().open, filename)
59  while self._thread.isRunning():
60  if not Application.NO_PROCESS_EVENTS:
61  QCoreApplication.instance().processEvents()
62  if self._thread.returnValue():
64  return True
65  return False
def Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.refresh (   self)

Definition at line 47 of file EventBrowserTabController.py.

47 
48  def refresh(self):
49  eventNum=self._dataAccessor.eventNumber()
50  self._fileModifcationTimestamp = os.path.getmtime(self._filename)
51  self.navigate(0)
52  self.navigate(eventNum)
def Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.setDataAccessor (   self,
  accessor 
)

Definition at line 33 of file EventBrowserTabController.py.

33 
34  def setDataAccessor(self, accessor):
35  if not isinstance(accessor, EventFileAccessor):
36  raise TypeError(__name__ + " requires data accessor of type EventFileAccessor.")
37  BrowserTabController.setDataAccessor(self, accessor)
def Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.updateEventNumberDisplay (   self)

Definition at line 165 of file EventBrowserTabController.py.

References PFTauMVAInputDiscriminantTranslator::DiscriminantInfo.plugin, lhef::FastJetAlgorithmWrapper.plugin, Vispa.Main.TabController.TabController.plugin(), and Vispa.Main.Application.Application.plugin().

Referenced by Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.activated(), Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.navigate(), and Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.readFile().

166  def updateEventNumberDisplay(self):
167  eventDisplayString = str(self._dataAccessor.eventNumber()) + "/"
168  if self._dataAccessor.numberOfEvents():
169  eventDisplayString += str(self._dataAccessor.numberOfEvents())
170  else:
171  eventDisplayString += "?"
172  self.plugin().eventNumberDisplay().setText(eventDisplayString)

Member Data Documentation

Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController._fileModifcationTimestamp
private

Definition at line 49 of file EventBrowserTabController.py.

Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController._navigateTo
private

Definition at line 22 of file EventBrowserTabController.py.

Referenced by Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.navigate().

Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController._thread
private

Definition at line 21 of file EventBrowserTabController.py.

Referenced by Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.isBusy(), and Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController.readFile().