LATTE: LatTE Documentation

LatTE Documentation

R04-12-00

Generated on Fri Jul 21 13:26:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: File Index

LATTE File List

Here is a list of all documented files with brief descriptions:
AcdHWMultiplexer.py [code]
AcdPanel.py [code]
AlertGuiImpl.py [code]
ancillaryContribution.py [code]
ancillaryFile.py [code]
ancillarySocket.py [code]
ArgumentImpl.py [code]
bar.py [code]
barw.py [code]
BrowserImpl.py [code]
browserPreferencesImpl.py [code]
BTdump.py [code]
Collector.py [code]
colorScale.py [code]
consumer.py [code]
consumerPlotter.py [code]
copyright_SLAC.py [code]
DataDistributor.py [code]
DataDistributorPoll.py [code]
DataExport.py [code]
dispatcher.py [code]
doublehisto.py [code]
EnvMonImpl.py [code]
errors.py [code]
evtDataImpl.py [code]
excApp.py [code]
FEpowerUp.py [code]
fileMerge.py [code]
fits2ldf.py [code]
FreeSpace.py [code]
FSM.py [code]
gAEM.py [code]
gAlert.py [code]
gAttr.py [code]
gBits.py [code]
gCmdCli.py [code]
gCommand.py [code]
gConstraint.py [code]
gCRU.py [code]
gDb.py [code]
geb.py [code]
gEBM.py [code]
gEGU.py [code]
gEPU.py [code]
gEvtCli.py [code]
gEvtCliBT.py [code]
gException.py [code]
gFabrics.py [code]
gFswMessages.py [code]
gGEM.py [code]
gGLT.py [code]
gGroup.py [code]
gHdb.py [code]
gHSK.py [code]
gLAT.py [code]
gLCB.py [code]
GlobalPanelImpl.py [code]
gLog.py [code]
gLoopback.py [code]
gMem.py [code]
gNAT.py [code]
gNode.py [code]
gOCS.py [code]
gOcsMessages.py [code]
gOpcode.py [code]
gOptions.py [code]
GOSED_LDF.py [code]
GOSEDACDImpl.py [code]
GOSEDCALImpl.py [code]
GOSEDCALTKRImpl.py [code]
GOSEDDataImpl.py [code]
gosedImpl.py [code]
GOSEDPainter.py [code]
GOSEDPreferencesImpl.py [code]
GOSEDTKRImpl.py [code]
GOSEDTWRImpl.py [code]
GOTEDImpl.py [code]
gPDU.py [code]
GpibPwrCtrlImpl.py [code]
gPlumber.py [code]
gRegister.py [code]
gResponse.py [code]
gRule.py [code]
gSchemaConfig.py [code]
gSIU.py [code]
gSocket.py [code]
gTEM.py [code]
gTPG.py [code]
guiBridges.py [code]
gVersions.py [code]
gXBR.py [code]
HskAlarms.py [code]
HskCli.py [code]
HskCollector.py [code]
HskGuiReceiver.py [code]
HskPacket.py [code]
HskPacketDecoder.py [code]
HskPacketRetriever.py [code]
HskReceiver.py [code]
HskRecorder.py [code]
HskRegisters.py [code]
HskRetriever.py [code]
HskSqlGuiReceiver.py [code]
HskSqlInterface.py [code]
HskSqlSvr.py [code]
HskSvr.py [code]
HskTestSvr.py [code]
hTestAppEvt.py [code]
hTestAppTkr.py [code]
hTestEnv.py [code]
hTestStrip.py [code]
imagedata.py [code]
LATsweep.py [code]
ldf2fits.py [code]
ldfContribution.py [code]
ldfFile.py [code]
ldfSocket.py [code]
listmean.py [code]
MailAlert.py [code]
mask.py [code]
MiniGLTExample.py [code]
monitoringDbSyncIn.py [code]
monitoringDbSyncOut.py [code]
MSGLogGUIImpl.py [code]
multibar.py [code]
nullApp.py [code]
NullObjects.py [code]
parseFswHsk.py [code]
PorcinePanel.py [code]
PowerPanelImpl.py [code]
radiomask.py [code]
rcArchiver.py [code]
rcCommentPanel.py [code]
rcComplStatus.py [code]
rcDefaultTrigger.py [code]
rcEndRunDlgImpl.py [code]
rcFitsWriter.py [code]
rcHouseKeeping.py [code]
rcLoginImpl.py [code]
rcParamVerifier.py [code]
rcParamVerifyGUIImpl.py [code]
rcPreferencesGUIImpl.py [code]
rcPreferencesManager.py [code]
rcPythonShell.py [code]
rcReportGen.py [code]
rcRunIdHelper.py [code]
rcScmCfgSelector.py [code]
rcSecurityMan.py [code]
rcStatusMonitor.py [code]
rcSuite.py [code]
rcTestReport.py [code]
rcTransitions.py [code]
rcTransitionsBT.py [code]
rcTrgFunctions.py [code]
rcTrgGem.py [code]
rcTrgMiniGLT.py [code]
rcUsers.py [code]
rcUtil.py [code]
Receiver.py [code]
Recorder.py [code]
Retriever.py [code]
robustapply.py [code]
RunControl.py [code]
RunControlCommon.py [code]
RunControlFSM.py [code]
RunControlGUIImpl.py [code]
RunControlMain.py [code]
RunControlMainGUIImpl.py [code]
saferef.py [code]
ServerPreferencesImpl.py [code]
SimpleGasuExample.py [code]
socketLogging.py [code]
socketMerge.py [code]
splitOutTem.py [code]
standardLDF.py [code]
standardPlotter.py [code]
standardPlotterGuiImpl.py [code]
startupGUI.py [code]
startupMainGUI.py [code]
suiteRunner.py [code]
sweepRejectTest.py [code]
taskEngine.py [code]
temLrsTest.py [code]
test_aem.py [code]
test_aeq.py [code]
test_bcast.py [code]
test_cmd.py [code]
test_cmdrsp.py [code]
test_cmxasbuilt.py [code]
test_db.py [code]
test_evt_aem.py [code]
test_evt_cal.py [code]
test_evt_exttrg.py [code]
test_evt_filters.py [code]
test_evt_tkr.py [code]
test_gafe.py [code]
test_garc.py [code]
test_glt.py [code]
test_initfabrics.py [code]
test_lat.py [code]
test_loopback.py [code]
test_mem.py [code]
test_options.py [code]
test_pduswitch.py [code]
test_peq.py [code]
test_playback.py [code]
test_power.py [code]
test_rate.py [code]
test_schema.py [code]
test_tem.py [code]
test_teq.py [code]
test_twoclients.py [code]
testAppAcd.py [code]
testAppAcdScalers.py [code]
testAppAlarm.py [code]
testAppArchiver.py [code]
testAppCal.py [code]
testAppCal_dg.py [code]
testAppEvt.py [code]
testAppEvtCli.py [code]
testAppEvtTO.py [code]
testAppExclude.py [code]
testAppLDFdump.py [code]
testAppMinimal.py [code]
testAppNoVersion.py [code]
testAppReport.py [code]
testAppTkr.py [code]
testArchiver.py [code]
testErrorPropogation.py [code]
testEvtBldr_script.py [code]
testEvtCli.py [code]
testPreload.py [code]
testRunner.py [code]
testSAppCal.py [code]
testSAppCal_Lean.py [code]
testSAppEvt.py [code]
testSuite.py [code]
testSuite2.py [code]
testSuite_Lean.py [code]
testSuiteLong.py [code]
testSuiteSummary.py [code]
testSummary.py [code]
testTkrHitFilter.py [code]
testTrending.py [code]
testTrgParityError.py [code]
towerwidgetImpl.py [code]
transitionRejectTest.py [code]
Trendable.py [code]
TrendMaps.py [code]
TrgAbstract.py [code]
TrgCmdCounters.py [code]
TrgCnoCounters.py [code]
TrgCoincidences.py [code]
TrgConditions.py [code]
TrgConditionsValue.py [code]
trgConsumer.py [code]
trgDisplayImpl.py [code]
TrgEngines.py [code]
TrgEventCounter.py [code]
TrgGem.py [code]
TrgGemAbstract.py [code]
TrgGemCounters.py [code]
TrgGemPeriodicCondition.py [code]
TrgGemRegisterGeometry.py [code]
TrgGemRegisters.py [code]
TrgGemSequence.py [code]
TrgInputEnables.py [code]
TrgMiniGLT.py [code]
TrgMiniGLTAbstract.py [code]
TrgMiniGLTRegisters.py [code]
TrgObject.py [code]
TrgPeriodic.py [code]
TrgPPSTimer.py [code]
TrgRoiAsTiles.py [code]
TrgRoiAsVeto.py [code]
TrgSequence.py [code]
TrgTileCounters.py [code]
TrgTower.py [code]
TrgTriggerCounters.py [code]
TrgUsingTiles.py [code]
userAppBrowser.py [code]
userAppLeaf.py [code]
userAppLoader.py [code]
userAppTree.py [code]
Generated on Fri Jul 21 13:26:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class List

Here are the classes, structs, unions and interfaces with brief descriptions:
_Anonymous |
_Any |
_Attr |
_Parameter |
_regList |
AcdHWMultiplexer | AcdHWMultiplexer class
ACDmap |
AcdPanel |
ACDPowerPanel |
ACDSingleEvtDisplayImpl |
AddableRoi |
AEM | AEM event object
AEMcontributionIterator |
AEMcontributionIterator_ |
AEQHskRegMap |
AlertGuiImpl |
AncillaryContribution |
AncillaryContributor |
AncillaryContributor |
AncillaryContributor | Concrete contributor class specifically meant to work with EvtCli
ArgumentImpl |
BadGasuExample | BadGasuExample
BadGLTExample | MiniTower example interface to MiniGLT
bar |
barw |
bf |
BitField |
BoundMethodWeakref |
BrowserImpl |
browserPreferencesImpl |
CAL_LATcontribution |
CALcontributionIterator |
CALcontributionIterator2 | CAL contribution Displayer
ccsdsHeader | CCSDS Header bitfield definition
ccsdsPacket | Interface to a generic CCSDS packet
ccsdsSocket |
CheckLed |
Children |
CmdCli |
Collector |
Command |
CommentEntryWidget |
ConfigElement | Wrapper class for providing a compatibility layer between the old minidom XML DOMs and the new 4Suite Domlette DOMs
ConnectState |
ConnectState |
ConnectState |
Consumer | Consumer class to consume LDF data This class just handles file open/close or server open/close
consumerPlotter | Consumer class to consume LDF data This class just handles file open/close or server open/close
CratePanel |
DataDistributorAddress | Data distributor address class containing static methods that govern the picking of multicast ports and addresses
DataDistributorClient | Data distributor client class
DataDistributorPoll | Data distributor client that polls for samples of data
DataDistributorServer | Data Distributor Server
DataExport | Class to synch a file or set of files between one location and another
DefaultPeriodicCondition | DefaultPeriodicCondition class
DefaultSequence |
DIAGcontributionIterator |
DIAGcontributionIterator_ |
DispatcherError |
DispatcherKeyError |
DispatcherTypeError |
doublehisto |
drawHatACD |
drawRainbowACD |
drawRainbowCAL |
drawSide1ACD |
drawSide2ACD |
drawSide3ACD |
drawSide4ACD |
drawXZ_CAL |
drawXZ_TKR |
drawYZ_CAL |
drawYZ_TKR |
DummyRecorder | Example recorder that dumps the trendables to a logger
DummyRetriever |
EBFeventIterator |
Email |
EMPanel |
EnvMonImpl |
ERRcontributionIterator_ |
ErrorLogCounterHandler |
evAEM_PHA | PHA object
evCAL_LayerLogData | Class that associates a layer with the log data
evCAL_LogAccepts | Log Accepts bitfields
evCAL_LogData | Log Data bitfields
evCellHeader | Cell Header bitfields
evCellHeader_Singleton |
evContPacket | Contribution Packet bitfields
evContPacket_Singleton |
evDiag_CalLayer | Calorimeter Layer class
evDiag_CalLayerEnd | Calorimeter Layer End bitfields
evDiag_Data | Diagnostic Data class
evDiag_TkrTrgReq | TKR Trigger Request bitfields
eventThread |
evErr_CablePhase | Cable Controller Phasing Error bitfields
evErr_CableTimeOut | Cable Timeout Error bitfields
evErr_GCCC | GCCC Error bitfields
evErr_GCCC_Message | GCCC Error Message object
evErr_GTCC | GTCC Error bitfields
evErr_GTCC_Message | GTCC Error Message object
evErr_Summary | Error summary bitfields
evGEM_Cond_Arrival_Times | GEM Condition Arrival Times bitfield
evGEM_Veto_List | GEM Veto List object
evSummary | Event summary bitfields
evSummary_Singleton |
Evt | Event object
EvtCli |
EvtCli | Event handler client
EvtCliBT |
EvtCliIO | Event client input/output class
evtDataImpl |
evTKR_Strip | TKR strip bitfields
evTKR_StripData | TKR StripData class
evTKR_TOTdata | TKR TOT data class
ExceptionFSM |
ExclusiveButtonGroup |
FabricPanel |
Fabrics |
FancyTrendTree |
FEpowerUp |
FlatFileRecorder |
FrontEndPowerPanel |
FSM |
FswMessages |
FullCondition |
FullEngine |
GAEM | ACD Common Controller
GAEQ | ACD Environmental Monitors
GAFE | ACD Front-End Controller
gAlertHandler |
gAlertMail |
gAlertMailer |
gAlertPopup |
gAlertRegistry |
gAlertStr |
GARC | ACD Readout Controller
GasuExtTrg |
GasuExtTrgEngine |
GasuPanel |
Gattr | Base class which is instantiated once for each attribute kind
GattrBF | Bit field class which is instantiated for each bit field kind
GattrDlc |
GattrHsk | Class which is instantiated for each housekeeping quantity
GattrRaw | Class which is instantiated for each raw register kind
GattrReg | Class which is instantiated for each register
GattrRegDepr |
GCCC | Calorimeter Cable Controller node Record
GCFE | Calorimeter Front End node Record
Gconstraint | Base class for describing constraints
GconstraintBase | Base constraint class for use when no constraint is appropriate
GconstraintLimit | Limit Constraint
GconstraintLimitPegRE | Pegged Limit Constraint
GconstraintLimitRE | On Constraint Limit Raise Exception
gConstraintViolation | Constraint Violation Class
GCRC | Calorimeter Readout Controller node Record
GCRU | CRU node
Gdb | Base class for all GLAST LAT functional blocks
GDBN | Database node record
Geb |
GebContribution |
GebContributor |
GEBM | GEBM node
GEBMC | EBM Controller node
GEBMST | EBM Event Statistics node
GEGU | Base class for raw/engineering unit conversions
GEGU_linear | EGU class for performing linear conversions
GEGU_poly3 | EGU class for performing 3rd degree polynominal conversions
GEGU_rtd | EGU class for performing RTD (Resistive Temp Device) conversions
GEGU_test |
GEGU_thermistor | EGU class for performing thermistor conversions
GEM | GEM event object
GEMcontribution |
GEMcontribution_ |
GEPU | EPU node
GExportException | Define an exception from the Export system
GGEM | GGEM node
GGEMC | GEMC sub-node of GGEM (controller)
GGEMIE | GEMIE sub-node of GGEM (input enables)
GGEMMG | GEMMG sub-node of GGEM (TAM generator)
GGEMSC | GEMSC sub-node of GGEM (scheduler)
GGEMST | GEMST sub-node of GGEM (statistics)
GGEMVG | GEMVG sub-node of GGEM (ROI generator)
GGEMW | GEMW sub-node of GGEM
GGLT | Global Trigger
Ggroup |
GHSK | GLAST HSK node Record
GHSKTrendMap |
GLAT | GLAST LAT node Record
GLATTrendMap |
GLCB | LCB node
GLCBSTATS | LCB stats access
GlobalPanelImpl |
GMem | Memory node
GNAT | GNAT node Record
GOCS | OCS node
GOSEDCALImpl |
GOSEDCALTKRImpl |
GOSEDDataImpl |
GOSEDPreferencesImpl | Class for managing a GOSED user's preferences
GOSEDTKRImpl |
GOSEDTWRImpl |
GPDU | PDU Controller
GPEQ | PDU Environmental Monitors
GpibPwrCtrlImpl |
GroupPanel |
Grule | Base class for describing rules
GruleAlarms | Alarm rule
GruleBase | Base rule class for use when no rule is appropriate
GruleLimit | Rule class that limits a passed in value to given limits
GSIU | SIU node
GTCC | Tracker Cable Controller node record
GTEM | TEM node Record
GTest |
GTFE | Tracker Front-End node Record
GTIC | Trigger Interface Controller
GTPG |
GTRC | Tracker Readout Controller node Record
GTWR | Tower node Record
GUIbridge | Class for providing a bridge between the GUI thread and other threads
GUIbridgeTest |
Gversions |
GXBRD | Tower controller node Record
HAEM | GLAST AEM HSK node Record
HARC | GLAST ARC HSK node record
HCOM | GLAST Communications statistics HSK node record
HCPU | GLAST CPU metrics HSK node record
HEBM | GLAST EBM HSK node record
HGEM | GLAST GEM HSK node record
HNUL | GLAST HSK null record
HPDU | GLAST PDU HSK node record
HskAlarmRecorder |
HskCfgTextReceiver |
HskCli | Housekeeping client input/output class
HskCmdRxSocket |
HskCmdTxSocket |
HskCollector | Configurable housekeeping collector
HskConfiguration |
HskFileRecorder |
HskHandler | HskHandler class
HskLatRetriever |
HskPacket |
HskPacket210 |
HskPacket211 |
HskPacket212 |
HskPacket213 |
HskPacket214 |
HskPacket215 |
HskPacket216 |
HskPacket217 |
HskPacket218 |
HskPacket219 |
HskPacket21a |
HskPacket21b |
HskPacket21c |
HskPacket21d |
HskPacket21e |
HskPacket21f |
HskPacket220 |
HskPacket221 |
HskPacket222 |
HskPacket223 |
HskPacket224 |
HskPacket225 |
HskPacket226 |
HskPacket227 |
HskPacket228 |
HskPacket229 |
HskPacket22a |
HskPacket22b |
HskPacket22c |
HskPacket22d |
HskPacket22e |
HskPacket22f |
HskPacket230 |
HskPacket231 |
HskPacket270 |
HskPacket271 |
HskPacket272 |
HskPacket273 |
HskPacket274 |
HskPacket275 |
HskPacket276 |
HskPacket277 |
HskPacket278 |
HskPacket279 |
HskPacket27a |
HskPacket27b |
HskPacket27c |
HskPacket27d |
HskPacket27e |
HskPacket27f |
HskPacket280 |
HskPacket281 |
HskPacket282 |
HskPacket283 |
HskPacket284 |
HskPacket285 |
HskPacket286 |
HskPacket287 |
HskPacket288 |
HskPacket289 |
HskPacket28a |
HskPacket28b |
HskPacket28c |
HskPacket28d |
HskPacket28e |
HskPacket28f |
HskPacket290 |
HskPacket291 |
HskPacket353 |
HskPacketBase |
HskPacketRecorder |
HskPacketRetriever |
HskPacketWriter |
HskSimpleTextReceiver |
HskSqlReceiver |
HskSqlRecorder |
HskTelemSocket |
HskTestRetriever |
HTEM | GLAST TEM HSK node record
LATcomponentIterator |
LATcomponentIterator |
LATcontributionIterator |
LATInterfaceException |
LATInterfaceStatus |
LATsweep |
LDBI_LATcontributionIterator_ | LDBI_LATcontributionIterator implementation
LdfContribution |
LdfContributor |
LdfContributor |
Lem |
ListViewToolTip |
LogRecordStreamHandler |
Loopback |
MailAlert |
MarkerTrgReadout | MarkerTrgReadout class definition
mask |
Merger |
Merger |
Merger |
MiniGLTExample | MiniTower example interface to MiniGLT
MiniGLTExample | MiniTower example interface to MiniGLT
MiniGLTExample | MiniTower example interface to MiniGLT
MiniGltExtTrg |
MiniGLTSolicitedCondition |
MiniGLTSolicitedCondition |
MiniGLTSolicitedCondition |
MiniGLTSolicitedEngine |
MiniGLTSolicitedEngine |
MiniGLTSolicitedEngine |
MiniGLTTrgConditionsValue |
MiniGltTrgEngine |
MiniGLTTrgEngines |
MiniGLTTrgEngines |
MiniGLTTrgEngines |
MSGLogGUIImpl |
MSGLogSocketReceiver |
multibar |
myLATcomponentIterator | LAT component Displayer
myLATcomponentIterator |
myLATcomponentIterator |
myLATcomponentIterator |
myLATcomponentIterator |
myLATdbIterator |
MyLogSocketHandler |
MyRoi |
myTKRcontributionIterator |
NoCnoEnabled |
Node |
NodeRegisterList |
NoExternal |
NoInputsEnabled |
NoTilesEnabled |
NoTowersBusy |
NoTowersEnabled |
NullCal |
NullCoincidence |
NullEngine |
NullRequest |
NullRoi |
NullStream |
NullTkr |
NullTower |
OcsMessages |
Opcode |
Options |
OSWcontributionIterator |
OSWcontributionIterator_ |
palettes |
panelsTest |
PduSwitch |
Playback |
PlotWidget |
Plumber |
PorcineEvent |
PorcinePanel |
PorcineWindow |
PowerPanelImpl |
Preferences | Preferences dictionary Preferences needs a special dictionary class since the data it stores may have macros and environment variables in it
PythonShellWidget |
PyThreadBridge |
QtReceiver |
QtReceiver |
QtReceiver |
QtThreadBridge |
radiomask |
rcArchiver | Event Archiver
rcCommentPanel |
rcCompletionStatus |
rcEndRunDlgImpl |
rcFileSelector |
rcFileSelector |
rcFitsWriter |
rcGEMDefaultTrigger | RcGEMDefaultTrigger
rcGEMTrgEngines |
rcHouseKeeping |
rcLoginImpl |
rcMiniGLTDefaultTrigger | RcMiniGLTDefaultTrigger
rcMiniGLTSolicitedCondition |
rcMiniGLTSolicitedEngine |
rcMiniGLTTrgEngines |
rcParamVerifier |
rcParamVerifyGUIImpl | Parameter verifier GUI
rcPreferencesGUIImpl |
rcPreferencesManager |
rcPythonShell |
rcReportGen |
rcRunIdHelper |
rcScmCfgSelector |
rcScmCfgSelText |
rcSecurityMan |
rcSolicitedCondition |
rcSolicitedEngine |
rcStatusMonitor |
rcStatusPanel |
rcSuite |
rcTest |
rcTestReport | Test Report class for RunControl
rcTransitions |
rcTransitionsBT |
rcTrgCoincidence | RcTrgCoincidence class
rcTrgEngines | RcTrgEngines Class
rcTrgGem | RcTrgGem class definition This class implements a 'threaded' model for enabling/disabling the trigger
rcTrgInjectMarker |
rcTrgMiniGLT | RcTrgMiniGLT class definition This class implements a 'threaded' model for enabling/disabling the trigger
rcTrgTileEnables | RcTrgTileEnables class
rcTrgTowerBusyEnables | RcTrgTowerBusyEnables class
rcUser |
rcUsers |
Receiver | Abstract Receiver class
Recorder | Recorder class
Register |
RegisterInterface |
RegViewItem |
Reloader |
Response |
Retriever |
ReverseTrendMap |
RunControl |
RunControlCommon |
RunControlFileHandler | FileHandler class for handling multiple line log entries
RunControlFSM |
RunControlGUIImpl |
RunControlMain |
RunControlMainGUIImpl |
RunControlSocketHandler |
ScrollablePlotView |
ServerPreferencesImpl |
SGETrgEngines |
SGETrgEngines |
SGETrgInputEnables |
SGETrgInputEnables |
SimpleGasuExample | SimpleGASU example interface to GEM
SimpleGasuExample | SimpleGASU example interface to GEM
singleEvtDisplayImpl | Glast Online Single Event Display (GOSED)
SLACmail |
Socket |
SocketClosed |
SolicitedCondition |
SolicitedCondition |
SolicitedEngine |
SolicitedEngine |
standardPlotter |
standardPlotterGuiImpl |
standardTestReport |
StatusItem |
StatusLabel |
SweepMarkerEngine | SweepMarkerEngine class
TaskEngine |
TaskEngineTestCase |
testArchiver |
testEvtCli |
TestWindow |
TimeAxisGen |
TimeAxisGen |
TKRcontributionIterator |
TKRcontributionIterator_ | TKR contribution Displayer
towerEvtDisplayImpl |
TowerPanel |
TowerPowerPanel |
towerwidgetImpl |
Trendable |
TrendLimit |
TrendMapBase |
TrendPlotter |
TrendPlotter |
TrendPlotter |
TrendTestGUI |
TrendTree |
TrgAbstract | Abstract trigger interface class definition
TrgCalorimeter | Trigger Calorimeter class definition
TrgCmdCounters | TrgCmdCounters class
TrgCmdStats | TrgCmdStats class
TrgCnoCounters | TrgCnoCounters class definition This class controls the counters used to count ACD Cno transitions
TrgCnoEnables | Trigger CNO Enables class definition
TrgCnoStats | TrgCnoStats class definition This class specifies the statistics returned by the counters described by TrgCnoCounters
TrgCoincidence | Trigger Coincidence class definition This class defines the set of tiles which will constitute any one coincidence
TrgCoincidences | Trigger Coincidences class definition
TrgConditions | Trigger Conditions Value class definition This class is used to define one combinatoric of the 128 possible conditions
TrgConditionsValue | Trigger Conditions Value class definition
trgConsumer |
TrgDefaultPeriodicCondition | TrgDefaultPeriodicCondition class definition
TrgDefaultSequence |
trgDisplayImpl |
TrgEngine | Trigger Engine class definition The user inherits from this class to customize their own Trigger Engines. The user must satisfy the member function 'request', which returns an object of type TrgEngineRequest. The user must satisfy the member function 'prescale', which returns an integer
TrgEngineRequest | Trigger Engine Request class definition The TrgEngineRequest class is used to specify the parameterization of the Trigger Message associated with a given engine
TrgEngines | Trigger Engines class definition A Trigger Engine defines what the Trigger System does when it detects a triggerable condition within the LAT
TrgEventCounter | TrgEventCounter class
TrgExtEnables | Trigger External Enables class definition
TrgGem | Trigger Global Trigger Electronics Module Interface class definition This class implements the hardware register access to the GEM
TrgGemAbstract | Trigger Global trigger Electronics Module Interface class definition
TrgGemCmdCounters | TrgGemCmdCounters
TrgGemCmdStats | TrgGemCmdStats
TrgGemCnoCounters | TrgGemCnoCounters
TrgGemCnoStats | TrgGemCnoStats
TrgGemEventCounter | TrgGemEventCounter
TrgGemPeriodicCondition | Trigger Periodic Condition class definition
TrgGemPPSTimer | TrgGemPPSTimer class definition This class HW abstraction corresponding to figure 75 of the GEM document: LAT-01545 Section 2.6.4
TrgGemRegisters | TrgGemRegisters class definition
TrgGemSequence | TrgGemSequence Hardware abstraction for TrgSequence
TrgGemTileCounters | TrgGemTileCounters
TrgGemTileStats | TrgGemTileStats
TrgGemTriggerCounters | TrgGemTriggerCounters class
TrgGemTriggerStats | TrgGemTriggerStats This class implements the HW abstraction corresponding to figure 66-69 of the GEM document: LAT-01545 Section 2.6.1 and 2.6.2
TrgInjectCharge | TrgInjectCharge class definition
TrgInjectChargeReadout | Trigger Inject Charge Readout class definition
TrgInjectMarker | Trigger Inject Marker class definition Directs a module to send to its Front-End Electronics a command sequence which is composed of only a TACK command. This sequence will trigger a readout of the module's Front-End Electronics
TrgInputEnables | Trigger Input Enables class definition
trgLATcomponentIterator |
TrgMiniGLT | Mini GLT Hardware abstraction implementation
TrgMiniGLTAbstract | TrgMiniGLTAbstract Interface class definition This class inherits from TrgAbstract to define the structure of a MiniGLT trigger
TrgMiniGLTRegisters | Register shape definition class for the MiniGLT This class defines the shapes of the registers and bitfields used in the MiniGLT
TrgObject | Trigger Object class definition
TrgPeriodicCondition | Trigger Periodic Condition class definition
TrgPeriodicConditionAbstract | TrgPeriodicConditionAbstract class definition
TrgPeriodicConditionDefinition | TrgPeriodicConditionDefinition class definition
TrgPPSTimer | TrgPPSTimer class definition This class controls the GEM's 1-PPS timer
TrgReadout | TrgReadout class definition
TrgRoi | Trigger ROI (Region of Interest) class definition
TrgRoiAsTiles | Class TrgRoiAsTiles LATTE provided class to map coincidences to ROIs
TrgRoiAsVeto |
TrgRois | Trigger ROI (Region of Interest) list class definition
TrgSequence | Trigger Sequence class definition
TrgSequenceAbstract | Abstract Trigger Sequence class definition
TrgSequenceDefinition | Trigger Sequence Definition class definition
TrgTileCounters | TrgTileCounters class definition This class controls the counters used to count ACD tile transitions
TrgTileEnables | Trigger Tile Enables class definition
TrgTileStats | TrgTileStats class definition This class specifies the statistics returned by the counters described by TrgTileCounters
TrgTower | Trigger Tower class definition
TrgTowerBusyEnables | Trigger Tower Busy Enables class definition
TrgTowerEnables | Trigger Tower Enables class definition
TrgTowers | Trigger Towers class definition
TrgTracker | Trigger Tracker class definition
TrgTriggerCounters | TrgTriggerCounters class definition This class controls the counters associated with the performance of the LAT with respect to the Trigger System
TrgTriggerStats | TrgTriggerStats This class specifies the statistics returned by the counters defined in TrgTriggerCounters
TrgUsingTiles | Trigger Using Tiles class definition
UDPReceiver | UDPReceiver class
UDPRecorder | Example recorder that UDP broadcasts trendables
userAppBrowser |
userAppLeaf | UserApp Gui Leaf This is the class of a leaf in the userApp Gui Tree It contains both basic functionality as a leaf (mainly input selection functions) and functionality as a manager of application windows
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplication |
userApplicationCallbacks |
userAppLoader |
userAppTree |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgText |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userArgument |
userModule |
userSuite |
userSuite |
userSuite |
userSuite |
userSuite |
userSuiteCallbacks |
WatchItem |
ZsupSolicitedEngine |
ZsupSolicitedEngine |
ZsupTrgInjectChargeReadout | ZsupTrgReadout class definition
ZsupTrgReadout | ZsupTrgReadout class definition
ZsupTrgReadout | ZsupTrgReadout class definition
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: _Anonymous Class Reference

dispatcher._Anonymous

_Anonymous Class Reference

Inheritance diagram for _Anonymous:

[legend]
Collaboration diagram for _Anonymous:

[legend]
List of all members.

Detailed Description

Singleton used to signal "Anonymous Sender"

The Anonymous object is used to signal that the sender of a message is not specified (as distinct from being "any sender"). Registering callbacks for Anonymous will only receive messages sent without senders. Sending with anonymous will only send messages to those receivers registered for Any or Anonymous.

Note: The default sender for connect is Any, while the default sender for send is Anonymous. This has the effect that if you do not specify any senders in either function then all messages are routed as though there was a single sender (Anonymous) being used everywhere.

Definition at line 76 of file dispatcher.py.

The documentation for this class was generated from the following file:
  • dispatcher.py
Generated on Fri Jul 21 13:26:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: _Any Class Reference

dispatcher._Any

_Any Class Reference

Inheritance diagram for _Any:

[legend]
Collaboration diagram for _Any:

[legend]
List of all members.

Detailed Description

Singleton used to signal either "Any Sender" or "Any Signal"

The Any object can be used with connect, disconnect, send, or sendExact to signal that the parameter given Any should react to all senders/signals, not just a particular sender/signal.

Definition at line 54 of file dispatcher.py.

The documentation for this class was generated from the following file:
  • dispatcher.py
Generated on Fri Jul 21 13:26:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: _Attr Class Reference

gAttr._Attr

_Attr Class Reference

List of all members.

Public Member Functions

__init__ (node, attr, egu)
getName ()
size ()
id ()
setRule (rule)
getRule ()
setConstraint (constraint)
setEGU (egu)
getEGU ()
getConstraint ()
flags ()
isReadOnly ()
isWriteOnly ()
isReadWrite ()
isNoDirectAccess ()
isCommand ()
isDeprecated ()
getNode ()
setTimeStamp (value)
getTimeStamp ()

Detailed Description

Helper class for private use in this file only.

Definition at line 289 of file gAttr.py.

Member Function Documentation

getConstraint ( )

Method that returns the gConstraint.Gconstraint class for this gAttr

Returns:
A Gconstraint object instance

getEGU ( )

Method that returns the gEGU.GEGU class for this gAttr

Returns:
A Gegu object instance

getRule ( )

Retrieve the rule associated with the gAttr.

getTimeStamp ( )

Method that returns the timestamp at the moment when the register was accessed.

Returns:
Timestamp in seconds as a floating point value

isCommand ( )

Returns a boolean value indicating if the attribute is a dataless command or not

Returns:
1=Dataless command, 0=Not a dataless command.

isDeprecated ( )

Returns a boolean value indicating if the attribute is deprecated or not

Returns:
1=Deprecated, 0=Not deprecated.

isNoDirectAccess ( )

Returns a boolean value indicating if the attribute is no direct access or not

Returns:
1=No Direct Access, 0=Not No Direct Access.

isReadOnly ( )

Returns a boolean value indicating if the attribute is read only or not

Returns:
1=Read Only, 0=Not Read Only.

isReadWrite ( )

Returns a boolean value indicating if the attribute is read write or not

Returns:
1=Read Write, 0=Not Read Write.

isWriteOnly ( )

Returns a boolean value indicating if the attribute is write only or not

Returns:
1=Write Only, 0=Not Write Only.

setConstraint ( constraint )

Method to attach a constraint to a gAttr after the gAttr has been constructed. This method will go away once constraints are loaded from a configuration file.

Parameters:
constraint A Gconstraint object instance

setEGU ( egu )

Method to attach a EGU to a gAttr after the gAttr has been constructed.

Parameters:
egu A Gegu object instance

setRule ( rule )

Method to attach a rule to a gAttr after the gAttr has been constructed.

Parameters:
rule A Grule object instance

size ( )

Method for returning the size of the attribute

Returns:
Attribute size in bytes

The documentation for this class was generated from the following file:
  • gAttr.py
Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: _Parameter Class Reference

dispatcher._Parameter

_Parameter Class Reference

Inheritance diagram for _Parameter:

[legend]
List of all members.

Public Member Functions

__repr__ ()

Detailed Description

Used to represent default parameter values.

Definition at line 41 of file dispatcher.py.

The documentation for this class was generated from the following file:
  • dispatcher.py
Generated on Fri Jul 21 13:26:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: _regList Class Reference

gDb._regList

_regList Class Reference

List of all members.

Public Member Functions

__getitem__ (attribute)
__setitem__ (attribute, value)
get (attribute, default=None)
has_key (attribute)
__contains__ (attribute)

Detailed Description

Definition at line 112 of file gDb.py.

The documentation for this class was generated from the following file:
  • gDb.py
Generated on Fri Jul 21 13:26:50 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: AcdHWMultiplexer Class Reference

AcdHWMultiplexer.AcdHWMultiplexer

AcdHWMultiplexer Class Reference

AcdHWMultiplexer class. More...

List of all members.

Public Member Functions

__init__ (GEM)
AcdHWMultiplexer constructor.
start ()
Method for starting the accumulation of ACD hardware scalers.
stop ()
Method for stopping the accumulation of ACD hardware scalers.
resume ()
Method for resuming the accumulation of ACD hardware scalers after a stop.
abort ()
Method for aborting the accumulation of ACD hardware scalers.
shutdown ()
Method for shutting down the Multiplexer.
dwell (d=None)
Method to set the dwell time for scaler integration.
tileList (tList=None)
Method to set which tiles are integrated.
stats ()
Method to access the counter statistics.

Detailed Description

AcdHWMultiplexer class.

A class to multiplex the two ACD hardware scalers defined in section 2.6.2 of the GEM document, LAT-TD-01545 into up to 108 separate counters.

Definition at line 23 of file AcdHWMultiplexer.py.

Member Function Documentation

__init__ ( GEM )

AcdHWMultiplexer constructor.

Parameters:
GEM a GEM object

abort ( )

Method for aborting the accumulation of ACD hardware scalers.

Abort the integration of the hardware counters. The cycle stops immediately, and the set of counts from the current cycle is discarded.

dwell ( d = None )

Method to set the dwell time for scaler integration.

Set the dwell time (in seconds) for integration. Total time in a cycle through the scalers will be dwell * nTiles. Minimum dwell time is 0.1 seconds. Default is 1 second.

Parameters:
dwell Dwell time in seconds, default = 1 second

resume ( )

Method for resuming the accumulation of ACD hardware scalers after a stop.

Resume the integration of the hardware counters after a stop() call. At resume of integration, the internal counters are not reset, but continue from their previous values.

shutdown ( )

Method for shutting down the Multiplexer.

Shut down the thread the multiplexer is running in. Should be called during endRun.

start ( )

Method for starting the accumulation of ACD hardware scalers.

Start the integration of the hardware counters. At the start of integration, the counters are all reset to zero (0).

stats ( )

Method to access the counter statistics.

Provides the user with the a list containing the counter statistics. This list corresponds to the tiles in tileList.

Returns:
The list of the tile statistics.

stop ( )

Method for stopping the accumulation of ACD hardware scalers.

Stop the integration of the hardware counters. The stop occurs at the end of the current cycle, and the counts from the current cycle are integrated into the count statistics

tileList ( tList = None )

Method to set which tiles are integrated.

Defines the list of tiles which are being integrated. Ex: range(108); [0,2,4,6]

Parameters:
tList The list of tiles to be integrated.
Returns:
The list of tiles that are being integrated

The documentation for this class was generated from the following file:
  • AcdHWMultiplexer.py
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ACDmap Class Reference

TrgGemRegisterGeometry.ACDmap

ACDmap Class Reference

List of all members.

Public Member Functions

__init__ (gemVersion=None)
lookup (cable, channel)
freeName (cable)

Detailed Description

An implementation of LDF.ACDmap that forces a particular LATtypeId()

Definition at line 11 of file TrgGemRegisterGeometry.py.

The documentation for this class was generated from the following file:
  • TrgGemRegisterGeometry.py
Generated on Fri Jul 21 13:28:25 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: AcdPanel Class Reference

AcdPanel.AcdPanel

AcdPanel Class Reference

List of all members.

Public Member Functions

languageChange ()

Detailed Description

Definition at line 5 of file AcdPanel.py.

The documentation for this class was generated from the following file:
  • AcdPanel.py
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ACDPowerPanel Class Reference

PorcinePanel.ACDPowerPanel

ACDPowerPanel Class Reference

Inheritance diagram for ACDPowerPanel:

[legend]
Collaboration diagram for ACDPowerPanel:

[legend]
List of all members.

Public Member Functions

__init__ (args)
constructGrid ()

Detailed Description

Definition at line 109 of file PorcinePanel.py.

The documentation for this class was generated from the following file:
  • PorcinePanel.py
Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ACDSingleEvtDisplayImpl Class Reference

GOSEDACDImpl.ACDSingleEvtDisplayImpl

ACDSingleEvtDisplayImpl Class Reference

List of all members.

Public Member Functions

__init__ (preferences, parent=None, name=None, fl=0)
relabel ()

Detailed Description

Definition at line 13 of file GOSEDACDImpl.py.

The documentation for this class was generated from the following file:
  • GOSEDACDImpl.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: AddableRoi Class Reference

TrgRoiAsTiles.AddableRoi

AddableRoi Class Reference

Inheritance diagram for AddableRoi:

[legend]
Collaboration diagram for AddableRoi:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgRoi constructor.
addTile (tile)
tile (tileNumber)
tile 'pure virtual' method

Detailed Description

The main purpose of this class is to add the member function addTile(tile). This function appends a tile to the list of tiles in the ROI

Definition at line 38 of file TrgRoiAsTiles.py.

Member Function Documentation

tile ( tileNumber )

tile 'pure virtual' method

Parameters:
tileNumber A tile number
Returns:
A boolean

Reimplemented from TrgRoi.

The documentation for this class was generated from the following file:
  • TrgRoiAsTiles.py
Generated on Fri Jul 21 13:28:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: AEM Class Reference

gEvtCli.AEM

AEM Class Reference

AEM event object. More...

List of all members.

Public Member Functions

__init__ ()
clearEvent ()
Initialize accept and veto hit vectors.
addPHA (cbl, pha)
Adds a PHA value.

Detailed Description

AEM event object.

Members:

  • vetoHitVectors
  • acceptHitVectors
  • PHA

Definition at line 79 of file gEvtCli.py.

Member Function Documentation

addPHA | ( | cbl | ,
 |  | pha |
 | ) |

Adds a PHA value.

Called from evDumpAEM_PHA

Parameters:
cbl | Cable number
pha | 16 bit PHA value

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: AEMcontributionIterator Class Reference

standardLDF.AEMcontributionIterator

AEMcontributionIterator Class Reference

List of all members.

Public Member Functions

fill ()
header (cable, hdr)
pha (cable, channel, p)
getSide (cable, channel)
getIntegerTileNumber (cable, channel)
getMiniAcdSide (cable, channel)
getMiniAcdTileNumber (cable, channel)
getRemappedTileNumber (tileNumber)

Detailed Description

Definition at line 39 of file standardLDF.py.

The documentation for this class was generated from the following file:
  • standardLDF.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: AEMcontributionIterator_ Class Reference

GOSED_LDF.AEMcontributionIterator_

AEMcontributionIterator_ Class Reference

List of all members.

Public Member Functions

__init__ (event, contribution, gui, lci)
plot (prefix="")
header (cable, hdr)
pha (cable, channel, p)

Detailed Description

Definition at line 31 of file GOSED_LDF.py.

The documentation for this class was generated from the following file:
  • GOSED_LDF.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: AEQHskRegMap Class Reference

HskRegisters.AEQHskRegMap

AEQHskRegMap Class Reference

List of all members.

Public Member Functions

__init__ ()
decodeRegister (key, regValue)

Detailed Description

Definition at line 39 of file HskRegisters.py.

Member Function Documentation

decodeRegister | ( | key | ,
 |  | regValue |
 | ) |

decode an AEM register. Each 16 bit section looks like: MBZ[3] Timeout[1] Val[12]

Returns:
a map of parsed values

The documentation for this class was generated from the following file:
  • HskRegisters.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: AlertGuiImpl Class Reference

AlertGuiImpl.AlertGuiImpl

AlertGuiImpl Class Reference

List of all members.

Public Member Functions

handleAlert (alertList)
startListenerThread ()
config (configFile)

Detailed Description

Definition at line 21 of file AlertGuiImpl.py.

The documentation for this class was generated from the following file:
  • AlertGuiImpl.py
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: AncillaryContribution Class Reference

ancillaryContribution.AncillaryContribution

AncillaryContribution Class Reference

Inheritance diagram for AncillaryContribution:

[legend]
Collaboration diagram for AncillaryContribution:

[legend]
List of all members.

Public Member Functions

__init__ (contributor, contribution)
identity ()
Method to return the identity (LDF TypeId) of a contribution to an event. Meant to be overridden.
length ()
Method to return the length of a contribution to an event. Meant to be overridden.
sequence ()
Method to return the sequence value of the contribution. Meant to be overridden.
buffer ()

Detailed Description

Definition at line 6 of file ancillaryContribution.py.

Member Function Documentation

sequence ( )

Method to return the sequence value of the contribution. Meant to be overridden.

! This method must return a value for which the equality and greater than operators are defined. The sequence values must be common amoungst all contributors such that a if a contribution's sequence value is equal to another contributions sequence value, the two contributions belong together as part of the same event. A contribution A's sequence value that is greater than another contribution B's sequence value is interpreted to mean that A is newer than B. This information is used to flush out partially built older events.

Reimplemented from GebContribution.

The documentation for this class was generated from the following file:
  • ancillaryContribution.py
Generated on Fri Jul 21 13:26:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: AncillaryContributor Class Reference

ancillaryFile.AncillaryContributor

AncillaryContributor Class Reference

Inheritance diagram for AncillaryContributor:

[legend]
Collaboration diagram for AncillaryContributor:

[legend]
List of all members.

Public Member Functions

__init__ (filename, offset=0)
name ()
Method to return the name of the contribution type. Meant to be overridden.
offset ()
open ()
Method to open the contributor. Meant to be overridden.
close ()
Optional method to close the contributor. Meant to be overridden.
read ()
Method to read an ancillary contribution from a file.

Detailed Description

Definition at line 11 of file ancillaryFile.py.

The documentation for this class was generated from the following file:
  • ancillaryFile.py
Generated on Fri Jul 21 13:26:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: AncillaryContributor Class Reference

ancillarySocket.AncillaryContributor

AncillaryContributor Class Reference

Inheritance diagram for AncillaryContributor:

[legend]
Collaboration diagram for AncillaryContributor:

[legend]
List of all members.

Public Member Functions

__init__ ((host, port), offset=0)
name ()
Method to return the name of the contribution type. Meant to be overridden.
offset ()
open ()
Method to open the contributor. Meant to be overridden.
close ()
Optional method to close the contributor. Meant to be overridden.
read ()
Method to read an ancillary contribution from a file.
fake ()

Detailed Description

Definition at line 13 of file ancillarySocket.py.

The documentation for this class was generated from the following file:
  • ancillarySocket.py
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: AncillaryContributor Class Reference

gEvtCliBT.AncillaryContributor

AncillaryContributor Class Reference

Concrete contributor class specifically meant to work with EvtCli. More...

Inheritance diagram for AncillaryContributor:

[legend]
Collaboration diagram for AncillaryContributor:

[legend]
List of all members.

Public Member Functions

__init__ ((host, port), offset=0L)
name ()
Method to return the name of the contribution type. Meant to be overridden.
sequence (sequence)
Method for remapping the ancillary contribution's sequence number into the same space as the other contributions' sequence numbers.
open ()
Method to open and connect to the server socket. It retries until a connection can be established, or the quit flag is seen to be set.
close ()
Method to signal the read loop to exit.
read ()
Method to read an ancillary contribution from a socket.

Detailed Description

Concrete contributor class specifically meant to work with EvtCli.

Definition at line 47 of file gEvtCliBT.py.

Member Function Documentation

read ( )

Method to read an ancillary contribution from a socket.

! This method deals with reconnecting when the server restarted.

Reimplemented from GebContributor.

The documentation for this class was generated from the following file:
  • gEvtCliBT.py
Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ArgumentImpl Class Reference

ArgumentImpl.ArgumentImpl

ArgumentImpl Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
getValue (caption, value=None)
CancelButtonClicked ()

Detailed Description

Definition at line 9 of file ArgumentImpl.py.

The documentation for this class was generated from the following file:
  • ArgumentImpl.py
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: BadGasuExample Class Reference

sweepRejectTest.BadGasuExample

BadGasuExample Class Reference

BadGasuExample. More...

List of all members.

Public Member Functions

__init__ ()
BadGasuExample constructor.
shut (sweepEvent, progress=None)

Detailed Description

BadGasuExample.

Definition at line 62 of file sweepRejectTest.py.

Member Function Documentation

shut | ( | sweepEvent | ,
 |  | progress | = None
 | ) |

Re-implementation of the shut function to NEVER send a sweep

NEVER EVER EVER use this code in a real trigger system. --Jim Panetta This code is only to test a particular bug in sweep timeouts.

The documentation for this class was generated from the following file:
  • sweepRejectTest.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: BadGLTExample Class Reference

sweepRejectTest.BadGLTExample

BadGLTExample Class Reference

MiniTower example interface to MiniGLT. More...

List of all members.

Public Member Functions

__init__ ()
AcdTriggerExample constructor.
shut (sweepEvent, progress=None)

Detailed Description

MiniTower example interface to MiniGLT.

Definition at line 80 of file sweepRejectTest.py.

Member Function Documentation

shut | ( | sweepEvent | ,
 |  | progress | = None
 | ) |

Re-implementation of the shut function to NEVER send a sweep

NEVER EVER EVER use this code in a real trigger system. --Jim Panetta This code is only to test a particular bug in sweep timeouts.

The documentation for this class was generated from the following file:
  • sweepRejectTest.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: bar Class Reference

bar.bar

bar Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, fl=0)
languageChange ()
setColor (col)
displayValue (a0)
paintEvent (pe)

Detailed Description

Definition at line 6 of file bar.py.

The documentation for this class was generated from the following file:
  • bar.py
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: barw Class Reference

barw.barw

barw Class Reference

List of all members.

Public Member Functions

languageChange ()
resizeEvent (rev)
setHigh (high)
setLow (low)
setTitle (title)
setMinScale (min)
setSlidingScale (scale)
displaySlidingScaleValue (val)

Detailed Description

Definition at line 9 of file barw.py.

The documentation for this class was generated from the following file:
  • barw.py
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: bf Class Reference

gBits.bf

bf Class Reference

List of all members.

Public Member Functions

set (value)
__getitem__ (index)
__setitem__ (index, value)
__getslice__ (start, end)
__setslice__ (start, end, value)
getOnBits ()
__int__ ()
__str__ ()

Detailed Description

Definition at line 8 of file gBits.py.

The documentation for this class was generated from the following file:
  • gBits.py
Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: BitField Class Reference

gBits.BitField

BitField Class Reference

Inheritance diagram for BitField:

[legend]
List of all members.

Public Member Functions

set (ui)
__setattr__ (attribute, val)
__getattr__ (attribute)
__int__ ()
__str__ ()

Detailed Description

Definition at line 20 of file gBits.py.

The documentation for this class was generated from the following file:
  • gBits.py
Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: BoundMethodWeakref Class Reference

saferef.BoundMethodWeakref

BoundMethodWeakref Class Reference

List of all members.

Public Member Functions

__init__ (target, onDelete=None)
__str__ ()
__nonzero__ ()
__cmp__ (other)
__call__ ()

Static Public Member Functions

static | __new__ (target, onDelete=None, arguments, named)
static | calculateKey (target)

Detailed Description

Safe' and reusable weak references to instance methods

BoundMethodWeakref objects provide a mechanism for referencing a bound method without requiring that the method object itself (which is normally a transient object) is kept alive. Instead, the BoundMethodWeakref object keeps weak references to both the object and the function which together define the instance method.

Attributes: key -- the identity key for the reference, calculated by the class's calculateKey method applied to the target instance method deletionMethods -- sequence of callable objects taking single argument, a reference to this object which will be called when *either* the target object or target function is garbage collected (i.e. when this object becomes invalid). These are specified as the onDelete parameters of safeRef calls. weakSelf -- weak reference to the target object weakFunc -- weak reference to the target function

Class Attributes: _allInstances -- class attribute pointing to all live BoundMethodWeakref objects indexed by the class's calculateKey(target) method applied to the target objects. This weak value dictionary is used to short-circuit creation so that multiple references to the same (object, function) pair produce the same BoundMethodWeakref instance.

Definition at line 53 of file saferef.py.

Member Function Documentation

__call__ ( )

Return a strong reference to the bound method

If the target cannot be retrieved, then will return None, otherwise returns a bound instance method for our object and function.

Note: You may call this method any number of times, as it does not invalidate the reference.

__cmp__ ( other )

Compare with another reference

__init__ | ( | target | ,
 |  | onDelete | = None
 | ) |

Return a weak-reference-like instance for a bound method

target -- the instance-method target for the weak reference, must have im_self and im_func attributes and be reconstructable via: target.im_func.__get__( target.im_self ) which is true of built-in instance methods. onDelete -- optional callback which will be called when this weak reference ceases to be valid (i.e. either the object or the function is garbage collected). Should take a single argument, which will be passed a pointer to this object.

static __new__ | ( | target | ,
 |  | onDelete | = None,
 |  | arguments | ,
 |  | named |
 | ) | [static]

Create new instance or return current instance

Basically this method of construction allows us to short-circuit creation of references to already- referenced instance methods. The key corresponding to the target is calculated, and if there is already an existing reference, that is returned, with its deletionMethods attribute updated. Otherwise the new instance is created and registered in the table of already-referenced methods.

__nonzero__ ( )

Whether we are still a valid reference

__str__ ( )

Give a friendly representation of the object

static calculateKey ( target ) [static]

Calculate the reference key for this reference

Currently this is a two-tuple of the id()'s of the target object and the target function respectively.

The documentation for this class was generated from the following file:
  • saferef.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: BrowserImpl Class Reference

BrowserImpl.BrowserImpl

BrowserImpl Class Reference

List of all members.

Public Member Functions

setViewDecimal (on)
setViewHexadecimal (on)
contextMenuShow (item, point, column)
copyToClipboard ()
copyLineToClipboard ()
updateView ()
loadSchema (filename)
setupSchema ()
loadHierarchy (lat, xbrd)
populateRegs (lat)
updateList (regList, listView)
selectItem (item)
fillViews ()
getCurrentItem ()
getCurrentParent ()
getCurrentGrandParent ()
getCurrentGreatGrandParent ()
fillRegsView (parent, listView)
setDefaults ()
clearViews ()
clearValues (listView)
browserPreferences ()
selectFile ()
fileNew ()
fileOpen ()
fileSave ()
fileSaveAs ()
filePrint ()
printRegList (regList, listHeader)
fileExit ()
editUndo ()
editRedo ()
editCut ()
editCopy ()
editPaste ()
editFind ()
helpOnline ()
helpContents ()
helpAbout ()

Detailed Description

Definition at line 49 of file BrowserImpl.py.

Member Function Documentation

selectItem ( item )

This function calls the clearViews function to clear all the register lists from the Tab window and then shows the registers of the selected Hierarchy node as well as upper level nodes

setupSchema ( )

self.__step = float(str(self.browserPreferences.timestepValue.text())) self.__timer.start(self.__step*1000, False) # seconds in milliseconds This function creates the Hierarchy tree and treeMap from the selected Schema.xml file

The documentation for this class was generated from the following file:
  • BrowserImpl.py
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: browserPreferencesImpl Class Reference

browserPreferencesImpl.browserPreferencesImpl

browserPreferencesImpl Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
changeStepValue ()

Detailed Description

Definition at line 9 of file browserPreferencesImpl.py.

The documentation for this class was generated from the following file:
  • browserPreferencesImpl.py
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: CAL_LATcontribution Class Reference

testAppCal_dg.CAL_LATcontribution

CAL_LATcontribution Class Reference

List of all members.

Public Member Functions

__str__ ()
__len__ ()

Detailed Description

Definition at line 18 of file testAppCal_dg.py.

Member Function Documentation

__len__ ( )

Helper python method so that we can take the len() of this object

__str__ ( )

Helper python method so that we can take the str() of this object

The documentation for this class was generated from the following file:
  • testAppCal_dg.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: CALcontributionIterator Class Reference

standardLDF.CALcontributionIterator

CALcontributionIterator Class Reference

List of all members.

Public Member Functions

fill ()
log (tower, layer, theLog)

Detailed Description

Definition at line 26 of file standardLDF.py.

The documentation for this class was generated from the following file:
  • standardLDF.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: CALcontributionIterator2 Class Reference

GOSED_LDF.CALcontributionIterator2

CALcontributionIterator2 Class Reference

CAL contribution Displayer. More...

List of all members.

Public Member Functions

__init__ (event, contribution, gui, limits, lci)
plot ()
log (tower, layer, theLog)

Detailed Description

CAL contribution Displayer.

This class obtains the filtered entries from CALcontributorIterator1 and converts them to the appropriate format to display them

Definition at line 72 of file GOSED_LDF.py.

Member Function Documentation

__init__ | ( | event | ,
 |  | contribution | ,
 |  | gui | ,
 |  | limits | ,
 |  | lci |
 | ) |

CALcontributionIterator2 contructor

Parameters:
event | Event
contribution | Contribution
gui | GOSED
limits | Tuple with filtered values (min value, max value, log count and energy count) obtained from CALcontributionIterator1

log | ( | tower | ,
 |  | layer | ,
 |  | theLog |
 | ) |

This function iterates over all current event entries and displays all those entries that passed the filter of for CAL in CALContributorIterator1.

Returns:
tower, layer, theLog

plot ( )

Plot here will call the iterate() function to display the filtered event within the scale format selected by the user (Event, Custom or Default)

There are three sorts of pixmaps (and the 3 equivalent for the YZ projection): background = Background Pixmap with the skeleton of the CAL final = Final pixmap that is going to be loaded to the display. If no data passed the filter, the custom widget drawXZ_CAL will automatically load background to final for display ebfXZ_CAL = Temporary Pixmap that, if there is data that passed the filter for the current event, it gets painted with it over background. If so it is then passed to final (once the iteration is over).

The documentation for this class was generated from the following file:
  • GOSED_LDF.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ccsdsHeader Class Reference

HskPacketDecoder.ccsdsHeader

ccsdsHeader Class Reference

CCSDS Header bitfield definition. More...

List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

CCSDS Header bitfield definition.

Definition at line 42 of file HskPacketDecoder.py.

The documentation for this class was generated from the following file:
  • HskPacketDecoder.py
Generated on Fri Jul 21 13:27:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ccsdsPacket Class Reference

HskPacketDecoder.ccsdsPacket

ccsdsPacket Class Reference

Interface to a generic CCSDS packet. More...

Inheritance diagram for ccsdsPacket:

[legend]
List of all members.

Public Member Functions

__init__ (ui)
apid ()
type ()
seqCnt ()
length ()
subSeconds ()

Detailed Description

Interface to a generic CCSDS packet.

Parameters:
ui The raw binary representation of the packet in big-endian byte order
Methods: apid() return packet APID secHead() return packet secondary header bit type() return packet type bit version() return packet version seqCnt() return sequence count seqFlg() return sequence flag length() return packet length in bytes seconds() return timestamp seconds subSeconds() return timestamp sub seconds payload() return packet payload (opaque)

Definition at line 26 of file HskPacketDecoder.py.

The documentation for this class was generated from the following file:
  • HskPacketDecoder.py
Generated on Fri Jul 21 13:27:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ccsdsSocket Class Reference

HskCli.ccsdsSocket

ccsdsSocket Class Reference

Inheritance diagram for ccsdsSocket:

[legend]
Collaboration diagram for ccsdsSocket:

[legend]
List of all members.

Public Member Functions

__init__ (handler=None, debug=0, port=0)
connect (host)
disconnect ()
handler (newhandler)
readCCSDS ()
CCSDS read routine.
setTimeoutEnabled (flag)
Enable or disable event timeout.
isTimeoutEnabled ()
Checks the event timeout state.
setTimeout (timeout)
Set the timeout value.
getTimeout ()
Query the current timeout value.

Detailed Description

Definition at line 36 of file HskCli.py.

Member Function Documentation

getTimeout ( )

Query the current timeout value.

Returns:
Current event timeout value as a floating point number in seconds

isTimeoutEnabled ( )

Checks the event timeout state.

Returns:
1 = If event timeout is enabled 0 = If event timeout is disabled

readCCSDS ( )

CCSDS read routine.

This routine does the minimal work of reading the raw CCSDS data from a socket.

Returns:
socket buffer read

setTimeout ( timeout )

Set the timeout value.

Parameters:
timeout Event timeout value as a floating point number in seconds. Default is 1 second.

setTimeoutEnabled ( flag )

Enable or disable event timeout.

Parameters:
flag 1 = Enable event timeout 0 = Disable event timeout (default)

The documentation for this class was generated from the following file:
  • HskCli.py
Generated on Fri Jul 21 13:27:15 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: CheckLed Class Reference

PorcinePanel.CheckLed

CheckLed Class Reference

List of all members.

Public Member Functions

__init__ (name, label, args)
setSelect (select)
getSelect ()
setStatus (status)
emitChanged (bool)
setEnables (enable)
setEnabled (bool)

Detailed Description

Definition at line 140 of file PorcinePanel.py.

The documentation for this class was generated from the following file:
  • PorcinePanel.py
Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Children Class Reference

gDb.Children

Children Class Reference

List of all members.

Public Member Functions

__init__ (parent, type)
remove (id)
add (id)
down (id)
exists (id)
all ()

Detailed Description

Definition at line 121 of file gDb.py.

The documentation for this class was generated from the following file:
  • gDb.py
Generated on Fri Jul 21 13:26:50 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: CmdCli Class Reference

gCmdCli.CmdCli

CmdCli Class Reference

Inheritance diagram for CmdCli:

[legend]
Collaboration diagram for CmdCli:

[legend]
List of all members.

Public Member Functions

__init__ (handler=None, debug=0, port=PortNumber)
setDebug (debug)
getDebug ()
handler (newhandler)

Detailed Description

Definition at line 10 of file gCmdCli.py.

The documentation for this class was generated from the following file:
  • gCmdCli.py
Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Collector Class Reference

Collector.Collector

Collector Class Reference

List of all members.

Public Member Functions

addRetriever (name, retriever)
delRetriever (name)
addRecorder (recorder)
setDelay (delay)
getDelay ()
isAcquiring ()
setAcquiring (bool)
collectData ()
shutdown ()

Detailed Description

Definition at line 7 of file Collector.py.

Member Function Documentation

setDelay ( delay )

Set the delay in units of seconds If the delay < 0, delay set to 0.

The documentation for this class was generated from the following file:
  • Collector.py
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Command Class Reference

gCommand.Command

Command Class Reference

List of all members.

Public Member Functions

__init__ (functionname, arguments)
packet ()
payloadfmts ()

Detailed Description

Definition at line 6 of file gCommand.py.

The documentation for this class was generated from the following file:
  • gCommand.py
Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: CommentEntryWidget Class Reference

rcCommentPanel.CommentEntryWidget

CommentEntryWidget Class Reference

List of all members.

Public Member Functions

getHistory ()
getTimestamps ()
clearHistory ()
clearDisplay ()
setPrompt (prompt)
getPrompt ()
flush ()
isatty ()
readline ()
write (text)
writelines (text)
enterComment (comment, addToHistory=0, source='system')
flushComment ()
insertText (text, offsetY=0, absX=0, overwrite=0)
keyPressEvent (e)
focusNextPrevChild (next)
handleClicked (para, pos)
contentsContextMenuEvent (ev)

Detailed Description

Definition at line 14 of file rcCommentPanel.py.

Member Function Documentation

contentsContextMenuEvent ( ev )

Suppress the right button context menu. Instead paste the contents of the clipboard.

enterComment | ( | comment | ,
 |  | addToHistory | = 0,
 |  | source | = 'system'
 | ) |

This can be called from a user script to add to comments. The text is prepended with source to indicate that it is a machine generated comment.

Parameters:
comment | The text of the comment to be entered
addtoHistory | Whether this comment will be persistent or not
source | The text to be prepended before the comment

flush ( )

Simulate stdin, stdout, and stderr.

focusNextPrevChild ( next )

Suppress tabbing to the next window in multi-line commands.

handleClicked | ( | para | ,
 |  | pos |
 | ) |

Keep the cursor after the last prompt.

insertText | ( | text | ,
 |  | offsetY | = 0,
 |  | absX | = 0,
 |  | overwrite | = 0
 | ) |

Parameters:
text | Text to be inserted
offsetY | The position of the comment text relative to the current position
absX | The absolute position of the comment text

isatty ( )

Simulate stdin, stdout, and stderr.

keyPressEvent ( e )

Handle user input a key at a time.

readline ( )

Simulate stdin, stdout, and stderr.

write ( text )

Simulate stdin, stdout, and stderr.

writelines ( text )

Simulate stdin, stdout, and stderr.

The documentation for this class was generated from the following file:
  • rcCommentPanel.py
Generated on Fri Jul 21 13:27:49 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ConfigElement Class Reference

gSchemaConfig.ConfigElement

ConfigElement Class Reference

Wrapper class for providing a compatibility layer between the old minidom XML DOMs and the new 4Suite Domlette DOMs. More...

List of all members.

Public Member Functions

__init__ (domletteElement)
getAttribute (attr)
getElementsByTagName (tagName)
__getattr__ (attr)

Detailed Description

Wrapper class for providing a compatibility layer between the old minidom XML DOMs and the new 4Suite Domlette DOMs.

Definition at line 200 of file gSchemaConfig.py.

The documentation for this class was generated from the following file:
  • gSchemaConfig.py
Generated on Fri Jul 21 13:27:11 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ConnectState Class Reference

RunControl.ConnectState

ConnectState Class Reference

Detailed Description

Definition at line 25 of file RunControl.py.

The documentation for this class was generated from the following file:
  • RunControl.py
Generated on Fri Jul 21 13:27:59 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ConnectState Class Reference

RunControlMain.ConnectState

ConnectState Class Reference

Detailed Description

Definition at line 42 of file RunControlMain.py.

The documentation for this class was generated from the following file:
  • RunControlMain.py
Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ConnectState Class Reference

HskCli.ConnectState

ConnectState Class Reference

Detailed Description

Definition at line 92 of file HskCli.py.

The documentation for this class was generated from the following file:
  • HskCli.py
Generated on Fri Jul 21 13:27:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Consumer Class Reference

consumer.Consumer

Consumer Class Reference

Consumer class to consume LDF data This class just handles file open/close or server open/close. More...

Inheritance diagram for Consumer:

[legend]
List of all members.

Public Member Functions

__init__ (argv)
parseEvent ()
checkUDF ()
getRunId ()
setRunId (runId)
getNextEvent ()
serverOpen (server="1")
serverClose ()
fileOpen (fn)
fileClose ()
archiveOpen (fn)
archiveClose (fn)
dataSize ()
usage ()
parseArgs (argv)
loop ()

Detailed Description

Consumer class to consume LDF data This class just handles file open/close or server open/close.

Definition at line 19 of file consumer.py.

Member Function Documentation

__init__ ( argv )

consumer constructor

Reimplemented in consumerPlotter.

archiveClose ( fn )

Close data archive

archiveOpen ( fn )

Open data archive

dataSize ( )

Return current event data size

fileClose ( )

Close input data file

fileOpen ( fn )

Load input data from a file

getNextEvent ( )

get Next Event into data buffer

parseEvent ( )

Analyse an event

Reimplemented in consumerPlotter.

serverClose ( )

Close network server

serverOpen ( server = "1" )

Connect to network server

The documentation for this class was generated from the following file:
  • consumer.py
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: consumerPlotter Class Reference

consumerPlotter.consumerPlotter

consumerPlotter Class Reference

Consumer class to consume LDF data This class just handles file open/close or server open/close. More...

Inheritance diagram for consumerPlotter:

[legend]
Collaboration diagram for consumerPlotter:

[legend]
List of all members.

Public Member Functions

__init__ (argv)
getName ()
parseEvent ()
checkUDF ()
checkLimits ()
setCompletionStatus (status)
getCompletionStatusStr ()
getCompletionStatus ()
addExportedFile (file, delete=False)
exportFiles ()

Detailed Description

Consumer class to consume LDF data This class just handles file open/close or server open/close.

Definition at line 18 of file consumerPlotter.py.

Member Function Documentation

__init__ ( argv )

consumer constructor

Reimplemented from Consumer.

parseEvent ( )

Analyse an event

Reimplemented from Consumer.

The documentation for this class was generated from the following file:
  • consumerPlotter.py
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: CratePanel Class Reference

PorcinePanel.CratePanel

CratePanel Class Reference

Inheritance diagram for CratePanel:

[legend]
Collaboration diagram for CratePanel:

[legend]
List of all members.

Public Member Functions

constructGrid ()

Detailed Description

Definition at line 120 of file PorcinePanel.py.

The documentation for this class was generated from the following file:
  • PorcinePanel.py
Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: DataDistributorAddress Class Reference

DataDistributor.DataDistributorAddress

DataDistributorAddress Class Reference

Data distributor address class containing static methods that govern the picking of multicast ports and addresses. More...

List of all members.

Static Public Member Functions

static | port (name)
static | lookup (port, server)

Detailed Description

Data distributor address class containing static methods that govern the picking of multicast ports and addresses.

Definition at line 111 of file DataDistributor.py.

Member Function Documentation

static lookup | ( | port | ,
 |  | server |
 | ) | [static]

Static method for resolving the multicast port and group values.

Parameters:
port | An integer containing the multicast port to use, e.g. from the port() method above, or None to indicate that the value will come from the supplied server string.
server | A string that contains either the machine ID (test stand instance number), or <port><group IP or name>, or <group ip ="" or="" name=""> when a port number is also supplied. These last two can be used to override the values chosen by this class. The machine ID is a number from 0 - 999, where the hundreds digit represents the site ID and remainder (0-99) is the machine ID at the site. This latter portion is what's used.
Returns:
A list made up of the resolved port and group values.

static port ( name ) [static]

Static method to select a physical multicast port to use based on the type of data that is desired.

Parameters:
name The name of the type of data that is desired. Choose from 'LAT_EBFdata', 'LAT_CMDdata', 'LAT_HSKdata' and 'LAT_MsgLog'.

The documentation for this class was generated from the following file:
  • DataDistributor.py
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: DataDistributorClient Class Reference

DataDistributor.DataDistributorClient

DataDistributorClient Class Reference

Data distributor client class. More...

List of all members.

Public Member Functions

__init__ (name=None, size=641024)
connect (server)
disconnect ()
returnNone ()
receive ()

Detailed Description

Data distributor client class.

Definition at line 61 of file DataDistributor.py.

Member Function Documentation

__init__ | ( | name | = None,
 |  | size | = 641024
 | ) |

Data Distributor client constructor.

Parameters:
name | The name of the type of data that the client wants to receive. See the DataDistributorAddress class.
size | The size in bytes of the buffer to allocate for receiving the data. Defaults to 64 KB.

connect ( server )

Open a UDP socket, bind it to a port and select a multicast group.

Parameters:
server The address the server is multicasting on. This address must be the same for both server and client. The value can be in one of the following forms:
  • A number of which only the two lower decimal digits are used, i.e., in the range 0-99
  • <port><multicast address>, where <port> is a value that will override what is found from the data type name translation, and <multicast address=""> is some valid multicast IP address starting with the value 239. A name may be used for the <multicast address=""> value as well, as long as it can be found in the name server and translates to a valid multicast IP address.
  • <multicast address="">, as discussed in the previous bullet. The port value is taken to be the one found from looking up the data type name in the port table.

disconnect ( )

Gracefully shut down the socket.

receive ( )

Receive multicast data and the sender's identification.

Returns:
A list of the data and the sender's identification string.

returnNone ( )

Method to signal the receive loop to exit.

The documentation for this class was generated from the following file:
  • DataDistributor.py
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: DataDistributorPoll Class Reference

DataDistributorPoll.DataDistributorPoll

DataDistributorPoll Class Reference

Data distributor client that polls for samples of data. More...

List of all members.

Public Member Functions

__init__ (name, length=641024)
start ()
stop ()
receive ()

Detailed Description

Data distributor client that polls for samples of data.

Use of this class involves the starting of a thread that constantly receives the data arriving in the base class's socket. Keeping the socket drained of data allows the user of this class to get the most recent data received, thus avoiding getting data with a bursty time structure. Whenever the application calls the receive() method, it gets the most recent data sample. Because of the reference counting method used by Python objects, no copy of the data needs to be made to avoid the data changing from underneath the application. The application can hold onto the data reference as long as it likes. Whenever new data appears a new reference is created, and is possibly deleted before the application gets access to it, leaving any existing reference alone. When the application tries to get access to the latest data, it gets a copy of the most recent reference, and the previous reference is deleted, if it has gone out of scope.

Definition at line 25 of file DataDistributorPoll.py.

Member Function Documentation

__init__ | ( | name | ,
 |  | length | = 641024
 | ) |

DataDistributorPoll constructor.

Parameters:
name | The name of the type of data that the client wants to receive. See the DataDistributorAddress class.
length | The size in bytes of the buffer to allocate for receiving the data. Defaults to 64 KB.

receive ( )

Receive a sampled value of the data and sender information.

Returns:
A list of the sampled data and sender's identification string. If the data buffer has not been refreshed since the last call, return None, None.

start ( )

Start the polling thread.

stop ( )

Stop the polling thread.

The documentation for this class was generated from the following file:
  • DataDistributorPoll.py
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: DataDistributorServer Class Reference

DataDistributor.DataDistributorServer

DataDistributorServer Class Reference

Data Distributor Server. More...

List of all members.

Public Member Functions

__init__ (name=None, size=321024)
connect (server, interface=socket.gethostname())
disconnect ()
publish (data)

Detailed Description

Data Distributor Server.

Definition at line 11 of file DataDistributor.py.

Member Function Documentation

__init__ | ( | name | = None,
 |  | size | = 321024
 | ) |

Data Distributor server constructor.

Parameters:
name | The name of the type of data to be served. See the DataDistributorAddress class.
size | The size in bytes of the buffer to allocate for sending the data. This is used to set the socket send buffer size.

connect | ( | server | ,
 |  | interface | = socket.gethostname()
 | ) |

Method to set up a socket and connect to it.

Parameters:
server The address of a socket on which to serve the data. This address must be the same for both server and client. The value can be in one of the following forms:
  • A number of which only the two lower decimal digits are used, i.e., in the range 0-99
  • <port><multicast address>, where <port> is a value that will override what is found from the data type name translation, and <multicast address=""> is some valid multicast IP address starting with the value 239. A name may be used for the <multicast address=""> value as well, as long as it can be found in the name server and translates to a valid multicast IP address.
  • <multicast address="">, as discussed in the previous bullet. The port value is taken to be the one found from looking up the data type name in the port table.
interface The network interface to send multicast traffic on. Defaults to 'the primary network interface', however 'primary' is defined. See socket.gethostbyname_ex() documentation.

disconnect ( )

Gracefully shut down the socket.

publish ( data )

Publish the data on the multicast socket.

Parameters:
data The data to be sent out on the multicast socket.

The documentation for this class was generated from the following file:
  • DataDistributor.py
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: DataExport Class Reference

DataExport.DataExport

DataExport Class Reference

Class to synch a file or set of files between one location and another. More...

List of all members.

Public Member Functions

__init__ ()
setPurge (purge)
synch (source, dest)
Synch up two directory structures.
export (source, dest)
Copy from source to dest.
md5sum (fname)
Returns an md5 hash for file fname.

Detailed Description

Class to synch a file or set of files between one location and another.

Definition at line 27 of file DataExport.py.

Member Function Documentation

export | ( | source | ,
 |  | dest |
 | ) |

Copy from source to dest.

! This routine will determine whether source is a file or a directory

synch | ( | source | ,
 |  | dest |
 | ) |

Synch up two directory structures.

! Synch only goes in one direction: source --> destination.

The documentation for this class was generated from the following file:
  • DataExport.py
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: DefaultPeriodicCondition Class Reference

TrgUsingTiles.DefaultPeriodicCondition

DefaultPeriodicCondition Class Reference

DefaultPeriodicCondition class. More...

Inheritance diagram for DefaultPeriodicCondition:

[legend]
Collaboration diagram for DefaultPeriodicCondition:

[legend]
List of all members.

Public Member Functions

__init__ ()
DefaultPeriodicCondition constructor.
definition ()
definition() method See TrgPeriodicCondition base class

Detailed Description

DefaultPeriodicCondition class.

Definition at line 43 of file TrgUsingTiles.py.

The documentation for this class was generated from the following file:
  • TrgUsingTiles.py
Generated on Fri Jul 21 13:28:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: DefaultSequence Class Reference

TrgUsingTiles.DefaultSequence

DefaultSequence Class Reference

Inheritance diagram for DefaultSequence:

[legend]
Collaboration diagram for DefaultSequence:

[legend]
List of all members.

Public Member Functions

definition ()
definition() method See TrgSequence base class

Detailed Description

Definition at line 56 of file TrgUsingTiles.py.

The documentation for this class was generated from the following file:
  • TrgUsingTiles.py
Generated on Fri Jul 21 13:28:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: DIAGcontributionIterator Class Reference

standardLDF.DIAGcontributionIterator

DIAGcontributionIterator Class Reference

List of all members.

Public Member Functions

__init__ (event, contribution, dataStart, lci)
CALdiag (tower, layer, diag)
TKRdiag (tower, gtcc, diag)

Detailed Description

Definition at line 57 of file standardLDF.py.

The documentation for this class was generated from the following file:
  • standardLDF.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: DIAGcontributionIterator_ Class Reference

GOSED_LDF.DIAGcontributionIterator_

DIAGcontributionIterator_ Class Reference

List of all members.

Public Member Functions

__init__ (event, contribution, dataStart, gui)
CALdiag (tower, layer, diag)
TKRdiag (tower, gtcc, diag)

Detailed Description

Definition at line 158 of file GOSED_LDF.py.

The documentation for this class was generated from the following file:
  • GOSED_LDF.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: DispatcherError Class Reference

errors.DispatcherError

DispatcherError Class Reference

Inheritance diagram for DispatcherError:

[legend]

Detailed Description

Base class for all Dispatcher errors

Definition at line 9 of file errors.py.

The documentation for this class was generated from the following file:
  • errors.py
Generated on Fri Jul 21 13:26:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: DispatcherKeyError Class Reference

errors.DispatcherKeyError

DispatcherKeyError Class Reference

Inheritance diagram for DispatcherKeyError:

[legend]
Collaboration diagram for DispatcherKeyError:

[legend]

Detailed Description

Error raised when unknown (sender,signal) set specified

Definition at line 15 of file errors.py.

The documentation for this class was generated from the following file:
  • errors.py
Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: DispatcherTypeError Class Reference

errors.DispatcherTypeError

DispatcherTypeError Class Reference

Inheritance diagram for DispatcherTypeError:

[legend]
Collaboration diagram for DispatcherTypeError:

[legend]

Detailed Description

Error raised when inappropriate signal-type specified (None)

Definition at line 21 of file errors.py.

The documentation for this class was generated from the following file:
  • errors.py
Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: doublehisto Class Reference

doublehisto.doublehisto

doublehisto Class Reference

List of all members.

Public Member Functions

setup (nbins, lower, upper, logx, logy)
addHisto (name="histo", color="black", style=0, uselabel=0, showhis=1)
find (name)
setHistoLabel (name, lab)
hideHisto (name)
showHisto (name)
removeHisto (name)
removeAllHistos ()
setBinBoundaries ()
resetHisto (number)
resetAllHistos ()
setLogy (on)
makelabels (ticks, logs, alignment)
fill (name, xval, weight=1.)
setBinContent (name, i, w)
resetlin ()
resetlog ()
resetxaxis (newaxis)
updateHisto ()
computeticks (lower, upper, log)
paintEvent (pe)
resizeEvent (rev)
drawLabels ()

Detailed Description

Definition at line 8 of file doublehisto.py.

The documentation for this class was generated from the following file:
  • doublehisto.py
Generated on Fri Jul 21 13:26:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: drawHatACD Class Reference

GOSEDPainter.drawHatACD

drawHatACD Class Reference

List of all members.

Public Member Functions

__init__ (gui, parent=None, name=None, fl=0)
drawNames (pixmap)
clear ()
showEvent (se)
paintEvent (pe)
paintFace ()

Detailed Description

Draws background Pixmap for the ACD Hat projection and updates the custom widget with the final pixmap processed by GOSED_LDF.

Definition at line 128 of file GOSEDPainter.py.

Member Function Documentation

__init__ | ( | gui | ,
 |  | parent | = None,
 |  | name | = None,
 |  | fl | = 0
 | ) |

drawHatACD contructor

Parameters:
parent | None
name | None
fl | 0

paintEvent ( pe )

Paint Event function for the Hat projection, paints its background and updates it with the current event pixmap (final) created in GOSED_LDF. If no data passed the filter for ACD, final will be updated as the background.

Parameters:
pe paint event

The documentation for this class was generated from the following file:
  • GOSEDPainter.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: drawRainbowACD Class Reference

GOSEDPainter.drawRainbowACD

drawRainbowACD Class Reference

List of all members.

Public Member Functions

__init__ (gui, parent=None, name=None, fl=0)
paintEvent (pe)
paintRainbowACD ()

Detailed Description

Draws background Pixmap for the ACD Rainbow and updates the custom widget with the final pixmap.

Definition at line 269 of file GOSEDPainter.py.

Member Function Documentation

__init__ | ( | gui | ,
 |  | parent | = None,
 |  | name | = None,
 |  | fl | = 0
 | ) |

drawRainbowACD constructor

Parameters:
parent | None
name | None
fl | 0

paintEvent ( pe )

Paint Event function for the ACD rainbow.

Parameters:
pe paint event

The documentation for this class was generated from the following file:
  • GOSEDPainter.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: drawRainbowCAL Class Reference

GOSEDPainter.drawRainbowCAL

drawRainbowCAL Class Reference

List of all members.

Public Member Functions

__init__ (gui, parent=None, name=None, fl=0)
paintEvent (pe)
paintRainbowCAL ()

Detailed Description

Draws background Pixmap for the CAL Rainbow and updates the custom widget with the final pixmap.

Definition at line 292 of file GOSEDPainter.py.

Member Function Documentation

__init__ | ( | gui | ,
 |  | parent | = None,
 |  | name | = None,
 |  | fl | = 0
 | ) |

drawRainbowCAL constructor

Parameters:
parent | None
name | None
fl | 0

paintEvent ( pe )

Paint Event function for the CAL rainbow.

Parameters:
pe paint event

The documentation for this class was generated from the following file:
  • GOSEDPainter.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: drawSide1ACD Class Reference

GOSEDPainter.drawSide1ACD

drawSide1ACD Class Reference

List of all members.

Public Member Functions

__init__ (gui, parent=None, name=None, fl=0)
drawNames (pixmap)
clear ()
showEvent (se)
paintEvent (pe)
paintFace ()

Detailed Description

Draws background Pixmap for the ACD Side 1 projection and updates the custom widget with the final pixmap processed by GOSED_LDF.

Definition at line 12 of file GOSEDPainter.py.

Member Function Documentation

__init__ | ( | gui | ,
 |  | parent | = None,
 |  | name | = None,
 |  | fl | = 0
 | ) |

drawSide1ACD contructor

Parameters:
parent | None
name | None
fl | 0

paintEvent ( pe )

Paint Event function for the Side 1 projection, paints its background and updates it with the current event pixmap (final) created in GOSED_LDF. If no data passed the filter for ACD, final will be updated as the background.

Parameters:
pe paint event

The documentation for this class was generated from the following file:
  • GOSEDPainter.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: drawSide2ACD Class Reference

GOSEDPainter.drawSide2ACD

drawSide2ACD Class Reference

List of all members.

Public Member Functions

__init__ (gui, parent=None, name=None, fl=0)
drawNames (pixmap)
clear ()
showEvent (se)
paintEvent (pe)
paintFace ()

Detailed Description

Draws background Pixmap for the ACD Side 2 projection and updates the custom widget with the final pixmap processed by GOSED_LDF.

Definition at line 41 of file GOSEDPainter.py.

Member Function Documentation

__init__ | ( | gui | ,
 |  | parent | = None,
 |  | name | = None,
 |  | fl | = 0
 | ) |

drawSide2ACD contructor

Parameters:
parent | None
name | None
fl | 0

paintEvent ( pe )

Paint Event function for the Side 2 projection, paints its background and updates it with the current event pixmap (final) created in GOSED_LDF. If no data passed the filter for ACD, final will be updated as the background.

Parameters:
pe paint event

The documentation for this class was generated from the following file:
  • GOSEDPainter.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: drawSide3ACD Class Reference

GOSEDPainter.drawSide3ACD

drawSide3ACD Class Reference

List of all members.

Public Member Functions

__init__ (gui, parent=None, name=None, fl=0)
drawNames (pixmap)
clear ()
showEvent (se)
paintEvent (pe)
paintFace ()

Detailed Description

Draws background Pixmap for the ACD Side 3 projection and updates the custom widget with the final pixmap processed by GOSED_LDF.

Definition at line 70 of file GOSEDPainter.py.

Member Function Documentation

__init__ | ( | gui | ,
 |  | parent | = None,
 |  | name | = None,
 |  | fl | = 0
 | ) |

drawSide3ACD contructor

Parameters:
parent | None
name | None
fl | 0

paintEvent ( pe )

Paint Event function for the Side 3 projection, paints its background and updates it with the current event pixmap (final) created in GOSED_LDF. If no data passed the filter for ACD, final will be updated as the background.

Parameters:
pe paint event

The documentation for this class was generated from the following file:
  • GOSEDPainter.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: drawSide4ACD Class Reference

GOSEDPainter.drawSide4ACD

drawSide4ACD Class Reference

List of all members.

Public Member Functions

__init__ (gui, parent=None, name=None, fl=0)
drawNames (pixmap)
clear ()
showEvent (se)
paintEvent (pe)
paintFace ()

Detailed Description

Draws background Pixmap for the ACD Side 4 projection and updates the custom widget with the final pixmap processed by GOSED_LDF.

Definition at line 99 of file GOSEDPainter.py.

Member Function Documentation

__init__ | ( | gui | ,
 |  | parent | = None,
 |  | name | = None,
 |  | fl | = 0
 | ) |

drawSide4ACD contructor

Parameters:
parent | None
name | None
fl | 0

paintEvent ( pe )

Paint Event function for the Side 4 projection, paints its background and updates it with the current event pixmap (final) created in GOSED_LDF. If no data passed the filter for ACD, final will be updated as the background.

Parameters:
pe paint event

The documentation for this class was generated from the following file:
  • GOSEDPainter.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: drawXZ_CAL Class Reference

GOSEDPainter.drawXZ_CAL

drawXZ_CAL Class Reference

List of all members.

Public Member Functions

__init__ (gui, parent=None, name=None, fl=0)
clear ()
showEvent (se)
paintEvent (pe)
paintFace ()

Detailed Description

Draws background Pixmap for the XZ CAL projection and updates the custom widget with the final pixmap processed by GOSED_LDF.

Definition at line 213 of file GOSEDPainter.py.

Member Function Documentation

__init__ | ( | gui | ,
 |  | parent | = None,
 |  | name | = None,
 |  | fl | = 0
 | ) |

drawXZ_CAL constructor

Parameters:
parent | None
name | None
fl | 0

paintEvent ( pe )

Paint Event function for the XZ CAL projection, paints its background and updates it with the current event pixmap (final) created in GOSED_LDF. If no data passed the filter for TKR, final will be updated as the background.

Parameters:
pe paint event

The documentation for this class was generated from the following file:
  • GOSEDPainter.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: drawXZ_TKR Class Reference

GOSEDPainter.drawXZ_TKR

drawXZ_TKR Class Reference

List of all members.

Public Member Functions

__init__ (gui, parent=None, name=None, fl=0)
clear ()
showEvent (se)
paintEvent (pe)
paintFace ()

Detailed Description

Draws background Pixmap for the XZ TKR projection and updates the custom widget with the final pixmap processed by GOSED_LDF.

Definition at line 157 of file GOSEDPainter.py.

Member Function Documentation

__init__ | ( | gui | ,
 |  | parent | = None,
 |  | name | = None,
 |  | fl | = 0
 | ) |

drawXZ_TKR contructor

Parameters:
parent | None
name | None
fl | 0

paintEvent ( pe )

Paint Event function for the XZ TKR projection, paints its background and updates it with the current event pixmap (final) created in GOSED_LDF. If no data passed the filter for TKR, final will be updated as the background.

Parameters:
pe paint event

The documentation for this class was generated from the following file:
  • GOSEDPainter.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: drawYZ_CAL Class Reference

GOSEDPainter.drawYZ_CAL

drawYZ_CAL Class Reference

List of all members.

Public Member Functions

__init__ (gui, parent=None, name=None, fl=0)
clear ()
showEvent (se)
paintEvent (pe)
paintFace ()

Detailed Description

Draws background Pixmap for the YZ TKR projection and updates the custom widget with the final pixmap processed by GOSED_LDF.

Definition at line 241 of file GOSEDPainter.py.

Member Function Documentation

__init__ | ( | gui | ,
 |  | parent | = None,
 |  | name | = None,
 |  | fl | = 0
 | ) |

drawYZ_CAL constructor

Parameters:
parent | None
name | None
fl | 0

paintEvent ( pe )

Paint Event function for the YZ CAL projection, paints its background and updates it with the current event pixmap (final) created in GOSED_LDF. If no data passed the filter for TKR, final will be updated as the background.

Parameters:
pe paint event

The documentation for this class was generated from the following file:
  • GOSEDPainter.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: drawYZ_TKR Class Reference

GOSEDPainter.drawYZ_TKR

drawYZ_TKR Class Reference

List of all members.

Public Member Functions

__init__ (gui, parent=None, name=None, fl=0)
clear ()
showEvent (se)
paintEvent (pe)
paintFace ()

Detailed Description

Draws background Pixmap for the YZ TKR projection and updates the custom widget with the final pixmap processed by GOSED_LDF.

Definition at line 185 of file GOSEDPainter.py.

Member Function Documentation

__init__ | ( | gui | ,
 |  | parent | = None,
 |  | name | = None,
 |  | fl | = 0
 | ) |

drawYZ_TKR constructor

Parameters:
parent | None
name | None
fl | 0

paintEvent ( pe )

Paint Event function for the YZ TKR projection, paints its background and updates it with the current event pixmap (final) created in GOSED_LDF. If no data passed the filter for TKR, final will be updated as the background.

Parameters:
pe paint event

The documentation for this class was generated from the following file:
  • GOSEDPainter.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: DummyRecorder Class Reference

Recorder.DummyRecorder

DummyRecorder Class Reference

Example recorder that dumps the trendables to a logger. More...

Inheritance diagram for DummyRecorder:

[legend]
Collaboration diagram for DummyRecorder:

[legend]
List of all members.

Public Member Functions

__init__ ()
processTrends (trendables)

Detailed Description

Example recorder that dumps the trendables to a logger.

Definition at line 23 of file Recorder.py.

The documentation for this class was generated from the following file:
  • Recorder.py
Generated on Fri Jul 21 13:27:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: DummyRetriever Class Reference

Retriever.DummyRetriever

DummyRetriever Class Reference

Inheritance diagram for DummyRetriever:

[legend]
Collaboration diagram for DummyRetriever:

[legend]
List of all members.

Public Member Functions

__init__ ()
retrievePacket ()

Detailed Description

Dummy retriever used for testing.

Creates 24 trendable objects which are simply sin/cos functions.

Definition at line 18 of file Retriever.py.

The documentation for this class was generated from the following file:
  • Retriever.py
Generated on Fri Jul 21 13:27:59 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: EBFeventIterator Class Reference

standardLDF.EBFeventIterator

EBFeventIterator Class Reference

List of all members.

Public Member Functions

process (evt)

Detailed Description

Definition at line 82 of file standardLDF.py.

The documentation for this class was generated from the following file:
  • standardLDF.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Email Class Reference

MailAlert.Email

Email Class Reference

Inheritance diagram for Email:

[legend]
List of all members.

Public Member Functions

sender (s=None)
recipient (r=None)
subject (s=None)
body (b=None)

Detailed Description

Definition at line 17 of file MailAlert.py.

The documentation for this class was generated from the following file:
  • MailAlert.py
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: EMPanel Class Reference

PorcinePanel.EMPanel

EMPanel Class Reference

List of all members.

Public Member Functions

addSelectable (key, sel)
getSelect ()
setStatus (status)
setSelect (select)
selectChanged (name)
setEnables (enablemap)

Detailed Description

Definition at line 130 of file PorcinePanel.py.

The documentation for this class was generated from the following file:
  • PorcinePanel.py
Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: EnvMonImpl Class Reference

EnvMonImpl.EnvMonImpl

EnvMonImpl Class Reference

List of all members.

Public Member Functions

__init__ (common, parent=None, name=None, fl=0)
setupLabels (newTem)
setFont (font)
adjustMonitorTextFont (monTxt)
toggleRaw (raw)
changeBlock (block)
selectAEM ()
selectTEM (blockText)
changeFreeBoard (boardId)
populateACDchecks (boardId)
toggleDataTakingPlot (id)
toggleDataTakingMon (id)
toggleChan0Plot (id)
toggleChan0Mon (id)
toggleChan1Plot (id)
toggleChan1Mon (id)
toggleChan2Plot (id)
toggleChan2Mon (id)
toggleChan3Plot (id)
toggleChan3Mon (id)
toggleChan4Plot (id)
toggleChan4Mon (id)
toggleAcdEnv1Plot (id)
toggleAcdEnv1Mon (id)
togglePDUPlot (id)
togglePDUMon (id)
clearPlots ()
initDisplays ()
changeRate (val)
calcDeadTime (regName)
readEnvValues ()
shutdown ()
quitApp ()
unregisterExitHandler ()
closeEvent (e)
customEvent (e)
execGUImethodNR (func, args, kwargs)
execGUImethod (func, args, kwargs)

Detailed Description

Definition at line 29 of file EnvMonImpl.py.

Member Function Documentation

customEvent ( e )

This method overrides the QObject base class's. There is generally no reason to call this method directly. It is called by the Qt infrastructure whenever the custom event is posted, e.g. by the following three methods of this class: createGUI, execGUImethodNR and execGUImethod.

execGUImethod | ( | func | ,
 |  | args | ,
 |  | kwargs |
 | ) |

Method used for executing a GUI function from a non-GUI thread. Use this method when a response is expected from the function and when it is appropriate to wait for it (no deadlock arises)

execGUImethodNR | ( | func | ,
 |  | args | ,
 |  | kwargs |
 | ) |

Method used for executing a GUI function from a non-GUI thread. Use this method when no (useful) response is expected or when waiting for one could cause a deadlock. Any response from the function is lost.

The documentation for this class was generated from the following file:
  • EnvMonImpl.py
Generated on Fri Jul 21 13:26:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ERRcontributionIterator_ Class Reference

GOSED_LDF.ERRcontributionIterator_

ERRcontributionIterator_ Class Reference

List of all members.

Public Member Functions

__init__ (event, contribution, dataStart, gui)
gcccError (tower, gccc, err)
gtccError (tower, gtcc, err)
phaseError (tower, err)
timeoutError (tower, err)
gtrcPhaseError (tower, gtcc, gtrc, err)
gtfePhaseError (tower, gtcc, gtrc, err1, err2, err3, err4, err5)
gtccFIFOerror (tower, gtcc, err)
gtccTMOerror (tower, gtcc)
gtccHDRParityError (tower, gtcc)
gtccWCParityError (tower, gtcc)
gtrcSummaryError (tower, gtcc)
gtccDataParityError (tower, gtcc)

Detailed Description

Definition at line 165 of file GOSED_LDF.py.

The documentation for this class was generated from the following file:
  • GOSED_LDF.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ErrorLogCounterHandler Class Reference

RunControlCommon.ErrorLogCounterHandler

ErrorLogCounterHandler Class Reference

List of all members.

Public Member Functions

emit (record)

Detailed Description

Definition at line 56 of file RunControlCommon.py.

The documentation for this class was generated from the following file:
  • RunControlCommon.py
Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evAEM_PHA Class Reference

gEvtCli.evAEM_PHA

evAEM_PHA Class Reference

PHA object. More...

Inheritance diagram for evAEM_PHA:

[legend]
Collaboration diagram for evAEM_PHA:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

PHA object.

Bit Fields:

  • more
  • range
  • ADC
  • parityErr

Definition at line 108 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:54 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evCAL_LayerLogData Class Reference

gEvtCli.evCAL_LayerLogData

evCAL_LayerLogData Class Reference

Class that associates a layer with the log data. More...

List of all members.

Public Member Functions

__init__ (twr, layer, data)
evCAL_LayerLogData constructor

Detailed Description

Class that associates a layer with the log data.

Definition at line 409 of file gEvtCli.py.

Member Function Documentation

__init__ | ( | twr | ,
 |  | layer | ,
 |  | data |
 | ) |

evCAL_LayerLogData constructor

Parameters:
layer | CAL layer (such as 'x1', 'y1', etc)
data | evCAL_LogData bitfield

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evCAL_LogAccepts Class Reference

gEvtCli.evCAL_LogAccepts

evCAL_LogAccepts Class Reference

Log Accepts bitfields. More...

Inheritance diagram for evCAL_LogAccepts:

[legend]
Collaboration diagram for evCAL_LogAccepts:

[legend]
List of all members.

Public Member Functions

__init__ (twr, ui)

Detailed Description

Log Accepts bitfields.

Bit Fields:

  • y3
  • y2
  • y1
  • y0
  • x3
  • x2
  • x1
  • x0

Definition at line 400 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evCAL_LogData Class Reference

gEvtCli.evCAL_LogData

evCAL_LogData Class Reference

Log Data bitfields. More...

Inheritance diagram for evCAL_LogData:

[legend]
Collaboration diagram for evCAL_LogData:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Log Data bitfields.

Bit Fields:

  • column
  • rangeADC_neg
  • valADC_neg
  • rangeADC_pos
  • valADC_pos

Definition at line 431 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evCellHeader Class Reference

gEvtCli.evCellHeader

evCellHeader Class Reference

Cell Header bitfields. More...

Inheritance diagram for evCellHeader:

[legend]
Collaboration diagram for evCellHeader:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Cell Header bitfields.

Bit Fields:

  • respond
  • destination
  • protocol
  • source
  • parity

Definition at line 604 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:59 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evCellHeader_Singleton Class Reference

gEvtCli.evCellHeader_Singleton

evCellHeader_Singleton Class Reference

Inheritance diagram for evCellHeader_Singleton:

[legend]
Collaboration diagram for evCellHeader_Singleton:

[legend]
List of all members.

Public Member Functions

__call__ (ui)

Detailed Description

Definition at line 609 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:59 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evContPacket Class Reference

gEvtCli.evContPacket

evContPacket Class Reference

Contribution Packet bitfields. More...

Inheritance diagram for evContPacket:

[legend]
Collaboration diagram for evContPacket:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Contribution Packet bitfields.

Bit Fields:

  • error
  • sequence
  • length

Definition at line 319 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:55 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evContPacket_Singleton Class Reference

gEvtCli.evContPacket_Singleton

evContPacket_Singleton Class Reference

Inheritance diagram for evContPacket_Singleton:

[legend]
Collaboration diagram for evContPacket_Singleton:

[legend]
List of all members.

Public Member Functions

__call__ (ui)

Detailed Description

Definition at line 324 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evDiag_CalLayer Class Reference

gEvtCli.evDiag_CalLayer

evDiag_CalLayer Class Reference

Calorimeter Layer class. More...

List of all members.

Public Member Functions

__init__ ()

Detailed Description

Calorimeter Layer class.

Members:

  • gccc
  • layer
  • negLayerEnd
  • posLayerEnd

Definition at line 460 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evDiag_CalLayerEnd Class Reference

gEvtCli.evDiag_CalLayerEnd

evDiag_CalLayerEnd Class Reference

Calorimeter Layer End bitfields. More...

Inheritance diagram for evDiag_CalLayerEnd:

[legend]
Collaboration diagram for evDiag_CalLayerEnd:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Calorimeter Layer End bitfields.

Bit Fields:

  • trgRequestHigh
  • trgRequestLow
  • logAccepts

Definition at line 445 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evDiag_Data Class Reference

gEvtCli.evDiag_Data

evDiag_Data Class Reference

Diagnostic Data class. More...

List of all members.

Public Member Functions

__init__ ()

Detailed Description

Diagnostic Data class.

Members:

  • cal
  • tkr

Definition at line 588 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evDiag_TkrTrgReq Class Reference

gEvtCli.evDiag_TkrTrgReq

evDiag_TkrTrgReq Class Reference

TKR Trigger Request bitfields. More...

Inheritance diagram for evDiag_TkrTrgReq:

[legend]
Collaboration diagram for evDiag_TkrTrgReq:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

TKR Trigger Request bitfields.

Members:

  • gtcc

Bit Fields:

  • trgRequests

Definition at line 475 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: eventThread Class Reference

trgDisplayImpl.eventThread

eventThread Class Reference

List of all members.

Public Member Functions

run ()

Detailed Description

Definition at line 23 of file trgDisplayImpl.py.

The documentation for this class was generated from the following file:
  • trgDisplayImpl.py
Generated on Fri Jul 21 13:28:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evErr_CablePhase Class Reference

gEvtCli.evErr_CablePhase

evErr_CablePhase Class Reference

Cable Controller Phasing Error bitfields. More...

Inheritance diagram for evErr_CablePhase:

[legend]
Collaboration diagram for evErr_CablePhase:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Cable Controller Phasing Error bitfields.

Bit Fields:

  • tag7
  • tag6
  • tag5
  • tag4
  • tag3
  • tag2
  • tag1
  • tag0

Definition at line 528 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evErr_CableTimeOut Class Reference

gEvtCli.evErr_CableTimeOut

evErr_CableTimeOut Class Reference

Cable Timeout Error bitfields. More...

Inheritance diagram for evErr_CableTimeOut:

[legend]
Collaboration diagram for evErr_CableTimeOut:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Cable Timeout Error bitfields.

Bit Fields:

  • tkr
  • cal

Definition at line 575 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evErr_GCCC Class Reference

gEvtCli.evErr_GCCC

evErr_GCCC Class Reference

GCCC Error bitfields. More...

Inheritance diagram for evErr_GCCC:

[legend]
Collaboration diagram for evErr_GCCC:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

GCCC Error bitfields.

Bit Fields:

  • errParm
  • sweepNum
  • errType

Definition at line 490 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evErr_GCCC_Message Class Reference

gEvtCli.evErr_GCCC_Message

evErr_GCCC_Message Class Reference

GCCC Error Message object. More...

List of all members.

Public Member Functions

__init__ (gccc, errGCCC)
evErr_GCCC_Message constructor

Detailed Description

GCCC Error Message object.

Members:

  • gccc
  • errGCCC

Definition at line 503 of file gEvtCli.py.

Member Function Documentation

__init__ | ( | gccc | ,
 |  | errGCCC |
 | ) |

evErr_GCCC_Message constructor

Parameters:
gccc | GCCC id
errGCCC | evErr_GCCC object instance

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evErr_GTCC Class Reference

gEvtCli.evErr_GTCC

evErr_GTCC Class Reference

GTCC Error bitfields. More...

Inheritance diagram for evErr_GTCC:

[legend]
Collaboration diagram for evErr_GTCC:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

GTCC Error bitfields.

Bit Fields:

  • dataParity
  • GTRCsum
  • wrdCntParity
  • hdrParity
  • cblTimeOut
  • fifoFull
  • phsGTFE
  • phsGTRC
  • nGTRC

Definition at line 548 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evErr_GTCC_Message Class Reference

gEvtCli.evErr_GTCC_Message

evErr_GTCC_Message Class Reference

GTCC Error Message object. More...

List of all members.

Public Member Functions

__init__ ()

Detailed Description

GTCC Error Message object.

Members:

  • gtcc
  • errGTCC
  • parameters

Definition at line 562 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evErr_Summary Class Reference

gEvtCli.evErr_Summary

evErr_Summary Class Reference

Error summary bitfields. More...

Inheritance diagram for evErr_Summary:

[legend]
Collaboration diagram for evErr_Summary:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Error summary bitfields.

Bit Fields:

  • cblTimeOut
  • cblPhsErr
  • gtccErr
  • gcccErr

Definition at line 278 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:54 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evGEM_Cond_Arrival_Times Class Reference

gEvtCli.evGEM_Cond_Arrival_Times

evGEM_Cond_Arrival_Times Class Reference

GEM Condition Arrival Times bitfield. More...

Inheritance diagram for evGEM_Cond_Arrival_Times:

[legend]
Collaboration diagram for evGEM_Cond_Arrival_Times:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

GEM Condition Arrival Times bitfield.

Members:

  • External
  • CNO
  • CAL_HE
  • CAL_LE
  • TKR
  • ROI

Definition at line 176 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:54 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evGEM_Veto_List Class Reference

gEvtCli.evGEM_Veto_List

evGEM_Veto_List Class Reference

GEM Veto List object. More...

List of all members.

Public Member Functions

__init__ ()
clear ()

Detailed Description

GEM Veto List object.

Members:

  • XZP
  • XZM
  • YZP
  • YZM
  • XY
  • NA
  • RBN

Definition at line 158 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:54 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evSummary Class Reference

gEvtCli.evSummary

evSummary Class Reference

Event summary bitfields. More...

Inheritance diagram for evSummary:

[legend]
Collaboration diagram for evSummary:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Event summary bitfields.

Bit Fields:

  • startbit
  • calStrobe
  • tag
  • TACK
  • readout4
  • zeroSuppress
  • marker
  • error
  • diag
  • evNumber
  • trgParityErr

Definition at line 300 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:55 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evSummary_Singleton Class Reference

gEvtCli.evSummary_Singleton

evSummary_Singleton Class Reference

Inheritance diagram for evSummary_Singleton:

[legend]
Collaboration diagram for evSummary_Singleton:

[legend]
List of all members.

Public Member Functions

__call__ (ui)

Detailed Description

Definition at line 305 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:55 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Evt Class Reference

gEvtCli.Evt

Evt Class Reference

Event object. More...

List of all members.

Public Member Functions

__init__ ()
Event object constructor.
clearEvent ()
Clear the event data.
addTKRstrip (cc, rc, strip)
Add a stripData to the tracker strip hit list of evTKR_StripData objects.
addTKRaccept (accept)
Add a TKR accept to the list.
addTKRtot (cc, rc, tot)
Add a TKR tot to the list of evTKR_TOTdata objects.
addCAL_LogAccept (accept)
Add a log accept to the list.
addCAL_LogData (twr, layer, data)
Add a log data to the list.
addErrGCCCmsg (errGCCC)
Add a GCCC error contribution to the event object.
addErrGTCCmsg (errGTCCmsg)
Add a GTCC error message to the event object.

Detailed Description

Event object.

Members:

  • aem
  • gem
  • contributor
  • summary
  • TKRstrips
  • TKRaccepts
  • TKRtots
  • CAL_LogAccepts
  • CAL_LogData
  • diag
  • errSummary
  • errGCCCmsg
  • errGTCCmsg
  • errCablePhase
  • errCableTimeOut

Definition at line 202 of file gEvtCli.py.

Member Function Documentation

__init__ ( )

Event object constructor.

Instantiate the AEM object and clear the event.

addCAL_LogAccept ( accept )

Add a log accept to the list.

Parameters:
accept An evCAL_LogAccepts object instance

addCAL_LogData | ( | twr | ,
 |  | layer | ,
 |  | data |
 | ) |

Add a log data to the list.

Parameters:
layer | A layer id in the form of 'x1', 'y1', etc.
data | An evCAL_LogData object instance

addErrGCCCmsg ( errGCCC )

Add a GCCC error contribution to the event object.

Parameters:
errGCCC An evErr_GCCC object instance

addErrGTCCmsg ( errGTCCmsg )

Add a GTCC error message to the event object.

Parameters:
errGTCCmsg An evErr_GTCC_Message object instance

addTKRaccept ( accept )

Add a TKR accept to the list.

Parameters:
9-bit TKR accept value

addTKRstrip | ( | cc | ,
 |  | rc | ,
 |  | strip |
 | ) |

Add a stripData to the tracker strip hit list of evTKR_StripData objects.

Parameters:
cc | Cable controller id
rc | Readout controller id
strip | evTKR_Strip object instance

addTKRtot | ( | cc | ,
 |  | rc | ,
 |  | tot |
 | ) |

Add a TKR tot to the list of evTKR_TOTdata objects.

Parameters:
cc | Cable controller id
rc | Readout controller id
tot | 8-bit tot value

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:54 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: EvtCli Class Reference

test_loopback.EvtCli

EvtCli Class Reference

List of all members.

Public Member Functions

read ()
dontread ()

Detailed Description

Definition at line 7 of file test_loopback.py.

The documentation for this class was generated from the following file:
  • test_loopback.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: EvtCli Class Reference

gEvtCli.EvtCli

EvtCli Class Reference

Event handler client. More...

Inheritance diagram for EvtCli:

[legend]
Collaboration diagram for EvtCli:

[legend]
List of all members.

Public Member Functions

__init__ (debug=0, port=EvtCliIO.PortNumber)
Event client constructor.
setDebug (debug)
Set the debug mode.
readEvent (dat=None)
Read an event.
getGGLTStatus ()
Retrieve the GGLT status.
getGGLTStatusStr ()
Return the string equivalent of the GGLT status code.
getOnlineStatus ()
Retrieve the Online status code.
getEvtStatus ()
Return the event status from the event header.
getContributionStatus ()
Return the contribution status.
getContributionStatusStr ()
Return the contribution status string.
getOnlineStatusStr ()
Retrieve the string equivalent of the Online status code.
getEvtSize ()
Return the event size.
isErrorEvent ()
isTrgParityErrorEvent ()
isPacketErrorEvent ()
isSweepEvent ()
Determine if a sweep event is received.
isGGLTStatus (status=None)
Determine if the current event is bad.
checkOnlineStatus (status, mask)
Checks if the bit mask mask matches the status that is assumed as an Online status.
checkGGLTstatus (status, mask)
Checks if the bit mask mask matches the status that is assumed as a GGLT status.
readEventSocket ()
setCurrentContribution (contributionId)
Given a contribution id, set the current contribution data needed for the parsing routines.
getCurrentContribution ()
Return the integer id of the current contribution.
getContributionList ()
Walk through the whole event and construct a list of contribution id strings.
dumpContributionData ()
Prints out information pertaining to the current contribution.
evGetTimestamp ()
Return the timestamp of the event in seconds.
evGetTimebase ()
Return the timestamp of the event derived from the PPC timebase register.
evGetEvtSeqMSW ()
Return the MSW portion of the event sequence.
evGetEvtSequence ()
Return the Event Sequence.
getUserId ()
Return the user id passed to the event client.
evGetTKR_Accepts (pAccept)
Walks tower event contribution to the TKR accepts data.
evGetCAL_NumAccepts ()
Counts the number of hit calorimeter logs in the tower event contribution.
evDumpGEM ()
Parses the GEM contribution by populating the data in self.evt.gem.
evDumpGEM_Veto_List (offset)
Parses the Veto List block of the GEM contribution.
getWord (wordOffset)
Unpack and return a 16-bit word value located at wordOffset.
getDWord (dWordOffset)
Unpack and return a 32-bit word value located at dWordOffset.
getByte (byteOffset)
Unpack and return an 8-bit byte value located at byteOffset.
evGetCAL_Logs ()
Walks tower event contribution to the CAL log data.
evGetCAL_LogAccepts ()
Walks the tower event contribution to the calorimeter log accepts word.
evDumpCAL_LogAccepts ()
Decodes the log accepts word and stores it in evt.CAL_LogAccepts.
evDumpCAL_Logs ()
Decodes all the log data for the event and stores it in evt.CAL_LogData.
evGetSummary ()
Return the offset to the summary word of the current contribution.
evGetTKR_StripN (pAccepts, stripN, stripData=None)
Fetches a 12-bit strip word from pAccepts, indexed by stripN.
evDumpTKR ()
Decodes all the TKR event data and stores it in the event object.
evBitCount (x)
Count the number of set bits in x.
evGetTKR_NumStrips ()
evGetTKR_TOT ()
Returns pointer to start of tracker TOT list.
evGetTKR_NumAccepts ()
Counts the number of accepted TKR layer-ends.
evGetTEM_Diagnostic ()
Returns pointer to start of diagnostic event data.
evGetTEM_Error ()
Returns pointer to the error word contribution of event data.
evDumpTEM_Error (forcePrint=0)
Decodes the event error contribution.
evDumpDiagnostic ()
Decodes the event diagnostic contribution.
evDumpSummary (minEvSize=24)
Decodes the event summary word.
evDumpAEM_Vetos ()
Decodes the AEM veto hit list contribution.
evDumpAEM_Accepts ()
Decodes the AEM accept list contribution.
evGetAEM_PHA (cbl)
Returns pointer to start of AEM PHA values.
evGetAEM_Vec (cbl, type)
Returns the 18-bit vector for cable specified by cbl and type.
evDumpAEM_PHA ()
Decodes the AEM PHA contribution.
evDumpEventAEM_G2 ()
Given a pointer to AEM event contribution print its contents.
evDumpEventAEM ()
The new AEM event parsing routine.
print_EOE_Warning ()
Print warning if we have reached the end of the contribution prematurely.

Detailed Description

Event handler client.

Contents:

Receives an event from TCP socket or a file stream and parses it into the evt object.

Overview:

The event client is responsible for communicating with the event server and retrieve events triggered by a script or an external source. The source of the event can be either a TCP socket or an archive file.

The event client uses lazy parsing to parse the event. This means the user application needs to call the parsing routines that corresponds to the section of the event that the user is interested in. The parser methods populate event objects inside the Evt class in the event client, so after the parser method is called these objects can be accessed or iterated over. The parser methods only apply to the current contribution. By default after readEvent() the first contribution after the GEM contribution is the current contribution. Use the setCurrentContribution method to change the current contribution. Use the getContributionList method to find out which contributions exist in the event.

Available parser methods:

  • evDumpSummary()
  • evDumpCAL_LogAccepts()
  • evDumpCAL_Logs()
  • evDumpTKR()
  • evDumpDiagnostic()
  • evDumpTEM_Error()
  • evDumpEventAEM()

Contribution related methods:

  • getContributionList()
  • getCurrentContribution()
  • setCurrentContribution()
  • dumpContributionData()

Retrieving the timestamp and timebase:

  • evGetTimestamp()
  • evGetTimebase()

Usage:

For reading events from a socket:

    from gEvtCli import *
    ec = EvtCli(debug=0)
    ec.connect('gitot')
    while ec.readEvent() == 0:
      ec.setCurrentContribution(...)
      if ec.getContributionStatus() == 0:
        ec.evDumpXXX()
        :
      else:
        print "Error %s in contribution %s ",
          (ec.getContributionStatusStr(), cId)
    ec.disconnect()
For reading events from an archived event file:
    from gEvtCli import *
    ec = EvtCli(debug=0)
    ec.open('030305165528.ldf')
    while ec.readEvent() == 0:
      ec.setCurrentContribution(...)
      if ec.getContributionStatus() == 0:
        ec.evDumpXXX()
        :
      else:
        print "Error %s in contribution %s ",
          (ec.getContributionStatusStr(), cId)
    ec.close()
For looping over contributions:
    from gEvtCli import *
    ec = EvtCli(debug=0)
    ec.connect('gitot')
    status = ec.readEvent()
    contList = ec.getContributionList()
    for cId in contList:
      ec.setCurrentContribution(cId)
      if ec.getContributionStatus() == 0:
        ec.evDumpSummary()
        if cId.startswith('TEM'):
          ec.evDumpCAL_LogAccepts()
          ec.evDumpCAL_Logs()
          ec.evDumpTKR()
          ec.evDumpTEM_Error()
          ec.evDumpDiagnostic()
        elif cId == 'AEM':
          ec.evDumpEventAEM()
      else:
        print "Error %s in contribution %s ",
          (ec.getContributionStatusStr(), cId)

Definition at line 795 of file gEvtCli.py.

Member Function Documentation

__init__ | ( | debug | = 0,
 |  | port | = EvtCliIO.PortNumber
 | ) |

Event client constructor.

Parameters:
debug Debug mode (0=Debug, 1=No debug)

Reimplemented from EvtCliIO.

checkGGLTstatus | ( | status | ,
 |  | mask |
 | ) |

Checks if the bit mask mask matches the status that is assumed as a GGLT status.

Parameters:
status | The status word to be checked against
mask | The mask bit(s) to be checked
Returns:
1 if there is a match 0 if there is no match

checkOnlineStatus | ( | status | ,
 |  | mask |
 | ) |

Checks if the bit mask mask matches the status that is assumed as an Online status.

Parameters:
status | The status word to be checked against
mask | The mask bit(s) to be checked
Returns:
1 if there is a match 0 if there is no match

evBitCount ( x )

Count the number of set bits in x.

Parameters:
x 32-bit word value
Returns:
Set bit count

evDumpAEM_Accepts ( )

Decodes the AEM accept list contribution.

This method is used by the old AEM event parser evDumpEventAEM_G2

evDumpAEM_PHA ( )

Decodes the AEM PHA contribution.

This method is used by the old AEM event parser evDumpEventAEM_G2

Given a pointer to AEM event contribution print the PHA values.

evDumpAEM_Vetos ( )

Decodes the AEM veto hit list contribution.

This method is used by the old AEM event parser evDumpEventAEM_G2

evDumpEventAEM ( )

The new AEM event parsing routine.

This parser works according to the latest specs where not all cable contributions are guaranteed to be provided.

evDumpEventAEM_G2 ( )

Given a pointer to AEM event contribution print its contents.

This method is the old G2 compatible AEM event parser, please use the new event parser evDumpEventAEM for G3 based AEM events.

evDumpGEM ( )

Parses the GEM contribution by populating the data in self.evt.gem.

Requires calling evtCli.setCurrentContribution(EvtCli.GEM) before usage.

evDumpGEM_Veto_List ( offset )

Parses the Veto List block of the GEM contribution.

Used by evDumpGEM

Parameters:
offset 32-bit word offset to the veto list block

evDumpSummary ( minEvSize = 24 )

Decodes the event summary word.

Given a pointer to tower event contribution print the event summary word.

Parameters:
minEvSize Minimum event size w/o error (default=24)

evDumpTEM_Error ( forcePrint = 0 )

Decodes the event error contribution.

If an error contribution is present this prints up to 20 16-bit words of the error contribution.

Parameters:
forcePrint If specified, dump the error even if in non-debug mode

evGetAEM_PHA ( cbl )

Returns pointer to start of AEM PHA values.

This method is used by the old AEM event parser evDumpEventAEM_G2

Parameters:
cbl Which cable is being decoded

evGetAEM_Vec | ( | cbl | ,
 |  | type |
 | ) |

Returns the 18-bit vector for cable specified by cbl and type.

This method is used by the old AEM event parser evDumpEventAEM_G2

Parameters:
cbl | Which cable is being decoded
type | ACD vector type
Returns:
18-bit vector

evGetCAL_LogAccepts ( )

Walks the tower event contribution to the calorimeter log accepts word.

Given a pointer to an entire TEM event contribution walk the data structure returning a pointer to the calorimeter log accepts word.

The 32-bit calorimeter log accepts word is immediately after the event summary word, i.e. the 2nd 32-bit word in the data.

Returns:
Offset to the calorimeter log accepts word.

evGetCAL_Logs ( )

Walks tower event contribution to the CAL log data.

Given a pointer to an entire TEM event contribution walk the data structure to the beginning of the calorimeter log data.

Returns:
Offset to the beginning of the calorimeter log data

evGetCAL_NumAccepts ( )

Counts the number of hit calorimeter logs in the tower event contribution.

Given a pointer to an entire TEM event contribution walk the data structure to the calorimeter log accepts word and return the sum of the number of hit logs.

Returns:
Number of hit logs

evGetEvtSeqMSW ( )

Return the MSW portion of the event sequence.

Returns:
MSW portion of the event sequence.

evGetEvtSequence ( )

Return the Event Sequence.

Returns:
Event sequence.

evGetSummary ( )

Return the offset to the summary word of the current contribution.

In a contribution, first word after the header is the summary word

Returns:
Offset to the summary word of the current contribution

evGetTEM_Diagnostic ( )

Returns pointer to start of diagnostic event data.

Caller should check the event summary word if a diagnostic contribution is present before calling this function.

Returns:
Offset to start of diagnostic event data

evGetTEM_Error ( )

Returns pointer to the error word contribution of event data.

Caller should check the event summary word if an error contribution is present before calling this function.

Returns:
Offset to the error word contribution

evGetTimebase ( )

Return the timestamp of the event derived from the PPC timebase register.

This is a 64 bit value that increments at an SBC implementation dependant rate (60 nS on MVME2306s). The value is reset at PPC reset time.

Returns:
Timestamp of the event in PPC timebase ticks.

evGetTimestamp ( )

Return the timestamp of the event in seconds.

The resolution of this timestamp is 1/60th of a second, by default. Consult VxWorks documentation for sysClkRateSet() and clock_setres() to see how to change this default. Beware that increasing the resolution from the default may cause adverse effects due to the increased interrupt rate generated.

Returns:
Timestamp of the event in seconds.

evGetTKR_Accepts ( pAccept )

Walks tower event contribution to the TKR accepts data.

Fills in the evGetTKR_Accepts structure pointed to by pAccept with the TKR accepts data. Also returns a pointer to the TKR accepts information.

Parameters:
pAccept Array to be filled with TKR accepts data
Returns:
Offset to the start of TKR accepts data

evGetTKR_NumAccepts ( )

Counts the number of accepted TKR layer-ends.

Returns:
Number of accepted TKR layer-ends.

evGetTKR_NumStrips ( )

Returns number of hit strips in the event

Returns:
Number of hit strips

evGetTKR_StripN | ( | pAccepts | ,
 |  | stripN | ,
 |  | stripData | = None
 | ) |

Fetches a 12-bit strip word from pAccepts, indexed by stripN.

pAccepts points to the top of the accepts data ... the strip data starts 72 bits ( 8 * 9 ) from the beginning of accepts. I.e. it starts 8 bits into the 3rd 32-bit word.

Parameters:
pAccepts | Pointer to 32-bit aligned tracker event data
stripN | The index of the 12-bit strip to fetch from pAccepts
stripData | Optional argument, if passed, avoid creating the object
Returns:
An evTKR_Strip object instance.

evGetTKR_TOT ( )

Returns pointer to start of tracker TOT list.

Returns:
Offset to the tracker TOT list

getByte ( byteOffset )

Unpack and return an 8-bit byte value located at byteOffset.

Parameters:
byteOffset Pointer to data
Returns:
8-bit byte value

getContributionList ( )

Walk through the whole event and construct a list of contribution id strings.

Returns:
A list of contributors that have contributed to the current event

getContributionStatus ( )

Return the contribution status.

Returns:
Contribution status

getContributionStatusStr ( )

Return the contribution status string.

Returns:
Contribution status string

getCurrentContribution ( )

Return the integer id of the current contribution.

Returns:
Current constribution id

getDWord ( dWordOffset )

Unpack and return a 32-bit word value located at dWordOffset.

Parameters:
dWordOffset Pointer to data
Returns:
32-bit word value

getEvtSize ( )

Return the event size.

Returns:
Event size

getGGLTStatus ( )

Retrieve the GGLT status.

If this status value is non zero then the event is considered "bad"

getOnlineStatus ( )

Retrieve the Online status code.

See getOnlineStatusStr method for a list of possible errors

getOnlineStatusStr ( )

Retrieve the string equivalent of the Online status code.

The error can be one of the following:

GGLT_STATUS_ERROR : A bad event was received. Call getGGLTStatusStr method for the description. MINIMAL_SIZE_ERROR : The event size was below the acceptable size. EOE_ERROR : End of event was reached before the parse completed. UNPACK_ERROR : There was an error while unpacking part of the event for parsing. IO_ERROR : An I/O error occurred while retrieving the event (socket or file). EVENT_VERSION_MISMATCH: An event with an old or unsupported format was received. PLAYBACK_ERROR : End of file was received while playing back an event archive file. READ_TIMEOUT_ERROR : A read timeout occurred while waiting for the event to be retrieved (Set by rcTransitions). EOF_ERROR : End of file is reached while reading the event file.

Returns:
Online status string

getUserId ( )

Return the user id passed to the event client.

Returns:
Current user id

getWord ( wordOffset )

Unpack and return a 16-bit word value located at wordOffset.

Parameters:
wordOffset Pointer to data
Returns:
16-bit word value

isErrorEvent ( )

Determines whether at least one contribution has the error bit set in its summary word.

Returns:
1: If at least one contribution has an error. 0: Otherwise

isGGLTStatus ( status = None )

Determine if the current event is bad.

User script can call this method in process() to determine if the current event is a bad event (gglt_status != 0).

Parameters:
Optional status value
Returns:
0: Not a bad event. 1: A bad event.

isPacketErrorEvent ( )

Determines whether at least one contribution has a non-zero packet error set in the EBF contribution.

Returns:
1: If at least one contribution has an error. 0: Otherwise

isSweepEvent ( )

Determine if a sweep event is received.

User script can call this method in process() to determine if the current event is a sweep event. A try block around the call should be used in case a bad event is received.

Returns:
0: Not a sweep event. 1: A sweep event.

isTrgParityErrorEvent ( )

Determines whether at least one contribution has the trigger parity error bit set in its summary word.

Returns:
1: If at least one contribution has an error. 0: Otherwise

readEvent ( dat = None )

Read an event.

Reads one event from an archive file or socket

Parameters:
dat If not None then interpret this data as event instead
Returns:
oes_status

setCurrentContribution ( contributionId )

Given a contribution id, set the current contribution data needed for the parsing routines.

Parameters:
contributionId Integer contribution id
Returns:
The offset to the contribution requested. -1 If the contribution requested is not found or contribution offset was found to be larger than the event size Note: Use getContributionStatus() method after calling this routine to find out if the contribution has an error.

setDebug ( debug )

Set the debug mode.

Parameters:
debug Debug mode The following debug modes are available and can be added together for combinations: 0: No Debug 1: Debug All 2: Event Dump 4: Warnings 8: Parser Output 16: Error Output

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: EvtCliBT Class Reference

gEvtCliBT.EvtCliBT

EvtCliBT Class Reference

List of all members.

Public Member Functions

__init__ (debug=0, port=EvtCliIO.PortNumber, ancHostPort="localhost:2345")
readEvent ()
Method used to read an event from the event merging code.
flushAll ()
abort ()
Abort out of a readEvent().
shutdown ()
Method used to shut down the event merging threads.

Detailed Description

Definition at line 89 of file gEvtCliBT.py.

Member Function Documentation

abort ( )

Abort out of a readEvent().

Can be used from another thread

shutdown ( )

Method used to shut down the event merging threads.

This must be called from a different thread than the one in which the merger runs.

The documentation for this class was generated from the following file:
  • gEvtCliBT.py
Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: EvtCliIO Class Reference

gEvtCli.EvtCliIO

EvtCliIO Class Reference

Event client input/output class. More...

Inheritance diagram for EvtCliIO:

[legend]
Collaboration diagram for EvtCliIO:

[legend]
List of all members.

Public Member Functions

__init__ (debug, port=PortNumber)
connect (host, force=False)
setSocket (sock)
readSocket ()
The 'lightweight' event read routine.
readFile ()
Read the event from a file.
open (filename, mode="r+b")
Open the event archive file for input.
close ()
Close the event source file.
abort ()
Abort out of a readEvent().
setTimeoutEnabled (flag)
Enable or disable event timeout.
isTimeoutEnabled ()
Checks the event timeout state.
setTimeout (timeout=1.0)
Set the timeout value.
getTimeout ()
Query the current timeout value.
unpack (fmt, str)
Wrapper method for unpack.

Detailed Description

Event client input/output class.

Contents:

This base class contains all the input/output handling routines for the event client (EvtCli) class.

Definition at line 622 of file gEvtCli.py.

Member Function Documentation

abort ( )

Abort out of a readEvent().

Can be used from another thread

getTimeout ( )

Query the current timeout value.

Returns:
Current event timeout value as a floating point number in seconds

isTimeoutEnabled ( )

Checks the event timeout state.

Returns:
1 = If event timeout is enabled 0 = If event timeout is disabled

open | ( | filename | ,
 |  | mode | = "r+b"
 | ) |

Open the event archive file for input.

Parameters:
filename Event archive file name

readSocket ( )

The 'lightweight' event read routine.

This routine does the minimal work of reading the raw event data from a file or a socket.

Returns:
Event buffer read

setTimeout ( timeout = 1.0 )

Set the timeout value.

Parameters:
timeout Event timeout value as a floating point number in seconds. Default is 1 second. Use 'None' to disable the timeout.

setTimeoutEnabled ( flag )

Enable or disable event timeout.

Parameters:
flag 1 = Enable event timeout 0 = Disable event timeout (default)

unpack | ( | fmt | ,
 |  | str |
 | ) |

Wrapper method for unpack.

Parameters:
fmt | Unpack format
str | String to be unpacked
Returns:
Unpacked data tuple

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:59 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evtDataImpl Class Reference

evtDataImpl.evtDataImpl

evtDataImpl Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, fl=0)
load ()
fileNew ()
fileOpen ()
fileSave ()
fileSaveAs ()
filePrint ()
fileExit ()
helpIndex ()
helpContents ()
helpAbout ()

Detailed Description

Definition at line 10 of file evtDataImpl.py.

The documentation for this class was generated from the following file:
  • evtDataImpl.py
Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evTKR_Strip Class Reference

gEvtCli.evTKR_Strip

evTKR_Strip Class Reference

TKR strip bitfields. More...

Inheritance diagram for evTKR_Strip:

[legend]
Collaboration diagram for evTKR_Strip:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

TKR strip bitfields.

Bit Fields:

  • done
  • gtfe
  • strip

Definition at line 360 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evTKR_StripData Class Reference

gEvtCli.evTKR_StripData

evTKR_StripData Class Reference

TKR StripData class. More...

List of all members.

Public Member Functions

__init__ (cc, rc, strip)
evTKR_StripData constructor

Detailed Description

TKR StripData class.

Members:

  • cc
  • rc
  • strip

Definition at line 374 of file gEvtCli.py.

Member Function Documentation

__init__ | ( | cc | ,
 |  | rc | ,
 |  | strip |
 | ) |

evTKR_StripData constructor

Parameters:
cc | Cable controller id
rc | Readout controller id
strip | An evTKR_Strip object instance

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evTKR_TOTdata Class Reference

gEvtCli.evTKR_TOTdata

evTKR_TOTdata Class Reference

TKR TOT data class. More...

List of all members.

Public Member Functions

__init__ (cc, rc, tot)
evTKR_TOTdata constructor

Detailed Description

TKR TOT data class.

Members:

  • tot
  • cc
  • rc

Definition at line 338 of file gEvtCli.py.

Member Function Documentation

__init__ | ( | cc | ,
 |  | rc | ,
 |  | tot |
 | ) |

evTKR_TOTdata constructor

Parameters:
cc | Cable controller id
rc | Readout controller id
tot | 8-bit TOT value

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ExceptionFSM Class Reference

FSM.ExceptionFSM

ExceptionFSM Class Reference

List of all members.

Public Member Functions

__init__ (value)
__str__ ()

Detailed Description

This is the FSM Exception class.

Definition at line 71 of file FSM.py.

The documentation for this class was generated from the following file:
  • FSM.py
Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ExclusiveButtonGroup Class Reference

PorcinePanel.ExclusiveButtonGroup

ExclusiveButtonGroup Class Reference

List of all members.

Public Member Functions

getSelect ()
setSelect (select)
setEnables (enable)
setEnabled (bool)
setStatus (status)

Detailed Description

Definition at line 156 of file PorcinePanel.py.

The documentation for this class was generated from the following file:
  • PorcinePanel.py
Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: FabricPanel Class Reference

PorcinePanel.FabricPanel

FabricPanel Class Reference

List of all members.

Public Member Functions

selectAll (select)
allsel ()
allclear ()
allselcr ()
allclearcr ()
allselevt ()
allclearevt ()
allselpdu0 ()
allselpdu1 ()

Detailed Description

Definition at line 70 of file PorcinePanel.py.

The documentation for this class was generated from the following file:
  • PorcinePanel.py
Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Fabrics Class Reference

gFabrics.Fabrics

Fabrics Class Reference

List of all members.

Public Member Functions

init_cmdrsp (cmdmask, cmdmset, pdumask, secmask)
insert_cmdrsp (cmdmask, pdumask, secmask, arcmask, ctrmask)
extract_cmdrsp (cmdmask, pdumask, secmask, arcmask, ctrmask)
init_event (evtmask, evtmset)
insert_event (evtmask)
extract_event (evtmask)

Detailed Description

Definition at line 8 of file gFabrics.py.

The documentation for this class was generated from the following file:
  • gFabrics.py
Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: FancyTrendTree Class Reference

testTrending.FancyTrendTree

FancyTrendTree Class Reference

List of all members.

Public Member Functions

toggleDynamic ()
update (trendables)
newTrend ()
removeSelected ()
contextMenu (item, point, pos)

Detailed Description

Definition at line 39 of file testTrending.py.

The documentation for this class was generated from the following file:
  • testTrending.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: FEpowerUp Class Reference

FEpowerUp.FEpowerUp

FEpowerUp Class Reference

List of all members.

Public Member Functions

initialize (lat, xbrd)
setAcdPowerUp (acdPowerUp)
setTemPowerUp (temPowerUp)
up ()
down ()
getActiveTEMs (lat)
isAEMactive (aem)
refreshPowerStatus ()
checkPower (aem, activeTEMs)

Detailed Description

Definition at line 10 of file FEpowerUp.py.

Member Function Documentation

down ( )

HIGH VOLTAGES for TKR and CAL Disable by default

Note: These take different values then ggDACload()

0x4000 - 0 V 0x5000 - plus half scale 0x5FFE - plus full scale

The documentation for this class was generated from the following file:
  • FEpowerUp.py
Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: FlatFileRecorder Class Reference

Recorder.FlatFileRecorder

FlatFileRecorder Class Reference

Inheritance diagram for FlatFileRecorder:

[legend]
Collaboration diagram for FlatFileRecorder:

[legend]
List of all members.

Public Member Functions

shutdown ()

Detailed Description

Definition at line 29 of file Recorder.py.

The documentation for this class was generated from the following file:
  • Recorder.py
Generated on Fri Jul 21 13:27:59 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: FrontEndPowerPanel Class Reference

PorcinePanel.FrontEndPowerPanel

FrontEndPowerPanel Class Reference

Detailed Description

Definition at line 86 of file PorcinePanel.py.

The documentation for this class was generated from the following file:
  • PorcinePanel.py
Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: FSM Class Reference

FSM.FSM

FSM Class Reference

Inheritance diagram for FSM:

[legend]
List of all members.

Public Member Functions

__init__ (initial_state, something)
reset ()
add_transition (input_symbol, state, action, next_state)
add_transition_list (list_input_symbols, state, action, next_state)
add_transition_any (state, action, next_state)
set_default_transition (action, next_state)
get_transition (input_symbol, state)
process (input_symbol)
process_list (s)

Detailed Description

This is a Finite State Machine (FSM).

Definition at line 80 of file FSM.py.

Member Function Documentation

__init__ | ( | initial_state | ,
 |  | something |
 | ) |

This creates the FSM. You set the initial state here. The "something" attribute is any object that you want to pass along to the action functions. It is not used by the FSM. For parsing you would typically pass a list to be used as a stack.

add_transition | ( | input_symbol | ,
 |  | state | ,
 |  | action | ,
 |  | next_state |
 | ) |

This adds a transition that associates (input_symbol, current_state) --> (action, next_state) The action may be set to None in which case the process() method will ignore the action and only set the next_state.

You can also set transitions for a list of symbols by using add_transition_list().

add_transition_any | ( | state | ,
 |  | action | ,
 |  | next_state |
 | ) |

This adds a transition that associates (current_state) --> (action, next_state) The process() method checks these associations if it cannot first find a match of an (input_symbol, current_state).

add_transition_list | ( | list_input_symbols | ,
 |  | state | ,
 |  | action | ,
 |  | next_state |
 | ) |

This adds the same transition for lots of different input symbols. You can pass a list or a string. Note that it is handy to use string.digits, string.whitespace, string.letters, etc. to add transitions that match character classes.

get_transition | ( | input_symbol | ,
 |  | state |
 | ) |

This returns (action, next state) given an input_symbol and state. This leaves the FSM unchanged. This does not update the current state nor does it trigger the output action. Normally you do not call this method. It is called by process().

The sequence of steps to check for a defined transition goes from the most specific to the least specific. 1. Check state_transitions[] that match (input_symbol, state) 2. Check state_transitions_any[] that match (state) In other words, match a specific state and ANY input_symbol. 3. Check if the default_transition is defined. This catches any input_symbol and any state. This is a handler for errors, undefined states, or defaults. 4. No transition was defined. If we get here then raise an exception.

process ( input_symbol )

This is the main method that you call to process input. This may cause the FSM to change state and call an action. This method calls get_transition() to find the action and next_state associated with the input_symbol and current_state. If the action is None then the action is not called and only the current state is changed. This method processes one input symbol. You can process a list of symbols (or a string) by calling process_list(). This method returns an uninterpreted status value used to indicate whether the state transition completed successfully.

process_list ( s )

This takes a list and sends each element to process(). The list may be a string.

reset ( )

This sets the current_state to the initial_state and sets input_symbol to None. The initial state was set by the constructor __init__().

set_default_transition | ( | action | ,
 |  | next_state |
 | ) |

This sets the default transition. This defines an action and next_state if the FSM cannot find the input symbol and the current state in the transition list and if the FSM cannot find the current_state in the transition_any list. This is useful for catching errors and undefined states.

The default transition can be removed by setting the attribute default_transition to None.

The documentation for this class was generated from the following file:
  • FSM.py
Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: FswMessages Class Reference

gFswMessages.FswMessages

FswMessages Class Reference

Detailed Description

Definition at line 4 of file gFswMessages.py.

The documentation for this class was generated from the following file:
  • gFswMessages.py
Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: FullCondition Class Reference

testAppAcdScalers.FullCondition

FullCondition Class Reference

List of all members.

Public Member Functions

__init__ ()
solicited ()
calLow ()
tkr ()
cno ()

Detailed Description

Define a condition where only the solicited trigger is asserted

Definition at line 217 of file testAppAcdScalers.py.

The documentation for this class was generated from the following file:
  • testAppAcdScalers.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: FullEngine Class Reference

testAppAcdScalers.FullEngine

FullEngine Class Reference

List of all members.

Public Member Functions

participate (conditionsValue)
prescale ()

Detailed Description

Definition at line 226 of file testAppAcdScalers.py.

The documentation for this class was generated from the following file:
  • testAppAcdScalers.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GAEM Class Reference

gAEM.GAEM

GAEM Class Reference

ACD Common Controller. More...

Inheritance diagram for GAEM:

[legend]
Collaboration diagram for GAEM:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)
send (cmd)
downARC (arcId)
Navigate to the GARC indicated by childId.
allARC ()
Navigate to the broadcast GARC.
existsARC (arcId)
Check if the GARC instance with the id arcId exists in the schema.
downAEQ ()
Navigate to the GAEQ.
existsAEQ ()
Check if the GAEQ instance exists in the schema.

Detailed Description

ACD Common Controller.

Has GAEM specific registers and dataless commands.

Valid Registers:

  • configuration
  • common_status
  • freeboard_status
  • command_response
  • trgseq
  • power_status
  • address
  • timeout
  • relocation
  • response_timeout
  • power_up
  • power_down
  • trigger_statistics

Dataless Commands:

  • cmd_reset

Definition at line 33 of file gAEM.py.

Member Function Documentation

__init__ | ( | client | ,
 |  | parent |
 | ) |

Initialize valid registers as Gattrs.

Assign default values to members

allARC ( )

Navigate to the broadcast GARC.

Returns:
The broadcast GARC object instance

downAEQ ( )

Navigate to the GAEQ.

Returns:
The GAEQ object instance

downARC ( arcId )

Navigate to the GARC indicated by childId.

Parameters:
childId The id of the child GARC
Returns:
A GARC object instance

existsAEQ ( )

Check if the GAEQ instance exists in the schema.

Returns:
1 if it exists, 0 if it doesn't.

existsARC ( arcId )

Check if the GARC instance with the id arcId exists in the schema.

Parameters:
arcId ACD readout controller id
Returns:
1 if it exists, 0 if it doesn't.

The documentation for this class was generated from the following file:
  • gAEM.py
Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GAEQ Class Reference

gAEM.GAEQ

GAEQ Class Reference

ACD Environmental Monitors. More...

Inheritance diagram for GAEQ:

[legend]
Collaboration diagram for GAEQ:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)

Detailed Description

ACD Environmental Monitors.

Has GAEQ specific registers and dataless commands.

Valid Registers:

  • env_free_1la
  • env_free_1rb
  • env_free_2la
  • env_free_2lb
  • env_free_2ra
  • env_free_2rb
  • env_free_3la
  • env_free_3rb
  • env_free_4la
  • env_free_4lb
  • env_free_4ra
  • env_free_4rb
  • env_daq

Pseudo registers:

  • env_vdd_xxx
  • env_temp_xxx
  • env_hv1_xxx
  • env_hv2_xxx
  • env_dac_digital_3_3i
  • env_dac_temp
  • env_dac_hv_i
  • env_dac_v

Definition at line 117 of file gAEM.py.

Member Function Documentation

__init__ | ( | client | ,
 |  | parent |
 | ) |

Initialize valid registers as Gattrs.

Assign default values to members

The documentation for this class was generated from the following file:
  • gAEM.py
Generated on Fri Jul 21 13:26:44 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GAFE Class Reference

gAEM.GAFE

GAFE Class Reference

ACD Front-End Controller. More...

Inheritance diagram for GAFE:

[legend]
Collaboration diagram for GAFE:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent, id)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)
send (cmd)

Detailed Description

ACD Front-End Controller.

Has GAFE specific registers and dataless commands.

Valid Registers:

  • configuration
  • veto_dac
  • hld_dac
  • veto_vernier
  • bias_dac
  • tci_dac
  • vers_addr
  • write_ctr
  • reject_ctr
  • loop_ctr
  • chip_addr

Definition at line 254 of file gAEM.py.

The documentation for this class was generated from the following file:
  • gAEM.py
Generated on Fri Jul 21 13:26:44 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gAlertHandler Class Reference

gAlert.gAlertHandler

gAlertHandler Class Reference

Inheritance diagram for gAlertHandler:

[legend]
List of all members.

Public Member Functions

handle (alertStr)

Detailed Description

Definition at line 9 of file gAlert.py.

Member Function Documentation

handle ( alertStr )

Method to handle an alert

Parameters:
alertStr a gAlertStr object

Reimplemented in gAlertMailer.

The documentation for this class was generated from the following file:
  • gAlert.py
Generated on Fri Jul 21 13:26:44 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gAlertMail Class Reference

gAlert.gAlertMail

gAlertMail Class Reference

Inheritance diagram for gAlertMail:

[legend]
Collaboration diagram for gAlertMail:

[legend]
List of all members.

Detailed Description

Definition at line 45 of file gAlert.py.

The documentation for this class was generated from the following file:
  • gAlert.py
Generated on Fri Jul 21 13:26:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gAlertMailer Class Reference

gAlert.gAlertMailer

gAlertMailer Class Reference

Inheritance diagram for gAlertMailer:

[legend]
Collaboration diagram for gAlertMailer:

[legend]
List of all members.

Public Member Functions

handle (alertStr)

Detailed Description

Definition at line 18 of file gAlert.py.

Member Function Documentation

handle ( alertStr )

Method to handle an alert

Parameters:
alertStr a gAlertStr object

Reimplemented from gAlertHandler.

The documentation for this class was generated from the following file:
  • gAlert.py
Generated on Fri Jul 21 13:26:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gAlertPopup Class Reference

AlertGuiImpl.gAlertPopup

gAlertPopup Class Reference

List of all members.

Public Member Functions

handle (alertStr)

Detailed Description

Definition at line 16 of file AlertGuiImpl.py.

The documentation for this class was generated from the following file:
  • AlertGuiImpl.py
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gAlertRegistry Class Reference

gAlert.gAlertRegistry

gAlertRegistry Class Reference

List of all members.

Public Member Functions

__init__ ()
register (system, handler)
unregister (handler, categories)
handle (alertStr)

Detailed Description

Alert registry class

Definition at line 52 of file gAlert.py.

Member Function Documentation

register | ( | system | ,
 |  | handler |
 | ) |

register method

Parameters:
handler
system

The documentation for this class was generated from the following file:
  • gAlert.py
Generated on Fri Jul 21 13:26:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gAlertStr Class Reference

gAlert.gAlertStr

gAlertStr Class Reference

List of all members.

Public Member Functions

__init__ (alertStr=None)
encode (severity, timestamp, system, message, machine=0)
decode (string=None)

Detailed Description

Parser/unparser/container for alert strings

Definition at line 26 of file gAlert.py.

Member Function Documentation

decode ( string = None )

Method to decode an alert string dispatched to the message logger

Returns:
(severity, time, system, message)

encode | ( | severity | ,
 |  | timestamp | ,
 |  | system | ,
 |  | message | ,
 |  | machine | = 0
 | ) |

Method to encode an alert string for dispatch to the message logger

Parameters:
severity | Severity level (YELLOWALERT or REDALERT)
time | Time alert was sent
system | System alert was sent from
message | Alert message
machine | Machine ID alert is sent from

The documentation for this class was generated from the following file:
  • gAlert.py
Generated on Fri Jul 21 13:26:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GARC Class Reference

gAEM.GARC

GARC Class Reference

ACD Readout Controller. More...

Inheritance diagram for GARC:

[legend]
Collaboration diagram for GARC:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent, id)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)
send (cmd)
downAFE (afeId)
Navigate to the GAFE indicated by childId.
allAFE ()
Navigate to the broadcast GAFE.
existsAFE (afeId)
Check if the GAFE instance with the id afeId exists in the schema.

Detailed Description

ACD Readout Controller.

Has GARC specific registers and dataless commands.

Valid Registers:

  • function block 0
    • veto_delay
    • hvbs
    • saa
    • use_hv_normal
    • use_hv_saa
    • hold_delay
    • veto_width
    • hitmap_width
    • hitmap_deadtime
  • function block 1
    • look_at_me
    • hitmap_delay
    • pha_en_0
    • veto_en_0
    • hld_en_0
    • pha_en_1
    • veto_en_1
    • hld_en_1
    • max_pha
  • function block 2
    • mode
    • status
    • last_cmd
    • diagnostic
    • cmd_reject
    • free_id
    • garc_version
  • function block 3
    • pha_threshold_0
    • pha_threshold_1
    • pha_threshold_2
    • pha_threshold_3
    • pha_threshold_4
    • pha_threshold_5
    • pha_threshold_6
  • function block 4
    • pha_threshold_7
    • pha_threshold_8
    • pha_threshold_9
    • pha_threshold_10
    • pha_threshold_11
    • pha_threshold_12
    • pha_threshold_13
  • function block 5
    • pha_threshold_14
    • pha_threshold_15
    • pha_threshold_16
    • pha_threshold_17
    • adc_tacq

Dataless Commands

  • cmd_reset
  • cmd_calstrobe
  • cmd_set_hvbs
  • cmd_set_hvsaa

Definition at line 196 of file gAEM.py.

Member Function Documentation

__init__ | ( | client | ,
 |  | parent | ,
 |  | id |
 | ) |

Initialize valid registers as Gattrs.

Assign default values to members

allAFE ( )

Navigate to the broadcast GAFE.

Returns:
The broadcast GAFE object instance

downAFE ( afeId )

Navigate to the GAFE indicated by childId.

Parameters:
childId The id of the child GAFE
Returns:
A GAFE object instance

existsAFE ( afeId )

Check if the GAFE instance with the id afeId exists in the schema.

Parameters:
afeId ACD readout controller id
Returns:
1 if it exists, 0 if it doesn't.

The documentation for this class was generated from the following file:
  • gAEM.py
Generated on Fri Jul 21 13:26:44 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GasuExtTrg Class Reference

test_evt_exttrg.GasuExtTrg

GasuExtTrg Class Reference

List of all members.

Public Member Functions

conditions ()

Detailed Description

Definition at line 30 of file test_evt_exttrg.py.

The documentation for this class was generated from the following file:
  • test_evt_exttrg.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GasuExtTrgEngine Class Reference

test_evt_exttrg.GasuExtTrgEngine

GasuExtTrgEngine Class Reference

List of all members.

Public Member Functions

participate (conditionsValue)
prescale ()

Detailed Description

Definition at line 37 of file test_evt_exttrg.py.

The documentation for this class was generated from the following file:
  • test_evt_exttrg.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GasuPanel Class Reference

PorcinePanel.GasuPanel

GasuPanel Class Reference

Inheritance diagram for GasuPanel:

[legend]
Collaboration diagram for GasuPanel:

[legend]
List of all members.

Public Member Functions

constructGrid ()

Detailed Description

Definition at line 125 of file PorcinePanel.py.

The documentation for this class was generated from the following file:
  • PorcinePanel.py
Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Gattr Class Reference

gAttr.Gattr

Gattr Class Reference

Base class which is instantiated once for each attribute kind. More...

Inheritance diagram for Gattr:

[legend]
List of all members.

Public Member Functions

__init__ (name, id, size, flags, rule=None, constraint=None, egu=None)
create (node)
set (node, value, attr, bypass=0)
get (node, attr, bypass=0)
getName ()
size ()
id ()
setRule (rule)
getRule ()
setConstraint (constraint)
setEGU (egu)
getEGU ()
getConstraint ()
flags ()
isReadOnly ()
isWriteOnly ()
isReadWrite ()
isNoDirectAccess ()
isCommand ()
isDeprecated ()

Detailed Description

Base class which is instantiated once for each attribute kind.

Definition at line 28 of file gAttr.py.

Member Function Documentation

__init__ | ( | name | ,
 |  | id | ,
 |  | size | ,
 |  | flags | ,
 |  | rule | = None,
 |  | constraint | = None,
 |  | egu | = None
 | ) |

Gattr constructor.

Parameters:
name | The name of the attribute.
size | Attribute size in bytes.
rule | Optional. Attribute rule.
constraint | Optional. Attribute constraint.
egu | Optional. Attribute EGU

getConstraint ( )

Method that returns the gConstraint.Gconstraint class for this gAttr

Returns:
A Gconstraint object instance

getEGU ( )

Method that returns the gEGU.GEGU class for this gAttr

Returns:
A Gegu object instance

getRule ( )

Retrieve the rule associated with the gAttr.

isCommand ( )

Returns a boolean value indicating if the attribute is a dataless command or not

Returns:
1=Dataless command, 0=Not a dataless command.

isDeprecated ( )

Returns a boolean value indicating if the attribute is deprecated or not

Returns:
1=Deprecated, 0=Not deprecated.

isNoDirectAccess ( )

Returns a boolean value indicating if the attribute is no direct access or not

Returns:
1=No Direct Access, 0=Not No Direct Access.

isReadOnly ( )

Returns a boolean value indicating if the attribute is read only or not

Returns:
1=Read Only, 0=Not Read Only.

isReadWrite ( )

Returns a boolean value indicating if the attribute is read write or not

Returns:
1=Read Write, 0=Not Read Write.

isWriteOnly ( )

Returns a boolean value indicating if the attribute is write only or not

Returns:
1=Write Only, 0=Not Write Only.

setConstraint ( constraint )

Method to attach a constraint to a gAttr after the gAttr has been constructed. This method will go away once constraints are loaded from a configuration file.

Parameters:
constraint A Gconstraint object instance

setEGU ( egu )

Method to attach a EGU to a gAttr after the gAttr has been constructed.

Parameters:
egu A Gegu object instance

setRule ( rule )

Method to attach a rule to a gAttr after the gAttr has been constructed.

Parameters:
rule A Grule object instance

size ( )

Method for returning the size of the attribute

Returns:
Attribute size in bytes

The documentation for this class was generated from the following file:
  • gAttr.py
Generated on Fri Jul 21 13:26:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GattrBF Class Reference

gAttr.GattrBF

GattrBF Class Reference

Bit field class which is instantiated for each bit field kind. More...

Inheritance diagram for GattrBF:

[legend]
Collaboration diagram for GattrBF:

[legend]
List of all members.

Public Member Functions

__init__ (name, regno, start, end, flags=ATTR_READ_WRITE)
set (node, val, attr, bypass=0)
get (node, attr, bypass=0)

Detailed Description

Bit field class which is instantiated for each bit field kind.

This class allows operation on bit fields of the form (end, start] in a register specified by the register number (regno).

N.B. This attribute operates on the raw value of the associated register

Definition at line 253 of file gAttr.py.

Member Function Documentation

__init__ | ( | name | ,
 |  | regno | ,
 |  | start | ,
 |  | end | ,
 |  | flags | = ATTR_READ_WRITE
 | ) |

GattrBF constructor

Parameters:
name | The name of the bit field
regno | Register no. containing the bit field
start | Bit offset to start (inclusive) of the bit field
end | Bit offset to the end (exclusive) of the bit field
flags | Optional flags to govern access to the bit field

get | ( | node | ,
 |  | attr | ,
 |  | bypass | = 0
 | ) |

Method for getting the value of a bit field.

Parameters:
val | bit field value to be set
bypass | ignored

Reimplemented from Gattr.

set | ( | node | ,
 |  | val | ,
 |  | attr | ,
 |  | bypass | = 0
 | ) |

Method for setting the value of a bit field. Calls the functions in the base class for setting values.

Parameters:
val | bit field value to be set
bypass | ignored

The documentation for this class was generated from the following file:
  • gAttr.py
Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GattrDlc Class Reference

gAttr.GattrDlc

GattrDlc Class Reference

Inheritance diagram for GattrDlc:

[legend]
Collaboration diagram for GattrDlc:

[legend]
List of all members.

Public Member Functions

__init__ (name, cmdNo, size=0, flags=ATTR_COMMAND)
set (node, args)

Detailed Description

Attribute class for implementing dataless commands

Definition at line 233 of file gAttr.py.

Member Function Documentation

set | ( | node | ,
 |  | args |
 | ) |

Method for invoking a dataless command. The value parameter is meaningless for this method and is only supplied to satisfy the function signature.

The documentation for this class was generated from the following file:
  • gAttr.py
Generated on Fri Jul 21 13:26:46 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GattrHsk Class Reference

gHdb.GattrHsk

GattrHsk Class Reference

Class which is instantiated for each housekeeping quantity. More...

Inheritance diagram for GattrHsk:

[legend]
Collaboration diagram for GattrHsk:

[legend]
List of all members.

Public Member Functions

__init__ (node, attr)
getNode ()
__init__ (name, id, rule=gAttr.Gattr.defaultRule, constraint=gAttr.Gattr.defaultConstraint, egu=gAttr.Gattr.defaultEgu)
create (node)
set (node, val, bypass=True)
get (node, raw, bypass=False)

Detailed Description

Class which is instantiated for each housekeeping quantity.

Definition at line 12 of file gHdb.py.

Member Function Documentation

__init__ | ( | name | ,
 |  | id | ,
 |  | rule | = gAttr.Gattr.defaultRule,
 |  | constraint | = gAttr.Gattr.defaultConstraint,
 |  | egu | = gAttr.Gattr.defaultEgu
 | ) |

GattrHsk constructor

Parameters:
name | The name of the attribute.
id | Positional identifier.
rule | Optional. Attribute rule.
constraint | Optional. Attribute constraint.
egu | Optional. Attribute EGU

get | ( | node | ,
 |  | raw | ,
 |  | bypass | = False
 | ) |

Method for getting the value of an attribute. If bypass=0 (the default), the value will be returned in EU. If bypass=1, the raw value will be returned.

set | ( | node | ,
 |  | val | ,
 |  | bypass | = True
 | ) |

Method for setting the value of an attribute. Calls the functions in the attribute's node for setting values.

Parameters:
val | Register value to be set
bypass | Optional. Flag for bypassing EGU conversion Default is to *not* convert to EGU.

The documentation for this class was generated from the following file:
  • gHdb.py
Generated on Fri Jul 21 13:27:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GattrRaw Class Reference

gAttr.GattrRaw

GattrRaw Class Reference

Class which is instantiated for each raw register kind. More...

Inheritance diagram for GattrRaw:

[legend]
Collaboration diagram for GattrRaw:

[legend]
List of all members.

Public Member Functions

__init__ (name, regno, size, flags=ATTR_READ_WRITE)
set (node, val, attr, bypass=0)
get (node, attr, bypass=0)

Detailed Description

Class which is instantiated for each raw register kind.

Definition at line 132 of file gAttr.py.

Member Function Documentation

__init__ | ( | name | ,
 |  | regno | ,
 |  | size | ,
 |  | flags | = ATTR_READ_WRITE
 | ) |

GattrRaw constructor

Parameters:
name | The name of the register
regno | Register no.
size | Register size in bytes.

get | ( | node | ,
 |  | attr | ,
 |  | bypass | = 0
 | ) |

Method for getting the value of a register attribute. Calls the functions in the node class for getting values. If bypass=0 (the default), the value will be returned in EU. If bypass=1, the raw value will be returned.

Reimplemented from Gattr.

set | ( | node | ,
 |  | val | ,
 |  | attr | ,
 |  | bypass | = 0
 | ) |

Method for setting the value of a register attribute. Calls the functions in the base class for setting values.

Parameters:
val | Register value to be set
bypass | Optional. Flag for bypassing EGU conversion

The documentation for this class was generated from the following file:
  • gAttr.py
Generated on Fri Jul 21 13:26:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GattrReg Class Reference

gAttr.GattrReg

GattrReg Class Reference

Class which is instantiated for each register. More...

Inheritance diagram for GattrReg:

[legend]
Collaboration diagram for GattrReg:

[legend]
List of all members.

Public Member Functions

__init__ (name, regno, size, flags=ATTR_READ_WRITE, rule=Gattr.defaultRule, constraint=Gattr.defaultConstraint, egu=Gattr.defaultEgu)
set (node, val, attr, bypass=0)
Method for setting the value of a register attribute.
get (node, attr, bypass=0)
Method for getting the value of a register attribute. Calls the functions in the node class for getting values.

Detailed Description

Class which is instantiated for each register.

Definition at line 166 of file gAttr.py.

Member Function Documentation

__init__ | ( | name | ,
 |  | regno | ,
 |  | size | ,
 |  | flags | = ATTR_READ_WRITE,
 |  | rule | = Gattr.defaultRule,
 |  | constraint | = Gattr.defaultConstraint,
 |  | egu | = Gattr.defaultEgu
 | ) |

GattrReg constructor

Parameters:
name | The name of the register
regno | Register no.
size | Register size in bytes.
rule | Optional. Register rule.
constraint | Optional. Register constraint.
egu | Optional. Register EGU

get | ( | node | ,
 |  | attr | ,
 |  | bypass | = 0
 | ) |

Method for getting the value of a register attribute. Calls the functions in the node class for getting values.

Parameters:
node | Node this register belongs to
attr | _Attr instance
bypass | Optional. Flag for bypassing EGU conversion bypass=0 (the default), the value will be returned in EU. bypass=1, the raw value will be returned.
Returns:
Register value.

Reimplemented from Gattr.

Reimplemented in GattrRegDepr.

set | ( | node | ,
 |  | val | ,
 |  | attr | ,
 |  | bypass | = 0
 | ) |

Method for setting the value of a register attribute.

Calls the functions in the base class for setting values.

Parameters:
node | Node this register belongs to
val | Register value to be set
attr | _Attr instance
bypass | Optional. Flag for bypassing EGU conversion

Reimplemented in GattrRegDepr.

The documentation for this class was generated from the following file:
  • gAttr.py
Generated on Fri Jul 21 13:26:46 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GattrRegDepr Class Reference

gAttr.GattrRegDepr

GattrRegDepr Class Reference

Inheritance diagram for GattrRegDepr:

[legend]
Collaboration diagram for GattrRegDepr:

[legend]
List of all members.

Public Member Functions

set (node, val, attr, bypass=0)
get (node, attr, bypass=0)

Detailed Description

Definition at line 209 of file gAttr.py.

Member Function Documentation

get | ( | node | ,
 |  | attr | ,
 |  | bypass | = 0
 | ) |

Method for getting the value of a register attribute. Calls the functions in the node class for getting values. If bypass=0 (the default), the value will be returned in EU. If bypass=1, the raw value will be returned.

Reimplemented from GattrReg.

set | ( | node | ,
 |  | val | ,
 |  | attr | ,
 |  | bypass | = 0
 | ) |

Method for setting the value of a register attribute. Calls the functions in the base class for setting values.

Parameters:
val | Register value to be set
bypass | Optional. Flag for bypassing EGU conversion

Reimplemented from GattrReg.

The documentation for this class was generated from the following file:
  • gAttr.py
Generated on Fri Jul 21 13:26:46 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GCCC Class Reference

gTEM.GCCC

GCCC Class Reference

Calorimeter Cable Controller node Record. More...

Inheritance diagram for GCCC:

[legend]
Collaboration diagram for GCCC:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent, id)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)
send (cmd)
downCRC (childId)
Navigate to the GCRC indicated by childId.
allCRC ()
Navigate to the broadcast GCRC.
existsCRC (crcId)
Check if the GCRC instance with the id crcId exists in the schema.

Detailed Description

Calorimeter Cable Controller node Record.

Has GCCC specific registers and dataless commands.

Valid Registers:

  • configuration
  • layer_mask_0
  • layer_mask_1
  • fifo_status
  • latched_status
  • event_timeouts
  • trg_alignment

Dataless Commands:

  • cmd_nop
  • cmd_reset

Definition at line 142 of file gTEM.py.

Member Function Documentation

__init__ | ( | client | ,
 |  | parent | ,
 |  | id |
 | ) |

Initialize valid registers as Gattrs.

Assign default values to members

allCRC ( )

Navigate to the broadcast GCRC.

Returns:
The broadcast GCRC object instance

downCRC ( childId )

Navigate to the GCRC indicated by childId.

Parameters:
childId The id of the child GCRC
Returns:
A GCRC object instance

existsCRC ( crcId )

Check if the GCRC instance with the id crcId exists in the schema.

Parameters:
crcId Calorimeter readout controller id
Returns:
1 if it exists, 0 if it doesn't.

The documentation for this class was generated from the following file:
  • gTEM.py
Generated on Fri Jul 21 13:27:12 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GCFE Class Reference

gTEM.GCFE

GCFE Class Reference

Calorimeter Front End node Record. More...

Inheritance diagram for GCFE:

[legend]
Collaboration diagram for GCFE:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent, id)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)
send (cmd)

Detailed Description

Calorimeter Front End node Record.

Has GCFE specific registers and dataless commands.

Valid Registers:

  • config_0
  • config_1
  • fle_dac
  • fhe_dac
  • log_acpt
  • rng_uld_dac
  • ref_dac

Dataless Commands:

  • cmd_nop

Definition at line 271 of file gTEM.py.

The documentation for this class was generated from the following file:
  • gTEM.py
Generated on Fri Jul 21 13:27:12 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Gconstraint Class Reference

gConstraint.Gconstraint

Gconstraint Class Reference

Base class for describing constraints. More...

Inheritance diagram for Gconstraint:

[legend]
Collaboration diagram for Gconstraint:

[legend]
List of all members.

Public Member Functions

__init__ (name, subsystem, category, enabled, continuous=False)
_eval_ (value)
evaluate (value)
name ()
subsystem ()
category ()
enabled ()
enable ()
disable ()
reset ()
reject (message)

Detailed Description

Base class for describing constraints.

Definition at line 28 of file gConstraint.py.

Member Function Documentation

__init__ | ( | name | ,
 |  | subsystem | ,
 |  | category | ,
 |  | enabled | ,
 |  | continuous | = False
 | ) |

Constructor.

Parameters:
name | Constraint name
subsystem | Subsystem gGroup to which the constraint belongs
category | Category gGroup to which the constraint belongs
enabled | Flag indicating whether constraint is enabled
continuous | Flag indicating whether constraint can fire repeatedly

_eval_ ( value )

Dummy evaluation method to be overridden through inheritance to implement the application specific constraint evaluation

Reimplemented in GconstraintLimitRE, GconstraintLimit, and GconstraintLimitPegRE.

category ( )

Method for discovering this constraint's category

disable ( )

Method used to disable evaluation of this constraint

enable ( )

Method used to enable evaluation of this constraint

enabled ( )

Method for discovering whether this constraint is enabled

evaluate ( value )

This method is called to evaluate the constraint on 'value

Reimplemented from GconstraintBase.

name ( )

Method to retrieve the constraint's name

reject ( message )

Method optionally used by the constraint evaluation implementation to signal a constraint violation

reset ( )

Method used to reenable evaluation of this constraint in the case of noncontinuous mode after it has been violated

subsystem ( )

Method for discovering this constraint's subsystem

The documentation for this class was generated from the following file:
  • gConstraint.py
Generated on Fri Jul 21 13:26:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GconstraintBase Class Reference

gConstraint.GconstraintBase

GconstraintBase Class Reference

Base constraint class for use when no constraint is appropriate. More...

Inheritance diagram for GconstraintBase:

[legend]
List of all members.

Public Member Functions

__init__ ()
evaluate (value)

Detailed Description

Base constraint class for use when no constraint is appropriate.

Definition at line 19 of file gConstraint.py.

The documentation for this class was generated from the following file:
  • gConstraint.py
Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GconstraintLimit Class Reference

gConstraint.GconstraintLimit

GconstraintLimit Class Reference

Limit Constraint. More...

Inheritance diagram for GconstraintLimit:

[legend]
Collaboration diagram for GconstraintLimit:

[legend]
List of all members.

Public Member Functions

__init__ (name, subsystem, category, enabled, continuous, low, high)
_eval_ (value)

Detailed Description

Limit Constraint.

Constraint class that limits a passed in value to given limits. If the value is outside of the constraint limits, it is pegged to the nearest limit.

Definition at line 93 of file gConstraint.py.

Member Function Documentation

_eval_ ( value )

Dummy evaluation method to be overridden through inheritance to implement the application specific constraint evaluation

Reimplemented from Gconstraint.

The documentation for this class was generated from the following file:
  • gConstraint.py
Generated on Fri Jul 21 13:26:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GconstraintLimitPegRE Class Reference

gConstraint.GconstraintLimitPegRE

GconstraintLimitPegRE Class Reference

Pegged Limit Constraint. More...

Inheritance diagram for GconstraintLimitPegRE:

[legend]
Collaboration diagram for GconstraintLimitPegRE:

[legend]
List of all members.

Public Member Functions

__init__ (name, subsystem, category, enabled, continuous, low, high)
_eval_ (value)

Detailed Description

Pegged Limit Constraint.

Constraint class that limits a passed in value to given limits. If the value is outside of the constraint limits, it raises an exception AND the value is pegged to the nearest limit.

Definition at line 107 of file gConstraint.py.

Member Function Documentation

_eval_ ( value )

Dummy evaluation method to be overridden through inheritance to implement the application specific constraint evaluation

Reimplemented from Gconstraint.

The documentation for this class was generated from the following file:
  • gConstraint.py
Generated on Fri Jul 21 13:26:49 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GconstraintLimitRE Class Reference

gConstraint.GconstraintLimitRE

GconstraintLimitRE Class Reference

On Constraint Limit Raise Exception. More...

Inheritance diagram for GconstraintLimitRE:

[legend]
Collaboration diagram for GconstraintLimitRE:

[legend]
List of all members.

Public Member Functions

__init__ (name, subsystem, category, enabled, continuous, low, high)
_eval_ (value)

Detailed Description

On Constraint Limit Raise Exception.

Constraint class that determines whether to raise an exception based on the passed in value being within given limits.

Definition at line 80 of file gConstraint.py.

Member Function Documentation

_eval_ ( value )

Dummy evaluation method to be overridden through inheritance to implement the application specific constraint evaluation

Reimplemented from Gconstraint.

The documentation for this class was generated from the following file:
  • gConstraint.py
Generated on Fri Jul 21 13:26:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gConstraintViolation Class Reference

gConstraint.gConstraintViolation

gConstraintViolation Class Reference

Constraint Violation Class. More...

List of all members.

Public Member Functions

__init__ (args=None)

Detailed Description

Constraint Violation Class.

Exception class used in constraint classes

Definition at line 11 of file gConstraint.py.

The documentation for this class was generated from the following file:
  • gConstraint.py
Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GCRC Class Reference

gTEM.GCRC

GCRC Class Reference

Calorimeter Readout Controller node Record. More...

Inheritance diagram for GCRC:

[legend]
Collaboration diagram for GCRC:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent, id)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)
send (cmd)
downCFE (childId)
Navigate to the GCFE indicated by childId.
allCFE ()
Navigate to the broadcast GCFE.
existsCFE (cfeId)
Check if the GCFE instance with the id cfeId exists in the schema.

Detailed Description

Calorimeter Readout Controller node Record.

Has GCRC specific registers and dataless commands.

Valid Registers:

  • csr
  • last_cmd
  • delay_1
  • delay_2
  • delay_3
  • dac
  • config

Dataless Commands:

  • cmd_nop
  • cmd_reset
  • cmd_calstrobe ]

Definition at line 208 of file gTEM.py.

Member Function Documentation

__init__ | ( | client | ,
 |  | parent | ,
 |  | id |
 | ) |

Initialize valid registers as Gattrs.

Assign default values to members

allCFE ( )

Navigate to the broadcast GCFE.

Returns:
The broadcast GCFE object instance

downCFE ( childId )

Navigate to the GCFE indicated by childId.

Parameters:
childId The id of the child GCFE
Returns:
A GCFE object instance

existsCFE ( cfeId )

Check if the GCFE instance with the id cfeId exists in the schema.

Parameters:
cfeId Calorimeter front-end id
Returns:
1 if it exists, 0 if it doesn't.

The documentation for this class was generated from the following file:
  • gTEM.py
Generated on Fri Jul 21 13:27:12 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GCRU Class Reference

gCRU.GCRU

GCRU Class Reference

CRU node. More...

Inheritance diagram for GCRU:

[legend]
Collaboration diagram for GCRU:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)
send (cmd)

Detailed Description

CRU node.

Has GCRU specific registers and dataless commands.

Valid Registers:

  • configuration
  • command_enable
  • response_enable
  • cr_statistics
  • acd_startup_clock
  • test_io

Dataless Commands:

  • cmd_nop
  • cmd_reset

Definition at line 24 of file gCRU.py.

The documentation for this class was generated from the following file:
  • gCRU.py
Generated on Fri Jul 21 13:26:49 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Gdb Class Reference

gDb.Gdb

Gdb Class Reference

Base class for all GLAST LAT functional blocks. More...

Inheritance diagram for Gdb:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent, id, valid_attrs=[], addr=None, flags=None)
up ()
id ()
addr ()
root ()
getIdTuple ()
getName ()
getOpaque (name=None)
Retrieves the named opaque data included in the schema The opaque data needs to be associated with a node therefore this method only returns the opaque data that is associated with that node.
getSerialNos (component=None)
Retrieves the serial numbers associated with the node.
getExcludeFlags ()
Retrieves the exclude reasons associated with the node.
setFlag (key, value)
Set generic flags for the node.
getFlag (key, integer=False)
Returns the value which corresponds to key.
attrIter ()
Iterator for attributes.

Detailed Description

Base class for all GLAST LAT functional blocks.

Uses __getattr__ and __setattr__ methods to feature an SCL like syntax for referencing attributes

Definition at line 13 of file gDb.py.

Member Function Documentation

__init__ | ( | client | ,
 |  | parent | ,
 |  | id | ,
 |  | valid_attrs | = [],
 |  | addr | = None,
 |  | flags | = None
 | ) |

gNode constructor.

Parameters:
valid_regs A list of valid attribute names.

addr ( )

Return the hardware address of this component

attrIter ( )

Iterator for attributes.

Iterates over attribute objects belonging to the current node returning each object in the order that is specified in the node's __attrs member.

getExcludeFlags ( )

Retrieves the exclude reasons associated with the node.

Returns:
A list of excludes that match the current node, if there are no excludes specified then an empty list is returned.

getFlag | ( | key | ,
 |  | integer | = False
 | ) |

Returns the value which corresponds to key.

Returns the value which corresponds to key.

Parameters:
key Entry key.
Returns:
Flag value corresponding to key.

getIdTuple ( )

Return the node id(s) in this node's hierarchy

Returns:
The root node

getOpaque ( name = None )

Retrieves the named opaque data included in the schema The opaque data needs to be associated with a node therefore this method only returns the opaque data that is associated with that node.

Parameters:
name Name of the opaque XML data (optional)
Returns:
A list of XML DOM objects matching name or if name is None a dictionary of a list of XML DOM objects

Reimplemented in GHSK.

getSerialNos ( component = None )

Retrieves the serial numbers associated with the node.

Parameters:
component Hardware component identifier (optional)
Returns:
A dictionary matching component or if component is None a dictionary of all components and their serial numbers

id ( )

Return the hardware id of this component

root ( )

Return the root node in this node's hierarchy

Returns:
The root node

setFlag | ( | key | ,
 |  | value |
 | ) |

Set generic flags for the node.

Flags are passed by gSchemaConfig when the <flags> section in the schema is parsed.

Parameters:
key | Entry key, must already exists.
value | New value to be set for key.

up ( )

Return the parent of this component

The documentation for this class was generated from the following file:
  • gDb.py
Generated on Fri Jul 21 13:26:50 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GDBN Class Reference

RunControlCommon.GDBN

GDBN Class Reference

Database node record. More...

List of all members.

Public Member Functions

__init__ ()
Initialize the dictionary.

Detailed Description

Database node record.

The database node contains session level variables in addition to preferences and entries used for diagnostics purposes.

Definition at line 42 of file RunControlCommon.py.

The documentation for this class was generated from the following file:
  • RunControlCommon.py
Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Geb Class Reference

geb.Geb

Geb Class Reference

Inheritance diagram for Geb:

[legend]
List of all members.

Public Member Functions

__init__ (contributors)
name ()
Method to return the name of the event builder. May be overridden.
shutdown ()
Method to shutdown the builder.
run ()
Method run by the Thread base class. Use the start() method to start event building.
build ()
Call this method to start event building.
flushAll ()
Method for flushing all stale events from the system.
close ()
Optional method to close down the derived class. Meant to be overridden.

Detailed Description

Definition at line 87 of file geb.py.

The documentation for this class was generated from the following file:
  • geb.py
Generated on Fri Jul 21 13:26:51 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GebContribution Class Reference

geb.GebContribution

GebContribution Class Reference

Inheritance diagram for GebContribution:

[legend]
List of all members.

Public Member Functions

identity ()
Method to return the identity (LDF TypeId) of a contribution to an event. Meant to be overridden.
length ()
Method to return the length of a contribution to an event. Meant to be overridden.
sequence ()
Method to return the sequence value of the contribution. Meant to be overridden.
contributor ()

Detailed Description

Definition at line 11 of file geb.py.

Member Function Documentation

sequence ( )

Method to return the sequence value of the contribution. Meant to be overridden.

! This method must return a value for which the equality and greater than operators are defined. The sequence values must be common amoungst all contributors such that a if a contribution's sequence value is equal to another contributions sequence value, the two contributions belong together as part of the same event. A contribution A's sequence value that is greater than another contribution B's sequence value is interpreted to mean that A is newer than B. This information is used to flush out partially built older events.

Reimplemented in AncillaryContribution, and LdfContribution.

The documentation for this class was generated from the following file:
  • geb.py
Generated on Fri Jul 21 13:26:50 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GebContributor Class Reference

geb.GebContributor

GebContributor Class Reference

Inheritance diagram for GebContributor:

[legend]
List of all members.

Public Member Functions

__init__ ()
read ()
Method to read a contribution from somewhere. Meant to be overridden.
name ()
Method to return the name of the contribution type. Meant to be overridden.
sequence (sequence)
Optional method for remapping the ancillary contribution's sequence number into the same space as the other contributions' sequence numbers. If this method is not overridden, the supplied sequence number is returned.
open ()
Method to open the contributor. Meant to be overridden.
close ()
Optional method to close the contributor. Meant to be overridden.
idMask (id=None)
Method for building the contributor mask.
run ()
Loop that continuously reads from the data source.

Static Public Member Functions

static contributionQueue ()
Method to get the common contribution queue.

Detailed Description

Definition at line 41 of file geb.py.

Member Function Documentation

static contributionQueue ( ) [static]

Method to get the common contribution queue.

!

Returns:
A Queue object

The documentation for this class was generated from the following file:
  • geb.py
Generated on Fri Jul 21 13:26:50 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GEBM Class Reference

gEBM.GEBM

GEBM Class Reference

GEBM node. More...

Inheritance diagram for GEBM:

[legend]
Collaboration diagram for GEBM:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize child objects.
downEBMC ()
Navigate to the GEBMC node.
existsEBMC ()
Check if the GEBMC instance exists in the schema.
downEBMST ()
Navigate to the GEBMST node.
existsEBMST ()
Check if the GEBMS instance exists in the schema.

Detailed Description

GEBM node.

Definition at line 10 of file gEBM.py.

Member Function Documentation

downEBMC ( )

Navigate to the GEBMC node.

Returns:
The GEBMC object instance

downEBMST ( )

Navigate to the GEBMST node.

Returns:
The GEBMST object instance

existsEBMC ( )

Check if the GEBMC instance exists in the schema.

Returns:
1 if it exists, 0 if it doesn't.

existsEBMST ( )

Check if the GEBMS instance exists in the schema.

Returns:
1 if it exists, 0 if it doesn't.

The documentation for this class was generated from the following file:
  • gEBM.py
Generated on Fri Jul 21 13:26:51 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GEBMC Class Reference

gEBM.GEBMC

GEBMC Class Reference

EBM Controller node. More...

Inheritance diagram for GEBMC:

[legend]
Collaboration diagram for GEBMC:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)
send (cmd)

Detailed Description

EBM Controller node.

Has GEBMC specific registers.

Valid Registers:

  • back_end_config
  • front_end_a_config
  • front_end_b_config
  • address
  • sources
  • input_enables
  • output_enables
  • timeout
  • tem_statistics
  • cr_statistics
  • ssr_header

Dataless Commands:

  • cmd_nop
  • cmd_reset

Definition at line 71 of file gEBM.py.

The documentation for this class was generated from the following file:
  • gEBM.py
Generated on Fri Jul 21 13:26:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GEBMST Class Reference

gEBM.GEBMST

GEBMST Class Reference

EBM Event Statistics node. More...

Inheritance diagram for GEBMST:

[legend]
Collaboration diagram for GEBMST:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid registers as Gattrs.
read (reg)
send (cmd)

Detailed Description

EBM Event Statistics node.

Has GEBMST specific registers.

Valid Registers:

  • receive_gem
  • receive_aem
  • receive_siu0
  • receive_siu1
  • receive_epu0
  • receive_epu1
  • receive_epu2
  • receive_siu2
  • receive_tem_mux0
  • receive_tem_mux1
  • transmit_siu0
  • transmit_siu1
  • transmit_epu0
  • transmit_epu1
  • transmit_epu2
  • transmit_siu2
  • transmit_ssr

Dataless Commands:

  • cmd_reset

Definition at line 110 of file gEBM.py.

The documentation for this class was generated from the following file:
  • gEBM.py
Generated on Fri Jul 21 13:26:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GEGU Class Reference

gEGU.GEGU

GEGU Class Reference

Base class for raw/engineering unit conversions. More...

Inheritance diagram for GEGU:

[legend]
List of all members.

Public Member Functions

__init__ (units)
egu (value)
raw (value)
units ()

Detailed Description

Base class for raw/engineering unit conversions.

Definition at line 10 of file gEGU.py.

Member Function Documentation

egu ( value )

Overloadable method for converting raw units to engineering units

Parameters:
value Value in raw units.
Returns:
Engineering units value after the conversion.

raw ( value )

Overloadable method for converting engineering units to raw units

Parameters:
value Value in engineering units.
Returns:
Raw value after the conversion.

units ( )

Method for returning the units string

Returns:
Units string value.

The documentation for this class was generated from the following file:
  • gEGU.py
Generated on Fri Jul 21 13:26:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GEGU_linear Class Reference

gEGU.GEGU_linear

GEGU_linear Class Reference

EGU class for performing linear conversions. More...

Inheritance diagram for GEGU_linear:

[legend]
Collaboration diagram for GEGU_linear:

[legend]
List of all members.

Public Member Functions

__init__ (slope, intercept, units="")
egu (rawValue)
raw (eguValue)

Detailed Description

EGU class for performing linear conversions.

Definition at line 44 of file gEGU.py.

Member Function Documentation

__init__ | ( | slope | ,
 |  | intercept | ,
 |  | units | = ""
 | ) |

Initialize a raw/EGU linear conversion object.

Parameters:
slope | Number of engineering unit counts per raw value tick
intercept | Offset in units of the engineering unit
units | The engineering units name, e.g. 'cm'

egu ( rawValue )

Convert a value in raw units to engineering units

Parameters:
rawValue Value in raw units.
Returns:
Engineering units value after the conversion.

raw ( eguValue )

Convert a value in engineering units to raw units

Parameters:
eguValue Value in engineering units.
Returns:
Raw value after the conversion.

The documentation for this class was generated from the following file:
  • gEGU.py
Generated on Fri Jul 21 13:26:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GEGU_poly3 Class Reference

gEGU.GEGU_poly3

GEGU_poly3 Class Reference

EGU class for performing 3rd degree polynominal conversions. More...

Inheritance diagram for GEGU_poly3:

[legend]
Collaboration diagram for GEGU_poly3:

[legend]
List of all members.

Public Member Functions

__init__ (coeff0, coeff1, coeff2, coeff3, offset, units="")
egu (rawValue)
raw (eguValue)

Detailed Description

EGU class for performing 3rd degree polynominal conversions.

Definition at line 79 of file gEGU.py.

Member Function Documentation

__init__ | ( | coeff0 | ,
 |  | coeff1 | ,
 |  | coeff2 | ,
 |  | coeff3 | ,
 |  | offset | ,
 |  | units | = ""
 | ) |

Initialize a raw/EGU linear conversion object.

Parameters:
slope | Number of engineering unit counts per raw value tick
intercept | Offset in units of the engineering unit
units | The engineering units name, e.g. 'cm'

egu ( rawValue )

Convert a value in raw units to engineering units

Parameters:
rawValue Value in raw units
Returns:
Engineering units value after the conversion.

raw ( eguValue )

Convert a value in engineering units to raw units

Parameters:
eguValue Value in engineering units.
Returns:
Raw value after the conversion.

The documentation for this class was generated from the following file:
  • gEGU.py
Generated on Fri Jul 21 13:26:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GEGU_rtd Class Reference

gEGU.GEGU_rtd

GEGU_rtd Class Reference

EGU class for performing RTD (Resistive Temp Device) conversions. More...

Inheritance diagram for GEGU_rtd:

[legend]
Collaboration diagram for GEGU_rtd:

[legend]
List of all members.

Public Member Functions

__init__ (coeff0, coeff1, coeff2, coeff3, coeff4, units="")
egu (rawValue)
raw (eguValue)

Detailed Description

EGU class for performing RTD (Resistive Temp Device) conversions.

Actual equation is:

C = ( R/(R+C0) - 1/(C2) ) * C1

C0 (C C2 + C1) R = - ----------------- C C2 - C1 C2 + C1

Temp = ( R + C4 ) / C5

Nominal C0 = 1820 Nominal C1 = 4096 (Exact) Nominal C2 = 3

Fitted from +/- 100 degree data from 0118MF literature from Goodrich (manufacturer) Fitted C3 = - 1994.5 Fitted C4 = 7.9051

Definition at line 178 of file gEGU.py.

Member Function Documentation

__init__ | ( | coeff0 | ,
 |  | coeff1 | ,
 |  | coeff2 | ,
 |  | coeff3 | ,
 |  | coeff4 | ,
 |  | units | = ""
 | ) |

Initialize a raw/EGU linear conversion object.

Parameters:
coeff[0-4] | One of the coefficients of the function. See function doc
units | The engineering units name, e.g. 'cm'

egu ( rawValue )

Convert a value in raw units to engineering units

Parameters:
rawValue Value in raw units
Returns:
Engineering units value after the conversion.

raw ( eguValue )

Convert a value in engineering units to raw units

Parameters:
eguValue Value in engineering units.
Returns:
Raw value after the conversion.

The documentation for this class was generated from the following file:
  • gEGU.py
Generated on Fri Jul 21 13:26:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GEGU_test Class Reference

testPreload.GEGU_test

GEGU_test Class Reference

Detailed Description

Definition at line 7 of file testPreload.py.

The documentation for this class was generated from the following file:
  • testPreload.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GEGU_thermistor Class Reference

gEGU.GEGU_thermistor

GEGU_thermistor Class Reference

EGU class for performing thermistor conversions. More...

Inheritance diagram for GEGU_thermistor:

[legend]
Collaboration diagram for GEGU_thermistor:

[legend]
List of all members.

Public Member Functions

__init__ (coeff0, coeff1, coeff2, coeff3, units="")
egu (rawValue)
raw (eguValue)

Detailed Description

EGU class for performing thermistor conversions.

Actual equation is: R = (C1 / Counts) + C0

Temp (deg C) = C2 * ln(R) + C3

Nominal C0 = - 1.020 E5 Nominal C1 = 4.096 E8

Fitted from (-40,80 degree) thermistor data from YSI. 30K ohm column (http://www.ysi.com/extranet/TEMPKL.nsf/447554deba0f52f2852569f500696b21/617d4fec8189026885256a03005d500a/$FILE/R_vs_T%20449XX.xls) Fitted C2 = - 20.319 Fitted C3 = 234.69

Definition at line 126 of file gEGU.py.

Member Function Documentation

__init__ | ( | coeff0 | ,
 |  | coeff1 | ,
 |  | coeff2 | ,
 |  | coeff3 | ,
 |  | units | = ""
 | ) |

Initialize a raw/EGU conversion object.

Parameters:
coeff[0-3] | One of the coefficients of the function. See function doc
units | The engineering units name, e.g. 'cm'

egu ( rawValue )

Convert a value in raw units to engineering units

Parameters:
rawValue Value in raw units
Returns:
Engineering units value after the conversion.

raw ( eguValue )

Convert a value in engineering units to raw units

Parameters:
eguValue Value in engineering units.
Returns:
Raw value after the conversion.

The documentation for this class was generated from the following file:
  • gEGU.py
Generated on Fri Jul 21 13:26:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GEM Class Reference

gEvtCli.GEM

GEM Class Reference

GEM event object. More...

List of all members.

Public Member Functions

__init__ ()
clear ()

Detailed Description

GEM event object.

Members:

  • ROI_Vector
  • TKR_Vector
  • CAL_HE_Vector
  • CAL_LE_Vector
  • deadzone
  • conditions
  • CNO_Vector
  • vetoList
  • liveTime
  • prescaled
  • discarded
  • condArrivalTimes
  • triggerTime
  • onePPSTime
  • deltaOpenWindowTime
  • deltaEventTime

Deprecated:
  • triggerSummary Use 'conditions' instead
  • sent Use 'condArrivalTimes' instead

Definition at line 139 of file gEvtCli.py.

The documentation for this class was generated from the following file:
  • gEvtCli.py
Generated on Fri Jul 21 13:26:54 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GEMcontribution Class Reference

standardLDF.GEMcontribution

GEMcontribution Class Reference

List of all members.

Public Member Functions

__getattr__ (attr)
fill (prefix="")

Detailed Description

Definition at line 64 of file standardLDF.py.

Member Function Documentation

__getattr__ ( attr )

This method fakes up inheritance from an LDF.GEMcontribution. When a called method can not be found to belong to this class, this method is called. We use it to redirect the call to the 'base' class.

The documentation for this class was generated from the following file:
  • standardLDF.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GEMcontribution_ Class Reference

GOSED_LDF.GEMcontribution_

GEMcontribution_ Class Reference

List of all members.

Public Member Functions

__init__ (event, contribution, gui)
__getattr__ (attr)
plot ()

Detailed Description

Definition at line 13 of file GOSED_LDF.py.

Member Function Documentation

__getattr__ ( attr )

This method fakes up inheritance from an LDF.GEMcontribution. When a called method can not be found to belong to this class, this method is called. We use it to redirect the call to the 'base' class.

The documentation for this class was generated from the following file:
  • GOSED_LDF.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GEPU Class Reference

gEPU.GEPU

GEPU Class Reference

EPU node. More...

Inheritance diagram for GEPU:

[legend]
Collaboration diagram for GEPU:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent, id)
Initialize valid registers as Gattrs.

Detailed Description

EPU node.

Definition at line 8 of file gEPU.py.

The documentation for this class was generated from the following file:
  • gEPU.py
Generated on Fri Jul 21 13:26:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GExportException Class Reference

DataExport.GExportException

GExportException Class Reference

Define an exception from the Export system. More...

List of all members.

Public Member Functions

__init__ (status)
__str__ ()

Detailed Description

Define an exception from the Export system.

Definition at line 18 of file DataExport.py.

The documentation for this class was generated from the following file:
  • DataExport.py
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GGEM Class Reference

gGEM.GGEM

GGEM Class Reference

GGEM node. More...

Inheritance diagram for GGEM:

[legend]
Collaboration diagram for GGEM:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize child objects.
getEPUaddr ()
downGEMC ()
Navigate to the GGEMC node.
existsGEMC ()
Check if the GGEMC instance exists in the schema.
downGEMMG ()
Navigate to the GGEMMG node.
existsGEMMG ()
Check if the GGEMMG instance exists in the schema.
downGEMST ()
Navigate to the GGEMST node.
existsGEMST ()
Check if the GGEMST instance exists in the schema.
downGEMSC ()
Navigate to the GGEMSC node.
existsGEMSC ()
Check if the GGEMSC instance exists in the schema.
downGEMVG ()
Navigate to the GGEMVG node.
existsGEMVG ()
Check if the GGEMVG instance exists in the schema.
downGEMIE ()
Navigate to the GGEMIE node.
existsGEMIE ()
Check if the GGEMIE instance exists in the schema.
downGEMW ()
Navigate to the GGEMW node.
existsGEMW ()
Check if the GGEMW instance exists in the schema.

Detailed Description

GGEM node.

Definition at line 10 of file gGEM.py.

Member Function Documentation

downGEMC ( )

Navigate to the GGEMC node.

Returns:
The GGEMC object instance

downGEMIE ( )

Navigate to the GGEMIE node.

Returns:
The GGEMIE object instance

downGEMMG ( )

Navigate to the GGEMMG node.

Returns:
The GGEMMG object instance

downGEMSC ( )

Navigate to the GGEMSC node.

Returns:
The GGEMSC object instance

downGEMST ( )

Navigate to the GGEMST node.

Returns:
The GGEMST object instance

downGEMVG ( )

Navigate to the GGEMVG node.

Returns:
The GGEMVG object instance

downGEMW ( )

Navigate to the GGEMW node.

Returns:
The GGEMW object instance

existsGEMC ( )

Check if the GGEMC instance exists in the schema.

Returns:
1 if it exists, 0 if it doesn't.

existsGEMIE ( )

Check if the GGEMIE instance exists in the schema.

Returns:
1 if it exists, 0 if it doesn't.

existsGEMMG ( )

Check if the GGEMMG instance exists in the schema.

Returns:
1 if it exists, 0 if it doesn't.

existsGEMSC ( )

Check if the GGEMSC instance exists in the schema.

Returns:
1 if it exists, 0 if it doesn't.

existsGEMST ( )

Check if the GGEMST instance exists in the schema.

Returns:
1 if it exists, 0 if it doesn't.

existsGEMVG ( )

Check if the GGEMVG instance exists in the schema.

Returns:
1 if it exists, 0 if it doesn't.

existsGEMW ( )

Check if the GGEMW instance exists in the schema.

Returns:
1 if it exists, 0 if it doesn't.

The documentation for this class was generated from the following file:
  • gGEM.py
Generated on Fri Jul 21 13:27:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GGEMC Class Reference

gGEM.GGEMC

GGEMC Class Reference

GEMC sub-node of GGEM (controller). More...

Inheritance diagram for GGEMC:

[legend]
Collaboration diagram for GGEMC:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)
send (cmd)

Detailed Description

GEMC sub-node of GGEM (controller).

Has GGEMC specific registers and dataless commands.

Valid Registers:

  • configuration
  • address
  • periodic_mode
  • periodic_limits
  • periodic_rate
  • sequence
  • cr_statistics
  • event_statistics
  • delay_ext_trg

Dataless Commands:

  • cmd_nop
  • cmd_reset
  • cmd_trigger

Definition at line 141 of file gGEM.py.

The documentation for this class was generated from the following file:
  • gGEM.py
Generated on Fri Jul 21 13:27:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GGEMIE Class Reference

gGEM.GGEMIE

GGEMIE Class Reference

GEMIE sub-node of GGEM (input enables). More...

Inheritance diagram for GGEMIE:

[legend]
Collaboration diagram for GGEMIE:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)

Detailed Description

GEMIE sub-node of GGEM (input enables).

Has GGEMIE specific registers and dataless commands.

Valid Registers:

  • towers_0_3
  • towers_4_7
  • towers_8_11
  • towers_12_15
  • acd_cno
  • tiles_000_013
  • tiles_014_032
  • tiles_033_NA3
  • tiles_100_113
  • tiles_114_NA5
  • tiles_200_213
  • tiles_214_NA7
  • tiles_300_313
  • tiles_314_NA9
  • tiles_400_413
  • tiles_414_NA1
  • tiles_500_NA10
  • tower_busy
  • external

Definition at line 376 of file gGEM.py.

The documentation for this class was generated from the following file:
  • gGEM.py
Generated on Fri Jul 21 13:27:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GGEMMG Class Reference

gGEM.GGEMMG

GGEMMG Class Reference

GEMMG sub-node of GGEM (TAM generator). More...

Inheritance diagram for GGEMMG:

[legend]
Collaboration diagram for GGEMMG:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)

Detailed Description

GEMMG sub-node of GGEM (TAM generator).

Has GGEMMG specific registers and dataless commands.

Valid Registers:

  • engine_0
  • engine_1
  • engine_2
  • engine_3
  • engine_4
  • engine_5
  • engine_6
  • engine_7
  • engine_8
  • engine_9
  • engine_a
  • engine_b
  • engine_c
  • engine_d
  • engine_e
  • engine_f

Definition at line 176 of file gGEM.py.

The documentation for this class was generated from the following file:
  • gGEM.py
Generated on Fri Jul 21 13:27:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GGEMSC Class Reference

gGEM.GGEMSC

GGEMSC Class Reference

GEMSC sub-node of GGEM (scheduler). More...

Inheritance diagram for GGEMSC:

[legend]
Collaboration diagram for GGEMSC:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)

Detailed Description

GEMSC sub-node of GGEM (scheduler).

Has GGEMSC specific registers and dataless commands.

Valid Registers:

  • conditions_00_07
  • conditions_08_0f
  • conditions_10_17
  • conditions_18_1f
  • conditions_20_27
  • conditions_28_2f
  • conditions_30_37
  • conditions_38_3f
  • conditions_40_47
  • conditions_48_4f
  • conditions_50_57
  • conditions_58_5f
  • conditions_60_67
  • conditions_68_6f
  • conditions_70_77
  • conditions_78_7f
  • conditions_80_87
  • conditions_88_8f
  • conditions_90_97
  • conditions_98_9f
  • conditions_a0_a7
  • conditions_a8_af
  • conditions_b0_b7
  • conditions_b8_bf
  • conditions_c0_c7
  • conditions_c8_cf
  • conditions_d0_d7
  • conditions_d8_df
  • conditions_e0_e7
  • conditions_e8_ef
  • conditions_f0_f7
  • conditions_f8_ff

Definition at line 319 of file gGEM.py.

The documentation for this class was generated from the following file:
  • gGEM.py
Generated on Fri Jul 21 13:27:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GGEMST Class Reference

gGEM.GGEMST

GGEMST Class Reference

GEMST sub-node of GGEM (statistics). More...

Inheritance diagram for GGEMST:

[legend]
Collaboration diagram for GGEMST:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)
send (cmd)
extCtrEnable (reg)
Enable the specified pseudo counter. By default all pseudo counters are disabled.
extCtrDisable (reg)
Disable the specified pseudo counter. By default all pseudo counters are disabled.
extCtrLoopEnable ()
Enable the update loop that updates all counter pseudoregisters.
extCtrLoopDisable ()
Disable the update loop that updates all counter pseudoregisters.
extCtrSetLoopDelay (delay)
Set the update loop interval for counter pseudoregisters.
extCtrRead (reg)
Read the specified pseudocounter.
extCtrClear ()
Clear the pseudocounters.
extCtrClearStatus ()
Read the pseudocounter statuses.

Detailed Description

GEMST sub-node of GGEM (statistics).

Has GGEMST specific registers and dataless commands.

Valid Registers:

  • livetime
  • prescaled
  • discarded
  • sent
  • tile_counters
  • tile_0
  • tile_1
  • cno_counters
  • cno_0
  • cno_1
  • one_pps
  • timebase
  • deadzone

Deprecated:
  • missed Use 'deadzone' instead

Definition at line 210 of file gGEM.py.

Member Function Documentation

extCtrDisable ( reg )

Disable the specified pseudo counter. By default all pseudo counters are disabled.

Parameters:
reg Register id of the pseudo counter. Can be retrieved by calling gemst.regs['regname'].id().
Returns:
A Response object

extCtrEnable ( reg )

Enable the specified pseudo counter. By default all pseudo counters are disabled.

Parameters:
reg Register id of the pseudo counter. Can be retrieved by calling gemst.regs['regname'].id().
Returns:
A Response object

extCtrLoopDisable ( )

Disable the update loop that updates all counter pseudoregisters.

Returns:
A Response object

extCtrLoopEnable ( )

Enable the update loop that updates all counter pseudoregisters.

Returns:
A Response object

extCtrRead ( reg )

Read the specified pseudocounter.

Parameters:
reg Register id of the pseudo counter. Can be retrieved by calling gemst.regs['regname'].id().
Returns:
(value, timestamp) pair

extCtrSetLoopDelay ( delay )

Set the update loop interval for counter pseudoregisters.

Parameters:
Set the pseudo counter update loop delay in 1/60 second ticks. The default is 30 (2 Hz).
Returns:
A Response object

The documentation for this class was generated from the following file:
  • gGEM.py
Generated on Fri Jul 21 13:27:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GGEMVG Class Reference

gGEM.GGEMVG

GGEMVG Class Reference

GEMVG sub-node of GGEM (ROI generator). More...

Inheritance diagram for GGEMVG:

[legend]
Collaboration diagram for GGEMVG:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)

Detailed Description

GEMVG sub-node of GGEM (ROI generator).

Has GGEMVG specific registers and dataless commands.

Valid Registers:

  • ROI_00, ROI_01, ROI_02,...,ROI_53

Definition at line 339 of file gGEM.py.

The documentation for this class was generated from the following file:
  • gGEM.py
Generated on Fri Jul 21 13:27:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GGEMW Class Reference

gGEM.GGEMW

GGEMW Class Reference

GEMW sub-node of GGEM. More...

Inheritance diagram for GGEMW:

[legend]
Collaboration diagram for GGEMW:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)

Detailed Description

GEMW sub-node of GGEM.

Has GGEMW specific registers.

Valid Registers:

  • window_width
  • window_open_mask

Definition at line 396 of file gGEM.py.

The documentation for this class was generated from the following file:
  • gGEM.py
Generated on Fri Jul 21 13:27:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GGLT Class Reference

gGLT.GGLT

GGLT Class Reference

Global Trigger. More...

Inheritance diagram for GGLT:

[legend]
Collaboration diagram for GGLT:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent=None)
Initialize valid registers as Gattrs.
getEPUaddr ()
read (reg)
load (reg, value)
send (cmd)
initialize ()
waitForMaskEnable (tmo=None)
Waits until the enableMask() method is called.
enableMask ()
Commits the mask value to hardware.
disableMask ()
Disables all trigger masks but doesn't change the cached mask value.
triggersDisabled ()
Check if the triggers are disabled.
isMaskDirty ()
Return the mask dirty flag.
refreshMask ()
Refreshes the cached value of the mask from the hardware.
getEnableTime ()
Returns the VxWorks timestamp at the time the triggers are enabled.
getDisableTime ()
Returns the VxWorks timestamp at the time the triggers are disabled.
setDestinationOverride (override)
Sets the flag to determine whether the user should be able to override the destination value.

Detailed Description

Global Trigger.

Has GGLT specific registers and dataless commands.

Valid Registers:

  • mask
  • busy_disable
  • ext_cal_strobe
  • ext_tack
  • counter_mask
  • counter
  • ext_clk_out_enable

Dataless Commands:

  • cmd_reset
  • cmd_self_trigger

Options Register Bit Fields:

  • parity
  • tag
  • event_number

Configuration Register Bit Fields:

  • destination
  • marker
  • tack
  • zero_suppress
  • four_range_readout
  • cal_strobe

Mask Register Bit Fields:

  • internal_trg
  • external_trg
  • cal_low
  • cal_high
  • three_in_a_row
  • acd_veto_00
  • acd_veto_01
  • acd_veto_02
  • acd_veto_03
  • acd_veto_04
  • acd_veto_05
  • acd_veto_06
  • acd_veto_07
  • acd_veto_08
  • acd_veto_09
  • acd_veto_10
  • acd_veto_11
  • acd_veto_12
  • acd_veto_13
  • acd_veto_14
  • acd_veto_15
  • acd_veto_16
  • acd_veto_17
  • acd_cno

Definition at line 70 of file gGLT.py.

Member Function Documentation

__init__ | ( | client | ,
 |  | parent | = None
 | ) |

Initialize valid registers as Gattrs.

Assign default values to members

disableMask ( )

Disables all trigger masks but doesn't change the cached mask value.

This way when the triggers are enabled again, the old setting can be applied.

enableMask ( )

Commits the mask value to hardware.

Returns:
The value of the dirty flag before the commit is made.

getDisableTime ( )

Returns the VxWorks timestamp at the time the triggers are disabled.

Returns:
Trigger disable time

getEnableTime ( )

Returns the VxWorks timestamp at the time the triggers are enabled.

Returns:
Trigger enable time

isMaskDirty ( )

Return the mask dirty flag.

Returns:
Mask dirty flag.

setDestinationOverride ( override )

Sets the flag to determine whether the user should be able to override the destination value.

Parameters:
override 0=Destination is supplied as the LCB address as returned by CmdCli.getLcbAddr() 1=The user supplied destination value takes effect

triggersDisabled ( )

Check if the triggers are disabled.

Returns:
True if triggers are disabled, False if triggers are disabled.

waitForMaskEnable ( tmo = None )

Waits until the enableMask() method is called.

This is usually needed by non-self-triggering scripts where the _commandSynch thread needs to wait until RunControl actually enables the mask before continuing.

Parameters:
tmo Optional parameter giving the wait timeout in seconds

The documentation for this class was generated from the following file:
  • gGLT.py
Generated on Fri Jul 21 13:27:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Ggroup Class Reference

gGroup.Ggroup

Ggroup Class Reference

List of all members.

Public Member Functions

name ()
enabled ()
enable ()
disable ()

Detailed Description

Definition at line 4 of file gGroup.py.

Member Function Documentation

disable ( )

Disable a group.

enable ( )

Enable a group.

enabled ( )

Return status of the group.

name ( )

Return the group's name.

The documentation for this class was generated from the following file:
  • gGroup.py
Generated on Fri Jul 21 13:27:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GHSK Class Reference

gHSK.GHSK

GHSK Class Reference

GLAST HSK node Record. More...

Inheritance diagram for GHSK:

[legend]
Collaboration diagram for GHSK:

[legend]
List of all members.

Public Member Functions

__init__ (client)
Initialize valid attributes as Gattrs.
downHTEM (childId)
Navigate to the HTEM indicated by childId.
downHAEM ()
Navigate to the HAEM node.
downHGEM ()
Navigate to the HGEM node.
downHEBM ()
Navigate to the HEBM node.
downHPDU (childId)
Navigate to the HPDU node.
downHCOM ()
Navigate to the HCOM node.
downHCPU ()
Navigate to the HCPU node.
downHNUL ()
Navigate to the HNUL node.
existsHTEM (temID)
Check if the HTEM instance with the id temID exists in the schema.
existsHAEM ()
Check if the HAEM instance exists in the schema.
existsHGEM ()
Check if the HGEM instance exists in the schema.
existsHEBM ()
Check if the HEBM instance exists in the schema.
existsHPDU (hpduID)
Check if the HPDU instance exists in the schema.
existsHCOM ()
Check if the HCOM instance exists in the schema.
existsHCPU ()
Check if the HCPU instance exists in the schema.
readSchema (schema)
readConfig (cfgFileName)
applyConfig (seq)
getConfigurations ()
Get list of configurations.
getDeclarations ()
Get list of declarations.
getRules ()
Retrieves the rule dictionary as defined by the current schema/configuration.
getOpaque (name)
Retrieves the named opaque data included in the schema.

Detailed Description

GLAST HSK node Record.

Definition at line 36 of file gHSK.py.

Member Function Documentation

__init__ ( client )

Initialize valid attributes as Gattrs.

Assign default values to members

downHAEM ( )

Navigate to the HAEM node.

Returns:
The HAEM object instance

downHCOM ( )

Navigate to the HCOM node.

Returns:
The HCOM object instance

downHCPU ( )

Navigate to the HCPU node.

Returns:
The HCPU object instance

downHEBM ( )

Navigate to the HEBM node.

Returns:
The HEBM object instance

downHGEM ( )

Navigate to the HGEM node.

Returns:
The HGEM object instance

downHNUL ( )

Navigate to the HNUL node.

Returns:
The HNUL object instance

downHPDU ( childId )

Navigate to the HPDU node.

Returns:
The HPDU object instance

downHTEM ( childId )

Navigate to the HTEM indicated by childId.

Parameters:
childId The id of the child HTEM
Returns:
A HARC object instance

existsHAEM ( )

Check if the HAEM instance exists in the schema.

Returns:
True if it exists, False if it doesn't.

existsHCOM ( )

Check if the HCOM instance exists in the schema.

Returns:
True if it exists, False if it doesn't.

existsHCPU ( )

Check if the HCPU instance exists in the schema.

Returns:
True if it exists, False if it doesn't.

existsHEBM ( )

Check if the HEBM instance exists in the schema.

Returns:
True if it exists, False if it doesn't.

existsHGEM ( )

Check if the HGEM instance exists in the schema.

Returns:
True if it exists, False if it doesn't.

existsHPDU ( hpduID )

Check if the HPDU instance exists in the schema.

Returns:
True if it exists, False if it doesn't.

existsHTEM ( temID )

Check if the HTEM instance with the id temID exists in the schema.

Parameters:
temID ACD readout controller id
Returns:
1 if it exists, 0 if it doesn't.

getConfigurations ( )

Get list of configurations.

Return a list of configuration tuples where each tuple contains the configDOM, configName and configRelease.

Returns:
Configuration tuple list.

getDeclarations ( )

Get list of declarations.

Return a list of declarations

Returns:
Declarations.

getOpaque ( name )

Retrieves the named opaque data included in the schema.

Parameters:
name Name of the opaque XML data
Returns:
A list of XML DOM objects matching name

Reimplemented from Gdb.

getRules ( )

Retrieves the rule dictionary as defined by the current schema/configuration.

Returns:
Dictionary containing Grule objects (or its descendants).

The documentation for this class was generated from the following file:
  • gHSK.py
Generated on Fri Jul 21 13:27:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GHSKTrendMap Class Reference

TrendMaps.GHSKTrendMap

GHSKTrendMap Class Reference

Inheritance diagram for GHSKTrendMap:

[legend]
Collaboration diagram for GHSKTrendMap:

[legend]
List of all members.

Detailed Description

Definition at line 17 of file TrendMaps.py.

The documentation for this class was generated from the following file:
  • TrendMaps.py
Generated on Fri Jul 21 13:28:05 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GLAT Class Reference

gLAT.GLAT

GLAT Class Reference

GLAST LAT node Record. More...

Inheritance diagram for GLAT:

[legend]
Collaboration diagram for GLAT:

[legend]
List of all members.

Public Member Functions

__init__ (client)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)
readSchema (name)
writeSchema (fileName)
writeConfig (fileName, seq=None)
takeSnapshot (stream, fileName, captureGTIC, captureGAEQ, trigger, configName, configVersion)
readConfig (cfgFileName)
applyConfig (seq=None, gxbrd=None)
getSysReg (node, regName)
Returns the system register value applied.
downTEM (childId)
Navigate to the GTEM indicated by childId.
allTEM ()
Navigate to the GTEM broadcast node.
downPDU (childId)
Navigate to the GPDU indicated by childId.
downAEM ()
Navigate to the GAEM.
downGEM ()
Navigate to the GGEM.
downEBM ()
Navigate to the GEBM.
downLCB ()
Navigate to the GLCB.
downCRU ()
Navigate to the GCRU.
TEMcnt ()
Return the TEM count.
existsTEM (temId)
Check if the GTEM instance with the id temId exists in the schema.
existsPDU (pduId)
Check if the GPDU instance with the id pduId exists in the schema.
existsAEM ()
Check if the GAEM instance exists in the schema.
existsGEM ()
Check if the GGEM instance exists in the schema.
existsEBM ()
Check if the GEBM instance exists in the schema.
existsCRU ()
Check if the GCRU instance exists in the schema.
existsLCB ()
Check if the GLCB instance exists in the schema.
getConfigurations ()
Get list of configurations.
getDeclarations ()
Get list of declarations.
getRules ()
Retrieves the rule dictionary as defined by the current schema/configuration.
getAllOpaque ()
Return all opaque data.
getAllSerialNos ()
Return all opaque data.
getAllExcludeFlags ()
Return all exclude data.

Detailed Description

GLAST LAT node Record.

The GLAT node provides access to parity registers and event statistics registers.

Valid Registers:

  • parity_latp_cell_header
  • parity_latp_cell_body
  • parity_tem_cmd_str
  • parity_tem_access_desc
  • parity_tem_cmd_payload
  • stats_failed_events
  • stats_failed_event_sends
  • stats_valid_events
  • stats_discarded_event_sends
  • stats_length_mismatch_count
  • stats_events_not_sent

Deprecated:
  • parity_latp_cell_header Use 'LCB.parity_latp_cell_header' instead
  • parity_latp_cell_body Use 'LCB.parity_latp_cell_body' instead
  • stats_failed_events Use 'OCS.stats_failed_events' instead
  • stats_failed_event_sends Use 'OCS.stats_failed_event_sends' instead
  • stats_valid_events Use 'OCS.stats_valid_events' instead
  • stats_discarded_event_sends Use 'OCS.stats_discarded_event_sends' instead
  • stats_length_mismatch_count Use 'OCS.stats_length_mismatch_count' instead
  • stats_events_not_sent Use 'OCS.stats_events_not_sent' instead

Event statistics:

The following statistics registers are initialized at the start of each RunControl run:

  • stats_failed_events -- Counts events where the eventHandler receives a bad status for the event.

  • stats_failed_event_sends -- Counts events where the socket send failed with an error other than EWOULDBLOCK.

  • stats_valid_events -- Counts when a valid event has been successfully sent to the client.

  • stats_discarded_event_sends -- Counts cases when an event send failed due to the fact that the send returned an EWOULDBLOCK error.

  • stats_length_mismatch_count -- Counts cases when the length argument passed to the event handler did not match the length provided in the event header.

  • stats_events_not_sent -- Counts when the event mode is set to DONOT_SEND_EVENTS where the incoming events will not be forwarded to the client over the socket.

Definition at line 135 of file gLAT.py.

Member Function Documentation

__init__ ( client )

Initialize valid registers as Gattrs.

Assign default values to members

allTEM ( )

Navigate to the GTEM broadcast node.

Returns:
the GTEM broadcast node instance

downAEM ( )

Navigate to the GAEM.

Returns:
the GAEM object instance

downCRU ( )

Navigate to the GCRU.

Returns:
the GCRU object instance

downEBM ( )

Navigate to the GEBM.

Returns:
the GEBM object instance

downGEM ( )

Navigate to the GGEM.

Returns:
the GGEM object instance

downLCB ( )

Navigate to the GLCB.

Returns:
the GLCB object instance

downPDU ( childId )

Navigate to the GPDU indicated by childId.

Parameters:
childId The id of the child PDU
Returns:
a GPDU object instance

downTEM ( childId )

Navigate to the GTEM indicated by childId.

Parameters:
childId The id of the child TEM
Returns:
a GTEM object instance

existsAEM ( )

Check if the GAEM instance exists in the schema.

Returns:
1 if it exists, 0 if it doesn't.

existsCRU ( )

Check if the GCRU instance exists in the schema.

Returns:
1 if it exists, 0 if it doesn't.

existsEBM ( )

Check if the GEBM instance exists in the schema.

Returns:
1 if it exists, 0 if it doesn't.

existsGEM ( )

Check if the GGEM instance exists in the schema.

Returns:
1 if it exists, 0 if it doesn't.

existsLCB ( )

Check if the GLCB instance exists in the schema.

Returns:
1 if it exists, 0 if it doesn't.

existsPDU ( pduId )

Check if the GPDU instance with the id pduId exists in the schema.

Parameters:
pduId PDU id
Returns:
1 if it exists, 0 if it doesn't.

existsTEM ( temId )

Check if the GTEM instance with the id temId exists in the schema.

Parameters:
temId TEM id
Returns:
1 if it exists, 0 if it doesn't.

getAllExcludeFlags ( )

Return all exclude data.

Returns:
All exclude data regardless of the node they are associated with.

getAllOpaque ( )

Return all opaque data.

Returns:
All opaque data regardless of the node they are associated with.

getAllSerialNos ( )

Return all opaque data.

Returns:
All serial number data regardless of the node they are associated with.

getConfigurations ( )

Get list of configurations.

Return a list of configuration tuples where each tuple contains the configDOM, configName and configRelease.

Returns:
Configuration tuple list.

getDeclarations ( )

Get list of declarations.

Return a list of declarations

Returns:
Declarations.

getRules ( )

Retrieves the rule dictionary as defined by the current schema/configuration.

Returns:
Dictionary containing Grule objects (or its descendants).

getSysReg | ( | node | ,
 |  | regName |
 | ) |

Returns the system register value applied.

The value of the register applied in the configuration and specified by node and regName is returned.

Returns:
Register value or None

TEMcnt ( )

Return the TEM count.

Returns:
Current TEM count

The documentation for this class was generated from the following file:
  • gLAT.py
Generated on Fri Jul 21 13:27:06 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GLATTrendMap Class Reference

TrendMaps.GLATTrendMap

GLATTrendMap Class Reference

Inheritance diagram for GLATTrendMap:

[legend]
Collaboration diagram for GLATTrendMap:

[legend]
List of all members.

Detailed Description

Definition at line 21 of file TrendMaps.py.

The documentation for this class was generated from the following file:
  • TrendMaps.py
Generated on Fri Jul 21 13:28:05 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GLCB Class Reference

gLCB.GLCB

GLCB Class Reference

LCB node. More...

Inheritance diagram for GLCB:

[legend]
Collaboration diagram for GLCB:

[legend]
List of all members.

Public Member Functions

__init__ (client)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)
setEvtEnable (enable)
Sets the LCB event enable bit to true or false.
start (lcbmask)
start_wait (lcbmask, timeout)
switch (lcbmask)
switch_wait (timeout)
state ()

Detailed Description

LCB node.

Has GLCB specific registers and dataless commands.

Valid Registers:

  • parity_latp_cell_header
  • parity_latp_cell_body
  • back_pressure_once
  • back_pressure
  • board_id

Definition at line 20 of file gLCB.py.

Member Function Documentation

setEvtEnable ( enable )

Sets the LCB event enable bit to true or false.

Parameters:
enable boolean.

The documentation for this class was generated from the following file:
  • gLCB.py
Generated on Fri Jul 21 13:27:06 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GLCBSTATS Class Reference

gLCB.GLCBSTATS

GLCBSTATS Class Reference

LCB stats access. More...

Inheritance diagram for GLCBSTATS:

[legend]
Collaboration diagram for GLCBSTATS:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid registers as Gattrs.
read (reg)
reset ()

Detailed Description

LCB stats access.

Has stats-specific registers

Valid Registers:

  • packets_received Number of event packets received
  • body_parity_error Latched data cell parity error
  • header_parity_error Latched data header parity error
  • latp_address_error Improperly addressed packet rejected

Definition at line 52 of file gLCB.py.

The documentation for this class was generated from the following file:
  • gLCB.py
Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GlobalPanelImpl Class Reference

GlobalPanelImpl.GlobalPanelImpl

GlobalPanelImpl Class Reference

List of all members.

Public Member Functions

__init__ (rc, common, parent=None, name=None, fl=0)
isrealfile (file)
checkFabricEnable (fabricEnable)
applyPermissions (operator)
loadMSGLogger ()
startEnvMon ()
startBrowser ()
startTriggerDisplay ()
browseExportedFiles ()
fabricPowerControl ()
gpibPowerSupplyControl ()
startUserApp ()
getUserApp (appname=None)
getUserAppTree ()

Detailed Description

Definition at line 21 of file GlobalPanelImpl.py.

Member Function Documentation

isrealfile ( file )

Test if file is on the os filesystem

The documentation for this class was generated from the following file:
  • GlobalPanelImpl.py
Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GMem Class Reference

gMem.GMem

GMem Class Reference

Memory node. More...

Inheritance diagram for GMem:

[legend]
Collaboration diagram for GMem:

[legend]
List of all members.

Public Member Functions

__init__ (client)
Initialize valid registers as Gattrs.
gMEMread (addr, size=4)
gMEMload (addr, val, size=4)
gMEMbusToLocal (space, addr)
gMEMlocalToBus (space, addr)

Detailed Description

Memory node.

Has GMem specific registers

Dataless Commands: none

Definition at line 16 of file gMem.py.

Member Function Documentation

gMEMbusToLocal | ( | space | ,
 |  | addr |
 | ) |

Translate an address in some space to local (PPC) space

Parameters:
space | Bus address space in which addr resides
addr | Bus address to convert
Returns:
A tuple containing the user id, status, local address value and timestamp

gMEMload | ( | addr | ,
 |  | val | ,
 |  | size | = 4
 | ) |

SBC MEM load command

Parameters:
addr | SBC address
val | Value to be set at address addr
size | Addressing used (1=8bit, 2=16bit, 4=32bit, 8=64bit, default is 4)
Returns:
A tuple containing the user id, status and timestamp

gMEMlocalToBus | ( | space | ,
 |  | addr |
 | ) |

Translate an address in local (PPC) space to some space

Parameters:
space | Bus address space in which addr resides
addr | Local address to convert
Returns:
A tuple containing the user id, status, bus address value and timestamp

gMEMread | ( | addr | ,
 |  | size | = 4
 | ) |

SBC MEM read command

Parameters:
addr | SBC address
size | Addressing used (1=8bit, 2=16bit, 4=32bit, 8=64bit, default is 4)
Returns:
A tuple containing the user id, status and value

The documentation for this class was generated from the following file:
  • gMem.py
Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GNAT Class Reference

gNAT.GNAT

GNAT Class Reference

GNAT node Record. More...

Inheritance diagram for GNAT:

[legend]
Collaboration diagram for GNAT:

[legend]
List of all members.

Public Member Functions

__init__ (client)
Initialize valid registers as Gattrs.
initHandle (slot, physAddr)
Initializes a new GNAT handle given a physical VME address.
clearBuffer ()
Zero out the contents of the bundle.
addChannel (channelNo, itemList)
loadFIFO ()
This is a combination of gBndlGetBndl() and gWritePF16v().
flushPlaybackFIFO ()
This is a combination of gFlushPF() and gEnablePF().
flushRecordFIFO ()
This is a combination of gFlushRF() and gEnableRF().
writeFIFO (data)
A wrapper around gWritePF().
writeFIFO32 (data)
A wrapper around gWritePF().
startPlayback ()
This is a wrapper around gStartPB().
setLATpMode (mode)
Sets the running mode of the COMM I/O board based on the boolean value of mode.

Detailed Description

GNAT node Record.

This node contains COMM card related functions. Each GNAT node is associated with one COMM card. A GNAT node can either be instantiated through the createGNATinstance method of GTEM, GAEM or GGLT nodes or it can be instantiated as a standalone node by creating an instance of it and calling its initHandle method with the pysical address of the COMM card. The other parameter that it needs is a slot. A slot is a placeholder for a GNAT handle. There are currently 16 slots available. When calling the createGNATinstance or initHandle methods the desired slot is passed and this is where the handle is stored for the duration of the session. Currently the GNAT node serves to major purposes:

(1) Statistics:

Contains registers for retrieving TX/RX ctrl and data cells as well as RX header parity and TX busy assert flags.

(2) Pattern generator functionality:

It is possible to use the exposed methods and registers to write bit streams to the COMM card. This functionality is available mostly for internal testing and should not be of and particular use to the subsystems.

Definition at line 35 of file gNAT.py.

Member Function Documentation

__init__ ( client )

Initialize valid registers as Gattrs.

Assign default values to members

Usage:

      gn = GNAT()

addChannel | ( | channelNo | ,
 |  | itemList |
 | ) |

Inserts data into a channel

Parameters:
channelNo | The channel number (0 - 15) to insert the chnlData into. The maximum channel number is defined in GNAT/gnat.h as MAX_CHANNEL.
itemList | A sequence of 32-bit words. The maximum number of words in the array is 5.
Returns:
Status
Usage:
      data = [0xdeadbeefL, 0xdeadbeefL, 0xdeadbeefL]
      gn.addChannel(channelNo=1, itemList=data)

clearBuffer ( )

Zero out the contents of the bundle.

Calls gBndlClear( gh);

Returns:
Status

flushPlaybackFIFO ( )

This is a combination of gFlushPF() and gEnablePF().

Flushes the playback FIFO.

Returns:
Status

flushRecordFIFO ( )

This is a combination of gFlushRF() and gEnableRF().

Flushes the record FIFO.

Returns:
Status

initHandle | ( | slot | ,
 |  | physAddr |
 | ) |

Initializes a new GNAT handle given a physical VME address.

Parameters:
slot | A number between 0 and 15 to hold the GNAT handle. Each GNAT handle should be assigned a unique slot number. The GNAT handle persists at that slot while the session is active.
physAddr | Physical VME address of the COMM card.
Returns:
Status
Usage:
      gn = GNAT()
      gn.setCmd(lat.getCmd())
      gn.initHandle(0, 0x08000000)

loadFIFO ( )

This is a combination of gBndlGetBndl() and gWritePF16v().

It transfers the data from the intermediate bundle buffer into the playback FIFO.

Returns:
Status

setLATpMode ( mode )

Sets the running mode of the COMM I/O board based on the boolean value of mode.

When mode is non-zero the mode bit of the COMM I/O control register is set to 1, which puts the board in "LATp mode". When mode is zero the mode bit is cleared, which puts the board in "dumb record FIFO mode".

Parameters:
mode The running mode of the COMM I/O board
Returns:
Status
Usage:
      gn.setLATpMode(0)

startPlayback ( )

This is a wrapper around gStartPB().

Starts the playback.

Returns:
Status
Usage:
      gn.startPlayback()

writeFIFO ( data )

A wrapper around gWritePF().

So user could write a single word to the FIFO or the user could prepare their own array of words, bypassing the bundle/channel interface.

Parameters:
data A single or a sequence of 16-bit words
Returns:
Status
Usage:
      data = [0xa0a0, 0xb0b0, 0xc0c0]
      gn.writeFIFO(data)
      data = 0x1234
      gn.writeFIFO(data)

writeFIFO32 ( data )

A wrapper around gWritePF().

So user could write a single word to the FIFO or the user could prepare their own array of words, bypassing the bundle/channel interface.

Parameters:
data A single or a sequence of 16-bit words
Returns:
Status
Usage:
      data = [0xa0a0a0a0L, 0xdeadbeefL, 0xc0c0c0c0L]
      gn.writeFIFO32(data)
      data = 0x12345678L
      gn.writeFIFO(data)

The documentation for this class was generated from the following file:
  • gNAT.py
Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GOCS Class Reference

gOCS.GOCS

GOCS Class Reference

OCS node. More...

Inheritance diagram for GOCS:

[legend]
Collaboration diagram for GOCS:

[legend]
List of all members.

Public Member Functions

__init__ (client)
read (reg)
load (reg, value)
evtHandlerSendAll ()
Sets the current event mode to send all events to the client.
evtHandlerSendNothing ()
Sets the current event mode to send no data events to the client.
evtHandlerSendErrorsOnly ()
Sets the current event mode to send only error events to the client.
evtHandlerSendAcdScalers (marker, prescale=0)
Sets the current event mode to send only events containing the ACD software scalers to the client upon recept of the given marker. All marker zero events are accumulated by the scaler code. If an event is triggered with the specified marker, the scaler data will be delivered with that event. Thus, if the specified marker is zero, then all data events will be accompanied by the scaler data. In addition, marker zero events can be prescaled before delivery to the client. A prescale value of zero (the default) delivers every marker zero event. A prescale value of 0xffffffffL disables prescaling and delivers no events.
evtHandlerSendPrescaled (prescale)
Sets the current event mode to send prescaled events to the client. A prescale value of zero delivers every event. A prescale value of 0xffffffffL disables prescaling and delivers no events.
evtHandlerPrescaleExternal (prescale)
Sets the current event mode to prescale externally triggered events. Only events with only the external trigger firing will be prescaled. A prescale value of zero delivers every event. A prescale value of 0xffffffffL disables prescaling and delivers no events.
evtHandlerFilterTkrHits (lowThreshold=0, towerMask=0xffff, highThreshold=0xffffffffL, prescale=0xffffffffL)
Sets the current event mode to the Tracker Hit Filter.
evtHandlerSetVerbosity (verbosity)
Sets the event server verbosity.
evtClearEvtSeqMSW ()
Clears the event sequence counter.
synchronize ()
Synchronize the SBC's clock with the host's clock.
getCallbackParams ()
Return a dictionary of the parameters used in the active OES callback.
getVersion ()
Get the protocol versions of code running on the SBC.
getStartupScriptInfo ()
Retrieve CVS
Id
gOCS.py,v 2.29 2005/06/23 23:54:48 perazzo Exp
info for the startup script.
verifyVersion ()
Verify that the protocol version of the code running on the SBC is one the host code is expected to support.
cmxAsBuilt ()

Detailed Description

OCS node.

Has OCS specific registers and methods.

Valid Registers:

  • stats_failed_events
  • stats_failed_event_sends
  • stats_valid_events
  • stats_discarded_event_sends
  • stats_length_mismatch_count
  • stats_events_not_sent
  • stats_filter_pkt_errors
  • stats_filter_src_errors
  • stats_filter_passes
  • stats_filter_fails
  • stats_handled_events

Event statistics:

The following statistics registers are initialized at the start of each RunControl run:

  • stats_failed_events -- Counts events where the eventHandler receives a bad status for the event.

  • stats_failed_event_sends -- Counts events where the socket send failed with an error other than EWOULDBLOCK.

  • stats_valid_events -- Counts when a valid event has been successfully sent to the client.

  • stats_discarded_event_sends -- Counts cases when an event send failed due to the fact that the send returned an EWOULDBLOCK error.

  • stats_length_mismatch_count -- Counts cases when the length argument passed to the event handler did not match the length provided in the event header.

  • stats_events_not_sent -- Counts when an event is not sent over the socket due a filter or a scaler.

  • stats_filter_pkt_errors -- Counts when the filtered event has a packet error in its contribution.

  • stats_filter_src_errors -- Counts when the filtered event has a source error in its contribution.

  • stats_filter_passes -- Counts when the event goes through the filter.

  • stats_filter_fails -- Counts when the event fails the filter.

  • stats_handled_events -- Counts when the event is received by the SBC event handler.

Definition at line 68 of file gOCS.py.

Member Function Documentation

evtHandlerFilterTkrHits | ( | lowThreshold | = 0,
 |  | towerMask | = 0xffff,
 |  | highThreshold | = 0xffffffffL,
 |  | prescale | = 0xffffffffL
 | ) |

Sets the current event mode to the Tracker Hit Filter.

The Tracker Hit Filter filters events based on the number of hits in the tracker. Only events with no errors will be filtered.

The filter algorithm sums up the number of hits found in the tracker contributions of the towers given in the towerMask and requires this total number of hits to be greater than or equal to the lowThreshold value and less than or equal to the highThreshold value in order to send the event downstream. The default threshold values allow all events to pass the filter, i.e., the default low threshold is zero, and the default high threshold is larger than the full LAT can generate.

The towerMask value is constructed by setting the bit at the position corresponding to the tower address of the tower to be included. Bit zero is the least significant, right-most bit and corresponds to the tower with LATp address zero. By default, all 16 towers are included in the filter calculation.

A prescale can be applied to allow a fraction of the events that don't pass the TKR hit filter through. If the prescale value is zero, the TKR hit filter is ignored. If the prescale value is 0xffffffffL (the default), prescaling is disabled and filtering is determined by the TKR hit filter. If prescaling is enabled, every event is considered for prescaling, not just the events that fail the TKR hit filter.

Parameters:
lowThreshold | - Minimum number of TKR hits needed to pass the event downstream
towerMask | - Mask of the towers participating in the filter
highThreshold | - Maximum number of TKR hits allowed to pass the event downstream
prescale | - Prescale value to use

evtHandlerPrescaleExternal ( prescale )

Sets the current event mode to prescale externally triggered events. Only events with only the external trigger firing will be prescaled. A prescale value of zero delivers every event. A prescale value of 0xffffffffL disables prescaling and delivers no events.

Parameters:
prescale - Prescale value to use

evtHandlerSendAcdScalers | ( | marker | ,
 |  | prescale | = 0
 | ) |

Sets the current event mode to send only events containing the ACD software scalers to the client upon recept of the given marker. All marker zero events are accumulated by the scaler code. If an event is triggered with the specified marker, the scaler data will be delivered with that event. Thus, if the specified marker is zero, then all data events will be accompanied by the scaler data. In addition, marker zero events can be prescaled before delivery to the client. A prescale value of zero (the default) delivers every marker zero event. A prescale value of 0xffffffffL disables prescaling and delivers no events.

Parameters:
marker | - Marker to value to use
prescale | - Prescale value to use

evtHandlerSendPrescaled ( prescale )

Sets the current event mode to send prescaled events to the client. A prescale value of zero delivers every event. A prescale value of 0xffffffffL disables prescaling and delivers no events.

Parameters:
prescale - Prescale value to use

evtHandlerSetVerbosity ( verbosity )

Sets the event server verbosity.

Parameters:
verbosity - Verbosity value to use

getStartupScriptInfo ( )

Retrieve CVS

Id
gOCS.py,v 2.29 2005/06/23 23:54:48 perazzo Exp
info for the startup script.

Returns:
A list of CVS related info in the form: [filename, version, date, time, user]

The documentation for this class was generated from the following file:
  • gOCS.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GOSEDCALImpl Class Reference

GOSEDCALImpl.GOSEDCALImpl

GOSEDCALImpl Class Reference

List of all members.

Public Member Functions

relabel ()

Detailed Description

Definition at line 9 of file GOSEDCALImpl.py.

The documentation for this class was generated from the following file:
  • GOSEDCALImpl.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GOSEDCALTKRImpl Class Reference

GOSEDCALTKRImpl.GOSEDCALTKRImpl

GOSEDCALTKRImpl Class Reference

List of all members.

Public Member Functions

__init__ (preferences, parent, name=None, fl=0)
relabel ()

Detailed Description

Definition at line 9 of file GOSEDCALTKRImpl.py.

The documentation for this class was generated from the following file:
  • GOSEDCALTKRImpl.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GOSEDDataImpl Class Reference

GOSEDDataImpl.GOSEDDataImpl

GOSEDDataImpl Class Reference

List of all members.

Public Member Functions

__init__ (gui, parent=None, name=None, fl=0)
formatCALview ()
formatTKRview ()
formatDiagCALview ()
formatDiagTKRview ()
showEvent (se)

Detailed Description

Definition at line 12 of file GOSEDDataImpl.py.

The documentation for this class was generated from the following file:
  • GOSEDDataImpl.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GOSEDPreferencesImpl Class Reference

GOSEDPreferencesImpl.GOSEDPreferencesImpl

GOSEDPreferencesImpl Class Reference

Class for managing a GOSED user's preferences. More...

List of all members.

Public Member Functions

__init__ (confParser, parent=None, name=None, modal=0, fl=0)
changeStepValue ()
setCustomEnabled (status)
setCustomEnabled2 (status)
setACDCustomEnabled (status)
selectScale ()
selectScale2 ()
selectScaleACD ()
minCAL ()
maxCAL ()
minCAL2 ()
maxCAL2 ()
minACD ()
maxACD ()
twr (hide=None)
calTkr (hide=None)
data (hide=None)
tkr (hide=None)
acd (hide=None)
cal (hide=None)
ted (hide=None)
selectACDPeds ()
selectCALPeds ()
selectACDPedsFile ()
selectCALPedsFile ()
getPedsFile ()
saveGOSED ()
saveViews ()
saveGOSEDSize ()
getAcdPeds ()
getCalPeds ()
readPedestals ()

Detailed Description

Class for managing a GOSED user's preferences.

! GOSED keeps a user's preferences information in a file that is called .gosedrc when os.name returns 'posix', and gosed.cfg otherwise, e.g. Windows. If the file doesn't exist, a set of defaults are used. These will be written to a file in the gosed source directory if it is writable. GOSED searches for the preferences file in the following directories in the order specified: the current directory, the directory pointed to by the HOME environment variable, and the gosed source directory.

Definition at line 26 of file GOSEDPreferencesImpl.py.

Member Function Documentation

getAcdPeds ( )

Returns the numarray of Acd pedestals Array shape is (12,18,2,2) (cable, channel, range, mean/rms)

getCalPeds ( )

Returns the numarray of Cal pedestals Array shape is (16,8,12,2,4,2) (tower, layer, column, end, range, mean/rms)

getPedsFile ( )

Calls getOpenFileName() with 'ANCILLARY_ROOT' as default to pick up the Pedestal File name.

readPedestals ( )

Retrieve pedestals from file. Needs ANCILLARY_ROOT in environment and assumes pedestal files are in ${ANCILLARY_ROOT}/Consumer/acdPeds.txt and calPeds.txt

selectACDPeds ( )

Operates the widget behaviour for the ACD Pedestal File type selection, default or custom.

selectACDPedsFile ( )

Calls getPedsFile to obtain the ACD Pedestal File name and passes it to the corresponding widget.

selectCALPeds ( )

Operates the widget behaviour for the CAL Pedestal File type selection, default or custom.

selectCALPedsFile ( )

Calls getPedsFile to obtain the CAL Pedestal File name and passes it to the corresponding widget.

The documentation for this class was generated from the following file:
  • GOSEDPreferencesImpl.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GOSEDTKRImpl Class Reference

GOSEDTKRImpl.GOSEDTKRImpl

GOSEDTKRImpl Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, fl=0)

Detailed Description

Definition at line 8 of file GOSEDTKRImpl.py.

The documentation for this class was generated from the following file:
  • GOSEDTKRImpl.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GOSEDTWRImpl Class Reference

GOSEDTWRImpl.GOSEDTWRImpl

GOSEDTWRImpl Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, fl=0)

Detailed Description

Definition at line 8 of file GOSEDTWRImpl.py.

The documentation for this class was generated from the following file:
  • GOSEDTWRImpl.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GPDU Class Reference

gPDU.GPDU

GPDU Class Reference

PDU Controller. More...

Inheritance diagram for GPDU:

[legend]
Collaboration diagram for GPDU:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent, id)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)
send (cmd)
downPEQ ()
Navigate to the GPEQ (PDU environmental monitors).
existsPEQ ()
Check if the GPEQ instance exists in the schema.

Detailed Description

PDU Controller.

Valid Registers:

  • configuration
  • address
  • cr_statistics
  • crates
  • tems
  • acd
  • monitor

Dataless commands:

  • cmd_nop
  • cmd_reset

Definition at line 27 of file gPDU.py.

Member Function Documentation

__init__ | ( | client | ,
 |  | parent | ,
 |  | id |
 | ) |

Initialize valid registers as Gattrs.

Assign default values to members

downPEQ ( )

Navigate to the GPEQ (PDU environmental monitors).

Returns:
A GPEQ object instance

existsPEQ ( )

Check if the GPEQ instance exists in the schema.

Returns:
1 if it exists, 0 if it doesn't.

The documentation for this class was generated from the following file:
  • gPDU.py
Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GPEQ Class Reference

gPDU.GPEQ

GPEQ Class Reference

PDU Environmental Monitors. More...

Inheritance diagram for GPEQ:

[legend]
Collaboration diagram for GPEQ:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid registers as Gattrs.
read (reg)

Detailed Description

PDU Environmental Monitors.

Has GPEQ specific registers and dataless commands.

Valid Registers:

  • adcs_00_07
  • adcs_08_15
  • adcs_16_19

Definition at line 65 of file gPDU.py.

Member Function Documentation

__init__ | ( | client | ,
 |  | parent |
 | ) |

Initialize valid registers as Gattrs.

Assign default values to members

The documentation for this class was generated from the following file:
  • gPDU.py
Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GpibPwrCtrlImpl Class Reference

GpibPwrCtrlImpl.GpibPwrCtrlImpl

GpibPwrCtrlImpl Class Reference

List of all members.

Public Member Functions

readPowerConfig ()
loadConfig (cfgFilename)
initGPIB ()
checkOutputEnable ()
applyData (type)
readData (type)
resetDevice ()
enableOutput ()
disableOutput ()
updateError ()
clearReadout ()
clearSettings ()
updateReadout ()
parserToScreen (confParser)
releaseGpib ()
startTimer ()
stopTimer ()
showEvent (e)
closeEvent (e)
shutdown ()
unregisterExitHandler ()
normalCursor ()
waitCursor ()

Detailed Description

Definition at line 16 of file GpibPwrCtrlImpl.py.

The documentation for this class was generated from the following file:
  • GpibPwrCtrlImpl.py
Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GroupPanel Class Reference

PorcinePanel.GroupPanel

GroupPanel Class Reference

Inheritance diagram for GroupPanel:

[legend]
List of all members.

Public Member Functions

constructGrid ()
constructControls ()
setModule (tag, module)
setEnables (enables)
getSelect ()
setStatus (statusmap)
setAllSelect (select, name='')

Detailed Description

Definition at line 90 of file PorcinePanel.py.

The documentation for this class was generated from the following file:
  • PorcinePanel.py
Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Grule Class Reference

gRule.Grule

Grule Class Reference

Base class for describing rules. More...

Inheritance diagram for Grule:

[legend]
Collaboration diagram for Grule:

[legend]
List of all members.

Public Member Functions

__init__ (name, subsystem, category, enabled, continuous=False)
_eval_ (value, attr, node)
evaluate (value, attr, node=None)
name ()
subsystem ()
category ()
enabled ()
enable ()
disable ()
reset (node=None)
fire (node=None)
fired (node=None)
registerAction (action, method, sender=dispatcher.Any)
setActions (actions)
sendAction (action, sender, arguments, named)
clearAllActions ()
unregisterAction (action, method, sender=dispatcher.Any)

Detailed Description

Base class for describing rules.

Definition at line 21 of file gRule.py.

Member Function Documentation

__init__ | ( | name | ,
 |  | subsystem | ,
 |  | category | ,
 |  | enabled | ,
 |  | continuous | = False
 | ) |

Constructor.

Parameters:
name | Rule name
subsystem | Subsystem gGroup to which the rule belongs
category | Category gGroup to which the rule belongs
enabled | Flag indicating whether rule is enabled
continuous | Flag indicating whether rule can fire repeatedly

_eval_ | ( | value | ,
 |  | attr | ,
 |  | node |
 | ) |

Base method called from derived classes. determine whether or not this rule can fire or not.

Returns:
a tuple containing the value of the test and whether the rule can fire or not.

Reimplemented in GruleLimit, and GruleAlarms.

category ( )

Method for discovering this rule's category

Returns:
Rule's category.

clearAllActions ( )

Forces all registered actions to be cleared. If this is not done and the scripts re-register their actions there may be extraneous rule action firings.

disable ( )

Method used to disable evaluation of this rule

enable ( )

Method used to enable evaluation of this rule

enabled ( )

Method for discovering whether this rule is enabled

Returns:
Whether this rule is enabled or not.

evaluate | ( | value | ,
 |  | attr | ,
 |  | node | = None
 | ) |

This method is called to evaluate the rule on 'value'

Parameters:
value | Value to be evaluated.
attr | Attribute object whose value is being evaluated.
Returns:
Result of the evaluation, if any.

Reimplemented from GruleBase.

fire ( node = None )

Method used to tell the rule it has fired

fired ( node = None )

Method for discovering whether this rule has fired

Returns:
Whether this rule has fired or not

name ( )

Method to retrieve the rule's name

Returns:
Rule's name.

registerAction | ( | action | ,
 |  | method | ,
 |  | sender | = dispatcher.Any
 | ) |

Associate and action with a user method, optionally specifying a sender. If a sender is not specified, the rule action may be fired for all registers which declare its rule to be the rule of this action. If an attribute is specified as the sender then only if the evaluation of that specific attribute causes the action to be fired the method will be called.

Parameters:
action | A string that represents the action to be taken. This is specified under the <actions> tag in the schema/configuration.
method | A user method visible to the current context.
sender | Optional parameter that specifies the sender of the action registration. If specifed, only the sendAction requests which specify the same sender will be honored. Defaults to dispatcher.Any.

reset ( node = None )

Method used to reenable evaluation of this rule in the case of noncontinuous mode after it has been violated

sendAction | ( | action | ,
 |  | sender | ,
 |  | arguments | ,
 |  | named |
 | ) |

Called from the rule evaluation method to fire the appropriate alarm action.

Parameters:
action | A string that represents the action to be taken. This is specified under the <actions> tag in the schema/configuration.
sender | The sender that made the rule firing request. This is usually the attribute which is being evaluated.
*arguments | An optional list of arguments which gets passed to the action method.
Returns:
A list of tuple pairs [(receiver, response), ... ]

setActions ( actions )

Convenience method that gets called from the rule constructor that defines the action names (which is read from the schema/configuration).

Parameters:
actions A list containing the action names.

subsystem ( )

Method for discovering this rule's subsystem

Returns:
Rule's subsystem.

unregisterAction | ( | action | ,
 |  | method | ,
 |  | sender | = dispatcher.Any
 | ) |

Reverse of registerAction, disassociates the action from the method.

Parameters:
action | A string that represents the action to be taken. This is specified under the <actions> tag in the schema/configuration.
method | A user method visible to the current context.
sender | Optional parameter that specifies the sender of the action registration. If specifed, only the sendAction requests which specify the same sender will be honored. Defaults to dispatcher.Any.

The documentation for this class was generated from the following file:
  • gRule.py
Generated on Fri Jul 21 13:27:10 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GruleAlarms Class Reference

gRule.GruleAlarms

GruleAlarms Class Reference

Alarm rule. More...

Inheritance diagram for GruleAlarms:

[legend]
Collaboration diagram for GruleAlarms:

[legend]
List of all members.

Public Member Functions

__init__ (name, subsystem, category, enabled, continuous, yellowUpperLimit, yellowLowerLimit, redUpperLimit, redLowerLimit, actions=[])
_eval_ (value, attr, node)

Detailed Description

Alarm rule.

If the value falls below the yellow or red lower limit or it exceeds the yellow or red upped limit the appropriate registered action is fired.

Definition at line 193 of file gRule.py.

Member Function Documentation

__init__ | ( | name | ,
 |  | subsystem | ,
 |  | category | ,
 |  | enabled | ,
 |  | continuous | ,
 |  | yellowUpperLimit | ,
 |  | yellowLowerLimit | ,
 |  | redUpperLimit | ,
 |  | redLowerLimit | ,
 |  | actions | = []
 | ) |

Alarm rule constructor.

Parameters:
name | Rule name
subsystem | Subsystem gGroup to which the rule belongs
category | Category gGroup to which the rule belongs
enabled | Flag indicating whether rule is enabled
continuous | Flag indicating whether rule can fire repeatedly
yellowUpperLimit | Yellow alarm upper limit
yellowLowerLimit | Yellow alarm lower limit
redUpperLimit | Red alarm upper limit
redLowerLimit | Red alarm lower limit

_eval_ | ( | value | ,
 |  | attr | ,
 |  | node |
 | ) |

Alarm rule evaluation method.

If the red alarm is fired then the yellow alarm does not get fired.

Reimplemented from Grule.

The documentation for this class was generated from the following file:
  • gRule.py
Generated on Fri Jul 21 13:27:10 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GruleBase Class Reference

gRule.GruleBase

GruleBase Class Reference

Base rule class for use when no rule is appropriate. More...

Inheritance diagram for GruleBase:

[legend]
List of all members.

Public Member Functions

__init__ ()
evaluate (value, attr, node=None)

Detailed Description

Base rule class for use when no rule is appropriate.

Definition at line 11 of file gRule.py.

The documentation for this class was generated from the following file:
  • gRule.py
Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GruleLimit Class Reference

gRule.GruleLimit

GruleLimit Class Reference

Rule class that limits a passed in value to given limits. More...

Inheritance diagram for GruleLimit:

[legend]
Collaboration diagram for GruleLimit:

[legend]
List of all members.

Public Member Functions

__init__ (name, subsystem, category, enabled, continuous, low, high)
_eval_ (value, attr, node)

Detailed Description

Rule class that limits a passed in value to given limits.

Definition at line 164 of file gRule.py.

Member Function Documentation

__init__ | ( | name | ,
 |  | subsystem | ,
 |  | category | ,
 |  | enabled | ,
 |  | continuous | ,
 |  | low | ,
 |  | high |
 | ) |

Limit rule constructor.

Parameters:
name | Rule name
subsystem | Subsystem gGroup to which the rule belongs
category | Category gGroup to which the rule belongs
enabled | Flag indicating whether rule is enabled
continuous | Flag indicating whether rule can fire repeatedly
low | Low limit
high | High limit

_eval_ | ( | value | ,
 |  | attr | ,
 |  | node |
 | ) |

Evaluate the rule.

Reimplemented from Grule.

The documentation for this class was generated from the following file:
  • gRule.py
Generated on Fri Jul 21 13:27:10 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GSIU Class Reference

gSIU.GSIU

GSIU Class Reference

SIU node. More...

Inheritance diagram for GSIU:

[legend]
Collaboration diagram for GSIU:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent, id)
Initialize valid registers as Gattrs.

Detailed Description

SIU node.

Definition at line 8 of file gSIU.py.

The documentation for this class was generated from the following file:
  • gSIU.py
Generated on Fri Jul 21 13:27:11 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GTCC Class Reference

gTEM.GTCC

GTCC Class Reference

Tracker Cable Controller node record. More...

Inheritance diagram for GTCC:

[legend]
Collaboration diagram for GTCC:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent, id)
read (reg)
load (reg, value)
send (cmd)
downTRC (childId)
Navigate to the GTRC indicated by childId.
allTRC ()
Navigate to the broadcast GTRC.
existsTRC (trcId)
Check if the GTRC instance with the id trcId exists in the schema.

Detailed Description

Tracker Cable Controller node record.

Has GTCC specific registers and dataless commands.

Valid Registers:

  • configuration
  • input_mask
  • fifo_status
  • latched_status
  • event_timeouts
  • trg_alignment

Dataless Commands:

  • cmd_nop
  • cmd_reset

Definition at line 307 of file gTEM.py.

Member Function Documentation

__init__ | ( | client | ,
 |  | parent | ,
 |  | id |
 | ) |

Initialize valid registers as Gattrs.

Assign default values to members

allTRC ( )

Navigate to the broadcast GTRC.

Returns:
The broadcast GTRC object instance

downTRC ( childId )

Navigate to the GTRC indicated by childId.

Parameters:
childId The id of the child GTRC
Returns:
A GTRC object instance

existsTRC ( trcId )

Check if the GTRC instance with the id trcId exists in the schema.

Parameters:
trcId Tracker readout controller id
Returns:
1 if it exists, 0 if it doesn't.

The documentation for this class was generated from the following file:
  • gTEM.py
Generated on Fri Jul 21 13:27:12 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GTEM Class Reference

gTEM.GTEM

GTEM Class Reference

TEM node Record. More...

Inheritance diagram for GTEM:

[legend]
Collaboration diagram for GTEM:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent, id)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)
send (cmd)
downCCC (childId)
Navigate to the GCCC indicated by childId.
downTCC (childId)
Navigate to the GTCC indicated by childId.
allCCC ()
Navigate to the broadcast GCCC.
allTCC ()
Navigate to the broadcast GTCC.
CCCcnt ()
Return the GCCC count.
TCCcnt ()
Return the GTCC count.
downTIC ()
Navigate to the GTIC node.
existsTIC ()
Check if the GTIC instance exists in the schema.
existsCCC (cccId)
Check if the GCCC instance with the id cccId exists in the schema.
existsTCC (tccId)
Check if the GTCC instance with the id tccId exists in the schema.

Detailed Description

TEM node Record.

Valid Registers:

  • configuration
  • data_masks
  • status
  • command_response
  • tkr_trgseq
  • cal_trgseq
  • address

Dataless Commands:

  • cmd_reset
  • cmd_look_at_me

Definition at line 27 of file gTEM.py.

Member Function Documentation

__init__ | ( | client | ,
 |  | parent | ,
 |  | id |
 | ) |

Initialize valid registers as Gattrs.

Assign default values to members

allCCC ( )

Navigate to the broadcast GCCC.

Returns:
The broadcast GCCC object instance

allTCC ( )

Navigate to the broadcast GTCC.

Returns:
The broadcast GTCC object instance

CCCcnt ( )

Return the GCCC count.

Returns:
Current GCCC count

downCCC ( childId )

Navigate to the GCCC indicated by childId.

Parameters:
childId The id of the child GCCC
Returns:
A GCCC object instance

downTCC ( childId )

Navigate to the GTCC indicated by childId.

Parameters:
childId The id of the child GTCC
Returns:
A GTCC object instance

downTIC ( )

Navigate to the GTIC node.

Returns:
The GTIC object instance

existsCCC ( cccId )

Check if the GCCC instance with the id cccId exists in the schema.

Parameters:
cccId Calorimeter cable controller id
Returns:
1 if it exists, 0 if it doesn't.

existsTCC ( tccId )

Check if the GTCC instance with the id tccId exists in the schema.

Parameters:
tccId Tracker cable controller id
Returns:
1 if it exists, 0 if it doesn't.

existsTIC ( )

Check if the GTIC instance exists in the schema.

Returns:
1 if it exists, 0 if it doesn't.

TCCcnt ( )

Return the GTCC count.

Returns:
Current GTCC count

The documentation for this class was generated from the following file:
  • gTEM.py
Generated on Fri Jul 21 13:27:11 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GTest Class Reference

test_db.GTest

GTest Class Reference

Inheritance diagram for GTest:

[legend]
Collaboration diagram for GTest:

[legend]
List of all members.

Public Member Functions

__init__ (client)
read (reg)
load (reg, value)
send (cmd)

Detailed Description

Definition at line 24 of file test_db.py.

The documentation for this class was generated from the following file:
  • test_db.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GTFE Class Reference

gTEM.GTFE

GTFE Class Reference

Tracker Front-End node Record. More...

Inheritance diagram for GTFE:

[legend]
Collaboration diagram for GTFE:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent, id)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)
send (cmd)

Detailed Description

Tracker Front-End node Record.

Has GTFE specific registers and dataless commands.

Valid Registers:

  • data_mask
  • calib_mask
  • trig_mask
  • dac
  • mode

Dataless Commands:

  • cmd_nop
  • cmd_reset
  • cmd_calstrobe
  • cmd_readevent

Definition at line 484 of file gTEM.py.

Member Function Documentation

__init__ | ( | client | ,
 |  | parent | ,
 |  | id |
 | ) |

Initialize valid registers as Gattrs.

Assign default values to members

The documentation for this class was generated from the following file:
  • gTEM.py
Generated on Fri Jul 21 13:27:13 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GTIC Class Reference

gTEM.GTIC

GTIC Class Reference

Trigger Interface Controller. More...

Inheritance diagram for GTIC:

[legend]
Collaboration diagram for GTIC:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid registers as Gattrs.
satCtrEnable (reg)
Enable the specified saturation counter. By default all saturation counters are disabled.
satCtrDisable (reg)
Disable the specified saturation counter. By default all saturation counters are disabled.
satCtrLoopEnable ()
Enable the update loop that updates all saturation counter pseudoregisters.
satCtrLoopDisable ()
Disable the update loop that updates all saturation counter pseudoregisters.
satCtrSetLoopDelay (delay)
Set the update loop interval for saturation counter pseudoregisters.
read (reg)
load (reg, value)
send (cmd)

Detailed Description

Trigger Interface Controller.

Has GTIC specific registers and dataless commands.

Valid Registers:

  • power_supply
  • status
  • cal_in_mask
  • cal_lrs_mask
  • cal_lrs_counters
  • tkr_layer_enable_0
  • tkr_layer_enable_1
  • tkr_out_mask
  • tkr_out_lrs_mask
  • tkr_lrs_counter_0
  • tkr_lrs_counter_1
  • busy_lrs_mask
  • busy_lrs_counter
  • adcs
  • mux_config
  • tkr_biasdac
  • cal_biasdac
  • adc_tkr_digital_2_5v
  • adc_tkr_digital_2_5i
  • adc_tkr_analog_a_1_5v
  • adc_tkr_analog_a_1_5i
  • adc_tkr_analog_b_2_5v
  • adc_tkr_analog_b_2_5i
  • adc_tkr_bias_v
  • adc_tkr_bias_v0
  • adc_tkr_bias_i
  • adc_cal_digital_3_3v
  • adc_cal_digital_3_3i
  • adc_tkr_bias_v1
  • adc_cal_analog_3_3v
  • adc_cal_analog_3_3i
  • adc_cal_bias_v1
  • adc_cal_bias_v
  • adc_cal_bias_v0
  • adc_cal_bias_i
  • adc_28_v0
  • adc_tem_digital_3_3v
  • adc_tem_digital_3_3i
  • adc_28_v1
  • adc_afee0_t0
  • adc_afee0_t1
  • adc_afee1_t0
  • adc_afee1_t1
  • adc_afee2_t0
  • adc_afee2_t1
  • adc_afee3_t0
  • adc_afee3_t1
  • adc_tkr_c0_t0
  • adc_tkr_c0_t1
  • adc_tkr_c1_t0
  • adc_tkr_c1_t1
  • adc_tkr_c2_t0
  • adc_tkr_c2_t1
  • adc_tkr_c3_t0
  • adc_tkr_c3_t1
  • adc_tkr_c4_t0
  • adc_tkr_c4_t1
  • adc_tkr_c5_t0
  • adc_tkr_c5_t1
  • adc_tkr_c6_t0
  • adc_tkr_c6_t1
  • adc_tkr_c7_t0
  • adc_tkr_c7_t1

Deadtime Counters:

  • sat_cal_lrs_ctr_0
  • sat_cal_lrs_ctr_1
  • sat_tkr_lrs_ctr_0
  • sat_tkr_lrs_ctr_1
  • sat_tkr_lrs_ctr_2
  • sat_tkr_lrs_ctr_3
  • sat_deadtime_lrs_ctr

Pseudo Registers:

  • psd_tkr_bias_i
  • psd_cal_bias_i
  • psd_tem_i

Dataless Commands:

  • cmd_nop
  • cmd_reset

Definition at line 592 of file gTEM.py.

Member Function Documentation

satCtrDisable ( reg )

Disable the specified saturation counter. By default all saturation counters are disabled.

Parameters:
reg Register id of the saturation counter. Can be retrieved by calling tic.regs['regname'].id().
Returns:
A Response object

satCtrEnable ( reg )

Enable the specified saturation counter. By default all saturation counters are disabled.

Parameters:
reg Register id of the saturation counter. Can be retrieved by calling tic.regs['regname'].id().
Returns:
A Response object

satCtrLoopDisable ( )

Disable the update loop that updates all saturation counter pseudoregisters.

Returns:
A Response object

satCtrLoopEnable ( )

Enable the update loop that updates all saturation counter pseudoregisters.

Returns:
A Response object

satCtrSetLoopDelay ( delay )

Set the update loop interval for saturation counter pseudoregisters.

Parameters:
Set the saturation counter update loop delay in 1/60 second ticks. The default is 30 (2 Hz).
Returns:
A Response object

The documentation for this class was generated from the following file:
  • gTEM.py
Generated on Fri Jul 21 13:27:13 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GTPG Class Reference

gTPG.GTPG

GTPG Class Reference

Inheritance diagram for GTPG:

[legend]
Collaboration diagram for GTPG:

[legend]
List of all members.

Public Member Functions

clear ()
clearBuf (bufferId)
start ()
startCmd ()
load ()
setTEM (tem_id, trg, start, pattern, pat_len, repetitions)
setVETO (free_id, veto_id, start, pattern, pat_len, repetitions)
setCNO (free_id, start, pattern, pat_len, repetitions)
setExtTrig (start, pattern, pat_len, repetitions)

Detailed Description

Definition at line 6 of file gTPG.py.

The documentation for this class was generated from the following file:
  • gTPG.py
Generated on Fri Jul 21 13:27:13 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GTRC Class Reference

gTEM.GTRC

GTRC Class Reference

Tracker Readout Controller node Record. More...

Inheritance diagram for GTRC:

[legend]
Collaboration diagram for GTRC:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent, id)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)
send (cmd)
downTFE (childId)
Navigate to the GTFE indicated by childId.
allTFE ()
Navigate to the broadcast GTFE.
existsTFE (tfeId)
Check if the GTFE instance with the id tfeId exists in the schema.
getNoisyChannelsByMask (mask, feId=None)
Get the noisy channels for this RC or for a specific FE belonging to this RC based on the mask provided.
getNoisyChannels (feId=None, calib=True, data=True, trig=True)
Get the noisy channels for this RC or for a specific FE belonging to this RC.
getDeadChannelsByMask (mask, feId=None)
Get the dead channels for this RC or for a specific FE belonging to this RC based on the mask provided.
getDeadChannels (feId=None, calib=True, data=True, trig=True)
Get the dead channels for this RC or for a specific FE belonging to this RC.

Detailed Description

Tracker Readout Controller node Record.

Has GTRC specific registers and dataless commands.

Valid Registers:

  • csr
  • sync

Dataless Commands:

  • cmd_nop
  • cmd_reset

Definition at line 366 of file gTEM.py.

Member Function Documentation

__init__ | ( | client | ,
 |  | parent | ,
 |  | id |
 | ) |

Initialize valid registers as Gattrs.

Assign default values to members

allTFE ( )

Navigate to the broadcast GTFE.

Returns:
The broadcast GTFE object instance

downTFE ( childId )

Navigate to the GTFE indicated by childId.

Parameters:
childId The id of the child GTFE
Returns:
A GTFE object instance

existsTFE ( tfeId )

Check if the GTFE instance with the id tfeId exists in the schema.

Parameters:
tfeId Tracker front-end id
Returns:
1 if it exists, 0 if it doesn't.

getDeadChannels | ( | feId | = None,
 |  | calib | = True,
 |  | data | = True,
 |  | trig | = True
 | ) |

Get the dead channels for this RC or for a specific FE belonging to this RC.

Parameters:
feId | Front-end id.
calib | Flag indicating whether calib mask noisy channels should be included.
data | Flag indicating whether data mask noisy channels should be included.
trig | Flag indicating whether trigger mask noisy channels should be included.
Returns:
If feId is None return a list of dead channels. If feId is not None return a bitmap of dead channels.

getDeadChannelsByMask | ( | mask | ,
 |  | feId | = None
 | ) |

Get the dead channels for this RC or for a specific FE belonging to this RC based on the mask provided.

Parameters:
mask | A string containing one of 'calib', 'data' or 'trig'
feId | Front-end id.
Returns:
If feId is None return a list of dead channels. If feId is not None return a bitmap of dead channels.

getNoisyChannels | ( | feId | = None,
 |  | calib | = True,
 |  | data | = True,
 |  | trig | = True
 | ) |

Get the noisy channels for this RC or for a specific FE belonging to this RC.

Parameters:
feId | Front-end id.
calib | Flag indicating whether calib mask noisy channels should be included.
data | Flag indicating whether data mask noisy channels should be included.
trig | Flag indicating whether trigger mask noisy channels should be included.
Returns:
If feId is None return a list of noisy channels. If feId is not None return a bitmap of noisy channels.

getNoisyChannelsByMask | ( | mask | ,
 |  | feId | = None
 | ) |

Get the noisy channels for this RC or for a specific FE belonging to this RC based on the mask provided.

Parameters:
mask | A string containing one of 'calib', 'data' or 'trig'
feId | Front-end id.
Returns:
If feId is None return a list of noisy channels. If feId is not None return a bitmap of noisy channels.

The documentation for this class was generated from the following file:
  • gTEM.py
Generated on Fri Jul 21 13:27:13 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GTWR Class Reference

gXBR.GTWR

GTWR Class Reference

Tower node Record. More...

Inheritance diagram for GTWR:

[legend]
Collaboration diagram for GTWR:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent, id)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)

Detailed Description

Tower node Record.

Valid Registers:

  • adc_ps_temp_0
  • adc_ps_temp_1
  • adc_tem_temp_0
  • adc_tem_temp_1
  • adc_tem_voltage_0
  • adc_tem_voltage_1

Definition at line 106 of file gXBR.py.

Member Function Documentation

__init__ | ( | client | ,
 |  | parent | ,
 |  | id |
 | ) |

Initialize valid registers as Gattrs.

Assign default values to members

The documentation for this class was generated from the following file:
  • gXBR.py
Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GUIbridge Class Reference

guiBridges.GUIbridge

GUIbridge Class Reference

Class for providing a bridge between the GUI thread and other threads. More...

List of all members.

Public Member Functions

__init__ (guiThread)
This is the constructor of the GUIbridge class.
shutdown ()
This method is used to shut the GUI bridge down.
isGUIthread ()
Returns True if this method is being called from the GUI thread.
createGUI (qObject, obj, args, kwargs)
Method used for instantiating a GUI from a non-GUI thread.
execGUImethodNR (qObject, func, args, kwargs)
Method used for executing a GUI function from a non-GUI thread.
execGUImethod (qObject, func, args, kwargs)
Method used for executing a GUI function from a non-GUI thread.
execGUImethod2 (qObject, func, args, kwargs)
handleCustomEvent (e)

Detailed Description

Class for providing a bridge between the GUI thread and other threads.

This bridge is needed whenever a non-GUI thread needs to interact with the GUI. The GUI is handled by the 'GUI thread'. A 'GUI thread' is defined to be the one in which the Qt QApplication class's exec_loop() method is executed. There can be only one GUI thread in a program.

The solution to the problem is handled by sending a message (an 'event', in Qt terms) from the non-GUI thread to the GUI thread. The message contains information on how it is to be handled. In some cases, this handling produces a result that must be sent back to the initiating non-GUI thread. The requests and responses are passed around via queues. Separate queues are maintained for the different non-GUI threads so that responses don't end up handed off to the wrong thread.

Definition at line 28 of file guiBridges.py.

Member Function Documentation

__init__ ( guiThread )

This is the constructor of the GUIbridge class.

It must be called from the GUI thread.

createGUI | ( | qObject | ,
 |  | obj | ,
 |  | args | ,
 |  | kwargs |
 | ) |

Method used for instantiating a GUI from a non-GUI thread.

Parameters:
qObject | - The Qt object that will receive the customEvent callback
obj | - The GUI object class type to create
args | - Arguments for the object class constructor
kwargs | - Keyword arguments for the object class constructor
Returns:
An instance of the requested GUI object class

execGUImethod | ( | qObject | ,
 |  | func | ,
 |  | args | ,
 |  | kwargs |
 | ) |

Method used for executing a GUI function from a non-GUI thread.

Use this method when a response is expected from the function and when it is appropriate to wait for it (no deadlock arises)

Parameters:
qObject | - The Qt object that will receive the customEvent callback
func | - The GUI function or method to call
args | - Arguments for the function or method
kwargs | - Keyword arguments for the function or method
Returns:
The called GUI function's return value

execGUImethodNR | ( | qObject | ,
 |  | func | ,
 |  | args | ,
 |  | kwargs |
 | ) |

Method used for executing a GUI function from a non-GUI thread.

Use this method when no (useful) response is expected or when waiting for one could cause a deadlock. Any response from the function is lost.

Parameters:
qObject | - The Qt object that will receive the customEvent callback
func | - The GUI function or method to call
args | - Arguments for the function or method
kwargs | - Keyword arguments for the function or method

The documentation for this class was generated from the following file:
  • guiBridges.py
Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GUIbridgeTest Class Reference

guiBridges.GUIbridgeTest

GUIbridgeTest Class Reference

List of all members.

Public Member Functions

shutdown ()
run ()

Detailed Description

Definition at line 95 of file guiBridges.py.

The documentation for this class was generated from the following file:
  • guiBridges.py
Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Gversions Class Reference

gVersions.Gversions

Gversions Class Reference

List of all members.

Static Public Member Functions

static | isModuleInReleases (m, rootDirEnvs=None)
static | extractVersion (verStr)
static | calcDigest (filePath)
static | getModuleDigests ()
static | getReleaseFromDigest (digestDataFile=None, rootDirEnv='LATTE_ROOT')
static | logBadMarshalDataMessage ()
static | verifyModuleDigests (digestDataFile=None, rootDirEnv='LATTE_ROOT', additionalFilesToVerify=[])
static | findVersionSymbol (filePath)
Find the __version__ symbol in the file.
static | verifyFileDigests (path=None, rootDirEnv='LATTE_ROOT', digestDataFile=None)
static | collectDigests (path)
static | getHardwareVersions (lat, xbrd=None)
static | printVersions (ocs, lat=None, xbrd=None)

Detailed Description

Definition at line 64 of file gVersions.py.

Member Function Documentation

static extractVersion ( verStr ) [static]

Static class method which extracts the version string from the CVS keyword string, if that's what it appears to be. If it doesn't, just return the input.

static findVersionSymbol ( filePath ) [static]

Find the __version__ symbol in the file.

Parameters:
filePath Full path of the module source code
Returns:
Version number or None if not found.

static getHardwareVersions | ( | lat | ,
 |  | xbrd | = None
 | ) | [static]

Static class method which retrieves hardware versions.

Keyword arguments:

cmd -- optional command client (default None)

The documentation for this class was generated from the following file:
  • gVersions.py
Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GXBRD Class Reference

gXBR.GXBRD

GXBRD Class Reference

Tower controller node Record. More...

Inheritance diagram for GXBRD:

[legend]
Collaboration diagram for GXBRD:

[legend]
List of all members.

Public Member Functions

__init__ (client)
Initialize valid registers as Gattrs.
read (reg)
load (reg, value)
send (cmd)
readSchema (name)
readConfig (cfgFileName)
applyConfig (seq=None)
getConfigurations ()
Get list of configurations.
getDeclarations ()
Get list of declarations.
downGLT ()
Navigate to the GGLT.
existsGLT ()
Check if the GGLT instance exists in the schema.
downTWR (twrId)
Navigate to the GTWR indicated by childId.
existsTWR (twrId)
Check if the GTWR instance with the id twrId exists in the schema.

Detailed Description

Tower controller node Record.

Valid Registers:

  • dac_tem_voltage
  • dac_tkr_analog_2_5
  • dac_tkr_digital_2_5
  • dac_tkr_cal_analog
  • dac_cal_digital_3_3
  • path_cmd_resp_reset
  • path_trigger
  • path_event
  • evt_flow_ctrl

Dataless commands:

  • cmd_tem_hw_reset

Definition at line 30 of file gXBR.py.

Member Function Documentation

__init__ ( client )

Initialize valid registers as Gattrs.

Assign default values to members

downGLT ( )

Navigate to the GGLT.

Returns:
The GGLT object instance

downTWR ( twrId )

Navigate to the GTWR indicated by childId.

Parameters:
childId The id of the child tower
Returns:
A GTWR object instance

existsGLT ( )

Check if the GGLT instance exists in the schema.

Returns:
1 if it exists, 0 if it doesn't.

existsTWR ( twrId )

Check if the GTWR instance with the id twrId exists in the schema.

Parameters:
twrId Tower id
Returns:
1 if it exists, 0 if it doesn't.

getConfigurations ( )

Get list of configurations.

Return a list of configuration tuples where each tuple contains the configDOM, configName and configRelease.

Returns:
Configuration tuple list.

getDeclarations ( )

Get list of declarations.

Return a list of declarations

Returns:
Declarations.

The documentation for this class was generated from the following file:
  • gXBR.py
Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HAEM Class Reference

gHSK.HAEM

HAEM Class Reference

GLAST AEM HSK node Record. More...

Inheritance diagram for HAEM:

[legend]
Collaboration diagram for HAEM:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid housekeeping quantities as Gattrs.
downHARC (arcID)
Navigate to the HARC indicated by arcID.
existsHARC (arcID)
Check if the HARC instance with the id arcID exists in the schema.

Detailed Description

GLAST AEM HSK node Record.

Valid Attributes:

  • FreeI
  • Temperature
  • HVI
  • DAQV
  • CommonStatus
  • CableStatus

Definition at line 277 of file gHSK.py.

Member Function Documentation

downHARC ( arcID )

Navigate to the HARC indicated by arcID.

Parameters:
arcID The id of the child HARC
Returns:
A HARC object instance

existsHARC ( arcID )

Check if the HARC instance with the id arcID exists in the schema.

Parameters:
arcId ACD readout controller id
Returns:
1 if it exists, 0 if it doesn't.

The documentation for this class was generated from the following file:
  • gHSK.py
Generated on Fri Jul 21 13:27:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HARC Class Reference

gHSK.HARC

HARC Class Reference

GLAST ARC HSK node record. More...

Inheritance diagram for HARC:

[legend]
Collaboration diagram for HARC:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent, arcID)
Initialize valid housekeeping quantities as Gattrs.

Detailed Description

GLAST ARC HSK node record.

Valid Attributes:

  • Vdd
  • Temperature
  • HV1
  • HV2

Definition at line 317 of file gHSK.py.

The documentation for this class was generated from the following file:
  • gHSK.py
Generated on Fri Jul 21 13:27:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HCOM Class Reference

gHSK.HCOM

HCOM Class Reference

GLAST Communications statistics HSK node record. More...

Inheritance diagram for HCOM:

[legend]
Collaboration diagram for HCOM:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid housekeeping quantities as Gattrs.

Detailed Description

GLAST Communications statistics HSK node record.

Valid Attributes:

  • Traffic_LCB0
  • Traffic_LCB0
  • Traffic_LCB0
  • Traffic_1553
  • Traffic_SSR

Definition at line 424 of file gHSK.py.

The documentation for this class was generated from the following file:
  • gHSK.py
Generated on Fri Jul 21 13:27:05 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HCPU Class Reference

gHSK.HCPU

HCPU Class Reference

GLAST CPU metrics HSK node record. More...

Inheritance diagram for HCPU:

[legend]
Collaboration diagram for HCPU:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid housekeeping quantities as Gattrs.

Detailed Description

GLAST CPU metrics HSK node record.

Valid Attributes:

  • CPU_Idle_[0-3]
  • CPU_Temp_[0-3]
  • MemUsage_[0-3]
  • CacheMisses_[0-3]
  • TaskStats_[0-3]

Definition at line 442 of file gHSK.py.

The documentation for this class was generated from the following file:
  • gHSK.py
Generated on Fri Jul 21 13:27:06 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HEBM Class Reference

gHSK.HEBM

HEBM Class Reference

GLAST EBM HSK node record. More...

Inheritance diagram for HEBM:

[legend]
Collaboration diagram for HEBM:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid housekeeping quantities as Gattrs.

Detailed Description

GLAST EBM HSK node record.

Valid Attributes:

  • Events
  • GEMreceive
  • TEM[0-15]receive
  • AEMreceive
  • SIU0receive
  • SIU1receive
  • EPU0receive
  • EPU1receive
  • EPU2receive
  • SIU0transmit
  • SIU1transmit
  • EPU0transmit
  • EPU1transmit
  • EPU2transmit
  • SSRtransmit

Definition at line 366 of file gHSK.py.

The documentation for this class was generated from the following file:
  • gHSK.py
Generated on Fri Jul 21 13:27:05 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HGEM Class Reference

gHSK.HGEM

HGEM Class Reference

GLAST GEM HSK node record. More...

Inheritance diagram for HGEM:

[legend]
Collaboration diagram for HGEM:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent)
Initialize valid housekeeping quantities as Gattrs.

Detailed Description

GLAST GEM HSK node record.

Valid Attributes:

  • Events
  • Livetime
  • Prescaled
  • Busy
  • Sent
  • PPS
  • LastPPS
  • TriggerTime

Definition at line 338 of file gHSK.py.

The documentation for this class was generated from the following file:
  • gHSK.py
Generated on Fri Jul 21 13:27:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HNUL Class Reference

gHSK.HNUL

HNUL Class Reference

GLAST HSK null record. More...

Inheritance diagram for HNUL:

[legend]
Collaboration diagram for HNUL:

[legend]
List of all members.

Public Member Functions

__init__ (parent)
Initialize valid housekeeping quantities as Gattrs.

Detailed Description

GLAST HSK null record.

Valid Attributes:

  • EMPTY

Definition at line 456 of file gHSK.py.

The documentation for this class was generated from the following file:
  • gHSK.py
Generated on Fri Jul 21 13:27:06 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HPDU Class Reference

gHSK.HPDU

HPDU Class Reference

GLAST PDU HSK node record. More...

Inheritance diagram for HPDU:

[legend]
Collaboration diagram for HPDU:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent, pduID)
Initialize valid housekeeping quantities as Gattrs.

Detailed Description

GLAST PDU HSK node record.

Valid Attributes:

  • ACDShellTemp0
  • ACDShellTemp1
  • ACDconvTemp
  • ACDpowerState
  • ACDpowerSupply
  • GridTemp[0-12]
  • RadiatorTemp[0-12]
  • RadiatorAfrzTemp0
  • RadiatorAfrzTemp1
  • CalBaseplateTemp[0-16]
  • VHCP_DSHP_M_Temp[0-6]
  • VHCP_DSHP_P_Temp[0-6]
  • VHCP_XLHP_M_Temp[0-6]
  • VHCP_XLHP_P_Temp[0-6]
  • VHCPRes_M_Temp[0-6]
  • VHCPRes_P_Temp[0-6]
  • TEM[0-16]_PCBTemp
  • TEM[0-16]_digital33V
  • TEM[0-16]_PSTemp
  • TEM[0-16]_powerState
  • ACDpmtRailTemp[0-4]
  • ACDBEAgridTemp[0-1]
  • GridRadiatorTemp[0-4]
  • EPUdigitalVoltage[0-3]
  • EPUTemp[0-3]
  • EPUCratePowerStat[0-3]
  • EPUConverterStat[0-3]

Definition at line 406 of file gHSK.py.

The documentation for this class was generated from the following file:
  • gHSK.py
Generated on Fri Jul 21 13:27:05 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskAlarmRecorder Class Reference

HskRecorder.HskAlarmRecorder

HskAlarmRecorder Class Reference

List of all members.

Public Member Functions

__init__ (ghsk)
processTrends (trendables)

Detailed Description

Applys the trends to the housekeeping node structure. As alarms are part of the node structure, we get those for free.

Definition at line 16 of file HskRecorder.py.

The documentation for this class was generated from the following file:
  • HskRecorder.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskCfgTextReceiver Class Reference

HskReceiver.HskCfgTextReceiver

HskCfgTextReceiver Class Reference

Inheritance diagram for HskCfgTextReceiver:

[legend]
Collaboration diagram for HskCfgTextReceiver:

[legend]
List of all members.

Public Member Functions

dispatch (trendMap)
process (dispatchMap)
trendItem (item)

Detailed Description

Definition at line 23 of file HskReceiver.py.

The documentation for this class was generated from the following file:
  • HskReceiver.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskCli Class Reference

HskCli.HskCli

HskCli Class Reference

Housekeeping client input/output class. More...

List of all members.

Public Member Functions

__init__ (handler=None)
connect (server)
connect method
disconnect ()
disconnect method
handler (newhandler)

Detailed Description

Housekeeping client input/output class.

This class instantiates and controls the sockets for the housekeeping process.

Definition at line 17 of file HskCli.py.

Member Function Documentation

connect ( server )

connect method

Parameters:
server the hostname where the housekeeping server process runs connect the housekeeping system to the housekeeping server

disconnect ( )

disconnect method

disconnect the housekeeping system from housekeeping server

The documentation for this class was generated from the following file:
  • HskCli.py
Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskCmdRxSocket Class Reference

HskCli.HskCmdRxSocket

HskCmdRxSocket Class Reference

Inheritance diagram for HskCmdRxSocket:

[legend]
Collaboration diagram for HskCmdRxSocket:

[legend]
List of all members.

Detailed Description

Definition at line 80 of file HskCli.py.

The documentation for this class was generated from the following file:
  • HskCli.py
Generated on Fri Jul 21 13:27:15 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskCmdTxSocket Class Reference

HskCli.HskCmdTxSocket

HskCmdTxSocket Class Reference

Inheritance diagram for HskCmdTxSocket:

[legend]
Collaboration diagram for HskCmdTxSocket:

[legend]
List of all members.

Detailed Description

Definition at line 84 of file HskCli.py.

The documentation for this class was generated from the following file:
  • HskCli.py
Generated on Fri Jul 21 13:27:15 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskCollector Class Reference

HskCollector.HskCollector

HskCollector Class Reference

Configurable housekeeping collector. More...

List of all members.

Public Member Functions

__init__ (config)
latDB ()

Detailed Description

Configurable housekeeping collector.

Takes a HskConfiguration object as input.

Definition at line 38 of file HskCollector.py.

The documentation for this class was generated from the following file:
  • HskCollector.py
Generated on Fri Jul 21 13:27:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskConfiguration Class Reference

HskCollector.HskConfiguration

HskConfiguration Class Reference

List of all members.

Public Member Functions

__init__ ()
read (fileName)
verify ()

Detailed Description

Definition at line 26 of file HskCollector.py.

The documentation for this class was generated from the following file:
  • HskCollector.py
Generated on Fri Jul 21 13:27:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskFileRecorder Class Reference

HskRecorder.HskFileRecorder

HskFileRecorder Class Reference

List of all members.

Public Member Functions

__init__ (ghsk, flatFile)

Detailed Description

Writes the Hsk EGUs to a flat file for later retrieval.

Definition at line 25 of file HskRecorder.py.

The documentation for this class was generated from the following file:
  • HskRecorder.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskHandler Class Reference

HskCli.HskHandler

HskHandler Class Reference

HskHandler class. More...

List of all members.

Public Member Functions

__init__ (server, host)
connect ()
connect
disconnected ()
disconnected
timedout ()
timedout

Detailed Description

HskHandler class.

Defines connection protocol to hsk server. This class needs to define two calls: disconnected and timeout.

Inherit from this to create GUI versions of HskSvr

Definition at line 104 of file HskCli.py.

Member Function Documentation

connect ( )

connect

Connect to the command/hsk server

The documentation for this class was generated from the following file:
  • HskCli.py
Generated on Fri Jul 21 13:27:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskLatRetriever Class Reference

HskRetriever.HskLatRetriever

HskLatRetriever Class Reference

List of all members.

Public Member Functions

__init__ (glat)
retrievePacket ()

Detailed Description

Fully populated LAT retriever. Should get all available LAT housekeeping quantities and trend them.

Definition at line 15 of file HskRetriever.py.

The documentation for this class was generated from the following file:
  • HskRetriever.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket Class Reference

HskPacket.HskPacket

HskPacket Class Reference

Inheritance diagram for HskPacket:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 5 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:17 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket210 Class Reference

HskPacket.HskPacket210

HskPacket210 Class Reference

Inheritance diagram for HskPacket210:

[legend]
Collaboration diagram for HskPacket210:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 10 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:17 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket211 Class Reference

HskPacket.HskPacket211

HskPacket211 Class Reference

Inheritance diagram for HskPacket211:

[legend]
Collaboration diagram for HskPacket211:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 15 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:17 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket212 Class Reference

HskPacket.HskPacket212

HskPacket212 Class Reference

Inheritance diagram for HskPacket212:

[legend]
Collaboration diagram for HskPacket212:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 20 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:18 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket213 Class Reference

HskPacket.HskPacket213

HskPacket213 Class Reference

Inheritance diagram for HskPacket213:

[legend]
Collaboration diagram for HskPacket213:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 25 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:18 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket214 Class Reference

HskPacket.HskPacket214

HskPacket214 Class Reference

Inheritance diagram for HskPacket214:

[legend]
Collaboration diagram for HskPacket214:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 30 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:18 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket215 Class Reference

HskPacket.HskPacket215

HskPacket215 Class Reference

Inheritance diagram for HskPacket215:

[legend]
Collaboration diagram for HskPacket215:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 35 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:19 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket216 Class Reference

HskPacket.HskPacket216

HskPacket216 Class Reference

Inheritance diagram for HskPacket216:

[legend]
Collaboration diagram for HskPacket216:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 40 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:19 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket217 Class Reference

HskPacket.HskPacket217

HskPacket217 Class Reference

Inheritance diagram for HskPacket217:

[legend]
Collaboration diagram for HskPacket217:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 45 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:19 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket218 Class Reference

HskPacket.HskPacket218

HskPacket218 Class Reference

Inheritance diagram for HskPacket218:

[legend]
Collaboration diagram for HskPacket218:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 50 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:19 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket219 Class Reference

HskPacket.HskPacket219

HskPacket219 Class Reference

Inheritance diagram for HskPacket219:

[legend]
Collaboration diagram for HskPacket219:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 55 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:20 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket21a Class Reference

HskPacket.HskPacket21a

HskPacket21a Class Reference

Inheritance diagram for HskPacket21a:

[legend]
Collaboration diagram for HskPacket21a:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 60 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:20 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket21b Class Reference

HskPacket.HskPacket21b

HskPacket21b Class Reference

Inheritance diagram for HskPacket21b:

[legend]
Collaboration diagram for HskPacket21b:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 65 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:20 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket21c Class Reference

HskPacket.HskPacket21c

HskPacket21c Class Reference

Inheritance diagram for HskPacket21c:

[legend]
Collaboration diagram for HskPacket21c:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 70 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:21 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket21d Class Reference

HskPacket.HskPacket21d

HskPacket21d Class Reference

Inheritance diagram for HskPacket21d:

[legend]
Collaboration diagram for HskPacket21d:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 75 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:21 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket21e Class Reference

HskPacket.HskPacket21e

HskPacket21e Class Reference

Inheritance diagram for HskPacket21e:

[legend]
Collaboration diagram for HskPacket21e:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 80 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:21 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket21f Class Reference

HskPacket.HskPacket21f

HskPacket21f Class Reference

Inheritance diagram for HskPacket21f:

[legend]
Collaboration diagram for HskPacket21f:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 85 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:21 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket220 Class Reference

HskPacket.HskPacket220

HskPacket220 Class Reference

Inheritance diagram for HskPacket220:

[legend]
Collaboration diagram for HskPacket220:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 90 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:22 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket221 Class Reference

HskPacket.HskPacket221

HskPacket221 Class Reference

Inheritance diagram for HskPacket221:

[legend]
Collaboration diagram for HskPacket221:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 95 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:22 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket222 Class Reference

HskPacket.HskPacket222

HskPacket222 Class Reference

Inheritance diagram for HskPacket222:

[legend]
Collaboration diagram for HskPacket222:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 100 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:22 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket223 Class Reference

HskPacket.HskPacket223

HskPacket223 Class Reference

Inheritance diagram for HskPacket223:

[legend]
Collaboration diagram for HskPacket223:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 105 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:22 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket224 Class Reference

HskPacket.HskPacket224

HskPacket224 Class Reference

Inheritance diagram for HskPacket224:

[legend]
Collaboration diagram for HskPacket224:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 110 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:23 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket225 Class Reference

HskPacket.HskPacket225

HskPacket225 Class Reference

Inheritance diagram for HskPacket225:

[legend]
Collaboration diagram for HskPacket225:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 115 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:23 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket226 Class Reference

HskPacket.HskPacket226

HskPacket226 Class Reference

Inheritance diagram for HskPacket226:

[legend]
Collaboration diagram for HskPacket226:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 120 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:23 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket227 Class Reference

HskPacket.HskPacket227

HskPacket227 Class Reference

Inheritance diagram for HskPacket227:

[legend]
Collaboration diagram for HskPacket227:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 240 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket228 Class Reference

HskPacket.HskPacket228

HskPacket228 Class Reference

Inheritance diagram for HskPacket228:

[legend]
Collaboration diagram for HskPacket228:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 250 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket229 Class Reference

HskPacket.HskPacket229

HskPacket229 Class Reference

Inheritance diagram for HskPacket229:

[legend]
Collaboration diagram for HskPacket229:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 255 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket22a Class Reference

HskPacket.HskPacket22a

HskPacket22a Class Reference

Inheritance diagram for HskPacket22a:

[legend]
Collaboration diagram for HskPacket22a:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 270 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket22b Class Reference

HskPacket.HskPacket22b

HskPacket22b Class Reference

Inheritance diagram for HskPacket22b:

[legend]
Collaboration diagram for HskPacket22b:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 280 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket22c Class Reference

HskPacket.HskPacket22c

HskPacket22c Class Reference

Inheritance diagram for HskPacket22c:

[legend]
Collaboration diagram for HskPacket22c:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 295 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:35 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket22d Class Reference

HskPacket.HskPacket22d

HskPacket22d Class Reference

Inheritance diagram for HskPacket22d:

[legend]
Collaboration diagram for HskPacket22d:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 300 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:35 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket22e Class Reference

HskPacket.HskPacket22e

HskPacket22e Class Reference

Inheritance diagram for HskPacket22e:

[legend]
Collaboration diagram for HskPacket22e:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 315 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:36 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket22f Class Reference

HskPacket.HskPacket22f

HskPacket22f Class Reference

Inheritance diagram for HskPacket22f:

[legend]
Collaboration diagram for HskPacket22f:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 320 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:36 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket230 Class Reference

HskPacket.HskPacket230

HskPacket230 Class Reference

Inheritance diagram for HskPacket230:

[legend]
Collaboration diagram for HskPacket230:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 325 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:37 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket231 Class Reference

HskPacket.HskPacket231

HskPacket231 Class Reference

Inheritance diagram for HskPacket231:

[legend]
Collaboration diagram for HskPacket231:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 330 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:37 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket270 Class Reference

HskPacket.HskPacket270

HskPacket270 Class Reference

Inheritance diagram for HskPacket270:

[legend]
Collaboration diagram for HskPacket270:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 125 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:24 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket271 Class Reference

HskPacket.HskPacket271

HskPacket271 Class Reference

Inheritance diagram for HskPacket271:

[legend]
Collaboration diagram for HskPacket271:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 130 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:24 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket272 Class Reference

HskPacket.HskPacket272

HskPacket272 Class Reference

Inheritance diagram for HskPacket272:

[legend]
Collaboration diagram for HskPacket272:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 135 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:24 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket273 Class Reference

HskPacket.HskPacket273

HskPacket273 Class Reference

Inheritance diagram for HskPacket273:

[legend]
Collaboration diagram for HskPacket273:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 140 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:24 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket274 Class Reference

HskPacket.HskPacket274

HskPacket274 Class Reference

Inheritance diagram for HskPacket274:

[legend]
Collaboration diagram for HskPacket274:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 145 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:25 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket275 Class Reference

HskPacket.HskPacket275

HskPacket275 Class Reference

Inheritance diagram for HskPacket275:

[legend]
Collaboration diagram for HskPacket275:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 150 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:25 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket276 Class Reference

HskPacket.HskPacket276

HskPacket276 Class Reference

Inheritance diagram for HskPacket276:

[legend]
Collaboration diagram for HskPacket276:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 155 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:25 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket277 Class Reference

HskPacket.HskPacket277

HskPacket277 Class Reference

Inheritance diagram for HskPacket277:

[legend]
Collaboration diagram for HskPacket277:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 160 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket278 Class Reference

HskPacket.HskPacket278

HskPacket278 Class Reference

Inheritance diagram for HskPacket278:

[legend]
Collaboration diagram for HskPacket278:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 165 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket279 Class Reference

HskPacket.HskPacket279

HskPacket279 Class Reference

Inheritance diagram for HskPacket279:

[legend]
Collaboration diagram for HskPacket279:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 170 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket27a Class Reference

HskPacket.HskPacket27a

HskPacket27a Class Reference

Inheritance diagram for HskPacket27a:

[legend]
Collaboration diagram for HskPacket27a:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 175 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket27b Class Reference

HskPacket.HskPacket27b

HskPacket27b Class Reference

Inheritance diagram for HskPacket27b:

[legend]
Collaboration diagram for HskPacket27b:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 180 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket27c Class Reference

HskPacket.HskPacket27c

HskPacket27c Class Reference

Inheritance diagram for HskPacket27c:

[legend]
Collaboration diagram for HskPacket27c:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 185 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket27d Class Reference

HskPacket.HskPacket27d

HskPacket27d Class Reference

Inheritance diagram for HskPacket27d:

[legend]
Collaboration diagram for HskPacket27d:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 190 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket27e Class Reference

HskPacket.HskPacket27e

HskPacket27e Class Reference

Inheritance diagram for HskPacket27e:

[legend]
Collaboration diagram for HskPacket27e:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 195 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket27f Class Reference

HskPacket.HskPacket27f

HskPacket27f Class Reference

Inheritance diagram for HskPacket27f:

[legend]
Collaboration diagram for HskPacket27f:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 200 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket280 Class Reference

HskPacket.HskPacket280

HskPacket280 Class Reference

Inheritance diagram for HskPacket280:

[legend]
Collaboration diagram for HskPacket280:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 205 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket281 Class Reference

HskPacket.HskPacket281

HskPacket281 Class Reference

Inheritance diagram for HskPacket281:

[legend]
Collaboration diagram for HskPacket281:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 210 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket282 Class Reference

HskPacket.HskPacket282

HskPacket282 Class Reference

Inheritance diagram for HskPacket282:

[legend]
Collaboration diagram for HskPacket282:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 215 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket283 Class Reference

HskPacket.HskPacket283

HskPacket283 Class Reference

Inheritance diagram for HskPacket283:

[legend]
Collaboration diagram for HskPacket283:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 220 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket284 Class Reference

HskPacket.HskPacket284

HskPacket284 Class Reference

Inheritance diagram for HskPacket284:

[legend]
Collaboration diagram for HskPacket284:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 225 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket285 Class Reference

HskPacket.HskPacket285

HskPacket285 Class Reference

Inheritance diagram for HskPacket285:

[legend]
Collaboration diagram for HskPacket285:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 230 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket286 Class Reference

HskPacket.HskPacket286

HskPacket286 Class Reference

Inheritance diagram for HskPacket286:

[legend]
Collaboration diagram for HskPacket286:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 235 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket287 Class Reference

HskPacket.HskPacket287

HskPacket287 Class Reference

Inheritance diagram for HskPacket287:

[legend]
Collaboration diagram for HskPacket287:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 245 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket288 Class Reference

HskPacket.HskPacket288

HskPacket288 Class Reference

Inheritance diagram for HskPacket288:

[legend]
Collaboration diagram for HskPacket288:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 260 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket289 Class Reference

HskPacket.HskPacket289

HskPacket289 Class Reference

Inheritance diagram for HskPacket289:

[legend]
Collaboration diagram for HskPacket289:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 265 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket28a Class Reference

HskPacket.HskPacket28a

HskPacket28a Class Reference

Inheritance diagram for HskPacket28a:

[legend]
Collaboration diagram for HskPacket28a:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 275 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket28b Class Reference

HskPacket.HskPacket28b

HskPacket28b Class Reference

Inheritance diagram for HskPacket28b:

[legend]
Collaboration diagram for HskPacket28b:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 285 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket28c Class Reference

HskPacket.HskPacket28c

HskPacket28c Class Reference

Inheritance diagram for HskPacket28c:

[legend]
Collaboration diagram for HskPacket28c:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 305 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:35 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket28d Class Reference

HskPacket.HskPacket28d

HskPacket28d Class Reference

Inheritance diagram for HskPacket28d:

[legend]
Collaboration diagram for HskPacket28d:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 310 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:36 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket28e Class Reference

HskPacket.HskPacket28e

HskPacket28e Class Reference

Inheritance diagram for HskPacket28e:

[legend]
Collaboration diagram for HskPacket28e:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 335 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:37 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket28f Class Reference

HskPacket.HskPacket28f

HskPacket28f Class Reference

Inheritance diagram for HskPacket28f:

[legend]
Collaboration diagram for HskPacket28f:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 340 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket290 Class Reference

HskPacket.HskPacket290

HskPacket290 Class Reference

Inheritance diagram for HskPacket290:

[legend]
Collaboration diagram for HskPacket290:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 345 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket291 Class Reference

HskPacket.HskPacket291

HskPacket291 Class Reference

Inheritance diagram for HskPacket291:

[legend]
Collaboration diagram for HskPacket291:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 350 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket353 Class Reference

HskPacket.HskPacket353

HskPacket353 Class Reference

Inheritance diagram for HskPacket353:

[legend]
Collaboration diagram for HskPacket353:

[legend]
List of all members.

Public Member Functions

__init__ (ui)

Detailed Description

Definition at line 290 of file HskPacket.py.

The documentation for this class was generated from the following file:
  • HskPacket.py
Generated on Fri Jul 21 13:27:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacketBase Class Reference

HskPacketDecoder.HskPacketBase

HskPacketBase Class Reference

Inheritance diagram for HskPacketBase:

[legend]
Collaboration diagram for HskPacketBase:

[legend]
List of all members.

Public Member Functions

read ()

Detailed Description

Definition at line 47 of file HskPacketDecoder.py.

The documentation for this class was generated from the following file:
  • HskPacketDecoder.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacketRecorder Class Reference

HskRecorder.HskPacketRecorder

HskPacketRecorder Class Reference

List of all members.

Public Member Functions

processTrends (trendables)

Detailed Description

Definition at line 36 of file HskRecorder.py.

The documentation for this class was generated from the following file:
  • HskRecorder.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacketRetriever Class Reference

HskPacketRetriever.HskPacketRetriever

HskPacketRetriever Class Reference

List of all members.

Public Member Functions

__init__ (hskCli)
retrievePacket ()

Detailed Description

Retrieve HSK ccsds packets from ethernet connection

Definition at line 15 of file HskPacketRetriever.py.

The documentation for this class was generated from the following file:
  • HskPacketRetriever.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacketWriter Class Reference

parseFswHsk.HskPacketWriter

HskPacketWriter Class Reference

List of all members.

Public Member Functions

dump ()
writeCode ()
writeSQL ()
name (a=None)
apid (a=None)
length (a=None)
brief (a=None)
descr (a=None)
payload ()
addPayload (item)

Detailed Description

Definition at line 11 of file parseFswHsk.py.

The documentation for this class was generated from the following file:
  • parseFswHsk.py
Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskSimpleTextReceiver Class Reference

HskReceiver.HskSimpleTextReceiver

HskSimpleTextReceiver Class Reference

Inheritance diagram for HskSimpleTextReceiver:

[legend]
List of all members.

Public Member Functions

__init__ (flatFile, startTime)
shutdown ()
receive ()
dispatch (trendMap)

Detailed Description

Definition at line 15 of file HskReceiver.py.

The documentation for this class was generated from the following file:
  • HskReceiver.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskSqlReceiver Class Reference

HskSqlInterface.HskSqlReceiver

HskSqlReceiver Class Reference

List of all members.

Public Member Functions

setSource (source)
receive ()
receiveRegion (start, end)
dispatch (trendMap)
process (dispatchMap)
trendItem (item)

Detailed Description

Definition at line 23 of file HskSqlInterface.py.

The documentation for this class was generated from the following file:
  • HskSqlInterface.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskSqlRecorder Class Reference

HskSqlInterface.HskSqlRecorder

HskSqlRecorder Class Reference

List of all members.

Public Member Functions

processTrends (trendables)

Detailed Description

Definition at line 15 of file HskSqlInterface.py.

The documentation for this class was generated from the following file:
  • HskSqlInterface.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskTelemSocket Class Reference

HskCli.HskTelemSocket

HskTelemSocket Class Reference

Inheritance diagram for HskTelemSocket:

[legend]
Collaboration diagram for HskTelemSocket:

[legend]
List of all members.

Detailed Description

Definition at line 88 of file HskCli.py.

The documentation for this class was generated from the following file:
  • HskCli.py
Generated on Fri Jul 21 13:27:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskTestRetriever Class Reference

HskRetriever.HskTestRetriever

HskTestRetriever Class Reference

List of all members.

Public Member Functions

__init__ (glat)
retrievePacket ()
aeqBuildDummy (timestamp)

Detailed Description

Test HskRetriever

Definition at line 24 of file HskRetriever.py.

The documentation for this class was generated from the following file:
  • HskRetriever.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HTEM Class Reference

gHSK.HTEM

HTEM Class Reference

GLAST TEM HSK node record. More...

Inheritance diagram for HTEM:

[legend]
Collaboration diagram for HTEM:

[legend]
List of all members.

Public Member Functions

__init__ (client, parent, temID)
Initialize valid housekeeping quantities as Gattrs.

Detailed Description

GLAST TEM HSK node record.

Valid Attributes:

  • tkr_digital_v
  • tkr_digital_i DEPRECATED, no replace
  • tkr_analoga_v
  • tkr_analoga_i DEPRECATED, no replace
  • tkr_analogb_v
  • tkr_analogb_i DEPRECATED, no replace
  • tkr_bias_v DEPRECATED, replaced by:
  • tkr_bias_v0
  • tkr_bias_i DEPRECATED, no replace
  • cal_digital_v
  • cal_digital_i DEPRECATED, replaced by:
  • tkr_bias_v1
  • cal_analog_v
  • cal_analog_i DEPRECATED, replaced by:
  • cal_bias_v1
  • cal_bias_v DEPRECATED, replaced by:
  • cal_bias_v0
  • cal_bias_i DEPRECATED, replaced by:
  • tem_28_v0
  • tem_digital_v
  • tem_digital_i DEPRECATED, replaced by:
  • tem_28_v0
  • afee_[0-3]_t[0-1] (AFEE_*_t0 DEPRECATED)
  • tkr_c[0-7]_t[0-1]
  • tkr_lrs_0_low
  • tkr_lrs_0_high
  • tkr_lrs_1_low
  • tkr_lrs_1_high
  • tkr_lrs_mask
  • cal_lrs_0
  • cal_lrs_0_mask
  • cal_lrs_1
  • cal_lrs_1_mask
  • deadtime

Definition at line 257 of file gHSK.py.

The documentation for this class was generated from the following file:
  • gHSK.py
Generated on Fri Jul 21 13:27:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: LATcomponentIterator Class Reference

standardLDF.LATcomponentIterator

LATcomponentIterator Class Reference

List of all members.

Public Member Functions

UDFcomponent (event, ebfContribution)
OSWcomponent (event, oswContribution)
ACDcomponent (event, aemContribution)
GEMcomponent (event, gemContribution)
CALcomponent (event, calContribution)
TKRcomponent (event, tkrContribution)
diagnostic (event, contribution)
error (event, contribution)
getEventMarker ()
declareNtDefinitions ()
declareNtDescriptions ()
getColumnDescription (ntName, columnName)
getChanIndexDescription (ntName, value)
getTileNumber (remapTileNumber)
getNtupleDefinition (ntName)

Detailed Description

Definition at line 7 of file standardLDF.py.

The documentation for this class was generated from the following file:
  • standardLDF.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: LATcomponentIterator Class Reference

testAppLDFdump.LATcomponentIterator

LATcomponentIterator Class Reference

List of all members.

Public Member Functions

UDFcomponent (event, ebfContribution)
OSWcomponent (event, oswContribution)
GLTcomponent (event, gltContribution)
GEMcomponent (event, gemContribution)
ACDcomponent (event, aemContribution)
CALcomponent (event, calContribution)
TKRcomponent (event, tkrContribution)

Detailed Description

Definition at line 17 of file testAppLDFdump.py.

The documentation for this class was generated from the following file:
  • testAppLDFdump.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: LATcontributionIterator Class Reference

standardLDF.LATcontributionIterator

LATcontributionIterator Class Reference

List of all members.

Public Member Functions

UDF (start, end)
getUdfDict ()
clearUdfDict ()

Detailed Description

Definition at line 75 of file standardLDF.py.

The documentation for this class was generated from the following file:
  • standardLDF.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: LATInterfaceException Class Reference

gException.LATInterfaceException

LATInterfaceException Class Reference

List of all members.

Public Member Functions

__str__ ()
errstr ()

Detailed Description

Definition at line 20 of file gException.py.

The documentation for this class was generated from the following file:
  • gException.py
Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: LATInterfaceStatus Class Reference

gException.LATInterfaceStatus

LATInterfaceStatus Class Reference

List of all members.

Public Member Functions

__init__ (status)
__str__ ()
errstr (status=None)

Static Public Member Functions

static | status (name)
static | name (status)
static | message (status)

Detailed Description

Definition at line 7 of file gException.py.

The documentation for this class was generated from the following file:
  • gException.py
Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: LATsweep Class Reference

LATsweep.LATsweep

LATsweep Class Reference

List of all members.

Public Member Functions

__init__ (lat, trigger, shut)
shut (sweepEvent, progress=None)

Detailed Description

Saves the current values of the registers, sets the TEM to a valid and known state for reliable event data taking. Triggers the event and then restores the registers to their prior values. This is done to make sure the sweep events that are retrieved from the TEM are good events.

Parameters:
lat | The LAT object hierarchy
trigger | The trigger object
sweepEvent | Event() object passed to the trigger

Definition at line 20 of file LATsweep.py.

The documentation for this class was generated from the following file:
  • LATsweep.py
Generated on Fri Jul 21 13:27:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: LDBI_LATcontributionIterator_ Class Reference

testAppAcdScalers.LDBI_LATcontributionIterator_

LDBI_LATcontributionIterator_ Class Reference

LDBI_LATcontributionIterator implementation. More...

List of all members.

Public Member Functions

__init__ (lci)
UDF (contrib, nextContrib)

Detailed Description

LDBI_LATcontributionIterator implementation.

Reimplements virtual UDF contribution handler from LATcontributionIterator This implementation checks if the contribution ID corresponds to a ACD Software Counter contribution, and parses it out into summary, cno and tile pieces. If the contribution ID does not match the expected ID, an error message is given, and the parser returns -1, an error.

Definition at line 140 of file testAppAcdScalers.py.

The documentation for this class was generated from the following file:
  • testAppAcdScalers.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: LdfContribution Class Reference

ldfContribution.LdfContribution

LdfContribution Class Reference

Inheritance diagram for LdfContribution:

[legend]
Collaboration diagram for LdfContribution:

[legend]
List of all members.

Public Member Functions

identity ()
Method to return the identity (LDF TypeId) of a contribution to an event. Meant to be overridden.
length ()
Method to return the length of a contribution to an event. Meant to be overridden.
sequence ()
Method to return the sequence value of the contribution. Meant to be overridden.
buffer ()

Detailed Description

Definition at line 6 of file ldfContribution.py.

Member Function Documentation

sequence ( )

Method to return the sequence value of the contribution. Meant to be overridden.

! This method must return a value for which the equality and greater than operators are defined. The sequence values must be common amoungst all contributors such that a if a contribution's sequence value is equal to another contributions sequence value, the two contributions belong together as part of the same event. A contribution A's sequence value that is greater than another contribution B's sequence value is interpreted to mean that A is newer than B. This information is used to flush out partially built older events.

Reimplemented from GebContribution.

The documentation for this class was generated from the following file:
  • ldfContribution.py
Generated on Fri Jul 21 13:27:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: LdfContributor Class Reference

ldfFile.LdfContributor

LdfContributor Class Reference

Inheritance diagram for LdfContributor:

[legend]
Collaboration diagram for LdfContributor:

[legend]
List of all members.

Public Member Functions

name ()
Method to return the name of the contribution type. Meant to be overridden.
offset ()
open ()
Method to open the contributor. Meant to be overridden.
close ()
Optional method to close the contributor. Meant to be overridden.
read ()
Method to read an LDF contribution from a file.
fake ()

Detailed Description

Definition at line 10 of file ldfFile.py.

The documentation for this class was generated from the following file:
  • ldfFile.py
Generated on Fri Jul 21 13:27:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: LdfContributor Class Reference

ldfSocket.LdfContributor

LdfContributor Class Reference

Inheritance diagram for LdfContributor:

[legend]
Collaboration diagram for LdfContributor:

[legend]
List of all members.

Public Member Functions

name ()
Method to return the name of the contribution type. Meant to be overridden.
offset ()
open ()
Method to open the contributor. Meant to be overridden.
read ()
Method to read an LDF contribution from a socket.
close ()
Optional method to close the contributor. Meant to be overridden.
fake ()

Detailed Description

Definition at line 12 of file ldfSocket.py.

The documentation for this class was generated from the following file:
  • ldfSocket.py
Generated on Fri Jul 21 13:27:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Lem Class Reference

gDb.Lem

Lem Class Reference

List of all members.

Public Member Functions

__init__ (client)
setParity (parity_type, parity_select)
getParity (parity_type)

Detailed Description

Definition at line 131 of file gDb.py.

The documentation for this class was generated from the following file:
  • gDb.py
Generated on Fri Jul 21 13:26:50 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ListViewToolTip Class Reference

rcStatusMonitor.ListViewToolTip

ListViewToolTip Class Reference

List of all members.

Public Member Functions

maybeTip (pos)

Detailed Description

Definition at line 7 of file rcStatusMonitor.py.

The documentation for this class was generated from the following file:
  • rcStatusMonitor.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: LogRecordStreamHandler Class Reference

MSGLogGUIImpl.LogRecordStreamHandler

LogRecordStreamHandler Class Reference

List of all members.

Public Member Functions

handle ()
unPickle (data)
handleLogRecord (record)

Detailed Description

Handler for a streaming logging request. It basically logs the record using whatever logging policy is configured locally.

Definition at line 32 of file MSGLogGUIImpl.py.

Member Function Documentation

handle ( )

Handle multiple requests - each expected to be a 4-byte length, followed by the LogRecord in pickle format. Logs the record according to whatever policy is configured locally.

The documentation for this class was generated from the following file:
  • MSGLogGUIImpl.py
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Loopback Class Reference

gLoopback.Loopback

Loopback Class Reference

List of all members.

Public Member Functions

socket ()
commit (value)
acknowledge ()

Detailed Description

Definition at line 6 of file gLoopback.py.

The documentation for this class was generated from the following file:
  • gLoopback.py
Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MailAlert Class Reference

MailAlert.MailAlert

MailAlert Class Reference

Inheritance diagram for MailAlert:

[legend]
List of all members.

Public Member Functions

sendMail (email)

Detailed Description

Definition at line 7 of file MailAlert.py.

The documentation for this class was generated from the following file:
  • MailAlert.py
Generated on Fri Jul 21 13:27:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MarkerTrgReadout Class Reference

testAppAcdScalers.MarkerTrgReadout

MarkerTrgReadout Class Reference

MarkerTrgReadout class definition. More...

List of all members.

Public Member Functions

__init__ ()
TrgReadout constructor.
zeroSuppress ()

Detailed Description

MarkerTrgReadout class definition.

Directs a module to send to its Front-End Electronics a command sequence which is composed only of the TACK command. This command will trigger a readout of the module's Front-End Electronics. Zero suppression is turned on. Marker is set to 1

Definition at line 121 of file testAppAcdScalers.py.

The documentation for this class was generated from the following file:
  • testAppAcdScalers.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: mask Class Reference

mask.mask

mask Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, fl=0)
setup (nbox)
setTitle (text)
setLabel (i, text)
updateMask ()
getMask ()
setMask (mask)
resizeEvent (rev)

Detailed Description

Definition at line 6 of file mask.py.

The documentation for this class was generated from the following file:
  • mask.py
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Merger Class Reference

fileMerge.Merger

Merger Class Reference

List of all members.

Public Member Functions

dispose ((statuses, event))
Method called by the base class to dispose of an event.
close ()
Method called by the base class to close the output file.

Detailed Description

Definition at line 14 of file fileMerge.py.

The documentation for this class was generated from the following file:
  • fileMerge.py
Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Merger Class Reference

socketMerge.Merger

Merger Class Reference

List of all members.

Public Member Functions

dispose ((statuses, buffer))
Method called by the base class to dispose of an event.
close ()
Method called by the base class to close the output file.

Detailed Description

Definition at line 16 of file socketMerge.py.

The documentation for this class was generated from the following file:
  • socketMerge.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Merger Class Reference

gEvtCliBT.Merger

Merger Class Reference

Inheritance diagram for Merger:

[legend]
Collaboration diagram for Merger:

[legend]
List of all members.

Public Member Functions

dispose (buffer)
Method called by the base class to dispose of an event.

Detailed Description

Definition at line 80 of file gEvtCliBT.py.

The documentation for this class was generated from the following file:
  • gEvtCliBT.py
Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MiniGLTExample Class Reference

test_evt_cal.MiniGLTExample

MiniGLTExample Class Reference

MiniTower example interface to MiniGLT. More...

List of all members.

Public Member Functions

__init__ ()
AcdTriggerExample constructor.
engines ()
Implementation of engines 'pure virtual' method from TrgAbstract.
conditions ()
Implementation of conditions 'pure virtual' method from TrgAbstract.

Detailed Description

MiniTower example interface to MiniGLT.

Definition at line 45 of file test_evt_cal.py.

The documentation for this class was generated from the following file:
  • test_evt_cal.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MiniGLTExample Class Reference

MiniGLTExample.MiniGLTExample

MiniGLTExample Class Reference

MiniTower example interface to MiniGLT. More...

List of all members.

Public Member Functions

__init__ ()
AcdTriggerExample constructor.
engines ()
Implementation of engines 'pure virtual' method from TrgAbstract.
conditions ()
Implementation of conditions 'pure virtual' method from TrgAbstract.

Detailed Description

MiniTower example interface to MiniGLT.

Definition at line 22 of file MiniGLTExample.py.

The documentation for this class was generated from the following file:
  • MiniGLTExample.py
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MiniGLTExample Class Reference

testAppAcdScalers.MiniGLTExample

MiniGLTExample Class Reference

MiniTower example interface to MiniGLT. More...

List of all members.

Public Member Functions

__init__ ()
AcdTriggerExample constructor.
engines ()
Implementation of engines 'pure virtual' method from TrgAbstract.
conditions ()
Implementation of conditions 'pure virtual' method from TrgAbstract.

Detailed Description

MiniTower example interface to MiniGLT.

Definition at line 70 of file testAppAcdScalers.py.

The documentation for this class was generated from the following file:
  • testAppAcdScalers.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MiniGltExtTrg Class Reference

test_evt_exttrg.MiniGltExtTrg

MiniGltExtTrg Class Reference

List of all members.

Public Member Functions

conditions ()

Detailed Description

Definition at line 43 of file test_evt_exttrg.py.

The documentation for this class was generated from the following file:
  • test_evt_exttrg.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MiniGLTSolicitedCondition Class Reference

testAppAcdScalers.MiniGLTSolicitedCondition

MiniGLTSolicitedCondition Class Reference

List of all members.

Public Member Functions

__init__ ()
solicited ()

Detailed Description

Define a condition where only the CNO trigger is asserted

Definition at line 106 of file testAppAcdScalers.py.

The documentation for this class was generated from the following file:
  • testAppAcdScalers.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MiniGLTSolicitedCondition Class Reference

MiniGLTExample.MiniGLTSolicitedCondition

MiniGLTSolicitedCondition Class Reference

List of all members.

Public Member Functions

__init__ ()
solicited ()

Detailed Description

Define a condition where only the CNO trigger is asserted

Definition at line 58 of file MiniGLTExample.py.

The documentation for this class was generated from the following file:
  • MiniGLTExample.py
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MiniGLTSolicitedCondition Class Reference

test_evt_cal.MiniGLTSolicitedCondition

MiniGLTSolicitedCondition Class Reference

List of all members.

Public Member Functions

__init__ ()
solicited ()

Detailed Description

Define a condition where only the CNO trigger is asserted

Definition at line 81 of file test_evt_cal.py.

The documentation for this class was generated from the following file:
  • test_evt_cal.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MiniGLTSolicitedEngine Class Reference

testAppAcdScalers.MiniGLTSolicitedEngine

MiniGLTSolicitedEngine Class Reference

List of all members.

Public Member Functions

__init__ ()
participate (conditionsValue)
prescale ()
request ()

Detailed Description

This class defines an engine which reads out the detector whenever there is a solicited trigger. This engine is not prescaled.

Definition at line 95 of file testAppAcdScalers.py.

The documentation for this class was generated from the following file:
  • testAppAcdScalers.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MiniGLTSolicitedEngine Class Reference

test_evt_cal.MiniGLTSolicitedEngine

MiniGLTSolicitedEngine Class Reference

List of all members.

Public Member Functions

__init__ ()
participate (conditionsValue)
prescale ()
request ()

Detailed Description

This class defines an engine which reads out the detector whenever there is a solicited trigger. This engine is not prescaled.

Definition at line 70 of file test_evt_cal.py.

The documentation for this class was generated from the following file:
  • test_evt_cal.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MiniGLTSolicitedEngine Class Reference

MiniGLTExample.MiniGLTSolicitedEngine

MiniGLTSolicitedEngine Class Reference

List of all members.

Public Member Functions

__init__ ()
participate (conditionsValue)
prescale ()
request ()

Detailed Description

This class defines an engine which reads out the detector whenever there is a solicited trigger. This engine is not prescaled.

Definition at line 47 of file MiniGLTExample.py.

The documentation for this class was generated from the following file:
  • MiniGLTExample.py
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MiniGLTTrgConditionsValue Class Reference

TrgMiniGLT.MiniGLTTrgConditionsValue

MiniGLTTrgConditionsValue Class Reference

Inheritance diagram for MiniGLTTrgConditionsValue:

[legend]
Collaboration diagram for MiniGLTTrgConditionsValue:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgConditionsValue constructor.
value ()
Value method.
external ()
external() 'pure virtual' method

Detailed Description

This class overrides the value() method of TrgConditionsValue as the MiniGLT has a different bitmap for the MASK register. It also provides the external() function.

Use this class instead of TrgConditionsValue for MiniGLT operations.

Definition at line 56 of file TrgMiniGLT.py.

Member Function Documentation

external ( )

external() 'pure virtual' method

Condition corresponding to an external trigger source

Returns:
A boolean

Reimplemented from TrgConditionsValue.

value ( )

Value method.

Returns:
integer
Returns an integer corresponding to the conditionValue integer corresponding to the WINDOW_OPEN mask register of the GEM Ref: LAT-TD-01545, S 2.9.2

Reimplemented from TrgConditionsValue.

The documentation for this class was generated from the following file:
  • TrgMiniGLT.py
Generated on Fri Jul 21 13:28:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MiniGltTrgEngine Class Reference

test_evt_exttrg.MiniGltTrgEngine

MiniGltTrgEngine Class Reference

List of all members.

Public Member Functions

participate (conditionsValue)
prescale ()

Detailed Description

Definition at line 50 of file test_evt_exttrg.py.

The documentation for this class was generated from the following file:
  • test_evt_exttrg.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MiniGLTTrgEngines Class Reference

test_evt_cal.MiniGLTTrgEngines

MiniGLTTrgEngines Class Reference

Detailed Description

Definition at line 61 of file test_evt_cal.py.

The documentation for this class was generated from the following file:
  • test_evt_cal.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MiniGLTTrgEngines Class Reference

testAppAcdScalers.MiniGLTTrgEngines

MiniGLTTrgEngines Class Reference

Detailed Description

Definition at line 86 of file testAppAcdScalers.py.

The documentation for this class was generated from the following file:
  • testAppAcdScalers.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MiniGLTTrgEngines Class Reference

MiniGLTExample.MiniGLTTrgEngines

MiniGLTTrgEngines Class Reference

Detailed Description

Definition at line 38 of file MiniGLTExample.py.

The documentation for this class was generated from the following file:
  • MiniGLTExample.py
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MSGLogGUIImpl Class Reference

MSGLogGUIImpl.MSGLogGUIImpl

MSGLogGUIImpl Class Reference

List of all members.

Public Member Functions

__init__ (port=logging.handlers.DEFAULT_TCP_LOGGING_PORT, updateInterval=100, parent=None, name=None, fl=0)
preventSaturation ()
showEntries ()
preventCheck ()
appendLogData (data)
switchToRunningLog ()
abortListenerThread ()
startListenerThread ()
runTCP (tcpserver)
clearLevels ()
levelCritical ()
levelFatal ()
levelError ()
levelWarn ()
levelInfo ()
levelDebug ()
levelNotset ()
levelNoFilter ()
setListViewItem (data)
handleAlert (s)
addLogDataToView ()
load ()
filePrint ()
Help ()
fileNew ()
fileOpen ()
fileSave ()
fileSaveAs ()
fileExit ()
closeEvent (e)
setSecure (secure)

Detailed Description

Definition at line 53 of file MSGLogGUIImpl.py.

The documentation for this class was generated from the following file:
  • MSGLogGUIImpl.py
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MSGLogSocketReceiver Class Reference

MSGLogGUIImpl.MSGLogSocketReceiver

MSGLogSocketReceiver Class Reference

List of all members.

Public Member Functions

__init__ (gui, host='', port=logging.handlers.DEFAULT_TCP_LOGGING_PORT, handler=LogRecordStreamHandler)
abort ()
serve_until_stopped ()

Detailed Description

Definition at line 45 of file MSGLogGUIImpl.py.

The documentation for this class was generated from the following file:
  • MSGLogGUIImpl.py
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: multibar Class Reference

multibar.multibar

multibar Class Reference

List of all members.

Public Member Functions

setup (nbars, lw=0)
languageChange ()
resizeEvent (rev)
setHigh (high)
setLow (low)
setBarTitle (i, title)
setTitle (title)
setScale (scale)
setMinScale (min)
setSlidingScale (scale)
displaySlidingScaleValue (i, val)

Detailed Description

Definition at line 9 of file multibar.py.

The documentation for this class was generated from the following file:
  • multibar.py
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: myLATcomponentIterator Class Reference

GOSED_LDF.myLATcomponentIterator

myLATcomponentIterator Class Reference

LAT component Displayer. More...

List of all members.

Public Member Functions

__init__ (gui)
UDFcomponent (event, ebfContribution)
GLTcomponent (event, contribution)
OSWcomponent (event, contribution)
GEMcomponent (event, gemContribution)
ACDcomponent (event, aemContribution)
TKRcomponent (event, tkrContribution)
CALcomponent (event, calContribution)
diagnostic (event, contribution)
error (event, contribution)

Detailed Description

LAT component Displayer.

This class obtains the information of all the LAT components from EBF and passes it to the corresponding component iterators, to be displayed in GOSED.

Definition at line 191 of file GOSED_LDF.py.

Member Function Documentation

__init__ ( gui )

myLATcomponentIterator contructor

Parameters:
gui GOSED

ACDcomponent | ( | event | ,
 |  | aemContribution |
 | ) |

Obtain the ACD information of the event

CALcomponent | ( | event | ,
 |  | calContribution |
 | ) |

Obtain the CAL information of the event to be processed by CALcontributionIterator1 and CALcontributionIterator2.

diagnostic | ( | event | ,
 |  | contribution |
 | ) |

Obtain the diagnostic information of the event.

error | ( | event | ,
 |  | contribution |
 | ) |

Obtain the error information of the event.

GEMcomponent | ( | event | ,
 |  | gemContribution |
 | ) |

Obtain the ACD information of the event

GLTcomponent | ( | event | ,
 |  | contribution |
 | ) |

Obtain the "fingerprints" of the event

OSWcomponent | ( | event | ,
 |  | contribution |
 | ) |

Obtain the 'fingerprints' of the event

TKRcomponent | ( | event | ,
 |  | tkrContribution |
 | ) |

Obtain the TKR information of the event to be processed by TKRcontributionIterator.

The documentation for this class was generated from the following file:
  • GOSED_LDF.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: myLATcomponentIterator Class Reference

hTestAppEvt.myLATcomponentIterator

myLATcomponentIterator Class Reference

List of all members.

Public Member Functions

CALcomponent (event, calContribution)
TKRcomponent (event, contribution)

Detailed Description

Definition at line 35 of file hTestAppEvt.py.

The documentation for this class was generated from the following file:
  • hTestAppEvt.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: myLATcomponentIterator Class Reference

testSAppEvt.myLATcomponentIterator

myLATcomponentIterator Class Reference

List of all members.

Public Member Functions

UDFcomponent (event, ebfContribution)
GLTcomponent (event, gemContribution)
ACDcomponent (event, aemContribution)
CALcomponent (event, calContribution)
TKRcomponent (event, tkrContribution)

Detailed Description

Definition at line 27 of file testSAppEvt.py.

The documentation for this class was generated from the following file:
  • testSAppEvt.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: myLATcomponentIterator Class Reference

splitOutTem.myLATcomponentIterator

myLATcomponentIterator Class Reference

List of all members.

Public Member Functions

TEM (event, ebfContribution)
GEM (event, ebfContribution)
AEM (event, ebfContribution)
OSW (event, ebfContribution)
headerStr (contrib)
summaryStr (contrib)
payloadStr (ebfContribution)
parseContrib (ebfContribution)

Detailed Description

Definition at line 28 of file splitOutTem.py.

The documentation for this class was generated from the following file:
  • splitOutTem.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: myLATcomponentIterator Class Reference

testAppEvt.myLATcomponentIterator

myLATcomponentIterator Class Reference

List of all members.

Public Member Functions

UDFcomponent (event, ebfContribution)
GLTcomponent (event, gemContribution)
ACDcomponent (event, aemContribution)
CALcomponent (event, calContribution)
TKRcomponent (event, tkrContribution)

Detailed Description

Definition at line 27 of file testAppEvt.py.

The documentation for this class was generated from the following file:
  • testAppEvt.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: myLATdbIterator Class Reference

splitOutTem.myLATdbIterator

myLATdbIterator Class Reference

List of all members.

Public Member Functions

iterate (buffer, size)
closeAll ()

Detailed Description

Definition at line 40 of file splitOutTem.py.

The documentation for this class was generated from the following file:
  • splitOutTem.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MyLogSocketHandler Class Reference

socketLogging.MyLogSocketHandler

MyLogSocketHandler Class Reference

List of all members.

Public Member Functions

handleError (record)
createSocket ()

Detailed Description

Definition at line 7 of file socketLogging.py.

Member Function Documentation

createSocket ( )

Override base classes createSocket method. This isn't allowed to fail silently

The documentation for this class was generated from the following file:
  • socketLogging.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MyRoi Class Reference

TrgRoiAsVeto.MyRoi

MyRoi Class Reference

Inheritance diagram for MyRoi:

[legend]
Collaboration diagram for MyRoi:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgRoi constructor.
tile (tileNumber)
tile 'pure virtual' method

Detailed Description

Definition at line 18 of file TrgRoiAsVeto.py.

Member Function Documentation

tile ( tileNumber )

tile 'pure virtual' method

Parameters:
tileNumber A tile number
Returns:
A boolean

Reimplemented from TrgRoi.

The documentation for this class was generated from the following file:
  • TrgRoiAsVeto.py
Generated on Fri Jul 21 13:28:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: myTKRcontributionIterator Class Reference

hTestAppEvt.myTKRcontributionIterator

myTKRcontributionIterator Class Reference

List of all members.

Public Member Functions

strip (tower, layerEnd, hit)
TOT (tower, layerEnd, tot)

Detailed Description

Definition at line 29 of file hTestAppEvt.py.

The documentation for this class was generated from the following file:
  • hTestAppEvt.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: NoCnoEnabled Class Reference

NullObjects.NoCnoEnabled

NoCnoEnabled Class Reference

Inheritance diagram for NoCnoEnabled:

[legend]
Collaboration diagram for NoCnoEnabled:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgCnoEnables constructor.

Detailed Description

NoCnoEnabled class: Class defining a system where all CNO inputs are disabled.

Definition at line 88 of file NullObjects.py.

The documentation for this class was generated from the following file:
  • NullObjects.py
Generated on Fri Jul 21 13:27:44 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Node Class Reference

gNode.Node

Node Class Reference

List of all members.

Public Member Functions

client ()
cmdrsp (functionname, arguments)
read (reg)
load (reg, value)
send (cmd)

Detailed Description

Definition at line 4 of file gNode.py.

The documentation for this class was generated from the following file:
  • gNode.py
Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: NodeRegisterList Class Reference

HskRegisters.NodeRegisterList

NodeRegisterList Class Reference

List of all members.

Public Member Functions

__init__ (node)
map ()

Detailed Description

Definition at line 30 of file HskRegisters.py.

The documentation for this class was generated from the following file:
  • HskRegisters.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: NoExternal Class Reference

NullObjects.NoExternal

NoExternal Class Reference

Inheritance diagram for NoExternal:

[legend]
Collaboration diagram for NoExternal:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgExtEnables constructor.
external ()
tower 'pure virtual' method

Detailed Description

NoExternal class: Class defining a system where no trigger is enabled.

Definition at line 107 of file NullObjects.py.

Member Function Documentation

external ( )

tower 'pure virtual' method

Returns:
A boolean

Reimplemented from TrgExtEnables.

The documentation for this class was generated from the following file:
  • NullObjects.py
Generated on Fri Jul 21 13:27:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: NoInputsEnabled Class Reference

NullObjects.NoInputsEnabled

NoInputsEnabled Class Reference

Inheritance diagram for NoInputsEnabled:

[legend]
Collaboration diagram for NoInputsEnabled:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgInputEnables constructor.
towers ()
Towers 'pure virtual' method.
cno ()
Cno 'pure virtual' method.
external ()
Tiles 'pure virtual' method.

Detailed Description

NoInputsEnabled class: Class defining a system where no inputs are enabled.

Definition at line 117 of file NullObjects.py.

Member Function Documentation

cno ( )

Cno 'pure virtual' method.

Returns:
A TrgCnoEnables object

Reimplemented from TrgInputEnables.

external ( )

Tiles 'pure virtual' method.

Returns:
A TrgExtEnables object

Reimplemented from TrgInputEnables.

towers ( )

Towers 'pure virtual' method.

Returns:
A TrgTowerEnables object

Reimplemented from TrgInputEnables.

The documentation for this class was generated from the following file:
  • NullObjects.py
Generated on Fri Jul 21 13:27:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: NoTilesEnabled Class Reference

NullObjects.NoTilesEnabled

NoTilesEnabled Class Reference

Inheritance diagram for NoTilesEnabled:

[legend]
Collaboration diagram for NoTilesEnabled:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgTileEnables constructor.
tile (tileNumber)
Tile 'pure virtual' method.

Detailed Description

NoTilesEnabled class: Class defining a system where no tiles are enabled.

Definition at line 78 of file NullObjects.py.

Member Function Documentation

tile ( tileNumber )

Tile 'pure virtual' method.

Parameters:
tileNumber A tile number
Returns:
An integer

Reimplemented from TrgTileEnables.

The documentation for this class was generated from the following file:
  • NullObjects.py
Generated on Fri Jul 21 13:27:44 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: NoTowersBusy Class Reference

NullObjects.NoTowersBusy

NoTowersBusy Class Reference

Inheritance diagram for NoTowersBusy:

[legend]
Collaboration diagram for NoTowersBusy:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgTowerBusyEnables constructor.
tower (towerNumber)
tower 'pure virtual' method

Detailed Description

NoTowersBusy class: Class defining a system where no tower busy bits are enabled.

Definition at line 97 of file NullObjects.py.

Member Function Documentation

tower ( towerNumber )

tower 'pure virtual' method

Parameters:
towerNumber A tower number
Returns:
A boolean

Reimplemented from TrgTowerBusyEnables.

The documentation for this class was generated from the following file:
  • NullObjects.py
Generated on Fri Jul 21 13:27:44 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: NoTowersEnabled Class Reference

NullObjects.NoTowersEnabled

NoTowersEnabled Class Reference

Inheritance diagram for NoTowersEnabled:

[legend]
Collaboration diagram for NoTowersEnabled:

[legend]
List of all members.

Public Member Functions

tower (towerNumber)

Detailed Description

Definition at line 69 of file NullObjects.py.

The documentation for this class was generated from the following file:
  • NullObjects.py
Generated on Fri Jul 21 13:27:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: NullCal Class Reference

NullObjects.NullCal

NullCal Class Reference

Inheritance diagram for NullCal:

[legend]
Collaboration diagram for NullCal:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgCalorimeter constructor.
useHighEnergy ()
UseHighEnergy 'virtual' method.
useLowEnergy ()
UseLowEnergy 'virtual' method.

Detailed Description

NullCal class: Class defines a calorimeter which is inactive. Used by NullTower

Definition at line 51 of file NullObjects.py.

Member Function Documentation

useHighEnergy ( )

UseHighEnergy 'virtual' method.

Returns:
A boolean

Reimplemented from TrgCalorimeter.

useLowEnergy ( )

UseLowEnergy 'virtual' method.

Returns:
A boolean

Reimplemented from TrgCalorimeter.

The documentation for this class was generated from the following file:
  • NullObjects.py
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: NullCoincidence Class Reference

NullObjects.NullCoincidence

NullCoincidence Class Reference

Inheritance diagram for NullCoincidence:

[legend]
Collaboration diagram for NullCoincidence:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgCoincidence constructor.
inCoincidence (tileNumber)
InCoincidence 'pure virtual' method To be satisfied by the user.

Detailed Description

NullCoincidence class: Class defining a coincidence set that is all null.

Definition at line 139 of file NullObjects.py.

Member Function Documentation

inCoincidence ( tileNumber )

InCoincidence 'pure virtual' method To be satisfied by the user.

Parameters:
tileNumber A tile number [0..107]
Returns:
An integer

Reimplemented from TrgCoincidence.

The documentation for this class was generated from the following file:
  • NullObjects.py
Generated on Fri Jul 21 13:27:46 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: NullEngine Class Reference

NullObjects.NullEngine

NullEngine Class Reference

Inheritance diagram for NullEngine:

[legend]
Collaboration diagram for NullEngine:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgEngine constructor.
participate (conditionsValue)
participate 'pure virtual' method Determines whether or not this engine participates when a particular conditionsValue is satisfied in the GEM.
prescale ()
prescale 'pure virtual' method
request ()
request 'pure virtual' method Return the TrgEngineRequest object corresponding to this engine.

Detailed Description

NullEngine class: This class defines an engine doesn't do anything. Prescale is set to -1 to prevent engine from firing.

Definition at line 150 of file NullObjects.py.

Member Function Documentation

participate ( conditionsValue )

participate 'pure virtual' method Determines whether or not this engine participates when a particular conditionsValue is satisfied in the GEM.

Parameters:
conditionsValue An integer
Returns:
A boolean

Reimplemented from TrgEngine.

prescale ( )

prescale 'pure virtual' method

Returns:
An integer

Reimplemented from TrgEngine.

request ( )

request 'pure virtual' method Return the TrgEngineRequest object corresponding to this engine.

Returns:
A TrgEngineRequest object

Reimplemented from TrgEngine.

The documentation for this class was generated from the following file:
  • NullObjects.py
Generated on Fri Jul 21 13:27:46 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: NullRequest Class Reference

NullObjects.NullRequest

NullRequest Class Reference

Inheritance diagram for NullRequest:

[legend]
Collaboration diagram for NullRequest:

[legend]
List of all members.

Public Member Functions

__init__ ()
constructor
sequence ()
sequence 'pure virtual' method

Detailed Description

NullRequest class: This class defines an engineRequest that doesn't do anything However sequence must be set, so the detector will be read out.

Definition at line 163 of file NullObjects.py.

Member Function Documentation

sequence ( )

sequence 'pure virtual' method

Returns:
An integer

Reimplemented from TrgEngineRequest.

The documentation for this class was generated from the following file:
  • NullObjects.py
Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: NullRoi Class Reference

NullObjects.NullRoi

NullRoi Class Reference

Inheritance diagram for NullRoi:

[legend]
Collaboration diagram for NullRoi:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgRoi constructor.
tile (tileNumber)
tile 'pure virtual' method

Detailed Description

NullRoi class: Class defining a system where the ROI contains no tiles.

Definition at line 129 of file NullObjects.py.

Member Function Documentation

tile ( tileNumber )

tile 'pure virtual' method

Parameters:
tileNumber A tile number
Returns:
A boolean

Reimplemented from TrgRoi.

The documentation for this class was generated from the following file:
  • NullObjects.py
Generated on Fri Jul 21 13:27:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: NullStream Class Reference

GlobalPanelImpl.NullStream

NullStream Class Reference

List of all members.

Public Member Functions

close ()
write (str)

Detailed Description

A file like class that writes nothing

Definition at line 47 of file GlobalPanelImpl.py.

The documentation for this class was generated from the following file:
  • GlobalPanelImpl.py
Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: NullTkr Class Reference

NullObjects.NullTkr

NullTkr Class Reference

Inheritance diagram for NullTkr:

[legend]
Collaboration diagram for NullTkr:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgTracker constructor.
use ()
Use 'virtual' method.

Detailed Description

NullTkr class: Class defines a tracker which is inactive. Used by NullTower

Definition at line 63 of file NullObjects.py.

Member Function Documentation

use ( )

Use 'virtual' method.

Returns:
A boolean

Reimplemented from TrgTracker.

The documentation for this class was generated from the following file:
  • NullObjects.py
Generated on Fri Jul 21 13:27:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: NullTower Class Reference

NullObjects.NullTower

NullTower Class Reference

Inheritance diagram for NullTower:

[legend]
Collaboration diagram for NullTower:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgTower constructor.
calorimeter ()
Calorimeter 'pure virtual' method.
tracker ()
Tracker 'pure virtual' method.

Detailed Description

NullTower class: Class defines a tower with no calorimeter active and no tracker active.

Definition at line 39 of file NullObjects.py.

Member Function Documentation

calorimeter ( )

Calorimeter 'pure virtual' method.

Returns:
A TrgCalorimeter object

Reimplemented from TrgTower.

tracker ( )

Tracker 'pure virtual' method.

Returns:
A TrgTracker object

Reimplemented from TrgTower.

The documentation for this class was generated from the following file:
  • NullObjects.py
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: OcsMessages Class Reference

gOcsMessages.OcsMessages

OcsMessages Class Reference

Detailed Description

Definition at line 4 of file gOcsMessages.py.

The documentation for this class was generated from the following file:
  • gOcsMessages.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Opcode Class Reference

gOpcode.Opcode

Opcode Class Reference

List of all members.

Public Member Functions

__init__ (value)
packet ()

Detailed Description

Definition at line 5 of file gOpcode.py.

The documentation for this class was generated from the following file:
  • gOpcode.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Options Class Reference

gOptions.Options

Options Class Reference

List of all members.

Public Member Functions

__getattr__ (attribute)
usage (notes='')
parse ()

Detailed Description

Definition at line 6 of file gOptions.py.

The documentation for this class was generated from the following file:
  • gOptions.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: OSWcontributionIterator Class Reference

standardLDF.OSWcontributionIterator

OSWcontributionIterator Class Reference

List of all members.

Public Member Functions

OSWtime (timeStamp, timebase)
OSW_UDF (event, contribution)

Detailed Description

Definition at line 51 of file standardLDF.py.

The documentation for this class was generated from the following file:
  • standardLDF.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: OSWcontributionIterator_ Class Reference

GOSED_LDF.OSWcontributionIterator_

OSWcontributionIterator_ Class Reference

List of all members.

Public Member Functions

timestamp ()
evtSequence ()
OSW_time (event, contribution)

Detailed Description

Definition at line 151 of file GOSED_LDF.py.

The documentation for this class was generated from the following file:
  • GOSED_LDF.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: palettes Class Reference

userAppLoader.palettes

palettes Class Reference

Detailed Description

Definition at line 19 of file userAppLoader.py.

The documentation for this class was generated from the following file:
  • userAppLoader.py
Generated on Fri Jul 21 13:28:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: panelsTest Class Reference

userAppBrowser.panelsTest

panelsTest Class Reference

List of all members.

Public Member Functions

getUserApp ()

Detailed Description

Definition at line 61 of file userAppBrowser.py.

The documentation for this class was generated from the following file:
  • userAppBrowser.py
Generated on Fri Jul 21 13:28:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: PduSwitch Class Reference

test_pduswitch.PduSwitch

PduSwitch Class Reference

List of all members.

Public Member Functions

configureTestHardware (pdu, gasu)

Detailed Description

Definition at line 19 of file test_pduswitch.py.

The documentation for this class was generated from the following file:
  • test_pduswitch.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Playback Class Reference

test_playback.Playback

Playback Class Reference

List of all members.

Public Member Functions

__init__ (server)
connect ()
disconnect ()
trigger (howmany)
listen ()

Detailed Description

Definition at line 10 of file test_playback.py.

The documentation for this class was generated from the following file:
  • test_playback.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: PlotWidget Class Reference

EnvMonImpl.PlotWidget

PlotWidget Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, fl=1)
OKButtonClicked ()
CancelButtonClicked ()
getMinMax ()
__init__ (envMonDlg, parent, title, sizeX, sizeY, labels)
getNTuple ()
contextMenuEvent (cmev)
printPlot ()
saveToFile ()
setRange ()

Detailed Description

Definition at line 86 of file EnvMonImpl.py.

The documentation for this class was generated from the following file:
  • EnvMonImpl.py
Generated on Fri Jul 21 13:26:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Plumber Class Reference

gPlumber.Plumber

Plumber Class Reference

List of all members.

Public Member Functions

__init__ (lat, xbrd)
initialize (fswmsglevel, ocsverbose, force, commander=True)

Detailed Description

Definition at line 8 of file gPlumber.py.

The documentation for this class was generated from the following file:
  • gPlumber.py
Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: PorcineEvent Class Reference

PorcinePanel.PorcineEvent

PorcineEvent Class Reference

List of all members.

Public Member Functions

__init__ (type, data)

Detailed Description

Definition at line 65 of file PorcinePanel.py.

The documentation for this class was generated from the following file:
  • PorcinePanel.py
Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: PorcinePanel Class Reference

PorcinePanel.PorcinePanel

PorcinePanel Class Reference

List of all members.

Public Member Functions

__init__ (args)
getPowerTab ()
shutdown ()
fabricInsert ()
fabricExtract ()
powerOn ()
powerOff ()
refreshSchema (lat, xbrd)
refreshStatus ()
getFabricControl ()
getPowerControl ()
customEvent (e)

Detailed Description

Definition at line 19 of file PorcinePanel.py.

The documentation for this class was generated from the following file:
  • PorcinePanel.py
Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: PorcineWindow Class Reference

PorcinePanel.PorcineWindow

PorcineWindow Class Reference

List of all members.

Public Member Functions

shutdown ()
windowActivationChange (oldActive)

Detailed Description

Definition at line 13 of file PorcinePanel.py.

The documentation for this class was generated from the following file:
  • PorcinePanel.py
Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: PowerPanelImpl Class Reference

PowerPanelImpl.PowerPanelImpl

PowerPanelImpl Class Reference

List of all members.

Public Member Functions

__init__ (rc, common, parent=None, name=None, fl=0)
applyPermissions (operator)
setEnablePowerUpButton (enable)
setEnablePowerDownButton (enable)
selectBothCALTKR (state)
selectCAL (id)
selectTKR (id)
selectAllACD ()
deSelectAllACD ()
selectAllCAL ()
deSelectAllCAL ()
selectAllTKR ()
deSelectAllTKR ()
activate ()
disableAllCheck (preserveExisting=0)
initCheckPower ()
getACDPowerUps ()
getTEMPowerUps ()
powerUp ()
powerDown ()
refreshPowerStatus ()
refreshLEDs (acdPowerCheck, calPowerCheck, tkrPowerCheck)

Detailed Description

Definition at line 8 of file PowerPanelImpl.py.

The documentation for this class was generated from the following file:
  • PowerPanelImpl.py
Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Preferences Class Reference

rcPreferencesManager.Preferences

Preferences Class Reference

Preferences dictionary Preferences needs a special dictionary class since the data it stores may have macros and environment variables in it. More...

List of all members.

Public Member Functions

__init__ ()
__getitem__ (item)
__setitem__ (item, value)
isDir (item)
isNumber (item)
isLastItem (item)
expandVars (path)
composePath (path)
getLastItem (item)

Detailed Description

Preferences dictionary Preferences needs a special dictionary class since the data it stores may have macros and environment variables in it.

In order to read the values unprocessed use the self.__prefs.get(item) method. If you need to resolve all the macros and environment variables then access it like any other dictionary (self.__prefs[item])

Definition at line 47 of file rcPreferencesManager.py.

The documentation for this class was generated from the following file:
  • rcPreferencesManager.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: PythonShellWidget Class Reference

rcPythonShell.PythonShellWidget

PythonShellWidget Class Reference

List of all members.

Public Member Functions

redirectIO ()
restoreIO ()
flush ()
isatty ()
readline ()
write (text)
writelines (text)
fakeUser (lines)
keyPressEvent (e)
focusNextPrevChild (next)
handleClicked (para, pos)
contentsContextMenuEvent (ev)

Detailed Description

Definition at line 17 of file rcPythonShell.py.

Member Function Documentation

contentsContextMenuEvent ( ev )

Suppress the right button context menu. Instead paste the contents of the clipboard.

fakeUser ( lines )

Simulate a user: lines is a sequence of strings, (Python statements).

flush ( )

Simulate stdin, stdout, and stderr.

focusNextPrevChild ( next )

Suppress tabbing to the next window in multi-line commands.

handleClicked | ( | para | ,
 |  | pos |
 | ) |

Keep the cursor after the last prompt.

isatty ( )

Simulate stdin, stdout, and stderr.

keyPressEvent ( e )

Handle user input a key at a time.

readline ( )

Simulate stdin, stdout, and stderr.

write ( text )

Simulate stdin, stdout, and stderr.

writelines ( text )

Simulate stdin, stdout, and stderr.

The documentation for this class was generated from the following file:
  • rcPythonShell.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: PyThreadBridge Class Reference

guiBridges.PyThreadBridge

PyThreadBridge Class Reference

List of all members.

Public Member Functions

pushEvent (event)
pullResponse (respQueue, blnBlock=1)

Detailed Description

Definition at line 89 of file guiBridges.py.

The documentation for this class was generated from the following file:
  • guiBridges.py
Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: QtReceiver Class Reference

HskSqlGuiReceiver.QtReceiver

QtReceiver Class Reference

List of all members.

Public Member Functions

__init__ (trendMap)
__init__ (sqlDB, timeDepth, trendList)
process (trendMap)
customEvent (event)

Detailed Description

Definition at line 17 of file HskSqlGuiReceiver.py.

The documentation for this class was generated from the following file:
  • HskSqlGuiReceiver.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: QtReceiver Class Reference

testTrending.QtReceiver

QtReceiver Class Reference

List of all members.

Public Member Functions

__init__ (trendables)
__init__ (args)
process (trendables)
customEvent (event)

Detailed Description

Definition at line 9 of file testTrending.py.

The documentation for this class was generated from the following file:
  • testTrending.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: QtReceiver Class Reference

HskGuiReceiver.QtReceiver

QtReceiver Class Reference

Inheritance diagram for QtReceiver:

[legend]
Collaboration diagram for QtReceiver:

[legend]
List of all members.

Public Member Functions

__init__ (trendMap)
__init__ (flatFile, startTime, trendList)
process (trendMap)
customEvent (event)

Detailed Description

Definition at line 19 of file HskGuiReceiver.py.

The documentation for this class was generated from the following file:
  • HskGuiReceiver.py
Generated on Fri Jul 21 13:27:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: QtThreadBridge Class Reference

guiBridges.QtThreadBridge

QtThreadBridge Class Reference

List of all members.

Public Member Functions

quit ()
pushResponse (respQueue, event, exception=None)
run ()

Detailed Description

Definition at line 82 of file guiBridges.py.

The documentation for this class was generated from the following file:
  • guiBridges.py
Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: radiomask Class Reference

radiomask.radiomask

radiomask Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, fl=0)
setup (nbox)
setTitle (text)
click (id)
setLabel (i, text)
updateMask (i)
getMask ()
resizeEvent (rev)

Detailed Description

Definition at line 6 of file radiomask.py.

The documentation for this class was generated from the following file:
  • radiomask.py
Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcArchiver Class Reference

rcArchiver.rcArchiver

rcArchiver Class Reference

Event Archiver. More...

Inheritance diagram for rcArchiver:

[legend]
List of all members.

Public Member Functions

__init__ (filePath=None, fileName=None, mode=MODE_CREATE, userId=123)
write (rawEventData)
writeTuple (tuple)
read ()
close ()
isClosed ()
getFileName ()
getFilePath ()

Static Public Member Functions

static getFileNameFromTS (ts)

Detailed Description

Event Archiver.

Default event archiver class to store event data to a file. This class can be inherited to create a custom event class and using it from a RunControl class by calling the setArchiverClass method.

Definition at line 20 of file rcArchiver.py.

The documentation for this class was generated from the following file:
  • rcArchiver.py
Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcCommentPanel Class Reference

rcCommentPanel.rcCommentPanel

rcCommentPanel Class Reference

List of all members.

Public Member Functions

getWidget ()
languageChange ()

Detailed Description

Definition at line 8 of file rcCommentPanel.py.

The documentation for this class was generated from the following file:
  • rcCommentPanel.py
Generated on Fri Jul 21 13:27:49 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcCompletionStatus Class Reference

rcComplStatus.rcCompletionStatus

rcCompletionStatus Class Reference

List of all members.

Public Member Functions

getCompletionStatusStr (status)
isCompletionStatus (status)
addCompletionStatus (status, statusStr)
getAll ()

Static Public Member Functions

static getCompletionStatus (statStr)

Detailed Description

This helper class provides methods to facilitate the management of completion codes.

Definition at line 8 of file rcComplStatus.py.

Member Function Documentation

addCompletionStatus | ( | status | ,
 |  | statusStr |
 | ) |

Adds the new completion status code and its description to the dictionary.

Parameters:
status | Completion status code
statusStr | Completion status description
Returns:
0: If add is successful. -1: If status code already exists. -2: If a duplicate description was found.

static getCompletionStatus ( statStr ) [static]

Return the completion status code based on the description.

Parameters:
statStr Completion status description
Returns:
Completion status code or None if it doesn't exist.

getCompletionStatusStr ( status )

Return the completion status string based on the code.

Parameters:
status Completion status code
Returns:
Completion status description or None if it doesn't exist.

isCompletionStatus ( status )

Check if status is already in the dictionary.

Parameters:
status Completion status code
Returns:
True : If it is already defined. False: Otherwise

The documentation for this class was generated from the following file:
  • rcComplStatus.py
Generated on Fri Jul 21 13:27:49 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcEndRunDlgImpl Class Reference

rcEndRunDlgImpl.rcEndRunDlgImpl

rcEndRunDlgImpl Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, fl=0)
initialize (secMan, loginId)
complStatusChanged (complStatusStr)
getNewCompletionStatus (curComplStatusStr)
ok ()
cancel ()
getCompletionStatusStr ()
enterComment (comment, addToHistory=0, source='system')
clearHistory ()

Detailed Description

Definition at line 11 of file rcEndRunDlgImpl.py.

The documentation for this class was generated from the following file:
  • rcEndRunDlgImpl.py
Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcFileSelector Class Reference

RunControlGUIImpl.rcFileSelector

rcFileSelector Class Reference

List of all members.

Public Member Functions

getValue ()

Detailed Description

Definition at line 48 of file RunControlGUIImpl.py.

The documentation for this class was generated from the following file:
  • RunControlGUIImpl.py
Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcFileSelector Class Reference

RunControlMainGUIImpl.rcFileSelector

rcFileSelector Class Reference

List of all members.

Public Member Functions

getValue ()

Detailed Description

Definition at line 71 of file RunControlMainGUIImpl.py.

The documentation for this class was generated from the following file:
  • RunControlMainGUIImpl.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcFitsWriter Class Reference

rcFitsWriter.rcFitsWriter

rcFitsWriter Class Reference

List of all members.

Public Member Functions

__init__ (filePath=None, fileName=None, mode=MODE_CREATE, format=FORMAT_WORD, tableSize=1000, compress=0, flushInterval=0, reportGen=None)
createNewTable (datagram_id=None, version_info=None)
bcLong2Int (datum)
write (rawEventData)
moveToHDU (tablenum)
read ()
close (inShutdown=0)
updateRunReportFields ()
setFlushInterval (flushInterval)
getStatus ()
getFileName ()
getFilePath ()
getHeaders ()
processTable ()

Detailed Description

Definition at line 12 of file rcFitsWriter.py.

Member Function Documentation

getHeaders ( )

If we are in read only mode and reportGen is provided then read the headers of off the FITS file

The documentation for this class was generated from the following file:
  • rcFitsWriter.py
Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcGEMDefaultTrigger Class Reference

rcDefaultTrigger.rcGEMDefaultTrigger

rcGEMDefaultTrigger Class Reference

rcGEMDefaultTrigger More...

Inheritance diagram for rcGEMDefaultTrigger:

[legend]
Collaboration diagram for rcGEMDefaultTrigger:

[legend]
List of all members.

Public Member Functions

__init__ ()
rcGEMDefaultTrigger constructor
conditions ()
conditions 'pure virtual' method
coincidences ()
Implementation of coincdences 'pure virtual' method from TrgUsingTiles.
inputEnables ()
Implementation of inputEnables 'pure virtual' method from TrgAbstract.
engines ()
Implementation of engines 'pure virtual' method from TrgAbstract.
useAcdAsTrigger ()
sweepOnShut ()
shut (sweepEvent=None, progress=None)

Detailed Description

rcGEMDefaultTrigger

Definition at line 23 of file rcDefaultTrigger.py.

Member Function Documentation

conditions ( )

conditions 'pure virtual' method

Returns:
A TrgConditionsValue object This object specifies the set of conditions to be enabled when the enable() member function is called

Reimplemented from TrgAbstract.

shut | ( | sweepEvent | = None,
 |  | progress | = None
 | ) |

Re-implementation of the shut function to take advantage of the fact that in rcTrgGem, trigger engine 15 is reserved for the marker.

Parameters:
sweepEvent,: A sweep Event() defined by runControl
progress,: An optional function that returns a non-zero value when when events are passing through the system. If omitted a fixed timeout is used.

Reimplemented from rcTrgGem.

sweepOnShut ( )

Returns whether or not shut() does a sweep event. Default true.

Returns:
a boolean

Reimplemented from rcTrgGem.

useAcdAsTrigger ( )

Don't use ACD as a trigger source.

Reimplemented from TrgUsingTiles.

The documentation for this class was generated from the following file:
  • rcDefaultTrigger.py
Generated on Fri Jul 21 13:27:49 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcGEMTrgEngines Class Reference

rcDefaultTrigger.rcGEMTrgEngines

rcGEMTrgEngines Class Reference

Inheritance diagram for rcGEMTrgEngines:

[legend]
Collaboration diagram for rcGEMTrgEngines:

[legend]
List of all members.

Public Member Functions

__init__ ()
rcTrgEngines constructor

Detailed Description

Class rcGEMTrgEngines: Initialize the trigger engines list class.

Definition at line 72 of file rcDefaultTrigger.py.

The documentation for this class was generated from the following file:
  • rcDefaultTrigger.py
Generated on Fri Jul 21 13:27:50 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcHouseKeeping Class Reference

rcHouseKeeping.rcHouseKeeping

rcHouseKeeping Class Reference

List of all members.

Public Member Functions

initialize (filePath=None, fileName=None, compress=0)
createNewTable ()
write ()
moveToHDU (tablenum)
read ()
close ()
setFlushInterval (flushInterval)
getStatus ()
getFileName (full=0)
setEnvRegs (regList, componentId=None)
addEnvRegs (regList, componentId=None)
setUpdateInterval (updateInterval)
stop ()
pause ()
resume ()
getRegLabel (reg)
getSampleCount ()
getEnvNames ()
getCachedValues ()
getCachedValue (reg, bypass=1, strVal=0)
getEnvQuantities (regList, bypass=0)
updateValues ()
start ()
run ()
checkStatus (cfitsio_function, status)

Detailed Description

Definition at line 14 of file rcHouseKeeping.py.

The documentation for this class was generated from the following file:
  • rcHouseKeeping.py
Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcLoginImpl Class Reference

rcLoginImpl.rcLoginImpl

rcLoginImpl Class Reference

Detailed Description

Definition at line 6 of file rcLoginImpl.py.

The documentation for this class was generated from the following file:
  • rcLoginImpl.py
Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcMiniGLTDefaultTrigger Class Reference

rcDefaultTrigger.rcMiniGLTDefaultTrigger

rcMiniGLTDefaultTrigger Class Reference

rcMiniGLTDefaultTrigger More...

Inheritance diagram for rcMiniGLTDefaultTrigger:

[legend]
Collaboration diagram for rcMiniGLTDefaultTrigger:

[legend]
List of all members.

Public Member Functions

__init__ ()
rcTrgGem constructor
engines ()
Implementation of engines 'pure virtual' method from TrgAbstract.
conditions ()
Implementation of conditions 'pure virtual' method from TrgAbstract.
sweepOnShut ()
shut (sweepEvent=None, progress=None)

Detailed Description

rcMiniGLTDefaultTrigger

Definition at line 53 of file rcDefaultTrigger.py.

Member Function Documentation

shut | ( | sweepEvent | = None,
 |  | progress | = None
 | ) |

Re-implementation of the shut function to take advantage of the fact that in rcTrgMiniGLT, trigger engine 0 is reserved for the marker.

Parameters:
sweepEvent,: A sweep Event() defined by runControl
progress,: An optional function that returns a non-zero value when when events are passing through the system. If omitted a fixed timeout is used.

Reimplemented from rcTrgMiniGLT.

sweepOnShut ( )

Returns whether or not shut() does a sweep event. Default true.

Returns:
a boolean

Reimplemented from rcTrgMiniGLT.

The documentation for this class was generated from the following file:
  • rcDefaultTrigger.py
Generated on Fri Jul 21 13:27:50 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcMiniGLTSolicitedCondition Class Reference

rcDefaultTrigger.rcMiniGLTSolicitedCondition

rcMiniGLTSolicitedCondition Class Reference

Inheritance diagram for rcMiniGLTSolicitedCondition:

[legend]
Collaboration diagram for rcMiniGLTSolicitedCondition:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgConditionsValue constructor.
solicited ()
solicited() 'pure virtual' method

Detailed Description

Define a condition where only the CNO trigger is asserted

Definition at line 119 of file rcDefaultTrigger.py.

Member Function Documentation

solicited ( )

solicited() 'pure virtual' method

Condition corresponding to a solicited trigger

Returns:
A boolean

Reimplemented from TrgConditionsValue.

The documentation for this class was generated from the following file:
  • rcDefaultTrigger.py
Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcMiniGLTSolicitedEngine Class Reference

rcDefaultTrigger.rcMiniGLTSolicitedEngine

rcMiniGLTSolicitedEngine Class Reference

Inheritance diagram for rcMiniGLTSolicitedEngine:

[legend]
Collaboration diagram for rcMiniGLTSolicitedEngine:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgEngine constructor.
participate (conditionsValue)
participate 'pure virtual' method Determines whether or not this engine participates when a particular conditionsValue is satisfied in the GEM.
prescale ()
prescale 'pure virtual' method
request ()
request 'pure virtual' method Return the TrgEngineRequest object corresponding to this engine.

Detailed Description

This class defines an engine which reads out the detector whenever there is a solicited trigger. This engine is not prescaled.

Definition at line 108 of file rcDefaultTrigger.py.

Member Function Documentation

participate ( conditionsValue )

participate 'pure virtual' method Determines whether or not this engine participates when a particular conditionsValue is satisfied in the GEM.

Parameters:
conditionsValue An integer
Returns:
A boolean

Reimplemented from TrgEngine.

prescale ( )

prescale 'pure virtual' method

Returns:
An integer

Reimplemented from TrgEngine.

request ( )

request 'pure virtual' method Return the TrgEngineRequest object corresponding to this engine.

Returns:
A TrgEngineRequest object

Reimplemented from TrgEngine.

The documentation for this class was generated from the following file:
  • rcDefaultTrigger.py
Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcMiniGLTTrgEngines Class Reference

rcDefaultTrigger.rcMiniGLTTrgEngines

rcMiniGLTTrgEngines Class Reference

Inheritance diagram for rcMiniGLTTrgEngines:

[legend]
Collaboration diagram for rcMiniGLTTrgEngines:

[legend]
List of all members.

Detailed Description

Definition at line 99 of file rcDefaultTrigger.py.

The documentation for this class was generated from the following file:
  • rcDefaultTrigger.py
Generated on Fri Jul 21 13:27:51 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcParamVerifier Class Reference

rcParamVerifier.rcParamVerifier

rcParamVerifier Class Reference

List of all members.

Public Member Functions

initialize (testName)
add (parName, parValue)
Add parameter and its value to the verify list.
getParameters (parName=None)
Retrive parameters to verify.
verify ()

Detailed Description

Definition at line 6 of file rcParamVerifier.py.

Member Function Documentation

add | ( | parName | ,
 |  | parValue |
 | ) |

Add parameter and its value to the verify list.

Parameters:
parName | Parameter name or description
parValue | Parameter value that the operator inputted

getParameters ( parName = None )

Retrive parameters to verify.

Parameters:
parName Parameter to retrieve from the verify list (optional)
Returns:
A list containing the parameter name and value tuple if parName is specified or A list of parameter name and value tuples if parName is None.

The documentation for this class was generated from the following file:
  • rcParamVerifier.py
Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcParamVerifyGUIImpl Class Reference

rcParamVerifyGUIImpl.rcParamVerifyGUIImpl

rcParamVerifyGUIImpl Class Reference

Parameter verifier GUI. More...

List of all members.

Public Member Functions

__init__ (args)
ParamCheckTableItem constructor.
rtti ()
Return the runtime type information value.
isChecked ()
Find out if the item is checked.
createEditor ()
Create an editor for the checkbox table item.
setContentFromEditor (w)
Set content from the editor.
doValueChanged ()
Emit a valueChanged signal.
__init__ (args)
ParamTextTableItem constructor.
alignment ()
Set alignment to left and center.
paint (p, cg, rect, selected)
Paint the table item.
setBold (bold)
Set the text item in bold.
__init__ (common, parent=None, name=None, fl=0)
rcParamVerifyGUIImpl constructor.
initialize (testName)
Initialize the GUI.
clearAllRows ()
Clear all rows.
cancel ()
Cancel button is clicked.
confirm ()
Confirm button is clicked.
addParameter (name, value)
Add parameter.
parameterClicked (row, col)
Signal that a table item has been changed.
allParametersChecked ()
Check if all parameters have been checked.

Detailed Description

Parameter verifier GUI.

Definition at line 15 of file rcParamVerifyGUIImpl.py.

Member Function Documentation

__init__ | ( | common | ,
 |  | parent | = None,
 |  | name | = None,
 |  | fl | = 0
 | ) |

rcParamVerifyGUIImpl constructor.

!

Parameters:
common | ScriptEngineCommon instance.
parent | Parent GUI
name | GUI name
fl | GUI flags

__init__ ( args )

ParamTextTableItem constructor.

!

Parameters:
*args Parameters

addParameter | ( | name | ,
 |  | value |
 | ) |

Add parameter.

!

Parameters:
name | Parameter name
value | Parameter value

allParametersChecked ( )

Check if all parameters have been checked.

!

Returns:
True: If all parameters have been checked. False: Not all parameters have been checked.

initialize ( testName )

Initialize the GUI.

!

Parameters:
testName Name of the test script

isChecked ( )

Find out if the item is checked.

!

Returns:
1: Checked, 0: Is not checked

paint | ( | p | ,
 |  | cg | ,
 |  | rect | ,
 |  | selected |
 | ) |

Paint the table item.

!

Parameters:
p | Painter
cg | Color group
rect | Rectangle
selected | Selected

parameterClicked | ( | row | ,
 |  | col |
 | ) |

Signal that a table item has been changed.

!

Parameters:
row | Table row
col | Table column

rtti ( )

Return the runtime type information value.

!

Returns:
RTTI

setBold ( bold )

Set the text item in bold.

!

Parameters:
bold Boolean

setContentFromEditor ( w )

Set content from the editor.

!

Parameters:
w Widget

The documentation for this class was generated from the following file:
  • rcParamVerifyGUIImpl.py
Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcPreferencesGUIImpl Class Reference

rcPreferencesGUIImpl.rcPreferencesGUIImpl

rcPreferencesGUIImpl Class Reference

List of all members.

Public Member Functions

applyPermissions (operator)
selectStyle (style)
selectFont ()
updateUserIDText ()
listUsersDblClick (item)
showUser (user)
checkModifyUserPermission (userId)
saveUser ()
addChangePassword ()
deleteUser ()
handleServerText ()
loadConfig ()
setupCombo (combo, group, last)
loadAndExit ()
writeConfig ()
sanityCheck (prefs)
screenToPrefs ()
cancel ()
default ()
choosePath (lineEdit, caption)
reposBrowser ()
appBrowser ()
dataBrowser ()
logBrowser ()
repBrowser ()
fitsBrowser ()
snapshotBrowser ()
exportBrowser ()
runIdBrowser ()

Detailed Description

Definition at line 14 of file rcPreferencesGUIImpl.py.

The documentation for this class was generated from the following file:
  • rcPreferencesGUIImpl.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcPreferencesManager Class Reference

rcPreferencesManager.rcPreferencesManager

rcPreferencesManager Class Reference

List of all members.

Public Member Functions

loadConfig ()
writeConfig ()
preferences ()
defPrefs ()
getConfigFile ()
refreshPrefs (newPrefs)
setPref (keyword, value)
parserToPrefs (confParser, prefs={})
prefsToParser ()
processLastItem (option, item, confParser)
loadDefaults (currentDir)
isnumeric (str)
setOperator (operator)
setParticleType (particleType)
setOrientation (orientation)
setSite (site)
setPhase (phase)
setInstrumentType (instrumentType)
userId ()

Detailed Description

Definition at line 14 of file rcPreferencesManager.py.

The documentation for this class was generated from the following file:
  • rcPreferencesManager.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcPythonShell Class Reference

rcPythonShell.rcPythonShell

rcPythonShell Class Reference

List of all members.

Public Member Functions

getParent ()
getWidget ()
languageChange ()

Detailed Description

Definition at line 10 of file rcPythonShell.py.

The documentation for this class was generated from the following file:
  • rcPythonShell.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcReportGen Class Reference

rcReportGen.rcReportGen

rcReportGen Class Reference

List of all members.

Public Member Functions

initialize (tstamp=None)
connectDB (dbname)
disconnectDB ()
addField (field, data, units=UNITS_STRING)
writeReportCSV ()
writeReportXML ()
writeReportSQL ()
readReportXML ()
getReportFields ()
getReportData ()
getReportUnits ()
getTimestamp ()
addShift (tstamp)
getShiftInfo (t)
obtainLocalTime (dateTime)
obtainGMTime (dateTime)
convertTimeTuple (timeTuple)
obtainCursor (table, filter)

Detailed Description

Definition at line 17 of file rcReportGen.py.

The documentation for this class was generated from the following file:
  • rcReportGen.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcRunIdHelper Class Reference

rcRunIdHelper.rcRunIdHelper

rcRunIdHelper Class Reference

List of all members.

Public Member Functions

__init__ (prefs)
currentRunId ()
nextRunId ()

Detailed Description

Definition at line 7 of file rcRunIdHelper.py.

The documentation for this class was generated from the following file:
  • rcRunIdHelper.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcScmCfgSelector Class Reference

rcScmCfgSelector.rcScmCfgSelector

rcScmCfgSelector Class Reference

List of all members.

Public Member Functions

__init__ (startwithDir, startwithFile, parent=None, name=None, fl=0)
getValue ()

Detailed Description

GUI for getting the SchemaConfig file to use.

Definition at line 7 of file rcScmCfgSelector.py.

The documentation for this class was generated from the following file:
  • rcScmCfgSelector.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcScmCfgSelText Class Reference

rcScmCfgSelector.rcScmCfgSelText

rcScmCfgSelText Class Reference

List of all members.

Public Member Functions

__init__ (startwith)
getValue ()

Detailed Description

Text user interface for getting the user to a SchemaConfig file

Definition at line 15 of file rcScmCfgSelector.py.

The documentation for this class was generated from the following file:
  • rcScmCfgSelector.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcSecurityMan Class Reference

rcSecurityMan.rcSecurityMan

rcSecurityMan Class Reference

List of all members.

Public Member Functions

__init__ (secureDir, users)
readPermissions ()
registerPermission (role, permission, permDesc)
checkPermission (user, permission)
roleHasPermission (role, permission)
getPermissions (role=None)
getPermissionDescription (permission)
getRoles ()
authenticateUser (loginId, password)
changePassword (loginId, password, userName, oldPassword="")
addPassword (loginId, password, userName)
checkPassword (loginId)
deleteUser (loginId)

Detailed Description

Security Manager class that contains user authentication and rights management routines.

Definition at line 18 of file rcSecurityMan.py.

Member Function Documentation

addPassword | ( | loginId | ,
 |  | password | ,
 |  | userName |
 | ) |

Add a new user to the password database

Parameters:
loginId | User's login id
password | The new password for the user
userName | User's full name
Returns:
-3: Error accessing the password database -2: User already exists in password database -1: Invalid login or password 0: Added user to the password database

authenticateUser | ( | loginId | ,
 |  | password |
 | ) |

Authenticate the user based on the given login id and password.

Parameters:
loginId | User's login id
password | User's password
Returns:
-1: User authentication failed, invalid user id or password -2: Password database is not accessible 0: Access granted

changePassword | ( | loginId | ,
 |  | password | ,
 |  | userName | ,
 |  | oldPassword | = ""
 | ) |

Change an existing user's password.

Parameters:
loginId | User's login id
password | The new password for the user
userName | User's full name
oldPassword | User's old password (optional). If this parameter is not specified the old password is not verified. This is useful when the password needs to be reset due to a forgotten password.
Returns:
-1: Invalid login or password -2: Password database is not accessible -3: Error accessing the password database 0: Password changed successfully

checkPassword ( loginId )

Checks if a user already has a password

Parameters:
loginId User's login id
Returns:
-1: Password does not exist 0: Password exists

checkPermission | ( | user | ,
 |  | permission |
 | ) |

Checks if the user has been granted the specified permission

Parameters:
user | rcUser object instance
permission | Permission name
Returns:
True: If the user is granted the permission False: Otherwise

deleteUser ( loginId )

Deletes the user based on the given login id and password.

Parameters:
loginId | User's login id
password | User's password
Returns:
-1: User authentication failed, invalid user id or password -2: Password database is not accessible 0: User deleted

getPermissionDescription ( permission )

Returns the description for the specified permission. If permission does not exist, returns None.

Parameters:
permission Permission name
Returns:
Permission description string

getPermissions ( role = None )

Returns the list of all permissions defined. If role has been specified then returns all permissions defined for that role.

Parameters:
role Role name
Returns:
List of sll permissions or permissions for the specified role

getRoles ( )

Returns the list of all roles defined.

Returns:
List of all roles.

readPermissions ( )

Read permissions from the security.cfg file and update user objects.

registerPermission | ( | role | ,
 |  | permission | ,
 |  | permDesc |
 | ) |

Method available to be called by a user script that allows the script to register a permission given a role and update any user permissions who belong in that role

Parameters:
role | Role name for the permission to be included.
permission | Permission name.
permDesc | Permission description

roleHasPermission | ( | role | ,
 |  | permission |
 | ) |

Check if permission exists in role.

Parameters:
role | Role name
permission | Permission name
Returns:
True: If role has permission. False: otherwise.

The documentation for this class was generated from the following file:
  • rcSecurityMan.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcSolicitedCondition Class Reference

rcDefaultTrigger.rcSolicitedCondition

rcSolicitedCondition Class Reference

Inheritance diagram for rcSolicitedCondition:

[legend]
Collaboration diagram for rcSolicitedCondition:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgConditionsValue constructor.
solicited ()
solicited() 'pure virtual' method

Detailed Description

Define a condition where only the solicited trigger is asserted

Definition at line 93 of file rcDefaultTrigger.py.

Member Function Documentation

solicited ( )

solicited() 'pure virtual' method

Condition corresponding to a solicited trigger

Returns:
A boolean

Reimplemented from TrgConditionsValue.

The documentation for this class was generated from the following file:
  • rcDefaultTrigger.py
Generated on Fri Jul 21 13:27:51 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcSolicitedEngine Class Reference

rcDefaultTrigger.rcSolicitedEngine

rcSolicitedEngine Class Reference

Inheritance diagram for rcSolicitedEngine:

[legend]
Collaboration diagram for rcSolicitedEngine:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgEngine constructor.
participate (conditionsValue)
participate 'pure virtual' method Determines whether or not this engine participates when a particular conditionsValue is satisfied in the GEM.
prescale ()
prescale 'pure virtual' method
request ()
request 'pure virtual' method Return the TrgEngineRequest object corresponding to this engine.

Detailed Description

This class defines an engine which reads out the detector whenever there is a solicited trigger. This engine is not prescaled.

Definition at line 82 of file rcDefaultTrigger.py.

Member Function Documentation

participate ( conditionsValue )

participate 'pure virtual' method Determines whether or not this engine participates when a particular conditionsValue is satisfied in the GEM.

Parameters:
conditionsValue An integer
Returns:
A boolean

Reimplemented from TrgEngine.

prescale ( )

prescale 'pure virtual' method

Returns:
An integer

Reimplemented from TrgEngine.

request ( )

request 'pure virtual' method Return the TrgEngineRequest object corresponding to this engine.

Returns:
A TrgEngineRequest object

Reimplemented from TrgEngine.

The documentation for this class was generated from the following file:
  • rcDefaultTrigger.py
Generated on Fri Jul 21 13:27:51 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcStatusMonitor Class Reference

rcStatusMonitor.rcStatusMonitor

rcStatusMonitor Class Reference

List of all members.

Public Member Functions

startWatch ()
stopWatch ()
addWatchItem (label, accessor, key=None, alarmExpr=None, offBoard=False)
updateWatchItems ()

Detailed Description

Definition at line 38 of file rcStatusMonitor.py.

The documentation for this class was generated from the following file:
  • rcStatusMonitor.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcStatusPanel Class Reference

rcStatusMonitor.rcStatusPanel

rcStatusPanel Class Reference

List of all members.

Public Member Functions

contextMenuShow (item, point, column)
copyToClipboard ()

Detailed Description

Definition at line 32 of file rcStatusMonitor.py.

The documentation for this class was generated from the following file:
  • rcStatusMonitor.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcSuite Class Reference

rcSuite.rcSuite

rcSuite Class Reference

List of all members.

Public Member Functions

__init__ (msg, suite, module)
beforeSetupSuite (suite)
afterSetupSuite (suite)
beforeStartSuite (suite)
afterStartSuite (suite)
beforeStopSuite (suite)
afterStopSuite (suite)
__init__ (logLevel="INFO")
launch (suiteClass, user, callbacks=None)
doStopRun ()
preferences ()
common ()
__init__ (gui, userId, debug)
setupSuite ()
rcPauseSuite ()
pauseSuite ()
rcSetupSuite ()
rcStartSuite (spawn=1)
stopSuite ()
rcStopSuite ()
scriptRun (module, context={})
resetSuiteScript ()
setCmdCli (cmdCli)
setEvtCli (evtCli)
getEvtCli ()
isSuiteScriptAborted ()
getScriptSequence ()
getScriptState ()
Return the state of the suite script.
getAppState ()
Return the state of the current script.
getApp ()
Return the instance of current script.
getSuite ()
Get the parent suite name of this suite.
setSuite (name)
Set the parent suite name of this suite.
getSuiteInstance ()
Return the parent suite instance that this suite is a part of.
setSuiteInstance (suiteInst)
Set the parent suite instance for this suite.
setSessionVar (key, value)
Set a session variable.
getSessionVar (key)
readSchema (scmCfgFile)
applyConfig (seq=None, gxbrd=None)
stopRequested ()
clearStopRequested ()
isPaused ()
isRunning ()
getName ()
startSuite ()

Detailed Description

Definition at line 11 of file rcSuite.py.

Member Function Documentation

getApp ( )

Return the instance of current script.

Returns the instance for the suite script or nested suite that is currently executing.

Returns:
userApplication or userSuite instance.

getAppState ( )

Return the state of the current script.

Returns:
State of the current script

getScriptState ( )

Return the state of the suite script.

Currently there are two states. 'RESET' or 'RUNNING'. If rcSetupSuite or rcStopSuite has completed execution then the state will be 'RESET'. If rcStartSuite started execution then the state will be 'RUNNING'.

Returns:
'RESET' or 'RUNNING'

getSessionVar ( key )

Retrieve the values of the session variable indicated by key.

Returns:
Session variable value

getSuite ( )

Get the parent suite name of this suite.

Returns:
Parent suite name or None.

getSuiteInstance ( )

Return the parent suite instance that this suite is a part of.

Returns:
Parent suite instance.

pauseSuite ( )

Override this method to do custom processing before the currently running application is paused. Pause can be rejected by not returning None

rcSetupSuite ( )

This method can be called from either RunControlMain or from another suite.

setSessionVar | ( | key | ,
 |  | value |
 | ) |

Set a session variable.

Do not use variable names beginning with the underscore ('_') character since these are reserved for RunControl

setSuite ( name )

Set the parent suite name of this suite.

Parameters:
name Parent suite name

setSuiteInstance ( suiteInst )

Set the parent suite instance for this suite.

Parameters:
suiteInst Parent suite instance.

setupSuite ( )

Override this method to do custom processing before the suite is started and/or to return a custom schema file

stopSuite ( )

Override this method to do custom processing before the suite is terminated

The documentation for this class was generated from the following file:
  • rcSuite.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcTest Class Reference

userAppBrowser.rcTest

rcTest Class Reference

List of all members.

Public Member Functions

addPanel (name, browser)
panels ()
preferences ()

Detailed Description

Definition at line 66 of file userAppBrowser.py.

The documentation for this class was generated from the following file:
  • userAppBrowser.py
Generated on Fri Jul 21 13:28:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcTestReport Class Reference

rcTestReport.rcTestReport

rcTestReport Class Reference

Test Report class for RunControl. More...

List of all members.

Public Member Functions

__init__ ()
initReport (title)
addHTML (htmlString, section=None)
addHeading (text)
addSection (caption, insert=1)
insertSection (sectionId, beforeSectionId=None)
addSectionItem (sectionId, label, text, url='')
addSectionImage (sectionId, caption, url, width='', height='')
addSectionTable (sectionId, border='1', width='')
addTableHeader (tableId, text, align='')
beginTableRow (tableId)
addTableData (text, url='', align='', width='')
findTag (node, tagName)
xmlToString ()
transformToFile (xslFileName, htmlFileName)
getReports ()
getChildNodes (node)

Detailed Description

Test Report class for RunControl.

This class provides a mechanism to create test reports in a well formed (XML) format using the provided report building methods and lets the user transform it to HTML format by providing an XSLT stylesheet template. A third-party tool called Pyana is used to do the transformation. A sample template (reportStyle.xsl.sample) is provided in the RunControl directory. For more information on XSLT see the following links:

XSL Transformations W3C Recommendation

XSLT Tutorial

Definition at line 26 of file rcTestReport.py.

Member Function Documentation

addHeading ( text )

Adds a heading to the report

Parameters:
text Heading text

addHTML | ( | htmlString | ,
 |  | section | = None
 | ) |

Adds an arbitrary HTML fragment to the end of the report or a section

Parameters:
htmlString | HTML fragment.
section | Optional section id that this HTML will be written to. If no section is specified then HTML is added to the end of the report.

addSection | ( | caption | ,
 |  | insert | = 1
 | ) |

Adds a section to the report and returns the section id.

Parameters:
caption | Section caption
insert | 0 = Do not insert the section into the report 1 = Insert the section into the report (default)
Returns:
Section id.

addSectionImage | ( | sectionId | ,
 |  | caption | ,
 |  | url | ,
 |  | width | = '',
 |  | height | = ''
 | ) |

Adds an image to a section. Images can have a caption, and an optional width and height. The url parameter specifies the location of the image.

Parameters:
sectionId | Id of the section that this image will be inserted in.
caption | Image caption
url | Image source URL
width | Optional width of the image
height | Optional height of the image

addSectionItem | ( | sectionId | ,
 |  | label | ,
 |  | text | ,
 |  | url | = ''
 | ) |

Adds a section item. Section items are entries with a label and text and an optional URL.

Parameters:
sectionId | Id of the section that this item will be inserted in.
label | Item label
text | Item text
url | Item URL

addSectionTable | ( | sectionId | ,
 |  | border | = '1',
 |  | width | = ''
 | ) |

Adds a table to a section. Border and width are optional

Parameters:
sectionId | Id of the section that this image will be inserted in.
border | Specifies whether the table will have a border or not. Default value is 1.
width | Specifies the width of the border in percentage relative to the width of the page.
Returns:
Table id.

addTableData | ( | text | ,
 |  | url | = '',
 |  | align | = '',
 |  | width | = ''
 | ) |

Adds a data column to the table row that was started by the last beginTableRow() call.

Parameters:
text | Text of the data column.
url | Optional. If the text refers to a hyperlink provide the URL here.
align | Optional text alignment.
width | Optional column width in percentage.

addTableHeader | ( | tableId | ,
 |  | text | ,
 |  | align | = ''
 | ) |

Adds one column header to the table.

Parameters:
tableId | Id of the table where column headers are being added.
text | Column header text.
align | Optional text alignment.

beginTableRow ( tableId )

Starts a table row.

Parameters:
tableId Id of the table where the row is being added.

initReport ( title )

Initializes the report class and provides a title for the report

Parameters:
title The title that will show in the window title of the HTML browser

insertSection | ( | sectionId | ,
 |  | beforeSectionId | = None
 | ) |

Inserts a previously added section (with insert=0) to the specified position in the report.

Parameters:
sectionId | Id of the section to be inserted
beforeSectionId | Id of the section that will come after the section specified by sectionId. If it is None then it is appended to the end. Defaults to None.

transformToFile | ( | xslFileName | ,
 |  | htmlFileName |
 | ) |

Based on the input template and output filename parameters creates an HTML report.

Parameters:
xslFileName | Input XSLT template file name.
htmlFileName | Output HTML filename.

The documentation for this class was generated from the following file:
  • rcTestReport.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcTransitions Class Reference

rcTransitions.rcTransitions

rcTransitions Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getFailedEvents ()
Return failed event count.
getFailedEventSends ()
Return number of failed event sends.
getSBCHandledEvents ()
Return number of events handled by the SBC.
getValidEvents ()
Return number of events successfully sent.
getDiscardedEvents ()
Return number of events discarded.
getLengthMismatchedEvents ()
Return number of length mismatched events.
getUnsentEvents ()
Return number of events filtered or prescaled.
getAvgDeadTime (temId=None)
Return the average deadtime.
getGemDeadTime ()
Return the Average GEM dead time as a percentage.
getRunId ()
Return the run id.
getSchemaConfigFile ()
Return the full path of the schema file.
getAddlInputFiles ()
Return a list containing the additional input files.
getRunMsgLogFile ()
Return the filename for the message log for the current run.
getArchiveFile ()
Return the filename for the archive file (LDF file).
getBadEventsFile ()
Return the filename for the bad events archive.
getErrorEventsFile ()
Return the filename for the error events archive.
getFITSfile ()
Return the filename for the FITS file.
getHSKfile ()
Return the filename for the housekeeping FITS file.
getPauseCount ()
Return number of times the test is paused.
getPausedTime ()
Return the amount of time spent in pause.
getEventCount ()
Return number of events received.
getElapsedTime ()
Return the elapsed time spent during test execution.
getEventRate ()
Return the event rate.
getSBCEventRate ()
Return the SBC event handling rate.
getInstEventRate ()
Return the instant event rate.
getInstSBCEventRate ()
Return the instant SBC event handling rate.
getInstDatagramSize ()
Return the instant datagram size.
getAvgDatagramSize ()
Return the instant datagram size divided by the number of events.
getInstByteRate ()
Return the instant datagram byte rate.
getStartTime ()
Return the test start time.
getEndTime ()
Return the test end time.
getBadEvents ()
Return number of events with a bad GGLT status.
getErrorEvents ()
Return number of error events.
getTrgParityErrorEvents ()
Return number of trigger parity error events.
getPacketErrorEvents ()
Return number of packet error events.
setCmdCli (cmdCli)
Set the command client instance (used in suites).
setEvtCli (evtCli)
Set the event client instance.
getEvtCli ()
Return the current event client instance.
getDataDistributor ()
Return the data distribution server instance.
setSessionVar (key, value)
Set session variable key to value value.
getSessionVar (key)
Return the session variable identified by key.
setPrefs (prefs)
Explicitly set preferences.
setCompletionStatus (completionStatus, completionStatusStr=None)
Sets the completion status of the test.
getCompletionStatus ()
Return the completion status code.
getCompletionStatusStr ()
Return the description of the completion status.
getSnapshotStatus (snapId=None)
Return snapshot result(s).
getHSK ()
Return the housekeeping class instance.
addCustomReportData (key, value)
Add custom report data to the run report.
getParameterVerifier ()
Return the parameter verifier instance.
addExportedFile (file=None, delete=False)
Add file to the list of files to be exported.
getFileTimeStamp ()
Return the formatted timestamp used to name output files.
getRawTimeStamp ()
Return the raw timestamp as returned from gmtime().
getSuite ()
Return the name of the suite that this script is a part of.
setSuite (suite)
Set name of the suite for this script.
getSuiteInstance ()
Return the suite instance that this script is a part of.
setSuiteInstance (suiteInst)
Set the suite instance for this script.
setLastSuiteScript ()
Set the script as the last one in the suite.
isLastSuiteScript ()
Check if the script is the last one.
getState ()
Return the state of the running script.
trigger (trg=None, replaceShut=True)
Return the trigger used in this script or initialize the trigger.
isRunFromSuite ()
Check if the script is being run from a suite.
takeSnapshot (stream=sys.stdout, fileName=None, captureGTIC=1, captureGAEQ=1, trigger=None, configName='', configVersion='')
Take a snapshot of the hardware.
readConfig (cfgFileName)
Read a configuration XML file.
applyConfig (seq=None, gxbrd=None)
Apply configuration.
setArchiverClass (archiverClass)
Set a custom archiver class.
getArchiverInstance ()
Return the archiver instance.
startExcludeTime ()
Save the start time for exclusion from the run's elapsed time.
endExcludeTime ()
Strobe the end time for exclusion from the run's elapsed time.
adjustExcludeTime (dExcludeTime)
This method allows adjustment of the amount of time to be excluded from the run's elapsed time.
rcSetup ()
Setup transition method.
rcTeardown ()
rcStartRun ()
rcStopRun ()
rcStop ()
rcPause ()
rcResume ()
getName ()
setup ()
teardown ()
startRun ()
stopRun ()
pause ()
resume ()
stop ()
process (eventBuffer)

Detailed Description

Class that handles the state machine transitions issued by Run Control

Definition at line 39 of file rcTransitions.py.

Member Function Documentation

addCustomReportData | ( | key | ,
 |  | value |
 | ) |

Add custom report data to the run report.

This method allows the application to add any additional data that Run Control is not already providing to the run report (rcReport.out).

When the custom report data gets processed and written to the database, it will go under the "AdditionFields" column. Please only provide values that can be converted to a string.

Parameters:
key | Custom report data identifier.
value | Custom report data value.

addExportedFile | ( | file | = None,
 |  | delete | = False
 | ) |

Add file to the list of files to be exported.

Parameters:
file | file to be added
delete | delete original on export (default False)

adjustExcludeTime ( dExcludeTime )

This method allows adjustment of the amount of time to be excluded from the run's elapsed time.

The amount of time to be excluded from the run's elapsed time can be adjusted positivily or negativily with this method. It does not take into account any other effects on the excluded time, such as whether the run was in the PAUSED state.

Parameters:
dExcludeTime The amount of time to be excluded as given by the difference of two time.time() values.

applyConfig | ( | seq | = None,
 |  | gxbrd | = None
 | ) |

Apply configuration.

Parameters:
seq | Sequence number of the configuration. If None, then apply all configurations.
gxbrd | Apply the GXBRD configuration as well. Disabled by default.

endExcludeTime ( )

Strobe the end time for exclusion from the run's elapsed time.

This method allows excluding some amount of time from the run's elapsed time. The end time is the time that the method is called. The difference between the end time and the start time is added to the excluded time.

getAddlInputFiles ( )

Return a list containing the additional input files.

This list is automatically generated from the XML files included in the schema using the <include> tag. The list contains only the filename portion and doesn't include the full path.

Returns:
List of additional input files.

getArchiveFile ( )

Return the filename for the archive file (LDF file).

Returns:
Archive filename.

getArchiverInstance ( )

Return the archiver instance.

Returns the archiver instance. Can be used by the user application.

Returns:
Archiver instance

getAvgDatagramSize ( )

Return the instant datagram size divided by the number of events.

Returns:
Average datagram size

getAvgDeadTime ( temId = None )

Return the average deadtime.

Returns the average deadtime as a percentage for a TEM specified by temId or all TEMs in the schema as a dictionary.

Returns:
Average deadtime(s)

getBadEvents ( )

Return number of events with a bad GGLT status.

Returns:
Number of bad events

getBadEventsFile ( )

Return the filename for the bad events archive.

Returns:
Bad events archive filename.

getCompletionStatus ( )

Return the completion status code.

Returns the code set by the script or COMPL_STATUS_UNDEFINED if it hasn't been set.

Returns:
Completion status code.

getCompletionStatusStr ( )

Return the description of the completion status.

Returns the code as set by the script or 'UNDEFINED' if it hasn't been set.

Returns:
Completion status description.

getDataDistributor ( )

Return the data distribution server instance.

Returns:
Data distribution server instance.

getDiscardedEvents ( )

Return number of events discarded.

OES increments this counter when an event has been discarded. Currently this method always returns 0.

Returns:
Number of events discarded.

getElapsedTime ( )

Return the elapsed time spent during test execution.

Returns:
Elapsed time.

getEndTime ( )

Return the test end time.

Returns:
Test end time in GMT as a tuple

getErrorEvents ( )

Return number of error events.

Returns:
Number of error events

getErrorEventsFile ( )

Return the filename for the error events archive.

Returns:
Error events archive filename.

getEventCount ( )

Return number of events received.

Returns:
Event count

getEventRate ( )

Return the event rate.

Returns:
Event rate.

getEvtCli ( )

Return the current event client instance.

Returns:
An EvtCli instance

getFailedEvents ( )

Return failed event count.

OES increments this counter when there is a packet transmission error.

Returns:
Failed event count.

getFailedEventSends ( )

Return number of failed event sends.

OES increments this counter when there is a TCP transport problem between the SBC and the teststand.

Returns:
Number of failed event sends.

getFileTimeStamp ( )

Return the formatted timestamp used to name output files.

Using this method, applications can request the formatted timestamp value used in naming archive, snapshot and housekeeping files. The format is YYMMDDHHMISS.

Returns:
Formatted GMT timestamp

getFITSfile ( )

Return the filename for the FITS file.

Returns:
FITS filename.

getHSK ( )

Return the housekeeping class instance.

Returns:
Housekeeping class instance

getHSKfile ( )

Return the filename for the housekeeping FITS file.

Returns:
Housekeeping FITS filename.

getInstByteRate ( )

Return the instant datagram byte rate.

Returns:
Average datagram byte rate

getInstDatagramSize ( )

Return the instant datagram size.

Returns:
Instant datagram size.

getInstEventRate ( )

Return the instant event rate.

Returns:
Instant event rate.

getInstSBCEventRate ( )

Return the instant SBC event handling rate.

Returns:
Instant SBC event handling rate.

getLengthMismatchedEvents ( )

Return number of length mismatched events.

OES increments this counter when an event size doesn't match the length specified in the event. Currently this method always returns 0.

Returns:
Number of length mismatched events.

getPacketErrorEvents ( )

Return number of packet error events.

Returns:
Number of packet error events

getParameterVerifier ( )

Return the parameter verifier instance.

Returns:
Parameter verifier instance

getPauseCount ( )

Return number of times the test is paused.

Returns:
Pause count

getPausedTime ( )

Return the amount of time spent in pause.

Returns:
Pause time.

getRawTimeStamp ( )

Return the raw timestamp as returned from gmtime().

Returns:
Raw GMT timestamp tuple.

getRunId ( )

Return the run id.

Returns:
Run id

getRunMsgLogFile ( )

Return the filename for the message log for the current run.

Returns:
Message log filename.

getSBCEventRate ( )

Return the SBC event handling rate.

Returns:
SBC event handling rate.

getSBCHandledEvents ( )

Return number of events handled by the SBC.

OES increments this counter when an event has been received by the event handler.

Returns:
Number of events handled by the SBC.

getSchemaConfigFile ( )

Return the full path of the schema file.

Returns:
Schema file path

getSessionVar ( key )

Return the session variable identified by key.

Parameters:
key Session variable identifier.
Returns:
Value of the session variable if it exists, otherwise None.

getSnapshotStatus ( snapId = None )

Return snapshot result(s).

Returns a dictionary of snapshot results or if snapId is specified, returns the corresponding snapshot status.

Parameters:
snapId Optional snapshot id.
Returns:
Snapshot status as a boolean or status dictionary. None, if a snapshot with an id of snapId doesn't exist.

getStartTime ( )

Return the test start time.

Returns:
Test start time in GMT as a tuple

getState ( )

Return the state of the running script.

If the script is running as part of a suite then the script state is simulated.

Returns:
Script state

getSuite ( )

Return the name of the suite that this script is a part of.

Returns:
Suite name.

getSuiteInstance ( )

Return the suite instance that this script is a part of.

Returns:
Suite instance.

getTrgParityErrorEvents ( )

Return number of trigger parity error events.

Returns:
Number of trigger parity error events

getUnsentEvents ( )

Return number of events filtered or prescaled.

OES increments this counter when there is a filter or prescale set that prevents the event from being transmitted.

Returns:
Number of unsent events.

getValidEvents ( )

Return number of events successfully sent.

OES increments this counter when an event has been successfully transmitted to the teststand.

Returns:
Number of valid events sent.

isRunFromSuite ( )

Check if the script is being run from a suite.

Returns:
True If the script is being run from a suite, False otherwise.

pause ( )

Method that is called on the PAUSE transition

process ( eventBuffer )

Method that is called on every data event taken

readConfig ( cfgFileName )

Read a configuration XML file.

Parameters:
cfgFileName Full path of the configuration file.
Returns:
Sequence number for this configuration. This number can later be passed to applyConfig.

resume ( )

Method that is called on the RESUME transition

setArchiverClass ( archiverClass )

Set a custom archiver class.

Check if FSM is None in case we are in a suite Set a custom archiver class. This is typically done in the __init__ method of the userApplication class.

Parameters:
The archiver class (not the instance)

setCmdCli ( cmdCli )

Set the command client instance (used in suites).

Parameters:
A CmdCli instance

setCompletionStatus | ( | completionStatus | ,
 |  | completionStatusStr | = None
 | ) |

Sets the completion status of the test.

Please use one of the following:

  • COMPL_STATUS_ABORTED = -2
  • COMPL_STATUS_ERROR = -3
  • COMPL_STATUS_FAILED = -3
  • COMPL_STATUS_SUCCESS = 0
  • COMPL_STATUS_PASSED = 0
  • COMPL_STATUS_PASSED_CONDITIONALLY = -4
  • COMPL_STATUS_MARGINAL = -5

Or a user defined completion status in which case a description needs to be supplied along with the code.

Parameters:
completionStatus | Numeric completion status code
completionStatusStr | Completion status description

setEvtCli ( evtCli )

Set the event client instance.

Used to set the custom event client.

Parameters:
A CmdCli instance

setLastSuiteScript ( )

Set the script as the last one in the suite.

Called from rcSuite.

setPrefs ( prefs )

Explicitly set preferences.

When scripts are run in standalone mode it may be necessary to pass in a script defined set of preferences.

The preferences specified in prefs get appended to the set of preferences read from the configuration file.

Parameters:
prefs Preferences as a dictionary.

setSessionVar | ( | key | ,
 |  | value |
 | ) |

Set session variable key to value value.

Session variables are data that is shared between different runs. They exist as long as the run control session they are defined in. Typical uses of session variables are to pass data from one suite script to another or to maintain state during a multiple step test run.

Parameters:
key | Session variable identifier.
value | Session variable value.

setSuite ( suite )

Set name of the suite for this script.

Called from rcSuite.

Parameters:
suite Name of the suite

setSuiteInstance ( suiteInst )

Set the suite instance for this script.

Called from rcSuite.

Parameters:
suiteInst Suite instance.

setup ( )

Method that is called on the SETUP transition

startExcludeTime ( )

Save the start time for exclusion from the run's elapsed time.

This method allows excluding some amount of time from the run's elapsed time. The start time is the time that the method is called.

Note that time spent in the PAUSED state is also excluded from the elapsed time value. Overlapping time is excluded from the elapsed time only once.

startRun ( )

Method that is called on the START_RUN transition

stop ( )

Method that is called on the STOP transition

stopRun ( )

Method that is called on the STOP_RUN transition

takeSnapshot | ( | stream | = sys.stdout,
 |  | fileName | = None,
 |  | captureGTIC | = 1,
 |  | captureGAEQ | = 1,
 |  | trigger | = None,
 |  | configName | = '',
 |  | configVersion | = ''
 | ) |

Take a snapshot of the hardware.

If snapshots are enabled in Run Control preferences, two snapshots will be taken, one before and one after the test has been run. This method allows the application to take a snapshot at a specific point of the run.

It is the application's responsibility to add the resulting file to the list of exported files by calling the addExportedFile method.

Since snapshots essentially have the same format as configuration blocks, configName and configVersion parameters can be used to output a named configuration.

Parameters:
stream | Output stream for the snapshot. sys.stdout by default.
fileName | Full path of the snapshot file.
captureGTIC | Capture TEM environmental quantities. Enabled by default.
captureGAEQ | Capture AEM environmental quantities. Enabled by default.
trigger | Trigger object. If miniGLT is used as a trigger then GLT registers can be snapshot.
configName | Configuration name
configVersion | Configuration version
Returns:
True if the snapshot was successful, False if errors were encountered during snapshot

teardown ( )

Method that is called on the TEARDOWN transition

trigger | ( | trg | = None,
 |  | replaceShut | = True
 | ) |

Return the trigger used in this script or initialize the trigger.

Parameters:
trg | Trigger object.
replaceShut | Flag to specify whether the trigger's default shut logic should be wrapped by Run Control's LATsweep shut logic. Default is True.
Returns:
Trigger object.

The documentation for this class was generated from the following file:
  • rcTransitions.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcTransitionsBT Class Reference

rcTransitionsBT.rcTransitionsBT

rcTransitionsBT Class Reference

List of all members.

Public Member Functions

autoStopRun (value=None)
rcSetup ()
rcTeardown ()
eventHandler ()

Detailed Description

Definition at line 13 of file rcTransitionsBT.py.

The documentation for this class was generated from the following file:
  • rcTransitionsBT.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcTrgCoincidence Class Reference

rcTrgFunctions.rcTrgCoincidence

rcTrgCoincidence Class Reference

rcTrgCoincidence class More...

Inheritance diagram for rcTrgCoincidence:

[legend]
Collaboration diagram for rcTrgCoincidence:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgCoincidence constructor.
addPair (tile1, tile2)
addPair(tile1, tile2)
inCoincidence (tileNumber)
InCoincidence 'pure virtual' method To be satisfied by the user.

Detailed Description

rcTrgCoincidence class

Class to provide a function to add tiles to coincidence sets. Also does checking to see if tiles are in the allowed tile set

Definition at line 112 of file rcTrgFunctions.py.

Member Function Documentation

addPair | ( | tile1 | ,
 |  | tile2 |
 | ) |

addPair(tile1, tile2)

Parameters:
tile1 | an integer
tile2 | an integer
Add a tile pair, tile1,tile2 to a coincidence list. Note, the set of tile1 objects must be unique.

inCoincidence ( tileNumber )

InCoincidence 'pure virtual' method To be satisfied by the user.

Parameters:
tileNumber A tile number [0..107]
Returns:
An integer

Reimplemented from TrgCoincidence.

The documentation for this class was generated from the following file:
  • rcTrgFunctions.py
Generated on Fri Jul 21 13:27:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcTrgEngines Class Reference

rcTrgFunctions.rcTrgEngines

rcTrgEngines Class Reference

rcTrgEngines Class More...

Inheritance diagram for rcTrgEngines:

[legend]
Collaboration diagram for rcTrgEngines:

[legend]
List of all members.

Public Member Functions

__init__ ()
rcTrgEngines constructor
replaceEngine (engineNumber, engine)
replaceEngine() method
engine (engineNumber)
engine() method

Detailed Description

rcTrgEngines Class

Setup a LATTE based trigger engine system. All sixteen (16) engines are defined. [0..14] are NullEngine, the last is a reserved engine that transmits the sweep marker on transitions.

Definition at line 28 of file rcTrgFunctions.py.

Member Function Documentation

engine ( engineNumber )

engine() method

Return one of the engines

Parameters:
engineNumber,: The engine to return

Reimplemented from TrgEngines.

replaceEngine | ( | engineNumber | ,
 |  | engine |
 | ) |

replaceEngine() method

Replace one of the engines.

Parameters:
engineNumber,: The engine number to replace [0..13]
engine,: The replacement engine

The documentation for this class was generated from the following file:
  • rcTrgFunctions.py
Generated on Fri Jul 21 13:27:54 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcTrgGem Class Reference

rcTrgGem.rcTrgGem

rcTrgGem Class Reference

rcTrgGem class definition This class implements a 'threaded' model for enabling/disabling the trigger More...

Inheritance diagram for rcTrgGem:

[legend]
Collaboration diagram for rcTrgGem:

[legend]
List of all members.

Public Member Functions

__init__ ()
commit (gem=None)
public commit function
waitForMaskEnable (tmo=None)
getEnableTime ()
getDisableTime ()
getTimeStamp ()
sweepOnShut ()
enable (mask=None)
disable ()
shut (sweepEvent, progress=None)

Detailed Description

rcTrgGem class definition This class implements a 'threaded' model for enabling/disabling the trigger

Definition at line 18 of file rcTrgGem.py.

Member Function Documentation

__init__ ( )

rcTrgGem constructor

Reimplemented from TrgGem.

Reimplemented in rcGEMDefaultTrigger, and TrgUsingTiles.

commit ( gem = None )

public commit function

This function commits the configuration defined by this TrgGem object to the hardware. It does *all* the registers. This function should never be called by anyone other than Run Control.

disable ( )

Re-implementation of the disable() function to take advantage of threading

Reimplemented from TrgGem.

enable ( mask = None )

Re-implementation of the enable() function to take advantage of threading

Reimplemented from TrgGem.

getDisableTime ( )

Returns the VxWorks timestamp at the time the triggers are disabled

Returns:
Trigger disable time

getEnableTime ( )

Returns the VxWorks timestamp at the time the triggers are enabled

Returns:
Trigger enable time

getTimeStamp ( )

Returns the VxWorks timestamp for the last time a self-trigger was asserted.

Returns:
Trigger timestamp

shut | ( | sweepEvent | ,
 |  | progress | = None
 | ) |

Re-implementation of the shut function to take advantage of the fact that in rcTrgGem, trigger engine 15 is reserved for the marker.

Parameters:
sweepEvent,: A sweep Event() defined by runControl
progress,: An optional function that returns a non-zero value when when events are passing through the system. If omitted a fixed timeout is used.

Reimplemented in rcGEMDefaultTrigger.

sweepOnShut ( )

Returns whether or not shut() does a sweep event. Default true.

Returns:
a boolean

Reimplemented in rcGEMDefaultTrigger.

waitForMaskEnable ( tmo = None )

Waits until the enableMask() method is called. This is usually needed by non-self-triggering scripts where the _commandSynch thread needs to wait until RunControl actually enables the mask before continuing.

Parameters:
tmo Optional parameter giving the wait timeout in seconds

The documentation for this class was generated from the following file:
  • rcTrgGem.py
Generated on Fri Jul 21 13:27:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcTrgInjectMarker Class Reference

rcTrgFunctions.rcTrgInjectMarker

rcTrgInjectMarker Class Reference

Inheritance diagram for rcTrgInjectMarker:

[legend]
Collaboration diagram for rcTrgInjectMarker:

[legend]
List of all members.

Public Member Functions

zeroSuppress ()
zeroSuppress 'virtual' method Return TRUE if the zero-suppression is enabled, else FALSE.
sequence ()
sequence() method See TrgEngineRequest base class

Detailed Description

Definition at line 84 of file rcTrgFunctions.py.

Member Function Documentation

zeroSuppress ( )

zeroSuppress 'virtual' method Return TRUE if the zero-suppression is enabled, else FALSE.

Returns:
A boolean

Reimplemented from TrgEngineRequest.

The documentation for this class was generated from the following file:
  • rcTrgFunctions.py
Generated on Fri Jul 21 13:27:55 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcTrgMiniGLT Class Reference

rcTrgMiniGLT.rcTrgMiniGLT

rcTrgMiniGLT Class Reference

rcTrgMiniGLT class definition This class implements a 'threaded' model for enabling/disabling the trigger More...

Inheritance diagram for rcTrgMiniGLT:

[legend]
Collaboration diagram for rcTrgMiniGLT:

[legend]
List of all members.

Public Member Functions

__init__ ()
rcTrgGem constructor
commit ()
public commit function This function commits the configuration defined by this TrgGem object to the hardware. It does *all* the registers. This function should never be called by anyone other than Run Control.
waitForMaskEnable (tmo=None)
getEnableTime ()
getDisableTime ()
getTimeStamp ()
sweepOnShut ()
enable (newMask=None)
disable ()
shut (sweepEvent, progress=None)

Detailed Description

rcTrgMiniGLT class definition This class implements a 'threaded' model for enabling/disabling the trigger

Definition at line 18 of file rcTrgMiniGLT.py.

Member Function Documentation

disable ( )

Re-implementation of the disable() function to take advantage of threading and timestamps

Reimplemented from TrgMiniGLT.

enable ( newMask = None )

Re-implementation of the enable() function to take advantage of threading and timestamps

Adds an argument to deal with several weird masking problems Only rcTransitions should use the above argument

getDisableTime ( )

Returns the VxWorks timestamp at the time the triggers are disabled

Returns:
Trigger disable time

getEnableTime ( )

Returns the VxWorks timestamp at the time the triggers are enabled

Returns:
Trigger enable time

getTimeStamp ( )

Returns the VxWorks timestamp for the last time a self-trigger was asserted.

Returns:
Trigger timestamp

shut | ( | sweepEvent | ,
 |  | progress | = None
 | ) |

Re-implementation of the shut function to take advantage of the fact that in rcTrgMiniGLT, trigger engine 0 is reserved for the marker.

Parameters:
sweepEvent,: A sweep Event() defined by runControl
progress,: An optional function that returns a non-zero value when when events are passing through the system. If omitted a fixed timeout is used.

Reimplemented in rcMiniGLTDefaultTrigger.

sweepOnShut ( )

Returns whether or not shut() does a sweep event. Default true.

Returns:
a boolean

Reimplemented in rcMiniGLTDefaultTrigger.

waitForMaskEnable ( tmo = None )

Waits until the enableMask() method is called. This is usually needed by non-self-triggering scripts where the _commandSynch thread needs to wait until RunControl actually enables the mask before continuing.

Parameters:
tmo Optional parameter giving the wait timeout in seconds

The documentation for this class was generated from the following file:
  • rcTrgMiniGLT.py
Generated on Fri Jul 21 13:27:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcTrgTileEnables Class Reference

rcTrgFunctions.rcTrgTileEnables

rcTrgTileEnables Class Reference

rcTrgTileEnables class More...

Inheritance diagram for rcTrgTileEnables:

[legend]
Collaboration diagram for rcTrgTileEnables:

[legend]
List of all members.

Public Member Functions

__init__ ()
rcTrgTileEnables constructor
tile (tileNumber)
Tile 'pure virtual' method.
addTile (tileNumber, side)

Detailed Description

rcTrgTileEnables class

Class to abstract the additions of tiles to the input enable list. All tiles *not* in the enable list are specifically disabled

Definition at line 96 of file rcTrgFunctions.py.

Member Function Documentation

tile ( tileNumber )

Tile 'pure virtual' method.

Parameters:
tileNumber A tile number
Returns:
An integer

Reimplemented from TrgTileEnables.

The documentation for this class was generated from the following file:
  • rcTrgFunctions.py
Generated on Fri Jul 21 13:27:55 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcTrgTowerBusyEnables Class Reference

rcTrgFunctions.rcTrgTowerBusyEnables

rcTrgTowerBusyEnables Class Reference

rcTrgTowerBusyEnables class More...

Inheritance diagram for rcTrgTowerBusyEnables:

[legend]
Collaboration diagram for rcTrgTowerBusyEnables:

[legend]
List of all members.

Public Member Functions

__init__ ()
rcTrgTowerBusyEnables constructor
tower (towerNumber)
tower 'pure virtual' method
addTower (towerNumber)

Detailed Description

rcTrgTowerBusyEnables class

Class to abstract the additions of towers to the tower-busy enable list. All towers *not* in the enable list are specifically disabled

Definition at line 143 of file rcTrgFunctions.py.

Member Function Documentation

tower ( towerNumber )

tower 'pure virtual' method

Parameters:
towerNumber A tower number
Returns:
A boolean

Reimplemented from TrgTowerBusyEnables.

The documentation for this class was generated from the following file:
  • rcTrgFunctions.py
Generated on Fri Jul 21 13:27:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcUser Class Reference

rcUsers.rcUser

rcUser Class Reference

List of all members.

Public Member Functions

__init__ (userId, loginId, userName)
getId ()
getLoginId ()
getName ()
getRoles ()
getPermissions ()
addRole (role)
addPermission (permission)
isAdministrator ()
__str__ ()

Detailed Description

Class that stores security and identification information about users

Definition at line 7 of file rcUsers.py.

Member Function Documentation

addPermission ( permission )

Adds permission to this user's permissions

Parameters:
permission Permission name

addRole ( role )

Adds role to this user's roles

Parameters:
role Role name

getId ( )

Returns the three digit user id

Returns:
User Id

getLoginId ( )

Returns the user's login id

Returns:
Login id

getName ( )

Returns the user name

Returns:
User name

getPermissions ( )

Returns the list of permissions that this user has

Returns:
List of permissions

getRoles ( )

Returns the list of roles that this user belongs in

Returns:
List of roles

isAdministrator ( )

Returns the user's administrator status

Returns:
1: If this user is an administrator 0: Otherwise

The documentation for this class was generated from the following file:
  • rcUsers.py
Generated on Fri Jul 21 13:27:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcUsers Class Reference

rcUsers.rcUsers

rcUsers Class Reference

List of all members.

Public Member Functions

__init__ ()
addUser (user)
deleteUser (userId)
getUserByLoginId (loginId)
getUserByName (name)
getUser (userId)
getUsers ()
getIdNameDict ()

Detailed Description

A dictionary like class that maintains a list of user objects

Definition at line 65 of file rcUsers.py.

Member Function Documentation

addUser ( user )

Adds the user to the list

Parameters:
user An rcUser object instance

deleteUser ( userId )

Deletes the user from the list based on the userId

Parameters:
userId The three digit id of the user
Returns:
True: If the user was successfully deleted False: If the user does not exist

getIdNameDict ( )

Retrieves all users in the form of a dictionary where values are user names. Provided for backward compatibility with the old code.

Returns:
A dictionary of user names keyed by the user id

getUser ( userId )

Retrieves the user based on userid

Parameters:
Three digit of the user
Returns:
rcUser object instance

getUserByLoginId ( loginId )

Retrieves the user based on the loginId

Parameters:
loginId Login id of the user
Returns:
rcUser object instance

getUserByName ( name )

Retrieves the user based on the name

Parameters:
name Name of the user
Returns:
rcUser object instance

getUsers ( )

Retrieves all users

Returns:
A dictionary of all users keyed by the user id

The documentation for this class was generated from the following file:
  • rcUsers.py
Generated on Fri Jul 21 13:27:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Receiver Class Reference

Receiver.Receiver

Receiver Class Reference

Abstract Receiver class. More...

Inheritance diagram for Receiver:

[legend]
List of all members.

Public Member Functions

__init__ ()
isReceiving ()
setReceiving (bool)
shutdown ()
receive ()
process (trendables)

Detailed Description

Abstract Receiver class.

Receiver objects retrieve the trendable data from some location.

Definition at line 12 of file Receiver.py.

The documentation for this class was generated from the following file:
  • Receiver.py
Generated on Fri Jul 21 13:27:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Recorder Class Reference

Recorder.Recorder

Recorder Class Reference

Recorder class. More...

Inheritance diagram for Recorder:

[legend]
List of all members.

Public Member Functions

__init__ ()
updateTrends (trendables)
processTrends (trendables)
shutdown ()

Detailed Description

Recorder class.

Base class for the Recorder portion of the monitoring system. Recorders send on the data that the Retriever class acquires.

Definition at line 12 of file Recorder.py.

The documentation for this class was generated from the following file:
  • Recorder.py
Generated on Fri Jul 21 13:27:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Register Class Reference

gRegister.Register

Register Class Reference

List of all members.

Public Member Functions

timestamp ()
status ()
value ()

Detailed Description

Definition at line 5 of file gRegister.py.

The documentation for this class was generated from the following file:
  • gRegister.py
Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: RegisterInterface Class Reference

HskRegisters.RegisterInterface

RegisterInterface Class Reference

List of all members.

Public Member Functions

__init__ (node, name)
RegisterReader constructor.
name ()
write (value)

Detailed Description

Represents a LAT housekeeping register for reading.

Definition at line 10 of file HskRegisters.py.

Member Function Documentation

__init__ | ( | node | ,
 |  | name |
 | ) |

RegisterReader constructor.

Parameters:
node,: a gNode (like GAEQ)
name,: a name (like env_free_1la)

write ( value )

writes to the register

The documentation for this class was generated from the following file:
  • HskRegisters.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: RegViewItem Class Reference

BrowserImpl.RegViewItem

RegViewItem Class Reference

List of all members.

Public Member Functions

paintCell (p, cg, column, width, align)
setError (error)

Detailed Description

Definition at line 116 of file BrowserImpl.py.

The documentation for this class was generated from the following file:
  • BrowserImpl.py
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Reloader Class Reference

rcUtil.Reloader

Reloader Class Reference

List of all members.

Public Member Functions

__init__ ()
getNewModules (keepem)
clearAppModules (dontReloadList, showUnloadedModules)
filterModules (modules, dontReloadList)

Detailed Description

Definition at line 11 of file rcUtil.py.

The documentation for this class was generated from the following file:
  • rcUtil.py
Generated on Fri Jul 21 13:27:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Response Class Reference

gResponse.Response

Response Class Reference

List of all members.

Public Member Functions

timestamp ()
status ()
rvalue ()
value ()
payloads ()

Detailed Description

Definition at line 6 of file gResponse.py.

The documentation for this class was generated from the following file:
  • gResponse.py
Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Retriever Class Reference

Retriever.Retriever

Retriever Class Reference

Inheritance diagram for Retriever:

[legend]
List of all members.

Public Member Functions

startup ()
shutdown ()
retrievePacket ()

Detailed Description

Definition at line 6 of file Retriever.py.

The documentation for this class was generated from the following file:
  • Retriever.py
Generated on Fri Jul 21 13:27:59 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ReverseTrendMap Class Reference

TrendMaps.ReverseTrendMap

ReverseTrendMap Class Reference

Inheritance diagram for ReverseTrendMap:

[legend]
Collaboration diagram for ReverseTrendMap:

[legend]
List of all members.

Public Member Functions

__init__ (startMap)
mapSet (key, value)
mapGet (key)
mapKeys ()

Detailed Description

Class to create a reverse map from a TrendMap using gnodes as function ptrs such as GHSKTrendMap and GLATTrendMap

Definition at line 29 of file TrendMaps.py.

The documentation for this class was generated from the following file:
  • TrendMaps.py
Generated on Fri Jul 21 13:28:06 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: RunControl Class Reference

RunControl.RunControl

RunControl Class Reference

Inheritance diagram for RunControl:

[legend]
Collaboration diagram for RunControl:

[legend]
List of all members.

Public Member Functions

__init__ (common, parent=None, name=None, fl=0)
disconnected ()
timedout ()
connectClicked ()
userId ()
SetupClicked ()
TeardownClicked ()
StartRunClicked ()
StopRunClicked ()
PauseClicked ()
ResumeClicked ()
StopClicked ()
load ()
fileExit ()
ExitButtonClicked ()
doReset ()
doStop ()
doStopRun ()
doRun ()
doPause ()
doEmit (obj, signal=SIGNAL("clicked()"), args=())
normalCursor ()
waitCursor ()
getHardwareVersions (lat=None)
clearHardwareVersionsCache ()
getFSM ()
setLAT (lat)
initGUIbridges ()
isGUIthread ()
customEvent (e)
createGUI (obj, args, kwargs)
execGUImethodNR (func, args, kwargs)
execGUImethod (func, args, kwargs)

Detailed Description

Class for providing a run control framework

Definition at line 32 of file RunControl.py.

Member Function Documentation

createGUI | ( | obj | ,
 |  | args | ,
 |  | kwargs |
 | ) |

Method used for instantiating a GUI from a non-GUI subthread

doEmit | ( | obj | ,
 |  | signal | = SIGNAL("clicked()"),
 |  | args | = ()
 | ) |

Emit a signal, possibly from a subthread. By default the signal is 'clicked()' with no arguments.

doPause ( )

Emit a Pause button click under program control. Can be done from a subthread.

doReset ( )

Emit a Reset button click under program control. Can be done from a subthread.

doRun ( )

Emit a Run button click under program control. Can be done from a subthread.

doStop ( )

Emit a Stop button click under program control. Can be done from a subthread.

doStopRun ( )

Depricated version of doStop().

execGUImethod | ( | func | ,
 |  | args | ,
 |  | kwargs |
 | ) |

Method used for executing a GUI function from a non-GUI thread. Use this method when a response is expected from the function and when it is appropriate to wait for it (no deadlock arises)

execGUImethodNR | ( | func | ,
 |  | args | ,
 |  | kwargs |
 | ) |

Method used for executing a GUI function from a non-GUI thread. Use this method when no (useful) response is expected or when waiting for one could cause a deadlock. Any response from the function is lost.

The documentation for this class was generated from the following file:
  • RunControl.py
Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: RunControlCommon Class Reference

RunControlCommon.RunControlCommon

RunControlCommon Class Reference

List of all members.

Public Member Functions

__init__ ()
initialize (startup=False)
connect (force=False)
disconnect ()
readSchema (filename)
elogWebsite ()
EBFdistribution ()
setLoggingLevel (logLevel=None)
startLogger (startup=True)
stopRunLog (fileHdlr)
startRunLog (fileName)
options ()
prefMan ()
prefGUI ()
getMSGLogger ()
getDDS ()
getCmdCli ()
getEvtCli ()
getLAT ()
getXBRD ()
getOCS ()
getDBN ()
getSecurityMan ()
getQtApp ()
getLoginId ()
getErrorLogCount ()
incrementErrorLogCount ()
resetErrorLogCount ()
showLogin (parent)
getHardwareVersions (lat=None, xbrd=None)
clearHardwareVersionsCache ()

Detailed Description

Common class for providing a run control helper functions

Definition at line 77 of file RunControlCommon.py.

Member Function Documentation

getLoginId ( )

Returns the login id for the last successful login

The documentation for this class was generated from the following file:
  • RunControlCommon.py
Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: RunControlFileHandler Class Reference

RunControlCommon.RunControlFileHandler

RunControlFileHandler Class Reference

FileHandler class for handling multiple line log entries. More...

List of all members.

Public Member Functions

__init__ (filename, mode)
emit (record)

Detailed Description

FileHandler class for handling multiple line log entries.

If a log entry contains multiple lines, such as the case for tracebacks or exceptions a begin and end delimiter is added to the log entry so that it can be parsed by the MessageLogger

Definition at line 68 of file RunControlCommon.py.

The documentation for this class was generated from the following file:
  • RunControlCommon.py
Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: RunControlFSM Class Reference

RunControlFSM.RunControlFSM

RunControlFSM Class Reference

Inheritance diagram for RunControlFSM:

[legend]
Collaboration diagram for RunControlFSM:

[legend]
List of all members.

Public Member Functions

error ()
setup ()
teardown ()
startRun ()
stopRun ()
pause ()
resume ()
stop ()

Detailed Description

Definition at line 7 of file RunControlFSM.py.

The documentation for this class was generated from the following file:
  • RunControlFSM.py
Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: RunControlGUIImpl Class Reference

RunControlGUIImpl.RunControlGUIImpl

RunControlGUIImpl Class Reference

Inheritance diagram for RunControlGUIImpl:

[legend]
List of all members.

Public Member Functions

__init__ (common, parent=None, name=None, fl=0)
common ()
preferences ()
getCommentWidget ()
PreferencesActivated ()
SetupClicked ()
TeardownClicked ()
StartRunClicked ()
StopRunClicked ()
PauseClicked ()
ResumeClicked ()
StopClicked ()
load ()
loadSchema ()
ExitButtonClicked ()
fileNew ()
fileOpen ()
fileSave ()
fileSaveAs ()
filePrint ()
fileExit ()
editUndo ()
editRedo ()
editCut ()
editCopy ()
editPaste ()
editFind ()
helpIndex ()
helpContents ()
helpAbout ()

Detailed Description

Definition at line 14 of file RunControlGUIImpl.py.

The documentation for this class was generated from the following file:
  • RunControlGUIImpl.py
Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: RunControlMain Class Reference

RunControlMain.RunControlMain

RunControlMain Class Reference

Inheritance diagram for RunControlMain:

[legend]
Collaboration diagram for RunControlMain:

[legend]
List of all members.

Public Member Functions

__init__ (common, parent=None, name="RunControl", fl=0)
disconnected ()
timedout ()
connectClicked ()
isConnected ()
Return the connection state.
schemaChanged ()
applyPermissions (operator)
setEnabledTabPage (panelLabel, enable)
setOperator (operator)
setParticleType (particleType)
setOrientation (orientation)
getName ()
initApp ()
Method usually invoked by the GUI to load a new application.
loadApp (applName)
Method that can be invoked from code to load a new application.
loadModule (module)
Method that can be invoked from code to load a new module.
ResetClicked ()
StopClicked ()
RunClicked ()
PauseClicked ()
doReset ()
doSuiteReset ()
doStop ()
doStopRun ()
doRun ()
doPause ()
doEmit (obj, signal=SIGNAL("clicked()"), args=())
normalCursor ()
waitCursor ()
handleEndRunDlg ()
getEndRunComments ()
handleComments (fromState, toState)
showHidePythonShell ()
verifySoftware ()
elogWebsite ()
warnFreeSpace (warn_level)
warnDirectoryExist (directory)
aboutRunControl ()
fileLogout ()
closeEvent (e)
login ()
getHardwareVersions (lat=None, xbrd=None)
clearHardwareVersionsCache ()
getFSM ()
getApp ()
isGUIthread ()
customEvent (e)
createGUI (obj, args, kwargs)
execGUImethodNR (func, args, kwargs)
execGUImethod (func, args, kwargs)
getSecurityMan ()

Detailed Description

Class for providing a run control framework

Definition at line 49 of file RunControlMain.py.

Member Function Documentation

createGUI | ( | obj | ,
 |  | args | ,
 |  | kwargs |
 | ) |

Method used for instantiating a GUI from a non-GUI subthread

customEvent ( e )

This method overrides the QObject base class's. There is generally no reason to call this method directly. It is called by the Qt infrastructure whenever the custom event is posted, e.g. by the following three methods of this class: createGUI, execGUImethodNR and execGUImethod.

doEmit | ( | obj | ,
 |  | signal | = SIGNAL("clicked()"),
 |  | args | = ()
 | ) |

Emit a signal, possibly from a subthread. By default the signal is 'clicked()' with no arguments.

doPause ( )

Emit a Pause button click under program control. Can be done from a subthread.

doReset ( )

Emit a Reset button click under program control. Can be done from a subthread.

doRun ( )

Emit a Run button click under program control. Can be done from a subthread.

doStop ( )

Emit a Stop button click under program control. Can be done from a subthread.

doStopRun ( )

Depricated version of doStop().

doSuiteReset ( )

Notify rcSuite that there was an exception in the suite script This gives rcSuite a chance to do its own doReset on the running script.

execGUImethod | ( | func | ,
 |  | args | ,
 |  | kwargs |
 | ) |

Method used for executing a GUI function from a non-GUI thread. Use this method when a response is expected from the function and when it is appropriate to wait for it (no deadlock arises)

execGUImethodNR | ( | func | ,
 |  | args | ,
 |  | kwargs |
 | ) |

Method used for executing a GUI function from a non-GUI thread. Use this method when no (useful) response is expected or when waiting for one could cause a deadlock. Any response from the function is lost.

isConnected ( )

Return the connection state.

Used by the WatchItem class in rcStatusMonitor.

Returns:
Connection state

isGUIthread ( )

Returns True if this method is being called from the GUI thread.

loadApp ( applName )

Method that can be invoked from code to load a new application.

Parameters:
applName Name of an application to load

loadModule ( module )

Method that can be invoked from code to load a new module.

Parameters:
module Pointer to module to load

setEnabledTabPage | ( | panelLabel | ,
 |  | enable |
 | ) |

Find the tabPage belonging to panel identified by panelLabel

The documentation for this class was generated from the following file:
  • RunControlMain.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: RunControlMainGUIImpl Class Reference

RunControlMainGUIImpl.RunControlMainGUIImpl

RunControlMainGUIImpl Class Reference

Inheritance diagram for RunControlMainGUIImpl:

[legend]
List of all members.

Public Member Functions

__init__ (listbox)
maybeTip (pos)
__init__ (parent, name, panel, tabPage, flags=0)
visibilityChanged (visible)
__init__ (common, parent=None, name=None, fl=0)
refreshUsers (operator=None)
mouseDblClick (event)
activateTab (tabPage)
panels ()
common ()
preferences ()
statusMonitor ()
parameterVerifier ()
getSchemaConfigFile ()
getOperator ()
getCommentWidget ()
getPythonShellWidget ()
statusPanelVisChanged (visible)
showHideStatusPanel ()
showHideComments ()
showComments ()
hideComments ()
showHidePythonShell ()
showPythonShell ()
hidePythonShell ()
isPythonShellHidden ()
PreferencesActivated ()
ResetClicked ()
StopClicked ()
RunClicked ()
PauseClicked ()
loadScript ()
loadSchema ()
schemaChanged ()
getApp ()
fileExit ()
connectClicked ()
fileLogout ()
closeEvent (e)
filePrint ()
setOperator (operator)
setParticleType (particleType)
setInstrumentType (instrumentType)
setOrientation (orientation)
setPhase (phase)
verifySoftware ()
elogWebsite ()
aboutRunControl ()

Detailed Description

Definition at line 19 of file RunControlMainGUIImpl.py.

The documentation for this class was generated from the following file:
  • RunControlMainGUIImpl.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: RunControlSocketHandler Class Reference

RunControlCommon.RunControlSocketHandler

RunControlSocketHandler Class Reference

List of all members.

Public Member Functions

handleError (record)

Detailed Description

Definition at line 51 of file RunControlCommon.py.

The documentation for this class was generated from the following file:
  • RunControlCommon.py
Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ScrollablePlotView Class Reference

EnvMonImpl.ScrollablePlotView

ScrollablePlotView Class Reference

List of all members.

Public Member Functions

addPlot (name, title, sizeX, sizeY, labels)
initEventPlot ()
addEventPlot (name)
removePlot (name)
getPlot (name)
getNTupleList ()
getPlotList ()

Detailed Description

Definition at line 100 of file EnvMonImpl.py.

The documentation for this class was generated from the following file:
  • EnvMonImpl.py
Generated on Fri Jul 21 13:26:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ServerPreferencesImpl Class Reference

ServerPreferencesImpl.ServerPreferencesImpl

ServerPreferencesImpl Class Reference

List of all members.

Public Member Functions

__init__ (confParser, parent=None, name=None, modal=0, fl=0)
selectServer ()
saveServer ()

Detailed Description

Definition at line 12 of file ServerPreferencesImpl.py.

The documentation for this class was generated from the following file:
  • ServerPreferencesImpl.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: SGETrgEngines Class Reference

SimpleGasuExample.SGETrgEngines

SGETrgEngines Class Reference

List of all members.

Public Member Functions

__init__ ()

Detailed Description

Class MyTrgEngines: Initialize the trigger engines list class.

Definition at line 59 of file SimpleGasuExample.py.

The documentation for this class was generated from the following file:
  • SimpleGasuExample.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: SGETrgEngines Class Reference

testAppAcdScalers.SGETrgEngines

SGETrgEngines Class Reference

List of all members.

Public Member Functions

__init__ ()

Detailed Description

Class MyTrgEngines: Initialize the trigger engines list class.

Definition at line 187 of file testAppAcdScalers.py.

The documentation for this class was generated from the following file:
  • testAppAcdScalers.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: SGETrgInputEnables Class Reference

testAppAcdScalers.SGETrgInputEnables

SGETrgInputEnables Class Reference

List of all members.

Public Member Functions

__init__ ()

Detailed Description

Class SGETrgInputEnables: Empty Input enables.

Definition at line 178 of file testAppAcdScalers.py.

The documentation for this class was generated from the following file:
  • testAppAcdScalers.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: SGETrgInputEnables Class Reference

SimpleGasuExample.SGETrgInputEnables

SGETrgInputEnables Class Reference

List of all members.

Public Member Functions

__init__ ()
towerBusy ()

Detailed Description

Class SGETrgInputEnables: Empty Input enables.

Definition at line 49 of file SimpleGasuExample.py.

The documentation for this class was generated from the following file:
  • SimpleGasuExample.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: SimpleGasuExample Class Reference

testAppAcdScalers.SimpleGasuExample

SimpleGasuExample Class Reference

SimpleGASU example interface to GEM. More...

List of all members.

Public Member Functions

__init__ ()
SimpleGasuExample constructor.
conditions ()
coincidences ()
Implementation of coincdences 'pure virtual' method from TrgUsingTiles.
inputEnables ()
Implementation of inputEnables 'pure virtual' method from TrgAbstract.
engines ()
Implementation of engines 'pure virtual' method from TrgAbstract.
useAcdAsTrigger ()

Detailed Description

SimpleGASU example interface to GEM.

Definition at line 149 of file testAppAcdScalers.py.

Member Function Documentation

useAcdAsTrigger ( )

Use ACD as a trigger source.

The documentation for this class was generated from the following file:
  • testAppAcdScalers.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: SimpleGasuExample Class Reference

SimpleGasuExample.SimpleGasuExample

SimpleGasuExample Class Reference

SimpleGASU example interface to GEM. More...

List of all members.

Public Member Functions

__init__ ()
SimpleGasuExample constructor.
conditions ()
coincidences ()
Implementation of coincdences 'pure virtual' method from TrgUsingTiles.
inputEnables ()
Implementation of inputEnables 'pure virtual' method from TrgAbstract.
engines ()
Implementation of engines 'pure virtual' method from TrgAbstract.
useAcdAsTrigger ()

Detailed Description

SimpleGASU example interface to GEM.

Definition at line 20 of file SimpleGasuExample.py.

Member Function Documentation

useAcdAsTrigger ( )

Use ACD as a trigger source.

The documentation for this class was generated from the following file:
  • SimpleGasuExample.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: singleEvtDisplayImpl Class Reference

gosedImpl.singleEvtDisplayImpl

singleEvtDisplayImpl Class Reference

Glast Online Single Event Display (GOSED). More...

List of all members.

Public Member Functions

__init__ (filename=None, parent=None, name=None, fl=0)
printCALTKR ()
printACD ()
createDockWindows ()
dockGOSEDTWR ()
dockGOSEDTKR ()
dockGOSEDCAL ()
dockGOSEDCALTKR ()
dockGOSEDData ()
dockGOTED ()
dockGOSEDACD ()
updateDockGOSEDTWR ()
updateDockGOSEDTKR ()
updateDockGOSEDCAL ()
updateDockGOSEDCALTKR ()
updateDockGOSEDData ()
updateDockGOTED ()
updateDockGOSEDACD ()
mousePressEvent (e)
clickTWR (id)
plot (skip=0)
replot ()
rangeChange (buttonId)
rangeChange2 (buttonId)
maintainButtons (buttonId, widget)
scaleChange (scaleId)
scaleChange2 (scaleId)
maintainScale (scaleId, window)
selectChange ()
setGOSEDDefaults ()
clearViews ()
clearButtons ()
clearPixmaps ()
clearButtonGroups ()
nextClicked (skip=0)
previousClicked (skip=-1)
goClicked ()
stopClicked ()
skipClicked ()
fileOpen ()
fileClose ()
fileExit ()
serverOpen (state)
serverClose ()
ServerPreferences ()
GOSEDPreferences ()
closeEvent (e)
helpOnline ()
helpContents ()
helpAbout ()

Detailed Description

Glast Online Single Event Display (GOSED).

This class: 1. Manages all the GUI functions for GOSED. 2. Retreives the TKR and CAL projections' pixmaps from GOSEDPainter. 3. Loads all the information from the current event processed by GOSED_LDF,

Definition at line 37 of file gosedImpl.py.

Member Function Documentation

__init__ | ( | filename | = None,
 |  | parent | = None,
 |  | name | = None,
 |  | fl | = 0
 | ) |

singleEvtDisplayImpl contructor

Parameters:
filename | None
parent | None
name | None
fl | 0

clearButtonGroups ( )

This function unchecks all the buttons. Contrary to clearviews(), this is only necesary when opening a new file, since we may have changed a selection in only one parameter (for example RNG only), and thus we don't want to loose the other filter by unchecking it (for example TWR).

clearViews ( )

This function reloads GOSED defaults in order to process a new event.

fileClose ( )

Close file source

fileExit ( )

Exits the gui

fileOpen ( )

Load data from a file

goClicked ( )

Load events ininterruptedly in time steps selected by the user from the GOSED Preferences menu. It stops when the Stop Button is clicked.

GOSEDPreferences ( )

Calls the GOSED Preferences window stopping the timer. It also passes the new settings to GOSED.

helpAbout ( )

Displays About GOSED info

helpContents ( )

Calls GOSED Readme file for reference.

helpOnline ( )

This function opens a web browser with I&T URL for reference.

nextClicked ( skip = 0 )

Plots next event when called

Parameters:
skip - Number of events to skip, negative means backward. Defaults to going forward one 1 event

plot ( skip = 0 )

Plot is the heart of GOSED. It strips the information of the event from the data string and passes it to GOSED_LDF, initializing the iteration over all the entries of the event. It manages three kinds of sources of data: 1. Data from .ldf files 2. Data from .fits files 3. Data from server It also manages the reinizialization of all the gui's outputs, calling clearviews() to delete the information from a previous event

Parameters:
skip - Number of events to skip (ignored if source is not an LDF file) Defaults to plotting next event in the file

previousClicked ( skip = -1 )

Finds previous event in the file and then plots it. It only works for .arch files.

Parameters:
skip - Number of events to skip, negative means backward. Defaults to going backward one 1 event

selectChange ( )

This function is called whenever the user makes a change of selection in TWR, RNG or Scale, to reload the event with the new filter settings.

serverClose ( )

Close network server

serverOpen ( state )

Load event data from a network server

ServerPreferences ( )

Calls the Server Preferences window stopping the timer.

skipClicked ( )

Skip events forward or backward in an LDF file. A skip amount of: 1 => display next event 0 => replot current event -1 => display previous event N => display event with Event Number = current event's Event Number + N -N => display event with Event Number = current event's Event Number - N

stopClicked ( )

Stop the ininterrupted display of events triggered by the Go Button

The documentation for this class was generated from the following file:
  • gosedImpl.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: SLACmail Class Reference

MailAlert.SLACmail

SLACmail Class Reference

Inheritance diagram for SLACmail:

[legend]
Collaboration diagram for SLACmail:

[legend]
List of all members.

Public Member Functions

__init__ ()

Detailed Description

Definition at line 12 of file MailAlert.py.

The documentation for this class was generated from the following file:
  • MailAlert.py
Generated on Fri Jul 21 13:27:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Socket Class Reference

gSocket.Socket

Socket Class Reference

Inheritance diagram for Socket:

[legend]
List of all members.

Public Member Functions

__init__ (portnumber)
connect (host)
disconnect ()
isConnected ()
socket ()
setSocket (sock)
port ()
setPort (port)
lock ()
release ()
gettimeout ()
settimeout (seconds)
send (packet)
recv (size)
sendall (packet)
recvall (size)
purge ()
Purge all stale data out of the socket.

Detailed Description

Definition at line 7 of file gSocket.py.

The documentation for this class was generated from the following file:
  • gSocket.py
Generated on Fri Jul 21 13:27:11 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: SocketClosed Class Reference

gEvtCliBT.SocketClosed

SocketClosed Class Reference

Detailed Description

Definition at line 21 of file gEvtCliBT.py.

The documentation for this class was generated from the following file:
  • gEvtCliBT.py
Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: SolicitedCondition Class Reference

testAppAcdScalers.SolicitedCondition

SolicitedCondition Class Reference

List of all members.

Public Member Functions

__init__ ()
solicited ()

Detailed Description

Define a condition where only the solicited trigger is asserted

Definition at line 208 of file testAppAcdScalers.py.

The documentation for this class was generated from the following file:
  • testAppAcdScalers.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: SolicitedCondition Class Reference

SimpleGasuExample.SolicitedCondition

SolicitedCondition Class Reference

List of all members.

Public Member Functions

__init__ ()
solicited ()

Detailed Description

Define a condition where only the solicited trigger is asserted

Definition at line 80 of file SimpleGasuExample.py.

The documentation for this class was generated from the following file:
  • SimpleGasuExample.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: SolicitedEngine Class Reference

testAppAcdScalers.SolicitedEngine

SolicitedEngine Class Reference

List of all members.

Public Member Functions

__init__ ()
participate (conditionsValue)
prescale ()
request ()

Detailed Description

This class defines an engine which reads out the detector whenever there is a solicited trigger. This engine is not prescaled.

Definition at line 197 of file testAppAcdScalers.py.

The documentation for this class was generated from the following file:
  • testAppAcdScalers.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: SolicitedEngine Class Reference

SimpleGasuExample.SolicitedEngine

SolicitedEngine Class Reference

List of all members.

Public Member Functions

__init__ ()
participate (conditionsValue)
prescale ()
request ()

Detailed Description

This class defines an engine which reads out the detector whenever there is a solicited trigger. This engine is not prescaled.

Definition at line 69 of file SimpleGasuExample.py.

The documentation for this class was generated from the following file:
  • SimpleGasuExample.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: standardPlotter Class Reference

standardPlotter.standardPlotter

standardPlotter Class Reference

Inheritance diagram for standardPlotter:

[legend]
List of all members.

Public Member Functions

initializePlotter ()
setDataType (dataType)
setConfigFile (configFile)
getName ()
initHippo ()
clearPlots ()
updatePlots ()
forceUpdatePlots ()
getPlotColumns (plot)
getPlotNtuple (plot)
getPlotTitle (plot)
getPlotCuts (plot)
getPlotType (plot)
getRequests ()
parseLimits ()
parseCuts ()
readPedestals ()
checkLimit (plot, limit)
reportResults ()
startSummary ()
reportLimits ()
addSummaryTableRow (plot, limitType, status)
reportPlotItem (sectionID, plot, itemStartString)
listFailed (names, failList, plot, limitDesc, sectionID)
capturePlot (plot)
startReport ()
writeReport (reportFileName)
reportPlots ()

Detailed Description

Definition at line 16 of file standardPlotter.py.

The documentation for this class was generated from the following file:
  • standardPlotter.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: standardPlotterGuiImpl Class Reference

standardPlotterGuiImpl.standardPlotterGuiImpl

standardPlotterGuiImpl Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
getConfigFile (fileName)
CancelButtonClicked ()
configFileBrowser ()

Detailed Description

Definition at line 9 of file standardPlotterGuiImpl.py.

The documentation for this class was generated from the following file:
  • standardPlotterGuiImpl.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: standardTestReport Class Reference

standardPlotter.standardTestReport

standardTestReport Class Reference

List of all members.

Public Member Functions

__init__ ()
writeTestInformation (runId, TestName=None, Operator=None, Site=None, Device=None, Phase=None, Status=None)
statusString (status)
getColorText (Text, Color='black', Bold=False)
closeTestReport (FileName)

Detailed Description

This class provide a standard Test Report HTML file for plotter results.

Definition at line 53 of file standardPlotter.py.

Member Function Documentation

__init__ ( )

Init the TestReport and Write Heading

closeTestReport ( FileName )

Close the HTML file and save it

statusString ( status )

Write test status (Passed/Failed or Aborted) in the report

Parameters:
status : Test status ('Passed', 'Failed' or 'Aborted' if script is stopped before end).

writeTestInformation | ( | runId | ,
 |  | TestName | = None,
 |  | Operator | = None,
 |  | Site | = None,
 |  | Device | = None,
 |  | Phase | = None,
 |  | Status | = None
 | ) |

Write standard information about test routine.

Parameters:
Operator | : name of the operator who perform the test
Site | : test site
TestName | : test name
runID | : run ID given by RunControl
Device | : device under test (i.e. MCM, tray, stack, tower)

The documentation for this class was generated from the following file:
  • standardPlotter.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: StatusItem Class Reference

rcStatusMonitor.StatusItem

StatusItem Class Reference

List of all members.

Public Member Functions

paintCell (p, cg, column, width, align)
setText (column, value)
setAlarmExpr (alarmExpr)

Detailed Description

Definition at line 12 of file rcStatusMonitor.py.

The documentation for this class was generated from the following file:
  • rcStatusMonitor.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: StatusLabel Class Reference

PorcinePanel.StatusLabel

StatusLabel Class Reference

List of all members.

Public Member Functions

setEnabled (bool)

Detailed Description

Definition at line 151 of file PorcinePanel.py.

The documentation for this class was generated from the following file:
  • PorcinePanel.py
Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: SweepMarkerEngine Class Reference

rcTrgFunctions.SweepMarkerEngine

SweepMarkerEngine Class Reference

SweepMarkerEngine class. More...

Inheritance diagram for SweepMarkerEngine:

[legend]
Collaboration diagram for SweepMarkerEngine:

[legend]
List of all members.

Public Member Functions

__init__ ()
SweepMarkerEngine constructor.
participate (conditionsValue)
participate() method
prescale ()
prescale() method
request ()
request() method

Detailed Description

SweepMarkerEngine class.

This class defines an engine which injects a sweep marker signal. This engine is not prescaled.

Definition at line 57 of file rcTrgFunctions.py.

Member Function Documentation

participate ( conditionsValue )

participate() method

This function always returns False as this engine never participates except when RunControl wants it to.

Reimplemented from TrgEngine.

prescale ( )

prescale() method

Returns 0. This engine isn't prescaled

Reimplemented from TrgEngine.

request ( )

request() method

Returns a TrgInjectMarker object

Reimplemented from TrgEngine.

The documentation for this class was generated from the following file:
  • rcTrgFunctions.py
Generated on Fri Jul 21 13:27:55 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TaskEngine Class Reference

taskEngine.TaskEngine

TaskEngine Class Reference

List of all members.

Public Member Functions

__init__ (name=None)
name ()
Method for querying the task engine's name.
spawn (task, args, kwargs)
Method used to queue a task to the task engine.
run ()
The task engine main routine.
shutdown (tmo=2.0)
Method for shutting down the task engine.

Detailed Description

A class for setting up and queueing tasks to a task engine.

A task engine is a thread that polls a task queue and runs tasks found on the queue. Tasks are functions or class methods accompanied with their arguments and keyword arguments. Each task must run to completion before the next task is pulled from the queue. Returning a return value from the task to the caller is currently not supported (easy to add, if the need arises). The queue is a FIFO queue and there is currently no way to jam a task to the head of the queue.

Definition at line 22 of file taskEngine.py.

Member Function Documentation

name ( )

Method for querying the task engine's name.

Returns:
The task engine's name

run ( )

The task engine main routine.

This method is invoked by the Thread class and should be considered 'protected'. Do not call it.

shutdown ( tmo = 2.0 )

Method for shutting down the task engine.

This method blocks (with a timeout) until the task engine has exited. It makes no sense to spawn this method to the task engine since it waits for the task engine to exit.

Parameters:
tmo The amount of time (seconds) to wait for the task engine to exit
Returns:
0 for success, -1 if the task engine didn't exit, -2 if the task engine exited prematurely

spawn | ( | task | ,
 |  | args | ,
 |  | kwargs |
 | ) |

Method used to queue a task to the task engine.

Parameters:
task | The task routine to queue
args | The arguments for the task routine
kwargs | The keyword arguments for the task routine

The documentation for this class was generated from the following file:
  • taskEngine.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TaskEngineTestCase Class Reference

taskEngine.TaskEngineTestCase

TaskEngineTestCase Class Reference

List of all members.

Public Member Functions

checkInstantiation ()
checkStartup ()
checkSpawn ()
checkUnboundSpawn ()
checkException1 ()
checkException2 ()
checkSelfShutdown ()
checkShutdown1 ()
checkShutdown2 ()

Detailed Description

Definition at line 61 of file taskEngine.py.

Member Function Documentation

checkException1 ( )

Test that the engine doesn't die if a class method task throws an exception

checkException2 ( )

Test that the engine doesn't die if an unbound function task throws an exception

checkInstantiation ( )

Test class instantiation

checkSelfShutdown ( )

Test that attempts to shut down an engine via a task fails

checkShutdown1 ( )

Test that attempting to shut down an engine from an unrelated thread succeeds

checkShutdown2 ( )

Test that attempts to shut down an engine that wasn't started fails

checkSpawn ( )

Test whether we can spawn a class method task to the engine and have the arguments handled correctly

checkStartup ( )

Test whether the thread starts up

checkUnboundSpawn ( )

Test whether we can spawn an unbound function task to the engine and have the arguments handled correctly

The documentation for this class was generated from the following file:
  • taskEngine.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testArchiver Class Reference

testArchiver.testArchiver

testArchiver Class Reference

Inheritance diagram for testArchiver:

[legend]
Collaboration diagram for testArchiver:

[legend]
List of all members.

Public Member Functions

__init__ (filePath=None, fileName=None)
write (data)
userMethod (data, moreData)

Static Public Member Functions

static getFileNameFromTS (ts)

Detailed Description

Definition at line 7 of file testArchiver.py.

Member Function Documentation

userMethod | ( | data | ,
 |  | moreData |
 | ) |

User defined method for adding custom data to the archive It should not be called before startRun() method since the archiver doesn't get instantiated before then.

The documentation for this class was generated from the following file:
  • testArchiver.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testEvtCli Class Reference

testEvtCli.testEvtCli

testEvtCli Class Reference

List of all members.

Public Member Functions

readEvent (dat=None)

Detailed Description

Definition at line 6 of file testEvtCli.py.

The documentation for this class was generated from the following file:
  • testEvtCli.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TestWindow Class Reference

guiBridges.TestWindow

TestWindow Class Reference

List of all members.

Public Member Functions

customEvent (e)
quit ()

Detailed Description

Definition at line 101 of file guiBridges.py.

The documentation for this class was generated from the following file:
  • guiBridges.py
Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TimeAxisGen Class Reference

HskSqlGuiReceiver.TimeAxisGen

TimeAxisGen Class Reference

List of all members.

Public Member Functions

setPlotter (plotter, name)
update (obs)

Detailed Description

Definition at line 33 of file HskSqlGuiReceiver.py.

The documentation for this class was generated from the following file:
  • HskSqlGuiReceiver.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TimeAxisGen Class Reference

HskGuiReceiver.TimeAxisGen

TimeAxisGen Class Reference

List of all members.

Public Member Functions

setPlotter (plotter, name)
update (obs)

Detailed Description

Definition at line 35 of file HskGuiReceiver.py.

The documentation for this class was generated from the following file:
  • HskGuiReceiver.py
Generated on Fri Jul 21 13:27:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TKRcontributionIterator Class Reference

standardLDF.TKRcontributionIterator

TKRcontributionIterator Class Reference

List of all members.

Public Member Functions

fill ()
strip (tower, layerEnd, hit)
TOT (tower, layerEnd, tot)

Detailed Description

Definition at line 32 of file standardLDF.py.

The documentation for this class was generated from the following file:
  • standardLDF.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TKRcontributionIterator_ Class Reference

GOSED_LDF.TKRcontributionIterator_

TKRcontributionIterator_ Class Reference

TKR contribution Displayer. More...

List of all members.

Public Member Functions

__init__ (event, contribution, gui)
plot ()
strip (tower, layerEnd, hit)
TOT (tower, layerEnd, tot)

Detailed Description

TKR contribution Displayer.

This class obtains the information of TKR from EBF to setup the tkr data in GOSED. To do so it filters by event and twr, iterating over all the entries in the event.

Definition at line 120 of file GOSED_LDF.py.

Member Function Documentation

__init__ | ( | event | ,
 |  | contribution | ,
 |  | gui |
 | ) |

TKRcontributionIterator contructor

Parameters:
event | Event
contribution | Contribution
gui | GOSED

plot ( )

Plot here will call the iterateStrips() function to display the filtered event.

There are three sorts of pixmaps (and the 3 equivalent for the YZ projection): background = Background Pixmap with the skeleton of the TKR final = Final pixmap that is going to be loaded to the display. If no data passed the filter, the custom widget drawXZ_CAL will automatically load background to final for display

strip | ( | tower | ,
 |  | layerEnd | ,
 |  | hit |
 | ) |

This function iterates over all current event entries and displays all those entries that passed the filter of for TWR.

Returns:
tower, layerEnd, hit

The documentation for this class was generated from the following file:
  • GOSED_LDF.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: towerEvtDisplayImpl Class Reference

GOTEDImpl.towerEvtDisplayImpl

towerEvtDisplayImpl Class Reference

List of all members.

Public Member Functions

clear ()
paintEvent (pe)

Detailed Description

Definition at line 9 of file GOTEDImpl.py.

The documentation for this class was generated from the following file:
  • GOTEDImpl.py
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TowerPanel Class Reference

PorcinePanel.TowerPanel

TowerPanel Class Reference

Inheritance diagram for TowerPanel:

[legend]
Collaboration diagram for TowerPanel:

[legend]
List of all members.

Public Member Functions

constructGrid ()

Detailed Description

Definition at line 115 of file PorcinePanel.py.

The documentation for this class was generated from the following file:
  • PorcinePanel.py
Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TowerPowerPanel Class Reference

PorcinePanel.TowerPowerPanel

TowerPowerPanel Class Reference

Inheritance diagram for TowerPowerPanel:

[legend]
Collaboration diagram for TowerPowerPanel:

[legend]
List of all members.

Public Member Functions

constructGrid ()

Detailed Description

Definition at line 104 of file PorcinePanel.py.

The documentation for this class was generated from the following file:
  • PorcinePanel.py
Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: towerwidgetImpl Class Reference

towerwidgetImpl.towerwidgetImpl

towerwidgetImpl Class Reference

List of all members.

Public Member Functions

changeSampling (sampling)
resetpressed ()
calmask (onoff)
tkrmask (onoff)
update ()

Detailed Description

Definition at line 12 of file towerwidgetImpl.py.

The documentation for this class was generated from the following file:
  • towerwidgetImpl.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Trendable Class Reference

Trendable.Trendable

Trendable Class Reference

List of all members.

Public Member Functions

__str__ ()

Detailed Description

Definition at line 4 of file Trendable.py.

The documentation for this class was generated from the following file:
  • Trendable.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrendLimit Class Reference

Trendable.TrendLimit

TrendLimit Class Reference

List of all members.

Public Member Functions

check (value)

Detailed Description

Definition at line 9 of file Trendable.py.

The documentation for this class was generated from the following file:
  • Trendable.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrendMapBase Class Reference

TrendMaps.TrendMapBase

TrendMapBase Class Reference

Inheritance diagram for TrendMapBase:

[legend]
List of all members.

Public Member Functions

mapSet (key, value)
mapGet (key)
mapKeys ()

Detailed Description

Definition at line 10 of file TrendMaps.py.

The documentation for this class was generated from the following file:
  • TrendMaps.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrendPlotter Class Reference

HskSqlGuiReceiver.TrendPlotter

TrendPlotter Class Reference

List of all members.

Public Member Functions

isDynamic ()
setDynamic (bool)
addPlot (key)
update (trendMap)

Detailed Description

Definition at line 25 of file HskSqlGuiReceiver.py.

The documentation for this class was generated from the following file:
  • HskSqlGuiReceiver.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrendPlotter Class Reference

HskGuiReceiver.TrendPlotter

TrendPlotter Class Reference

List of all members.

Public Member Functions

isDynamic ()
setDynamic (bool)
addPlot (key)
update (trendMap)

Detailed Description

Definition at line 27 of file HskGuiReceiver.py.

The documentation for this class was generated from the following file:
  • HskGuiReceiver.py
Generated on Fri Jul 21 13:27:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrendPlotter Class Reference

testTrending.TrendPlotter

TrendPlotter Class Reference

List of all members.

Public Member Functions

isDynamic ()
setDynamic (bool)
addPlot (trendable)
update (trendables)

Detailed Description

Definition at line 31 of file testTrending.py.

The documentation for this class was generated from the following file:
  • testTrending.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrendTestGUI Class Reference

testTrending.TrendTestGUI

TrendTestGUI Class Reference

List of all members.

Public Member Functions

update (trendables)

Detailed Description

Definition at line 17 of file testTrending.py.

The documentation for this class was generated from the following file:
  • testTrending.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrendTree Class Reference

testTrending.TrendTree

TrendTree Class Reference

List of all members.

Public Member Functions

isDynamic ()
setDynamic (bool)
addLeaf (name)
update (trendables)
getBranchName (name)

Detailed Description

Definition at line 22 of file testTrending.py.

The documentation for this class was generated from the following file:
  • testTrending.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgAbstract Class Reference

TrgAbstract.TrgAbstract

TrgAbstract Class Reference

Abstract trigger interface class definition. More...

Inheritance diagram for TrgAbstract:

[legend]
Collaboration diagram for TrgAbstract:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgAbstract constructor.
conditions ()
conditions 'pure virtual' method
engines ()
Engines 'pure virtual' method.
sequence ()
Sequence 'pure virtual' method.
inputEnables ()
Enables 'pure virtual' method.
version ()
Version 'pure virtual' method.
maxEngines ()
maxEngines 'pure virtual' method
maxConditions ()
maxConditions 'pure virtual' method
solicit ()
Solicit 'pure virtual' method.
enable ()
Enable 'pure virtual' method.
disable ()
disable 'pure virtual' method
shut (marker)
shut 'pure virtual' method

Detailed Description

Abstract trigger interface class definition.

Definition at line 12 of file TrgAbstract.py.

Member Function Documentation

conditions ( )

conditions 'pure virtual' method

Returns:
A TrgConditionsValue object This object specifies the set of conditions to be enabled when the enable() member function is called

Reimplemented in rcGEMDefaultTrigger, and rcMiniGLTDefaultTrigger.

disable ( )

disable 'pure virtual' method

This function returns no value.

Disables the conditions returned by the conditions() member function. Once a condition is disabled, the condition will not activate the Trigger System, independent of its presence in the LAT.

Reimplemented in rcTrgGem, rcTrgMiniGLT, TrgGem, and TrgMiniGLT.

enable ( )

Enable 'pure virtual' method.

This function returns no value.

Enables the trigger conditions returned by the conditions() member function. Once a condition is enabled and the condition occurs in the LAT, the Trigger Engines corresponding to the condition will fire and most likely cause a Trigger Message to be emitted by the Trigger System.

engines ( )

Engines 'pure virtual' method.

Returns:
A TrgEngines object This object specifies the set of engines used by the trigger

Reimplemented in rcGEMDefaultTrigger, and rcMiniGLTDefaultTrigger.

inputEnables ( )

Enables 'pure virtual' method.

Returns:
A TrgInputEnables object This object specifies the input masking definitions for the trigger

Reimplemented in rcGEMDefaultTrigger.

maxConditions ( )

maxConditions 'pure virtual' method

Returns:
An integer This value specifies the type and number of conditions supported by the Trigger System.

Reimplemented in TrgGemAbstract.

maxEngines ( )

maxEngines 'pure virtual' method

Returns:
An integer This value determines the maximum number of Trigger Engines supported by the Trigger System.

Reimplemented in TrgGemAbstract.

sequence ( )

Sequence 'pure virtual' method.

Returns:
A TrgSequence object This object specifies the initial sequence number definitions for the trigger

Reimplemented in TrgUsingTiles.

shut ( marker )

shut 'pure virtual' method

Parameters:
marker an integer representing a marker value
This function returns no value.

This function returns performs two functions: a) it disables any enabled conditions b) it solicits a trigger with a marker of the value of the input value

Reimplemented in TrgGem, and TrgMiniGLT.

solicit ( )

Solicit 'pure virtual' method.

Allows the application to assert the solicited condition. Depending on the engine (or engines) associated with this condition, asserting this condition will most likely cause a readout of the detector. This function returns no value.

Reimplemented in TrgGem, and TrgMiniGLT.

version ( )

Version 'pure virtual' method.

Returns:
An integer This value specifies (in a hardware dependent representation) the generation and revision numbers of the Trigger System.

Reimplemented in TrgGem.

The documentation for this class was generated from the following file:
  • TrgAbstract.py
Generated on Fri Jul 21 13:28:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgCalorimeter Class Reference

TrgTower.TrgCalorimeter

TrgCalorimeter Class Reference

Trigger Calorimeter class definition. More...

Inheritance diagram for TrgCalorimeter:

[legend]
Collaboration diagram for TrgCalorimeter:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgCalorimeter constructor.
useHighEnergy ()
UseHighEnergy 'virtual' method.
useLowEnergy ()
UseLowEnergy 'virtual' method.

Detailed Description

Trigger Calorimeter class definition.

Definition at line 53 of file TrgTower.py.

Member Function Documentation

useHighEnergy ( )

UseHighEnergy 'virtual' method.

Returns:
A boolean

Reimplemented in NullCal.

useLowEnergy ( )

UseLowEnergy 'virtual' method.

Returns:
A boolean

Reimplemented in NullCal.

The documentation for this class was generated from the following file:
  • TrgTower.py
Generated on Fri Jul 21 13:28:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgCmdCounters Class Reference

TrgCmdCounters.TrgCmdCounters

TrgCmdCounters Class Reference

TrgCmdCounters class. More...

Inheritance diagram for TrgCmdCounters:

[legend]
Collaboration diagram for TrgCmdCounters:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgCmdCounters constructor.
stats ()
stats() method
reset ()
reset() method

Detailed Description

TrgCmdCounters class.

This class controls the counters associated with the commands received and the responses sent by the GEM.

Definition at line 15 of file TrgCmdCounters.py.

Member Function Documentation

reset ( )

reset() method

Reset the command counters

Reimplemented in TrgGemCmdCounters.

stats ( )

stats() method

Get the command statistics object.

Returns:
a TrgCmdStats object

Reimplemented in TrgGemCmdCounters.

The documentation for this class was generated from the following file:
  • TrgCmdCounters.py
Generated on Fri Jul 21 13:28:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgCmdStats Class Reference

TrgCmdCounters.TrgCmdStats

TrgCmdStats Class Reference

TrgCmdStats class. More...

Inheritance diagram for TrgCmdStats:

[legend]
Collaboration diagram for TrgCmdStats:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgCmdStats constructor.
command ()
command() method
response ()
response() method

Detailed Description

TrgCmdStats class.

This class specifies the statistics returned by the command counters. cf: LAT-TD-01545 section 2.3

Definition at line 42 of file TrgCmdCounters.py.

Member Function Documentation

command ( )

command() method

Returns:
an integer

Reimplemented in TrgGemCmdStats.

response ( )

response() method

Returns:
an integer

Reimplemented in TrgGemCmdStats.

The documentation for this class was generated from the following file:
  • TrgCmdCounters.py
Generated on Fri Jul 21 13:28:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgCnoCounters Class Reference

TrgCnoCounters.TrgCnoCounters

TrgCnoCounters Class Reference

TrgCnoCounters class definition This class controls the counters used to count ACD Cno transitions. More...

Inheritance diagram for TrgCnoCounters:

[legend]
Collaboration diagram for TrgCnoCounters:

[legend]
List of all members.

Public Member Functions

__init__ ()
stats ()
stats() member function Returns the statistics object for the Cno counters
reset ()
reset() member function Reset the Cno statistics
assignA (a)
assignA() member function Assign the 'A' Cno counter to watch a particular Cno Immediately after counter assignment, both counters are reset.
assignB (B)
assignB() member function Assign the 'B' Cno counter to watch a particular Cno Immediately after counter assignment, both counters are reset.
assignAB (a, b)
assignAB() member function Assign both the 'A' and the'B' Cno counters to watch two Cnos Immediately after counter assignment, both counters are reset.

Detailed Description

TrgCnoCounters class definition This class controls the counters used to count ACD Cno transitions.

Definition at line 13 of file TrgCnoCounters.py.

Member Function Documentation

stats ( )

stats() member function Returns the statistics object for the Cno counters

Returns:
A TrgCnoStats object

Reimplemented in TrgGemCnoCounters.

The documentation for this class was generated from the following file:
  • TrgCnoCounters.py
Generated on Fri Jul 21 13:28:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgCnoEnables Class Reference

TrgInputEnables.TrgCnoEnables

TrgCnoEnables Class Reference

Trigger CNO Enables class definition. More...

Inheritance diagram for TrgCnoEnables:

[legend]
Collaboration diagram for TrgCnoEnables:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgCnoEnables constructor.
LA1 ()
LA1 'virtual' method.
RB1 ()
RB1 'virtual' method.
LA2 ()
LA2 'virtual' method.
LB2 ()
LB2 'virtual' method.
RA2 ()
RA2 'virtual' method.
RB2 ()
RB2 'virtual' method.
LA3 ()
LA3 'virtual' method.
RB3 ()
RB3 'virtual' method.
LA4 ()
LA4 'virtual' method.
LB4 ()
LB4 'virtual' method.
RA4 ()
RA4 'virtual' method.
RB4 ()
RB4 'virtual' method.

Detailed Description

Trigger CNO Enables class definition.

Definition at line 70 of file TrgInputEnables.py.

Member Function Documentation

LA1 ( )

LA1 'virtual' method.

Returns:
A boolean

LA2 ( )

LA2 'virtual' method.

Returns:
A boolean

LA3 ( )

LA3 'virtual' method.

Returns:
A boolean

LA4 ( )

LA4 'virtual' method.

Returns:
A boolean

LB2 ( )

LB2 'virtual' method.

Returns:
A boolean

LB4 ( )

LB4 'virtual' method.

Returns:
A boolean

RA2 ( )

RA2 'virtual' method.

Returns:
A boolean

RA4 ( )

RA4 'virtual' method.

Returns:
A boolean

RB1 ( )

RB1 'virtual' method.

Returns:
A boolean

RB2 ( )

RB2 'virtual' method.

Returns:
A boolean

RB3 ( )

RB3 'virtual' method.

Returns:
A boolean

RB4 ( )

RB4 'virtual' method.

Returns:
A boolean

The documentation for this class was generated from the following file:
  • TrgInputEnables.py
Generated on Fri Jul 21 13:28:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgCnoStats Class Reference

TrgCnoCounters.TrgCnoStats

TrgCnoStats Class Reference

TrgCnoStats class definition This class specifies the statistics returned by the counters described by TrgCnoCounters. More...

Inheritance diagram for TrgCnoStats:

[legend]
Collaboration diagram for TrgCnoStats:

[legend]
List of all members.

Public Member Functions

__init__ ()
A ()
B ()

Detailed Description

TrgCnoStats class definition This class specifies the statistics returned by the counters described by TrgCnoCounters.

Definition at line 52 of file TrgCnoCounters.py.

Member Function Documentation

A ( )

Return the statistics for the 'A' Cno counter

Returns:
an integer

Reimplemented in TrgGemCnoStats.

B ( )

Return the statistics for the 'B' Cno counter

Returns:
an integer

Reimplemented in TrgGemCnoStats.

The documentation for this class was generated from the following file:
  • TrgCnoCounters.py
Generated on Fri Jul 21 13:28:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgCoincidence Class Reference

TrgCoincidences.TrgCoincidence

TrgCoincidence Class Reference

Trigger Coincidence class definition This class defines the set of tiles which will constitute any one coincidence. More...

Inheritance diagram for TrgCoincidence:

[legend]
Collaboration diagram for TrgCoincidence:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgCoincidence constructor.
inCoincidence (tileNumber)
InCoincidence 'pure virtual' method To be satisfied by the user.

Detailed Description

Trigger Coincidence class definition This class defines the set of tiles which will constitute any one coincidence.

Definition at line 67 of file TrgCoincidences.py.

Member Function Documentation

inCoincidence ( tileNumber )

InCoincidence 'pure virtual' method To be satisfied by the user.

Parameters:
tileNumber A tile number [0..107]
Returns:
An integer

Reimplemented in NullCoincidence, and rcTrgCoincidence.

The documentation for this class was generated from the following file:
  • TrgCoincidences.py
Generated on Fri Jul 21 13:28:12 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgCoincidences Class Reference

TrgCoincidences.TrgCoincidences

TrgCoincidences Class Reference

Trigger Coincidences class definition. More...

Inheritance diagram for TrgCoincidences:

[legend]
Collaboration diagram for TrgCoincidences:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgCoincidences constructor.
coincidence (coincidenceNumber)
coincidence 'pure virtual' method Reference into the list of coincidences.

Detailed Description

Trigger Coincidences class definition.

Definition at line 48 of file TrgCoincidences.py.

Member Function Documentation

coincidence ( coincidenceNumber )

coincidence 'pure virtual' method Reference into the list of coincidences.

Parameters:
coincidenceNumber A coincidence number
Returns:
A TrgCoincidence object

Reimplemented in TrgRoiAsTiles.

The documentation for this class was generated from the following file:
  • TrgCoincidences.py
Generated on Fri Jul 21 13:28:12 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgConditions Class Reference

TrgConditions.TrgConditions

TrgConditions Class Reference

Trigger Conditions Value class definition This class is used to define one combinatoric of the 128 possible conditions. More...

Inheritance diagram for TrgConditions:

[legend]
Collaboration diagram for TrgConditions:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgConditions constructor.
roi ()
roi() 'pure virtual' method
calLow ()
calLow() 'pure virtual' method
calHigh ()
calHigh() 'pure virtual' method
tkr ()
tkr() 'pure virtual' method
periodic ()
periodic() 'pure virtual' method
solicited ()
solicited() 'pure virtual' method
cno ()
cno() 'pure virtual' method
external ()
external() 'pure virtual' method

Detailed Description

Trigger Conditions Value class definition This class is used to define one combinatoric of the 128 possible conditions.

Definition at line 13 of file TrgConditions.py.

Member Function Documentation

calHigh ( )

calHigh() 'pure virtual' method

Condition corresponding to a calorimeter high-energy trigger

Returns:
A boolean

Reimplemented in TrgConditionsValue.

calLow ( )

calLow() 'pure virtual' method

Condition corresponding to a calorimeter low-energy trigger

Returns:
A boolean

Reimplemented in TrgConditionsValue.

cno ( )

cno() 'pure virtual' method

Condition corresponding to a CNO trigger

Returns:
A boolean

Reimplemented in TrgConditionsValue.

external ( )

external() 'pure virtual' method

Condition corresponding to an external trigger source

Returns:
A boolean

Reimplemented in TrgConditionsValue, and MiniGLTTrgConditionsValue.

periodic ( )

periodic() 'pure virtual' method

Condition corresponding to a periodic trigger

Returns:
A boolean

Reimplemented in TrgConditionsValue.

roi ( )

roi() 'pure virtual' method

Condition corresponding to a ROI trigger

Returns:
A boolean

Reimplemented in TrgConditionsValue.

solicited ( )

solicited() 'pure virtual' method

Condition corresponding to a solicited trigger

Returns:
A boolean

Reimplemented in rcSolicitedCondition, rcMiniGLTSolicitedCondition, and TrgConditionsValue.

tkr ( )

tkr() 'pure virtual' method

Condition corresponding to a tracker 'three in a row' trigger

Returns:
A boolean

Reimplemented in TrgConditionsValue.

The documentation for this class was generated from the following file:
  • TrgConditions.py
Generated on Fri Jul 21 13:28:13 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgConditionsValue Class Reference

TrgConditionsValue.TrgConditionsValue

TrgConditionsValue Class Reference

Trigger Conditions Value class definition. More...

Inheritance diagram for TrgConditionsValue:

[legend]
Collaboration diagram for TrgConditionsValue:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgConditionsValue constructor.
value ()
Value method.
roi ()
roi() 'pure virtual' method
calLow ()
calLow() 'pure virtual' method
calHigh ()
calHigh() 'pure virtual' method
tkr ()
tkr() 'pure virtual' method
periodic ()
periodic() 'pure virtual' method
solicited ()
solicited() 'pure virtual' method
cno ()
cno() 'pure virtual' method
external ()
external() 'pure virtual' method

Detailed Description

Trigger Conditions Value class definition.

Definition at line 9 of file TrgConditionsValue.py.

Member Function Documentation

calHigh ( )

calHigh() 'pure virtual' method

Condition corresponding to a calorimeter high-energy trigger

Returns:
A boolean

Reimplemented from TrgConditions.

calLow ( )

calLow() 'pure virtual' method

Condition corresponding to a calorimeter low-energy trigger

Returns:
A boolean

Reimplemented from TrgConditions.

cno ( )

cno() 'pure virtual' method

Condition corresponding to a CNO trigger

Returns:
A boolean

Reimplemented from TrgConditions.

external ( )

external() 'pure virtual' method

Condition corresponding to an external trigger source

Returns:
A boolean

Reimplemented from TrgConditions.

Reimplemented in MiniGLTTrgConditionsValue.

periodic ( )

periodic() 'pure virtual' method

Condition corresponding to a periodic trigger

Returns:
A boolean

Reimplemented from TrgConditions.

roi ( )

roi() 'pure virtual' method

Condition corresponding to a ROI trigger

Returns:
A boolean

Reimplemented from TrgConditions.

solicited ( )

solicited() 'pure virtual' method

Condition corresponding to a solicited trigger

Returns:
A boolean

Reimplemented from TrgConditions.

Reimplemented in rcSolicitedCondition, and rcMiniGLTSolicitedCondition.

tkr ( )

tkr() 'pure virtual' method

Condition corresponding to a tracker 'three in a row' trigger

Returns:
A boolean

Reimplemented from TrgConditions.

value ( )

Value method.

Returns:
integer
Returns an integer corresponding to the conditionValue integer corresponding to the WINDOW_OPEN mask register of the GEM Ref: LAT-TD-01545, S 2.9.2

Reimplemented in MiniGLTTrgConditionsValue.

The documentation for this class was generated from the following file:
  • TrgConditionsValue.py
Generated on Fri Jul 21 13:28:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: trgConsumer Class Reference

trgConsumer.trgConsumer

trgConsumer Class Reference

List of all members.

Public Member Functions

checkUDF ()
getRunId ()
setRunId (runId)
resetWindowData ()
getNextEvent ()
serverOpen (server="1")
serverClose ()
fileOpen (fn)
fileClose ()
dataSize ()
exitConsumer ()
parseEvent ()
loop ()
reloadData ()

Detailed Description

Definition at line 19 of file trgConsumer.py.

Member Function Documentation

dataSize ( )

Return current event data size

fileClose ( )

Close input data file

fileOpen ( fn )

Load input data from a file

getNextEvent ( )

get Next Event into data buffer

serverClose ( )

Close network server

serverOpen ( server = "1" )

Connect to network server

The documentation for this class was generated from the following file:
  • trgConsumer.py
Generated on Fri Jul 21 13:28:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgDefaultPeriodicCondition Class Reference

TrgPeriodic.TrgDefaultPeriodicCondition

TrgDefaultPeriodicCondition Class Reference

TrgDefaultPeriodicCondition class definition. More...

Inheritance diagram for TrgDefaultPeriodicCondition:

[legend]
Collaboration diagram for TrgDefaultPeriodicCondition:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgPeriodicConditionAbstract constructor.
source ()
source() method Default is FALSE, do not use 1-PPS clock
prescale ()
prescale() method Default is 0x1fffff, 10 hz periodic function
limit ()
limit() method Default is 0, free-run the condition.

Detailed Description

TrgDefaultPeriodicCondition class definition.

Definition at line 92 of file TrgPeriodic.py.

The documentation for this class was generated from the following file:
  • TrgPeriodic.py
Generated on Fri Jul 21 13:28:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgDefaultSequence Class Reference

TrgSequence.TrgDefaultSequence

TrgDefaultSequence Class Reference

Inheritance diagram for TrgDefaultSequence:

[legend]
Collaboration diagram for TrgDefaultSequence:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgDefaultSequence constructor.
eventNumber ()
eventNumber() method Returns 0
eventTag ()

Detailed Description

The class defines 'sensible' values for the initial Event and Tag numbers.

Definition at line 56 of file TrgSequence.py.

Member Function Documentation

eventTag ( )

brief eventTag() method Returns 0

Reimplemented from TrgSequenceAbstract.

The documentation for this class was generated from the following file:
  • TrgSequence.py
Generated on Fri Jul 21 13:28:36 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: trgDisplayImpl Class Reference

trgDisplayImpl.trgDisplayImpl

trgDisplayImpl Class Reference

List of all members.

Public Member Functions

__init__ (lat, ocs, server, infile, parent=None, name=None, modal=0, fl=0)
resettimehisto ()
changecalmask11 (mask)
changecalmask12 (mask)
changecalmaskh11 (mask)
changecalmaskh12 (mask)
changecalmask21 (mask)
changecalmaskh21 (mask)
changecalmask22 (mask)
changecalmaskh22 (mask)
changetkrmask11 (mask)
changetkrmask12 (mask)
changetkrmask13 (mask)
changetkrmask14 (mask)
changetkrmask21 (mask)
changetkrmask22 (mask)
changetkrmask23 (mask)
changetkrmask24 (mask)
changetile1 (tile)
changetile2 (tile)
changecno1 (tile)
changecno2 (tile)
changetower1 (id)
changetower2 (id)
doresetcal1 ()
doresetcal2 ()
doresettkr11 ()
doresettkr12 ()
doresettkr21 ()
doresettkr22 ()
doresettile ()
doresetcno ()
update ()
changeRate (rate)
changeSampling (sampling)
setReference (ref)
setROI (onoff)
setTKR (onoff)
setCALlow (onoff)
setCALhigh (onoff)
setCNO (onoff)
setEXT (onoff)
closeEvent (e)
stopthethread ()
resizeEvent (rev)
readlut (gemsc)
getEngines (gemmg, val)

Detailed Description

Definition at line 28 of file trgDisplayImpl.py.

Member Function Documentation

resettimehisto ( )

self.multibar1.setBarTitle(1,"TKR\n ") self.multibar1.setBarTitle(3,"CAL\nhigh")

The documentation for this class was generated from the following file:
  • trgDisplayImpl.py
Generated on Fri Jul 21 13:28:15 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgEngine Class Reference

TrgEngines.TrgEngine

TrgEngine Class Reference

Trigger Engine class definition The user inherits from this class to customize their own Trigger Engines. The user must satisfy the member function 'request', which returns an object of type TrgEngineRequest. The user must satisfy the member function 'prescale', which returns an integer. More...

Inheritance diagram for TrgEngine:

[legend]
Collaboration diagram for TrgEngine:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgEngine constructor.
prescale ()
prescale 'pure virtual' method
request ()
request 'pure virtual' method Return the TrgEngineRequest object corresponding to this engine.
participate (conditionsValue)
participate 'pure virtual' method Determines whether or not this engine participates when a particular conditionsValue is satisfied in the GEM.

Detailed Description

Trigger Engine class definition The user inherits from this class to customize their own Trigger Engines. The user must satisfy the member function 'request', which returns an object of type TrgEngineRequest. The user must satisfy the member function 'prescale', which returns an integer.

Definition at line 37 of file TrgEngines.py.

Member Function Documentation

participate ( conditionsValue )

participate 'pure virtual' method Determines whether or not this engine participates when a particular conditionsValue is satisfied in the GEM.

Parameters:
conditionsValue An integer
Returns:
A boolean

Reimplemented in NullEngine, rcSolicitedEngine, rcMiniGLTSolicitedEngine, and SweepMarkerEngine.

prescale ( )

prescale 'pure virtual' method

Returns:
An integer

Reimplemented in NullEngine, rcSolicitedEngine, rcMiniGLTSolicitedEngine, and SweepMarkerEngine.

request ( )

request 'pure virtual' method Return the TrgEngineRequest object corresponding to this engine.

Returns:
A TrgEngineRequest object

Reimplemented in NullEngine, rcSolicitedEngine, rcMiniGLTSolicitedEngine, and SweepMarkerEngine.

The documentation for this class was generated from the following file:
  • TrgEngines.py
Generated on Fri Jul 21 13:28:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgEngineRequest Class Reference

TrgEngines.TrgEngineRequest

TrgEngineRequest Class Reference

Trigger Engine Request class definition The TrgEngineRequest class is used to specify the parameterization of the Trigger Message associated with a given engine. More...

Inheritance diagram for TrgEngineRequest:

[legend]
Collaboration diagram for TrgEngineRequest:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgEngineRequest constructor.
fourRange ()
fourRange 'virtual' method Return TRUE if the four-range-readout is enabled, else FALSE.
zeroSuppress ()
zeroSuppress 'virtual' method Return TRUE if the zero-suppression is enabled, else FALSE.
destination ()
destination method
marker (markerValue=0)
marker method
sequence ()
sequence 'pure virtual' method

Detailed Description

Trigger Engine Request class definition The TrgEngineRequest class is used to specify the parameterization of the Trigger Message associated with a given engine.

See below for concrete examples.

Definition at line 72 of file TrgEngines.py.

Member Function Documentation

destination ( )

destination method

Returns:
An integer

fourRange ( )

fourRange 'virtual' method Return TRUE if the four-range-readout is enabled, else FALSE.

Returns:
A boolean

marker ( markerValue = 0 )

marker method

Parameters:
markerValue A marker value
Returns:
An integer

sequence ( )

sequence 'pure virtual' method

Returns:
An integer

Reimplemented in NullRequest, rcTrgInjectMarker, TrgInjectCharge, TrgReadout, TrgInjectChargeReadout, and TrgInjectMarker.

zeroSuppress ( )

zeroSuppress 'virtual' method Return TRUE if the zero-suppression is enabled, else FALSE.

Returns:
A boolean

Reimplemented in rcTrgInjectMarker.

The documentation for this class was generated from the following file:
  • TrgEngines.py
Generated on Fri Jul 21 13:28:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgEngines Class Reference

TrgEngines.TrgEngines

TrgEngines Class Reference

Trigger Engines class definition A Trigger Engine defines what the Trigger System does when it detects a triggerable condition within the LAT. More...

Inheritance diagram for TrgEngines:

[legend]
Collaboration diagram for TrgEngines:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgEngines constructor.
engine (engineNumber)
Engine 'pure virtual' method Reference into a list of engines.

Detailed Description

Trigger Engines class definition A Trigger Engine defines what the Trigger System does when it detects a triggerable condition within the LAT.

Definition at line 14 of file TrgEngines.py.

Member Function Documentation

engine ( engineNumber )

Engine 'pure virtual' method Reference into a list of engines.

Parameters:
engineNumber An integer
Returns:
A TrgEngine object

Reimplemented in rcTrgEngines.

The documentation for this class was generated from the following file:
  • TrgEngines.py
Generated on Fri Jul 21 13:28:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgEventCounter Class Reference

TrgEventCounter.TrgEventCounter

TrgEventCounter Class Reference

TrgEventCounter class. More...

Inheritance diagram for TrgEventCounter:

[legend]
Collaboration diagram for TrgEventCounter:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgEventCounter contructor.
stats ()
stats() method
reset ()
reset() method

Detailed Description

TrgEventCounter class.

This class controls the counters associated with the event stream received and the responses sent by the GEM.

These functions to be implemented at the hardware abstraction level.

Definition at line 17 of file TrgEventCounter.py.

Member Function Documentation

reset ( )

reset() method

Reset the event counters

Reimplemented in TrgGemEventCounter.

stats ( )

stats() method

Return the number of events seen by the counter

Returns:
an integer

Reimplemented in TrgGemEventCounter.

The documentation for this class was generated from the following file:
  • TrgEventCounter.py
Generated on Fri Jul 21 13:28:19 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgExtEnables Class Reference

TrgInputEnables.TrgExtEnables

TrgExtEnables Class Reference

Trigger External Enables class definition. More...

Inheritance diagram for TrgExtEnables:

[legend]
Collaboration diagram for TrgExtEnables:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgExtEnables constructor.
external ()
tower 'pure virtual' method

Detailed Description

Trigger External Enables class definition.

Definition at line 189 of file TrgInputEnables.py.

Member Function Documentation

external ( )

tower 'pure virtual' method

Returns:
A boolean

Reimplemented in NoExternal.

The documentation for this class was generated from the following file:
  • TrgInputEnables.py
Generated on Fri Jul 21 13:28:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGem Class Reference

TrgGem.TrgGem

TrgGem Class Reference

Trigger Global Trigger Electronics Module Interface class definition This class implements the hardware register access to the GEM. More...

Inheritance diagram for TrgGem:

[legend]
Collaboration diagram for TrgGem:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgGem constructor.
GEM (glt=None)
GEM function.
version ()
Version 'pure virtual' method.
solicit ()
Solicit 'pure virtual' method.
enable (mask=None)
disable ()
disable 'pure virtual' method
triggerCounters ()
triggerCounters 'pure virtual' method
tileCounters ()
tileCounters 'pure virtual' method
cnoCounters ()
cnoCounters 'pure virtual' method
cmdCounters ()
cmdCounters 'pure virtual' method
eventCounter ()
eventCounter 'pure virtual' method
ppsTimer ()
ppsTimer 'pure virtual' method
shut (marker)

Detailed Description

Trigger Global Trigger Electronics Module Interface class definition This class implements the hardware register access to the GEM.

Definition at line 17 of file TrgGem.py.

Member Function Documentation

cmdCounters ( )

cmdCounters 'pure virtual' method

Returns:
A TrgCmdCounters object
This object specifies an implementation of the GEM's Command/Response counters

Reimplemented from TrgGemAbstract.

cnoCounters ( )

cnoCounters 'pure virtual' method

Returns:
A TrgCnoCounters object
This object specifies an implementation of the GEM's cno counters

Reimplemented from TrgGemAbstract.

disable ( )

disable 'pure virtual' method

This function returns no value.

Disables the conditions returned by the conditions() member function. Once a condition is disabled, the condition will not activate the Trigger System, independent of its presence in the LAT.

Reimplemented from TrgAbstract.

Reimplemented in rcTrgGem.

eventCounter ( )

eventCounter 'pure virtual' method

Returns:
A TrgEventCounter object
This object specifies an implementation of the GEM's events sent counter

Reimplemented from TrgGemAbstract.

GEM ( glt = None )

GEM function.

Parameters:
glt,: a GGEM object
Returns:
a GGEM object
This function sets and/or the GGEM hardware implementation used by TrgGem.

ppsTimer ( )

ppsTimer 'pure virtual' method

Returns:
A TrgPPSTimer object
This object specifies an implementation of the GEM's 1-PPS timer

Reimplemented from TrgGemAbstract.

shut ( marker )

Implementation of the shut function.

Reimplemented from TrgAbstract.

solicit ( )

Solicit 'pure virtual' method.

Allows the application to assert the solicited condition. Depending on the engine (or engines) associated with this condition, asserting this condition will most likely cause a readout of the detector. This function returns no value.

Reimplemented from TrgAbstract.

tileCounters ( )

tileCounters 'pure virtual' method

Returns:
A TrgTileCounters object
This object specifies an implementation of the GEM's tile counters

Reimplemented from TrgGemAbstract.

triggerCounters ( )

triggerCounters 'pure virtual' method

Returns:
A TrgTriggerCounters object
This object specifies an implementation of the GEM's trigger counters

Reimplemented from TrgGemAbstract.

version ( )

Version 'pure virtual' method.

Returns:
An integer This value specifies (in a hardware dependent representation) the generation and revision numbers of the Trigger System.

Reimplemented from TrgAbstract.

The documentation for this class was generated from the following file:
  • TrgGem.py
Generated on Fri Jul 21 13:28:20 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemAbstract Class Reference

TrgGemAbstract.TrgGemAbstract

TrgGemAbstract Class Reference

Trigger Global trigger Electronics Module Interface class definition. More...

Inheritance diagram for TrgGemAbstract:

[legend]
Collaboration diagram for TrgGemAbstract:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgGemAbstract constructor.
width ()
width 'pure virtual' method
useAcdAsTrigger ()
UseAcdAsTrigger 'pure virtual' method.
redundantPPS ()
RedundantPPS 'pure virtual' method.
responseHeaderParityEven ()
responseHeaderParityEven 'pure virtual' method
responseDataParityEven ()
responseDataParityEven 'pure virtual' method
eventHeaderParityEven ()
eventHeaderParityEven 'pure virtual' method
eventDataParityEven ()
eventDataParityEven 'pure virtual' method
triggerParityEven ()
TriggerParityEven 'pure virtual' method.
inhibitContribution ()
inhibitContribution 'pure virtual' method
periodicCondition ()
PeriodicCondition 'pure virtual' method.
roi ()
Roi 'pure virtual' method.
triggerCounters ()
triggerCounters 'pure virtual' method
cnoCounters ()
cnoCounters 'pure virtual' method
tileCounters ()
tileCounters 'pure virtual' method
cmdCounters ()
cmdCounters 'pure virtual' method
eventCounter ()
eventCounter 'pure virtual' method
ppsTimer ()
ppsTimer 'pure virtual' method
maxEngines ()
maxEngines 'pure virtual' method
maxConditions ()
maxConditions 'pure virtual' method

Detailed Description

Trigger Global trigger Electronics Module Interface class definition.

Definition at line 16 of file TrgGemAbstract.py.

Member Function Documentation

cmdCounters ( )

cmdCounters 'pure virtual' method

Returns:
A TrgCmdCounters object
This object specifies an implementation of the GEM's Command/Response counters

Reimplemented in TrgGem.

cnoCounters ( )

cnoCounters 'pure virtual' method

Returns:
A TrgCnoCounters object
This object specifies an implementation of the GEM's cno counters

Reimplemented in TrgGem.

eventCounter ( )

eventCounter 'pure virtual' method

Returns:
A TrgEventCounter object
This object specifies an implementation of the GEM's events sent counter

Reimplemented in TrgGem.

eventDataParityEven ( )

eventDataParityEven 'pure virtual' method

Returns:
A boolean
This value specifies whether or not the parity associated with a trigger message body initiated by the GEM should be sent with odd or even parity. If the value returned is TRUE, trigger message bodies will have even parity. If the value returned is FALSE, trigger message bodies will have odd parity.

Reimplemented in TrgGemRegisters.

eventHeaderParityEven ( )

eventHeaderParityEven 'pure virtual' method

Returns:
A boolean
This value specifies whether or not the parity associated with a trigger message header initiated by the GEM should be sent with odd or even parity. If the value returned is TRUE, trigger message headers will have even parity. If the value returned is FALSE, trigger message headers will have odd parity.

Reimplemented in TrgGemRegisters.

inhibitContribution ( )

inhibitContribution 'pure virtual' method

Returns:
A boolean
This value specifies whether or not the GEM transmits a contribution to the event. If the value returned is TRUE, GEM contributions are inhibited. If the value returned is FALSE, GEM contributions are sent with the event.

Reimplemented in TrgGemRegisters.

maxConditions ( )

maxConditions 'pure virtual' method

Returns:
An integer This value specifies the type and number of conditions supported by the Trigger System.

Reimplemented from TrgAbstract.

maxEngines ( )

maxEngines 'pure virtual' method

Returns:
An integer This value determines the maximum number of Trigger Engines supported by the Trigger System.

Reimplemented from TrgAbstract.

periodicCondition ( )

PeriodicCondition 'pure virtual' method.

Returns:
A TrgPeriodicCondition object
This object specifies the initial and current definition of the periodic condition

Reimplemented in TrgUsingTiles.

ppsTimer ( )

ppsTimer 'pure virtual' method

Returns:
A TrgPPSTimer object
This object specifies an implementation of the GEM's 1-PPS timer

Reimplemented in TrgGem.

redundantPPS ( )

RedundantPPS 'pure virtual' method.

Returns:
A boolean
This value specifies whether or not the GEM should use the redundant 1-PPS signal. If the value returned is TRUE, the redundant 1-PPS signal will be used. If the value returned is FALSE, the primary 1-PPS signal will not be used.

responseDataParityEven ( )

responseDataParityEven 'pure virtual' method

Returns:
A boolean
This value specifies whether or not the parity associated with a command response packet body should be sent with odd or even parity. If the value returned is TRUE, response bodies will have even parity. If the value returned is FALSE, responses will have odd parity.

Reimplemented in TrgGemRegisters.

responseHeaderParityEven ( )

responseHeaderParityEven 'pure virtual' method

Returns:
A boolean
This value specifies whether or not the parity associated with a command responsepacket header should be sent with odd or even parity. If the value returned is TRUE, response headers will have even parity. If the value returned is FALSE, responses will have odd parity.

Reimplemented in TrgGemRegisters.

roi ( )

Roi 'pure virtual' method.

Returns:
A TrgRoi object
This object specifies the definition of the GEM's ROI generator

Reimplemented in TrgUsingTiles.

tileCounters ( )

tileCounters 'pure virtual' method

Returns:
A TrgTileCounters object
This object specifies an implementation of the GEM's tile counters

Reimplemented in TrgGem.

triggerCounters ( )

triggerCounters 'pure virtual' method

Returns:
A TrgTriggerCounters object
This object specifies an implementation of the GEM's trigger counters

Reimplemented in TrgGem.

triggerParityEven ( )

TriggerParityEven 'pure virtual' method.

Returns:
A boolean
This value specifies whether or not the parity associated with a trigger message initiated by the GEM should be sent with odd or even parity. If the value returned is TRUE, trigger messages will have even parity. If the value returned is FALSE, trigger messages will have odd parity.

Reimplemented in TrgGemRegisters.

useAcdAsTrigger ( )

UseAcdAsTrigger 'pure virtual' method.

Returns:
A boolean
This value specifies whether or not the the ROI generator and its ACD tile signals are be used as a trigger or as a veto. If the value returned is TRUE, the ROI generator is used as a trigger. If the value returned is FALSE, the ROI generator is used as a veto.

Reimplemented in rcGEMDefaultTrigger, and TrgUsingTiles.

width ( )

width 'pure virtual' method

Returns:
An int.
This value specifies the window of the GEM's trigger window (see [4]). The width is specified in units of system clock, where one system clock is 50 nanoseconds.

Reimplemented in TrgGemRegisters.

The documentation for this class was generated from the following file:
  • TrgGemAbstract.py
Generated on Fri Jul 21 13:28:20 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemCmdCounters Class Reference

TrgGemCounters.TrgGemCmdCounters

TrgGemCmdCounters Class Reference

TrgGemCmdCounters. More...

Inheritance diagram for TrgGemCmdCounters:

[legend]
Collaboration diagram for TrgGemCmdCounters:

[legend]
List of all members.

Public Member Functions

__init__ (glt)
TrgGemCmdCounters constructor.
stats ()
stats() method
reset ()
reset() member function

Detailed Description

TrgGemCmdCounters.

This class implements the HW abstraction corresponding to figure 62 of the GEM document: LAT-01545 Section 2.3.4

Definition at line 199 of file TrgGemCounters.py.

Member Function Documentation

reset ( )

reset() member function

Reset the command/response statistics register

Reimplemented from TrgCmdCounters.

stats ( )

stats() method

Get the command statistics object.

Returns:
a TrgCmdStats object

Reimplemented from TrgCmdCounters.

The documentation for this class was generated from the following file:
  • TrgGemCounters.py
Generated on Fri Jul 21 13:28:23 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemCmdStats Class Reference

TrgGemCounters.TrgGemCmdStats

TrgGemCmdStats Class Reference

TrgGemCmdStats. More...

Inheritance diagram for TrgGemCmdStats:

[legend]
Collaboration diagram for TrgGemCmdStats:

[legend]
List of all members.

Public Member Functions

__init__ (glt)
TrgGemCmdStats constructor.
command ()
command() method
response ()
response() method

Detailed Description

TrgGemCmdStats.

This class implements the HW abstraction corresponding to figure 62 of the GEM document: LAT-01545 Section 2.3.4

Definition at line 220 of file TrgGemCounters.py.

Member Function Documentation

command ( )

command() method

Returns:
an integer

Reimplemented from TrgCmdStats.

response ( )

response() method

Returns:
an integer

Reimplemented from TrgCmdStats.

The documentation for this class was generated from the following file:
  • TrgGemCounters.py
Generated on Fri Jul 21 13:28:24 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemCnoCounters Class Reference

TrgGemCounters.TrgGemCnoCounters

TrgGemCnoCounters Class Reference

TrgGemCnoCounters. More...

Inheritance diagram for TrgGemCnoCounters:

[legend]
Collaboration diagram for TrgGemCnoCounters:

[legend]
List of all members.

Public Member Functions

__init__ (glt)
TrgGemCnoCounters constructor.
stats ()
stats() member function Returns the statistics object for the Cno counters
reset ()
reset() member function
assignA (CnoNumber)
assignA() member function
assignB (CnoNumber)
assignB() member function
assignAB (a, b)
assignAB() member function

Detailed Description

TrgGemCnoCounters.

This class implements the HW abstraction corresponding to the Cno counter detailed in the GEM document: LAT-01545 Section 2.6

Definition at line 141 of file TrgGemCounters.py.

Member Function Documentation

assignA ( CnoNumber )

assignA() member function

Assign the 'A' Cno counter to watch a particular Cno Immediately after counter assignment, both counters are reset.

assignAB | ( | a | ,
 |  | b |
 | ) |

assignAB() member function

Assign both the 'A' and the'B' Cno counters to watch two Cnos Immediately after counter assignment, both counters are reset.

Reimplemented from TrgCnoCounters.

assignB ( CnoNumber )

assignB() member function

Assign the 'B' Cno counter to watch a particular Cno Immediately after counter assignment, both counters are reset.

reset ( )

reset() member function

Reset the Cno counter register

Reimplemented from TrgCnoCounters.

stats ( )

stats() member function Returns the statistics object for the Cno counters

Returns:
A TrgCnoStats object

Reimplemented from TrgCnoCounters.

The documentation for this class was generated from the following file:
  • TrgGemCounters.py
Generated on Fri Jul 21 13:28:22 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemCnoStats Class Reference

TrgGemCounters.TrgGemCnoStats

TrgGemCnoStats Class Reference

TrgGemCnoStats. More...

Inheritance diagram for TrgGemCnoStats:

[legend]
Collaboration diagram for TrgGemCnoStats:

[legend]
List of all members.

Public Member Functions

__init__ (glt)
TrgGemCnoStats constructor.
A ()
B ()

Detailed Description

TrgGemCnoStats.

This class implements the HW abstraction corresponding to figure 64 of the GEM document: LAT-01545 Section 2.5

Definition at line 183 of file TrgGemCounters.py.

Member Function Documentation

A ( )

Return the statistics for the 'A' Cno counter

Returns:
an integer

Reimplemented from TrgCnoStats.

B ( )

Return the statistics for the 'B' Cno counter

Returns:
an integer

Reimplemented from TrgCnoStats.

The documentation for this class was generated from the following file:
  • TrgGemCounters.py
Generated on Fri Jul 21 13:28:23 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemEventCounter Class Reference

TrgGemCounters.TrgGemEventCounter

TrgGemEventCounter Class Reference

TrgGemEventCounter. More...

Inheritance diagram for TrgGemEventCounter:

[legend]
Collaboration diagram for TrgGemEventCounter:

[legend]
List of all members.

Public Member Functions

__init__ (glt)
TrgGemEventCounter constructor.
stats ()
stats() method
reset ()
reset() member function

Detailed Description

TrgGemEventCounter.

This class implements the HW abstraction corresponding to figure 63 of the GEM document: LAT-01545 Section 2.3.6

Definition at line 236 of file TrgGemCounters.py.

Member Function Documentation

reset ( )

reset() member function

Reset the event statistics register

Reimplemented from TrgEventCounter.

stats ( )

stats() method

Return the number of events seen by the counter

Returns:
an integer

Reimplemented from TrgEventCounter.

The documentation for this class was generated from the following file:
  • TrgGemCounters.py
Generated on Fri Jul 21 13:28:24 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemPeriodicCondition Class Reference

TrgGemPeriodicCondition.TrgGemPeriodicCondition

TrgGemPeriodicCondition Class Reference

Trigger Periodic Condition class definition. More...

Inheritance diagram for TrgGemPeriodicCondition:

[legend]
Collaboration diagram for TrgGemPeriodicCondition:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgPeriodicConditionAbstract constructor.
remaining ()
remaining() method See base class
reset ()
reset() method See base class
abort ()
abort() method See base class
source ()
source() method See base class
prescale ()
prescale() method See base class
limit ()
limit() method See base class

Detailed Description

Trigger Periodic Condition class definition.

Definition at line 12 of file TrgGemPeriodicCondition.py.

The documentation for this class was generated from the following file:
  • TrgGemPeriodicCondition.py
Generated on Fri Jul 21 13:28:25 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemPPSTimer Class Reference

TrgGemCounters.TrgGemPPSTimer

TrgGemPPSTimer Class Reference

TrgGemPPSTimer class definition This class HW abstraction corresponding to figure 75 of the GEM document: LAT-01545 Section 2.6.4. More...

Inheritance diagram for TrgGemPPSTimer:

[legend]
Collaboration diagram for TrgGemPPSTimer:

[legend]
List of all members.

Public Member Functions

__init__ (glt)
TrgGemPPSTimer constructor.
seconds ()
seconds() method Return the counts the number of arrived 1-PPS signals since the GEM was reset
timebase ()
timebase() method Return the contains the time, in system clock ticks (50 nano-seconds), of the last arrived 1-PPS signal.

Detailed Description

TrgGemPPSTimer class definition This class HW abstraction corresponding to figure 75 of the GEM document: LAT-01545 Section 2.6.4.

Definition at line 256 of file TrgGemCounters.py.

Member Function Documentation

seconds ( )

seconds() method Return the counts the number of arrived 1-PPS signals since the GEM was reset

Returns:
an integer

Reimplemented from TrgPPSTimer.

timebase ( )

timebase() method Return the contains the time, in system clock ticks (50 nano-seconds), of the last arrived 1-PPS signal.

Returns:
an integer

Reimplemented from TrgPPSTimer.

The documentation for this class was generated from the following file:
  • TrgGemCounters.py
Generated on Fri Jul 21 13:28:24 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemRegisters Class Reference

TrgGemRegisters.TrgGemRegisters

TrgGemRegisters Class Reference

TrgGemRegisters class definition. More...

Inheritance diagram for TrgGemRegisters:

[legend]
Collaboration diagram for TrgGemRegisters:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgGem constructor.
configurationRegister ()
configurationRegister() method
widthRegister ()
widthRegister method
periodicRateRegister ()
periodicRateRegister method
periodicModeRegister ()
periodicModeRegister method
periodicLimitRegister ()
periodicLimitRegister method
sequenceRegister ()
sequenceRegister method
templateRegister (registerNumber)
templateRegister method
lookupTableRegister (registerNumber)
lookupTableRegister method
roiRegister (registerNumber)
roiRegister method
towerEnableRegister (registerNumber)
towerEnableRegister method
towerBusyEnableRegister ()
towerBusyEnableRegister method
externalEnableRegister ()
externalEnableRegister method
cnoEnableRegister ()
cnoEnableRegister method
tileEnableRegister (registerNumber)
tileEnableRegister method
width ()
width 'pure virtual' method
responseHeaderParityEven ()
responseHeaderParityEven 'pure virtual' method
responseDataParityEven ()
responseDataParityEven 'pure virtual' method
eventHeaderParityEven ()
eventHeaderParityEven 'pure virtual' method
eventDataParityEven ()
eventDataParityEven 'pure virtual' method
triggerParityEven ()
TriggerParityEven 'pure virtual' method.
inhibitContribution ()
inhibitContribution 'pure virtual' method

Detailed Description

TrgGemRegisters class definition.

Implements the register shape definitions for a GASU trigger system

Definition at line 20 of file TrgGemRegisters.py.

Member Function Documentation

cnoEnableRegister ( )

cnoEnableRegister method

Returns:
integer
Returns a 32 bit integer corresponding to the ACD CNO enable register Ref: LAT-TD-01545, 2.9.2

configurationRegister ( )

configurationRegister() method

Method to construct the value of the GEM configuration register

Returns:
An integer

eventDataParityEven ( )

eventDataParityEven 'pure virtual' method

Returns:
A boolean
This value specifies whether or not the parity associated with a trigger message body initiated by the GEM should be sent with odd or even parity. If the value returned is TRUE, trigger message bodies will have even parity. If the value returned is FALSE, trigger message bodies will have odd parity.

Reimplemented from TrgGemAbstract.

eventHeaderParityEven ( )

eventHeaderParityEven 'pure virtual' method

Returns:
A boolean
This value specifies whether or not the parity associated with a trigger message header initiated by the GEM should be sent with odd or even parity. If the value returned is TRUE, trigger message headers will have even parity. If the value returned is FALSE, trigger message headers will have odd parity.

Reimplemented from TrgGemAbstract.

externalEnableRegister ( )

externalEnableRegister method

Returns:
integer
Returns a 32 bit integer corresponding to the external enable register

inhibitContribution ( )

inhibitContribution 'pure virtual' method

Returns:
A boolean
This value specifies whether or not the GEM transmits a contribution to the event. If the value returned is TRUE, GEM contributions are inhibited. If the value returned is FALSE, GEM contributions are sent with the event.

Reimplemented from TrgGemAbstract.

lookupTableRegister ( registerNumber )

lookupTableRegister method

Parameters:
registerNumber A reference into the Scheduler register set
Returns:
integer
Returns a 32 bit integer referencing the TAM generator used for a particular trigger summary Ref: LAT-TD-01545, S 2.7

periodicLimitRegister ( )

periodicLimitRegister method

Returns:
integer
Returns a 32 bit integer corresponding to the PERIODIC_LIMITS register of the GEM. Ref: LAT-TD-01545, S 2.3.3.3

periodicModeRegister ( )

periodicModeRegister method

Returns:
integer
Returns a 32 bit integer corresponding to the PERIODIC_MODE register of the GEM. Ref: LAT-TD-01545, S 2.3.3.2

periodicRateRegister ( )

periodicRateRegister method

Returns:
integer
Returns a 32 bit integer corresponding to the PERIODIC_RATE register of the GEM. Ref: LAT-TD-01545, S 2.3.3.1

responseDataParityEven ( )

responseDataParityEven 'pure virtual' method

Returns:
A boolean
This value specifies whether or not the parity associated with a command response packet body should be sent with odd or even parity. If the value returned is TRUE, response bodies will have even parity. If the value returned is FALSE, responses will have odd parity.

Reimplemented from TrgGemAbstract.

responseHeaderParityEven ( )

responseHeaderParityEven 'pure virtual' method

Returns:
A boolean
This value specifies whether or not the parity associated with a command responsepacket header should be sent with odd or even parity. If the value returned is TRUE, response headers will have even parity. If the value returned is FALSE, responses will have odd parity.

Reimplemented from TrgGemAbstract.

roiRegister ( registerNumber )

roiRegister method

Parameters:
registerNumber A reference into the ROI generator registers
Returns:
integer
Returns a 32 bit integer referencing the 54 ROI registers defined in Ref: LAT-TD-01545, S 2.8

sequenceRegister ( )

sequenceRegister method

Returns:
integer
Returns a 32 bit integer corresponding to the SEQUENCE register of the GEM. Ref: LAT-TD-01545, S 2.3.4

templateRegister ( registerNumber )

templateRegister method

Parameters:
registerNumber An registerNumber value
Returns:
integer
Returns a 32 bit integer corresponding to the message engine template register of the TAM. Ref: LAT-TD-01545, S 2.5 Context portion is defined in 1.8.6.1

tileEnableRegister ( registerNumber )

tileEnableRegister method

Parameters:
registerNumber
Returns:
integer
Returns a 32 bit integer corresponding to the ACD tile enable register. Ref: LAT-TD-01545, 2.9.3

towerBusyEnableRegister ( )

towerBusyEnableRegister method

Returns:
integer
Returns a 32 bit integer corresponding to the Tower Busy enable register

towerEnableRegister ( registerNumber )

towerEnableRegister method

Parameters:
registerNumber A reference into the tower enable registers
Returns:
integer
Returns a 32 bit object corresponding to figures 78/79 of the GEM documentation. This is used to construct the registers TOWERS_0_3, etc. Ref: LAT-TD-01545, 2.9.1

triggerParityEven ( )

TriggerParityEven 'pure virtual' method.

Returns:
A boolean
This value specifies whether or not the parity associated with a trigger message initiated by the GEM should be sent with odd or even parity. If the value returned is TRUE, trigger messages will have even parity. If the value returned is FALSE, trigger messages will have odd parity.

Reimplemented from TrgGemAbstract.

width ( )

width 'pure virtual' method

Returns:
An int.
This value specifies the window of the GEM's trigger window (see [4]). The width is specified in units of system clock, where one system clock is 50 nanoseconds.

Reimplemented from TrgGemAbstract.

widthRegister ( )

widthRegister method

Returns:
integer
Returns a 32 bit integer corresponding to the WINDOW_WIDTH register of the GEM. Ref: LAT-TD-01545, S 2.9.1

The documentation for this class was generated from the following file:
  • TrgGemRegisters.py
Generated on Fri Jul 21 13:28:25 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemSequence Class Reference

TrgGemSequence.TrgGemSequence

TrgGemSequence Class Reference

TrgGemSequence Hardware abstraction for TrgSequence. More...

Inheritance diagram for TrgGemSequence:

[legend]
Collaboration diagram for TrgGemSequence:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgSequenceAbstract constructor.
eventNumber ()
eventNumber() method Returns 0
eventTag ()

Detailed Description

TrgGemSequence Hardware abstraction for TrgSequence.

Definition at line 15 of file TrgGemSequence.py.

Member Function Documentation

eventTag ( )

brief eventTag() method Returns 0

Reimplemented from TrgSequenceAbstract.

The documentation for this class was generated from the following file:
  • TrgGemSequence.py
Generated on Fri Jul 21 13:28:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemTileCounters Class Reference

TrgGemCounters.TrgGemTileCounters

TrgGemTileCounters Class Reference

TrgGemTileCounters. More...

Inheritance diagram for TrgGemTileCounters:

[legend]
Collaboration diagram for TrgGemTileCounters:

[legend]
List of all members.

Public Member Functions

__init__ (glt)
TrgGemTileCounters constructor.
stats ()
stats() member function Returns the statistics object for the tile counters
reset ()
reset() member function
assignA (tileNumber)
assignA() member function
assignB (tileNumber)
assignB() member function
assignAB (a, b)
assignAB() member function

Detailed Description

TrgGemTileCounters.

This class implements the HW abstraction corresponding to the tile counter detailed in the GEM document: LAT-01545 Section 2.6

Definition at line 82 of file TrgGemCounters.py.

Member Function Documentation

assignA ( tileNumber )

assignA() member function

Assign the 'A' tile counter to watch a particular tile Immediately after counter assignment, both counters are reset.

assignAB | ( | a | ,
 |  | b |
 | ) |

assignAB() member function

Assign both the 'A' and the'B' tile counters to watch two tiles Immediately after counter assignment, both counters are reset.

Reimplemented from TrgTileCounters.

assignB ( tileNumber )

assignB() member function

Assign the 'B' tile counter to watch a particular tile Immediately after counter assignment, both counters are reset.

reset ( )

reset() member function

Reset the tile counter register

Reimplemented from TrgTileCounters.

stats ( )

stats() member function Returns the statistics object for the tile counters

Returns:
A TrgTileStats object

Reimplemented from TrgTileCounters.

The documentation for this class was generated from the following file:
  • TrgGemCounters.py
Generated on Fri Jul 21 13:28:21 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemTileStats Class Reference

TrgGemCounters.TrgGemTileStats

TrgGemTileStats Class Reference

TrgGemTileStats. More...

Inheritance diagram for TrgGemTileStats:

[legend]
Collaboration diagram for TrgGemTileStats:

[legend]
List of all members.

Public Member Functions

__init__ (glt)
TrgGemTileStats constructor.
A ()
B ()

Detailed Description

TrgGemTileStats.

This class implements the HW abstraction corresponding to figure 64 of the GEM document: LAT-01545 Section 2.5

Definition at line 124 of file TrgGemCounters.py.

Member Function Documentation

A ( )

Return the statistics for the 'A' tile counter

Returns:
an integer

Reimplemented from TrgTileStats.

B ( )

Return the statistics for the 'B' tile counter

Returns:
an integer

Reimplemented from TrgTileStats.

The documentation for this class was generated from the following file:
  • TrgGemCounters.py
Generated on Fri Jul 21 13:28:22 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemTriggerCounters Class Reference

TrgGemCounters.TrgGemTriggerCounters

TrgGemTriggerCounters Class Reference

TrgGemTriggerCounters class. More...

Inheritance diagram for TrgGemTriggerCounters:

[legend]
Collaboration diagram for TrgGemTriggerCounters:

[legend]
List of all members.

Public Member Functions

__init__ (glt)
TrgGemTriggerCounters constructor.
stats ()
stats() member function Returns an object that accesses the trigger statistics
reset ()
reset() member function Reset the statistics registers

Detailed Description

TrgGemTriggerCounters class.

This class implements the HW abstraction corresponding to figure 66-69 of the GEM document: LAT-01545 Section 2.6.1 and 2.6.2

Definition at line 36 of file TrgGemCounters.py.

Member Function Documentation

stats ( )

stats() member function Returns an object that accesses the trigger statistics

Returns:
a TrgGemTriggerStats object

Reimplemented from TrgTriggerCounters.

The documentation for this class was generated from the following file:
  • TrgGemCounters.py
Generated on Fri Jul 21 13:28:21 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemTriggerStats Class Reference

TrgGemCounters.TrgGemTriggerStats

TrgGemTriggerStats Class Reference

TrgGemTriggerStats This class implements the HW abstraction corresponding to figure 66-69 of the GEM document: LAT-01545 Section 2.6.1 and 2.6.2. More...

Inheritance diagram for TrgGemTriggerStats:

[legend]
Collaboration diagram for TrgGemTriggerStats:

[legend]
List of all members.

Public Member Functions

__init__ (glt)
TrgGemTriggerStats constructor.
livetime ()
livetime() method Return the system livetime
prescaled ()
prescaled() method Return the number of events that have been prescaled
discarded ()
discarded() method Return the number of events discarded
sent ()
sent() method Return the number of events sent on

Detailed Description

TrgGemTriggerStats This class implements the HW abstraction corresponding to figure 66-69 of the GEM document: LAT-01545 Section 2.6.1 and 2.6.2.

Note: Reading the livetime register latches all 4 registers. Rereading the livetime register unlatches the registers.

Definition at line 63 of file TrgGemCounters.py.

Member Function Documentation

discarded ( )

discarded() method Return the number of events discarded

Returns:
an integer

Reimplemented from TrgTriggerStats.

livetime ( )

livetime() method Return the system livetime

Returns:
an integer

Reimplemented from TrgTriggerStats.

prescaled ( )

prescaled() method Return the number of events that have been prescaled

Returns:
an integer

Reimplemented from TrgTriggerStats.

sent ( )

sent() method Return the number of events sent on

Returns:
an integer

Reimplemented from TrgTriggerStats.

The documentation for this class was generated from the following file:
  • TrgGemCounters.py
Generated on Fri Jul 21 13:28:21 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgInjectCharge Class Reference

TrgEngines.TrgInjectCharge

TrgInjectCharge Class Reference

TrgInjectCharge class definition. More...

Inheritance diagram for TrgInjectCharge:

[legend]
Collaboration diagram for TrgInjectCharge:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgInjectCharge constructor.
sequence ()
sequence() method See TrgEngineRequest base class

Detailed Description

TrgInjectCharge class definition.

Directs a module to send to its Front-End Electronics a command sequence which is composed only of the CALSTROBE command. This command will not trigger a readout of the module's Front-End Electronics.

Definition at line 118 of file TrgEngines.py.

The documentation for this class was generated from the following file:
  • TrgEngines.py
Generated on Fri Jul 21 13:28:17 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgInjectChargeReadout Class Reference

TrgEngines.TrgInjectChargeReadout

TrgInjectChargeReadout Class Reference

Trigger Inject Charge Readout class definition. More...

Inheritance diagram for TrgInjectChargeReadout:

[legend]
Collaboration diagram for TrgInjectChargeReadout:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgInjectChargeReadout constructor.
sequence ()
sequence() method See TrgEngineRequest base class

Detailed Description

Trigger Inject Charge Readout class definition.

Directs a module to send to its Front-End Electronics a command sequence which is composed of a CALSTROBE followed by a TACK command. This sequence will trigger a readout of the module's Front-End Electronics.

Definition at line 158 of file TrgEngines.py.

The documentation for this class was generated from the following file:
  • TrgEngines.py
Generated on Fri Jul 21 13:28:18 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgInjectMarker Class Reference

TrgEngines.TrgInjectMarker

TrgInjectMarker Class Reference

Trigger Inject Marker class definition Directs a module to send to its Front-End Electronics a command sequence which is composed of only a TACK command. This sequence will trigger a readout of the module's Front-End Electronics. More...

Inheritance diagram for TrgInjectMarker:

[legend]
Collaboration diagram for TrgInjectMarker:

[legend]
List of all members.

Public Member Functions

__init__ (marker)
TrgInjectMarker constructor.
sequence ()
sequence() method See TrgEngineRequest base class
marker ()
marker() method See TrgEngineRequest base class

Detailed Description

Trigger Inject Marker class definition Directs a module to send to its Front-End Electronics a command sequence which is composed of only a TACK command. This sequence will trigger a readout of the module's Front-End Electronics.

Definition at line 177 of file TrgEngines.py.

The documentation for this class was generated from the following file:
  • TrgEngines.py
Generated on Fri Jul 21 13:28:19 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgInputEnables Class Reference

TrgInputEnables.TrgInputEnables

TrgInputEnables Class Reference

Trigger Input Enables class definition. More...

Inheritance diagram for TrgInputEnables:

[legend]
Collaboration diagram for TrgInputEnables:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgInputEnables constructor.
towers ()
Towers 'pure virtual' method.
cno ()
Cno 'pure virtual' method.
tiles ()
Tiles 'pure virtual' method.
towerBusy ()
Tiles 'pure virtual' method.
external ()
Tiles 'pure virtual' method.

Detailed Description

Trigger Input Enables class definition.

Definition at line 12 of file TrgInputEnables.py.

Member Function Documentation

cno ( )

Cno 'pure virtual' method.

Returns:
A TrgCnoEnables object

Reimplemented in NoInputsEnabled.

external ( )

Tiles 'pure virtual' method.

Returns:
A TrgExtEnables object

Reimplemented in NoInputsEnabled.

tiles ( )

Tiles 'pure virtual' method.

Returns:
A TrgTileEnables object

towerBusy ( )

Tiles 'pure virtual' method.

Returns:
A TrgTowerBusyEnables object

towers ( )

Towers 'pure virtual' method.

Returns:
A TrgTowerEnables object

Reimplemented in NoInputsEnabled.

The documentation for this class was generated from the following file:
  • TrgInputEnables.py
Generated on Fri Jul 21 13:28:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: trgLATcomponentIterator Class Reference

trgConsumer.trgLATcomponentIterator

trgLATcomponentIterator Class Reference

List of all members.

Public Member Functions

GEMcomponent (event, gemContribution)

Detailed Description

Definition at line 14 of file trgConsumer.py.

The documentation for this class was generated from the following file:
  • trgConsumer.py
Generated on Fri Jul 21 13:28:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgMiniGLT Class Reference

TrgMiniGLT.TrgMiniGLT

TrgMiniGLT Class Reference

Mini GLT Hardware abstraction implementation. More...

Inheritance diagram for TrgMiniGLT:

[legend]
Collaboration diagram for TrgMiniGLT:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgMiniGLT constructor.
GLT (glt=None)
GLT function glt: a GGLT object This function sets the GLT hardware implementation used by TrgGem.
solicit ()
Solicit 'pure virtual' method.
enable (mask=None)
disable ()
disable 'pure virtual' method
shut (marker)

Detailed Description

Mini GLT Hardware abstraction implementation.

Definition at line 16 of file TrgMiniGLT.py.

Member Function Documentation

disable ( )

disable 'pure virtual' method

This function returns no value.

Disables the conditions returned by the conditions() member function. Once a condition is disabled, the condition will not activate the Trigger System, independent of its presence in the LAT.

Reimplemented from TrgAbstract.

Reimplemented in rcTrgMiniGLT.

shut ( marker )

Implementation of the shut function.

Reimplemented from TrgAbstract.

solicit ( )

Solicit 'pure virtual' method.

Allows the application to assert the solicited condition. Depending on the engine (or engines) associated with this condition, asserting this condition will most likely cause a readout of the detector. This function returns no value.

Reimplemented from TrgAbstract.

The documentation for this class was generated from the following file:
  • TrgMiniGLT.py
Generated on Fri Jul 21 13:28:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgMiniGLTAbstract Class Reference

TrgMiniGLTAbstract.TrgMiniGLTAbstract

TrgMiniGLTAbstract Class Reference

TrgMiniGLTAbstract Interface class definition This class inherits from TrgAbstract to define the structure of a MiniGLT trigger. More...

Inheritance diagram for TrgMiniGLTAbstract:

[legend]
Collaboration diagram for TrgMiniGLTAbstract:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgMiniGLTAbstract constructor.
parity ()
parity() member function Returns a boolean indicating the state of the parity bitfield in the configuration register of the MiniGLT
tag ()
tag() member function Returns an integer indicating the state of the tag bitfield in the configuration register of the MiniGLT
eventNumber ()
eventNumber() member function Returns an integer indicating the starting event number of the MiniGLT
destination ()
destination() member function Returns an integer indicating the state of the destination bitfield in the configuration register of the MiniGLT
marker ()
marker() member function Returns an integer indicating the state of the marker bitfield in the configuration register of the MiniGLT
tack ()
tack() member function Returns a boolean indicating the state of the tack bitfield in the configuration register of the MiniGLT
zeroSuppress ()
zeroSuppress() member function Returns a boolean indicating the state of the zeroSuppress bitfield in the configuration register of the MiniGLT
fourRangeReadout ()
fourRangeReadout() member function Returns a boolean indicating the state of the fourRangeReadout bitfield in the configuration register of the MiniGLT
calStrobe ()
calStrobe() member function Returns a boolean indicating the state of the calStrobe bitfield in the configuration register of the MiniGLT

Detailed Description

TrgMiniGLTAbstract Interface class definition This class inherits from TrgAbstract to define the structure of a MiniGLT trigger.

Definition at line 14 of file TrgMiniGLTAbstract.py.

Member Function Documentation

calStrobe ( )

calStrobe() member function Returns a boolean indicating the state of the calStrobe bitfield in the configuration register of the MiniGLT

Returns:
a boolean

Reimplemented in TrgMiniGLTRegisters.

destination ( )

destination() member function Returns an integer indicating the state of the destination bitfield in the configuration register of the MiniGLT

Returns:
an integer

Reimplemented in TrgMiniGLTRegisters.

eventNumber ( )

eventNumber() member function Returns an integer indicating the starting event number of the MiniGLT

Returns:
an integer

Reimplemented in TrgMiniGLTRegisters.

fourRangeReadout ( )

fourRangeReadout() member function Returns a boolean indicating the state of the fourRangeReadout bitfield in the configuration register of the MiniGLT

Returns:
a boolean

Reimplemented in TrgMiniGLTRegisters.

marker ( )

marker() member function Returns an integer indicating the state of the marker bitfield in the configuration register of the MiniGLT

Returns:
an integer

Reimplemented in TrgMiniGLTRegisters.

parity ( )

parity() member function Returns a boolean indicating the state of the parity bitfield in the configuration register of the MiniGLT

Returns:
a boolean

Reimplemented in TrgMiniGLTRegisters.

tack ( )

tack() member function Returns a boolean indicating the state of the tack bitfield in the configuration register of the MiniGLT

Returns:
a boolean

Reimplemented in TrgMiniGLTRegisters.

tag ( )

tag() member function Returns an integer indicating the state of the tag bitfield in the configuration register of the MiniGLT

Returns:
an integer

Reimplemented in TrgMiniGLTRegisters.

zeroSuppress ( )

zeroSuppress() member function Returns a boolean indicating the state of the zeroSuppress bitfield in the configuration register of the MiniGLT

Returns:
a boolean

Reimplemented in TrgMiniGLTRegisters.

The documentation for this class was generated from the following file:
  • TrgMiniGLTAbstract.py
Generated on Fri Jul 21 13:28:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgMiniGLTRegisters Class Reference

TrgMiniGLTRegisters.TrgMiniGLTRegisters

TrgMiniGLTRegisters Class Reference

Register shape definition class for the MiniGLT This class defines the shapes of the registers and bitfields used in the MiniGLT. More...

Inheritance diagram for TrgMiniGLTRegisters:

[legend]
Collaboration diagram for TrgMiniGLTRegisters:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgMiniGLTAbstract constructor.
parity ()
parity() member function Returns a boolean indicating the state of the parity bitfield in the configuration register of the MiniGLT
tag ()
tag() member function Returns an integer indicating the state of the tag bitfield in the configuration register of the MiniGLT
eventNumber ()
eventNumber() member function Returns an integer indicating the starting event number of the MiniGLT
destination ()
destination() member function Returns an integer indicating the state of the destination bitfield in the configuration register of the MiniGLT
marker ()
marker() member function Returns an integer indicating the state of the marker bitfield in the configuration register of the MiniGLT
tack ()
tack() member function Returns a boolean indicating the state of the tack bitfield in the configuration register of the MiniGLT
zeroSuppress ()
zeroSuppress() member function Returns a boolean indicating the state of the zeroSuppress bitfield in the configuration register of the MiniGLT
fourRangeReadout ()
fourRangeReadout() member function Returns a boolean indicating the state of the fourRangeReadout bitfield in the configuration register of the MiniGLT
calStrobe ()
calStrobe() member function Returns a boolean indicating the state of the calStrobe bitfield in the configuration register of the MiniGLT

Detailed Description

Register shape definition class for the MiniGLT This class defines the shapes of the registers and bitfields used in the MiniGLT.

Definition at line 15 of file TrgMiniGLTRegisters.py.

Member Function Documentation

calStrobe ( )

calStrobe() member function Returns a boolean indicating the state of the calStrobe bitfield in the configuration register of the MiniGLT

Returns:
a boolean

Reimplemented from TrgMiniGLTAbstract.

destination ( )

destination() member function Returns an integer indicating the state of the destination bitfield in the configuration register of the MiniGLT

Returns:
an integer

Reimplemented from TrgMiniGLTAbstract.

eventNumber ( )

eventNumber() member function Returns an integer indicating the starting event number of the MiniGLT

Returns:
an integer

Reimplemented from TrgMiniGLTAbstract.

fourRangeReadout ( )

fourRangeReadout() member function Returns a boolean indicating the state of the fourRangeReadout bitfield in the configuration register of the MiniGLT

Returns:
a boolean

Reimplemented from TrgMiniGLTAbstract.

marker ( )

marker() member function Returns an integer indicating the state of the marker bitfield in the configuration register of the MiniGLT

Returns:
an integer

Reimplemented from TrgMiniGLTAbstract.

parity ( )

parity() member function Returns a boolean indicating the state of the parity bitfield in the configuration register of the MiniGLT

Returns:
a boolean

Reimplemented from TrgMiniGLTAbstract.

tack ( )

tack() member function Returns a boolean indicating the state of the tack bitfield in the configuration register of the MiniGLT

Returns:
a boolean

Reimplemented from TrgMiniGLTAbstract.

tag ( )

tag() member function Returns an integer indicating the state of the tag bitfield in the configuration register of the MiniGLT

Returns:
an integer

Reimplemented from TrgMiniGLTAbstract.

zeroSuppress ( )

zeroSuppress() member function Returns a boolean indicating the state of the zeroSuppress bitfield in the configuration register of the MiniGLT

Returns:
a boolean

Reimplemented from TrgMiniGLTAbstract.

The documentation for this class was generated from the following file:
  • TrgMiniGLTRegisters.py
Generated on Fri Jul 21 13:28:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgObject Class Reference

TrgObject.TrgObject

TrgObject Class Reference

Trigger Object class definition. More...

Inheritance diagram for TrgObject:

[legend]
List of all members.

Public Member Functions

__setattr__ (name, value)

Detailed Description

Trigger Object class definition.

Definition at line 10 of file TrgObject.py.

Member Function Documentation

__setattr__ | ( | name | ,
 |  | value |
 | ) |

Reject attempts to modify TrgObject's constants.

The documentation for this class was generated from the following file:
  • TrgObject.py
Generated on Fri Jul 21 13:28:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgPeriodicCondition Class Reference

TrgPeriodic.TrgPeriodicCondition

TrgPeriodicCondition Class Reference

Trigger Periodic Condition class definition. More...

Inheritance diagram for TrgPeriodicCondition:

[legend]
Collaboration diagram for TrgPeriodicCondition:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgPeriodicConditionAbstract constructor.
definition ()
definition() method Returns an object of type TrgPeriodicConditionDefinition. This object will be used to both define the initial values for the periodic condition and is used by the reset() function to re-establish the initial limit value.
remaining ()
remaining() method Returns the number of iterations remaining before the periodic condition stops.
reset ()
reset() method Will cause the periodic condition to stop, regardless of how many iterations are remaining. It will re-initialize the limit function with the value returned by the limit function of. If the periodic condition is free running, this function has no effect.
abort ()
abort() method Will cause the periodic condition to stop, regardless of how many iterations are remaining. If the periodic condition is free running, this function has no effect.

Detailed Description

Trigger Periodic Condition class definition.

Definition at line 49 of file TrgPeriodic.py.

The documentation for this class was generated from the following file:
  • TrgPeriodic.py
Generated on Fri Jul 21 13:28:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgPeriodicConditionAbstract Class Reference

TrgPeriodic.TrgPeriodicConditionAbstract

TrgPeriodicConditionAbstract Class Reference

TrgPeriodicConditionAbstract class definition. More...

Inheritance diagram for TrgPeriodicConditionAbstract:

[legend]
Collaboration diagram for TrgPeriodicConditionAbstract:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgPeriodicConditionAbstract constructor.
source ()
source() 'virtual' method If the returned value is FALSE, the system clock is used as the source of the periodic condition. If the returned value is TRUE, the 1-PPS signal is used as the source of the condition.
prescale ()
prescale() 'virtual' method Determines how the source signal is prescaled to form the periodic condition. That is, it sets the rate of the periodic condition. A value of zero does not prescale the periodic condition. This would, for example, assuming the system clock is used as source, create a periodic condition which operates at 20 MHZ. Range: [0 .. 0xffffff]
limit ()
limit() 'virtual' method Returns the number of iterations of the periodic condition before the condition stops. A value of zero (0) will cause the periodic condition to 'free-run', or never stop.

Detailed Description

TrgPeriodicConditionAbstract class definition.

Definition at line 12 of file TrgPeriodic.py.

Member Function Documentation

limit ( )

limit() 'virtual' method Returns the number of iterations of the periodic condition before the condition stops. A value of zero (0) will cause the periodic condition to 'free-run', or never stop.

Returns:
An integer

Reimplemented in TrgGemPeriodicCondition, and TrgDefaultPeriodicCondition.

prescale ( )

prescale() 'virtual' method Determines how the source signal is prescaled to form the periodic condition. That is, it sets the rate of the periodic condition. A value of zero does not prescale the periodic condition. This would, for example, assuming the system clock is used as source, create a periodic condition which operates at 20 MHZ. Range: [0 .. 0xffffff]

Returns:
An integer

Reimplemented in TrgGemPeriodicCondition, and TrgDefaultPeriodicCondition.

source ( )

source() 'virtual' method If the returned value is FALSE, the system clock is used as the source of the periodic condition. If the returned value is TRUE, the 1-PPS signal is used as the source of the condition.

Returns:
A boolean

Reimplemented in TrgGemPeriodicCondition, and TrgDefaultPeriodicCondition.

The documentation for this class was generated from the following file:
  • TrgPeriodic.py
Generated on Fri Jul 21 13:28:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgPeriodicConditionDefinition Class Reference

TrgPeriodic.TrgPeriodicConditionDefinition

TrgPeriodicConditionDefinition Class Reference

TrgPeriodicConditionDefinition class definition. More...

Inheritance diagram for TrgPeriodicConditionDefinition:

[legend]
Collaboration diagram for TrgPeriodicConditionDefinition:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgPeriodicConditionAbstract constructor.

Detailed Description

TrgPeriodicConditionDefinition class definition.

Definition at line 84 of file TrgPeriodic.py.

The documentation for this class was generated from the following file:
  • TrgPeriodic.py
Generated on Fri Jul 21 13:28:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgPPSTimer Class Reference

TrgPPSTimer.TrgPPSTimer

TrgPPSTimer Class Reference

TrgPPSTimer class definition This class controls the GEM's 1-PPS timer. More...

Inheritance diagram for TrgPPSTimer:

[legend]
Collaboration diagram for TrgPPSTimer:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgPPSTimer constructor.
seconds ()
seconds() method Return the counts the number of arrived 1-PPS signals since the GEM was reset
timebase ()
timebase() method Return the contains the time, in system clock ticks (50 nano-seconds), of the last arrived 1-PPS signal.

Detailed Description

TrgPPSTimer class definition This class controls the GEM's 1-PPS timer.

Definition at line 13 of file TrgPPSTimer.py.

Member Function Documentation

seconds ( )

seconds() method Return the counts the number of arrived 1-PPS signals since the GEM was reset

Returns:
an integer

Reimplemented in TrgGemPPSTimer.

timebase ( )

timebase() method Return the contains the time, in system clock ticks (50 nano-seconds), of the last arrived 1-PPS signal.

Returns:
an integer

Reimplemented in TrgGemPPSTimer.

The documentation for this class was generated from the following file:
  • TrgPPSTimer.py
Generated on Fri Jul 21 13:28:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgReadout Class Reference

TrgEngines.TrgReadout

TrgReadout Class Reference

TrgReadout class definition. More...

Inheritance diagram for TrgReadout:

[legend]
Collaboration diagram for TrgReadout:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgReadout constructor.
sequence ()
sequence() method See TrgEngineRequest base class

Detailed Description

TrgReadout class definition.

Directs a module to send to its Front-End Electronics a command sequence which is composed only of the TACK command. This command will trigger a readout of the module's Front-End Electronics.

Definition at line 138 of file TrgEngines.py.

The documentation for this class was generated from the following file:
  • TrgEngines.py
Generated on Fri Jul 21 13:28:18 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgRoi Class Reference

TrgCoincidences.TrgRoi

TrgRoi Class Reference

Trigger ROI (Region of Interest) class definition. More...

Inheritance diagram for TrgRoi:

[legend]
Collaboration diagram for TrgRoi:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgRoi constructor.
tile (tileNumber)
tile 'pure virtual' method

Detailed Description

Trigger ROI (Region of Interest) class definition.

Definition at line 30 of file TrgCoincidences.py.

Member Function Documentation

tile ( tileNumber )

tile 'pure virtual' method

Parameters:
tileNumber A tile number
Returns:
A boolean

Reimplemented in NullRoi, AddableRoi, and MyRoi.

The documentation for this class was generated from the following file:
  • TrgCoincidences.py
Generated on Fri Jul 21 13:28:11 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgRoiAsTiles Class Reference

TrgRoiAsTiles.TrgRoiAsTiles

TrgRoiAsTiles Class Reference

Class TrgRoiAsTiles LATTE provided class to map coincidences to ROIs. More...

Inheritance diagram for TrgRoiAsTiles:

[legend]
Collaboration diagram for TrgRoiAsTiles:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgCoincidences constructor.
coincidence (coincidenceNumber)
coincidence 'pure virtual' method Reference into the list of coincidences.
roi (roiNumber)
addCoincidence (cNumber, coinc)

Detailed Description

Class TrgRoiAsTiles LATTE provided class to map coincidences to ROIs.

Definition at line 16 of file TrgRoiAsTiles.py.

Member Function Documentation

coincidence ( coincidenceNumber )

coincidence 'pure virtual' method Reference into the list of coincidences.

Parameters:
coincidenceNumber A coincidence number
Returns:
A TrgCoincidence object

Reimplemented from TrgCoincidences.

The documentation for this class was generated from the following file:
  • TrgRoiAsTiles.py
Generated on Fri Jul 21 13:28:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgRoiAsVeto Class Reference

TrgRoiAsVeto.TrgRoiAsVeto

TrgRoiAsVeto Class Reference

Inheritance diagram for TrgRoiAsVeto:

[legend]
Collaboration diagram for TrgRoiAsVeto:

[legend]
List of all members.

Public Member Functions

roi (roiNumber)

Detailed Description

Definition at line 10 of file TrgRoiAsVeto.py.

The documentation for this class was generated from the following file:
  • TrgRoiAsVeto.py
Generated on Fri Jul 21 13:28:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgRois Class Reference

TrgCoincidences.TrgRois

TrgRois Class Reference

Trigger ROI (Region of Interest) list class definition. More...

Inheritance diagram for TrgRois:

[legend]
Collaboration diagram for TrgRois:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgRois constructor.
roi (regionNumber)
roi 'pure virtual' method Reference into the list of ROIs

Detailed Description

Trigger ROI (Region of Interest) list class definition.

Definition at line 12 of file TrgCoincidences.py.

Member Function Documentation

roi ( regionNumber )

roi 'pure virtual' method Reference into the list of ROIs

Parameters:
regionNumber A region number
Returns:
A TrgRoi objece

The documentation for this class was generated from the following file:
  • TrgCoincidences.py
Generated on Fri Jul 21 13:28:11 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgSequence Class Reference

TrgSequence.TrgSequence

TrgSequence Class Reference

Trigger Sequence class definition. More...

Inheritance diagram for TrgSequence:

[legend]
Collaboration diagram for TrgSequence:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgSequenceAbstract constructor.
definition ()
definition() member

Detailed Description

Trigger Sequence class definition.

Definition at line 43 of file TrgSequence.py.

Member Function Documentation

definition ( )

definition() member

Returns:
an object of type TrgSequenceDefinition

Reimplemented in DefaultSequence.

The documentation for this class was generated from the following file:
  • TrgSequence.py
Generated on Fri Jul 21 13:28:36 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgSequenceAbstract Class Reference

TrgSequence.TrgSequenceAbstract

TrgSequenceAbstract Class Reference

Abstract Trigger Sequence class definition. More...

Inheritance diagram for TrgSequenceAbstract:

[legend]
Collaboration diagram for TrgSequenceAbstract:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgSequenceAbstract constructor.
eventNumber ()
EventNumber 'pure virtual' method.
eventTag ()
EventTag 'pure virtual' method.

Detailed Description

Abstract Trigger Sequence class definition.

Definition at line 12 of file TrgSequence.py.

Member Function Documentation

eventNumber ( )

EventNumber 'pure virtual' method.

Returns:
An integer containing the current event number

Reimplemented in TrgGemSequence, and TrgDefaultSequence.

eventTag ( )

EventTag 'pure virtual' method.

Returns:
An integer containing the current event tag value

Reimplemented in TrgGemSequence, and TrgDefaultSequence.

The documentation for this class was generated from the following file:
  • TrgSequence.py
Generated on Fri Jul 21 13:28:35 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgSequenceDefinition Class Reference

TrgSequence.TrgSequenceDefinition

TrgSequenceDefinition Class Reference

Trigger Sequence Definition class definition. More...

Inheritance diagram for TrgSequenceDefinition:

[legend]
Collaboration diagram for TrgSequenceDefinition:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgSequenceAbstract constructor.

Detailed Description

Trigger Sequence Definition class definition.

Definition at line 35 of file TrgSequence.py.

The documentation for this class was generated from the following file:
  • TrgSequence.py
Generated on Fri Jul 21 13:28:35 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgTileCounters Class Reference

TrgTileCounters.TrgTileCounters

TrgTileCounters Class Reference

TrgTileCounters class definition This class controls the counters used to count ACD tile transitions. More...

Inheritance diagram for TrgTileCounters:

[legend]
Collaboration diagram for TrgTileCounters:

[legend]
List of all members.

Public Member Functions

__init__ ()
stats ()
stats() member function Returns the statistics object for the tile counters
reset ()
reset() member function Reset the tile statistics
assignA (a)
assignA() member function Assign the 'A' tile counter to watch a particular tile Immediately after counter assignment, both counters are reset.
assignB (B)
assignB() member function Assign the 'B' tile counter to watch a particular tile Immediately after counter assignment, both counters are reset.
assignAB (a, b)
assignAB() member function Assign both the 'A' and the'B' tile counters to watch two tiles Immediately after counter assignment, both counters are reset.

Detailed Description

TrgTileCounters class definition This class controls the counters used to count ACD tile transitions.

Definition at line 13 of file TrgTileCounters.py.

Member Function Documentation

stats ( )

stats() member function Returns the statistics object for the tile counters

Returns:
A TrgTileStats object

Reimplemented in TrgGemTileCounters.

The documentation for this class was generated from the following file:
  • TrgTileCounters.py
Generated on Fri Jul 21 13:28:36 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgTileEnables Class Reference

TrgInputEnables.TrgTileEnables

TrgTileEnables Class Reference

Trigger Tile Enables class definition. More...

Inheritance diagram for TrgTileEnables:

[legend]
Collaboration diagram for TrgTileEnables:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgTileEnables constructor.
tile (tileNumber)
Tile 'pure virtual' method.

Detailed Description

Trigger Tile Enables class definition.

Definition at line 153 of file TrgInputEnables.py.

Member Function Documentation

tile ( tileNumber )

Tile 'pure virtual' method.

Parameters:
tileNumber A tile number
Returns:
An integer

Reimplemented in NoTilesEnabled, and rcTrgTileEnables.

The documentation for this class was generated from the following file:
  • TrgInputEnables.py
Generated on Fri Jul 21 13:28:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgTileStats Class Reference

TrgTileCounters.TrgTileStats

TrgTileStats Class Reference

TrgTileStats class definition This class specifies the statistics returned by the counters described by TrgTileCounters. More...

Inheritance diagram for TrgTileStats:

[legend]
Collaboration diagram for TrgTileStats:

[legend]
List of all members.

Public Member Functions

__init__ ()
A ()
B ()

Detailed Description

TrgTileStats class definition This class specifies the statistics returned by the counters described by TrgTileCounters.

Definition at line 52 of file TrgTileCounters.py.

Member Function Documentation

A ( )

Return the statistics for the 'A' tile counter

Returns:
an integer

Reimplemented in TrgGemTileStats.

B ( )

Return the statistics for the 'B' tile counter

Returns:
an integer

Reimplemented in TrgGemTileStats.

The documentation for this class was generated from the following file:
  • TrgTileCounters.py
Generated on Fri Jul 21 13:28:37 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgTower Class Reference

TrgTower.TrgTower

TrgTower Class Reference

Trigger Tower class definition. More...

Inheritance diagram for TrgTower:

[legend]
Collaboration diagram for TrgTower:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgTower constructor.
calorimeter ()
Calorimeter 'pure virtual' method.
tracker ()
Tracker 'pure virtual' method.

Detailed Description

Trigger Tower class definition.

Definition at line 30 of file TrgTower.py.

Member Function Documentation

calorimeter ( )

Calorimeter 'pure virtual' method.

Returns:
A TrgCalorimeter object

Reimplemented in NullTower.

tracker ( )

Tracker 'pure virtual' method.

Returns:
A TrgTracker object

Reimplemented in NullTower.

The documentation for this class was generated from the following file:
  • TrgTower.py
Generated on Fri Jul 21 13:28:37 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgTowerBusyEnables Class Reference

TrgInputEnables.TrgTowerBusyEnables

TrgTowerBusyEnables Class Reference

Trigger Tower Busy Enables class definition. More...

Inheritance diagram for TrgTowerBusyEnables:

[legend]
Collaboration diagram for TrgTowerBusyEnables:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgTowerBusyEnables constructor.
tower (towerNumber)
tower 'pure virtual' method

Detailed Description

Trigger Tower Busy Enables class definition.

Definition at line 171 of file TrgInputEnables.py.

Member Function Documentation

tower ( towerNumber )

tower 'pure virtual' method

Parameters:
towerNumber A tower number
Returns:
A boolean

Reimplemented in NoTowersBusy, and rcTrgTowerBusyEnables.

The documentation for this class was generated from the following file:
  • TrgInputEnables.py
Generated on Fri Jul 21 13:28:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgTowerEnables Class Reference

TrgInputEnables.TrgTowerEnables

TrgTowerEnables Class Reference

Trigger Tower Enables class definition. More...

Inheritance diagram for TrgTowerEnables:

[legend]
Collaboration diagram for TrgTowerEnables:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgTowerEnables constructor.
towers ()
towers() 'pure virtual' method

Detailed Description

Trigger Tower Enables class definition.

Definition at line 53 of file TrgInputEnables.py.

Member Function Documentation

towers ( )

towers() 'pure virtual' method

Returns:
a TrgTowers object

The documentation for this class was generated from the following file:
  • TrgInputEnables.py
Generated on Fri Jul 21 13:28:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgTowers Class Reference

TrgTower.TrgTowers

TrgTowers Class Reference

Trigger Towers class definition. More...

Inheritance diagram for TrgTowers:

[legend]
Collaboration diagram for TrgTowers:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgTowers constructor.
tower (towerNumber)
Tower 'pure virtual' method.

Detailed Description

Trigger Towers class definition.

Definition at line 12 of file TrgTower.py.

Member Function Documentation

tower ( towerNumber )

Tower 'pure virtual' method.

Parameters:
towerNumber A tower number
Returns:
A TrgTower object

The documentation for this class was generated from the following file:
  • TrgTower.py
Generated on Fri Jul 21 13:28:37 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgTracker Class Reference

TrgTower.TrgTracker

TrgTracker Class Reference

Trigger Tracker class definition. More...

Inheritance diagram for TrgTracker:

[legend]
Collaboration diagram for TrgTracker:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgTracker constructor.
use ()
Use 'virtual' method.

Detailed Description

Trigger Tracker class definition.

Definition at line 76 of file TrgTower.py.

Member Function Documentation

use ( )

Use 'virtual' method.

Returns:
A boolean

Reimplemented in NullTkr.

The documentation for this class was generated from the following file:
  • TrgTower.py
Generated on Fri Jul 21 13:28:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgTriggerCounters Class Reference

TrgTriggerCounters.TrgTriggerCounters

TrgTriggerCounters Class Reference

TrgTriggerCounters class definition This class controls the counters associated with the performance of the LAT with respect to the Trigger System. More...

Inheritance diagram for TrgTriggerCounters:

[legend]
Collaboration diagram for TrgTriggerCounters:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgTriggerCounters constructor.
stats ()
stats() method Returns the Trigger Counter Statistics object.
reset ()
reset() method Reset the trigger counters.

Detailed Description

TrgTriggerCounters class definition This class controls the counters associated with the performance of the LAT with respect to the Trigger System.

Definition at line 14 of file TrgTriggerCounters.py.

Member Function Documentation

stats ( )

stats() method Returns the Trigger Counter Statistics object.

Returns:
A TrgTriggerStats object

Reimplemented in TrgGemTriggerCounters.

The documentation for this class was generated from the following file:
  • TrgTriggerCounters.py
Generated on Fri Jul 21 13:28:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgTriggerStats Class Reference

TrgTriggerCounters.TrgTriggerStats

TrgTriggerStats Class Reference

TrgTriggerStats This class specifies the statistics returned by the counters defined in TrgTriggerCounters. More...

Inheritance diagram for TrgTriggerStats:

[legend]
Collaboration diagram for TrgTriggerStats:

[legend]
List of all members.

Public Member Functions

__init__ ()
livetime ()
livetime() method Return the system livetime
prescaled ()
prescaled() method Return the number of events that have been prescaled
discarded ()
discarded() method Return the number of events discarded
sent ()
sent() method Return the number of events sent on

Detailed Description

TrgTriggerStats This class specifies the statistics returned by the counters defined in TrgTriggerCounters.

Definition at line 37 of file TrgTriggerCounters.py.

Member Function Documentation

discarded ( )

discarded() method Return the number of events discarded

Returns:
an integer

Reimplemented in TrgGemTriggerStats.

livetime ( )

livetime() method Return the system livetime

Returns:
an integer

Reimplemented in TrgGemTriggerStats.

prescaled ( )

prescaled() method Return the number of events that have been prescaled

Returns:
an integer

Reimplemented in TrgGemTriggerStats.

sent ( )

sent() method Return the number of events sent on

Returns:
an integer

Reimplemented in TrgGemTriggerStats.

The documentation for this class was generated from the following file:
  • TrgTriggerCounters.py
Generated on Fri Jul 21 13:28:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgUsingTiles Class Reference

TrgUsingTiles.TrgUsingTiles

TrgUsingTiles Class Reference

Trigger Using Tiles class definition. More...

Inheritance diagram for TrgUsingTiles:

[legend]
Collaboration diagram for TrgUsingTiles:

[legend]
List of all members.

Public Member Functions

__init__ ()
TrgUsingTiles constructor.
coincidences ()
Coincdences 'pure virtual' method.
useAcdAsTrigger ()
UseAcdAsTrigger 'pure virtual' method.
periodicCondition ()
PeriodicCondition 'pure virtual' method.
sequence ()
Sequence 'pure virtual' method.
roi ()
Roi 'pure virtual' method.

Detailed Description

Trigger Using Tiles class definition.

Definition at line 22 of file TrgUsingTiles.py.

Member Function Documentation

coincidences ( )

Coincdences 'pure virtual' method.

Returns:
A TrgCoincidences object

Reimplemented in rcGEMDefaultTrigger.

periodicCondition ( )

PeriodicCondition 'pure virtual' method.

Returns:
A TrgPeriodicCondition object
This object specifies the initial and current definition of the periodic condition

Reimplemented from TrgGemAbstract.

roi ( )

Roi 'pure virtual' method.

Returns:
A TrgRoi object
This object specifies the definition of the GEM's ROI generator

Reimplemented from TrgGemAbstract.

sequence ( )

Sequence 'pure virtual' method.

Returns:
A TrgSequence object This object specifies the initial sequence number definitions for the trigger

Reimplemented from TrgAbstract.

useAcdAsTrigger ( )

UseAcdAsTrigger 'pure virtual' method.

Returns:
A boolean
This value specifies whether or not the the ROI generator and its ACD tile signals are be used as a trigger or as a veto. If the value returned is TRUE, the ROI generator is used as a trigger. If the value returned is FALSE, the ROI generator is used as a veto.

Reimplemented from TrgGemAbstract.

Reimplemented in rcGEMDefaultTrigger.

The documentation for this class was generated from the following file:
  • TrgUsingTiles.py
Generated on Fri Jul 21 13:28:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: UDPReceiver Class Reference

Receiver.UDPReceiver

UDPReceiver Class Reference

UDPReceiver class. More...

Inheritance diagram for UDPReceiver:

[legend]
Collaboration diagram for UDPReceiver:

[legend]
List of all members.

Public Member Functions

__init__ ()
receive ()
setUDPClient (name, server)
shutdown ()

Detailed Description

UDPReceiver class.

Definition at line 37 of file Receiver.py.

The documentation for this class was generated from the following file:
  • Receiver.py
Generated on Fri Jul 21 13:27:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: UDPRecorder Class Reference

Recorder.UDPRecorder

UDPRecorder Class Reference

Example recorder that UDP broadcasts trendables. More...

Inheritance diagram for UDPRecorder:

[legend]
Collaboration diagram for UDPRecorder:

[legend]
List of all members.

Public Member Functions

__init__ ()
startUDPServer (name, server)
stopUDPServer ()
processTrends (trendables)
shutdown ()

Detailed Description

Example recorder that UDP broadcasts trendables.

Uses LATTE.tools.DataDistributionServer

Definition at line 45 of file Recorder.py.

The documentation for this class was generated from the following file:
  • Recorder.py
Generated on Fri Jul 21 13:27:59 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userAppBrowser Class Reference

userAppBrowser.userAppBrowser

userAppBrowser Class Reference

List of all members.

Public Member Functions

__init__ (rc, appdir)
verbosity ()
updateSchema ()
updateSuites ()
getGui (appname)
getTree ()
loaded (appgui)
ResetClicked ()
StopClicked ()
PauseClicked ()
RunClicked ()
purge ()
append (message, level)

Detailed Description

Definition at line 28 of file userAppBrowser.py.

The documentation for this class was generated from the following file:
  • userAppBrowser.py
Generated on Fri Jul 21 13:28:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userAppLeaf Class Reference

userAppLeaf.userAppLeaf

userAppLeaf Class Reference

userApp Gui Leaf This is the class of a leaf in the userApp Gui Tree It contains both basic functionality as a leaf (mainly input selection functions) and functionality as a manager of application windows More...

List of all members.

Public Member Functions

__init__ (lat, node, parent)
rect ()
pressedEvent (pos, column)
setOn (value)
isOn ()
__del__ ()
getTree ()
stateChangeClicked ()
name ()
module ()
getLeaf (leaf)
copyCheckedNodes (from_leaf)
select_family (value=1)
unselect_family ()
expand_family (value=1)
collapse_family ()
selectFamilyClicked (value=1)
unselectFamilyClicked ()
leafActionsTuples ()
loadAppWindows (leaf_window_list)
createWindow (parent)
getInputNodes (of_class_type=None)
getLogDir ()
getRC ()
setStatus (status_descr)
triggerPolling ()
triggerCmdCliUpdate ()
triggerInputsUpdate ()
close ()
paintCell (p, cg, column, width, align)
paintFocus (p, cg, r)
paintWarning (value)
updatePWarning ()
setWarning (value)

Detailed Description

userApp Gui Leaf This is the class of a leaf in the userApp Gui Tree It contains both basic functionality as a leaf (mainly input selection functions) and functionality as a manager of application windows

Definition at line 11 of file userAppLeaf.py.

Member Function Documentation

__init__ | ( | lat | ,
 |  | node | ,
 |  | parent |
 | ) |

Init Function for the leaf

Parameters:
lat_node | pointer to the LAT structure
self_node | pointer to the "Gnode" device related to this leaf
parent | object to use as the QCheckListItem parent

collapse_family ( )

Function that expands/collapse the leaf node in the tree and all its children and their children...

copyCheckedNodes ( from_leaf )

No prior assumption

createWindow ( parent )

Function that creates the window containing the applications managed by the leaf If the window exists already, the function returns the pointer to this window pointer to the parent to use to create the window

Returns:
pointer to the window

expand_family ( value = 1 )

Function that expands/collapse the leaf node in the tree and all its children and their children... expands all leaves if 1, collapse if 0

getInputNodes ( of_class_type = None )

Function which extracts from all its child leaves the ones that are checked Builds a list of Gnodes for the application to use as inputs

Returns:
list of Gnodes

getLeaf ( leaf )

Function that finds the leaf in the hierarchical structure of leaves starting at this leaf A match only occur if there exist a leaf at depth k under self with all of its parents name up to self matching with the reference leaf kth first parents. Ex: ref_leaf = a->b->self->d->e->ref_leaf will match with self->d->e->ref_leaf This function is mostly use to port information between leaves of different implementation of the same ELX Tree

Parameters:
leaf leaf object to find in the structure
Returns:
the leaf that matches with the searched leaf, None with no match

getLogDir ( )

Function which returns the current log directory for the application

Returns:
a string containing the name of the directory to log in

getTree ( )

Leaf functionality

leafActionsTuples ( )

Function which returns the possible actions that can be included in this leafs menu

Returns:
a list of tuples (name,method) where name is the name of the action and method is the method implements the action

loadAppWindows ( leaf_window_list )

Application manager Function which loads the list of application windows related to the leaf

Parameters:
appfiles_list list of module names to use as application window (these module need to contain a class 'MainWindow')

module ( )

Function which returns the name of the Gnode The parent might have more than one child with the same module name

Returns:
name of module type

name ( )

Function which returns the name of the leaf A parent of this leaf should not possibly have two leaves with the same name The leaf could have cousins with the same name

Returns:
name of node/leaf

paintCell | ( | p | ,
 |  | cg | ,
 |  | column | ,
 |  | width | ,
 |  | align |
 | ) |

Triggering Alerts section Function that reimplements QCheckListItem.paintCell to show that warning is active

paintFocus | ( | p | ,
 |  | cg | ,
 |  | r |
 | ) |

Removes the misaligned flashy rectangle around the selected item

paintWarning ( value )

Function that sets the Paint warning value for the leaf A paint warning means either the leaf or one of the leaf's child is in warning mode

Parameters:
value warning is painted if 1, not painted if 0

rect ( )

checkbox.hide()

select_family ( value = 1 )

Function that checks/unchecks this leaf and all its children leaves and all their children... checks all leaves if 1, unchecks all if 0

setOn ( value )

b = a + 20

setWarning ( value )

Function that sets/clear the leaf in warning mode It also updates the paint warning information

Parameters:
value sets if 1, clears if 0

triggerInputsUpdate ( )

This method assumes that all children of this leaf have been previously triggered

unselect_family ( )

Function that unchecks this leaf and all its children leaves and all their children...

updatePWarning ( )

Function which updates the paint warning for this leaf and triggers an update for this leaf's parent

The documentation for this class was generated from the following file:
  • userAppLeaf.py
Generated on Fri Jul 21 13:28:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testSAppCal_Lean.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
teardown ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implementation class for a user application

Definition at line 36 of file testSAppCal_Lean.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testSAppCal_Lean.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

temLrsTest.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
teardown ()
process ((status, latDatagram))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 18 of file temLrsTest.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, latDatagram) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • temLrsTest.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

hTestEnv.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (gui, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
stop ()
teardown ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 34 of file hTestEnv.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • hTestEnv.py
Generated on Fri Jul 21 13:27:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

transitionRejectTest.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
teardown ()
pause ()
resume ()
stop ()

Detailed Description

Implmentation class for Null application

Definition at line 36 of file transitionRejectTest.py.

The documentation for this class was generated from the following file:
  • transitionRejectTest.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

hTestAppTkr.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (gui, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
teardown ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 40 of file hTestAppTkr.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • hTestAppTkr.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testAppArchiver.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 37 of file testAppArchiver.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testAppArchiver.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testSAppCal.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
teardown ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 36 of file testSAppCal.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testSAppCal.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

excApp.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
stop ()
teardown ()
pause ()
resume ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for Null application

Definition at line 39 of file excApp.py.

Member Function Documentation

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • excApp.py
Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testAppMinimal.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
teardown ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 36 of file testAppMinimal.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testAppMinimal.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

nullApp.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
stop ()
process ((status, buffer))
wait ()

Detailed Description

Implmentation class for Null application

Definition at line 10 of file nullApp.py.

Member Function Documentation

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • nullApp.py
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testAppReport.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
createTestReport ()

Detailed Description

Implementation class for a user application

Definition at line 14 of file testAppReport.py.

The documentation for this class was generated from the following file:
  • testAppReport.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testAppCal_dg.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
teardown ()
process ((status, latDatagram))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 48 of file testAppCal_dg.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, latDatagram) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testAppCal_dg.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testSAppEvt.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
teardown ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 56 of file testSAppEvt.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testSAppEvt.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

sweepRejectTest.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
teardown ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 37 of file sweepRejectTest.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • sweepRejectTest.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testAppCal.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
teardown ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 36 of file testAppCal.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testAppCal.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testAppNoVersion.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
teardown ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 36 of file testAppNoVersion.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testAppNoVersion.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testAppEvtTO.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
teardown ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 34 of file testAppEvtTO.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testAppEvtTO.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testAppTkr.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
teardown ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 36 of file testAppTkr.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testAppTkr.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testAppAcd.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
teardown ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 34 of file testAppAcd.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testAppAcd.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testAppEvtCli.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 38 of file testAppEvtCli.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testAppEvtCli.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

hTestAppEvt.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (gui, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 60 of file hTestAppEvt.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • hTestAppEvt.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

splitOutTem.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
teardown ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 66 of file splitOutTem.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

The documentation for this class was generated from the following file:
  • splitOutTem.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testSummary.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 37 of file testSummary.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

The documentation for this class was generated from the following file:
  • testSummary.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testEvtBldr_script.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
teardown ()
process ((status, latDatagram))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 36 of file testEvtBldr_script.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, latDatagram) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testEvtBldr_script.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testErrorPropogation.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (gui, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 35 of file testErrorPropogation.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testErrorPropogation.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testTrgParityError.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (gui, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 17 of file testTrgParityError.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testTrgParityError.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testAppEvt.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
teardown ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 56 of file testAppEvt.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testAppEvt.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testAppAcdScalers.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
teardown ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 47 of file testAppAcdScalers.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testAppAcdScalers.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testTkrHitFilter.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
teardown ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 34 of file testTkrHitFilter.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testTkrHitFilter.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testAppAlarm.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()
yellowAlarm1 (value, signal, sender, sendNode)
yellowAlarm2 (value, signal, sender, sendNode)
redAlarm (value, signal, sender)

Detailed Description

Implmentation class for a user application

Definition at line 36 of file testAppAlarm.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testAppAlarm.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testAppExclude.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (rc, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()

Detailed Description

V&V test case for the <exclude> tag

Definition at line 11 of file testAppExclude.py.

The documentation for this class was generated from the following file:
  • testAppExclude.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

testAppLDFdump.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (gui, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
resume ()
stop ()
process ((status, buffer))
commandSynch ()
wait ()
sync ()

Detailed Description

Implmentation class for a user application

Definition at line 47 of file testAppLDFdump.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • testAppLDFdump.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplication Class Reference

hTestStrip.userApplication

userApplication Class Reference

List of all members.

Public Member Functions

__init__ (gui, userId, debug)
getName ()
setup ()
startRun ()
stopRun ()
stop ()
teardown ()
process ((status, buffer))
commandSynch ()
wait ()

Detailed Description

Implmentation class for a user application

Definition at line 38 of file hTestStrip.py.

Member Function Documentation

commandSynch ( )

Method called by the command synchronization task

process ( (status, buffer) )

Method called back for each data event taken

The documentation for this class was generated from the following file:
  • hTestStrip.py
Generated on Fri Jul 21 13:27:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userApplicationCallbacks Class Reference

testAppCal.userApplicationCallbacks

userApplicationCallbacks Class Reference

List of all members.

Public Member Functions

beforeSetup (app)
beforeStartRun (app)
afterStopRun (app)

Detailed Description

Definition at line 56 of file testAppCal.py.

The documentation for this class was generated from the following file:
  • testAppCal.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userAppLoader Class Reference

userAppLoader.userAppLoader

userAppLoader Class Reference

List of all members.

Public Member Functions

reimport ()
load ()
loaded ()
unloaded ()
isChecked (module)
setState (module, failed)
clearState (module)
updateSchema ()

Detailed Description

Definition at line 7 of file userAppLoader.py.

The documentation for this class was generated from the following file:
  • userAppLoader.py
Generated on Fri Jul 21 13:28:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userAppTree Class Reference

userAppTree.userAppTree

userAppTree Class Reference

List of all members.

Public Member Functions

pressedEvent (leaf, pos, column)
rightMouseClicked (leaf)
setCopyFromMenu (from_list, method)
AddLeaf (leaf)
clearLeaves ()
getAllLeaves ()
getInputNodes (of_class_type=None)
getLeaf (leaf)
copyCheckedNodes (from_tree)
loadNodes (lat, leaf_class=None)
setStatus (leaf, descr)
close ()

Detailed Description

Definition at line 7 of file userAppTree.py.

Member Function Documentation

AddLeaf ( leaf )

Function that adds the leaf to a local list of the leafs in this tree Locally the list is organized according to module types

Parameters:
leaf leaf to add to the tree leaves list

copyCheckedNodes ( from_tree )

Function that copies all the checked status of nodes in the from_tree to the nodes in this tree

Parameters:
from_tree tree object from which to copy the checked information for the leaves

getInputNodes ( of_class_type = None )

Function which extracts from all the tree the leafs that are checked, it builds a list of Gnodes that are considered checked

Returns:
list of Gnodes

getLeaf ( leaf )

Function that retrieves a leaf in the tree structure

Parameters:
leaf leaf to search for
Returns:
leaf matching leaf found in the tree

loadNodes | ( | lat | ,
 |  | leaf_class | = None
 | ) |

Function that populate the tree by converting nodes in the LAT structure into leaves of leaf_class

Parameters:
lat | LAT pointer
leaf_class | class object which will be used to populate the tree

rightMouseClicked ( leaf )

Function that is triggered by a right click of the mouse over the tree This lauches a pop-up menu with actions that can be taken on the leaf where the cursor is

Parameters:
leaf leaf that the mouse is pointing at

setCopyFromMenu | ( | from_list | ,
 |  | method |
 | ) |

Function that creates the popup menu that is launched when 'Copy from' is highlighted based on a list describing the names that describes the origins and on a method that will execute the copying given the origin's index

Parameters:
from_list | list of name for the possible origins
method | that execute the copying from the specified origin to this leaf

setStatus | ( | leaf | ,
 |  | descr |
 | ) |

Clear the hierarchy first

The documentation for this class was generated from the following file:
  • userAppTree.py
Generated on Fri Jul 21 13:28:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

hTestEnv.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 26 of file hTestEnv.py.

The documentation for this class was generated from the following file:
  • hTestEnv.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testAppTkr.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 28 of file testAppTkr.py.

The documentation for this class was generated from the following file:
  • testAppTkr.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testEvtBldr_script.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 28 of file testEvtBldr_script.py.

The documentation for this class was generated from the following file:
  • testEvtBldr_script.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

splitOutTem.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 58 of file splitOutTem.py.

The documentation for this class was generated from the following file:
  • splitOutTem.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testAppCal_dg.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 40 of file testAppCal_dg.py.

The documentation for this class was generated from the following file:
  • testAppCal_dg.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

hTestAppTkr.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 32 of file hTestAppTkr.py.

The documentation for this class was generated from the following file:
  • hTestAppTkr.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testAppLDFdump.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 39 of file testAppLDFdump.py.

The documentation for this class was generated from the following file:
  • testAppLDFdump.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

sweepRejectTest.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 29 of file sweepRejectTest.py.

The documentation for this class was generated from the following file:
  • sweepRejectTest.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testAppArchiver.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 29 of file testAppArchiver.py.

The documentation for this class was generated from the following file:
  • testAppArchiver.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

hTestAppEvt.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 52 of file hTestAppEvt.py.

The documentation for this class was generated from the following file:
  • hTestAppEvt.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testSAppCal_Lean.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 28 of file testSAppCal_Lean.py.

The documentation for this class was generated from the following file:
  • testSAppCal_Lean.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testAppAcdScalers.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 39 of file testAppAcdScalers.py.

The documentation for this class was generated from the following file:
  • testAppAcdScalers.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testAppEvtCli.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 30 of file testAppEvtCli.py.

The documentation for this class was generated from the following file:
  • testAppEvtCli.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testTkrHitFilter.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption, value=None)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 26 of file testTkrHitFilter.py.

The documentation for this class was generated from the following file:
  • testTkrHitFilter.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testSummary.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 29 of file testSummary.py.

The documentation for this class was generated from the following file:
  • testSummary.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testSAppEvt.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 48 of file testSAppEvt.py.

The documentation for this class was generated from the following file:
  • testSAppEvt.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testErrorPropogation.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 27 of file testErrorPropogation.py.

The documentation for this class was generated from the following file:
  • testErrorPropogation.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testAppNoVersion.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 28 of file testAppNoVersion.py.

The documentation for this class was generated from the following file:
  • testAppNoVersion.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

excApp.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 31 of file excApp.py.

The documentation for this class was generated from the following file:
  • excApp.py
Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testAppEvt.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 48 of file testAppEvt.py.

The documentation for this class was generated from the following file:
  • testAppEvt.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testAppMinimal.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 28 of file testAppMinimal.py.

The documentation for this class was generated from the following file:
  • testAppMinimal.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testAppAlarm.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 28 of file testAppAlarm.py.

The documentation for this class was generated from the following file:
  • testAppAlarm.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

transitionRejectTest.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption, value=None)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 28 of file transitionRejectTest.py.

The documentation for this class was generated from the following file:
  • transitionRejectTest.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testSAppCal.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 28 of file testSAppCal.py.

The documentation for this class was generated from the following file:
  • testSAppCal.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testAppCal.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 28 of file testAppCal.py.

The documentation for this class was generated from the following file:
  • testAppCal.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testAppEvtTO.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 26 of file testAppEvtTO.py.

The documentation for this class was generated from the following file:
  • testAppEvtTO.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

testAppAcd.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 26 of file testAppAcd.py.

The documentation for this class was generated from the following file:
  • testAppAcd.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgText Class Reference

hTestStrip.userArgText

userArgText Class Reference

List of all members.

Public Member Functions

__init__ ()
getValue (caption)

Detailed Description

Text user interface for getting the user to input some sort of value

Definition at line 30 of file hTestStrip.py.

The documentation for this class was generated from the following file:
  • hTestStrip.py
Generated on Fri Jul 21 13:27:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testAppLDFdump.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 30 of file testAppLDFdump.py.

The documentation for this class was generated from the following file:
  • testAppLDFdump.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testAppEvtCli.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 20 of file testAppEvtCli.py.

The documentation for this class was generated from the following file:
  • testAppEvtCli.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testAppEvtTO.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 16 of file testAppEvtTO.py.

The documentation for this class was generated from the following file:
  • testAppEvtTO.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testEvtBldr_script.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 18 of file testEvtBldr_script.py.

The documentation for this class was generated from the following file:
  • testEvtBldr_script.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testErrorPropogation.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 17 of file testErrorPropogation.py.

The documentation for this class was generated from the following file:
  • testErrorPropogation.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testAppCal_dg.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 30 of file testAppCal_dg.py.

The documentation for this class was generated from the following file:
  • testAppCal_dg.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testTkrHitFilter.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
CancelButtonClicked ()

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 18 of file testTkrHitFilter.py.

The documentation for this class was generated from the following file:
  • testTkrHitFilter.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

splitOutTem.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 48 of file splitOutTem.py.

The documentation for this class was generated from the following file:
  • splitOutTem.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

hTestAppTkr.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 22 of file hTestAppTkr.py.

The documentation for this class was generated from the following file:
  • hTestAppTkr.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testAppAcdScalers.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 29 of file testAppAcdScalers.py.

The documentation for this class was generated from the following file:
  • testAppAcdScalers.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testAppArchiver.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 19 of file testAppArchiver.py.

The documentation for this class was generated from the following file:
  • testAppArchiver.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testAppCal.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 18 of file testAppCal.py.

The documentation for this class was generated from the following file:
  • testAppCal.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testSAppCal_Lean.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 18 of file testSAppCal_Lean.py.

The documentation for this class was generated from the following file:
  • testSAppCal_Lean.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testSummary.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 19 of file testSummary.py.

The documentation for this class was generated from the following file:
  • testSummary.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testAppTkr.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 18 of file testAppTkr.py.

The documentation for this class was generated from the following file:
  • testAppTkr.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

hTestEnv.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 16 of file hTestEnv.py.

The documentation for this class was generated from the following file:
  • hTestEnv.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testSAppCal.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 18 of file testSAppCal.py.

The documentation for this class was generated from the following file:
  • testSAppCal.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testAppEvt.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 38 of file testAppEvt.py.

The documentation for this class was generated from the following file:
  • testAppEvt.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testAppAlarm.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 18 of file testAppAlarm.py.

The documentation for this class was generated from the following file:
  • testAppAlarm.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testAppMinimal.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 18 of file testAppMinimal.py.

The documentation for this class was generated from the following file:
  • testAppMinimal.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

excApp.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)
getValueExc (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 20 of file excApp.py.

The documentation for this class was generated from the following file:
  • excApp.py
Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

hTestStrip.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 20 of file hTestStrip.py.

The documentation for this class was generated from the following file:
  • hTestStrip.py
Generated on Fri Jul 21 13:27:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

sweepRejectTest.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 19 of file sweepRejectTest.py.

The documentation for this class was generated from the following file:
  • sweepRejectTest.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testSAppEvt.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 38 of file testSAppEvt.py.

The documentation for this class was generated from the following file:
  • testSAppEvt.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testAppAcd.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value

Definition at line 16 of file testAppAcd.py.

The documentation for this class was generated from the following file:
  • testAppAcd.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

transitionRejectTest.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
CancelButtonClicked ()

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 20 of file transitionRejectTest.py.

The documentation for this class was generated from the following file:
  • transitionRejectTest.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

testAppNoVersion.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
CancelButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 18 of file testAppNoVersion.py.

The documentation for this class was generated from the following file:
  • testAppNoVersion.py
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userArgument Class Reference

hTestAppEvt.userArgument

userArgument Class Reference

List of all members.

Public Member Functions

__init__ (parent=None, name=None, modal=0, fl=0)
OKButtonClicked ()
getValue (caption)

Detailed Description

GUI for getting the user to input some sort of value.

Definition at line 43 of file hTestAppEvt.py.

The documentation for this class was generated from the following file:
  • hTestAppEvt.py
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userModule Class Reference

userAppBrowser.userModule

userModule Class Reference

List of all members.

Public Member Functions

__init__ (root, packagename, groupname, appname)
reload ()

Detailed Description

Definition at line 18 of file userAppBrowser.py.

The documentation for this class was generated from the following file:
  • userAppBrowser.py
Generated on Fri Jul 21 13:28:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userSuite Class Reference

testSuite_Lean.userSuite

userSuite Class Reference

List of all members.

Public Member Functions

__init__ (gui, userId, debug)
getName ()
setupSuite ()
startSuite ()
stopSuite ()

Detailed Description

Implmentation class for a user application

Definition at line 10 of file testSuite_Lean.py.

The documentation for this class was generated from the following file:
  • testSuite_Lean.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userSuite Class Reference

testSuite.userSuite

userSuite Class Reference

List of all members.

Public Member Functions

__init__ (gui, userId, debug)
getName ()
setupSuite ()
pauseSuite ()
startSuite ()
stopSuite ()

Detailed Description

Implmentation class for a user application

Definition at line 10 of file testSuite.py.

The documentation for this class was generated from the following file:
  • testSuite.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userSuite Class Reference

testSuiteSummary.userSuite

userSuite Class Reference

List of all members.

Public Member Functions

__init__ (gui, userId, debug)
getName ()
setupSuite ()
startSuite ()
stopSuite ()

Detailed Description

Implmentation class for a user application

Definition at line 11 of file testSuiteSummary.py.

The documentation for this class was generated from the following file:
  • testSuiteSummary.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userSuite Class Reference

testSuiteLong.userSuite

userSuite Class Reference

List of all members.

Public Member Functions

__init__ (gui, userId, debug)
getName ()
setupSuite ()
startSuite ()
stopSuite ()

Detailed Description

Implmentation class for a user application

Definition at line 11 of file testSuiteLong.py.

The documentation for this class was generated from the following file:
  • testSuiteLong.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userSuite Class Reference

testSuite2.userSuite

userSuite Class Reference

List of all members.

Public Member Functions

__init__ (gui, userId, debug)
getName ()
setupSuite ()
startSuite ()
stopSuite ()

Detailed Description

Implmentation class for a user application

Definition at line 10 of file testSuite2.py.

The documentation for this class was generated from the following file:
  • testSuite2.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userSuiteCallbacks Class Reference

testSuite.userSuiteCallbacks

userSuiteCallbacks Class Reference

List of all members.

Public Member Functions

beforeSetupSuite (suite)
beforeStartSuite (suite)
afterStopSuite (suite)

Detailed Description

Definition at line 20 of file testSuite.py.

The documentation for this class was generated from the following file:
  • testSuite.py
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: WatchItem Class Reference

rcStatusMonitor.WatchItem

WatchItem Class Reference

List of all members.

Public Member Functions

evaluate ()
getLabel ()
getAlarmExpr ()
getStatusItem ()
setStatusItem (si)
isInView ()
setInView ()
setAccessor (accessor, key)
isOffBoard ()

Detailed Description

Definition at line 19 of file rcStatusMonitor.py.

The documentation for this class was generated from the following file:
  • rcStatusMonitor.py
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ZsupSolicitedEngine Class Reference

test_evt_tkr.ZsupSolicitedEngine

ZsupSolicitedEngine Class Reference

List of all members.

Public Member Functions

__init__ ()
participate (conditionsValue)
prescale ()
request ()

Detailed Description

This class defines an engine which reads out the detector whenever there is a solicited trigger. Zero suppression is on. This engine is not prescaled.

Definition at line 35 of file test_evt_tkr.py.

The documentation for this class was generated from the following file:
  • test_evt_tkr.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ZsupSolicitedEngine Class Reference

test_evt_cal.ZsupSolicitedEngine

ZsupSolicitedEngine Class Reference

List of all members.

Public Member Functions

__init__ ()
participate (conditionsValue)
prescale ()
request ()

Detailed Description

This class defines an engine which reads out the detector whenever there is a solicited trigger. Zero suppression is on. This engine is not prescaled.

Definition at line 109 of file test_evt_cal.py.

The documentation for this class was generated from the following file:
  • test_evt_cal.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ZsupTrgInjectChargeReadout Class Reference

test_evt_cal.ZsupTrgInjectChargeReadout

ZsupTrgInjectChargeReadout Class Reference

ZsupTrgReadout class definition. More...

List of all members.

Public Member Functions

__init__ ()
TrgReadout constructor.
zeroSuppress ()

Detailed Description

ZsupTrgReadout class definition.

Directs a module to send to its Front-End Electronics a command sequence which is composed only of the TACK command. This command will trigger a readout of the module's Front-End Electronics. Zero suppression is turned on.

Definition at line 95 of file test_evt_cal.py.

The documentation for this class was generated from the following file:
  • test_evt_cal.py
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ZsupTrgReadout Class Reference

MiniGLTExample.ZsupTrgReadout

ZsupTrgReadout Class Reference

ZsupTrgReadout class definition. More...

List of all members.

Public Member Functions

__init__ ()
TrgReadout constructor.
zeroSuppress ()

Detailed Description

ZsupTrgReadout class definition.

Directs a module to send to its Front-End Electronics a command sequence which is composed only of the TACK command. This command will trigger a readout of the module's Front-End Electronics. Zero suppression is turned on.

Definition at line 72 of file MiniGLTExample.py.

The documentation for this class was generated from the following file:
  • MiniGLTExample.py
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ZsupTrgReadout Class Reference

SimpleGasuExample.ZsupTrgReadout

ZsupTrgReadout Class Reference

ZsupTrgReadout class definition. More...

List of all members.

Public Member Functions

__init__ ()
TrgReadout constructor.
zeroSuppress ()

Detailed Description

ZsupTrgReadout class definition.

Directs a module to send to its Front-End Electronics a command sequence which is composed only of the TACK command. This command will trigger a readout of the module's Front-End Electronics. Zero suppression is turned on.

Definition at line 94 of file SimpleGasuExample.py.

The documentation for this class was generated from the following file:
  • SimpleGasuExample.py
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Hierarchical Index

LATTE Class Hierarchy

Go to the graphical class hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically:

  • _Attr
  • _Parameter
    • _Anonymous
    • _Any
  • _regList
  • AcdHWMultiplexer
  • ACDmap
  • AcdPanel
  • ACDSingleEvtDisplayImpl
  • AEM
  • AEMcontributionIterator
  • AEMcontributionIterator_
  • AEQHskRegMap
  • AlertGuiImpl
  • ArgumentImpl
  • BadGasuExample
  • BadGLTExample
  • bar
  • barw
  • bf
  • BitField
    • evAEM_PHA
    • evCAL_LogAccepts
    • evCAL_LogData
    • evCellHeader
      • evCellHeader_Singleton
    • evContPacket
      • evContPacket_Singleton
    • evDiag_CalLayerEnd
    • evDiag_TkrTrgReq
    • evErr_CablePhase
    • evErr_CableTimeOut
    • evErr_GCCC
    • evErr_GTCC
    • evErr_Summary
    • evGEM_Cond_Arrival_Times
    • evSummary
      • evSummary_Singleton
    • evTKR_Strip
  • BoundMethodWeakref
  • BrowserImpl
  • browserPreferencesImpl
  • CAL_LATcontribution
  • CALcontributionIterator
  • CALcontributionIterator2
  • ccsdsHeader
  • ccsdsPacket
    • HskPacketBase
  • CheckLed
  • Children
  • Collector
  • Command
  • CommentEntryWidget
  • ConfigElement
  • ConnectState
  • ConnectState
  • ConnectState
  • Consumer
    • consumerPlotter
  • DataDistributorAddress
  • DataDistributorClient
  • DataDistributorPoll
  • DataDistributorServer
  • DataExport
  • DIAGcontributionIterator
  • DIAGcontributionIterator_
  • DispatcherError
    • DispatcherKeyError
    • DispatcherTypeError
  • doublehisto
  • drawHatACD
  • drawRainbowACD
  • drawRainbowCAL
  • drawSide1ACD
  • drawSide2ACD
  • drawSide3ACD
  • drawSide4ACD
  • drawXZ_CAL
  • drawXZ_TKR
  • drawYZ_CAL
  • drawYZ_TKR
  • EBFeventIterator
  • Email
    • gAlertMail
  • EMPanel
  • EnvMonImpl
  • ERRcontributionIterator_
  • ErrorLogCounterHandler
  • evCAL_LayerLogData
  • evDiag_CalLayer
  • evDiag_Data
  • eventThread
  • evErr_GCCC_Message
  • evErr_GTCC_Message
  • evGEM_Veto_List
  • Evt
  • EvtCli
  • EvtCliBT
  • evtDataImpl
  • evTKR_StripData
  • evTKR_TOTdata
  • ExceptionFSM
  • ExclusiveButtonGroup
  • FabricPanel
  • Fabrics
  • FancyTrendTree
  • FEpowerUp
  • FrontEndPowerPanel
  • FSM
    • RunControlFSM
  • FswMessages
  • FullCondition
  • FullEngine
  • gAlertHandler
    • gAlertMailer
  • gAlertPopup
  • gAlertRegistry
  • gAlertStr
  • GasuExtTrg
  • GasuExtTrgEngine
  • Gattr
    • GattrBF
    • GattrDlc
    • GattrRaw
    • GattrReg
      • GattrRegDepr
    • GattrHsk
  • GconstraintBase
    • Gconstraint
      • GconstraintLimit
      • GconstraintLimitPegRE
      • GconstraintLimitRE
  • gConstraintViolation
  • Gdb
    • GAEM
    • GAEQ
    • GAFE
    • GARC
    • GCRU
    • GEBM
    • GEBMC
    • GEBMST
    • GEPU
    • GGEM
    • GGEMC
    • GGEMIE
    • GGEMMG
    • GGEMSC
    • GGEMST
    • GGEMVG
    • GGEMW
    • GGLT
    • GHSK
    • HAEM
    • HARC
    • HCOM
    • HCPU
    • HEBM
    • HGEM
    • HNUL
    • HPDU
    • HTEM
    • GLAT
    • GLCB
    • GLCBSTATS
    • GMem
    • GNAT
    • GOCS
    • GPDU
    • GPEQ
    • GSIU
    • GCCC
    • GCFE
    • GCRC
    • GTCC
    • GTEM
    • GTFE
    • GTIC
    • GTRC
    • GTPG
    • GTWR
    • GXBRD
    • GTest
  • GDBN
  • Geb
    • Merger
  • GebContribution
    • AncillaryContribution
    • LdfContribution
  • GebContributor
    • AncillaryContributor
    • AncillaryContributor
    • AncillaryContributor
    • LdfContributor
    • LdfContributor
  • GEGU
    • GEGU_linear
    • GEGU_poly3
    • GEGU_rtd
    • GEGU_thermistor
  • GEGU_test
  • GEM
  • GEMcontribution
  • GEMcontribution_
  • GExportException
  • Ggroup
  • GlobalPanelImpl
  • GOSEDCALImpl
  • GOSEDCALTKRImpl
  • GOSEDDataImpl
  • GOSEDPreferencesImpl
  • GOSEDTKRImpl
  • GOSEDTWRImpl
  • GpibPwrCtrlImpl
  • GroupPanel
    • ACDPowerPanel
    • CratePanel
    • GasuPanel
    • TowerPanel
    • TowerPowerPanel
  • GruleBase
    • Grule
      • GruleAlarms
      • GruleLimit
  • GUIbridge
  • GUIbridgeTest
  • Gversions
  • HskAlarmRecorder
  • HskCli
  • HskCollector
  • HskConfiguration
  • HskFileRecorder
  • HskHandler
  • HskLatRetriever
  • HskPacket
    • HskPacket210
    • HskPacket211
    • HskPacket212
    • HskPacket213
    • HskPacket214
    • HskPacket215
    • HskPacket216
    • HskPacket217
    • HskPacket218
    • HskPacket219
    • HskPacket21a
    • HskPacket21b
    • HskPacket21c
    • HskPacket21d
    • HskPacket21e
    • HskPacket21f
    • HskPacket220
    • HskPacket221
    • HskPacket222
    • HskPacket223
    • HskPacket224
    • HskPacket225
    • HskPacket226
    • HskPacket227
    • HskPacket228
    • HskPacket229
    • HskPacket22a
    • HskPacket22b
    • HskPacket22c
    • HskPacket22d
    • HskPacket22e
    • HskPacket22f
    • HskPacket230
    • HskPacket231
    • HskPacket270
    • HskPacket271
    • HskPacket272
    • HskPacket273
    • HskPacket274
    • HskPacket275
    • HskPacket276
    • HskPacket277
    • HskPacket278
    • HskPacket279
    • HskPacket27a
    • HskPacket27b
    • HskPacket27c
    • HskPacket27d
    • HskPacket27e
    • HskPacket27f
    • HskPacket280
    • HskPacket281
    • HskPacket282
    • HskPacket283
    • HskPacket284
    • HskPacket285
    • HskPacket286
    • HskPacket287
    • HskPacket288
    • HskPacket289
    • HskPacket28a
    • HskPacket28b
    • HskPacket28c
    • HskPacket28d
    • HskPacket28e
    • HskPacket28f
    • HskPacket290
    • HskPacket291
    • HskPacket353
  • HskPacketRecorder
  • HskPacketRetriever
  • HskPacketWriter
  • HskSimpleTextReceiver
    • HskCfgTextReceiver
      • QtReceiver
  • HskSqlReceiver
  • HskSqlRecorder
  • HskTestRetriever
  • LATcomponentIterator
  • LATcomponentIterator
  • LATcontributionIterator
  • LATInterfaceException
  • LATInterfaceStatus
  • LATsweep
  • LDBI_LATcontributionIterator_
  • Lem
  • ListViewToolTip
  • LogRecordStreamHandler
  • Loopback
  • MailAlert
    • SLACmail
  • MarkerTrgReadout
  • mask
  • Merger
  • Merger
  • MiniGLTExample
  • MiniGLTExample
  • MiniGLTExample
  • MiniGltExtTrg
  • MiniGLTSolicitedCondition
  • MiniGLTSolicitedCondition
  • MiniGLTSolicitedCondition
  • MiniGLTSolicitedEngine
  • MiniGLTSolicitedEngine
  • MiniGLTSolicitedEngine
  • MiniGltTrgEngine
  • MiniGLTTrgEngines
  • MiniGLTTrgEngines
  • MiniGLTTrgEngines
  • MSGLogGUIImpl
  • MSGLogSocketReceiver
  • multibar
  • myLATcomponentIterator
  • myLATcomponentIterator
  • myLATcomponentIterator
  • myLATcomponentIterator
  • myLATcomponentIterator
  • myLATdbIterator
  • MyLogSocketHandler
  • myTKRcontributionIterator
  • Node
  • NodeRegisterList
  • NullStream
  • OcsMessages
  • Opcode
  • Options
  • OSWcontributionIterator
  • OSWcontributionIterator_
  • palettes
  • panelsTest
  • PduSwitch
  • Playback
  • PlotWidget
  • Plumber
  • PorcineEvent
  • PorcinePanel
  • PorcineWindow
  • PowerPanelImpl
  • Preferences
  • PythonShellWidget
  • PyThreadBridge
  • QtReceiver
  • QtReceiver
  • QtThreadBridge
  • radiomask
  • rcArchiver
    • testArchiver
  • rcCommentPanel
  • rcCompletionStatus
  • rcEndRunDlgImpl
  • rcFileSelector
  • rcFileSelector
  • rcFitsWriter
  • rcHouseKeeping
  • rcLoginImpl
  • rcParamVerifier
  • rcParamVerifyGUIImpl
  • rcPreferencesGUIImpl
  • rcPreferencesManager
  • rcPythonShell
  • rcReportGen
  • rcRunIdHelper
  • rcScmCfgSelector
  • rcScmCfgSelText
  • rcSecurityMan
  • rcStatusMonitor
  • rcStatusPanel
  • rcSuite
  • rcTest
  • rcTestReport
  • rcTransitions
  • rcTransitionsBT
  • rcUser
  • rcUsers
  • Receiver
    • UDPReceiver
  • Recorder
    • DummyRecorder
    • FlatFileRecorder
    • UDPRecorder
  • Register
  • RegisterInterface
  • RegViewItem
  • Reloader
  • Response
  • Retriever
    • DummyRetriever
  • RunControlCommon
  • RunControlFileHandler
  • RunControlGUIImpl
    • RunControl
  • RunControlMainGUIImpl
    • RunControlMain
  • RunControlSocketHandler
  • ScrollablePlotView
  • ServerPreferencesImpl
  • SGETrgEngines
  • SGETrgEngines
  • SGETrgInputEnables
  • SGETrgInputEnables
  • SimpleGasuExample
  • SimpleGasuExample
  • singleEvtDisplayImpl
  • Socket
    • CmdCli
    • EvtCliIO
      • EvtCli
    • ccsdsSocket
      • HskCmdRxSocket
      • HskCmdTxSocket
      • HskTelemSocket
  • SocketClosed
  • SolicitedCondition
  • SolicitedCondition
  • SolicitedEngine
  • SolicitedEngine
  • standardPlotter
    • consumerPlotter
  • standardPlotterGuiImpl
  • standardTestReport
  • StatusItem
  • StatusLabel
  • TaskEngine
  • TaskEngineTestCase
  • testEvtCli
  • TestWindow
  • TimeAxisGen
  • TimeAxisGen
  • TKRcontributionIterator
  • TKRcontributionIterator_
  • towerEvtDisplayImpl
  • towerwidgetImpl
  • Trendable
  • TrendLimit
  • TrendMapBase
    • GHSKTrendMap
    • GLATTrendMap
    • ReverseTrendMap
  • TrendPlotter
  • TrendPlotter
  • TrendPlotter
  • TrendTestGUI
  • TrendTree
  • trgConsumer
  • trgDisplayImpl
  • trgLATcomponentIterator
  • TrgObject
    • TrgAbstract
      • TrgGemAbstract
        • TrgGemRegisters
          • TrgGem
            • rcTrgGem
              • TrgUsingTiles
                • rcGEMDefaultTrigger
      • TrgMiniGLTAbstract
        • TrgMiniGLTRegisters
          • TrgMiniGLT
            • rcTrgMiniGLT
              • rcMiniGLTDefaultTrigger
    • TrgCmdCounters
      • TrgGemCmdCounters
    • TrgCmdStats
      • TrgGemCmdStats
    • TrgCnoCounters
      • TrgGemCnoCounters
    • TrgCnoStats
      • TrgGemCnoStats
    • TrgCoincidence
      • NullCoincidence
      • rcTrgCoincidence
    • TrgRoi
      • NullRoi
      • AddableRoi
      • MyRoi
    • TrgRois
      • TrgCoincidences
        • TrgRoiAsTiles
      • TrgRoiAsVeto
    • TrgConditions
      • TrgConditionsValue
        • rcSolicitedCondition
        • MiniGLTTrgConditionsValue
          • rcMiniGLTSolicitedCondition
    • TrgEngine
      • NullEngine
      • rcMiniGLTSolicitedEngine
      • rcSolicitedEngine
      • SweepMarkerEngine
    • TrgEngineRequest
      • NullRequest
      • TrgInjectCharge
      • TrgInjectChargeReadout
      • TrgInjectMarker
        • rcTrgInjectMarker
      • TrgReadout
    • TrgEngines
      • rcTrgEngines
        • rcGEMTrgEngines
        • rcMiniGLTTrgEngines
    • TrgEventCounter
      • TrgGemEventCounter
    • TrgCnoEnables
      • NoCnoEnabled
    • TrgExtEnables
      • NoExternal
    • TrgInputEnables
      • NoInputsEnabled
    • TrgTileEnables
      • NoTilesEnabled
      • rcTrgTileEnables
    • TrgTowerBusyEnables
      • NoTowersBusy
      • rcTrgTowerBusyEnables
    • TrgTowerEnables
      • NoTowersEnabled
    • TrgPeriodicConditionAbstract
      • TrgPeriodicCondition
        • TrgGemPeriodicCondition
          • DefaultPeriodicCondition
      • TrgPeriodicConditionDefinition
        • TrgDefaultPeriodicCondition
    • TrgPPSTimer
      • TrgGemPPSTimer
    • TrgSequenceAbstract
      • TrgSequence
        • TrgGemSequence
          • DefaultSequence
      • TrgSequenceDefinition
        • TrgDefaultSequence
    • TrgTileCounters
      • TrgGemTileCounters
    • TrgTileStats
      • TrgGemTileStats
    • TrgCalorimeter
      • NullCal
    • TrgTower
      • NullTower
    • TrgTowers
    • TrgTracker
      • NullTkr
    • TrgTriggerCounters
      • TrgGemTriggerCounters
    • TrgTriggerStats
      • TrgGemTriggerStats
  • userAppBrowser
  • userAppLeaf
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplication
  • userApplicationCallbacks
  • userAppLoader
  • userAppTree
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgText
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userArgument
  • userModule
  • userSuite
  • userSuite
  • userSuite
  • userSuite
  • userSuite
  • userSuiteCallbacks
  • WatchItem
  • ZsupSolicitedEngine
  • ZsupSolicitedEngine
  • ZsupTrgInjectChargeReadout
  • ZsupTrgReadout
  • ZsupTrgReadout
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- _ -

  • __call__() : BoundMethodWeakref
  • __cmp__() : BoundMethodWeakref
  • __getattr__() : GEMcontribution_, GEMcontribution
  • __init__() : DefaultPeriodicCondition, TrgUsingTiles, TrgTriggerCounters, TrgTracker, TrgCalorimeter, TrgTower, TrgTowers, TrgDefaultSequence, TrgSequence, TrgSequenceDefinition, TrgSequenceAbstract, MyRoi, AddableRoi, TrgRoiAsTiles, TrgPPSTimer, TrgDefaultPeriodicCondition, TrgPeriodicConditionDefinition, TrgPeriodicCondition, TrgPeriodicConditionAbstract, TrgMiniGLTRegisters, TrgMiniGLTAbstract, MiniGLTTrgConditionsValue, TrgMiniGLT, TrgExtEnables, TrgTowerBusyEnables, TrgTileEnables, TrgCnoEnables, TrgTowerEnables, TrgInputEnables, TrgGemSequence, TrgGemRegisters, TrgGemPeriodicCondition, TrgGemPPSTimer, TrgGemEventCounter, TrgGemCmdStats, TrgGemCmdCounters, TrgGemCnoStats, TrgGemCnoCounters, TrgGemTileStats, TrgGemTileCounters, TrgGemTriggerStats, TrgGemTriggerCounters, TrgGemAbstract, TrgGem, TrgEventCounter, TrgInjectMarker, TrgInjectChargeReadout, TrgReadout, TrgInjectCharge, TrgEngineRequest, TrgEngine, TrgEngines, TrgConditionsValue, TrgConditions, TrgCoincidence, TrgCoincidences, TrgRoi, TrgRois, TrgCmdStats, TrgCmdCounters, TrgAbstract, rcTrgMiniGLT, rcTrgGem, rcTrgTowerBusyEnables, rcTrgCoincidence, rcTrgTileEnables, SweepMarkerEngine, rcTrgEngines, rcMiniGLTSolicitedCondition, rcMiniGLTSolicitedEngine, rcSolicitedCondition, rcSolicitedEngine, rcGEMTrgEngines, rcMiniGLTDefaultTrigger, rcGEMDefaultTrigger, NullRequest, NullEngine, NullCoincidence, NullRoi, NoInputsEnabled, NoExternal, NoTowersBusy, NoCnoEnabled, NoTilesEnabled, NullTkr, NullCal, NullTower, GUIbridge, DataDistributorPoll, DataDistributorClient, DataDistributorServer, AcdHWMultiplexer, ZsupTrgInjectChargeReadout, MiniGLTExample, SimpleGasuExample, MarkerTrgReadout, MiniGLTExample, BadGLTExample, BadGasuExample, ZsupTrgReadout, SimpleGasuExample, ZsupTrgReadout, MiniGLTExample, GDBN, rcParamVerifyGUIImpl, FSM, RegisterInterface, drawRainbowCAL, drawRainbowACD, drawYZ_CAL, drawXZ_CAL, drawYZ_TKR, drawXZ_TKR, drawHatACD, drawSide4ACD, drawSide3ACD, drawSide2ACD, drawSide1ACD, singleEvtDisplayImpl, myLATcomponentIterator, TKRcontributionIterator_, CALcontributionIterator2, BoundMethodWeakref, GTWR, GXBRD, GTIC, GTFE, GTRC, GTCC, GCFE, GCRC, GCCC, GTEM, GSIU, GruleAlarms, GruleLimit, Grule, GPEQ, GPDU, GNAT, GMem, GLCBSTATS, GLCB, GLAT, HNUL, HCPU, HCOM, HPDU, HEBM, HGEM, HARC, HAEM, HTEM, GHSK, GattrHsk, GGLT, GGEMW, GGEMIE, GGEMVG, GGEMSC, GGEMST, GGEMMG, GGEMC, GGEM, GEPU, GEGU_rtd, GEGU_thermistor, GEGU_poly3, GEGU_linear, GEBMST, GEBMC, GEBM, Gdb, GCRU, Gconstraint, GattrBF, GattrReg, GattrRaw, Gattr, GAFE, GARC, GAEQ, GAEM, standardTestReport, consumerPlotter, Consumer, EvtCli, evErr_GCCC_Message, evCAL_LayerLogData, evTKR_StripData, evTKR_TOTdata, Evt, userAppLeaf
  • __len__() : CAL_LATcontribution
  • __new__() : BoundMethodWeakref
  • __nonzero__() : BoundMethodWeakref
  • __setattr__() : TrgObject
  • __str__() : CAL_LATcontribution, BoundMethodWeakref
  • _eval_() : GruleAlarms, GruleLimit, Grule, GconstraintLimitPegRE, GconstraintLimit, GconstraintLimitRE, Gconstraint
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package List

Here are the packages with brief descriptions (if available):
AcdHWMultiplexer | Module "AcdHWMultiplexer"
AcdPanel | Module "AcdPanel"
AlertGuiImpl | Module "AlertGuiImpl"
ancillaryContribution | Module "ancillaryContribution"
ancillaryFile | Module "ancillaryFile"
ancillarySocket | Module "ancillarySocket"
ArgumentImpl | Module "ArgumentImpl"
bar | Module "bar"
barw | Module "barw"
BrowserImpl | Module "BrowserImpl"
browserPreferencesImpl | Module "browserPreferencesImpl"
BTdump | Module "BTdump"
Collector | Module "Collector"
colorScale | Module "colorScale"
consumer | Module "consumer"
consumerPlotter | Module "consumerPlotter"
copyright_SLAC | Module "copyright_SLAC"
DataDistributor | Module "DataDistributor"
DataDistributorPoll | Module "DataDistributorPoll"
DataExport | Module "DataExport"
dispatcher |
doublehisto | Module "doublehisto"
EnvMonImpl | Module "EnvMonImpl"
errors |
evtCli | Event handler classes
evtDataImpl | Module "evtDataImpl"
excApp | Module "excApp"
FEpowerUp | Module "FEpowerUp"
fileMerge | Module "fileMerge"
fits2ldf | Module "fits2ldf"
FreeSpace | Module "FreeSpace"
FSM |
gAEM | Module "gAEM"
gAlert | Module "gAlert"
gAttr | GLAST LAT record attribute definitions
gBits | Module "gBits"
gCmdCli | Module "gCmdCli"
gCommand | Module "gCommand"
gConstraint | Module "gConstraint"
gCRU | Module "gCRU"
gDb | Module "gDb"
geb | Module "geb"
gEBM | Module "gEBM"
gEGU | Module "gEGU"
gEPU | Module "gEPU"
gEvtCli | Module "gEvtCli"
gEvtCliBT | Module "gEvtCliBT"
gException | Module "gException"
gFabrics | Module "gFabrics"
gFswMessages | Module "gFswMessages"
gGEM | Module "gGEM"
gGLT | Module "gGLT"
gGroup | Module "gGroup"
gHdb | Module "gHdb"
gHSK | GLAST LAT record definitions
gLAT | GLAST LAT record definitions
gLCB | Module "gLCB"
GlobalPanelImpl | Module "GlobalPanelImpl"
gLog | Module "gLog"
gLoopback | Module "gLoopback"
gMem | Module "gMem"
gNAT | Module "gNAT"
gNode | Module "gNode"
gOCS | Module "gOCS"
gOcsMessages | Module "gOcsMessages"
gOpcode | Module "gOpcode"
gOptions | Module "gOptions"
GOSED_LDF | Module "GOSED_LDF"
GOSEDACDImpl | Module "GOSEDACDImpl"
GOSEDCALImpl | Module "GOSEDCALImpl"
GOSEDCALTKRImpl | Module "GOSEDCALTKRImpl"
GOSEDDataImpl | Module "GOSEDDataImpl"
gosedImpl | Module "gosedImpl"
GOSEDPainter | Module "GOSEDPainter"
GOSEDPreferencesImpl | Module "GOSEDPreferencesImpl"
GOSEDTKRImpl | Module "GOSEDTKRImpl"
GOSEDTWRImpl | Module "GOSEDTWRImpl"
GOTEDImpl | Module "GOTEDImpl"
gPDU | Module "gPDU"
GpibPwrCtrlImpl | Module "GpibPwrCtrlImpl"
gPlumber | Module "gPlumber"
gRegister | Module "gRegister"
gResponse | Module "gResponse"
gRule | Module "gRule"
gSchemaConfig | Module "gSchemaConfig"
gSIU | Module "gSIU"
gSocket | Module "gSocket"
gTEM | Module "gTEM"
gTPG | Module "gTPG"
guiBridges | Module "guiBridges"
gVersions |
gXBR | Module "gXBR"
HskAlarms | Module "HskAlarms"
HskCli | Module "HskCli"
HskCollector | Module "HskCollector"
HskGuiReceiver | Module "HskGuiReceiver"
HskPacket | Module "HskPacket"
HskPacketDecoder | Module "HskPacketDecoder"
HskPacketRetriever | Module "HskPacketRetriever"
HskReceiver | Module "HskReceiver"
HskRecorder | Module "HskRecorder"
HskRegisters | Module "HskRegisters"
HskRetriever | Module "HskRetriever"
HskSqlGuiReceiver | Module "HskSqlGuiReceiver"
HskSqlInterface | Module "HskSqlInterface"
HskSqlSvr | Module "HskSqlSvr"
HskSvr | Module "HskSvr"
HskTestSvr | Module "HskTestSvr"
hTestAppEvt | Module "hTestAppEvt"
hTestAppTkr | Module "hTestAppTkr"
hTestEnv | Module "hTestEnv"
hTestStrip | Module "hTestStrip"
imagedata | Module "imagedata"
LATsweep | Module "LATsweep"
ldf2fits | Module "ldf2fits"
ldfContribution | Module "ldfContribution"
ldfFile | Module "ldfFile"
ldfSocket | Module "ldfSocket"
listmean | Module "listmean"
MailAlert | Module "MailAlert"
mask | Module "mask"
MiniGLTExample | Interface for Coincidence based Trigger System
monitoringDbSyncIn | Module "monitoringDbSyncIn"
monitoringDbSyncOut | Module "monitoringDbSyncOut"
MSGLogGUIImpl | Module "MSGLogGUIImpl"
multibar | Module "multibar"
nullApp | Module "nullApp"
NullObjects |
parseFswHsk | Module "parseFswHsk"
PorcinePanel | Module "PorcinePanel"
PowerPanelImpl | Module "PowerPanelImpl"
radiomask | Module "radiomask"
rcArchiver | Module "rcArchiver"
rcCommentPanel | Module "rcCommentPanel"
rcComplStatus | Module "rcComplStatus"
rcDefaultTrigger | Module "rcDefaultTrigger"
rcEndRunDlgImpl | Module "rcEndRunDlgImpl"
rcFitsWriter | Module "rcFitsWriter"
rcHouseKeeping | Module "rcHouseKeeping"
rcLoginImpl | Module "rcLoginImpl"
rcParamVerifier | Module "rcParamVerifier"
rcParamVerifyGUIImpl | Module "rcParamVerifyGUIImpl"
rcPreferencesGUIImpl | Module "rcPreferencesGUIImpl"
rcPreferencesManager | Module "rcPreferencesManager"
rcPythonShell | Module "rcPythonShell"
rcReportGen | Module "rcReportGen"
rcRunIdHelper | Module "rcRunIdHelper"
rcScmCfgSelector | Module "rcScmCfgSelector"
rcSecurityMan | Module "rcSecurityMan"
rcStatusMonitor | Module "rcStatusMonitor"
rcSuite | Module "rcSuite"
rcTestReport | Module "rcTestReport"
rcTransitions | Module "rcTransitions"
rcTransitionsBT | Module "rcTransitionsBT"
rcTrgFunctions |
rcTrgGem |
rcTrgMiniGLT |
rcUsers | Module "rcUsers"
rcUtil | Module "rcUtil"
Receiver | Module "Receiver"
Recorder | Module "Recorder"
Retriever | Module "Retriever"
robustapply |
RunControl | Module "RunControl"
RunControlCommon | Module "RunControlCommon"
RunControlFSM | Module "RunControlFSM"
RunControlGUIImpl | Module "RunControlGUIImpl"
RunControlMain | Module "RunControlMain"
RunControlMainGUIImpl | Module "RunControlMainGUIImpl"
saferef |
ServerPreferencesImpl | Module "ServerPreferencesImpl"
SimpleGasuExample | Interface for Coincidence based Trigger System
socketLogging | Module "socketLogging"
socketMerge | Module "socketMerge"
splitOutTem | Module "splitOutTem"
standardLDF | Module "standardLDF"
standardPlotter | Module "standardPlotter"
standardPlotterGuiImpl | Module "standardPlotterGuiImpl"
startupGUI | Module "startupGUI"
startupMainGUI | Module "startupMainGUI"
suiteRunner | Module "suiteRunner"
sweepRejectTest | Module "sweepRejectTest"
taskEngine | Module "taskEngine"
temLrsTest | Module "temLrsTest"
test_aem | Module "test_aem"
test_aeq | Module "test_aeq"
test_bcast |
test_cmd |
test_cmdrsp | Module "test_cmdrsp"
test_cmxasbuilt | Module "test_cmxasbuilt"
test_db |
test_evt_aem |
test_evt_cal |
test_evt_exttrg |
test_evt_filters |
test_evt_tkr |
test_gafe | Module "test_gafe"
test_garc | Module "test_garc"
test_glt | Module "test_glt"
test_initfabrics | Module "test_initfabrics"
test_lat | Module "test_lat"
test_loopback | Module "test_loopback"
test_mem | Module "test_mem"
test_options | Module "test_options"
test_pduswitch | Module "test_pduswitch"
test_peq | Module "test_peq"
test_playback | Module "test_playback"
test_power | Module "test_power"
test_rate | Module "test_rate"
test_schema | Module "test_schema"
test_tem |
test_teq | Module "test_teq"
test_twoclients | Module "test_twoclients"
testAppAcd | Module "testAppAcd"
testAppAcdScalers | Module "testAppAcdScalers"
testAppAlarm | Module "testAppAlarm"
testAppArchiver | Module "testAppArchiver"
testAppCal | Module "testAppCal"
testAppCal_dg | Module "testAppCal_dg"
testAppEvt | Module "testAppEvt"
testAppEvtCli | Module "testAppEvtCli"
testAppEvtTO | Module "testAppEvtTO"
testAppExclude | Module "testAppExclude"
testAppLDFdump | Module "testAppLDFdump"
testAppMinimal | Module "testAppMinimal"
testAppNoVersion | Module "testAppNoVersion"
testAppReport | Module "testAppReport"
testAppTkr | Module "testAppTkr"
testArchiver | Module "testArchiver"
testErrorPropogation | Module "testErrorPropogation"
testEvtBldr_script | Module "testEvtBldr_script"
testEvtCli | Module "testEvtCli"
testPreload | Module "testPreload"
testRunner | Module "testRunner"
testSAppCal | Module "testSAppCal"
testSAppCal_Lean | Module "testSAppCal_Lean"
testSAppEvt | Module "testSAppEvt"
testSuite | Module "testSuite"
testSuite2 | Module "testSuite2"
testSuite_Lean | Module "testSuite_Lean"
testSuiteLong | Module "testSuiteLong"
testSuiteSummary | Module "testSuiteSummary"
testSummary | Module "testSummary"
testTkrHitFilter | Module "testTkrHitFilter"
testTrending | Module "testTrending"
testTrgParityError | Module "testTrgParityError"
towerwidgetImpl | Module "towerwidgetImpl"
transitionRejectTest | Module "transitionRejectTest"
Trendable | Module "Trendable"
TrendMaps | Module "TrendMaps"
TrgAbstract |
TrgCmdCounters |
TrgCnoCounters |
TrgCoincidences |
TrgConditions |
TrgConditionsValue | Module "TrgConditionsValue"
trgConsumer | Module "trgConsumer"
trgDisplayImpl | Module "trgDisplayImpl"
TrgEngines |
TrgEventCounter |
TrgGem |
TrgGemAbstract |
TrgGemCounters |
TrgGemPeriodicCondition |
TrgGemRegisterGeometry |
TrgGemRegisters |
TrgGemSequence |
TrgInputEnables |
TrgMiniGLT |
TrgMiniGLTAbstract |
TrgMiniGLTRegisters |
TrgObject |
TrgPeriodic |
TrgPPSTimer |
TrgRoiAsTiles |
TrgRoiAsVeto |
TrgSequence |
TrgTileCounters |
TrgTower |
TrgTriggerCounters |
TrgUsingTiles |
userAppBrowser | Module "userAppBrowser"
userAppLeaf | Module "userAppLeaf"
userAppLoader | Module "userAppLoader"
userAppTree | Module "userAppTree"
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package AcdHWMultiplexer

Package AcdHWMultiplexer

Module "AcdHWMultiplexer". More...

Classes

class AcdHWMultiplexer
AcdHWMultiplexer class. More...

Detailed Description

Module "AcdHWMultiplexer".
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package AcdPanel

Package AcdPanel

Module "AcdPanel". More...

Classes

class AcdPanel

Functions

__tr (self, s, c=None)

Detailed Description

Module "AcdPanel".
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package AlertGuiImpl

Package AlertGuiImpl

Module "AlertGuiImpl". More...

Classes

class | gAlertPopup
class | AlertGuiImpl

Functions

usage ()

Detailed Description

Module "AlertGuiImpl".
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package ancillaryContribution

Package ancillaryContribution

Module "ancillaryContribution". More...

Classes

class AncillaryContribution

Detailed Description

Module "ancillaryContribution".
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package ancillaryFile

Package ancillaryFile

Module "ancillaryFile". More...

Classes

class AncillaryContributor

Detailed Description

Module "ancillaryFile".
Generated on Fri Jul 21 13:26:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package ancillarySocket

Package ancillarySocket

Module "ancillarySocket". More...

Classes

class AncillaryContributor

Detailed Description

Module "ancillarySocket".
Generated on Fri Jul 21 13:26:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package ArgumentImpl

Package ArgumentImpl

Module "ArgumentImpl". More...

Classes

class ArgumentImpl

Detailed Description

Module "ArgumentImpl".
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package bar

Package bar

Module "bar". More...

Classes

class bar

Detailed Description

Module "bar".
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package barw

Package barw

Module "barw". More...

Classes

class barw

Detailed Description

Module "barw".
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package BrowserImpl

Package BrowserImpl

Module "BrowserImpl". More...

Classes

class | BrowserImpl
class | RegViewItem

Detailed Description

Module "BrowserImpl".
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package browserPreferencesImpl

Package browserPreferencesImpl

Module "browserPreferencesImpl". More...

Classes

class browserPreferencesImpl

Detailed Description

Module "browserPreferencesImpl".
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package BTdump

Package BTdump

Module "BTdump". More...

Functions

_testDg (dgBuf)
testDG (dg)
testRaw (filename="muon-5.arch", skip=0, saveFile=None)
usage ()

Detailed Description

Module "BTdump".

Function Documentation

BTdump._testDg ( dgBuf )

Iterate over a buffer containing a list of LATdatagrams.

BTdump.testRaw | ( | filename | = "muon-5.arch",
 |  | skip | = 0,
 |  | saveFile | = None
 | ) |

This function is meant for use with datagram encapsulated EBF event files. It assumes the first contribution to the datagram is an EBF event and ignores any subsequent contributions. An EBF event as defined here contains an identification value in its first longword and is followed by the raw EBF event format as described in the TEM, AEM, GEM, etc. documents.

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package Collector

Package Collector

Module "Collector". More...

Classes

class Collector

Functions

testCollector ()

Detailed Description

Module "Collector".
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package colorScale

Package colorScale

Module "colorScale". More...

Functions

colorScale (value)
Method for returning a color scale RGB tuple given a percentage.

Detailed Description

Module "colorScale".

Function Documentation

colorScale.colorScale ( value )

Method for returning a color scale RGB tuple given a percentage.

Return a tuple giving the RGB values for a color chosen from a color scale: black for value < 0.0 blue (cold) for value >= 0.0 red (hot) for value <= 1.0 white for value > 1.0

Parameters:
value - A number between 0.0 and 1.0
Returns:
A tuple containing the RGB values corresponding to the input value

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package consumer

Package consumer

Module "consumer". More...

Classes

class Consumer
Consumer class to consume LDF data This class just handles file open/close or server open/close. More...

Detailed Description

Module "consumer".
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package consumerPlotter

Package consumerPlotter

Module "consumerPlotter". More...

Classes

class consumerPlotter
Consumer class to consume LDF data This class just handles file open/close or server open/close. More...

Detailed Description

Module "consumerPlotter".
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package copyright_SLAC

Package copyright_SLAC

Module "copyright_SLAC". More...

Detailed Description

Module "copyright_SLAC".
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package DataDistributor

Package DataDistributor

Module "DataDistributor". More...

Classes

class | DataDistributorServer
Data Distributor Server. More...
class | DataDistributorClient
Data distributor client class. More...
class | DataDistributorAddress
Data distributor address class containing static methods that govern the picking of multicast ports and addresses. More...

Functions

sender ()
receiver ()

Detailed Description

Module "DataDistributor".
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package DataDistributorPoll

Package DataDistributorPoll

Module "DataDistributorPoll". More...

Classes

class DataDistributorPoll
Data distributor client that polls for samples of data. More...

Detailed Description

Module "DataDistributorPoll".
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package DataExport

Package DataExport

Module "DataExport". More...

Classes

class | GExportException
Define an exception from the Export system. More...
class | DataExport
Class to synch a file or set of files between one location and another. More...

Functions

usage ()

Detailed Description

Module "DataExport".
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package dispatcher

Package dispatcher

Classes

class | _Parameter
class | _Any
class | _Anonymous

Functions

connect (receiver, signal=Any, sender=Any, weak=True)
disconnect (receiver, signal=Any, sender=Any, weak=True)
getReceivers (sender=Any, signal=Any)
liveReceivers (receivers)
getAllReceivers (sender=Any, signal=Any)
send (signal=Any, sender=Anonymous, arguments, named)
sendExact (signal=Any, sender=Anonymous, arguments, named)
_removeReceiver (receiver)
_cleanupConnections (senderkey, signal)
_removeSender (senderkey)

Detailed Description

Multiple-producer-multiple-consumer signal-dispatching

dispatcher is the core of the PyDispatcher system, providing the primary API and the core logic for the system.

Module attributes of note:

Any -- Singleton used to signal either "Any Sender" or "Any Signal". See documentation of the _Any class. Anonymous -- Singleton used to signal "Anonymous Sender" See documentation of the _Anonymous class.

Internal attributes: WEAKREF_TYPES -- tuple of types/classes which represent weak references to receivers, and thus must be de- referenced on retrieval to retrieve the callable object connections -- { senderkey (id) : { signal : [receivers...]}} senders -- { senderkey (id) : weakref(sender) } used for cleaning up sender references on sender deletion sendersBack -- { receiverkey (id) : [senderkey (id)...] } used for cleaning up receiver references on receiver deletion, (considerably speeds up the cleanup process vs. the original code.)

Function Documentation

dispatcher._cleanupConnections | ( | senderkey | ,
 |  | signal |
 | ) |

Delete any empty signals for senderkey. Delete senderkey if empty.

dispatcher._removeReceiver ( receiver )

Remove receiver from connections.

dispatcher._removeSender ( senderkey )

Remove senderkey from connections.

dispatcher.connect | ( | receiver | ,
 |  | signal | = Any,
 |  | sender | = Any,
 |  | weak | = True
 | ) |

Connect receiver to sender for signal

receiver -- a callable Python object which is to receive messages/signals/events. Receivers must be hashable objects.

if weak is True, then receiver must be weak-referencable (more precisely saferef.safeRef() must be able to create a reference to the receiver).

Receivers are fairly flexible in their specification, as the machinery in the robustApply module takes care of most of the details regarding figuring out appropriate subsets of the sent arguments to apply to a given receiver.

Note: if receiver is itself a weak reference (a callable), it will be de-referenced by the system's machinery, so *generally* weak references are not suitable as receivers, though some use might be found for the facility whereby a higher-level library passes in pre-weakrefed receiver references.

signal -- the signal to which the receiver should respond

if Any, receiver will receive any signal from the indicated sender (which might also be Any, but is not necessarily Any).

Otherwise must be a hashable Python object other than None (DispatcherError raised on None).

sender -- the sender to which the receiver should respond

if Any, receiver will receive the indicated signals from any sender.

if Anonymous, receiver will only receive indicated signals from send/sendExact which do not specify a sender, or specify Anonymous explicitly as the sender.

Otherwise can be any python object.

weak -- whether to use weak references to the receiver By default, the module will attempt to use weak references to the receiver objects. If this parameter is false, then strong references will be used.

returns None, may raise DispatcherTypeError

dispatcher.disconnect | ( | receiver | ,
 |  | signal | = Any,
 |  | sender | = Any,
 |  | weak | = True
 | ) |

Disconnect receiver from sender for signal

receiver -- the registered receiver to disconnect signal -- the registered signal to disconnect sender -- the registered sender to disconnect weak -- the weakref state to disconnect

disconnect reverses the process of connect, the semantics for the individual elements are logically equivalent to a tuple of (receiver, signal, sender, weak) used as a key to be deleted from the internal routing tables. (The actual process is slightly more complex but the semantics are basically the same).

Note: Using disconnect is not required to cleanup routing when an object is deleted, the framework will remove routes for deleted objects automatically. It's only necessary to disconnect if you want to stop routing to a live object.

returns None, may raise DispatcherTypeError or DispatcherKeyError

dispatcher.getAllReceivers | ( | sender | = Any,
 |  | signal | = Any
 | ) |

Get list of all receivers from global tables

This gets all receivers which should receive the given signal from sender, each receiver should be produced only once by the resulting generator

dispatcher.getReceivers | ( | sender | = Any,
 |  | signal | = Any
 | ) |

Get list of receivers from global tables

This utility function allows you to retrieve the raw list of receivers from the connections table for the given sender and signal pair.

Note: there is no guarantee that this is the actual list stored in the connections table, so the value should be treated as a simple iterable/truth value rather than, for instance a list to which you might append new records.

Normally you would use liveReceivers( getReceivers( ...)) to retrieve the actual receiver objects as an iterable object.

dispatcher.liveReceivers ( receivers )

Filter sequence of receivers to get resolved, live receivers

This is a generator which will iterate over the passed sequence, checking for weak references and resolving them, then returning all live receivers.

dispatcher.send | ( | signal | = Any,
 |  | sender | = Anonymous,
 |  | arguments | ,
 |  | named |
 | ) |

Send signal from sender to all connected receivers.

signal -- (hashable) signal value, see connect for details

sender -- the sender of the signal

if Any, only receivers registered for Any will receive the message.

if Anonymous, only receivers registered to receive messages from Anonymous or Any will receive the message

Otherwise can be any python object (normally one registered with a connect if you actually want something to occur).

arguments -- positional arguments which will be passed to all* receivers. Note that this may raise TypeErrors if the receivers do not allow the particular arguments. Note also that arguments are applied before named arguments, so they should be used with care.

named -- named arguments which will be filtered according to the parameters of the receivers to only provide those acceptable to the receiver.

Return a list of tuple pairs [(receiver, response), ... ]

if any receiver raises an error, the error propagates back through send, terminating the dispatch loop, so it is quite possible to not have all receivers called if a raises an error.

dispatcher.sendExact | ( | signal | = Any,
 |  | sender | = Anonymous,
 |  | arguments | ,
 |  | named |
 | ) |

Send signal only to those receivers registered for exact message

sendExact allows for avoiding Any/Anonymous registered handlers, sending only to those receivers explicitly registered for a particular signal on a particular sender.

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package doublehisto

Package doublehisto

Module "doublehisto". More...

Classes

class doublehisto

Functions

remainder (nr)

Detailed Description

Module "doublehisto".
Generated on Fri Jul 21 13:26:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package EnvMonImpl

Package EnvMonImpl

Module "EnvMonImpl". More...

Classes

class | EnvMonImpl
class | PlotWidget
class | ScrollablePlotView

Detailed Description

Module "EnvMonImpl".
Generated on Fri Jul 21 13:26:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package errors

Package errors

Classes

class | DispatcherError
class | DispatcherKeyError
class | DispatcherTypeError

Detailed Description

Error types for dispatcher mechanism

Generated on Fri Jul 21 13:26:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package evtCli

Package evtCli

Event handler classes. More...

Detailed Description

Event handler classes.

Event objects:

The following list contains the objects populated during parsing. Please refer to the individual classes to find out how to access event data stored in these objects:

  • CAL_LogAccepts -- List of evCAL_LogAccepts

  • CAL_LogData -- List of evCAL_LayerLogData

  • TKRstrips -- List of evTKR_StripData

  • TKRaccepts -- List of int

  • TKRtots -- List of evTKR_TOTdata

  • diag -- evDiag_Data

  • errSummary -- evErr_Summary

  • errGCCCmsg -- List of evErr_GCCC_Message

  • errGTCCmsg -- List of evErr_GTCC_Message

  • errCablePhase -- evErr_CablePhase

  • errCableTimeOut -- evErr_CableTimeOut

  • aem -- AEM

  • aem.PHA -- Dictionary of evAEM_PHA indexed by cable number

  • gem -- GEM

  • gem.vetoList -- evGEM_Veto_List

Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package evtDataImpl

Package evtDataImpl

Module "evtDataImpl". More...

Classes

class evtDataImpl

Detailed Description

Module "evtDataImpl".
Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package excApp

Package excApp

Module "excApp". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "excApp".
Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package FEpowerUp

Package FEpowerUp

Module "FEpowerUp". More...

Classes

class FEpowerUp

Detailed Description

Module "FEpowerUp".
Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package fileMerge

Package fileMerge

Module "fileMerge". More...

Classes

class Merger

Functions

main (options)
usage ()
Return a program usage message.

Detailed Description

Module "fileMerge".
Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package fits2ldf

Package fits2ldf

Module "fits2ldf". More...

Functions

__usage ()

Detailed Description

Module "fits2ldf".
Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package FreeSpace

Package FreeSpace

Module "FreeSpace". More...

Functions

FreeSpace (filePath=None)

Detailed Description

Module "FreeSpace".

Function Documentation

FreeSpace.FreeSpace ( filePath = None )

freespace(path) -> long Return the number of bytes available to the user on the file system pointed to by path.

Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package FSM

Package FSM

Classes

class | ExceptionFSM
class | FSM

Functions

BeginBuildNumber (fsm)
BuildNumber (fsm)
EndBuildNumber (fsm)
DoOperator (fsm)
DoEqual (fsm)
Error (fsm)
example ()

Detailed Description

This module implements a Finite State Machine (FSM). In addition to state this FSM also maintains a user defined "something". This "something" is effectively memory, so this FSM could be considered a Push-down Automata (PDA) since a PDA is a FSM + memory.

The following describes how the FSM works, but you will probably also need to see the example function to understand how the FSM is used in practice.

You define an FSM by building tables of transitions. For a given input symbol the process() method uses these tables to decide what action to call and what the next state will be. The FSM has a table of transitions that associate: (input_symbol, current_state) --> (action, next_state) where "action" is a function you define. The symbols and states can be any objects. You use the add_transition() and add_transition_list() methods to add to the transition table. The FSM also has a table of transitions that associate: (current_state) --> (action, next_state) You use the add_transition_any() method to add to this transition table. The FSM also has one default transition that is not associated with any specific input_symbol or state. You use the set_default_transition() method to set the default transition.

When an action function is called it is passed a reference to the FSM. The action function may then access attributes of the FSM such as input_symbol, current_state, or "something". The "something" attribute can be any object that you want to pass along to the action functions. It is not used by the FSM. For parsing you would typically pass a list to be used as a stack.

The processing sequence is as follows. The process() method is given an input_symbol to process. The FSM will search the table of transitions that associate: (input_symbol, current_state) --> (action, next_state) If the pair (input_symbol, current_state) is found then process() will call the associated action function and then set the current state to the next_state.

If the FSM cannot find a match for (input_symbol, current_state) it will then search the table of transitions that associate: (current_state) --> (action, next_state) If the current_state is found then the process() method will call the associated action function and then set the current state to the next_state. Notice that this table lacks an input_symbol. It lets you define transitions for a current_state and ANY input_symbol. Hence, it is called the "any" table. Remember, it is always checked after first searching the table for a specific (input_symbol, current_state).

For the case where the FSM did not match either of the previous two cases the FSM will try to use the default transition. If the default transition is defined then the process() method will call the associated action function and then set the current state to the next_state. This lets you define a default transition as a catch-all case. You can think of it as an exception handler. There can be only one default transition.

Finally, if none of the previous cases are defined for an input_symbol and current_state then the FSM will raise an exception. This may be desirable, but you can always prevent this just by defining a default transition.

Noah Spurrier 20020822

Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gAEM

Package gAEM

Module "gAEM". More...

Classes

class | GAEM
ACD Common Controller. More...
class | GAEQ
ACD Environmental Monitors. More...
class | GARC
ACD Readout Controller. More...
class | GAFE
ACD Front-End Controller. More...

Detailed Description

Module "gAEM".
Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gAlert

Package gAlert

Module "gAlert". More...

Classes

class | gAlertHandler
class | gAlertMailer
class | gAlertStr
class | gAlertMail
class | gAlertRegistry

Functions

alert (message, system, severity=YELLOWALERT, machine=0)

Detailed Description

Module "gAlert".
Generated on Fri Jul 21 13:26:44 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gAttr

Package gAttr

GLAST LAT record attribute definitions. More...

Classes

class | Gattr
Base class which is instantiated once for each attribute kind. More...
class | GattrRaw
Class which is instantiated for each raw register kind. More...
class | GattrReg
Class which is instantiated for each register. More...
class | GattrRegDepr
class | GattrDlc
class | GattrBF
Bit field class which is instantiated for each bit field kind. More...
class | _Attr

Detailed Description

GLAST LAT record attribute definitions.

Contents:

GLAST LAT functional block hierarchy representation in Python See The Tower Electronics Module (TEM) - Programming ICD specification (LAT-TD-00605-D1) for more info

Generated on Fri Jul 21 13:26:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gBits

Package gBits

Module "gBits". More...

Classes

class | bf
class | BitField

Functions

hexConvert (s, size=1, outPutStyle="0x%s ")
lhex (x, size=8)
q (cond, on_true, on_false)
dump_cells (data)
population (mask)

Detailed Description

Module "gBits".

Function Documentation

gBits.hexConvert | ( | s | ,
 |  | size | = 1,
 |  | outPutStyle | = "0x%s "
 | ) |

Convert binary string s to a hex format

Keyword arguments:

'size' -- How large should each hex value be

'outPutStyle' -- How should each value be formatted

Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gCmdCli

Package gCmdCli

Module "gCmdCli". More...

Classes

class CmdCli

Detailed Description

Module "gCmdCli".
Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gCommand

Package gCommand

Module "gCommand". More...

Classes

class Command

Functions

packstring (arg, type)

Detailed Description

Module "gCommand".
Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gConstraint

Package gConstraint

Module "gConstraint". More...

Classes

class | gConstraintViolation
Constraint Violation Class. More...
class | GconstraintBase
Base constraint class for use when no constraint is appropriate. More...
class | Gconstraint
Base class for describing constraints. More...
class | GconstraintLimitRE
On Constraint Limit Raise Exception. More...
class | GconstraintLimit
Limit Constraint. More...
class | GconstraintLimitPegRE
Pegged Limit Constraint. More...

Detailed Description

Module "gConstraint".
Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gCRU

Package gCRU

Module "gCRU". More...

Classes

class GCRU
CRU node. More...

Detailed Description

Module "gCRU".
Generated on Fri Jul 21 13:26:49 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gDb

Package gDb

Module "gDb". More...

Classes

class | Gdb
Base class for all GLAST LAT functional blocks. More...
class | _regList
class | Children
class | Lem

Detailed Description

Module "gDb".
Generated on Fri Jul 21 13:26:49 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package geb

Package geb

Module "geb". More...

Classes

class | GebContribution
class | GebContributor
class | Geb

Detailed Description

Module "geb".
Generated on Fri Jul 21 13:26:50 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gEBM

Package gEBM

Module "gEBM". More...

Classes

class | GEBM
GEBM node. More...
class | GEBMC
EBM Controller node. More...
class | GEBMST
EBM Event Statistics node. More...

Detailed Description

Module "gEBM".
Generated on Fri Jul 21 13:26:51 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gEGU

Package gEGU

Module "gEGU". More...

Classes

class | GEGU
Base class for raw/engineering unit conversions. More...
class | GEGU_linear
EGU class for performing linear conversions. More...
class | GEGU_poly3
EGU class for performing 3rd degree polynominal conversions. More...
class | GEGU_thermistor
EGU class for performing thermistor conversions. More...
class | GEGU_rtd
EGU class for performing RTD (Resistive Temp Device) conversions. More...

Detailed Description

Module "gEGU".
Generated on Fri Jul 21 13:26:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gEPU

Package gEPU

Module "gEPU". More...

Classes

class GEPU
EPU node. More...

Detailed Description

Module "gEPU".
Generated on Fri Jul 21 13:26:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gEvtCli

Package gEvtCli

Module "gEvtCli". More...

Classes

class | AEM
AEM event object. More...
class | evAEM_PHA
PHA object. More...
class | GEM
GEM event object. More...
class | evGEM_Veto_List
GEM Veto List object. More...
class | evGEM_Cond_Arrival_Times
GEM Condition Arrival Times bitfield. More...
class | Evt
Event object. More...
class | evErr_Summary
Error summary bitfields. More...
class | evSummary
Event summary bitfields. More...
class | evSummary_Singleton
class | evContPacket
Contribution Packet bitfields. More...
class | evContPacket_Singleton
class | evTKR_TOTdata
TKR TOT data class. More...
class | evTKR_Strip
TKR strip bitfields. More...
class | evTKR_StripData
TKR StripData class. More...
class | evCAL_LogAccepts
Log Accepts bitfields. More...
class | evCAL_LayerLogData
Class that associates a layer with the log data. More...
class | evCAL_LogData
Log Data bitfields. More...
class | evDiag_CalLayerEnd
Calorimeter Layer End bitfields. More...
class | evDiag_CalLayer
Calorimeter Layer class. More...
class | evDiag_TkrTrgReq
TKR Trigger Request bitfields. More...
class | evErr_GCCC
GCCC Error bitfields. More...
class | evErr_GCCC_Message
GCCC Error Message object. More...
class | evErr_CablePhase
Cable Controller Phasing Error bitfields. More...
class | evErr_GTCC
GTCC Error bitfields. More...
class | evErr_GTCC_Message
GTCC Error Message object. More...
class | evErr_CableTimeOut
Cable Timeout Error bitfields. More...
class | evDiag_Data
Diagnostic Data class. More...
class | evCellHeader
Cell Header bitfields. More...
class | evCellHeader_Singleton
class | EvtCliIO
Event client input/output class. More...
class | EvtCli
Event handler client. More...

Detailed Description

Module "gEvtCli".
Generated on Fri Jul 21 13:26:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gEvtCliBT

Package gEvtCliBT

Module "gEvtCliBT". More...

Classes

class | SocketClosed
class | AncillaryContributor
Concrete contributor class specifically meant to work with EvtCli. More...
class | Merger
class | EvtCliBT

Functions

__init__ (self, evtCli, offset=1L)
name (self)
sequence (self, sequence)
Method for remapping the ancillary contribution's sequence number into the same space as the other contributions' sequence numbers.
open (self)
close (self)
read (self)
Method to read an LDF contribution from a socket.
getHostPort (hostPort)

Detailed Description

Module "gEvtCliBT".

Function Documentation

gEvtCliBT.sequence | ( | self | ,
 |  | sequence |
 | ) |

Method for remapping the ancillary contribution's sequence number into the same space as the other contributions' sequence numbers.

! This method has the side effect that it can affect the next the value returned, so it assumes that it is called with sequential sequence numbers. This would be a problem if were called multiple times to retrieve the sequence number for the same sequence number.

Todo:
Fix the side effect nature of this routine

Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gException

Package gException

Module "gException". More...

Classes

class | LATInterfaceStatus
class | LATInterfaceException

Detailed Description

Module "gException".
Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gFabrics

Package gFabrics

Module "gFabrics". More...

Classes

class Fabrics

Detailed Description

Module "gFabrics".
Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gFswMessages

Package gFswMessages

Module "gFswMessages". More...

Classes

class FswMessages

Detailed Description

Module "gFswMessages".
Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gGEM

Package gGEM

Module "gGEM". More...

Classes

class | GGEM
GGEM node. More...
class | GGEMC
GEMC sub-node of GGEM (controller). More...
class | GGEMMG
GEMMG sub-node of GGEM (TAM generator). More...
class | GGEMST
GEMST sub-node of GGEM (statistics). More...
class | GGEMSC
GEMSC sub-node of GGEM (scheduler). More...
class | GGEMVG
GEMVG sub-node of GGEM (ROI generator). More...
class | GGEMIE
GEMIE sub-node of GGEM (input enables). More...
class | GGEMW
GEMW sub-node of GGEM. More...

Detailed Description

Module "gGEM".
Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gGLT

Package gGLT

Module "gGLT". More...

Classes

class GGLT
Global Trigger. More...

Detailed Description

Module "gGLT".
Generated on Fri Jul 21 13:27:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gGroup

Package gGroup

Module "gGroup". More...

Classes

class Ggroup

Detailed Description

Module "gGroup".
Generated on Fri Jul 21 13:27:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gHdb

Package gHdb

Module "gHdb". More...

Classes

class GattrHsk
Class which is instantiated for each housekeeping quantity. More...

Detailed Description

Module "gHdb".
Generated on Fri Jul 21 13:27:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gHSK

Package gHSK

GLAST LAT record definitions. More...

Classes

class | GHSK
GLAST HSK node Record. More...
class | HTEM
GLAST TEM HSK node record. More...
class | HAEM
GLAST AEM HSK node Record. More...
class | HARC
GLAST ARC HSK node record. More...
class | HGEM
GLAST GEM HSK node record. More...
class | HEBM
GLAST EBM HSK node record. More...
class | HPDU
GLAST PDU HSK node record. More...
class | HCOM
GLAST Communications statistics HSK node record. More...
class | HCPU
GLAST CPU metrics HSK node record. More...
class | HNUL
GLAST HSK null record. More...

Functions

processGHSK (isSchema, ghdb, node, declarations)
processHTEM (isSchema, ghdb, node, declarations)
processHAEM (isSchema, ghdb, node, declarations)
processHARC (isSchema, ghdb, node, declarations)
processHGEM (isSchema, ghdb, node, declarations)
processHEBM (isSchema, ghdb, node, declarations)
processHPDU (isSchema, ghdb, node, declarations)
processHCOM (isSchema, ghdb, node, declarations)
processHCPU (isSchema, ghdb, node, declarations)
readHskConfig (ghsk, cfgFileName)
applyHskConfig (ghsk, seq=None)
processHskConfigProperties (ghsk, node, declarations)
__privateFn (cls, function)

Detailed Description

GLAST LAT record definitions.

Contents:

Overview:

This module provides classes that are used as the building blocks for the Housekeeping hierarchy.

Function Documentation

gHSK.applyHskConfig | ( | ghsk | ,
 |  | seq | = None
 | ) |

Applies the configuration that may have existed when the schema is read. The configuration portion of the schema is stored as a DOM reference in the GHSK node. This function accesses that DOM and sets the attributes accordingly

Input ::

(1) GHSK root of the object model (2) Optional sequence number of the configuration

Output: None

Usage::

applyConfig(ghsk)

gHSK.readHskConfig | ( | ghsk | ,
 |  | cfgFileName |
 | ) |

Read a hsk configuration XML file and add its DOM to the dictionary of configurations.

Parameters:
ghsk | Populated schema
cfgFileName | Name of the configuration file in XML format
Returns:
The numeric key value of the dictionary entry. -1 if it fails to read the configuration file.

Generated on Fri Jul 21 13:27:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gLAT

Package gLAT

GLAST LAT record definitions. More...

Classes

class GLAT
GLAST LAT node Record. More...

Detailed Description

GLAST LAT record definitions.

Contents:

GLAST LAT functional block hierarchy representation in Python. See the following documents for more info:

The Tower Electronics Module (TEM) - Programming ICD specification (LAT-TD-00605-D1)

ACD Electronics Module (AEM) - Programming ICD specification (LAT-TD-00639-D1)

The Event Builder Module - Programming ICD specification (LAT-TD-01546)

The GLT Electronics Module - Programming ICD specification (LAT-TD-01545)

The Command/Response Unit - Programming ICD specification (LAT-TD-01547)

The Power Distribution Unit - Programming ICD specification (LAT-TD-01543)

Overview:

This module provides classes that are used as the building blocks for the LAT hierarchy. All classes inherit from Gnode class and add their own member methods and functions where necessary. Here is a list of classes defined:

  • GLAT: Root node for the hierarchy
  • GPDU: Power Distribution Unit
  • GPDUC: PDU Controller
  • GPEQ: PDU Environmental Monitors
  • GTWR: Tower
  • GTEM: Tower Electronics Module
  • GCCC: Calorimeter Cable Controller
  • GCRC: Calorimeter Readout Controller
  • GCFE: Calorimeter Front-end Controller
  • GTCC: Tracker Cable Controller
  • GTRC: Tracker Readout Controller
  • GTFE: Tracker Front-end Controller
  • GTIC: Trigger Interface Controller
  • GAEM: ACD Common Controller
  • GAEQ: ACD Environmental Monitors
  • GARC: ACD Readout Controller
  • GAFE: ACD Front-End Controller
  • GGLT: Global Trigger
  • GEBM: Event Builder Module
  • GEBMC: Event Builder Module Controller
  • GEBMST: Event Builder Module Statistics
  • GGEM: GLT Electronics Module
  • GGEMC: GLT Electronics Module Controller
  • GGEMMG: GLT Electronics Module TAM generator
  • GGEMST: GLT Electronics Module Statistics
  • GGEMSC: GLT Electronics Module Scheduler
  • GGEMVG: GLT Electronics Module ROI generator
  • GGEMIE: GLT Electronics Module Input enables
  • GGEMW: GLT Electronics Module Window
  • GCRU: Command Response Unit

Generated on Fri Jul 21 13:27:06 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gLCB

Package gLCB

Module "gLCB". More...

Classes

class | GLCB
LCB node. More...
class | GLCBSTATS
LCB stats access. More...

Detailed Description

Module "gLCB".
Generated on Fri Jul 21 13:27:06 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package GlobalPanelImpl

Package GlobalPanelImpl

Module "GlobalPanelImpl". More...

Classes

class | GlobalPanelImpl
class | NullStream

Detailed Description

Module "GlobalPanelImpl".
Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gLog

Package gLog

Module "gLog". More...

Functions

logStack ()
logException (msg="")
__stripLineFeed (str)

Detailed Description

Module "gLog".
Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gLoopback

Package gLoopback

Module "gLoopback". More...

Classes

class Loopback

Detailed Description

Module "gLoopback".
Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gMem

Package gMem

Module "gMem". More...

Classes

class GMem
Memory node. More...

Detailed Description

Module "gMem".
Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gNAT

Package gNAT

Module "gNAT". More...

Classes

class GNAT
GNAT node Record. More...

Detailed Description

Module "gNAT".
Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gNode

Package gNode

Module "gNode". More...

Classes

class Node

Detailed Description

Module "gNode".
Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gOCS

Package gOCS

Module "gOCS". More...

Classes

class GOCS
OCS node. More...

Detailed Description

Module "gOCS".
Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gOcsMessages

Package gOcsMessages

Module "gOcsMessages". More...

Classes

class OcsMessages

Detailed Description

Module "gOcsMessages".
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gOpcode

Package gOpcode

Module "gOpcode". More...

Classes

class Opcode

Detailed Description

Module "gOpcode".
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gOptions

Package gOptions

Module "gOptions". More...

Classes

class Options

Detailed Description

Module "gOptions".
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package GOSED_LDF

Package GOSED_LDF

Module "GOSED_LDF". More...

Classes

class | GEMcontribution_
class | AEMcontributionIterator_
class | CALcontributionIterator2
CAL contribution Displayer. More...
class | TKRcontributionIterator_
TKR contribution Displayer. More...
class | OSWcontributionIterator_
class | DIAGcontributionIterator_
class | ERRcontributionIterator_
class | myLATcomponentIterator
LAT component Displayer. More...

Detailed Description

Module "GOSED_LDF".
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package GOSEDACDImpl

Package GOSEDACDImpl

Module "GOSEDACDImpl". More...

Classes

class ACDSingleEvtDisplayImpl

Detailed Description

Module "GOSEDACDImpl".
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package GOSEDCALImpl

Package GOSEDCALImpl

Module "GOSEDCALImpl". More...

Classes

class GOSEDCALImpl

Detailed Description

Module "GOSEDCALImpl".
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package GOSEDCALTKRImpl

Package GOSEDCALTKRImpl

Module "GOSEDCALTKRImpl". More...

Classes

class GOSEDCALTKRImpl

Detailed Description

Module "GOSEDCALTKRImpl".
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package GOSEDDataImpl

Package GOSEDDataImpl

Module "GOSEDDataImpl". More...

Classes

class GOSEDDataImpl

Detailed Description

Module "GOSEDDataImpl".
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gosedImpl

Package gosedImpl

Module "gosedImpl". More...

Classes

class singleEvtDisplayImpl
Glast Online Single Event Display (GOSED). More...

Detailed Description

Module "gosedImpl".
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package GOSEDPainter

Package GOSEDPainter

Module "GOSEDPainter". More...

Classes

class | drawSide1ACD
class | drawSide2ACD
class | drawSide3ACD
class | drawSide4ACD
class | drawHatACD
class | drawXZ_TKR
class | drawYZ_TKR
class | drawXZ_CAL
class | drawYZ_CAL
class | drawRainbowACD
class | drawRainbowCAL

Detailed Description

Module "GOSEDPainter".
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package GOSEDPreferencesImpl

Package GOSEDPreferencesImpl

Module "GOSEDPreferencesImpl". More...

Classes

class GOSEDPreferencesImpl
Class for managing a GOSED user's preferences. More...

Detailed Description

Module "GOSEDPreferencesImpl".
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package GOSEDTKRImpl

Package GOSEDTKRImpl

Module "GOSEDTKRImpl". More...

Classes

class GOSEDTKRImpl

Detailed Description

Module "GOSEDTKRImpl".
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package GOSEDTWRImpl

Package GOSEDTWRImpl

Module "GOSEDTWRImpl". More...

Classes

class GOSEDTWRImpl

Detailed Description

Module "GOSEDTWRImpl".
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package GOTEDImpl

Package GOTEDImpl

Module "GOTEDImpl". More...

Classes

class towerEvtDisplayImpl

Detailed Description

Module "GOTEDImpl".
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gPDU

Package gPDU

Module "gPDU". More...

Classes

class | GPDU
PDU Controller. More...
class | GPEQ
PDU Environmental Monitors. More...

Detailed Description

Module "gPDU".
Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package GpibPwrCtrlImpl

Package GpibPwrCtrlImpl

Module "GpibPwrCtrlImpl". More...

Classes

class GpibPwrCtrlImpl

Detailed Description

Module "GpibPwrCtrlImpl".
Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gPlumber

Package gPlumber

Module "gPlumber". More...

Classes

class Plumber

Detailed Description

Module "gPlumber".
Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gRegister

Package gRegister

Module "gRegister". More...

Classes

class Register

Detailed Description

Module "gRegister".
Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gResponse

Package gResponse

Module "gResponse". More...

Classes

class Response

Detailed Description

Module "gResponse".
Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gRule

Package gRule

Module "gRule". More...

Classes

class | GruleBase
Base rule class for use when no rule is appropriate. More...
class | Grule
Base class for describing rules. More...
class | GruleLimit
Rule class that limits a passed in value to given limits. More...
class | GruleAlarms
Alarm rule. More...

Detailed Description

Module "gRule".
Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gSchemaConfig

Package gSchemaConfig

Module "gSchemaConfig". More...

Classes

class ConfigElement
Wrapper class for providing a compatibility layer between the old minidom XML DOMs and the new 4Suite Domlette DOMs. More...

Functions

readSchema (glat, fileName)
processFlags (gnode, xnode)
addOpaque (gnode, xnode)
opaqueExists (opaqueList, xnode)
addSerialNos (gnode, snode)
addExcludes (gnode, enode)
processIncludes (doc, node, includeFiles, mainFilePath)
processConfigProperties (node, declarations)
readConfig (glat, cfgFileName)
applyConfig (glat, seq=None, gxbrd=None, enableSystemOverrides=True, enableRegWrite=True)
processGLAT (isSchema, glat, node, declarations)
setRegister (gattr, node, declarations)
extractRegisterValue (node)
processGXBRD (isSchema, gxbrd, node, declarations)
processGTWR (isSchema, gxbrd, node, declarations)
processGGLT (isSchema, gxbrd, node, declarations)
processGPDU (isSchema, glat, node, declarations)
processGPEQ (isSchema, gpdu, node, declarations)
processGEBM (isSchema, glat, node, declarations)
processGEBMC (isSchema, gebm, node, declarations)
processGEBMST (isSchema, gebm, node, declarations)
processGGEM (isSchema, glat, node, declarations)
processGGEMC (isSchema, ggem, node, declarations)
processGGEMMG (isSchema, ggem, node, declarations)
processGGEMST (isSchema, ggem, node, declarations)
processGGEMSC (isSchema, ggem, node, declarations)
processGGEMVG (isSchema, ggem, node, declarations)
processGGEMIE (isSchema, ggem, node, declarations)
processGGEMW (isSchema, ggem, node, declarations)
processGCRU (isSchema, glat, node, declarations)
processGTEM (isSchema, glat, node, declarations)
setSysReg (declarations, node, regName, value)
Record the system register if specified in the schema.
getSysReg (declarations, node, regName)
Check if the system register regName is specified in a configuration.
tuplesMatch (t1, t2)
configureSystem (glat, gtemIdSeq)
processGSIU (isSchema, glat, node, declarations)
processGEPU (isSchema, glat, node, declarations)
configureGCCC (node)
checkForDuplicateNode (node)
checkForConfigurationNode (node)
processGCCC (isSchema, gtem, node, declarations)
processGTCC (isSchema, gtem, node, declarations)
processGTIC (isSchema, gtem, node, declarations)
processGCRC (isSchema, gccc, node, declarations)
processGTRC (isSchema, gtcc, node, declarations)
processGCFE (isSchema, gcrc, node, declarations)
processGTFE (isSchema, gtrc, node, declarations)
processGAEM (isSchema, glat, node, declarations)
processGAEQ (isSchema, gaem, node, declarations)
processGARC (isSchema, gaem, node, declarations)
processGAFE (isSchema, garc, node, declarations)
printTree (node)
getChildNodes (node)
getAttribute (node, attr)
hasAttribute (node, attr)
setAttribute (node, attr, value)
createElement (node, elem)
isNumber (s)
getParameterValue (parValue)
processConstraints (node, declarations)
processRules (node, declarations)
processEGUs (node, declarations)
processDeclarations (isSchema, node, declarations)
processBooleanDeclarationOption (on, declarations, tagName=None)
processBadChannels (node, badChannels, mapLayerToCable=None, mapDetectorToLayer=None, temId=None)
readBadChannels (fileName, mapLayerToCable=None, mapDetectorToLayer=None, temId=None)
instantiateClass (classModStr, classNameStr, parList)
takeSnapshot (glat, stream=sys.stdout, fileName=None, captureGTIC=1, captureGAEQ=1, trigger=None, configName='', configVersion='')
writeConfig (glat, stream=sys.stdout, seq=None)
writeRegisters (node, doc, xnode)
writeSchema (glat, stream=sys.stdout, snapshotMode=0, captureGTIC=1, captureGAEQ=1, trigger=None, configName='', configVersion='')
getPath (gnode, explicitBroadcastNodes)
uncompressSequence (seqStr, sepChar=',')
compressSequence (idTuple, sepChar=',')
toPrettyXML (doc, writer, indent="\t", newl="\n", encoding=None)
writeXML (n, writer, indent="", addindent="", newl="")
_write_data (writer, data)

Detailed Description

Module "gSchemaConfig".

Function Documentation

gSchemaConfig._write_data | ( | writer | ,
 |  | data |
 | ) |

Writes datachars to writer.

gSchemaConfig.applyConfig | ( | glat | ,
 |  | seq | = None,
 |  | gxbrd | = None,
 |  | enableSystemOverrides | = True,
 |  | enableRegWrite | = True
 | ) |

Applies the configuration that may have existed when the schema is read. The configuration portion of the schema is stored as a DOM reference in the GLAT node. This function accesses that DOM and sets the registers accordingly

Input ::

(1) GLAT root of the object model (2) Optional sequence number of the configuration

Output: None

Usage::

applyConfig(lat)

gSchemaConfig.getSysReg | ( | declarations | ,
 |  | node | ,
 |  | regName |
 | ) |

Check if the system register regName is specified in a configuration.

Parameters:
declarations | Declarations dictionary.
node | Node where we check for the system register.
regName | System register name.
Returns:
None if it is not specified in the configuration(s) Register value from the configurations(s) if it is specified.

gSchemaConfig.readConfig | ( | glat | ,
 |  | cfgFileName |
 | ) |

Read a configuration XML file and add its DOM to the dictionary of configurations.

Parameters:
glat | Populated schema
cfgFileName | Name of the configuration file in XML format
Returns:
The numeric key value of the dictionary entry. -1 if it fails to read the configuration file.

gSchemaConfig.readSchema | ( | glat | ,
 |  | fileName |
 | ) |

Reads a LAT schema/config document from an XML file and returns the object model

Input ::

(1) Filename of the XML (2) Optional active (connected) command client reference. Not needed if the document does not contain a 'configuration' section

Output::

GLAT root of the object model

Usage::

lat = readSchema('testSchema.xml')

gSchemaConfig.setSysReg | ( | declarations | ,
 |  | node | ,
 |  | regName | ,
 |  | value |
 | ) |

Record the system register if specified in the schema.

Parameters:
declarations | Declarations dictionary.
node | Node where the system register is specified.
regName | System register name.
value | System register value as specified in the configuration(s).

gSchemaConfig.writeSchema | ( | glat | ,
 |  | stream | = sys.stdout,
 |  | snapshotMode | = 0,
 |  | captureGTIC | = 1,
 |  | captureGAEQ | = 1,
 |  | trigger | = None,
 |  | configName | = '',
 |  | configVersion | = ''
 | ) |

Writes a LAT object model to an XML schema

Inputs::

GLAT root of the object model Output stream (defaults to sys.stdout if omitted)

Output: None

Usage::

f = open('mySchema.xml', 'w') writeSchema(lat, f) f.close() or writeSchema(lat) to output to sys.stdout.

Generated on Fri Jul 21 13:27:10 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gSIU

Package gSIU

Module "gSIU". More...

Classes

class GSIU
SIU node. More...

Detailed Description

Module "gSIU".
Generated on Fri Jul 21 13:27:11 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gSocket

Package gSocket

Module "gSocket". More...

Classes

class Socket

Detailed Description

Module "gSocket".
Generated on Fri Jul 21 13:27:11 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gTEM

Package gTEM

Module "gTEM". More...

Classes

class | GTEM
TEM node Record. More...
class | GCCC
Calorimeter Cable Controller node Record. More...
class | GCRC
Calorimeter Readout Controller node Record. More...
class | GCFE
Calorimeter Front End node Record. More...
class | GTCC
Tracker Cable Controller node record. More...
class | GTRC
Tracker Readout Controller node Record. More...
class | GTFE
Tracker Front-End node Record. More...
class | GTIC
Trigger Interface Controller. More...

Detailed Description

Module "gTEM".
Generated on Fri Jul 21 13:27:11 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gTPG

Package gTPG

Module "gTPG". More...

Classes

class GTPG

Detailed Description

Module "gTPG".
Generated on Fri Jul 21 13:27:13 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package guiBridges

Package guiBridges

Module "guiBridges". More...

Classes

class | GUIbridge
Class for providing a bridge between the GUI thread and other threads. More...
class | QtThreadBridge
class | PyThreadBridge
class | GUIbridgeTest
class | TestWindow

Functions

startTest (args)

Detailed Description

Module "guiBridges".
Generated on Fri Jul 21 13:27:13 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gVersions

Package gVersions

Classes

class Gversions

Detailed Description

Version retrieval utility class

Contents:

Provides accessor methods to retrieve version information from both the software and hardware. Displays version info from loaded libraries. Used for troubleshooting problems.

Overview:

Each driver on VxWorks side and each module on the client side provides its version number through functions. When the function cmd.getVersions() is called the command server packetizes this information and sends it over the socket to the command client which gets decoded into a tuple. The getModuleVersions() function converts this tuple to a dictionary and adds the python module versions to it.

Usage:

To retrieve version information one can write::

python versions.py

or

import versions versions.Gversions.getModuleVersions()

Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package gXBR

Package gXBR

Module "gXBR". More...

Classes

class | GXBRD
Tower controller node Record. More...
class | GTWR
Tower node Record. More...

Detailed Description

Module "gXBR".
Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package HskAlarms

Package HskAlarms

Module "HskAlarms". More...

Functions

sendAlert (value, signal, sender, node, level)
yellowAlert (value, signal, sender, node)
redAlert (value, signal, sender, node)
yellowPrintMessage (value, signal, sender, node)
redPrintMessage (value, signal, sender, node)
NodeString (node)

Detailed Description

Module "HskAlarms".

Function Documentation

HskAlarms.NodeString ( node )

Useful little recursive function to generate a string representation of a gDb-like object.

Parameters:
node Any gDb-like object. (i.e. GLAT, GHSK) Object must support getName(), up() and id() methods.

Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package HskCli

Package HskCli

Module "HskCli". More...

Classes

class | HskCli
Housekeeping client input/output class. More...
class | ccsdsSocket
class | HskCmdRxSocket
class | HskCmdTxSocket
class | HskTelemSocket
class | ConnectState
class | HskHandler
HskHandler class. More...

Detailed Description

Module "HskCli".
Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package HskCollector

Package HskCollector

Module "HskCollector". More...

Classes

class | HskConfiguration
class | HskCollector
Configurable housekeeping collector. More...

Detailed Description

Module "HskCollector".
Generated on Fri Jul 21 13:27:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package HskGuiReceiver

Package HskGuiReceiver

Module "HskGuiReceiver". More...

Classes

class | QtReceiver
class | TrendPlotter
class | TimeAxisGen

Functions

memget ()
startup ()
startQT (dataFile, startTime, keyList)
usage ()

Detailed Description

Module "HskGuiReceiver".
Generated on Fri Jul 21 13:27:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package HskPacket

Package HskPacket

Module "HskPacket". More...

Classes

class | HskPacket
class | HskPacket210
class | HskPacket211
class | HskPacket212
class | HskPacket213
class | HskPacket214
class | HskPacket215
class | HskPacket216
class | HskPacket217
class | HskPacket218
class | HskPacket219
class | HskPacket21a
class | HskPacket21b
class | HskPacket21c
class | HskPacket21d
class | HskPacket21e
class | HskPacket21f
class | HskPacket220
class | HskPacket221
class | HskPacket222
class | HskPacket223
class | HskPacket224
class | HskPacket225
class | HskPacket226
class | HskPacket270
class | HskPacket271
class | HskPacket272
class | HskPacket273
class | HskPacket274
class | HskPacket275
class | HskPacket276
class | HskPacket277
class | HskPacket278
class | HskPacket279
class | HskPacket27a
class | HskPacket27b
class | HskPacket27c
class | HskPacket27d
class | HskPacket27e
class | HskPacket27f
class | HskPacket280
class | HskPacket281
class | HskPacket282
class | HskPacket283
class | HskPacket284
class | HskPacket285
class | HskPacket286
class | HskPacket227
class | HskPacket287
class | HskPacket228
class | HskPacket229
class | HskPacket288
class | HskPacket289
class | HskPacket22a
class | HskPacket28a
class | HskPacket22b
class | HskPacket28b
class | HskPacket353
class | HskPacket22c
class | HskPacket22d
class | HskPacket28c
class | HskPacket28d
class | HskPacket22e
class | HskPacket22f
class | HskPacket230
class | HskPacket231
class | HskPacket28e
class | HskPacket28f
class | HskPacket290
class | HskPacket291

Detailed Description

Module "HskPacket".
Generated on Fri Jul 21 13:27:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package HskPacketDecoder

Package HskPacketDecoder

Module "HskPacketDecoder". More...

Classes

class | ccsdsPacket
Interface to a generic CCSDS packet. More...
class | ccsdsHeader
CCSDS Header bitfield definition. More...
class | HskPacketBase

Functions

packetFactory (packet)

Detailed Description

Module "HskPacketDecoder".
Generated on Fri Jul 21 13:27:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package HskPacketRetriever

Package HskPacketRetriever

Module "HskPacketRetriever". More...

Classes

class HskPacketRetriever

Detailed Description

Module "HskPacketRetriever".
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package HskReceiver

Package HskReceiver

Module "HskReceiver". More...

Classes

class | HskSimpleTextReceiver
class | HskCfgTextReceiver

Functions

parseKeyFile (keyFile)
startup ()
usage ()

Detailed Description

Module "HskReceiver".
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package HskRecorder

Package HskRecorder

Module "HskRecorder". More...

Classes

class | HskAlarmRecorder
class | HskFileRecorder
class | HskPacketRecorder

Detailed Description

Module "HskRecorder".
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package HskRegisters

Package HskRegisters

Module "HskRegisters". More...

Classes

class | RegisterInterface
class | NodeRegisterList
class | AEQHskRegMap

Detailed Description

Module "HskRegisters".
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package HskRetriever

Package HskRetriever

Module "HskRetriever". More...

Classes

class | HskLatRetriever
class | HskTestRetriever

Detailed Description

Module "HskRetriever".
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package HskSqlGuiReceiver

Package HskSqlGuiReceiver

Module "HskSqlGuiReceiver". More...

Classes

class | QtReceiver
class | TrendPlotter
class | TimeAxisGen

Functions

memget ()
startup ()
startQT (sqlDB, timeDepth, keyList, source)
configParse (configFile)
usage ()

Detailed Description

Module "HskSqlGuiReceiver".
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package HskSqlInterface

Package HskSqlInterface

Module "HskSqlInterface". More...

Classes

class | HskSqlRecorder
class | HskSqlReceiver

Detailed Description

Module "HskSqlInterface".
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package HskSqlSvr

Package HskSqlSvr

Module "HskSqlSvr". More...

Functions

startup ()
testCollector (sqlDB)
alarmSetup (hskDB, cmdDB)
usage ()

Detailed Description

Module "HskSqlSvr".
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package HskSvr

Package HskSvr

Module "HskSvr". More...

Functions

alarmSetup (hskDB, cmdDB)
usage ()

Detailed Description

Module "HskSvr".
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package HskTestSvr

Package HskTestSvr

Module "HskTestSvr". More...

Functions

testCollector ()

Detailed Description

Module "HskTestSvr".
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package hTestAppEvt

Package hTestAppEvt

Module "hTestAppEvt". More...

Classes

class | myTKRcontributionIterator
class | myLATcomponentIterator
class | userArgument
class | userArgText
class | userApplication

Functions

_unsigned (arg)
Convert an unsigned int argument to an unsigned long.

Detailed Description

Module "hTestAppEvt".

Function Documentation

hTestAppEvt._unsigned ( arg )

Convert an unsigned int argument to an unsigned long.

This funtion exists to help format unsigned ints greater than 0x7fffffff, which in Python 2.4 and up will be displayed as signed strings.

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package hTestAppTkr

Package hTestAppTkr

Module "hTestAppTkr". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "hTestAppTkr".
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package hTestEnv

Package hTestEnv

Module "hTestEnv". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "hTestEnv".
Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package hTestStrip

Package hTestStrip

Module "hTestStrip". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "hTestStrip".
Generated on Fri Jul 21 13:27:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package imagedata

Package imagedata

Module "imagedata". More...

Detailed Description

Module "imagedata".
Generated on Fri Jul 21 13:27:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package LATsweep

Package LATsweep

Module "LATsweep". More...

Classes

class LATsweep

Detailed Description

Module "LATsweep".
Generated on Fri Jul 21 13:27:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package ldf2fits

Package ldf2fits

Module "ldf2fits". More...

Functions

__usage ()

Detailed Description

Module "ldf2fits".
Generated on Fri Jul 21 13:27:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package ldfContribution

Package ldfContribution

Module "ldfContribution". More...

Classes

class LdfContribution

Detailed Description

Module "ldfContribution".
Generated on Fri Jul 21 13:27:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package ldfFile

Package ldfFile

Module "ldfFile". More...

Classes

class LdfContributor

Detailed Description

Module "ldfFile".
Generated on Fri Jul 21 13:27:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package ldfSocket

Package ldfSocket

Module "ldfSocket". More...

Classes

class LdfContributor

Detailed Description

Module "ldfSocket".
Generated on Fri Jul 21 13:27:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package listmean

Package listmean

Module "listmean". More...

Functions

listmean (list, element, numsamples)

Detailed Description

Module "listmean".
Generated on Fri Jul 21 13:27:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package MailAlert

Package MailAlert

Module "MailAlert". More...

Classes

class | MailAlert
class | SLACmail
class | Email

Detailed Description

Module "MailAlert".
Generated on Fri Jul 21 13:27:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package mask

Package mask

Module "mask". More...

Classes

class mask

Detailed Description

Module "mask".
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package MiniGLTExample

Package MiniGLTExample

Interface for Coincidence based Trigger System. More...

Classes

class | MiniGLTExample
MiniTower example interface to MiniGLT. More...
class | MiniGLTTrgEngines
class | MiniGLTSolicitedEngine
class | MiniGLTSolicitedCondition
class | ZsupTrgReadout
ZsupTrgReadout class definition. More...

Detailed Description

Interface for Coincidence based Trigger System.
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package monitoringDbSyncIn

Package monitoringDbSyncIn

Module "monitoringDbSyncIn". More...

Functions

dumpVALfields (inFile, db)

Detailed Description

Module "monitoringDbSyncIn".
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package monitoringDbSyncOut

Package monitoringDbSyncOut

Module "monitoringDbSyncOut". More...

Functions

lockTransact (db, msg)
dateMnemSelect (db, start, end)
dumpVALfields (db, outFile, start, end)
findMinTime (db)
dumpTLMfields (db, outFile)
usage ()

Detailed Description

Module "monitoringDbSyncOut".

Function Documentation

monitoringDbSyncOut.dateMnemSelect | ( | db | ,
 |  | start | ,
 |  | end |
 | ) |

Returns all used mnemonics in a time period

monitoringDbSyncOut.lockTransact | ( | db | ,
 |  | msg |
 | ) |

Locking database transactor for INNODB databases

Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package MSGLogGUIImpl

Package MSGLogGUIImpl

Module "MSGLogGUIImpl". More...

Classes

class | LogRecordStreamHandler
class | MSGLogSocketReceiver
class | MSGLogGUIImpl

Functions

usage (msg)

Detailed Description

Module "MSGLogGUIImpl".
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package multibar

Package multibar

Module "multibar". More...

Classes

class multibar

Detailed Description

Module "multibar".
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package nullApp

Package nullApp

Module "nullApp". More...

Classes

class userApplication

Detailed Description

Module "nullApp".
Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package NullObjects

Package NullObjects

Classes

class | NullTower
class | NullCal
class | NullTkr
class | NoTowersEnabled
class | NoTilesEnabled
class | NoCnoEnabled
class | NoTowersBusy
class | NoExternal
class | NoInputsEnabled
class | NullRoi
class | NullCoincidence
class | NullEngine
class | NullRequest

Detailed Description

NullObjects: Interfaces for when there are no objects in the system

Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package parseFswHsk

Package parseFswHsk

Module "parseFswHsk". More...

Classes

class HskPacketWriter

Functions

readCATH (fileName, codeFile, sqlFile)
processTlmFld (node, codeFile)
processTlmPkt (node, codeFile, sqlFile)
processTlmPayload (node, packetCode)
processTlmITOS (node, packetCode)
processMnemonic (node, packetCode)
startHeader (codeFile)
endHeader (codeFile)

Detailed Description

Module "parseFswHsk".
Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package PorcinePanel

Package PorcinePanel

Module "PorcinePanel". More...

Classes

class | PorcineWindow
class | PorcinePanel
class | PorcineEvent
class | FabricPanel
class | FrontEndPowerPanel
class | GroupPanel
class | TowerPowerPanel
class | ACDPowerPanel
class | TowerPanel
class | CratePanel
class | GasuPanel
class | EMPanel
class | CheckLed
class | StatusLabel
class | ExclusiveButtonGroup

Functions

simple_test (args)

Detailed Description

Module "PorcinePanel".
Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package PowerPanelImpl

Package PowerPanelImpl

Module "PowerPanelImpl". More...

Classes

class PowerPanelImpl

Detailed Description

Module "PowerPanelImpl".
Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package radiomask

Package radiomask

Module "radiomask". More...

Classes

class radiomask

Detailed Description

Module "radiomask".
Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcArchiver

Package rcArchiver

Module "rcArchiver". More...

Classes

class rcArchiver
Event Archiver. More...

Detailed Description

Module "rcArchiver".
Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcCommentPanel

Package rcCommentPanel

Module "rcCommentPanel". More...

Classes

class | rcCommentPanel
class | CommentEntryWidget

Detailed Description

Module "rcCommentPanel".
Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcComplStatus

Package rcComplStatus

Module "rcComplStatus". More...

Classes

class rcCompletionStatus

Detailed Description

Module "rcComplStatus".
Generated on Fri Jul 21 13:27:49 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcDefaultTrigger

Package rcDefaultTrigger

Module "rcDefaultTrigger". More...

Classes

class | rcGEMDefaultTrigger
rcGEMDefaultTrigger More...
class | rcMiniGLTDefaultTrigger
rcMiniGLTDefaultTrigger More...
class | rcGEMTrgEngines
class | rcSolicitedEngine
class | rcSolicitedCondition
class | rcMiniGLTTrgEngines
class | rcMiniGLTSolicitedEngine
class | rcMiniGLTSolicitedCondition

Detailed Description

Module "rcDefaultTrigger".
Generated on Fri Jul 21 13:27:49 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcEndRunDlgImpl

Package rcEndRunDlgImpl

Module "rcEndRunDlgImpl". More...

Classes

class rcEndRunDlgImpl

Detailed Description

Module "rcEndRunDlgImpl".
Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcFitsWriter

Package rcFitsWriter

Module "rcFitsWriter". More...

Classes

class rcFitsWriter

Functions

getFileNameFromTS (ts)

Detailed Description

Module "rcFitsWriter".
Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcHouseKeeping

Package rcHouseKeeping

Module "rcHouseKeeping". More...

Classes

class rcHouseKeeping

Functions

getFileNameFromTS (ts)

Detailed Description

Module "rcHouseKeeping".
Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcLoginImpl

Package rcLoginImpl

Module "rcLoginImpl". More...

Classes

class rcLoginImpl

Detailed Description

Module "rcLoginImpl".
Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcParamVerifier

Package rcParamVerifier

Module "rcParamVerifier". More...

Classes

class rcParamVerifier

Detailed Description

Module "rcParamVerifier".
Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcParamVerifyGUIImpl

Package rcParamVerifyGUIImpl

Module "rcParamVerifyGUIImpl". More...

Classes

class rcParamVerifyGUIImpl
Parameter verifier GUI. More...

Detailed Description

Module "rcParamVerifyGUIImpl".
Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcPreferencesGUIImpl

Package rcPreferencesGUIImpl

Module "rcPreferencesGUIImpl". More...

Classes

class rcPreferencesGUIImpl

Detailed Description

Module "rcPreferencesGUIImpl".
Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcPreferencesManager

Package rcPreferencesManager

Module "rcPreferencesManager". More...

Classes

class | rcPreferencesManager
class | Preferences
Preferences dictionary Preferences needs a special dictionary class since the data it stores may have macros and environment variables in it. More...

Detailed Description

Module "rcPreferencesManager".
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcPythonShell

Package rcPythonShell

Module "rcPythonShell". More...

Classes

class | rcPythonShell
class | PythonShellWidget

Detailed Description

Module "rcPythonShell".
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcReportGen

Package rcReportGen

Module "rcReportGen". More...

Classes

class rcReportGen

Detailed Description

Module "rcReportGen".
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcRunIdHelper

Package rcRunIdHelper

Module "rcRunIdHelper". More...

Classes

class rcRunIdHelper

Detailed Description

Module "rcRunIdHelper".
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcScmCfgSelector

Package rcScmCfgSelector

Module "rcScmCfgSelector". More...

Classes

class | rcScmCfgSelector
class | rcScmCfgSelText

Detailed Description

Module "rcScmCfgSelector".
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcSecurityMan

Package rcSecurityMan

Module "rcSecurityMan". More...

Classes

class rcSecurityMan

Detailed Description

Module "rcSecurityMan".
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcStatusMonitor

Package rcStatusMonitor

Module "rcStatusMonitor". More...

Classes

class | ListViewToolTip
class | StatusItem
class | WatchItem
class | rcStatusPanel
class | rcStatusMonitor

Detailed Description

Module "rcStatusMonitor".
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcSuite

Package rcSuite

Module "rcSuite". More...

Classes

class rcSuite

Detailed Description

Module "rcSuite".
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcTestReport

Package rcTestReport

Module "rcTestReport". More...

Classes

class rcTestReport
Test Report class for RunControl. More...

Detailed Description

Module "rcTestReport".
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcTransitions

Package rcTransitions

Module "rcTransitions". More...

Classes

class rcTransitions

Detailed Description

Module "rcTransitions".
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcTransitionsBT

Package rcTransitionsBT

Module "rcTransitionsBT". More...

Classes

class rcTransitionsBT

Detailed Description

Module "rcTransitionsBT".
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcTrgFunctions

Package rcTrgFunctions

Classes

class | rcTrgEngines
rcTrgEngines Class More...
class | SweepMarkerEngine
SweepMarkerEngine class. More...
class | rcTrgInjectMarker
class | rcTrgTileEnables
rcTrgTileEnables class More...
class | rcTrgCoincidence
rcTrgCoincidence class More...
class | rcTrgTowerBusyEnables
rcTrgTowerBusyEnables class More...

Detailed Description

rcTrgFunctions: Run control Interfaces for Trigger modules

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcTrgGem

Package rcTrgGem

Classes

class rcTrgGem
rcTrgGem class definition This class implements a 'threaded' model for enabling/disabling the trigger More...

Detailed Description

rcTrgGem: This class implements a 'threaded' model for enabling/disabling the trigger

Generated on Fri Jul 21 13:27:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcTrgMiniGLT

Package rcTrgMiniGLT

Classes

class rcTrgMiniGLT
rcTrgMiniGLT class definition This class implements a 'threaded' model for enabling/disabling the trigger More...

Detailed Description

rcTrgMiniGLT: This class implements a 'threaded' model for enabling/disabling the trigger

Generated on Fri Jul 21 13:27:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcUsers

Package rcUsers

Module "rcUsers". More...

Classes

class | rcUser
class | rcUsers

Detailed Description

Module "rcUsers".
Generated on Fri Jul 21 13:27:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package rcUtil

Package rcUtil

Module "rcUtil". More...

Classes

class Reloader

Functions

importModule (appName, reload=1, dontReloadList=[], showUnloadedModules=0)

Detailed Description

Module "rcUtil".

Function Documentation

rcUtil.importModule | ( | appName | ,
 |  | reload | = 1,
 |  | dontReloadList | = [],
 |  | showUnloadedModules | = 0
 | ) |

Import a RunControl application or suite

Parameters:
appName | Name of the module or pathname of the python script
reload | 1 = Reload all modules that have been loaded since RunControl started (default) 0 = Do not reload modules (used if a suite is being loaded)
dontReloadList | Optional parameter which specifies the additional list of module prefixes that should not be reloaded. If this parameter is missing then the default list (Reloader.DONT_RELOAD_LIST) is used, if it is specified then it gets appended to the default list.
Returns:
The name of the module and the resolved pathname

Generated on Fri Jul 21 13:27:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package Receiver

Package Receiver

Module "Receiver". More...

Classes

class | Receiver
Abstract Receiver class. More...
class | UDPReceiver
UDPReceiver class. More...

Detailed Description

Module "Receiver".
Generated on Fri Jul 21 13:27:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package Recorder

Package Recorder

Module "Recorder". More...

Classes

class | Recorder
Recorder class. More...
class | DummyRecorder
Example recorder that dumps the trendables to a logger. More...
class | FlatFileRecorder
class | UDPRecorder
Example recorder that UDP broadcasts trendables. More...

Detailed Description

Module "Recorder".
Generated on Fri Jul 21 13:27:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package Retriever

Package Retriever

Module "Retriever". More...

Classes

class | Retriever
class | DummyRetriever

Detailed Description

Module "Retriever".
Generated on Fri Jul 21 13:27:59 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package robustapply

Package robustapply

Functions

function (receiver)
robustApply (receiver, arguments, named)

Detailed Description

Robust apply mechanism

Provides a function "call", which can sort out what arguments a given callable object can take, and subset the given arguments to match only those which are acceptable.

Function Documentation

robustapply.function ( receiver )

Get function-like callable object for given receiver

returns (function_or_method, codeObject, fromMethod)

If fromMethod is true, then the callable already has its first argument bound

robustapply.robustApply | ( | receiver | ,
 |  | arguments | ,
 |  | named |
 | ) |

Call receiver with arguments and an appropriate subset of named

Generated on Fri Jul 21 13:27:59 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package RunControl

Package RunControl

Module "RunControl". More...

Classes

class | ConnectState
class | RunControl

Detailed Description

Module "RunControl".
Generated on Fri Jul 21 13:27:59 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package RunControlCommon

Package RunControlCommon

Module "RunControlCommon". More...

Classes

class | GDBN
Database node record. More...
class | RunControlSocketHandler
class | ErrorLogCounterHandler
class | RunControlFileHandler
FileHandler class for handling multiple line log entries. More...
class | RunControlCommon

Detailed Description

Module "RunControlCommon".
Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package RunControlFSM

Package RunControlFSM

Module "RunControlFSM". More...

Classes

class RunControlFSM

Detailed Description

Module "RunControlFSM".
Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package RunControlGUIImpl

Package RunControlGUIImpl

Module "RunControlGUIImpl". More...

Classes

class | RunControlGUIImpl
class | rcFileSelector

Detailed Description

Module "RunControlGUIImpl".
Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package RunControlMain

Package RunControlMain

Module "RunControlMain". More...

Classes

class | ConnectState
class | RunControlMain

Detailed Description

Module "RunControlMain".
Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package RunControlMainGUIImpl

Package RunControlMainGUIImpl

Module "RunControlMainGUIImpl". More...

Classes

class | RunControlMainGUIImpl
class | rcFileSelector

Detailed Description

Module "RunControlMainGUIImpl".
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package saferef

Package saferef

Classes

class BoundMethodWeakref

Functions

safeRef (target, onDelete=None)

Detailed Description

Refactored "safe reference" from dispatcher.py

Function Documentation

saferef.safeRef | ( | target | ,
 |  | onDelete | = None
 | ) |

Return a *safe* weak reference to a callable target

target -- the object to be weakly referenced, if it's a bound method reference, will create a BoundMethodWeakref, otherwise creates a simple weakref. onDelete -- if provided, will have a hard reference stored to the callable to be called after the safe reference goes out of scope with the reference object, (either a weakref or a BoundMethodWeakref) as argument.

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package ServerPreferencesImpl

Package ServerPreferencesImpl

Module "ServerPreferencesImpl". More...

Classes

class ServerPreferencesImpl

Detailed Description

Module "ServerPreferencesImpl".
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package SimpleGasuExample

Package SimpleGasuExample

Interface for Coincidence based Trigger System. More...

Classes

class | SimpleGasuExample
SimpleGASU example interface to GEM. More...
class | SGETrgInputEnables
class | SGETrgEngines
class | SolicitedEngine
class | SolicitedCondition
class | ZsupTrgReadout
ZsupTrgReadout class definition. More...

Detailed Description

Interface for Coincidence based Trigger System.
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package socketLogging

Package socketLogging

Module "socketLogging". More...

Classes

class MyLogSocketHandler

Functions

socketLogging (logHost, logLevel, port=ALARM_TCP_LOGGING_PORT)

Detailed Description

Module "socketLogging".
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package socketMerge

Package socketMerge

Module "socketMerge". More...

Classes

class Merger

Functions

getHostPort (option)
main (options)
usage ()
Return a program usage message.

Detailed Description

Module "socketMerge".
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package splitOutTem

Package splitOutTem

Module "splitOutTem". More...

Classes

class | myLATcomponentIterator
class | myLATdbIterator
class | userArgument
class | userArgText
class | userApplication

Functions

_unsigned (arg)
Convert an unsigned int argument to an unsigned long.

Detailed Description

Module "splitOutTem".

Function Documentation

splitOutTem._unsigned ( arg )

Convert an unsigned int argument to an unsigned long.

This funtion exists to help format unsigned ints greater than 0x7fffffff, which in Python 2.4 and up will be displayed as signed strings.

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package standardLDF

Package standardLDF

Module "standardLDF". More...

Classes

class | LATcomponentIterator
class | CALcontributionIterator
class | TKRcontributionIterator
class | AEMcontributionIterator
class | OSWcontributionIterator
class | DIAGcontributionIterator
class | GEMcontribution
class | LATcontributionIterator
class | EBFeventIterator

Functions

hexdump (chars, sep, width)
quotechars (chars)

Detailed Description

Module "standardLDF".
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package standardPlotter

Package standardPlotter

Module "standardPlotter". More...

Classes

class | standardPlotter
class | standardTestReport

Detailed Description

Module "standardPlotter".
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package standardPlotterGuiImpl

Package standardPlotterGuiImpl

Module "standardPlotterGuiImpl". More...

Classes

class standardPlotterGuiImpl

Detailed Description

Module "standardPlotterGuiImpl".
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package startupGUI

Package startupGUI

Module "startupGUI". More...

Functions

startup ()

Detailed Description

Module "startupGUI".
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package startupMainGUI

Package startupMainGUI

Module "startupMainGUI". More...

Functions

startupMainGui ()
initstyle (rcCommon)

Detailed Description

Module "startupMainGUI".

Function Documentation

startupMainGUI.startupMainGui ( )

Start up run control.

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package suiteRunner

Package suiteRunner

Module "suiteRunner". More...

Detailed Description

Module "suiteRunner".
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package sweepRejectTest

Package sweepRejectTest

Module "sweepRejectTest". More...

Classes

class | userArgument
class | userArgText
class | userApplication
class | BadGasuExample
BadGasuExample. More...
class | BadGLTExample
MiniTower example interface to MiniGLT. More...

Detailed Description

Module "sweepRejectTest".
Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package taskEngine

Package taskEngine

Module "taskEngine". More...

Classes

class | TaskEngine
class | TaskEngineTestCase

Functions

_unbound1 (a, b, c, x, y, z)
_doException ()
_unbound2 ()
suite ()
test ()

Detailed Description

Module "taskEngine".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package temLrsTest

Package temLrsTest

Module "temLrsTest". More...

Classes

class userApplication

Detailed Description

Module "temLrsTest".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_aem

Package test_aem

Module "test_aem". More...

Functions

test_aem ()

Detailed Description

Module "test_aem".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_aeq

Package test_aeq

Module "test_aeq". More...

Detailed Description

Module "test_aeq".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_bcast

Package test_bcast

Functions

test (c=None, disconnectOnExit=1)

Detailed Description

TEM test Contents: Script for testing TEM

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_cmd

Package test_cmd

Functions

test (cmd=None, disconnectOnExit=True)

Detailed Description

Test script for commanding Contents: Sample script for testing write command throughput

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_cmdrsp

Package test_cmdrsp

Module "test_cmdrsp". More...

Functions

test_cmdrsp ()

Detailed Description

Module "test_cmdrsp".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_cmxasbuilt

Package test_cmxasbuilt

Module "test_cmxasbuilt". More...

Functions

test_cmdrsp ()

Detailed Description

Module "test_cmxasbuilt".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_db

Package test_db

Classes

class GTest

Functions

test (cmd=None, disconnectOnExit=True)

Detailed Description

Test script for commanding Contents: Sample script for testing commanding throughput

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_evt_aem

Package test_evt_aem

Functions

test (cmd=None, debug=0, count=10000, disconnectOnExit=1, parse=1, lowlevel=0)

Detailed Description

Test script for taking AEM events

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_evt_cal

Package test_evt_cal

Classes

class | MiniGLTExample
MiniTower example interface to MiniGLT. More...
class | MiniGLTTrgEngines
class | MiniGLTSolicitedEngine
class | MiniGLTSolicitedCondition
class | ZsupTrgInjectChargeReadout
ZsupTrgReadout class definition. More...
class | ZsupSolicitedEngine

Functions

test (cmd=None, debug=0, count=10000, disconnectOnExit=1, parse=1, lowlevel=0)

Detailed Description

Test script for measuring event taking throughput.

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_evt_exttrg

Package test_evt_exttrg

Classes

class | GasuExtTrg
class | GasuExtTrgEngine
class | MiniGltExtTrg
class | MiniGltTrgEngine

Functions

__init__ (self)
external (self)
test (cmd=None, debug=0, disconnectOnExit=1, parse=1, lowlevel=0)

Detailed Description

Test script for external trigger functionality.

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_evt_filters

Package test_evt_filters

Functions

test (cmd=None, debug=0, count=10, disconnectOnExit=1)
countEvents (count, printSize=False)
testEHSendErrors (test, count)
testEHSendNothing (test, count)
testEHSendPrescale (test, count, prescale)
testEHFilterTkrHits (test, count, prescale)
testEHSendAcd (test, count, marker, prescale)
testEHSendAll (test, count)

Detailed Description

Test of callbacks in OES

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_evt_tkr

Package test_evt_tkr

Classes

class ZsupSolicitedEngine

Functions

test (cmd=None, debug=0, count=10000, disconnectOnExit=1, parse=1, lowlevel=0)

Detailed Description

Test script for taking TKR events

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_gafe

Package test_gafe

Module "test_gafe". More...

Functions

test_gafe ()

Detailed Description

Module "test_gafe".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_garc

Package test_garc

Module "test_garc". More...

Functions

test_garc ()

Detailed Description

Module "test_garc".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_glt

Package test_glt

Module "test_glt". More...

Functions

test_glt ()

Detailed Description

Module "test_glt".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_initfabrics

Package test_initfabrics

Module "test_initfabrics". More...

Functions

test_initfabrics ()

Detailed Description

Module "test_initfabrics".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_lat

Package test_lat

Module "test_lat". More...

Functions

test_lat ()

Detailed Description

Module "test_lat".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_loopback

Package test_loopback

Module "test_loopback". More...

Classes

class EvtCli

Detailed Description

Module "test_loopback".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_mem

Package test_mem

Module "test_mem". More...

Functions

test_lat ()

Detailed Description

Module "test_mem".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_options

Package test_options

Module "test_options". More...

Functions

test_cmdrsp ()

Detailed Description

Module "test_options".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_pduswitch

Package test_pduswitch

Module "test_pduswitch". More...

Classes

class PduSwitch

Detailed Description

Module "test_pduswitch".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_peq

Package test_peq

Module "test_peq". More...

Functions

is_vmon (adc)
is_rtd (adc)

Detailed Description

Module "test_peq".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_playback

Package test_playback

Module "test_playback". More...

Classes

class Playback

Functions

test_playback ()

Detailed Description

Module "test_playback".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_power

Package test_power

Module "test_power". More...

Functions

test_power (args)

Detailed Description

Module "test_power".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_rate

Package test_rate

Module "test_rate". More...

Functions

test_rate ()

Detailed Description

Module "test_rate".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_schema

Package test_schema

Module "test_schema". More...

Functions

test_schema ()

Detailed Description

Module "test_schema".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_tem

Package test_tem

Functions

test (c=None, disconnectOnExit=1)

Detailed Description

TEM test Contents: Script for testing TEM

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_teq

Package test_teq

Module "test_teq". More...

Detailed Description

Module "test_teq".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package test_twoclients

Package test_twoclients

Module "test_twoclients". More...

Functions

test_twoclients ()

Detailed Description

Module "test_twoclients".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testAppAcd

Package testAppAcd

Module "testAppAcd". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "testAppAcd".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testAppAcdScalers

Package testAppAcdScalers

Module "testAppAcdScalers". More...

Classes

class | userArgument
class | userArgText
class | userApplication
class | MiniGLTExample
MiniTower example interface to MiniGLT. More...
class | MiniGLTTrgEngines
class | MiniGLTSolicitedEngine
class | MiniGLTSolicitedCondition
class | MarkerTrgReadout
MarkerTrgReadout class definition. More...
class | LDBI_LATcontributionIterator_
LDBI_LATcontributionIterator implementation. More...
class | SimpleGasuExample
SimpleGASU example interface to GEM. More...
class | SGETrgInputEnables
class | SGETrgEngines
class | SolicitedEngine
class | SolicitedCondition
class | FullCondition
class | FullEngine

Detailed Description

Module "testAppAcdScalers".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testAppAlarm

Package testAppAlarm

Module "testAppAlarm". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "testAppAlarm".
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testAppArchiver

Package testAppArchiver

Module "testAppArchiver". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "testAppArchiver".
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testAppCal

Package testAppCal

Module "testAppCal". More...

Classes

class | userArgument
class | userArgText
class | userApplication
class | userApplicationCallbacks

Detailed Description

Module "testAppCal".
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testAppCal_dg

Package testAppCal_dg

Module "testAppCal_dg". More...

Classes

class | CAL_LATcontribution
class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "testAppCal_dg".
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testAppEvt

Package testAppEvt

Module "testAppEvt". More...

Classes

class | myLATcomponentIterator
class | userArgument
class | userArgText
class | userApplication

Functions

_unsigned (arg)
Convert an unsigned int argument to an unsigned long.

Detailed Description

Module "testAppEvt".

Function Documentation

testAppEvt._unsigned ( arg )

Convert an unsigned int argument to an unsigned long.

This funtion exists to help format unsigned ints greater than 0x7fffffff, which in Python 2.4 and up will be displayed as signed strings.

Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testAppEvtCli

Package testAppEvtCli

Module "testAppEvtCli". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "testAppEvtCli".
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testAppEvtTO

Package testAppEvtTO

Module "testAppEvtTO". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "testAppEvtTO".
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testAppExclude

Package testAppExclude

Module "testAppExclude". More...

Classes

class userApplication

Detailed Description

Module "testAppExclude".
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testAppLDFdump

Package testAppLDFdump

Module "testAppLDFdump". More...

Classes

class | LATcomponentIterator
class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "testAppLDFdump".
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testAppMinimal

Package testAppMinimal

Module "testAppMinimal". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "testAppMinimal".
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testAppNoVersion

Package testAppNoVersion

Module "testAppNoVersion". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "testAppNoVersion".
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testAppReport

Package testAppReport

Module "testAppReport". More...

Classes

class userApplication

Detailed Description

Module "testAppReport".
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testAppTkr

Package testAppTkr

Module "testAppTkr". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "testAppTkr".
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testArchiver

Package testArchiver

Module "testArchiver". More...

Classes

class testArchiver

Detailed Description

Module "testArchiver".
Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testErrorPropogation

Package testErrorPropogation

Module "testErrorPropogation". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "testErrorPropogation".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testEvtBldr_script

Package testEvtBldr_script

Module "testEvtBldr_script". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "testEvtBldr_script".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testEvtCli

Package testEvtCli

Module "testEvtCli". More...

Classes

class testEvtCli

Detailed Description

Module "testEvtCli".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testPreload

Package testPreload

Module "testPreload". More...

Classes

class GEGU_test

Detailed Description

Module "testPreload".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testRunner

Package testRunner

Module "testRunner". More...

Detailed Description

Module "testRunner".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testSAppCal

Package testSAppCal

Module "testSAppCal". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "testSAppCal".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testSAppCal_Lean

Package testSAppCal_Lean

Module "testSAppCal_Lean". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "testSAppCal_Lean".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testSAppEvt

Package testSAppEvt

Module "testSAppEvt". More...

Classes

class | myLATcomponentIterator
class | userArgument
class | userArgText
class | userApplication

Functions

_unsigned (arg)
Convert an unsigned int argument to an unsigned long.

Detailed Description

Module "testSAppEvt".

Function Documentation

testSAppEvt._unsigned ( arg )

Convert an unsigned int argument to an unsigned long.

This funtion exists to help format unsigned ints greater than 0x7fffffff, which in Python 2.4 and up will be displayed as signed strings.

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testSuite

Package testSuite

Module "testSuite". More...

Classes

class | userSuite
class | userSuiteCallbacks

Detailed Description

Module "testSuite".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testSuite2

Package testSuite2

Module "testSuite2". More...

Classes

class userSuite

Detailed Description

Module "testSuite2".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testSuite_Lean

Package testSuite_Lean

Module "testSuite_Lean". More...

Classes

class userSuite

Detailed Description

Module "testSuite_Lean".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testSuiteLong

Package testSuiteLong

Module "testSuiteLong". More...

Classes

class userSuite

Detailed Description

Module "testSuiteLong".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testSuiteSummary

Package testSuiteSummary

Module "testSuiteSummary". More...

Classes

class userSuite

Detailed Description

Module "testSuiteSummary".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testSummary

Package testSummary

Module "testSummary". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "testSummary".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testTkrHitFilter

Package testTkrHitFilter

Module "testTkrHitFilter". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "testTkrHitFilter".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testTrending

Package testTrending

Module "testTrending". More...

Classes

class | QtReceiver
class | TrendTestGUI
class | TrendTree
class | TrendPlotter
class | FancyTrendTree

Functions

testQtReceiver (args)
testReceiver ()

Detailed Description

Module "testTrending".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package testTrgParityError

Package testTrgParityError

Module "testTrgParityError". More...

Classes

class userApplication

Detailed Description

Module "testTrgParityError".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package towerwidgetImpl

Package towerwidgetImpl

Module "towerwidgetImpl". More...

Classes

class towerwidgetImpl

Detailed Description

Module "towerwidgetImpl".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package transitionRejectTest

Package transitionRejectTest

Module "transitionRejectTest". More...

Classes

class | userArgument
class | userArgText
class | userApplication

Detailed Description

Module "transitionRejectTest".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package Trendable

Package Trendable

Module "Trendable". More...

Classes

class | Trendable
class | TrendLimit

Detailed Description

Module "Trendable".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrendMaps

Package TrendMaps

Module "TrendMaps". More...

Classes

class | TrendMapBase
class | GHSKTrendMap
class | GLATTrendMap
class | ReverseTrendMap

Functions

makeSimpleMap (trendables, trendMap)

Detailed Description

Module "TrendMaps".
Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgAbstract

Package TrgAbstract

Classes

class TrgAbstract
Abstract trigger interface class definition. More...

Detailed Description

TrgAbstract: Interface for Coincidence based Trigger System

Generated on Fri Jul 21 13:28:06 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgCmdCounters

Package TrgCmdCounters

Classes

class | TrgCmdCounters
TrgCmdCounters class. More...
class | TrgCmdStats
TrgCmdStats class. More...

Detailed Description

TrgCmdCounters: Interface for Command Response system

Generated on Fri Jul 21 13:28:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgCnoCounters

Package TrgCnoCounters

Classes

class | TrgCnoCounters
TrgCnoCounters class definition This class controls the counters used to count ACD Cno transitions. More...
class | TrgCnoStats
TrgCnoStats class definition This class specifies the statistics returned by the counters described by TrgCnoCounters. More...

Detailed Description

TrgCnoCounters: Trigger GEM Cno counter abstract class

Generated on Fri Jul 21 13:28:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgCoincidences

Package TrgCoincidences

Classes

class | TrgRois
Trigger ROI (Region of Interest) list class definition. More...
class | TrgRoi
Trigger ROI (Region of Interest) class definition. More...
class | TrgCoincidences
Trigger Coincidences class definition. More...
class | TrgCoincidence
Trigger Coincidence class definition This class defines the set of tiles which will constitute any one coincidence. More...

Detailed Description

TrgCoincidences: Interface for Trigger Coincidence classes

Generated on Fri Jul 21 13:28:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgConditions

Package TrgConditions

Classes

class TrgConditions
Trigger Conditions Value class definition This class is used to define one combinatoric of the 128 possible conditions. More...

Detailed Description

TrgConditions: Interface for Trigger Conditions

Generated on Fri Jul 21 13:28:12 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgConditionsValue

Package TrgConditionsValue

Module "TrgConditionsValue". More...

Classes

class TrgConditionsValue
Trigger Conditions Value class definition. More...

Detailed Description

Module "TrgConditionsValue".
Generated on Fri Jul 21 13:28:13 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package trgConsumer

Package trgConsumer

Module "trgConsumer". More...

Classes

class | trgLATcomponentIterator
class | trgConsumer

Detailed Description

Module "trgConsumer".
Generated on Fri Jul 21 13:28:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package trgDisplayImpl

Package trgDisplayImpl

Module "trgDisplayImpl". More...

Classes

class | eventThread
class | trgDisplayImpl

Functions

disconnectcmdcli ()

Detailed Description

Module "trgDisplayImpl".
Generated on Fri Jul 21 13:28:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgEngines

Package TrgEngines

Classes

class | TrgEngines
Trigger Engines class definition A Trigger Engine defines what the Trigger System does when it detects a triggerable condition within the LAT. More...
class | TrgEngine
Trigger Engine class definition The user inherits from this class to customize their own Trigger Engines. The user must satisfy the member function 'request', which returns an object of type TrgEngineRequest. The user must satisfy the member function 'prescale', which returns an integer. More...
class | TrgEngineRequest
Trigger Engine Request class definition The TrgEngineRequest class is used to specify the parameterization of the Trigger Message associated with a given engine. More...
class | TrgInjectCharge
TrgInjectCharge class definition. More...
class | TrgReadout
TrgReadout class definition. More...
class | TrgInjectChargeReadout
Trigger Inject Charge Readout class definition. More...
class | TrgInjectMarker
Trigger Inject Marker class definition Directs a module to send to its Front-End Electronics a command sequence which is composed of only a TACK command. This sequence will trigger a readout of the module's Front-End Electronics. More...

Detailed Description

TrgEngines: Interface for the Trigger Engine classes

Generated on Fri Jul 21 13:28:15 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgEventCounter

Package TrgEventCounter

Classes

class TrgEventCounter
TrgEventCounter class. More...

Detailed Description

TrgEventCounter: Interface for event counters.

Generated on Fri Jul 21 13:28:19 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgGem

Package TrgGem

Classes

class TrgGem
Trigger Global Trigger Electronics Module Interface class definition This class implements the hardware register access to the GEM. More...

Detailed Description

TrgGem: This file implements the hardware register access to the GEM

Generated on Fri Jul 21 13:28:19 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgGemAbstract

Package TrgGemAbstract

Classes

class TrgGemAbstract
Trigger Global trigger Electronics Module Interface class definition. More...

Detailed Description

TrgGemAbstract: Abstract interface for GEM based systems.

Generated on Fri Jul 21 13:28:20 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgGemCounters

Package TrgGemCounters

Classes

class | TrgGemTriggerCounters
TrgGemTriggerCounters class. More...
class | TrgGemTriggerStats
TrgGemTriggerStats This class implements the HW abstraction corresponding to figure 66-69 of the GEM document: LAT-01545 Section 2.6.1 and 2.6.2. More...
class | TrgGemTileCounters
TrgGemTileCounters. More...
class | TrgGemTileStats
TrgGemTileStats. More...
class | TrgGemCnoCounters
TrgGemCnoCounters. More...
class | TrgGemCnoStats
TrgGemCnoStats. More...
class | TrgGemCmdCounters
TrgGemCmdCounters. More...
class | TrgGemCmdStats
TrgGemCmdStats. More...
class | TrgGemEventCounter
TrgGemEventCounter. More...
class | TrgGemPPSTimer
TrgGemPPSTimer class definition This class HW abstraction corresponding to figure 75 of the GEM document: LAT-01545 Section 2.6.4. More...

Detailed Description

TrgGemCounters: Trigger GEM counter hardware implementation class

Generated on Fri Jul 21 13:28:20 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgGemPeriodicCondition

Package TrgGemPeriodicCondition

Classes

class TrgGemPeriodicCondition
Trigger Periodic Condition class definition. More...

Detailed Description

TrgGemPeriodicCondition: Hardware implementation of TrgPeriodicCondition

Generated on Fri Jul 21 13:28:24 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgGemRegisterGeometry

Package TrgGemRegisterGeometry

Classes

class ACDmap

Detailed Description

TrgGemRegisterGeometry: Define the mapping between tile number and tile name

Generated on Fri Jul 21 13:28:25 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgGemRegisters

Package TrgGemRegisters

Classes

class TrgGemRegisters
TrgGemRegisters class definition. More...

Detailed Description

TrgGemRegisters: Register shape defintions for a GASU trigger system

Generated on Fri Jul 21 13:28:25 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgGemSequence

Package TrgGemSequence

Classes

class TrgGemSequence
TrgGemSequence Hardware abstraction for TrgSequence. More...

Detailed Description

TrgGemSequence: Hardware implementation of TrgSequence

Generated on Fri Jul 21 13:28:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgInputEnables

Package TrgInputEnables

Classes

class | TrgInputEnables
Trigger Input Enables class definition. More...
class | TrgTowerEnables
Trigger Tower Enables class definition. More...
class | TrgCnoEnables
Trigger CNO Enables class definition. More...
class | TrgTileEnables
Trigger Tile Enables class definition. More...
class | TrgTowerBusyEnables
Trigger Tower Busy Enables class definition. More...
class | TrgExtEnables
Trigger External Enables class definition. More...

Detailed Description

TrgInputEnables: Interface for Trigger Input Enables

Generated on Fri Jul 21 13:28:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgMiniGLT

Package TrgMiniGLT

Classes

class | TrgMiniGLT
Mini GLT Hardware abstraction implementation. More...
class | MiniGLTTrgConditionsValue

Detailed Description

TrgMiniGLT: This file implements the hardware register access to the MiniGLT

Generated on Fri Jul 21 13:28:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgMiniGLTAbstract

Package TrgMiniGLTAbstract

Classes

class TrgMiniGLTAbstract
TrgMiniGLTAbstract Interface class definition This class inherits from TrgAbstract to define the structure of a MiniGLT trigger. More...

Detailed Description

TrgMiniGLTAbstract: Abstract interface for MiniGLT based systems.

Generated on Fri Jul 21 13:28:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgMiniGLTRegisters

Package TrgMiniGLTRegisters

Classes

class TrgMiniGLTRegisters
Register shape definition class for the MiniGLT This class defines the shapes of the registers and bitfields used in the MiniGLT. More...

Detailed Description

TrgMiniGLTRegisters: Register shape definitions for a MiniGLT based trigger system

Generated on Fri Jul 21 13:28:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgObject

Package TrgObject

Classes

class TrgObject
Trigger Object class definition. More...

Detailed Description

TrgObject: Base class for the trigger. Defines useful quantities

Generated on Fri Jul 21 13:28:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgPeriodic

Package TrgPeriodic

Classes

class | TrgPeriodicConditionAbstract
TrgPeriodicConditionAbstract class definition. More...
class | TrgPeriodicCondition
Trigger Periodic Condition class definition. More...
class | TrgPeriodicConditionDefinition
TrgPeriodicConditionDefinition class definition. More...
class | TrgDefaultPeriodicCondition
TrgDefaultPeriodicCondition class definition. More...

Detailed Description

TrgPeriodic: Interface for the Periodic Trigger

Generated on Fri Jul 21 13:28:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgPPSTimer

Package TrgPPSTimer

Classes

class TrgPPSTimer
TrgPPSTimer class definition This class controls the GEM's 1-PPS timer. More...

Detailed Description

TrgPPSTimer: Abstract interface to 1-PPS timer

Generated on Fri Jul 21 13:28:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgRoiAsTiles

Package TrgRoiAsTiles

Classes

class | TrgRoiAsTiles
Class TrgRoiAsTiles LATTE provided class to map coincidences to ROIs. More...
class | AddableRoi

Detailed Description

TrgRoiAsTiles: Map coincidences to Regions of Interest

Generated on Fri Jul 21 13:28:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgRoiAsVeto

Package TrgRoiAsVeto

Classes

class | TrgRoiAsVeto
class | MyRoi

Detailed Description

TrgRoiAsVeto: Implement an ROI based veto system.

Generated on Fri Jul 21 13:28:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgSequence

Package TrgSequence

Classes

class | TrgSequenceAbstract
Abstract Trigger Sequence class definition. More...
class | TrgSequenceDefinition
Trigger Sequence Definition class definition. More...
class | TrgSequence
Trigger Sequence class definition. More...
class | TrgDefaultSequence

Detailed Description

TrgSequence: Interface for Trigger Sequences

Generated on Fri Jul 21 13:28:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgTileCounters

Package TrgTileCounters

Classes

class | TrgTileCounters
TrgTileCounters class definition This class controls the counters used to count ACD tile transitions. More...
class | TrgTileStats
TrgTileStats class definition This class specifies the statistics returned by the counters described by TrgTileCounters. More...

Detailed Description

TrgTileCounters: Trigger GEM tile counter abstract class

Generated on Fri Jul 21 13:28:36 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgTower

Package TrgTower

Classes

class | TrgTowers
Trigger Towers class definition. More...
class | TrgTower
Trigger Tower class definition. More...
class | TrgCalorimeter
Trigger Calorimeter class definition. More...
class | TrgTracker
Trigger Tracker class definition. More...

Detailed Description

TrgTower: Abstract interfaces for Trigger Tower classes

Generated on Fri Jul 21 13:28:37 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgTriggerCounters

Package TrgTriggerCounters

Classes

class | TrgTriggerCounters
TrgTriggerCounters class definition This class controls the counters associated with the performance of the LAT with respect to the Trigger System. More...
class | TrgTriggerStats
TrgTriggerStats This class specifies the statistics returned by the counters defined in TrgTriggerCounters. More...

Detailed Description

TrgTriggerCounters: Abstract interface to trigger counters

Generated on Fri Jul 21 13:28:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package TrgUsingTiles

Package TrgUsingTiles

Classes

class | TrgUsingTiles
Trigger Using Tiles class definition. More...
class | DefaultPeriodicCondition
DefaultPeriodicCondition class. More...
class | DefaultSequence

Detailed Description

TrgUsingTiles: Implementation of a tile-based trigger system

Generated on Fri Jul 21 13:28:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package userAppBrowser

Package userAppBrowser

Module "userAppBrowser". More...

Classes

class | userModule
class | userAppBrowser
class | panelsTest
class | rcTest

Functions

import_initfile (root, packagename, groupname)

Detailed Description

Module "userAppBrowser".
Generated on Fri Jul 21 13:28:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package userAppLeaf

Package userAppLeaf

Module "userAppLeaf". More...

Classes

class userAppLeaf
userApp Gui Leaf This is the class of a leaf in the userApp Gui Tree It contains both basic functionality as a leaf (mainly input selection functions) and functionality as a manager of application windows More...

Detailed Description

Module "userAppLeaf".
Generated on Fri Jul 21 13:28:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package userAppLoader

Package userAppLoader

Module "userAppLoader". More...

Classes

class | userAppLoader
class | palettes

Detailed Description

Module "userAppLoader".
Generated on Fri Jul 21 13:28:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Package userAppTree

Package userAppTree

Module "userAppTree". More...

Classes

class userAppTree

Detailed Description

Module "userAppTree".
Generated on Fri Jul 21 13:28:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Directory Hierarchy

LATTE Directories

This directory hierarchy is sorted roughly, but not completely, alphabetically:
  • browser
  • client
  • consumer
  • database
  • dispatch
  • gosed
  • logger
  • merger
    • test
      • file
      • socket
  • monitoring
    • tools
  • power
  • runcontrol
  • start
  • tests
    • apps
      • support
  • tools
  • trigger
Generated on Fri Jul 21 13:28:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/browser/ Directory Reference

browser

browser Directory Reference

Files

file | bar.py [code]
file | barw.py [code]
file | BrowserImpl.py [code]
file | browserPreferencesImpl.py [code]
file | doublehisto.py [code]
file | imagedata.py [code]
file | listmean.py [code]
file | mask.py [code]
file | multibar.py [code]
file | radiomask.py [code]
file | towerwidgetImpl.py [code]
file | trgConsumer.py [code]
file | trgDisplayImpl.py [code]
file | userAppBrowser.py [code]
file | userAppLeaf.py [code]
file | userAppLoader.py [code]
file | userAppTree.py [code]
Generated on Fri Jul 21 13:26:37 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/client/ Directory Reference

client

client Directory Reference

Files

file | gBits.py [code]
file | gCmdCli.py [code]
file | gCommand.py [code]
file | gEvtCli.py [code]
file | gException.py [code]
file | gFswMessages.py [code]
file | gLog.py [code]
file | gLoopback.py [code]
file | gNode.py [code]
file | gOcsMessages.py [code]
file | gOpcode.py [code]
file | gOptions.py [code]
file | gRegister.py [code]
file | gResponse.py [code]
file | gSocket.py [code]
Generated on Fri Jul 21 13:26:37 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/consumer/ Directory Reference

consumer

consumer Directory Reference

Files

file | consumer.py [code]
file | consumerPlotter.py [code]
file | standardLDF.py [code]
file | standardPlotter.py [code]
file | standardPlotterGuiImpl.py [code]
Generated on Fri Jul 21 13:26:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/database/ Directory Reference

database

database Directory Reference

Files

file | gAEM.py [code]
file | gAttr.py [code]
file | gConstraint.py [code]
file | gCRU.py [code]
file | gDb.py [code]
file | gEBM.py [code]
file | gEGU.py [code]
file | gEPU.py [code]
file | gFabrics.py [code]
file | gGEM.py [code]
file | gGLT.py [code]
file | gGroup.py [code]
file | gHdb.py [code]
file | gHSK.py [code]
file | gLAT.py [code]
file | gLCB.py [code]
file | gMem.py [code]
file | gNAT.py [code]
file | gOCS.py [code]
file | gPDU.py [code]
file | gPlumber.py [code]
file | gRule.py [code]
file | gSchemaConfig.py [code]
file | gSIU.py [code]
file | gTEM.py [code]
file | gTPG.py [code]
file | gVersions.py [code]
file | gXBR.py [code]
Generated on Fri Jul 21 13:26:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/dispatch/ Directory Reference

dispatch

dispatch Directory Reference

Files

file | dispatcher.py [code]
file | errors.py [code]
file | robustapply.py [code]
file | saferef.py [code]
Generated on Fri Jul 21 13:26:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/gosed/ Directory Reference

gosed

gosed Directory Reference

Files

file | colorScale.py [code]
file | GOSED_LDF.py [code]
file | GOSEDACDImpl.py [code]
file | GOSEDCALImpl.py [code]
file | GOSEDCALTKRImpl.py [code]
file | GOSEDDataImpl.py [code]
file | gosedImpl.py [code]
file | GOSEDPainter.py [code]
file | GOSEDPreferencesImpl.py [code]
file | GOSEDTKRImpl.py [code]
file | GOSEDTWRImpl.py [code]
file | GOTEDImpl.py [code]
file | ServerPreferencesImpl.py [code]
Generated on Fri Jul 21 13:26:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/logger/ Directory Reference

logger

logger Directory Reference

Files

file | AlertGuiImpl.py [code]
file | MSGLogGUIImpl.py [code]
file | socketLogging.py [code]
Generated on Fri Jul 21 13:26:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/merger/ Directory Reference

merger

merger Directory Reference

Directories

directory | test

Files

file | ancillaryContribution.py [code]
file | geb.py [code]
file | ldfContribution.py [code]
Generated on Fri Jul 21 13:26:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/merger/test/ Directory Reference

test Directory Reference

Directories

directory | file
directory | socket

Files

file | BTdump.py [code]
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/merger/test/file/ Directory Reference

file Directory Reference

Files

file | ancillaryFile.py [code]
file | fileMerge.py [code]
file | ldfFile.py [code]
Generated on Fri Jul 21 13:26:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/merger/test/socket/ Directory Reference

socket Directory Reference

Files

file | ancillarySocket.py [code]
file | ldfSocket.py [code]
file | socketMerge.py [code]
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/monitoring/ Directory Reference

monitoring

monitoring Directory Reference

Directories

directory | tools

Files

file | Collector.py [code]
file | HskAlarms.py [code]
file | HskCli.py [code]
file | HskCollector.py [code]
file | HskGuiReceiver.py [code]
file | HskPacket.py [code]
file | HskPacketDecoder.py [code]
file | HskPacketRetriever.py [code]
file | HskReceiver.py [code]
file | HskRecorder.py [code]
file | HskRegisters.py [code]
file | HskRetriever.py [code]
file | HskSqlGuiReceiver.py [code]
file | HskSqlInterface.py [code]
file | HskSqlSvr.py [code]
file | HskSvr.py [code]
file | HskTestSvr.py [code]
file | Receiver.py [code]
file | Recorder.py [code]
file | Retriever.py [code]
file | testTrending.py [code]
file | Trendable.py [code]
file | TrendMaps.py [code]
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/monitoring/tools/ Directory Reference

tools Directory Reference

Files

file | monitoringDbSyncIn.py [code]
file | monitoringDbSyncOut.py [code]
file | parseFswHsk.py [code]
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/power/ Directory Reference

power

power Directory Reference

Files

file | GpibPwrCtrlImpl.py [code]
file | PorcinePanel.py [code]
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/runcontrol/ Directory Reference

runcontrol

runcontrol Directory Reference

Files

file | AcdPanel.py [code]
file | ArgumentImpl.py [code]
file | EnvMonImpl.py [code]
file | evtDataImpl.py [code]
file | FEpowerUp.py [code]
file | fits2ldf.py [code]
file | FSM.py [code]
file | GlobalPanelImpl.py [code]
file | LATsweep.py [code]
file | ldf2fits.py [code]
file | PowerPanelImpl.py [code]
file | rcArchiver.py [code]
file | rcCommentPanel.py [code]
file | rcComplStatus.py [code]
file | rcEndRunDlgImpl.py [code]
file | rcFitsWriter.py [code]
file | rcHouseKeeping.py [code]
file | rcLoginImpl.py [code]
file | rcParamVerifier.py [code]
file | rcParamVerifyGUIImpl.py [code]
file | rcPreferencesGUIImpl.py [code]
file | rcPreferencesManager.py [code]
file | rcPythonShell.py [code]
file | rcReportGen.py [code]
file | rcRunIdHelper.py [code]
file | rcScmCfgSelector.py [code]
file | rcSecurityMan.py [code]
file | rcStatusMonitor.py [code]
file | rcSuite.py [code]
file | rcTestReport.py [code]
file | rcTransitions.py [code]
file | rcUsers.py [code]
file | rcUtil.py [code]
file | RunControl.py [code]
file | RunControlCommon.py [code]
file | RunControlFSM.py [code]
file | RunControlGUIImpl.py [code]
file | RunControlMain.py [code]
file | RunControlMainGUIImpl.py [code]
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/start/ Directory Reference

start

start Directory Reference

Files

file | startupGUI.py [code]
file | startupMainGUI.py [code]
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/tests/ Directory Reference

tests

tests Directory Reference

Directories

directory | apps

Files

file | test_aem.py [code]
file | test_aeq.py [code]
file | test_bcast.py [code]
file | test_cmd.py [code]
file | test_cmdrsp.py [code]
file | test_cmxasbuilt.py [code]
file | test_db.py [code]
file | test_evt_aem.py [code]
file | test_evt_cal.py [code]
file | test_evt_exttrg.py [code]
file | test_evt_filters.py [code]
file | test_evt_tkr.py [code]
file | test_gafe.py [code]
file | test_garc.py [code]
file | test_glt.py [code]
file | test_initfabrics.py [code]
file | test_lat.py [code]
file | test_loopback.py [code]
file | test_mem.py [code]
file | test_options.py [code]
file | test_pduswitch.py [code]
file | test_peq.py [code]
file | test_playback.py [code]
file | test_power.py [code]
file | test_rate.py [code]
file | test_schema.py [code]
file | test_tem.py [code]
file | test_teq.py [code]
file | test_twoclients.py [code]
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/tests/apps/ Directory Reference

apps Directory Reference

Directories

directory | support

Files

file | excApp.py [code]
file | hTestAppEvt.py [code]
file | hTestAppTkr.py [code]
file | hTestEnv.py [code]
file | hTestStrip.py [code]
file | nullApp.py [code]
file | splitOutTem.py [code]
file | suiteRunner.py [code]
file | sweepRejectTest.py [code]
file | temLrsTest.py [code]
file | testAppAcd.py [code]
file | testAppAcdScalers.py [code]
file | testAppAlarm.py [code]
file | testAppArchiver.py [code]
file | testAppCal.py [code]
file | testAppCal_dg.py [code]
file | testAppEvt.py [code]
file | testAppEvtCli.py [code]
file | testAppEvtTO.py [code]
file | testAppExclude.py [code]
file | testAppLDFdump.py [code]
file | testAppMinimal.py [code]
file | testAppNoVersion.py [code]
file | testAppReport.py [code]
file | testAppTkr.py [code]
file | testErrorPropogation.py [code]
file | testEvtBldr_script.py [code]
file | testRunner.py [code]
file | testSAppCal.py [code]
file | testSAppCal_Lean.py [code]
file | testSAppEvt.py [code]
file | testSuite.py [code]
file | testSuite2.py [code]
file | testSuite_Lean.py [code]
file | testSuiteLong.py [code]
file | testSuiteSummary.py [code]
file | testSummary.py [code]
file | testTkrHitFilter.py [code]
file | testTrgParityError.py [code]
file | transitionRejectTest.py [code]
Generated on Fri Jul 21 13:26:37 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/tests/apps/support/ Directory Reference

support Directory Reference

Files

file | gEvtCliBT.py [code]
file | MiniGLTExample.py [code]
file | rcTransitionsBT.py [code]
file | SimpleGasuExample.py [code]
file | testArchiver.py [code]
file | testEvtCli.py [code]
file | testPreload.py [code]
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/tools/ Directory Reference

tools

tools Directory Reference

Files

file | AcdHWMultiplexer.py [code]
file | DataDistributor.py [code]
file | DataDistributorPoll.py [code]
file | DataExport.py [code]
file | FreeSpace.py [code]
file | gAlert.py [code]
file | guiBridges.py [code]
file | MailAlert.py [code]
file | taskEngine.py [code]
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: c:/temp/LATTE/trigger/ Directory Reference

trigger

trigger Directory Reference

Files

file | NullObjects.py [code]
file | rcDefaultTrigger.py [code]
file | rcTrgFunctions.py [code]
file | rcTrgGem.py [code]
file | rcTrgMiniGLT.py [code]
file | TrgAbstract.py [code]
file | TrgCmdCounters.py [code]
file | TrgCnoCounters.py [code]
file | TrgCoincidences.py [code]
file | TrgConditions.py [code]
file | TrgConditionsValue.py [code]
file | TrgEngines.py [code]
file | TrgEventCounter.py [code]
file | TrgGem.py [code]
file | TrgGemAbstract.py [code]
file | TrgGemCounters.py [code]
file | TrgGemPeriodicCondition.py [code]
file | TrgGemRegisterGeometry.py [code]
file | TrgGemRegisters.py [code]
file | TrgGemSequence.py [code]
file | TrgInputEnables.py [code]
file | TrgMiniGLT.py [code]
file | TrgMiniGLTAbstract.py [code]
file | TrgMiniGLTRegisters.py [code]
file | TrgObject.py [code]
file | TrgPeriodic.py [code]
file | TrgPPSTimer.py [code]
file | TrgRoiAsTiles.py [code]
file | TrgRoiAsVeto.py [code]
file | TrgSequence.py [code]
file | TrgTileCounters.py [code]
file | TrgTower.py [code]
file | TrgTriggerCounters.py [code]
file | TrgUsingTiles.py [code]
Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented namespace members with links to the namespaces they belong to:

- _ -

  • _cleanupConnections() : dispatcher
  • _removeReceiver() : dispatcher
  • _removeSender() : dispatcher
  • _testDg() : BTdump
  • _unsigned() : testSAppEvt, testAppEvt, splitOutTem, hTestAppEvt
  • _write_data() : gSchemaConfig

- a -

  • applyConfig() : gSchemaConfig
  • applyHskConfig() : gHSK

- c -

  • colorScale() : colorScale
  • connect() : dispatcher

- d -

  • dateMnemSelect() : monitoringDbSyncOut
  • disconnect() : dispatcher

- f -

  • FreeSpace() : FreeSpace
  • function() : robustapply

- g -

  • getAllReceivers() : dispatcher
  • getReceivers() : dispatcher
  • getSysReg() : gSchemaConfig

- h -

  • hexConvert() : gBits

- i -

  • importModule() : rcUtil

- l -

  • liveReceivers() : dispatcher
  • lockTransact() : monitoringDbSyncOut

- n -

  • NodeString() : HskAlarms

- r -

  • read() : gEvtCliBT
  • readConfig() : gSchemaConfig
  • readHskConfig() : gHSK
  • readSchema() : gSchemaConfig
  • robustApply() : robustapply

- s -

  • safeRef() : saferef
  • send() : dispatcher
  • sendExact() : dispatcher
  • sequence() : gEvtCliBT
  • setSysReg() : gSchemaConfig
  • startupMainGui() : startupMainGUI

- t -

  • testRaw() : BTdump

- u -

  • usage() : socketMerge, fileMerge

- w -

  • writeSchema() : gSchemaConfig
Generated on Fri Jul 21 13:28:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Page Index

LATTE Related Pages

Here is a list of all related documentation pages:
  • Deprecated List
  • Todo List
Generated on Fri Jul 21 13:28:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Deprecated List

Deprecated List

Class GEM
  • triggerSummary Use 'conditions' instead
  • sent Use 'condArrivalTimes' instead

Class GGEMST
  • missed Use 'deadzone' instead

Class GLAT
  • parity_latp_cell_header Use 'LCB.parity_latp_cell_header' instead
  • parity_latp_cell_body Use 'LCB.parity_latp_cell_body' instead
  • stats_failed_events Use 'OCS.stats_failed_events' instead
  • stats_failed_event_sends Use 'OCS.stats_failed_event_sends' instead
  • stats_valid_events Use 'OCS.stats_valid_events' instead
  • stats_discarded_event_sends Use 'OCS.stats_discarded_event_sends' instead
  • stats_length_mismatch_count Use 'OCS.stats_length_mismatch_count' instead
  • stats_events_not_sent Use 'OCS.stats_events_not_sent' instead

Event statistics:

The following statistics registers are initialized at the start of each RunControl run:

  • stats_failed_events -- Counts events where the eventHandler receives a bad status for the event.

  • stats_failed_event_sends -- Counts events where the socket send failed with an error other than EWOULDBLOCK.

  • stats_valid_events -- Counts when a valid event has been successfully sent to the client.

  • stats_discarded_event_sends -- Counts cases when an event send failed due to the fact that the send returned an EWOULDBLOCK error.

  • stats_length_mismatch_count -- Counts cases when the length argument passed to the event handler did not match the length provided in the event header.

  • stats_events_not_sent -- Counts when the event mode is set to DONOT_SEND_EVENTS where the incoming events will not be forwarded to the client over the socket.

Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Todo List

Todo List

Member sequence
Fix the side effect nature of this routine
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Graphical Class Hierarchy

Go to the textual class hierarchy

Generated on Fri Jul 21 13:29:22 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: AcdHWMultiplexer.py Source File

tools

AcdHWMultiplexer.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT data export routines"
00012 __author__   = "J. Panetta <panetta@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2004/11/08 21:03:12 $").split(' ')[1]
00014 __version__  = "$Revision: 2.2 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import                           time
00021 from Numeric                     import array, zeros
00022
00023 from LATTE.tools.taskEngine      import TaskEngine
00024 from LATTE.database.gLAT         import *
00025 from LATTE.trigger.TrgObject     import TrgObject
00026 from thread                      import allocate_lock
00027
00028 class AcdHWMultiplexer(object):
00029   """\brief AcdHWMultiplexer class
00030
00031   A class to multiplex the two ACD hardware scalers defined in
00032   section 2.6.2 of the GEM document, LAT-TD-01545 into up to 108
00033   separate counters.
00034
00035   """
00036   __DEFAULT_DWELL_TIME             = 1    # Default to 1 second
00037
00038   def __init__(self, GEM):
00039     """\brief AcdHWMultiplexer constructor
00040
00041     \param GEM  a GEM object
00042     """
00043     self.__gemst = GEM.downGEMST()
00044     self.__gemie = GEM.downGEMIE()
00045
00046     self.__dwell = None
00047     self.__tList = None
00048     self.__stats = None
00049
00050     self.__accumEngine = TaskEngine("AcdHWMultiplexer")
00051     self.__accumEngine.start()
00052
00053     self.__statsLock  = allocate_lock()
00054
00055     self.__setupDone  = False
00056     self.__stopAccum  = False
00057     self.__abortAccum = False
00058
00059     self.__sortIEregs()
00060
00061   def start(self):
00062     """\brief Method for starting the accumulation of ACD hardware scalers
00063
00064     Start the integration of the hardware counters.
00065     At the start of integration, the counters are all reset to zero (0).
00066     """
00067     # invalidate setup to reset stats, etc.
00068     self.__setupDone = False
00069     # spawn the accumulate engine
00070     self.__accumEngine.spawn(self.__accumulate)
00071
00072   def stop(self):
00073     """\brief Method for stopping the accumulation of ACD hardware scalers
00074
00075     Stop the integration of the hardware counters.
00076     The stop occurs at the end of the current cycle, and
00077     the counts from the current cycle are integrated into the count
00078     statistics
00079     """
00080     self.__stopAccum = True
00081
00082   def resume(self):
00083     """\brief Method for resuming the accumulation of ACD hardware scalers after a stop
00084
00085     Resume the integration of the hardware counters after a stop()
00086     call.  At resume of integration, the internal counters are not reset, but
00087     continue from their previous values.
00088     """
00089     # spawn the accumulate engine
00090     self.__stopAccum = False
00091     self.__accumEngine.spawn(self.__accumulate)
00092
00093   def abort(self):
00094     """\brief Method for aborting the accumulation of ACD hardware scalers
00095
00096     Abort the integration of the hardware counters.  The cycle
00097     stops immediately, and the set of counts from the current cycle
00098     is discarded.
00099     """
00100     self.__abortAccum = True
00101
00102   def shutdown(self):
00103     """\brief Method for shutting down the Multiplexer.
00104
00105     Shut down the thread the multiplexer is running in.  Should be
00106     called during endRun.
00107     """
00108     self.__accumEngine.shutdown()
00109
00110   def dwell(self, d=None):
00111     """\brief Method to set the dwell time for scaler integration
00112
00113     Set the dwell time (in seconds) for integration.
00114     Total time in a cycle through the scalers will be dwell * nTiles.
00115     Minimum dwell time is 0.1 seconds.  Default is 1 second.
00116     \param   dwell  Dwell time in seconds, default = 1 second
00117     """
00118     if d is not None:
00119       if d < 0.1:
00120         d = 0.1
00121       self.__dwell = d
00122       self.__setupDone = False      # invalidate setup, need to recompute stuff
00123     return self.__dwell
00124
00125   def tileList(self, tList=None):
00126     """\brief Method to set which tiles are integrated
00127
00128     Defines the list of tiles which are being integrated.
00129     Ex: range(108); [0,2,4,6]
00130
00131     \param   tList  The list of tiles to be integrated.
00132     \return  The list of tiles that are being integrated
00133     """
00134     if tList is not None:
00135       self.__tList = tList
00136       self.__setupDone = False      # invalidate setup, need to recompute stuff
00137     return self.__tList
00138
00139   def stats(self):
00140     """\brief Method to access the counter statistics
00141
00142     Provides the user with the a list containing the counter statistics.
00143     This list corresponds to the tiles in tileList.
00144
00145     \return The list of the tile statistics.
00146     """
00147     # Prevent multithread access to self.__stats with a lock
00148     self.__statsLock.acquire()
00149     s = self.__stats.tolist()
00150     self.__statsLock.release()
00151     return s
00152
00153
00154 # private:
00155   def __setup(self):
00156     """Set up the system
00157     """
00158     # Make sure we're able to run.
00159     self.__stopAccum  = False
00160     self.__abortAccum = False
00161     self.__setupDone  = True
00162
00163     # error checking
00164     if self.__tList is None:
00165       msg = "No list of tiles defined for the multiplexer."
00166       raise Exception, msg
00167
00168     # No dwell time specified?
00169     if self.__dwell is None:
00170       self.__dwell = AcdHWMultiplexer.__DEFAULT_DWELL_TIME
00171
00172     # Check integrity of tile list
00173     for tile in self.__tList:
00174       if tile < TrgObject.TILE_NUMBER_MIN or \
00175          tile > TrgObject.TILE_NUMBER_MAX:
00176         msg = "Tile number %d is out of range [%d, %d]" % \
00177         ( tile, TrgObject.TILE_NUMBER_MIN, TrgObject.TILE_NUMBER_MAX )
00178         raise IndexError, msg
00179
00180     # set up internal array structure
00181     self.__tListInt = array( self.__tList )
00182
00183     # create our internal and external stats arrays
00184     self.__statsInt = zeros( self.__tListInt.shape )
00185     self.__stats    = zeros( self.__tListInt.shape )
00186
00187   def __accumulate(self):
00188     """ This is where the work is really done.
00189     """
00190     if not self.__setupDone:
00191       self.__setup()
00192
00193     sweepSize = len(self.__tListInt)
00194
00195     while ( not self.__stopAccum ):
00196       for tileSet in range(0,sweepSize,2):
00197         # Check for abort here
00198         if self.__abortAccum:
00199           print "abort"
00200           return
00201
00202         tile_0 = self.__tListInt[tileSet]
00203         if tileSet+1 < sweepSize:
00204           tile_1 = self.__tListInt[tileSet+1]
00205         else:
00206           tile_1 = None
00207
00208         # cache input enables
00209         regList  = self.__gemie.regs.values()
00210         self.__regCache = zeros( (len(regList)) )
00211         for reg in regList:
00212           if reg.size() > 0:
00213             self.__regCache[reg.id()] = reg.get()
00214
00215         # set up counters
00216         self.__gemst.TILE_0 = tile_0
00217         if tile_1 is not None:
00218           self.__gemst.TILE_1 = tile_1
00219
00220         # enable the proper tiles
00221         self.__setIE(tile_0)
00222         if tile_1 is not None:
00223           self.__setIE(tile_1)
00224
00225         self.__gemst.TILE_COUNTERS = 0
00226         # Accumulate
00227         time.sleep(self.__dwell)
00228         count = self.__gemst.TILE_COUNTERS
00229
00230         # reset the input enables
00231         self.__resetIE(tile_0)
00232         if tile_1 is not None:
00233           self.__resetIE(tile_1)
00234
00235         # pull counters
00236         self.__statsInt[tileSet] = ( count >>  0 ) & 0xffff
00237         if tile_1 is not None:
00238           self.__statsInt[tileSet+1] = ( count >> 16 ) & 0xffff
00239
00240       # Send internal stats into external stats
00241       # Prevent multithread access to self.__stats with a lock
00242       self.__statsLock.acquire()
00243       self.__stats += self.__statsInt
00244       self.__statsLock.release()
00245     print "stopped"
00246
00247   def __setIE(self,tile):
00248     # set the corresponding bits in the IE on for a tile
00249
00250     reg,bit = divmod(tile,9)
00251     value   = ( 1 << bit ) + ( 1 << bit+9 )  # two nine bit fields
00252     self.__gemieDict[reg+5].set( self.__gemieDict[reg+5].get() | value )         # tile enables start at 5
00253
00254   def __resetIE(self,tile):
00255     # reset the changed input enables to their cached values
00256     reg,bit = divmod(tile,9)
00257     self.__gemieDict[reg+5].set( self.__regCache[reg+5] )
00258
00259   def __sortIEregs(self):
00260     # create a lookup table based on register number
00261     regList  = self.__gemie.regs.values()
00262     self.__gemieDict = {}
00263     for reg in regList:
00264       if reg.size() > 0:
00265         self.__gemieDict[reg.id()] = reg
00266
Generated on Fri Jul 21 13:26:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: AcdPanel.py Source File

runcontrol

AcdPanel.py

00001 # -*- coding: utf-8 -*-
00002
00003 __version__  = "$Revision: 2.1 $"
00004
00005 # Form implementation generated from reading ui file 'AcdPanel.ui'
00006 #
00007 # Created: Tue Mar 30 12:57:54 2004
00008 #      by: The PyQt User Interface Compiler (pyuic) 3.11
00009 #
00010 # WARNING! All changes made in this file will be lost!
00011
00012
00013 from qt import *
00014
00015
00016 class AcdPanel(QWidget):
00017     def __init__(self,parent = None,name = None,fl = 0):
00018         QWidget.__init__(self,parent,name,fl)
00019
00020         if not name:
00021             self.setName("AcdPanel")
00022
00023         self.setSizePolicy(QSizePolicy(5,5,0,0,self.sizePolicy().hasHeightForWidth()))
00024
00025         AcdPanelLayout = QGridLayout(self,1,1,11,6,"AcdPanelLayout")
00026
00027         self.buttonGroup63 = QButtonGroup(self,"buttonGroup63")
00028         self.buttonGroup63.setSizePolicy(QSizePolicy(5,0,0,0,self.buttonGroup63.sizePolicy().hasHeightForWidth()))
00029         self.buttonGroup63.setMinimumSize(QSize(0,100))
00030         self.buttonGroup63.setColumnLayout(0,Qt.Vertical)
00031         self.buttonGroup63.layout().setSpacing(6)
00032         self.buttonGroup63.layout().setMargin(11)
00033         buttonGroup63Layout = QGridLayout(self.buttonGroup63.layout())
00034         buttonGroup63Layout.setAlignment(Qt.AlignTop)
00035
00036         self.pushButton_acdEgse = QPushButton(self.buttonGroup63,"pushButton_acdEgse")
00037         self.pushButton_acdEgse.setSizePolicy(QSizePolicy(7,7,0,0,self.pushButton_acdEgse.sizePolicy().hasHeightForWidth()))
00038         pushButton_acdEgse_font = QFont(self.pushButton_acdEgse.font())
00039         pushButton_acdEgse_font.setFamily("Arial")
00040         pushButton_acdEgse_font.setPointSize(7)
00041         self.pushButton_acdEgse.setFont(pushButton_acdEgse_font)
00042
00043         buttonGroup63Layout.addWidget(self.pushButton_acdEgse,0,0)
00044
00045         self.pushButton_Histogram = QPushButton(self.buttonGroup63,"pushButton_Histogram")
00046         self.pushButton_Histogram.setSizePolicy(QSizePolicy(7,7,0,0,self.pushButton_Histogram.sizePolicy().hasHeightForWidth()))
00047         pushButton_Histogram_font = QFont(self.pushButton_Histogram.font())
00048         pushButton_Histogram_font.setFamily("Arial")
00049         pushButton_Histogram_font.setPointSize(7)
00050         self.pushButton_Histogram.setFont(pushButton_Histogram_font)
00051
00052         buttonGroup63Layout.addWidget(self.pushButton_Histogram,0,1)
00053
00054         self.pushButton_garcDisplay = QPushButton(self.buttonGroup63,"pushButton_garcDisplay")
00055         self.pushButton_garcDisplay.setSizePolicy(QSizePolicy(7,7,0,0,self.pushButton_garcDisplay.sizePolicy().hasHeightForWidth()))
00056         pushButton_garcDisplay_font = QFont(self.pushButton_garcDisplay.font())
00057         pushButton_garcDisplay_font.setFamily("Arial")
00058         pushButton_garcDisplay_font.setPointSize(7)
00059         self.pushButton_garcDisplay.setFont(pushButton_garcDisplay_font)
00060
00061         buttonGroup63Layout.addWidget(self.pushButton_garcDisplay,0,2)
00062
00063         self.pushButton_PowerSupply = QPushButton(self.buttonGroup63,"pushButton_PowerSupply")
00064         self.pushButton_PowerSupply.setSizePolicy(QSizePolicy(7,7,0,0,self.pushButton_PowerSupply.sizePolicy().hasHeightForWidth()))
00065         pushButton_PowerSupply_font = QFont(self.pushButton_PowerSupply.font())
00066         pushButton_PowerSupply_font.setFamily("Arial")
00067         pushButton_PowerSupply_font.setPointSize(7)
00068         self.pushButton_PowerSupply.setFont(pushButton_PowerSupply_font)
00069
00070         buttonGroup63Layout.addWidget(self.pushButton_PowerSupply,0,3)
00071
00072         self.pushButton_TilesDisplay = QPushButton(self.buttonGroup63,"pushButton_TilesDisplay")
00073         self.pushButton_TilesDisplay.setSizePolicy(QSizePolicy(7,7,0,0,self.pushButton_TilesDisplay.sizePolicy().hasHeightForWidth()))
00074         pushButton_TilesDisplay_font = QFont(self.pushButton_TilesDisplay.font())
00075         pushButton_TilesDisplay_font.setFamily("Arial")
00076         pushButton_TilesDisplay_font.setPointSize(7)
00077         self.pushButton_TilesDisplay.setFont(pushButton_TilesDisplay_font)
00078
00079         buttonGroup63Layout.addWidget(self.pushButton_TilesDisplay,0,4)
00080
00081         AcdPanelLayout.addWidget(self.buttonGroup63,0,0)
00082         spacer16 = QSpacerItem(31,170,QSizePolicy.Minimum,QSizePolicy.Expanding)
00083         AcdPanelLayout.addItem(spacer16,1,0)
00084         spacer17 = QSpacerItem(9,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
00085         AcdPanelLayout.addItem(spacer17,0,1)
00086
00087         self.languageChange()
00088
00089         self.resize(QSize(357,288).expandedTo(self.minimumSizeHint()))
00090         self.clearWState(Qt.WState_Polished)
00091
00092
00093     def languageChange(self):
00094         self.setCaption(self.__tr("AcdPanel"))
00095         self.buttonGroup63.setTitle(self.__tr("Launch GUIs"))
00096         self.pushButton_acdEgse.setText(self.__tr("H/W\n"
00097 "I/F\n"
00098 "TOOL"))
00099         self.pushButton_Histogram.setText(self.__tr("HISTO-\n"
00100 "GRAMS"))
00101         self.pushButton_garcDisplay.setText(self.__tr("H/W\n"
00102 "MONITOR"))
00103         self.pushButton_PowerSupply.setText(self.__tr("POWER\n"
00104 "SUPPLY"))
00105         self.pushButton_TilesDisplay.setText(self.__tr("TILES\n"
00106 "DISPLAY"))
00107
00108
00109     def __tr(self,s,c = None):
00110         return qApp.translate("AcdPanel",s,c)
Generated on Fri Jul 21 13:26:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: AlertGuiImpl.py Source File

logger

AlertGuiImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Alert System GUI"
00012 __author__   = "J. Panetta"
00013 __date__     = "28/01/2005"
00014 __version__  = "$Revision: 1.5 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 from LATTE.logger.MSGLogGUIImpl   import *
00020 from LATTE.client.gOptions        import Options
00021 from LATTE.tools.gAlert           import *
00022 from LATTE.logger.socketLogging   import *
00023
00024 from ConfigParser                 import *
00025 from string                       import *
00026
00027
00028 class gAlertPopup(gAlertHandler):
00029   def __init__(self, gui):
00030     gAlertHandler.__init__(self)
00031     self.__gui = gui
00032
00033   def handle(self, alertStr):
00034     (severity, timestamp, machine, system, message) = alertStr.decode()
00035     alertHeader = "%s: %s System Alert, HOST:%d" % (alertDict[severity], system, machine)
00036
00037     mb = QMessageBox( alertHeader, message, QMessageBox.Critical,
00038                       QMessageBox.Ok, QMessageBox.NoButton, QMessageBox.NoButton,
00039                       self.__gui, None, False )
00040
00041     mb.show()
00042
00043 class AlertGuiImpl(MSGLogGUIImpl):
00044   def __init__(self, cfg):
00045     MSGLogGUIImpl.__init__(self)
00046     self.setCaption("LATTE alerting system")
00047     self.__registry = gAlertRegistry()
00048
00049     self.config(cfg)
00050
00051   def handleAlert(self, alertList):
00052     tempString = join(alertList[5:],' ')
00053     alertString = gAlertStr(tempString)
00054     self.__registry.handle(alertString)
00055
00056   def startListenerThread(self):
00057     self.Logger.clear()
00058     self.LogType.setText("Active Run Control Log")
00059     self.LogType.setAlignment(QLineEdit.AlignLeft)
00060
00061     self.tcpserver = MSGLogSocketReceiver(self, port=ALARM_TCP_LOGGING_PORT)
00062     self.tcpserver.logname = self._MSGLogGUIImpl__logname
00063     self.runTCPThread = threading.Thread(target=self.runTCP, name=self.tcpserver.logname, args=(self.tcpserver,))
00064     self.runTCPThread.start()
00065
00066
00067   def config(self, configFile):
00068     parser = ConfigParser()
00069     parser.read(configFile)
00070
00071     handlers = {}
00072     alarms   = {}
00073
00074     # test the config for required parameters
00075     cSect    = parser.sections()
00076     REQUIRED = ('core', 'handlers', 'alarms')
00077     for sect in REQUIRED:
00078       if sect not in cSect:
00079         msg = 'Config file %s is missing required section: %s' % ( configFile, sect )
00080         raise KeyError, msg
00081
00082     for section in cSect:
00083       options = parser.options(section)
00084       if section == "core":
00085         # core doesn't do anything ... yet
00086         pass
00087       elif section == "handlers":
00088         for option in options:
00089           handlers[option] = parser.get(section, option)
00090
00091       elif section == "alarms":
00092         for option in options:
00093           alarms[option] = parser.get(section, option)
00094
00095     # parse the handlers out
00096     for handler in handlers:
00097       (name, email) = handlers[handler].split(",")
00098       address = '\"%s\" <%s>' % (strip(name), strip(email))
00099       handlers[handler] = gAlertMailer(address)     # replace the instance
00100
00101     for alarm in alarms:
00102       for handlerString in alarms[alarm].split(","):
00103         # print "adding handler %s to alarm %s" % (strip(handlerString), alarm)
00104         self.__registry.register(alarm, handlers[strip(handlerString)])
00105
00106     popupHandler = gAlertPopup(self)
00107     self.__registry.register("ALL", popupHandler)
00108
00109 def usage():
00110   return """
00111
00112 AlertGuiImpl Usage:
00113
00114 Mandatory options:
00115 --config    specify the configuration file to read
00116
00117 Example:
00118 $ AlertGuiImpl --config alert.cfg
00119
00120 """
00121
00122 if __name__ == "__main__":
00123
00124   # Options, first list mandatory, second list optional
00125   options = Options(['config'])
00126   try:
00127     options.parse()
00128   except Exception, msg:
00129     options.usage(usage())
00130     raise Exception, msg
00131
00132   a = QApplication(sys.argv)
00133   QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00134   w = AlertGuiImpl(options.config)
00135   w.startListenerThread()
00136   a.setMainWidget(w)
00137   w.show()
00138   a.exec_loop()
Generated on Fri Jul 21 13:26:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ancillaryContribution.py Source File

merger

ancillaryContribution.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2006
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Ancillary event contribution class"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "3/30/2006"
00014 __updated__  = ("$Date: 2006/07/14 22:27:33 $").split(' ')[1]
00015 __version__  = "$Revision: 1.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import struct
00022
00023 import LATTE.merger.geb as geb
00024
00025
00026 class AncillaryContribution(geb.GebContribution):
00027   EventId   = 0x000F1030L               # LDF.LATprimaryId.BtAncEvt
00028   HeaderId  = 0x000F1040L               # LDF.LATprimaryId.BtAncHdr
00029   TrailerId = 0x000F1050L               # LDF.LATprimaryId.BtAncTlr
00030   def __init__(self, contributor, contribution):
00031     geb.GebContribution.__init__(self, contributor)
00032     self.__contribution = contribution
00033
00034   def identity(self):
00035     return struct.unpack('>L', self.__contribution[0*4:1*4])[0]
00036
00037   def length(self):
00038     return struct.unpack('>L', self.__contribution[1*4:2*4])[0]
00039
00040   def sequence(self):
00041     seq = struct.unpack('>L', self.__contribution[2*4:3*4])[0] & 0x0fffffff
00042     return self.contributor().sequence(seq)
00043
00044   def buffer(self):
00045     return self.__contribution
Generated on Fri Jul 21 13:26:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ancillaryFile.py Source File

ancillaryFile.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2006
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Read ancillary event contributions from a file"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "3/30/2006"
00014 __updated__  = ("$Date: 2006/07/19 16:08:33 $").split(' ')[1]
00015 __version__  = "$Revision: 1.2 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import struct
00022 from   array   import array
00023 import logging as     log
00024
00025 import LATTE.merger.geb                   as     geb
00026 from   LATTE.merger.ancillaryContribution import AncillaryContribution
00027
00028
00029 class AncillaryContributor(geb.GebContributor):
00030   __typeIds = [AncillaryContribution.EventId,
00031                AncillaryContribution.HeaderId,
00032                AncillaryContribution.TrailerId]
00033   def __init__(self, filename, offset = 0):
00034     geb.GebContributor.__init__(self)
00035     self.__filename  = filename
00036     self.__fakeEvent = struct.pack("<3L", AncillaryContribution.EventId, 3*4, 0xdeadbeefL)
00037     self.__offset = offset
00038
00039   def name(self):
00040     return "Anc"
00041
00042   def offset(self):
00043     return self.__offset
00044
00045   def open(self):
00046     self.__file = file(self.__filename, 'rb')
00047     print "AncContrib.open: %s opened" % (self.__filename)
00048
00049   def close(self):
00050     self.__file.close()
00051
00052   def read(self):
00053     """!\brief Method to read an ancillary contribution from a file.
00054     """
00055     data = self.__file.read(8)
00056     if len(data) == 0:  raise EOFError, "AncContrib.read: End of file on %s" % (self.__filename)
00057     (vTypeId, length) = struct.unpack('<2L', data)
00058     typeId = vTypeId & 0x000fffff
00059     if typeId not in AncillaryContributor.__typeIds:
00060       raise KeyError, "AncContrib.read: Unrecognized contribution %08x" % (vTypeId)
00061     length &= 0x0fffffff
00062     #print "AncContrib.read:   id = %08x, len = %08x" % (typeId,length)
00063     #data  += self.__file.read(length - 8)
00064     #data = array('I', data)
00065
00066     #!\todo Improve the swapping if possible, i.e. avoid a copy
00067     data = array('I', (vTypeId, length))
00068     data.fromfile(self.__file, (length - 8) / 4)
00069     data.byteswap()
00070     data = data.tostring()
00071
00072     status = 0
00073     if typeId == AncillaryContribution.EventId:
00074       return geb.Geb.Build,     status, AncillaryContribution(self, data)
00075     else:
00076       return geb.Geb.DontBuild, status, AncillaryContribution(self, data)
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
Generated on Fri Jul 21 13:26:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ancillarySocket.py Source File

ancillarySocket.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2006
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Read ancillary event contributions from a socket"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "3/30/2006"
00014 __updated__  = ("$Date: 2006/07/14 22:34:28 $").split(' ')[1]
00015 __version__  = "$Revision: 1.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import struct
00022 from   array                              import array
00023 import logging                            as     log
00024
00025 import LATTE.merger.geb                   as     geb
00026 from   LATTE.merger.ancillaryContribution import AncillaryContribution
00027 from   LATTE.client.gSocket               import Socket
00028
00029
00030 class AncillaryContributor(geb.GebContributor):
00031   __typeIds = [AncillaryContribution.HeaderId,
00032                AncillaryContribution.TrailerId,
00033                AncillaryContribution.EventId]
00034   def __init__(self, (host, port), offset = 0):
00035     geb.GebContributor.__init__(self)
00036     self.__socket    = Socket(port)
00037     self.__host      = host
00038     self.__fakeEvent = struct.pack("<3L", AncillaryContribution.EventId, 3*4, 0xdeadbeefL)
00039     self.__offset    = offset
00040
00041   def name(self):
00042     return "Anc"
00043
00044   def offset(self):
00045     return self.__offset
00046
00047   def open(self):
00048     self.__socket.connect(self.__host)
00049     self.__socket.settimeout(9999)
00050     print "AncContrib.open: socket opened"
00051
00052   def close(self):
00053     self.__socket.disconnect()
00054
00055   def read(self):
00056     """!\brief Method to read an ancillary contribution from a file.
00057     """
00058     data   = self.__socket.recvall(8)
00059     (vTypeId, length) = struct.unpack('<2L', data)
00060     typeId = vTypeId & 0x000fffff
00061     if typeId not in AncillaryContributor.__typeIds:
00062       # Don't try to continue if bad typeId: we're lost or it's undefined
00063       raise KeyError, "Unrecognized contribution %08x"%(typeId)
00064     length &= 0x0fffffff
00065     #print "AncContrib.read:   id = %08x, len = %08x" % (typeId,length)
00066     data  += self.__socket.recvall(length - 8)
00067     data = array('I', data)
00068     data.byteswap()
00069     data = data.tostring()
00070
00071     status = 0
00072     if typeId == AncillaryContribution.EventId:
00073       return geb.Geb.Build,     status, AncillaryContribution(self, data)
00074     else:
00075       return geb.Geb.DontBuild, status, AncillaryContribution(self, data)
00076
00077   def fake(self):
00078     return self.__fakeEvent
Generated on Fri Jul 21 13:26:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ArgumentImpl.py Source File

runcontrol

ArgumentImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Argument GUI implementation module"
00012 __author__   = "A. Kavelaars <aliciak@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "11/20/2003"
00014 __version__  = "$Revision: 2.2 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import sys
00020 from qt import *
00021 from Argument import Argument
00022
00023
00024 class ArgumentImpl(Argument):
00025
00026   def __init__(self,parent = None,name = None,modal = 0,fl = 0):
00027     Argument.__init__(self,parent,name,modal,fl)
00028
00029     self.__label = 0
00030
00031     self.connect(self.OKButton,SIGNAL("clicked()"),self.OKButtonClicked)
00032     self.connect(self.CancelButton,SIGNAL("clicked()"),self.CancelButtonClicked)
00033
00034   def OKButtonClicked(self):
00035     self.__value = int(self.ArgumentList.text().latin1())
00036     self.close()
00037
00038   def getValue(self, caption, value = None):
00039     if value is not None:
00040       self.ArgumentList.setText(str(value))
00041     self.ArgLabel.setText(caption)
00042     self.show()
00043     self.exec_loop()
00044     return self.__value
00045
00046   def CancelButtonClicked(self):
00047     self.close()
00048
00049 if __name__ == "__main__":
00050     a = QApplication(sys.argv)
00051     QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00052     w = ArgumentImpl()
00053     a.setMainWidget(w)
00054     w.show()
00055     a.exec_loop()
Generated on Fri Jul 21 13:26:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: bar.py Source File

browser

bar.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Trigger"
00012 __abstract__ = "Bar widget for trigger display"
00013 __author__   = "Martin Kocian, SLAC"
00014 __date__     = ("$Date: 2005/05/16 18:30:35 $").split(' ')[1]
00015 __version__  = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 from qt import *
00020 import sys
00021
00022 class bar (QWidget):
00023
00024         def __init__(self,parent= None,name = None,fl = 0):
00025                 QWidget.__init__(self,parent,name,fl)
00026         self.__val=0
00027         self.__rval=0
00028                 self.__fullscale=10
00029                 self.__color=QColor("green")
00030         self.__orientation=0 # vertical
00031         self.__minorab=0
00032         self.__minorcolor=QColor("yellow")
00033         self.__minorlevel=0
00034         self.__majorab=0
00035         self.__majorcolor=QColor("red")
00036         self.__majorlevel=0
00037         if not name:
00038             self.setName("bar")
00039
00040
00041         self.languageChange()
00042
00043         self.clearWState(Qt.WState_Polished)
00044
00045
00046     def languageChange(self):
00047         self.setCaption(self.__tr("Form1"))
00048
00049
00050
00051     def __tr(self,s,c = None):
00052         return qApp.translate("bar",s,c)
00053     def setColor(self,col):
00054         self.__color=QColor(col)
00055         self.update()
00056         def setMinor(self,level,abovebelow=1,color="yellow"):
00057         #ab=0 is off ab=1 is alarm above level, -1 is alarm below level
00058         self.__minorlevel=level
00059         self.__minorab=abovebelow
00060         self.__minorcolor=QColor(color)
00061         def setMajor(self,level,abovebelow=1,color="red"):
00062         self.__majorlevel=level
00063         self.__majorab=abovebelow
00064         self.__majorcolor=QColor(color)
00065         def setScale(self,scale):
00066         self.__fullscale=scale
00067                 self.update()
00068         def setOrientation(self,st):
00069         if st=="vertical":
00070             self.__orientation=0
00071         else:
00072             self.__orientation=1
00073         def getOrientation():
00074         return self.__orientation
00075
00076     def displayValue(self,a0):
00077                 self.__rval=a0
00078         if a0>=0 and a0 <=self.__fullscale:
00079             self.__val=a0
00080                 elif a0<0:
00081             self.__val=0
00082         else:
00083             self.__val=self.__fullscale
00084                 self.update()
00085
00086
00087     def paintEvent(self,pe):
00088         try:
00089             r= pe.rect()
00090             painter=QPainter()
00091             painter.begin( self )
00092             painter.setBrush(self.paletteBackgroundColor())
00093             pen=QPen()
00094                         pen.setColor(QColor("black"))
00095                         pen.setWidth(1)
00096                         painter.setPen(pen)
00097                         ar=QPointArray(4)
00098                 ar.setPoint(0, 0,0 )
00099                 ar.setPoint(1, self.size().width()-1,0)
00100                 ar.setPoint(2,self.size().width()-1, self.size().height()-1)
00101             ar.setPoint(3,0,self.size().height()-1)
00102             painter.drawPolygon(ar)
00103             brush=QBrush(self.__color )
00104             if self.__minorab==1 and self.__rval>self.__minorlevel: brush=QBrush(self.__minorcolor)
00105             if self.__minorab==-1 and self.__rval<self.__minorlevel: brush=QBrush(self.__minorcolor)
00106             if self.__majorab==1 and self.__rval>self.__majorlevel: brush=QBrush(self.__majorcolor)
00107             if self.__majorab==-1 and self.__rval<self.__majorlevel: brush=QBrush(self.__majorcolor)
00108
00109             painter.setBrush( brush )
00110             painter.setPen(self.paletteBackgroundColor())
00111                 hval=float(self.__val)/self.__fullscale*(self.size().width()-2)
00112             if hval<0: hval=0
00113                         vval=float(self.__val)/self.__fullscale*(self.size().height()-2)
00114             if vval<0:vval=0
00115             if self.__orientation==0:
00116                 painter.drawRect( 1,self.size().height()-vval-1,
00117                           self.size().width()-2,vval )
00118             else:
00119                 painter.drawRect(1,1,hval,self.size().height()-2)
00120         except :
00121             print "Unexpected error:", sys.exc_info()[1]
00122
00123
00124
00125 if __name__ == "__main__":
00126         a = QApplication(sys.argv)
00127         QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00128         w = bar()
00129         a.setMainWidget(w)
00130         w.show()
00131         a.exec_loop()
Generated on Fri Jul 21 13:26:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: barw.py Source File

browser

barw.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Trigger"
00012 __abstract__ = "Bar with scale for trigger display"
00013 __author__   = "Martin Kocian, SLAC"
00014 __date__     = ("$Date: 2005/06/15 23:42:30 $").split(' ')[1]
00015 __version__  = "$Revision: 2.3 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019
00020
00021 from qt import *
00022 from bar import bar
00023 from math import *
00024
00025
00026 class barw(QWidget):
00027     def __init__(self,parent = None,name = None,fl = 0):
00028         QWidget.__init__(self,parent,name,fl)
00029
00030         if not name:
00031             self.setName("barw")
00032
00033         self.__minscale=1
00034         self.__fullscale=1
00035
00036         self.line2 = QFrame(self,"line2")
00037         self.line2.setFrameShape(QFrame.HLine)
00038         self.line2.setFrameShadow(QFrame.Plain)
00039         self.line2.setLineWidth(3)
00040         self.line2.setFrameShape(QFrame.HLine)
00041
00042         self.line1 = QFrame(self,"line1")
00043         self.line1.setFrameShape(QFrame.VLine)
00044         self.line1.setFrameShadow(QFrame.Plain)
00045         self.line1.setLineWidth(3)
00046         self.line1.setFrameShape(QFrame.VLine)
00047
00048         self.line2_2 = QFrame(self,"line2_2")
00049         self.line2_2.setFrameShape(QFrame.HLine)
00050         self.line2_2.setFrameShadow(QFrame.Plain)
00051         self.line2_2.setLineWidth(3)
00052         self.line2_2.setFrameShape(QFrame.HLine)
00053
00054         self.low = QLabel(self,"low")
00055         self.low.setAlignment(QLabel.AlignVCenter | QLabel.AlignRight)
00056         self.low.setScaledContents(1)
00057
00058         self.font=QFont("Times")
00059         self.font.setPointSizeFloat(12.)
00060
00061         self.bar = bar(self,"bar")
00062
00063         self.line5_2 = QFrame(self,"line5_2")
00064         self.line5_2.setFrameShape(QFrame.HLine)
00065         self.line5_2.setFrameShadow(QFrame.Plain)
00066         self.line5_2.setLineWidth(2)
00067         self.line5_2.setFrameShape(QFrame.HLine)
00068
00069         self.line2_3 = QFrame(self,"line2_3")
00070         self.line2_3.setFrameShape(QFrame.HLine)
00071         self.line2_3.setFrameShadow(QFrame.Plain)
00072         self.line2_3.setLineWidth(3)
00073         self.line2_3.setFrameShape(QFrame.HLine)
00074
00075         self.line5_2_2 = QFrame(self,"line5_2_2")
00076         self.line5_2_2.setFrameShape(QFrame.HLine)
00077         self.line5_2_2.setFrameShadow(QFrame.Plain)
00078         self.line5_2_2.setLineWidth(2)
00079         self.line5_2_2.setFrameShape(QFrame.HLine)
00080
00081         self.label = QLabel(self,"label")
00082         self.label.setAlignment(QLabel.AlignVCenter | QLabel.AlignRight)
00083         self.label.setScaledContents(1)
00084
00085         self.high = QLabel(self,"high")
00086         self.high.setAlignment(QLabel.AlignVCenter | QLabel.AlignRight)
00087         self.high.setScaledContents(1)
00088
00089         self.languageChange()
00090
00091         #self.resize(QSize(124,168).expandedTo(self.minimumSizeHint()))
00092         self.clearWState(Qt.WState_Polished)
00093
00094
00095     def languageChange(self):
00096         self.setCaption(self.__tr("Form1"))
00097         self.low.setText(self.__tr("low"))
00098         self.label.setText(self.__tr("level"))
00099         self.high.setText(self.__tr("high"))
00100
00101
00102     def __tr(self,s,c = None):
00103         return qApp.translate("barw",s,c)
00104
00105     def resizeEvent(self,rev):
00106         #print "resizing done"
00107         xel=float(rev.size().width())/11.
00108         yel=float(rev.size().height())/16.
00109         self.line2.setGeometry(QRect(xel*4.,yel*13-3,xel*2,3))
00110         self.line1.setGeometry(QRect(xel*4,yel*1,3,12*yel))
00111         self.line2_2.setGeometry(QRect(xel*4,yel*7-1,xel*2,3))
00112         self.low.setGeometry(QRect(0,yel*12,xel*4,yel*1.6))
00113         self.bar.setGeometry(QRect(xel*7,yel,xel*4,yel*12))
00114         self.line5_2.setGeometry(QRect(xel*4,yel*4-2,xel,2))
00115         self.line2_3.setGeometry(QRect(xel*4,yel*1,xel*2,3))
00116         self.line5_2_2.setGeometry(QRect(xel*4,yel*10-2,xel,2))
00117         self.label.setGeometry(QRect(0,yel*14,xel*11,yel*1.6))
00118         self.high.setGeometry(QRect(0,0,xel*4,yel*1.6))
00119         self.font.setPointSizeFloat(yel*1.6)
00120         self.label.setFont(self.font)
00121         self.low.setFont(self.font)
00122         self.high.setFont(self.font)
00123
00124
00125     def setHigh(self,high):
00126         self.high.setText(self.__tr(high))
00127
00128     def setLow(self,low):
00129         self.low.setText(self.__tr(low))
00130
00131     def setTitle(self,title):
00132         self.label.setText(self.__tr(title))
00133
00134     def setMinScale(self,min):
00135         self.__minscale=min
00136
00137     def setSlidingScale(self,scale):
00138         self.__fullscale=scale
00139         self.bar.setScale(scale)
00140         self.setHigh("%d"%scale)
00141         self.setLow("0")
00142
00143     def displaySlidingScaleValue(self,val):
00144         if val>0 and (val>self.__fullscale or val<self.__fullscale*.2):
00145             l=pow(10,floor(log10(val)))
00146             if val/l>5:newscale=10*l
00147             elif val/l>2:newscale=5*l
00148             else:newscale=2*l
00149             if newscale<self.__minscale:
00150                 newscale=self.__minscale
00151             self.setSlidingScale(newscale)
00152         self.bar.displayValue(val)
Generated on Fri Jul 21 13:26:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: BrowserImpl.py Source File

browser

BrowserImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "GLAST Online Register Browser"
00013 __author__   = "A. Kavelaars <aliciak@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = "5/15/2003"
00015 __version__  = "$Revision: 2.15 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import os
00021 import sys
00022 import time
00023 import math
00024 import string
00025 from qt import *
00026 from Browser import Browser
00027 from browserPreferencesImpl import browserPreferencesImpl
00028 from BrowserReadme import BrowserReadme
00029 import threading
00030
00031 from LATTE.client.gException import LATInterfaceException
00032
00033 from LATTE.database.gLAT     import GLAT
00034 from LATTE.database.gTEM     import GTEM, GCCC, GCRC, GCFE
00035 from LATTE.database.gTEM     import GTCC, GTRC, GTFE, GTIC
00036 from LATTE.database.gAEM     import GAEM, GAEQ, GARC, GAFE
00037 from LATTE.database.gEBM     import GEBM, GEBMC, GEBMST
00038 from LATTE.database.gGEM     import GGEM, GGEMC, GGEMMG, GGEMST
00039 from LATTE.database.gGEM     import GGEMSC, GGEMVG, GGEMIE, GGEMW
00040 from LATTE.database.gCRU     import GCRU
00041 from LATTE.database.gPDU     import GPDU, GPEQ
00042 from LATTE.database.gGLT     import GGLT
00043 from LATTE.database.gLCB     import GLCB, GLCBSTATS
00044 from LATTE.database.gOCS     import GOCS
00045
00046
00047 #from gLAT import *
00048 #from gSchemaConfig import *
00049
00050 # Pix map of OPEN FOLDER to shown an element of the hierarchy loaded
00051 image0_data = [
00052 "16 13 7 1",
00053 "d c #000000",
00054 "# c #a0a000",
00055 "c c #c0c080",
00056 "e c #e0c080",
00057 "b c #e0e080",
00058 "a c #fffbf0",
00059 ". c #ffffff",
00060 "...#####........",
00061 "..#aaaaa#.......",
00062 ".#abbbbba######.",
00063 ".#abbbbbbbaaaacd",
00064 ".#abbbbbbbbbbbcd",
00065 "############cbcd",
00066 "#abbbbbbebecdccd",
00067 "#abbbbebbebcdccd",
00068 ".#abbbbbebee#d#d",
00069 ".#abbebebeeecd#d",
00070 "..#aebebeeeec#dd",
00071 "..############dd",
00072 "...ddddddddddddd"
00073 ]
00074
00075
00076 class BrowserImpl(Browser):
00077   def __init__(self, lat, xbrd, ocs, parent = None, name = None, fl = 0):
00078     Browser.__init__(self,parent,name,fl)
00079
00080     self.__image0 = QPixmap(image0_data)
00081
00082     # Initialize file parameters
00083     self.printer    = QPrinter()
00084     self.__filename = QString.null
00085     self.__openFile = 0
00086     self.__lat      = lat
00087     self.__xbrd     = xbrd
00088     self.__ocs      = ocs
00089
00090     # Initialize Hierarchy Dictionary
00091     self.__treeMap = {}
00092     self.__labelMap = {}
00093
00094     # Initialize register views' dictionary
00095     self.registerView =  [self.GLAT_Regs,
00096                           self.GLCB_Regs,
00097                           self.GLCBSTATS_Regs,
00098                           self.GOCS_Regs,
00099                           self.GAEM_Regs,
00100                           self.GAEQ_Regs,
00101                           self.GARC_Regs,
00102                           self.GAFE_Regs,
00103                           self.GTEM_Regs,
00104                           self.GTEM_Regs2,
00105                           self.GCCC_Regs,
00106                           self.GCRC_Regs,
00107                           self.GCFE_Regs,
00108                           self.GTCC_Regs,
00109                           self.GTRC_Regs,
00110                           self.GTFE_Regs,
00111                           self.GTIC_Regs,
00112                           self.GEBM_Regs,
00113                           self.GEBMC_Regs,
00114                           self.GEBMST_Regs,
00115                           self.GGEM_Regs,
00116                           self.GGEMC_Regs,
00117                           self.GGEMMG_Regs,
00118                           self.GGEMST_Regs,
00119                           self.GGEMSC_Regs,
00120                           self.GGEMVG_Regs,
00121                           self.GGEMIE_Regs,
00122                           self.GGEMW_Regs,
00123                           self.GCRU_Regs,
00124                           #self.GPDU_Regs,
00125                           #self.GPEQ_Regs,
00126                           self.GGLT_Regs]
00127
00128     # Initialize Context Menu
00129     self.contextMenu = QPopupMenu( self )
00130     self.contextMenu.insertItem( "Copy &Cell", self.copyToClipboard, Qt.CTRL+Qt.Key_C)
00131     self.contextMenu.insertItem( "Copy &Line", self.copyLineToClipboard, Qt.CTRL+Qt.Key_L)
00132
00133     # Initialize clip board
00134     self.clip = QApplication.clipboard()
00135
00136     self.Hierarchy.setSorting(-1)
00137     #~ self.Hierarchy.sort()
00138     self.Hierarchy.setEnabled(1)
00139     self.TEMTab.setEnabled(1)
00140     self.TEMTab.setCurrentPage(1)
00141
00142     self.Conversion.setText("RAW")
00143     self.__base = 1
00144
00145     self.browserPreferences = browserPreferencesImpl()
00146     self.browserPreferences.hexButton.setChecked(1)
00147
00148     self.viewHexadecimal.setOn(1)
00149     self.connect(self.viewDecimal,SIGNAL("toggled(bool)"),self.setViewDecimal)
00150     self.connect(self.viewHexadecimal,SIGNAL("toggled(bool)"),self.setViewHexadecimal)
00151
00152
00153     self.browserPreferences.rawButton.setChecked(1)
00154
00155     #~ self.Browsing.setText("TEM All, GCCC All, GCRC All, GCFE All")
00156
00157     self.__lock = threading.Lock()
00158
00159     # Set the Timer
00160     self.__timer = QTimer(self)
00161     QObject.connect(self.__timer, SIGNAL("timeout()"), self.updateView)
00162     self.__step = float(str(self.browserPreferences.timestepValue.text()))
00163     self.__timer.start(self.__step*1000, False)   # seconds in milliseconds
00164
00165     self.connect(self.UpdateButton, SIGNAL('clicked()'), self.updateView)
00166
00167     # Set connections
00168     #self.connect(self.Hierarchy, SIGNAL('clicked(QListViewItem*)'), \
00169     #  self.selectItem)
00170     self.connect(self.Hierarchy, SIGNAL('currentChanged(QListViewItem*)'), \
00171       self.selectItem)
00172
00173     # Load Schema if LAT has been created
00174     self.setupSchema()
00175
00176     # Cut and Paste capability
00177     for view in self.registerView:
00178       #~ self.__statusPanel = rcStatusPanel(view)
00179       self.connect(view,
00180                    SIGNAL("contextMenuRequested(QListViewItem*,const QPoint&,int)"),
00181                    self.contextMenuShow)
00182
00183   #~ def rightButtonPressed(self, item, point, column):
00184     #~ print item, point, column
00185
00186   def setViewDecimal(self, on):
00187     if on:
00188       self.__base = 0
00189       self.browserPreferences.decButton.setChecked(1)
00190
00191   def setViewHexadecimal(self, on):
00192     if on:
00193       self.__base = 1
00194       self.browserPreferences.hexButton.setChecked(1)
00195
00196   def contextMenuShow(self, item, point, column):
00197     self.selectedItem = item
00198     self.__column = column
00199     self.contextMenu.exec_loop(point)
00200
00201   def copyToClipboard(self):
00202     self.clip.setText(self.selectedItem.text(self.__column))
00203
00204   def copyLineToClipboard(self):
00205     text = ""
00206     for col in range(0,4):
00207       text += str(self.selectedItem.text(col)) + "  "
00208     self.clip.setText(text)
00209
00210   def updateView(self):
00211     if self.__lat is None:
00212       return
00213     #~ if str(self.getCurrentItem().text(0)) == "GLAT":
00214       #~ return
00215     self.fillViews()
00216
00217   def loadSchema(self, filename):
00218     self.__lat.readSchema(filename)
00219     self.__xbrd.readSchema(filename)
00220     plumber = Plumber(self.__lat, self.__xbrd)
00221     plumber.initialize(fswmsglevel=3, ocsverbose=False, force=False, commander=True)
00222     self.setupSchema()
00223
00224 ##   def loadSchema(self, filename):
00225 ##     """ This function reads the xml file and creates the hierarchy tree in
00226 ##         the Hierarchy window. To do so It calls the loadHierarchy function"""
00227
00228
00229 ##     lat = readSchema(filename)
00230 ##     # Load Schema if LAT has been created
00231 ##     self.setupSchema(lat)
00232
00233 ##     self.TEMTab.setEnabled(1)
00234 ##     self.Hierarchy.setEnabled(1)
00235
00236 ##     self.__step = float(str(self.browserPreferences.timestepValue.text()))
00237 ##     self.__timer.start(self.__step*1000, False)   # seconds in milliseconds
00238
00239
00240   def setupSchema(self):
00241     """ This function creates the Hierarchy tree and treeMap from the selected
00242         Schema.xml file
00243     """
00244
00245     # Load Schema if LAT has been created
00246     self.Hierarchy.clear()
00247     self.loadHierarchy(self.__lat, self.__xbrd)
00248     self.populateRegs(self.__lat)
00249     self.__ApplyChanges = 0
00250
00251   def loadHierarchy(self, lat, xbrd):
00252
00253     latItem = QListViewItem(self.Hierarchy)
00254     latItem.setPixmap(0, self.__image0)
00255     latItem.setText(0,self.trUtf8("GLAT"))
00256     latItem.setExpandable(1)
00257     latItem.setOpen(1)
00258
00259     self.Hierarchy.setCurrentItem(latItem)
00260
00261     self.__treeMap[latItem] = lat
00262     self.__labelMap[latItem] = None
00263
00264     #~ AEM Leg
00265     aem = lat.downAEM()
00266     if aem is not None:
00267       aemItem = QListViewItem(latItem)
00268       aemItem.setText(0,"GAEM")
00269       aemItem.setPixmap(0, self.__image0)
00270       aemItem.setOpen(1)
00271
00272       self.__treeMap[aemItem] = aem
00273       self.__labelMap[aemItem] = self.GAEMLabel
00274
00275       arcItem = None
00276       afeItem = None
00277
00278       for (arcId, arc) in aem.ARC.items():
00279         arcNewItem = QListViewItem(aemItem, arcItem)
00280         arcNewItem.setPixmap(0, self.__image0)
00281         arcNewItem.setText(0, "GARC " + str(arcId))
00282
00283         self.__treeMap[arcNewItem] = arc
00284         self.__labelMap[arcNewItem] = self.GARCLabel
00285
00286         for (afeId, afe) in arc.AFE.items():
00287           afeNewItem = QListViewItem(arcNewItem, afeItem)
00288           afeNewItem.setPixmap(0, self.__image0)
00289           afeNewItem.setText(0,"GAFE " + str(afeId))
00290
00291           self.__treeMap[afeNewItem] = afe
00292           self.__labelMap[afeNewItem] = self.GAFELabel
00293           afeItem = afeNewItem
00294         arcItem = arcNewItem
00295
00296       if aem.existsAEQ():
00297         aeq = aem.downAEQ()
00298         aeqItem = QListViewItem(aemItem)
00299         aeqItem.setText(0,"GAEQ")
00300         aeqItem.setPixmap(0, self.__image0)
00301
00302         self.__treeMap[aeqItem] = aeq
00303         self.__labelMap[aeqItem] = self.GAEQLabel
00304
00305     #~ TEM Leg
00306
00307     # Initialize this parameters to store the list view items in the right order:
00308     # after the previous item. For example tccNewItem = QListViewItem(temNewItem, tccItem)
00309     temItem = None
00310     cccItem = None
00311     crcItem = None
00312     cfeItem = None
00313     tccItem = None
00314     trcItem = None
00315     tfeItem = None
00316
00317     for (temId, tem) in lat.TEM.items():
00318       #~ print "TEM ID: ", temId
00319       self.TEMTab.setCurrentPage(2)
00320
00321       temNewItem = QListViewItem(latItem, temItem)
00322       temNewItem.setText(0,"GTEM " + str(temId))
00323       temNewItem.setPixmap(0, self.__image0)
00324
00325       self.__treeMap[temNewItem] = tem
00326       self.__labelMap[temNewItem] = self.GTEMLabel
00327
00328
00329
00330       for (tccId, tcc) in tem.TCC.items():
00331         if tccId != 255:
00332           tccNewItem = QListViewItem(temNewItem, tccItem)
00333           tccNewItem.setPixmap(0, self.__image0)
00334           tccNewItem.setText(0,"GTCC " + str(tccId))
00335
00336           self.__treeMap[tccNewItem] = tcc
00337           self.__labelMap[tccNewItem] = self.GTCCLabel
00338
00339           for (trcId, trc) in tcc.TRC.items():
00340             if trcId != 255:
00341               trcNewItem = QListViewItem(tccNewItem, trcItem)
00342               trcNewItem.setPixmap(0, self.__image0)
00343               trcNewItem.setText(0,"GTRC " + str(trcId))
00344
00345               self.__treeMap[trcNewItem] = trc
00346               self.__labelMap[trcNewItem] = self.GTRCLabel
00347
00348               for (tfeId, tfe) in trc.TFE.items():
00349                 if tfeId != 255:
00350                   tfeNewItem = QListViewItem(trcNewItem, tfeItem)
00351                   tfeNewItem.setPixmap(0, self.__image0)
00352                   tfeNewItem.setText(0,"GTFE " + str(tfeId))
00353
00354                   self.__treeMap[tfeNewItem] = tfe
00355                   self.__labelMap[tfeNewItem] = self.GTFELabel
00356
00357                   tfeItem = tfeNewItem
00358               trcItem = trcNewItem
00359           tccItem = tccNewItem
00360       temItem = temNewItem
00361
00362       for (cccId, ccc) in tem.CCC.items():
00363         if cccId != 255:
00364           cccNewItem = QListViewItem(temNewItem, cccItem)
00365           cccNewItem.setPixmap(0, self.__image0)
00366           cccNewItem.setText(0,"GCCC " + str(cccId))
00367
00368           self.__treeMap[cccNewItem] = ccc
00369           self.__labelMap[cccNewItem] = self.GCCCLabel
00370
00371           for (crcId, crc) in ccc.CRC.items():
00372             if crcId != 255:
00373               crcNewItem = QListViewItem(cccNewItem, crcItem)
00374               crcNewItem.setPixmap(0, self.__image0)
00375               crcNewItem.setText(0,"GCRC " + str(crcId))
00376
00377               self.__treeMap[crcNewItem] = crc
00378               self.__labelMap[crcNewItem] = self.GCRCLabel
00379
00380               for (cfeId, cfe) in crc.CFE.items():
00381                 if cfeId != 255:
00382                   cfeNewItem = QListViewItem(crcNewItem, cfeItem)
00383                   cfeNewItem.setPixmap(0, self.__image0)
00384                   cfeNewItem.setText(0,"GCFE " + str(cfeId))
00385
00386                   self.__treeMap[cfeNewItem] = cfe
00387                   self.__labelMap[cfeNewItem] = self.GCFELabel
00388
00389                   cfeItem = cfeNewItem
00390               crcItem = crcNewItem
00391           cccItem = cccNewItem
00392       temItem = temNewItem
00393
00394       if tem.existsTIC():
00395         tic = tem.downTIC()
00396         ticItem = QListViewItem(temItem)
00397         ticItem.setText(0,"GTIC")
00398         ticItem.setPixmap(0, self.__image0)
00399
00400         self.__treeMap[ticItem] = tic
00401         self.__labelMap[ticItem] = self.GTICLabel
00402
00403     #~ EBM Leg
00404     ebm = lat.downEBM()
00405     if ebm is not None:
00406       ebmItem = QListViewItem(latItem)
00407       ebmItem.setText(0,self.trUtf8("GEBM"))
00408       ebmItem.setPixmap(0, self.__image0)
00409       ebmItem.setOpen(1)
00410
00411       self.__treeMap[ebmItem] = ebm
00412       self.__labelMap[ebmItem] = self.GEBMLabel
00413
00414       if ebm.existsEBMST():
00415         ebmst = ebm.downEBMST()
00416         ebmstItem = QListViewItem(ebmItem)
00417         ebmstItem.setText(0,"GEBMST")
00418         ebmstItem.setPixmap(0, self.__image0)
00419
00420         self.__treeMap[ebmstItem] = ebmst
00421         self.__labelMap[ebmstItem] = self.GEBMSTLabel
00422
00423       if ebm.existsEBMC():
00424         ebmc = ebm.downEBMC()
00425         ebmcItem = QListViewItem(ebmItem)
00426         ebmcItem.setText(0,"GEBMC")
00427         ebmcItem.setPixmap(0, self.__image0)
00428
00429         self.__treeMap[ebmcItem] = ebmc
00430         self.__labelMap[ebmcItem] = self.GEBMCLabel
00431
00432     #~ GEM Leg
00433     gem = lat.downGEM()
00434     if gem is not None:
00435       gemItem = QListViewItem(latItem)
00436       gemItem.setText(0,self.trUtf8("GGEM"))
00437       gemItem.setPixmap(0, self.__image0)
00438       gemItem.setOpen(1)
00439
00440       self.__treeMap[gemItem] = gem
00441       self.__labelMap[gemItem] = self.GGEMLabel
00442
00443
00444       if gem.existsGEMW():
00445         gemw = gem.downGEMW()
00446         gemwItem = QListViewItem(gemItem)
00447         gemwItem.setText(0,"GGEMW")
00448         gemwItem.setPixmap(0, self.__image0)
00449
00450         self.__treeMap[gemwItem] = gemw
00451         self.__labelMap[gemwItem] = self.GGEMWLabel
00452
00453       if gem.existsGEMIE():
00454         gemie = gem.downGEMIE()
00455         gemieItem = QListViewItem(gemItem)
00456         gemieItem.setText(0,"GGEMIE")
00457         gemieItem.setPixmap(0, self.__image0)
00458
00459         self.__treeMap[gemieItem] = gemie
00460         self.__labelMap[gemieItem] = self.GGEMIELabel
00461
00462       if gem.existsGEMVG():
00463         gemvg = gem.downGEMVG()
00464         gemvgItem = QListViewItem(gemItem)
00465         gemvgItem.setText(0,"GGEMVG")
00466         gemvgItem.setPixmap(0, self.__image0)
00467
00468         self.__treeMap[gemvgItem] = gemvg
00469         self.__labelMap[gemvgItem] = self.GGEMVGLabel
00470
00471       if gem.existsGEMSC():
00472         gemsc = gem.downGEMSC()
00473         gemscItem = QListViewItem(gemItem)
00474         gemscItem.setText(0,"GGEMSC")
00475         gemscItem.setPixmap(0, self.__image0)
00476
00477         self.__treeMap[gemscItem] = gemsc
00478         self.__labelMap[gemscItem] = self.GGEMSCLabel
00479
00480       if gem.existsGEMST():
00481         gemst = gem.downGEMST()
00482         gemstItem = QListViewItem(gemItem)
00483         gemstItem.setText(0,"GGEMST")
00484         gemstItem.setPixmap(0, self.__image0)
00485
00486         self.__treeMap[gemstItem] = gemst
00487         self.__labelMap[gemstItem] = self.GGEMSTLabel
00488
00489       if gem.existsGEMMG():
00490         gemmg = gem.downGEMMG()
00491         gemmgItem = QListViewItem(gemItem)
00492         gemmgItem.setText(0,"GGEMMG")
00493         gemmgItem.setPixmap(0, self.__image0)
00494
00495         self.__treeMap[gemmgItem] = gemmg
00496         self.__labelMap[gemmgItem] = self.GGEMMGLabel
00497
00498       if gem.existsGEMC():
00499         gemc = gem.downGEMC()
00500         gemcItem = QListViewItem(gemItem)
00501         gemcItem.setText(0,"GGEMC")
00502         gemcItem.setPixmap(0, self.__image0)
00503
00504         self.__treeMap[gemcItem] = gemc
00505         self.__labelMap[gemcItem] = self.GGEMCLabel
00506
00507     #~ CRU Leg
00508     cru = lat.downCRU()
00509     if cru is not None:
00510       cruItem = QListViewItem(latItem)
00511       cruItem.setText(0,self.trUtf8("GCRU"))
00512       cruItem.setPixmap(0, self.__image0)
00513       cruItem.setOpen(1)
00514
00515       self.__treeMap[cruItem] = cru
00516       self.__labelMap[cruItem] = self.GCRULabel
00517
00518     #~ PDU Leg
00519     pduItem = None
00520     for (pduId, pdu) in lat.PDU.items():
00521       pduItem = QListViewItem(latItem, pduItem)
00522       pduItem.setText(0,"GPDU " + str(pduId))
00523       pduItem.setPixmap(0, self.__image0)
00524       pduItem.setOpen(0)
00525
00526       self.__treeMap[pduItem] = pdu
00527       self.__labelMap[pduItem] = self.GPDULabel
00528       if pdu.existsPEQ():
00529         peq = pdu.downPEQ()
00530         peqItem = QListViewItem(pduItem)
00531         peqItem.setText(0,"GPEQ")
00532         peqItem.setPixmap(0, self.__image0)
00533
00534         self.__treeMap[peqItem] = peq
00535         self.__labelMap[peqItem] = self.GPEQLabel
00536
00537
00538     #~ GLT Leg
00539     if xbrd is not None:
00540       glt = xbrd.downGLT()
00541       if glt is not None:
00542         gltItem = QListViewItem(latItem)
00543         gltItem.setText(0,self.trUtf8("GGLT"))
00544         gltItem.setPixmap(0, self.__image0)
00545         gltItem.setOpen(1)
00546
00547         self.__treeMap[gltItem] = glt
00548         self.__labelMap[gltItem] = self.GGLTLabel
00549
00550     lcbItem = QListViewItem(latItem)
00551     lcbItem.setText(0,"GLCB")
00552     lcbItem.setPixmap(0, self.__image0)
00553
00554     self.__treeMap[lcbItem] = lat.LCB
00555     self.__labelMap[lcbItem] = self.GLCBLabel
00556
00557     lcbstatsItem = QListViewItem(lcbItem)
00558     lcbstatsItem.setText(0,"GLCBSTATS")
00559     lcbstatsItem.setPixmap(0, self.__image0)
00560
00561     self.__treeMap[lcbstatsItem] = lat.LCB.stats
00562     self.__labelMap[lcbstatsItem] = self.GLCBSTATSLabel
00563
00564     lcbItem = QListViewItem(latItem)
00565     lcbItem.setText(0,"GOCS")
00566     lcbItem.setPixmap(0, self.__image0)
00567
00568     self.__treeMap[lcbItem] = self.__ocs
00569     self.__labelMap[lcbItem] = self.GOCSLabel
00570
00571   def populateRegs(self, lat):
00572     #~ lat = self.__lat
00573     self.TEMTab.setCurrentPage(0)
00574     self.updateList(GLAT._GLAT__attrs, self.GLAT_Regs)
00575     self.updateList(GLCB._GLCB__attrs, self.GLCB_Regs)
00576     self.updateList(GLCBSTATS._GLCBSTATS__attrs, self.GLCBSTATS_Regs)
00577     self.updateList(GOCS._GOCS__attrs, self.GOCS_Regs)
00578
00579     #~ AEM LEg
00580     self.updateList(GAEM._GAEM__attrs, self.GAEM_Regs)
00581
00582     self.updateList(GAEQ._GAEQ__attrs, self.GAEQ_Regs)
00583
00584     self.updateList(GARC._GARC__attrs, self.GARC_Regs)
00585
00586     self.updateList(GAFE._GAFE__attrs, self.GAFE_Regs)
00587
00588     #~ TEM LEg
00589     tem = None
00590     #if lat._GLAT__childrenTEM.keys() is not None:
00591     self.updateList(GTEM._GTEM__attrs, self.GTEM_Regs)
00592     self.updateList(GTEM._GTEM__attrs, self.GTEM_Regs2)
00593
00594     #~ tem = lat.downTEM(temId)
00595     self.updateList(GCCC._GCCC__attrs, self.GCCC_Regs)
00596     self.updateList(GCRC._GCRC__attrs, self.GCRC_Regs)
00597     self.updateList(GCFE._GCFE__attrs, self.GCFE_Regs)
00598     self.updateList(GTCC._GTCC__attrs, self.GTCC_Regs)
00599     self.updateList(GTRC._GTRC__attrs, self.GTRC_Regs)
00600     self.updateList(GTFE._GTFE__attrs, self.GTFE_Regs)
00601     self.updateList(GTIC._GTIC__attrs, self.GTIC_Regs)
00602
00603     #~ EBM Leg
00604     self.updateList(GEBM._GEBM__attrs, self.GEBM_Regs)
00605     self.updateList(GEBMC._GEBMC__attrs, self.GEBMC_Regs)
00606     self.updateList(GEBMST._GEBMST__attrs, self.GEBMST_Regs)
00607
00608     #~ GEM Leg
00609     self.updateList(GGEM._GGEM__attrs, self.GGEM_Regs)
00610     self.updateList(GGEMC._GGEMC__attrs, self.GGEMC_Regs)
00611     self.updateList(GGEMMG._GGEMMG__attrs, self.GGEMMG_Regs)
00612     self.updateList(GGEMST._GGEMST__attrs, self.GGEMST_Regs)
00613     self.updateList(GGEMSC._GGEMSC__attrs, self.GGEMSC_Regs)
00614     self.updateList(GGEMVG._GGEMVG__attrs, self.GGEMVG_Regs)
00615     self.updateList(GGEMIE._GGEMIE__attrs, self.GGEMIE_Regs)
00616     self.updateList(GGEMW._GGEMW__attrs, self.GGEMW_Regs)
00617
00618     #~ CRU Leg
00619     self.updateList(GCRU._GCRU__attrs, self.GCRU_Regs)
00620
00621     #~ GLT Leg
00622     self.updateList(GGLT._GGLT__attrs, self.GGLT_Regs)
00623
00624     #~ PDU Leg
00625     self.updateList(GPDU._GPDU__attrs, self.GPDU_Regs)
00626     self.updateList(GPEQ._GPEQ__attrs, self.GPEQ_Regs)
00627
00628
00629 #  def updateList(self, parent, regList, listView):
00630 #    listView.clear()
00631 #    #listView.setFont(QFont("Tahoma"))
00632 #    listView.header().setMovingEnabled(0)
00633 #    listView.setColumnWidth(0,160)
00634 #    listView.setColumnWidth(1,20)
00635 #    listView.setColumnAlignment(1,self.AlignRight)
00636 #    listView.setColumnAlignment(2,self.AlignRight)
00637 #    listView.setColumnAlignment(3,self.AlignRight)
00638 #    listView.setColumnWidth(2,80)
00639
00640 #    regList.sort()
00641
00642 #    for reg in regList:
00643 #      if parent.regs[str(reg)].size() != 0 and not \
00644 #         ( parent.regs[str(reg)].isWriteOnly()  or \
00645 #           parent.regs[str(reg)].isNoDirectAccess() ):
00646 #        item = RegViewItem(listView)
00647 #        item.setText(0, str(reg))
00648
00649   def updateList(self, regList, listView):
00650     def cmpByName(r1, r2):
00651       return cmp(r1.getName(), r2.getName())
00652
00653     listView.clear()
00654     #listView.setFont(QFont("Tahoma"))
00655     listView.header().setMovingEnabled(0)
00656     listView.setColumnWidth(0,160)
00657     listView.setColumnWidth(1,20)
00658     listView.setColumnAlignment(1,self.AlignRight)
00659     listView.setColumnAlignment(2,self.AlignRight)
00660     listView.setColumnAlignment(3,self.AlignRight)
00661     listView.setColumnWidth(2,80)
00662
00663     regList.sort(cmpByName)
00664
00665     for reg in regList:
00666       if reg.size() != 0 and \
00667          not reg.isDeprecated() and \
00668          not ( reg.isWriteOnly()  or \
00669                reg.isNoDirectAccess() ):
00670         item = RegViewItem(listView)
00671         item.setText(0, reg.getName())
00672
00673   def selectItem(self, item):
00674     """ This function calls the clearViews function to clear all the register lists
00675         from the Tab window and then shows the registers of the selected Hierarchy
00676         node as well as upper level nodes """
00677
00678     #~ if str(self.__filename) == "":
00679       #~ print "No Schema loaded"
00680       #~ self.statusBar().message('No Schema loaded', 2000)
00681       #~ return
00682
00683     # Setup Defaults
00684     self.setDefaults()
00685
00686     # Update selected Item
00687     #self.updateSelection()
00688
00689     self.__lock.acquire()
00690     label = self.__labelMap[self.getCurrentItem()]
00691     parentLabel = self.__labelMap[self.getCurrentParent()]
00692     grandParentLabel = self.__labelMap[self.getCurrentGrandParent()]
00693     greatGrandParentLabel = self.__labelMap[self.getCurrentGreatGrandParent()]
00694     self.__lock.release()
00695
00696     text = "GLAT"
00697     if label is not None:
00698       label.setText(self.getCurrentItem().text(0))
00699       text = str(label.text())
00700
00701     if parentLabel is not None:
00702       parentLabel.setText(self.getCurrentParent().text(0))
00703       text = str(parentLabel.text()) + ", " + text
00704       #~ browseLabel = str(self.getCurrentGreatGrandParent().text(0))
00705
00706     if grandParentLabel is not None:
00707       grandParentLabel.setText(self.getCurrentGrandParent().text(0))
00708       text = str(grandParentLabel.text()) + ", " + text
00709
00710     if greatGrandParentLabel is not None:
00711       greatGrandParentLabel.setText(self.getCurrentGreatGrandParent().text(0))
00712       text = str(greatGrandParentLabel.text()) + ", " + text
00713
00714     self.Browsing.setText(text)
00715
00716     if str(self.Browsing.text()) == "GLAT":
00717       self.TEMTab.setCurrentPage(0)
00718
00719     if str(self.Browsing.text()) == "GLCB":
00720       self.TEMTab.setCurrentPage(0)
00721
00722     if self.Browsing.text().contains("GLCBSTATS"):
00723       self.TEMTab.setCurrentPage(0)
00724
00725     if str(self.Browsing.text()) == "GOCS":
00726       self.TEMTab.setCurrentPage(0)
00727
00728     if self.Browsing.text().contains("GAEM"):
00729       self.TEMTab.setCurrentPage(1)
00730
00731     if self.Browsing.text().contains("GTEM"):
00732       self.TEMTab.setCurrentPage(2)
00733
00734     if self.Browsing.text().contains("GCCC"):
00735       self.TEMTab.setCurrentPage(2)
00736
00737     if self.Browsing.text().contains("GTCC"):
00738       self.TEMTab.setCurrentPage(3)
00739
00740     if self.Browsing.text().contains("GTIC"):
00741       self.TEMTab.setCurrentPage(4)
00742
00743     if self.Browsing.text().contains("GEBM"):
00744       self.TEMTab.setCurrentPage(5)
00745
00746     if self.Browsing.text().contains("GGEM"):
00747       self.TEMTab.setCurrentPage(6)
00748
00749     if self.Browsing.text().contains("GGEMC"):
00750       self.TEMTab.setCurrentPage(6)
00751
00752     if self.Browsing.text().contains("GGEMMG"):
00753       self.TEMTab.setCurrentPage(6)
00754
00755     if self.Browsing.text().contains("GGEMST"):
00756       self.TEMTab.setCurrentPage(6)
00757
00758     if self.Browsing.text().contains("GGEMSC"):
00759       self.TEMTab.setCurrentPage(7)
00760
00761     if self.Browsing.text().contains("GGEMVG"):
00762       self.TEMTab.setCurrentPage(7)
00763
00764     if self.Browsing.text().contains("GGEMIE"):
00765       self.TEMTab.setCurrentPage(7)
00766
00767     if self.Browsing.text().contains("GGEMW"):
00768       self.TEMTab.setCurrentPage(7)
00769
00770     if self.Browsing.text().contains("GCRU"):
00771       self.TEMTab.setCurrentPage(8)
00772
00773     if self.Browsing.text().contains("GPDU"):
00774       self.TEMTab.setCurrentPage(9)
00775
00776     if self.Browsing.text().contains("GPEQ"):
00777       self.TEMTab.setCurrentPage(9)
00778
00779     if self.Browsing.text().contains("GGLT"):
00780       self.TEMTab.setCurrentPage(10)
00781
00782     #self.__lock.acquire()
00783     self.fillViews()
00784     #self.__lock.release()
00785
00786
00787   def fillViews(self):
00788     node = self.__treeMap[self.getCurrentItem()]
00789
00790     #~ parentNode = self.__treeMap[self.getCurrentParent()]
00791     #~ grandParentNode = self.__treeMap[self.getCurrentGrandParent()]
00792     #~ greatGrandParentNode = self.__treeMap[self.getCurrentGreatGrandParent()]
00793
00794     #~ self.TEMTab.setCurrentPage(0)
00795
00796     if self.getCurrentItem().text(0).startsWith("GLAT"):
00797       self.fillRegsView(node, self.GLAT_Regs)
00798       return
00799
00800     if str(self.getCurrentItem().text(0)) == "GLCB":
00801       parentNode = self.__treeMap[self.getCurrentParent()]
00802       self.fillRegsView(node, self.GLCB_Regs)
00803       self.fillRegsView(parentNode, self.GLAT_Regs)
00804       return
00805
00806     if str(self.getCurrentItem().text(0)) == "GLCBSTATS":
00807       parentNode = self.__treeMap[self.getCurrentParent()]
00808       grandParentNode = self.__treeMap[self.getCurrentGrandParent()]
00809       self.fillRegsView(node, self.GLCBSTATS_Regs)
00810       self.fillRegsView(parentNode, self.GLCB_Regs)
00811       self.fillRegsView(grandParentNode, self.GLAT_Regs)
00812       return
00813
00814     if str(self.getCurrentItem().text(0)) == "GOCS":
00815       parentNode = self.__treeMap[self.getCurrentParent()]
00816       self.fillRegsView(node, self.GOCS_Regs)
00817       self.fillRegsView(parentNode, self.GLAT_Regs)
00818       return
00819
00820     #~ AEM Leg
00821     if self.getCurrentItem().text(0).startsWith("GAEM"):
00822       #~ self.TEMTab.setCurrentPage(0)
00823       self.fillRegsView(node, self.GAEM_Regs)
00824       return
00825
00826     elif self.getCurrentItem().text(0).startsWith("GAEQ"):
00827       #~ self.TEMTab.setCurrentPage(0)
00828       parentNode = self.__treeMap[self.getCurrentParent()]
00829       self.fillRegsView(node, self.GAEQ_Regs)
00830       self.fillRegsView(parentNode, self.GAEM_Regs)
00831       return
00832
00833     elif self.getCurrentItem().text(0).startsWith("GARC"):
00834       #~ self.TEMTab.setCurrentPage(0)
00835       parentNode = self.__treeMap[self.getCurrentParent()]
00836       self.fillRegsView(node, self.GARC_Regs)
00837       self.fillRegsView(parentNode, self.GAEM_Regs)
00838       return
00839
00840     elif self.getCurrentItem().text(0).startsWith("GAFE"):
00841       #~ self.TEMTab.setCurrentPage(0)
00842       parentNode = self.__treeMap[self.getCurrentParent()]
00843       grandParentNode = self.__treeMap[self.getCurrentGrandParent()]
00844       self.fillRegsView(node, self.GAFE_Regs)
00845       self.fillRegsView(parentNode, self.GARC_Regs)
00846       self.fillRegsView(grandParentNode, self.GAEM_Regs)
00847       return
00848
00849     #~ TEM Leg
00850     #~ self.TEMTab.setCurrentPage(2)
00851
00852     if self.getCurrentItem().text(0).startsWith("GTEM"):
00853       #~ self.TEMTab.setCurrentPage(2)
00854       self.GTEMLabel2.setText(self.getCurrentItem().text(0))
00855       self.fillRegsView(node, self.GTEM_Regs)
00856       self.fillRegsView(node, self.GTEM_Regs2)
00857       return
00858
00859     elif self.getCurrentItem().text(0).startsWith("GTCC"):
00860       #~ self.TEMTab.setCurrentPage(2)
00861       self.GTEMLabel2.setText(self.getCurrentParent().text(0))
00862       parentNode = self.__treeMap[self.getCurrentParent()]
00863       self.fillRegsView(node, self.GTCC_Regs)
00864       self.fillRegsView(parentNode, self.GTEM_Regs)
00865       self.fillRegsView(parentNode, self.GTEM_Regs2)
00866       return
00867
00868     elif self.getCurrentItem().text(0).startsWith("GTRC"):
00869       #~ self.TEMTab.setCurrentPage(2)
00870       self.GTEMLabel2.setText(self.getCurrentGrandParent().text(0))
00871       parentNode = self.__treeMap[self.getCurrentParent()]
00872       grandParentNode = self.__treeMap[self.getCurrentGrandParent()]
00873       self.fillRegsView(node, self.GTRC_Regs)
00874       self.fillRegsView(parentNode, self.GTCC_Regs)
00875       self.fillRegsView(grandParentNode, self.GTEM_Regs)
00876       self.fillRegsView(grandParentNode, self.GTEM_Regs2)
00877       return
00878
00879     elif self.getCurrentItem().text(0).startsWith("GTFE"):
00880       #~ self.TEMTab.setCurrentPage(2)
00881       self.GTEMLabel2.setText(self.getCurrentGreatGrandParent().text(0))
00882       parentNode = self.__treeMap[self.getCurrentParent()]
00883       grandParentNode = self.__treeMap[self.getCurrentGrandParent()]
00884       greatGrandParentNode = self.__treeMap[self.getCurrentGreatGrandParent()]
00885       self.fillRegsView(node, self.GTFE_Regs)
00886       self.fillRegsView(parentNode, self.GTRC_Regs)
00887       self.fillRegsView(grandParentNode, self.GTCC_Regs)
00888       self.fillRegsView(greatGrandParentNode, self.GTEM_Regs)
00889       self.fillRegsView(greatGrandParentNode, self.GTEM_Regs2)
00890       return
00891
00892     #~ self.TEMTab.setCurrentPage(1)
00893
00894     if self.getCurrentItem().text(0).startsWith("GCCC"):
00895       #~ self.TEMTab.setCurrentPage(1)
00896       parentNode = self.__treeMap[self.getCurrentParent()]
00897       self.fillRegsView(node, self.GCCC_Regs)
00898       self.fillRegsView(parentNode, self.GTEM_Regs)
00899       self.fillRegsView(parentNode, self.GTEM_Regs2)
00900       return
00901
00902     elif self.getCurrentItem().text(0).startsWith("GCRC"):
00903       #~ self.TEMTab.setCurrentPage(1)
00904       parentNode = self.__treeMap[self.getCurrentParent()]
00905       grandParentNode = self.__treeMap[self.getCurrentGrandParent()]
00906       self.fillRegsView(node, self.GCRC_Regs)
00907       self.fillRegsView(parentNode, self.GCCC_Regs)
00908       self.fillRegsView(grandParentNode, self.GTEM_Regs)
00909       self.fillRegsView(grandParentNode, self.GTEM_Regs2)
00910       return
00911
00912     elif self.getCurrentItem().text(0).startsWith("GCFE"):
00913       #~ self.TEMTab.setCurrentPage(1)
00914       parentNode = self.__treeMap[self.getCurrentParent()]
00915       grandParentNode = self.__treeMap[self.getCurrentGrandParent()]
00916       greatGrandParentNode = self.__treeMap[self.getCurrentGreatGrandParent()]
00917       self.fillRegsView(node, self.GCFE_Regs)
00918       self.fillRegsView(parentNode, self.GCRC_Regs)
00919       self.fillRegsView(grandParentNode, self.GCCC_Regs)
00920       self.fillRegsView(greatGrandParentNode, self.GTEM_Regs)
00921       self.fillRegsView(greatGrandParentNode, self.GTEM_Regs2)
00922       return
00923
00924     if self.getCurrentItem().text(0).startsWith("GTIC"):
00925       self.fillRegsView(node, self.GTIC_Regs)
00926       return
00927
00928     #~ EBM Leg
00929     if self.getCurrentItem().text(0).endsWith("GEBM"):
00930       #~ self.TEMTab.setCurrentPage(5)
00931       self.fillRegsView(node, self.GEBM_Regs)
00932       return
00933
00934     if self.getCurrentItem().text(0).endsWith("GEBMC"):
00935       #~ self.TEMTab.setCurrentPage(0)
00936       parentNode = self.__treeMap[self.getCurrentParent()]
00937       self.fillRegsView(node, self.GEBMC_Regs)
00938       self.fillRegsView(parentNode, self.GEBM_Regs)
00939       return
00940
00941     elif self.getCurrentItem().text(0).endsWith("GEBMST"):
00942       #~ self.TEMTab.setCurrentPage(0)
00943       parentNode = self.__treeMap[self.getCurrentParent()]
00944       self.fillRegsView(node, self.GEBMST_Regs)
00945       self.fillRegsView(parentNode, self.GEBM_Regs)
00946       return
00947
00948     #~ GEM Leg
00949     if self.getCurrentItem().text(0).endsWith("GGEM"):
00950       #~ self.TEMTab.setCurrentPage(5)
00951       self.fillRegsView(node, self.GGEM_Regs)
00952       return
00953
00954     elif self.getCurrentItem().text(0).endsWith("GGEMC"):
00955       #~ self.TEMTab.setCurrentPage(6)
00956       parentNode = self.__treeMap[self.getCurrentParent()]
00957       self.fillRegsView(node, self.GGEMC_Regs)
00958       self.fillRegsView(parentNode, self.GGEM_Regs)
00959       return
00960
00961     elif self.getCurrentItem().text(0).endsWith("GGEMMG"):
00962       #~ self.TEMTab.setCurrentPage(6)
00963       parentNode = self.__treeMap[self.getCurrentParent()]
00964       self.fillRegsView(node, self.GGEMMG_Regs)
00965       self.fillRegsView(parentNode, self.GGEM_Regs)
00966       return
00967
00968     elif self.getCurrentItem().text(0).endsWith("GGEMST"):
00969       #~ self.TEMTab.setCurrentPage(6)
00970       parentNode = self.__treeMap[self.getCurrentParent()]
00971       self.fillRegsView(node, self.GGEMST_Regs)
00972       self.fillRegsView(parentNode, self.GGEM_Regs)
00973       return
00974
00975     elif self.getCurrentItem().text(0).endsWith("GGEMSC"):
00976       #~ self.TEMTab.setCurrentPage(7)
00977       parentNode = self.__treeMap[self.getCurrentParent()]
00978       self.fillRegsView(node, self.GGEMSC_Regs)
00979       self.fillRegsView(parentNode, self.GGEM_Regs)
00980       return
00981
00982     elif self.getCurrentItem().text(0).endsWith("GGEMVG"):
00983       #~ self.TEMTab.setCurrentPage(7)
00984       parentNode = self.__treeMap[self.getCurrentParent()]
00985       self.fillRegsView(node, self.GGEMVG_Regs)
00986       self.fillRegsView(parentNode, self.GGEM_Regs)
00987       return
00988
00989     elif self.getCurrentItem().text(0).endsWith("GGEMIE"):
00990       #~ self.TEMTab.setCurrentPage(7)
00991       parentNode = self.__treeMap[self.getCurrentParent()]
00992       self.fillRegsView(node, self.GGEMIE_Regs)
00993       self.fillRegsView(parentNode, self.GGEM_Regs)
00994       return
00995
00996     elif self.getCurrentItem().text(0).endsWith("GGEMW"):
00997       #~ self.TEMTab.setCurrentPage(7)
00998       parentNode = self.__treeMap[self.getCurrentParent()]
00999       self.fillRegsView(node, self.GGEMW_Regs)
01000       self.fillRegsView(parentNode, self.GGEM_Regs)
01001       return
01002
01003     #~ CRU Leg
01004     if self.getCurrentItem().text(0).startsWith("GCRU"):
01005       #~ self.TEMTab.setCurrentPage(8)
01006       self.fillRegsView(node, self.GCRU_Regs)
01007       return
01008
01009     #~ PDU Leg
01010     if self.getCurrentItem().text(0).startsWith("GPDU"):
01011       #~ self.TEMTab.setCurrentPage(0)
01012       self.fillRegsView(node, self.GPDU_Regs)
01013       return
01014
01015     elif self.getCurrentItem().text(0).startsWith("GPEQ"):
01016       #~ self.TEMTab.setCurrentPage(0)
01017       parentNode = self.__treeMap[self.getCurrentParent()]
01018       self.fillRegsView(node, self.GPEQ_Regs)
01019       self.fillRegsView(parentNode, self.GPDU_Regs)
01020       return
01021
01022     #~ GLT Leg
01023     if self.getCurrentItem().text(0).startsWith("GGLT"):
01024       #~ self.TEMTab.setCurrentPage(9)
01025       self.fillRegsView(node, self.GGLT_Regs)
01026       return
01027
01028
01029   def getCurrentItem(self):
01030     currentItem = self.Hierarchy.currentItem()
01031     return currentItem
01032
01033   def getCurrentParent(self):
01034     if self.getCurrentItem().parent() is not None:
01035       currentParent = self.getCurrentItem().parent()
01036     else:
01037       currentParent = self.Hierarchy.firstChild()
01038     return currentParent
01039
01040   def getCurrentGrandParent(self):
01041     if self.getCurrentParent().parent() is not None:
01042       currentGrandParent = self.getCurrentParent().parent()
01043     else:
01044       currentGrandParent = self.Hierarchy.firstChild()
01045     return currentGrandParent
01046
01047   def getCurrentGreatGrandParent(self):
01048     if self.getCurrentGrandParent().parent() is not None:
01049       currentGreatGrandParent = self.getCurrentGrandParent().parent()
01050     else:
01051       currentGreatGrandParent = self.Hierarchy.firstChild()
01052     return currentGreatGrandParent
01053
01054
01055   def fillRegsView(self, parent, listView):
01056     listItem = listView.firstChild()
01057
01058     while listItem != None:
01059       name = str(listItem.text(0))
01060       #if parent.regs[name].isWriteOnly():
01061       #  continue
01062
01063       #if parent.regs[name].isNoDirectAccess():
01064       #  continue
01065
01066       retryCount = 3
01067       while True:
01068         try:
01069           if QString.compare(self.Conversion.text(), "EGU") == 0:
01070             value = parent.regs[name].get()
01071           else:
01072             value = parent.regs[name].get(bypass = 1)
01073
01074           size = parent.regs[name].size()
01075           listItem.setText(1,str(size))
01076
01077           if self.__base == 1:
01078             fmt = "0x%0" + str(size*2) + "x "
01079             listItem.setText(3, fmt % value)
01080           else:
01081             listItem.setText(3,str(value) + " ")
01082
01083           tstamp = parent.regs[name].getTimeStamp()
01084           if tstamp == -1:
01085             strTime = ''
01086           else:
01087             strTime = time.strftime('%H:%M:%S', time.gmtime(tstamp)) + " + %03d" % (math.modf(tstamp)[0]*1000)
01088           listItem.setText(2,strTime)
01089           listItem.setError(0)
01090           break
01091         except LATInterfaceException:
01092           if sys.exc_info()[1].errstr()[0] == 'OCS_BDADC' and retryCount > 1:
01093             retryCount =- 1
01094             continue
01095           else:
01096             listItem.setText(3, "%s - %s (0x%08x)"
01097                                 % (sys.exc_info()[1].errstr()[0], sys.exc_info()[1].errstr()[1], sys.exc_info()[1].status)
01098                             )
01099             listItem.setError(1)
01100             break
01101       listItem = listItem.nextSibling()
01102
01103   def setDefaults(self):
01104
01105     self.TEMTab.setEnabled(1)
01106
01107     #~ self.GAEM_Regs.setEnabled(0)
01108     #~ self.GARC_Regs.setEnabled(0)
01109     #~ self.GAFE_Regs.setEnabled(0)
01110
01111     #~ self.GTEM_Regs.setEnabled(0)
01112     #~ self.GCCC_Regs.setEnabled(0)
01113     #~ self.GCRC_Regs.setEnabled(0)
01114     #~ self.GCFE_Regs.setEnabled(0)
01115
01116     #~ self.GTEM_Regs2.setEnabled(0)
01117     #~ self.GTCC_Regs.setEnabled(0)
01118     #~ self.GTRC_Regs.setEnabled(0)
01119     #~ self.GTFE_Regs.setEnabled(0)
01120
01121
01122     #~ self.TEMTab.page(0).setEnabled(0)
01123     #~ self.TEMTab.page(1).setEnabled(0)
01124     #~ self.TEMTab.page(2).setEnabled(0)
01125
01126     #~ self.TEMTab.setTabLabel(self.TEMTab.page(1), self.trUtf8("ACD") )
01127     #~ self.TEMTab.setTabLabel(self.TEMTab.page(2), self.trUtf8("CAL") )
01128     #~ self.TEMTab.setTabLabel(self.TEMTab.page(3), self.trUtf8("TKR") )
01129
01130     self.GLATLabel.setText("GLAT")
01131     self.GLCBLabel.setText("GLCB")
01132     self.GLCBSTATSLabel.setText("GLCBSTATS")
01133     self.GOCSLabel.setText("GOCS")
01134     self.GAEMLabel.setText("GAEM")
01135     self.GAEQLabel.setText("GAEQ")
01136     self.GARCLabel.setText("GARC")
01137     self.GAFELabel.setText("GAFE")
01138
01139     self.GTEMLabel.setText("GTEM")
01140     self.GTEMLabel2.setText("GTEM")
01141
01142     self.GCCCLabel.setText("GCCC")
01143     self.GCRCLabel.setText("GCRC")
01144     self.GCFELabel.setText("GCFE")
01145
01146     self.GTCCLabel.setText("GTCC")
01147     self.GTRCLabel.setText("GTRC")
01148     self.GTFELabel.setText("GTFE")
01149
01150     self.GEBMLabel.setText("GEBM")
01151     self.GEBMCLabel.setText("GEBMC")
01152     self.GEBMSTLabel.setText("GEBMST")
01153
01154     self.GGEMLabel.setText("GGEM")
01155     self.GGEMCLabel.setText("GGEMC")
01156     self.GGEMCLabel.setText("GGEMMG")
01157     self.GGEMSTLabel.setText("GGEMST")
01158     self.GGEMCLabel.setText("GGEMSC")
01159     self.GGEMCLabel.setText("GGEMVG")
01160     self.GGEMCLabel.setText("GGEMIE")
01161     self.GGEMCLabel.setText("GGEMW")
01162
01163     self.GCRULabel.setText("GCRU")
01164
01165     self.GGLTLabel.setText("GGLT")
01166
01167     self.clearViews()
01168
01169   def clearViews(self):
01170
01171     self.clearValues(self.GLAT_Regs)
01172     self.clearValues(self.GLCB_Regs)
01173     self.clearValues(self.GLCBSTATS_Regs)
01174     self.clearValues(self.GOCS_Regs)
01175     self.clearValues(self.GAEM_Regs)
01176     self.clearValues(self.GAEQ_Regs)
01177
01178     self.clearValues(self.GARC_Regs)
01179     self.clearValues(self.GAFE_Regs)
01180
01181     self.clearValues(self.GTEM_Regs)
01182     self.clearValues(self.GTEM_Regs2)
01183
01184     self.clearValues(self.GCCC_Regs)
01185     self.clearValues(self.GCRC_Regs)
01186     self.clearValues(self.GCFE_Regs)
01187
01188     self.clearValues(self.GTCC_Regs)
01189     self.clearValues(self.GTRC_Regs)
01190     self.clearValues(self.GTFE_Regs)
01191
01192     self.clearValues(self.GTIC_Regs)
01193
01194     self.clearValues(self.GEBM_Regs)
01195     self.clearValues(self.GEBMC_Regs)
01196     self.clearValues(self.GEBMST_Regs)
01197
01198     self.clearValues(self.GGEM_Regs)
01199     self.clearValues(self.GGEMC_Regs)
01200     self.clearValues(self.GGEMMG_Regs)
01201     self.clearValues(self.GGEMST_Regs)
01202     self.clearValues(self.GGEMSC_Regs)
01203     self.clearValues(self.GGEMVG_Regs)
01204     self.clearValues(self.GGEMIE_Regs)
01205     self.clearValues(self.GGEMW_Regs)
01206
01207     self.clearValues(self.GCRU_Regs)
01208
01209     self.clearValues(self.GPDU_Regs)
01210     self.clearValues(self.GPEQ_Regs)
01211
01212     self.clearValues(self.GGLT_Regs)
01213
01214   def clearValues(self, listView):
01215     regItem = listView.firstChild()
01216     while regItem != None:
01217       regItem.setError(0)
01218       regItem.setText(1, "" )
01219       regItem.setText(2, "" )
01220       regItem.setText(3, "" )
01221       if self.__openFile == 1:
01222         regItem.setText(0, "" )
01223       regItem = regItem.nextSibling()
01224
01225   def browserPreferences(self):
01226     self.__timer.stop()
01227     status = self.browserPreferences.exec_loop()
01228     if status == self.browserPreferences.Rejected:
01229       self.__timer.start(self.__step*1000, False)
01230     else:
01231       self.__step = float(str(self.browserPreferences.timestepValue.text()))
01232       self.__timer.start(self.__step*1000, False)
01233
01234       if self.browserPreferences.rawButton.isChecked():
01235         self.Conversion.setText("RAW")
01236       elif self.browserPreferences.eguButton.isChecked():
01237         self.Conversion.setText("EGU")
01238         self.browserPreferences.decButton.setChecked(1)
01239
01240       if self.browserPreferences.decButton.isChecked():
01241         self.viewDecimal.setOn(1)
01242       elif self.browserPreferences.hexButton.isChecked():
01243         self.viewHexadecimal.setOn(1)
01244
01245       if QString.compare(self.__filename, QString.null) != 0:
01246         self.selectItem(self.Hierarchy.currentItem())
01247
01248   def selectFile(self):
01249     fn = QFileDialog.getOpenFileName( QString.null, "(*.xml)", self )
01250     if not fn.isEmpty():
01251       self.__filename = fn
01252       self.loadSchema(str(self.__filename))
01253
01254   def fileNew(self):
01255     print "BrowserImpl.fileNew(): Not implemented yet"
01256   # public slot
01257
01258   def fileOpen(self):
01259     self.__timer.stop()
01260     #~ self.__lock.acquire()
01261
01262     self.__openFile = 1
01263     self.clearViews()
01264     self.__openFile = 0
01265
01266     self.selectFile()
01267     #~ self.__lock.release()
01268
01269
01270   def fileSave(self):
01271     print "BrowserImpl.fileSave(): Not implemented yet"
01272   # public slot
01273
01274   def fileSaveAs(self):
01275     print "BrowserImpl.fileSaveAs(): Not implemented yet"
01276   # public slot
01277
01278   def filePrint(self):
01279     Margin = 50
01280     self.__pageNo = 1
01281     #~ self.__column = [0, 130, 180]#, 180, 260, 400]#, 325] # Magic numbers
01282
01283     # If there are no items, don't try to print
01284     #~ if QString.compare(str(self.__filename), "") == 0:
01285     #if not self.Hierarchy.firstChild():
01286       #~ print "Can't print a non-loaded Browser"
01287       #~ return
01288
01289     if self.printer.setup(self):
01290       self.statusBar().message('Printing...')
01291
01292       self.__p = QPainter()
01293       self.__p.begin(self.printer)
01294       self.__p.setFont(self.GAEM_Regs.font())
01295       self.__yPos = 0
01296       self.__fm = self.__p.fontMetrics()
01297       self.__metrics = QPaintDeviceMetrics(self.printer)
01298
01299       self.__header = "GLAT Browser. Browsing: " + str(options.schema)
01300
01301       page = "Page: 1"
01302       self.__p.drawText(Margin,Margin + self.__yPos,self.__metrics.width(),self.__fm.lineSpacing(),\
01303                 Qt.ExpandTabs | Qt.DontClip, self.__header)
01304       self.__yPos = self.__yPos + self.__fm.lineSpacing()
01305       self.__p.drawText(Margin,Margin + self.__yPos,self.__metrics.width(),self.__fm.lineSpacing(),\
01306                 Qt.ExpandTabs | Qt.DontClip, page)
01307       self.__yPos = self.__yPos + self.__fm.lineSpacing()
01308
01309       #~ self.__currentItem = self.Hierarchy.self.__currentItem()
01310
01311       #~ if self.__currentItem.parent() is not None:
01312         #~ self.getCurrentParent() = self.__currentItem.parent()
01313       #~ else:
01314         #~ self.getCurrentParent() = self.Hierarchy.firstChild()
01315
01316       #~ if self.getCurrentParent().parent() is not None:
01317         #~ self.getCurrentGrandParent() = self.getCurrentParent().parent()
01318       #~ else:
01319         #~ self.getCurrentGrandParent() = self.Hierarchy.firstChild()
01320
01321       #~ if self.getCurrentGrandParent().parent() is not None:
01322         #~ self.getCurrentGreatGrandParent() = self.getCurrentGrandParent().parent()
01323       #~ else:
01324         #~ self.getCurrentGreatGrandParent() = self.Hierarchy.firstChild()
01325
01326       self.printRegList(self.GLAT_Regs, str(self.GLATLabel.text()) + " Registers")
01327       self.printRegList(self.GLCB_Regs, str(self.GLCBLabel.text()) + " Registers")
01328       self.printRegList(self.GLCBSTATS_Regs, str(self.GLCBSTATSLabel.text()) + " Registers")
01329       self.printRegList(self.GOCS_Regs, str(self.GOCSLabel.text()) + " Registers")
01330       self.printRegList(self.GAEM_Regs, str(self.GAEMLabel.text()) + " Registers")
01331       self.printRegList(self.GAEQ_Regs, str(self.GAEQLabel.text()) + " Registers")
01332       self.printRegList(self.GARC_Regs, str(self.GARCLabel.text()) + " Registers")
01333       self.printRegList(self.GAFE_Regs, str(self.GAFELabel.text()) + " Registers")
01334
01335       self.printRegList(self.GTEM_Regs, str(self.GTEMLabel.text()) + " Registers")
01336       self.printRegList(self.GCCC_Regs, str(self.GCCCLabel.text()) + " Registers")
01337       self.printRegList(self.GCRC_Regs, str(self.GCRCLabel.text()) + " Registers")
01338       self.printRegList(self.GCFE_Regs, str(self.GCFELabel.text()) + " Registers")
01339
01340       self.printRegList(self.GTCC_Regs, str(self.GTCCLabel.text()) + " Registers")
01341       self.printRegList(self.GTRC_Regs, str(self.GTRCLabel.text()) + " Registers")
01342       self.printRegList(self.GTFE_Regs, str(self.GTFELabel.text()) + " Registers")
01343
01344       self.printRegList(self.GTIC_Regs, str(self.GTICLabel.text()) + " Registers")
01345
01346       self.printRegList(self.GEBM_Regs, str(self.GEBMLabel.text()) + " Registers")
01347       self.printRegList(self.GEBMC_Regs, str(self.GEBMCLabel.text()) + " Registers")
01348       self.printRegList(self.GEBMST_Regs, str(self.GEBMSTLabel.text()) + " Registers")
01349
01350       self.printRegList(self.GGEM_Regs, str(self.GGEMLabel.text()) + " Registers")
01351       self.printRegList(self.GGEMC_Regs, str(self.GGEMCLabel.text()) + " Registers")
01352       self.printRegList(self.GGEMMG_Regs, str(self.GGEMMGLabel.text()) + " Registers")
01353       self.printRegList(self.GGEMST_Regs, str(self.GGEMSTLabel.text()) + " Registers")
01354       self.printRegList(self.GGEMSC_Regs, str(self.GGEMSCLabel.text()) + " Registers")
01355       self.printRegList(self.GGEMVG_Regs, str(self.GGEMVGLabel.text()) + " Registers")
01356       self.printRegList(self.GGEMIE_Regs, str(self.GGEMIELabel.text()) + " Registers")
01357       self.printRegList(self.GGEMW_Regs, str(self.GGEMWLabel.text()) + " Registers")
01358
01359       self.printRegList(self.GCRU_Regs, str(self.GCRULabel.text()) + " Registers")
01360
01361       self.printRegList(self.GPDU_Regs, str(self.GPDULabel.text()) + " Registers")
01362       self.printRegList(self.GPEQ_Regs, str(self.GPEQLabel.text()) + " Registers")
01363
01364       self.printRegList(self.GGLT_Regs, str(self.GGLTLabel.text()) + " Registers")
01365
01366       self.__p.end()
01367       self.statusBar().message('Printing completed',2000)
01368     else:
01369       self.statusBar().message('Printing aborted',2000)
01370
01371   def printRegList(self, regList, listHeader):
01372       Margin = 50
01373
01374       # If there are no items, don't try to print
01375       if not regList.firstChild():
01376         return
01377
01378       # If the selected node is a broadcast node or is not selected, don't print:
01379       if QString.compare(regList.firstChild().text(1),"") == 0 :
01380         return
01381
01382       column = [50, 200, 260, 390]
01383       columnHeader = ['Register','Size','Time Stamp','Value']#,'Time','Source','Message']
01384
01385       self.__yPos = self.__yPos + self.__fm.lineSpacing()
01386       self.__p.drawText(Margin,Margin + self.__yPos,self.__metrics.width(),self.__fm.lineSpacing(),\
01387                 Qt.ExpandTabs | Qt.DontClip, listHeader)
01388       self.__yPos = self.__yPos + self.__fm.lineSpacing()
01389
01390       for i in range (0,4):
01391           self.__p.drawText(column[i],Margin + self.__yPos,self.__metrics.width(),self.__fm.lineSpacing(),
01392                     Qt.ExpandTabs | Qt.DontClip, columnHeader[i])
01393       self.__yPos = self.__yPos + self.__fm.lineSpacing()
01394
01395       item = regList.firstChild()
01396       for j in range(regList.childCount()):
01397         if Margin + self.__yPos > self.__metrics.height() - Margin:
01398           self.__pageNo = self.__pageNo + 1
01399           page = "Page: " + str(self.__pageNo)
01400           self.statusBar().message('Printing (page %d)...' % (self.__pageNo))
01401           self.printer.newPage()
01402           self.__yPos = 0
01403           self.__p.drawText(Margin,Margin + self.__yPos,self.__metrics.width(),self.__fm.lineSpacing(),
01404                   Qt.ExpandTabs | Qt.DontClip, self.__header)
01405           self.__yPos = self.__yPos + self.__fm.lineSpacing()
01406           self.__p.drawText(Margin,Margin + self.__yPos,self.__metrics.width(),self.__fm.lineSpacing(),
01407                   Qt.ExpandTabs | Qt.DontClip, page)
01408           self.__yPos = self.__yPos + 2*self.__fm.lineSpacing()
01409
01410           self.__p.drawText(Margin,Margin + self.__yPos,self.__metrics.width(),self.__fm.lineSpacing(),
01411                   Qt.ExpandTabs | Qt.DontClip, listHeader)
01412           self.__yPos = self.__yPos + self.__fm.lineSpacing()
01413
01414           for i in range (0,4):
01415             self.__p.drawText(column[i],Margin + self.__yPos,self.__metrics.width(),self.__fm.lineSpacing(),
01416                       Qt.ExpandTabs | Qt.DontClip, columnHeader[i])
01417           self.__yPos = self.__yPos + self.__fm.lineSpacing()
01418
01419         for i in range (0,4):
01420           self.__p.drawText(column[i],Margin + self.__yPos,self.__metrics.width(),self.__fm.lineSpacing(),
01421                     Qt.ExpandTabs | Qt.DontClip,item.text(i))
01422         self.__yPos = self.__yPos + self.__fm.lineSpacing()
01423         item = item.nextSibling()
01424
01425   def fileExit(self):
01426     self.close()
01427
01428   def editUndo(self):
01429     print "BrowserImpl.editUndo(): Not implemented yet"
01430   # public slot
01431
01432   def editRedo(self):
01433     print "BrowserImpl.editRedo(): Not implemented yet"
01434   # public slot
01435
01436   def editCut(self):
01437     print "BrowserImpl.editCut(): Not implemented yet"
01438   # public slot
01439
01440   def editCopy(self):
01441     print "BrowserImpl.editCopy(): Not implemented yet"
01442   # public slot
01443
01444   def editPaste(self):
01445     print "BrowserImpl.editPaste(): Not implemented yet"
01446   # public slot
01447
01448   def editFind(self):
01449     print "BrowserImpl.editFind(): Not implemented yet"
01450   # public slot
01451
01452   def helpOnline(self):
01453     import webbrowser
01454     webbrowser.open('http://www-glast.slac.stanford.edu/IntegrationTest/ONLINE/Default.htm')
01455
01456   def helpContents(self):
01457     self.browserReadme = BrowserReadme()
01458     self.browserReadme.exec_loop()
01459
01460   def helpAbout(self):
01461     QMessageBox.about(self,'Help About',
01462             '                                     GLAST Online Browser\n                               I&T Online - Alicia T. Kavelaars\nhttp://www-glast.slac.stanford.edu/IntegrationTest/ONLINE/contact.htm\n                                       Copyright 2003 by\n       The Board of Trustees of the Leland Stanford Junior University.\n                                       All rights reserved.')
01463
01464 class RegViewItem(QListViewItem):
01465   def __init__(self, *args):
01466     QListViewItem.__init__(self, *args)
01467     self.__error = 0
01468
01469   def paintCell(self, p, cg, column, width, align):
01470     g = QColorGroup(cg)
01471     g.setColor( QColorGroup.Base, Qt.white)
01472     g.setColor( QColorGroup.Foreground, Qt.black)
01473     if self.__error:
01474       g.setColor( QColorGroup.Text, Qt.red)
01475     else:
01476       g.setColor( QColorGroup.Text, Qt.black)
01477
01478     # Do the standard painting
01479     QListViewItem.paintCell(self,p,g,column,width,align)
01480
01481     p.setPen( QPen( cg.dark(), 1 ) )
01482     p.drawLine( 0, self.height() - 1, width, self.height() - 1 )
01483     p.drawLine( width - 1, 0, width - 1, self.height() )
01484
01485   def setError(self, error):
01486     self.__error = error
01487
01488 if __name__ == "__main__":
01489   from LATTE.client.gOptions import Options
01490   from LATTE.client.gCmdCli  import CmdCli
01491   from LATTE.database.gLAT   import GLAT
01492   from LATTE.database.gXBR   import GXBRD
01493   from LATTE.database.gPlumber import Plumber
01494
01495   options = Options(['server'], ['schema'])
01496   try:
01497     options.parse()
01498   except Exception, msg:
01499     options.usage(str(msg))
01500     sys.exit(1)
01501
01502   cmd = CmdCli()
01503   cmd.connect(options.server)
01504
01505   lat = GLAT(cmd)
01506   xbrd = GXBRD(cmd)
01507   ocs = GOCS(cmd)
01508
01509   a = QApplication(sys.argv)
01510   QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
01511   w = BrowserImpl(lat, xbrd, ocs)
01512   w.fileOpenAction.setEnabled(1)
01513   if options.schema is not None:
01514     w.loadSchema(options.schema)
01515
01516   a.setMainWidget(w)
01517   w.show()
01518   a.exec_loop()
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: browserPreferencesImpl.py Source File

browser

browserPreferencesImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Browser preferences GUI implementation module"
00013 __author__   = "A. Kavelaars <aliciak@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2005/05/16 18:30:35 $").split(' ')[1]
00015 __version__  = "$Revision: 2.2 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import sys
00022 from qt import *
00023 from BrowserPreferences import BrowserPreferences
00024
00025
00026 class browserPreferencesImpl(BrowserPreferences):
00027
00028   def __init__(self,parent = None,name = None,modal = 0,fl = 0):
00029     BrowserPreferences.__init__(self,parent,name,modal,fl)
00030
00031     self.timestepValue.setText("1")
00032     self.connect(self.timestepSlider, SIGNAL('valueChanged(int)'), self.changeStepValue)
00033
00034   def changeStepValue(self):
00035     self.timestepValue.setText(str(float(self.timestepSlider.value())/10.))
00036
00037 if __name__ == "__main__":
00038   a = QApplication(sys.argv)
00039   QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00040   w = BrowserPreferences()
00041   a.setMainWidget(w)
00042   w.show()
00043   a.exec_loop()
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: BTdump.py Source File

BTdump.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Data Format (LDF) data dumper functions for Beam Test"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "6/17/2006"
00014 __version__  = "$Revision: 1.1 $"
00015 __credits__  = "SLAC"
00016
00017 import copyright_SLAC
00018
00019 import os, stat, struct
00020
00021 import LDF
00022
00023 import LDFdumper as LD
00024 from   LDFdumper import _u
00025
00026 from   LDFdump               import myLATcomponentIterator
00027 from   ancillaryContribution import AncillaryContribution
00028
00029 import sys
00030
00031
00032 def _testDg(dgBuf):
00033   """Iterate over a buffer containing a list of LATdatagrams.
00034   """
00035   class myEBFeventIterator(LDF.LDBI_EBFeventIterator):
00036     def __init__(self, lci):
00037       LDF.LDBI_EBFeventIterator.__init__(self, lci)
00038       self.__lci = lci
00039
00040     def process(self, evt):
00041       LD.EBFevent(evt).dump()
00042       if evt.status() != 0:
00043         print
00044         print "Bad status %d in event header" % (evt.status())
00045         print "Aborting processing of event"
00046         print
00047         return evt.status()
00048       else:
00049         self.__lci.iterate(evt)
00050         return self.__lci.status()
00051
00052     def handleError(self, event, code, p1, p2):
00053       if code == LDF.EBFeventIterator.ERR_NonEBFevent:
00054         print >> sys.stderr, "EBFeventIterator::iterate: ", \
00055                             "Encountered a non-EBFevent datagram contribution ", \
00056                             "with typeId %08x\n" % (p1)
00057         return 1
00058       else:
00059         print >> sys.stderr, "myEBFeventIterator.handleError got unknown error code:", \
00060                              "  code=%d, p1=%d, p2=%d\n" % ( code, p1, p2)
00061       return 0
00062
00063   class myASCtileContributionIterator(LD.ASCtileContributionIteratorDump):
00064     def __init__(self):
00065       LD.ASCtileContributionIteratorDump.__init__(self)
00066
00067   class myASCcontributionIterator(LD.ASCcontributionIteratorDump):
00068     def __init__(self):
00069       LD.ASCcontributionIteratorDump.__init__(self)
00070
00071   class myLATcontributionIterator(LDF.LDBI_LATcontributionIterator):
00072     __typeIds = [AncillaryContribution.EventId,
00073                  AncillaryContribution.HeaderId,
00074                  AncillaryContribution.TrailerId]
00075     def __init__(self, eei):
00076       LDF.LDBI_LATcontributionIterator.__init__(self, eei)
00077
00078     def handleError(self, contribution, code, p1, p2):
00079       if code == LDF.LATcontributionIterator.ERR_UDFcontribution:
00080         typeId = _u(p1)
00081         if typeId & 0x000fffff in myLATcontributionIterator.__typeIds:
00082           import Numeric
00083           buffer = Numeric.fromstring(contribution.string(0), 'i')
00084           i      = 0
00085           prefix = "  "
00086           print "ANC:"
00087           print "%s  %08x, %08x, %08x, %08x" % (prefix,
00088                                                 _u(buffer[0  ]),_u(buffer[i+1]),
00089                                                 _u(buffer[i+2]),_u(buffer[i+3]))
00090           print
00091           return 0
00092         else:
00093           print >> sys.stderr, "LATcontributionIterator::UDF: ", \
00094                                "Found unrecognized LATdatagram contribution type 0x%08X" % \
00095                                (typeId)
00096           return -1
00097       else:
00098         print >> sys.stderr, "myLATcontributionIterator.handleError got unknown error code:", \
00099                              "  code=%d, p1=%d, p2=%d\n" % ( code, p1, p2)
00100       return 0
00101
00102     def ASC(self, start, end):
00103       print ""
00104       print "ASC"
00105       asci = myASCcontributionIterator()
00106       asci.iterate(start)
00107       return asci.status()
00108
00109   class myLATdatagramIterator(LDF.LDBI_LATdatagramIterator):
00110     def __init__(self, lci):
00111       LDF.LDBI_LATdatagramIterator.__init__(self, lci)
00112       self.__lci = lci
00113
00114     def handleError(self, contribution, code, p1, p2):
00115       if code == LDF.LATdatagramIterator.ERR_IDmismatch:
00116         print >> sys.stderr, "LATdatagramIterator.iterate: ", \
00117                              "Identity mismatch: got %08x, expected %08x\n" % \
00118                             (p1, p2)
00119         return -1
00120       else:
00121         print >> sys.stderr, "myLATcontributionIterator.handleError got unknown error code:", \
00122                              "  code=%d, p1=%d, p2=%d\n" % ( code, p1, p2)
00123       return 0
00124
00125     def process(self, dg):
00126       LD.LATdatagram(dg).dump()
00127
00128       self.__lci.iterate(dg)      # Returns the number of objects iterated over
00129       status = self.__lci.status()
00130       if status:  print "Datagram iteration returned status 0x%08x = %d" % \
00131          (_u(status), _u(status))
00132
00133       return 0
00134
00135   latCompIt    = myLATcomponentIterator()
00136   ebfEvtIt     = myEBFeventIterator(latCompIt)
00137   ascContIt    = myASCcontributionIterator()
00138   latContIt    = myLATcontributionIterator(ebfEvtIt)
00139   latDgIt      = myLATdatagramIterator(latContIt)
00140   latDataBufIt = LDF.LATdataBufferIterator(latDgIt)
00141
00142   latDataBufIt.iterate(dgBuf, len(dgBuf)) # Returns # of objects iterated over
00143   return latDgIt.status()
00144
00145 def testDG(dg):
00146   _testDg(dg)
00147
00148 def testRaw(filename="muon-5.arch", skip=0, saveFile=None):
00149   """This function is meant for use with datagram encapsulated EBF event files.
00150   It assumes the first contribution to the datagram is an EBF event and ignores
00151   any subsequent contributions.  An EBF event as defined here contains an
00152   identification value in its first longword and is followed by the raw EBF
00153   event format as described in the TEM, AEM, GEM, etc. documents.
00154   """
00155   ebfFile = open(filename, 'rb')
00156   fileLen = os.stat(filename)[stat.ST_SIZE]
00157   if saveFile is not None:  saveFile = open(saveFile, 'wb')
00158   n = 0
00159
00160   while fileLen > 0:
00161     try:
00162       data               = ebfFile.read(8)
00163       if len(data) < 8:  break
00164       (identity, length) = struct.unpack('!LL', data)
00165       data              += ebfFile.read(length - 8)
00166
00167       if n == skip:
00168         if saveFile is not None:  saveFile.write(data)
00169         print
00170         status = _testDg(data)
00171         if status > 0: break
00172         if status < 0:
00173           skip = -status
00174           n    = 0
00175       else:
00176         if n % 30000 == 0:
00177           print "\n%7d" % (n),
00178         else:
00179           if n % 1000 == 0:
00180             print ".",
00181         n += 1
00182
00183       fileLen -= length
00184     except KeyboardInterrupt:
00185       n = skip
00186     except MemoryError, e:
00187       print "MemoryError exception: ", e
00188       print "Length = 0x%08x" % length
00189
00190   if saveFile is not None:  saveFile.close()
00191   ebfFile.close()
00192
00193
00194 if __name__ == '__main__':
00195   import sys
00196
00197   def usage():
00198     print "%s <filename>" % sys.argv[0]
00199     print
00200     print "  runs testRaw(<filename>)"
00201     print
00202     print "Other functions are available by running with python -i:"
00203     print "  test(<string buffer>)"
00204     print "  testEBF(<filename>, <identity>)"
00205     print "  testRaw(<filename>, <skip count>, <save filename>"
00206     print "  testFITS(<filename>)"
00207     print "  testFITS_Dist(<filename>, <multicast address>)"
00208     print "  testRaw_Dist(<server>)"
00209     print "  testHex(<filename>)"
00210
00211
00212   if len(sys.argv) == 1:
00213     usage()
00214   else:
00215     testRaw(sys.argv[1])
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

AcdHWMultiplexer Member List

This is the complete list of members for AcdHWMultiplexer, including all inherited members.

__init__(GEM) | AcdHWMultiplexer
abort() | AcdHWMultiplexer
dwell(d=None) | AcdHWMultiplexer
resume() | AcdHWMultiplexer
shutdown() | AcdHWMultiplexer
start() | AcdHWMultiplexer
stats() | AcdHWMultiplexer
stop() | AcdHWMultiplexer
tileList(tList=None) | AcdHWMultiplexer

Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

AcdPanel Member List

This is the complete list of members for AcdPanel, including all inherited members.

languageChange() (defined in AcdPanel) AcdPanel

Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

AlertGuiImpl Member List

This is the complete list of members for AlertGuiImpl, including all inherited members.

config(configFile) (defined in AlertGuiImpl) | AlertGuiImpl
handleAlert(alertList) (defined in AlertGuiImpl) | AlertGuiImpl
startListenerThread() (defined in AlertGuiImpl) | AlertGuiImpl

Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

gAlertPopup Member List

This is the complete list of members for gAlertPopup, including all inherited members.

handle(alertStr) (defined in gAlertPopup) gAlertPopup

Generated on Fri Jul 21 13:26:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

AncillaryContribution Member List

This is the complete list of members for AncillaryContribution, including all inherited members.

__init__(contributor, contribution) (defined in AncillaryContribution) | AncillaryContribution
buffer() (defined in AncillaryContribution) | AncillaryContribution
contributor() (defined in GebContribution) | GebContribution
identity() | AncillaryContribution
length() | AncillaryContribution
sequence() | AncillaryContribution

Generated on Fri Jul 21 13:26:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

AncillaryContributor Member List

This is the complete list of members for AncillaryContributor, including all inherited members.

__init__(filename, offset=0) (defined in AncillaryContributor) | AncillaryContributor |
__init__() (defined in GebContributor) | GebContributor |
close() | AncillaryContributor |
contributionQueue() | GebContributor | [static]
idMask(id=None) | GebContributor |
name() | AncillaryContributor |
offset() (defined in AncillaryContributor) | AncillaryContributor |
open() | AncillaryContributor |
read() | AncillaryContributor |
run() | GebContributor |
sequence(sequence) | GebContributor |

Generated on Fri Jul 21 13:26:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

AncillaryContributor Member List

This is the complete list of members for AncillaryContributor, including all inherited members.

__init__((host, port), offset=0) (defined in AncillaryContributor) | AncillaryContributor |
__init__() (defined in GebContributor) | GebContributor |
close() | AncillaryContributor |
contributionQueue() | GebContributor | [static]
fake() (defined in AncillaryContributor) | AncillaryContributor |
idMask(id=None) | GebContributor |
name() | AncillaryContributor |
offset() (defined in AncillaryContributor) | AncillaryContributor |
open() | AncillaryContributor |
read() | AncillaryContributor |
run() | GebContributor |
sequence(sequence) | GebContributor |

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ArgumentImpl Member List

This is the complete list of members for ArgumentImpl, including all inherited members.

__init__(parent=None, name=None, modal=0, fl=0) (defined in ArgumentImpl) | ArgumentImpl
CancelButtonClicked() (defined in ArgumentImpl) | ArgumentImpl
getValue(caption, value=None) (defined in ArgumentImpl) | ArgumentImpl
OKButtonClicked() (defined in ArgumentImpl) | ArgumentImpl

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

bar Member List

This is the complete list of members for bar, including all inherited members.

__init__(parent=None, name=None, fl=0) (defined in bar) | bar
displayValue(a0) (defined in bar) | bar
languageChange() (defined in bar) | bar
paintEvent(pe) (defined in bar) | bar
setColor(col) (defined in bar) | bar

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

barw Member List

This is the complete list of members for barw, including all inherited members.

displaySlidingScaleValue(val) (defined in barw) | barw
languageChange() (defined in barw) | barw
resizeEvent(rev) (defined in barw) | barw
setHigh(high) (defined in barw) | barw
setLow(low) (defined in barw) | barw
setMinScale(min) (defined in barw) | barw
setSlidingScale(scale) (defined in barw) | barw
setTitle(title) (defined in barw) | barw

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

BrowserImpl Member List

This is the complete list of members for BrowserImpl, including all inherited members.

browserPreferences() (defined in BrowserImpl) | BrowserImpl
clearValues(listView) (defined in BrowserImpl) | BrowserImpl
clearViews() (defined in BrowserImpl) | BrowserImpl
contextMenuShow(item, point, column) (defined in BrowserImpl) | BrowserImpl
copyLineToClipboard() (defined in BrowserImpl) | BrowserImpl
copyToClipboard() (defined in BrowserImpl) | BrowserImpl
editCopy() (defined in BrowserImpl) | BrowserImpl
editCut() (defined in BrowserImpl) | BrowserImpl
editFind() (defined in BrowserImpl) | BrowserImpl
editPaste() (defined in BrowserImpl) | BrowserImpl
editRedo() (defined in BrowserImpl) | BrowserImpl
editUndo() (defined in BrowserImpl) | BrowserImpl
fileExit() (defined in BrowserImpl) | BrowserImpl
fileNew() (defined in BrowserImpl) | BrowserImpl
fileOpen() (defined in BrowserImpl) | BrowserImpl
filePrint() (defined in BrowserImpl) | BrowserImpl
fileSave() (defined in BrowserImpl) | BrowserImpl
fileSaveAs() (defined in BrowserImpl) | BrowserImpl
fillRegsView(parent, listView) (defined in BrowserImpl) | BrowserImpl
fillViews() (defined in BrowserImpl) | BrowserImpl
getCurrentGrandParent() (defined in BrowserImpl) | BrowserImpl
getCurrentGreatGrandParent() (defined in BrowserImpl) | BrowserImpl
getCurrentItem() (defined in BrowserImpl) | BrowserImpl
getCurrentParent() (defined in BrowserImpl) | BrowserImpl
helpAbout() (defined in BrowserImpl) | BrowserImpl
helpContents() (defined in BrowserImpl) | BrowserImpl
helpOnline() (defined in BrowserImpl) | BrowserImpl
loadHierarchy(lat, xbrd) (defined in BrowserImpl) | BrowserImpl
loadSchema(filename) (defined in BrowserImpl) | BrowserImpl
populateRegs(lat) (defined in BrowserImpl) | BrowserImpl
printRegList(regList, listHeader) (defined in BrowserImpl) | BrowserImpl
selectFile() (defined in BrowserImpl) | BrowserImpl
selectItem(item) | BrowserImpl
setDefaults() (defined in BrowserImpl) | BrowserImpl
setupSchema() | BrowserImpl
setViewDecimal(on) (defined in BrowserImpl) | BrowserImpl
setViewHexadecimal(on) (defined in BrowserImpl) | BrowserImpl
updateList(regList, listView) (defined in BrowserImpl) | BrowserImpl
updateView() (defined in BrowserImpl) | BrowserImpl

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

RegViewItem Member List

This is the complete list of members for RegViewItem, including all inherited members.

paintCell(p, cg, column, width, align) (defined in RegViewItem) | RegViewItem
setError(error) (defined in RegViewItem) | RegViewItem

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

browserPreferencesImpl Member List

This is the complete list of members for browserPreferencesImpl, including all inherited members.

__init__(parent=None, name=None, modal=0, fl=0) (defined in browserPreferencesImpl) | browserPreferencesImpl
changeStepValue() (defined in browserPreferencesImpl) | browserPreferencesImpl

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Collector Member List

This is the complete list of members for Collector, including all inherited members.

addRecorder(recorder) (defined in Collector) | Collector
addRetriever(name, retriever) (defined in Collector) | Collector
collectData() (defined in Collector) | Collector
delRetriever(name) (defined in Collector) | Collector
getDelay() (defined in Collector) | Collector
isAcquiring() (defined in Collector) | Collector
setAcquiring(bool) (defined in Collector) | Collector
setDelay(delay) | Collector
shutdown() (defined in Collector) | Collector

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Consumer Member List

This is the complete list of members for Consumer, including all inherited members.

__init__(argv) | Consumer
archiveClose(fn) | Consumer
archiveOpen(fn) | Consumer
checkUDF() (defined in Consumer) | Consumer
dataSize() | Consumer
fileClose() | Consumer
fileOpen(fn) | Consumer
getNextEvent() | Consumer
getRunId() (defined in Consumer) | Consumer
loop() (defined in Consumer) | Consumer
parseArgs(argv) (defined in Consumer) | Consumer
parseEvent() | Consumer
serverClose() | Consumer
serverOpen(server="1") | Consumer
setRunId(runId) (defined in Consumer) | Consumer
usage() (defined in Consumer) | Consumer

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

consumerPlotter Member List

This is the complete list of members for consumerPlotter, including all inherited members.

__init__(argv) | consumerPlotter |
addExportedFile(file, delete=False) (defined in consumerPlotter) | consumerPlotter |
addSummaryTableRow(plot, limitType, status) (defined in standardPlotter) | standardPlotter | [private]
archiveClose(fn) | Consumer |
archiveOpen(fn) | Consumer |
capturePlot(plot) (defined in standardPlotter) | standardPlotter | [private]
checkLimit(plot, limit) (defined in standardPlotter) | standardPlotter | [private]
checkLimits() (defined in consumerPlotter) | consumerPlotter |
checkUDF() (defined in consumerPlotter) | consumerPlotter |
clearPlots() (defined in standardPlotter) | standardPlotter | [private]
dataSize() | Consumer |
exportFiles() (defined in consumerPlotter) | consumerPlotter |
fileClose() | Consumer |
fileOpen(fn) | Consumer |
forceUpdatePlots() (defined in standardPlotter) | standardPlotter | [private]
getCompletionStatus() (defined in consumerPlotter) | consumerPlotter |
getCompletionStatusStr() (defined in consumerPlotter) | consumerPlotter |
getName() (defined in consumerPlotter) | consumerPlotter |
getNextEvent() | Consumer |
getPlotColumns(plot) (defined in standardPlotter) | standardPlotter | [private]
getPlotCuts(plot) (defined in standardPlotter) | standardPlotter | [private]
getPlotNtuple(plot) (defined in standardPlotter) | standardPlotter | [private]
getPlotTitle(plot) (defined in standardPlotter) | standardPlotter | [private]
getPlotType(plot) (defined in standardPlotter) | standardPlotter | [private]
getRequests() (defined in standardPlotter) | standardPlotter | [private]
getRunId() (defined in Consumer) | Consumer |
initHippo() (defined in standardPlotter) | standardPlotter | [private]
initializePlotter() (defined in standardPlotter) | standardPlotter | [private]
listFailed(names, failList, plot, limitDesc, sectionID) (defined in standardPlotter) | standardPlotter | [private]
loop() (defined in Consumer) | Consumer |
parseArgs(argv) (defined in Consumer) | Consumer |
parseCuts() (defined in standardPlotter) | standardPlotter | [private]
parseEvent() | consumerPlotter |
parseLimits() (defined in standardPlotter) | standardPlotter | [private]
readPedestals() (defined in standardPlotter) | standardPlotter | [private]
reportLimits() (defined in standardPlotter) | standardPlotter | [private]
reportPlotItem(sectionID, plot, itemStartString) (defined in standardPlotter) | standardPlotter | [private]
reportPlots() (defined in standardPlotter) | standardPlotter | [private]
reportResults() (defined in standardPlotter) | standardPlotter | [private]
serverClose() | Consumer |
serverOpen(server="1") | Consumer |
setCompletionStatus(status) (defined in consumerPlotter) | consumerPlotter |
setConfigFile(configFile) (defined in standardPlotter) | standardPlotter | [private]
setDataType(dataType) (defined in standardPlotter) | standardPlotter | [private]
setRunId(runId) (defined in Consumer) | Consumer |
startReport() (defined in standardPlotter) | standardPlotter | [private]
startSummary() (defined in standardPlotter) | standardPlotter | [private]
updatePlots() (defined in standardPlotter) | standardPlotter | [private]
usage() (defined in Consumer) | Consumer |
writeReport(reportFileName) (defined in standardPlotter) | standardPlotter | [private]

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

DataDistributorAddress Member List

This is the complete list of members for DataDistributorAddress, including all inherited members.

lookup(port, server) | DataDistributorAddress | [static]
port(name) | DataDistributorAddress | [static]

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

DataDistributorClient Member List

This is the complete list of members for DataDistributorClient, including all inherited members.

__init__(name=None, size=641024) | DataDistributorClient
connect(server) | DataDistributorClient
disconnect() | DataDistributorClient
receive() | DataDistributorClient
returnNone() | DataDistributorClient

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

DataDistributorServer Member List

This is the complete list of members for DataDistributorServer, including all inherited members.

__init__(name=None, size=321024) | DataDistributorServer
connect(server, interface=socket.gethostname()) | DataDistributorServer
disconnect() | DataDistributorServer
publish(data) | DataDistributorServer

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

DataDistributorPoll Member List

This is the complete list of members for DataDistributorPoll, including all inherited members.

__init__(name, length=641024) | DataDistributorPoll
receive() | DataDistributorPoll
start() | DataDistributorPoll
stop() | DataDistributorPoll

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

DataExport Member List

This is the complete list of members for DataExport, including all inherited members.

__init__() (defined in DataExport) | DataExport
export(source, dest) | DataExport
md5sum(fname) | DataExport
setPurge(purge) (defined in DataExport) | DataExport
synch(source, dest) | DataExport

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GExportException Member List

This is the complete list of members for GExportException, including all inherited members.

__init__(status) (defined in GExportException) | GExportException
__str__() (defined in GExportException) | GExportException

Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

_Anonymous Member List

This is the complete list of members for _Anonymous, including all inherited members.

__repr__() (defined in _Parameter) _Parameter

Generated on Fri Jul 21 13:26:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

_Any Member List

This is the complete list of members for _Any, including all inherited members.

__repr__() (defined in _Parameter) _Parameter

Generated on Fri Jul 21 13:26:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

_Parameter Member List

This is the complete list of members for _Parameter, including all inherited members.

__repr__() (defined in _Parameter) _Parameter

Generated on Fri Jul 21 13:26:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

doublehisto Member List

This is the complete list of members for doublehisto, including all inherited members.

addHisto(name="histo", color="black", style=0, uselabel=0, showhis=1) (defined in doublehisto) | doublehisto
computeticks(lower, upper, log) (defined in doublehisto) | doublehisto
drawLabels() (defined in doublehisto) | doublehisto
fill(name, xval, weight=1.) (defined in doublehisto) | doublehisto
find(name) (defined in doublehisto) | doublehisto
hideHisto(name) (defined in doublehisto) | doublehisto
makelabels(ticks, logs, alignment) (defined in doublehisto) | doublehisto
paintEvent(pe) (defined in doublehisto) | doublehisto
removeAllHistos() (defined in doublehisto) | doublehisto
removeHisto(name) (defined in doublehisto) | doublehisto
resetAllHistos() (defined in doublehisto) | doublehisto
resetHisto(number) (defined in doublehisto) | doublehisto
resetlin() (defined in doublehisto) | doublehisto
resetlog() (defined in doublehisto) | doublehisto
resetxaxis(newaxis) (defined in doublehisto) | doublehisto
resizeEvent(rev) (defined in doublehisto) | doublehisto
setBinBoundaries() (defined in doublehisto) | doublehisto
setBinContent(name, i, w) (defined in doublehisto) | doublehisto
setHistoLabel(name, lab) (defined in doublehisto) | doublehisto
setLogy(on) (defined in doublehisto) | doublehisto
setup(nbins, lower, upper, logx, logy) (defined in doublehisto) | doublehisto
showHisto(name) (defined in doublehisto) | doublehisto
updateHisto() (defined in doublehisto) | doublehisto

Generated on Fri Jul 21 13:26:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

EnvMonImpl Member List

This is the complete list of members for EnvMonImpl, including all inherited members.

__init__(common, parent=None, name=None, fl=0) (defined in EnvMonImpl) | EnvMonImpl
adjustMonitorTextFont(monTxt) (defined in EnvMonImpl) | EnvMonImpl
calcDeadTime(regName) (defined in EnvMonImpl) | EnvMonImpl
changeBlock(block) (defined in EnvMonImpl) | EnvMonImpl
changeFreeBoard(boardId) (defined in EnvMonImpl) | EnvMonImpl
changeRate(val) (defined in EnvMonImpl) | EnvMonImpl
clearPlots() (defined in EnvMonImpl) | EnvMonImpl
closeEvent(e) (defined in EnvMonImpl) | EnvMonImpl
customEvent(e) | EnvMonImpl
execGUImethod(func, args, kwargs) | EnvMonImpl
execGUImethodNR(func, args, kwargs) | EnvMonImpl
initDisplays() (defined in EnvMonImpl) | EnvMonImpl
populateACDchecks(boardId) (defined in EnvMonImpl) | EnvMonImpl
quitApp() (defined in EnvMonImpl) | EnvMonImpl
readEnvValues() (defined in EnvMonImpl) | EnvMonImpl
selectAEM() (defined in EnvMonImpl) | EnvMonImpl
selectTEM(blockText) (defined in EnvMonImpl) | EnvMonImpl
setFont(font) (defined in EnvMonImpl) | EnvMonImpl
setupLabels(newTem) (defined in EnvMonImpl) | EnvMonImpl
shutdown() (defined in EnvMonImpl) | EnvMonImpl
toggleAcdEnv1Mon(id) (defined in EnvMonImpl) | EnvMonImpl
toggleAcdEnv1Plot(id) (defined in EnvMonImpl) | EnvMonImpl
toggleChan0Mon(id) (defined in EnvMonImpl) | EnvMonImpl
toggleChan0Plot(id) (defined in EnvMonImpl) | EnvMonImpl
toggleChan1Mon(id) (defined in EnvMonImpl) | EnvMonImpl
toggleChan1Plot(id) (defined in EnvMonImpl) | EnvMonImpl
toggleChan2Mon(id) (defined in EnvMonImpl) | EnvMonImpl
toggleChan2Plot(id) (defined in EnvMonImpl) | EnvMonImpl
toggleChan3Mon(id) (defined in EnvMonImpl) | EnvMonImpl
toggleChan3Plot(id) (defined in EnvMonImpl) | EnvMonImpl
toggleChan4Mon(id) (defined in EnvMonImpl) | EnvMonImpl
toggleChan4Plot(id) (defined in EnvMonImpl) | EnvMonImpl
toggleDataTakingMon(id) (defined in EnvMonImpl) | EnvMonImpl
toggleDataTakingPlot(id) (defined in EnvMonImpl) | EnvMonImpl
togglePDUMon(id) (defined in EnvMonImpl) | EnvMonImpl
togglePDUPlot(id) (defined in EnvMonImpl) | EnvMonImpl
toggleRaw(raw) (defined in EnvMonImpl) | EnvMonImpl
unregisterExitHandler() (defined in EnvMonImpl) | EnvMonImpl

Generated on Fri Jul 21 13:26:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

PlotWidget Member List

This is the complete list of members for PlotWidget, including all inherited members.

__init__(parent=None, name=None, fl=1) (defined in PlotWidget) | PlotWidget
__init__(envMonDlg, parent, title, sizeX, sizeY, labels) (defined in PlotWidget) | PlotWidget
CancelButtonClicked() (defined in PlotWidget) | PlotWidget
contextMenuEvent(cmev) (defined in PlotWidget) | PlotWidget
getMinMax() (defined in PlotWidget) | PlotWidget
getNTuple() (defined in PlotWidget) | PlotWidget
OKButtonClicked() (defined in PlotWidget) | PlotWidget
printPlot() (defined in PlotWidget) | PlotWidget
saveToFile() (defined in PlotWidget) | PlotWidget
setRange() (defined in PlotWidget) | PlotWidget

Generated on Fri Jul 21 13:26:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ScrollablePlotView Member List

This is the complete list of members for ScrollablePlotView, including all inherited members.

addEventPlot(name) (defined in ScrollablePlotView) | ScrollablePlotView
addPlot(name, title, sizeX, sizeY, labels) (defined in ScrollablePlotView) | ScrollablePlotView
getNTupleList() (defined in ScrollablePlotView) | ScrollablePlotView
getPlot(name) (defined in ScrollablePlotView) | ScrollablePlotView
getPlotList() (defined in ScrollablePlotView) | ScrollablePlotView
initEventPlot() (defined in ScrollablePlotView) | ScrollablePlotView
removePlot(name) (defined in ScrollablePlotView) | ScrollablePlotView

Generated on Fri Jul 21 13:26:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Alphabetical List

LATTE Class Index

_ | A | B | C | D | E | F | G | H | L | M | N | O | P | Q | R | S | T | U | W | Z

_
gAlertStr (gAlert) HskPacket231 (HskPacket) rcCompletionStatus (rcComplStatus) TrgInputEnables (TrgInputEnables)
_Anonymous (dispatcher) GARC (gAEM) HskPacket270 (HskPacket) rcEndRunDlgImpl (rcEndRunDlgImpl) trgLATcomponentIterator (trgConsumer)
_Any (dispatcher) GasuExtTrg (test_evt_exttrg) HskPacket271 (HskPacket) rcFileSelector (RunControlGUIImpl) TrgMiniGLT (TrgMiniGLT)
_Attr (gAttr) GasuExtTrgEngine (test_evt_exttrg) HskPacket272 (HskPacket) rcFileSelector (RunControlMainGUIImpl) TrgMiniGLTAbstract (TrgMiniGLTAbstract)
_Parameter (dispatcher) GasuPanel (PorcinePanel) HskPacket273 (HskPacket) rcFitsWriter (rcFitsWriter) TrgMiniGLTRegisters (TrgMiniGLTRegisters)
_regList (gDb) Gattr (gAttr) HskPacket274 (HskPacket) rcGEMDefaultTrigger (rcDefaultTrigger) TrgObject (TrgObject)
A
GattrBF (gAttr) HskPacket275 (HskPacket) rcGEMTrgEngines (rcDefaultTrigger) TrgPeriodicCondition (TrgPeriodic)
AcdHWMultiplexer (AcdHWMultiplexer) GattrDlc (gAttr) HskPacket276 (HskPacket) rcHouseKeeping (rcHouseKeeping) TrgPeriodicConditionAbstract (TrgPeriodic)
ACDmap (TrgGemRegisterGeometry) GattrHsk (gHdb) HskPacket277 (HskPacket) rcLoginImpl (rcLoginImpl) TrgPeriodicConditionDefinition (TrgPeriodic)
AcdPanel (AcdPanel) GattrRaw (gAttr) HskPacket278 (HskPacket) rcMiniGLTDefaultTrigger (rcDefaultTrigger) TrgPPSTimer (TrgPPSTimer)
ACDPowerPanel (PorcinePanel) GattrReg (gAttr) HskPacket279 (HskPacket) rcMiniGLTSolicitedCondition (rcDefaultTrigger) TrgReadout (TrgEngines)
ACDSingleEvtDisplayImpl (GOSEDACDImpl) GattrRegDepr (gAttr) HskPacket27a (HskPacket) rcMiniGLTSolicitedEngine (rcDefaultTrigger) TrgRoi (TrgCoincidences)
AddableRoi (TrgRoiAsTiles) GCCC (gTEM) HskPacket27b (HskPacket) rcMiniGLTTrgEngines (rcDefaultTrigger) TrgRoiAsTiles (TrgRoiAsTiles)
AEM (gEvtCli) GCFE (gTEM) HskPacket27c (HskPacket) rcParamVerifier (rcParamVerifier) TrgRoiAsVeto (TrgRoiAsVeto)
AEMcontributionIterator (standardLDF) Gconstraint (gConstraint) HskPacket27d (HskPacket) rcParamVerifyGUIImpl (rcParamVerifyGUIImpl) TrgRois (TrgCoincidences)
AEMcontributionIterator_ (GOSED_LDF) GconstraintBase (gConstraint) HskPacket27e (HskPacket) rcPreferencesGUIImpl (rcPreferencesGUIImpl) TrgSequence (TrgSequence)
AEQHskRegMap (HskRegisters) GconstraintLimit (gConstraint) HskPacket27f (HskPacket) rcPreferencesManager (rcPreferencesManager) TrgSequenceAbstract (TrgSequence)
AlertGuiImpl (AlertGuiImpl) GconstraintLimitPegRE (gConstraint) HskPacket280 (HskPacket) rcPythonShell (rcPythonShell) TrgSequenceDefinition (TrgSequence)
AncillaryContribution (ancillaryContribution) GconstraintLimitRE (gConstraint) HskPacket281 (HskPacket) rcReportGen (rcReportGen) TrgTileCounters (TrgTileCounters)
AncillaryContributor (ancillaryFile) gConstraintViolation (gConstraint) HskPacket282 (HskPacket) rcRunIdHelper (rcRunIdHelper) TrgTileEnables (TrgInputEnables)
AncillaryContributor (ancillarySocket) GCRC (gTEM) HskPacket283 (HskPacket) rcScmCfgSelector (rcScmCfgSelector) TrgTileStats (TrgTileCounters)
AncillaryContributor (gEvtCliBT) GCRU (gCRU) HskPacket284 (HskPacket) rcScmCfgSelText (rcScmCfgSelector) TrgTower (TrgTower)
ArgumentImpl (ArgumentImpl) Gdb (gDb) HskPacket285 (HskPacket) rcSecurityMan (rcSecurityMan) TrgTowerBusyEnables (TrgInputEnables)
B
GDBN (RunControlCommon) HskPacket286 (HskPacket) rcSolicitedCondition (rcDefaultTrigger) TrgTowerEnables (TrgInputEnables)
BadGasuExample (sweepRejectTest) Geb (geb) HskPacket287 (HskPacket) rcSolicitedEngine (rcDefaultTrigger) TrgTowers (TrgTower)
BadGLTExample (sweepRejectTest) GebContribution (geb) HskPacket288 (HskPacket) rcStatusMonitor (rcStatusMonitor) TrgTracker (TrgTower)
bar (bar) GebContributor (geb) HskPacket289 (HskPacket) rcStatusPanel (rcStatusMonitor) TrgTriggerCounters (TrgTriggerCounters)
barw (barw) GEBM (gEBM) HskPacket28a (HskPacket) rcSuite (rcSuite) TrgTriggerStats (TrgTriggerCounters)
bf (gBits) GEBMC (gEBM) HskPacket28b (HskPacket) rcTest (userAppBrowser) TrgUsingTiles (TrgUsingTiles)
BitField (gBits) GEBMST (gEBM) HskPacket28c (HskPacket) rcTestReport (rcTestReport)
U
BoundMethodWeakref (saferef) GEGU (gEGU) HskPacket28d (HskPacket) rcTransitions (rcTransitions) UDPReceiver (Receiver)
BrowserImpl (BrowserImpl) GEGU_linear (gEGU) HskPacket28e (HskPacket) rcTransitionsBT (rcTransitionsBT) UDPRecorder (Recorder)
browserPreferencesImpl (browserPreferencesImpl) GEGU_poly3 (gEGU) HskPacket28f (HskPacket) rcTrgCoincidence (rcTrgFunctions) userAppBrowser (userAppBrowser)
C
GEGU_rtd (gEGU) HskPacket290 (HskPacket) rcTrgEngines (rcTrgFunctions) userAppLeaf (userAppLeaf)
CAL_LATcontribution (testAppCal_dg) GEGU_test (testPreload) HskPacket291 (HskPacket) rcTrgGem (rcTrgGem) userApplication (testSAppCal_Lean)
CALcontributionIterator (standardLDF) GEGU_thermistor (gEGU) HskPacket353 (HskPacket) rcTrgInjectMarker (rcTrgFunctions) userApplication (temLrsTest)
CALcontributionIterator2 (GOSED_LDF) GEM (gEvtCli) HskPacketBase (HskPacketDecoder) rcTrgMiniGLT (rcTrgMiniGLT) userApplication (hTestEnv)
ccsdsHeader (HskPacketDecoder) GEMcontribution (standardLDF) HskPacketRecorder (HskRecorder) rcTrgTileEnables (rcTrgFunctions) userApplication (transitionRejectTest)
ccsdsPacket (HskPacketDecoder) GEMcontribution_ (GOSED_LDF) HskPacketRetriever (HskPacketRetriever) rcTrgTowerBusyEnables (rcTrgFunctions) userApplication (hTestAppTkr)
ccsdsSocket (HskCli) GEPU (gEPU) HskPacketWriter (parseFswHsk) rcUser (rcUsers) userApplication (testAppArchiver)
CheckLed (PorcinePanel) GExportException (DataExport) HskSimpleTextReceiver (HskReceiver) rcUsers (rcUsers) userApplication (testSAppCal)
Children (gDb) GGEM (gGEM) HskSqlReceiver (HskSqlInterface) Receiver (Receiver) userApplication (excApp)
CmdCli (gCmdCli) GGEMC (gGEM) HskSqlRecorder (HskSqlInterface) Recorder (Recorder) userApplication (testAppMinimal)
Collector (Collector) GGEMIE (gGEM) HskTelemSocket (HskCli) Register (gRegister) userApplication (nullApp)
Command (gCommand) GGEMMG (gGEM) HskTestRetriever (HskRetriever) RegisterInterface (HskRegisters) userApplication (testAppReport)
CommentEntryWidget (rcCommentPanel) GGEMSC (gGEM) HTEM (gHSK) RegViewItem (BrowserImpl) userApplication (testAppCal_dg)
ConfigElement (gSchemaConfig) GGEMST (gGEM)
L
Reloader (rcUtil) userApplication (testSAppEvt)
ConnectState (RunControl) GGEMVG (gGEM) LATcomponentIterator (standardLDF) Response (gResponse) userApplication (sweepRejectTest)
ConnectState (RunControlMain) GGEMW (gGEM) LATcomponentIterator (testAppLDFdump) Retriever (Retriever) userApplication (testAppCal)
ConnectState (HskCli) GGLT (gGLT) LATcontributionIterator (standardLDF) ReverseTrendMap (TrendMaps) userApplication (testAppNoVersion)
Consumer (consumer) Ggroup (gGroup) LATInterfaceException (gException) RunControl (RunControl) userApplication (testAppEvtTO)
consumerPlotter (consumerPlotter) GHSK (gHSK) LATInterfaceStatus (gException) RunControlCommon (RunControlCommon) userApplication (testAppTkr)
CratePanel (PorcinePanel) GHSKTrendMap (TrendMaps) LATsweep (LATsweep) RunControlFileHandler (RunControlCommon) userApplication (testAppAcd)
D
GLAT (gLAT) LDBI_LATcontributionIterator_ (testAppAcdScalers) RunControlFSM (RunControlFSM) userApplication (testAppEvtCli)
DataDistributorAddress (DataDistributor) GLATTrendMap (TrendMaps) LdfContribution (ldfContribution) RunControlGUIImpl (RunControlGUIImpl) userApplication (hTestAppEvt)
DataDistributorClient (DataDistributor) GLCB (gLCB) LdfContributor (ldfFile) RunControlMain (RunControlMain) userApplication (splitOutTem)
DataDistributorPoll (DataDistributorPoll) GLCBSTATS (gLCB) LdfContributor (ldfSocket) RunControlMainGUIImpl (RunControlMainGUIImpl) userApplication (testSummary)
DataDistributorServer (DataDistributor) GlobalPanelImpl (GlobalPanelImpl) Lem (gDb) RunControlSocketHandler (RunControlCommon) userApplication (testEvtBldr_script)
DataExport (DataExport) GMem (gMem) ListViewToolTip (rcStatusMonitor)
S
userApplication (testErrorPropogation)
DefaultPeriodicCondition (TrgUsingTiles) GNAT (gNAT) LogRecordStreamHandler (MSGLogGUIImpl) ScrollablePlotView (EnvMonImpl) userApplication (testTrgParityError)
DefaultSequence (TrgUsingTiles) GOCS (gOCS) Loopback (gLoopback) ServerPreferencesImpl (ServerPreferencesImpl) userApplication (testAppEvt)
DIAGcontributionIterator (standardLDF) GOSEDCALImpl (GOSEDCALImpl)
M
SGETrgEngines (SimpleGasuExample) userApplication (testAppAcdScalers)
DIAGcontributionIterator_ (GOSED_LDF) GOSEDCALTKRImpl (GOSEDCALTKRImpl) MailAlert (MailAlert) SGETrgEngines (testAppAcdScalers) userApplication (testTkrHitFilter)
DispatcherError (errors) GOSEDDataImpl (GOSEDDataImpl) MarkerTrgReadout (testAppAcdScalers) SGETrgInputEnables (testAppAcdScalers) userApplication (testAppAlarm)
DispatcherKeyError (errors) GOSEDPreferencesImpl (GOSEDPreferencesImpl) mask (mask) SGETrgInputEnables (SimpleGasuExample) userApplication (testAppExclude)
DispatcherTypeError (errors) GOSEDTKRImpl (GOSEDTKRImpl) Merger (fileMerge) SimpleGasuExample (testAppAcdScalers) userApplication (testAppLDFdump)
doublehisto (doublehisto) GOSEDTWRImpl (GOSEDTWRImpl) Merger (socketMerge) SimpleGasuExample (SimpleGasuExample) userApplication (hTestStrip)
drawHatACD (GOSEDPainter) GPDU (gPDU) Merger (gEvtCliBT) singleEvtDisplayImpl (gosedImpl) userApplicationCallbacks (testAppCal)
drawRainbowACD (GOSEDPainter) GPEQ (gPDU) MiniGLTExample (test_evt_cal) SLACmail (MailAlert) userAppLoader (userAppLoader)
drawRainbowCAL (GOSEDPainter) GpibPwrCtrlImpl (GpibPwrCtrlImpl) MiniGLTExample (MiniGLTExample) Socket (gSocket) userAppTree (userAppTree)
drawSide1ACD (GOSEDPainter) GroupPanel (PorcinePanel) MiniGLTExample (testAppAcdScalers) SocketClosed (gEvtCliBT) userArgText (hTestEnv)
drawSide2ACD (GOSEDPainter) Grule (gRule) MiniGltExtTrg (test_evt_exttrg) SolicitedCondition (testAppAcdScalers) userArgText (testAppTkr)
drawSide3ACD (GOSEDPainter) GruleAlarms (gRule) MiniGLTSolicitedCondition (testAppAcdScalers) SolicitedCondition (SimpleGasuExample) userArgText (testEvtBldr_script)
drawSide4ACD (GOSEDPainter) GruleBase (gRule) MiniGLTSolicitedCondition (MiniGLTExample) SolicitedEngine (testAppAcdScalers) userArgText (splitOutTem)
drawXZ_CAL (GOSEDPainter) GruleLimit (gRule) MiniGLTSolicitedCondition (test_evt_cal) SolicitedEngine (SimpleGasuExample) userArgText (testAppCal_dg)
drawXZ_TKR (GOSEDPainter) GSIU (gSIU) MiniGLTSolicitedEngine (testAppAcdScalers) standardPlotter (standardPlotter) userArgText (hTestAppTkr)
drawYZ_CAL (GOSEDPainter) GTCC (gTEM) MiniGLTSolicitedEngine (test_evt_cal) standardPlotterGuiImpl (standardPlotterGuiImpl) userArgText (testAppLDFdump)
drawYZ_TKR (GOSEDPainter) GTEM (gTEM) MiniGLTSolicitedEngine (MiniGLTExample) standardTestReport (standardPlotter) userArgText (sweepRejectTest)
DummyRecorder (Recorder) GTest (test_db) MiniGLTTrgConditionsValue (TrgMiniGLT) StatusItem (rcStatusMonitor) userArgText (testAppArchiver)
DummyRetriever (Retriever) GTFE (gTEM) MiniGltTrgEngine (test_evt_exttrg) StatusLabel (PorcinePanel) userArgText (hTestAppEvt)
E
GTIC (gTEM) MiniGLTTrgEngines (test_evt_cal) SweepMarkerEngine (rcTrgFunctions) userArgText (testSAppCal_Lean)
EBFeventIterator (standardLDF) GTPG (gTPG) MiniGLTTrgEngines (testAppAcdScalers)
T
userArgText (testAppAcdScalers)
Email (MailAlert) GTRC (gTEM) MiniGLTTrgEngines (MiniGLTExample) TaskEngine (taskEngine) userArgText (testAppEvtCli)
EMPanel (PorcinePanel) GTWR (gXBR) MSGLogGUIImpl (MSGLogGUIImpl) TaskEngineTestCase (taskEngine) userArgText (testTkrHitFilter)
EnvMonImpl (EnvMonImpl) GUIbridge (guiBridges) MSGLogSocketReceiver (MSGLogGUIImpl) testArchiver (testArchiver) userArgText (testSummary)
ERRcontributionIterator_ (GOSED_LDF) GUIbridgeTest (guiBridges) multibar (multibar) testEvtCli (testEvtCli) userArgText (testSAppEvt)
ErrorLogCounterHandler (RunControlCommon) Gversions (gVersions) myLATcomponentIterator (GOSED_LDF) TestWindow (guiBridges) userArgText (testErrorPropogation)
evAEM_PHA (gEvtCli) GXBRD (gXBR) myLATcomponentIterator (hTestAppEvt) TimeAxisGen (HskSqlGuiReceiver) userArgText (testAppNoVersion)
evCAL_LayerLogData (gEvtCli)
H
myLATcomponentIterator (testSAppEvt) TimeAxisGen (HskGuiReceiver) userArgText (excApp)
evCAL_LogAccepts (gEvtCli) HAEM (gHSK) myLATcomponentIterator (splitOutTem) TKRcontributionIterator (standardLDF) userArgText (testAppEvt)
evCAL_LogData (gEvtCli) HARC (gHSK) myLATcomponentIterator (testAppEvt) TKRcontributionIterator_ (GOSED_LDF) userArgText (testAppMinimal)
evCellHeader (gEvtCli) HCOM (gHSK) myLATdbIterator (splitOutTem) towerEvtDisplayImpl (GOTEDImpl) userArgText (testAppAlarm)
evCellHeader_Singleton (gEvtCli) HCPU (gHSK) MyLogSocketHandler (socketLogging) TowerPanel (PorcinePanel) userArgText (transitionRejectTest)
evContPacket (gEvtCli) HEBM (gHSK) MyRoi (TrgRoiAsVeto) TowerPowerPanel (PorcinePanel) userArgText (testSAppCal)
evContPacket_Singleton (gEvtCli) HGEM (gHSK) myTKRcontributionIterator (hTestAppEvt) towerwidgetImpl (towerwidgetImpl) userArgText (testAppCal)
evDiag_CalLayer (gEvtCli) HNUL (gHSK)
N
Trendable (Trendable) userArgText (testAppEvtTO)
evDiag_CalLayerEnd (gEvtCli) HPDU (gHSK) NoCnoEnabled (NullObjects) TrendLimit (Trendable) userArgText (testAppAcd)
evDiag_Data (gEvtCli) HskAlarmRecorder (HskRecorder) Node (gNode) TrendMapBase (TrendMaps) userArgText (hTestStrip)
evDiag_TkrTrgReq (gEvtCli) HskCfgTextReceiver (HskReceiver) NodeRegisterList (HskRegisters) TrendPlotter (HskSqlGuiReceiver) userArgument (testAppLDFdump)
eventThread (trgDisplayImpl) HskCli (HskCli) NoExternal (NullObjects) TrendPlotter (HskGuiReceiver) userArgument (testAppEvtCli)
evErr_CablePhase (gEvtCli) HskCmdRxSocket (HskCli) NoInputsEnabled (NullObjects) TrendPlotter (testTrending) userArgument (testAppEvtTO)
evErr_CableTimeOut (gEvtCli) HskCmdTxSocket (HskCli) NoTilesEnabled (NullObjects) TrendTestGUI (testTrending) userArgument (testEvtBldr_script)
evErr_GCCC (gEvtCli) HskCollector (HskCollector) NoTowersBusy (NullObjects) TrendTree (testTrending) userArgument (testErrorPropogation)
evErr_GCCC_Message (gEvtCli) HskConfiguration (HskCollector) NoTowersEnabled (NullObjects) TrgAbstract (TrgAbstract) userArgument (testAppCal_dg)
evErr_GTCC (gEvtCli) HskFileRecorder (HskRecorder) NullCal (NullObjects) TrgCalorimeter (TrgTower) userArgument (testTkrHitFilter)
evErr_GTCC_Message (gEvtCli) HskHandler (HskCli) NullCoincidence (NullObjects) TrgCmdCounters (TrgCmdCounters) userArgument (splitOutTem)
evErr_Summary (gEvtCli) HskLatRetriever (HskRetriever) NullEngine (NullObjects) TrgCmdStats (TrgCmdCounters) userArgument (hTestAppTkr)
evGEM_Cond_Arrival_Times (gEvtCli) HskPacket (HskPacket) NullRequest (NullObjects) TrgCnoCounters (TrgCnoCounters) userArgument (testAppAcdScalers)
evGEM_Veto_List (gEvtCli) HskPacket210 (HskPacket) NullRoi (NullObjects) TrgCnoEnables (TrgInputEnables) userArgument (testAppArchiver)
evSummary (gEvtCli) HskPacket211 (HskPacket) NullStream (GlobalPanelImpl) TrgCnoStats (TrgCnoCounters) userArgument (testAppCal)
evSummary_Singleton (gEvtCli) HskPacket212 (HskPacket) NullTkr (NullObjects) TrgCoincidence (TrgCoincidences) userArgument (testSAppCal_Lean)
Evt (gEvtCli) HskPacket213 (HskPacket) NullTower (NullObjects) TrgCoincidences (TrgCoincidences) userArgument (testSummary)
EvtCli (test_loopback) HskPacket214 (HskPacket)
O
TrgConditions (TrgConditions) userArgument (testAppTkr)
EvtCli (gEvtCli) HskPacket215 (HskPacket) OcsMessages (gOcsMessages) TrgConditionsValue (TrgConditionsValue) userArgument (hTestEnv)
EvtCliBT (gEvtCliBT) HskPacket216 (HskPacket) Opcode (gOpcode) trgConsumer (trgConsumer) userArgument (testSAppCal)
EvtCliIO (gEvtCli) HskPacket217 (HskPacket) Options (gOptions) TrgDefaultPeriodicCondition (TrgPeriodic) userArgument (testAppEvt)
evtDataImpl (evtDataImpl) HskPacket218 (HskPacket) OSWcontributionIterator (standardLDF) TrgDefaultSequence (TrgSequence) userArgument (testAppAlarm)
evTKR_Strip (gEvtCli) HskPacket219 (HskPacket) OSWcontributionIterator_ (GOSED_LDF) trgDisplayImpl (trgDisplayImpl) userArgument (testAppMinimal)
evTKR_StripData (gEvtCli) HskPacket21a (HskPacket)
P
TrgEngine (TrgEngines) userArgument (excApp)
evTKR_TOTdata (gEvtCli) HskPacket21b (HskPacket) palettes (userAppLoader) TrgEngineRequest (TrgEngines) userArgument (hTestStrip)
ExceptionFSM (FSM) HskPacket21c (HskPacket) panelsTest (userAppBrowser) TrgEngines (TrgEngines) userArgument (sweepRejectTest)
ExclusiveButtonGroup (PorcinePanel) HskPacket21d (HskPacket) PduSwitch (test_pduswitch) TrgEventCounter (TrgEventCounter) userArgument (testSAppEvt)
F
HskPacket21e (HskPacket) Playback (test_playback) TrgExtEnables (TrgInputEnables) userArgument (testAppAcd)
FabricPanel (PorcinePanel) HskPacket21f (HskPacket) PlotWidget (EnvMonImpl) TrgGem (TrgGem) userArgument (transitionRejectTest)
Fabrics (gFabrics) HskPacket220 (HskPacket) Plumber (gPlumber) TrgGemAbstract (TrgGemAbstract) userArgument (testAppNoVersion)
FancyTrendTree (testTrending) HskPacket221 (HskPacket) PorcineEvent (PorcinePanel) TrgGemCmdCounters (TrgGemCounters) userArgument (hTestAppEvt)
FEpowerUp (FEpowerUp) HskPacket222 (HskPacket) PorcinePanel (PorcinePanel) TrgGemCmdStats (TrgGemCounters) userModule (userAppBrowser)
FlatFileRecorder (Recorder) HskPacket223 (HskPacket) PorcineWindow (PorcinePanel) TrgGemCnoCounters (TrgGemCounters) userSuite (testSuite_Lean)
FrontEndPowerPanel (PorcinePanel) HskPacket224 (HskPacket) PowerPanelImpl (PowerPanelImpl) TrgGemCnoStats (TrgGemCounters) userSuite (testSuite)
FSM (FSM) HskPacket225 (HskPacket) Preferences (rcPreferencesManager) TrgGemEventCounter (TrgGemCounters) userSuite (testSuiteSummary)
FswMessages (gFswMessages) HskPacket226 (HskPacket) PythonShellWidget (rcPythonShell) TrgGemPeriodicCondition (TrgGemPeriodicCondition) userSuite (testSuiteLong)
FullCondition (testAppAcdScalers) HskPacket227 (HskPacket) PyThreadBridge (guiBridges) TrgGemPPSTimer (TrgGemCounters) userSuite (testSuite2)
FullEngine (testAppAcdScalers) HskPacket228 (HskPacket)
Q
TrgGemRegisters (TrgGemRegisters) userSuiteCallbacks (testSuite)
G
HskPacket229 (HskPacket) QtReceiver (HskSqlGuiReceiver) TrgGemSequence (TrgGemSequence)
W
GAEM (gAEM) HskPacket22a (HskPacket) QtReceiver (testTrending) TrgGemTileCounters (TrgGemCounters) WatchItem (rcStatusMonitor)
GAEQ (gAEM) HskPacket22b (HskPacket) QtReceiver (HskGuiReceiver) TrgGemTileStats (TrgGemCounters)
Z
GAFE (gAEM) HskPacket22c (HskPacket) QtThreadBridge (guiBridges) TrgGemTriggerCounters (TrgGemCounters) ZsupSolicitedEngine (test_evt_tkr)
gAlertHandler (gAlert) HskPacket22d (HskPacket)
R
TrgGemTriggerStats (TrgGemCounters) ZsupSolicitedEngine (test_evt_cal)
gAlertMail (gAlert) HskPacket22e (HskPacket) radiomask (radiomask) TrgInjectCharge (TrgEngines) ZsupTrgInjectChargeReadout (test_evt_cal)
gAlertMailer (gAlert) HskPacket22f (HskPacket) rcArchiver (rcArchiver) TrgInjectChargeReadout (TrgEngines) ZsupTrgReadout (MiniGLTExample)
gAlertPopup (AlertGuiImpl) HskPacket230 (HskPacket) rcCommentPanel (rcCommentPanel) TrgInjectMarker (TrgEngines) ZsupTrgReadout (SimpleGasuExample)
gAlertRegistry (gAlert)

_ | A | B | C | D | E | F | G | H | L | M | N | O | P | Q | R | S | T | U | W | Z

Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evtDataImpl Member List

This is the complete list of members for evtDataImpl, including all inherited members.

__init__(parent=None, name=None, fl=0) (defined in evtDataImpl) | evtDataImpl
fileExit() (defined in evtDataImpl) | evtDataImpl
fileNew() (defined in evtDataImpl) | evtDataImpl
fileOpen() (defined in evtDataImpl) | evtDataImpl
filePrint() (defined in evtDataImpl) | evtDataImpl
fileSave() (defined in evtDataImpl) | evtDataImpl
fileSaveAs() (defined in evtDataImpl) | evtDataImpl
helpAbout() (defined in evtDataImpl) | evtDataImpl
helpContents() (defined in evtDataImpl) | evtDataImpl
helpIndex() (defined in evtDataImpl) | evtDataImpl
load() (defined in evtDataImpl) | evtDataImpl

Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(rc, userId, debug) (defined in userApplication) | userApplication
commandSynch() (defined in userApplication) | userApplication
getName() (defined in userApplication) | userApplication
pause() (defined in userApplication) | userApplication
process((status, buffer)) | userApplication
resume() (defined in userApplication) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
sync() (defined in userApplication) | userApplication
teardown() (defined in userApplication) | userApplication
wait() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userArgText Member List

This is the complete list of members for userArgText, including all inherited members.

__init__() (defined in userArgText) | userArgText
getValue(caption) (defined in userArgText) | userArgText

Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userArgument Member List

This is the complete list of members for userArgument, including all inherited members.

__init__(parent=None, name=None, modal=0, fl=0) (defined in userArgument) | userArgument
CancelButtonClicked() (defined in userArgument) | userArgument
getValue(caption) (defined in userArgument) | userArgument
getValueExc(caption) (defined in userArgument) | userArgument
OKButtonClicked() (defined in userArgument) | userArgument

Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

FEpowerUp Member List

This is the complete list of members for FEpowerUp, including all inherited members.

checkPower(aem, activeTEMs) (defined in FEpowerUp) | FEpowerUp
down() | FEpowerUp
getActiveTEMs(lat) (defined in FEpowerUp) | FEpowerUp
initialize(lat, xbrd) (defined in FEpowerUp) | FEpowerUp
isAEMactive(aem) (defined in FEpowerUp) | FEpowerUp
refreshPowerStatus() (defined in FEpowerUp) | FEpowerUp
setAcdPowerUp(acdPowerUp) (defined in FEpowerUp) | FEpowerUp
setTemPowerUp(temPowerUp) (defined in FEpowerUp) | FEpowerUp
up() (defined in FEpowerUp) | FEpowerUp

Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Merger Member List

This is the complete list of members for Merger, including all inherited members.

close() | Merger
dispose((statuses, event)) | Merger

Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ExceptionFSM Member List

This is the complete list of members for ExceptionFSM, including all inherited members.

__init__(value) (defined in ExceptionFSM) | ExceptionFSM
__str__() (defined in ExceptionFSM) | ExceptionFSM

Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

FSM Member List

This is the complete list of members for FSM, including all inherited members.

__init__(initial_state, something) | FSM
add_transition(input_symbol, state, action, next_state) | FSM
add_transition_any(state, action, next_state) | FSM
add_transition_list(list_input_symbols, state, action, next_state) | FSM
get_transition(input_symbol, state) | FSM
process(input_symbol) | FSM
process_list(s) | FSM
reset() | FSM
set_default_transition(action, next_state) | FSM

Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GAEM Member List

This is the complete list of members for GAEM, including all inherited members.

__init__(client, parent) | GAEM
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
allARC() | GAEM
attrIter() | Gdb
downAEQ() | GAEM
downARC(arcId) | GAEM
existsAEQ() | GAEM
existsARC(arcId) | GAEM
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GAEM) | GAEM
read(reg) (defined in GAEM) | GAEM
root() | Gdb
send(cmd) (defined in GAEM) | GAEM
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:26:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GAEQ Member List

This is the complete list of members for GAEQ, including all inherited members.

__init__(client, parent) | GAEQ
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GAEQ) | GAEQ
read(reg) (defined in GAEQ) | GAEQ
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:26:44 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GAFE Member List

This is the complete list of members for GAFE, including all inherited members.

__init__(client, parent, id) | GAFE
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GAFE) | GAFE
read(reg) (defined in GAFE) | GAFE
root() | Gdb
send(cmd) (defined in GAFE) | GAFE
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:26:44 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GARC Member List

This is the complete list of members for GARC, including all inherited members.

__init__(client, parent, id) | GARC
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
allAFE() | GARC
attrIter() | Gdb
downAFE(afeId) | GARC
existsAFE(afeId) | GARC
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GARC) | GARC
read(reg) (defined in GARC) | GARC
root() | Gdb
send(cmd) (defined in GARC) | GARC
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:26:44 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

gAlertHandler Member List

This is the complete list of members for gAlertHandler, including all inherited members.

handle(alertStr) gAlertHandler

Generated on Fri Jul 21 13:26:44 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

gAlertMail Member List

This is the complete list of members for gAlertMail, including all inherited members.

body(b=None) (defined in Email) | Email
recipient(r=None) (defined in Email) | Email
sender(s=None) (defined in Email) | Email
subject(s=None) (defined in Email) | Email

Generated on Fri Jul 21 13:26:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

gAlertMailer Member List

This is the complete list of members for gAlertMailer, including all inherited members.

handle(alertStr) gAlertMailer

Generated on Fri Jul 21 13:26:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

gAlertRegistry Member List

This is the complete list of members for gAlertRegistry, including all inherited members.

__init__() (defined in gAlertRegistry) | gAlertRegistry
handle(alertStr) (defined in gAlertRegistry) | gAlertRegistry
register(system, handler) | gAlertRegistry
unregister(handler, categories) (defined in gAlertRegistry) | gAlertRegistry

Generated on Fri Jul 21 13:26:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

gAlertStr Member List

This is the complete list of members for gAlertStr, including all inherited members.

__init__(alertStr=None) (defined in gAlertStr) | gAlertStr
decode(string=None) | gAlertStr
encode(severity, timestamp, system, message, machine=0) | gAlertStr

Generated on Fri Jul 21 13:26:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

_Attr Member List

This is the complete list of members for _Attr, including all inherited members.

__init__(node, attr, egu) (defined in _Attr) | _Attr
flags() (defined in _Attr) | _Attr
getConstraint() | _Attr
getEGU() | _Attr
getName() (defined in _Attr) | _Attr
getNode() (defined in _Attr) | _Attr
getRule() | _Attr
getTimeStamp() | _Attr
id() (defined in _Attr) | _Attr
isCommand() | _Attr
isDeprecated() | _Attr
isNoDirectAccess() | _Attr
isReadOnly() | _Attr
isReadWrite() | _Attr
isWriteOnly() | _Attr
setConstraint(constraint) | _Attr
setEGU(egu) | _Attr
setRule(rule) | _Attr
setTimeStamp(value) (defined in _Attr) | _Attr
size() | _Attr

Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Gattr Member List

This is the complete list of members for Gattr, including all inherited members.

__init__(name, id, size, flags, rule=None, constraint=None, egu=None) | Gattr
create(node) (defined in Gattr) | Gattr
flags() (defined in Gattr) | Gattr
get(node, attr, bypass=0) (defined in Gattr) | Gattr
getConstraint() | Gattr
getEGU() | Gattr
getName() (defined in Gattr) | Gattr
getRule() | Gattr
id() (defined in Gattr) | Gattr
isCommand() | Gattr
isDeprecated() | Gattr
isNoDirectAccess() | Gattr
isReadOnly() | Gattr
isReadWrite() | Gattr
isWriteOnly() | Gattr
set(node, value, attr, bypass=0) (defined in Gattr) | Gattr
setConstraint(constraint) | Gattr
setEGU(egu) | Gattr
setRule(rule) | Gattr
size() | Gattr

Generated on Fri Jul 21 13:26:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GattrBF Member List

This is the complete list of members for GattrBF, including all inherited members.

__init__(name, regno, start, end, flags=ATTR_READ_WRITE) | GattrBF
gAttr::Gattr::__init__(name, id, size, flags, rule=None, constraint=None, egu=None) | Gattr
create(node) (defined in Gattr) | Gattr
flags() (defined in Gattr) | Gattr
get(node, attr, bypass=0) | GattrBF
getConstraint() | Gattr
getEGU() | Gattr
getName() (defined in Gattr) | Gattr
getRule() | Gattr
id() (defined in Gattr) | Gattr
isCommand() | Gattr
isDeprecated() | Gattr
isNoDirectAccess() | Gattr
isReadOnly() | Gattr
isReadWrite() | Gattr
isWriteOnly() | Gattr
set(node, val, attr, bypass=0) | GattrBF
set(node, value, attr, bypass=0) (defined in Gattr) | Gattr
setConstraint(constraint) | Gattr
setEGU(egu) | Gattr
setRule(rule) | Gattr
size() | Gattr

Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GattrDlc Member List

This is the complete list of members for GattrDlc, including all inherited members.

__init__(name, cmdNo, size=0, flags=ATTR_COMMAND) (defined in GattrDlc) | GattrDlc
gAttr::Gattr::__init__(name, id, size, flags, rule=None, constraint=None, egu=None) | Gattr
create(node) (defined in Gattr) | Gattr
flags() (defined in Gattr) | Gattr
get(node, attr, bypass=0) (defined in Gattr) | Gattr
getConstraint() | Gattr
getEGU() | Gattr
getName() (defined in Gattr) | Gattr
getRule() | Gattr
id() (defined in Gattr) | Gattr
isCommand() | Gattr
isDeprecated() | Gattr
isNoDirectAccess() | Gattr
isReadOnly() | Gattr
isReadWrite() | Gattr
isWriteOnly() | Gattr
set(node, args) | GattrDlc
set(node, value, attr, bypass=0) (defined in Gattr) | Gattr
setConstraint(constraint) | Gattr
setEGU(egu) | Gattr
setRule(rule) | Gattr
size() | Gattr

Generated on Fri Jul 21 13:26:46 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GattrRaw Member List

This is the complete list of members for GattrRaw, including all inherited members.

__init__(name, regno, size, flags=ATTR_READ_WRITE) | GattrRaw
gAttr::Gattr::__init__(name, id, size, flags, rule=None, constraint=None, egu=None) | Gattr
create(node) (defined in Gattr) | Gattr
flags() (defined in Gattr) | Gattr
get(node, attr, bypass=0) | GattrRaw
getConstraint() | Gattr
getEGU() | Gattr
getName() (defined in Gattr) | Gattr
getRule() | Gattr
id() (defined in Gattr) | Gattr
isCommand() | Gattr
isDeprecated() | Gattr
isNoDirectAccess() | Gattr
isReadOnly() | Gattr
isReadWrite() | Gattr
isWriteOnly() | Gattr
set(node, val, attr, bypass=0) | GattrRaw
set(node, value, attr, bypass=0) (defined in Gattr) | Gattr
setConstraint(constraint) | Gattr
setEGU(egu) | Gattr
setRule(rule) | Gattr
size() | Gattr

Generated on Fri Jul 21 13:26:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GattrReg Member List

This is the complete list of members for GattrReg, including all inherited members.

__init__(name, regno, size, flags=ATTR_READ_WRITE, rule=Gattr.defaultRule, constraint=Gattr.defaultConstraint, egu=Gattr.defaultEgu) | GattrReg
gAttr::Gattr::__init__(name, id, size, flags, rule=None, constraint=None, egu=None) | Gattr
create(node) (defined in Gattr) | Gattr
flags() (defined in Gattr) | Gattr
get(node, attr, bypass=0) | GattrReg
getConstraint() | Gattr
getEGU() | Gattr
getName() (defined in Gattr) | Gattr
getRule() | Gattr
id() (defined in Gattr) | Gattr
isCommand() | Gattr
isDeprecated() | Gattr
isNoDirectAccess() | Gattr
isReadOnly() | Gattr
isReadWrite() | Gattr
isWriteOnly() | Gattr
set(node, val, attr, bypass=0) | GattrReg
set(node, value, attr, bypass=0) (defined in Gattr) | Gattr
setConstraint(constraint) | Gattr
setEGU(egu) | Gattr
setRule(rule) | Gattr
size() | Gattr

Generated on Fri Jul 21 13:26:46 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GattrRegDepr Member List

This is the complete list of members for GattrRegDepr, including all inherited members.

__init__(name, regno, size, flags=ATTR_READ_WRITE, rule=Gattr.defaultRule, constraint=Gattr.defaultConstraint, egu=Gattr.defaultEgu) | GattrReg
gAttr::Gattr::__init__(name, id, size, flags, rule=None, constraint=None, egu=None) | Gattr
create(node) (defined in Gattr) | Gattr
flags() (defined in Gattr) | Gattr
get(node, attr, bypass=0) | GattrRegDepr
getConstraint() | Gattr
getEGU() | Gattr
getName() (defined in Gattr) | Gattr
getRule() | Gattr
id() (defined in Gattr) | Gattr
isCommand() | Gattr
isDeprecated() | Gattr
isNoDirectAccess() | Gattr
isReadOnly() | Gattr
isReadWrite() | Gattr
isWriteOnly() | Gattr
set(node, val, attr, bypass=0) | GattrRegDepr
set(node, value, attr, bypass=0) (defined in Gattr) | Gattr
setConstraint(constraint) | Gattr
setEGU(egu) | Gattr
setRule(rule) | Gattr
size() | Gattr

Generated on Fri Jul 21 13:26:46 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

bf Member List

This is the complete list of members for bf, including all inherited members.

__getitem__(index) (defined in bf) | bf
__getslice__(start, end) (defined in bf) | bf
__int__() (defined in bf) | bf
__setitem__(index, value) (defined in bf) | bf
__setslice__(start, end, value) (defined in bf) | bf
__str__() (defined in bf) | bf
getOnBits() (defined in bf) | bf
set(value) (defined in bf) | bf

Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

BitField Member List

This is the complete list of members for BitField, including all inherited members.

__getattr__(attribute) (defined in BitField) | BitField
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

CmdCli Member List

This is the complete list of members for CmdCli, including all inherited members.

__init__(handler=None, debug=0, port=PortNumber) (defined in CmdCli) | CmdCli
__init__(portnumber) (defined in Socket) | Socket
connect(host) (defined in Socket) | Socket
disconnect() (defined in Socket) | Socket
getDebug() (defined in CmdCli) | CmdCli
gettimeout() (defined in Socket) | Socket
handler(newhandler) (defined in CmdCli) | CmdCli
isConnected() (defined in Socket) | Socket
lock() (defined in Socket) | Socket
port() (defined in Socket) | Socket
purge() | Socket
recv(size) (defined in Socket) | Socket
recvall(size) (defined in Socket) | Socket
release() (defined in Socket) | Socket
send(packet) (defined in Socket) | Socket
sendall(packet) (defined in Socket) | Socket
setDebug(debug) (defined in CmdCli) | CmdCli
setPort(port) (defined in Socket) | Socket
setSocket(sock) (defined in Socket) | Socket
settimeout(seconds) (defined in Socket) | Socket
socket() (defined in Socket) | Socket

Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Command Member List

This is the complete list of members for Command, including all inherited members.

__init__(functionname, arguments) (defined in Command) | Command
packet() (defined in Command) | Command
payloadfmts() (defined in Command) | Command

Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Gconstraint Member List

This is the complete list of members for Gconstraint, including all inherited members.

__init__(name, subsystem, category, enabled, continuous=False) | Gconstraint
__init__() (defined in GconstraintBase) | GconstraintBase
_eval_(value) | Gconstraint
category() | Gconstraint
disable() | Gconstraint
enable() | Gconstraint
enabled() | Gconstraint
evaluate(value) | Gconstraint
name() | Gconstraint
reject(message) | Gconstraint
reset() | Gconstraint
subsystem() | Gconstraint

Generated on Fri Jul 21 13:26:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GconstraintBase Member List

This is the complete list of members for GconstraintBase, including all inherited members.

__init__() (defined in GconstraintBase) | GconstraintBase
evaluate(value) (defined in GconstraintBase) | GconstraintBase

Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GconstraintLimit Member List

This is the complete list of members for GconstraintLimit, including all inherited members.

__init__(name, subsystem, category, enabled, continuous, low, high) (defined in GconstraintLimit) | GconstraintLimit
gConstraint::Gconstraint::__init__(name, subsystem, category, enabled, continuous=False) | Gconstraint
__init__() (defined in GconstraintBase) | GconstraintBase
_eval_(value) | GconstraintLimit
category() | Gconstraint
disable() | Gconstraint
enable() | Gconstraint
enabled() | Gconstraint
evaluate(value) | Gconstraint
name() | Gconstraint
reject(message) | Gconstraint
reset() | Gconstraint
subsystem() | Gconstraint

Generated on Fri Jul 21 13:26:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GconstraintLimitPegRE Member List

This is the complete list of members for GconstraintLimitPegRE, including all inherited members.

__init__(name, subsystem, category, enabled, continuous, low, high) (defined in GconstraintLimitPegRE) | GconstraintLimitPegRE
gConstraint::Gconstraint::__init__(name, subsystem, category, enabled, continuous=False) | Gconstraint
__init__() (defined in GconstraintBase) | GconstraintBase
_eval_(value) | GconstraintLimitPegRE
category() | Gconstraint
disable() | Gconstraint
enable() | Gconstraint
enabled() | Gconstraint
evaluate(value) | Gconstraint
name() | Gconstraint
reject(message) | Gconstraint
reset() | Gconstraint
subsystem() | Gconstraint

Generated on Fri Jul 21 13:26:49 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GconstraintLimitRE Member List

This is the complete list of members for GconstraintLimitRE, including all inherited members.

__init__(name, subsystem, category, enabled, continuous, low, high) (defined in GconstraintLimitRE) | GconstraintLimitRE
gConstraint::Gconstraint::__init__(name, subsystem, category, enabled, continuous=False) | Gconstraint
__init__() (defined in GconstraintBase) | GconstraintBase
_eval_(value) | GconstraintLimitRE
category() | Gconstraint
disable() | Gconstraint
enable() | Gconstraint
enabled() | Gconstraint
evaluate(value) | Gconstraint
name() | Gconstraint
reject(message) | Gconstraint
reset() | Gconstraint
subsystem() | Gconstraint

Generated on Fri Jul 21 13:26:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

gConstraintViolation Member List

This is the complete list of members for gConstraintViolation, including all inherited members.

__init__(args=None) (defined in gConstraintViolation) gConstraintViolation

Generated on Fri Jul 21 13:26:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GCRU Member List

This is the complete list of members for GCRU, including all inherited members.

__init__(client, parent) | GCRU
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GCRU) | GCRU
read(reg) (defined in GCRU) | GCRU
root() | Gdb
send(cmd) (defined in GCRU) | GCRU
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:26:49 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

_regList Member List

This is the complete list of members for _regList, including all inherited members.

__contains__(attribute) (defined in _regList) | _regList
__getitem__(attribute) (defined in _regList) | _regList
__setitem__(attribute, value) (defined in _regList) | _regList
get(attribute, default=None) (defined in _regList) | _regList
has_key(attribute) (defined in _regList) | _regList

Generated on Fri Jul 21 13:26:50 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Children Member List

This is the complete list of members for Children, including all inherited members.

__init__(parent, type) (defined in Children) | Children
add(id) (defined in Children) | Children
all() (defined in Children) | Children
down(id) (defined in Children) | Children
exists(id) (defined in Children) | Children
remove(id) (defined in Children) | Children

Generated on Fri Jul 21 13:26:50 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Gdb Member List

This is the complete list of members for Gdb, including all inherited members.

__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:26:50 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Lem Member List

This is the complete list of members for Lem, including all inherited members.

__init__(client) (defined in Lem) | Lem
getParity(parity_type) (defined in Lem) | Lem
setParity(parity_type, parity_select) (defined in Lem) | Lem

Generated on Fri Jul 21 13:26:50 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Geb Member List

This is the complete list of members for Geb, including all inherited members.

__init__(contributors) (defined in Geb) | Geb
build() | Geb
close() | Geb
flushAll() | Geb
name() | Geb
run() | Geb
shutdown() | Geb

Generated on Fri Jul 21 13:26:51 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GebContribution Member List

This is the complete list of members for GebContribution, including all inherited members.

contributor() (defined in GebContribution) | GebContribution
identity() | GebContribution
length() | GebContribution
sequence() | GebContribution

Generated on Fri Jul 21 13:26:50 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GebContributor Member List

This is the complete list of members for GebContributor, including all inherited members.

__init__() (defined in GebContributor) | GebContributor |
close() | GebContributor |
contributionQueue() | GebContributor | [static]
idMask(id=None) | GebContributor |
name() | GebContributor |
open() | GebContributor |
read() | GebContributor |
run() | GebContributor |
sequence(sequence) | GebContributor |

Generated on Fri Jul 21 13:26:50 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GEBM Member List

This is the complete list of members for GEBM, including all inherited members.

__init__(client, parent) | GEBM
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
downEBMC() | GEBM
downEBMST() | GEBM
existsEBMC() | GEBM
existsEBMST() | GEBM
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:26:51 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GEBMC Member List

This is the complete list of members for GEBMC, including all inherited members.

__init__(client, parent) | GEBMC
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GEBMC) | GEBMC
read(reg) (defined in GEBMC) | GEBMC
root() | Gdb
send(cmd) (defined in GEBMC) | GEBMC
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:26:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GEBMST Member List

This is the complete list of members for GEBMST, including all inherited members.

__init__(client, parent) | GEBMST
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
read(reg) (defined in GEBMST) | GEBMST
root() | Gdb
send(cmd) (defined in GEBMST) | GEBMST
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:26:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GEGU Member List

This is the complete list of members for GEGU, including all inherited members.

__init__(units) (defined in GEGU) | GEGU
egu(value) | GEGU
raw(value) | GEGU
units() | GEGU

Generated on Fri Jul 21 13:26:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GEGU_linear Member List

This is the complete list of members for GEGU_linear, including all inherited members.

__init__(slope, intercept, units="") | GEGU_linear
__init__(units) (defined in GEGU) | GEGU
egu(rawValue) | GEGU_linear
gEGU::GEGU::egu(value) | GEGU
raw(eguValue) | GEGU_linear
gEGU::GEGU::raw(value) | GEGU
units() | GEGU

Generated on Fri Jul 21 13:26:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GEGU_poly3 Member List

This is the complete list of members for GEGU_poly3, including all inherited members.

__init__(coeff0, coeff1, coeff2, coeff3, offset, units="") | GEGU_poly3
__init__(units) (defined in GEGU) | GEGU
egu(rawValue) | GEGU_poly3
gEGU::GEGU::egu(value) | GEGU
raw(eguValue) | GEGU_poly3
gEGU::GEGU::raw(value) | GEGU
units() | GEGU

Generated on Fri Jul 21 13:26:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GEGU_rtd Member List

This is the complete list of members for GEGU_rtd, including all inherited members.

__init__(coeff0, coeff1, coeff2, coeff3, coeff4, units="") | GEGU_rtd
__init__(units) (defined in GEGU) | GEGU
egu(rawValue) | GEGU_rtd
gEGU::GEGU::egu(value) | GEGU
raw(eguValue) | GEGU_rtd
gEGU::GEGU::raw(value) | GEGU
units() | GEGU

Generated on Fri Jul 21 13:26:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GEGU_thermistor Member List

This is the complete list of members for GEGU_thermistor, including all inherited members.

__init__(coeff0, coeff1, coeff2, coeff3, units="") | GEGU_thermistor
__init__(units) (defined in GEGU) | GEGU
egu(rawValue) | GEGU_thermistor
gEGU::GEGU::egu(value) | GEGU
raw(eguValue) | GEGU_thermistor
gEGU::GEGU::raw(value) | GEGU
units() | GEGU

Generated on Fri Jul 21 13:26:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GEPU Member List

This is the complete list of members for GEPU, including all inherited members.

__init__(client, parent, id) | GEPU
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:26:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

AEM Member List

This is the complete list of members for AEM, including all inherited members.

__init__() (defined in AEM) | AEM
addPHA(cbl, pha) | AEM
clearEvent() | AEM

Generated on Fri Jul 21 13:26:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evAEM_PHA Member List

This is the complete list of members for evAEM_PHA, including all inherited members.

__getattr__(attribute) (defined in BitField) | BitField
__init__(ui) (defined in evAEM_PHA) | evAEM_PHA
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:54 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evCAL_LayerLogData Member List

This is the complete list of members for evCAL_LayerLogData, including all inherited members.

__init__(twr, layer, data) evCAL_LayerLogData

Generated on Fri Jul 21 13:26:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evCAL_LogAccepts Member List

This is the complete list of members for evCAL_LogAccepts, including all inherited members.

__getattr__(attribute) (defined in BitField) | BitField
__init__(twr, ui) (defined in evCAL_LogAccepts) | evCAL_LogAccepts
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evCAL_LogData Member List

This is the complete list of members for evCAL_LogData, including all inherited members.

__getattr__(attribute) (defined in BitField) | BitField
__init__(ui) (defined in evCAL_LogData) | evCAL_LogData
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evCellHeader Member List

This is the complete list of members for evCellHeader, including all inherited members.

__getattr__(attribute) (defined in BitField) | BitField
__init__(ui) (defined in evCellHeader) | evCellHeader
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:59 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evCellHeader_Singleton Member List

This is the complete list of members for evCellHeader_Singleton, including all inherited members.

__call__(ui) (defined in evCellHeader_Singleton) | evCellHeader_Singleton
__getattr__(attribute) (defined in BitField) | BitField
__init__(ui) (defined in evCellHeader) | evCellHeader
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:59 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evContPacket Member List

This is the complete list of members for evContPacket, including all inherited members.

__getattr__(attribute) (defined in BitField) | BitField
__init__(ui) (defined in evContPacket) | evContPacket
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:55 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evContPacket_Singleton Member List

This is the complete list of members for evContPacket_Singleton, including all inherited members.

__call__(ui) (defined in evContPacket_Singleton) | evContPacket_Singleton
__getattr__(attribute) (defined in BitField) | BitField
__init__(ui) (defined in evContPacket) | evContPacket
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evDiag_CalLayer Member List

This is the complete list of members for evDiag_CalLayer, including all inherited members.

__init__() (defined in evDiag_CalLayer) evDiag_CalLayer

Generated on Fri Jul 21 13:26:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evDiag_CalLayerEnd Member List

This is the complete list of members for evDiag_CalLayerEnd, including all inherited members.

__getattr__(attribute) (defined in BitField) | BitField
__init__(ui) (defined in evDiag_CalLayerEnd) | evDiag_CalLayerEnd
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evDiag_Data Member List

This is the complete list of members for evDiag_Data, including all inherited members.

__init__() (defined in evDiag_Data) evDiag_Data

Generated on Fri Jul 21 13:26:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evDiag_TkrTrgReq Member List

This is the complete list of members for evDiag_TkrTrgReq, including all inherited members.

__getattr__(attribute) (defined in BitField) | BitField
__init__(ui) (defined in evDiag_TkrTrgReq) | evDiag_TkrTrgReq
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evErr_CablePhase Member List

This is the complete list of members for evErr_CablePhase, including all inherited members.

__getattr__(attribute) (defined in BitField) | BitField
__init__(ui) (defined in evErr_CablePhase) | evErr_CablePhase
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evErr_CableTimeOut Member List

This is the complete list of members for evErr_CableTimeOut, including all inherited members.

__getattr__(attribute) (defined in BitField) | BitField
__init__(ui) (defined in evErr_CableTimeOut) | evErr_CableTimeOut
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evErr_GCCC Member List

This is the complete list of members for evErr_GCCC, including all inherited members.

__getattr__(attribute) (defined in BitField) | BitField
__init__(ui) (defined in evErr_GCCC) | evErr_GCCC
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evErr_GCCC_Message Member List

This is the complete list of members for evErr_GCCC_Message, including all inherited members.

__init__(gccc, errGCCC) evErr_GCCC_Message

Generated on Fri Jul 21 13:26:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evErr_GTCC Member List

This is the complete list of members for evErr_GTCC, including all inherited members.

__getattr__(attribute) (defined in BitField) | BitField
__init__(ui) (defined in evErr_GTCC) | evErr_GTCC
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evErr_GTCC_Message Member List

This is the complete list of members for evErr_GTCC_Message, including all inherited members.

__init__() (defined in evErr_GTCC_Message) evErr_GTCC_Message

Generated on Fri Jul 21 13:26:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evErr_Summary Member List

This is the complete list of members for evErr_Summary, including all inherited members.

__getattr__(attribute) (defined in BitField) | BitField
__init__(ui) (defined in evErr_Summary) | evErr_Summary
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:54 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evGEM_Cond_Arrival_Times Member List

This is the complete list of members for evGEM_Cond_Arrival_Times, including all inherited members.

__getattr__(attribute) (defined in BitField) | BitField
__init__(ui) (defined in evGEM_Cond_Arrival_Times) | evGEM_Cond_Arrival_Times
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:54 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evGEM_Veto_List Member List

This is the complete list of members for evGEM_Veto_List, including all inherited members.

__init__() (defined in evGEM_Veto_List) | evGEM_Veto_List
clear() (defined in evGEM_Veto_List) | evGEM_Veto_List

Generated on Fri Jul 21 13:26:54 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evSummary Member List

This is the complete list of members for evSummary, including all inherited members.

__getattr__(attribute) (defined in BitField) | BitField
__init__(ui) (defined in evSummary) | evSummary
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:55 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evSummary_Singleton Member List

This is the complete list of members for evSummary_Singleton, including all inherited members.

__call__(ui) (defined in evSummary_Singleton) | evSummary_Singleton
__getattr__(attribute) (defined in BitField) | BitField
__init__(ui) (defined in evSummary) | evSummary
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:55 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Evt Member List

This is the complete list of members for Evt, including all inherited members.

__init__() | Evt
addCAL_LogAccept(accept) | Evt
addCAL_LogData(twr, layer, data) | Evt
addErrGCCCmsg(errGCCC) | Evt
addErrGTCCmsg(errGTCCmsg) | Evt
addTKRaccept(accept) | Evt
addTKRstrip(cc, rc, strip) | Evt
addTKRtot(cc, rc, tot) | Evt
clearEvent() | Evt

Generated on Fri Jul 21 13:26:54 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

EvtCli Member List

This is the complete list of members for EvtCli, including all inherited members.

__init__(debug=0, port=EvtCliIO.PortNumber) | EvtCli
__init__(portnumber) (defined in Socket) | Socket
abort() | EvtCliIO
checkGGLTstatus(status, mask) | EvtCli
checkOnlineStatus(status, mask) | EvtCli
close() | EvtCliIO
connect(host, force=False) (defined in EvtCliIO) | EvtCliIO
connect(host) (defined in Socket) | Socket
disconnect() (defined in Socket) | Socket
dumpContributionData() | EvtCli
evBitCount(x) | EvtCli
evDumpAEM_Accepts() | EvtCli
evDumpAEM_PHA() | EvtCli
evDumpAEM_Vetos() | EvtCli
evDumpCAL_LogAccepts() | EvtCli
evDumpCAL_Logs() | EvtCli
evDumpDiagnostic() | EvtCli
evDumpEventAEM() | EvtCli
evDumpEventAEM_G2() | EvtCli
evDumpGEM() | EvtCli
evDumpGEM_Veto_List(offset) | EvtCli
evDumpSummary(minEvSize=24) | EvtCli
evDumpTEM_Error(forcePrint=0) | EvtCli
evDumpTKR() | EvtCli
evGetAEM_PHA(cbl) | EvtCli
evGetAEM_Vec(cbl, type) | EvtCli
evGetCAL_LogAccepts() | EvtCli
evGetCAL_Logs() | EvtCli
evGetCAL_NumAccepts() | EvtCli
evGetEvtSeqMSW() | EvtCli
evGetEvtSequence() | EvtCli
evGetSummary() | EvtCli
evGetTEM_Diagnostic() | EvtCli
evGetTEM_Error() | EvtCli
evGetTimebase() | EvtCli
evGetTimestamp() | EvtCli
evGetTKR_Accepts(pAccept) | EvtCli
evGetTKR_NumAccepts() | EvtCli
evGetTKR_NumStrips() | EvtCli
evGetTKR_StripN(pAccepts, stripN, stripData=None) | EvtCli
evGetTKR_TOT() | EvtCli
getByte(byteOffset) | EvtCli
getContributionList() | EvtCli
getContributionStatus() | EvtCli
getContributionStatusStr() | EvtCli
getCurrentContribution() | EvtCli
getDWord(dWordOffset) | EvtCli
getEvtSize() | EvtCli
getEvtStatus() | EvtCli
getGGLTStatus() | EvtCli
getGGLTStatusStr() | EvtCli
getOnlineStatus() | EvtCli
getOnlineStatusStr() | EvtCli
getTimeout() | EvtCliIO
gettimeout() (defined in Socket) | Socket
getUserId() | EvtCli
getWord(wordOffset) | EvtCli
isConnected() (defined in Socket) | Socket
isErrorEvent() | EvtCli
isGGLTStatus(status=None) | EvtCli
isPacketErrorEvent() | EvtCli
isSweepEvent() | EvtCli
isTimeoutEnabled() | EvtCliIO
isTrgParityErrorEvent() | EvtCli
lock() (defined in Socket) | Socket
open(filename, mode="r+b") | EvtCliIO
port() (defined in Socket) | Socket
print_EOE_Warning() | EvtCli
purge() | Socket
readEvent(dat=None) | EvtCli
readEventSocket() (defined in EvtCli) | EvtCli
readFile() | EvtCliIO
readSocket() | EvtCliIO
recv(size) (defined in Socket) | Socket
recvall(size) (defined in Socket) | Socket
release() (defined in Socket) | Socket
send(packet) (defined in Socket) | Socket
sendall(packet) (defined in Socket) | Socket
setCurrentContribution(contributionId) | EvtCli
setDebug(debug) | EvtCli
setPort(port) (defined in Socket) | Socket
setSocket(sock) (defined in EvtCliIO) | EvtCliIO
settimeout(seconds) (defined in Socket) | Socket
setTimeout(timeout=1.0) | EvtCliIO
setTimeoutEnabled(flag) | EvtCliIO
socket() (defined in Socket) | Socket
unpack(fmt, str) | EvtCliIO

Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

EvtCliIO Member List

This is the complete list of members for EvtCliIO, including all inherited members.

__init__(debug, port=PortNumber) (defined in EvtCliIO) | EvtCliIO
__init__(portnumber) (defined in Socket) | Socket
abort() | EvtCliIO
close() | EvtCliIO
connect(host, force=False) (defined in EvtCliIO) | EvtCliIO
connect(host) (defined in Socket) | Socket
disconnect() (defined in Socket) | Socket
gettimeout() (defined in Socket) | Socket
getTimeout() | EvtCliIO
isConnected() (defined in Socket) | Socket
isTimeoutEnabled() | EvtCliIO
lock() (defined in Socket) | Socket
open(filename, mode="r+b") | EvtCliIO
port() (defined in Socket) | Socket
purge() | Socket
readFile() | EvtCliIO
readSocket() | EvtCliIO
recv(size) (defined in Socket) | Socket
recvall(size) (defined in Socket) | Socket
release() (defined in Socket) | Socket
send(packet) (defined in Socket) | Socket
sendall(packet) (defined in Socket) | Socket
setPort(port) (defined in Socket) | Socket
setSocket(sock) (defined in EvtCliIO) | EvtCliIO
settimeout(seconds) (defined in Socket) | Socket
setTimeout(timeout=1.0) | EvtCliIO
setTimeoutEnabled(flag) | EvtCliIO
socket() (defined in Socket) | Socket
unpack(fmt, str) | EvtCliIO

Generated on Fri Jul 21 13:26:59 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evTKR_Strip Member List

This is the complete list of members for evTKR_Strip, including all inherited members.

__getattr__(attribute) (defined in BitField) | BitField
__init__(ui) (defined in evTKR_Strip) | evTKR_Strip
__int__() (defined in BitField) | BitField
__setattr__(attribute, val) (defined in BitField) | BitField
__str__() (defined in BitField) | BitField
set(ui) (defined in BitField) | BitField

Generated on Fri Jul 21 13:26:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evTKR_StripData Member List

This is the complete list of members for evTKR_StripData, including all inherited members.

__init__(cc, rc, strip) evTKR_StripData

Generated on Fri Jul 21 13:26:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

evTKR_TOTdata Member List

This is the complete list of members for evTKR_TOTdata, including all inherited members.

__init__(cc, rc, tot) evTKR_TOTdata

Generated on Fri Jul 21 13:26:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GEM Member List

This is the complete list of members for GEM, including all inherited members.

__init__() (defined in GEM) | GEM
clear() (defined in GEM) | GEM

Generated on Fri Jul 21 13:26:54 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

AncillaryContributor Member List

This is the complete list of members for AncillaryContributor, including all inherited members.

__init__((host, port), offset=0L) (defined in AncillaryContributor) | AncillaryContributor |
__init__() (defined in GebContributor) | GebContributor |
close() | AncillaryContributor |
contributionQueue() | GebContributor | [static]
idMask(id=None) | GebContributor |
name() | AncillaryContributor |
open() | AncillaryContributor |
read() | AncillaryContributor |
run() | GebContributor |
sequence(sequence) | AncillaryContributor |

Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

EvtCliBT Member List

This is the complete list of members for EvtCliBT, including all inherited members.

__init__(debug=0, port=EvtCliIO.PortNumber, ancHostPort="localhost:2345") (defined in EvtCliBT) | EvtCliBT
abort() | EvtCliBT
flushAll() (defined in EvtCliBT) | EvtCliBT
readEvent() | EvtCliBT
shutdown() | EvtCliBT

Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Merger Member List

This is the complete list of members for Merger, including all inherited members.

__init__(contributors) (defined in Geb) | Geb
build() | Geb
close() | Geb
dispose(buffer) | Merger
flushAll() | Geb
name() | Geb
run() | Geb
shutdown() | Geb

Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

LATInterfaceException Member List

This is the complete list of members for LATInterfaceException, including all inherited members.

__str__() (defined in LATInterfaceException) | LATInterfaceException
errstr() (defined in LATInterfaceException) | LATInterfaceException

Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

LATInterfaceStatus Member List

This is the complete list of members for LATInterfaceStatus, including all inherited members.

__init__(status) (defined in LATInterfaceStatus) | LATInterfaceStatus |
__str__() (defined in LATInterfaceStatus) | LATInterfaceStatus |
errstr(status=None) (defined in LATInterfaceStatus) | LATInterfaceStatus |
message(status) (defined in LATInterfaceStatus) | LATInterfaceStatus | [static]
name(status) (defined in LATInterfaceStatus) | LATInterfaceStatus | [static]
status(name) (defined in LATInterfaceStatus) | LATInterfaceStatus | [static]

Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Fabrics Member List

This is the complete list of members for Fabrics, including all inherited members.

extract_cmdrsp(cmdmask, pdumask, secmask, arcmask, ctrmask) (defined in Fabrics) | Fabrics
extract_event(evtmask) (defined in Fabrics) | Fabrics
init_cmdrsp(cmdmask, cmdmset, pdumask, secmask) (defined in Fabrics) | Fabrics
init_event(evtmask, evtmset) (defined in Fabrics) | Fabrics
insert_cmdrsp(cmdmask, pdumask, secmask, arcmask, ctrmask) (defined in Fabrics) | Fabrics
insert_event(evtmask) (defined in Fabrics) | Fabrics

Generated on Fri Jul 21 13:27:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GGEM Member List

This is the complete list of members for GGEM, including all inherited members.

__init__(client, parent) | GGEM
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
downGEMC() | GGEM
downGEMIE() | GGEM
downGEMMG() | GGEM
downGEMSC() | GGEM
downGEMST() | GGEM
downGEMVG() | GGEM
downGEMW() | GGEM
existsGEMC() | GGEM
existsGEMIE() | GGEM
existsGEMMG() | GGEM
existsGEMSC() | GGEM
existsGEMST() | GGEM
existsGEMVG() | GGEM
existsGEMW() | GGEM
getEPUaddr() (defined in GGEM) | GGEM
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GGEMC Member List

This is the complete list of members for GGEMC, including all inherited members.

__init__(client, parent) | GGEMC
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GGEMC) | GGEMC
read(reg) (defined in GGEMC) | GGEMC
root() | Gdb
send(cmd) (defined in GGEMC) | GGEMC
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GGEMIE Member List

This is the complete list of members for GGEMIE, including all inherited members.

__init__(client, parent) | GGEMIE
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GGEMIE) | GGEMIE
read(reg) (defined in GGEMIE) | GGEMIE
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GGEMMG Member List

This is the complete list of members for GGEMMG, including all inherited members.

__init__(client, parent) | GGEMMG
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GGEMMG) | GGEMMG
read(reg) (defined in GGEMMG) | GGEMMG
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GGEMSC Member List

This is the complete list of members for GGEMSC, including all inherited members.

__init__(client, parent) | GGEMSC
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GGEMSC) | GGEMSC
read(reg) (defined in GGEMSC) | GGEMSC
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GGEMST Member List

This is the complete list of members for GGEMST, including all inherited members.

__init__(client, parent) | GGEMST
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
extCtrClear() | GGEMST
extCtrClearStatus() | GGEMST
extCtrDisable(reg) | GGEMST
extCtrEnable(reg) | GGEMST
extCtrLoopDisable() | GGEMST
extCtrLoopEnable() | GGEMST
extCtrRead(reg) | GGEMST
extCtrSetLoopDelay(delay) | GGEMST
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GGEMST) | GGEMST
read(reg) (defined in GGEMST) | GGEMST
root() | Gdb
send(cmd) (defined in GGEMST) | GGEMST
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GGEMVG Member List

This is the complete list of members for GGEMVG, including all inherited members.

__init__(client, parent) | GGEMVG
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GGEMVG) | GGEMVG
read(reg) (defined in GGEMVG) | GGEMVG
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GGEMW Member List

This is the complete list of members for GGEMW, including all inherited members.

__init__(client, parent) | GGEMW
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GGEMW) | GGEMW
read(reg) (defined in GGEMW) | GGEMW
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GGLT Member List

This is the complete list of members for GGLT, including all inherited members.

__init__(client, parent=None) | GGLT
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
disableMask() | GGLT
enableMask() | GGLT
getDisableTime() | GGLT
getEnableTime() | GGLT
getEPUaddr() (defined in GGLT) | GGLT
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
initialize() (defined in GGLT) | GGLT
isMaskDirty() | GGLT
load(reg, value) (defined in GGLT) | GGLT
read(reg) (defined in GGLT) | GGLT
refreshMask() | GGLT
root() | Gdb
send(cmd) (defined in GGLT) | GGLT
setDestinationOverride(override) | GGLT
setFlag(key, value) | Gdb
triggersDisabled() | GGLT
up() | Gdb
waitForMaskEnable(tmo=None) | GGLT

Generated on Fri Jul 21 13:27:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Ggroup Member List

This is the complete list of members for Ggroup, including all inherited members.

disable() | Ggroup
enable() | Ggroup
enabled() | Ggroup
name() | Ggroup

Generated on Fri Jul 21 13:27:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GattrHsk Member List

This is the complete list of members for GattrHsk, including all inherited members.

__init__(node, attr) (defined in GattrHsk) | GattrHsk
__init__(name, id, rule=gAttr.Gattr.defaultRule, constraint=gAttr.Gattr.defaultConstraint, egu=gAttr.Gattr.defaultEgu) | GattrHsk
gAttr::Gattr::__init__(name, id, size, flags, rule=None, constraint=None, egu=None) | Gattr
create(node) (defined in GattrHsk) | GattrHsk
flags() (defined in Gattr) | Gattr
get(node, raw, bypass=False) | GattrHsk
get(node, attr, bypass=0) (defined in Gattr) | Gattr
getConstraint() | Gattr
getEGU() | Gattr
getName() (defined in Gattr) | Gattr
getNode() (defined in GattrHsk) | GattrHsk
getRule() | Gattr
id() (defined in Gattr) | Gattr
isCommand() | Gattr
isDeprecated() | Gattr
isNoDirectAccess() | Gattr
isReadOnly() | Gattr
isReadWrite() | Gattr
isWriteOnly() | Gattr
set(node, val, bypass=True) | GattrHsk
set(node, value, attr, bypass=0) (defined in Gattr) | Gattr
setConstraint(constraint) | Gattr
setEGU(egu) | Gattr
setRule(rule) | Gattr
size() | Gattr

Generated on Fri Jul 21 13:27:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GHSK Member List

This is the complete list of members for GHSK, including all inherited members.

__init__(client) | GHSK
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
applyConfig(seq) (defined in GHSK) | GHSK
attrIter() | Gdb
downHAEM() | GHSK
downHCOM() | GHSK
downHCPU() | GHSK
downHEBM() | GHSK
downHGEM() | GHSK
downHNUL() | GHSK
downHPDU(childId) | GHSK
downHTEM(childId) | GHSK
existsHAEM() | GHSK
existsHCOM() | GHSK
existsHCPU() | GHSK
existsHEBM() | GHSK
existsHGEM() | GHSK
existsHPDU(hpduID) | GHSK
existsHTEM(temID) | GHSK
getConfigurations() | GHSK
getDeclarations() | GHSK
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name) | GHSK
getRules() | GHSK
getSerialNos(component=None) | Gdb
id() | Gdb
readConfig(cfgFileName) (defined in GHSK) | GHSK
readSchema(schema) (defined in GHSK) | GHSK
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HAEM Member List

This is the complete list of members for HAEM, including all inherited members.

__init__(client, parent) | HAEM
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
downHARC(arcID) | HAEM
existsHARC(arcID) | HAEM
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HARC Member List

This is the complete list of members for HARC, including all inherited members.

__init__(client, parent, arcID) | HARC
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HCOM Member List

This is the complete list of members for HCOM, including all inherited members.

__init__(client, parent) | HCOM
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:05 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HCPU Member List

This is the complete list of members for HCPU, including all inherited members.

__init__(client, parent) | HCPU
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:06 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HEBM Member List

This is the complete list of members for HEBM, including all inherited members.

__init__(client, parent) | HEBM
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:05 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HGEM Member List

This is the complete list of members for HGEM, including all inherited members.

__init__(client, parent) | HGEM
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HNUL Member List

This is the complete list of members for HNUL, including all inherited members.

__init__(parent) | HNUL
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:06 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HPDU Member List

This is the complete list of members for HPDU, including all inherited members.

__init__(client, parent, pduID) | HPDU
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:05 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HTEM Member List

This is the complete list of members for HTEM, including all inherited members.

__init__(client, parent, temID) | HTEM
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GLAT Member List

This is the complete list of members for GLAT, including all inherited members.

__init__(client) | GLAT
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
allTEM() | GLAT
applyConfig(seq=None, gxbrd=None) (defined in GLAT) | GLAT
attrIter() | Gdb
downAEM() | GLAT
downCRU() | GLAT
downEBM() | GLAT
downGEM() | GLAT
downLCB() | GLAT
downPDU(childId) | GLAT
downTEM(childId) | GLAT
existsAEM() | GLAT
existsCRU() | GLAT
existsEBM() | GLAT
existsGEM() | GLAT
existsLCB() | GLAT
existsPDU(pduId) | GLAT
existsTEM(temId) | GLAT
getAllExcludeFlags() | GLAT
getAllOpaque() | GLAT
getAllSerialNos() | GLAT
getConfigurations() | GLAT
getDeclarations() | GLAT
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getRules() | GLAT
getSerialNos(component=None) | Gdb
getSysReg(node, regName) | GLAT
id() | Gdb
load(reg, value) (defined in GLAT) | GLAT
read(reg) (defined in GLAT) | GLAT
readConfig(cfgFileName) (defined in GLAT) | GLAT
readSchema(name) (defined in GLAT) | GLAT
root() | Gdb
setFlag(key, value) | Gdb
takeSnapshot(stream, fileName, captureGTIC, captureGAEQ, trigger, configName, configVersion) (defined in GLAT) | GLAT
TEMcnt() | GLAT
up() | Gdb
writeConfig(fileName, seq=None) (defined in GLAT) | GLAT
writeSchema(fileName) (defined in GLAT) | GLAT

Generated on Fri Jul 21 13:27:06 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GLCB Member List

This is the complete list of members for GLCB, including all inherited members.

__init__(client) | GLCB
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GLCB) | GLCB
read(reg) (defined in GLCB) | GLCB
root() | Gdb
setEvtEnable(enable) | GLCB
setFlag(key, value) | Gdb
start(lcbmask) (defined in GLCB) | GLCB
start_wait(lcbmask, timeout) (defined in GLCB) | GLCB
state() (defined in GLCB) | GLCB
switch(lcbmask) (defined in GLCB) | GLCB
switch_wait(timeout) (defined in GLCB) | GLCB
up() | Gdb

Generated on Fri Jul 21 13:27:06 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GLCBSTATS Member List

This is the complete list of members for GLCBSTATS, including all inherited members.

__init__(client, parent) | GLCBSTATS
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
read(reg) (defined in GLCBSTATS) | GLCBSTATS
reset() (defined in GLCBSTATS) | GLCBSTATS
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GlobalPanelImpl Member List

This is the complete list of members for GlobalPanelImpl, including all inherited members.

__init__(rc, common, parent=None, name=None, fl=0) (defined in GlobalPanelImpl) | GlobalPanelImpl
applyPermissions(operator) (defined in GlobalPanelImpl) | GlobalPanelImpl
browseExportedFiles() (defined in GlobalPanelImpl) | GlobalPanelImpl
checkFabricEnable(fabricEnable) (defined in GlobalPanelImpl) | GlobalPanelImpl
fabricPowerControl() (defined in GlobalPanelImpl) | GlobalPanelImpl
getUserApp(appname=None) (defined in GlobalPanelImpl) | GlobalPanelImpl
getUserAppTree() (defined in GlobalPanelImpl) | GlobalPanelImpl
gpibPowerSupplyControl() (defined in GlobalPanelImpl) | GlobalPanelImpl
isrealfile(file) | GlobalPanelImpl
loadMSGLogger() (defined in GlobalPanelImpl) | GlobalPanelImpl
startBrowser() (defined in GlobalPanelImpl) | GlobalPanelImpl
startEnvMon() (defined in GlobalPanelImpl) | GlobalPanelImpl
startTriggerDisplay() (defined in GlobalPanelImpl) | GlobalPanelImpl
startUserApp() (defined in GlobalPanelImpl) | GlobalPanelImpl

Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

NullStream Member List

This is the complete list of members for NullStream, including all inherited members.

close() (defined in NullStream) | NullStream
write(str) (defined in NullStream) | NullStream

Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Loopback Member List

This is the complete list of members for Loopback, including all inherited members.

acknowledge() (defined in Loopback) | Loopback
commit(value) (defined in Loopback) | Loopback
socket() (defined in Loopback) | Loopback

Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GMem Member List

This is the complete list of members for GMem, including all inherited members.

__init__(client) | GMem
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
gMEMbusToLocal(space, addr) | GMem
gMEMload(addr, val, size=4) | GMem
gMEMlocalToBus(space, addr) | GMem
gMEMread(addr, size=4) | GMem
id() | Gdb
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GNAT Member List

This is the complete list of members for GNAT, including all inherited members.

__init__(client) | GNAT
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addChannel(channelNo, itemList) | GNAT
addr() | Gdb
attrIter() | Gdb
clearBuffer() | GNAT
flushPlaybackFIFO() | GNAT
flushRecordFIFO() | GNAT
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
initHandle(slot, physAddr) | GNAT
loadFIFO() | GNAT
root() | Gdb
setFlag(key, value) | Gdb
setLATpMode(mode) | GNAT
startPlayback() | GNAT
up() | Gdb
writeFIFO(data) | GNAT
writeFIFO32(data) | GNAT

Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Node Member List

This is the complete list of members for Node, including all inherited members.

client() (defined in Node) | Node
cmdrsp(functionname, arguments) (defined in Node) | Node
load(reg, value) (defined in Node) | Node
read(reg) (defined in Node) | Node
send(cmd) (defined in Node) | Node

Generated on Fri Jul 21 13:27:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GOCS Member List

This is the complete list of members for GOCS, including all inherited members.

__init__(client) (defined in GOCS) | GOCS
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
cmxAsBuilt() (defined in GOCS) | GOCS
evtClearEvtSeqMSW() | GOCS
evtHandlerFilterTkrHits(lowThreshold=0, towerMask=0xffff, highThreshold=0xffffffffL, prescale=0xffffffffL) | GOCS
evtHandlerPrescaleExternal(prescale) | GOCS
evtHandlerSendAcdScalers(marker, prescale=0) | GOCS
evtHandlerSendAll() | GOCS
evtHandlerSendErrorsOnly() | GOCS
evtHandlerSendNothing() | GOCS
evtHandlerSendPrescaled(prescale) | GOCS
evtHandlerSetVerbosity(verbosity) | GOCS
getCallbackParams() | GOCS
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
getStartupScriptInfo() | GOCS
getVersion() | GOCS
id() | Gdb
load(reg, value) (defined in GOCS) | GOCS
read(reg) (defined in GOCS) | GOCS
root() | Gdb
setFlag(key, value) | Gdb
synchronize() | GOCS
up() | Gdb
verifyVersion() | GOCS

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Opcode Member List

This is the complete list of members for Opcode, including all inherited members.

__init__(value) (defined in Opcode) | Opcode
packet() (defined in Opcode) | Opcode

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Options Member List

This is the complete list of members for Options, including all inherited members.

__getattr__(attribute) (defined in Options) | Options
parse() (defined in Options) | Options
usage(notes='') (defined in Options) | Options

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

AEMcontributionIterator_ Member List

This is the complete list of members for AEMcontributionIterator_, including all inherited members.

__init__(event, contribution, gui, lci) (defined in AEMcontributionIterator_) | AEMcontributionIterator_
header(cable, hdr) (defined in AEMcontributionIterator_) | AEMcontributionIterator_
pha(cable, channel, p) (defined in AEMcontributionIterator_) | AEMcontributionIterator_
plot(prefix="") (defined in AEMcontributionIterator_) | AEMcontributionIterator_

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

CALcontributionIterator2 Member List

This is the complete list of members for CALcontributionIterator2, including all inherited members.

__init__(event, contribution, gui, limits, lci) | CALcontributionIterator2
log(tower, layer, theLog) | CALcontributionIterator2
plot() | CALcontributionIterator2

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

DIAGcontributionIterator_ Member List

This is the complete list of members for DIAGcontributionIterator_, including all inherited members.

__init__(event, contribution, dataStart, gui) (defined in DIAGcontributionIterator_) | DIAGcontributionIterator_
CALdiag(tower, layer, diag) (defined in DIAGcontributionIterator_) | DIAGcontributionIterator_
TKRdiag(tower, gtcc, diag) (defined in DIAGcontributionIterator_) | DIAGcontributionIterator_

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ERRcontributionIterator_ Member List

This is the complete list of members for ERRcontributionIterator_, including all inherited members.

__init__(event, contribution, dataStart, gui) (defined in ERRcontributionIterator_) | ERRcontributionIterator_
gcccError(tower, gccc, err) (defined in ERRcontributionIterator_) | ERRcontributionIterator_
gtccDataParityError(tower, gtcc) (defined in ERRcontributionIterator_) | ERRcontributionIterator_
gtccError(tower, gtcc, err) (defined in ERRcontributionIterator_) | ERRcontributionIterator_
gtccFIFOerror(tower, gtcc, err) (defined in ERRcontributionIterator_) | ERRcontributionIterator_
gtccHDRParityError(tower, gtcc) (defined in ERRcontributionIterator_) | ERRcontributionIterator_
gtccTMOerror(tower, gtcc) (defined in ERRcontributionIterator_) | ERRcontributionIterator_
gtccWCParityError(tower, gtcc) (defined in ERRcontributionIterator_) | ERRcontributionIterator_
gtfePhaseError(tower, gtcc, gtrc, err1, err2, err3, err4, err5) (defined in ERRcontributionIterator_) | ERRcontributionIterator_
gtrcPhaseError(tower, gtcc, gtrc, err) (defined in ERRcontributionIterator_) | ERRcontributionIterator_
gtrcSummaryError(tower, gtcc) (defined in ERRcontributionIterator_) | ERRcontributionIterator_
phaseError(tower, err) (defined in ERRcontributionIterator_) | ERRcontributionIterator_
timeoutError(tower, err) (defined in ERRcontributionIterator_) | ERRcontributionIterator_

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GEMcontribution_ Member List

This is the complete list of members for GEMcontribution_, including all inherited members.

__getattr__(attr) | GEMcontribution_
__init__(event, contribution, gui) (defined in GEMcontribution_) | GEMcontribution_
plot() (defined in GEMcontribution_) | GEMcontribution_

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

myLATcomponentIterator Member List

This is the complete list of members for myLATcomponentIterator, including all inherited members.

__init__(gui) | myLATcomponentIterator
ACDcomponent(event, aemContribution) | myLATcomponentIterator
CALcomponent(event, calContribution) | myLATcomponentIterator
diagnostic(event, contribution) | myLATcomponentIterator
error(event, contribution) | myLATcomponentIterator
GEMcomponent(event, gemContribution) | myLATcomponentIterator
GLTcomponent(event, contribution) | myLATcomponentIterator
OSWcomponent(event, contribution) | myLATcomponentIterator
TKRcomponent(event, tkrContribution) | myLATcomponentIterator
UDFcomponent(event, ebfContribution) (defined in myLATcomponentIterator) | myLATcomponentIterator

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

OSWcontributionIterator_ Member List

This is the complete list of members for OSWcontributionIterator_, including all inherited members.

evtSequence() (defined in OSWcontributionIterator_) | OSWcontributionIterator_
OSW_time(event, contribution) (defined in OSWcontributionIterator_) | OSWcontributionIterator_
timestamp() (defined in OSWcontributionIterator_) | OSWcontributionIterator_

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TKRcontributionIterator_ Member List

This is the complete list of members for TKRcontributionIterator_, including all inherited members.

__init__(event, contribution, gui) | TKRcontributionIterator_
plot() | TKRcontributionIterator_
strip(tower, layerEnd, hit) | TKRcontributionIterator_
TOT(tower, layerEnd, tot) (defined in TKRcontributionIterator_) | TKRcontributionIterator_

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ACDSingleEvtDisplayImpl Member List

This is the complete list of members for ACDSingleEvtDisplayImpl, including all inherited members.

__init__(preferences, parent=None, name=None, fl=0) (defined in ACDSingleEvtDisplayImpl) | ACDSingleEvtDisplayImpl
relabel() (defined in ACDSingleEvtDisplayImpl) | ACDSingleEvtDisplayImpl

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GOSEDCALImpl Member List

This is the complete list of members for GOSEDCALImpl, including all inherited members.

relabel() (defined in GOSEDCALImpl) GOSEDCALImpl

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GOSEDCALTKRImpl Member List

This is the complete list of members for GOSEDCALTKRImpl, including all inherited members.

__init__(preferences, parent, name=None, fl=0) (defined in GOSEDCALTKRImpl) | GOSEDCALTKRImpl
relabel() (defined in GOSEDCALTKRImpl) | GOSEDCALTKRImpl

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GOSEDDataImpl Member List

This is the complete list of members for GOSEDDataImpl, including all inherited members.

__init__(gui, parent=None, name=None, fl=0) (defined in GOSEDDataImpl) | GOSEDDataImpl
formatCALview() (defined in GOSEDDataImpl) | GOSEDDataImpl
formatDiagCALview() (defined in GOSEDDataImpl) | GOSEDDataImpl
formatDiagTKRview() (defined in GOSEDDataImpl) | GOSEDDataImpl
formatTKRview() (defined in GOSEDDataImpl) | GOSEDDataImpl
showEvent(se) (defined in GOSEDDataImpl) | GOSEDDataImpl

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

singleEvtDisplayImpl Member List

This is the complete list of members for singleEvtDisplayImpl, including all inherited members.

__init__(filename=None, parent=None, name=None, fl=0) | singleEvtDisplayImpl
clearButtonGroups() | singleEvtDisplayImpl
clearButtons() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
clearPixmaps() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
clearViews() | singleEvtDisplayImpl
clickTWR(id) (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
closeEvent(e) (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
createDockWindows() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
dockGOSEDACD() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
dockGOSEDCAL() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
dockGOSEDCALTKR() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
dockGOSEDData() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
dockGOSEDTKR() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
dockGOSEDTWR() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
dockGOTED() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
fileClose() | singleEvtDisplayImpl
fileExit() | singleEvtDisplayImpl
fileOpen() | singleEvtDisplayImpl
goClicked() | singleEvtDisplayImpl
GOSEDPreferences() | singleEvtDisplayImpl
helpAbout() | singleEvtDisplayImpl
helpContents() | singleEvtDisplayImpl
helpOnline() | singleEvtDisplayImpl
maintainButtons(buttonId, widget) (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
maintainScale(scaleId, window) (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
mousePressEvent(e) (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
nextClicked(skip=0) | singleEvtDisplayImpl
plot(skip=0) | singleEvtDisplayImpl
previousClicked(skip=-1) | singleEvtDisplayImpl
printACD() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
printCALTKR() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
rangeChange(buttonId) (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
rangeChange2(buttonId) (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
replot() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
scaleChange(scaleId) (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
scaleChange2(scaleId) (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
selectChange() | singleEvtDisplayImpl
serverClose() | singleEvtDisplayImpl
serverOpen(state) | singleEvtDisplayImpl
ServerPreferences() | singleEvtDisplayImpl
setGOSEDDefaults() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
skipClicked() | singleEvtDisplayImpl
stopClicked() | singleEvtDisplayImpl
updateDockGOSEDACD() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
updateDockGOSEDCAL() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
updateDockGOSEDCALTKR() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
updateDockGOSEDData() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
updateDockGOSEDTKR() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
updateDockGOSEDTWR() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl
updateDockGOTED() (defined in singleEvtDisplayImpl) | singleEvtDisplayImpl

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

drawHatACD Member List

This is the complete list of members for drawHatACD, including all inherited members.

__init__(gui, parent=None, name=None, fl=0) | drawHatACD
clear() (defined in drawHatACD) | drawHatACD
drawNames(pixmap) (defined in drawHatACD) | drawHatACD
paintEvent(pe) | drawHatACD
paintFace() (defined in drawHatACD) | drawHatACD
showEvent(se) (defined in drawHatACD) | drawHatACD

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

drawRainbowACD Member List

This is the complete list of members for drawRainbowACD, including all inherited members.

__init__(gui, parent=None, name=None, fl=0) | drawRainbowACD
paintEvent(pe) | drawRainbowACD
paintRainbowACD() (defined in drawRainbowACD) | drawRainbowACD

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

drawRainbowCAL Member List

This is the complete list of members for drawRainbowCAL, including all inherited members.

__init__(gui, parent=None, name=None, fl=0) | drawRainbowCAL
paintEvent(pe) | drawRainbowCAL
paintRainbowCAL() (defined in drawRainbowCAL) | drawRainbowCAL

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

drawSide1ACD Member List

This is the complete list of members for drawSide1ACD, including all inherited members.

__init__(gui, parent=None, name=None, fl=0) | drawSide1ACD
clear() (defined in drawSide1ACD) | drawSide1ACD
drawNames(pixmap) (defined in drawSide1ACD) | drawSide1ACD
paintEvent(pe) | drawSide1ACD
paintFace() (defined in drawSide1ACD) | drawSide1ACD
showEvent(se) (defined in drawSide1ACD) | drawSide1ACD

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

drawSide2ACD Member List

This is the complete list of members for drawSide2ACD, including all inherited members.

__init__(gui, parent=None, name=None, fl=0) | drawSide2ACD
clear() (defined in drawSide2ACD) | drawSide2ACD
drawNames(pixmap) (defined in drawSide2ACD) | drawSide2ACD
paintEvent(pe) | drawSide2ACD
paintFace() (defined in drawSide2ACD) | drawSide2ACD
showEvent(se) (defined in drawSide2ACD) | drawSide2ACD

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

drawSide3ACD Member List

This is the complete list of members for drawSide3ACD, including all inherited members.

__init__(gui, parent=None, name=None, fl=0) | drawSide3ACD
clear() (defined in drawSide3ACD) | drawSide3ACD
drawNames(pixmap) (defined in drawSide3ACD) | drawSide3ACD
paintEvent(pe) | drawSide3ACD
paintFace() (defined in drawSide3ACD) | drawSide3ACD
showEvent(se) (defined in drawSide3ACD) | drawSide3ACD

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

drawSide4ACD Member List

This is the complete list of members for drawSide4ACD, including all inherited members.

__init__(gui, parent=None, name=None, fl=0) | drawSide4ACD
clear() (defined in drawSide4ACD) | drawSide4ACD
drawNames(pixmap) (defined in drawSide4ACD) | drawSide4ACD
paintEvent(pe) | drawSide4ACD
paintFace() (defined in drawSide4ACD) | drawSide4ACD
showEvent(se) (defined in drawSide4ACD) | drawSide4ACD

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

drawXZ_CAL Member List

This is the complete list of members for drawXZ_CAL, including all inherited members.

__init__(gui, parent=None, name=None, fl=0) | drawXZ_CAL
clear() (defined in drawXZ_CAL) | drawXZ_CAL
paintEvent(pe) | drawXZ_CAL
paintFace() (defined in drawXZ_CAL) | drawXZ_CAL
showEvent(se) (defined in drawXZ_CAL) | drawXZ_CAL

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

drawXZ_TKR Member List

This is the complete list of members for drawXZ_TKR, including all inherited members.

__init__(gui, parent=None, name=None, fl=0) | drawXZ_TKR
clear() (defined in drawXZ_TKR) | drawXZ_TKR
paintEvent(pe) | drawXZ_TKR
paintFace() (defined in drawXZ_TKR) | drawXZ_TKR
showEvent(se) (defined in drawXZ_TKR) | drawXZ_TKR

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

drawYZ_CAL Member List

This is the complete list of members for drawYZ_CAL, including all inherited members.

__init__(gui, parent=None, name=None, fl=0) | drawYZ_CAL
clear() (defined in drawYZ_CAL) | drawYZ_CAL
paintEvent(pe) | drawYZ_CAL
paintFace() (defined in drawYZ_CAL) | drawYZ_CAL
showEvent(se) (defined in drawYZ_CAL) | drawYZ_CAL

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

drawYZ_TKR Member List

This is the complete list of members for drawYZ_TKR, including all inherited members.

__init__(gui, parent=None, name=None, fl=0) | drawYZ_TKR
clear() (defined in drawYZ_TKR) | drawYZ_TKR
paintEvent(pe) | drawYZ_TKR
paintFace() (defined in drawYZ_TKR) | drawYZ_TKR
showEvent(se) (defined in drawYZ_TKR) | drawYZ_TKR

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GOSEDPreferencesImpl Member List

This is the complete list of members for GOSEDPreferencesImpl, including all inherited members.

__init__(confParser, parent=None, name=None, modal=0, fl=0) (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
acd(hide=None) (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
cal(hide=None) (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
calTkr(hide=None) (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
changeStepValue() (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
data(hide=None) (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
getAcdPeds() | GOSEDPreferencesImpl
getCalPeds() | GOSEDPreferencesImpl
getPedsFile() | GOSEDPreferencesImpl
maxACD() (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
maxCAL() (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
maxCAL2() (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
minACD() (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
minCAL() (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
minCAL2() (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
readPedestals() | GOSEDPreferencesImpl
saveGOSED() (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
saveGOSEDSize() (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
saveViews() (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
selectACDPeds() | GOSEDPreferencesImpl
selectACDPedsFile() | GOSEDPreferencesImpl
selectCALPeds() | GOSEDPreferencesImpl
selectCALPedsFile() | GOSEDPreferencesImpl
selectScale() (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
selectScale2() (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
selectScaleACD() (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
setACDCustomEnabled(status) (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
setCustomEnabled(status) (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
setCustomEnabled2(status) (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
ted(hide=None) (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
tkr(hide=None) (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl
twr(hide=None) (defined in GOSEDPreferencesImpl) | GOSEDPreferencesImpl

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GOSEDTKRImpl Member List

This is the complete list of members for GOSEDTKRImpl, including all inherited members.

__init__(parent=None, name=None, fl=0) (defined in GOSEDTKRImpl) GOSEDTKRImpl

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GOSEDTWRImpl Member List

This is the complete list of members for GOSEDTWRImpl, including all inherited members.

__init__(parent=None, name=None, fl=0) (defined in GOSEDTWRImpl) GOSEDTWRImpl

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

towerEvtDisplayImpl Member List

This is the complete list of members for towerEvtDisplayImpl, including all inherited members.

clear() (defined in towerEvtDisplayImpl) | towerEvtDisplayImpl
paintEvent(pe) (defined in towerEvtDisplayImpl) | towerEvtDisplayImpl

Generated on Fri Jul 21 13:27:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GPDU Member List

This is the complete list of members for GPDU, including all inherited members.

__init__(client, parent, id) | GPDU
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
downPEQ() | GPDU
existsPEQ() | GPDU
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GPDU) | GPDU
read(reg) (defined in GPDU) | GPDU
root() | Gdb
send(cmd) (defined in GPDU) | GPDU
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GPEQ Member List

This is the complete list of members for GPEQ, including all inherited members.

__init__(client, parent) | GPEQ
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
read(reg) (defined in GPEQ) | GPEQ
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GpibPwrCtrlImpl Member List

This is the complete list of members for GpibPwrCtrlImpl, including all inherited members.

applyData(type) (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
checkOutputEnable() (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
clearReadout() (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
clearSettings() (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
closeEvent(e) (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
disableOutput() (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
enableOutput() (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
initGPIB() (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
loadConfig(cfgFilename) (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
normalCursor() (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
parserToScreen(confParser) (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
readData(type) (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
readPowerConfig() (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
releaseGpib() (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
resetDevice() (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
showEvent(e) (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
shutdown() (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
startTimer() (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
stopTimer() (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
unregisterExitHandler() (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
updateError() (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
updateReadout() (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl
waitCursor() (defined in GpibPwrCtrlImpl) | GpibPwrCtrlImpl

Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Plumber Member List

This is the complete list of members for Plumber, including all inherited members.

__init__(lat, xbrd) (defined in Plumber) | Plumber
initialize(fswmsglevel, ocsverbose, force, commander=True) (defined in Plumber) | Plumber

Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Register Member List

This is the complete list of members for Register, including all inherited members.

status() (defined in Register) | Register
timestamp() (defined in Register) | Register
value() (defined in Register) | Register

Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Response Member List

This is the complete list of members for Response, including all inherited members.

payloads() (defined in Response) | Response
rvalue() (defined in Response) | Response
status() (defined in Response) | Response
timestamp() (defined in Response) | Response
value() (defined in Response) | Response

Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Grule Member List

This is the complete list of members for Grule, including all inherited members.

__init__(name, subsystem, category, enabled, continuous=False) | Grule
__init__() (defined in GruleBase) | GruleBase
_eval_(value, attr, node) | Grule
category() | Grule
clearAllActions() | Grule
disable() | Grule
enable() | Grule
enabled() | Grule
evaluate(value, attr, node=None) | Grule
fire(node=None) | Grule
fired(node=None) | Grule
name() | Grule
registerAction(action, method, sender=dispatcher.Any) | Grule
reset(node=None) | Grule
sendAction(action, sender, arguments, named) | Grule
setActions(actions) | Grule
subsystem() | Grule
unregisterAction(action, method, sender=dispatcher.Any) | Grule

Generated on Fri Jul 21 13:27:10 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GruleAlarms Member List

This is the complete list of members for GruleAlarms, including all inherited members.

__init__(name, subsystem, category, enabled, continuous, yellowUpperLimit, yellowLowerLimit, redUpperLimit, redLowerLimit, actions=[]) | GruleAlarms
gRule::Grule::__init__(name, subsystem, category, enabled, continuous=False) | Grule
__init__() (defined in GruleBase) | GruleBase
_eval_(value, attr, node) | GruleAlarms
category() | Grule
clearAllActions() | Grule
disable() | Grule
enable() | Grule
enabled() | Grule
evaluate(value, attr, node=None) | Grule
fire(node=None) | Grule
fired(node=None) | Grule
name() | Grule
registerAction(action, method, sender=dispatcher.Any) | Grule
reset(node=None) | Grule
sendAction(action, sender, arguments, named) | Grule
setActions(actions) | Grule
subsystem() | Grule
unregisterAction(action, method, sender=dispatcher.Any) | Grule

Generated on Fri Jul 21 13:27:10 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GruleBase Member List

This is the complete list of members for GruleBase, including all inherited members.

__init__() (defined in GruleBase) | GruleBase
evaluate(value, attr, node=None) (defined in GruleBase) | GruleBase

Generated on Fri Jul 21 13:27:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GruleLimit Member List

This is the complete list of members for GruleLimit, including all inherited members.

__init__(name, subsystem, category, enabled, continuous, low, high) | GruleLimit
gRule::Grule::__init__(name, subsystem, category, enabled, continuous=False) | Grule
__init__() (defined in GruleBase) | GruleBase
_eval_(value, attr, node) | GruleLimit
category() | Grule
clearAllActions() | Grule
disable() | Grule
enable() | Grule
enabled() | Grule
evaluate(value, attr, node=None) | Grule
fire(node=None) | Grule
fired(node=None) | Grule
name() | Grule
registerAction(action, method, sender=dispatcher.Any) | Grule
reset(node=None) | Grule
sendAction(action, sender, arguments, named) | Grule
setActions(actions) | Grule
subsystem() | Grule
unregisterAction(action, method, sender=dispatcher.Any) | Grule

Generated on Fri Jul 21 13:27:10 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ConfigElement Member List

This is the complete list of members for ConfigElement, including all inherited members.

__getattr__(attr) (defined in ConfigElement) | ConfigElement
__init__(domletteElement) (defined in ConfigElement) | ConfigElement
getAttribute(attr) (defined in ConfigElement) | ConfigElement
getElementsByTagName(tagName) (defined in ConfigElement) | ConfigElement

Generated on Fri Jul 21 13:27:11 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GSIU Member List

This is the complete list of members for GSIU, including all inherited members.

__init__(client, parent, id) | GSIU
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:11 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Socket Member List

This is the complete list of members for Socket, including all inherited members.

__init__(portnumber) (defined in Socket) | Socket
connect(host) (defined in Socket) | Socket
disconnect() (defined in Socket) | Socket
gettimeout() (defined in Socket) | Socket
isConnected() (defined in Socket) | Socket
lock() (defined in Socket) | Socket
port() (defined in Socket) | Socket
purge() | Socket
recv(size) (defined in Socket) | Socket
recvall(size) (defined in Socket) | Socket
release() (defined in Socket) | Socket
send(packet) (defined in Socket) | Socket
sendall(packet) (defined in Socket) | Socket
setPort(port) (defined in Socket) | Socket
setSocket(sock) (defined in Socket) | Socket
settimeout(seconds) (defined in Socket) | Socket
socket() (defined in Socket) | Socket

Generated on Fri Jul 21 13:27:11 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GCCC Member List

This is the complete list of members for GCCC, including all inherited members.

__init__(client, parent, id) | GCCC
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
allCRC() | GCCC
attrIter() | Gdb
downCRC(childId) | GCCC
existsCRC(crcId) | GCCC
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GCCC) | GCCC
read(reg) (defined in GCCC) | GCCC
root() | Gdb
send(cmd) (defined in GCCC) | GCCC
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:12 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GCFE Member List

This is the complete list of members for GCFE, including all inherited members.

__init__(client, parent, id) | GCFE
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GCFE) | GCFE
read(reg) (defined in GCFE) | GCFE
root() | Gdb
send(cmd) (defined in GCFE) | GCFE
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:12 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GCRC Member List

This is the complete list of members for GCRC, including all inherited members.

__init__(client, parent, id) | GCRC
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
allCFE() | GCRC
attrIter() | Gdb
downCFE(childId) | GCRC
existsCFE(cfeId) | GCRC
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GCRC) | GCRC
read(reg) (defined in GCRC) | GCRC
root() | Gdb
send(cmd) (defined in GCRC) | GCRC
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:12 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GTCC Member List

This is the complete list of members for GTCC, including all inherited members.

__init__(client, parent, id) | GTCC
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
allTRC() | GTCC
attrIter() | Gdb
downTRC(childId) | GTCC
existsTRC(trcId) | GTCC
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GTCC) | GTCC
read(reg) (defined in GTCC) | GTCC
root() | Gdb
send(cmd) (defined in GTCC) | GTCC
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:12 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GTEM Member List

This is the complete list of members for GTEM, including all inherited members.

__init__(client, parent, id) | GTEM
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
allCCC() | GTEM
allTCC() | GTEM
attrIter() | Gdb
CCCcnt() | GTEM
downCCC(childId) | GTEM
downTCC(childId) | GTEM
downTIC() | GTEM
existsCCC(cccId) | GTEM
existsTCC(tccId) | GTEM
existsTIC() | GTEM
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GTEM) | GTEM
read(reg) (defined in GTEM) | GTEM
root() | Gdb
send(cmd) (defined in GTEM) | GTEM
setFlag(key, value) | Gdb
TCCcnt() | GTEM
up() | Gdb

Generated on Fri Jul 21 13:27:11 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GTFE Member List

This is the complete list of members for GTFE, including all inherited members.

__init__(client, parent, id) | GTFE
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GTFE) | GTFE
read(reg) (defined in GTFE) | GTFE
root() | Gdb
send(cmd) (defined in GTFE) | GTFE
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:13 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GTIC Member List

This is the complete list of members for GTIC, including all inherited members.

__init__(client, parent) | GTIC
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GTIC) | GTIC
read(reg) (defined in GTIC) | GTIC
root() | Gdb
satCtrDisable(reg) | GTIC
satCtrEnable(reg) | GTIC
satCtrLoopDisable() | GTIC
satCtrLoopEnable() | GTIC
satCtrSetLoopDelay(delay) | GTIC
send(cmd) (defined in GTIC) | GTIC
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:13 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GTRC Member List

This is the complete list of members for GTRC, including all inherited members.

__init__(client, parent, id) | GTRC
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
allTFE() | GTRC
attrIter() | Gdb
downTFE(childId) | GTRC
existsTFE(tfeId) | GTRC
getDeadChannels(feId=None, calib=True, data=True, trig=True) | GTRC
getDeadChannelsByMask(mask, feId=None) | GTRC
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getNoisyChannels(feId=None, calib=True, data=True, trig=True) | GTRC
getNoisyChannelsByMask(mask, feId=None) | GTRC
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GTRC) | GTRC
read(reg) (defined in GTRC) | GTRC
root() | Gdb
send(cmd) (defined in GTRC) | GTRC
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:13 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GTPG Member List

This is the complete list of members for GTPG, including all inherited members.

__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
clear() (defined in GTPG) | GTPG
clearBuf(bufferId) (defined in GTPG) | GTPG
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load() (defined in GTPG) | GTPG
root() | Gdb
setCNO(free_id, start, pattern, pat_len, repetitions) (defined in GTPG) | GTPG
setExtTrig(start, pattern, pat_len, repetitions) (defined in GTPG) | GTPG
setFlag(key, value) | Gdb
setTEM(tem_id, trg, start, pattern, pat_len, repetitions) (defined in GTPG) | GTPG
setVETO(free_id, veto_id, start, pattern, pat_len, repetitions) (defined in GTPG) | GTPG
start() (defined in GTPG) | GTPG
startCmd() (defined in GTPG) | GTPG
up() | Gdb

Generated on Fri Jul 21 13:27:13 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GUIbridge Member List

This is the complete list of members for GUIbridge, including all inherited members.

__init__(guiThread) | GUIbridge
createGUI(qObject, obj, args, kwargs) | GUIbridge
execGUImethod(qObject, func, args, kwargs) | GUIbridge
execGUImethod2(qObject, func, args, kwargs) (defined in GUIbridge) | GUIbridge
execGUImethodNR(qObject, func, args, kwargs) | GUIbridge
handleCustomEvent(e) (defined in GUIbridge) | GUIbridge
isGUIthread() | GUIbridge
shutdown() | GUIbridge

Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GUIbridgeTest Member List

This is the complete list of members for GUIbridgeTest, including all inherited members.

run() (defined in GUIbridgeTest) | GUIbridgeTest
shutdown() (defined in GUIbridgeTest) | GUIbridgeTest

Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

PyThreadBridge Member List

This is the complete list of members for PyThreadBridge, including all inherited members.

pullResponse(respQueue, blnBlock=1) (defined in PyThreadBridge) | PyThreadBridge
pushEvent(event) (defined in PyThreadBridge) | PyThreadBridge

Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

QtThreadBridge Member List

This is the complete list of members for QtThreadBridge, including all inherited members.

pushResponse(respQueue, event, exception=None) (defined in QtThreadBridge) | QtThreadBridge
quit() (defined in QtThreadBridge) | QtThreadBridge
run() (defined in QtThreadBridge) | QtThreadBridge

Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TestWindow Member List

This is the complete list of members for TestWindow, including all inherited members.

customEvent(e) (defined in TestWindow) | TestWindow
quit() (defined in TestWindow) | TestWindow

Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Gversions Member List

This is the complete list of members for Gversions, including all inherited members.

calcDigest(filePath) (defined in Gversions) | Gversions | [static]
collectDigests(path) (defined in Gversions) | Gversions | [static]
extractVersion(verStr) | Gversions | [static]
findVersionSymbol(filePath) | Gversions | [static]
getHardwareVersions(lat, xbrd=None) | Gversions | [static]
getModuleDigests() (defined in Gversions) | Gversions | [static]
getReleaseFromDigest(digestDataFile=None, rootDirEnv='LATTE_ROOT') (defined in Gversions) | Gversions | [static]
isModuleInReleases(m, rootDirEnvs=None) (defined in Gversions) | Gversions | [static]
logBadMarshalDataMessage() (defined in Gversions) | Gversions | [static]
printVersions(ocs, lat=None, xbrd=None) (defined in Gversions) | Gversions | [static]
verifyFileDigests(path=None, rootDirEnv='LATTE_ROOT', digestDataFile=None) (defined in Gversions) | Gversions | [static]
verifyModuleDigests(digestDataFile=None, rootDirEnv='LATTE_ROOT', additionalFilesToVerify=[]) (defined in Gversions) | Gversions | [static]

Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GTWR Member List

This is the complete list of members for GTWR, including all inherited members.

__init__(client, parent, id) | GTWR
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GTWR) | GTWR
read(reg) (defined in GTWR) | GTWR
root() | Gdb
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GXBRD Member List

This is the complete list of members for GXBRD, including all inherited members.

__init__(client) | GXBRD
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
applyConfig(seq=None) (defined in GXBRD) | GXBRD
attrIter() | Gdb
downGLT() | GXBRD
downTWR(twrId) | GXBRD
existsGLT() | GXBRD
existsTWR(twrId) | GXBRD
getConfigurations() | GXBRD
getDeclarations() | GXBRD
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GXBRD) | GXBRD
read(reg) (defined in GXBRD) | GXBRD
readConfig(cfgFileName) (defined in GXBRD) | GXBRD
readSchema(name) (defined in GXBRD) | GXBRD
root() | Gdb
send(cmd) (defined in GXBRD) | GXBRD
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ccsdsSocket Member List

This is the complete list of members for ccsdsSocket, including all inherited members.

__init__(handler=None, debug=0, port=0) (defined in ccsdsSocket) | ccsdsSocket
__init__(portnumber) (defined in Socket) | Socket
connect(host) (defined in ccsdsSocket) | ccsdsSocket
disconnect() (defined in ccsdsSocket) | ccsdsSocket
getTimeout() | ccsdsSocket
gettimeout() (defined in Socket) | Socket
handler(newhandler) (defined in ccsdsSocket) | ccsdsSocket
isConnected() (defined in Socket) | Socket
isTimeoutEnabled() | ccsdsSocket
lock() (defined in Socket) | Socket
port() (defined in Socket) | Socket
purge() | Socket
readCCSDS() | ccsdsSocket
recv(size) (defined in Socket) | Socket
recvall(size) (defined in Socket) | Socket
release() (defined in Socket) | Socket
send(packet) (defined in Socket) | Socket
sendall(packet) (defined in Socket) | Socket
setPort(port) (defined in Socket) | Socket
setSocket(sock) (defined in Socket) | Socket
setTimeout(timeout) | ccsdsSocket
settimeout(seconds) (defined in Socket) | Socket
setTimeoutEnabled(flag) | ccsdsSocket
socket() (defined in Socket) | Socket

Generated on Fri Jul 21 13:27:15 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskCli Member List

This is the complete list of members for HskCli, including all inherited members.

__init__(handler=None) (defined in HskCli) | HskCli
connect(server) | HskCli
disconnect() | HskCli
handler(newhandler) (defined in HskCli) | HskCli

Generated on Fri Jul 21 13:27:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskCmdRxSocket Member List

This is the complete list of members for HskCmdRxSocket, including all inherited members.

__init__(handler=None, debug=0, port=0) (defined in ccsdsSocket) | ccsdsSocket
__init__(portnumber) (defined in Socket) | Socket
connect(host) (defined in ccsdsSocket) | ccsdsSocket
disconnect() (defined in ccsdsSocket) | ccsdsSocket
getTimeout() | ccsdsSocket
gettimeout() (defined in Socket) | Socket
handler(newhandler) (defined in ccsdsSocket) | ccsdsSocket
isConnected() (defined in Socket) | Socket
isTimeoutEnabled() | ccsdsSocket
lock() (defined in Socket) | Socket
port() (defined in Socket) | Socket
purge() | Socket
readCCSDS() | ccsdsSocket
recv(size) (defined in Socket) | Socket
recvall(size) (defined in Socket) | Socket
release() (defined in Socket) | Socket
send(packet) (defined in Socket) | Socket
sendall(packet) (defined in Socket) | Socket
setPort(port) (defined in Socket) | Socket
setSocket(sock) (defined in Socket) | Socket
setTimeout(timeout) | ccsdsSocket
settimeout(seconds) (defined in Socket) | Socket
setTimeoutEnabled(flag) | ccsdsSocket
socket() (defined in Socket) | Socket

Generated on Fri Jul 21 13:27:15 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskCmdTxSocket Member List

This is the complete list of members for HskCmdTxSocket, including all inherited members.

__init__(handler=None, debug=0, port=0) (defined in ccsdsSocket) | ccsdsSocket
__init__(portnumber) (defined in Socket) | Socket
connect(host) (defined in ccsdsSocket) | ccsdsSocket
disconnect() (defined in ccsdsSocket) | ccsdsSocket
getTimeout() | ccsdsSocket
gettimeout() (defined in Socket) | Socket
handler(newhandler) (defined in ccsdsSocket) | ccsdsSocket
isConnected() (defined in Socket) | Socket
isTimeoutEnabled() | ccsdsSocket
lock() (defined in Socket) | Socket
port() (defined in Socket) | Socket
purge() | Socket
readCCSDS() | ccsdsSocket
recv(size) (defined in Socket) | Socket
recvall(size) (defined in Socket) | Socket
release() (defined in Socket) | Socket
send(packet) (defined in Socket) | Socket
sendall(packet) (defined in Socket) | Socket
setPort(port) (defined in Socket) | Socket
setSocket(sock) (defined in Socket) | Socket
setTimeout(timeout) | ccsdsSocket
settimeout(seconds) (defined in Socket) | Socket
setTimeoutEnabled(flag) | ccsdsSocket
socket() (defined in Socket) | Socket

Generated on Fri Jul 21 13:27:15 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskHandler Member List

This is the complete list of members for HskHandler, including all inherited members.

__init__(server, host) (defined in HskHandler) | HskHandler
connect() | HskHandler
disconnected() | HskHandler
timedout() | HskHandler

Generated on Fri Jul 21 13:27:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskTelemSocket Member List

This is the complete list of members for HskTelemSocket, including all inherited members.

__init__(handler=None, debug=0, port=0) (defined in ccsdsSocket) | ccsdsSocket
__init__(portnumber) (defined in Socket) | Socket
connect(host) (defined in ccsdsSocket) | ccsdsSocket
disconnect() (defined in ccsdsSocket) | ccsdsSocket
getTimeout() | ccsdsSocket
gettimeout() (defined in Socket) | Socket
handler(newhandler) (defined in ccsdsSocket) | ccsdsSocket
isConnected() (defined in Socket) | Socket
isTimeoutEnabled() | ccsdsSocket
lock() (defined in Socket) | Socket
port() (defined in Socket) | Socket
purge() | Socket
readCCSDS() | ccsdsSocket
recv(size) (defined in Socket) | Socket
recvall(size) (defined in Socket) | Socket
release() (defined in Socket) | Socket
send(packet) (defined in Socket) | Socket
sendall(packet) (defined in Socket) | Socket
setPort(port) (defined in Socket) | Socket
setSocket(sock) (defined in Socket) | Socket
setTimeout(timeout) | ccsdsSocket
settimeout(seconds) (defined in Socket) | Socket
setTimeoutEnabled(flag) | ccsdsSocket
socket() (defined in Socket) | Socket

Generated on Fri Jul 21 13:27:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskCollector Member List

This is the complete list of members for HskCollector, including all inherited members.

__init__(config) (defined in HskCollector) | HskCollector
latDB() (defined in HskCollector) | HskCollector

Generated on Fri Jul 21 13:27:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskConfiguration Member List

This is the complete list of members for HskConfiguration, including all inherited members.

__init__() (defined in HskConfiguration) | HskConfiguration
read(fileName) (defined in HskConfiguration) | HskConfiguration
verify() (defined in HskConfiguration) | HskConfiguration

Generated on Fri Jul 21 13:27:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

QtReceiver Member List

This is the complete list of members for QtReceiver, including all inherited members.

__init__(trendMap) (defined in QtReceiver) | QtReceiver |
__init__(flatFile, startTime, trendList) (defined in QtReceiver) | QtReceiver |
__init__(flatFile, startTime) (defined in HskSimpleTextReceiver) | HskSimpleTextReceiver | [private]
customEvent(event) (defined in QtReceiver) | QtReceiver |
dispatch(trendMap) (defined in HskCfgTextReceiver) | HskCfgTextReceiver | [private]
process(trendMap) (defined in QtReceiver) | QtReceiver |
process(dispatchMap) (defined in HskCfgTextReceiver) | HskCfgTextReceiver | [private]
receive() (defined in HskSimpleTextReceiver) | HskSimpleTextReceiver | [private]
shutdown() (defined in HskSimpleTextReceiver) | HskSimpleTextReceiver | [private]
trendItem(item) (defined in HskCfgTextReceiver) | HskCfgTextReceiver | [private]

Generated on Fri Jul 21 13:27:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TimeAxisGen Member List

This is the complete list of members for TimeAxisGen, including all inherited members.

setPlotter(plotter, name) (defined in TimeAxisGen) | TimeAxisGen
update(obs) (defined in TimeAxisGen) | TimeAxisGen

Generated on Fri Jul 21 13:27:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrendPlotter Member List

This is the complete list of members for TrendPlotter, including all inherited members.

addPlot(key) (defined in TrendPlotter) | TrendPlotter
isDynamic() (defined in TrendPlotter) | TrendPlotter
setDynamic(bool) (defined in TrendPlotter) | TrendPlotter
update(trendMap) (defined in TrendPlotter) | TrendPlotter

Generated on Fri Jul 21 13:27:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket21a Member List

This is the complete list of members for HskPacket21a, including all inherited members.

__init__(ui) (defined in HskPacket21a) HskPacket21a

Generated on Fri Jul 21 13:27:20 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket21b Member List

This is the complete list of members for HskPacket21b, including all inherited members.

__init__(ui) (defined in HskPacket21b) HskPacket21b

Generated on Fri Jul 21 13:27:20 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket21c Member List

This is the complete list of members for HskPacket21c, including all inherited members.

__init__(ui) (defined in HskPacket21c) HskPacket21c

Generated on Fri Jul 21 13:27:21 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket21d Member List

This is the complete list of members for HskPacket21d, including all inherited members.

__init__(ui) (defined in HskPacket21d) HskPacket21d

Generated on Fri Jul 21 13:27:21 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket21e Member List

This is the complete list of members for HskPacket21e, including all inherited members.

__init__(ui) (defined in HskPacket21e) HskPacket21e

Generated on Fri Jul 21 13:27:21 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket21f Member List

This is the complete list of members for HskPacket21f, including all inherited members.

__init__(ui) (defined in HskPacket21f) HskPacket21f

Generated on Fri Jul 21 13:27:21 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket22a Member List

This is the complete list of members for HskPacket22a, including all inherited members.

__init__(ui) (defined in HskPacket22a) HskPacket22a

Generated on Fri Jul 21 13:27:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket22b Member List

This is the complete list of members for HskPacket22b, including all inherited members.

__init__(ui) (defined in HskPacket22b) HskPacket22b

Generated on Fri Jul 21 13:27:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket22c Member List

This is the complete list of members for HskPacket22c, including all inherited members.

__init__(ui) (defined in HskPacket22c) HskPacket22c

Generated on Fri Jul 21 13:27:35 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket22d Member List

This is the complete list of members for HskPacket22d, including all inherited members.

__init__(ui) (defined in HskPacket22d) HskPacket22d

Generated on Fri Jul 21 13:27:35 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket22e Member List

This is the complete list of members for HskPacket22e, including all inherited members.

__init__(ui) (defined in HskPacket22e) HskPacket22e

Generated on Fri Jul 21 13:27:36 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket22f Member List

This is the complete list of members for HskPacket22f, including all inherited members.

__init__(ui) (defined in HskPacket22f) HskPacket22f

Generated on Fri Jul 21 13:27:36 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket27a Member List

This is the complete list of members for HskPacket27a, including all inherited members.

__init__(ui) (defined in HskPacket27a) HskPacket27a

Generated on Fri Jul 21 13:27:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket27b Member List

This is the complete list of members for HskPacket27b, including all inherited members.

__init__(ui) (defined in HskPacket27b) HskPacket27b

Generated on Fri Jul 21 13:27:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket27c Member List

This is the complete list of members for HskPacket27c, including all inherited members.

__init__(ui) (defined in HskPacket27c) HskPacket27c

Generated on Fri Jul 21 13:27:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket27d Member List

This is the complete list of members for HskPacket27d, including all inherited members.

__init__(ui) (defined in HskPacket27d) HskPacket27d

Generated on Fri Jul 21 13:27:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket27e Member List

This is the complete list of members for HskPacket27e, including all inherited members.

__init__(ui) (defined in HskPacket27e) HskPacket27e

Generated on Fri Jul 21 13:27:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket27f Member List

This is the complete list of members for HskPacket27f, including all inherited members.

__init__(ui) (defined in HskPacket27f) HskPacket27f

Generated on Fri Jul 21 13:27:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket28a Member List

This is the complete list of members for HskPacket28a, including all inherited members.

__init__(ui) (defined in HskPacket28a) HskPacket28a

Generated on Fri Jul 21 13:27:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket28b Member List

This is the complete list of members for HskPacket28b, including all inherited members.

__init__(ui) (defined in HskPacket28b) HskPacket28b

Generated on Fri Jul 21 13:27:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket28c Member List

This is the complete list of members for HskPacket28c, including all inherited members.

__init__(ui) (defined in HskPacket28c) HskPacket28c

Generated on Fri Jul 21 13:27:35 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket28d Member List

This is the complete list of members for HskPacket28d, including all inherited members.

__init__(ui) (defined in HskPacket28d) HskPacket28d

Generated on Fri Jul 21 13:27:36 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket28e Member List

This is the complete list of members for HskPacket28e, including all inherited members.

__init__(ui) (defined in HskPacket28e) HskPacket28e

Generated on Fri Jul 21 13:27:37 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket28f Member List

This is the complete list of members for HskPacket28f, including all inherited members.

__init__(ui) (defined in HskPacket28f) HskPacket28f

Generated on Fri Jul 21 13:27:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket210 Member List

This is the complete list of members for HskPacket210, including all inherited members.

__init__(ui) (defined in HskPacket210) HskPacket210

Generated on Fri Jul 21 13:27:17 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket211 Member List

This is the complete list of members for HskPacket211, including all inherited members.

__init__(ui) (defined in HskPacket211) HskPacket211

Generated on Fri Jul 21 13:27:17 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket212 Member List

This is the complete list of members for HskPacket212, including all inherited members.

__init__(ui) (defined in HskPacket212) HskPacket212

Generated on Fri Jul 21 13:27:18 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket213 Member List

This is the complete list of members for HskPacket213, including all inherited members.

__init__(ui) (defined in HskPacket213) HskPacket213

Generated on Fri Jul 21 13:27:18 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket214 Member List

This is the complete list of members for HskPacket214, including all inherited members.

__init__(ui) (defined in HskPacket214) HskPacket214

Generated on Fri Jul 21 13:27:18 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket215 Member List

This is the complete list of members for HskPacket215, including all inherited members.

__init__(ui) (defined in HskPacket215) HskPacket215

Generated on Fri Jul 21 13:27:19 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket216 Member List

This is the complete list of members for HskPacket216, including all inherited members.

__init__(ui) (defined in HskPacket216) HskPacket216

Generated on Fri Jul 21 13:27:19 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket217 Member List

This is the complete list of members for HskPacket217, including all inherited members.

__init__(ui) (defined in HskPacket217) HskPacket217

Generated on Fri Jul 21 13:27:19 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket218 Member List

This is the complete list of members for HskPacket218, including all inherited members.

__init__(ui) (defined in HskPacket218) HskPacket218

Generated on Fri Jul 21 13:27:19 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket219 Member List

This is the complete list of members for HskPacket219, including all inherited members.

__init__(ui) (defined in HskPacket219) HskPacket219

Generated on Fri Jul 21 13:27:20 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket220 Member List

This is the complete list of members for HskPacket220, including all inherited members.

__init__(ui) (defined in HskPacket220) HskPacket220

Generated on Fri Jul 21 13:27:22 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket221 Member List

This is the complete list of members for HskPacket221, including all inherited members.

__init__(ui) (defined in HskPacket221) HskPacket221

Generated on Fri Jul 21 13:27:22 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket222 Member List

This is the complete list of members for HskPacket222, including all inherited members.

__init__(ui) (defined in HskPacket222) HskPacket222

Generated on Fri Jul 21 13:27:22 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket223 Member List

This is the complete list of members for HskPacket223, including all inherited members.

__init__(ui) (defined in HskPacket223) HskPacket223

Generated on Fri Jul 21 13:27:22 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket224 Member List

This is the complete list of members for HskPacket224, including all inherited members.

__init__(ui) (defined in HskPacket224) HskPacket224

Generated on Fri Jul 21 13:27:23 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket225 Member List

This is the complete list of members for HskPacket225, including all inherited members.

__init__(ui) (defined in HskPacket225) HskPacket225

Generated on Fri Jul 21 13:27:23 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket226 Member List

This is the complete list of members for HskPacket226, including all inherited members.

__init__(ui) (defined in HskPacket226) HskPacket226

Generated on Fri Jul 21 13:27:23 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket227 Member List

This is the complete list of members for HskPacket227, including all inherited members.

__init__(ui) (defined in HskPacket227) HskPacket227

Generated on Fri Jul 21 13:27:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket228 Member List

This is the complete list of members for HskPacket228, including all inherited members.

__init__(ui) (defined in HskPacket228) HskPacket228

Generated on Fri Jul 21 13:27:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket229 Member List

This is the complete list of members for HskPacket229, including all inherited members.

__init__(ui) (defined in HskPacket229) HskPacket229

Generated on Fri Jul 21 13:27:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket230 Member List

This is the complete list of members for HskPacket230, including all inherited members.

__init__(ui) (defined in HskPacket230) HskPacket230

Generated on Fri Jul 21 13:27:37 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket231 Member List

This is the complete list of members for HskPacket231, including all inherited members.

__init__(ui) (defined in HskPacket231) HskPacket231

Generated on Fri Jul 21 13:27:37 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket270 Member List

This is the complete list of members for HskPacket270, including all inherited members.

__init__(ui) (defined in HskPacket270) HskPacket270

Generated on Fri Jul 21 13:27:24 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket271 Member List

This is the complete list of members for HskPacket271, including all inherited members.

__init__(ui) (defined in HskPacket271) HskPacket271

Generated on Fri Jul 21 13:27:24 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket272 Member List

This is the complete list of members for HskPacket272, including all inherited members.

__init__(ui) (defined in HskPacket272) HskPacket272

Generated on Fri Jul 21 13:27:24 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket273 Member List

This is the complete list of members for HskPacket273, including all inherited members.

__init__(ui) (defined in HskPacket273) HskPacket273

Generated on Fri Jul 21 13:27:24 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket274 Member List

This is the complete list of members for HskPacket274, including all inherited members.

__init__(ui) (defined in HskPacket274) HskPacket274

Generated on Fri Jul 21 13:27:25 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket275 Member List

This is the complete list of members for HskPacket275, including all inherited members.

__init__(ui) (defined in HskPacket275) HskPacket275

Generated on Fri Jul 21 13:27:25 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket276 Member List

This is the complete list of members for HskPacket276, including all inherited members.

__init__(ui) (defined in HskPacket276) HskPacket276

Generated on Fri Jul 21 13:27:25 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket277 Member List

This is the complete list of members for HskPacket277, including all inherited members.

__init__(ui) (defined in HskPacket277) HskPacket277

Generated on Fri Jul 21 13:27:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket278 Member List

This is the complete list of members for HskPacket278, including all inherited members.

__init__(ui) (defined in HskPacket278) HskPacket278

Generated on Fri Jul 21 13:27:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket279 Member List

This is the complete list of members for HskPacket279, including all inherited members.

__init__(ui) (defined in HskPacket279) HskPacket279

Generated on Fri Jul 21 13:27:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket280 Member List

This is the complete list of members for HskPacket280, including all inherited members.

__init__(ui) (defined in HskPacket280) HskPacket280

Generated on Fri Jul 21 13:27:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket281 Member List

This is the complete list of members for HskPacket281, including all inherited members.

__init__(ui) (defined in HskPacket281) HskPacket281

Generated on Fri Jul 21 13:27:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket282 Member List

This is the complete list of members for HskPacket282, including all inherited members.

__init__(ui) (defined in HskPacket282) HskPacket282

Generated on Fri Jul 21 13:27:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket283 Member List

This is the complete list of members for HskPacket283, including all inherited members.

__init__(ui) (defined in HskPacket283) HskPacket283

Generated on Fri Jul 21 13:27:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket284 Member List

This is the complete list of members for HskPacket284, including all inherited members.

__init__(ui) (defined in HskPacket284) HskPacket284

Generated on Fri Jul 21 13:27:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket285 Member List

This is the complete list of members for HskPacket285, including all inherited members.

__init__(ui) (defined in HskPacket285) HskPacket285

Generated on Fri Jul 21 13:27:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket286 Member List

This is the complete list of members for HskPacket286, including all inherited members.

__init__(ui) (defined in HskPacket286) HskPacket286

Generated on Fri Jul 21 13:27:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket287 Member List

This is the complete list of members for HskPacket287, including all inherited members.

__init__(ui) (defined in HskPacket287) HskPacket287

Generated on Fri Jul 21 13:27:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket288 Member List

This is the complete list of members for HskPacket288, including all inherited members.

__init__(ui) (defined in HskPacket288) HskPacket288

Generated on Fri Jul 21 13:27:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket289 Member List

This is the complete list of members for HskPacket289, including all inherited members.

__init__(ui) (defined in HskPacket289) HskPacket289

Generated on Fri Jul 21 13:27:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket290 Member List

This is the complete list of members for HskPacket290, including all inherited members.

__init__(ui) (defined in HskPacket290) HskPacket290

Generated on Fri Jul 21 13:27:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket291 Member List

This is the complete list of members for HskPacket291, including all inherited members.

__init__(ui) (defined in HskPacket291) HskPacket291

Generated on Fri Jul 21 13:27:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket353 Member List

This is the complete list of members for HskPacket353, including all inherited members.

__init__(ui) (defined in HskPacket353) HskPacket353

Generated on Fri Jul 21 13:27:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacket Member List

This is the complete list of members for HskPacket, including all inherited members.

__init__(ui) (defined in HskPacket) HskPacket

Generated on Fri Jul 21 13:27:17 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ccsdsHeader Member List

This is the complete list of members for ccsdsHeader, including all inherited members.

__init__(ui) (defined in ccsdsHeader) ccsdsHeader

Generated on Fri Jul 21 13:27:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ccsdsPacket Member List

This is the complete list of members for ccsdsPacket, including all inherited members.

__init__(ui) (defined in ccsdsPacket) | ccsdsPacket
apid() (defined in ccsdsPacket) | ccsdsPacket
length() (defined in ccsdsPacket) | ccsdsPacket
seqCnt() (defined in ccsdsPacket) | ccsdsPacket
subSeconds() (defined in ccsdsPacket) | ccsdsPacket
type() (defined in ccsdsPacket) | ccsdsPacket

Generated on Fri Jul 21 13:27:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacketBase Member List

This is the complete list of members for HskPacketBase, including all inherited members.

__init__(ui) (defined in ccsdsPacket) | ccsdsPacket
apid() (defined in ccsdsPacket) | ccsdsPacket
length() (defined in ccsdsPacket) | ccsdsPacket
read() (defined in HskPacketBase) | HskPacketBase
seqCnt() (defined in ccsdsPacket) | ccsdsPacket
subSeconds() (defined in ccsdsPacket) | ccsdsPacket
type() (defined in ccsdsPacket) | ccsdsPacket

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacketRetriever Member List

This is the complete list of members for HskPacketRetriever, including all inherited members.

__init__(hskCli) (defined in HskPacketRetriever) | HskPacketRetriever
retrievePacket() (defined in HskPacketRetriever) | HskPacketRetriever

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskCfgTextReceiver Member List

This is the complete list of members for HskCfgTextReceiver, including all inherited members.

__init__(flatFile, startTime) (defined in HskSimpleTextReceiver) | HskSimpleTextReceiver
dispatch(trendMap) (defined in HskCfgTextReceiver) | HskCfgTextReceiver
process(dispatchMap) (defined in HskCfgTextReceiver) | HskCfgTextReceiver
receive() (defined in HskSimpleTextReceiver) | HskSimpleTextReceiver
shutdown() (defined in HskSimpleTextReceiver) | HskSimpleTextReceiver
trendItem(item) (defined in HskCfgTextReceiver) | HskCfgTextReceiver

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskSimpleTextReceiver Member List

This is the complete list of members for HskSimpleTextReceiver, including all inherited members.

__init__(flatFile, startTime) (defined in HskSimpleTextReceiver) | HskSimpleTextReceiver
dispatch(trendMap) (defined in HskSimpleTextReceiver) | HskSimpleTextReceiver
receive() (defined in HskSimpleTextReceiver) | HskSimpleTextReceiver
shutdown() (defined in HskSimpleTextReceiver) | HskSimpleTextReceiver

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskAlarmRecorder Member List

This is the complete list of members for HskAlarmRecorder, including all inherited members.

__init__(ghsk) (defined in HskAlarmRecorder) | HskAlarmRecorder
processTrends(trendables) (defined in HskAlarmRecorder) | HskAlarmRecorder

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskFileRecorder Member List

This is the complete list of members for HskFileRecorder, including all inherited members.

__init__(ghsk, flatFile) (defined in HskFileRecorder) HskFileRecorder

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacketRecorder Member List

This is the complete list of members for HskPacketRecorder, including all inherited members.

processTrends(trendables) (defined in HskPacketRecorder) HskPacketRecorder

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

AEQHskRegMap Member List

This is the complete list of members for AEQHskRegMap, including all inherited members.

__init__() (defined in AEQHskRegMap) | AEQHskRegMap
decodeRegister(key, regValue) | AEQHskRegMap

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

NodeRegisterList Member List

This is the complete list of members for NodeRegisterList, including all inherited members.

__init__(node) (defined in NodeRegisterList) | NodeRegisterList
map() (defined in NodeRegisterList) | NodeRegisterList

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

RegisterInterface Member List

This is the complete list of members for RegisterInterface, including all inherited members.

__init__(node, name) | RegisterInterface
name() (defined in RegisterInterface) | RegisterInterface
write(value) | RegisterInterface

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskLatRetriever Member List

This is the complete list of members for HskLatRetriever, including all inherited members.

__init__(glat) (defined in HskLatRetriever) | HskLatRetriever
retrievePacket() (defined in HskLatRetriever) | HskLatRetriever

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskTestRetriever Member List

This is the complete list of members for HskTestRetriever, including all inherited members.

__init__(glat) (defined in HskTestRetriever) | HskTestRetriever
aeqBuildDummy(timestamp) (defined in HskTestRetriever) | HskTestRetriever
retrievePacket() (defined in HskTestRetriever) | HskTestRetriever

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

QtReceiver Member List

This is the complete list of members for QtReceiver, including all inherited members.

__init__(trendMap) (defined in QtReceiver) | QtReceiver
__init__(sqlDB, timeDepth, trendList) (defined in QtReceiver) | QtReceiver
customEvent(event) (defined in QtReceiver) | QtReceiver
process(trendMap) (defined in QtReceiver) | QtReceiver

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TimeAxisGen Member List

This is the complete list of members for TimeAxisGen, including all inherited members.

setPlotter(plotter, name) (defined in TimeAxisGen) | TimeAxisGen
update(obs) (defined in TimeAxisGen) | TimeAxisGen

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrendPlotter Member List

This is the complete list of members for TrendPlotter, including all inherited members.

addPlot(key) (defined in TrendPlotter) | TrendPlotter
isDynamic() (defined in TrendPlotter) | TrendPlotter
setDynamic(bool) (defined in TrendPlotter) | TrendPlotter
update(trendMap) (defined in TrendPlotter) | TrendPlotter

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskSqlReceiver Member List

This is the complete list of members for HskSqlReceiver, including all inherited members.

dispatch(trendMap) (defined in HskSqlReceiver) | HskSqlReceiver
process(dispatchMap) (defined in HskSqlReceiver) | HskSqlReceiver
receive() (defined in HskSqlReceiver) | HskSqlReceiver
receiveRegion(start, end) (defined in HskSqlReceiver) | HskSqlReceiver
setSource(source) (defined in HskSqlReceiver) | HskSqlReceiver
trendItem(item) (defined in HskSqlReceiver) | HskSqlReceiver

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskSqlRecorder Member List

This is the complete list of members for HskSqlRecorder, including all inherited members.

processTrends(trendables) (defined in HskSqlRecorder) HskSqlRecorder

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

myLATcomponentIterator Member List

This is the complete list of members for myLATcomponentIterator, including all inherited members.

CALcomponent(event, calContribution) (defined in myLATcomponentIterator) | myLATcomponentIterator
TKRcomponent(event, contribution) (defined in myLATcomponentIterator) | myLATcomponentIterator

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

myTKRcontributionIterator Member List

This is the complete list of members for myTKRcontributionIterator, including all inherited members.

strip(tower, layerEnd, hit) (defined in myTKRcontributionIterator) | myTKRcontributionIterator
TOT(tower, layerEnd, tot) (defined in myTKRcontributionIterator) | myTKRcontributionIterator

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(gui, userId, debug) (defined in userApplication) | userApplication
commandSynch() | userApplication
getName() (defined in userApplication) | userApplication
process((status, buffer)) | userApplication
resume() (defined in userApplication) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
sync() (defined in userApplication) | userApplication
wait() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userArgText Member List

This is the complete list of members for userArgText, including all inherited members.

__init__() (defined in userArgText) | userArgText
getValue(caption) (defined in userArgText) | userArgText

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userArgument Member List

This is the complete list of members for userArgument, including all inherited members.

__init__(parent=None, name=None, modal=0, fl=0) (defined in userArgument) | userArgument
getValue(caption) (defined in userArgument) | userArgument
OKButtonClicked() (defined in userArgument) | userArgument

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(gui, userId, debug) (defined in userApplication) | userApplication
commandSynch() | userApplication
getName() (defined in userApplication) | userApplication
process((status, buffer)) | userApplication
resume() (defined in userApplication) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
sync() (defined in userApplication) | userApplication
teardown() (defined in userApplication) | userApplication
wait() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userArgument Member List

This is the complete list of members for userArgument, including all inherited members.

__init__(parent=None, name=None, modal=0, fl=0) (defined in userArgument) | userArgument
CancelButtonClicked() (defined in userArgument) | userArgument
getValue(caption) (defined in userArgument) | userArgument
OKButtonClicked() (defined in userArgument) | userArgument

Generated on Fri Jul 21 13:27:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(gui, userId, debug) (defined in userApplication) | userApplication
commandSynch() | userApplication
getName() (defined in userApplication) | userApplication
process((status, buffer)) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
sync() (defined in userApplication) | userApplication
teardown() (defined in userApplication) | userApplication
wait() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:27:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(gui, userId, debug) (defined in userApplication) | userApplication
commandSynch() | userApplication
getName() (defined in userApplication) | userApplication
process((status, buffer)) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
teardown() (defined in userApplication) | userApplication
wait() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:27:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userArgText Member List

This is the complete list of members for userArgText, including all inherited members.

__init__() (defined in userArgText) | userArgText
getValue(caption) (defined in userArgText) | userArgText

Generated on Fri Jul 21 13:27:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userArgument Member List

This is the complete list of members for userArgument, including all inherited members.

__init__(parent=None, name=None, modal=0, fl=0) (defined in userArgument) | userArgument
CancelButtonClicked() (defined in userArgument) | userArgument
getValue(caption) (defined in userArgument) | userArgument
OKButtonClicked() (defined in userArgument) | userArgument

Generated on Fri Jul 21 13:27:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

LATsweep Member List

This is the complete list of members for LATsweep, including all inherited members.

__init__(lat, trigger, shut) (defined in LATsweep) | LATsweep
shut(sweepEvent, progress=None) (defined in LATsweep) | LATsweep

Generated on Fri Jul 21 13:27:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

LdfContribution Member List

This is the complete list of members for LdfContribution, including all inherited members.

buffer() (defined in LdfContribution) | LdfContribution
contributor() (defined in GebContribution) | GebContribution
identity() | LdfContribution
length() | LdfContribution
sequence() | LdfContribution

Generated on Fri Jul 21 13:27:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

LdfContributor Member List

This is the complete list of members for LdfContributor, including all inherited members.

__init__() (defined in GebContributor) | GebContributor |
close() | LdfContributor |
contributionQueue() | GebContributor | [static]
fake() (defined in LdfContributor) | LdfContributor |
idMask(id=None) | GebContributor |
name() | LdfContributor |
offset() (defined in LdfContributor) | LdfContributor |
open() | LdfContributor |
read() | LdfContributor |
run() | GebContributor |
sequence(sequence) | GebContributor |

Generated on Fri Jul 21 13:27:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Email Member List

This is the complete list of members for Email, including all inherited members.

body(b=None) (defined in Email) | Email
recipient(r=None) (defined in Email) | Email
sender(s=None) (defined in Email) | Email
subject(s=None) (defined in Email) | Email

Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

MailAlert Member List

This is the complete list of members for MailAlert, including all inherited members.

sendMail(email) (defined in MailAlert) MailAlert

Generated on Fri Jul 21 13:27:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

SLACmail Member List

This is the complete list of members for SLACmail, including all inherited members.

__init__() (defined in SLACmail) | SLACmail
sendMail(email) (defined in MailAlert) | MailAlert

Generated on Fri Jul 21 13:27:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

mask Member List

This is the complete list of members for mask, including all inherited members.

__init__(parent=None, name=None, fl=0) (defined in mask) | mask
getMask() (defined in mask) | mask
resizeEvent(rev) (defined in mask) | mask
setLabel(i, text) (defined in mask) | mask
setMask(mask) (defined in mask) | mask
setTitle(text) (defined in mask) | mask
setup(nbox) (defined in mask) | mask
updateMask() (defined in mask) | mask

Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

MiniGLTExample Member List

This is the complete list of members for MiniGLTExample, including all inherited members.

__init__() | MiniGLTExample
conditions() | MiniGLTExample
engines() | MiniGLTExample

Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

MiniGLTSolicitedCondition Member List

This is the complete list of members for MiniGLTSolicitedCondition, including all inherited members.

__init__() (defined in MiniGLTSolicitedCondition) | MiniGLTSolicitedCondition
solicited() (defined in MiniGLTSolicitedCondition) | MiniGLTSolicitedCondition

Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

MiniGLTSolicitedEngine Member List

This is the complete list of members for MiniGLTSolicitedEngine, including all inherited members.

__init__() (defined in MiniGLTSolicitedEngine) | MiniGLTSolicitedEngine
participate(conditionsValue) (defined in MiniGLTSolicitedEngine) | MiniGLTSolicitedEngine
prescale() (defined in MiniGLTSolicitedEngine) | MiniGLTSolicitedEngine
request() (defined in MiniGLTSolicitedEngine) | MiniGLTSolicitedEngine

Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ZsupTrgReadout Member List

This is the complete list of members for ZsupTrgReadout, including all inherited members.

__init__() | ZsupTrgReadout
zeroSuppress() (defined in ZsupTrgReadout) | ZsupTrgReadout

Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

LogRecordStreamHandler Member List

This is the complete list of members for LogRecordStreamHandler, including all inherited members.

handle() | LogRecordStreamHandler
handleLogRecord(record) (defined in LogRecordStreamHandler) | LogRecordStreamHandler
unPickle(data) (defined in LogRecordStreamHandler) | LogRecordStreamHandler

Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

MSGLogGUIImpl Member List

This is the complete list of members for MSGLogGUIImpl, including all inherited members.

__init__(port=logging.handlers.DEFAULT_TCP_LOGGING_PORT, updateInterval=100, parent=None, name=None, fl=0) (defined in MSGLogGUIImpl) | MSGLogGUIImpl
abortListenerThread() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
addLogDataToView() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
appendLogData(data) (defined in MSGLogGUIImpl) | MSGLogGUIImpl
clearLevels() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
closeEvent(e) (defined in MSGLogGUIImpl) | MSGLogGUIImpl
fileExit() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
fileNew() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
fileOpen() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
filePrint() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
fileSave() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
fileSaveAs() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
handleAlert(s) (defined in MSGLogGUIImpl) | MSGLogGUIImpl
Help() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
levelCritical() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
levelDebug() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
levelError() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
levelFatal() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
levelInfo() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
levelNoFilter() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
levelNotset() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
levelWarn() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
load() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
preventCheck() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
preventSaturation() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
runTCP(tcpserver) (defined in MSGLogGUIImpl) | MSGLogGUIImpl
setListViewItem(data) (defined in MSGLogGUIImpl) | MSGLogGUIImpl
setSecure(secure) (defined in MSGLogGUIImpl) | MSGLogGUIImpl
showEntries() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
startListenerThread() (defined in MSGLogGUIImpl) | MSGLogGUIImpl
switchToRunningLog() (defined in MSGLogGUIImpl) | MSGLogGUIImpl

Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

MSGLogSocketReceiver Member List

This is the complete list of members for MSGLogSocketReceiver, including all inherited members.

__init__(gui, host='', port=logging.handlers.DEFAULT_TCP_LOGGING_PORT, handler=LogRecordStreamHandler) (defined in MSGLogSocketReceiver) | MSGLogSocketReceiver
abort() (defined in MSGLogSocketReceiver) | MSGLogSocketReceiver
serve_until_stopped() (defined in MSGLogSocketReceiver) | MSGLogSocketReceiver

Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

multibar Member List

This is the complete list of members for multibar, including all inherited members.

displaySlidingScaleValue(i, val) (defined in multibar) | multibar
languageChange() (defined in multibar) | multibar
resizeEvent(rev) (defined in multibar) | multibar
setBarTitle(i, title) (defined in multibar) | multibar
setHigh(high) (defined in multibar) | multibar
setLow(low) (defined in multibar) | multibar
setMinScale(min) (defined in multibar) | multibar
setScale(scale) (defined in multibar) | multibar
setSlidingScale(scale) (defined in multibar) | multibar
setTitle(title) (defined in multibar) | multibar
setup(nbars, lw=0) (defined in multibar) | multibar

Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(rc, userId, debug) (defined in userApplication) | userApplication
getName() (defined in userApplication) | userApplication
process((status, buffer)) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
wait() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

NoCnoEnabled Member List

This is the complete list of members for NoCnoEnabled, including all inherited members.

__init__() | NoCnoEnabled
__setattr__(name, value) | TrgObject
LA1() | TrgCnoEnables
LA2() | TrgCnoEnables
LA3() | TrgCnoEnables
LA4() | TrgCnoEnables
LB2() | TrgCnoEnables
LB4() | TrgCnoEnables
RA2() | TrgCnoEnables
RA4() | TrgCnoEnables
RB1() | TrgCnoEnables
RB2() | TrgCnoEnables
RB3() | TrgCnoEnables
RB4() | TrgCnoEnables

Generated on Fri Jul 21 13:27:44 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

NoExternal Member List

This is the complete list of members for NoExternal, including all inherited members.

__init__() | NoExternal
__setattr__(name, value) | TrgObject
external() | NoExternal

Generated on Fri Jul 21 13:27:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

NoInputsEnabled Member List

This is the complete list of members for NoInputsEnabled, including all inherited members.

__init__() | NoInputsEnabled
__setattr__(name, value) | TrgObject
cno() | NoInputsEnabled
external() | NoInputsEnabled
tiles() | TrgInputEnables
towerBusy() | TrgInputEnables
towers() | NoInputsEnabled

Generated on Fri Jul 21 13:27:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

NoTilesEnabled Member List

This is the complete list of members for NoTilesEnabled, including all inherited members.

__init__() | NoTilesEnabled
__setattr__(name, value) | TrgObject
tile(tileNumber) | NoTilesEnabled

Generated on Fri Jul 21 13:27:44 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

NoTowersBusy Member List

This is the complete list of members for NoTowersBusy, including all inherited members.

__init__() | NoTowersBusy
__setattr__(name, value) | TrgObject
tower(towerNumber) | NoTowersBusy

Generated on Fri Jul 21 13:27:44 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

NoTowersEnabled Member List

This is the complete list of members for NoTowersEnabled, including all inherited members.

__init__() | TrgTowerEnables
__setattr__(name, value) | TrgObject
tower(towerNumber) (defined in NoTowersEnabled) | NoTowersEnabled
towers() | TrgTowerEnables

Generated on Fri Jul 21 13:27:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

NullCal Member List

This is the complete list of members for NullCal, including all inherited members.

__init__() | NullCal
__setattr__(name, value) | TrgObject
useHighEnergy() | NullCal
useLowEnergy() | NullCal

Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

NullCoincidence Member List

This is the complete list of members for NullCoincidence, including all inherited members.

__init__() | NullCoincidence
__setattr__(name, value) | TrgObject
inCoincidence(tileNumber) | NullCoincidence

Generated on Fri Jul 21 13:27:46 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

NullEngine Member List

This is the complete list of members for NullEngine, including all inherited members.

__init__() | NullEngine
__setattr__(name, value) | TrgObject
participate(conditionsValue) | NullEngine
prescale() | NullEngine
request() | NullEngine

Generated on Fri Jul 21 13:27:46 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

NullRequest Member List

This is the complete list of members for NullRequest, including all inherited members.

__init__() | NullRequest
__setattr__(name, value) | TrgObject
destination() | TrgEngineRequest
fourRange() | TrgEngineRequest
marker(markerValue=0) | TrgEngineRequest
sequence() | NullRequest
zeroSuppress() | TrgEngineRequest

Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

NullRoi Member List

This is the complete list of members for NullRoi, including all inherited members.

__init__() | NullRoi
__setattr__(name, value) | TrgObject
tile(tileNumber) | NullRoi

Generated on Fri Jul 21 13:27:45 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

NullTkr Member List

This is the complete list of members for NullTkr, including all inherited members.

__init__() | NullTkr
__setattr__(name, value) | TrgObject
use() | NullTkr

Generated on Fri Jul 21 13:27:43 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

NullTower Member List

This is the complete list of members for NullTower, including all inherited members.

__init__() | NullTower
__setattr__(name, value) | TrgObject
calorimeter() | NullTower
tracker() | NullTower

Generated on Fri Jul 21 13:27:42 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

HskPacketWriter Member List

This is the complete list of members for HskPacketWriter, including all inherited members.

addPayload(item) (defined in HskPacketWriter) | HskPacketWriter
apid(a=None) (defined in HskPacketWriter) | HskPacketWriter
brief(a=None) (defined in HskPacketWriter) | HskPacketWriter
descr(a=None) (defined in HskPacketWriter) | HskPacketWriter
dump() (defined in HskPacketWriter) | HskPacketWriter
length(a=None) (defined in HskPacketWriter) | HskPacketWriter
name(a=None) (defined in HskPacketWriter) | HskPacketWriter
payload() (defined in HskPacketWriter) | HskPacketWriter
writeCode() (defined in HskPacketWriter) | HskPacketWriter
writeSQL() (defined in HskPacketWriter) | HskPacketWriter

Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ACDPowerPanel Member List

This is the complete list of members for ACDPowerPanel, including all inherited members.

__init__(args) (defined in ACDPowerPanel) | ACDPowerPanel
constructControls() (defined in GroupPanel) | GroupPanel
constructGrid() (defined in ACDPowerPanel) | ACDPowerPanel
getSelect() (defined in GroupPanel) | GroupPanel
setAllSelect(select, name='') (defined in GroupPanel) | GroupPanel
setEnables(enables) (defined in GroupPanel) | GroupPanel
setModule(tag, module) (defined in GroupPanel) | GroupPanel
setStatus(statusmap) (defined in GroupPanel) | GroupPanel

Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

CheckLed Member List

This is the complete list of members for CheckLed, including all inherited members.

__init__(name, label, args) (defined in CheckLed) | CheckLed
emitChanged(bool) (defined in CheckLed) | CheckLed
getSelect() (defined in CheckLed) | CheckLed
setEnabled(bool) (defined in CheckLed) | CheckLed
setEnables(enable) (defined in CheckLed) | CheckLed
setSelect(select) (defined in CheckLed) | CheckLed
setStatus(status) (defined in CheckLed) | CheckLed

Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

CratePanel Member List

This is the complete list of members for CratePanel, including all inherited members.

constructControls() (defined in GroupPanel) | GroupPanel
constructGrid() (defined in CratePanel) | CratePanel
getSelect() (defined in GroupPanel) | GroupPanel
setAllSelect(select, name='') (defined in GroupPanel) | GroupPanel
setEnables(enables) (defined in GroupPanel) | GroupPanel
setModule(tag, module) (defined in GroupPanel) | GroupPanel
setStatus(statusmap) (defined in GroupPanel) | GroupPanel

Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

EMPanel Member List

This is the complete list of members for EMPanel, including all inherited members.

addSelectable(key, sel) (defined in EMPanel) | EMPanel
getSelect() (defined in EMPanel) | EMPanel
selectChanged(name) (defined in EMPanel) | EMPanel
setEnables(enablemap) (defined in EMPanel) | EMPanel
setSelect(select) (defined in EMPanel) | EMPanel
setStatus(status) (defined in EMPanel) | EMPanel

Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ExclusiveButtonGroup Member List

This is the complete list of members for ExclusiveButtonGroup, including all inherited members.

getSelect() (defined in ExclusiveButtonGroup) | ExclusiveButtonGroup
setEnabled(bool) (defined in ExclusiveButtonGroup) | ExclusiveButtonGroup
setEnables(enable) (defined in ExclusiveButtonGroup) | ExclusiveButtonGroup
setSelect(select) (defined in ExclusiveButtonGroup) | ExclusiveButtonGroup
setStatus(status) (defined in ExclusiveButtonGroup) | ExclusiveButtonGroup

Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

FabricPanel Member List

This is the complete list of members for FabricPanel, including all inherited members.

allclear() (defined in FabricPanel) | FabricPanel
allclearcr() (defined in FabricPanel) | FabricPanel
allclearevt() (defined in FabricPanel) | FabricPanel
allsel() (defined in FabricPanel) | FabricPanel
allselcr() (defined in FabricPanel) | FabricPanel
allselevt() (defined in FabricPanel) | FabricPanel
allselpdu0() (defined in FabricPanel) | FabricPanel
allselpdu1() (defined in FabricPanel) | FabricPanel
selectAll(select) (defined in FabricPanel) | FabricPanel

Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GasuPanel Member List

This is the complete list of members for GasuPanel, including all inherited members.

constructControls() (defined in GroupPanel) | GroupPanel
constructGrid() (defined in GasuPanel) | GasuPanel
getSelect() (defined in GroupPanel) | GroupPanel
setAllSelect(select, name='') (defined in GroupPanel) | GroupPanel
setEnables(enables) (defined in GroupPanel) | GroupPanel
setModule(tag, module) (defined in GroupPanel) | GroupPanel
setStatus(statusmap) (defined in GroupPanel) | GroupPanel

Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GroupPanel Member List

This is the complete list of members for GroupPanel, including all inherited members.

constructControls() (defined in GroupPanel) | GroupPanel
constructGrid() (defined in GroupPanel) | GroupPanel
getSelect() (defined in GroupPanel) | GroupPanel
setAllSelect(select, name='') (defined in GroupPanel) | GroupPanel
setEnables(enables) (defined in GroupPanel) | GroupPanel
setModule(tag, module) (defined in GroupPanel) | GroupPanel
setStatus(statusmap) (defined in GroupPanel) | GroupPanel

Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

PorcineEvent Member List

This is the complete list of members for PorcineEvent, including all inherited members.

__init__(type, data) (defined in PorcineEvent) PorcineEvent

Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

PorcinePanel Member List

This is the complete list of members for PorcinePanel, including all inherited members.

__init__(args) (defined in PorcinePanel) | PorcinePanel
customEvent(e) (defined in PorcinePanel) | PorcinePanel
fabricExtract() (defined in PorcinePanel) | PorcinePanel
fabricInsert() (defined in PorcinePanel) | PorcinePanel
getFabricControl() (defined in PorcinePanel) | PorcinePanel
getPowerControl() (defined in PorcinePanel) | PorcinePanel
getPowerTab() (defined in PorcinePanel) | PorcinePanel
powerOff() (defined in PorcinePanel) | PorcinePanel
powerOn() (defined in PorcinePanel) | PorcinePanel
refreshSchema(lat, xbrd) (defined in PorcinePanel) | PorcinePanel
refreshStatus() (defined in PorcinePanel) | PorcinePanel
shutdown() (defined in PorcinePanel) | PorcinePanel

Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

PorcineWindow Member List

This is the complete list of members for PorcineWindow, including all inherited members.

shutdown() (defined in PorcineWindow) | PorcineWindow
windowActivationChange(oldActive) (defined in PorcineWindow) | PorcineWindow

Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

StatusLabel Member List

This is the complete list of members for StatusLabel, including all inherited members.

setEnabled(bool) (defined in StatusLabel) StatusLabel

Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TowerPanel Member List

This is the complete list of members for TowerPanel, including all inherited members.

constructControls() (defined in GroupPanel) | GroupPanel
constructGrid() (defined in TowerPanel) | TowerPanel
getSelect() (defined in GroupPanel) | GroupPanel
setAllSelect(select, name='') (defined in GroupPanel) | GroupPanel
setEnables(enables) (defined in GroupPanel) | GroupPanel
setModule(tag, module) (defined in GroupPanel) | GroupPanel
setStatus(statusmap) (defined in GroupPanel) | GroupPanel

Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TowerPowerPanel Member List

This is the complete list of members for TowerPowerPanel, including all inherited members.

constructControls() (defined in GroupPanel) | GroupPanel
constructGrid() (defined in TowerPowerPanel) | TowerPowerPanel
getSelect() (defined in GroupPanel) | GroupPanel
setAllSelect(select, name='') (defined in GroupPanel) | GroupPanel
setEnables(enables) (defined in GroupPanel) | GroupPanel
setModule(tag, module) (defined in GroupPanel) | GroupPanel
setStatus(statusmap) (defined in GroupPanel) | GroupPanel

Generated on Fri Jul 21 13:27:47 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

PowerPanelImpl Member List

This is the complete list of members for PowerPanelImpl, including all inherited members.

__init__(rc, common, parent=None, name=None, fl=0) (defined in PowerPanelImpl) | PowerPanelImpl
activate() (defined in PowerPanelImpl) | PowerPanelImpl
applyPermissions(operator) (defined in PowerPanelImpl) | PowerPanelImpl
deSelectAllACD() (defined in PowerPanelImpl) | PowerPanelImpl
deSelectAllCAL() (defined in PowerPanelImpl) | PowerPanelImpl
deSelectAllTKR() (defined in PowerPanelImpl) | PowerPanelImpl
disableAllCheck(preserveExisting=0) (defined in PowerPanelImpl) | PowerPanelImpl
getACDPowerUps() (defined in PowerPanelImpl) | PowerPanelImpl
getTEMPowerUps() (defined in PowerPanelImpl) | PowerPanelImpl
initCheckPower() (defined in PowerPanelImpl) | PowerPanelImpl
powerDown() (defined in PowerPanelImpl) | PowerPanelImpl
powerUp() (defined in PowerPanelImpl) | PowerPanelImpl
refreshLEDs(acdPowerCheck, calPowerCheck, tkrPowerCheck) (defined in PowerPanelImpl) | PowerPanelImpl
refreshPowerStatus() (defined in PowerPanelImpl) | PowerPanelImpl
selectAllACD() (defined in PowerPanelImpl) | PowerPanelImpl
selectAllCAL() (defined in PowerPanelImpl) | PowerPanelImpl
selectAllTKR() (defined in PowerPanelImpl) | PowerPanelImpl
selectBothCALTKR(state) (defined in PowerPanelImpl) | PowerPanelImpl
selectCAL(id) (defined in PowerPanelImpl) | PowerPanelImpl
selectTKR(id) (defined in PowerPanelImpl) | PowerPanelImpl
setEnablePowerDownButton(enable) (defined in PowerPanelImpl) | PowerPanelImpl
setEnablePowerUpButton(enable) (defined in PowerPanelImpl) | PowerPanelImpl

Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

radiomask Member List

This is the complete list of members for radiomask, including all inherited members.

__init__(parent=None, name=None, fl=0) (defined in radiomask) | radiomask
click(id) (defined in radiomask) | radiomask
getMask() (defined in radiomask) | radiomask
resizeEvent(rev) (defined in radiomask) | radiomask
setLabel(i, text) (defined in radiomask) | radiomask
setTitle(text) (defined in radiomask) | radiomask
setup(nbox) (defined in radiomask) | radiomask
updateMask(i) (defined in radiomask) | radiomask

Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcArchiver Member List

This is the complete list of members for rcArchiver, including all inherited members.

__init__(filePath=None, fileName=None, mode=MODE_CREATE, userId=123) (defined in rcArchiver) | rcArchiver |
close() (defined in rcArchiver) | rcArchiver |
getFileName() (defined in rcArchiver) | rcArchiver |
getFileNameFromTS(ts) (defined in rcArchiver) | rcArchiver | [static]
getFilePath() (defined in rcArchiver) | rcArchiver |
isClosed() (defined in rcArchiver) | rcArchiver |
read() (defined in rcArchiver) | rcArchiver |
write(rawEventData) (defined in rcArchiver) | rcArchiver |
writeTuple(tuple) (defined in rcArchiver) | rcArchiver |

Generated on Fri Jul 21 13:27:48 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

CommentEntryWidget Member List

This is the complete list of members for CommentEntryWidget, including all inherited members.

clearDisplay() (defined in CommentEntryWidget) | CommentEntryWidget
clearHistory() (defined in CommentEntryWidget) | CommentEntryWidget
contentsContextMenuEvent(ev) | CommentEntryWidget
enterComment(comment, addToHistory=0, source='system') | CommentEntryWidget
flush() | CommentEntryWidget
flushComment() (defined in CommentEntryWidget) | CommentEntryWidget
focusNextPrevChild(next) | CommentEntryWidget
getHistory() (defined in CommentEntryWidget) | CommentEntryWidget
getPrompt() (defined in CommentEntryWidget) | CommentEntryWidget
getTimestamps() (defined in CommentEntryWidget) | CommentEntryWidget
handleClicked(para, pos) | CommentEntryWidget
insertText(text, offsetY=0, absX=0, overwrite=0) | CommentEntryWidget
isatty() | CommentEntryWidget
keyPressEvent(e) | CommentEntryWidget
readline() | CommentEntryWidget
setPrompt(prompt) (defined in CommentEntryWidget) | CommentEntryWidget
write(text) | CommentEntryWidget
writelines(text) | CommentEntryWidget

Generated on Fri Jul 21 13:27:49 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcCommentPanel Member List

This is the complete list of members for rcCommentPanel, including all inherited members.

getWidget() (defined in rcCommentPanel) | rcCommentPanel
languageChange() (defined in rcCommentPanel) | rcCommentPanel

Generated on Fri Jul 21 13:27:49 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcCompletionStatus Member List

This is the complete list of members for rcCompletionStatus, including all inherited members.

addCompletionStatus(status, statusStr) | rcCompletionStatus |
getAll() (defined in rcCompletionStatus) | rcCompletionStatus |
getCompletionStatus(statStr) | rcCompletionStatus | [static]
getCompletionStatusStr(status) | rcCompletionStatus |
isCompletionStatus(status) | rcCompletionStatus |

Generated on Fri Jul 21 13:27:49 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcGEMDefaultTrigger Member List

This is the complete list of members for rcGEMDefaultTrigger, including all inherited members.

__init__() | rcGEMDefaultTrigger
__setattr__(name, value) | TrgObject
cmdCounters() | TrgGem
cnoCounters() | TrgGem
cnoEnableRegister() | TrgGemRegisters
coincidences() | rcGEMDefaultTrigger
commit(gem=None) | rcTrgGem
conditions() | rcGEMDefaultTrigger
configurationRegister() | TrgGemRegisters
disable() | rcTrgGem
enable(mask=None) | rcTrgGem
TrgGemRegisters::TrgGemRegisters::enable() | TrgAbstract
engines() | rcGEMDefaultTrigger
eventCounter() | TrgGem
eventDataParityEven() | TrgGemRegisters
eventHeaderParityEven() | TrgGemRegisters
externalEnableRegister() | TrgGemRegisters
GEM(glt=None) | TrgGem
getDisableTime() | rcTrgGem
getEnableTime() | rcTrgGem
getTimeStamp() | rcTrgGem
inhibitContribution() | TrgGemRegisters
inputEnables() | rcGEMDefaultTrigger
lookupTableRegister(registerNumber) | TrgGemRegisters
maxConditions() | TrgGemAbstract
maxEngines() | TrgGemAbstract
periodicCondition() | TrgUsingTiles
periodicLimitRegister() | TrgGemRegisters
periodicModeRegister() | TrgGemRegisters
periodicRateRegister() | TrgGemRegisters
ppsTimer() | TrgGem
redundantPPS() | TrgGemAbstract
responseDataParityEven() | TrgGemRegisters
responseHeaderParityEven() | TrgGemRegisters
roi() | TrgUsingTiles
roiRegister(registerNumber) | TrgGemRegisters
sequence() | TrgUsingTiles
sequenceRegister() | TrgGemRegisters
shut(sweepEvent=None, progress=None) | rcGEMDefaultTrigger
TrgGem::TrgGem::shut(marker) | TrgGem
solicit() | TrgGem
sweepOnShut() | rcGEMDefaultTrigger
templateRegister(registerNumber) | TrgGemRegisters
tileCounters() | TrgGem
tileEnableRegister(registerNumber) | TrgGemRegisters
towerBusyEnableRegister() | TrgGemRegisters
towerEnableRegister(registerNumber) | TrgGemRegisters
triggerCounters() | TrgGem
triggerParityEven() | TrgGemRegisters
useAcdAsTrigger() | rcGEMDefaultTrigger
version() | TrgGem
waitForMaskEnable(tmo=None) | rcTrgGem
width() | TrgGemRegisters
widthRegister() | TrgGemRegisters

Generated on Fri Jul 21 13:27:49 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcGEMTrgEngines Member List

This is the complete list of members for rcGEMTrgEngines, including all inherited members.

__init__() | rcGEMTrgEngines
__setattr__(name, value) | TrgObject
engine(engineNumber) | rcTrgEngines
replaceEngine(engineNumber, engine) | rcTrgEngines

Generated on Fri Jul 21 13:27:50 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcMiniGLTDefaultTrigger Member List

This is the complete list of members for rcMiniGLTDefaultTrigger, including all inherited members.

__init__() | rcMiniGLTDefaultTrigger
__setattr__(name, value) | TrgObject
calStrobe() | TrgMiniGLTRegisters
commit() | rcTrgMiniGLT
conditions() | rcMiniGLTDefaultTrigger
destination() | TrgMiniGLTRegisters
disable() | rcTrgMiniGLT
enable(newMask=None) | rcTrgMiniGLT
enable(mask=None) (defined in TrgMiniGLT) | TrgMiniGLT
TrgMiniGLTRegisters::TrgMiniGLTRegisters::enable() | TrgAbstract
engines() | rcMiniGLTDefaultTrigger
eventNumber() | TrgMiniGLTRegisters
fourRangeReadout() | TrgMiniGLTRegisters
getDisableTime() | rcTrgMiniGLT
getEnableTime() | rcTrgMiniGLT
getTimeStamp() | rcTrgMiniGLT
GLT(glt=None) | TrgMiniGLT
inputEnables() | TrgAbstract
marker() | TrgMiniGLTRegisters
maxConditions() | TrgAbstract
maxEngines() | TrgAbstract
parity() | TrgMiniGLTRegisters
sequence() | TrgAbstract
shut(sweepEvent=None, progress=None) | rcMiniGLTDefaultTrigger
TrgMiniGLT::TrgMiniGLT::shut(marker) | TrgMiniGLT
solicit() | TrgMiniGLT
sweepOnShut() | rcMiniGLTDefaultTrigger
tack() | TrgMiniGLTRegisters
tag() | TrgMiniGLTRegisters
version() | TrgAbstract
waitForMaskEnable(tmo=None) | rcTrgMiniGLT
zeroSuppress() | TrgMiniGLTRegisters

Generated on Fri Jul 21 13:27:50 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcMiniGLTSolicitedCondition Member List

This is the complete list of members for rcMiniGLTSolicitedCondition, including all inherited members.

__init__() | rcMiniGLTSolicitedCondition
__setattr__(name, value) | TrgObject
calHigh() | TrgConditionsValue
calLow() | TrgConditionsValue
cno() | TrgConditionsValue
external() | MiniGLTTrgConditionsValue
periodic() | TrgConditionsValue
roi() | TrgConditionsValue
solicited() | rcMiniGLTSolicitedCondition
tkr() | TrgConditionsValue
value() | MiniGLTTrgConditionsValue

Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcMiniGLTSolicitedEngine Member List

This is the complete list of members for rcMiniGLTSolicitedEngine, including all inherited members.

__init__() | rcMiniGLTSolicitedEngine
__setattr__(name, value) | TrgObject
participate(conditionsValue) | rcMiniGLTSolicitedEngine
prescale() | rcMiniGLTSolicitedEngine
request() | rcMiniGLTSolicitedEngine

Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcMiniGLTTrgEngines Member List

This is the complete list of members for rcMiniGLTTrgEngines, including all inherited members.

__init__() | rcTrgEngines
__setattr__(name, value) | TrgObject
engine(engineNumber) | rcTrgEngines
replaceEngine(engineNumber, engine) | rcTrgEngines

Generated on Fri Jul 21 13:27:51 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcSolicitedCondition Member List

This is the complete list of members for rcSolicitedCondition, including all inherited members.

__init__() | rcSolicitedCondition
__setattr__(name, value) | TrgObject
calHigh() | TrgConditionsValue
calLow() | TrgConditionsValue
cno() | TrgConditionsValue
external() | TrgConditionsValue
periodic() | TrgConditionsValue
roi() | TrgConditionsValue
solicited() | rcSolicitedCondition
tkr() | TrgConditionsValue
value() | TrgConditionsValue

Generated on Fri Jul 21 13:27:51 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcSolicitedEngine Member List

This is the complete list of members for rcSolicitedEngine, including all inherited members.

__init__() | rcSolicitedEngine
__setattr__(name, value) | TrgObject
participate(conditionsValue) | rcSolicitedEngine
prescale() | rcSolicitedEngine
request() | rcSolicitedEngine

Generated on Fri Jul 21 13:27:51 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcEndRunDlgImpl Member List

This is the complete list of members for rcEndRunDlgImpl, including all inherited members.

__init__(parent=None, name=None, fl=0) (defined in rcEndRunDlgImpl) | rcEndRunDlgImpl
cancel() (defined in rcEndRunDlgImpl) | rcEndRunDlgImpl
clearHistory() (defined in rcEndRunDlgImpl) | rcEndRunDlgImpl
complStatusChanged(complStatusStr) (defined in rcEndRunDlgImpl) | rcEndRunDlgImpl
enterComment(comment, addToHistory=0, source='system') (defined in rcEndRunDlgImpl) | rcEndRunDlgImpl
getCompletionStatusStr() (defined in rcEndRunDlgImpl) | rcEndRunDlgImpl
getNewCompletionStatus(curComplStatusStr) (defined in rcEndRunDlgImpl) | rcEndRunDlgImpl
initialize(secMan, loginId) (defined in rcEndRunDlgImpl) | rcEndRunDlgImpl
ok() (defined in rcEndRunDlgImpl) | rcEndRunDlgImpl

Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcFitsWriter Member List

This is the complete list of members for rcFitsWriter, including all inherited members.

__init__(filePath=None, fileName=None, mode=MODE_CREATE, format=FORMAT_WORD, tableSize=1000, compress=0, flushInterval=0, reportGen=None) (defined in rcFitsWriter) | rcFitsWriter
bcLong2Int(datum) (defined in rcFitsWriter) | rcFitsWriter
close(inShutdown=0) (defined in rcFitsWriter) | rcFitsWriter
createNewTable(datagram_id=None, version_info=None) (defined in rcFitsWriter) | rcFitsWriter
getFileName() (defined in rcFitsWriter) | rcFitsWriter
getFilePath() (defined in rcFitsWriter) | rcFitsWriter
getHeaders() | rcFitsWriter
getStatus() (defined in rcFitsWriter) | rcFitsWriter
moveToHDU(tablenum) (defined in rcFitsWriter) | rcFitsWriter
processTable() (defined in rcFitsWriter) | rcFitsWriter
read() (defined in rcFitsWriter) | rcFitsWriter
setFlushInterval(flushInterval) (defined in rcFitsWriter) | rcFitsWriter
updateRunReportFields() (defined in rcFitsWriter) | rcFitsWriter
write(rawEventData) (defined in rcFitsWriter) | rcFitsWriter

Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcHouseKeeping Member List

This is the complete list of members for rcHouseKeeping, including all inherited members.

addEnvRegs(regList, componentId=None) (defined in rcHouseKeeping) | rcHouseKeeping
checkStatus(cfitsio_function, status) (defined in rcHouseKeeping) | rcHouseKeeping
close() (defined in rcHouseKeeping) | rcHouseKeeping
createNewTable() (defined in rcHouseKeeping) | rcHouseKeeping
getCachedValue(reg, bypass=1, strVal=0) (defined in rcHouseKeeping) | rcHouseKeeping
getCachedValues() (defined in rcHouseKeeping) | rcHouseKeeping
getEnvNames() (defined in rcHouseKeeping) | rcHouseKeeping
getEnvQuantities(regList, bypass=0) (defined in rcHouseKeeping) | rcHouseKeeping
getFileName(full=0) (defined in rcHouseKeeping) | rcHouseKeeping
getRegLabel(reg) (defined in rcHouseKeeping) | rcHouseKeeping
getSampleCount() (defined in rcHouseKeeping) | rcHouseKeeping
getStatus() (defined in rcHouseKeeping) | rcHouseKeeping
initialize(filePath=None, fileName=None, compress=0) (defined in rcHouseKeeping) | rcHouseKeeping
moveToHDU(tablenum) (defined in rcHouseKeeping) | rcHouseKeeping
pause() (defined in rcHouseKeeping) | rcHouseKeeping
read() (defined in rcHouseKeeping) | rcHouseKeeping
resume() (defined in rcHouseKeeping) | rcHouseKeeping
run() (defined in rcHouseKeeping) | rcHouseKeeping
setEnvRegs(regList, componentId=None) (defined in rcHouseKeeping) | rcHouseKeeping
setFlushInterval(flushInterval) (defined in rcHouseKeeping) | rcHouseKeeping
setUpdateInterval(updateInterval) (defined in rcHouseKeeping) | rcHouseKeeping
start() (defined in rcHouseKeeping) | rcHouseKeeping
stop() (defined in rcHouseKeeping) | rcHouseKeeping
updateValues() (defined in rcHouseKeeping) | rcHouseKeeping
write() (defined in rcHouseKeeping) | rcHouseKeeping

Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcParamVerifier Member List

This is the complete list of members for rcParamVerifier, including all inherited members.

add(parName, parValue) | rcParamVerifier
getParameters(parName=None) | rcParamVerifier
initialize(testName) (defined in rcParamVerifier) | rcParamVerifier
verify() (defined in rcParamVerifier) | rcParamVerifier

Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcParamVerifyGUIImpl Member List

This is the complete list of members for rcParamVerifyGUIImpl, including all inherited members.

__init__(args) | rcParamVerifyGUIImpl
__init__(args) | rcParamVerifyGUIImpl
__init__(common, parent=None, name=None, fl=0) | rcParamVerifyGUIImpl
addParameter(name, value) | rcParamVerifyGUIImpl
alignment() | rcParamVerifyGUIImpl
allParametersChecked() | rcParamVerifyGUIImpl
cancel() | rcParamVerifyGUIImpl
clearAllRows() | rcParamVerifyGUIImpl
confirm() | rcParamVerifyGUIImpl
createEditor() | rcParamVerifyGUIImpl
doValueChanged() | rcParamVerifyGUIImpl
initialize(testName) | rcParamVerifyGUIImpl
isChecked() | rcParamVerifyGUIImpl
paint(p, cg, rect, selected) | rcParamVerifyGUIImpl
parameterClicked(row, col) | rcParamVerifyGUIImpl
rtti() | rcParamVerifyGUIImpl
setBold(bold) | rcParamVerifyGUIImpl
setContentFromEditor(w) | rcParamVerifyGUIImpl

Generated on Fri Jul 21 13:27:52 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcPreferencesGUIImpl Member List

This is the complete list of members for rcPreferencesGUIImpl, including all inherited members.

addChangePassword() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
appBrowser() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
applyPermissions(operator) (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
cancel() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
checkModifyUserPermission(userId) (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
choosePath(lineEdit, caption) (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
dataBrowser() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
default() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
deleteUser() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
exportBrowser() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
fitsBrowser() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
handleServerText() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
listUsersDblClick(item) (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
loadAndExit() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
loadConfig() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
logBrowser() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
repBrowser() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
reposBrowser() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
runIdBrowser() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
sanityCheck(prefs) (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
saveUser() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
screenToPrefs() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
selectFont() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
selectStyle(style) (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
setupCombo(combo, group, last) (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
showUser(user) (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
snapshotBrowser() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
updateUserIDText() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl
writeConfig() (defined in rcPreferencesGUIImpl) | rcPreferencesGUIImpl

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Preferences Member List

This is the complete list of members for Preferences, including all inherited members.

__getitem__(item) (defined in Preferences) | Preferences
__init__() (defined in Preferences) | Preferences
__setitem__(item, value) (defined in Preferences) | Preferences
composePath(path) (defined in Preferences) | Preferences
expandVars(path) (defined in Preferences) | Preferences
getLastItem(item) (defined in Preferences) | Preferences
isDir(item) (defined in Preferences) | Preferences
isLastItem(item) (defined in Preferences) | Preferences
isNumber(item) (defined in Preferences) | Preferences

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcPreferencesManager Member List

This is the complete list of members for rcPreferencesManager, including all inherited members.

defPrefs() (defined in rcPreferencesManager) | rcPreferencesManager
getConfigFile() (defined in rcPreferencesManager) | rcPreferencesManager
isnumeric(str) (defined in rcPreferencesManager) | rcPreferencesManager
loadConfig() (defined in rcPreferencesManager) | rcPreferencesManager
loadDefaults(currentDir) (defined in rcPreferencesManager) | rcPreferencesManager
parserToPrefs(confParser, prefs={}) (defined in rcPreferencesManager) | rcPreferencesManager
preferences() (defined in rcPreferencesManager) | rcPreferencesManager
prefsToParser() (defined in rcPreferencesManager) | rcPreferencesManager
processLastItem(option, item, confParser) (defined in rcPreferencesManager) | rcPreferencesManager
refreshPrefs(newPrefs) (defined in rcPreferencesManager) | rcPreferencesManager
setInstrumentType(instrumentType) (defined in rcPreferencesManager) | rcPreferencesManager
setOperator(operator) (defined in rcPreferencesManager) | rcPreferencesManager
setOrientation(orientation) (defined in rcPreferencesManager) | rcPreferencesManager
setParticleType(particleType) (defined in rcPreferencesManager) | rcPreferencesManager
setPhase(phase) (defined in rcPreferencesManager) | rcPreferencesManager
setPref(keyword, value) (defined in rcPreferencesManager) | rcPreferencesManager
setSite(site) (defined in rcPreferencesManager) | rcPreferencesManager
userId() (defined in rcPreferencesManager) | rcPreferencesManager
writeConfig() (defined in rcPreferencesManager) | rcPreferencesManager

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

PythonShellWidget Member List

This is the complete list of members for PythonShellWidget, including all inherited members.

contentsContextMenuEvent(ev) | PythonShellWidget
fakeUser(lines) | PythonShellWidget
flush() | PythonShellWidget
focusNextPrevChild(next) | PythonShellWidget
handleClicked(para, pos) | PythonShellWidget
isatty() | PythonShellWidget
keyPressEvent(e) | PythonShellWidget
readline() | PythonShellWidget
redirectIO() (defined in PythonShellWidget) | PythonShellWidget
restoreIO() (defined in PythonShellWidget) | PythonShellWidget
write(text) | PythonShellWidget
writelines(text) | PythonShellWidget

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcPythonShell Member List

This is the complete list of members for rcPythonShell, including all inherited members.

getParent() (defined in rcPythonShell) | rcPythonShell
getWidget() (defined in rcPythonShell) | rcPythonShell
languageChange() (defined in rcPythonShell) | rcPythonShell

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcReportGen Member List

This is the complete list of members for rcReportGen, including all inherited members.

addField(field, data, units=UNITS_STRING) (defined in rcReportGen) | rcReportGen
addShift(tstamp) (defined in rcReportGen) | rcReportGen
connectDB(dbname) (defined in rcReportGen) | rcReportGen
convertTimeTuple(timeTuple) (defined in rcReportGen) | rcReportGen
disconnectDB() (defined in rcReportGen) | rcReportGen
getReportData() (defined in rcReportGen) | rcReportGen
getReportFields() (defined in rcReportGen) | rcReportGen
getReportUnits() (defined in rcReportGen) | rcReportGen
getShiftInfo(t) (defined in rcReportGen) | rcReportGen
getTimestamp() (defined in rcReportGen) | rcReportGen
initialize(tstamp=None) (defined in rcReportGen) | rcReportGen
obtainCursor(table, filter) (defined in rcReportGen) | rcReportGen
obtainGMTime(dateTime) (defined in rcReportGen) | rcReportGen
obtainLocalTime(dateTime) (defined in rcReportGen) | rcReportGen
readReportXML() (defined in rcReportGen) | rcReportGen
writeReportCSV() (defined in rcReportGen) | rcReportGen
writeReportSQL() (defined in rcReportGen) | rcReportGen
writeReportXML() (defined in rcReportGen) | rcReportGen

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcRunIdHelper Member List

This is the complete list of members for rcRunIdHelper, including all inherited members.

__init__(prefs) (defined in rcRunIdHelper) | rcRunIdHelper
currentRunId() (defined in rcRunIdHelper) | rcRunIdHelper
nextRunId() (defined in rcRunIdHelper) | rcRunIdHelper

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcScmCfgSelector Member List

This is the complete list of members for rcScmCfgSelector, including all inherited members.

__init__(startwithDir, startwithFile, parent=None, name=None, fl=0) (defined in rcScmCfgSelector) | rcScmCfgSelector
getValue() (defined in rcScmCfgSelector) | rcScmCfgSelector

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcScmCfgSelText Member List

This is the complete list of members for rcScmCfgSelText, including all inherited members.

__init__(startwith) (defined in rcScmCfgSelText) | rcScmCfgSelText
getValue() (defined in rcScmCfgSelText) | rcScmCfgSelText

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcSecurityMan Member List

This is the complete list of members for rcSecurityMan, including all inherited members.

__init__(secureDir, users) (defined in rcSecurityMan) | rcSecurityMan
addPassword(loginId, password, userName) | rcSecurityMan
authenticateUser(loginId, password) | rcSecurityMan
changePassword(loginId, password, userName, oldPassword="") | rcSecurityMan
checkPassword(loginId) | rcSecurityMan
checkPermission(user, permission) | rcSecurityMan
deleteUser(loginId) | rcSecurityMan
getPermissionDescription(permission) | rcSecurityMan
getPermissions(role=None) | rcSecurityMan
getRoles() | rcSecurityMan
readPermissions() | rcSecurityMan
registerPermission(role, permission, permDesc) | rcSecurityMan
roleHasPermission(role, permission) | rcSecurityMan

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ListViewToolTip Member List

This is the complete list of members for ListViewToolTip, including all inherited members.

maybeTip(pos) (defined in ListViewToolTip) ListViewToolTip

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcStatusMonitor Member List

This is the complete list of members for rcStatusMonitor, including all inherited members.

addWatchItem(label, accessor, key=None, alarmExpr=None, offBoard=False) (defined in rcStatusMonitor) | rcStatusMonitor
startWatch() (defined in rcStatusMonitor) | rcStatusMonitor
stopWatch() (defined in rcStatusMonitor) | rcStatusMonitor
updateWatchItems() (defined in rcStatusMonitor) | rcStatusMonitor

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcStatusPanel Member List

This is the complete list of members for rcStatusPanel, including all inherited members.

contextMenuShow(item, point, column) (defined in rcStatusPanel) | rcStatusPanel
copyToClipboard() (defined in rcStatusPanel) | rcStatusPanel

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

StatusItem Member List

This is the complete list of members for StatusItem, including all inherited members.

paintCell(p, cg, column, width, align) (defined in StatusItem) | StatusItem
setAlarmExpr(alarmExpr) (defined in StatusItem) | StatusItem
setText(column, value) (defined in StatusItem) | StatusItem

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

WatchItem Member List

This is the complete list of members for WatchItem, including all inherited members.

evaluate() (defined in WatchItem) | WatchItem
getAlarmExpr() (defined in WatchItem) | WatchItem
getLabel() (defined in WatchItem) | WatchItem
getStatusItem() (defined in WatchItem) | WatchItem
isInView() (defined in WatchItem) | WatchItem
isOffBoard() (defined in WatchItem) | WatchItem
setAccessor(accessor, key) (defined in WatchItem) | WatchItem
setInView() (defined in WatchItem) | WatchItem
setStatusItem(si) (defined in WatchItem) | WatchItem

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcSuite Member List

This is the complete list of members for rcSuite, including all inherited members.

__init__(msg, suite, module) (defined in rcSuite) | rcSuite
__init__(logLevel="INFO") (defined in rcSuite) | rcSuite
__init__(gui, userId, debug) (defined in rcSuite) | rcSuite
afterSetupSuite(suite) (defined in rcSuite) | rcSuite
afterStartSuite(suite) (defined in rcSuite) | rcSuite
afterStopSuite(suite) (defined in rcSuite) | rcSuite
applyConfig(seq=None, gxbrd=None) (defined in rcSuite) | rcSuite
beforeSetupSuite(suite) (defined in rcSuite) | rcSuite
beforeStartSuite(suite) (defined in rcSuite) | rcSuite
beforeStopSuite(suite) (defined in rcSuite) | rcSuite
clearStopRequested() (defined in rcSuite) | rcSuite
common() (defined in rcSuite) | rcSuite
doStopRun() (defined in rcSuite) | rcSuite
getApp() | rcSuite
getAppState() | rcSuite
getEvtCli() (defined in rcSuite) | rcSuite
getName() (defined in rcSuite) | rcSuite
getScriptSequence() (defined in rcSuite) | rcSuite
getScriptState() | rcSuite
getSessionVar(key) | rcSuite
getSuite() | rcSuite
getSuiteInstance() | rcSuite
isPaused() (defined in rcSuite) | rcSuite
isRunning() (defined in rcSuite) | rcSuite
isSuiteScriptAborted() (defined in rcSuite) | rcSuite
launch(suiteClass, user, callbacks=None) (defined in rcSuite) | rcSuite
pauseSuite() | rcSuite
preferences() (defined in rcSuite) | rcSuite
rcPauseSuite() (defined in rcSuite) | rcSuite
rcSetupSuite() | rcSuite
rcStartSuite(spawn=1) (defined in rcSuite) | rcSuite
rcStopSuite() (defined in rcSuite) | rcSuite
readSchema(scmCfgFile) (defined in rcSuite) | rcSuite
resetSuiteScript() (defined in rcSuite) | rcSuite
scriptRun(module, context={}) (defined in rcSuite) | rcSuite
setCmdCli(cmdCli) (defined in rcSuite) | rcSuite
setEvtCli(evtCli) (defined in rcSuite) | rcSuite
setSessionVar(key, value) | rcSuite
setSuite(name) | rcSuite
setSuiteInstance(suiteInst) | rcSuite
setupSuite() | rcSuite
startSuite() (defined in rcSuite) | rcSuite
stopRequested() (defined in rcSuite) | rcSuite
stopSuite() | rcSuite

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcTestReport Member List

This is the complete list of members for rcTestReport, including all inherited members.

__init__() (defined in rcTestReport) | rcTestReport
addHeading(text) | rcTestReport
addHTML(htmlString, section=None) | rcTestReport
addSection(caption, insert=1) | rcTestReport
addSectionImage(sectionId, caption, url, width='', height='') | rcTestReport
addSectionItem(sectionId, label, text, url='') | rcTestReport
addSectionTable(sectionId, border='1', width='') | rcTestReport
addTableData(text, url='', align='', width='') | rcTestReport
addTableHeader(tableId, text, align='') | rcTestReport
beginTableRow(tableId) | rcTestReport
findTag(node, tagName) (defined in rcTestReport) | rcTestReport
getChildNodes(node) (defined in rcTestReport) | rcTestReport
getReports() (defined in rcTestReport) | rcTestReport
initReport(title) | rcTestReport
insertSection(sectionId, beforeSectionId=None) | rcTestReport
transformToFile(xslFileName, htmlFileName) | rcTestReport
xmlToString() (defined in rcTestReport) | rcTestReport

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcTransitions Member List

This is the complete list of members for rcTransitions, including all inherited members.

__init__(rc, userId, debug) (defined in rcTransitions) | rcTransitions
addCustomReportData(key, value) | rcTransitions
addExportedFile(file=None, delete=False) | rcTransitions
adjustExcludeTime(dExcludeTime) | rcTransitions
applyConfig(seq=None, gxbrd=None) | rcTransitions
endExcludeTime() | rcTransitions
getAddlInputFiles() | rcTransitions
getArchiveFile() | rcTransitions
getArchiverInstance() | rcTransitions
getAvgDatagramSize() | rcTransitions
getAvgDeadTime(temId=None) | rcTransitions
getBadEvents() | rcTransitions
getBadEventsFile() | rcTransitions
getCompletionStatus() | rcTransitions
getCompletionStatusStr() | rcTransitions
getDataDistributor() | rcTransitions
getDiscardedEvents() | rcTransitions
getElapsedTime() | rcTransitions
getEndTime() | rcTransitions
getErrorEvents() | rcTransitions
getErrorEventsFile() | rcTransitions
getEventCount() | rcTransitions
getEventRate() | rcTransitions
getEvtCli() | rcTransitions
getFailedEvents() | rcTransitions
getFailedEventSends() | rcTransitions
getFileTimeStamp() | rcTransitions
getFITSfile() | rcTransitions
getGemDeadTime() | rcTransitions
getHSK() | rcTransitions
getHSKfile() | rcTransitions
getInstByteRate() | rcTransitions
getInstDatagramSize() | rcTransitions
getInstEventRate() | rcTransitions
getInstSBCEventRate() | rcTransitions
getLengthMismatchedEvents() | rcTransitions
getName() (defined in rcTransitions) | rcTransitions
getPacketErrorEvents() | rcTransitions
getParameterVerifier() | rcTransitions
getPauseCount() | rcTransitions
getPausedTime() | rcTransitions
getRawTimeStamp() | rcTransitions
getRunId() | rcTransitions
getRunMsgLogFile() | rcTransitions
getSBCEventRate() | rcTransitions
getSBCHandledEvents() | rcTransitions
getSchemaConfigFile() | rcTransitions
getSessionVar(key) | rcTransitions
getSnapshotStatus(snapId=None) | rcTransitions
getStartTime() | rcTransitions
getState() | rcTransitions
getSuite() | rcTransitions
getSuiteInstance() | rcTransitions
getTrgParityErrorEvents() | rcTransitions
getUnsentEvents() | rcTransitions
getValidEvents() | rcTransitions
isLastSuiteScript() | rcTransitions
isRunFromSuite() | rcTransitions
pause() | rcTransitions
process(eventBuffer) | rcTransitions
rcPause() (defined in rcTransitions) | rcTransitions
rcResume() (defined in rcTransitions) | rcTransitions
rcSetup() | rcTransitions
rcStartRun() (defined in rcTransitions) | rcTransitions
rcStop() (defined in rcTransitions) | rcTransitions
rcStopRun() (defined in rcTransitions) | rcTransitions
rcTeardown() (defined in rcTransitions) | rcTransitions
readConfig(cfgFileName) | rcTransitions
resume() | rcTransitions
setArchiverClass(archiverClass) | rcTransitions
setCmdCli(cmdCli) | rcTransitions
setCompletionStatus(completionStatus, completionStatusStr=None) | rcTransitions
setEvtCli(evtCli) | rcTransitions
setLastSuiteScript() | rcTransitions
setPrefs(prefs) | rcTransitions
setSessionVar(key, value) | rcTransitions
setSuite(suite) | rcTransitions
setSuiteInstance(suiteInst) | rcTransitions
setup() | rcTransitions
startExcludeTime() | rcTransitions
startRun() | rcTransitions
stop() | rcTransitions
stopRun() | rcTransitions
takeSnapshot(stream=sys.stdout, fileName=None, captureGTIC=1, captureGAEQ=1, trigger=None, configName='', configVersion='') | rcTransitions
teardown() | rcTransitions
trigger(trg=None, replaceShut=True) | rcTransitions

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcTransitionsBT Member List

This is the complete list of members for rcTransitionsBT, including all inherited members.

autoStopRun(value=None) (defined in rcTransitionsBT) | rcTransitionsBT
eventHandler() (defined in rcTransitionsBT) | rcTransitionsBT
rcSetup() (defined in rcTransitionsBT) | rcTransitionsBT
rcTeardown() (defined in rcTransitionsBT) | rcTransitionsBT

Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcTrgCoincidence Member List

This is the complete list of members for rcTrgCoincidence, including all inherited members.

__init__() | rcTrgCoincidence
__setattr__(name, value) | TrgObject
addPair(tile1, tile2) | rcTrgCoincidence
inCoincidence(tileNumber) | rcTrgCoincidence

Generated on Fri Jul 21 13:27:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcTrgEngines Member List

This is the complete list of members for rcTrgEngines, including all inherited members.

__init__() | rcTrgEngines
__setattr__(name, value) | TrgObject
engine(engineNumber) | rcTrgEngines
replaceEngine(engineNumber, engine) | rcTrgEngines

Generated on Fri Jul 21 13:27:54 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcTrgInjectMarker Member List

This is the complete list of members for rcTrgInjectMarker, including all inherited members.

__init__(marker) | TrgInjectMarker
TrgEngines::TrgEngineRequest::__init__() | TrgEngineRequest
__setattr__(name, value) | TrgObject
destination() | TrgEngineRequest
fourRange() | TrgEngineRequest
marker() | TrgInjectMarker
TrgEngines::TrgEngineRequest::marker(markerValue=0) | TrgEngineRequest
sequence() | rcTrgInjectMarker
zeroSuppress() | rcTrgInjectMarker

Generated on Fri Jul 21 13:27:55 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcTrgTileEnables Member List

This is the complete list of members for rcTrgTileEnables, including all inherited members.

__init__() | rcTrgTileEnables
__setattr__(name, value) | TrgObject
addTile(tileNumber, side) (defined in rcTrgTileEnables) | rcTrgTileEnables
tile(tileNumber) | rcTrgTileEnables

Generated on Fri Jul 21 13:27:55 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcTrgTowerBusyEnables Member List

This is the complete list of members for rcTrgTowerBusyEnables, including all inherited members.

__init__() | rcTrgTowerBusyEnables
__setattr__(name, value) | TrgObject
addTower(towerNumber) (defined in rcTrgTowerBusyEnables) | rcTrgTowerBusyEnables
tower(towerNumber) | rcTrgTowerBusyEnables

Generated on Fri Jul 21 13:27:56 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

SweepMarkerEngine Member List

This is the complete list of members for SweepMarkerEngine, including all inherited members.

__init__() | SweepMarkerEngine
__setattr__(name, value) | TrgObject
participate(conditionsValue) | SweepMarkerEngine
prescale() | SweepMarkerEngine
request() | SweepMarkerEngine

Generated on Fri Jul 21 13:27:55 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcTrgGem Member List

This is the complete list of members for rcTrgGem, including all inherited members.

__init__() | rcTrgGem
__setattr__(name, value) | TrgObject
cmdCounters() | TrgGem
cnoCounters() | TrgGem
cnoEnableRegister() | TrgGemRegisters
commit(gem=None) | rcTrgGem
conditions() | TrgAbstract
configurationRegister() | TrgGemRegisters
disable() | rcTrgGem
enable(mask=None) | rcTrgGem
TrgGemRegisters::TrgGemRegisters::enable() | TrgAbstract
engines() | TrgAbstract
eventCounter() | TrgGem
eventDataParityEven() | TrgGemRegisters
eventHeaderParityEven() | TrgGemRegisters
externalEnableRegister() | TrgGemRegisters
GEM(glt=None) | TrgGem
getDisableTime() | rcTrgGem
getEnableTime() | rcTrgGem
getTimeStamp() | rcTrgGem
inhibitContribution() | TrgGemRegisters
inputEnables() | TrgAbstract
lookupTableRegister(registerNumber) | TrgGemRegisters
maxConditions() | TrgGemAbstract
maxEngines() | TrgGemAbstract
periodicCondition() | TrgGemAbstract
periodicLimitRegister() | TrgGemRegisters
periodicModeRegister() | TrgGemRegisters
periodicRateRegister() | TrgGemRegisters
ppsTimer() | TrgGem
redundantPPS() | TrgGemAbstract
responseDataParityEven() | TrgGemRegisters
responseHeaderParityEven() | TrgGemRegisters
roi() | TrgGemAbstract
roiRegister(registerNumber) | TrgGemRegisters
sequence() | TrgAbstract
sequenceRegister() | TrgGemRegisters
shut(sweepEvent, progress=None) | rcTrgGem
TrgGem::TrgGem::shut(marker) | TrgGem
solicit() | TrgGem
sweepOnShut() | rcTrgGem
templateRegister(registerNumber) | TrgGemRegisters
tileCounters() | TrgGem
tileEnableRegister(registerNumber) | TrgGemRegisters
towerBusyEnableRegister() | TrgGemRegisters
towerEnableRegister(registerNumber) | TrgGemRegisters
triggerCounters() | TrgGem
triggerParityEven() | TrgGemRegisters
useAcdAsTrigger() | TrgGemAbstract
version() | TrgGem
waitForMaskEnable(tmo=None) | rcTrgGem
width() | TrgGemRegisters
widthRegister() | TrgGemRegisters

Generated on Fri Jul 21 13:27:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcTrgMiniGLT Member List

This is the complete list of members for rcTrgMiniGLT, including all inherited members.

__init__() | rcTrgMiniGLT
__setattr__(name, value) | TrgObject
calStrobe() | TrgMiniGLTRegisters
commit() | rcTrgMiniGLT
conditions() | TrgAbstract
destination() | TrgMiniGLTRegisters
disable() | rcTrgMiniGLT
enable(newMask=None) | rcTrgMiniGLT
enable(mask=None) (defined in TrgMiniGLT) | TrgMiniGLT
TrgMiniGLTRegisters::TrgMiniGLTRegisters::enable() | TrgAbstract
engines() | TrgAbstract
eventNumber() | TrgMiniGLTRegisters
fourRangeReadout() | TrgMiniGLTRegisters
getDisableTime() | rcTrgMiniGLT
getEnableTime() | rcTrgMiniGLT
getTimeStamp() | rcTrgMiniGLT
GLT(glt=None) | TrgMiniGLT
inputEnables() | TrgAbstract
marker() | TrgMiniGLTRegisters
maxConditions() | TrgAbstract
maxEngines() | TrgAbstract
parity() | TrgMiniGLTRegisters
sequence() | TrgAbstract
shut(sweepEvent, progress=None) | rcTrgMiniGLT
TrgMiniGLT::TrgMiniGLT::shut(marker) | TrgMiniGLT
solicit() | TrgMiniGLT
sweepOnShut() | rcTrgMiniGLT
tack() | TrgMiniGLTRegisters
tag() | TrgMiniGLTRegisters
version() | TrgAbstract
waitForMaskEnable(tmo=None) | rcTrgMiniGLT
zeroSuppress() | TrgMiniGLTRegisters

Generated on Fri Jul 21 13:27:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcUser Member List

This is the complete list of members for rcUser, including all inherited members.

__init__(userId, loginId, userName) (defined in rcUser) | rcUser
__str__() (defined in rcUser) | rcUser
addPermission(permission) | rcUser
addRole(role) | rcUser
getId() | rcUser
getLoginId() | rcUser
getName() | rcUser
getPermissions() | rcUser
getRoles() | rcUser
isAdministrator() | rcUser

Generated on Fri Jul 21 13:27:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcUsers Member List

This is the complete list of members for rcUsers, including all inherited members.

__init__() (defined in rcUsers) | rcUsers
addUser(user) | rcUsers
deleteUser(userId) | rcUsers
getIdNameDict() | rcUsers
getUser(userId) | rcUsers
getUserByLoginId(loginId) | rcUsers
getUserByName(name) | rcUsers
getUsers() | rcUsers

Generated on Fri Jul 21 13:27:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Reloader Member List

This is the complete list of members for Reloader, including all inherited members.

__init__() (defined in Reloader) | Reloader
clearAppModules(dontReloadList, showUnloadedModules) (defined in Reloader) | Reloader
filterModules(modules, dontReloadList) (defined in Reloader) | Reloader
getNewModules(keepem) (defined in Reloader) | Reloader

Generated on Fri Jul 21 13:27:57 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Receiver Member List

This is the complete list of members for Receiver, including all inherited members.

__init__() (defined in Receiver) | Receiver
isReceiving() (defined in Receiver) | Receiver
process(trendables) (defined in Receiver) | Receiver
receive() (defined in Receiver) | Receiver
setReceiving(bool) (defined in Receiver) | Receiver
shutdown() (defined in Receiver) | Receiver

Generated on Fri Jul 21 13:27:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

UDPReceiver Member List

This is the complete list of members for UDPReceiver, including all inherited members.

__init__() (defined in UDPReceiver) | UDPReceiver
isReceiving() (defined in Receiver) | Receiver
process(trendables) (defined in Receiver) | Receiver
receive() (defined in UDPReceiver) | UDPReceiver
setReceiving(bool) (defined in Receiver) | Receiver
setUDPClient(name, server) (defined in UDPReceiver) | UDPReceiver
shutdown() (defined in UDPReceiver) | UDPReceiver

Generated on Fri Jul 21 13:27:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

DummyRecorder Member List

This is the complete list of members for DummyRecorder, including all inherited members.

__init__() (defined in DummyRecorder) | DummyRecorder
processTrends(trendables) (defined in DummyRecorder) | DummyRecorder
shutdown() (defined in Recorder) | Recorder
updateTrends(trendables) (defined in Recorder) | Recorder

Generated on Fri Jul 21 13:27:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

FlatFileRecorder Member List

This is the complete list of members for FlatFileRecorder, including all inherited members.

__init__() (defined in Recorder) | Recorder
processTrends(trendables) (defined in Recorder) | Recorder
shutdown() (defined in FlatFileRecorder) | FlatFileRecorder
updateTrends(trendables) (defined in Recorder) | Recorder

Generated on Fri Jul 21 13:27:59 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Recorder Member List

This is the complete list of members for Recorder, including all inherited members.

__init__() (defined in Recorder) | Recorder
processTrends(trendables) (defined in Recorder) | Recorder
shutdown() (defined in Recorder) | Recorder
updateTrends(trendables) (defined in Recorder) | Recorder

Generated on Fri Jul 21 13:27:58 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

UDPRecorder Member List

This is the complete list of members for UDPRecorder, including all inherited members.

__init__() (defined in UDPRecorder) | UDPRecorder
processTrends(trendables) (defined in UDPRecorder) | UDPRecorder
shutdown() (defined in UDPRecorder) | UDPRecorder
startUDPServer(name, server) (defined in UDPRecorder) | UDPRecorder
stopUDPServer() (defined in UDPRecorder) | UDPRecorder
updateTrends(trendables) (defined in Recorder) | Recorder

Generated on Fri Jul 21 13:27:59 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

DummyRetriever Member List

This is the complete list of members for DummyRetriever, including all inherited members.

__init__() (defined in DummyRetriever) | DummyRetriever
retrievePacket() (defined in DummyRetriever) | DummyRetriever
shutdown() (defined in Retriever) | Retriever
startup() (defined in Retriever) | Retriever

Generated on Fri Jul 21 13:27:59 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Retriever Member List

This is the complete list of members for Retriever, including all inherited members.

retrievePacket() (defined in Retriever) | Retriever
shutdown() (defined in Retriever) | Retriever
startup() (defined in Retriever) | Retriever

Generated on Fri Jul 21 13:27:59 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

RunControl Member List

This is the complete list of members for RunControl, including all inherited members.

__init__(common, parent=None, name=None, fl=0) (defined in RunControl) | RunControl
clearHardwareVersionsCache() (defined in RunControl) | RunControl
common() (defined in RunControlGUIImpl) | RunControlGUIImpl
connectClicked() (defined in RunControl) | RunControl
createGUI(obj, args, kwargs) | RunControl
customEvent(e) (defined in RunControl) | RunControl
disconnected() (defined in RunControl) | RunControl
doEmit(obj, signal=SIGNAL("clicked()"), args=()) | RunControl
doPause() | RunControl
doReset() | RunControl
doRun() | RunControl
doStop() | RunControl
doStopRun() | RunControl
editCopy() (defined in RunControlGUIImpl) | RunControlGUIImpl
editCut() (defined in RunControlGUIImpl) | RunControlGUIImpl
editFind() (defined in RunControlGUIImpl) | RunControlGUIImpl
editPaste() (defined in RunControlGUIImpl) | RunControlGUIImpl
editRedo() (defined in RunControlGUIImpl) | RunControlGUIImpl
editUndo() (defined in RunControlGUIImpl) | RunControlGUIImpl
execGUImethod(func, args, kwargs) | RunControl
execGUImethodNR(func, args, kwargs) | RunControl
ExitButtonClicked() (defined in RunControl) | RunControl
fileExit() (defined in RunControl) | RunControl
fileNew() (defined in RunControlGUIImpl) | RunControlGUIImpl
fileOpen() (defined in RunControlGUIImpl) | RunControlGUIImpl
filePrint() (defined in RunControlGUIImpl) | RunControlGUIImpl
fileSave() (defined in RunControlGUIImpl) | RunControlGUIImpl
fileSaveAs() (defined in RunControlGUIImpl) | RunControlGUIImpl
getCommentWidget() (defined in RunControlGUIImpl) | RunControlGUIImpl
getFSM() (defined in RunControl) | RunControl
getHardwareVersions(lat=None) (defined in RunControl) | RunControl
helpAbout() (defined in RunControlGUIImpl) | RunControlGUIImpl
helpContents() (defined in RunControlGUIImpl) | RunControlGUIImpl
helpIndex() (defined in RunControlGUIImpl) | RunControlGUIImpl
initGUIbridges() (defined in RunControl) | RunControl
isGUIthread() (defined in RunControl) | RunControl
load() (defined in RunControl) | RunControl
loadSchema() (defined in RunControlGUIImpl) | RunControlGUIImpl
normalCursor() (defined in RunControl) | RunControl
PauseClicked() (defined in RunControl) | RunControl
preferences() (defined in RunControlGUIImpl) | RunControlGUIImpl
PreferencesActivated() (defined in RunControlGUIImpl) | RunControlGUIImpl
ResumeClicked() (defined in RunControl) | RunControl
setLAT(lat) (defined in RunControl) | RunControl
SetupClicked() (defined in RunControl) | RunControl
StartRunClicked() (defined in RunControl) | RunControl
StopClicked() (defined in RunControl) | RunControl
StopRunClicked() (defined in RunControl) | RunControl
TeardownClicked() (defined in RunControl) | RunControl
timedout() (defined in RunControl) | RunControl
userId() (defined in RunControl) | RunControl
waitCursor() (defined in RunControl) | RunControl

Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ErrorLogCounterHandler Member List

This is the complete list of members for ErrorLogCounterHandler, including all inherited members.

emit(record) (defined in ErrorLogCounterHandler) ErrorLogCounterHandler

Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GDBN Member List

This is the complete list of members for GDBN, including all inherited members.

__init__() GDBN

Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

RunControlCommon Member List

This is the complete list of members for RunControlCommon, including all inherited members.

__init__() (defined in RunControlCommon) | RunControlCommon
clearHardwareVersionsCache() (defined in RunControlCommon) | RunControlCommon
connect(force=False) (defined in RunControlCommon) | RunControlCommon
disconnect() (defined in RunControlCommon) | RunControlCommon
EBFdistribution() (defined in RunControlCommon) | RunControlCommon
elogWebsite() (defined in RunControlCommon) | RunControlCommon
getCmdCli() (defined in RunControlCommon) | RunControlCommon
getDBN() (defined in RunControlCommon) | RunControlCommon
getDDS() (defined in RunControlCommon) | RunControlCommon
getErrorLogCount() (defined in RunControlCommon) | RunControlCommon
getEvtCli() (defined in RunControlCommon) | RunControlCommon
getHardwareVersions(lat=None, xbrd=None) (defined in RunControlCommon) | RunControlCommon
getLAT() (defined in RunControlCommon) | RunControlCommon
getLoginId() | RunControlCommon
getMSGLogger() (defined in RunControlCommon) | RunControlCommon
getOCS() (defined in RunControlCommon) | RunControlCommon
getQtApp() (defined in RunControlCommon) | RunControlCommon
getSecurityMan() (defined in RunControlCommon) | RunControlCommon
getXBRD() (defined in RunControlCommon) | RunControlCommon
incrementErrorLogCount() (defined in RunControlCommon) | RunControlCommon
initialize(startup=False) (defined in RunControlCommon) | RunControlCommon
options() (defined in RunControlCommon) | RunControlCommon
prefGUI() (defined in RunControlCommon) | RunControlCommon
prefMan() (defined in RunControlCommon) | RunControlCommon
readSchema(filename) (defined in RunControlCommon) | RunControlCommon
resetErrorLogCount() (defined in RunControlCommon) | RunControlCommon
setLoggingLevel(logLevel=None) (defined in RunControlCommon) | RunControlCommon
showLogin(parent) (defined in RunControlCommon) | RunControlCommon
startLogger(startup=True) (defined in RunControlCommon) | RunControlCommon
startRunLog(fileName) (defined in RunControlCommon) | RunControlCommon
stopRunLog(fileHdlr) (defined in RunControlCommon) | RunControlCommon

Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

RunControlFileHandler Member List

This is the complete list of members for RunControlFileHandler, including all inherited members.

__init__(filename, mode) (defined in RunControlFileHandler) | RunControlFileHandler
emit(record) (defined in RunControlFileHandler) | RunControlFileHandler

Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

RunControlSocketHandler Member List

This is the complete list of members for RunControlSocketHandler, including all inherited members.

handleError(record) (defined in RunControlSocketHandler) RunControlSocketHandler

Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

RunControlFSM Member List

This is the complete list of members for RunControlFSM, including all inherited members.

__init__(initial_state, something) | FSM
add_transition(input_symbol, state, action, next_state) | FSM
add_transition_any(state, action, next_state) | FSM
add_transition_list(list_input_symbols, state, action, next_state) | FSM
error() (defined in RunControlFSM) | RunControlFSM
get_transition(input_symbol, state) | FSM
pause() (defined in RunControlFSM) | RunControlFSM
process(input_symbol) | FSM
process_list(s) | FSM
reset() | FSM
resume() (defined in RunControlFSM) | RunControlFSM
set_default_transition(action, next_state) | FSM
setup() (defined in RunControlFSM) | RunControlFSM
startRun() (defined in RunControlFSM) | RunControlFSM
stop() (defined in RunControlFSM) | RunControlFSM
stopRun() (defined in RunControlFSM) | RunControlFSM
teardown() (defined in RunControlFSM) | RunControlFSM

Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcFileSelector Member List

This is the complete list of members for rcFileSelector, including all inherited members.

getValue() (defined in rcFileSelector) rcFileSelector

Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

RunControlGUIImpl Member List

This is the complete list of members for RunControlGUIImpl, including all inherited members.

__init__(common, parent=None, name=None, fl=0) (defined in RunControlGUIImpl) | RunControlGUIImpl
common() (defined in RunControlGUIImpl) | RunControlGUIImpl
editCopy() (defined in RunControlGUIImpl) | RunControlGUIImpl
editCut() (defined in RunControlGUIImpl) | RunControlGUIImpl
editFind() (defined in RunControlGUIImpl) | RunControlGUIImpl
editPaste() (defined in RunControlGUIImpl) | RunControlGUIImpl
editRedo() (defined in RunControlGUIImpl) | RunControlGUIImpl
editUndo() (defined in RunControlGUIImpl) | RunControlGUIImpl
ExitButtonClicked() (defined in RunControlGUIImpl) | RunControlGUIImpl
fileExit() (defined in RunControlGUIImpl) | RunControlGUIImpl
fileNew() (defined in RunControlGUIImpl) | RunControlGUIImpl
fileOpen() (defined in RunControlGUIImpl) | RunControlGUIImpl
filePrint() (defined in RunControlGUIImpl) | RunControlGUIImpl
fileSave() (defined in RunControlGUIImpl) | RunControlGUIImpl
fileSaveAs() (defined in RunControlGUIImpl) | RunControlGUIImpl
getCommentWidget() (defined in RunControlGUIImpl) | RunControlGUIImpl
helpAbout() (defined in RunControlGUIImpl) | RunControlGUIImpl
helpContents() (defined in RunControlGUIImpl) | RunControlGUIImpl
helpIndex() (defined in RunControlGUIImpl) | RunControlGUIImpl
load() (defined in RunControlGUIImpl) | RunControlGUIImpl
loadSchema() (defined in RunControlGUIImpl) | RunControlGUIImpl
PauseClicked() (defined in RunControlGUIImpl) | RunControlGUIImpl
preferences() (defined in RunControlGUIImpl) | RunControlGUIImpl
PreferencesActivated() (defined in RunControlGUIImpl) | RunControlGUIImpl
ResumeClicked() (defined in RunControlGUIImpl) | RunControlGUIImpl
SetupClicked() (defined in RunControlGUIImpl) | RunControlGUIImpl
StartRunClicked() (defined in RunControlGUIImpl) | RunControlGUIImpl
StopClicked() (defined in RunControlGUIImpl) | RunControlGUIImpl
StopRunClicked() (defined in RunControlGUIImpl) | RunControlGUIImpl
TeardownClicked() (defined in RunControlGUIImpl) | RunControlGUIImpl

Generated on Fri Jul 21 13:28:00 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

RunControlMain Member List

This is the complete list of members for RunControlMain, including all inherited members.

__init__(common, parent=None, name="RunControl", fl=0) (defined in RunControlMain) | RunControlMain
__init__(listbox) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
__init__(parent, name, panel, tabPage, flags=0) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
aboutRunControl() (defined in RunControlMain) | RunControlMain
activateTab(tabPage) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
applyPermissions(operator) (defined in RunControlMain) | RunControlMain
clearHardwareVersionsCache() (defined in RunControlMain) | RunControlMain
closeEvent(e) (defined in RunControlMain) | RunControlMain
common() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
connectClicked() (defined in RunControlMain) | RunControlMain
createGUI(obj, args, kwargs) | RunControlMain
customEvent(e) | RunControlMain
disconnected() (defined in RunControlMain) | RunControlMain
doEmit(obj, signal=SIGNAL("clicked()"), args=()) | RunControlMain
doPause() | RunControlMain
doReset() | RunControlMain
doRun() | RunControlMain
doStop() | RunControlMain
doStopRun() | RunControlMain
doSuiteReset() | RunControlMain
elogWebsite() (defined in RunControlMain) | RunControlMain
execGUImethod(func, args, kwargs) | RunControlMain
execGUImethodNR(func, args, kwargs) | RunControlMain
fileExit() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
fileLogout() (defined in RunControlMain) | RunControlMain
filePrint() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
getApp() (defined in RunControlMain) | RunControlMain
getCommentWidget() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
getEndRunComments() (defined in RunControlMain) | RunControlMain
getFSM() (defined in RunControlMain) | RunControlMain
getHardwareVersions(lat=None, xbrd=None) (defined in RunControlMain) | RunControlMain
getName() (defined in RunControlMain) | RunControlMain
getOperator() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
getPythonShellWidget() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
getSchemaConfigFile() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
getSecurityMan() (defined in RunControlMain) | RunControlMain
handleComments(fromState, toState) (defined in RunControlMain) | RunControlMain
handleEndRunDlg() (defined in RunControlMain) | RunControlMain
hideComments() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
hidePythonShell() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
initApp() | RunControlMain
isConnected() | RunControlMain
isGUIthread() | RunControlMain
isPythonShellHidden() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
loadApp(applName) | RunControlMain
loadModule(module) | RunControlMain
loadSchema() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
loadScript() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
login() (defined in RunControlMain) | RunControlMain
maybeTip(pos) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
mouseDblClick(event) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
normalCursor() (defined in RunControlMain) | RunControlMain
panels() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
parameterVerifier() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
PauseClicked() (defined in RunControlMain) | RunControlMain
preferences() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
PreferencesActivated() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
refreshUsers(operator=None) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
ResetClicked() (defined in RunControlMain) | RunControlMain
RunClicked() (defined in RunControlMain) | RunControlMain
schemaChanged() (defined in RunControlMain) | RunControlMain
setEnabledTabPage(panelLabel, enable) | RunControlMain
setInstrumentType(instrumentType) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
setOperator(operator) (defined in RunControlMain) | RunControlMain
setOrientation(orientation) (defined in RunControlMain) | RunControlMain
setParticleType(particleType) (defined in RunControlMain) | RunControlMain
setPhase(phase) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
showComments() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
showHideComments() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
showHidePythonShell() (defined in RunControlMain) | RunControlMain
showHideStatusPanel() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
showPythonShell() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
statusMonitor() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
statusPanelVisChanged(visible) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
StopClicked() (defined in RunControlMain) | RunControlMain
timedout() (defined in RunControlMain) | RunControlMain
verifySoftware() (defined in RunControlMain) | RunControlMain
visibilityChanged(visible) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
waitCursor() (defined in RunControlMain) | RunControlMain
warnDirectoryExist(directory) (defined in RunControlMain) | RunControlMain
warnFreeSpace(warn_level) (defined in RunControlMain) | RunControlMain

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcFileSelector Member List

This is the complete list of members for rcFileSelector, including all inherited members.

getValue() (defined in rcFileSelector) rcFileSelector

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

RunControlMainGUIImpl Member List

This is the complete list of members for RunControlMainGUIImpl, including all inherited members.

__init__(listbox) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
__init__(parent, name, panel, tabPage, flags=0) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
__init__(common, parent=None, name=None, fl=0) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
aboutRunControl() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
activateTab(tabPage) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
closeEvent(e) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
common() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
connectClicked() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
elogWebsite() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
fileExit() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
fileLogout() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
filePrint() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
getApp() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
getCommentWidget() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
getOperator() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
getPythonShellWidget() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
getSchemaConfigFile() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
hideComments() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
hidePythonShell() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
isPythonShellHidden() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
loadSchema() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
loadScript() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
maybeTip(pos) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
mouseDblClick(event) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
panels() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
parameterVerifier() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
PauseClicked() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
preferences() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
PreferencesActivated() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
refreshUsers(operator=None) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
ResetClicked() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
RunClicked() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
schemaChanged() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
setInstrumentType(instrumentType) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
setOperator(operator) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
setOrientation(orientation) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
setParticleType(particleType) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
setPhase(phase) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
showComments() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
showHideComments() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
showHidePythonShell() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
showHideStatusPanel() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
showPythonShell() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
statusMonitor() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
statusPanelVisChanged(visible) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
StopClicked() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
verifySoftware() (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl
visibilityChanged(visible) (defined in RunControlMainGUIImpl) | RunControlMainGUIImpl

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

BoundMethodWeakref Member List

This is the complete list of members for BoundMethodWeakref, including all inherited members.

__call__() | BoundMethodWeakref |
__cmp__(other) | BoundMethodWeakref |
__init__(target, onDelete=None) | BoundMethodWeakref |
__new__(target, onDelete=None, arguments, named) | BoundMethodWeakref | [static]
__nonzero__() | BoundMethodWeakref |
__str__() | BoundMethodWeakref |
calculateKey(target) | BoundMethodWeakref | [static]

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ServerPreferencesImpl Member List

This is the complete list of members for ServerPreferencesImpl, including all inherited members.

__init__(confParser, parent=None, name=None, modal=0, fl=0) (defined in ServerPreferencesImpl) | ServerPreferencesImpl
saveServer() (defined in ServerPreferencesImpl) | ServerPreferencesImpl
selectServer() (defined in ServerPreferencesImpl) | ServerPreferencesImpl

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

SGETrgEngines Member List

This is the complete list of members for SGETrgEngines, including all inherited members.

__init__() (defined in SGETrgEngines) SGETrgEngines

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

SGETrgInputEnables Member List

This is the complete list of members for SGETrgInputEnables, including all inherited members.

__init__() (defined in SGETrgInputEnables) | SGETrgInputEnables
towerBusy() (defined in SGETrgInputEnables) | SGETrgInputEnables

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

SimpleGasuExample Member List

This is the complete list of members for SimpleGasuExample, including all inherited members.

__init__() | SimpleGasuExample
coincidences() | SimpleGasuExample
conditions() (defined in SimpleGasuExample) | SimpleGasuExample
engines() | SimpleGasuExample
inputEnables() | SimpleGasuExample
useAcdAsTrigger() | SimpleGasuExample

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

SolicitedCondition Member List

This is the complete list of members for SolicitedCondition, including all inherited members.

__init__() (defined in SolicitedCondition) | SolicitedCondition
solicited() (defined in SolicitedCondition) | SolicitedCondition

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

SolicitedEngine Member List

This is the complete list of members for SolicitedEngine, including all inherited members.

__init__() (defined in SolicitedEngine) | SolicitedEngine
participate(conditionsValue) (defined in SolicitedEngine) | SolicitedEngine
prescale() (defined in SolicitedEngine) | SolicitedEngine
request() (defined in SolicitedEngine) | SolicitedEngine

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ZsupTrgReadout Member List

This is the complete list of members for ZsupTrgReadout, including all inherited members.

__init__() | ZsupTrgReadout
zeroSuppress() (defined in ZsupTrgReadout) | ZsupTrgReadout

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

MyLogSocketHandler Member List

This is the complete list of members for MyLogSocketHandler, including all inherited members.

createSocket() | MyLogSocketHandler
handleError(record) (defined in MyLogSocketHandler) | MyLogSocketHandler

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Merger Member List

This is the complete list of members for Merger, including all inherited members.

close() | Merger
dispose((statuses, buffer)) | Merger

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

myLATcomponentIterator Member List

This is the complete list of members for myLATcomponentIterator, including all inherited members.

AEM(event, ebfContribution) (defined in myLATcomponentIterator) | myLATcomponentIterator
GEM(event, ebfContribution) (defined in myLATcomponentIterator) | myLATcomponentIterator
headerStr(contrib) (defined in myLATcomponentIterator) | myLATcomponentIterator
OSW(event, ebfContribution) (defined in myLATcomponentIterator) | myLATcomponentIterator
parseContrib(ebfContribution) (defined in myLATcomponentIterator) | myLATcomponentIterator
payloadStr(ebfContribution) (defined in myLATcomponentIterator) | myLATcomponentIterator
summaryStr(contrib) (defined in myLATcomponentIterator) | myLATcomponentIterator
TEM(event, ebfContribution) (defined in myLATcomponentIterator) | myLATcomponentIterator

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

myLATdbIterator Member List

This is the complete list of members for myLATdbIterator, including all inherited members.

closeAll() (defined in myLATdbIterator) | myLATdbIterator
iterate(buffer, size) (defined in myLATdbIterator) | myLATdbIterator

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(rc, userId, debug) (defined in userApplication) | userApplication
commandSynch() | userApplication
getName() (defined in userApplication) | userApplication
process((status, buffer)) (defined in userApplication) | userApplication
resume() (defined in userApplication) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
sync() (defined in userApplication) | userApplication
teardown() (defined in userApplication) | userApplication
wait() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userArgText Member List

This is the complete list of members for userArgText, including all inherited members.

__init__() (defined in userArgText) | userArgText
getValue(caption) (defined in userArgText) | userArgText

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userArgument Member List

This is the complete list of members for userArgument, including all inherited members.

__init__(parent=None, name=None, modal=0, fl=0) (defined in userArgument) | userArgument
CancelButtonClicked() (defined in userArgument) | userArgument
getValue(caption) (defined in userArgument) | userArgument
OKButtonClicked() (defined in userArgument) | userArgument

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

AEMcontributionIterator Member List

This is the complete list of members for AEMcontributionIterator, including all inherited members.

fill() (defined in AEMcontributionIterator) | AEMcontributionIterator
getIntegerTileNumber(cable, channel) (defined in AEMcontributionIterator) | AEMcontributionIterator
getMiniAcdSide(cable, channel) (defined in AEMcontributionIterator) | AEMcontributionIterator
getMiniAcdTileNumber(cable, channel) (defined in AEMcontributionIterator) | AEMcontributionIterator
getRemappedTileNumber(tileNumber) (defined in AEMcontributionIterator) | AEMcontributionIterator
getSide(cable, channel) (defined in AEMcontributionIterator) | AEMcontributionIterator
header(cable, hdr) (defined in AEMcontributionIterator) | AEMcontributionIterator
pha(cable, channel, p) (defined in AEMcontributionIterator) | AEMcontributionIterator

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

CALcontributionIterator Member List

This is the complete list of members for CALcontributionIterator, including all inherited members.

fill() (defined in CALcontributionIterator) | CALcontributionIterator
log(tower, layer, theLog) (defined in CALcontributionIterator) | CALcontributionIterator

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

DIAGcontributionIterator Member List

This is the complete list of members for DIAGcontributionIterator, including all inherited members.

__init__(event, contribution, dataStart, lci) (defined in DIAGcontributionIterator) | DIAGcontributionIterator
CALdiag(tower, layer, diag) (defined in DIAGcontributionIterator) | DIAGcontributionIterator
TKRdiag(tower, gtcc, diag) (defined in DIAGcontributionIterator) | DIAGcontributionIterator

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

EBFeventIterator Member List

This is the complete list of members for EBFeventIterator, including all inherited members.

process(evt) (defined in EBFeventIterator) EBFeventIterator

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GEMcontribution Member List

This is the complete list of members for GEMcontribution, including all inherited members.

__getattr__(attr) | GEMcontribution
fill(prefix="") (defined in GEMcontribution) | GEMcontribution

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

LATcomponentIterator Member List

This is the complete list of members for LATcomponentIterator, including all inherited members.

ACDcomponent(event, aemContribution) (defined in LATcomponentIterator) | LATcomponentIterator
CALcomponent(event, calContribution) (defined in LATcomponentIterator) | LATcomponentIterator
declareNtDefinitions() (defined in LATcomponentIterator) | LATcomponentIterator
declareNtDescriptions() (defined in LATcomponentIterator) | LATcomponentIterator
diagnostic(event, contribution) (defined in LATcomponentIterator) | LATcomponentIterator
error(event, contribution) (defined in LATcomponentIterator) | LATcomponentIterator
GEMcomponent(event, gemContribution) (defined in LATcomponentIterator) | LATcomponentIterator
getChanIndexDescription(ntName, value) (defined in LATcomponentIterator) | LATcomponentIterator
getColumnDescription(ntName, columnName) (defined in LATcomponentIterator) | LATcomponentIterator
getEventMarker() (defined in LATcomponentIterator) | LATcomponentIterator
getNtupleDefinition(ntName) (defined in LATcomponentIterator) | LATcomponentIterator
getTileNumber(remapTileNumber) (defined in LATcomponentIterator) | LATcomponentIterator
OSWcomponent(event, oswContribution) (defined in LATcomponentIterator) | LATcomponentIterator
TKRcomponent(event, tkrContribution) (defined in LATcomponentIterator) | LATcomponentIterator
UDFcomponent(event, ebfContribution) (defined in LATcomponentIterator) | LATcomponentIterator

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

LATcontributionIterator Member List

This is the complete list of members for LATcontributionIterator, including all inherited members.

clearUdfDict() (defined in LATcontributionIterator) | LATcontributionIterator
getUdfDict() (defined in LATcontributionIterator) | LATcontributionIterator
UDF(start, end) (defined in LATcontributionIterator) | LATcontributionIterator

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

OSWcontributionIterator Member List

This is the complete list of members for OSWcontributionIterator, including all inherited members.

OSW_UDF(event, contribution) (defined in OSWcontributionIterator) | OSWcontributionIterator
OSWtime(timeStamp, timebase) (defined in OSWcontributionIterator) | OSWcontributionIterator

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TKRcontributionIterator Member List

This is the complete list of members for TKRcontributionIterator, including all inherited members.

fill() (defined in TKRcontributionIterator) | TKRcontributionIterator
strip(tower, layerEnd, hit) (defined in TKRcontributionIterator) | TKRcontributionIterator
TOT(tower, layerEnd, tot) (defined in TKRcontributionIterator) | TKRcontributionIterator

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

standardPlotter Member List

This is the complete list of members for standardPlotter, including all inherited members.

addSummaryTableRow(plot, limitType, status) (defined in standardPlotter) | standardPlotter
capturePlot(plot) (defined in standardPlotter) | standardPlotter
checkLimit(plot, limit) (defined in standardPlotter) | standardPlotter
clearPlots() (defined in standardPlotter) | standardPlotter
forceUpdatePlots() (defined in standardPlotter) | standardPlotter
getName() (defined in standardPlotter) | standardPlotter
getPlotColumns(plot) (defined in standardPlotter) | standardPlotter
getPlotCuts(plot) (defined in standardPlotter) | standardPlotter
getPlotNtuple(plot) (defined in standardPlotter) | standardPlotter
getPlotTitle(plot) (defined in standardPlotter) | standardPlotter
getPlotType(plot) (defined in standardPlotter) | standardPlotter
getRequests() (defined in standardPlotter) | standardPlotter
initHippo() (defined in standardPlotter) | standardPlotter
initializePlotter() (defined in standardPlotter) | standardPlotter
listFailed(names, failList, plot, limitDesc, sectionID) (defined in standardPlotter) | standardPlotter
parseCuts() (defined in standardPlotter) | standardPlotter
parseLimits() (defined in standardPlotter) | standardPlotter
readPedestals() (defined in standardPlotter) | standardPlotter
reportLimits() (defined in standardPlotter) | standardPlotter
reportPlotItem(sectionID, plot, itemStartString) (defined in standardPlotter) | standardPlotter
reportPlots() (defined in standardPlotter) | standardPlotter
reportResults() (defined in standardPlotter) | standardPlotter
setConfigFile(configFile) (defined in standardPlotter) | standardPlotter
setDataType(dataType) (defined in standardPlotter) | standardPlotter
startReport() (defined in standardPlotter) | standardPlotter
startSummary() (defined in standardPlotter) | standardPlotter
updatePlots() (defined in standardPlotter) | standardPlotter
writeReport(reportFileName) (defined in standardPlotter) | standardPlotter

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

standardTestReport Member List

This is the complete list of members for standardTestReport, including all inherited members.

__init__() | standardTestReport
closeTestReport(FileName) | standardTestReport
getColorText(Text, Color='black', Bold=False) (defined in standardTestReport) | standardTestReport
statusString(status) | standardTestReport
writeTestInformation(runId, TestName=None, Operator=None, Site=None, Device=None, Phase=None, Status=None) | standardTestReport

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

standardPlotterGuiImpl Member List

This is the complete list of members for standardPlotterGuiImpl, including all inherited members.

__init__(parent=None, name=None, modal=0, fl=0) (defined in standardPlotterGuiImpl) | standardPlotterGuiImpl
CancelButtonClicked() (defined in standardPlotterGuiImpl) | standardPlotterGuiImpl
configFileBrowser() (defined in standardPlotterGuiImpl) | standardPlotterGuiImpl
getConfigFile(fileName) (defined in standardPlotterGuiImpl) | standardPlotterGuiImpl
OKButtonClicked() (defined in standardPlotterGuiImpl) | standardPlotterGuiImpl

Generated on Fri Jul 21 13:28:01 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

BadGasuExample Member List

This is the complete list of members for BadGasuExample, including all inherited members.

__init__() | BadGasuExample
shut(sweepEvent, progress=None) | BadGasuExample

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

BadGLTExample Member List

This is the complete list of members for BadGLTExample, including all inherited members.

__init__() | BadGLTExample
shut(sweepEvent, progress=None) | BadGLTExample

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(rc, userId, debug) (defined in userApplication) | userApplication
commandSynch() | userApplication
getName() (defined in userApplication) | userApplication
process((status, buffer)) | userApplication
resume() (defined in userApplication) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
sync() (defined in userApplication) | userApplication
teardown() (defined in userApplication) | userApplication
wait() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userArgText Member List

This is the complete list of members for userArgText, including all inherited members.

__init__() (defined in userArgText) | userArgText
getValue(caption) (defined in userArgText) | userArgText

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TaskEngine Member List

This is the complete list of members for TaskEngine, including all inherited members.

__init__(name=None) (defined in TaskEngine) | TaskEngine
name() | TaskEngine
run() | TaskEngine
shutdown(tmo=2.0) | TaskEngine
spawn(task, args, kwargs) | TaskEngine

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TaskEngineTestCase Member List

This is the complete list of members for TaskEngineTestCase, including all inherited members.

checkException1() | TaskEngineTestCase
checkException2() | TaskEngineTestCase
checkInstantiation() | TaskEngineTestCase
checkSelfShutdown() | TaskEngineTestCase
checkShutdown1() | TaskEngineTestCase
checkShutdown2() | TaskEngineTestCase
checkSpawn() | TaskEngineTestCase
checkStartup() | TaskEngineTestCase
checkUnboundSpawn() | TaskEngineTestCase

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(rc, userId, debug) (defined in userApplication) | userApplication
commandSynch() | userApplication
getName() (defined in userApplication) | userApplication
process((status, latDatagram)) | userApplication
resume() (defined in userApplication) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
sync() (defined in userApplication) | userApplication
teardown() (defined in userApplication) | userApplication
wait() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GTest Member List

This is the complete list of members for GTest, including all inherited members.

__init__(client) (defined in GTest) | GTest
gDb::Gdb::__init__(client, parent, id, valid_attrs=[], addr=None, flags=None) | Gdb
addr() | Gdb
attrIter() | Gdb
getExcludeFlags() | Gdb
getFlag(key, integer=False) | Gdb
getIdTuple() | Gdb
getName() (defined in Gdb) | Gdb
getOpaque(name=None) | Gdb
getSerialNos(component=None) | Gdb
id() | Gdb
load(reg, value) (defined in GTest) | GTest
read(reg) (defined in GTest) | GTest
root() | Gdb
send(cmd) (defined in GTest) | GTest
setFlag(key, value) | Gdb
up() | Gdb

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

MiniGLTExample Member List

This is the complete list of members for MiniGLTExample, including all inherited members.

__init__() | MiniGLTExample
conditions() | MiniGLTExample
engines() | MiniGLTExample

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

MiniGLTSolicitedCondition Member List

This is the complete list of members for MiniGLTSolicitedCondition, including all inherited members.

__init__() (defined in MiniGLTSolicitedCondition) | MiniGLTSolicitedCondition
solicited() (defined in MiniGLTSolicitedCondition) | MiniGLTSolicitedCondition

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

MiniGLTSolicitedEngine Member List

This is the complete list of members for MiniGLTSolicitedEngine, including all inherited members.

__init__() (defined in MiniGLTSolicitedEngine) | MiniGLTSolicitedEngine
participate(conditionsValue) (defined in MiniGLTSolicitedEngine) | MiniGLTSolicitedEngine
prescale() (defined in MiniGLTSolicitedEngine) | MiniGLTSolicitedEngine
request() (defined in MiniGLTSolicitedEngine) | MiniGLTSolicitedEngine

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ZsupSolicitedEngine Member List

This is the complete list of members for ZsupSolicitedEngine, including all inherited members.

__init__() (defined in ZsupSolicitedEngine) | ZsupSolicitedEngine
participate(conditionsValue) (defined in ZsupSolicitedEngine) | ZsupSolicitedEngine
prescale() (defined in ZsupSolicitedEngine) | ZsupSolicitedEngine
request() (defined in ZsupSolicitedEngine) | ZsupSolicitedEngine

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ZsupTrgInjectChargeReadout Member List

This is the complete list of members for ZsupTrgInjectChargeReadout, including all inherited members.

__init__() | ZsupTrgInjectChargeReadout
zeroSuppress() (defined in ZsupTrgInjectChargeReadout) | ZsupTrgInjectChargeReadout

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GasuExtTrg Member List

This is the complete list of members for GasuExtTrg, including all inherited members.

conditions() (defined in GasuExtTrg) GasuExtTrg

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GasuExtTrgEngine Member List

This is the complete list of members for GasuExtTrgEngine, including all inherited members.

participate(conditionsValue) (defined in GasuExtTrgEngine) | GasuExtTrgEngine
prescale() (defined in GasuExtTrgEngine) | GasuExtTrgEngine

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

MiniGltExtTrg Member List

This is the complete list of members for MiniGltExtTrg, including all inherited members.

conditions() (defined in MiniGltExtTrg) MiniGltExtTrg

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

MiniGltTrgEngine Member List

This is the complete list of members for MiniGltTrgEngine, including all inherited members.

participate(conditionsValue) (defined in MiniGltTrgEngine) | MiniGltTrgEngine
prescale() (defined in MiniGltTrgEngine) | MiniGltTrgEngine

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

EvtCli Member List

This is the complete list of members for EvtCli, including all inherited members.

dontread() (defined in EvtCli) | EvtCli
read() (defined in EvtCli) | EvtCli

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

PduSwitch Member List

This is the complete list of members for PduSwitch, including all inherited members.

configureTestHardware(pdu, gasu) (defined in PduSwitch) PduSwitch

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Playback Member List

This is the complete list of members for Playback, including all inherited members.

__init__(server) (defined in Playback) | Playback
connect() (defined in Playback) | Playback
disconnect() (defined in Playback) | Playback
listen() (defined in Playback) | Playback
trigger(howmany) (defined in Playback) | Playback

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userArgument Member List

This is the complete list of members for userArgument, including all inherited members.

__init__(parent=None, name=None, modal=0, fl=0) (defined in userArgument) | userArgument
CancelButtonClicked() (defined in userArgument) | userArgument
getValue(caption) (defined in userArgument) | userArgument
OKButtonClicked() (defined in userArgument) | userArgument

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

FullCondition Member List

This is the complete list of members for FullCondition, including all inherited members.

__init__() (defined in FullCondition) | FullCondition
calLow() (defined in FullCondition) | FullCondition
cno() (defined in FullCondition) | FullCondition
solicited() (defined in FullCondition) | FullCondition
tkr() (defined in FullCondition) | FullCondition

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

FullEngine Member List

This is the complete list of members for FullEngine, including all inherited members.

participate(conditionsValue) (defined in FullEngine) | FullEngine
prescale() (defined in FullEngine) | FullEngine

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

LDBI_LATcontributionIterator_ Member List

This is the complete list of members for LDBI_LATcontributionIterator_, including all inherited members.

__init__(lci) (defined in LDBI_LATcontributionIterator_) | LDBI_LATcontributionIterator_
UDF(contrib, nextContrib) (defined in LDBI_LATcontributionIterator_) | LDBI_LATcontributionIterator_

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

MarkerTrgReadout Member List

This is the complete list of members for MarkerTrgReadout, including all inherited members.

__init__() | MarkerTrgReadout
zeroSuppress() (defined in MarkerTrgReadout) | MarkerTrgReadout

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

SGETrgEngines Member List

This is the complete list of members for SGETrgEngines, including all inherited members.

__init__() (defined in SGETrgEngines) SGETrgEngines

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

SGETrgInputEnables Member List

This is the complete list of members for SGETrgInputEnables, including all inherited members.

__init__() (defined in SGETrgInputEnables) SGETrgInputEnables

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

SimpleGasuExample Member List

This is the complete list of members for SimpleGasuExample, including all inherited members.

__init__() | SimpleGasuExample
coincidences() | SimpleGasuExample
conditions() (defined in SimpleGasuExample) | SimpleGasuExample
engines() | SimpleGasuExample
inputEnables() | SimpleGasuExample
useAcdAsTrigger() | SimpleGasuExample

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

SolicitedCondition Member List

This is the complete list of members for SolicitedCondition, including all inherited members.

__init__() (defined in SolicitedCondition) | SolicitedCondition
solicited() (defined in SolicitedCondition) | SolicitedCondition

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

SolicitedEngine Member List

This is the complete list of members for SolicitedEngine, including all inherited members.

__init__() (defined in SolicitedEngine) | SolicitedEngine
participate(conditionsValue) (defined in SolicitedEngine) | SolicitedEngine
prescale() (defined in SolicitedEngine) | SolicitedEngine
request() (defined in SolicitedEngine) | SolicitedEngine

Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(rc, userId, debug) (defined in userApplication) | userApplication
commandSynch() | userApplication
getName() (defined in userApplication) | userApplication
process((status, buffer)) | userApplication
redAlarm(value, signal, sender) (defined in userApplication) | userApplication
resume() (defined in userApplication) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
sync() (defined in userApplication) | userApplication
wait() (defined in userApplication) | userApplication
yellowAlarm1(value, signal, sender, sendNode) (defined in userApplication) | userApplication
yellowAlarm2(value, signal, sender, sendNode) (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(rc, userId, debug) (defined in userApplication) | userApplication
commandSynch() | userApplication
getName() (defined in userApplication) | userApplication
process((status, buffer)) | userApplication
resume() (defined in userApplication) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
sync() (defined in userApplication) | userApplication
wait() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userArgText Member List

This is the complete list of members for userArgText, including all inherited members.

__init__() (defined in userArgText) | userArgText
getValue(caption) (defined in userArgText) | userArgText

Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userArgument Member List

This is the complete list of members for userArgument, including all inherited members.

__init__(parent=None, name=None, modal=0, fl=0) (defined in userArgument) | userArgument
CancelButtonClicked() (defined in userArgument) | userArgument
getValue(caption) (defined in userArgument) | userArgument
OKButtonClicked() (defined in userArgument) | userArgument

Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(rc, userId, debug) (defined in userApplication) | userApplication
commandSynch() | userApplication
getName() (defined in userApplication) | userApplication
process((status, buffer)) | userApplication
resume() (defined in userApplication) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
sync() (defined in userApplication) | userApplication
teardown() (defined in userApplication) | userApplication
wait() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplicationCallbacks Member List

This is the complete list of members for userApplicationCallbacks, including all inherited members.

afterStopRun(app) (defined in userApplicationCallbacks) | userApplicationCallbacks
beforeSetup(app) (defined in userApplicationCallbacks) | userApplicationCallbacks
beforeStartRun(app) (defined in userApplicationCallbacks) | userApplicationCallbacks

Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

CAL_LATcontribution Member List

This is the complete list of members for CAL_LATcontribution, including all inherited members.

__len__() | CAL_LATcontribution
__str__() | CAL_LATcontribution

Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(rc, userId, debug) (defined in userApplication) | userApplication
commandSynch() | userApplication
getName() (defined in userApplication) | userApplication
process((status, latDatagram)) | userApplication
resume() (defined in userApplication) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
sync() (defined in userApplication) | userApplication
teardown() (defined in userApplication) | userApplication
wait() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

myLATcomponentIterator Member List

This is the complete list of members for myLATcomponentIterator, including all inherited members.

ACDcomponent(event, aemContribution) (defined in myLATcomponentIterator) | myLATcomponentIterator
CALcomponent(event, calContribution) (defined in myLATcomponentIterator) | myLATcomponentIterator
GLTcomponent(event, gemContribution) (defined in myLATcomponentIterator) | myLATcomponentIterator
TKRcomponent(event, tkrContribution) (defined in myLATcomponentIterator) | myLATcomponentIterator
UDFcomponent(event, ebfContribution) (defined in myLATcomponentIterator) | myLATcomponentIterator

Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(rc, userId, debug) (defined in userApplication) | userApplication
getName() (defined in userApplication) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

LATcomponentIterator Member List

This is the complete list of members for LATcomponentIterator, including all inherited members.

ACDcomponent(event, aemContribution) (defined in LATcomponentIterator) | LATcomponentIterator
CALcomponent(event, calContribution) (defined in LATcomponentIterator) | LATcomponentIterator
GEMcomponent(event, gemContribution) (defined in LATcomponentIterator) | LATcomponentIterator
GLTcomponent(event, gltContribution) (defined in LATcomponentIterator) | LATcomponentIterator
OSWcomponent(event, oswContribution) (defined in LATcomponentIterator) | LATcomponentIterator
TKRcomponent(event, tkrContribution) (defined in LATcomponentIterator) | LATcomponentIterator
UDFcomponent(event, ebfContribution) (defined in LATcomponentIterator) | LATcomponentIterator

Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(gui, userId, debug) (defined in userApplication) | userApplication
commandSynch() | userApplication
getName() (defined in userApplication) | userApplication
process((status, buffer)) | userApplication
resume() (defined in userApplication) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
sync() (defined in userApplication) | userApplication
wait() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userArgument Member List

This is the complete list of members for userArgument, including all inherited members.

__init__(parent=None, name=None, modal=0, fl=0) (defined in userArgument) | userArgument
getValue(caption) (defined in userArgument) | userArgument
OKButtonClicked() (defined in userArgument) | userArgument

Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(rc, userId, debug) (defined in userApplication) | userApplication
createTestReport() (defined in userApplication) | userApplication
getName() (defined in userApplication) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:28:03 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

testArchiver Member List

This is the complete list of members for testArchiver, including all inherited members.

__init__(filePath=None, fileName=None) (defined in testArchiver) | testArchiver |
__init__(filePath=None, fileName=None, mode=MODE_CREATE, userId=123) (defined in rcArchiver) | rcArchiver |
close() (defined in rcArchiver) | rcArchiver |
getFileName() (defined in rcArchiver) | rcArchiver |
getFileNameFromTS(ts) (defined in testArchiver) | testArchiver | [static]
getFilePath() (defined in rcArchiver) | rcArchiver |
isClosed() (defined in rcArchiver) | rcArchiver |
read() (defined in rcArchiver) | rcArchiver |
userMethod(data, moreData) | testArchiver |
write(data) (defined in testArchiver) | testArchiver |
write(rawEventData) (defined in rcArchiver) | rcArchiver |
writeTuple(tuple) (defined in rcArchiver) | rcArchiver |

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(gui, userId, debug) (defined in userApplication) | userApplication
commandSynch() | userApplication
getName() (defined in userApplication) | userApplication
process((status, buffer)) | userApplication
resume() (defined in userApplication) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
sync() (defined in userApplication) | userApplication
wait() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userArgText Member List

This is the complete list of members for userArgText, including all inherited members.

__init__() (defined in userArgText) | userArgText
getValue(caption) (defined in userArgText) | userArgText

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userArgument Member List

This is the complete list of members for userArgument, including all inherited members.

__init__(parent=None, name=None, modal=0, fl=0) (defined in userArgument) | userArgument
CancelButtonClicked() (defined in userArgument) | userArgument
getValue(caption) (defined in userArgument) | userArgument
OKButtonClicked() (defined in userArgument) | userArgument

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(rc, userId, debug) (defined in userApplication) | userApplication
commandSynch() | userApplication
getName() (defined in userApplication) | userApplication
process((status, latDatagram)) | userApplication
resume() (defined in userApplication) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
sync() (defined in userApplication) | userApplication
teardown() (defined in userApplication) | userApplication
wait() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

testEvtCli Member List

This is the complete list of members for testEvtCli, including all inherited members.

readEvent(dat=None) (defined in testEvtCli) testEvtCli

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(rc, userId, debug) (defined in userApplication) | userApplication
commandSynch() | userApplication
getName() (defined in userApplication) | userApplication
process((status, buffer)) | userApplication
resume() (defined in userApplication) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
sync() (defined in userApplication) | userApplication
teardown() (defined in userApplication) | userApplication
wait() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

myLATcomponentIterator Member List

This is the complete list of members for myLATcomponentIterator, including all inherited members.

ACDcomponent(event, aemContribution) (defined in myLATcomponentIterator) | myLATcomponentIterator
CALcomponent(event, calContribution) (defined in myLATcomponentIterator) | myLATcomponentIterator
GLTcomponent(event, gemContribution) (defined in myLATcomponentIterator) | myLATcomponentIterator
TKRcomponent(event, tkrContribution) (defined in myLATcomponentIterator) | myLATcomponentIterator
UDFcomponent(event, ebfContribution) (defined in myLATcomponentIterator) | myLATcomponentIterator

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userSuite Member List

This is the complete list of members for userSuite, including all inherited members.

__init__(gui, userId, debug) (defined in userSuite) | userSuite
getName() (defined in userSuite) | userSuite
setupSuite() (defined in userSuite) | userSuite
startSuite() (defined in userSuite) | userSuite
stopSuite() (defined in userSuite) | userSuite

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userSuite Member List

This is the complete list of members for userSuite, including all inherited members.

__init__(gui, userId, debug) (defined in userSuite) | userSuite
getName() (defined in userSuite) | userSuite
pauseSuite() (defined in userSuite) | userSuite
setupSuite() (defined in userSuite) | userSuite
startSuite() (defined in userSuite) | userSuite
stopSuite() (defined in userSuite) | userSuite

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userSuiteCallbacks Member List

This is the complete list of members for userSuiteCallbacks, including all inherited members.

afterStopSuite(suite) (defined in userSuiteCallbacks) | userSuiteCallbacks
beforeSetupSuite(suite) (defined in userSuiteCallbacks) | userSuiteCallbacks
beforeStartSuite(suite) (defined in userSuiteCallbacks) | userSuiteCallbacks

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(rc, userId, debug) (defined in userApplication) | userApplication
commandSynch() | userApplication
getName() (defined in userApplication) | userApplication
resume() (defined in userApplication) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
sync() (defined in userApplication) | userApplication
wait() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userArgText Member List

This is the complete list of members for userArgText, including all inherited members.

__init__() (defined in userArgText) | userArgText
getValue(caption, value=None) (defined in userArgText) | userArgText

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userArgument Member List

This is the complete list of members for userArgument, including all inherited members.

__init__(parent=None, name=None, modal=0, fl=0) (defined in userArgument) | userArgument
CancelButtonClicked() (defined in userArgument) | userArgument

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

FancyTrendTree Member List

This is the complete list of members for FancyTrendTree, including all inherited members.

contextMenu(item, point, pos) (defined in FancyTrendTree) | FancyTrendTree
newTrend() (defined in FancyTrendTree) | FancyTrendTree
removeSelected() (defined in FancyTrendTree) | FancyTrendTree
toggleDynamic() (defined in FancyTrendTree) | FancyTrendTree
update(trendables) (defined in FancyTrendTree) | FancyTrendTree

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

QtReceiver Member List

This is the complete list of members for QtReceiver, including all inherited members.

__init__(trendables) (defined in QtReceiver) | QtReceiver
__init__(args) (defined in QtReceiver) | QtReceiver
customEvent(event) (defined in QtReceiver) | QtReceiver
process(trendables) (defined in QtReceiver) | QtReceiver

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrendPlotter Member List

This is the complete list of members for TrendPlotter, including all inherited members.

addPlot(trendable) (defined in TrendPlotter) | TrendPlotter
isDynamic() (defined in TrendPlotter) | TrendPlotter
setDynamic(bool) (defined in TrendPlotter) | TrendPlotter
update(trendables) (defined in TrendPlotter) | TrendPlotter

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrendTestGUI Member List

This is the complete list of members for TrendTestGUI, including all inherited members.

update(trendables) (defined in TrendTestGUI) TrendTestGUI

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrendTree Member List

This is the complete list of members for TrendTree, including all inherited members.

addLeaf(name) (defined in TrendTree) | TrendTree
getBranchName(name) (defined in TrendTree) | TrendTree
isDynamic() (defined in TrendTree) | TrendTree
setDynamic(bool) (defined in TrendTree) | TrendTree
update(trendables) (defined in TrendTree) | TrendTree

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

towerwidgetImpl Member List

This is the complete list of members for towerwidgetImpl, including all inherited members.

calmask(onoff) (defined in towerwidgetImpl) | towerwidgetImpl
changeSampling(sampling) (defined in towerwidgetImpl) | towerwidgetImpl
resetpressed() (defined in towerwidgetImpl) | towerwidgetImpl
tkrmask(onoff) (defined in towerwidgetImpl) | towerwidgetImpl
update() (defined in towerwidgetImpl) | towerwidgetImpl

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userApplication Member List

This is the complete list of members for userApplication, including all inherited members.

__init__(rc, userId, debug) (defined in userApplication) | userApplication
getName() (defined in userApplication) | userApplication
pause() (defined in userApplication) | userApplication
resume() (defined in userApplication) | userApplication
setup() (defined in userApplication) | userApplication
startRun() (defined in userApplication) | userApplication
stop() (defined in userApplication) | userApplication
stopRun() (defined in userApplication) | userApplication
teardown() (defined in userApplication) | userApplication

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

Trendable Member List

This is the complete list of members for Trendable, including all inherited members.

__str__() (defined in Trendable) Trendable

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrendLimit Member List

This is the complete list of members for TrendLimit, including all inherited members.

check(value) (defined in TrendLimit) TrendLimit

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GHSKTrendMap Member List

This is the complete list of members for GHSKTrendMap, including all inherited members.

mapGet(key) (defined in TrendMapBase) | TrendMapBase
mapKeys() (defined in TrendMapBase) | TrendMapBase
mapSet(key, value) (defined in TrendMapBase) | TrendMapBase

Generated on Fri Jul 21 13:28:05 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

GLATTrendMap Member List

This is the complete list of members for GLATTrendMap, including all inherited members.

mapGet(key) (defined in TrendMapBase) | TrendMapBase
mapKeys() (defined in TrendMapBase) | TrendMapBase
mapSet(key, value) (defined in TrendMapBase) | TrendMapBase

Generated on Fri Jul 21 13:28:05 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ReverseTrendMap Member List

This is the complete list of members for ReverseTrendMap, including all inherited members.

__init__(startMap) (defined in ReverseTrendMap) | ReverseTrendMap
mapGet(key) (defined in ReverseTrendMap) | ReverseTrendMap
mapKeys() (defined in ReverseTrendMap) | ReverseTrendMap
mapSet(key, value) (defined in ReverseTrendMap) | ReverseTrendMap

Generated on Fri Jul 21 13:28:06 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrendMapBase Member List

This is the complete list of members for TrendMapBase, including all inherited members.

mapGet(key) (defined in TrendMapBase) | TrendMapBase
mapKeys() (defined in TrendMapBase) | TrendMapBase
mapSet(key, value) (defined in TrendMapBase) | TrendMapBase

Generated on Fri Jul 21 13:28:04 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgAbstract Member List

This is the complete list of members for TrgAbstract, including all inherited members.

__init__() | TrgAbstract
__setattr__(name, value) | TrgObject
conditions() | TrgAbstract
disable() | TrgAbstract
enable() | TrgAbstract
engines() | TrgAbstract
inputEnables() | TrgAbstract
maxConditions() | TrgAbstract
maxEngines() | TrgAbstract
sequence() | TrgAbstract
shut(marker) | TrgAbstract
solicit() | TrgAbstract
version() | TrgAbstract

Generated on Fri Jul 21 13:28:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgCmdCounters Member List

This is the complete list of members for TrgCmdCounters, including all inherited members.

__init__() | TrgCmdCounters
__setattr__(name, value) | TrgObject
reset() | TrgCmdCounters
stats() | TrgCmdCounters

Generated on Fri Jul 21 13:28:07 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgCmdStats Member List

This is the complete list of members for TrgCmdStats, including all inherited members.

__init__() | TrgCmdStats
__setattr__(name, value) | TrgObject
command() | TrgCmdStats
response() | TrgCmdStats

Generated on Fri Jul 21 13:28:08 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgCnoCounters Member List

This is the complete list of members for TrgCnoCounters, including all inherited members.

__init__() (defined in TrgCnoCounters) | TrgCnoCounters
__setattr__(name, value) | TrgObject
assignA(a) | TrgCnoCounters
assignAB(a, b) | TrgCnoCounters
assignB(B) | TrgCnoCounters
reset() | TrgCnoCounters
stats() | TrgCnoCounters

Generated on Fri Jul 21 13:28:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgCnoStats Member List

This is the complete list of members for TrgCnoStats, including all inherited members.

__init__() (defined in TrgCnoStats) | TrgCnoStats
__setattr__(name, value) | TrgObject
A() | TrgCnoStats
B() | TrgCnoStats

Generated on Fri Jul 21 13:28:09 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgCoincidence Member List

This is the complete list of members for TrgCoincidence, including all inherited members.

__init__() | TrgCoincidence
__setattr__(name, value) | TrgObject
inCoincidence(tileNumber) | TrgCoincidence

Generated on Fri Jul 21 13:28:12 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgCoincidences Member List

This is the complete list of members for TrgCoincidences, including all inherited members.

__init__() | TrgCoincidences
__setattr__(name, value) | TrgObject
coincidence(coincidenceNumber) | TrgCoincidences
roi(regionNumber) | TrgRois

Generated on Fri Jul 21 13:28:12 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgRoi Member List

This is the complete list of members for TrgRoi, including all inherited members.

__init__() | TrgRoi
__setattr__(name, value) | TrgObject
tile(tileNumber) | TrgRoi

Generated on Fri Jul 21 13:28:11 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgRois Member List

This is the complete list of members for TrgRois, including all inherited members.

__init__() | TrgRois
__setattr__(name, value) | TrgObject
roi(regionNumber) | TrgRois

Generated on Fri Jul 21 13:28:11 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgConditions Member List

This is the complete list of members for TrgConditions, including all inherited members.

__init__() | TrgConditions
__setattr__(name, value) | TrgObject
calHigh() | TrgConditions
calLow() | TrgConditions
cno() | TrgConditions
external() | TrgConditions
periodic() | TrgConditions
roi() | TrgConditions
solicited() | TrgConditions
tkr() | TrgConditions

Generated on Fri Jul 21 13:28:13 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgConditionsValue Member List

This is the complete list of members for TrgConditionsValue, including all inherited members.

__init__() | TrgConditionsValue
__setattr__(name, value) | TrgObject
calHigh() | TrgConditionsValue
calLow() | TrgConditionsValue
cno() | TrgConditionsValue
external() | TrgConditionsValue
periodic() | TrgConditionsValue
roi() | TrgConditionsValue
solicited() | TrgConditionsValue
tkr() | TrgConditionsValue
value() | TrgConditionsValue

Generated on Fri Jul 21 13:28:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

trgConsumer Member List

This is the complete list of members for trgConsumer, including all inherited members.

checkUDF() (defined in trgConsumer) | trgConsumer
dataSize() | trgConsumer
exitConsumer() (defined in trgConsumer) | trgConsumer
fileClose() | trgConsumer
fileOpen(fn) | trgConsumer
getNextEvent() | trgConsumer
getRunId() (defined in trgConsumer) | trgConsumer
loop() (defined in trgConsumer) | trgConsumer
parseEvent() (defined in trgConsumer) | trgConsumer
reloadData() (defined in trgConsumer) | trgConsumer
resetWindowData() (defined in trgConsumer) | trgConsumer
serverClose() | trgConsumer
serverOpen(server="1") | trgConsumer
setRunId(runId) (defined in trgConsumer) | trgConsumer

Generated on Fri Jul 21 13:28:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

trgLATcomponentIterator Member List

This is the complete list of members for trgLATcomponentIterator, including all inherited members.

GEMcomponent(event, gemContribution) (defined in trgLATcomponentIterator) trgLATcomponentIterator

Generated on Fri Jul 21 13:28:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

eventThread Member List

This is the complete list of members for eventThread, including all inherited members.

run() (defined in eventThread) eventThread

Generated on Fri Jul 21 13:28:14 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

trgDisplayImpl Member List

This is the complete list of members for trgDisplayImpl, including all inherited members.

__init__(lat, ocs, server, infile, parent=None, name=None, modal=0, fl=0) (defined in trgDisplayImpl) | trgDisplayImpl
changecalmask11(mask) (defined in trgDisplayImpl) | trgDisplayImpl
changecalmask12(mask) (defined in trgDisplayImpl) | trgDisplayImpl
changecalmask21(mask) (defined in trgDisplayImpl) | trgDisplayImpl
changecalmask22(mask) (defined in trgDisplayImpl) | trgDisplayImpl
changecalmaskh11(mask) (defined in trgDisplayImpl) | trgDisplayImpl
changecalmaskh12(mask) (defined in trgDisplayImpl) | trgDisplayImpl
changecalmaskh21(mask) (defined in trgDisplayImpl) | trgDisplayImpl
changecalmaskh22(mask) (defined in trgDisplayImpl) | trgDisplayImpl
changecno1(tile) (defined in trgDisplayImpl) | trgDisplayImpl
changecno2(tile) (defined in trgDisplayImpl) | trgDisplayImpl
changeRate(rate) (defined in trgDisplayImpl) | trgDisplayImpl
changeSampling(sampling) (defined in trgDisplayImpl) | trgDisplayImpl
changetile1(tile) (defined in trgDisplayImpl) | trgDisplayImpl
changetile2(tile) (defined in trgDisplayImpl) | trgDisplayImpl
changetkrmask11(mask) (defined in trgDisplayImpl) | trgDisplayImpl
changetkrmask12(mask) (defined in trgDisplayImpl) | trgDisplayImpl
changetkrmask13(mask) (defined in trgDisplayImpl) | trgDisplayImpl
changetkrmask14(mask) (defined in trgDisplayImpl) | trgDisplayImpl
changetkrmask21(mask) (defined in trgDisplayImpl) | trgDisplayImpl
changetkrmask22(mask) (defined in trgDisplayImpl) | trgDisplayImpl
changetkrmask23(mask) (defined in trgDisplayImpl) | trgDisplayImpl
changetkrmask24(mask) (defined in trgDisplayImpl) | trgDisplayImpl
changetower1(id) (defined in trgDisplayImpl) | trgDisplayImpl
changetower2(id) (defined in trgDisplayImpl) | trgDisplayImpl
closeEvent(e) (defined in trgDisplayImpl) | trgDisplayImpl
doresetcal1() (defined in trgDisplayImpl) | trgDisplayImpl
doresetcal2() (defined in trgDisplayImpl) | trgDisplayImpl
doresetcno() (defined in trgDisplayImpl) | trgDisplayImpl
doresettile() (defined in trgDisplayImpl) | trgDisplayImpl
doresettkr11() (defined in trgDisplayImpl) | trgDisplayImpl
doresettkr12() (defined in trgDisplayImpl) | trgDisplayImpl
doresettkr21() (defined in trgDisplayImpl) | trgDisplayImpl
doresettkr22() (defined in trgDisplayImpl) | trgDisplayImpl
getEngines(gemmg, val) (defined in trgDisplayImpl) | trgDisplayImpl
readlut(gemsc) (defined in trgDisplayImpl) | trgDisplayImpl
resettimehisto() | trgDisplayImpl
resizeEvent(rev) (defined in trgDisplayImpl) | trgDisplayImpl
setCALhigh(onoff) (defined in trgDisplayImpl) | trgDisplayImpl
setCALlow(onoff) (defined in trgDisplayImpl) | trgDisplayImpl
setCNO(onoff) (defined in trgDisplayImpl) | trgDisplayImpl
setEXT(onoff) (defined in trgDisplayImpl) | trgDisplayImpl
setReference(ref) (defined in trgDisplayImpl) | trgDisplayImpl
setROI(onoff) (defined in trgDisplayImpl) | trgDisplayImpl
setTKR(onoff) (defined in trgDisplayImpl) | trgDisplayImpl
stopthethread() (defined in trgDisplayImpl) | trgDisplayImpl
update() (defined in trgDisplayImpl) | trgDisplayImpl

Generated on Fri Jul 21 13:28:15 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgEngine Member List

This is the complete list of members for TrgEngine, including all inherited members.

__init__() | TrgEngine
__setattr__(name, value) | TrgObject
participate(conditionsValue) | TrgEngine
prescale() | TrgEngine
request() | TrgEngine

Generated on Fri Jul 21 13:28:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgEngineRequest Member List

This is the complete list of members for TrgEngineRequest, including all inherited members.

__init__() | TrgEngineRequest
__setattr__(name, value) | TrgObject
destination() | TrgEngineRequest
fourRange() | TrgEngineRequest
marker(markerValue=0) | TrgEngineRequest
sequence() | TrgEngineRequest
zeroSuppress() | TrgEngineRequest

Generated on Fri Jul 21 13:28:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgEngines Member List

This is the complete list of members for TrgEngines, including all inherited members.

__init__() | TrgEngines
__setattr__(name, value) | TrgObject
engine(engineNumber) | TrgEngines

Generated on Fri Jul 21 13:28:16 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgInjectCharge Member List

This is the complete list of members for TrgInjectCharge, including all inherited members.

__init__() | TrgInjectCharge
__setattr__(name, value) | TrgObject
destination() | TrgEngineRequest
fourRange() | TrgEngineRequest
marker(markerValue=0) | TrgEngineRequest
sequence() | TrgInjectCharge
zeroSuppress() | TrgEngineRequest

Generated on Fri Jul 21 13:28:17 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgInjectChargeReadout Member List

This is the complete list of members for TrgInjectChargeReadout, including all inherited members.

__init__() | TrgInjectChargeReadout
__setattr__(name, value) | TrgObject
destination() | TrgEngineRequest
fourRange() | TrgEngineRequest
marker(markerValue=0) | TrgEngineRequest
sequence() | TrgInjectChargeReadout
zeroSuppress() | TrgEngineRequest

Generated on Fri Jul 21 13:28:18 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgInjectMarker Member List

This is the complete list of members for TrgInjectMarker, including all inherited members.

__init__(marker) | TrgInjectMarker
TrgEngines::TrgEngineRequest::__init__() | TrgEngineRequest
__setattr__(name, value) | TrgObject
destination() | TrgEngineRequest
fourRange() | TrgEngineRequest
marker() | TrgInjectMarker
TrgEngines::TrgEngineRequest::marker(markerValue=0) | TrgEngineRequest
sequence() | TrgInjectMarker
zeroSuppress() | TrgEngineRequest

Generated on Fri Jul 21 13:28:19 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgReadout Member List

This is the complete list of members for TrgReadout, including all inherited members.

__init__() | TrgReadout
__setattr__(name, value) | TrgObject
destination() | TrgEngineRequest
fourRange() | TrgEngineRequest
marker(markerValue=0) | TrgEngineRequest
sequence() | TrgReadout
zeroSuppress() | TrgEngineRequest

Generated on Fri Jul 21 13:28:18 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgEventCounter Member List

This is the complete list of members for TrgEventCounter, including all inherited members.

__init__() | TrgEventCounter
__setattr__(name, value) | TrgObject
reset() | TrgEventCounter
stats() | TrgEventCounter

Generated on Fri Jul 21 13:28:19 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgGem Member List

This is the complete list of members for TrgGem, including all inherited members.

__init__() | TrgGem
__setattr__(name, value) | TrgObject
cmdCounters() | TrgGem
cnoCounters() | TrgGem
cnoEnableRegister() | TrgGemRegisters
conditions() | TrgAbstract
configurationRegister() | TrgGemRegisters
disable() | TrgGem
enable(mask=None) (defined in TrgGem) | TrgGem
TrgGemRegisters::TrgGemRegisters::enable() | TrgAbstract
engines() | TrgAbstract
eventCounter() | TrgGem
eventDataParityEven() | TrgGemRegisters
eventHeaderParityEven() | TrgGemRegisters
externalEnableRegister() | TrgGemRegisters
GEM(glt=None) | TrgGem
inhibitContribution() | TrgGemRegisters
inputEnables() | TrgAbstract
lookupTableRegister(registerNumber) | TrgGemRegisters
maxConditions() | TrgGemAbstract
maxEngines() | TrgGemAbstract
periodicCondition() | TrgGemAbstract
periodicLimitRegister() | TrgGemRegisters
periodicModeRegister() | TrgGemRegisters
periodicRateRegister() | TrgGemRegisters
ppsTimer() | TrgGem
redundantPPS() | TrgGemAbstract
responseDataParityEven() | TrgGemRegisters
responseHeaderParityEven() | TrgGemRegisters
roi() | TrgGemAbstract
roiRegister(registerNumber) | TrgGemRegisters
sequence() | TrgAbstract
sequenceRegister() | TrgGemRegisters
shut(marker) | TrgGem
solicit() | TrgGem
templateRegister(registerNumber) | TrgGemRegisters
tileCounters() | TrgGem
tileEnableRegister(registerNumber) | TrgGemRegisters
towerBusyEnableRegister() | TrgGemRegisters
towerEnableRegister(registerNumber) | TrgGemRegisters
triggerCounters() | TrgGem
triggerParityEven() | TrgGemRegisters
useAcdAsTrigger() | TrgGemAbstract
version() | TrgGem
width() | TrgGemRegisters
widthRegister() | TrgGemRegisters

Generated on Fri Jul 21 13:28:20 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgGemAbstract Member List

This is the complete list of members for TrgGemAbstract, including all inherited members.

__init__() | TrgGemAbstract
__setattr__(name, value) | TrgObject
cmdCounters() | TrgGemAbstract
cnoCounters() | TrgGemAbstract
conditions() | TrgAbstract
disable() | TrgAbstract
enable() | TrgAbstract
engines() | TrgAbstract
eventCounter() | TrgGemAbstract
eventDataParityEven() | TrgGemAbstract
eventHeaderParityEven() | TrgGemAbstract
inhibitContribution() | TrgGemAbstract
inputEnables() | TrgAbstract
maxConditions() | TrgGemAbstract
maxEngines() | TrgGemAbstract
periodicCondition() | TrgGemAbstract
ppsTimer() | TrgGemAbstract
redundantPPS() | TrgGemAbstract
responseDataParityEven() | TrgGemAbstract
responseHeaderParityEven() | TrgGemAbstract
roi() | TrgGemAbstract
sequence() | TrgAbstract
shut(marker) | TrgAbstract
solicit() | TrgAbstract
tileCounters() | TrgGemAbstract
triggerCounters() | TrgGemAbstract
triggerParityEven() | TrgGemAbstract
useAcdAsTrigger() | TrgGemAbstract
version() | TrgAbstract
width() | TrgGemAbstract

Generated on Fri Jul 21 13:28:20 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgGemCmdCounters Member List

This is the complete list of members for TrgGemCmdCounters, including all inherited members.

__init__(glt) | TrgGemCmdCounters
TrgCmdCounters::TrgCmdCounters::__init__() | TrgCmdCounters
__setattr__(name, value) | TrgObject
reset() | TrgGemCmdCounters
stats() | TrgGemCmdCounters

Generated on Fri Jul 21 13:28:23 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgGemCmdStats Member List

This is the complete list of members for TrgGemCmdStats, including all inherited members.

__init__(glt) | TrgGemCmdStats
TrgCmdCounters::TrgCmdStats::__init__() | TrgCmdStats
__setattr__(name, value) | TrgObject
command() | TrgGemCmdStats
response() | TrgGemCmdStats

Generated on Fri Jul 21 13:28:24 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgGemCnoCounters Member List

This is the complete list of members for TrgGemCnoCounters, including all inherited members.

__init__(glt) | TrgGemCnoCounters
__init__() (defined in TrgCnoCounters) | TrgCnoCounters
__setattr__(name, value) | TrgObject
assignA(CnoNumber) | TrgGemCnoCounters
TrgCnoCounters::TrgCnoCounters::assignA(a) | TrgCnoCounters
assignAB(a, b) | TrgGemCnoCounters
assignB(CnoNumber) | TrgGemCnoCounters
TrgCnoCounters::TrgCnoCounters::assignB(B) | TrgCnoCounters
reset() | TrgGemCnoCounters
stats() | TrgGemCnoCounters

Generated on Fri Jul 21 13:28:22 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgGemCnoStats Member List

This is the complete list of members for TrgGemCnoStats, including all inherited members.

__init__(glt) | TrgGemCnoStats
__init__() (defined in TrgCnoStats) | TrgCnoStats
__setattr__(name, value) | TrgObject
A() | TrgGemCnoStats
B() | TrgGemCnoStats

Generated on Fri Jul 21 13:28:23 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgGemEventCounter Member List

This is the complete list of members for TrgGemEventCounter, including all inherited members.

__init__(glt) | TrgGemEventCounter
TrgEventCounter::TrgEventCounter::__init__() | TrgEventCounter
__setattr__(name, value) | TrgObject
reset() | TrgGemEventCounter
stats() | TrgGemEventCounter

Generated on Fri Jul 21 13:28:24 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgGemPPSTimer Member List

This is the complete list of members for TrgGemPPSTimer, including all inherited members.

__init__(glt) | TrgGemPPSTimer
TrgPPSTimer::TrgPPSTimer::__init__() | TrgPPSTimer
__setattr__(name, value) | TrgObject
seconds() | TrgGemPPSTimer
timebase() | TrgGemPPSTimer

Generated on Fri Jul 21 13:28:24 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgGemTileCounters Member List

This is the complete list of members for TrgGemTileCounters, including all inherited members.

__init__(glt) | TrgGemTileCounters
__init__() (defined in TrgTileCounters) | TrgTileCounters
__setattr__(name, value) | TrgObject
assignA(tileNumber) | TrgGemTileCounters
TrgTileCounters::TrgTileCounters::assignA(a) | TrgTileCounters
assignAB(a, b) | TrgGemTileCounters
assignB(tileNumber) | TrgGemTileCounters
TrgTileCounters::TrgTileCounters::assignB(B) | TrgTileCounters
reset() | TrgGemTileCounters
stats() | TrgGemTileCounters

Generated on Fri Jul 21 13:28:21 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgGemTileStats Member List

This is the complete list of members for TrgGemTileStats, including all inherited members.

__init__(glt) | TrgGemTileStats
__init__() (defined in TrgTileStats) | TrgTileStats
__setattr__(name, value) | TrgObject
A() | TrgGemTileStats
B() | TrgGemTileStats

Generated on Fri Jul 21 13:28:22 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgGemTriggerCounters Member List

This is the complete list of members for TrgGemTriggerCounters, including all inherited members.

__init__(glt) | TrgGemTriggerCounters
TrgTriggerCounters::TrgTriggerCounters::__init__() | TrgTriggerCounters
__setattr__(name, value) | TrgObject
reset() | TrgGemTriggerCounters
stats() | TrgGemTriggerCounters

Generated on Fri Jul 21 13:28:21 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgGemTriggerStats Member List

This is the complete list of members for TrgGemTriggerStats, including all inherited members.

__init__(glt) | TrgGemTriggerStats
__init__() (defined in TrgTriggerStats) | TrgTriggerStats
__setattr__(name, value) | TrgObject
discarded() | TrgGemTriggerStats
livetime() | TrgGemTriggerStats
prescaled() | TrgGemTriggerStats
sent() | TrgGemTriggerStats

Generated on Fri Jul 21 13:28:21 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgGemPeriodicCondition Member List

This is the complete list of members for TrgGemPeriodicCondition, including all inherited members.

__init__() | TrgGemPeriodicCondition
__setattr__(name, value) | TrgObject
abort() | TrgGemPeriodicCondition
definition() | TrgPeriodicCondition
limit() | TrgGemPeriodicCondition
prescale() | TrgGemPeriodicCondition
remaining() | TrgGemPeriodicCondition
reset() | TrgGemPeriodicCondition
source() | TrgGemPeriodicCondition

Generated on Fri Jul 21 13:28:25 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

ACDmap Member List

This is the complete list of members for ACDmap, including all inherited members.

__init__(gemVersion=None) (defined in ACDmap) | ACDmap
freeName(cable) (defined in ACDmap) | ACDmap
lookup(cable, channel) (defined in ACDmap) | ACDmap

Generated on Fri Jul 21 13:28:25 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgGemRegisters Member List

This is the complete list of members for TrgGemRegisters, including all inherited members.

__init__() | TrgGemRegisters
__setattr__(name, value) | TrgObject
cmdCounters() | TrgGemAbstract
cnoCounters() | TrgGemAbstract
cnoEnableRegister() | TrgGemRegisters
conditions() | TrgAbstract
configurationRegister() | TrgGemRegisters
disable() | TrgAbstract
enable() | TrgAbstract
engines() | TrgAbstract
eventCounter() | TrgGemAbstract
eventDataParityEven() | TrgGemRegisters
eventHeaderParityEven() | TrgGemRegisters
externalEnableRegister() | TrgGemRegisters
inhibitContribution() | TrgGemRegisters
inputEnables() | TrgAbstract
lookupTableRegister(registerNumber) | TrgGemRegisters
maxConditions() | TrgGemAbstract
maxEngines() | TrgGemAbstract
periodicCondition() | TrgGemAbstract
periodicLimitRegister() | TrgGemRegisters
periodicModeRegister() | TrgGemRegisters
periodicRateRegister() | TrgGemRegisters
ppsTimer() | TrgGemAbstract
redundantPPS() | TrgGemAbstract
responseDataParityEven() | TrgGemRegisters
responseHeaderParityEven() | TrgGemRegisters
roi() | TrgGemAbstract
roiRegister(registerNumber) | TrgGemRegisters
sequence() | TrgAbstract
sequenceRegister() | TrgGemRegisters
shut(marker) | TrgAbstract
solicit() | TrgAbstract
templateRegister(registerNumber) | TrgGemRegisters
tileCounters() | TrgGemAbstract
tileEnableRegister(registerNumber) | TrgGemRegisters
towerBusyEnableRegister() | TrgGemRegisters
towerEnableRegister(registerNumber) | TrgGemRegisters
triggerCounters() | TrgGemAbstract
triggerParityEven() | TrgGemRegisters
useAcdAsTrigger() | TrgGemAbstract
version() | TrgAbstract
width() | TrgGemRegisters
widthRegister() | TrgGemRegisters

Generated on Fri Jul 21 13:28:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgGemSequence Member List

This is the complete list of members for TrgGemSequence, including all inherited members.

__init__() | TrgGemSequence
__setattr__(name, value) | TrgObject
definition() | TrgSequence
eventNumber() | TrgGemSequence
eventTag() | TrgGemSequence

Generated on Fri Jul 21 13:28:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgCnoEnables Member List

This is the complete list of members for TrgCnoEnables, including all inherited members.

__init__() | TrgCnoEnables
__setattr__(name, value) | TrgObject
LA1() | TrgCnoEnables
LA2() | TrgCnoEnables
LA3() | TrgCnoEnables
LA4() | TrgCnoEnables
LB2() | TrgCnoEnables
LB4() | TrgCnoEnables
RA2() | TrgCnoEnables
RA4() | TrgCnoEnables
RB1() | TrgCnoEnables
RB2() | TrgCnoEnables
RB3() | TrgCnoEnables
RB4() | TrgCnoEnables

Generated on Fri Jul 21 13:28:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgExtEnables Member List

This is the complete list of members for TrgExtEnables, including all inherited members.

__init__() | TrgExtEnables
__setattr__(name, value) | TrgObject
external() | TrgExtEnables

Generated on Fri Jul 21 13:28:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgInputEnables Member List

This is the complete list of members for TrgInputEnables, including all inherited members.

__init__() | TrgInputEnables
__setattr__(name, value) | TrgObject
cno() | TrgInputEnables
external() | TrgInputEnables
tiles() | TrgInputEnables
towerBusy() | TrgInputEnables
towers() | TrgInputEnables

Generated on Fri Jul 21 13:28:26 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgTileEnables Member List

This is the complete list of members for TrgTileEnables, including all inherited members.

__init__() | TrgTileEnables
__setattr__(name, value) | TrgObject
tile(tileNumber) | TrgTileEnables

Generated on Fri Jul 21 13:28:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgTowerBusyEnables Member List

This is the complete list of members for TrgTowerBusyEnables, including all inherited members.

__init__() | TrgTowerBusyEnables
__setattr__(name, value) | TrgObject
tower(towerNumber) | TrgTowerBusyEnables

Generated on Fri Jul 21 13:28:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgTowerEnables Member List

This is the complete list of members for TrgTowerEnables, including all inherited members.

__init__() | TrgTowerEnables
__setattr__(name, value) | TrgObject
towers() | TrgTowerEnables

Generated on Fri Jul 21 13:28:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

MiniGLTTrgConditionsValue Member List

This is the complete list of members for MiniGLTTrgConditionsValue, including all inherited members.

__init__() | MiniGLTTrgConditionsValue
__setattr__(name, value) | TrgObject
calHigh() | TrgConditionsValue
calLow() | TrgConditionsValue
cno() | TrgConditionsValue
external() | MiniGLTTrgConditionsValue
periodic() | TrgConditionsValue
roi() | TrgConditionsValue
solicited() | TrgConditionsValue
tkr() | TrgConditionsValue
value() | MiniGLTTrgConditionsValue

Generated on Fri Jul 21 13:28:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgMiniGLT Member List

This is the complete list of members for TrgMiniGLT, including all inherited members.

__init__() | TrgMiniGLT
__setattr__(name, value) | TrgObject
calStrobe() | TrgMiniGLTRegisters
conditions() | TrgAbstract
destination() | TrgMiniGLTRegisters
disable() | TrgMiniGLT
enable(mask=None) (defined in TrgMiniGLT) | TrgMiniGLT
TrgMiniGLTRegisters::TrgMiniGLTRegisters::enable() | TrgAbstract
engines() | TrgAbstract
eventNumber() | TrgMiniGLTRegisters
fourRangeReadout() | TrgMiniGLTRegisters
GLT(glt=None) | TrgMiniGLT
inputEnables() | TrgAbstract
marker() | TrgMiniGLTRegisters
maxConditions() | TrgAbstract
maxEngines() | TrgAbstract
parity() | TrgMiniGLTRegisters
sequence() | TrgAbstract
shut(marker) | TrgMiniGLT
solicit() | TrgMiniGLT
tack() | TrgMiniGLTRegisters
tag() | TrgMiniGLTRegisters
version() | TrgAbstract
zeroSuppress() | TrgMiniGLTRegisters

Generated on Fri Jul 21 13:28:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgMiniGLTAbstract Member List

This is the complete list of members for TrgMiniGLTAbstract, including all inherited members.

__init__() | TrgMiniGLTAbstract
__setattr__(name, value) | TrgObject
calStrobe() | TrgMiniGLTAbstract
conditions() | TrgAbstract
destination() | TrgMiniGLTAbstract
disable() | TrgAbstract
enable() | TrgAbstract
engines() | TrgAbstract
eventNumber() | TrgMiniGLTAbstract
fourRangeReadout() | TrgMiniGLTAbstract
inputEnables() | TrgAbstract
marker() | TrgMiniGLTAbstract
maxConditions() | TrgAbstract
maxEngines() | TrgAbstract
parity() | TrgMiniGLTAbstract
sequence() | TrgAbstract
shut(marker) | TrgAbstract
solicit() | TrgAbstract
tack() | TrgMiniGLTAbstract
tag() | TrgMiniGLTAbstract
version() | TrgAbstract
zeroSuppress() | TrgMiniGLTAbstract

Generated on Fri Jul 21 13:28:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgMiniGLTRegisters Member List

This is the complete list of members for TrgMiniGLTRegisters, including all inherited members.

__init__() | TrgMiniGLTRegisters
__setattr__(name, value) | TrgObject
calStrobe() | TrgMiniGLTRegisters
conditions() | TrgAbstract
destination() | TrgMiniGLTRegisters
disable() | TrgAbstract
enable() | TrgAbstract
engines() | TrgAbstract
eventNumber() | TrgMiniGLTRegisters
fourRangeReadout() | TrgMiniGLTRegisters
inputEnables() | TrgAbstract
marker() | TrgMiniGLTRegisters
maxConditions() | TrgAbstract
maxEngines() | TrgAbstract
parity() | TrgMiniGLTRegisters
sequence() | TrgAbstract
shut(marker) | TrgAbstract
solicit() | TrgAbstract
tack() | TrgMiniGLTRegisters
tag() | TrgMiniGLTRegisters
version() | TrgAbstract
zeroSuppress() | TrgMiniGLTRegisters

Generated on Fri Jul 21 13:28:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgObject Member List

This is the complete list of members for TrgObject, including all inherited members.

__setattr__(name, value) TrgObject

Generated on Fri Jul 21 13:28:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgDefaultPeriodicCondition Member List

This is the complete list of members for TrgDefaultPeriodicCondition, including all inherited members.

__init__() | TrgDefaultPeriodicCondition
__setattr__(name, value) | TrgObject
limit() | TrgDefaultPeriodicCondition
prescale() | TrgDefaultPeriodicCondition
source() | TrgDefaultPeriodicCondition

Generated on Fri Jul 21 13:28:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgPeriodicCondition Member List

This is the complete list of members for TrgPeriodicCondition, including all inherited members.

__init__() | TrgPeriodicCondition
__setattr__(name, value) | TrgObject
abort() | TrgPeriodicCondition
definition() | TrgPeriodicCondition
limit() | TrgPeriodicConditionAbstract
prescale() | TrgPeriodicConditionAbstract
remaining() | TrgPeriodicCondition
reset() | TrgPeriodicCondition
source() | TrgPeriodicConditionAbstract

Generated on Fri Jul 21 13:28:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgPeriodicConditionAbstract Member List

This is the complete list of members for TrgPeriodicConditionAbstract, including all inherited members.

__init__() | TrgPeriodicConditionAbstract
__setattr__(name, value) | TrgObject
limit() | TrgPeriodicConditionAbstract
prescale() | TrgPeriodicConditionAbstract
source() | TrgPeriodicConditionAbstract

Generated on Fri Jul 21 13:28:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgPeriodicConditionDefinition Member List

This is the complete list of members for TrgPeriodicConditionDefinition, including all inherited members.

__init__() | TrgPeriodicConditionDefinition
__setattr__(name, value) | TrgObject
limit() | TrgPeriodicConditionAbstract
prescale() | TrgPeriodicConditionAbstract
source() | TrgPeriodicConditionAbstract

Generated on Fri Jul 21 13:28:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgPPSTimer Member List

This is the complete list of members for TrgPPSTimer, including all inherited members.

__init__() | TrgPPSTimer
__setattr__(name, value) | TrgObject
seconds() | TrgPPSTimer
timebase() | TrgPPSTimer

Generated on Fri Jul 21 13:28:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

AddableRoi Member List

This is the complete list of members for AddableRoi, including all inherited members.

__init__() | AddableRoi
__setattr__(name, value) | TrgObject
addTile(tile) (defined in AddableRoi) | AddableRoi
tile(tileNumber) | AddableRoi

Generated on Fri Jul 21 13:28:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgRoiAsTiles Member List

This is the complete list of members for TrgRoiAsTiles, including all inherited members.

__init__() | TrgRoiAsTiles
__setattr__(name, value) | TrgObject
addCoincidence(cNumber, coinc) (defined in TrgRoiAsTiles) | TrgRoiAsTiles
coincidence(coincidenceNumber) | TrgRoiAsTiles
roi(roiNumber) (defined in TrgRoiAsTiles) | TrgRoiAsTiles
TrgCoincidences::TrgCoincidences::roi(regionNumber) | TrgRois

Generated on Fri Jul 21 13:28:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

MyRoi Member List

This is the complete list of members for MyRoi, including all inherited members.

__init__() | MyRoi
__setattr__(name, value) | TrgObject
tile(tileNumber) | MyRoi

Generated on Fri Jul 21 13:28:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgRoiAsVeto Member List

This is the complete list of members for TrgRoiAsVeto, including all inherited members.

__init__() | TrgRois
__setattr__(name, value) | TrgObject
roi(roiNumber) (defined in TrgRoiAsVeto) | TrgRoiAsVeto
TrgCoincidences::TrgRois::roi(regionNumber) | TrgRois

Generated on Fri Jul 21 13:28:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgDefaultSequence Member List

This is the complete list of members for TrgDefaultSequence, including all inherited members.

__init__() | TrgDefaultSequence
__setattr__(name, value) | TrgObject
eventNumber() | TrgDefaultSequence
eventTag() | TrgDefaultSequence

Generated on Fri Jul 21 13:28:36 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgSequence Member List

This is the complete list of members for TrgSequence, including all inherited members.

__init__() | TrgSequence
__setattr__(name, value) | TrgObject
definition() | TrgSequence
eventNumber() | TrgSequenceAbstract
eventTag() | TrgSequenceAbstract

Generated on Fri Jul 21 13:28:36 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgSequenceAbstract Member List

This is the complete list of members for TrgSequenceAbstract, including all inherited members.

__init__() | TrgSequenceAbstract
__setattr__(name, value) | TrgObject
eventNumber() | TrgSequenceAbstract
eventTag() | TrgSequenceAbstract

Generated on Fri Jul 21 13:28:35 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgSequenceDefinition Member List

This is the complete list of members for TrgSequenceDefinition, including all inherited members.

__init__() | TrgSequenceDefinition
__setattr__(name, value) | TrgObject
eventNumber() | TrgSequenceAbstract
eventTag() | TrgSequenceAbstract

Generated on Fri Jul 21 13:28:35 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgTileCounters Member List

This is the complete list of members for TrgTileCounters, including all inherited members.

__init__() (defined in TrgTileCounters) | TrgTileCounters
__setattr__(name, value) | TrgObject
assignA(a) | TrgTileCounters
assignAB(a, b) | TrgTileCounters
assignB(B) | TrgTileCounters
reset() | TrgTileCounters
stats() | TrgTileCounters

Generated on Fri Jul 21 13:28:36 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgTileStats Member List

This is the complete list of members for TrgTileStats, including all inherited members.

__init__() (defined in TrgTileStats) | TrgTileStats
__setattr__(name, value) | TrgObject
A() | TrgTileStats
B() | TrgTileStats

Generated on Fri Jul 21 13:28:37 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgCalorimeter Member List

This is the complete list of members for TrgCalorimeter, including all inherited members.

__init__() | TrgCalorimeter
__setattr__(name, value) | TrgObject
useHighEnergy() | TrgCalorimeter
useLowEnergy() | TrgCalorimeter

Generated on Fri Jul 21 13:28:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgTower Member List

This is the complete list of members for TrgTower, including all inherited members.

__init__() | TrgTower
__setattr__(name, value) | TrgObject
calorimeter() | TrgTower
tracker() | TrgTower

Generated on Fri Jul 21 13:28:37 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgTowers Member List

This is the complete list of members for TrgTowers, including all inherited members.

__init__() | TrgTowers
__setattr__(name, value) | TrgObject
tower(towerNumber) | TrgTowers

Generated on Fri Jul 21 13:28:37 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgTracker Member List

This is the complete list of members for TrgTracker, including all inherited members.

__init__() | TrgTracker
__setattr__(name, value) | TrgObject
use() | TrgTracker

Generated on Fri Jul 21 13:28:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgTriggerCounters Member List

This is the complete list of members for TrgTriggerCounters, including all inherited members.

__init__() | TrgTriggerCounters
__setattr__(name, value) | TrgObject
reset() | TrgTriggerCounters
stats() | TrgTriggerCounters

Generated on Fri Jul 21 13:28:38 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgTriggerStats Member List

This is the complete list of members for TrgTriggerStats, including all inherited members.

__init__() (defined in TrgTriggerStats) | TrgTriggerStats
__setattr__(name, value) | TrgObject
discarded() | TrgTriggerStats
livetime() | TrgTriggerStats
prescaled() | TrgTriggerStats
sent() | TrgTriggerStats

Generated on Fri Jul 21 13:28:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

DefaultPeriodicCondition Member List

This is the complete list of members for DefaultPeriodicCondition, including all inherited members.

__init__() | DefaultPeriodicCondition
__setattr__(name, value) | TrgObject
abort() | TrgGemPeriodicCondition
definition() | DefaultPeriodicCondition
limit() | TrgGemPeriodicCondition
prescale() | TrgGemPeriodicCondition
remaining() | TrgGemPeriodicCondition
reset() | TrgGemPeriodicCondition
source() | TrgGemPeriodicCondition

Generated on Fri Jul 21 13:28:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

DefaultSequence Member List

This is the complete list of members for DefaultSequence, including all inherited members.

__init__() | TrgGemSequence
__setattr__(name, value) | TrgObject
definition() | DefaultSequence
eventNumber() | TrgGemSequence
eventTag() | TrgGemSequence

Generated on Fri Jul 21 13:28:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

TrgUsingTiles Member List

This is the complete list of members for TrgUsingTiles, including all inherited members.

__init__() | TrgUsingTiles
__setattr__(name, value) | TrgObject
cmdCounters() | TrgGem
cnoCounters() | TrgGem
cnoEnableRegister() | TrgGemRegisters
coincidences() | TrgUsingTiles
commit(gem=None) | rcTrgGem
conditions() | TrgAbstract
configurationRegister() | TrgGemRegisters
disable() | rcTrgGem
enable(mask=None) | rcTrgGem
TrgGemRegisters::TrgGemRegisters::enable() | TrgAbstract
engines() | TrgAbstract
eventCounter() | TrgGem
eventDataParityEven() | TrgGemRegisters
eventHeaderParityEven() | TrgGemRegisters
externalEnableRegister() | TrgGemRegisters
GEM(glt=None) | TrgGem
getDisableTime() | rcTrgGem
getEnableTime() | rcTrgGem
getTimeStamp() | rcTrgGem
inhibitContribution() | TrgGemRegisters
inputEnables() | TrgAbstract
lookupTableRegister(registerNumber) | TrgGemRegisters
maxConditions() | TrgGemAbstract
maxEngines() | TrgGemAbstract
periodicCondition() | TrgUsingTiles
periodicLimitRegister() | TrgGemRegisters
periodicModeRegister() | TrgGemRegisters
periodicRateRegister() | TrgGemRegisters
ppsTimer() | TrgGem
redundantPPS() | TrgGemAbstract
responseDataParityEven() | TrgGemRegisters
responseHeaderParityEven() | TrgGemRegisters
roi() | TrgUsingTiles
roiRegister(registerNumber) | TrgGemRegisters
sequence() | TrgUsingTiles
sequenceRegister() | TrgGemRegisters
shut(sweepEvent, progress=None) | rcTrgGem
TrgGem::TrgGem::shut(marker) | TrgGem
solicit() | TrgGem
sweepOnShut() | rcTrgGem
templateRegister(registerNumber) | TrgGemRegisters
tileCounters() | TrgGem
tileEnableRegister(registerNumber) | TrgGemRegisters
towerBusyEnableRegister() | TrgGemRegisters
towerEnableRegister(registerNumber) | TrgGemRegisters
triggerCounters() | TrgGem
triggerParityEven() | TrgGemRegisters
useAcdAsTrigger() | TrgUsingTiles
version() | TrgGem
waitForMaskEnable(tmo=None) | rcTrgGem
width() | TrgGemRegisters
widthRegister() | TrgGemRegisters

Generated on Fri Jul 21 13:28:39 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

panelsTest Member List

This is the complete list of members for panelsTest, including all inherited members.

getUserApp() (defined in panelsTest) panelsTest

Generated on Fri Jul 21 13:28:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

rcTest Member List

This is the complete list of members for rcTest, including all inherited members.

addPanel(name, browser) (defined in rcTest) | rcTest
panels() (defined in rcTest) | rcTest
preferences() (defined in rcTest) | rcTest

Generated on Fri Jul 21 13:28:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userAppBrowser Member List

This is the complete list of members for userAppBrowser, including all inherited members.

__init__(rc, appdir) (defined in userAppBrowser) | userAppBrowser
append(message, level) (defined in userAppBrowser) | userAppBrowser
getGui(appname) (defined in userAppBrowser) | userAppBrowser
getTree() (defined in userAppBrowser) | userAppBrowser
loaded(appgui) (defined in userAppBrowser) | userAppBrowser
PauseClicked() (defined in userAppBrowser) | userAppBrowser
purge() (defined in userAppBrowser) | userAppBrowser
ResetClicked() (defined in userAppBrowser) | userAppBrowser
RunClicked() (defined in userAppBrowser) | userAppBrowser
StopClicked() (defined in userAppBrowser) | userAppBrowser
updateSchema() (defined in userAppBrowser) | userAppBrowser
updateSuites() (defined in userAppBrowser) | userAppBrowser
verbosity() (defined in userAppBrowser) | userAppBrowser

Generated on Fri Jul 21 13:28:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userModule Member List

This is the complete list of members for userModule, including all inherited members.

__init__(root, packagename, groupname, appname) (defined in userModule) | userModule
reload() (defined in userModule) | userModule

Generated on Fri Jul 21 13:28:40 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userAppLeaf Member List

This is the complete list of members for userAppLeaf, including all inherited members.

__del__() (defined in userAppLeaf) | userAppLeaf
__init__(lat, node, parent) | userAppLeaf
close() (defined in userAppLeaf) | userAppLeaf
collapse_family() | userAppLeaf
copyCheckedNodes(from_leaf) | userAppLeaf
createWindow(parent) | userAppLeaf
expand_family(value=1) | userAppLeaf
getInputNodes(of_class_type=None) | userAppLeaf
getLeaf(leaf) | userAppLeaf
getLogDir() | userAppLeaf
getRC() (defined in userAppLeaf) | userAppLeaf
getTree() | userAppLeaf
isOn() (defined in userAppLeaf) | userAppLeaf
leafActionsTuples() | userAppLeaf
loadAppWindows(leaf_window_list) | userAppLeaf
module() | userAppLeaf
name() | userAppLeaf
paintCell(p, cg, column, width, align) | userAppLeaf
paintFocus(p, cg, r) | userAppLeaf
paintWarning(value) | userAppLeaf
pressedEvent(pos, column) (defined in userAppLeaf) | userAppLeaf
rect() | userAppLeaf
select_family(value=1) | userAppLeaf
selectFamilyClicked(value=1) (defined in userAppLeaf) | userAppLeaf
setOn(value) | userAppLeaf
setStatus(status_descr) (defined in userAppLeaf) | userAppLeaf
setWarning(value) | userAppLeaf
stateChangeClicked() (defined in userAppLeaf) | userAppLeaf
triggerCmdCliUpdate() (defined in userAppLeaf) | userAppLeaf
triggerInputsUpdate() | userAppLeaf
triggerPolling() (defined in userAppLeaf) | userAppLeaf
unselect_family() | userAppLeaf
unselectFamilyClicked() (defined in userAppLeaf) | userAppLeaf
updatePWarning() | userAppLeaf

Generated on Fri Jul 21 13:28:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userAppLoader Member List

This is the complete list of members for userAppLoader, including all inherited members.

clearState(module) (defined in userAppLoader) | userAppLoader
isChecked(module) (defined in userAppLoader) | userAppLoader
load() (defined in userAppLoader) | userAppLoader
loaded() (defined in userAppLoader) | userAppLoader
reimport() (defined in userAppLoader) | userAppLoader
setState(module, failed) (defined in userAppLoader) | userAppLoader
unloaded() (defined in userAppLoader) | userAppLoader
updateSchema() (defined in userAppLoader) | userAppLoader

Generated on Fri Jul 21 13:28:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Member List

userAppTree Member List

This is the complete list of members for userAppTree, including all inherited members.

AddLeaf(leaf) | userAppTree
clearLeaves() (defined in userAppTree) | userAppTree
close() (defined in userAppTree) | userAppTree
copyCheckedNodes(from_tree) | userAppTree
getAllLeaves() (defined in userAppTree) | userAppTree
getInputNodes(of_class_type=None) | userAppTree
getLeaf(leaf) | userAppTree
loadNodes(lat, leaf_class=None) | userAppTree
pressedEvent(leaf, pos, column) (defined in userAppTree) | userAppTree
rightMouseClicked(leaf) | userAppTree
setCopyFromMenu(from_list, method) | userAppTree
setStatus(leaf, descr) | userAppTree

Generated on Fri Jul 21 13:28:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Collector.py Source File

monitoring

Collector.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Housekeeping server infrastructure"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "07/28/04"
00014 __version__  = "$Revision: 1.6 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import logging
00021 import threading
00022 import time
00023
00024 class Collector(object):
00025   def __init__(self, *args):
00026     self.__loopStop   = 0
00027     self.__monDelay   = 0
00028     self.__monThread  = None
00029     self.__retrievers = {}
00030     self.__recorders  = []
00031     self.__delayUnits = 0.01  # seconds
00032     self.__log        = logging.getLogger('collecting.Collector')
00033     self.setDelay(10)
00034
00035   def addRetriever(self,name,retriever):
00036     self.__retrievers[name]=retriever
00037     retriever.startup()
00038
00039   def delRetriever(self,name):
00040     if self.__retrievers.has_key(name):
00041       del self.__retrievers[name]
00042
00043   def addRecorder(self,recorder):
00044     self.__recorders.append(recorder)
00045
00046   def setDelay(self,delay):
00047     """Set the delay in units of seconds  If the delay < 0, delay set to 0.
00048     """
00049     if delay < 0:
00050       delay = 0
00051     acq = self.isAcquiring()
00052     self.setAcquiring(0)
00053     self.__monDelay = int(delay / self.__delayUnits)
00054     self.setAcquiring(acq)
00055
00056   def getDelay(self):
00057     return self.__monDelay * self.__delayUnits
00058
00059   def isAcquiring(self):
00060     if self.__monThread:
00061       return 1
00062     return 0
00063
00064   def setAcquiring(self,bool):
00065     if bool:
00066       self.__startLoop()
00067     else:
00068       self.__stopLoop()
00069
00070   def collectData(self):
00071     for r in self.__retrievers.values():
00072       data = r.retrievePacket()
00073       # Process the data
00074       for l in self.__recorders:
00075         l.updateTrends(data)
00076
00077   def shutdown(self):
00078     for r in self.__retrievers.values() + self.__recorders:
00079       r.shutdown()
00080     self.__stopLoop()
00081
00082   def __startLoop(self):
00083     if self.__monThread:
00084       self.__log.warning("There is already a Collector Loop")
00085     else:
00086       self.__monThread = threading.Thread(None,
00087                                           self.__monLoop,
00088                                           'Collector',
00089                                           (self.__monDelay,))
00090       self.__monThread.start()
00091
00092   def __stopLoop(self):
00093     if self.__monThread:
00094       self.__log.info("Shutting down Collector Loop")
00095       self.__loopStop  = 1
00096       self.__monThread.join()
00097       self.__monThread = None
00098       self.__loopStop  = 0
00099
00100   def __monLoop(self,delay):
00101     self.__log.info("Starting Collector Loop")
00102     while (not self.__loopStop):
00103       self.collectData()
00104       for i in xrange(delay):
00105         if (self.__loopStop):
00106           break;
00107         time.sleep(self.__delayUnits)
00108     self.__log.info("Collector Loop Stopped")
00109
00110 def testCollector():
00111   logging.basicConfig()
00112   logging.root.setLevel(logging.DEBUG)
00113
00114   udpServerName = 'testTrendingServer'
00115   udpServerAddr = '54320@239.255.1.14'
00116   from Retriever import DummyRetriever
00117   from Recorder  import UDPRecorder, DummyRecorder
00118
00119   c   = Collector()
00120   rec = UDPRecorder()
00121   rec.startUDPServer(udpServerName,udpServerAddr)
00122   c.addRetriever('dummy',DummyRetriever())
00123   c.addRecorder(rec)
00124   c.addRecorder(DummyRecorder())
00125   c.setAcquiring(True)
00126
00127   try:
00128     while 1:
00129       time.sleep(.01)
00130   except Exception, e:
00131     c.shutdown()
00132
00133 if __name__ == '__main__':
00134   testCollector()
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: colorScale.py Source File

gosed

colorScale.py

00001 #!/usr/bin/env python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST Online Event Display color selector"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "10/14/04"
00014 __version__  = "$Revision: 1.3 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 def colorScale(value):
00022   """\brief Method for returning a color scale RGB tuple given a percentage.
00023
00024   Return a tuple giving the RGB values for a color chosen from a color scale:
00025     black       for value <  0.0
00026     blue (cold) for value >= 0.0
00027     .
00028     .
00029     .
00030     red (hot)   for value <= 1.0
00031     white       for value >  1.0
00032
00033   \param value - A number between 0.0 and 1.0
00034   \return A tuple containing the RGB values corresponding to the input value
00035   """
00036
00037   if value < 0.0:  return (0,     0,   0)
00038   if value > 1.0:  return (255, 255, 255)
00039
00040   r = 1.0
00041   g = 1.0
00042   b = 1.0
00043
00044   dv   = 1.0
00045   vmin = 0.0
00046   v    = value
00047
00048   if (v < (vmin + 0.25 * dv)):
00049     r = 0
00050     g = 4 * (v - vmin) / dv
00051   elif (v < (vmin + 0.5 * dv)):
00052     r = 0
00053     b = 1 + 4 * (vmin + 0.25 * dv - v) / dv
00054   elif (v < (vmin + 0.75 * dv)):
00055     r = 4 * (v - vmin - 0.5 * dv) / dv
00056     b = 0
00057   else:
00058     g = 1 + 4 * (vmin + 0.75 * dv - v) / dv
00059     b = 0
00060
00061   red   = int( r * 255. )
00062   green = int( g * 255. )
00063   blue  = int( b * 255. )
00064
00065   assert ( red < 256 and green < 256 and blue < 256 )
00066   return ( red, green, blue )
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: consumer.py Source File

consumer

consumer.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST Online consumer"
00012 __author__   = "Lester Miller"
00013 __date__     = "11/20/2003"
00014 __version__  = "$Revision: 1.5 $"
00015 __credits__  = "SLAC"
00016
00017
00018 import LATTE.copyright_SLAC
00019 import LDF
00020 import LATTE.consumer.standardLDF as standardLDF
00021 import LATTE.tools.DataDistributorPoll as DDP
00022 import LATTE.runcontrol.rcArchiver as rcArchiver
00023 import struct
00024 import time
00025 import sys
00026 import getopt
00027 import array
00028 import logging as myLog
00029
00030 class Consumer(object):
00031   """\brief Consumer class to consume LDF data
00032   This class just handles file open/close or server
00033   open/close
00034   """
00035
00036   def __init__(self,argv):
00037     """consumer constructor
00038     """
00039     # subclasses should provide iterators in constructor
00040     self.lci       = standardLDF.LATcomponentIterator()
00041     self.eei       = standardLDF.EBFeventIterator(self.lci)
00042     self.lcti      = standardLDF.LATcontributionIterator(self.eei)
00043     self.ldbi      = LDF.LATdataBufferIterator(self.lcti)
00044
00045     self.__ds          = None
00046     self.__file        = None
00047     self.__archiver    = None
00048     self.__debug       = 0
00049     self.eventData     = None
00050     self.__archiveFile = "consumer.ldf"
00051     self.__inFileName  = None
00052     self.__nEvents     = 0
00053     self.__server      = "1"
00054     self.__runId       = ''
00055     self.sleepTime     = 0.1
00056     self.startRun      = False
00057     self.endRun        = False
00058     self.parseArgs(argv)
00059
00060   def parseEvent(self):
00061     """Analyse an event
00062     """
00063     # subclasses should provide a custom iterator to iterate in this method
00064     self.ldbi.iterate(self.eventData, len(self.eventData))
00065     self.checkUDF()
00066
00067   def checkUDF(self):
00068     udfDict = self.lcti.getUdfDict()
00069     self.startRun = False
00070     if 'startRun' in udfDict:
00071       self.setRunId(udfDict['startRun'])
00072       self.startRun = True
00073     self.endRun = False
00074     if 'endRun' in udfDict:
00075       self.endRun = True
00076     self.lcti.clearUdfDict()
00077
00078   def getRunId(self):
00079     return self.__runId
00080   def setRunId(self,runId):
00081     self.__runId = runId
00082
00083   def getNextEvent(self):
00084     """get Next Event into data buffer
00085     """
00086     if self.__file is not None:
00087       evtPtr = self.__file.tell()
00088       # get datagram
00089       self.eventData = self.__file.read(8)
00090       # check for file end
00091       if len(self.eventData) < 8:
00092         myLog.info("Consumer.getNextEvent: End of File")
00093         return 0
00094       # unpack pair of big-endian 4 byte words
00095       # this is presumably broken for Sun hardware
00096       (identity, length) = struct.unpack('!LL', self.eventData)
00097       self.eventData        += self.__file.read(length - 8)
00098       if self.__debug:
00099         myLog.info("got data %d length from file" % (length))
00100       return length
00101     if self.__ds is not None:
00102       self.eventData, sender = self.__ds.receive()
00103       if self.eventData is None:
00104         #print "No data from server"
00105         return 1
00106       if self.__debug:
00107         myLog.info("got data %d length from file" % len(self.eventData))
00108       return 1
00109     myLog.warn("Consumer.getNextEvent: No data source")
00110     return 0
00111
00112   def serverOpen(self, server="1"):
00113     """  Connect to network server
00114     """
00115     myLog.info("Consumer.serverOpen: Connecting to data server %s"%(server))
00116     # Close previous data sources
00117     if self.__file is not None:
00118       self.__fileClose()
00119     if self.__ds is not None:
00120       self.serverClose()
00121     dsName = 'LAT_EBFdata'
00122     self.__ds = DDP.DataDistributorPoll(dsName)
00123     if self.__ds is not None:
00124       self.__ds.connect(server)
00125       self.__ds.start()
00126     else:
00127       myLog.warn("Consumer.serverOpen: Unable to connect to Data Distribution server %s"%(server))
00128       sys.exit(2)
00129
00130   def serverClose(self):
00131     """  Close network server
00132     """
00133     if self.__ds is not None:
00134       self.__ds.stop()
00135       self.__ds.disconnect()
00136       self.__ds = None
00137
00138   def fileOpen(self,fn):
00139     """ Load input data from a file
00140     """
00141     # Close previous data sources
00142     if self.__ds is not None:
00143       self.serverClose()
00144     if self.__file is not None:
00145       self.__fileClose()
00146     try:
00147       self.__file = open(fn, 'rb')
00148     except:
00149       myLog.warn("Consumer.fileOpen: Fatal: failed to open file %s"%(fn))
00150       sys.exit(2)
00151     print myLog.info("Consumer.fileOpen: opening file %s"%(fn))
00152
00153   def fileClose(self):
00154     """ Close input data file
00155     """
00156     if self.__file is not None:
00157       self.__file.close()
00158       self.__file = None
00159     return
00160
00161   def archiveOpen(self,fn):
00162     """ Open data archive
00163     """
00164     # make a 'being written to' version of the file
00165     openfn = fn + '_locked'
00166     # Close previous archive file
00167     if self.__archiver is not None:
00168       self.archiveClose(fn)
00169     myLog.info("Consumer.archiveOpen: opening file %s"%(fn))
00170     try:
00171       self.__archiver = rcArchiver.rcArchiver(fileName=openfn)
00172     except:
00173       myLog.warn("Consumer.archiveOpen: failed to open archive file %s"%(fn))
00174       self.__archiver = None
00175
00176   def archiveClose(self,fn):
00177     """ Close data archive
00178     """
00179     if self.__archiver is not None:
00180       self.__archiver.close()
00181       self.__archiver = None
00182       myLog.info("Consumer.archiveClose: closing archive file %s"%(fn))
00183     # move it to the requested file name if it is closed
00184     openfn = fn + '_locked'
00185     import shutil
00186     shutil.move(openfn,fn)
00187     return
00188
00189   def dataSize(self):
00190     """Return current event data size
00191     """
00192     if self.eventData is not None:
00193       return len(self.eventData)
00194     else:
00195       return 0
00196
00197   def usage(self):
00198     print "\n%s Usage:" % (sys.argv[0])
00199     print "\t-h or --help for Help"
00200     print "\t-a or --archive to specify output to archive file (default consumer.ldf)"
00201     print "\t-n or --nevents to specify the number of events archived (default 0)"
00202     print "\t-i or --infile to specify an input from file instead of server"
00203     print "\t-s or --server to specify server to connect to (default 1)"
00204     print "\t-c or --config to specify configuration file (default None, used by Plotter)"
00205     print "\t-r or --rate to specify a rate limit in Hz (default 10)"
00206
00207
00208   def parseArgs(self,argv):
00209     try:
00210       opts, args = getopt.getopt(argv, "ha:n:i:s:c:r:",
00211                                  ["help", "archive=", "nevents=", "infile=", "server=","config=","rate="])
00212     except getopt.GetoptError:
00213       # print help information and exit:
00214       self.usage()
00215       sys.exit(2)
00216     for o, a in opts:
00217       if o in ("-h", "--help"):
00218         self.usage()
00219         sys.exit()
00220       if o in ("-a", "--archive"):
00221         self.__archiveFile = a
00222       if o in ("-n", "--nevents"):
00223         self.__nEvents = int(a)
00224       if o in ("-i", "--infile"):
00225         self.__inFileName = a
00226       if o in ("-s", "--server"):
00227         self.__server = a
00228       if o in ("-c", "--config"):
00229         self.configFile = a
00230       if o in ("-r", "--rate"):
00231         rate = float(a)
00232         if rate>0:
00233           self.sleepTime = 1./rate
00234
00235   def loop(self):
00236     if self.__inFileName is not None:
00237       self.fileOpen(self.__inFileName)
00238     else:
00239       self.serverOpen(self.__server)
00240     eventCount=0
00241     archivedEventCount=0
00242     sayWaiting = 0
00243     timeLastEvent = 0
00244     while (1):
00245       self.getNextEvent()
00246       if self.eventData is not None and self.dataSize()>0:
00247         timeLastEvent = time.time()
00248         eventCount+=1
00249         self.parseEvent()
00250         # archive
00251         if self.__archiver is not None and archivedEventCount<self.__nEvents:
00252           # don't know why, but needs byte swapping?
00253           outputData = array.array('L',self.eventData)
00254           outputData.byteswap()
00255           self.__archiver.write(outputData)
00256           #self.__archiver.write(self.eventData)
00257           archivedEventCount+=1
00258         # open archive if new run seen and none open
00259         if self.__nEvents>0 and self.startRun:
00260           self.archiveOpen(self.__archiveFile)
00261         # close archive if collected enough
00262         if (self.endRun or archivedEventCount>=self.__nEvents) and self.__archiver is not None:
00263           self.archiveClose(self.__archiveFile)
00264           archivedEventCount=0
00265         if sayWaiting==1:
00266           sayWaiting=0
00267           print "resumed acquisition... (eventCount is ",eventCount,")"
00268         time.sleep(self.sleepTime) # conserve cpu...
00269       else:
00270         deltaTime = time.time() - timeLastEvent
00271         if sayWaiting==0 and deltaTime>1:
00272           sayWaiting=1
00273           print "Waiting for data..."
00274       time.sleep(0.0005) # conserve cpu...
00275
00276     myLog.info("Consumer: Read in %d events" % (eventCount))
00277     self.serverClose()
00278     self.fileClose()
00279     sys.exit()
00280
00281
00282 if __name__ == '__main__':
00283   consumer = Consumer(sys.argv[1:])
00284   consumer.loop()
00285
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: consumerPlotter.py Source File

consumer

consumerPlotter.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Glast Online consumer plotter"
00012 __author__   = "Lester Miller"
00013 __date__     = "11/20/2003"
00014 __version__  = "$Revision: 1.10 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018 import LATTE.consumer.consumer as consumer
00019 import LATTE.consumer.standardPlotter as standardPlotter
00020 import threading
00021 import sys
00022 from qt import *
00023 import Numeric as numarray
00024 import os
00025 import sihippo
00026
00027 class consumerPlotter(consumer.Consumer,standardPlotter.standardPlotter,QMainWindow):
00028   """\brief Consumer class to consume LDF data
00029   This class just handles file open/close or server
00030   open/close
00031   """
00032
00033   def __init__(self,argv):
00034     """consumer constructor
00035     """
00036     QMainWindow.__init__(self,None,None,0)
00037     if 'ONLINE_ROOT' in os.environ:
00038       self.configFile = os.path.join(os.environ['ONLINE_ROOT'],'LATTE/consumer/consumerPlotter.cfg')
00039     else:
00040       self.configFile = ''
00041     consumer.Consumer.__init__(self,argv)
00042     standardPlotter.standardPlotter.__init__(self, self.lci)
00043     # used for status
00044     self.COMPL_STATUS_FAILED = 'FAILED'
00045     self.COMPL_STATUS_PASSED = 'PASSED'
00046     self.COMPL_STATUS_UNDEFINED = 'PASSED'
00047     self.COMPL_STATUS_ABORTED = 'ABORTED'
00048     self.COMPL_STATUS_PASSED_CONDITIONALLY = 'PASSED_CONDITIONALLY'
00049     self.__status = self.COMPL_STATUS_UNDEFINED
00050     self.__exportedFileList = []
00051     self.initializePlotter()
00052     self.guiThread = threading.Thread(None,self.loop,'consumerloop',())
00053     self.guiThread.start()
00054
00055   def getName(self):
00056     return 'consumerPlotter'
00057
00058   def parseEvent(self):
00059     """Analyse an event
00060     """
00061     self.ldbi.iterate(self.eventData, len(self.eventData))
00062     self.checkUDF()
00063     if self.endRun:
00064       self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00065       self.reportResults()
00066       self.exportFiles()
00067     if self.startRun:
00068       self.setCompletionStatus(self.COMPL_STATUS_UNDEFINED)
00069       self.clearPlots()
00070       self.readPedestals()
00071     self.updatePlots()
00072     if self.lci.nEvtSeen>0 and self.lci.nEvtSeen%self.checkInterval==0:
00073       self.checkLimits()
00074
00075   def checkUDF(self):
00076     udfDict = self.lcti.getUdfDict()
00077     self.startRun = False
00078     if 'startRun' in udfDict:
00079       self.setRunId(udfDict['startRun'])
00080       self.startRun = True
00081     self.endRun = False
00082     if 'endRun' in udfDict:
00083       self.endRun = True
00084     if 'configFile' in udfDict:
00085       self.setConfigFile(udfDict['configFile'])
00086     if 'dataType' in udfDict:
00087       self.setDataType(udfDict['dataType'])
00088     self.lcti.clearUdfDict()
00089
00090   def checkLimits(self):
00091     print 'checking limits...'
00092     for plot in self.limits.keys():
00093       cLimit = self.limits[plot]
00094       # check ringBuffer for completion
00095       if self.ntRequests[self.getPlotNtuple(plot)]<=0 or self.lci.ntDict[self.getPlotNtuple(plot)].rows()>=self.ntRequests[self.getPlotNtuple(plot)]:
00096         (limitName,limitLabelList,limitFailList,errorLabelList,errorFailList)  = self.checkLimit(plot,cLimit)
00097         if len(limitFailList)>0 or len(errorFailList)>0:
00098           #self.histDict[plot].getDataRep(0).setRepColor(sihippo.Color.orange)
00099           print 'Plot ',plot,' is out of limits!!'
00100
00101   # these methods are needed for reporting, they pretend to be rcTransitions
00102   def setCompletionStatus(self,status):
00103     self.__status = status
00104   def getCompletionStatusStr(self):
00105     return self.__status
00106   def getCompletionStatus(self):
00107     return self.__status
00108
00109   def addExportedFile(self,file,delete=False):
00110     self.__exportedFileList.append((file,delete))
00111
00112   def exportFiles(self):
00113     if self.reportPath is not None and os.path.exists(self.reportPath) and len(self.__exportedFileList)>0:
00114       exportDirName = self.getName()+'_'+self.getRunId()
00115       exportDir = os.path.join(self.reportPath,exportDirName)
00116       if os.access(self.reportPath,os.W_OK):             # can we write?
00117         os.mkdir(exportDir)
00118         for (file,delete) in self.__exportedFileList:
00119           import shutil
00120           fileName = os.path.basename(file)
00121           outFile = os.path.join(exportDir,fileName)
00122           # avoid copying to itself
00123           if os.path.exists(file) and not os.path.exists(outFile):
00124             if delete:
00125               shutil.move(file,outFile)
00126             else:
00127               shutil.copy(file,outFile)
00128
00129 if __name__ == '__main__':
00130   a = QApplication(sys.argv)
00131   consumer = consumerPlotter(sys.argv[1:])
00132   QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00133   a.setMainWidget(consumer)
00134   a.exec_loop()
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: copyright_SLAC.py Source File

copyright_SLAC.py

00001 #
00002 #                               Copyright 2003
00003 #                                     by
00004 #                        The Board of Trustees of the
00005 #                     Leland Stanford Junior University.
00006 #                            All rights reserved.
00007 #
00008 #          Work supported by the U.S. Department of Energy under contract
00009 #        DE-AC03-76SF00515.
00010 #
00011 #                                Disclaimer Notice
00012 #
00013 #         The items furnished herewith were developed under the sponsorship
00014 #    of the U.S. Government.  Neither the U.S., nor the U.S. D.O.E., nor the
00015 #    Leland Stanford Junior University, nor their employees, makes any war-
00016 #    ranty, express or implied, or assumes any liability or responsibility
00017 #    for accuracy, completeness or usefulness of any information, apparatus,
00018 #    product or process disclosed, or represents that its use will not in-
00019 #    fringe privately-owned rights.  Mention of any product, its manufactur-
00020 #    er, or suppliers shall not, nor is it intended to, imply approval, dis-
00021 #    approval, or fitness for any particular use.  The U.S. and the Univer-
00022 #    sity at all times retain the right to use and disseminate the furnished
00023 #    items for any purpose whatsoever.                       Notice 91 02 01
00024 #
00025
00026 __facility__ = "Online"
00027 __abstract__ = "LATTE copyright notice"
00028 __author__   = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST I&T/Online"
00029 __date__     = ("$Date: 2005/02/18 23:02:50 $").split(' ')[1]
00030 __version__  = "$Revision: 1.2 $"
00031 __release__  = "$Name: R04-12-00 $"
00032 __credits__  = "SLAC"
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: DataDistributor.py Source File

tools

DataDistributor.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT data distribution wrapper classes"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/06/28 19:20:37 $").split(' ')[1]
00014 __version__  = "$Revision: 2.7 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 import socket
00022 import struct
00023
00024
00025 class DataDistributorServer(object):
00026   """\brief Data Distributor Server
00027   """
00028   def __init__(self, name = None, size = 32*1024):
00029     """Data Distributor server constructor.
00030
00031     \param name The name of the type of data to be served.
00032                 See the DataDistributorAddress class.
00033     \param size The size in bytes of the buffer to allocate for sending the
00034                 data.  This is used to set the socket send buffer size.
00035     """
00036     self.__socket = None
00037     self.__group  = None
00038     self.__port   = DataDistributorAddress.port(name)
00039     self.__size   = size
00040
00041   def connect(self, server, interface = socket.gethostname()):
00042     """Method to set up a socket and connect to it.
00043
00044     \param server    The address of a socket on which to serve the data.  This
00045                      address must be the same for both server and client.  The
00046                      value can be in one of the following forms:
00047                      - A number of which only the two lower decimal digits are
00048                        used, i.e., in the range 0-99
00049                      - <port>@<multicast address>, where <port> is a value that
00050                        will override what is found from the data type name
00051                        translation, and <multicast address> is some valid
00052                        multicast IP address starting with the value 239.  A name
00053                        may be used for the <multicast address> value as well, as
00054                        long as it can be found in the name server and translates
00055                        to a valid multicast IP address.
00056                      - <multicast address>, as discussed in the previous bullet.
00057                        The port value is taken to be the one found from looking up
00058                        the data type name in the port table.
00059     \param interface The network interface to send multicast traffic on.
00060                      Defaults to 'the primary network interface', however
00061                      'primary' is defined.  See socket.gethostbyname_ex()
00062                      documentation.
00063     """
00064     if self.__socket is None:
00065       self.__port, self.__group = DataDistributorAddress.lookup(self.__port,
00066                                                                 server)
00067
00068       # Look up multicast group address in name server
00069       # (doesn't hurt if it is already in ddd.ddd.ddd.ddd format)
00070       group = socket.gethostbyname(self.__group)
00071
00072       # Any chance this sort of looks like a valid multicast group?
00073       firstByte = int(group.split(".", 1)[0])
00074       if firstByte < 224 and firstByte > 239:
00075         raise RuntimeError, \
00076           "Group %s does not resolve to a multicast address" % self.__group
00077
00078       s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
00079       self.__socket = s
00080       #
00081       # Make sure there is sufficient network buffering
00082       s.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, self.__size)
00083       #
00084       # Construct interface address
00085       # Use gethostbyname and gethostname to force the connection onto the
00086       # primary network interface.
00087       intf = socket.gethostbyname_ex(interface)[2][0]
00088       #
00089       # Specify the interface for outgoing multicast datagrams
00090       s.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_IF, socket.inet_aton(intf) + socket.inet_aton('0.0.0.0'))
00091     else:
00092       raise RuntimeError, "Socket already in use"
00093
00094   def disconnect(self):
00095     """Gracefully shut down the socket."""
00096     if self.__socket is not None:
00097       self.__socket.close()
00098       self.__socket = None
00099       self.__group  = None
00100       self.__port   = None
00101     else:
00102       raise RuntimeError, "No socket found"
00103
00104   def publish(self, data):
00105     """Publish the data on the multicast socket.
00106
00107     \param data The data to be sent out on the multicast socket.
00108
00109     """
00110     if self.__socket is not None:
00111       self.__socket.sendto(data, (self.__group, self.__port))
00112     else:
00113       raise RuntimeError, "No socket found"
00114
00115
00116 class DataDistributorClient(object):
00117   """\brief Data distributor client class.
00118   """
00119   __timeout = 1
00120
00121   def __init__(self, name = None, size = 64*1024):
00122     """Data Distributor client constructor.
00123
00124     \param name The name of the type of data that the client wants to receive.
00125                 See the DataDistributorAddress class.
00126     \param size The size in bytes of the buffer to allocate for receiving the
00127                 data.  Defaults to 64 KB.
00128     """
00129     self.__socket     = None
00130     self.__group      = None
00131     self.__port       = DataDistributorAddress.port(name)
00132     self.__size       = size
00133     self.__returnNone = None
00134
00135   # Open a UDP socket, bind it to a port and select a multicast group
00136   def connect(self, server):
00137     """Open a UDP socket, bind it to a port and select a multicast group.
00138
00139     \param server The address the server is multicasting on.  This
00140                   address must be the same for both server and client.  The
00141                   value can be in one of the following forms:
00142                   - A number of which only the two lower decimal digits are
00143                     used, i.e., in the range 0-99
00144                   - <port>@<multicast address>, where <port> is a value that
00145                     will override what is found from the data type name
00146                     translation, and <multicast address> is some valid multicast
00147                     IP address starting with the value 239.  A name may be used
00148                     for the <multicast address> value as well, as long as it can
00149                     be found in the name server and translates to a valid
00150                     multicast IP address.
00151                   - <multicast address>, as discussed in the previous bullet.
00152                     The port value is taken to be the one found from looking up
00153                     the data type name in the port table.
00154
00155     """
00156     if self.__socket is None:
00157       self.__port, self.__group = DataDistributorAddress.lookup(self.__port,
00158                                                                 server)
00159       #print "port@group =", str(self.__port) + '@' + self.__group
00160       # Import modules used only here
00161       import string
00162       import struct
00163       #
00164       # Create a socket
00165       s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
00166       self.__socket = s
00167       #
00168       # Allow multiple copies of this program on one machine
00169       # (not strictly needed)
00170       s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
00171       try:
00172         s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
00173       except AttributeError:
00174         pass # Some systems don't support SO_REUSEPORT
00175       #
00176       # Bind it to the port
00177       s.bind(('', self.__port))
00178       #
00179       # Look up multicast group address in name server
00180       # (doesn't hurt if it is already in ddd.ddd.ddd.ddd format)
00181       group = socket.gethostbyname(self.__group)
00182       #
00183       # Any chance this sort of looks like a valid multicast group?
00184       bytes = map(int, group.split("."))
00185       if bytes[0] < 224 and bytes[0] > 239:
00186         raise RuntimeError, \
00187           "Group %s does not resolve to a multicast address" % self.__group
00188       #
00189       # Make sure there is sufficient network buffering to receive stuff in
00190       s.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, self.__size)
00191       #
00192       # Add group membership
00193       s.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP,
00194                    socket.inet_aton(group) + socket.inet_aton('0.0.0.0'))
00195     else:
00196       raise RuntimeError, "Socket already in use"
00197
00198   def disconnect(self):
00199     """Gracefully shut down the socket."""
00200     s = self.__socket
00201     if s is not None:
00202       s.setsockopt(socket.IPPROTO_IP, socket.IP_DROP_MEMBERSHIP,
00203                    socket.inet_aton(self.__group) + socket.inet_aton('0.0.0.0'))
00204       s.close()
00205       self.__socket = None
00206       self.__group  = None
00207       self.__port   = None
00208     else:
00209       raise RuntimeError, "No socket found"
00210
00211   def returnNone(self):
00212     """Method to signal the receive loop to exit."""
00213     self.__returnNone = 1
00214
00215   def receive(self):
00216     """Receive multicast data and the sender's identification.
00217
00218     \return A list of the data and the sender's identification string.
00219     """
00220     if self.__socket is not None:
00221       import select
00222       while self.__returnNone is None:
00223         rd, wr, ex = select.select([self.__socket], [], [], self.__timeout)
00224         if rd:
00225           data, sender = self.__socket.recvfrom(self.__size)
00226           return data, sender
00227         elif ex:
00228           return None, None
00229     else:
00230       raise RuntimeError, "No socket found"
00231     return None, None
00232
00233 class DataDistributorAddress(object):
00234   """\brief Data distributor address class containing static methods that
00235   govern the picking of multicast ports and addresses.
00236   """
00237   # See http://www.iana.org/assignments/port-numbers on how to pick a port
00238   # I randomly chose the following from the dynamic ports section:
00239   __PORT_TEMPLATE = 54321
00240   # See http://www.iana.org/assignments/multicast-addresses on how to pick a
00241   # group BaBar uses 239.255.0.2- 239.255.0.130, so I chose the following:
00242   __GROUP_TEMPLATE = '239.255.1.%u'     # From "site-local" range (Stevens)
00243
00244   __ports = {"LAT_EBFdata" : __PORT_TEMPLATE + 0,
00245              "LAT_CMDdata" : __PORT_TEMPLATE + 1,
00246              "LAT_HSKdata" : __PORT_TEMPLATE + 2,
00247              "LAT_MsgLog"  : __PORT_TEMPLATE + 3}
00248
00249   def port(name):
00250     """Static method to select a physical multicast port to use based on the
00251        type of data that is desired.
00252
00253     \param name The name of the type of data that is desired.  Choose from
00254                 'LAT_EBFdata', 'LAT_CMDdata', 'LAT_HSKdata' and 'LAT_MsgLog'.
00255     """
00256     if name in DataDistributorAddress.__ports:
00257       return DataDistributorAddress.__ports[name]
00258     return None
00259
00260   def lookup(port, server):
00261     """Static method for resolving the multicast port and group values.
00262
00263     \param port   An integer containing the multicast port to use, e.g. from
00264                   the port() method above, or None to indicate that the value
00265                   will come from the supplied server string.
00266     \param server A string that contains either the machine ID (test stand
00267                   instance number), or <port>@<group IP or name>, or <group IP
00268                   or name> when a port number is also supplied.  These last two
00269                   can be used to override the values chosen by this class.  The
00270                   machine ID is a number from 0 - 999, where the hundreds
00271                   digit represents the site ID and remainder (0-99) is the
00272                   machine ID at the site.  This latter portion is what's used.
00273     \return A list made up of the resolved port and group values.
00274     """
00275     # Do a DNS like action to get the machine ID of the server
00276     # Until we get that built, let's do the following:
00277
00278     # The 'server' argument is either a machine ID or a string of the form
00279     # port@<multicast group> (multicast group could be an IP address or a name)
00280     try:
00281       # Site machine IDs run from 0 to 99.  Remove the site ID to prevent > 255
00282       group = DataDistributorAddress.__GROUP_TEMPLATE % (int(server) % 100)
00283     except ValueError:                  # Can only be <port>@<group> or <group>
00284       try:
00285         port, group = server.split('@', 1)
00286         port = int(port)
00287       except ValueError:                # Must be <group>
00288         group = server
00289     return port, group
00290
00291   port   = staticmethod(port)
00292   lookup = staticmethod(lookup)
00293
00294
00295 if __name__ == "__main__":
00296   """Testing routine.
00297
00298   Usage: Run DataDistributor (this file) in one session to start up the client
00299          and DataDistributor -s in another session to start up the server.
00300   """
00301   import time
00302
00303   def sender():
00304     dds = DataDistributorServer('test')
00305     #dds.connect('54320@224.0.0.0')      # "node-local" according to Stevens
00306     dds.connect('54320@239.255.1.0')    # "site-local" according to Stevens
00307     #dds.connect('54320@239.255.1.0', "localhost")  # mcast to self via primary
00308                                          # interface doesn't seem to work on XP
00309                                          # with Checkpoint enabled
00310     i = 5
00311     while i > 0:  #1:
00312       i -= 1
00313       data = `time.time()`
00314       data += 50000*'-'                 # Make it a long string
00315       #print "data =", data
00316       dds.publish(data)
00317       time.sleep(1)
00318     dds.publish('Quit')
00319     dds.disconnect()
00320
00321   def receiver():
00322     dds = DataDistributorClient('test', 64*1024)
00323     #dds.connect('54320@224.0.0.0')      # "node-local" according to Stevens
00324     dds.connect('54320@239.255.1.0')    # "site-local" according to Stevens
00325     #dds.connect('9875@sap.mcast.net')   # Didn't see any activity
00326     #dds.connect('123@ntp.mcast.net')    # Didn't see any activity
00327
00328     # Loop, printing any data we receive
00329     while 1:
00330       data, sender = dds.receive()
00331       print sender, ':', `data[:40]`, len(data)
00332       if data == 'Quit':  break
00333
00334     dds.disconnect()
00335
00336   #---
00337   import sys
00338
00339   flags = sys.argv[1:]
00340
00341   if flags:
00342     sender()
00343   else:
00344     receiver()
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: DataDistributorPoll.py Source File

tools

DataDistributorPoll.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT data distribution polling class"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/06/28 17:38:56 $").split(' ')[1]
00014 __version__  = "$Revision: 2.3 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 import DataDistributor as DD
00022 import threading
00023 import copy
00024 import time
00025
00026
00027 class DataDistributorPoll(DD.DataDistributorClient):
00028   """\brief Data distributor client that polls for samples of data.
00029
00030   Use of this class involves the starting of a thread that constantly receives
00031   the data arriving in the base class's socket.  Keeping the socket drained of
00032   data allows the user of this class to get the most recent data received, thus
00033   avoiding getting data with a bursty time structure.  Whenever the application
00034   calls the receive() method, it gets the most recent data sample.  Because of
00035   the reference counting method used by Python objects, no copy of the data
00036   needs to be made to avoid the data changing from underneath the application.
00037   The application can hold onto the data reference as long as it likes.
00038   Whenever new data appears a new reference is created, and is possibly deleted
00039   before the application gets access to it, leaving any existing reference
00040   alone.  When the application tries to get access to the latest data, it gets
00041   a copy of the most recent reference, and the previous reference is deleted,
00042   if it has gone out of scope.
00043   """
00044   def __init__(self, name, length = 64*1024):
00045     """DataDistributorPoll constructor.
00046
00047     \param name   The name of the type of data that the client wants to receive.
00048                   See the DataDistributorAddress class.
00049     \param length The size in bytes of the buffer to allocate for receiving the
00050                   data.  Defaults to 64 KB.
00051     """
00052     DD.DataDistributorClient.__init__(self, name, length)
00053     self.__pollTaskQuit = False
00054     self.__pollTask     = None
00055     self.__data         = None
00056     self.__dataCopy     = None
00057     self.__sender       = None
00058
00059   def start(self):
00060     """Start the polling thread."""
00061     self.__pollTask = threading.Thread(None, self.__poll, 'DataDistributorPoll')
00062     if self.__pollTask is not None:
00063       self.__pollTask.start()
00064
00065   def stop(self):
00066     """Stop the polling thread."""
00067     self.returnNone()   # Force the base class receiver loop to break out
00068     self.__pollTaskQuit = True
00069     self.__pollTask.join()
00070
00071   def __poll(self):
00072     """Internal routine to drain the data distributor client socket."""
00073     while not self.__pollTaskQuit:
00074       self.__data, self.__sender = DD.DataDistributorClient.receive(self)
00075       time.sleep(.001)  # Let another thread have some CPU time
00076
00077   def receive(self):
00078     """Receive a sampled value of the data and sender information.
00079
00080     \return A list of the sampled data and sender's identification string.
00081             If the data buffer has not been refreshed since the last call,
00082             return None, None.
00083     """
00084     # Avoid returning the same data more than once by keeping a reference to
00085     # the last-returned data.  When there is a new data buffer the references
00086     # won't match.
00087     if self.__data is not self.__dataCopy:
00088       self.__dataCopy = self.__data
00089       return self.__dataCopy, self.__sender
00090     else:
00091       return None, None
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: DataExport.py Source File

tools

DataExport.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2005
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT data export routines"
00012 __author__   = "J. Panetta <panetta@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2006/01/31 17:24:49 $").split(' ')[1]
00014 __version__  = "$Revision: 2.8 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import exceptions
00021 import md5
00022 import os
00023 import shutil
00024 import stat
00025 import sys
00026 import logging as log
00027 from   LATTE.tools.FreeSpace        import FreeSpace
00028 from   LATTE.client.gOptions        import Options
00029
00030 class GExportException(exceptions.Exception):
00031   """!\brief Define an exception from the Export system.
00032   """
00033   def __init__(self, status):
00034     self.status = status
00035
00036   def __str__(self):
00037     return repr(self.status)
00038
00039
00040 class DataExport:
00041   """!\brief Class to synch a file or set of files between one location and another.
00042   """
00043   # Error codes
00044   NO_ERROR                      = 0x0
00045   DIR_NOT_WRITABLE              = 0x1
00046   NOT_EXTANT                    = 0x2
00047
00048   DISK_FULL                     = 0x10
00049
00050   DISK_FULL_LEVEL               = 100*1024*1024  # 100 Megabytes
00051
00052   def __init__(self):
00053     self.__purgeFiles   = False
00054
00055     self.transfer = self.__copy   # Other valid is self.__rename
00056     pass
00057
00058   def setPurge(self, purge):
00059     """
00060     """
00061     if purge == True:
00062       self.__purgeFiles = True
00063     else:
00064       self.__purgeFiles = False
00065
00066   def synch(self, source, dest):
00067     """!\brief Synch up two directory structures.
00068
00069        Synch only goes in one direction:  source --> destination.
00070     """
00071
00072     sourceStatus = self.__checkDir(source)
00073     destStatus   = self.__checkDir(dest)
00074
00075     # do something with statuses
00076
00077     # get a list of directories under source.  Do this only once, as it can take time
00078     dirList = []
00079     for file in os.listdir(source):
00080       file = os.path.join(source,file)
00081       if os.path.isdir(file):
00082         dirList.append(file)
00083
00084     for sourceDir in dirList:
00085       destDir = os.path.join(dest, os.path.basename(sourceDir))
00086       try:
00087         log.info( "Exporting from %s to %s" % ( sourceDir, destDir ) )
00088         self.exportDir(sourceDir, destDir)
00089       except Exception, e:
00090         log.error( "Failed exporting from %s to %s" % ( sourceDir, destDir ) )
00091         log.error( "  Exception: %s" % e )
00092         pass
00093
00094   def export(self, source, dest):
00095     """!\brief Copy from source to dest.
00096
00097        This routine will determine whether source is a file or a directory
00098     """
00099
00100     self.__checkDirs(source, dest)
00101
00102     # Check for common disk on Windows XP/NT (*not* CE).
00103     if os.name == 'nt':
00104       commonPath = os.path.commonprefix( [source, dest] )
00105       if len(commonPath) > 0 and self.__purgeFiles:
00106         self.transfer = self.__rename
00107       else:
00108         self.transfer = self.__copy
00109     else:
00110       pass # self.__transfer is set in constructor to self.__copy
00111
00112     self.transfer(source, dest)
00113
00114   def md5sum(self, fname):
00115     """!\brief Returns an md5 hash for file fname.
00116     """
00117     # md5hash from ActiveState cookbook
00118     # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/266486
00119     #
00120     # 2004-01-30
00121     #
00122     # Nick Vargish
00123     #
00124     # Simple md5 hash utility for generating md5 checksums of files.
00125     # Modified slightly by Jim Panetta
00126     try:
00127       if os.path.isdir(fname):
00128         return "Directory"
00129       f = file(fname, 'rb')
00130     except:
00131       return 'Failed to open file'
00132     ret = self.__sumfile(f)
00133     f.close()
00134     return ret
00135
00136
00137   def __copy(self, source, dest):
00138     # copy/checksum/delete
00139     if os.path.isdir(source):
00140       shutil.copytree( source, dest )      # copy
00141       self.__compareTree( source, dest )   # checksum
00142
00143       if self.__purgeFiles:                # delete
00144         for root, dirs, files in os.walk(source, topdown=False):
00145           for name in files:
00146               f = os.path.join(root, name)
00147               os.chmod(f, stat.S_IWRITE) # Just in case it is read-only
00148               os.remove(f)
00149           for name in dirs:
00150               os.rmdir(os.path.join(root, name))
00151         os.rmdir(root)
00152     else:  # regular file.  much simpler
00153       shutil.copy( source, dest )         # copy
00154       sourceMD5 = self.md5sum(source)     # checksum
00155       destMD5   = self.md5sum(dest)
00156       if sourceMD5 != destMD5:
00157         msg = "md5 sums don't match for %s :" % (source)
00158         msg += "\n   source: %s, dest: %s" % ( sourceMD5, destMD5 )
00159         raise GExportException, msg
00160
00161       if self.__purgeFiles:               # delete
00162         os.remove(source)
00163
00164   def __rename(self, source, dest):
00165     # just move it.  No purging needed
00166     shutil.move(source, dest)
00167
00168   def __checkDirs(self, source, dest):
00169     # check statuses
00170     sourceStatus = self.__checkStat(source)
00171     destStatus   = self.__checkStat(dest)
00172
00173     # don't care if source dir is on a full disk or if it isn't writable
00174     if ( sourceStatus & ~(DataExport.DISK_FULL|DataExport.DIR_NOT_WRITABLE) ):
00175       msg = "Export Error: Attempt to read from source %s encountered errors: " % (source)
00176       msg += self.__statusParse(sourceStatus)
00177       raise GExportException, msg
00178     # Destination must not be extant.
00179     if not ( destStatus & DataExport.NOT_EXTANT ):
00180       msg = "Export Error: Destination %s already exists" % (dest)
00181       raise GExportException, msg
00182     if ( destStatus & ~DataExport.NOT_EXTANT ) :
00183       msg = "Export Error: Attempt to write to destination %s encountered errors: " % (dest)
00184       msg += self.__statusParse(destStatus)
00185
00186       raise GExportException, msg
00187     # source and dest can't be the same
00188     if os.path.abspath(source) == os.path.abspath(dest):
00189       msg = "Source and destination directories are the same.  Export aborted"
00190       raise GExportException, msg
00191
00192
00193   def __compareTree(self, sourceDir, destDir):
00194     """!\brief Compare all files under sourceDir and destDir with md5.
00195
00196     \param sourceDir Source directory
00197     \param destDir   Destination directory
00198      """
00199     # scan the source/dest directories
00200     # chdir so that the source/dest keys are the same
00201     saveDir = os.getcwd()
00202     os.chdir(sourceDir)
00203     sourceWalk = os.walk(".")
00204     sourceMD5 = self.__treeWalk( sourceWalk, self.md5sum )
00205
00206     os.chdir(destDir)
00207     destWalk   = os.walk(".")
00208     destMD5   = self.__treeWalk( destWalk,   self.md5sum )
00209
00210     # compare the checksums
00211     for file in sourceMD5.keys():
00212       if destMD5.has_key(file):
00213         if sourceMD5[file] != destMD5[file]:
00214           os.chdir(saveDir)
00215           msg = "md5 sums don't match for %s :" % (file)
00216           msg += "\n   source: %s, dest: %s" % ( sourceMD5[file], destMD5[file])
00217           raise GExportException, msg
00218         else:
00219           destMD5.pop(file)
00220       else:
00221         os.chdir(saveDir)
00222         msg = "Destination directory %s does not contain file %s from source directory %s" % \
00223               ( destDir, file, sourceDir )
00224         raise GExportException, msg
00225
00226     if destMD5 != {}:
00227       os.chdir(saveDir)
00228       msg = "Destination directory %s contains files not in source directory:" % ( destDir )
00229       for file in destMD5.keys():
00230         msg += "\n    %s" % ( file )
00231       raise GExportException, msg
00232     os.chdir(saveDir)
00233
00234   def __treeWalk(self, tree, function):
00235     """!\brief Walk a tree, executing function() on every file.
00236     """
00237     returnDict = {}
00238     for root, dirs, files in tree:
00239       for name in dirs + files:
00240         try:
00241           retVal = function(os.path.join(root, name))
00242         except:
00243           retVal = -1
00244         returnDict[os.path.join(root, name)] = retVal
00245     return returnDict
00246
00247   def __checkStat(self, obj):
00248     """!\brief Check if source and directories exist, are writable,
00249     and the disks aren't full.
00250
00251     \param obj File path
00252     \return Status
00253     """
00254     status = 0L
00255
00256     if not os.path.exists(obj):
00257       status |= DataExport.NOT_EXTANT
00258     elif FreeSpace(os.path.dirname(obj)) < DataExport.DISK_FULL_LEVEL:
00259       status |= DataExport.DISK_FULL
00260     if not os.access(os.path.dirname(obj),os.W_OK):
00261       status |= DataExport.DIR_NOT_WRITABLE
00262
00263     return status
00264
00265   def __makeReadOnly(self, file):
00266     status = 0
00267     try:
00268       os.chmod(file, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
00269     except:
00270       status = -1
00271     return status
00272
00273   def __statusParse(self, status):
00274     msg = ""
00275     if status & DataExport.DIR_NOT_WRITABLE:
00276       msg += "\n  Directory not writable"
00277     if status & DataExport.NOT_EXTANT:
00278       msg += "\n  Directory does not exist"
00279     if status & DataExport.DISK_FULL:
00280       msg += "\n  Disk is full"
00281     return msg
00282
00283   def __sumfile(self, fobj):
00284     '''Returns an md5 hash for an object with read() method.'''
00285     m = md5.new()
00286     while True:
00287       d = fobj.read(8096)
00288       if not d:
00289         break
00290       m.update(d)
00291     return m.hexdigest()
00292
00293
00294
00295 def usage():
00296   return """
00297 DataExport:  Securely copy files from one directory to another.
00298
00299 Mandatory options:
00300 --source        Source directory
00301 --destination   Destination directory
00302
00303 Flags:
00304 --purge         Set if source files are to be deleted after copy.
00305 """
00306
00307 if __name__ == "__main__":
00308   """Command line interface for the Data Export system.
00309      Can be called by the user or by an automated process.
00310
00311   """
00312
00313   # Options, first list mandatory, second list optional
00314   options = Options(['source', 'destination'], [], ['purge'])
00315   try:
00316     options.parse()
00317   except Exception, msg:
00318     options.usage(usage())
00319     raise Exception, msg
00320
00321   source         = options.source
00322   destination    = options.destination
00323   print "source=%s, dest=%s" % ( source, destination)
00324
00325   exporter = DataExport()
00326
00327   # Do we want file deletion?
00328   if options.purge is not None:
00329     exporter.setPurge(True)
00330
00331   exporter.export(source, destination)
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: dispatcher.py Source File

dispatch

dispatcher.py

00001 """Multiple-producer-multiple-consumer signal-dispatching
00002
00003 dispatcher is the core of the PyDispatcher system,
00004 providing the primary API and the core logic for the
00005 system.
00006
00007 Module attributes of note:
00008
00009   Any -- Singleton used to signal either "Any Sender" or
00010     "Any Signal".  See documentation of the _Any class.
00011   Anonymous -- Singleton used to signal "Anonymous Sender"
00012     See documentation of the _Anonymous class.
00013
00014 Internal attributes:
00015   WEAKREF_TYPES -- tuple of types/classes which represent
00016     weak references to receivers, and thus must be de-
00017     referenced on retrieval to retrieve the callable
00018     object
00019   connections -- { senderkey (id) : { signal : [receivers...]}}
00020   senders -- { senderkey (id) : weakref(sender) }
00021     used for cleaning up sender references on sender
00022     deletion
00023   sendersBack -- { receiverkey (id) : [senderkey (id)...] }
00024     used for cleaning up receiver references on receiver
00025     deletion, (considerably speeds up the cleanup process
00026     vs. the original code.)
00027 """
00028 from __future__ import generators
00029 import types, weakref
00030 import saferef, robustapply, errors
00031
00032 __author__   = "Patrick K. O'Brien <pobrien@orbtech.com>"
00033 __cvsid__    = "$Id: dispatcher.py,v 2.1 2005/02/26 02:41:17 stuvi Exp $"
00034 __version__  = "$Revision: 2.1 $"
00035
00036 try:
00037     True
00038 except NameError:
00039     True = 1==1
00040     False = 1==0
00041
00042 class _Parameter:
00043   """Used to represent default parameter values."""
00044   def __repr__(self):
00045     return self.__class__.__name__
00046
00047 class _Any(_Parameter):
00048   """Singleton used to signal either "Any Sender" or "Any Signal"
00049
00050   The Any object can be used with connect, disconnect,
00051   send, or sendExact to signal that the parameter given
00052   Any should react to all senders/signals, not just
00053   a particular sender/signal.
00054   """
00055 Any = _Any()
00056
00057 class _Anonymous(_Parameter):
00058   """Singleton used to signal "Anonymous Sender"
00059
00060   The Anonymous object is used to signal that the sender
00061   of a message is not specified (as distinct from being
00062   "any sender").  Registering callbacks for Anonymous
00063   will only receive messages sent without senders.  Sending
00064   with anonymous will only send messages to those receivers
00065   registered for Any or Anonymous.
00066
00067   Note:
00068     The default sender for connect is Any, while the
00069     default sender for send is Anonymous.  This has
00070     the effect that if you do not specify any senders
00071     in either function then all messages are routed
00072     as though there was a single sender (Anonymous)
00073     being used everywhere.
00074   """
00075 Anonymous = _Anonymous()
00076
00077 WEAKREF_TYPES = (weakref.ReferenceType, saferef.BoundMethodWeakref)
00078
00079 connections = {}
00080 senders = {}
00081 sendersBack = {}
00082
00083
00084 def connect(receiver, signal=Any, sender=Any, weak=True):
00085   """Connect receiver to sender for signal
00086
00087   receiver -- a callable Python object which is to receive
00088     messages/signals/events.  Receivers must be hashable
00089     objects.
00090
00091     if weak is True, then receiver must be weak-referencable
00092     (more precisely saferef.safeRef() must be able to create
00093     a reference to the receiver).
00094
00095     Receivers are fairly flexible in their specification,
00096     as the machinery in the robustApply module takes care
00097     of most of the details regarding figuring out appropriate
00098     subsets of the sent arguments to apply to a given
00099     receiver.
00100
00101     Note:
00102       if receiver is itself a weak reference (a callable),
00103       it will be de-referenced by the system's machinery,
00104       so *generally* weak references are not suitable as
00105       receivers, though some use might be found for the
00106       facility whereby a higher-level library passes in
00107       pre-weakrefed receiver references.
00108
00109   signal -- the signal to which the receiver should respond
00110
00111     if Any, receiver will receive any signal from the
00112     indicated sender (which might also be Any, but is not
00113     necessarily Any).
00114
00115     Otherwise must be a hashable Python object other than
00116     None (DispatcherError raised on None).
00117
00118   sender -- the sender to which the receiver should respond
00119
00120     if Any, receiver will receive the indicated signals
00121     from any sender.
00122
00123     if Anonymous, receiver will only receive indicated
00124     signals from send/sendExact which do not specify a
00125     sender, or specify Anonymous explicitly as the sender.
00126
00127     Otherwise can be any python object.
00128
00129   weak -- whether to use weak references to the receiver
00130     By default, the module will attempt to use weak
00131     references to the receiver objects.  If this parameter
00132     is false, then strong references will be used.
00133
00134   returns None, may raise DispatcherTypeError
00135   """
00136   if signal is None:
00137     raise errors.DispatcherTypeError(
00138       'Signal cannot be None (receiver=%r sender=%r)'%( receiver,sender)
00139     )
00140   receiverID = id( receiver )
00141   if weak: receiver = saferef.safeRef(receiver, onDelete=_removeReceiver)
00142   senderkey = id(sender)
00143   signals = {}
00144   if connections.has_key(senderkey):
00145     signals = connections[senderkey]
00146   else:
00147     connections[senderkey] = signals
00148     # Keep track of senders for cleanup.
00149     # Is Anonymous something we want to clean up?
00150     if sender not in (None, Anonymous, Any):
00151       def remove(object, senderkey=senderkey):
00152         _removeSender(senderkey=senderkey)
00153       # Skip objects that can not be weakly referenced, which means
00154       # they won't be automatically cleaned up, but that's too bad.
00155       try:
00156         weakSender = weakref.ref(sender, remove)
00157         senders[senderkey] = weakSender
00158         sendersBack.setdefault(receiverID,[]).append(senderkey)
00159       except:
00160         pass
00161   receivers = []
00162   if signals.has_key(signal):
00163     receivers = signals[signal]
00164   else:
00165     signals[signal] = receivers
00166   try: receivers.remove(receiver)
00167   except ValueError: pass
00168   receivers.append(receiver)
00169
00170 def disconnect(receiver, signal=Any, sender=Any, weak=True):
00171   """Disconnect receiver from sender for signal
00172
00173   receiver -- the registered receiver to disconnect
00174   signal -- the registered signal to disconnect
00175   sender -- the registered sender to disconnect
00176   weak -- the weakref state to disconnect
00177
00178   disconnect reverses the process of connect,
00179   the semantics for the individual elements are
00180   logically equivalent to a tuple of
00181   (receiver, signal, sender, weak) used as a key
00182   to be deleted from the internal routing tables.
00183   (The actual process is slightly more complex
00184   but the semantics are basically the same).
00185
00186   Note:
00187     Using disconnect is not required to cleanup
00188     routing when an object is deleted, the framework
00189     will remove routes for deleted objects
00190     automatically.  It's only necessary to disconnect
00191     if you want to stop routing to a live object.
00192
00193   returns None, may raise DispatcherTypeError or
00194     DispatcherKeyError
00195   """
00196   if signal is None:
00197     raise errors.DispatcherTypeError(
00198       'Signal cannot be None (receiver=%r sender=%r)'%( receiver,sender)
00199     )
00200   if weak: receiver = saferef.safeRef(receiver)
00201   senderkey = id(sender)
00202   try:
00203     receivers = connections[senderkey][signal]
00204   except KeyError:
00205     raise errors.DispatcherKeyError(
00206       """No receivers found for signal %r from sender %r""" %(
00207         signal,
00208         sender
00209       )
00210     )
00211   try:
00212     receivers.remove(receiver)
00213   except ValueError:
00214     raise errors.DispatcherKeyError(
00215       """No connection to receiver %s for signal %s from sender %s""" %(
00216         receiver,
00217         signal,
00218         sender
00219       )
00220     )
00221   _cleanupConnections(senderkey, signal)
00222
00223 def getReceivers( sender = Any, signal = Any ):
00224   """Get list of receivers from global tables
00225
00226   This utility function allows you to retrieve the
00227   raw list of receivers from the connections table
00228   for the given sender and signal pair.
00229
00230   Note:
00231     there is no guarantee that this is the actual list
00232     stored in the connections table, so the value
00233     should be treated as a simple iterable/truth value
00234     rather than, for instance a list to which you
00235     might append new records.
00236
00237   Normally you would use liveReceivers( getReceivers( ...))
00238   to retrieve the actual receiver objects as an iterable
00239   object.
00240   """
00241   try:
00242     return connections[id(sender)][signal]
00243   except KeyError:
00244     return []
00245
00246 def liveReceivers(receivers):
00247   """Filter sequence of receivers to get resolved, live receivers
00248
00249   This is a generator which will iterate over
00250   the passed sequence, checking for weak references
00251   and resolving them, then returning all live
00252   receivers.
00253   """
00254   for receiver in receivers:
00255     if isinstance( receiver, WEAKREF_TYPES):
00256       # Dereference the weak reference.
00257       receiver = receiver()
00258       if receiver is not None:
00259         yield receiver
00260     else:
00261       yield receiver
00262
00263 def getAllReceivers( sender = Any, signal = Any ):
00264   """Get list of all receivers from global tables
00265
00266   This gets all receivers which should receive
00267   the given signal from sender, each receiver should
00268   be produced only once by the resulting generator
00269   """
00270   receivers = {}
00271   for set in (
00272     # Get receivers that receive *this* signal from *this* sender.
00273     getReceivers( sender, signal ),
00274     # Add receivers that receive *any* signal from *this* sender.
00275     getReceivers( sender, Any ),
00276     # Add receivers that receive *this* signal from *any* sender.
00277     getReceivers( Any, signal ),
00278     # Add receivers that receive *any* signal from *any* sender.
00279     getReceivers( Any, Any ),
00280   ):
00281     for receiver in set:
00282       if receiver: # filter out dead instance-method weakrefs
00283         try:
00284           if not receivers.has_key( receiver ):
00285             receivers[receiver] = 1
00286             yield receiver
00287         except TypeError:
00288           # dead weakrefs raise TypeError on hash...
00289           pass
00290
00291 def send(signal=Any, sender=Anonymous, *arguments, **named):
00292   """Send signal from sender to all connected receivers.
00293
00294   signal -- (hashable) signal value, see connect for details
00295
00296   sender -- the sender of the signal
00297
00298     if Any, only receivers registered for Any will receive
00299     the message.
00300
00301     if Anonymous, only receivers registered to receive
00302     messages from Anonymous or Any will receive the message
00303
00304     Otherwise can be any python object (normally one
00305     registered with a connect if you actually want
00306     something to occur).
00307
00308   arguments -- positional arguments which will be passed to
00309     *all* receivers. Note that this may raise TypeErrors
00310     if the receivers do not allow the particular arguments.
00311     Note also that arguments are applied before named
00312     arguments, so they should be used with care.
00313
00314   named -- named arguments which will be filtered according
00315     to the parameters of the receivers to only provide those
00316     acceptable to the receiver.
00317
00318   Return a list of tuple pairs [(receiver, response), ... ]
00319
00320   if any receiver raises an error, the error propagates back
00321   through send, terminating the dispatch loop, so it is quite
00322   possible to not have all receivers called if a raises an
00323   error.
00324   """
00325   # Call each receiver with whatever arguments it can accept.
00326   # Return a list of tuple pairs [(receiver, response), ... ].
00327   responses = []
00328   for receiver in liveReceivers(getAllReceivers(sender, signal)):
00329     response = robustapply.robustApply(
00330       receiver,
00331       signal=signal,
00332       sender=sender,
00333       *arguments,
00334       **named
00335     )
00336     responses.append((receiver, response))
00337   return responses
00338 def sendExact( signal=Any, sender=Anonymous, *arguments, **named ):
00339   """Send signal only to those receivers registered for exact message
00340
00341   sendExact allows for avoiding Any/Anonymous registered
00342   handlers, sending only to those receivers explicitly
00343   registered for a particular signal on a particular
00344   sender.
00345   """
00346   responses = []
00347   for receiver in liveReceivers(getReceivers(sender, signal)):
00348     response = robustapply.robustApply(
00349       receiver,
00350       signal=signal,
00351       sender=sender,
00352       *arguments,
00353       **named
00354     )
00355     responses.append((receiver, response))
00356   return responses
00357
00358
00359 def _removeReceiver(receiver):
00360   """Remove receiver from connections."""
00361   backKey = id(receiver)
00362   for senderkey in sendersBack.get(backKey,()):
00363     try:
00364       for signal in connections[senderkey].keys():
00365         try:
00366           receivers = connections[senderkey][signal]
00367         except KeyError:
00368           pass
00369         else:
00370           try: receivers.remove(receiver)
00371           except: pass
00372         _cleanupConnections(senderkey, signal)
00373     except KeyError:
00374       pass
00375
00376 def _cleanupConnections(senderkey, signal):
00377   """Delete any empty signals for senderkey. Delete senderkey if empty."""
00378   try:
00379     receivers = connections[senderkey][signal]
00380   except:
00381     pass
00382   else:
00383     if not receivers:
00384       # No more connected receivers. Therefore, remove the signal.
00385       try:
00386         signals = connections[senderkey]
00387       except KeyError:
00388         pass
00389       else:
00390         del signals[signal]
00391         if not signals:
00392           # No more signal connections. Therefore, remove the sender.
00393           _removeSender(senderkey)
00394
00395 def _removeSender(senderkey):
00396   """Remove senderkey from connections."""
00397   try:
00398     del connections[senderkey]
00399   except KeyError:
00400     pass
00401   # Senderkey will only be in senders dictionary if sender
00402   # could be weakly referenced.
00403   try: del senders[senderkey]
00404   except: pass
00405
00406
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: doublehisto.py Source File

browser

doublehisto.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Trigger"
00012 __abstract__ = "Histogram for trigger display"
00013 __author__   = "Martin Kocian, SLAC"
00014 __date__     = ("$Date: 2005/06/15 23:42:30 $").split(' ')[1]
00015 __version__  = "$Revision: 2.3 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 from qt import *
00020 import sys
00021 from math import *
00022 BORDERSIZE=10
00023 MARGINLEFT=15
00024 MARGINLOW=25
00025 NTICKMIN=10
00026 NTICKMAX=50
00027
00028 class doublehisto(QWidget):
00029     def __init__(self,parent=None,name=None,fl=0):
00030         QWidget.__init__(self,parent,name,fl)
00031         self.__firstsetup=True
00032         if not name:
00033             self.setName("doublehisto")
00034         self.clearWState(Qt.WState_Polished)
00035     def setup(self,nbins,lower,upper,logx,logy):
00036         self.__nbins=nbins
00037         self.__lower=float(lower)
00038         self.__upper=float(upper)
00039         self.__nhist=0
00040         self.__logx=logx
00041         self.__logy=logy
00042         self.__scale=1.
00043         self.__scalehaschanged=True
00044         self.fontsize=8
00045         self.bds=BORDERSIZE
00046         self.labelboxx=.05
00047         self.labelboxy=.04
00048         self.boxwidth=0.5
00049         if self.__logy==False:
00050             self.__scalelow=0.
00051         else:
00052             self.__scalelow=0.5
00053         self.__histtitle0="Hist 0"
00054         self.__histtitle1="Hist 1"
00055         self.__marginleft=MARGINLEFT
00056         self.__marginlow=MARGINLOW
00057         self.__ticksx=self.computeticks(self.__lower,self.__upper,self.__logx)
00058         self.__ticksy=self.computeticks(self.__scalelow,self.__scale,self.__logy)
00059         if self.__firstsetup==False:
00060             for it in self.__xlabels: it.deleteLater()
00061             for it in self.__ylabels: it.deleteLater()
00062             self.xaxislabel.deleteLater()
00063         self.__firstsetup=False
00064         self.__xlabels=self.makelabels(self.__ticksx[0],self.__logx,QLabel.AlignTop|QLabel.AlignHCenter)
00065         self.__ylabels=self.makelabels(self.__ticksy[0],self.__logy,QLabel.AlignVCenter|QLabel.AlignRight)
00066         self.xaxislabel=QLabel(self,"xaxis")
00067         font=QFont(self.xaxislabel.font())
00068         font.setPointSize(self.fontsize)
00069         self.xaxislabel.setFont(font)
00070         self.xaxislabel.setPaletteBackgroundColor(QColor("white"))
00071         self.xaxislabel.setAlignment(QLabel.AlignVCenter|QLabel.AlignRight)
00072         self.histolabel=[]
00073         self.__contents=[]
00074         self.style=[]
00075         self.color=[]
00076         self.uselabel=[]
00077         self.showhisto=[]
00078         self.histoname=[]
00079         self.setBinBoundaries()
00080     def addHisto(self,name="histo",color="black",style=0,uselabel=0,showhis=1):
00081         self.histoname.append(name)
00082         self.uselabel.append(uselabel)
00083         self.showhisto.append(showhis)
00084         self.color.append(color)
00085         self.style.append(style)
00086         self.histolabel.append(QLabel(self,"histo_%d"%self.__nhist))
00087         font=QFont(self.histolabel[-1].font())
00088         font.setPointSize(self.fontsize)
00089         self.histolabel[-1].setFont(font)
00090         self.histolabel[-1].setPaletteBackgroundColor(QColor("white"))
00091         self.histolabel[-1].setAlignment(QLabel.AlignVCenter|QLabel.AlignLeft)
00092         self.__contents.append([])
00093         for i in range(self.__nbins):
00094             self.__contents[self.__nhist].append(0.)
00095         self.__nhist+=1
00096         self.drawLabels()
00097     def find(self,name):
00098         try:
00099             ind=self.histoname.index(name)
00100         except:
00101             ind=-1
00102         return ind
00103     def setHistoLabel(self,name,lab):
00104         ind=self.histoname.index(name)
00105         self.histolabel[ind].setText(lab)
00106     def hideHisto(self,name):
00107         ind=self.histoname.index(name)
00108         self.showhisto[ind]=0
00109         newmax=1.
00110         for i in range(self.__nhist):
00111             if self.showhisto[i]==1:
00112                 newmax=max(newmax,max(self.__contents[i]))
00113         if newmax<max(self.__contents[ind]):
00114             self.__scale=newmax*1.25
00115             self.__scalehaschanged=True
00116         self.updateHisto()
00117         self.drawLabels()
00118     def showHisto(self,name):
00119         ind=self.histoname.index(name)
00120         self.showhisto[ind]=1
00121         if max(self.__contents[ind])>self.__scale*.95:
00122             self.__scale=max(self.__contents[ind])*1.25
00123             self.__scalehaschanged=True
00124         self.updateHisto()
00125         self.drawLabels()
00126     def removeHisto(self,name):
00127         ind=self.histoname.index(name)
00128         newmax=1.
00129         for i in range(self.__nhist):
00130             if self.showhisto[i]==1:
00131                 newmax=max(newmax,max(self.__contents[i]))
00132         if newmax<max(self.__contents[ind]):
00133             self.__scale=newmax*1.25
00134             self.__scalehaschanged=True
00135         self.__contents.pop(ind)
00136         self.histoname.pop(ind)
00137         self.uselabel.pop(ind)
00138         self.showhisto.pop(ind)
00139         self.color.pop(ind)
00140         self.style.pop(ind)
00141         self.histolabel.pop(ind).deleteLater()
00142         self.__nhist-=1
00143         self.updateHisto()
00144         self.drawLabels()
00145     def removeAllHistos(self):
00146         self.__contents=[]
00147         self.histoname=[]
00148         self.uselabel=[]
00149         self.showhisto=[]
00150         self.color=[]
00151         self.style=[]
00152         for i in self.histolabel:i.deleteLater()
00153         self.histolabel=[]
00154         self.__nhist=0
00155         self.updateHisto()
00156         self.drawLabels()
00157         self.__scale==1.
00158     def setBinBoundaries(self):
00159         self.__binboundary=[]
00160         for i in range (self.__nbins):
00161             if self.__logx:
00162                 self.__binboundary.append(pow(10,(log10(self.__upper)-log10(self.__lower))/self.__nbins*i+log10(self.__lower)))
00163             else:
00164                 self.__binboundary.append((self.__upper-self.__lower)/self.__nbins*(i)+self.__lower)
00165
00166     def resetHisto(self,number):
00167         for i in range(self.__nbins):
00168             self.__contents[number][i]=0.
00169     def resetAllHistos(self):
00170         for i in range (self.__nhist):
00171             self.resetHisto(i)
00172             self.__scale=1.
00173
00174     def setLogy(self, on):
00175        self.__logy=on
00176        if on:
00177            self.__marginleft=MARGINLEFT
00178            self.__scalelow=0.5
00179        else: self.__scalelow=0.
00180        self.__scalehaschanged=True
00181        self.updateHisto()
00182
00183     def makelabels(self,ticks,logs,alignment):
00184         labels=[]
00185         for tick in ticks:
00186             labels.append(QLabel(self,"tick_%d"%tick))
00187             font=QFont(labels[-1].font())
00188             font.setPointSize(self.fontsize)
00189             labels[-1].setFont(font)
00190             if logs==True:
00191                 if floor(log10(tick)+.1)==0:labels[-1].setText("<b>1<sup> ")
00192                 elif int(log10(tick)+.1)==1:labels[-1].setText("<b>10<sup> ")
00193                 else: labels[-1].setText("<b>10<sup>%d"% floor(log10(tick)+.1))
00194             else:
00195                 if remainder(tick)<1e-5 or tick==0:
00196                     labels[-1].setText("<b>%d"%tick)
00197                 else:
00198                     labels[-1].setText("<b>"+str(tick))
00199             labels[-1].setPaletteBackgroundColor(QColor("white"))
00200             labels[-1].setAlignment(alignment)
00201         return labels
00202     def fill(self,name,xval,weight=1.):
00203         hist=self.histoname.index(name)
00204         if hist>=self.__nhist or xval>self.__upper:return
00205         for i in range(self.__nbins-1,-1,-1):
00206             if xval>self.__binboundary[i]:
00207                     self.__contents[hist][i]+=weight
00208                     if self.__contents[hist][i]>self.__scale*.95 and self.showhisto[hist]==1:
00209                         self.__scale=self.__contents[hist][i]*1.25
00210                         self.__scalehaschanged=True
00211                     break
00212     def setBinContent(self,name,i,w):
00213         hist=self.histoname.index(name)
00214         self.__contents[hist][i]=w
00215         if self.__contents[hist][i]>self.__scale*.95 and self.showhisto[hist]==1:
00216                         self.__scale=self.__contents[hist][i]*1.25
00217                         self.__scalehaschanged=True
00218     def resetlin(self):
00219         newaxis=False
00220         if self.__logx==True:
00221             newaxis=True
00222         self.__logx=False
00223         self.resetxaxis(newaxis)
00224     def resetlog(self):
00225         newaxis=False
00226         if self.__logx==False:
00227             newaxis=True
00228         self.__logx=True
00229         self.resetxaxis(newaxis)
00230
00231     def resetxaxis(self,newaxis):
00232         for i in range (self.__nhist):
00233             self.resetHisto(i)
00234         if newaxis==True:
00235             self.__ticksx=self.computeticks(self.__lower,self.__upper,self.__logx)
00236             for j in self.__xlabels:j.deleteLater()
00237             self.__xlabels=self.makelabels(self.__ticksx[0],self.__logx,QLabel.AlignHCenter|QLabel.AlignTop)
00238             self.setBinBoundaries()
00239         self.__scale=1.
00240         self.__scalehaschanged=True
00241         self.updateHisto()
00242
00243     def updateHisto(self):
00244         if self.__scalehaschanged==True:
00245             self.__ticksy=self.computeticks(self.__scalelow,self.__scale,self.__logy)
00246             for j in self.__ylabels:j.deleteLater()
00247             self.__ylabels=self.makelabels(self.__ticksy[0],self.__logy,QLabel.AlignVCenter|QLabel.AlignRight)
00248             if len(self.__ylabels[-1].text())>6 and not self.__logy:self.__marginleft=(len(self.__ylabels[-1].text())-3)*6
00249             self.drawLabels()
00250             self.__scalehaschanged=False
00251         self.update()
00252     def computeticks(self,lower,upper,log):
00253         if log:
00254             l=floor(log10(float(lower)))
00255             tickval=ceil(float(lower)/pow(10,l))*pow(10,l)
00256             ticks=[[],[]]
00257             while tickval<=upper:
00258                 if int(tickval/pow(10,l)+.1)==10:
00259                     l+=1
00260                     ticks[0].append(tickval)
00261                 else:
00262                     if int(tickval/pow(10,l)+.1)==1:
00263                         ticks[0].append(tickval)
00264                     else:
00265                         ticks[1].append(tickval)
00266                 tickval+=pow(10,l)
00267         else:
00268             l=pow(10,floor(log10(upper-lower)-.1))
00269             if (upper-lower)/l*10<=NTICKMAX:subd=10
00270             elif (upper-lower)/l*5<=NTICKMAX:subd=5
00271             elif (upper-lower)/l*2<=NTICKMAX:subd=2
00272             else: subd=1
00273             l2=float(l)/subd
00274             ticks=[[],[]]
00275             if lower%l==0:
00276                 ticks[0].append(lower)
00277             for i in range(int((upper-(upper%l)-(lower-lower%l))/l)):
00278                 ticks[0].append(lower+(i+1)*l-((lower)%l))
00279             if lower%l2==0:
00280                 ticks[1].append(lower)
00281             for i in range(int((upper-(upper%l2)-(lower-lower%l2))/l2)):
00282                 ticks[1].append(lower+(i+1)*l2-((lower)%l2))
00283         return ticks
00284
00285     def paintEvent(self,pe):
00286         try:
00287             r=pe.rect()
00288             painter=QPainter()
00289             painter.begin(self)
00290             painter.setBrush(QColor("white"))
00291             painter.drawRect(0,0,self.size().width(),self.size().height())
00292             widthx=float(self.size().width()-2*self.bds-self.__marginleft)
00293             widthy=float(self.size().height()-2*self.bds-self.__marginlow)
00294             pen=QPen()
00295             for j in range (self.__nhist):
00296               if self.showhisto[j]==0:continue
00297               if self.style[j]==1:
00298                 painter.setBrush(QColor(self.color[j]))
00299                 pen.setColor(QColor(self.color[j]))
00300                 painter.setPen(pen)
00301                 for i in range(self.__nbins):
00302                   if self.__logy == True and self.__contents[j][i]>self.__scalelow:
00303                     painter.drawRect(1+self.bds+self.__marginleft+float(i)/self.__nbins*widthx,
00304                                  self.bds+widthy-(log10(self.__contents[j][i])-log10(self.__scalelow))
00305                                                     /(log10(self.__scale)-log10(self.__scalelow))*widthy,
00306                                  int(float(i+1)*widthx/self.__nbins)-int(float(i)*widthx/self.__nbins),
00307                                  1+(log10(self.__contents[j][i])-log10(self.__scalelow))/
00308                                     (log10(self.__scale)-log10(self.__scalelow))*widthy)
00309                   else:
00310                     painter.drawRect(1+self.bds+self.__marginleft+float(i)/self.__nbins*widthx,
00311                                  self.bds+widthy-(self.__contents[j][i]/self.__scale)*widthy,
00312                                  int(float(i+1)*widthx/self.__nbins)-int(float(i)*widthx/self.__nbins),
00313                                  1+(self.__contents[j][i]/self.__scale)*widthy)
00314             for j in range (self.__nhist):
00315               if self.showhisto[j]==0:continue
00316               if self.style[j]==0:
00317                 pen.setColor(QColor(self.color[j]))
00318                 painter.setPen(pen)
00319                 for i in range(self.__nbins):
00320                   if self.__logy==True :
00321                    if self.__contents[j][i]>self.__scalelow :
00322                     if i!=0:
00323                         if self.__contents[j][i-1]>self.__scalelow:
00324                           painter.drawLine(1+self.bds+self.__marginleft+float(i)/self.__nbins*widthx,
00325                                      self.bds+widthy-(log10(self.__contents[j][i-1])-log10(self.__scalelow))
00326                                            /(log10(self.__scale)-log10(self.__scalelow))*widthy,
00327                                       1+self.bds+self.__marginleft+float(i)/self.__nbins*widthx,
00328                                      self.bds+widthy-(log10(self.__contents[j][i])-log10(self.__scalelow))
00329                                            /(log10(self.__scale)-log10(self.__scalelow))*widthy)
00330                         else:
00331                           painter.drawLine(1+self.bds+self.__marginleft+float(i)/self.__nbins*widthx,
00332                                      self.bds+widthy,
00333                                       1+self.bds+self.__marginleft+float(i)/self.__nbins*widthx,
00334                                      self.bds+widthy-(log10(self.__contents[j][i])-log10(self.__scalelow))
00335                                            /(log10(self.__scale)-log10(self.__scalelow))*widthy)
00336                     painter.drawLine(1+self.bds+self.__marginleft+float(i)/self.__nbins*widthx,
00337                                      self.bds+widthy-(log10(self.__contents[j][i])-log10(self.__scalelow))
00338                                      /(log10(self.__scale)-log10(self.__scalelow))*widthy,
00339                                      self.bds+self.__marginleft+float(i)/self.__nbins*widthx+
00340                                      int(float(i+1)*widthx/self.__nbins)-int(float(i)*widthx/self.__nbins),
00341                                      self.bds+widthy-(log10(self.__contents[j][i])-log10(self.__scalelow))/
00342                                                         (log10(self.__scale)-log10(self.__scalelow))*widthy)
00343                     if i<self.__nbins-1:
00344                         if self.__contents[j][i+1]<self.__scalelow:
00345                             painter.drawLine(self.bds+self.__marginleft+float(i)/self.__nbins*widthx+
00346                                      int(float(i+1)*widthx/self.__nbins)-int(float(i)*widthx/self.__nbins),
00347                                      self.bds+widthy,
00348                                      self.bds+self.__marginleft+float(i)/self.__nbins*widthx+
00349                                      int(float(i+1)*widthx/self.__nbins)-int(float(i)*widthx/self.__nbins),
00350                                      self.bds+widthy-(log10(self.__contents[j][i])-log10(self.__scalelow))
00351                                            /(log10(self.__scale)-log10(self.__scalelow))*widthy)
00352
00353                   else:
00354                     if i!=0:
00355                         painter.drawLine(1+self.bds+self.__marginleft+float(i)/self.__nbins*widthx,
00356                                      self.bds+widthy-(self.__contents[j][i-1]/self.__scale)*widthy,
00357                                       1+self.bds+self.__marginleft+float(i)/self.__nbins*widthx,
00358                                      self.bds+widthy-(self.__contents[j][i]/self.__scale)*widthy)
00359                     painter.drawLine(1+self.bds+self.__marginleft+float(i)/self.__nbins*widthx,
00360                                      self.bds+widthy-(self.__contents[j][i]/self.__scale)*widthy,
00361                                      self.bds+self.__marginleft+float(i)/self.__nbins*widthx+
00362                                      int(float(i+1)*widthx/self.__nbins)-int(float(i)*widthx/self.__nbins),
00363                                      self.bds+widthy-(self.__contents[j][i]/self.__scale)*widthy)
00364             #done with histograms, now do ticks
00365             pen.setColor(QColor("black"))
00366             painter.setPen(pen)
00367             painter.setBrush(QBrush(Qt.NoBrush))
00368             painter.drawRect(self.bds+self.__marginleft,self.bds,widthx+1,widthy+1)
00369             for tick in self.__ticksx[0]:
00370                 if self.__logx:
00371                     painter.drawLine(self.bds+self.__marginleft+widthx/(log10(self.__upper)-log10(self.__lower))*(log10(tick)-
00372                             log10(self.__lower)),widthy+self.bds-1,
00373                            self.bds+self.__marginleft+widthx/(log10(self.__upper)-log10(self.__lower))*(log10(tick)-
00374                             log10(self.__lower)),widthy+self.bds-6)
00375                 else:
00376                   painter.drawLine(self.bds+self.__marginleft+widthx/(self.__upper-self.__lower)*(tick-self.__lower),widthy+self.bds-1,
00377                                  self.bds+self.__marginleft+widthx/(self.__upper-self.__lower)*(tick-self.__lower),widthy+self.bds-6)
00378             for tick in self.__ticksx[1]:
00379                 if self.__logx:
00380                     painter.drawLine(self.bds+self.__marginleft+widthx/(log10(self.__upper)-log10(self.__lower))*(log10(tick)-
00381                             log10(self.__lower)),widthy+self.bds-1,
00382                            self.bds+self.__marginleft+widthx/(log10(self.__upper)-log10(self.__lower))*(log10(tick)-
00383                             log10(self.__lower)),widthy+self.bds-4)
00384                 else:
00385                   painter.drawLine(self.bds+self.__marginleft+widthx/(self.__upper-self.__lower)*(tick-self.__lower),widthy+self.bds-1,
00386                                  self.bds+self.__marginleft+widthx/(self.__upper-self.__lower)*(tick-self.__lower),widthy+self.bds-4)
00387             for tick in self.__ticksy[0]:
00388                 if self.__logy:
00389                     painter.drawLine(self.bds+self.__marginleft,self.bds+widthy-widthy/(log10(self.__scale)-log10(self.__scalelow))*
00390                                      (log10(tick)-log10(self.__scalelow)),
00391                                  self.bds+6+self.__marginleft,self.bds+widthy-widthy/(log10(self.__scale)-log10(self.__scalelow))*
00392                                      (log10(tick)-log10(self.__scalelow)))
00393                 else:
00394                     painter.drawLine(self.bds+self.__marginleft,self.bds+widthy-widthy/(self.__scale)*tick,
00395                                  self.bds+6+self.__marginleft,self.bds+widthy-widthy/(self.__scale)*tick)
00396             for tick in self.__ticksy[1]:
00397                 if self.__logy:
00398                     painter.drawLine(self.bds+self.__marginleft,self.bds+widthy-widthy/(log10(self.__scale)-log10(self.__scalelow))*
00399                                      (log10(tick)-log10(self.__scalelow)),
00400                                  self.bds+3+self.__marginleft,self.bds+widthy-widthy/(log10(self.__scale)-log10(self.__scalelow))*
00401                                      (log10(tick)-log10(self.__scalelow)))
00402                 else:
00403                     painter.drawLine(self.bds+self.__marginleft,self.bds+widthy-widthy/(self.__scale)*tick,
00404                                  self.bds+3+self.__marginleft,self.bds+widthy-widthy/(self.__scale)*tick)
00405             #box with labels
00406             nlab=0
00407             textdist=self.fontsize*2
00408             for i in range(self.__nhist):
00409                 if self.uselabel[i] and self.showhisto[i]:nlab+=1
00410             if nlab>0:
00411                 painter.setBrush(QColor("white"))
00412                 painter.drawRect(self.bds+self.__marginleft+widthx*self.labelboxx,self.bds+widthy*self.labelboxy,
00413                                  widthx*self.boxwidth,textdist*nlab+2)
00414                 i=0
00415                 for j in range (self.__nhist):
00416                     if self.uselabel[j]==0 or self.showhisto[j]==0:continue
00417                     if self.style[j]:
00418                         painter.setBrush(QColor(self.color[j]))
00419                         pen.setColor(QColor(self.color[j]))
00420                         painter.setPen(pen)
00421                         painter.drawRect(self.bds+self.__marginleft+widthx*(self.labelboxx+.02),
00422                              self.bds+widthy*self.labelboxy+textdist*i+2,widthx*.04,textdist-2)
00423                     else:
00424                         painter.setBrush(QColor("white"))
00425                         pen.setColor(QColor(self.color[j]))
00426                         painter.setPen(pen)
00427                         painter.drawLine(self.bds+self.__marginleft+widthx*(self.labelboxx+.02),
00428                                          self.bds+widthy*self.labelboxy+textdist*i+textdist/2,
00429                              self.bds+self.__marginleft+widthx*(self.labelboxx+.06),
00430                                          self.bds+widthy*self.labelboxy+textdist*i+textdist/2)
00431                     i+=1
00432                 pen.setColor(QColor("black"))
00433                 painter.setPen(pen)
00434         except :
00435             print "Unexpected error:", sys.exc_info()[1]
00436
00437
00438     def resizeEvent(self,rev):
00439       try:
00440         self.drawLabels()
00441       except:
00442             print "Unexpected Label error:", sys.exc_info()[1]
00443
00444
00445     def drawLabels(self):
00446         width=float(self.size().width()-2*self.bds-self.__marginleft)
00447         height=float(self.size().height()-2*self.bds-self.__marginlow)
00448         self.xaxislabel.setGeometry(self.bds+self.__marginleft,height+2*self.bds-2+self.__marginlow-15,width,13)
00449         #histogram labels
00450         i=0
00451         textdist=self.fontsize*2
00452         for j in range (self.__nhist):
00453             if self.uselabel[j]==0 or self.showhisto[j]==0:
00454                 self.histolabel[j].hide()
00455                 continue
00456             self.histolabel[j].setGeometry(self.bds+self.__marginleft+width*(self.labelboxx+.1),
00457                                        self.bds+height*self.labelboxy+textdist*i+1,width*(self.boxwidth-0.12),textdist-2)
00458             self.histolabel[j].show()
00459             i+=1
00460
00461         #axis labels
00462         i=0
00463         for tick in self.__ticksx[0]:
00464             if self.__logx:
00465                 self.__xlabels[i].setGeometry(QRect(self.bds+self.__marginleft+width/(log10(self.__upper)-
00466                                             log10(self.__lower))*(log10(tick)
00467                                            -log10(self.__lower))-15, height+self.bds+2,30,self.bds+self.__marginlow-18))
00468             else:
00469                 if len(self.__ticksx[0])>1:
00470                     labelwidth=(self.__ticksx[0][1]-self.__ticksx[0][0])/2./(self.__upper-self.__lower)*width-2
00471                 else:
00472                     labelwidth=self.size().width()/2.
00473                 while (self.bds+self.__marginleft+width/(self.__upper-self.__lower)*(tick-self.__lower)-labelwidth<1 or
00474                  self.bds+self.__marginleft+width/(self.__upper-self.__lower)*(tick-self.__lower)+labelwidth>self.size().width()-1):
00475                     labelwidth-=1
00476                     if labelwidth<=6:break
00477                 self.__xlabels[i].setGeometry(QRect(self.bds+self.__marginleft+width/(self.__upper-self.__lower)
00478                                               *(tick-self.__lower)-labelwidth, height+self.bds+2,2*labelwidth,
00479                                                         self.bds+self.__marginlow-18))
00480
00481
00482             self.__xlabels[i].show()
00483             i+=1
00484         i=0
00485         for tick in self.__ticksy[0]:
00486             if self.__logy:
00487                 self.__ylabels[i].setGeometry(QRect(1,self.bds+height-height/(log10(self.__scale)-log10(self.__scalelow))
00488                                    *(log10(tick)-log10(self.__scalelow))-8,self.bds+self.__marginleft-4,16))
00489             else:
00490                 self.__ylabels[i].setGeometry(QRect(1,self.bds+height-height/self.__scale*tick-8,
00491                                                     self.bds+self.__marginleft-4,16))
00492             self.__ylabels[i].show()
00493             i+=1
00494
00495
00496 def remainder(nr):
00497   remainder = ceil(nr) - nr
00498   if remainder>.5:
00499       remainder=nr-floor(nr)
00500   return remainder
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: EnvMonImpl.py Source File

runcontrol

EnvMonImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Environmental Monitoring implementation GUI class"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2006/07/17 19:08:59 $").split(' ')[1]
00014 __version__  = "$Revision: 2.20 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import                     sys
00021 import                     os
00022 import                     threading
00023 import                     time
00024 from qt             import *
00025 from sihippo        import *
00026 import                     atexit
00027 import                     copy
00028
00029 from EnvMon                        import EnvMon
00030 from EnvMonSetRange                import EnvMonSetRange
00031 from LATTE.database.gSchemaConfig  import *
00032 from LATTE.database.gLAT           import GLAT
00033 from LATTE.database.gXBR           import GXBRD
00034 from LATTE.tools.taskEngine        import TaskEngine
00035 from LATTE.tools.guiBridges        import GUIbridge
00036
00037
00038 class EnvMonImpl(EnvMon):
00039
00040   DEADTIME_RATE_IN_MHZ = 20.0
00041   TIMEBASE_RATE_IN_MHZ = 16.6666667
00042
00043   def __init__(self, common, parent = None, name = None, fl = 0):
00044     EnvMon.__init__(self, None, name, fl)
00045     if not name:
00046       self.setName("EnvMon")
00047     self.fontPsize= QApplication.font().pointSize()
00048
00049     self.splitEnvMon.setOpaqueResize(1)
00050     self.DBN = common.getDBN()
00051     #self.__lat = common.getLAT()
00052     self.scrPlotView = ScrollablePlotView(self.DBN, self.frameOuterPlots,"PlotScrollView")
00053     if self.DBN != {}:
00054       self.scrPlotView.initEventPlot()
00055     self.__rate = 50
00056     self.sldRate.setValue(self.__rate)
00057     self.oldVal = None
00058     self.initDisplays()
00059     self.inShutdown = False
00060     atexit.register(self.quitApp)
00061     QObject.connect(self.bgDataTakingPlot,  SIGNAL('clicked(int)'),      self.toggleDataTakingPlot)
00062     QObject.connect(self.bgDataTakingMon,   SIGNAL('clicked(int)'),      self.toggleDataTakingMon)
00063     QObject.connect(self.bgChan0Plot,       SIGNAL('clicked(int)'),      self.toggleChan0Plot)
00064     QObject.connect(self.bgChan0Mon,        SIGNAL('clicked(int)'),      self.toggleChan0Mon)
00065     QObject.connect(self.bgChan1Plot,       SIGNAL('clicked(int)'),      self.toggleChan1Plot)
00066     QObject.connect(self.bgChan1Mon,        SIGNAL('clicked(int)'),      self.toggleChan1Mon)
00067     QObject.connect(self.bgChan2Plot,       SIGNAL('clicked(int)'),      self.toggleChan2Plot)
00068     QObject.connect(self.bgChan2Mon,        SIGNAL('clicked(int)'),      self.toggleChan2Mon)
00069     QObject.connect(self.bgChan3Plot,       SIGNAL('clicked(int)'),      self.toggleChan3Plot)
00070     QObject.connect(self.bgChan3Mon,        SIGNAL('clicked(int)'),      self.toggleChan3Mon)
00071     QObject.connect(self.bgChan4Plot,       SIGNAL('clicked(int)'),      self.toggleChan4Plot)
00072     QObject.connect(self.bgChan4Mon,        SIGNAL('clicked(int)'),      self.toggleChan4Mon)
00073     QObject.connect(self.bgAcdEnv1Plot,     SIGNAL('clicked(int)'),      self.toggleAcdEnv1Plot)
00074     QObject.connect(self.bgAcdEnv1Mon,      SIGNAL('clicked(int)'),      self.toggleAcdEnv1Mon)
00075     QObject.connect(self.bgPDUPlot,         SIGNAL('clicked(int)'),      self.togglePDUPlot)
00076     QObject.connect(self.bgPDUMon,          SIGNAL('clicked(int)'),      self.togglePDUMon)
00077     QObject.connect(self.cmbBlock,          SIGNAL("activated(int)"),    self.changeBlock)
00078     QObject.connect(self.cmbFreeBoard,      SIGNAL("activated(int)"),    self.changeFreeBoard)
00079     QObject.connect(self.sldRate,           SIGNAL("valueChanged(int)"), self.changeRate)
00080     QObject.connect(self.btnClear,          SIGNAL("clicked()"),         self.clearPlots)
00081     QObject.connect(self.btnRaw,            SIGNAL("toggled(bool)"),     self.toggleRaw)
00082
00083     cmd = common.getCmdCli()
00084     self.__lat = GLAT(cmd)
00085     envMonFile = os.path.join(os.environ['ONLINE_ROOT'],
00086                             'LATTE/repos/envMonSchema.xml')
00087
00088     self.__xbrd = GXBRD(cmd)
00089     self.__xbrd.readSchema(envMonFile)
00090     self.__lat.readSchema(envMonFile)
00091
00092
00093     self.DataTakingRegList = [
00094                           'event_size',
00095                           'sat_deadtime_lrs_ctr',
00096                           'sat_cal_lrs_ctr_0',
00097                           'sat_cal_lrs_ctr_1',
00098                           'sat_tkr_lrs_ctr_0',
00099                           'sat_tkr_lrs_ctr_1',
00100                           'sat_tkr_lrs_ctr_2',
00101                           'sat_tkr_lrs_ctr_3'
00102                         ]
00103
00104     self.chan2RegList = [
00105                           'adc_afee0_t0',
00106                           'adc_afee0_t1',
00107                           'adc_afee1_t0',
00108                           'adc_afee1_t1',
00109                           'adc_afee2_t0',
00110                           'adc_afee2_t1',
00111                           'adc_afee3_t0',
00112                           'adc_afee3_t1'
00113                         ]
00114
00115     self.chan3RegList = [
00116                           'adc_tkr_c0_t0',
00117                           'adc_tkr_c0_t1',
00118                           'adc_tkr_c1_t0',
00119                           'adc_tkr_c1_t1',
00120                           'adc_tkr_c2_t0',
00121                           'adc_tkr_c2_t1',
00122                           'adc_tkr_c3_t0',
00123                           'adc_tkr_c3_t1'
00124                         ]
00125
00126     self.chan4RegList = [
00127                           'adc_tkr_c4_t0',
00128                           'adc_tkr_c4_t1',
00129                           'adc_tkr_c5_t0',
00130                           'adc_tkr_c5_t1',
00131                           'adc_tkr_c6_t0',
00132                           'adc_tkr_c6_t1',
00133                           'adc_tkr_c7_t0',
00134                           'adc_tkr_c7_t1'
00135                         ]
00136
00137     self.acdEnv1RegList = [
00138                           'env_vdd_',
00139                           'env_temp_',
00140                           'env_hv1_',
00141                           'env_hv2_',
00142                           'env_dac_digital_3_3i',
00143                           'env_dac_temp',
00144                           'env_dac_hv_i',
00145                           'env_dac_v',
00146                         ]
00147
00148     self.acdEnv2RegList = [
00149                           'env_free_4LA',
00150                           'env_free_4LB',
00151                           'env_free_4RA',
00152                           'env_free_4RB',
00153                           'env_daq',
00154                         ]
00155
00156     self.pduRegList = [
00157                         'adc_ps_temp_0',
00158                         'adc_ps_temp_1',
00159                         'adc_tem_temp_0',
00160                         'adc_tem_temp_1',
00161                         'adc_tem_voltage_0',
00162                         'adc_tem_voltage_1',
00163                       ]
00164
00165     self.acdPlotCheckList = {}
00166     self.acdMonitorCheckList = {}
00167     for i in range(12):
00168       self.acdPlotCheckList[i] = [0] * 8
00169       self.acdMonitorCheckList[i] = [0] * 8
00170
00171     self.monitorList = {}
00172     #self.vArrayList = {}
00173     self.__block = 'TEM 0'
00174     self.changeFreeBoard(0)
00175     self.cmbBlock.setCurrentText(self.__block)
00176     self.changeBlock(-1) # First time caller
00177     self.__threadQuit = 0
00178     self.__bypass = 0
00179     #self.__dictSem = threading.Semaphore(1) # used for controlling dictionary access
00180
00181     self.__guiThread    = threading.currentThread()
00182     self.__guiBridge    = GUIbridge(self.__guiThread)
00183
00184     #self.threadReadEnv = threading.Thread(target=self.readEnvValues, name='EnvMon', args=())
00185     #self.threadReadEnv.start()
00186     self.threadReadEnv = TaskEngine('EnvMon')
00187     self.threadReadEnv.start()
00188     self.threadReadEnv.spawn(self.readEnvValues)
00189
00190   def setupLabels(self, newTem):
00191     if newTem:
00192                # (channel, adc)
00193       labels = {  (0,1): 'TKR Bias (I)',
00194                   (0,3): 'CAL Bias (I)',
00195                   (0,5): 'TEM (I)',
00196                   (0,6): 'TKR Bias V0',
00197                   (0,7): '',
00198                   (1,1): 'TKR Bias V1',
00199                   (1,3): 'CAL Bias V1',
00200                   (1,4): 'CAL Bias V0',
00201                   (1,5): '28 V0',
00202                   (1,7): '28 V1'
00203                 }
00204
00205       self.disableEntries = ['TKRBiasI']
00206
00207       self.chan0RegList = [
00208                             'adc_tkr_digital_2_5v',
00209                             'psd_tkr_bias_i',
00210                             'adc_tkr_analog_a_1_5v',
00211                             'psd_cal_bias_i',
00212                             'adc_tkr_analog_b_2_5v',
00213                             'psd_tem_i',
00214                             'adc_tkr_bias_v0',
00215                             ''
00216                           ]
00217
00218       self.chan1RegList = [
00219                             'adc_cal_digital_3_3v',
00220                             'adc_tkr_bias_v1',
00221                             'adc_cal_analog_3_3v',
00222                             'adc_cal_bias_v1',
00223                             'adc_cal_bias_v0',
00224                             'adc_28_v0',
00225                             'adc_tem_digital_3_3v',
00226                             'adc_28_v1'
00227                           ]
00228
00229     else:
00230                # (channel, adc)
00231       labels = {  (0,1): 'TKR Digital (2.5I)',
00232                   (0,3): 'TKR Analog A (1.5I)',
00233                   (0,5): 'TKR Analog B (2.5I)',
00234                   (0,6): 'TKR Bias (V)',
00235                   (0,7): 'TKR Bias (I)',
00236                   (1,1): 'CAL Digital (3.3I)',
00237                   (1,3): 'CAL Analog (3.3I)',
00238                   (1,4): 'CAL Bias (V)',
00239                   (1,5): 'CAL Bias (I)',
00240                   (1,7): 'TEM Digital (3.3I)'
00241                 }
00242       self.disableEntries = []
00243
00244       self.chan0RegList = [
00245                             'adc_tkr_digital_2_5v',
00246                             'adc_tkr_digital_2_5i',
00247                             'adc_tkr_analog_a_1_5v',
00248                             'adc_tkr_analog_a_1_5i',
00249                             'adc_tkr_analog_b_2_5v',
00250                             'adc_tkr_analog_b_2_5i',
00251                             'adc_tkr_bias_v',
00252                             'adc_tkr_bias_i'
00253                           ]
00254
00255       self.chan1RegList = [
00256                             'adc_cal_digital_3_3v',
00257                             'adc_cal_digital_3_3i',
00258                             'adc_cal_analog_3_3v',
00259                             'adc_cal_analog_3_3i',
00260                             'adc_cal_bias_v',
00261                             'adc_cal_bias_i',
00262                             'adc_tem_digital_3_3v',
00263                             'adc_tem_digital_3_3i'
00264                           ]
00265
00266     for ((ch,adc), label) in labels.items():
00267       txtLabel = eval("self.textLabelCh%dAdc%d" % (ch,adc))
00268       if label != "": label += ":"
00269       txtLabel.setText(label)
00270     for suffix in self.disableEntries:
00271       eval("self.txt"+suffix).setEnabled(0)
00272       eval("self.chkPlot"+suffix).setEnabled(0)
00273       eval("self.chkMon"+suffix).setEnabled(0)
00274
00275
00276   def setFont(self, font):
00277     self.fontPsize= font.pointSize()
00278     EnvMon.setFont(self, font)
00279     for regName in self.monitorList:
00280       self.adjustMonitorTextFont(self.monitorList[regName])
00281
00282   def adjustMonitorTextFont(self, monTxt):
00283     font = monTxt.font()
00284     font.setPointSize(self.fontPsize)
00285     monTxt.setFont(font)
00286
00287   def toggleRaw(self, raw):
00288     self.__bypass = raw
00289
00290   def changeBlock(self, block):
00291     if block == -1:
00292       block = 0
00293       suppressError = 1
00294     else:
00295       suppressError = 0
00296     blockText = str(self.cmbBlock.text(block))
00297     if blockText.startswith('TEM'):
00298       try:
00299         self.selectTEM(blockText)
00300       except:
00301         # Either the TEM doesn't exist or running with a G2 or G3 setup
00302         if not suppressError:
00303           QMessageBox.critical(self, "Environmental Quantity Monitor",
00304                               "Invalid block " + blockText +
00305                               ", doesn't exist in this hardware configuration.")
00306         else:
00307           self.selectAEM()
00308       else:
00309         self.envMonStack.raiseWidget(0)
00310       self.cmbBlock.setCurrentText(self.__block)
00311     else:
00312       self.selectAEM()
00313
00314   def selectAEM(self):
00315     self.__block = "AEM"
00316     self.__lat.applyConfig(2)
00317     self.__gaeq = self.__lat.AEM.AEQ
00318     self.envMonStack.raiseWidget(1)
00319
00320   def selectTEM(self, blockText):
00321     temId = int(blockText.split()[1])
00322     tem = self.__lat.TEM[temId]
00323     temVer = int((tem.status >> 16) & 0x3F)
00324     self.__block = blockText
00325     self.__gtic = tem.TIC
00326     self.__gtwr = self.__xbrd.TWR[temId]
00327     if temVer < 8:
00328       self.__lat.applyConfig(0, self.__xbrd)
00329       self.setupLabels(0)
00330     else:
00331       self.__lat.applyConfig(1, self.__xbrd)
00332       self.setupLabels(1)
00333
00334   def changeFreeBoard(self, boardId):
00335     self.__board = boardId
00336     self.__freeBoard = str(self.cmbFreeBoard.currentText())
00337     self.populateACDchecks(boardId)
00338
00339   def populateACDchecks(self, boardId):
00340     checkList = self.acdMonitorCheckList[boardId]
00341     for i in range(8):
00342       chkState = checkList[i]
00343       chkBox = self.bgAcdEnv1Mon.find(i)
00344       if chkState:
00345         chkBox.setChecked(1)
00346       else:
00347         chkBox.setChecked(0)
00348         eval("self.txt" + chkBox.name()[6:]).setText("")
00349     checkList = self.acdPlotCheckList[boardId]
00350     for i in range(8):
00351       chkState = checkList[i]
00352       chkBox = self.bgAcdEnv1Plot.find(i)
00353       if chkState:
00354         chkBox.setChecked(1)
00355       else:
00356         chkBox.setChecked(0)
00357
00358
00359   def toggleDataTakingPlot(self, id):
00360     chk = self.bgDataTakingPlot.find(id)
00361     if chk.isChecked():
00362       if not self.DataTakingRegList[id] in self.scrPlotView.getPlotList():
00363         if self.DataTakingRegList[id] == "event_size":
00364           self.scrPlotView.addEventPlot(self.DataTakingRegList[id])
00365         else:
00366           columns = ['Time', 'Counter']
00367           self.scrPlotView.addPlot(name=self.DataTakingRegList[id],
00368                                           title=self.DataTakingRegList[id],
00369                                           sizeX=250,
00370                                           sizeY=300,
00371                                           labels=columns)
00372     else:
00373       self.scrPlotView.removePlot(self.DataTakingRegList[id])
00374
00375   def toggleDataTakingMon(self, id):
00376     chk = self.bgDataTakingMon.find(id)
00377     if chk.isChecked():
00378       if not self.DataTakingRegList[id] in self.monitorList:
00379         #self.__dictSem.acquire()
00380         self.monitorList[self.DataTakingRegList[id]] = eval("self.txt" + chk.name()[6:])
00381         self.adjustMonitorTextFont(self.monitorList[self.DataTakingRegList[id]])
00382         #self.__dictSem.release()
00383     else:
00384       if self.DataTakingRegList[id] in self.monitorList:
00385         self.monitorList[self.DataTakingRegList[id]].setText('')
00386         #self.__dictSem.acquire()
00387         self.monitorList.__delitem__(self.DataTakingRegList[id])
00388         #self.__dictSem.release()
00389
00390
00391   def toggleChan0Plot(self, id):
00392     chk = self.bgChan0Plot.find(id)
00393     if chk.isChecked():
00394       if not self.chan0RegList[id] in self.scrPlotView.getPlotList():
00395         reg = self.__gtic.regs[self.chan0RegList[id]]
00396         if reg.getEGU().units() == '':
00397           strUnits = ""
00398         else:
00399           strUnits = " (" + reg.getEGU().units() + ")"
00400         if chk.name()[-1] == 'V':
00401           columns = ['Time', 'Voltage' + strUnits]
00402         else:
00403           columns = ['Time', 'Current' + strUnits]
00404         #self.vArrayList[self.chan0RegList[id]] = [0.0] * 100
00405         self.scrPlotView.addPlot(name=self.chan0RegList[id],
00406                                         title=self.chan0RegList[id],
00407                                         sizeX=250,
00408                                         sizeY=300,
00409                                         labels=columns)
00410     else:
00411       self.scrPlotView.removePlot(self.chan0RegList[id])
00412
00413
00414   def toggleChan0Mon(self, id):
00415     chk = self.bgChan0Mon.find(id)
00416     if chk.isChecked():
00417       if not self.chan0RegList[id] in self.monitorList:
00418         #self.__dictSem.acquire()
00419         self.monitorList[self.chan0RegList[id]] = eval("self.txt" + chk.name()[6:])
00420         self.adjustMonitorTextFont(self.monitorList[self.chan0RegList[id]])
00421         #self.__dictSem.release()
00422     else:
00423       if self.chan0RegList[id] in self.monitorList:
00424         self.monitorList[self.chan0RegList[id]].setText('')
00425         #self.__dictSem.acquire()
00426         self.monitorList.__delitem__(self.chan0RegList[id])
00427         #self.__dictSem.release()
00428
00429   def toggleChan1Plot(self, id):
00430     chk = self.bgChan1Plot.find(id)
00431     if chk.isChecked():
00432       if not self.chan1RegList[id] in self.scrPlotView.getPlotList():
00433         reg = self.__gtic.regs[self.chan1RegList[id]]
00434         if reg.getEGU().units() == '':
00435           strUnits = ""
00436         else:
00437           strUnits = " (" + reg.getEGU().units() + ")"
00438         if chk.name()[-1] == 'V':
00439           columns = ['Time', 'Voltage' + strUnits]
00440         else:
00441           columns = ['Time', 'Current' + strUnits]
00442         #self.vArrayList[self.chan1RegList[id]] = [0.0] * 100
00443         self.scrPlotView.addPlot(name=self.chan1RegList[id],
00444                                         title=self.chan1RegList[id],
00445                                         sizeX=250,
00446                                         sizeY=300,
00447                                         labels=columns)
00448     else:
00449       self.scrPlotView.removePlot(self.chan1RegList[id])
00450
00451
00452   def toggleChan1Mon(self, id):
00453     chk = self.bgChan1Mon.find(id)
00454     if chk.isChecked():
00455       if not self.chan1RegList[id] in self.monitorList:
00456         #self.__dictSem.acquire()
00457         self.monitorList[self.chan1RegList[id]] = eval("self.txt" + chk.name()[6:])
00458         self.adjustMonitorTextFont(self.monitorList[self.chan1RegList[id]])
00459         #self.__dictSem.release()
00460     else:
00461       if self.chan1RegList[id] in self.monitorList:
00462         self.monitorList[self.chan1RegList[id]].setText('')
00463         #self.__dictSem.acquire()
00464         self.monitorList.__delitem__(self.chan1RegList[id])
00465         #self.__dictSem.release()
00466
00467   def toggleChan2Plot(self, id):
00468     chk = self.bgChan2Plot.find(id)
00469     if chk.isChecked():
00470       if not self.chan2RegList[id] in self.scrPlotView.getPlotList():
00471         reg = self.__gtic.regs[self.chan2RegList[id]]
00472         if reg.getEGU().units() == '':
00473           strUnits = ""
00474         else:
00475           strUnits = " (" + reg.getEGU().units() + ")"
00476         columns = ['Time', 'Temperature' + strUnits]
00477         #self.vArrayList[self.chan2RegList[id]] = [0.0] * 100
00478         self.scrPlotView.addPlot(name=self.chan2RegList[id],
00479                                         title=self.chan2RegList[id],
00480                                         sizeX=250,
00481                                         sizeY=300,
00482                                         labels=columns)
00483     else:
00484       self.scrPlotView.removePlot(self.chan2RegList[id])
00485
00486
00487   def toggleChan2Mon(self, id):
00488     chk = self.bgChan2Mon.find(id)
00489     if chk.isChecked():
00490       if not self.chan2RegList[id] in self.monitorList:
00491         #self.__dictSem.acquire()
00492         self.monitorList[self.chan2RegList[id]] = eval("self.txt" + chk.name()[6:])
00493         self.adjustMonitorTextFont(self.monitorList[self.chan2RegList[id]])
00494         #self.__dictSem.release()
00495     else:
00496       if self.chan2RegList[id] in self.monitorList:
00497         self.monitorList[self.chan2RegList[id]].setText('')
00498         #self.__dictSem.acquire()
00499         self.monitorList.__delitem__(self.chan2RegList[id])
00500         #self.__dictSem.release()
00501
00502   def toggleChan3Plot(self, id):
00503     chk = self.bgChan3Plot.find(id)
00504     if chk.isChecked():
00505       if not self.chan3RegList[id] in self.scrPlotView.getPlotList():
00506         reg = self.__gtic.regs[self.chan3RegList[id]]
00507         if reg.getEGU().units() == '':
00508           strUnits = ""
00509         else:
00510           strUnits = " (" + reg.getEGU().units() + ")"
00511         columns = ['Time', 'Temperature' + strUnits]
00512         #self.vArrayList[self.chan3RegList[id]] = [0.0] * 100
00513         self.scrPlotView.addPlot(name=self.chan3RegList[id],
00514                                         title=self.chan3RegList[id],
00515                                         sizeX=250,
00516                                         sizeY=300,
00517                                         labels=columns)
00518     else:
00519       self.scrPlotView.removePlot(self.chan3RegList[id])
00520
00521
00522   def toggleChan3Mon(self, id):
00523     chk = self.bgChan3Mon.find(id)
00524     if chk.isChecked():
00525       if not self.chan3RegList[id] in self.monitorList:
00526         #self.__dictSem.acquire()
00527         self.monitorList[self.chan3RegList[id]] = eval("self.txt" + chk.name()[6:])
00528         self.adjustMonitorTextFont(self.monitorList[self.chan3RegList[id]])
00529         #self.__dictSem.release()
00530     else:
00531       if self.chan3RegList[id] in self.monitorList:
00532         self.monitorList[self.chan3RegList[id]].setText('')
00533         #self.__dictSem.acquire()
00534         self.monitorList.__delitem__(self.chan3RegList[id])
00535         #self.__dictSem.release()
00536
00537   def toggleChan4Plot(self, id):
00538     chk = self.bgChan4Plot.find(id)
00539     if chk.isChecked():
00540       if not self.chan4RegList[id] in self.scrPlotView.getPlotList():
00541         reg = self.__gtic.regs[self.chan4RegList[id]]
00542         if reg.getEGU().units() == '':
00543           strUnits = ""
00544         else:
00545           strUnits = " (" + reg.getEGU().units() + ")"
00546         columns = ['Time', 'Temperature' + strUnits]
00547         #self.vArrayList[self.chan4RegList[id]] = [0.0] * 100
00548         self.scrPlotView.addPlot(name=self.chan4RegList[id],
00549                                         title=self.chan4RegList[id],
00550                                         sizeX=250,
00551                                         sizeY=300,
00552                                         labels=columns)
00553     else:
00554       self.scrPlotView.removePlot(self.chan4RegList[id])
00555
00556
00557   def toggleChan4Mon(self, id):
00558     chk = self.bgChan4Mon.find(id)
00559     if chk.isChecked():
00560       if not self.chan4RegList[id] in self.monitorList:
00561         #self.__dictSem.acquire()
00562         self.monitorList[self.chan4RegList[id]] = eval("self.txt" + chk.name()[6:])
00563         self.adjustMonitorTextFont(self.monitorList[self.chan4RegList[id]])
00564         #self.__dictSem.release()
00565     else:
00566       if self.chan4RegList[id] in self.monitorList:
00567         self.monitorList[self.chan4RegList[id]].setText('')
00568         #self.__dictSem.acquire()
00569         self.monitorList.__delitem__(self.chan4RegList[id])
00570         #self.__dictSem.release()
00571
00572   def toggleAcdEnv1Plot(self, id):
00573     chk = self.bgAcdEnv1Plot.find(id)
00574     if chk.isChecked():
00575       reg = self.acdEnv1RegList[id]
00576       if reg.startswith('env_dac'):
00577         for i in range(12):
00578           self.acdPlotCheckList[i][id] = 1
00579       else:
00580         self.acdPlotCheckList[self.__board][id] = 1
00581       if reg.endswith('_'):
00582         reg += str(self.cmbFreeBoard.currentText())
00583       if not reg in self.scrPlotView.getPlotList():
00584         regAttr = self.__gaeq.regs[reg]
00585         if regAttr.getEGU().units() == '':
00586           strUnits = ""
00587         else:
00588           strUnits = " (" + regAttr.getEGU().units() + ")"
00589         columns = ['Time', strUnits]
00590         #self.vArrayList[self.acdEnv1RegList[id]] = [0.0] * 100
00591         self.scrPlotView.addPlot(name=reg,
00592                                         title=reg,
00593                                         sizeX=250,
00594                                         sizeY=300,
00595                                         labels=columns)
00596     else:
00597       reg = self.acdEnv1RegList[id]
00598       if reg.startswith('env_dac'):
00599         for i in range(12):
00600           self.acdPlotCheckList[i][id] = 0
00601       else:
00602         self.acdPlotCheckList[self.__board][id] = 0
00603       if reg.endswith('_'):
00604         reg += str(self.cmbFreeBoard.currentText())
00605       self.scrPlotView.removePlot(reg)
00606
00607   def toggleAcdEnv1Mon(self, id):
00608     chk = self.bgAcdEnv1Mon.find(id)
00609     if chk.isChecked():
00610       reg = self.acdEnv1RegList[id]
00611       if reg.startswith('env_dac'):
00612         for i in range(12):
00613           self.acdMonitorCheckList[i][id] = 1
00614       else:
00615         self.acdMonitorCheckList[self.__board][id] = 1
00616       if reg.endswith('_'):
00617         reg += str(self.cmbFreeBoard.currentText())
00618       if not reg in self.monitorList:
00619         #self.__dictSem.acquire()
00620         self.monitorList[reg] = eval("self.txt" + chk.name()[6:])
00621         self.adjustMonitorTextFont(self.monitorList[reg])
00622         #self.__dictSem.release()
00623     else:
00624       reg = self.acdEnv1RegList[id]
00625       if reg.startswith('env_dac'):
00626         for i in range(12):
00627           self.acdMonitorCheckList[i][id] = 0
00628       else:
00629         self.acdMonitorCheckList[self.__board][id] = 0
00630       if reg.endswith('_'):
00631         reg += str(self.cmbFreeBoard.currentText())
00632       if reg in self.monitorList:
00633         self.monitorList[reg].setText('')
00634         #self.__dictSem.acquire()
00635         self.monitorList.__delitem__(reg)
00636         #self.__dictSem.release()
00637
00638   def togglePDUPlot(self, id):
00639     chk = self.bgPDUPlot.find(id)
00640     if chk.isChecked():
00641       if not self.pduRegList[id] in self.scrPlotView.getPlotList():
00642         reg = self.__gtwr.regs[self.pduRegList[id]]
00643         if reg.getEGU().units() == '':
00644           strUnits = ""
00645         else:
00646           strUnits = " (" + reg.getEGU().units() + ")"
00647         if chk.name()[-1] == 'V':
00648           columns = ['Time', 'Voltage' + strUnits]
00649         else:
00650           columns = ['Time', 'Temperature' + strUnits]
00651         self.scrPlotView.addPlot(name=self.pduRegList[id],
00652                                         title=self.pduRegList[id],
00653                                         sizeX=250,
00654                                         sizeY=300,
00655                                         labels=columns)
00656     else:
00657       self.scrPlotView.removePlot(self.pduRegList[id])
00658
00659   def togglePDUMon(self, id):
00660     chk = self.bgPDUMon.find(id)
00661     if chk.isChecked():
00662       if not self.pduRegList[id] in self.monitorList:
00663         #self.__dictSem.acquire()
00664         self.monitorList[self.pduRegList[id]] = eval("self.txt" + chk.name()[6:])
00665         self.adjustMonitorTextFont(self.monitorList[self.pduRegList[id]])
00666         #self.__dictSem.release()
00667     else:
00668       if self.pduRegList[id] in self.monitorList:
00669         self.monitorList[self.pduRegList[id]].setText('')
00670         #self.__dictSem.acquire()
00671         self.monitorList.__delitem__(self.pduRegList[id])
00672         #self.__dictSem.release()
00673
00674
00675   def clearPlots(self):
00676     #self.__dictSem.acquire()
00677     for txt in self.monitorList.values():
00678       txt.setText('')
00679     self.monitorList.clear()
00680     for chkId in self.scrPlotView.getPlotList().keys():
00681       self.scrPlotView.removePlot(chkId)
00682     for chkId in range(self.bgDataTakingMon.count()):
00683       self.bgDataTakingMon.find(chkId).setChecked(0)
00684       self.bgDataTakingPlot.find(chkId).setChecked(0)
00685     for chkId in range(self.bgChan0Mon.count()):
00686       self.bgChan0Mon.find(chkId).setChecked(0)
00687       self.bgChan0Plot.find(chkId).setChecked(0)
00688     for chkId in range(self.bgChan1Mon.count()):
00689       self.bgChan1Mon.find(chkId).setChecked(0)
00690       self.bgChan1Plot.find(chkId).setChecked(0)
00691     for chkId in range(self.bgChan2Mon.count()):
00692       self.bgChan2Mon.find(chkId).setChecked(0)
00693       self.bgChan2Plot.find(chkId).setChecked(0)
00694     for chkId in range(self.bgChan3Mon.count()):
00695       self.bgChan3Mon.find(chkId).setChecked(0)
00696       self.bgChan3Plot.find(chkId).setChecked(0)
00697     for chkId in range(self.bgChan4Mon.count()):
00698       self.bgChan4Mon.find(chkId).setChecked(0)
00699       self.bgChan4Plot.find(chkId).setChecked(0)
00700     for chkId in range(self.bgAcdEnv1Mon.count()):
00701       self.bgAcdEnv1Mon.find(chkId).setChecked(0)
00702       self.bgAcdEnv1Plot.find(chkId).setChecked(0)
00703     for chkId in range(self.bgPDUMon.count()):
00704       self.bgPDUMon.find(chkId).setChecked(0)
00705       self.bgPDUPlot.find(chkId).setChecked(0)
00706     #self.__dictSem.release()
00707
00708   def initDisplays(self):
00709     #self.scrPlotView.setVScrollBarMode(QScrollView.AlwaysOn)
00710     self.frameOuterPlotsLayout = QGridLayout(self.frameOuterPlots,1,1,11,6,"frameOuterPlotsLayout")
00711     self.frameOuterPlotsLayout.addWidget(self.scrPlotView, 0, 0)
00712
00713   def changeRate(self, val):
00714     self.__rate = val
00715
00716   def calcDeadTime(self, regName):
00717     reg = self.__gtic.regs[regName]
00718     regNo = reg.id()
00719     resp = self.__gtic.read(regNo)
00720     status = resp.status()
00721     newVal = resp.value()
00722     newTS = resp.payloads()[1]
00723     if status == 0:
00724       if self.oldVal is None:
00725         self.oldVal = newVal
00726         self.oldTS = newTS
00727         return None
00728       else:
00729         dTime = newVal - self.oldVal
00730         dTS = newTS - self.oldTS
00731         self.oldVal = newVal
00732         self.oldTS = newTS
00733         if dTime < 0:
00734           dTime += (1L << 32)
00735         if dTS < 0:
00736           dTS += (1L << 64)
00737         if dTS != 0:                    # Make sure denominator isn't zero
00738           return (float(dTime)/float(dTS)) * (EnvMonImpl.TIMEBASE_RATE_IN_MHZ / EnvMonImpl.DEADTIME_RATE_IN_MHZ) * 100.0
00739         else:
00740           #print "dTimebase = 0"
00741           return None
00742     else:
00743       #print "Deadtime counter saturated"
00744       self.oldVal = None
00745       self.oldTS = None
00746       return None
00747
00748   def readEnvValues(self):
00749     def updateGui(regs):
00750       for (tWidget, val) in regs.items():
00751         if self.__threadQuit != 0: break
00752         tWidget.setText(val)
00753     cnt = 0
00754     while(self.__threadQuit == 0):
00755       cnt = cnt + 1
00756       #self.__dictSem.acquire()
00757
00758       #Make a copy of the list so that we don't have concurrency issues
00759       #with the main thread
00760       regList = copy.copy(self.monitorList)
00761       updateGuiRegs = {}
00762       #self.__dictSem.release()
00763       for regName in regList:
00764         if self.__threadQuit != 0:
00765           break
00766         if regName == "event_size" and self.DBN != {}:
00767           val = self.DBN['_event_size']
00768           strVal = "%8d" % val
00769           if not self.__bypass:
00770             strVal = strVal + "   "
00771         elif regName == "sat_deadtime_lrs_ctr":
00772           val = self.calcDeadTime(regName)
00773           if val is not None:
00774             strVal = "%3.2f%%" % val
00775           else:
00776             val    = 0
00777             strVal = "N/A"
00778           if not self.__bypass:
00779             strVal = strVal + "   "
00780         else:
00781           try:
00782             if regName.startswith('env'):
00783               reg = self.__gaeq.regs[regName]
00784               val = reg.get(bypass=self.__bypass, node=self.__gaeq)
00785             elif regName in self.pduRegList:
00786               reg = self.__gtwr.regs[regName]
00787               reg.set(0, self.__gtwr)
00788               val = reg.get(bypass=1, node=self.__gtwr) & 0xFFFF
00789               if not self.__bypass:
00790                 val = reg.getEGU().egu(val)
00791             else:
00792               reg = self.__gtic.regs[regName]
00793               val = reg.get(bypass=self.__bypass, node=self.__gtic)
00794             if not self.__bypass:
00795               if regName in self.DataTakingRegList:
00796                 strVal = "%8d" % val
00797               else:
00798                 strVal = "%8.4f" % val
00799               strVal = strVal + " %2s" % reg.getEGU().units()
00800             else:
00801               strVal = "%8d" % val
00802           except:
00803             val    = 0
00804             strVal = "N/A"
00805         if not regName.startswith('env') or regName.startswith('env_dac'):
00806           #regList[regName].setText(strVal)
00807           #self.execGUImethodNR(regList[regName].setText, strVal)
00808           updateGuiRegs[regList[regName]] = strVal
00809         elif regName[-3:] == self.__freeBoard:
00810           #regList[regName].setText(strVal)
00811           #self.execGUImethodNR(regList[regName].setText, strVal)
00812           updateGuiRegs[regList[regName]] = strVal
00813         if regName in self.scrPlotView.getPlotList():
00814           plot = self.scrPlotView.getPlot(regName)
00815           if regName == "event_size" and self.DBN != {}:
00816             self.DBN['_EventSizeNTuple'].setIntervalEnabled(0)
00817             #plot.update()
00818             self.DBN['_EventSizeNTuple'].setIntervalEnabled(1)
00819           else:
00820             nt = plot.getNTuple()
00821             nt.addRow([cnt, val])
00822       #self.__dictSem.release()
00823       if updateGuiRegs != {}:
00824          self.execGUImethodNR(updateGui, updateGuiRegs)
00825
00826       t0 = time.time()
00827       while (time.time() - t0 < 2.1 - self.__rate*0.02):
00828         time.sleep(.1)
00829         if self.__threadQuit != 0:
00830           break
00831     # Make sure all the previous calls to GUI bridge
00832     # get processed before shutdown
00833     if self.__threadQuit == 1:
00834       self.execGUImethodNR(self.shutdown)
00835
00836   def shutdown(self):
00837     self.__threadQuit = 1
00838     self.threadReadEnv.shutdown()
00839     self.inShutdown = True
00840     self.__guiBridge.shutdown()
00841     time.sleep(.1)
00842     self.unregisterExitHandler()
00843     self.close()
00844     #self.deleteLater()
00845
00846   def quitApp(self):
00847     self.__threadQuit = 2
00848     self.inShutdown = True
00849     self.threadReadEnv.shutdown()
00850     self.__guiBridge.shutdown()
00851     time.sleep(.1)
00852     self.unregisterExitHandler()
00853
00854   def unregisterExitHandler(self):
00855     for i in range(len(atexit._exithandlers)):
00856       if atexit._exithandlers[i][0] == self.quitApp:
00857         del atexit._exithandlers[i]
00858         break
00859
00860   def closeEvent(self, e):
00861     if self.__threadQuit == 0:
00862       # Before the user closes the app we want to
00863       # shutdown, so ignore the close request and
00864       # let the thread finish to its completion
00865       # which will call shutdown where the actual
00866       # close happens.
00867       self.__threadQuit = 1
00868       #self.shutdown()
00869       #e.accept()
00870       e.ignore()
00871     else:
00872       e.accept()
00873
00874   def customEvent(self, e):
00875     """This method overrides the QObject base class's.  There is generally
00876     no reason to call this method directly.  It is called by the Qt
00877     infrastructure whenever the custom event is posted, e.g. by the following
00878     three methods of this class: createGUI, execGUImethodNR and execGUImethod.
00879     """
00880     self.__guiBridge.handleCustomEvent(e)
00881
00882   def execGUImethodNR(self, func, *args, **kwargs):
00883     """Method used for executing a GUI function from a non-GUI thread.
00884     Use this method when no (useful) response is expected or
00885     when waiting for one could cause a deadlock.  Any response from the
00886     function is lost."""
00887     if self.inShutdown:  return # Don't try to update the GUI during shutdown
00888
00889     return self.__guiBridge.execGUImethodNR(self, func, *args, **kwargs)
00890
00891   def execGUImethod(self, func, *args, **kwargs):
00892     """Method used for executing a GUI function from a non-GUI thread.
00893     Use this method when a response is expected from the function and
00894     when it is appropriate to wait for it (no deadlock arises)"""
00895     if self.inShutdown:  return # Don't try to update the GUI during shutdown
00896
00897     return self.__guiBridge.execGUImethod(self, func, *args, **kwargs)
00898
00899
00900
00901 class PlotWidget(QtViewWidget):
00902
00903   class EnvMonSetRangeImpl(EnvMonSetRange):
00904     def __init__(self, parent = None,name = None,fl = 1):
00905       EnvMonSetRange.__init__(self,parent,name,fl)
00906       QObject.connect(self.btnOK,     SIGNAL("clicked()"), self.OKButtonClicked)
00907       QObject.connect(self.btnCancel, SIGNAL("clicked()"), self.CancelButtonClicked)
00908       self.__cancel = 1
00909
00910     def OKButtonClicked(self):
00911       self.__cancel = 0
00912       self.close()
00913
00914     def CancelButtonClicked(self):
00915       self.close()
00916
00917     def getMinMax(self):
00918       rect = self.parentWidget().geometry()
00919       self.move (rect.center().x() - self.rect().center().x(),
00920                  rect.center().y() - self.rect().center().y())
00921       self.txtMinVal.setFocus()
00922       self.show()
00923       self.exec_loop()
00924       if self.__cancel:
00925         return None
00926       else:
00927         return (str(self.txtMinVal.text()), str(self.txtMaxVal.text()))
00928
00929   def __init__(self, envMonDlg, parent, title, sizeX, sizeY, labels):
00930     QtViewWidget.__init__(self, parent, "", Qt.WStaticContents | Qt.WRepaintNoErase)
00931     #QtViewWidget.__init__(self, parent, "")
00932     self.printer=QPrinter()
00933     self.__setRangeDlg = self.EnvMonSetRangeImpl(envMonDlg)
00934     ntc = NTupleController.instance()
00935     self.__nt = ntc.createCircularBuffer(2)
00936     self.__nt.setLabels(labels)
00937     self.__nt.setTitle(title)
00938     self.__nt.reserve(100)
00939     dc = DisplayController.instance()
00940     self.__plot = dc.createDisplay('Strip Chart', self.__nt, labels)
00941     self.setPlotter (self.__plot)
00942     self.setDoubleBuffering(1)
00943     self.resize(sizeX, sizeY)
00944     self.show()
00945
00946   def getNTuple(self):
00947     return self.__nt
00948
00949   def contextMenuEvent(self, cmev):
00950     contextMenu = QPopupMenu( self )
00951     caption = QLabel( self )
00952     caption.setAlignment( Qt.AlignCenter )
00953     caption.setText("<font color=darkblue><u><b>Context Menu</b></u></font>")
00954     contextMenu.insertItem(caption)
00955     contextMenu.insertItem( "&Print to printer", self.printPlot, Qt.CTRL+Qt.Key_P)
00956     contextMenu.insertItem( "&Save to &file", self.saveToFile, Qt.CTRL+Qt.Key_S)
00957     contextMenu.insertSeparator()
00958     contextMenu.insertItem( "&Set Range", self.setRange, Qt.CTRL+Qt.Key_R)
00959     contextMenu.exec_loop(QCursor.pos())
00960
00961   def printPlot(self):
00962     if not self.printer:
00963       self.printer = QPrinter()
00964     if self.printer.setup(self):
00965       pp=QPainter(self.printer)
00966       self.draw(pp)
00967
00968   def saveToFile(self):
00969     imgFormatList = []
00970     ifQList = QImage.outputFormatList()
00971     fileSpec = "Images ("
00972     for imgFormat in ifQList:
00973       imgFormat = str(imgFormat)
00974       if imgFormat == 'JPEG': imgFormat = 'JPG'
00975       imgFormatList = imgFormatList + [imgFormat]
00976       fileSpec = fileSpec + " *." + imgFormat.lower()
00977     fileSpec = fileSpec + " )"
00978     fileName = QFileDialog.getSaveFileName(QString.null, fileSpec,
00979                          self, "file save as bitmap",
00980                          "Plot -- File Save As Bitmap")
00981     fileName = str(fileName)
00982     if fileName != '':
00983       sep = fileName.rfind('.')
00984       if not sep:
00985         QMessageBox.critical(self, "Environmental Quantity Monitor",
00986                               "Can not determine the output image format without an extension")
00987       else:
00988         imgFormat = fileName[sep+1:].upper()
00989         if imgFormat not in imgFormatList:
00990           QMessageBox.critical(self, "Environmental Quantity Monitor",
00991                               "Unsupported image format:%s" % fileName[fileName.rfind('.')+1:].upper())
00992         else:
00993           if imgFormat == 'JPG': imgFormat = 'JPEG'
00994           plotPixmap = QPixmap.grabWidget(self)
00995           plotPixmap.save(fileName, imgFormat)
00996
00997
00998   def setRange(self):
00999     minMax = self.__setRangeDlg.getMinMax()
01000     if minMax is not None:
01001       self.__plot.setRange('y', float(minMax[0]), float(minMax[1]))
01002
01003 class ScrollablePlotView(QScrollView):
01004   def __init__(self, dbn, parent = None,name = None,fl = 0):
01005     QScrollView.__init__(self, parent, name, fl)
01006     self.__parent = parent
01007     self.__dbn = dbn
01008     self._plots = []
01009     self.setVScrollBarMode(QScrollView.AlwaysOn)
01010     self.box = QVBox(self.viewport())
01011     self.addChild(self.box)
01012     self.__nTupleList = {}
01013     self.__plotList = {}
01014     self.viewport().setFocusProxy( self );
01015     self.viewport().setFocusPolicy( QWidget.WheelFocus );
01016
01017   def addPlot(self, name, title, sizeX, sizeY, labels):
01018     plot = PlotWidget(self.__parent, self.box, title, sizeX, sizeY, labels)
01019     self.__nTupleList[name] = plot.getNTuple()
01020     self.__plotList[name] = plot
01021     return plot
01022
01023   def initEventPlot(self): # revisit
01024     dc = DisplayController.instance()
01025     self.eventPlotter = dc.createDisplay('Histogram', self.__dbn['_EventSizeNTuple'], ['Event Size'])
01026     self.eventWidget = QtViewWidget(self.box, '', Qt.WStaticContents | Qt.WRepaintNoErase)
01027     self.eventWidget.setDoubleBuffering(1)
01028     self.eventWidget.setPlotter (self.eventPlotter)
01029     self.eventWidget.resize(250, 300)
01030     self.eventWidget.hide()
01031
01032   def addEventPlot(self, name):
01033     self.__plotList[name] = self.eventWidget
01034     self.eventWidget.show()
01035     return self.eventWidget
01036
01037
01038   def removePlot(self, name):
01039     if name == "event_size":
01040       self.eventWidget.hide()
01041       self.__plotList.__delitem__(name)
01042     else:
01043       self.box.removeChild(self.getPlot(name))
01044       self.__nTupleList.__delitem__(name)
01045       self.__plotList.__delitem__(name)
01046
01047   def getPlot(self, name):
01048     return self.__plotList[name]
01049
01050   def getNTupleList(self):
01051     return self.__nTupleList
01052
01053   def getPlotList(self):
01054     return self.__plotList
01055
01056
01057
01058 if __name__ == "__main__":
01059   from LATTE.runcontrol.RunControlCommon import RunControlCommon
01060
01061   rcCommon = RunControlCommon()
01062   rcCommon.initialize()
01063   rcCommon.setLoggingLevel("INFO")
01064   rcCommon.connect()
01065
01066   a = QApplication(sys.argv)
01067   em = EnvMonImpl(rcCommon)
01068   QObject.connect(a,SIGNAL("lastWindowClosed()"), a, SLOT("quit()"))
01069   a.setMainWidget(em)
01070   em.show()
01071   a.exec_loop()
01072
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: errors.py Source File

dispatch

errors.py

00001 """Error types for dispatcher mechanism
00002 """
00003 __version__  = "$Revision: 2.1 $"
00004
00005 class DispatcherError(Exception):
00006     """Base class for all Dispatcher errors"""
00007 class DispatcherKeyError(KeyError, DispatcherError):
00008     """Error raised when unknown (sender,signal) set specified"""
00009 class DispatcherTypeError(TypeError, DispatcherError):
00010     """Error raised when inappropriate signal-type specified (None)"""
00011
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: evtDataImpl.py Source File

runcontrol

evtDataImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Event Data displayer module"
00013 __author__   = "A. Kavelaars <aliciak@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/08/24 23:15:11 $").split(' ')[1]
00015 __version__  = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import sys
00022 from qt import *
00023 from evtData import evtData
00024 import Numeric
00025
00026 class evtDataImpl(evtData):
00027
00028   def __init__(self,parent = None,name = None,fl = 0):
00029     evtData.__init__(self,parent,name,fl)
00030   # public slot
00031
00032   def load(self):
00033     f = file( str(self.__filename), 'rb' )
00034
00035     #~ if not f.open( IO_ReadOnly ):
00036         #~ return
00037
00038     dataString = []
00039     #~ while 1:
00040     data = f.read()
00041     dataArray = Numeric.fromstring(data,'b')
00042
00043     #~ self.evtDataList.setPointSize(16)
00044     #~ self.evtDataList.setFamily('Courier')
00045
00046     v = ""
00047     for i in xrange(len(dataArray)):
00048       v += "%02x " % dataArray[i]
00049
00050     self.evtDataList.setText(v)
00051
00052     #~ font = self.evtDataList.font()
00053
00054     f.close()
00055
00056   def fileNew(self):
00057     print "evtDataImpl.fileNew(): Not implemented yet"
00058   # public slot
00059
00060   def fileOpen(self):
00061     fn = QFileDialog.getOpenFileName( QString.null, "(*.*)", self, "Event Data file dialog",
00062                                             "Choose an Event Data File" )
00063     if not fn.isEmpty():
00064       self.__filename = fn
00065       self.load( )
00066
00067   def fileSave(self):
00068     print "evtDataImpl.fileSave(): Not implemented yet"
00069   # public slot
00070
00071   def fileSaveAs(self):
00072     print "evtDataImpl.fileSaveAs(): Not implemented yet"
00073   # public slot
00074
00075   def filePrint(self):
00076     Margin = 50
00077     pageNo = 1
00078     column = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150] # Magic numbers
00079
00080     # If there are no items, don't try to print
00081     if not self.Logger.firstChild():
00082       return
00083
00084     if self.printer.setup(self):
00085       self.statusBar().message('Printing...')
00086
00087       p = QPainter()
00088       p.begin(self.printer)
00089       p.setFont(self.Logger.font())
00090       yPos = 0
00091       fm = p.fontMetrics()
00092       metrics = QPaintDeviceMetrics(self.printer)
00093
00094       header = "Evend Data Source: " + str(self.__filename)
00095
00096       page = "Page: 1"
00097       p.drawText(Margin,Margin + yPos,metrics.width(),fm.lineSpacing(),Qt.ExpandTabs | Qt.DontClip, header)
00098       yPos = yPos + fm.lineSpacing()
00099       p.drawText(Margin,Margin + yPos,metrics.width(),fm.lineSpacing(),Qt.ExpandTabs | Qt.DontClip, page)
00100       yPos = yPos + 2*fm.lineSpacing()
00101
00102       #~ columnHeader = ['','Severity','Date','Time','Source','Message']
00103
00104       for i in len(self.__data):
00105         p.drawText(column[i],Margin + yPos,metrics.width(),fm.lineSpacing(),
00106                     Qt.ExpandTabs | Qt.DontClip, columnHeader[i])
00107       yPos = yPos + fm.lineSpacing()
00108
00109       item = self.Logger.firstChild()
00110       for j in range(self.Logger.childCount()):
00111         if Margin + yPos > metrics.height() - Margin:
00112           pageNo = pageNo + 1
00113           page = "Page: " + str(pageNo)
00114           self.statusBar().message('Printing (page %d)...' % (pageNo))
00115           self.printer.newPage()
00116           yPos = 0
00117           p.drawText(Margin,Margin + yPos,metrics.width(),fm.lineSpacing(),Qt.ExpandTabs | Qt.DontClip, header)
00118           yPos = yPos + fm.lineSpacing()
00119           p.drawText(Margin,Margin + yPos,metrics.width(),fm.lineSpacing(),Qt.ExpandTabs | Qt.DontClip, page)
00120           yPos = yPos + 2*fm.lineSpacing()
00121
00122           for i in range (0,6):
00123             p.drawText(column[i],Margin + yPos,metrics.width(),fm.lineSpacing(),
00124                       Qt.ExpandTabs | Qt.DontClip, columnHeader[i])
00125           yPos = yPos + fm.lineSpacing()
00126
00127         for i in range (0,6):
00128           p.drawText(column[i],Margin + yPos,metrics.width(),fm.lineSpacing(),
00129                     Qt.ExpandTabs | Qt.DontClip,item.text(i))
00130         yPos = yPos + fm.lineSpacing()
00131         item = item.nextSibling()
00132
00133       p.end()
00134       self.statusBar().message('Printing completed',2000)
00135     else:
00136       self.statusBar().message('Printing aborted',2000)
00137
00138
00139   def fileExit(self):
00140     print "evtDataImpl.fileExit(): Not implemented yet"
00141   # public slot
00142
00143   def helpIndex(self):
00144     print "evtDataImpl.helpIndex(): Not implemented yet"
00145   # public slot
00146
00147   def helpContents(self):
00148     print "evtDataImpl.helpContents(): Not implemented yet"
00149   # public slot
00150
00151   def helpAbout(self):
00152     print "evtDataImpl.helpAbout(): Not implemented yet"
00153
00154
00155
00156 if __name__ == "__main__":
00157   a = QApplication(sys.argv)
00158   QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00159   w = evtDataImpl()
00160   a.setMainWidget(w)
00161   w.show()
00162   a.exec_loop()
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: excApp.py Source File

excApp.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Application for testing handling of exceptions"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "August 20, 2004"        # Created
00014 __version__  = "$Revision: 1.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 from qt import qApp
00021
00022 import            threading
00023 import logging as log
00024
00025 from   LATTE.runcontrol.rcTransitions  import rcTransitions
00026 from   LATTE.runcontrol.ArgumentImpl   import ArgumentImpl
00027
00028 from support.SimpleGasuExample   import *
00029 from support.MiniGLTExample      import *
00030
00031
00032 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00033 #  the userApplication example to get the number of self triggers to take.
00034 class userArgument(ArgumentImpl):
00035   "GUI for getting the user to input some sort of value."
00036   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00037     ArgumentImpl.__init__(self, parent, name, modal, fl)
00038     self.__value = 0
00039
00040   def OKButtonClicked(self):
00041     self.__value = int(self.ArgumentList.text().latin1())
00042     self.close()
00043
00044   def CancelButtonClicked(self):
00045     self.__value = None
00046     self.close()
00047
00048   def getValue(self, caption):
00049     #self.setCaption(caption)
00050     self.ArgLabel.setText(qApp.translate("Argument", caption, None))
00051     self.show()
00052     self.exec_loop()
00053     return self.__value
00054
00055   def getValueExc(self, caption):
00056     raise Exception, "Exception taken during a GUI operation"
00057
00058 class userArgText(object):
00059   "Text user interface for getting the user to input some sort of value"
00060   def __init__(self):
00061     pass
00062
00063   def getValue(self, caption):
00064     return int(raw_input("%s: " % (caption)))
00065
00066
00067 #  Null application implementation.
00068 class userApplication(rcTransitions):
00069   "Implmentation class for Null application"
00070   def __init__(self, rc, userId, debug):
00071     rcTransitions.__init__(self, rc, userId, debug)
00072     self.__eventSem    = threading.Semaphore(0)
00073     self.__cmdSynchSem = threading.Semaphore(0)
00074
00075   def getName(self):
00076     return __name__
00077
00078   def setup(self):
00079     log.debug("userApplication.setup()")
00080
00081     if self.rc is None:
00082       self.__arg = userArgText()
00083     else:
00084       self.__arg = self.rc.createGUI(userArgument, self.rc, self.getName(), 1)
00085
00086     caption = "Select when to take an exception:\n  0 = GUI\n  1 = Setup\n  2 = StartRun\n  3 = StopRun\n  4 = Stop\n  5 = Teardown\n  6 = Pause\n  7 = Resume\n  8 = CmdSynch\n  9 = Process"
00087     if self.rc is None:
00088       self.__state = self.__arg.getValue(caption)
00089     else:
00090       self.__state = self.rc.execGUImethod(self.__arg.getValue, caption)
00091
00092     if self.__state == 0:
00093       crud = self.rc.execGUImethod(self.__arg.getValueExc, "Exception test")
00094       return False                      # To reject the transition
00095
00096     if self.__state == 1:
00097       raise Exception, "Exception taken during SETUP transition"
00098
00099     # Two choices for the trigger, GEM and MiniGLT
00100     if self.lat.existsGEM():
00101       self.trigger( SimpleGasuExample() )
00102     else:
00103       self.trigger( MiniGLTExample() )
00104
00105     # A state transition can be rejected by not returning None
00106     return None
00107
00108   def startRun(self):
00109     log.debug("userApplication.startRun()")
00110
00111     if self.__state == 2:
00112       raise Exception, "Exception taken during STARTRUN transition"
00113
00114     self.__cmdSynchQuit = False
00115
00116     # A state transition can be rejected by not returning None
00117     return None
00118
00119   def stopRun(self):
00120     log.debug("userApplication.stopRun()")
00121
00122     self.__cmdSynchQuit = True
00123     self.__eventSem.release()
00124
00125     # Set the test completion status value
00126     self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00127
00128     if self.__state == 3:
00129       raise Exception, "Exception taken during STOPRUN transition"
00130
00131     # The STOP_RUN transition can not be rejected
00132
00133   def stop(self):
00134     log.debug("userApplication.stop()")
00135
00136     if self.__state == 4:
00137       raise Exception, "Exception taken during STOP transition"
00138
00139     return self.stopRun()
00140
00141   def teardown(self):
00142     log.debug("userApplication.teardown()")
00143
00144     if self.__state == 5:
00145       raise Exception, "Exception taken during TEARDOWN transition"
00146
00147   def pause(self):
00148     log.debug("userApplication.pause()")
00149
00150     if self.__state == 6:
00151       raise Exception, "Exception taken during PAUSE transition"
00152
00153   def resume(self):
00154     log.debug("userApplication.resume()")
00155
00156     if self.__state == 7:
00157       raise Exception, "Exception taken during RESUME transition"
00158
00159     # Issue self trigger to make up for the one that was lost during PAUSE
00160     self.trigger().solicit()
00161
00162   def process(self, (status, buffer)):
00163     "Method called back for each data event taken"
00164
00165     if self.__state == 8:  log.debug("userApplication.process()")
00166
00167     if self.__state == 9:
00168       raise Exception, "Exception taken during process()"
00169
00170     # Get next event triggered
00171     self.__eventSem.release()
00172
00173   def commandSynch(self):
00174     log.debug("userApplication.commandSynch()")
00175
00176     trigger  = self.trigger()
00177     eventSem = self.__eventSem
00178
00179     # Drain the semaphore release count
00180     # Handles the case when the stop run release collided with a trigger release
00181     while eventSem.acquire(0):  pass
00182
00183     # Wait for START_RUN to enable triggers
00184     trigger.waitForMaskEnable()
00185
00186     cnt = 0
00187     while not self.__cmdSynchQuit:
00188       if cnt == 5 and self.__state == 8:
00189         raise Exception, "Exception taken during commandSynch()"
00190       trigger.solicit()                 # Issue an internal trigger
00191       eventSem.acquire()                # Wait for the event to be processed
00192       cnt += 1
00193
00194     # Indicate we're done
00195     self.sync()
00196
00197   def wait(self):
00198     self.__cmdSynchSem.acquire()
00199
00200   def sync(self):
00201     if __name__ == "__main__" or self.isRunFromSuite():
00202       self.__cmdSynchSem.release()
00203
00204
00205 # Standalone mode:
00206 if __name__ == "__main__":
00207   import os
00208   import logging as log
00209   log.basicConfig()
00210   log.getLogger("").setLevel(log.DEBUG)
00211   ua = userApplication(None, 321, 0)
00212   prefs = {'datasave': 1, 'datadir':os.path.join(os.environ['ONLINE_ROOT'],'temp')}
00213   ua.setPrefs(prefs)
00214   ua.rcSetup(os.path.join(os.environ['ONLINE_ROOT'], 'repos/simpleTemSchema.xml'))
00215   ua.rcStartRun()
00216   ua.wait()
00217   ua.rcStopRun()
00218   ua.rcTeardown()
00219
00220 # History:
00221 #     $Log: excApp.py,v $
00222 #     Revision 1.1  2004/08/23 21:04:24  claus
00223 #     Test exception handling.
00224 #
00225 #
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: FEpowerUp.py Source File

runcontrol

FEpowerUp.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Front End power up / power down routines"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/02/11 03:58:33 $").split(' ')[1]
00014 __version__  = "$Revision: 2.16 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 from time import sleep
00020 import           sys
00021 import           logging as log
00022
00023 from LATTE.client.gException import LATInterfaceException
00024
00025 class FEpowerUp(object):
00026   def __init__(self, acdPowerUp=None, temPowerUp=None):
00027     self.acdPowerUp = acdPowerUp
00028     self.temPowerUp = temPowerUp
00029     self.__nominal  = 0x800
00030
00031   def initialize(self, lat, xbrd):
00032     self.lat        = lat
00033     self.xbrd       = xbrd
00034
00035   def setAcdPowerUp(self, acdPowerUp):
00036     self.acdPowerUp = acdPowerUp
00037
00038   def setTemPowerUp(self, temPowerUp):
00039     self.temPowerUp = temPowerUp
00040
00041   def up(self):
00042     # Power up TEM(s)
00043     activeTEMs = self.getActiveTEMs(self.lat)
00044     #for (temId, tem) in activeTEMs.items():
00045     #  if self.temPowerUp is None or temId in self.temPowerUp:
00046     #    # turn off front ends
00047     #    tic = tem.TIC
00048     #    if self.temPowerUp is None:
00049     #      tic.POWER_SUPPLY = 0x0
00050     #    else:
00051     #      powerSupply = tic.POWER_SUPPLY
00052     #      if powerSupply & self.temPowerUp[temId] != 0:
00053     #        powerSupply &= ~self.temPowerUp[temId]
00054     #        tic.POWER_SUPPLY = powerSupply
00055
00056     xbrd = self.xbrd
00057     if xbrd is not None:
00058       # set all margin DACs to "middle" values
00059       # ggDACload() take the following values:
00060       #   0x000 - maximum voltage
00061       #   0x800 - nominal
00062       #   0xFFF - minimum voltage
00063
00064       # Adjust TKR Analog 2.5v
00065       margin = 0x800
00066       if margin != self.__nominal:
00067         log.warn("dac_tkr_analog_2_5 is being set to 0x%03x" % margin)
00068       xbrd.dac_tkr_analog_2_5 = margin
00069
00070       # Adjust TKR Digital 2.5v
00071       margin = 0x800
00072       if margin != self.__nominal:
00073         log.warn("dac_tkr_digital_2_5 is being set to 0x%03x" % margin)
00074       xbrd.dac_tkr_digital_2_5 = margin
00075
00076       # Adjust TKR Analog 1.5v _and_ CAL Analog 3.3v
00077       margin = 0x800
00078       if margin != self.__nominal:
00079         log.warn("dac_tkr_cal_analog is being set to 0x%03x" % margin)
00080       xbrd.dac_tkr_cal_analog = margin
00081
00082       # Adjust CAL Digital 3.3v
00083       margin = 0x800
00084       if margin != self.__nominal:
00085         log.warn("dac_cal_digital_3_3 is being set to 0x%03x" % margin)
00086       xbrd.dac_cal_digital_3_3 = margin
00087
00088       # Adjust TEM Digital 3.3v
00089       margin = 0x800
00090       if margin != self.__nominal:
00091         log.warn("dac_tem_voltage is being set to 0x%03x" % margin)
00092       xbrd.dac_tem_voltage = margin
00093
00094       ##
00095       ##  HIGH VOLTAGES for TKR and CAL
00096       ##  Disable by default
00097       ##
00098       ##  Note:  These take different values then ggDACload()
00099       ##
00100       ##    0x4000 - 0 V
00101       ##    0x5000 - plus half scale
00102       ##    0x5FFE - plus full scale
00103       ##
00104
00105       # Adjust TKR High Voltage
00106       #tic.tkr_biasdac = 0x4000
00107
00108       # Adjust CAL High Voltage
00109       #tic.cal_biasdac = 0x5000
00110
00111     for (temId, tem) in activeTEMs.items():
00112       # turn on TKR and/or CAL front ends
00113       if self.temPowerUp is None or temId in self.temPowerUp:
00114         tic = tem.TIC
00115         if self.temPowerUp is None:
00116           tic.POWER_SUPPLY = 0x3
00117         else:
00118           powerSupply = tic.POWER_SUPPLY
00119           if powerSupply | self.temPowerUp[temId] != powerSupply:
00120             tkrPowerUp = 0
00121             if self.temPowerUp[temId] & 1 == 1 and powerSupply & 1 == 0:
00122               # TKR power up requested
00123               tkrPowerUp = 1
00124               if tem.allTCC() is None:
00125                 msg = "Broadcast TCC needs to be defined in the schema for TKR power up"
00126                 log.error(msg)
00127                 raise RuntimeError, msg
00128             tic.POWER_SUPPLY = powerSupply | self.temPowerUp[temId]
00129             # We don't want to reset the TEM since it causes events
00130             # to be triggered
00131             #tem.CMD_RESET = 1
00132             if tkrPowerUp:
00133               sleep(1.0)
00134               tem.allTCC().CMD_RESET = 1
00135
00136     # Power up AEM
00137     aem = self.lat.AEM
00138     if not self.isAEMactive(aem):
00139       aem = None
00140     else:
00141       for (arcId, arc) in aem.ARC.items():
00142         if self.acdPowerUp is None or arcId in self.acdPowerUp:
00143           aem.power_down = arcId
00144           aem.power_up = arcId
00145           sleep(1.5)  # Gotta wait 1.5 seconds before *any* read can work.
00146           arc.look_at_me = 0xeb90
00147     return self.checkPower(aem, activeTEMs)
00148
00149   def down(self):
00150     # Power down TEM
00151     activeTEMs = self.getActiveTEMs(self.lat)
00152     for (temId, tem) in activeTEMs.items():
00153       if self.temPowerUp is None or temId in self.temPowerUp:
00154         # turn off CAL and/or TKR front ends
00155         tic = tem.TIC
00156         if self.temPowerUp is None:
00157           tic.POWER_SUPPLY = 0x0
00158         else:
00159           powerSupply = tic.POWER_SUPPLY
00160           if powerSupply & ~self.temPowerUp[temId] != powerSupply:
00161             tic.POWER_SUPPLY = powerSupply & ~self.temPowerUp[temId]
00162
00163     xbrd = self.xbrd
00164
00165     if xbrd is not None:
00166       # set all margin DACs to "middle" values (as per Leonid's request)
00167
00168       # Adjust TKR Analog 2.5v
00169       xbrd.dac_tkr_analog_2_5 = self.__nominal
00170
00171       # Adjust TKR Digital 2.5v
00172       xbrd.dac_tkr_digital_2_5 = self.__nominal
00173
00174       # Adjust TKR Analog 1.5v _and_ CAL Analog 3.3v
00175       xbrd.dac_tkr_cal_analog = self.__nominal
00176
00177       # Adjust CAL Digital 3.3v
00178       xbrd.dac_cal_digital_3_3 = self.__nominal
00179
00180       # Adjust TEM Digital 3.3v
00181       xbrd.dac_tem_voltage = self.__nominal
00182
00183     # Power down AEM
00184     aem = self.lat.AEM
00185     if not self.isAEMactive(aem):
00186       aem = None
00187     else:
00188       for arcId in aem.ARC:
00189         if self.acdPowerUp is None or arcId in self.acdPowerUp:
00190           try:
00191             arc = aem.ARC[arcId]
00192             for mode in (0xF8F, 0xFF1): # Enable HVBS 1 and then HVBS 2
00193               arc.mode &= mode
00194               hvbs = arc.hvbs
00195               while hvbs > 0:
00196                 hvbs -= 200 # Ramp-down in 200 DAC step decrements
00197                 if hvbs >= 0:
00198                   arc.hvbs = hvbs
00199                 else:
00200                   arc.hvbs = 0
00201                 arc.cmd_set_hvbs = 1
00202                 sleep(1)
00203           except LATInterfaceException:
00204             if sys.exc_info()[1].errstr()[0] in ('LCB_RTOERR', 'LCBD_RTOERR') \
00205                 and self.lat.getDeclarations()['options']['ignorehardwaretimeouts']:
00206               pass
00207             else:
00208               raise LATInterfaceException(sys.exc_info()[1].status)
00209           aem.power_down = arcId
00210     return self.checkPower(aem, activeTEMs)
00211
00212   def getActiveTEMs(self, lat):
00213     activeTEMs = {}
00214     if lat.TEMcnt() > 0:
00215       for (temId, tem) in lat.TEM.items():
00216         try:
00217           tem.configuration # Check to see if this TEM really exists
00218           activeTEMs[temId] = tem
00219         except LATInterfaceException:
00220           if sys.exc_info()[1].errstr()[0] in ('LCB_RTOERR', 'LCBD_RTOERR') \
00221               and lat.getDeclarations()['options']['ignorehardwaretimeouts']:
00222             continue
00223           else:
00224             raise LATInterfaceException(sys.exc_info()[1].status)
00225     return activeTEMs
00226
00227   def isAEMactive(self, aem):
00228     if aem is None:
00229       return False
00230     else:
00231       try:
00232         aem.configuration # Check to see if the AEM really exists
00233       except LATInterfaceException:
00234         if sys.exc_info()[1].errstr()[0] in ('LCB_RTOERR', 'LCBD_RTOERR') \
00235             and aem.up().getDeclarations()['options']['ignorehardwaretimeouts']:
00236           return False
00237         else:
00238           raise LATInterfaceException(sys.exc_info()[1].status)
00239     return True
00240
00241   def refreshPowerStatus(self):
00242     activeTEMs = self.getActiveTEMs(self.lat)
00243     aem = self.lat.AEM
00244     if not self.isAEMactive(aem):
00245       aem = None
00246     return self.checkPower(aem, activeTEMs)
00247
00248   def checkPower(self, aem, activeTEMs):
00249     aemPowerCheck = []
00250     calPowerCheck = []
00251     tkrPowerCheck = []
00252
00253     # Prepare feedback as to which CAL & TKR front ends were really turned on
00254     for (temId, tem) in activeTEMs.items():
00255       tic = tem.TIC
00256       powerSupply = tic.POWER_SUPPLY
00257       if powerSupply & 1:
00258         tkrPowerCheck.append(temId)
00259       if powerSupply & 2:
00260         calPowerCheck.append(temId)
00261
00262     if aem is not None:
00263       # Prepare feedback as to which free-boards were really turned on
00264       powerStatus = aem.power_status
00265       for i in range(12):
00266         if powerStatus & (1 << i):
00267           aemPowerCheck.append(i)
00268     return (aemPowerCheck, calPowerCheck, tkrPowerCheck)
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: fileMerge.py Source File

fileMerge.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2006
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Program to merge data from ancillary and LDF data files"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "3/30/2006"
00014 __updated__  = ("$Date: 2006/07/14 22:33:25 $").split(' ')[1]
00015 __version__  = "$Revision: 1.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import logging          as     log
00022 import sys
00023 import time
00024
00025 from   LATTE.merger.geb import Geb
00026
00027 from   ancillaryFile    import AncillaryContributor
00028 from   ldfFile          import LdfContributor
00029
00030
00031 class Merger(Geb):
00032   def __init__(self, contributors, filename):
00033     Geb.__init__(self, contributors)
00034     self.__file = file(filename, 'wb')
00035
00036   def dispose(self, (statuses, event)):
00037     """!\brief Method called by the base class to dispose of an event.
00038     """
00039     self.__file.write(event)
00040
00041   def close(self):
00042     """!\brief Method called by the base class to close the output file.
00043     """
00044     self.__file.close()
00045
00046
00047 def main(options):
00048   ancillaryContributor = AncillaryContributor(options.ancillaryFile)
00049   ldfContributor       = LdfContributor(options.ldfFile)
00050   merger = Merger([ancillaryContributor, ldfContributor], options.outFile)
00051   #merger = Merger([ancillaryContributor], options.outFile)
00052
00053   try:
00054     merger.start()
00055
00056     # Wait until an error occurs or the user kills us
00057     while(True):  time.sleep(24*3600)
00058
00059   except KeyboardInterrupt:
00060     pass
00061   except Exception, e:
00062     log.exception(sys.argv[0] + ":\n" + str(e))
00063
00064   # Shutdown the builder
00065   merger.shutdown()
00066
00067
00068 def usage():
00069   """!\brief Return a program usage message
00070   """
00071   return "\n\n%s merges, or builds, events from files\n" % (sys.argv[0])
00072
00073
00074 if __name__ == "__main__":
00075   # Options, first list mandatory, second list optional
00076   from LATTE.tools.gOptions import Options
00077
00078   options = Options(["ancillaryFile", "ldfFile", "outFile"])
00079   try:
00080    options.parse()
00081   except Exception, msg:
00082    options.usage(usage())
00083    raise Exception, msg
00084
00085   main(options)
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: fits2ldf.py Source File

runcontrol

fits2ldf.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "FITS to Archive converter"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2004/08/24 23:15:11 $").split(' ')[1]
00014 __version__  = "$Revision: 2.1 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import sys
00020 import getopt
00021
00022 def __usage():
00023   print "\n%s Usage:" % (sys.argv[0])
00024   print "\t-h or --help for Help"
00025   print "\t-f or --fits to specify the input FITS file"
00026   print "\t-a or --archive to specify to output archive file"
00027   print "\t-r or --runreport to specify an output run report filename (eg. rcReport.out)"
00028   print "\t-v or --verbose to specify progress messages during the conversion"
00029
00030
00031 if __name__ == '__main__':
00032   archiveFile=''
00033   fitsFile=''
00034   verbose=0
00035   try:
00036     opts, args = getopt.getopt(sys.argv[1:], "ha:f:vr:",
00037                                ["help", "archive=", "fits=", "verbose", "runreport="])
00038   except getopt.GetoptError:
00039     # print help information and exit:
00040     __usage()
00041     sys.exit(2)
00042   for o, a in opts:
00043     if o in ("-h", "--help"):
00044       __usage()
00045       sys.exit()
00046     if o in ("-a", "--archive"):
00047       archiveFile = a
00048     if o in ("-f", "--fits"):
00049       fitsFile = a
00050     if o in ("-v", "--verbose"):
00051       verbose = 1
00052     if o in ("-r", "--runreport"):
00053       runReportFile = a
00054
00055   if archiveFile == '':
00056     print "\nERROR: Missing archive file parameter"
00057     __usage()
00058     sys.exit(2)
00059
00060   if fitsFile == '':
00061     print "\nERROR: Missing FITS file parameter"
00062     __usage()
00063     sys.exit(2)
00064
00065   import rcArchiver
00066   arch = rcArchiver.rcArchiver(fileName=archiveFile, mode=rcArchiver.MODE_CREATE)
00067
00068   import rcReportGen
00069   reportGen = rcReportGen.rcReportGen(fileName=runReportFile)
00070   reportGen.initialize()
00071
00072   import rcFitsWriter
00073   fits = rcFitsWriter.rcFitsWriter(fileName=fitsFile, mode=rcFitsWriter.MODE_READONLY,
00074                                    format=rcFitsWriter.FORMAT_BYTE, reportGen=reportGen)
00075
00076   cnt=0
00077   while(1):
00078     dat = fits.read()
00079     if dat == None: break
00080     cnt+=1
00081     if verbose and (cnt % 100) == 0: print "Progress line:", cnt
00082     arch.write(dat)
00083   if verbose and (cnt % 100) != 0: print "Progress line:", cnt
00084
00085   arch.close()
00086   fits.close()
00087
00088   reportGen.writeReportXML()
00089
00090   if verbose: print "Conversion completed successfully!"
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: FreeSpace.py Source File

tools

FreeSpace.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT free disk space utility functions"
00012 __author__   = "Jim Panetta <panetta@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "10/20/2003"
00014 __version__  = "$Revision: 2.1 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019
00020 import os
00021
00022 def FreeSpace(filePath=None):
00023   """ freespace(path) -> long
00024   Return the number of bytes available to the user on the file system
00025   pointed to by path."""
00026   try:
00027     os.statvfs          # doesn't fail if we're on unix
00028   except AttributeError:
00029     # Win32 implementation
00030     try:
00031       if filePath is None: filePath = 'C:/'  # Root level directory
00032       import win32file
00033       return win32file.GetDiskFreeSpaceEx(filePath)[0]
00034     except Exception, e:
00035       print 'FreeSpace() exception: ', e, ' path ', filePath
00036       return long(-1)
00037   else:
00038     # Unix implementation
00039     try:
00040       if filePath is None: filePath = '.'    # Current working directory
00041       import statvfs
00042       s = os.statvfs(filePath)
00043       return s[statvfs.F_BAVAIL] * long(s[statvfs.F_BSIZE])
00044     except Exception, e:
00045       print 'FreeSpace() exception: ', e
00046       return long(-1)
00047
00048   # should never get here
00049   return long(-1)
00050
00051
00052
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: FSM.py Source File

runcontrol

FSM.py

00001 #!/usr/local/bin python
00002 # This was found at http://www.noah.org/python/FSM/ on November 12, 2002.
00003 # RiC slightly modified it 11/13/02.
00004 # __author__ below means responsible party, not author in the usual sense.
00005
00006 __facility__ = "Online"
00007 __abstract__ = "Finite State Machine class"
00008 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00009 __date__     = "11/12/2002"
00010 __version__  = "$Revision: 2.0 $"
00011 __credits__  = "SLAC"
00012
00013
00014
00015 '''This module implements a Finite State Machine (FSM).
00016 In addition to state this FSM also maintains a user defined "something".
00017 This "something" is effectively memory, so this FSM could be considered
00018 a Push-down Automata (PDA) since a PDA is a FSM + memory.
00019
00020 The following describes how the FSM works, but you will probably also need
00021 to see the example function to understand how the FSM is used in practice.
00022
00023 You define an FSM by building tables of transitions.
00024 For a given input symbol the process() method uses these tables
00025 to decide what action to call and what the next state will be.
00026 The FSM has a table of transitions that associate:
00027         (input_symbol, current_state) --> (action, next_state)
00028 where "action" is a function you define. The symbols and states
00029 can be any objects. You use the add_transition() and add_transition_list()
00030 methods to add to the transition table. The FSM also has a table
00031 of transitions that associate:
00032         (current_state) --> (action, next_state)
00033 You use the add_transition_any() method to add to this transition table.
00034 The FSM also has one default transition that is not associated
00035 with any specific input_symbol or state. You use the
00036 set_default_transition() method to set the default transition.
00037
00038 When an action function is called it is passed a reference to the FSM.
00039 The action function may then access attributes of the FSM such as
00040 input_symbol, current_state, or "something". The "something" attribute
00041 can be any object that you want to pass along to the action functions.
00042 It is not used by the FSM. For parsing you would typically pass a list
00043 to be used as a stack.
00044
00045 The processing sequence is as follows.
00046 The process() method is given an input_symbol to process.
00047 The FSM will search the table of transitions that associate:
00048         (input_symbol, current_state) --> (action, next_state)
00049 If the pair (input_symbol, current_state) is found then
00050 process() will call the associated action function and then set the
00051 current state to the next_state.
00052
00053 If the FSM cannot find a match for (input_symbol, current_state)
00054 it will then search the table of transitions that associate:
00055         (current_state) --> (action, next_state)
00056 If the current_state is found then the process() method will call
00057 the associated action function and then set the current state to
00058 the next_state. Notice that this table lacks an input_symbol.
00059 It lets you define transitions for a current_state and ANY input_symbol.
00060 Hence, it is called the "any" table. Remember, it is always checked
00061 after first searching the table for a specific (input_symbol, current_state).
00062
00063 For the case where the FSM did not match either of the previous two cases
00064 the FSM will try to use the default transition. If the default transition
00065 is defined then the process() method will call the associated action function
00066 and then set the current state to the next_state. This lets you define
00067 a default transition as a catch-all case. You can think of it as an
00068 exception handler. There can be only one default transition.
00069
00070 Finally, if none of the previous cases are defined for an input_symbol
00071 and current_state then the FSM will raise an exception.
00072 This may be desirable, but you can always prevent this just by
00073 defining a default transition.
00074
00075 Noah Spurrier 20020822
00076 '''
00077
00078 import exceptions
00079
00080
00081 class ExceptionFSM(exceptions.Exception):
00082     '''This is the FSM Exception class.'''
00083     def __init__(self, value):
00084         self.value = value
00085     def __str__(self):
00086         return `self.value`
00087
00088 class FSM(object):
00089     '''This is a Finite State Machine (FSM).
00090     '''
00091
00092     def __init__(self, initial_state, something):
00093         '''This creates the FSM.
00094         You set the initial state here. The "something" attribute is any
00095         object that you want to pass along to the action functions.
00096         It is not used by the FSM. For parsing you would typically pass
00097         a list to be used as a stack.
00098         '''
00099         # Map (input_symbol, current_state) --> (action, next_state).
00100         self.state_transitions = {}
00101         # Map (current_state) --> (action, next_state).
00102         self.state_transitions_any = {}
00103         self.default_transition = None
00104
00105         self.input_symbol = None
00106         self.initial_state = initial_state
00107         self.current_state = self.initial_state
00108         self.something = something
00109
00110     def reset (self):
00111         '''This sets the current_state to the initial_state and
00112         sets input_symbol to None.
00113         The initial state was set by the constructor __init__().
00114         '''
00115         self.current_state = self.initial_state
00116         self.input_symbol = None
00117
00118     def add_transition (self, input_symbol, state, action, next_state):
00119         '''This adds a transition that associates
00120                 (input_symbol, current_state) --> (action, next_state)
00121         The action may be set to None in which case the process() method
00122         will ignore the action and only set the next_state.
00123
00124         You can also set transitions for a list of symbols by using
00125         add_transition_list().
00126         '''
00127         self.state_transitions[(input_symbol, state)] = (action, next_state)
00128
00129     def add_transition_list (self, list_input_symbols, state, action, next_state):
00130         '''This adds the same transition for lots of different input symbols.
00131         You can pass a list or a string. Note that it is handy to use
00132         string.digits, string.whitespace, string.letters, etc. to add
00133         transitions that match character classes.
00134         '''
00135         for input_symbol in list_input_symbols:
00136             self.add_transition (input_symbol, state, action, next_state)
00137
00138     def add_transition_any (self, state, action, next_state):
00139         '''This adds a transition that associates
00140                 (current_state) --> (action, next_state)
00141         The process() method checks these associations if it cannot
00142         first find a match of an (input_symbol, current_state).
00143         '''
00144         self.state_transitions_any [state] = (action, next_state)
00145
00146     def set_default_transition (self, action, next_state):
00147         '''This sets the default transition.
00148         This defines an action and next_state if the FSM cannot find the
00149         input symbol and the current state in the transition list and
00150         if the FSM cannot find the current_state in the transition_any list.
00151         This is useful for catching errors and undefined states.
00152
00153         The default transition can be removed by setting the attribute
00154         default_transition to None.
00155         '''
00156         self.default_transition = (action, next_state)
00157
00158     def get_transition (self, input_symbol, state):
00159         '''This returns (action, next state) given an input_symbol and state.
00160         This leaves the FSM unchanged. This does not update the current state
00161         nor does it trigger the output action. Normally you do not call
00162         this method. It is called by process().
00163
00164         The sequence of steps to check for a defined transition goes from
00165         the most specific to the least specific.
00166         1. Check state_transitions[] that match (input_symbol, state)
00167         2. Check state_transitions_any[] that match (state)
00168            In other words, match a specific state and ANY input_symbol.
00169         3. Check if the default_transition is defined.
00170            This catches any input_symbol and any state.
00171            This is a handler for errors, undefined states, or defaults.
00172         4. No transition was defined. If we get here then raise an exception.
00173         '''
00174         if self.state_transitions.has_key((input_symbol, self.current_state)):
00175             return self.state_transitions[(input_symbol, self.current_state)]
00176         elif self.state_transitions_any.has_key (self.current_state):
00177             return self.state_transitions_any[self.current_state]
00178         elif self.default_transition != None:
00179             return self.default_transition
00180         else:
00181             raise ExceptionFSM ('Transition is undefined: (%s, %s).' %
00182                 (str(input_symbol), str(self.current_state)) )
00183
00184     def process (self, input_symbol):
00185         '''This is the main method that you call to process input.
00186         This may cause the FSM to change state and call an action.
00187         This method calls get_transition() to find the action and next_state
00188         associated with the input_symbol and current_state.
00189         If the action is None then the action is not called and
00190         only the current state is changed.
00191         This method processes one input symbol. You can process a list of
00192         symbols (or a string) by calling process_list().
00193         This method returns an uninterpreted status value used to indicate
00194         whether the state transition completed successfully.
00195         '''
00196         self.input_symbol = input_symbol
00197         (action, next_state) = self.get_transition (self.input_symbol, self.current_state)
00198         if action != None:
00199             status = action ()
00200         if status is None and next_state is not None:
00201             self.current_state = next_state
00202         return status
00203
00204     def process_list (self, s):
00205         '''This takes a list and sends each element to process().
00206         The list may be a string.
00207         '''
00208         for c in s:
00209             self.process (c)
00210
00211 ##########################################################################
00212 # The following example demonstrates the use of the FSM class in
00213 # processing RPN expressions. Run this module from the command line.
00214 # You will get a prompt > for input.
00215 # Enter an RPN Expression.
00216 # Numbers may be integers. Operators are * / + -
00217 # Use the = sign to evaluate and print the expression.
00218 # For example:
00219 #    167 3 2 2 * * * 1 - =
00220 # will print:
00221 #    2003
00222 ##########################################################################
00223
00224 import string
00225
00226 #
00227 # These define the actions.
00228 # Note that "something" is a list being used as a stack.
00229 #
00230 def BeginBuildNumber (fsm):
00231     fsm.something.append (fsm.input_symbol)
00232 def BuildNumber (fsm):
00233     s = fsm.something.pop ()
00234     s = s + fsm.input_symbol
00235     fsm.something.append (s)
00236 def EndBuildNumber (fsm):
00237     s = fsm.something.pop ()
00238     fsm.something.append (int(s))
00239 def DoOperator (fsm):
00240     ar = fsm.something.pop()
00241     al = fsm.something.pop()
00242     if fsm.input_symbol == '+':
00243         fsm.something.append (al + ar)
00244     elif fsm.input_symbol == '-':
00245         fsm.something.append (al - ar)
00246     elif fsm.input_symbol == '*':
00247         fsm.something.append (al * ar)
00248     elif fsm.input_symbol == '/':
00249         fsm.something.append (al / ar)
00250 def DoEqual (fsm):
00251     print str(fsm.something.pop())
00252 def Error (fsm):
00253     print 'That does not compute.'
00254     print str(fsm.input_symbol)
00255
00256 #
00257 # This is where the example starts and the FSM state transitions are defined.
00258 # Note that states (such as 'INIT') are strings. This is not necessary, but
00259 # it makes the example easier to read.
00260 #
00261 def example ():
00262     f = FSM ('INIT', []) # "something" will be used as a stack.
00263     f.set_default_transition (Error, 'INIT')
00264     f.add_transition_any  ('INIT', None, 'INIT')
00265     f.add_transition      ('=',               'INIT',            DoEqual,          'INIT')
00266     f.add_transition_list (string.digits,     'INIT',            BeginBuildNumber, 'BUILDING_NUMBER')
00267     f.add_transition_list (string.digits,     'BUILDING_NUMBER', BuildNumber,      'BUILDING_NUMBER')
00268     f.add_transition_list (string.whitespace, 'BUILDING_NUMBER', EndBuildNumber,   'INIT')
00269     f.add_transition_list ('+-*/',            'INIT',            DoOperator,       'INIT')
00270
00271     print
00272     print 'Enter an RPN Expression.'
00273     print 'Numbers may be integers. Operators are * / + -'
00274     print 'Use the = sign to evaluate and print the expression.'
00275     print 'For example: '
00276     print '    167 3 2 2 * * * 1 - ='
00277     inputs = raw_input ('>')
00278     for s in inputs:
00279         f.process (s)
00280
00281 if __name__ == '__main__':
00282     example ()
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- k -

  • keyPressEvent() : PythonShellWidget, CommentEntryWidget
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- l -

  • LA1() : TrgCnoEnables
  • LA2() : TrgCnoEnables
  • LA3() : TrgCnoEnables
  • LA4() : TrgCnoEnables
  • LB2() : TrgCnoEnables
  • LB4() : TrgCnoEnables
  • leafActionsTuples() : userAppLeaf
  • length() : LdfContribution, GebContribution, AncillaryContribution
  • limit() : TrgDefaultPeriodicCondition, TrgPeriodicConditionAbstract, TrgGemPeriodicCondition
  • livetime() : TrgTriggerStats, TrgGemTriggerStats
  • loadApp() : RunControlMain
  • loadAppWindows() : userAppLeaf
  • loadFIFO() : GNAT
  • loadModule() : RunControlMain
  • loadNodes() : userAppTree
  • log() : CALcontributionIterator2
  • lookup() : DataDistributorAddress
  • lookupTableRegister() : TrgGemRegisters
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- m -

  • marker() : TrgMiniGLTRegisters, TrgMiniGLTAbstract, TrgInjectMarker, TrgEngineRequest
  • maxConditions() : TrgGemAbstract, TrgAbstract
  • maxEngines() : TrgGemAbstract, TrgAbstract
  • md5sum() : DataExport
  • module() : userAppLeaf
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- n -

  • name() : TaskEngine, AncillaryContributor, LdfContributor, AncillaryContributor, LdfContributor, AncillaryContributor, Geb, GebContributor, Grule, Ggroup, Gconstraint, userAppLeaf
  • nextClicked() : singleEvtDisplayImpl
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- o -

  • open() : AncillaryContributor, LdfContributor, AncillaryContributor, LdfContributor, AncillaryContributor, GebContributor, EvtCliIO
  • OSWcomponent() : myLATcomponentIterator
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- z -

  • zeroSuppress() : TrgMiniGLTRegisters, TrgMiniGLTAbstract, TrgEngineRequest, rcTrgInjectMarker
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- a -

  • A() : TrgTileStats, TrgGemCnoStats, TrgGemTileStats, TrgCnoStats
  • abort() : TrgPeriodicCondition, TrgGemPeriodicCondition, AcdHWMultiplexer, EvtCliBT, EvtCliIO
  • ACDcomponent() : myLATcomponentIterator
  • add() : rcParamVerifier
  • add_transition() : FSM
  • add_transition_any() : FSM
  • add_transition_list() : FSM
  • addCAL_LogAccept() : Evt
  • addCAL_LogData() : Evt
  • addChannel() : GNAT
  • addCompletionStatus() : rcCompletionStatus
  • addCustomReportData() : rcTransitions
  • addErrGCCCmsg() : Evt
  • addErrGTCCmsg() : Evt
  • addExportedFile() : rcTransitions
  • addHeading() : rcTestReport
  • addHTML() : rcTestReport
  • AddLeaf() : userAppTree
  • addPair() : rcTrgCoincidence
  • addParameter() : rcParamVerifyGUIImpl
  • addPassword() : rcSecurityMan
  • addPermission() : rcUser
  • addPHA() : AEM
  • addr() : Gdb
  • addRole() : rcUser
  • addSection() : rcTestReport
  • addSectionImage() : rcTestReport
  • addSectionItem() : rcTestReport
  • addSectionTable() : rcTestReport
  • addTableData() : rcTestReport
  • addTableHeader() : rcTestReport
  • addTKRaccept() : Evt
  • addTKRstrip() : Evt
  • addTKRtot() : Evt
  • addUser() : rcUsers
  • adjustExcludeTime() : rcTransitions
  • alignment() : rcParamVerifyGUIImpl
  • allAFE() : GARC
  • allARC() : GAEM
  • allCCC() : GTEM
  • allCFE() : GCRC
  • allCRC() : GCCC
  • allParametersChecked() : rcParamVerifyGUIImpl
  • allTCC() : GTEM
  • allTEM() : GLAT
  • allTFE() : GTRC
  • allTRC() : GTCC
  • applyConfig() : rcTransitions
  • archiveClose() : Consumer
  • archiveOpen() : Consumer
  • assignA() : TrgTileCounters, TrgGemCnoCounters, TrgGemTileCounters, TrgCnoCounters
  • assignAB() : TrgTileCounters, TrgGemCnoCounters, TrgGemTileCounters, TrgCnoCounters
  • assignB() : TrgTileCounters, TrgGemCnoCounters, TrgGemTileCounters, TrgCnoCounters
  • attrIter() : Gdb
  • authenticateUser() : rcSecurityMan
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- b -

  • B() : TrgTileStats, TrgGemCnoStats, TrgGemTileStats, TrgCnoStats
  • beginTableRow() : rcTestReport
  • build() : Geb
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- c -

  • CALcomponent() : myLATcomponentIterator
  • calculateKey() : BoundMethodWeakref
  • calHigh() : TrgConditionsValue, TrgConditions
  • calLow() : TrgConditionsValue, TrgConditions
  • calorimeter() : TrgTower, NullTower
  • calStrobe() : TrgMiniGLTRegisters, TrgMiniGLTAbstract
  • cancel() : rcParamVerifyGUIImpl
  • category() : Grule, Gconstraint
  • CCCcnt() : GTEM
  • changePassword() : rcSecurityMan
  • checkException1() : TaskEngineTestCase
  • checkException2() : TaskEngineTestCase
  • checkGGLTstatus() : EvtCli
  • checkInstantiation() : TaskEngineTestCase
  • checkOnlineStatus() : EvtCli
  • checkPassword() : rcSecurityMan
  • checkPermission() : rcSecurityMan
  • checkSelfShutdown() : TaskEngineTestCase
  • checkShutdown1() : TaskEngineTestCase
  • checkShutdown2() : TaskEngineTestCase
  • checkSpawn() : TaskEngineTestCase
  • checkStartup() : TaskEngineTestCase
  • checkUnboundSpawn() : TaskEngineTestCase
  • clearAllActions() : Grule
  • clearAllRows() : rcParamVerifyGUIImpl
  • clearBuffer() : GNAT
  • clearButtonGroups() : singleEvtDisplayImpl
  • clearEvent() : Evt, AEM
  • clearViews() : singleEvtDisplayImpl
  • close() : AncillaryContributor, Merger, LdfContributor, AncillaryContributor, LdfContributor, Merger, AncillaryContributor, Geb, GebContributor, EvtCliIO
  • closeTestReport() : standardTestReport
  • cmdCounters() : TrgGemAbstract, TrgGem
  • cno() : TrgInputEnables, TrgConditionsValue, TrgConditions, NoInputsEnabled
  • cnoCounters() : TrgGemAbstract, TrgGem
  • cnoEnableRegister() : TrgGemRegisters
  • coincidence() : TrgRoiAsTiles, TrgCoincidences
  • coincidences() : TrgUsingTiles, rcGEMDefaultTrigger, SimpleGasuExample
  • collapse_family() : userAppLeaf
  • command() : TrgGemCmdStats, TrgCmdStats
  • commandSynch() : userApplication
  • commit() : rcTrgMiniGLT, rcTrgGem
  • conditions() : TrgAbstract, rcMiniGLTDefaultTrigger, rcGEMDefaultTrigger, MiniGLTExample
  • configurationRegister() : TrgGemRegisters
  • confirm() : rcParamVerifyGUIImpl
  • connect() : DataDistributorClient, DataDistributorServer, HskHandler, HskCli
  • contentsContextMenuEvent() : PythonShellWidget, CommentEntryWidget
  • contributionQueue() : GebContributor
  • copyCheckedNodes() : userAppTree, userAppLeaf
  • createEditor() : rcParamVerifyGUIImpl
  • createGUI() : GUIbridge, RunControlMain, RunControl
  • createSocket() : MyLogSocketHandler
  • createWindow() : userAppLeaf
  • customEvent() : RunControlMain, EnvMonImpl
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- d -

  • dataSize() : Consumer, trgConsumer
  • decode() : gAlertStr
  • decodeRegister() : AEQHskRegMap
  • definition() : DefaultSequence, DefaultPeriodicCondition, TrgSequence, TrgPeriodicCondition
  • deleteUser() : rcUsers, rcSecurityMan
  • destination() : TrgMiniGLTRegisters, TrgMiniGLTAbstract, TrgEngineRequest
  • diagnostic() : myLATcomponentIterator
  • disable() : TrgMiniGLT, TrgGem, TrgAbstract, rcTrgMiniGLT, rcTrgGem, Grule, Ggroup, Gconstraint
  • disableMask() : GGLT
  • discarded() : TrgTriggerStats, TrgGemTriggerStats
  • disconnect() : DataDistributorClient, DataDistributorServer, HskCli
  • disconnected() : HskHandler
  • dispose() : Merger
  • doEmit() : RunControlMain, RunControl
  • doPause() : RunControlMain, RunControl
  • doReset() : RunControlMain, RunControl
  • doRun() : RunControlMain, RunControl
  • doStop() : RunControlMain, RunControl
  • doStopRun() : RunControlMain, RunControl
  • doSuiteReset() : RunControlMain
  • doValueChanged() : rcParamVerifyGUIImpl
  • down() : FEpowerUp
  • downAEM() : GLAT
  • downAEQ() : GAEM
  • downAFE() : GARC
  • downARC() : GAEM
  • downCCC() : GTEM
  • downCFE() : GCRC
  • downCRC() : GCCC
  • downCRU() : GLAT
  • downEBM() : GLAT
  • downEBMC() : GEBM
  • downEBMST() : GEBM
  • downGEM() : GLAT
  • downGEMC() : GGEM
  • downGEMIE() : GGEM
  • downGEMMG() : GGEM
  • downGEMSC() : GGEM
  • downGEMST() : GGEM
  • downGEMVG() : GGEM
  • downGEMW() : GGEM
  • downGLT() : GXBRD
  • downHAEM() : GHSK
  • downHARC() : HAEM
  • downHCOM() : GHSK
  • downHCPU() : GHSK
  • downHEBM() : GHSK
  • downHGEM() : GHSK
  • downHNUL() : GHSK
  • downHPDU() : GHSK
  • downHTEM() : GHSK
  • downLCB() : GLAT
  • downPDU() : GLAT
  • downPEQ() : GPDU
  • downTCC() : GTEM
  • downTEM() : GLAT
  • downTFE() : GTRC
  • downTIC() : GTEM
  • downTRC() : GTCC
  • downTWR() : GXBRD
  • dumpContributionData() : EvtCli
  • dwell() : AcdHWMultiplexer
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- e -

  • egu() : GEGU_rtd, GEGU_thermistor, GEGU_poly3, GEGU_linear, GEGU
  • enable() : TrgAbstract, rcTrgMiniGLT, rcTrgGem, Grule, Ggroup, Gconstraint
  • enabled() : Grule, Ggroup, Gconstraint
  • enableMask() : GGLT
  • encode() : gAlertStr
  • endExcludeTime() : rcTransitions
  • engine() : TrgEngines, rcTrgEngines
  • engines() : TrgAbstract, rcMiniGLTDefaultTrigger, rcGEMDefaultTrigger, MiniGLTExample, SimpleGasuExample, MiniGLTExample, SimpleGasuExample, MiniGLTExample
  • enterComment() : CommentEntryWidget
  • error() : myLATcomponentIterator
  • evaluate() : Grule, Gconstraint
  • evBitCount() : EvtCli
  • evDumpAEM_Accepts() : EvtCli
  • evDumpAEM_PHA() : EvtCli
  • evDumpAEM_Vetos() : EvtCli
  • evDumpCAL_LogAccepts() : EvtCli
  • evDumpCAL_Logs() : EvtCli
  • evDumpDiagnostic() : EvtCli
  • evDumpEventAEM() : EvtCli
  • evDumpEventAEM_G2() : EvtCli
  • evDumpGEM() : EvtCli
  • evDumpGEM_Veto_List() : EvtCli
  • evDumpSummary() : EvtCli
  • evDumpTEM_Error() : EvtCli
  • evDumpTKR() : EvtCli
  • eventCounter() : TrgGemAbstract, TrgGem
  • eventDataParityEven() : TrgGemRegisters, TrgGemAbstract
  • eventHeaderParityEven() : TrgGemRegisters, TrgGemAbstract
  • eventNumber() : TrgDefaultSequence, TrgSequenceAbstract, TrgMiniGLTRegisters, TrgMiniGLTAbstract, TrgGemSequence
  • eventTag() : TrgDefaultSequence, TrgSequenceAbstract, TrgGemSequence
  • evGetAEM_PHA() : EvtCli
  • evGetAEM_Vec() : EvtCli
  • evGetCAL_LogAccepts() : EvtCli
  • evGetCAL_Logs() : EvtCli
  • evGetCAL_NumAccepts() : EvtCli
  • evGetEvtSeqMSW() : EvtCli
  • evGetEvtSequence() : EvtCli
  • evGetSummary() : EvtCli
  • evGetTEM_Diagnostic() : EvtCli
  • evGetTEM_Error() : EvtCli
  • evGetTimebase() : EvtCli
  • evGetTimestamp() : EvtCli
  • evGetTKR_Accepts() : EvtCli
  • evGetTKR_NumAccepts() : EvtCli
  • evGetTKR_NumStrips() : EvtCli
  • evGetTKR_StripN() : EvtCli
  • evGetTKR_TOT() : EvtCli
  • evtClearEvtSeqMSW() : GOCS
  • evtHandlerFilterTkrHits() : GOCS
  • evtHandlerPrescaleExternal() : GOCS
  • evtHandlerSendAcdScalers() : GOCS
  • evtHandlerSendAll() : GOCS
  • evtHandlerSendErrorsOnly() : GOCS
  • evtHandlerSendNothing() : GOCS
  • evtHandlerSendPrescaled() : GOCS
  • evtHandlerSetVerbosity() : GOCS
  • execGUImethod() : GUIbridge, RunControlMain, RunControl, EnvMonImpl
  • execGUImethodNR() : GUIbridge, RunControlMain, RunControl, EnvMonImpl
  • existsAEM() : GLAT
  • existsAEQ() : GAEM
  • existsAFE() : GARC
  • existsARC() : GAEM
  • existsCCC() : GTEM
  • existsCFE() : GCRC
  • existsCRC() : GCCC
  • existsCRU() : GLAT
  • existsEBM() : GLAT
  • existsEBMC() : GEBM
  • existsEBMST() : GEBM
  • existsGEM() : GLAT
  • existsGEMC() : GGEM
  • existsGEMIE() : GGEM
  • existsGEMMG() : GGEM
  • existsGEMSC() : GGEM
  • existsGEMST() : GGEM
  • existsGEMVG() : GGEM
  • existsGEMW() : GGEM
  • existsGLT() : GXBRD
  • existsHAEM() : GHSK
  • existsHARC() : HAEM
  • existsHCOM() : GHSK
  • existsHCPU() : GHSK
  • existsHEBM() : GHSK
  • existsHGEM() : GHSK
  • existsHPDU() : GHSK
  • existsHTEM() : GHSK
  • existsLCB() : GLAT
  • existsPDU() : GLAT
  • existsPEQ() : GPDU
  • existsTCC() : GTEM
  • existsTEM() : GLAT
  • existsTFE() : GTRC
  • existsTIC() : GTEM
  • existsTRC() : GTCC
  • existsTWR() : GXBRD
  • expand_family() : userAppLeaf
  • export() : DataExport
  • extCtrClear() : GGEMST
  • extCtrClearStatus() : GGEMST
  • extCtrDisable() : GGEMST
  • extCtrEnable() : GGEMST
  • extCtrLoopDisable() : GGEMST
  • extCtrLoopEnable() : GGEMST
  • extCtrRead() : GGEMST
  • extCtrSetLoopDelay() : GGEMST
  • external() : MiniGLTTrgConditionsValue, TrgExtEnables, TrgInputEnables, TrgConditionsValue, TrgConditions, NoInputsEnabled, NoExternal
  • externalEnableRegister() : TrgGemRegisters
  • extractVersion() : Gversions
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- f -

  • fakeUser() : PythonShellWidget
  • fileClose() : singleEvtDisplayImpl, Consumer, trgConsumer
  • fileExit() : singleEvtDisplayImpl
  • fileOpen() : singleEvtDisplayImpl, Consumer, trgConsumer
  • findVersionSymbol() : Gversions
  • fire() : Grule
  • fired() : Grule
  • flush() : PythonShellWidget, CommentEntryWidget
  • flushAll() : Geb
  • flushPlaybackFIFO() : GNAT
  • flushRecordFIFO() : GNAT
  • focusNextPrevChild() : PythonShellWidget, CommentEntryWidget
  • fourRange() : TrgEngineRequest
  • fourRangeReadout() : TrgMiniGLTRegisters, TrgMiniGLTAbstract
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- g -

  • GEM() : TrgGem
  • GEMcomponent() : myLATcomponentIterator
  • get() : GattrHsk, GattrBF, GattrRegDepr, GattrReg, GattrRaw
  • get_transition() : FSM
  • getAcdPeds() : GOSEDPreferencesImpl
  • getAddlInputFiles() : rcTransitions
  • getAllExcludeFlags() : GLAT
  • getAllOpaque() : GLAT
  • getAllSerialNos() : GLAT
  • getApp() : rcSuite
  • getAppState() : rcSuite
  • getArchiveFile() : rcTransitions
  • getArchiverInstance() : rcTransitions
  • getAvgDatagramSize() : rcTransitions
  • getAvgDeadTime() : rcTransitions
  • getBadEvents() : rcTransitions
  • getBadEventsFile() : rcTransitions
  • getByte() : EvtCli
  • getCallbackParams() : GOCS
  • getCalPeds() : GOSEDPreferencesImpl
  • getCompletionStatus() : rcTransitions, rcCompletionStatus
  • getCompletionStatusStr() : rcTransitions, rcCompletionStatus
  • getConfigurations() : GXBRD, GLAT, GHSK
  • getConstraint() : _Attr, Gattr
  • getContributionList() : EvtCli
  • getContributionStatus() : EvtCli
  • getContributionStatusStr() : EvtCli
  • getCurrentContribution() : EvtCli
  • getDataDistributor() : rcTransitions
  • getDeadChannels() : GTRC
  • getDeadChannelsByMask() : GTRC
  • getDeclarations() : GXBRD, GLAT, GHSK
  • getDisableTime() : rcTrgMiniGLT, rcTrgGem, GGLT
  • getDiscardedEvents() : rcTransitions
  • getDWord() : EvtCli
  • getEGU() : _Attr, Gattr
  • getElapsedTime() : rcTransitions
  • getEnableTime() : rcTrgMiniGLT, rcTrgGem, GGLT
  • getEndTime() : rcTransitions
  • getErrorEvents() : rcTransitions
  • getErrorEventsFile() : rcTransitions
  • getEventCount() : rcTransitions
  • getEventRate() : rcTransitions
  • getEvtCli() : rcTransitions
  • getEvtSize() : EvtCli
  • getEvtStatus() : EvtCli
  • getExcludeFlags() : Gdb
  • getFailedEvents() : rcTransitions
  • getFailedEventSends() : rcTransitions
  • getFileTimeStamp() : rcTransitions
  • getFITSfile() : rcTransitions
  • getFlag() : Gdb
  • getGemDeadTime() : rcTransitions
  • getGGLTStatus() : EvtCli
  • getGGLTStatusStr() : EvtCli
  • getHardwareVersions() : Gversions
  • getHeaders() : rcFitsWriter
  • getHSK() : rcTransitions
  • getHSKfile() : rcTransitions
  • getId() : rcUser
  • getIdNameDict() : rcUsers
  • getIdTuple() : Gdb
  • getInputNodes() : userAppTree, userAppLeaf
  • getInstByteRate() : rcTransitions
  • getInstDatagramSize() : rcTransitions
  • getInstEventRate() : rcTransitions
  • getInstSBCEventRate() : rcTransitions
  • getLeaf() : userAppTree, userAppLeaf
  • getLengthMismatchedEvents() : rcTransitions
  • getLogDir() : userAppLeaf
  • getLoginId() : RunControlCommon, rcUser
  • getName() : rcUser
  • getNextEvent() : Consumer, trgConsumer
  • getNoisyChannels() : GTRC
  • getNoisyChannelsByMask() : GTRC
  • getOnlineStatus() : EvtCli
  • getOnlineStatusStr() : EvtCli
  • getOpaque() : GHSK, Gdb
  • getPacketErrorEvents() : rcTransitions
  • getParameters() : rcParamVerifier
  • getParameterVerifier() : rcTransitions
  • getPauseCount() : rcTransitions
  • getPausedTime() : rcTransitions
  • getPedsFile() : GOSEDPreferencesImpl
  • getPermissionDescription() : rcSecurityMan
  • getPermissions() : rcUser, rcSecurityMan
  • getRawTimeStamp() : rcTransitions
  • getRoles() : rcUser, rcSecurityMan
  • getRule() : _Attr, Gattr
  • getRules() : GLAT, GHSK
  • getRunId() : rcTransitions
  • getRunMsgLogFile() : rcTransitions
  • getSBCEventRate() : rcTransitions
  • getSBCHandledEvents() : rcTransitions
  • getSchemaConfigFile() : rcTransitions
  • getScriptState() : rcSuite
  • getSerialNos() : Gdb
  • getSessionVar() : rcTransitions, rcSuite
  • getSnapshotStatus() : rcTransitions
  • getStartTime() : rcTransitions
  • getStartupScriptInfo() : GOCS
  • getState() : rcTransitions
  • getSuite() : rcTransitions, rcSuite
  • getSuiteInstance() : rcTransitions, rcSuite
  • getSysReg() : GLAT
  • getTimeout() : ccsdsSocket, EvtCliIO
  • getTimeStamp() : rcTrgMiniGLT, rcTrgGem, _Attr
  • getTree() : userAppLeaf
  • getTrgParityErrorEvents() : rcTransitions
  • getUnsentEvents() : rcTransitions
  • getUser() : rcUsers
  • getUserByLoginId() : rcUsers
  • getUserByName() : rcUsers
  • getUserId() : EvtCli
  • getUsers() : rcUsers
  • getValidEvents() : rcTransitions
  • getVersion() : GOCS
  • getWord() : EvtCli
  • GLT() : TrgMiniGLT
  • GLTcomponent() : myLATcomponentIterator
  • gMEMbusToLocal() : GMem
  • gMEMload() : GMem
  • gMEMlocalToBus() : GMem
  • gMEMread() : GMem
  • goClicked() : singleEvtDisplayImpl
  • GOSEDPreferences() : singleEvtDisplayImpl
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- h -

  • handle() : gAlertMailer, gAlertHandler, LogRecordStreamHandler
  • handleClicked() : PythonShellWidget, CommentEntryWidget
  • helpAbout() : singleEvtDisplayImpl
  • helpContents() : singleEvtDisplayImpl
  • helpOnline() : singleEvtDisplayImpl
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- i -

  • id() : Gdb
  • identity() : LdfContribution, GebContribution, AncillaryContribution
  • idMask() : GebContributor
  • inCoincidence() : TrgCoincidence, rcTrgCoincidence, NullCoincidence
  • inhibitContribution() : TrgGemRegisters, TrgGemAbstract
  • initApp() : RunControlMain
  • initHandle() : GNAT
  • initialize() : rcParamVerifyGUIImpl
  • initReport() : rcTestReport
  • inputEnables() : TrgAbstract, rcGEMDefaultTrigger, SimpleGasuExample
  • insertSection() : rcTestReport
  • insertText() : CommentEntryWidget
  • isAdministrator() : rcUser
  • isatty() : PythonShellWidget, CommentEntryWidget
  • isChecked() : rcParamVerifyGUIImpl
  • isCommand() : _Attr, Gattr
  • isCompletionStatus() : rcCompletionStatus
  • isConnected() : RunControlMain
  • isDeprecated() : _Attr, Gattr
  • isErrorEvent() : EvtCli
  • isGGLTStatus() : EvtCli
  • isGUIthread() : GUIbridge, RunControlMain
  • isLastSuiteScript() : rcTransitions
  • isMaskDirty() : GGLT
  • isNoDirectAccess() : _Attr, Gattr
  • isPacketErrorEvent() : EvtCli
  • isReadOnly() : _Attr, Gattr
  • isReadWrite() : _Attr, Gattr
  • isrealfile() : GlobalPanelImpl
  • isRunFromSuite() : rcTransitions
  • isSweepEvent() : EvtCli
  • isTimeoutEnabled() : ccsdsSocket, EvtCliIO
  • isTrgParityErrorEvent() : EvtCli
  • isWriteOnly() : _Attr, Gattr
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- p -

  • paint() : rcParamVerifyGUIImpl
  • paintCell() : userAppLeaf
  • paintEvent() : drawRainbowCAL, drawRainbowACD, drawYZ_CAL, drawXZ_CAL, drawYZ_TKR, drawXZ_TKR, drawHatACD, drawSide4ACD, drawSide3ACD, drawSide2ACD, drawSide1ACD
  • paintFocus() : userAppLeaf
  • paintWarning() : userAppLeaf
  • parameterClicked() : rcParamVerifyGUIImpl
  • parity() : TrgMiniGLTRegisters, TrgMiniGLTAbstract
  • parseEvent() : consumerPlotter, Consumer
  • participate() : TrgEngine, SweepMarkerEngine, rcMiniGLTSolicitedEngine, rcSolicitedEngine, NullEngine
  • pause() : rcTransitions
  • pauseSuite() : rcSuite
  • periodic() : TrgConditionsValue, TrgConditions
  • periodicCondition() : TrgUsingTiles, TrgGemAbstract
  • periodicLimitRegister() : TrgGemRegisters
  • periodicModeRegister() : TrgGemRegisters
  • periodicRateRegister() : TrgGemRegisters
  • plot() : singleEvtDisplayImpl, TKRcontributionIterator_, CALcontributionIterator2
  • port() : DataDistributorAddress
  • ppsTimer() : TrgGemAbstract, TrgGem
  • prescale() : TrgDefaultPeriodicCondition, TrgPeriodicConditionAbstract, TrgGemPeriodicCondition, TrgEngine, SweepMarkerEngine, rcMiniGLTSolicitedEngine, rcSolicitedEngine, NullEngine
  • prescaled() : TrgTriggerStats, TrgGemTriggerStats
  • previousClicked() : singleEvtDisplayImpl
  • print_EOE_Warning() : EvtCli
  • process() : userApplication, rcTransitions, FSM
  • process_list() : FSM
  • publish() : DataDistributorServer
  • purge() : Socket
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- r -

  • RA2() : TrgCnoEnables
  • RA4() : TrgCnoEnables
  • raw() : GEGU_rtd, GEGU_thermistor, GEGU_poly3, GEGU_linear, GEGU
  • RB1() : TrgCnoEnables
  • RB2() : TrgCnoEnables
  • RB3() : TrgCnoEnables
  • RB4() : TrgCnoEnables
  • rcSetup() : rcTransitions
  • rcSetupSuite() : rcSuite
  • read() : AncillaryContributor, LdfContributor, AncillaryContributor, LdfContributor, AncillaryContributor, GebContributor
  • readCCSDS() : ccsdsSocket
  • readConfig() : rcTransitions
  • readEvent() : EvtCliBT, EvtCli
  • readFile() : EvtCliIO
  • readline() : PythonShellWidget, CommentEntryWidget
  • readPedestals() : GOSEDPreferencesImpl
  • readPermissions() : rcSecurityMan
  • readSocket() : EvtCliIO
  • receive() : DataDistributorPoll, DataDistributorClient
  • rect() : userAppLeaf
  • redundantPPS() : TrgGemAbstract
  • refreshMask() : GGLT
  • register() : gAlertRegistry
  • registerAction() : Grule
  • registerPermission() : rcSecurityMan
  • reject() : Gconstraint
  • remaining() : TrgPeriodicCondition, TrgGemPeriodicCondition
  • replaceEngine() : rcTrgEngines
  • request() : TrgEngine, SweepMarkerEngine, rcMiniGLTSolicitedEngine, rcSolicitedEngine, NullEngine
  • reset() : TrgTriggerCounters, TrgTileCounters, TrgPeriodicCondition, TrgGemPeriodicCondition, TrgGemEventCounter, TrgGemCmdCounters, TrgGemCnoCounters, TrgGemTileCounters, TrgGemTriggerCounters, TrgEventCounter, TrgCnoCounters, TrgCmdCounters, FSM, Grule, Gconstraint
  • resettimehisto() : trgDisplayImpl
  • response() : TrgGemCmdStats, TrgCmdStats
  • responseDataParityEven() : TrgGemRegisters, TrgGemAbstract
  • responseHeaderParityEven() : TrgGemRegisters, TrgGemAbstract
  • resume() : AcdHWMultiplexer, rcTransitions
  • returnNone() : DataDistributorClient
  • rightMouseClicked() : userAppTree
  • roi() : TrgUsingTiles, TrgGemAbstract, TrgConditionsValue, TrgConditions, TrgRois
  • roiRegister() : TrgGemRegisters
  • roleHasPermission() : rcSecurityMan
  • root() : Gdb
  • rtti() : rcParamVerifyGUIImpl
  • run() : TaskEngine, Geb, GebContributor
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- s -

  • satCtrDisable() : GTIC
  • satCtrEnable() : GTIC
  • satCtrLoopDisable() : GTIC
  • satCtrLoopEnable() : GTIC
  • satCtrSetLoopDelay() : GTIC
  • seconds() : TrgPPSTimer, TrgGemPPSTimer
  • select_family() : userAppLeaf
  • selectACDPeds() : GOSEDPreferencesImpl
  • selectACDPedsFile() : GOSEDPreferencesImpl
  • selectCALPeds() : GOSEDPreferencesImpl
  • selectCALPedsFile() : GOSEDPreferencesImpl
  • selectChange() : singleEvtDisplayImpl
  • selectItem() : BrowserImpl
  • sendAction() : Grule
  • sent() : TrgTriggerStats, TrgGemTriggerStats
  • sequence() : TrgUsingTiles, TrgInjectMarker, TrgInjectChargeReadout, TrgReadout, TrgInjectCharge, TrgEngineRequest, TrgAbstract, rcTrgInjectMarker, NullRequest, AncillaryContributor, LdfContribution, GebContributor, GebContribution, AncillaryContribution
  • sequenceRegister() : TrgGemRegisters
  • serverClose() : singleEvtDisplayImpl, Consumer, trgConsumer
  • serverOpen() : singleEvtDisplayImpl, Consumer, trgConsumer
  • ServerPreferences() : singleEvtDisplayImpl
  • set() : GattrHsk, GattrBF, GattrDlc, GattrRegDepr, GattrReg, GattrRaw
  • set_default_transition() : FSM
  • setActions() : Grule
  • setArchiverClass() : rcTransitions
  • setBold() : rcParamVerifyGUIImpl
  • setCmdCli() : rcTransitions
  • setCompletionStatus() : rcTransitions
  • setConstraint() : _Attr, Gattr
  • setContentFromEditor() : rcParamVerifyGUIImpl
  • setCopyFromMenu() : userAppTree
  • setCurrentContribution() : EvtCli
  • setDebug() : EvtCli
  • setDelay() : Collector
  • setDestinationOverride() : GGLT
  • setEGU() : _Attr, Gattr
  • setEnabledTabPage() : RunControlMain
  • setEvtCli() : rcTransitions
  • setEvtEnable() : GLCB
  • setFlag() : Gdb
  • setLastSuiteScript() : rcTransitions
  • setLATpMode() : GNAT
  • setOn() : userAppLeaf
  • setPrefs() : rcTransitions
  • setRule() : _Attr, Gattr
  • setSessionVar() : rcTransitions, rcSuite
  • setStatus() : userAppTree
  • setSuite() : rcTransitions, rcSuite
  • setSuiteInstance() : rcTransitions, rcSuite
  • setTimeout() : ccsdsSocket, EvtCliIO
  • setTimeoutEnabled() : ccsdsSocket, EvtCliIO
  • setup() : rcTransitions
  • setupSchema() : BrowserImpl
  • setupSuite() : rcSuite
  • setWarning() : userAppLeaf
  • shut() : TrgMiniGLT, TrgGem, TrgAbstract, rcTrgMiniGLT, rcTrgGem, rcMiniGLTDefaultTrigger, rcGEMDefaultTrigger, BadGLTExample, BadGasuExample
  • shutdown() : TaskEngine, GUIbridge, AcdHWMultiplexer, EvtCliBT, Geb
  • size() : _Attr, Gattr
  • skipClicked() : singleEvtDisplayImpl
  • solicit() : TrgMiniGLT, TrgGem, TrgAbstract
  • solicited() : TrgConditionsValue, TrgConditions, rcMiniGLTSolicitedCondition, rcSolicitedCondition
  • source() : TrgDefaultPeriodicCondition, TrgPeriodicConditionAbstract, TrgGemPeriodicCondition
  • spawn() : TaskEngine
  • start() : DataDistributorPoll, AcdHWMultiplexer
  • startExcludeTime() : rcTransitions
  • startPlayback() : GNAT
  • startRun() : rcTransitions
  • stats() : TrgTriggerCounters, TrgTileCounters, TrgGemEventCounter, TrgGemCmdCounters, TrgGemCnoCounters, TrgGemTileCounters, TrgGemTriggerCounters, TrgEventCounter, TrgCnoCounters, TrgCmdCounters, AcdHWMultiplexer
  • statusString() : standardTestReport
  • stop() : DataDistributorPoll, AcdHWMultiplexer, rcTransitions
  • stopClicked() : singleEvtDisplayImpl
  • stopRun() : rcTransitions
  • stopSuite() : rcSuite
  • strip() : TKRcontributionIterator_
  • subsystem() : Grule, Gconstraint
  • sweepOnShut() : rcTrgMiniGLT, rcTrgGem, rcMiniGLTDefaultTrigger, rcGEMDefaultTrigger
  • synch() : DataExport
  • synchronize() : GOCS
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- t -

  • tack() : TrgMiniGLTRegisters, TrgMiniGLTAbstract
  • tag() : TrgMiniGLTRegisters, TrgMiniGLTAbstract
  • takeSnapshot() : rcTransitions
  • TCCcnt() : GTEM
  • teardown() : rcTransitions
  • TEMcnt() : GLAT
  • templateRegister() : TrgGemRegisters
  • tile() : MyRoi, AddableRoi, TrgTileEnables, TrgRoi, rcTrgTileEnables, NullRoi, NoTilesEnabled
  • tileCounters() : TrgGemAbstract, TrgGem
  • tileEnableRegister() : TrgGemRegisters
  • tileList() : AcdHWMultiplexer
  • tiles() : TrgInputEnables
  • timebase() : TrgPPSTimer, TrgGemPPSTimer
  • timedout() : HskHandler
  • tkr() : TrgConditionsValue, TrgConditions
  • TKRcomponent() : myLATcomponentIterator
  • tower() : TrgTowers, TrgTowerBusyEnables, rcTrgTowerBusyEnables, NoTowersBusy
  • towerBusy() : TrgInputEnables
  • towerBusyEnableRegister() : TrgGemRegisters
  • towerEnableRegister() : TrgGemRegisters
  • towers() : TrgTowerEnables, TrgInputEnables, NoInputsEnabled
  • tracker() : TrgTower, NullTower
  • transformToFile() : rcTestReport
  • trigger() : rcTransitions
  • triggerCounters() : TrgGemAbstract, TrgGem
  • triggerInputsUpdate() : userAppLeaf
  • triggerParityEven() : TrgGemRegisters, TrgGemAbstract
  • triggersDisabled() : GGLT
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- u -

  • units() : GEGU
  • unpack() : EvtCliIO
  • unregisterAction() : Grule
  • unselect_family() : userAppLeaf
  • up() : Gdb
  • updatePWarning() : userAppLeaf
  • use() : TrgTracker, NullTkr
  • useAcdAsTrigger() : TrgUsingTiles, TrgGemAbstract, rcGEMDefaultTrigger, SimpleGasuExample
  • useHighEnergy() : TrgCalorimeter, NullCal
  • useLowEnergy() : TrgCalorimeter, NullCal
  • userMethod() : testArchiver
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- v -

  • value() : MiniGLTTrgConditionsValue, TrgConditionsValue
  • verifyVersion() : GOCS
  • version() : TrgGem, TrgAbstract
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- w -

  • waitForMaskEnable() : rcTrgMiniGLT, rcTrgGem, GGLT
  • width() : TrgGemRegisters, TrgGemAbstract
  • widthRegister() : TrgGemRegisters
  • write() : PythonShellWidget, CommentEntryWidget, RegisterInterface
  • writeFIFO() : GNAT
  • writeFIFO32() : GNAT
  • writelines() : PythonShellWidget, CommentEntryWidget
  • writeTestInformation() : standardTestReport
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- _ -

  • __call__() : BoundMethodWeakref
  • __cmp__() : BoundMethodWeakref
  • __getattr__() : GEMcontribution_, GEMcontribution
  • __init__() : DefaultPeriodicCondition, TrgUsingTiles, TrgTriggerCounters, TrgTracker, TrgCalorimeter, TrgTower, TrgTowers, TrgDefaultSequence, TrgSequence, TrgSequenceDefinition, TrgSequenceAbstract, MyRoi, AddableRoi, TrgRoiAsTiles, TrgPPSTimer, TrgDefaultPeriodicCondition, TrgPeriodicConditionDefinition, TrgPeriodicCondition, TrgPeriodicConditionAbstract, TrgMiniGLTRegisters, TrgMiniGLTAbstract, MiniGLTTrgConditionsValue, TrgMiniGLT, TrgExtEnables, TrgTowerBusyEnables, TrgTileEnables, TrgCnoEnables, TrgTowerEnables, TrgInputEnables, TrgGemSequence, TrgGemRegisters, TrgGemPeriodicCondition, TrgGemPPSTimer, TrgGemEventCounter, TrgGemCmdStats, TrgGemCmdCounters, TrgGemCnoStats, TrgGemCnoCounters, TrgGemTileStats, TrgGemTileCounters, TrgGemTriggerStats, TrgGemTriggerCounters, TrgGemAbstract, TrgGem, TrgEventCounter, TrgInjectMarker, TrgInjectChargeReadout, TrgReadout, TrgInjectCharge, TrgEngineRequest, TrgEngine, TrgEngines, TrgConditionsValue, TrgConditions, TrgCoincidence, TrgCoincidences, TrgRoi, TrgRois, TrgCmdStats, TrgCmdCounters, TrgAbstract, rcTrgMiniGLT, rcTrgGem, rcTrgTowerBusyEnables, rcTrgCoincidence, rcTrgTileEnables, SweepMarkerEngine, rcTrgEngines, rcMiniGLTSolicitedCondition, rcMiniGLTSolicitedEngine, rcSolicitedCondition, rcSolicitedEngine, rcGEMTrgEngines, rcMiniGLTDefaultTrigger, rcGEMDefaultTrigger, NullRequest, NullEngine, NullCoincidence, NullRoi, NoInputsEnabled, NoExternal, NoTowersBusy, NoCnoEnabled, NoTilesEnabled, NullTkr, NullCal, NullTower, GUIbridge, DataDistributorPoll, DataDistributorClient, DataDistributorServer, AcdHWMultiplexer, ZsupTrgInjectChargeReadout, MiniGLTExample, SimpleGasuExample, MarkerTrgReadout, MiniGLTExample, BadGLTExample, BadGasuExample, ZsupTrgReadout, SimpleGasuExample, ZsupTrgReadout, MiniGLTExample, GDBN, rcParamVerifyGUIImpl, FSM, RegisterInterface, drawRainbowCAL, drawRainbowACD, drawYZ_CAL, drawXZ_CAL, drawYZ_TKR, drawXZ_TKR, drawHatACD, drawSide4ACD, drawSide3ACD, drawSide2ACD, drawSide1ACD, singleEvtDisplayImpl, myLATcomponentIterator, TKRcontributionIterator_, CALcontributionIterator2, BoundMethodWeakref, GTWR, GXBRD, GTIC, GTFE, GTRC, GTCC, GCFE, GCRC, GCCC, GTEM, GSIU, GruleAlarms, GruleLimit, Grule, GPEQ, GPDU, GNAT, GMem, GLCBSTATS, GLCB, GLAT, HNUL, HCPU, HCOM, HPDU, HEBM, HGEM, HARC, HAEM, HTEM, GHSK, GattrHsk, GGLT, GGEMW, GGEMIE, GGEMVG, GGEMSC, GGEMST, GGEMMG, GGEMC, GGEM, GEPU, GEGU_rtd, GEGU_thermistor, GEGU_poly3, GEGU_linear, GEBMST, GEBMC, GEBM, Gdb, GCRU, Gconstraint, GattrBF, GattrReg, GattrRaw, Gattr, GAFE, GARC, GAEQ, GAEM, standardTestReport, consumerPlotter, Consumer, EvtCli, evErr_GCCC_Message, evCAL_LayerLogData, evTKR_StripData, evTKR_TOTdata, Evt, userAppLeaf
  • __len__() : CAL_LATcontribution
  • __new__() : BoundMethodWeakref
  • __nonzero__() : BoundMethodWeakref
  • __setattr__() : TrgObject
  • __str__() : CAL_LATcontribution, BoundMethodWeakref
  • _eval_() : GruleAlarms, GruleLimit, Grule, GconstraintLimitPegRE, GconstraintLimit, GconstraintLimitRE, Gconstraint
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- k -

  • keyPressEvent() : PythonShellWidget, CommentEntryWidget
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- l -

  • LA1() : TrgCnoEnables
  • LA2() : TrgCnoEnables
  • LA3() : TrgCnoEnables
  • LA4() : TrgCnoEnables
  • LB2() : TrgCnoEnables
  • LB4() : TrgCnoEnables
  • leafActionsTuples() : userAppLeaf
  • length() : LdfContribution, GebContribution, AncillaryContribution
  • limit() : TrgDefaultPeriodicCondition, TrgPeriodicConditionAbstract, TrgGemPeriodicCondition
  • livetime() : TrgTriggerStats, TrgGemTriggerStats
  • loadApp() : RunControlMain
  • loadAppWindows() : userAppLeaf
  • loadFIFO() : GNAT
  • loadModule() : RunControlMain
  • loadNodes() : userAppTree
  • log() : CALcontributionIterator2
  • lookup() : DataDistributorAddress
  • lookupTableRegister() : TrgGemRegisters
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- m -

  • marker() : TrgMiniGLTRegisters, TrgMiniGLTAbstract, TrgInjectMarker, TrgEngineRequest
  • maxConditions() : TrgGemAbstract, TrgAbstract
  • maxEngines() : TrgGemAbstract, TrgAbstract
  • md5sum() : DataExport
  • module() : userAppLeaf
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- n -

  • name() : TaskEngine, AncillaryContributor, LdfContributor, AncillaryContributor, LdfContributor, AncillaryContributor, Geb, GebContributor, Grule, Ggroup, Gconstraint, userAppLeaf
  • nextClicked() : singleEvtDisplayImpl
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- o -

  • open() : AncillaryContributor, LdfContributor, AncillaryContributor, LdfContributor, AncillaryContributor, GebContributor, EvtCliIO
  • OSWcomponent() : myLATcomponentIterator
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- z -

  • zeroSuppress() : TrgMiniGLTRegisters, TrgMiniGLTAbstract, TrgEngineRequest, rcTrgInjectMarker
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- a -

  • A() : TrgTileStats, TrgGemCnoStats, TrgGemTileStats, TrgCnoStats
  • abort() : TrgPeriodicCondition, TrgGemPeriodicCondition, AcdHWMultiplexer, EvtCliBT, EvtCliIO
  • ACDcomponent() : myLATcomponentIterator
  • add() : rcParamVerifier
  • add_transition() : FSM
  • add_transition_any() : FSM
  • add_transition_list() : FSM
  • addCAL_LogAccept() : Evt
  • addCAL_LogData() : Evt
  • addChannel() : GNAT
  • addCompletionStatus() : rcCompletionStatus
  • addCustomReportData() : rcTransitions
  • addErrGCCCmsg() : Evt
  • addErrGTCCmsg() : Evt
  • addExportedFile() : rcTransitions
  • addHeading() : rcTestReport
  • addHTML() : rcTestReport
  • AddLeaf() : userAppTree
  • addPair() : rcTrgCoincidence
  • addParameter() : rcParamVerifyGUIImpl
  • addPassword() : rcSecurityMan
  • addPermission() : rcUser
  • addPHA() : AEM
  • addr() : Gdb
  • addRole() : rcUser
  • addSection() : rcTestReport
  • addSectionImage() : rcTestReport
  • addSectionItem() : rcTestReport
  • addSectionTable() : rcTestReport
  • addTableData() : rcTestReport
  • addTableHeader() : rcTestReport
  • addTKRaccept() : Evt
  • addTKRstrip() : Evt
  • addTKRtot() : Evt
  • addUser() : rcUsers
  • adjustExcludeTime() : rcTransitions
  • alignment() : rcParamVerifyGUIImpl
  • allAFE() : GARC
  • allARC() : GAEM
  • allCCC() : GTEM
  • allCFE() : GCRC
  • allCRC() : GCCC
  • allParametersChecked() : rcParamVerifyGUIImpl
  • allTCC() : GTEM
  • allTEM() : GLAT
  • allTFE() : GTRC
  • allTRC() : GTCC
  • applyConfig() : rcTransitions
  • archiveClose() : Consumer
  • archiveOpen() : Consumer
  • assignA() : TrgTileCounters, TrgGemCnoCounters, TrgGemTileCounters, TrgCnoCounters
  • assignAB() : TrgTileCounters, TrgGemCnoCounters, TrgGemTileCounters, TrgCnoCounters
  • assignB() : TrgTileCounters, TrgGemCnoCounters, TrgGemTileCounters, TrgCnoCounters
  • attrIter() : Gdb
  • authenticateUser() : rcSecurityMan
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- b -

  • B() : TrgTileStats, TrgGemCnoStats, TrgGemTileStats, TrgCnoStats
  • beginTableRow() : rcTestReport
  • build() : Geb
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- c -

  • CALcomponent() : myLATcomponentIterator
  • calculateKey() : BoundMethodWeakref
  • calHigh() : TrgConditionsValue, TrgConditions
  • calLow() : TrgConditionsValue, TrgConditions
  • calorimeter() : TrgTower, NullTower
  • calStrobe() : TrgMiniGLTRegisters, TrgMiniGLTAbstract
  • cancel() : rcParamVerifyGUIImpl
  • category() : Grule, Gconstraint
  • CCCcnt() : GTEM
  • changePassword() : rcSecurityMan
  • checkException1() : TaskEngineTestCase
  • checkException2() : TaskEngineTestCase
  • checkGGLTstatus() : EvtCli
  • checkInstantiation() : TaskEngineTestCase
  • checkOnlineStatus() : EvtCli
  • checkPassword() : rcSecurityMan
  • checkPermission() : rcSecurityMan
  • checkSelfShutdown() : TaskEngineTestCase
  • checkShutdown1() : TaskEngineTestCase
  • checkShutdown2() : TaskEngineTestCase
  • checkSpawn() : TaskEngineTestCase
  • checkStartup() : TaskEngineTestCase
  • checkUnboundSpawn() : TaskEngineTestCase
  • clearAllActions() : Grule
  • clearAllRows() : rcParamVerifyGUIImpl
  • clearBuffer() : GNAT
  • clearButtonGroups() : singleEvtDisplayImpl
  • clearEvent() : Evt, AEM
  • clearViews() : singleEvtDisplayImpl
  • close() : AncillaryContributor, Merger, LdfContributor, AncillaryContributor, LdfContributor, Merger, AncillaryContributor, Geb, GebContributor, EvtCliIO
  • closeTestReport() : standardTestReport
  • cmdCounters() : TrgGemAbstract, TrgGem
  • cno() : TrgInputEnables, TrgConditionsValue, TrgConditions, NoInputsEnabled
  • cnoCounters() : TrgGemAbstract, TrgGem
  • cnoEnableRegister() : TrgGemRegisters
  • coincidence() : TrgRoiAsTiles, TrgCoincidences
  • coincidences() : TrgUsingTiles, rcGEMDefaultTrigger, SimpleGasuExample
  • collapse_family() : userAppLeaf
  • command() : TrgGemCmdStats, TrgCmdStats
  • commandSynch() : userApplication
  • commit() : rcTrgMiniGLT, rcTrgGem
  • conditions() : TrgAbstract, rcMiniGLTDefaultTrigger, rcGEMDefaultTrigger, MiniGLTExample
  • configurationRegister() : TrgGemRegisters
  • confirm() : rcParamVerifyGUIImpl
  • connect() : DataDistributorClient, DataDistributorServer, HskHandler, HskCli
  • contentsContextMenuEvent() : PythonShellWidget, CommentEntryWidget
  • contributionQueue() : GebContributor
  • copyCheckedNodes() : userAppTree, userAppLeaf
  • createEditor() : rcParamVerifyGUIImpl
  • createGUI() : GUIbridge, RunControlMain, RunControl
  • createSocket() : MyLogSocketHandler
  • createWindow() : userAppLeaf
  • customEvent() : RunControlMain, EnvMonImpl
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- d -

  • dataSize() : Consumer, trgConsumer
  • decode() : gAlertStr
  • decodeRegister() : AEQHskRegMap
  • definition() : DefaultSequence, DefaultPeriodicCondition, TrgSequence, TrgPeriodicCondition
  • deleteUser() : rcUsers, rcSecurityMan
  • destination() : TrgMiniGLTRegisters, TrgMiniGLTAbstract, TrgEngineRequest
  • diagnostic() : myLATcomponentIterator
  • disable() : TrgMiniGLT, TrgGem, TrgAbstract, rcTrgMiniGLT, rcTrgGem, Grule, Ggroup, Gconstraint
  • disableMask() : GGLT
  • discarded() : TrgTriggerStats, TrgGemTriggerStats
  • disconnect() : DataDistributorClient, DataDistributorServer, HskCli
  • disconnected() : HskHandler
  • dispose() : Merger
  • doEmit() : RunControlMain, RunControl
  • doPause() : RunControlMain, RunControl
  • doReset() : RunControlMain, RunControl
  • doRun() : RunControlMain, RunControl
  • doStop() : RunControlMain, RunControl
  • doStopRun() : RunControlMain, RunControl
  • doSuiteReset() : RunControlMain
  • doValueChanged() : rcParamVerifyGUIImpl
  • down() : FEpowerUp
  • downAEM() : GLAT
  • downAEQ() : GAEM
  • downAFE() : GARC
  • downARC() : GAEM
  • downCCC() : GTEM
  • downCFE() : GCRC
  • downCRC() : GCCC
  • downCRU() : GLAT
  • downEBM() : GLAT
  • downEBMC() : GEBM
  • downEBMST() : GEBM
  • downGEM() : GLAT
  • downGEMC() : GGEM
  • downGEMIE() : GGEM
  • downGEMMG() : GGEM
  • downGEMSC() : GGEM
  • downGEMST() : GGEM
  • downGEMVG() : GGEM
  • downGEMW() : GGEM
  • downGLT() : GXBRD
  • downHAEM() : GHSK
  • downHARC() : HAEM
  • downHCOM() : GHSK
  • downHCPU() : GHSK
  • downHEBM() : GHSK
  • downHGEM() : GHSK
  • downHNUL() : GHSK
  • downHPDU() : GHSK
  • downHTEM() : GHSK
  • downLCB() : GLAT
  • downPDU() : GLAT
  • downPEQ() : GPDU
  • downTCC() : GTEM
  • downTEM() : GLAT
  • downTFE() : GTRC
  • downTIC() : GTEM
  • downTRC() : GTCC
  • downTWR() : GXBRD
  • dumpContributionData() : EvtCli
  • dwell() : AcdHWMultiplexer
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- e -

  • egu() : GEGU_rtd, GEGU_thermistor, GEGU_poly3, GEGU_linear, GEGU
  • enable() : TrgAbstract, rcTrgMiniGLT, rcTrgGem, Grule, Ggroup, Gconstraint
  • enabled() : Grule, Ggroup, Gconstraint
  • enableMask() : GGLT
  • encode() : gAlertStr
  • endExcludeTime() : rcTransitions
  • engine() : TrgEngines, rcTrgEngines
  • engines() : TrgAbstract, rcMiniGLTDefaultTrigger, rcGEMDefaultTrigger, MiniGLTExample, SimpleGasuExample, MiniGLTExample, SimpleGasuExample, MiniGLTExample
  • enterComment() : CommentEntryWidget
  • error() : myLATcomponentIterator
  • evaluate() : Grule, Gconstraint
  • evBitCount() : EvtCli
  • evDumpAEM_Accepts() : EvtCli
  • evDumpAEM_PHA() : EvtCli
  • evDumpAEM_Vetos() : EvtCli
  • evDumpCAL_LogAccepts() : EvtCli
  • evDumpCAL_Logs() : EvtCli
  • evDumpDiagnostic() : EvtCli
  • evDumpEventAEM() : EvtCli
  • evDumpEventAEM_G2() : EvtCli
  • evDumpGEM() : EvtCli
  • evDumpGEM_Veto_List() : EvtCli
  • evDumpSummary() : EvtCli
  • evDumpTEM_Error() : EvtCli
  • evDumpTKR() : EvtCli
  • eventCounter() : TrgGemAbstract, TrgGem
  • eventDataParityEven() : TrgGemRegisters, TrgGemAbstract
  • eventHeaderParityEven() : TrgGemRegisters, TrgGemAbstract
  • eventNumber() : TrgDefaultSequence, TrgSequenceAbstract, TrgMiniGLTRegisters, TrgMiniGLTAbstract, TrgGemSequence
  • eventTag() : TrgDefaultSequence, TrgSequenceAbstract, TrgGemSequence
  • evGetAEM_PHA() : EvtCli
  • evGetAEM_Vec() : EvtCli
  • evGetCAL_LogAccepts() : EvtCli
  • evGetCAL_Logs() : EvtCli
  • evGetCAL_NumAccepts() : EvtCli
  • evGetEvtSeqMSW() : EvtCli
  • evGetEvtSequence() : EvtCli
  • evGetSummary() : EvtCli
  • evGetTEM_Diagnostic() : EvtCli
  • evGetTEM_Error() : EvtCli
  • evGetTimebase() : EvtCli
  • evGetTimestamp() : EvtCli
  • evGetTKR_Accepts() : EvtCli
  • evGetTKR_NumAccepts() : EvtCli
  • evGetTKR_NumStrips() : EvtCli
  • evGetTKR_StripN() : EvtCli
  • evGetTKR_TOT() : EvtCli
  • evtClearEvtSeqMSW() : GOCS
  • evtHandlerFilterTkrHits() : GOCS
  • evtHandlerPrescaleExternal() : GOCS
  • evtHandlerSendAcdScalers() : GOCS
  • evtHandlerSendAll() : GOCS
  • evtHandlerSendErrorsOnly() : GOCS
  • evtHandlerSendNothing() : GOCS
  • evtHandlerSendPrescaled() : GOCS
  • evtHandlerSetVerbosity() : GOCS
  • execGUImethod() : GUIbridge, RunControlMain, RunControl, EnvMonImpl
  • execGUImethodNR() : GUIbridge, RunControlMain, RunControl, EnvMonImpl
  • existsAEM() : GLAT
  • existsAEQ() : GAEM
  • existsAFE() : GARC
  • existsARC() : GAEM
  • existsCCC() : GTEM
  • existsCFE() : GCRC
  • existsCRC() : GCCC
  • existsCRU() : GLAT
  • existsEBM() : GLAT
  • existsEBMC() : GEBM
  • existsEBMST() : GEBM
  • existsGEM() : GLAT
  • existsGEMC() : GGEM
  • existsGEMIE() : GGEM
  • existsGEMMG() : GGEM
  • existsGEMSC() : GGEM
  • existsGEMST() : GGEM
  • existsGEMVG() : GGEM
  • existsGEMW() : GGEM
  • existsGLT() : GXBRD
  • existsHAEM() : GHSK
  • existsHARC() : HAEM
  • existsHCOM() : GHSK
  • existsHCPU() : GHSK
  • existsHEBM() : GHSK
  • existsHGEM() : GHSK
  • existsHPDU() : GHSK
  • existsHTEM() : GHSK
  • existsLCB() : GLAT
  • existsPDU() : GLAT
  • existsPEQ() : GPDU
  • existsTCC() : GTEM
  • existsTEM() : GLAT
  • existsTFE() : GTRC
  • existsTIC() : GTEM
  • existsTRC() : GTCC
  • existsTWR() : GXBRD
  • expand_family() : userAppLeaf
  • export() : DataExport
  • extCtrClear() : GGEMST
  • extCtrClearStatus() : GGEMST
  • extCtrDisable() : GGEMST
  • extCtrEnable() : GGEMST
  • extCtrLoopDisable() : GGEMST
  • extCtrLoopEnable() : GGEMST
  • extCtrRead() : GGEMST
  • extCtrSetLoopDelay() : GGEMST
  • external() : MiniGLTTrgConditionsValue, TrgExtEnables, TrgInputEnables, TrgConditionsValue, TrgConditions, NoInputsEnabled, NoExternal
  • externalEnableRegister() : TrgGemRegisters
  • extractVersion() : Gversions
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- f -

  • fakeUser() : PythonShellWidget
  • fileClose() : singleEvtDisplayImpl, Consumer, trgConsumer
  • fileExit() : singleEvtDisplayImpl
  • fileOpen() : singleEvtDisplayImpl, Consumer, trgConsumer
  • findVersionSymbol() : Gversions
  • fire() : Grule
  • fired() : Grule
  • flush() : PythonShellWidget, CommentEntryWidget
  • flushAll() : Geb
  • flushPlaybackFIFO() : GNAT
  • flushRecordFIFO() : GNAT
  • focusNextPrevChild() : PythonShellWidget, CommentEntryWidget
  • fourRange() : TrgEngineRequest
  • fourRangeReadout() : TrgMiniGLTRegisters, TrgMiniGLTAbstract
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- g -

  • GEM() : TrgGem
  • GEMcomponent() : myLATcomponentIterator
  • get() : GattrHsk, GattrBF, GattrRegDepr, GattrReg, GattrRaw
  • get_transition() : FSM
  • getAcdPeds() : GOSEDPreferencesImpl
  • getAddlInputFiles() : rcTransitions
  • getAllExcludeFlags() : GLAT
  • getAllOpaque() : GLAT
  • getAllSerialNos() : GLAT
  • getApp() : rcSuite
  • getAppState() : rcSuite
  • getArchiveFile() : rcTransitions
  • getArchiverInstance() : rcTransitions
  • getAvgDatagramSize() : rcTransitions
  • getAvgDeadTime() : rcTransitions
  • getBadEvents() : rcTransitions
  • getBadEventsFile() : rcTransitions
  • getByte() : EvtCli
  • getCallbackParams() : GOCS
  • getCalPeds() : GOSEDPreferencesImpl
  • getCompletionStatus() : rcTransitions, rcCompletionStatus
  • getCompletionStatusStr() : rcTransitions, rcCompletionStatus
  • getConfigurations() : GXBRD, GLAT, GHSK
  • getConstraint() : _Attr, Gattr
  • getContributionList() : EvtCli
  • getContributionStatus() : EvtCli
  • getContributionStatusStr() : EvtCli
  • getCurrentContribution() : EvtCli
  • getDataDistributor() : rcTransitions
  • getDeadChannels() : GTRC
  • getDeadChannelsByMask() : GTRC
  • getDeclarations() : GXBRD, GLAT, GHSK
  • getDisableTime() : rcTrgMiniGLT, rcTrgGem, GGLT
  • getDiscardedEvents() : rcTransitions
  • getDWord() : EvtCli
  • getEGU() : _Attr, Gattr
  • getElapsedTime() : rcTransitions
  • getEnableTime() : rcTrgMiniGLT, rcTrgGem, GGLT
  • getEndTime() : rcTransitions
  • getErrorEvents() : rcTransitions
  • getErrorEventsFile() : rcTransitions
  • getEventCount() : rcTransitions
  • getEventRate() : rcTransitions
  • getEvtCli() : rcTransitions
  • getEvtSize() : EvtCli
  • getEvtStatus() : EvtCli
  • getExcludeFlags() : Gdb
  • getFailedEvents() : rcTransitions
  • getFailedEventSends() : rcTransitions
  • getFileTimeStamp() : rcTransitions
  • getFITSfile() : rcTransitions
  • getFlag() : Gdb
  • getGemDeadTime() : rcTransitions
  • getGGLTStatus() : EvtCli
  • getGGLTStatusStr() : EvtCli
  • getHardwareVersions() : Gversions
  • getHeaders() : rcFitsWriter
  • getHSK() : rcTransitions
  • getHSKfile() : rcTransitions
  • getId() : rcUser
  • getIdNameDict() : rcUsers
  • getIdTuple() : Gdb
  • getInputNodes() : userAppTree, userAppLeaf
  • getInstByteRate() : rcTransitions
  • getInstDatagramSize() : rcTransitions
  • getInstEventRate() : rcTransitions
  • getInstSBCEventRate() : rcTransitions
  • getLeaf() : userAppTree, userAppLeaf
  • getLengthMismatchedEvents() : rcTransitions
  • getLogDir() : userAppLeaf
  • getLoginId() : RunControlCommon, rcUser
  • getName() : rcUser
  • getNextEvent() : Consumer, trgConsumer
  • getNoisyChannels() : GTRC
  • getNoisyChannelsByMask() : GTRC
  • getOnlineStatus() : EvtCli
  • getOnlineStatusStr() : EvtCli
  • getOpaque() : GHSK, Gdb
  • getPacketErrorEvents() : rcTransitions
  • getParameters() : rcParamVerifier
  • getParameterVerifier() : rcTransitions
  • getPauseCount() : rcTransitions
  • getPausedTime() : rcTransitions
  • getPedsFile() : GOSEDPreferencesImpl
  • getPermissionDescription() : rcSecurityMan
  • getPermissions() : rcUser, rcSecurityMan
  • getRawTimeStamp() : rcTransitions
  • getRoles() : rcUser, rcSecurityMan
  • getRule() : _Attr, Gattr
  • getRules() : GLAT, GHSK
  • getRunId() : rcTransitions
  • getRunMsgLogFile() : rcTransitions
  • getSBCEventRate() : rcTransitions
  • getSBCHandledEvents() : rcTransitions
  • getSchemaConfigFile() : rcTransitions
  • getScriptState() : rcSuite
  • getSerialNos() : Gdb
  • getSessionVar() : rcTransitions, rcSuite
  • getSnapshotStatus() : rcTransitions
  • getStartTime() : rcTransitions
  • getStartupScriptInfo() : GOCS
  • getState() : rcTransitions
  • getSuite() : rcTransitions, rcSuite
  • getSuiteInstance() : rcTransitions, rcSuite
  • getSysReg() : GLAT
  • getTimeout() : ccsdsSocket, EvtCliIO
  • getTimeStamp() : rcTrgMiniGLT, rcTrgGem, _Attr
  • getTree() : userAppLeaf
  • getTrgParityErrorEvents() : rcTransitions
  • getUnsentEvents() : rcTransitions
  • getUser() : rcUsers
  • getUserByLoginId() : rcUsers
  • getUserByName() : rcUsers
  • getUserId() : EvtCli
  • getUsers() : rcUsers
  • getValidEvents() : rcTransitions
  • getVersion() : GOCS
  • getWord() : EvtCli
  • GLT() : TrgMiniGLT
  • GLTcomponent() : myLATcomponentIterator
  • gMEMbusToLocal() : GMem
  • gMEMload() : GMem
  • gMEMlocalToBus() : GMem
  • gMEMread() : GMem
  • goClicked() : singleEvtDisplayImpl
  • GOSEDPreferences() : singleEvtDisplayImpl
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- h -

  • handle() : gAlertMailer, gAlertHandler, LogRecordStreamHandler
  • handleClicked() : PythonShellWidget, CommentEntryWidget
  • helpAbout() : singleEvtDisplayImpl
  • helpContents() : singleEvtDisplayImpl
  • helpOnline() : singleEvtDisplayImpl
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- i -

  • id() : Gdb
  • identity() : LdfContribution, GebContribution, AncillaryContribution
  • idMask() : GebContributor
  • inCoincidence() : TrgCoincidence, rcTrgCoincidence, NullCoincidence
  • inhibitContribution() : TrgGemRegisters, TrgGemAbstract
  • initApp() : RunControlMain
  • initHandle() : GNAT
  • initialize() : rcParamVerifyGUIImpl
  • initReport() : rcTestReport
  • inputEnables() : TrgAbstract, rcGEMDefaultTrigger, SimpleGasuExample
  • insertSection() : rcTestReport
  • insertText() : CommentEntryWidget
  • isAdministrator() : rcUser
  • isatty() : PythonShellWidget, CommentEntryWidget
  • isChecked() : rcParamVerifyGUIImpl
  • isCommand() : _Attr, Gattr
  • isCompletionStatus() : rcCompletionStatus
  • isConnected() : RunControlMain
  • isDeprecated() : _Attr, Gattr
  • isErrorEvent() : EvtCli
  • isGGLTStatus() : EvtCli
  • isGUIthread() : GUIbridge, RunControlMain
  • isLastSuiteScript() : rcTransitions
  • isMaskDirty() : GGLT
  • isNoDirectAccess() : _Attr, Gattr
  • isPacketErrorEvent() : EvtCli
  • isReadOnly() : _Attr, Gattr
  • isReadWrite() : _Attr, Gattr
  • isrealfile() : GlobalPanelImpl
  • isRunFromSuite() : rcTransitions
  • isSweepEvent() : EvtCli
  • isTimeoutEnabled() : ccsdsSocket, EvtCliIO
  • isTrgParityErrorEvent() : EvtCli
  • isWriteOnly() : _Attr, Gattr
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- p -

  • paint() : rcParamVerifyGUIImpl
  • paintCell() : userAppLeaf
  • paintEvent() : drawRainbowCAL, drawRainbowACD, drawYZ_CAL, drawXZ_CAL, drawYZ_TKR, drawXZ_TKR, drawHatACD, drawSide4ACD, drawSide3ACD, drawSide2ACD, drawSide1ACD
  • paintFocus() : userAppLeaf
  • paintWarning() : userAppLeaf
  • parameterClicked() : rcParamVerifyGUIImpl
  • parity() : TrgMiniGLTRegisters, TrgMiniGLTAbstract
  • parseEvent() : consumerPlotter, Consumer
  • participate() : TrgEngine, SweepMarkerEngine, rcMiniGLTSolicitedEngine, rcSolicitedEngine, NullEngine
  • pause() : rcTransitions
  • pauseSuite() : rcSuite
  • periodic() : TrgConditionsValue, TrgConditions
  • periodicCondition() : TrgUsingTiles, TrgGemAbstract
  • periodicLimitRegister() : TrgGemRegisters
  • periodicModeRegister() : TrgGemRegisters
  • periodicRateRegister() : TrgGemRegisters
  • plot() : singleEvtDisplayImpl, TKRcontributionIterator_, CALcontributionIterator2
  • port() : DataDistributorAddress
  • ppsTimer() : TrgGemAbstract, TrgGem
  • prescale() : TrgDefaultPeriodicCondition, TrgPeriodicConditionAbstract, TrgGemPeriodicCondition, TrgEngine, SweepMarkerEngine, rcMiniGLTSolicitedEngine, rcSolicitedEngine, NullEngine
  • prescaled() : TrgTriggerStats, TrgGemTriggerStats
  • previousClicked() : singleEvtDisplayImpl
  • print_EOE_Warning() : EvtCli
  • process() : userApplication, rcTransitions, FSM
  • process_list() : FSM
  • publish() : DataDistributorServer
  • purge() : Socket
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- r -

  • RA2() : TrgCnoEnables
  • RA4() : TrgCnoEnables
  • raw() : GEGU_rtd, GEGU_thermistor, GEGU_poly3, GEGU_linear, GEGU
  • RB1() : TrgCnoEnables
  • RB2() : TrgCnoEnables
  • RB3() : TrgCnoEnables
  • RB4() : TrgCnoEnables
  • rcSetup() : rcTransitions
  • rcSetupSuite() : rcSuite
  • read() : AncillaryContributor, LdfContributor, AncillaryContributor, LdfContributor, AncillaryContributor, GebContributor
  • readCCSDS() : ccsdsSocket
  • readConfig() : rcTransitions
  • readEvent() : EvtCliBT, EvtCli
  • readFile() : EvtCliIO
  • readline() : PythonShellWidget, CommentEntryWidget
  • readPedestals() : GOSEDPreferencesImpl
  • readPermissions() : rcSecurityMan
  • readSocket() : EvtCliIO
  • receive() : DataDistributorPoll, DataDistributorClient
  • rect() : userAppLeaf
  • redundantPPS() : TrgGemAbstract
  • refreshMask() : GGLT
  • register() : gAlertRegistry
  • registerAction() : Grule
  • registerPermission() : rcSecurityMan
  • reject() : Gconstraint
  • remaining() : TrgPeriodicCondition, TrgGemPeriodicCondition
  • replaceEngine() : rcTrgEngines
  • request() : TrgEngine, SweepMarkerEngine, rcMiniGLTSolicitedEngine, rcSolicitedEngine, NullEngine
  • reset() : TrgTriggerCounters, TrgTileCounters, TrgPeriodicCondition, TrgGemPeriodicCondition, TrgGemEventCounter, TrgGemCmdCounters, TrgGemCnoCounters, TrgGemTileCounters, TrgGemTriggerCounters, TrgEventCounter, TrgCnoCounters, TrgCmdCounters, FSM, Grule, Gconstraint
  • resettimehisto() : trgDisplayImpl
  • response() : TrgGemCmdStats, TrgCmdStats
  • responseDataParityEven() : TrgGemRegisters, TrgGemAbstract
  • responseHeaderParityEven() : TrgGemRegisters, TrgGemAbstract
  • resume() : AcdHWMultiplexer, rcTransitions
  • returnNone() : DataDistributorClient
  • rightMouseClicked() : userAppTree
  • roi() : TrgUsingTiles, TrgGemAbstract, TrgConditionsValue, TrgConditions, TrgRois
  • roiRegister() : TrgGemRegisters
  • roleHasPermission() : rcSecurityMan
  • root() : Gdb
  • rtti() : rcParamVerifyGUIImpl
  • run() : TaskEngine, Geb, GebContributor
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- s -

  • satCtrDisable() : GTIC
  • satCtrEnable() : GTIC
  • satCtrLoopDisable() : GTIC
  • satCtrLoopEnable() : GTIC
  • satCtrSetLoopDelay() : GTIC
  • seconds() : TrgPPSTimer, TrgGemPPSTimer
  • select_family() : userAppLeaf
  • selectACDPeds() : GOSEDPreferencesImpl
  • selectACDPedsFile() : GOSEDPreferencesImpl
  • selectCALPeds() : GOSEDPreferencesImpl
  • selectCALPedsFile() : GOSEDPreferencesImpl
  • selectChange() : singleEvtDisplayImpl
  • selectItem() : BrowserImpl
  • sendAction() : Grule
  • sent() : TrgTriggerStats, TrgGemTriggerStats
  • sequence() : TrgUsingTiles, TrgInjectMarker, TrgInjectChargeReadout, TrgReadout, TrgInjectCharge, TrgEngineRequest, TrgAbstract, rcTrgInjectMarker, NullRequest, AncillaryContributor, LdfContribution, GebContributor, GebContribution, AncillaryContribution
  • sequenceRegister() : TrgGemRegisters
  • serverClose() : singleEvtDisplayImpl, Consumer, trgConsumer
  • serverOpen() : singleEvtDisplayImpl, Consumer, trgConsumer
  • ServerPreferences() : singleEvtDisplayImpl
  • set() : GattrHsk, GattrBF, GattrDlc, GattrRegDepr, GattrReg, GattrRaw
  • set_default_transition() : FSM
  • setActions() : Grule
  • setArchiverClass() : rcTransitions
  • setBold() : rcParamVerifyGUIImpl
  • setCmdCli() : rcTransitions
  • setCompletionStatus() : rcTransitions
  • setConstraint() : _Attr, Gattr
  • setContentFromEditor() : rcParamVerifyGUIImpl
  • setCopyFromMenu() : userAppTree
  • setCurrentContribution() : EvtCli
  • setDebug() : EvtCli
  • setDelay() : Collector
  • setDestinationOverride() : GGLT
  • setEGU() : _Attr, Gattr
  • setEnabledTabPage() : RunControlMain
  • setEvtCli() : rcTransitions
  • setEvtEnable() : GLCB
  • setFlag() : Gdb
  • setLastSuiteScript() : rcTransitions
  • setLATpMode() : GNAT
  • setOn() : userAppLeaf
  • setPrefs() : rcTransitions
  • setRule() : _Attr, Gattr
  • setSessionVar() : rcTransitions, rcSuite
  • setStatus() : userAppTree
  • setSuite() : rcTransitions, rcSuite
  • setSuiteInstance() : rcTransitions, rcSuite
  • setTimeout() : ccsdsSocket, EvtCliIO
  • setTimeoutEnabled() : ccsdsSocket, EvtCliIO
  • setup() : rcTransitions
  • setupSchema() : BrowserImpl
  • setupSuite() : rcSuite
  • setWarning() : userAppLeaf
  • shut() : TrgMiniGLT, TrgGem, TrgAbstract, rcTrgMiniGLT, rcTrgGem, rcMiniGLTDefaultTrigger, rcGEMDefaultTrigger, BadGLTExample, BadGasuExample
  • shutdown() : TaskEngine, GUIbridge, AcdHWMultiplexer, EvtCliBT, Geb
  • size() : _Attr, Gattr
  • skipClicked() : singleEvtDisplayImpl
  • solicit() : TrgMiniGLT, TrgGem, TrgAbstract
  • solicited() : TrgConditionsValue, TrgConditions, rcMiniGLTSolicitedCondition, rcSolicitedCondition
  • source() : TrgDefaultPeriodicCondition, TrgPeriodicConditionAbstract, TrgGemPeriodicCondition
  • spawn() : TaskEngine
  • start() : DataDistributorPoll, AcdHWMultiplexer
  • startExcludeTime() : rcTransitions
  • startPlayback() : GNAT
  • startRun() : rcTransitions
  • stats() : TrgTriggerCounters, TrgTileCounters, TrgGemEventCounter, TrgGemCmdCounters, TrgGemCnoCounters, TrgGemTileCounters, TrgGemTriggerCounters, TrgEventCounter, TrgCnoCounters, TrgCmdCounters, AcdHWMultiplexer
  • statusString() : standardTestReport
  • stop() : DataDistributorPoll, AcdHWMultiplexer, rcTransitions
  • stopClicked() : singleEvtDisplayImpl
  • stopRun() : rcTransitions
  • stopSuite() : rcSuite
  • strip() : TKRcontributionIterator_
  • subsystem() : Grule, Gconstraint
  • sweepOnShut() : rcTrgMiniGLT, rcTrgGem, rcMiniGLTDefaultTrigger, rcGEMDefaultTrigger
  • synch() : DataExport
  • synchronize() : GOCS
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- t -

  • tack() : TrgMiniGLTRegisters, TrgMiniGLTAbstract
  • tag() : TrgMiniGLTRegisters, TrgMiniGLTAbstract
  • takeSnapshot() : rcTransitions
  • TCCcnt() : GTEM
  • teardown() : rcTransitions
  • TEMcnt() : GLAT
  • templateRegister() : TrgGemRegisters
  • tile() : MyRoi, AddableRoi, TrgTileEnables, TrgRoi, rcTrgTileEnables, NullRoi, NoTilesEnabled
  • tileCounters() : TrgGemAbstract, TrgGem
  • tileEnableRegister() : TrgGemRegisters
  • tileList() : AcdHWMultiplexer
  • tiles() : TrgInputEnables
  • timebase() : TrgPPSTimer, TrgGemPPSTimer
  • timedout() : HskHandler
  • tkr() : TrgConditionsValue, TrgConditions
  • TKRcomponent() : myLATcomponentIterator
  • tower() : TrgTowers, TrgTowerBusyEnables, rcTrgTowerBusyEnables, NoTowersBusy
  • towerBusy() : TrgInputEnables
  • towerBusyEnableRegister() : TrgGemRegisters
  • towerEnableRegister() : TrgGemRegisters
  • towers() : TrgTowerEnables, TrgInputEnables, NoInputsEnabled
  • tracker() : TrgTower, NullTower
  • transformToFile() : rcTestReport
  • trigger() : rcTransitions
  • triggerCounters() : TrgGemAbstract, TrgGem
  • triggerInputsUpdate() : userAppLeaf
  • triggerParityEven() : TrgGemRegisters, TrgGemAbstract
  • triggersDisabled() : GGLT
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- u -

  • units() : GEGU
  • unpack() : EvtCliIO
  • unregisterAction() : Grule
  • unselect_family() : userAppLeaf
  • up() : Gdb
  • updatePWarning() : userAppLeaf
  • use() : TrgTracker, NullTkr
  • useAcdAsTrigger() : TrgUsingTiles, TrgGemAbstract, rcGEMDefaultTrigger, SimpleGasuExample
  • useHighEnergy() : TrgCalorimeter, NullCal
  • useLowEnergy() : TrgCalorimeter, NullCal
  • userMethod() : testArchiver
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- v -

  • value() : MiniGLTTrgConditionsValue, TrgConditionsValue
  • verifyVersion() : GOCS
  • version() : TrgGem, TrgAbstract
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members - Functions

- w -

  • waitForMaskEnable() : rcTrgMiniGLT, rcTrgGem, GGLT
  • width() : TrgGemRegisters, TrgGemAbstract
  • widthRegister() : TrgGemRegisters
  • write() : PythonShellWidget, CommentEntryWidget, RegisterInterface
  • writeFIFO() : GNAT
  • writeFIFO32() : GNAT
  • writelines() : PythonShellWidget, CommentEntryWidget
  • writeTestInformation() : standardTestReport
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gAEM.py Source File

database

gAEM.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "GLAST ACD functional block hierarchy"
00013 __author__  = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = ("$Date: 2005/12/21 01:07:55 $").split(' ')[1]
00015 __version__ = "$Revision: 2.17 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__ = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import time
00022 import gDb
00023 import gAttr
00024 import LATTE.client.gRegister as gRegister
00025 import LATTE.client.gException as gException
00026
00027 class GAEM(gDb.Gdb):
00028   """\brief ACD Common Controller.
00029
00030   Has GAEM specific registers and dataless commands.
00031
00032   Valid Registers:
00033   - \c configuration
00034   - \c common_status
00035   - \c freeboard_status
00036   - \c command_response
00037   - \c trgseq
00038   - \c power_status
00039   - \c address
00040   - \c timeout
00041   - \c relocation
00042   - \c response_timeout
00043   - \c power_up
00044   - \c power_down
00045   - \c trigger_statistics
00046
00047   Dataless Commands:
00048   - \c cmd_reset
00049
00050   """
00051   __attrs = [
00052     gAttr.GattrReg('configuration',       0, 4),
00053     gAttr.GattrReg('common_status',       1, 4),
00054     gAttr.GattrReg('freeboard_status',    2, 4),
00055     gAttr.GattrReg('command_response',    3, 4),
00056     gAttr.GattrReg('trgseq',              4, 4),
00057     gAttr.GattrReg('power_status',        5, 4),
00058     gAttr.GattrReg('address',             6, 4),
00059     gAttr.GattrReg('timeout',             7, 4),
00060     gAttr.GattrReg('relocation',          8, 4),
00061     gAttr.GattrReg('response_timeout',    9, 4),
00062     gAttr.GattrReg('power_up',           10, 4),
00063     gAttr.GattrReg('power_down',         11, 4),
00064     gAttr.GattrReg('trigger_statistics', 12, 4),
00065     gAttr.GattrDlc('cmd_reset',           1, 0),
00066     ]
00067
00068   def __init__(self, client, parent):
00069     """\brief Initialize valid registers as Gattrs.
00070
00071     Assign default values to members
00072     """
00073     self.ARC = gDb.Children(self, GARC)
00074     self.AEQ = None
00075     flags = {'CmdrspFabric'    : 'On',
00076              'EventFabric'     : 'On',
00077              'UsePdu1'         : False,
00078              'UseRedundantConv': False}
00079     gDb.Gdb.__init__(self, client, parent, 0, self.__attrs, None, flags)
00080
00081   def read(self, reg):
00082     return self.cmdrsp('AEM_read', gDb.Lem.ADDR_AEM, reg, '!I')
00083
00084   def load(self, reg, value):
00085     return self.cmdrsp('AEM_load', gDb.Lem.ADDR_AEM, reg, value)
00086
00087   def send(self, cmd):
00088     return self.cmdrsp('AEM_cmd', gDb.Lem.ADDR_AEM, cmd)
00089
00090   def downARC(self, arcId):
00091     """\brief Navigate to the GARC indicated by \a childId
00092
00093     \param  childId The id of the child GARC
00094
00095     \return         A GARC object instance
00096     """
00097     return self.ARC.down(arcId)
00098
00099   def allARC(self):
00100     """\brief Navigate to the broadcast GARC
00101
00102     \return The broadcast GARC object instance
00103     """
00104     return self.ARC.all()
00105
00106   def existsARC(self, arcId):
00107     """\brief Check if the GARC instance with the id
00108     \a arcId exists in the schema.
00109
00110     \param  arcId ACD readout controller id
00111
00112     \return       1 if it exists, 0 if it doesn't.
00113     """
00114     return self.ARC.exists(arcId)
00115
00116   def downAEQ(self):
00117     """\brief Navigate to the GAEQ
00118
00119     \return The GAEQ object instance
00120     """
00121     return self.AEQ
00122
00123   def existsAEQ(self):
00124     """\brief Check if the GAEQ instance exists in the schema.
00125
00126     \return  1 if it exists, 0 if it doesn't.
00127     """
00128     return self.AEQ != None
00129
00130 ## private:
00131   def __removeARC(self, arcId):
00132     self.ARC.remove(arcId)
00133
00134   def __addARC(self, arcId):
00135     return self.ARC.add(arcId)
00136
00137   def __removeAEQ(self):
00138     self.AEQ = None
00139
00140   def __addAEQ(self):
00141     self.AEQ = GAEQ(self.client(), self)
00142     return self.AEQ
00143
00144 class GAEQ(gDb.Gdb):
00145   """\brief ACD Environmental Monitors.
00146
00147   Has GAEQ specific registers and dataless commands.
00148
00149   Valid Registers:
00150   - \c env_free_1la
00151   - \c env_free_1rb
00152   - \c env_free_2la
00153   - \c env_free_2lb
00154   - \c env_free_2ra
00155   - \c env_free_2rb
00156   - \c env_free_3la
00157   - \c env_free_3rb
00158   - \c env_free_4la
00159   - \c env_free_4lb
00160   - \c env_free_4ra
00161   - \c env_free_4rb
00162   - \c env_daq
00163
00164     Pseudo registers:
00165   - \c env_vdd_xxx
00166   - \c env_temp_xxx
00167   - \c env_hv1_xxx
00168   - \c env_hv2_xxx
00169   - \c env_dac_digital_3_3i
00170   - \c env_dac_temp
00171   - \c env_dac_hv_i
00172   - \c env_dac_v
00173
00174   """
00175   __attrs = [
00176     # Registers
00177     gAttr.GattrReg('env_free_1la',       0, 8),
00178     gAttr.GattrReg('env_free_1rb',       1, 8),
00179     gAttr.GattrReg('env_free_2la',       2, 8),
00180     gAttr.GattrReg('env_free_2lb',       3, 8),
00181     gAttr.GattrReg('env_free_2ra',       4, 8),
00182     gAttr.GattrReg('env_free_2rb',       5, 8),
00183     gAttr.GattrReg('env_free_3la',       6, 8),
00184     gAttr.GattrReg('env_free_3rb',       7, 8),
00185     gAttr.GattrReg('env_free_4la',       8, 8),
00186     gAttr.GattrReg('env_free_4lb',       9, 8),
00187     gAttr.GattrReg('env_free_4ra',      10, 8),
00188     gAttr.GattrReg('env_free_4rb',      11, 8),
00189     gAttr.GattrReg('env_daq',           12, 8),
00190     ]
00191   __STALE_TMO = 1.0     # Timeout in seconds before considering adcs value stale
00192   __GAEQ_ENV_VDD_1LA = 20
00193   __ADCS_BASE = 20
00194
00195   i = __ADCS_BASE
00196   for env in ('1la','1rb','2la','2lb','2ra','2rb',
00197               '3la','3rb','4la','4lb','4ra','4rb'):
00198     __attrs.append(gAttr.GattrReg('env_vdd_'+env, i, 2))
00199     i+=1
00200     __attrs.append(gAttr.GattrReg('env_temp_'+env, i, 2))
00201     i+=1
00202     __attrs.append(gAttr.GattrReg('env_hv1_'+env, i, 2))
00203     i+=1
00204     __attrs.append(gAttr.GattrReg('env_hv2_'+env, i, 2))
00205     i+=1
00206   __attrs.append(gAttr.GattrReg('env_dac_digital_3_3i', 68, 2))
00207   __attrs.append(gAttr.GattrReg('env_dac_temp', 69, 2))
00208   __attrs.append(gAttr.GattrReg('env_dac_hv_i', 70, 2))
00209   __attrs.append(gAttr.GattrReg('env_dac_v', 71, 2))
00210
00211   def __init__(self, client, parent):
00212     """\brief Initialize valid registers as Gattrs.
00213
00214     Assign default values to members
00215     """
00216     self.__envs = 13*[(None, 0)]      # [gRegister.Register, time.time()]
00217     gDb.Gdb.__init__(self, client, parent, 0, self.__attrs)
00218
00219   def read(self, reg):
00220     if reg < GAEQ.__ADCS_BASE:
00221       rsp = self.cmdrsp('AEM_ENV_read', gDb.Lem.ADDR_AEM, reg, '!I', '!I')
00222       timestamp = rsp.timestamp()
00223       status    = rsp.status()
00224       payloads  = (rsp.payloads()[1], rsp.payloads()[0])
00225       return gRegister.Register(timestamp, status, payloads, 'II')
00226     else:
00227       return self.__fetchReg(reg)
00228
00229   def load(self, reg, value):
00230     return self.cmdrsp('AEM_ENV_load', gDb.Lem.ADDR_AEM, reg, value)
00231
00232   def __fetchReg(self, reg):
00233     mux   = (reg - GAEQ.__ADCS_BASE) / 4
00234     which = (reg - GAEQ.__ADCS_BASE) % 4
00235     now = time.time()
00236     (rsp, rt) = self.__envs[mux]
00237     if ((rsp is None) or (now - rt) > GAEQ.__STALE_TMO):
00238       rsp = self.cmdrsp('AEM_ENV_acquire', gDb.Lem.ADDR_AEM, mux, '!I', '!I')
00239       notready = (rsp.payloads()[0]>>31) & 1
00240       tmo = ((rsp.payloads()[0]>>28) & 1) | ((rsp.payloads()[0]>>12) & 1) |\
00241             ((rsp.payloads()[1]>>28) & 1) | ((rsp.payloads()[1]>>12) & 1)
00242       if notready:
00243         status = gException.LATInterfaceStatus.status('OCS_BDADC')
00244         raise gException.LATInterfaceException(status)
00245       if tmo:
00246         status = gException.LATInterfaceStatus.status('OCS_TMOADC')
00247         raise gException.LATInterfaceException(status)
00248       self.__envs[mux] = (rsp, now)
00249     timestamp = rsp.timestamp()
00250     status    = rsp.status()
00251     payload   = rsp.payloads()[0] << 32 | rsp.payloads()[1]
00252     value     = int((payload >> (16 * which)) & 0xfff)
00253     payloads  = [value]
00254     return gRegister.Register(timestamp, status, payloads, 'H')
00255
00256 class GARC(gDb.Gdb):
00257   """\brief ACD Readout Controller.
00258
00259   Has GARC specific registers and dataless commands.
00260
00261   Valid Registers:
00262   - function block 0
00263     - \c veto_delay
00264     - \c hvbs
00265     - \c saa
00266     - \c use_hv_normal
00267     - \c use_hv_saa
00268     - \c hold_delay
00269     - \c veto_width
00270     - \c hitmap_width
00271     - \c hitmap_deadtime
00272   - function block 1
00273     - \c look_at_me
00274     - \c hitmap_delay
00275     - \c pha_en_0
00276     - \c veto_en_0
00277     - \c hld_en_0
00278     - \c pha_en_1
00279     - \c veto_en_1
00280     - \c hld_en_1
00281     - \c max_pha
00282   - function block 2
00283     - \c mode
00284     - \c status
00285     - \c last_cmd
00286     - \c diagnostic
00287     - \c cmd_reject
00288     - \c free_id
00289     - \c garc_version
00290   - function block 3
00291     - \c pha_threshold_0
00292     - \c pha_threshold_1
00293     - \c pha_threshold_2
00294     - \c pha_threshold_3
00295     - \c pha_threshold_4
00296     - \c pha_threshold_5
00297     - \c pha_threshold_6
00298   - function block 4
00299     - \c pha_threshold_7
00300     - \c pha_threshold_8
00301     - \c pha_threshold_9
00302     - \c pha_threshold_10
00303     - \c pha_threshold_11
00304     - \c pha_threshold_12
00305     - \c pha_threshold_13
00306   - function block 5
00307     - \c pha_threshold_14
00308     - \c pha_threshold_15
00309     - \c pha_threshold_16
00310     - \c pha_threshold_17
00311     - \c adc_tacq
00312
00313   Dataless Commands
00314   - \c cmd_reset
00315   - \c cmd_calstrobe
00316   - \c cmd_set_hvbs
00317   - \c cmd_set_hvsaa
00318
00319   """
00320   __attrs = [
00321     # Registers
00322     # function block 0
00323     gAttr.GattrReg('veto_delay',         2, 2),
00324     gAttr.GattrReg('hvbs',               8, 2),
00325     gAttr.GattrReg('saa',                9, 2),
00326     gAttr.GattrReg('use_hv_normal',     10, 2),
00327     gAttr.GattrReg('use_hv_saa',        11, 2),
00328     gAttr.GattrReg('hold_delay',        12, 2),
00329     gAttr.GattrReg('veto_width',        13, 2),
00330     gAttr.GattrReg('hitmap_width',      14, 2),
00331     gAttr.GattrReg('hitmap_deadtime',   15, 2),
00332     # function block 1
00333     gAttr.GattrReg('look_at_me',        20, 2),
00334     gAttr.GattrReg('hitmap_delay',      24, 2),
00335     gAttr.GattrReg('pha_en_0',          25, 2),
00336     gAttr.GattrReg('veto_en_0',         26, 2),
00337     gAttr.GattrReg('pha_en_1',          28, 2),
00338     gAttr.GattrReg('veto_en_1',         29, 2),
00339     gAttr.GattrReg('max_pha',           31, 2),
00340     # function block 2
00341     gAttr.GattrReg('mode',              40, 2),
00342     gAttr.GattrReg('status',            41, 2),
00343     gAttr.GattrReg('last_cmd',          42, 2),
00344     gAttr.GattrReg('diagnostic',        43, 2),
00345     gAttr.GattrReg('cmd_reject',        44, 2),
00346     gAttr.GattrReg('free_id',           45, 2),
00347     gAttr.GattrReg('garc_version',      46, 2),
00348     # function block 3
00349     gAttr.GattrReg('pha_threshold_0',   56, 2),
00350     gAttr.GattrReg('pha_threshold_1',   57, 2),
00351     gAttr.GattrReg('pha_threshold_2',   58, 2),
00352     gAttr.GattrReg('pha_threshold_3',   59, 2),
00353     gAttr.GattrReg('pha_threshold_4',   60, 2),
00354     gAttr.GattrReg('pha_threshold_5',   61, 2),
00355     gAttr.GattrReg('pha_threshold_6',   62, 2),
00356     # function block 4
00357     gAttr.GattrReg('pha_threshold_7',   72, 2),
00358     gAttr.GattrReg('pha_threshold_8',   73, 2),
00359     gAttr.GattrReg('pha_threshold_9',   74, 2),
00360     gAttr.GattrReg('pha_threshold_10',  75, 2),
00361     gAttr.GattrReg('pha_threshold_11',  76, 2),
00362     gAttr.GattrReg('pha_threshold_12',  77, 2),
00363     gAttr.GattrReg('pha_threshold_13',  78, 2),
00364     # function block 5
00365     gAttr.GattrReg('pha_threshold_14',  88, 2),
00366     gAttr.GattrReg('pha_threshold_15',  89, 2),
00367     gAttr.GattrReg('pha_threshold_16',  90, 2),
00368     gAttr.GattrReg('pha_threshold_17',  91, 2),
00369     gAttr.GattrReg('adc_tacq',          92, 2),
00370     # Dataless Commands
00371     gAttr.GattrDlc('cmd_reset',          1, 0),
00372     gAttr.GattrDlc('cmd_calstrobe',      3, 0),
00373     gAttr.GattrDlc('cmd_set_hvbs',      10, 0),
00374     gAttr.GattrDlc('cmd_set_hvsaa',     11, 0)
00375     ]
00376
00377   def __init__(self, client, parent, id):
00378     """\brief Initialize valid registers as Gattrs.
00379
00380     Assign default values to members
00381     """
00382     if id < gDb.Lem.NARCS:
00383       addr = id
00384     elif id == gDb.Children.BCASTID:
00385       addr = gDb.Lem.ARCBCAST
00386     else:
00387       raise KeyError("*** gAEM: GARC id %d is invalid" %(id))
00388     self.AFE = gDb.Children(self, GAFE)
00389     gDb.Gdb.__init__(self, client, parent, id, self.__attrs, addr)
00390
00391   def read(self, reg):
00392     return self.cmdrsp('ARC_read', gDb.Lem.ADDR_AEM, self.addr(), reg, '!I')
00393
00394   def load(self, reg, value):
00395     return self.cmdrsp('ARC_load', gDb.Lem.ADDR_AEM, self.addr(), reg, value)
00396
00397   def send(self, cmd):
00398     return self.cmdrsp('ARC_cmd', gDb.Lem.ADDR_AEM, self.addr(), cmd)
00399
00400   def downAFE(self, afeId):
00401     """\brief Navigate to the GAFE indicated by \a childId
00402
00403     \param  childId The id of the child GAFE
00404
00405     \return         A GAFE object instance
00406     """
00407     return self.AFE.down(afeId)
00408
00409   def allAFE(self):
00410     """\brief Navigate to the broadcast GAFE
00411
00412     \return The broadcast GAFE object instance
00413     """
00414     return self.AFE.all()
00415
00416   def existsAFE(self, afeId):
00417     """\brief Check if the GAFE instance with the id
00418     \a afeId exists in the schema.
00419
00420     \param  afeId ACD readout controller id
00421
00422     \return       1 if it exists, 0 if it doesn't.
00423     """
00424     return self.AFE.exists(afeId)
00425
00426 ## private:
00427   def __removeAFE(self, afeId):
00428     self.AFE.remove(afeId)
00429
00430   def __addAFE(self, afeId):
00431     return self.AFE.add(afeId)
00432
00433
00434 class GAFE(gDb.Gdb):
00435   """\brief ACD Front-End Controller.
00436
00437   Has GAFE specific registers and dataless commands.
00438
00439   Valid Registers:
00440   - \c configuration
00441   - \c veto_dac
00442   - \c hld_dac
00443   - \c veto_vernier
00444   - \c bias_dac
00445   - \c tci_dac
00446   - \c vers_addr
00447   - \c write_ctr
00448   - \c reject_ctr
00449   - \c loop_ctr
00450   - \c chip_addr
00451
00452   """
00453   __attrs = [
00454     # Registers
00455     gAttr.GattrReg('configuration',  0, 2),
00456     gAttr.GattrReg('veto_dac',       1, 2),
00457     gAttr.GattrReg('veto_vernier',   2, 2),
00458     gAttr.GattrReg('hld_dac',        3, 2),
00459     gAttr.GattrReg('bias_dac',       4, 2),
00460     gAttr.GattrReg('tci_dac',        5, 2),
00461     gAttr.GattrReg('vers_addr',      6, 2),
00462     gAttr.GattrReg('write_ctr',      7, 2),
00463     gAttr.GattrReg('reject_ctr',     8, 2),
00464     gAttr.GattrReg('loop_ctr',       9, 2),
00465     gAttr.GattrReg('chip_addr',     10, 2)
00466     ]
00467
00468   def __init__(self, client, parent, id):
00469     """\brief Initialize valid registers as Gattrs.
00470
00471     """
00472     if id < gDb.Lem.NAFES:
00473       addr = id
00474     elif id == gDb.Children.BCASTID:
00475       addr = gDb.Lem.AFEBCAST
00476     else:
00477       raise KeyError("*** gAEM: GAFE id %d is invalid" %(id))
00478     gDb.Gdb.__init__(self, client, parent, id, self.__attrs, addr)
00479
00480   def read(self, reg):
00481     return self.cmdrsp('AFE_read', gDb.Lem.ADDR_AEM, self.up().addr(), self.addr(), reg, '!I')
00482
00483   def load(self, reg, value):
00484     return self.cmdrsp('AFE_load', gDb.Lem.ADDR_AEM, self.up().addr(), self.addr(), reg, value)
00485
00486   def send(self, cmd):
00487     return self.cmdrsp('AFE_cmd', gDb.Lem.ADDR_AEM, self.up().addr(), self.addr(), cmd)
00488
Generated on Fri Jul 21 13:26:27 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gAlert.py Source File

tools

gAlert.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT alert email tool"
00012 __author__   = "Jim Panetta <panetta@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "09/03/2004"
00014 __version__  = "$Revision: 1.5 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 # Python imports
00020 import logging
00021 import re
00022 import time
00023
00024 # LATTE imports
00025 import LATTE.tools.MailAlert as MailAlert
00026
00027 # set up logging
00028 logging.addLevelName(60, 'ALERT')
00029 logging.ALERT = 60
00030
00031 # add alert severity levels
00032 YELLOWALERT  = 10
00033 REDALERT     = 30
00034 alertDict = { YELLOWALERT:"Minor", REDALERT:"Major"}
00035
00036 def alert(message, system, severity=YELLOWALERT, machine=0):
00037
00038   alertStr = gAlertStr()
00039
00040   logging.log(logging.ALERT, alertStr.encode(severity, time.time(), system, message, machine))
00041
00042
00043 class gAlertHandler(object):
00044   def __init__(self):
00045     pass
00046
00047   def handle(self, alertStr):
00048     """ Method to handle an alert
00049     \param alertStr  a gAlertStr object
00050     """
00051     raise NotImplementedError, "call to abstract base class gAlertHandler::handle()"
00052
00053 class gAlertMailer(gAlertHandler):
00054   def __init__(self, recipient):
00055     gAlertHandler.__init__(self)
00056     self.__recipient = recipient
00057     self.__sender    = "glast@slac.stanford.edu"  # add text for glast alarm acct <...>
00058     self.__smtp      = MailAlert.SLACmail()
00059
00060   def handle(self, alertStr):
00061     (severity, timestamp, machine, system, message) = alertStr.decode()
00062
00063     # construct email object
00064     subject = "[LAT] %s %s %s HOST:%d" % \
00065               ( system, alertDict[severity], time.asctime(time.gmtime(timestamp)), machine )
00066     eml = gAlertMail(self.__recipient, subject, message)
00067     # print "sending email to %s, subj=%s, msg=%s" % (self.__recipient, subject, message)
00068     self.__smtp.sendMail(eml)
00069
00070 class gAlertStr(object):
00071   """Parser/unparser/container for alert strings
00072   """
00073   def __init__(self, alertStr=None):
00074     self.__alertFmt = "%04d-%f-%d-%s-%s"
00075     self.__alertRe  = re.compile("(\d\d\d\d)-([\d\.]+)-([\d]+)-([^-]+)-(.*)")
00076     self.__string   = alertStr
00077
00078   def encode(self, severity, timestamp, system, message, machine=0):
00079     """Method to encode an alert string for dispatch to the message logger
00080     \param severity   Severity level (YELLOWALERT or REDALERT)
00081     \param time       Time alert was sent
00082     \param system     System alert was sent from
00083     \param message    Alert message
00084     \param machine    Machine ID alert is sent from
00085     """
00086     self.__string = self.__alertFmt % (severity, timestamp, machine, system, message)
00087     return self.__string
00088
00089   def decode(self, string=None):
00090     """Method to decode an alert string dispatched to the message logger
00091     \return  (severity, time, system, message)
00092     """
00093     if string==None:
00094       string = self.__string
00095     dec = self.__alertRe.split(string)
00096     # print string, dec
00097     severity   = int(dec[1])
00098     timestamp  = float(dec[2])
00099     machine    = int(dec[3])
00100     system     = str(dec[4])
00101     message    = str(dec[5])
00102     return (severity, timestamp, machine, system, message)
00103
00104
00105 class gAlertMail(MailAlert.Email):
00106   def __init__(self, recip, subject, message):
00107     MailAlert.Email.__init__(self)
00108     self.sender("glast@slac.stanford.edu")  # add text for glast alarm acct <...>
00109     self.recipient(recip)
00110     self.body("Subject: %s " % subject + "\r\n" + message)
00111
00112
00113 class gAlertRegistry(object):
00114   """Alert registry class
00115   """
00116   def __init__(self):
00117     self.__handlers     = []
00118     self.__dispatchMap  = {"ALL":[]}
00119     pass
00120
00121   def register(self, system, handler):
00122     """register method
00123     \param handler
00124     \param system
00125     """
00126     if handler not in self.__handlers:
00127       self.__handlers.append(handler)
00128     system = system.upper()
00129     if system not in self.__dispatchMap.keys():
00130       self.__dispatchMap[system] = []
00131     self.__dispatchMap[system].append(handler)
00132
00133   def unregister(self, handler, categories):
00134     pass
00135
00136   def handle(self, alertStr):
00137     (severity, timestamp, machine, system, message) = alertStr.decode()  # just to get system
00138
00139     system = system.upper()
00140     # if system not in self.__dispatchMap.keys():
00141       # print "system \'%s\' not in keys" % system, self.__dispatchMap.keys()
00142       # raise KeyError
00143
00144     # deal with "ALL" and appending handlers
00145     handleList = self.__dispatchMap["ALL"]
00146     if system in self.__dispatchMap.keys():
00147       for handler in self.__dispatchMap[system]:
00148         if handler not in handleList:
00149           handleList.append(handler)
00150
00151     for handler in handleList:
00152       handler.handle(alertStr)
00153
00154
00155 if __name__ == "__main__":
00156
00157   # create handlers
00158   h1 = gAlertMailer("panetta@slac.stanford.edu")
00159   # h1 = gAlertMailer("claus@slac.stanford.edu")
00160   h2 = gAlertMailer("6508499455@myairmail.com")
00161
00162   h1set = ['CAL', 'LATTE', 'HSK']
00163   h1list = []
00164   for s in h1set:
00165     h1list.append("%8s"%s)
00166
00167   registry = gAlertRegistry()
00168   # registry.register(h1, h1list)
00169   registry.register(h1, h1list)
00170
00171   alertStr = gAlertStr()
00172   alertStr.encode(YELLOWALERT, time.time(), "LATTE", "Ah, I just figured out how to set a subject", 0)
00173
00174   registry.handle(alertStr)
00175
00176
00177 #EOF
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gAttr.py Source File

database

gAttr.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 ## \namespace gAttr
00012 ##
00013 ## \brief GLAST LAT record attribute definitions.
00014 ##
00015 ## \b Contents:
00016 ##
00017 ## GLAST LAT functional block hierarchy representation in Python
00018 ## See <a href="http://www-glast.slac.stanford.edu/IntegrationTest/ONLINE/docs/TEM.pdf">
00019 ## The Tower Electronics Module (TEM) - Programming ICD specification (LAT-TD-00605-D1)</a>
00020 ## for more info
00021
00022 __facility__ = "Online"
00023 __abstract__ = "GLAST LAT record attribute definitions"
00024 __author__   = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00025 __date__     = ("$Date: 2005/08/02 21:08:49 $").split(' ')[1]
00026
00027 __version__  = "$Revision: 2.17 $"
00028 __release__ = "$Name: R04-12-00 $"
00029 __credits__  = "SLAC"
00030
00031 import LATTE.copyright_SLAC
00032
00033 from LATTE.client.gException import LATInterfaceException
00034
00035 from gRule       import GruleBase
00036 from gConstraint import GconstraintBase
00037 from gEGU        import GEGU
00038
00039 import                  warnings
00040
00041 ATTR_READ             = 0x1
00042 ATTR_WRITE            = 0x2
00043 ATTR_READ_ONLY        = ATTR_READ
00044 ATTR_WRITE_ONLY       = ATTR_WRITE
00045 ATTR_READ_WRITE       = ATTR_READ | ATTR_WRITE
00046 ATTR_NO_DIRECT_ACCESS = 0x4
00047 ATTR_COMMAND          = 0x8 | ATTR_WRITE
00048 ATTR_DEPRECATED       = 0x10
00049
00050 # The following is for backward compatibility only
00051 REG_READ_ONLY        = ATTR_READ_ONLY
00052 REG_WRITE_ONLY       = ATTR_WRITE_ONLY
00053 REG_READ_WRITE       = ATTR_READ_WRITE
00054 REG_NO_DIRECT_ACCESS = ATTR_NO_DIRECT_ACCESS
00055
00056
00057
00058 class Gattr(object):
00059   """\brief Base class which is instantiated once for each attribute kind.
00060   """
00061   # Set up a single instance of the defaults rather than one per Gattr
00062   defaultRule       = GruleBase()
00063   defaultConstraint = GconstraintBase()
00064   defaultEgu        = GEGU("")
00065
00066
00067   def __init__(self, name, id, size, flags, rule=None, constraint=None, egu=None):
00068     """Gattr constructor.
00069
00070     \param name        The name of the attribute.
00071     \param size        Attribute size in bytes.
00072     \param rule        Optional. Attribute rule.
00073     \param constraint  Optional. Attribute constraint.
00074     \param egu         Optional. Attribute EGU
00075     """
00076     self.__name       = name.lower()
00077     self.__id         = id
00078     self.__size       = size
00079     self.__flags      = flags
00080
00081     self.__rule       = rule
00082     self.__constraint = constraint
00083     self.__egu        = egu
00084
00085   def create(self, node):
00086     return _Attr(node, self, self.__egu)
00087
00088   def set(self, node, value, attr, bypass=0):
00089     raise Exception, "Missing set() implementation"      # Revisit status
00090
00091   def get(self, node, attr, bypass=0):
00092     raise Exception, "Missing get() implementation"      # Revisit status
00093
00094   def getName(self):
00095     return self.__name
00096
00097   def size(self):
00098     """Method for returning the size of the attribute
00099
00100     \return Attribute size in bytes
00101     """
00102     return self.__size
00103
00104   def id(self):
00105     return self.__id
00106
00107   def setRule(self, rule):
00108     """Method to attach a rule to a gAttr after the gAttr has been constructed.
00109
00110     \param rule A Grule object instance
00111     """
00112     self.__rule = rule
00113
00114   def getRule(self):
00115     """Retrieve the rule associated with the gAttr.
00116     """
00117     return self.__rule
00118
00119   def setConstraint(self, constraint):
00120     """
00121     Method to attach a constraint to a gAttr after the gAttr has been constructed.
00122     This method will go away once constraints are loaded from a configuration file.
00123
00124     \param constraint A Gconstraint object instance
00125     """
00126     self.__constraint = constraint
00127
00128   def setEGU(self, egu):
00129     """
00130     Method to attach a EGU to a gAttr after the gAttr has been constructed.
00131
00132     \param egu A Gegu object instance
00133     """
00134     self.__egu = egu
00135
00136   def getEGU(self):
00137     """
00138     Method that returns the gEGU.GEGU class for this gAttr
00139
00140     \return A Gegu object instance
00141     """
00142     return self.__egu
00143
00144   def getConstraint(self):
00145     """
00146     Method that returns the gConstraint.Gconstraint class for this gAttr
00147
00148     \return A Gconstraint object instance
00149     """
00150     return self.__constraint
00151
00152   def flags(self):
00153     return self.__flags
00154
00155   def isReadOnly(self):
00156     """ Returns a boolean value indicating if the attribute is read only or not
00157
00158     \return 1=Read Only, 0=Not Read Only.
00159     """
00160     return self.__flags == ATTR_READ
00161
00162   def isWriteOnly(self):
00163     """ Returns a boolean value indicating if the attribute is write only or not
00164
00165     \return 1=Write Only, 0=Not Write Only.
00166     """
00167     return self.__flags == ATTR_WRITE
00168
00169   def isReadWrite(self):
00170     """ Returns a boolean value indicating if the attribute is read write or not
00171
00172     \return 1=Read Write, 0=Not Read Write.
00173     """
00174     return self.__flags == ATTR_READ_WRITE
00175
00176   def isNoDirectAccess(self):
00177     """ Returns a boolean value indicating if the attribute is no direct access or not
00178
00179     \return 1=No Direct Access, 0=Not No Direct Access.
00180     """
00181     return self.__flags == ATTR_NO_DIRECT_ACCESS
00182
00183   def isCommand(self):
00184     """Returns a boolean value indicating if the attribute is a dataless command or not
00185
00186     \return 1=Dataless command, 0=Not a dataless command.
00187     """
00188     return self.__flags & ATTR_COMMAND == ATTR_COMMAND
00189
00190   def isDeprecated(self):
00191     """Returns a boolean value indicating if the attribute is deprecated or not
00192
00193     \return 1=Deprecated, 0=Not deprecated.
00194     """
00195     return self.__flags & ATTR_DEPRECATED == ATTR_DEPRECATED
00196
00197
00198 class GattrRaw(Gattr):
00199   """\brief Class which is instantiated for each raw register kind
00200   """
00201   def __init__(self, name, regno, size, flags=ATTR_READ_WRITE):
00202     """GattrRaw constructor
00203
00204     \param name        The name of the register
00205     \param regno       Register no.
00206     \param size        Register size in bytes.
00207
00208     """
00209     Gattr.__init__(self, name, regno, size, flags)
00210
00211   def set(self, node, val, attr, bypass=0):
00212     """
00213     Method for setting the value of a register attribute.
00214     Calls the functions in the base class for setting values.
00215
00216     \param val    Register value to be set
00217     \param bypass Optional. Flag for bypassing EGU conversion
00218
00219     """
00220     response = node.load(self.id(), val)
00221     status = response.status()
00222     if status & 0x3:  raise LATInterfaceException(status)
00223     return None, response.timestamp()
00224
00225   def get(self, node, attr, bypass=0):
00226     """
00227     Method for getting the value of a register attribute.
00228     Calls the functions in the node class for getting values.
00229     If bypass=0 (the default), the value will be returned in EU.
00230     If bypass=1, the raw value will be returned.
00231     """
00232     response = node.read(self.id())
00233     status = response.status()
00234     if status & 0x3:  raise LATInterfaceException(status)
00235
00236     return response.value(), response.timestamp()
00237
00238
00239 class GattrReg(Gattr):
00240   """\brief Class which is instantiated for each register
00241   """
00242   def __init__(self, name, regno, size, flags=ATTR_READ_WRITE,
00243                rule=Gattr.defaultRule, constraint=Gattr.defaultConstraint, egu=Gattr.defaultEgu):
00244     """GattrReg constructor
00245
00246     \param name        The name of the register
00247     \param regno       Register no.
00248     \param size        Register size in bytes.
00249     \param rule        Optional. Register rule.
00250     \param constraint  Optional. Register constraint.
00251     \param egu         Optional. Register EGU
00252
00253     """
00254     Gattr.__init__(self, name, regno, size, flags, rule, constraint, egu)
00255
00256   def set(self, node, val, attr, bypass=0):
00257     """\brief Method for setting the value of a register attribute.
00258
00259     Calls the functions in the base class for setting values.
00260
00261     \param node   Node this register belongs to
00262     \param val    Register value to be set
00263     \param attr   _Attr instance
00264     \param bypass Optional. Flag for bypassing EGU conversion
00265
00266     """
00267     if bypass:
00268       raw = val
00269     else:
00270       (val, rejected) = self._Gattr__constraint.evaluate(val)
00271       if rejected:
00272         return None, None
00273       raw = attr.getEGU().raw(val)
00274
00275     response = node.load(self.id(), raw)
00276     status = response.status()
00277     if status & 0x3:  raise LATInterfaceException(status)
00278     return None, response.timestamp()
00279
00280   def get(self, node, attr, bypass=0):
00281     """\brief Method for getting the value of a register attribute.
00282     Calls the functions in the node class for getting values.
00283
00284     \param node   Node this register belongs to
00285     \param attr   _Attr instance
00286     \param bypass Optional. Flag for bypassing EGU conversion
00287                   bypass=0 (the default), the value will be returned in EU.
00288                   bypass=1, the raw value will be returned.
00289
00290     \return Register value.
00291
00292     """
00293     response = node.read(self.id())
00294     status = response.status()
00295     if status & 0x3:  raise LATInterfaceException(status)
00296
00297     raw = response.value()
00298     if bypass:
00299       return raw, response.timestamp()
00300     else:
00301       egu = attr.getEGU().egu(raw)
00302       self._Gattr__rule.evaluate(egu, self, node)
00303       return egu, response.timestamp()
00304
00305 class GattrRegDepr(GattrReg):
00306   def __init__(self, name, regno, size, flags=ATTR_DEPRECATED|ATTR_READ_WRITE,
00307                rule=Gattr.defaultRule, constraint=Gattr.defaultConstraint, egu=Gattr.defaultEgu):
00308     GattrReg.__init__(self, name, regno, size, flags, rule, constraint, egu)
00309
00310   def set(self, node, val, attr, bypass=0):
00311     """
00312     Method for setting the value of a register attribute.
00313     Calls the functions in the base class for setting values.
00314
00315     \param val    Register value to be set
00316     \param bypass Optional. Flag for bypassing EGU conversion
00317
00318     """
00319     warnings.warn("GattrReg.set: Attribute %s.%s deprecated. Please use the new attribute name"
00320                   % (node.getName(), self.getName())
00321                   , DeprecationWarning, stacklevel=2)
00322     return GattrReg.set(self, node, val, attr, bypass)
00323
00324   def get(self, node, attr, bypass=0):
00325     """
00326     Method for getting the value of a register attribute.
00327     Calls the functions in the node class for getting values.
00328     If bypass=0 (the default), the value will be returned in EU.
00329     If bypass=1, the raw value will be returned.
00330     """
00331
00332     warnings.warn("GattrReg.get: Attribute %s.%s deprecated. Please use the new attribute name"
00333                   % (node.getName(), self.getName())
00334                   , DeprecationWarning, stacklevel=2)
00335
00336     return GattrReg.get(self, node, bypass)
00337
00338 class GattrDlc(Gattr):
00339   """Attribute class for implementing dataless commands"""
00340   def __init__(self, name, cmdNo, size=0, flags=ATTR_COMMAND):
00341     Gattr.__init__(self, name, cmdNo, 0, flags)
00342     self.get = self.set
00343
00344   def set(self, node, *args):
00345     """
00346     Method for invoking a dataless command.
00347     The value parameter is meaningless for this method and is only supplied to
00348     satisfy the function signature.
00349     """
00350     response = node.send(self.id())
00351     status = response.status()
00352     if status & 0x3:  raise LATInterfaceException(status)
00353     return None, response.timestamp()
00354
00355 class GattrBF(Gattr):
00356   """\brief Bit field class which is instantiated for each bit field kind
00357
00358   This class allows operation on bit fields of the form (end, start]
00359   in a register specified by the register number (regno).
00360
00361   N.B. This attribute operates on the raw value of the associated register
00362   """
00363   def __init__(self, name, regno, start, end, flags=ATTR_READ_WRITE):
00364     """GattrBF constructor
00365
00366     \param name        The name of the bit field
00367     \param regno       Register no. containing the bit field
00368     \param start       Bit offset to start (inclusive) of the bit field
00369     \param end         Bit offset to the end (exclusive) of the bit field
00370     \param flags       Optional flags to govern access to the bit field
00371
00372     """
00373     Gattr.__init__(self, name, regno, 0, flags)
00374
00375     if end <= start:
00376       raise Exception, "Invalid bit field specification: start %d, end %d" % (start, end) # Revisit
00377     self.__offset = start
00378     self.__mask   = long(2**(end - start) - 1) << start
00379
00380     # Find the size of the bitfield in bytes. Required by the register browser -ST
00381     (d,m) = divmod(end-start,8)
00382     self._Gattr__size = d + (m>0)
00383
00384   def set(self, node, val, attr, bypass=0):
00385     """
00386     Method for setting the value of a bit field.
00387     Calls the functions in the base class for setting values.
00388
00389     \param val    bit field value to be set
00390     \param bypass ignored
00391
00392     """
00393
00394     response = node.read(self.id())
00395     status = response.status()
00396     if status & 0x3:  raise LATInterfaceException(status)
00397
00398     value = ((response.value() & ~self.__mask) |
00399              ((long(val) << self.__offset) & self.__mask))
00400
00401     response = node.load(self.id(), value)
00402     status = response.status()
00403     if status & 0x3:  raise LATInterfaceException(status)
00404     return None, response.timestamp()
00405
00406   def get(self, node, attr, bypass=0):
00407     """
00408     Method for getting the value of a bit field.
00409
00410     \param val    bit field value to be set
00411     \param bypass ignored
00412     """
00413     response = node.read(self.id())
00414     status = response.status()
00415     if status & 0x3:  raise LATInterfaceException(status)
00416
00417     value = (response.value() & self.__mask) >> self.__offset
00418
00419     return value, response.timestamp()
00420
00421 class _Attr(object):
00422   """Helper class for private use in this file only.
00423   """
00424
00425
00426   def __init__(self, node, attr, egu):
00427     #print node.getName(), attr
00428     self.__node = node
00429     self.__attr = attr
00430
00431     self.__timestamp = -1L
00432
00433     #print id(self), id(attr), node.getName(), attr.getName(), attr.flags()
00434     if attr.flags() == (ATTR_READ | ATTR_NO_DIRECT_ACCESS):
00435       self.set = self.__badSet
00436       self.get = self.__badGet
00437     else:
00438       self.set = self.__set
00439       self.get = self.__get
00440
00441     if egu is not None and egu is not Gattr.defaultEgu:
00442       self.setEGU(egu)
00443
00444     # Callthroughs to 'parent' class
00445
00446 # This callthrough is only in effect if the _Attr__egu is not instantiated
00447 #    getEGU           = Gattr.getEGU
00448
00449 #    setRule          = Gattr.setRule
00450 #    setConstraint    = Gattr.setConstraint
00451 #    getRule          = Gattr.getRule
00452 #    getConstraint    = Gattr.getConstraint
00453 #    getName          = Gattr.getName
00454
00455 #    id               = Gattr.id
00456 #    size             = Gattr.size
00457 #    isReadOnly       = Gattr.isReadOnly
00458 #    isWriteOnly      = Gattr.isWriteOnly
00459 #    isReadWrite      = Gattr.isReadWrite
00460 #    isNoDirectAccess = Gattr.isNoDirectAccess
00461 #    isCommand        = Gattr.isCommand
00462
00463
00464   def getName(self):
00465     return self.__attr.getName()
00466
00467   def size(self):
00468     """Method for returning the size of the attribute
00469
00470     \return Attribute size in bytes
00471     """
00472     return self.__attr.size()
00473
00474   def id(self):
00475     return self.__attr.id()
00476
00477   def setRule(self, rule):
00478     """Method to attach a rule to a gAttr after the gAttr has been constructed.
00479
00480     \param rule A Grule object instance
00481     """
00482     return self.__attr.setRule(rule)
00483
00484   def getRule(self):
00485     """Retrieve the rule associated with the gAttr.
00486     """
00487     return self.__attr.getRule()
00488
00489   def setConstraint(self, constraint):
00490     """
00491     Method to attach a constraint to a gAttr after the gAttr has been constructed.
00492     This method will go away once constraints are loaded from a configuration file.
00493
00494     \param constraint A Gconstraint object instance
00495     """
00496     return self.__attr.setConstraint(constraint)
00497
00498   def setEGU(self, egu):
00499     """
00500     Method to attach a EGU to a gAttr after the gAttr has been constructed.
00501
00502     \param egu A Gegu object instance
00503     """
00504     self.__egu = egu
00505
00506   def getEGU(self):
00507     """
00508     Method that returns the gEGU.GEGU class for this gAttr
00509
00510     \return A Gegu object instance
00511     """
00512     return getattr(self, '_Attr__egu', self.__attr.getEGU())
00513
00514   def getConstraint(self):
00515     """
00516     Method that returns the gConstraint.Gconstraint class for this gAttr
00517
00518     \return A Gconstraint object instance
00519     """
00520     return self.__attr.getConstraint()
00521
00522   def flags(self):
00523     return self.__attr.flags()
00524
00525   def isReadOnly(self):
00526     """ Returns a boolean value indicating if the attribute is read only or not
00527
00528     \return 1=Read Only, 0=Not Read Only.
00529     """
00530     return self.__attr.isReadOnly()
00531
00532   def isWriteOnly(self):
00533     """ Returns a boolean value indicating if the attribute is write only or not
00534
00535     \return 1=Write Only, 0=Not Write Only.
00536     """
00537     return self.__attr.isWriteOnly()
00538
00539   def isReadWrite(self):
00540     """ Returns a boolean value indicating if the attribute is read write or not
00541
00542     \return 1=Read Write, 0=Not Read Write.
00543     """
00544     return self.__attr.isReadWrite()
00545
00546   def isNoDirectAccess(self):
00547     """ Returns a boolean value indicating if the attribute is no direct access or not
00548
00549     \return 1=No Direct Access, 0=Not No Direct Access.
00550     """
00551     return self.__attr.isNoDirectAccess()
00552
00553   def isCommand(self):
00554     """Returns a boolean value indicating if the attribute is a dataless command or not
00555
00556     \return 1=Dataless command, 0=Not a dataless command.
00557     """
00558     return self.__attr.isCommand()
00559
00560   def isDeprecated(self):
00561     """Returns a boolean value indicating if the attribute is deprecated or not
00562
00563     \return 1=Deprecated, 0=Not deprecated.
00564     """
00565     return self.__attr.isDeprecated()
00566
00567   def __set(self, val, bypass=0, node=None):
00568     if node is not None:
00569       junk, self.__timestamp = self.__attr.set(node, val, self, bypass)
00570     else:                             # For backward compatibility
00571       junk, self.__timestamp = self.__attr.set(self.__node, val, self, bypass)
00572
00573   def __get(self, bypass=0, node=None):
00574     if node is not None:
00575       val, self.__timestamp = self.__attr.get(node, self, bypass)
00576     else:                             # For backward compatibility
00577       val, self.__timestamp = self.__attr.get(self.__node, self, bypass)
00578     return val
00579
00580   def __badSet(self, node, val, bypass=0):
00581     return -1                         # revisit
00582     #raise LATInterfaceException(1)
00583
00584   def __badGet(self, node, val, bypass=0):
00585     return -1                         # revisit
00586     #raise LATInterfaceException(1)
00587
00588   def getNode(self):
00589     return self.__node
00590
00591   def setTimeStamp(self, value):
00592     self.__timestamp = value
00593
00594   def getTimeStamp(self):
00595     """
00596     Method that returns the timestamp at the moment when the register was accessed.
00597
00598     \return Timestamp in seconds as a floating point value
00599     """
00600     if self.__timestamp == -1:
00601       return self.__timestamp
00602     else:
00603       return ((self.__timestamp >> 32) +
00604               (self.__timestamp & 0xffffffffL) / 1000000000.0)
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gBits.py Source File

client

gBits.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Bit field utility methods"
00013 __author__   = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/12/09 02:08:39 $").split(' ')[1]
00015 __version__  = "$Revision: 2.5 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import sys
00022 import string
00023 import inspect
00024 import struct
00025
00026 class bf(object):
00027   def __init__(self,value=0L):
00028     self._d = long(value)
00029
00030   def set(self, value):
00031     self._d = long(value)
00032
00033   def __getitem__(self, index):
00034     return (self._d >> index) & 1
00035
00036   def __setitem__(self,index,value):
00037     value    = (value&1L)<<index
00038     mask     = 1L<<index
00039     self._d  = (self._d & ~mask) | value
00040
00041   def __getslice__(self, start, end):
00042     mask = 2**(end - start) -1
00043     return (self._d >> start) & mask
00044
00045   def __setslice__(self, start, end, value):
00046     mask = 2**(end - start) -1
00047     value = (long(value) & mask) << start
00048     mask = mask << start
00049     self._d = (self._d & ~mask) | value
00050     return (self._d >> start) & mask
00051
00052   def getOnBits(self):
00053     value = self._d
00054     i = 0
00055     bits = []
00056     while value != 0:
00057       bit = value & 1L
00058       if bit: bits.append(i)
00059       value = value >> 1
00060       i+=1
00061     return bits
00062
00063   def __int__(self):
00064     return self._d
00065
00066   def __str__(self):
00067     return str(self._d)
00068
00069 class BitField(object):
00070   def __init__(self, ui, bf_def):
00071     self.bf_ui = bf(ui)
00072     self.bf_def = bf_def
00073
00074   def set(self, ui):
00075     self.bf_ui.set(ui)
00076
00077   def __setattr__(self, attribute, val):
00078     if attribute == 'ui':
00079       self.__dict__['bf_ui'] = bf(val)
00080       return
00081     elif attribute in ('bf_ui', 'bf_def'):
00082       self.__dict__[attribute] = val
00083       return
00084     else:
00085       for (bitField, fromBit, toBit) in self.bf_def:
00086         if attribute.lower() == bitField:
00087           self.bf_ui[fromBit:toBit] = val
00088           return
00089     self.__dict__[attribute] = val
00090
00091   def __getattr__(self, attribute):
00092     if attribute == 'ui':
00093       return int(self.__dict__['bf_ui'])
00094     elif attribute in ('bf_ui', 'bf_def'):
00095       return self.__dict__[attribute]
00096     else:
00097       for (bitField, fromBit, toBit) in self.bf_def:
00098         if attribute == bitField:
00099           return self.bf_ui[fromBit:toBit]
00100     return self.__dict__[attribute]
00101
00102   def __int__(self):
00103     return int(self.__dict__['bf_ui'])
00104
00105   def __str__(self):
00106     return str(self.__dict__['bf_ui'])
00107
00108
00109 def hexConvert(s, size=1, outPutStyle="0x%s "):
00110   """
00111   Convert binary string s
00112   to a hex format
00113
00114   Keyword arguments:
00115
00116   'size'        -- How large should each hex value be
00117
00118   'outPutStyle' -- How should each value be formatted
00119   """
00120   res=[]
00121   while s:
00122       temp=s[:size]
00123       s=s[size:]
00124       l=[]
00125       for i in temp:
00126           l.append("%02x"%ord(i))
00127       val=string.join(l,'')
00128       res.append(outPutStyle%val)
00129   return string.join(res,'')
00130
00131 def lhex(x, size=8):
00132   xs = string.lower(hex(x))
00133   l = len(xs)
00134   if xs[l-1] == "l":
00135     xs = xs[2:l-1]
00136   else:
00137     xs = xs[2:l]
00138   l = len(xs)
00139   xs = '0'*(size-l) + xs
00140   return xs
00141
00142 def q(cond,on_true,on_false):
00143   if cond:
00144     if not inspect.isfunction(on_true):
00145       return on_true
00146     else:
00147       return apply(on_true)
00148   else:
00149     if not inspect.isfunction(on_false):
00150       return on_false
00151     else:
00152       return apply(on_false)
00153
00154 def dump_cells(data):
00155   fmt = '!%dI' %(len(data) >> 2)
00156   words = struct.unpack(fmt, data)
00157   counter = 0
00158   for word in words:
00159     if ((counter%4) == 0): print '\n  ',
00160     print '0x%08x' %(word),
00161     counter += 1
00162   print
00163
00164 def population(mask):
00165   n = 0
00166   while (mask != 0):
00167     n = n+1
00168     mask = mask & (mask-1)
00169   return n
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gCmdCli.py Source File

client

gCmdCli.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Command handler client"
00013 __author__   = "Amedeo Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2005/07/11 17:07:08 $").split(' ')[1]
00015 __version__  = "$Revision: 2.7 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020 import logging as log
00021 import struct
00022
00023 import gCommand
00024 import gResponse
00025 import gSocket
00026 import gException
00027
00028 class CmdCli(gSocket.Socket):
00029   PortNumber = 2000
00030
00031   def __init__(self, handler=None, debug=0, port=PortNumber):
00032     gSocket.Socket.__init__(self, port)
00033     self.__handler = handler
00034     self.cmdrsp = None
00035     self.setDebug(debug)
00036
00037   def setDebug(self, debug):
00038     if debug == 0:
00039       self.cmdrsp = self.__cmdrsp
00040     else:
00041       self.cmdrsp = self.__cmdrsp_debug
00042
00043   def getDebug(self):
00044     return self.cmdrsp == self.__cmdrsp_debug
00045
00046   def handler(self, newhandler):
00047     self.__handler = newhandler
00048
00049   def __command_response(self, command):
00050     self.lock()
00051     try:
00052       self.send(command)
00053       result = self.recv(1024)
00054       (remaining,) = struct.unpack('!I', result[0:4])
00055       remaining = remaining+16-len(result)
00056       if remaining > 0:
00057         result += self.recvall(remaining)
00058       self.release()
00059     except:
00060       self.release()
00061       if self.__handler is not None:
00062         self.__handler.timedout()
00063       status = gException.LATInterfaceStatus.status('OCS_TMO')
00064       raise gException.LATInterfaceException(status)
00065     if len(result) == 0:
00066       if self.__handler is not None:
00067         self.__handler.disconnected()
00068       status = gException.LATInterfaceStatus.status('OCS_NOSRV')
00069       raise gException.LATInterfaceException(status)
00070     return result
00071
00072   def __cmdrsp(self, functionname, *arguments):
00073     command = gCommand.Command(functionname, *arguments)
00074     result = self.__command_response(command.packet())
00075     response = gResponse.Response(command, result)
00076     return response
00077
00078   def __cmdrsp_debug(self, functionname, *arguments):
00079     log.debug('%s calling: %s(%s)' %(__name__, functionname, arguments))
00080     command = gCommand.Command(functionname, *arguments)
00081     result = self.__command_response(command.packet())
00082     response = gResponse.Response(command, result)
00083     statusmsg = gException.LATInterfaceStatus(response.status())
00084     log.debug('%s returns: status: %s, value(s): %s' \
00085               %(__name__, statusmsg, response.payloads()))
00086     return response
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gCommand.py Source File

client

gCommand.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Commanding"
00013 __author__   = "Amedeo Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/09/11 00:52:01 $").split(' ')[1]
00015 __version__  = "$Revision: 2.3 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import struct
00022
00023 def packstring(arg, type):
00024   strlen = len(arg)
00025   strpad = 4-(strlen&0x3)
00026   fmt = '!HH%ds%dx' %(strlen, strpad)
00027   return struct.pack(fmt, strlen+strpad, type, arg)
00028
00029 class Command:
00030   __Function = 0
00031   __Handler  = 1
00032   __Payload  = 2
00033   __Value    = 3
00034   __Input    = 4
00035
00036   def __init__(self, functionname, *arguments):
00037     self.__packet = None
00038     self.__payloadfmts = []
00039
00040     cmd = packstring(functionname, Command.__Function)
00041     for arg in arguments:
00042       if isinstance(arg, str):
00043         if arg[0] == '!':
00044           cmd += packstring(arg[1:], Command.__Payload)
00045           self.__payloadfmts.append(arg[1:])
00046         elif arg[0] == '>':
00047           cmd += packstring(arg[1:], Command.__Input)
00048         else:
00049           cmd += packstring(arg, Command.__Handler)
00050       elif isinstance(arg, int) or isinstance(arg, long):
00051         cmd += struct.pack('!HHI', 4, Command.__Value, arg)
00052       else:
00053         raise Exception, "*** gCommand: cannot handle type %s" \
00054                         %(arg.__class__.__name__)
00055     self.__packet = struct.pack('!I', len(cmd)) + cmd
00056
00057   def packet(self):
00058     return self.__packet
00059
00060   def payloadfmts(self):
00061     return self.__payloadfmts
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gConstraint.py Source File

database

gConstraint.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Classes for defining constraints"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/03/20 00:58:14 $").split(' ')[1]
00014 __version__  = "$Revision: 2.3 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import exceptions
00020 import gGroup
00021
00022 True  = (0 < 1)
00023 False = not True
00024
00025 class gConstraintViolation(exceptions.Exception):
00026   """\brief Constraint Violation Class
00027
00028   Exception class used in constraint classes
00029   """
00030   def __init__(self, args=None):
00031     self.args = args
00032
00033
00034 class GconstraintBase(object):
00035   """\brief Base constraint class for use when no constraint is appropriate.
00036   """
00037   def __init__(self):
00038     pass
00039
00040   def evaluate(self, value):
00041     return (value, False)
00042
00043 class Gconstraint(GconstraintBase):
00044   """\brief Base class for describing constraints
00045   """
00046   def __init__(self, name, subsystem, category, enabled, continuous = False):
00047     """ Constructor.
00048       \param name       Constraint name
00049       \param subsystem  Subsystem gGroup to which the constraint belongs
00050       \param category   Category gGroup to which the constraint belongs
00051       \param enabled    Flag indicating whether constraint is enabled
00052       \param continuous Flag indicating whether constraint can fire repeatedly
00053     """
00054     self.__name       = name
00055     self.__subsystem  = subsystem
00056     self.__category   = category
00057     self.__enabled    = enabled
00058     self.__continuous = continuous
00059     self.__fired      = False
00060
00061   def _eval_(self, value):
00062     """Dummy evaluation method to be overridden through inheritance to implement
00063     the application specific constraint evaluation"""
00064     return (value, False)
00065
00066   def evaluate(self, value):
00067     """This method is called to evaluate the constraint on 'value'"""
00068     if self.__subsystem.enabled() and \
00069        self.__category.enabled()  and \
00070        self.__enabled:
00071       return self._eval_(value)
00072     else:
00073       return (value, False)
00074
00075   def name(self):
00076     """Method to retrieve the constraint's name"""
00077     return self.__name
00078
00079   def subsystem(self):
00080     """Method for discovering this constraint's subsystem"""
00081     return self.__subsystem
00082
00083   def category(self):
00084     """Method for discovering this constraint's category"""
00085     return self.__category
00086
00087   def enabled(self):
00088     """Method for discovering whether this constraint is enabled"""
00089     return self.__enabled
00090
00091   def enable(self):
00092     """Method used to enable evaluation of this constraint"""
00093     self.__enabled = True
00094
00095   def disable(self):
00096     """Method used to disable evaluation of this constraint"""
00097     self.__enabled = False
00098
00099   def reset(self):
00100     """Method used to reenable evaluation of this constraint in the case of
00101     noncontinuous mode after it has been violated"""
00102     self.__fired = False
00103
00104   def reject(self, message):
00105     """Method optionally used by the constraint evaluation implementation to
00106     signal a constraint violation"""
00107     if self.__continuous or not self.__fired:
00108       self.__fired = True
00109       raise gConstraintViolation, message
00110
00111
00112 class GconstraintLimitRE(Gconstraint):
00113   """\brief On Constraint Limit Raise Exception
00114
00115   Constraint class that determines whether to raise an exception
00116   based on the passed in value being within given limits.
00117   """
00118   def __init__(self, name, subsystem, category, enabled, continuous,
00119                low, high):
00120     Gconstraint.__init__(self, name, subsystem, category, enabled, continuous)
00121     self.__low  = low
00122     self.__high = high
00123
00124   def _eval_(self, value):
00125     if value < self.__low or value > self.__high:
00126       self.reject("%s constraint: value is driven out of range" % self._Gconstraint__name)
00127       return (value, True)
00128     return (value, False)
00129
00130
00131 class GconstraintLimit(Gconstraint):
00132   """\brief Limit Constraint
00133
00134   Constraint class that limits a passed in value to given limits.  If the
00135   value is outside of the constraint limits, it is pegged to the nearest limit.
00136   """
00137   def __init__(self, name, subsystem, category, enabled, continuous,
00138                low, high):
00139     Gconstraint.__init__(self, name, subsystem, category, enabled, continuous)
00140     self.__low  = low
00141     self.__high = high
00142
00143   def _eval_(self, value):
00144     if   value < self.__low:
00145       print "%s constraint: value is driven to the low constraint"  % self.name()
00146       return    (self.__low,  False)
00147     elif value > self.__high:
00148       print "%s constraint: value is driven to the high constraint" % self.name()
00149       return    (self.__high, False)
00150     else:
00151       return    (value,       False)
00152
00153 class GconstraintLimitPegRE(Gconstraint):
00154   """\brief Pegged Limit Constraint
00155
00156   Constraint class that limits a passed in value to given limits.  If the
00157   value is outside of the constraint limits, it raises an exception AND the
00158   value is pegged to the nearest limit.
00159   """
00160   def __init__(self, name, subsystem, category, enabled, continuous,
00161                low, high):
00162     Gconstraint.__init__(self, name, subsystem, category, enabled, continuous)
00163     self.__low  = low
00164     self.__high = high
00165
00166   def _eval_(self, value):
00167     if   value < self.__low:
00168       violMsg =  "Driven to low constraint"
00169       self.reject(violMsg)
00170       return    (self.__low,  True)
00171     elif value > self.__high:
00172       violMsg =  "Driven to high constraint"
00173       self.reject(violMsg)
00174       return    (self.__high, True)
00175     else:
00176       return    (value,       False)
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gCRU.py Source File

database

gCRU.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "GLAST CRU functional block"
00013 __author__  = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = ("$Date: 2005/03/15 19:42:43 $").split(' ')[1]
00015 __version__ = "$Revision: 2.8 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__ = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import gDb
00022 import gAttr
00023
00024 class GCRU(gDb.Gdb):
00025   """\brief CRU node.
00026
00027   Has GCRU specific registers and dataless commands.
00028
00029   Valid Registers:
00030   - \c configuration
00031   - \c command_enable
00032   - \c response_enable
00033   - \c cr_statistics
00034   - \c acd_startup_clock
00035   - \c test_io
00036
00037   Dataless Commands:
00038   - \c cmd_nop
00039   - \c cmd_reset
00040
00041   """
00042   __attrs = [
00043     # Registers
00044     gAttr.GattrRaw('configuration',        0, 4),
00045     gAttr.GattrRaw('command_enable',       1, 4),
00046     gAttr.GattrRaw('response_enable',      2, 4),
00047     gAttr.GattrRaw('cr_statistics',        3, 4),
00048     gAttr.GattrRaw('acd_startup_clock',    4, 4),
00049     gAttr.GattrRaw('test_io',              5, 4),
00050     # Dataless Commands
00051     gAttr.GattrDlc('cmd_nop',              0, 0),
00052     gAttr.GattrDlc('cmd_reset',            1, 0),
00053     ]
00054
00055   def __init__(self, client, parent):
00056     """\brief Initialize valid registers as Gattrs.
00057     """
00058     flags = { 'EnableInternal1PPS' : 0 }
00059     gDb.Gdb.__init__(self, client, parent, 0, self.__attrs, None, flags)
00060
00061   def read(self, reg):
00062     return self.cmdrsp('CRU_read', reg, '!I')
00063
00064   def load(self, reg, value):
00065     return self.cmdrsp('CRU_load', reg, value)
00066
00067   def send(self, cmd):
00068     return self.cmdrsp('CRU_cmd', cmd)
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gDb.py Source File

database

gDb.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "GLAST functional block base class"
00013 __author__  = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = ("$Date: 2006/07/17 18:25:20 $").split(' ')[1]
00015 __version__ = "$Revision: 2.23 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__ = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import gAttr
00022 from LATTE.client.gNode import Node
00023
00024 class Gdb(Node):
00025   """\brief Base class for all GLAST LAT functional blocks.
00026
00027      Uses __getattr__ and __setattr__ methods to feature an SCL like syntax
00028      for referencing attributes
00029   """
00030
00031   def __init__(self, client, parent, id, valid_attrs=[], addr=None, flags=None):
00032     """gNode constructor.
00033
00034     \param valid_regs A list of valid attribute names.
00035     """
00036     Node.__init__(self, client)
00037     self.__parent = parent
00038     self.__id = id
00039     if addr is None:
00040       self.__addr = id
00041     else:
00042       self.__addr = addr
00043
00044     attrDict = _regList()
00045     self.__dict__['regs'] = attrDict
00046
00047     #Instantiate all attributes
00048     for attr in valid_attrs:
00049       attrDict[attr.getName()] = attr.create(self)
00050
00051     self.__dict__['_Gdb__flags'] = flags
00052
00053   def up(self):
00054     """Return the parent of this component
00055     """
00056     return self.__parent
00057
00058   def id(self):
00059     """Return the hardware id of this component
00060     """
00061     return self.__id
00062
00063   def addr(self):
00064     """Return the hardware address of this component
00065     """
00066     return self.__addr
00067
00068   def root(self):
00069     """Return the root node in this node's hierarchy
00070
00071     \return The root node
00072     """
00073     root = self
00074     while root.up() is not None:
00075       root = root.up()
00076     return root
00077
00078   def getIdTuple(self):
00079     """Return the node id(s) in this node's hierarchy
00080
00081     \return The root node
00082     """
00083     idtuple = []
00084     root = self
00085     while root.up() is not None:
00086       idtuple.append(root.id())
00087       root = root.up()
00088     idtuple.reverse()
00089     return tuple(idtuple)
00090
00091   def getName(self):
00092     return self.__class__.__name__
00093
00094   def getOpaque(self, name=None):
00095     """\brief Retrieves the named opaque data included in the schema
00096     The opaque data needs to be associated with a node therefore this
00097     method only returns the opaque data that is associated with that
00098     node.
00099
00100     \param  name Name of the opaque XML data (optional)
00101
00102     \return      A list of XML DOM objects matching \a name
00103                  or if \a name is None a dictionary of a list
00104                  of XML DOM objects
00105     """
00106     root = self.root()
00107     rname = root.__class__.__name__
00108     rdict = root.__dict__
00109     opaque = rdict["_" + rname + '__opaque']
00110     if self in opaque:
00111       if name is None:
00112         return opaque[self]
00113       elif name in opaque[self]:
00114         return opaque[self][name]
00115
00116   def getSerialNos(self, component=None):
00117     """\brief Retrieves the serial numbers associated with the node
00118
00119     \param  component Hardware component identifier (optional)
00120
00121     \return           A dictionary matching \a component
00122                       or if \a component is None a dictionary of all
00123                       components and their serial numbers
00124     """
00125     root = self.root()
00126     rname = root.__class__.__name__
00127     rdict = root.__dict__
00128     serialnos = rdict["_" + rname + '__serialnos']
00129     if self in serialnos:
00130       if component is None:
00131         return serialnos[self]
00132       elif component in serialnos[self]:
00133         return {component: serialnos[self][component]}
00134
00135   def getExcludeFlags(self):
00136     """\brief Retrieves the exclude reasons associated with the node
00137
00138     \return A list of excludes that match the current node, if there
00139             are no excludes specified then an empty list is returned.
00140     """
00141     root = self.root()
00142     rname = root.__class__.__name__
00143     rdict = root.__dict__
00144     excludes = rdict["_" + rname + '__excludes']
00145     if self in excludes:
00146       return excludes[self]
00147     else:
00148       return []
00149
00150   def setFlag(self, key, value):
00151     """\brief Set generic flags for the node.
00152
00153     Flags are passed by gSchemaConfig when the <flags> section
00154     in the schema is parsed.
00155
00156     \param key Entry key, must already exists.
00157     \param value New value to be set for key.
00158     """
00159     if key in self.__flags:
00160       self.__flags[key] = value
00161     else:
00162       raise AttributeError("Attribute " + key + " not found")
00163
00164
00165   def getFlag(self, key, integer=False):
00166     """\brief Returns the value which corresponds to key.
00167
00168     Returns the value which corresponds to key.
00169
00170     \param key Entry key.
00171     \return Flag value corresponding to key.
00172     """
00173     if key in self.__flags:
00174       flag = self.__flags[key]
00175       if integer and isinstance(flag, str): return int(flag, 0)
00176       return flag
00177     else:
00178       raise AttributeError("Attribute " + key + " not found")
00179
00180   def attrIter(self):
00181     """\brief Iterator for attributes
00182
00183     Iterates over attribute objects belonging to the current
00184     node returning each object in the order that is specified
00185     in the node's __attrs member.
00186     """
00187     attrs = getattr(self, "_%s__attrs" % self.__class__.__name__)
00188     for attr in attrs:
00189       yield self.regs[attr.getName()]
00190
00191 ## private:
00192 #
00193 #  The following was an attempt to optimize access for mixed case attribute
00194 #  names.  Unfortunately we run into trouble with the tem.regs['configuration']
00195 #  type notation, and with constructs like 'for reg in regs' which returns
00196 #  the attribute in each casing.  We punt on it for now (Thu Aug 19 2004)
00197 #
00198 #   def __setattr__(self, attribute, value):
00199 #     attrDict = self.__dict__
00200 #     if attribute in attrDict:
00201 #       attrDict[attribute] = value
00202 #       return
00203 #     try:
00204 #       regs = attrDict['regs']
00205 #     except KeyError:
00206 #       attrDict[attribute] = value
00207 #       return
00208 #     try:
00209 #       regs[attribute].set(value, 0, self)
00210 #     except KeyError:
00211 #       try:
00212 #         attr = regs[attribute.lower()]
00213 #       except KeyError:
00214 #         raise AttributeError("Attribute " + attribute + " not found")
00215 #       regs[attribute] = attr
00216 #       attr.set(value, 0, self)
00217
00218 #   def __getattr__(self, attribute):
00219 #     attrDict = self.__dict__
00220 #     if attribute in attrDict:
00221 #       return attrDict[attribute]
00222 #     try:
00223 #       regs = attrDict['regs']
00224 #       return regs[attribute].get(0, self)
00225 #     except KeyError:
00226 #       try:
00227 #         attr = regs[attribute.lower()]
00228 #       except KeyError:
00229 #         raise AttributeError("Attribute " + attribute + " not found")
00230 #       regs[attribute] = attr
00231 #       return attr.get(0, self)
00232
00233   def __setattr__(self, attribute, value):
00234     """Gets called when a syntax like 'gtem.configuration = 5' is used"""
00235     attrDict = self.__dict__
00236     try:
00237       regs = attrDict['regs']
00238       if attribute in regs:
00239         regs[attribute].set(value, 0, self)
00240       elif attribute in attrDict:
00241         attrDict[attribute] = value
00242       else:
00243         raise AttributeError("Attribute " + attribute + " not found")
00244     except KeyError:
00245       if 'regs' not in attrDict:
00246         attrDict[attribute] = value
00247       else:
00248         raise AttributeError("Attribute " + attribute + " not found")
00249
00250   def __getattr__(self, attribute):
00251     """Gets called when a syntax like 'print gtem.configuration' is used"""
00252     try:
00253       return self.__dict__['regs'][attribute].get(0, self)
00254     except KeyError:
00255       raise AttributeError("Attribute " + attribute + " not found")
00256
00257 class _regList(dict):
00258   def __init__(self):
00259     dict.__init__(self)
00260
00261   def __getitem__(self, attribute):
00262     return dict.__getitem__(self, attribute.lower())
00263
00264   def __setitem__ (self, attribute, value):
00265     dict.__setitem__(self, attribute.lower(), value)
00266
00267   def get (self, attribute, default=None):
00268     return dict.get(self, attribute.lower(), default)
00269
00270   def has_key(self, attribute):
00271     return dict.has_key(self, attribute.lower())
00272
00273   def __contains__(self, attribute):
00274     return dict.__contains__(self, attribute.lower())
00275
00276 class Children(dict):
00277   BCASTID = 0xff
00278
00279   def __init__(self, parent, type):
00280     dict.__init__(self)
00281     self.__parent = parent
00282     self.__type = type
00283     self.__bcast = None
00284
00285   def remove(self, id):
00286     if id in self:
00287       self.__delitem__(id)
00288     elif id == Children.BCASTID:
00289       self.__bcast = None
00290     else:
00291       print "*** gDb: id %d not found for %s %d" %(id, self.__parent.getName(), self.__parent.id())
00292
00293   def add(self, id):
00294     if id == Children.BCASTID:
00295       if self.__bcast is not None:
00296         print "*** gDb: bcast %s already exists for %s %d" \
00297               %(self.__bcast.getName(),
00298                 self.__parent.getName(), self.__parent.id())
00299       else:
00300         self.__bcast = self.__type(self.__parent.client(), self.__parent, id)
00301         return self.__bcast
00302     elif id in self:
00303       print "*** gDb: child %s %d already exists for %s %d" \
00304             %(self[id].getName(), id,
00305               self.__parent.getName(), self.__parent.id())
00306     else:
00307       self[id] = self.__type(self.__parent.client(), self.__parent, id)
00308       return self[id]
00309
00310   def down(self, id):
00311     if id in self:
00312       return self[id]
00313     elif id == Children.BCASTID:
00314       return self.__bcast
00315     else:
00316       return None
00317
00318   def exists(self, id):
00319     if id in self:
00320       return True
00321     elif id == Children.BCASTID and self.__bcast is not None:
00322       return True
00323     return False
00324
00325   def all(self):
00326     return self.__bcast
00327
00328 class Lem(Node):
00329   ADDR_TEM_BASE  = 0x00
00330   ADDR_GEM       = 0x10
00331   ADDR_AEM       = 0x11
00332   ADDR_EBM       = 0x12
00333   ADDR_PDU_BASE  = 0x13
00334   ADDR_CRU       = 0x1E
00335   ADDR_SLV_BCAST = 0x1F
00336   ADDR_MASTER    = 0x20
00337
00338   NPDUS = 2
00339   NTEMS = 16
00340   NCCCS = 4
00341   NCRCS = 4
00342   NCFES = 12
00343   NTCCS = 8
00344   NTRCS = 9
00345   NTFES = 24
00346   NARCS = 12
00347   NAFES = 18
00348
00349   CCCBCAST = 0xFF
00350   CRCBCAST = 0xFF
00351   CFEBCAST = 0xFF
00352   TCCBCAST = 0xFF
00353   TRCBCAST = 0xFF
00354   TFEBCAST = 0xFF
00355   ARCBCAST = 0x1F
00356   AFEBCAST = 0x1F
00357
00358   GEM_CC   = 0
00359   GEM_TAM  = 1
00360   GEM_STAT = 2
00361   GEM_SCHD = 3
00362   GEM_ROI  = 4
00363   GEM_IE   = 5
00364   GEM_WIN  = 6
00365
00366   # Parity select
00367   PARITY_ODD   = 0
00368   PARITY_EVEN  = 1
00369
00370   # Parity type
00371   PARITY_CMD_STRING  = 0
00372   PARITY_CMD_PAYLOAD = 1
00373   PARITY_ACCESS_DESC = 2
00374
00375   def __init__(self, client):
00376     Node.__init__(self, client)
00377
00378   def setParity(self, parity_type, parity_select):
00379     return self.cmdrsp('LEM_set_parity', parity_type, parity_select)
00380
00381   def getParity(self, parity_type):
00382     rsp = self.cmdrsp('LEM_get_parity', parity_type)
00383     return rsp.status()
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: geb.py Source File

merger

geb.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2006
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Generic event builder"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "2/27/2006"
00014 __updated__  = ("$Date: 2006/07/19 16:06:44 $").split(' ')[1]
00015 __version__  = "$Revision: 1.2 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 from   Queue         import Queue
00022 from   threading     import Thread
00023 import time
00024 import struct
00025
00026 import LDF
00027
00028
00029 class GebContribution(object):
00030   def __init__(self, contributor):
00031     self.__contributor = contributor
00032
00033   def identity(self):
00034     """!\brief Method to return the identity (LDF TypeId) of a contribution to
00035     an event.  Meant to be overridden.
00036     """
00037     raise NotImplementedError, "identity() method must be implemented in a subclass"
00038
00039   def length(self):
00040     """!\brief Method to return the length of a contribution to an event.
00041     Meant to be overridden.
00042     """
00043     raise NotImplementedError, "sequence() method must be implemented in a subclass"
00044
00045   def sequence(self):
00046     """!\brief Method to return the sequence value of the contribution.
00047     Meant to be overridden.
00048
00049     This method must return a value for which the equality and greater
00050     than operators are defined.  The sequence values must be common
00051     amoungst all contributors such that a if a contribution's sequence
00052     value is equal to another contributions sequence value, the two
00053     contributions belong together as part of the same event.  A
00054     contribution A's sequence value that is greater than another
00055     contribution B's sequence value is interpreted to mean that A is
00056     newer than B.  This information is used to flush out partially
00057     built older events.
00058     """
00059     raise NotImplementedError, "sequence() method must be implemented in a subclass"
00060
00061   def contributor(self):
00062     return self.__contributor
00063
00064
00065 class GebContributor(Thread):
00066   # Set up one common blocking queue for all contributors
00067   __contributionQueue = Queue()
00068
00069   def __init__(self):
00070     Thread.__init__(self)
00071     self.setName(self.name())
00072
00073   def contributionQueue():
00074     """!\brief Method to get the common contribution queue.
00075
00076     \returns A Queue object
00077     """
00078     return GebContributor.__contributionQueue
00079
00080   contributionQueue = staticmethod(contributionQueue)
00081
00082   def read(self):
00083     """!\brief Method to read a contribution from somewhere.
00084     Meant to be overridden.
00085     """
00086     raise NotImplementedError, "read() method must be implemented in a subclass"
00087
00088   def name(self):
00089     """!\brief Method to return the name of the contribution type.
00090     Meant to be overridden.
00091     """
00092     raise NotImplementedError, "name() method must be implemented in a subclass"
00093
00094   def sequence(self, sequence):
00095     """!\brief Optional method for remapping the ancillary contribution's
00096     sequence number into the same space as the other contributions' sequence
00097     numbers.  If this method is not overridden, the supplied sequence number is
00098     returned.
00099     """
00100     return sequence
00101
00102   def open(self):
00103     """!\brief Method to open the contributor.
00104     Meant to be overridden.
00105     """
00106     raise NotImplementedError, "open() method must be implemented in a subclass"
00107
00108   def close(self):
00109     """!\brief Optional method to close the contributor.
00110     Meant to be overridden.
00111     """
00112     pass
00113
00114   def idMask(self, id = None):
00115     """!\brief Method for building the contributor mask
00116     """
00117     if id is not None:
00118       self.__idMask = id
00119     return self.__idMask
00120
00121   def run(self):
00122     """!\brief Loop that continuously reads from the data source
00123     """
00124     contributionQueue = self.__contributionQueue
00125     reason = None
00126     try:
00127       while reason != Geb.Terminate:
00128         reason, status, contribution = self.read()
00129         contributionQueue.put((reason, status, contribution))
00130
00131         # Allow other threads to run by forcing a reschedule
00132         time.sleep(0.0)
00133     except Exception, e:
00134       import logging
00135       logging.exception(self.name() + ": Trapped exception:\n" + str(e))
00136
00137     print self.name() + ": terminating"
00138     import logging
00139     logging.info(self.name() + ": terminating")
00140
00141
00142 class Geb(Thread):
00143   Build     = 0
00144   DontBuild = 1
00145   Terminate = 2
00146   Sweep     = 3
00147   def __init__(self, contributors):
00148     Thread.__init__(self)
00149     self.setName(self.name())
00150     self.__idMask = 0L
00151     idMask        = 0x1L
00152     for contributor in contributors:
00153       # Make sure that the contributors were inherited from GebContributor
00154       if not isinstance(contributor, GebContributor):
00155         raise TypeError, "Contributor must be a subclass of GebContributor"
00156       self.__idMask |= contributor.idMask(idMask)
00157       idMask <<= 1
00158     self.__contributors      = contributors
00159     self.__contributionQueue = GebContributor.contributionQueue()
00160     self.__contributionsDict = {}
00161
00162   def name(self):
00163     """!\brief Method to return the name of the event builder.
00164     May be overridden.
00165     """
00166     return "GEB"
00167
00168   def shutdown(self):
00169     """!\brief Method to shutdown the builder
00170     """
00171     # Shutdown the contributors
00172     for contributor in self.__contributors:
00173       contributor.close()
00174
00175   def run(self):
00176     """!\brief Method run by the Thread base class.  Use the start() method
00177     to start event building.
00178     """
00179     try:
00180       self.build()
00181     except Exception, e:
00182       import logging
00183       logging.exception(self.name() + ":\n" + str(e))
00184
00185   def build(self):
00186     """!\brief Call this method to start event building
00187     """
00188     contributionQueue = self.__contributionQueue
00189     contributionsDict = self.__contributionsDict
00190     contributors      = self.__contributors
00191     dTime             = 0.0
00192
00193     # Open the contributors
00194     for contributor in contributors:
00195       contributor.open()
00196
00197     # Start the contributor threads up
00198     for contributor in contributors:
00199       contributor.start()
00200
00201     reason, status, contribution = contributionQueue.get() # Blocks
00202     tStart = time.time()
00203
00204     n = 0
00205     while reason != Geb.Terminate:
00206       if reason == Geb.Build:
00207         contributor = contribution.contributor()
00208         sequence    = contribution.sequence()
00209         try:
00210           contributionsDict[sequence].append((status, contribution))
00211           contributionsDict[sequence][0] |= contributor.idMask()
00212         except KeyError: # i.e., sequence not in contributionsDict.keys():
00213           contributionsDict[sequence] = [contributor.idMask(), (status, contribution)]
00214
00215         if contributionsDict[sequence][0] == self.__idMask:
00216           self.__flush(sequence)
00217           self.__dispose(contributionsDict.pop(sequence)[1:])
00218           if n % 100 == 0:
00219             print "......Geb.build: seq %08x built and disposed" % (sequence)
00220           n += 1
00221       elif reason == Geb.Sweep:
00222         sequence = contribution.sequence()
00223         contributionsDict[sequence] = [self.__idMask, (status, contribution)]
00224
00225         self.__flush(sequence)
00226         self.__dispose(contributionsDict.pop(sequence)[1:])
00227         print "......Geb.build: seq %08x disposed (sweep)" % (sequence)
00228       else:
00229         print "......Geb.build: id %08x disposed" % (contribution.identity())
00230
00231         self.__dispose([(status, contribution)])
00232
00233       dTime += time.time() - tStart
00234       reason, status, contribution = contributionQueue.get() # Blocks
00235       tStart = time.time()
00236
00237     if n     == 0:  n     = 1.0e-99
00238     if dTime == 0:  dTime = 1.0e-99
00239     print "\nGeb.build: N = %d, T = %f, T/N = %f, N/T = %f" % \
00240           (n, dTime, dTime / n, float(n) / dTime)
00241
00242     # Close the contributors
00243     for contributor in contributors:
00244       contributor.close()    # Redundant - normally done by shutdown()
00245       contributor.join()     # Wait for the contributor threads to exit
00246
00247     # Let the subclass clean up and close
00248     self.close()
00249
00250     print "\nGeb.build: terminating\n"
00251     import logging
00252     logging.info("Geb.build: terminating")
00253
00254   def flushAll(self):
00255     """!\brief Method for flushing all stale events from the system.
00256     """
00257     contribsDict = self.__contributionsDict
00258     sequences    = contribsDict.keys()
00259     for staleSequence in sequences:
00260       contributions = contribsDict.pop(staleSequence)[1:]
00261       self.__dispose(contributions)
00262       ids = ""
00263       for status, contribution in contributions:
00264         ids += hex(contribution.identity()) + ", "
00265       import logging
00266       logging.warning("...Geb.flushAll: seq %08x flushed, ids = %s" % (staleSequence, ids))
00267
00268   def __flush(self, sequence):
00269     """!\brief Method for flushing stale events from the system.
00270
00271     Stale events are generally events that are missing contributions and will
00272     never be completed.  Since we require that events are disposed of in
00273     chronological order, incomplete events older than the most recently
00274     completed event are deemed stale.
00275
00276     \param sequence - The sequence number of the most recently completed event
00277     """
00278     contribsDict = self.__contributionsDict
00279     sequences    = contribsDict.keys()
00280     for staleSequence in sequences:
00281       if staleSequence < sequence:
00282         contributions = contribsDict.pop(staleSequence)[1:]
00283         self.__dispose(contributions)
00284         ids = ""
00285         for status, contribution in contributions:
00286           ids += hex(contribution.identity()) + ", "
00287         import logging
00288         logging.warning("......Geb.flush: seq %08x flushed, ids = %s" % (staleSequence, ids))
00289
00290   def __dispose(self, contributions):
00291     """!\brief Internal method to concatenate the contributions into a single
00292     event and call the subclass to dispose of it.
00293     """
00294     length   = 0
00295     buffer   = ''
00296     statuses = ()
00297     for status, contribution in contributions:
00298       statuses += (status,)
00299       length   += contribution.length()
00300       buffer   += str(contribution.buffer())
00301
00302     length += 8
00303     header  = struct.pack('>2L', LDF.LATdatagram.ID, length)
00304
00305     self.dispose((statuses, header + buffer))
00306
00307   def close(self):
00308     """!\brief Optional method to close down the derived class.
00309     Meant to be overridden.
00310     """
00311     return
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gEBM.py Source File

database

gEBM.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "GLAST EBM functional block"
00013 __author__  = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = ("$Date: 2005/03/05 03:30:23 $").split(' ')[1]
00015 __version__ = "$Revision: 2.10 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__ = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import gDb
00022 import gAttr
00023
00024 class GEBM(gDb.Gdb):
00025   """\brief GEBM node.
00026
00027   """
00028   __attrs = []
00029
00030   def __init__(self, client, parent):
00031     """\brief Initialize child objects.
00032
00033     """
00034     self.EBMC = None
00035     self.EBMST = None
00036     flags = {'CmdrspFabric': 'On'}
00037     gDb.Gdb.__init__(self, client, parent, 0, self.__attrs, None, flags)
00038
00039   def downEBMC(self):
00040     """\brief Navigate to the GEBMC node.
00041
00042     \return         The GEBMC object instance
00043     """
00044     return self.EBMC
00045
00046   def existsEBMC(self):
00047     """\brief Check if the GEBMC instance exists in the schema.
00048
00049     \return       1 if it exists, 0 if it doesn't.
00050     """
00051     return self.EBMC != None
00052
00053   def downEBMST(self):
00054     """\brief Navigate to the GEBMST node.
00055
00056     \return         The GEBMST object instance
00057     """
00058     return self.EBMST
00059
00060   def existsEBMST(self):
00061     """\brief Check if the GEBMS instance exists in the schema.
00062
00063     \return       1 if it exists, 0 if it doesn't.
00064     """
00065     return self.EBMST != None
00066
00067 ## private:
00068
00069   def __removeEBMC(self):
00070     self.EBMC = None
00071
00072   def __addEBMC(self):
00073     gebmc = GEBMC(self.client(), self)
00074     self.EBMC = gebmc
00075     return gebmc
00076
00077   def __removeEBMST(self):
00078     self.EBMST = None
00079
00080   def __addEBMST(self):
00081     gebmst = GEBMST(self.client(), self)
00082     self.EBMST = gebmst
00083     return gebmst
00084
00085
00086 class GEBMC(gDb.Gdb):
00087   """\brief EBM Controller node.
00088
00089   Has GEBMC specific registers.
00090
00091   Valid Registers:
00092   - \c back_end_config
00093   - \c front_end_a_config
00094   - \c front_end_b_config
00095   - \c address
00096   - \c sources
00097   - \c input_enables
00098   - \c output_enables
00099   - \c timeout
00100   - \c tem_statistics
00101   - \c cr_statistics
00102   - \c ssr_header
00103
00104   Dataless Commands:
00105   - \c cmd_nop
00106   - \c cmd_reset
00107
00108   """
00109   __attrs = [
00110     # Registers
00111     gAttr.GattrRaw('back_end_config',     0, 4),
00112     gAttr.GattrRaw('front_end_a_config',  1, 4),
00113     gAttr.GattrRaw('front_end_b_config',  2, 4),
00114     gAttr.GattrRaw('address',             3, 4),
00115     gAttr.GattrRaw('sources',             4, 4),
00116     gAttr.GattrRaw('input_enables',       5, 4),
00117     gAttr.GattrRaw('output_enables',      6, 4),
00118     gAttr.GattrRaw('timeout',             7, 4),
00119     gAttr.GattrRaw('tem_statistics',      8, 4),
00120     gAttr.GattrRaw('cr_statistics',       9, 4),
00121     gAttr.GattrRaw('ssr_header',         10, 4),
00122     # Dataless Commands
00123     gAttr.GattrDlc('cmd_nop',             0, 0),
00124     gAttr.GattrDlc('cmd_reset',           1, 0),
00125     ]
00126
00127   def __init__(self, client, parent):
00128     """\brief Initialize valid registers as Gattrs
00129     """
00130     gDb.Gdb.__init__(self, client, parent, 0, self.__attrs)
00131
00132   def read(self, reg):
00133     return self.cmdrsp('EBM_read', gDb.Lem.ADDR_EBM, reg, '!I')
00134
00135   def load(self, reg, value):
00136     return self.cmdrsp('EBM_load', gDb.Lem.ADDR_EBM, reg, value)
00137
00138   def send(self, cmd):
00139     return self.cmdrsp('EBM_cmd', gDb.Lem.ADDR_EBM, cmd)
00140
00141
00142 class GEBMST(gDb.Gdb):
00143   """\brief EBM Event Statistics node.
00144
00145   Has GEBMST specific registers.
00146
00147   Valid Registers:
00148   - \c receive_gem
00149   - \c receive_aem
00150   - \c receive_siu0
00151   - \c receive_siu1
00152   - \c receive_epu0
00153   - \c receive_epu1
00154   - \c receive_epu2
00155   - \c receive_siu2
00156   - \c receive_tem_mux0
00157   - \c receive_tem_mux1
00158   - \c transmit_siu0
00159   - \c transmit_siu1
00160   - \c transmit_epu0
00161   - \c transmit_epu1
00162   - \c transmit_epu2
00163   - \c transmit_siu2
00164   - \c transmit_ssr
00165
00166   Dataless Commands:
00167   - \c cmd_reset
00168
00169   """
00170   __attrs = [
00171     # Registers
00172     gAttr.GattrRaw('receive_gem',          0, 4),
00173     gAttr.GattrRaw('receive_aem',          1, 4),
00174     gAttr.GattrRaw('receive_siu0',         2, 4),
00175     gAttr.GattrRaw('receive_siu1',         3, 4),
00176     gAttr.GattrRaw('receive_epu0',         4, 4),
00177     gAttr.GattrRaw('receive_epu1',         5, 4),
00178     gAttr.GattrRaw('receive_epu2',         6, 4),
00179     gAttr.GattrRaw('receive_siu2',         7, 4),
00180     gAttr.GattrRaw('receive_tem_mux0',    16, 4),
00181     gAttr.GattrRaw('receive_tem_mux1',    17, 4),
00182     gAttr.GattrRaw('transmit_siu0',       32, 4),
00183     gAttr.GattrRaw('transmit_siu1',       33, 4),
00184     gAttr.GattrRaw('transmit_epu0',       34, 4),
00185     gAttr.GattrRaw('transmit_epu1',       35, 4),
00186     gAttr.GattrRaw('transmit_epu2',       36, 4),
00187     gAttr.GattrRaw('transmit_siu2',       37, 4),
00188     gAttr.GattrRaw('transmit_ssr',        38, 4),
00189     # Dataless Commands
00190     gAttr.GattrDlc('cmd_reset',            0, 0),
00191     ]
00192
00193   def __init__(self, client, parent):
00194     """\brief Initialize valid registers as Gattrs.
00195
00196     """
00197     gDb.Gdb.__init__(self, client, parent, 0, self.__attrs)
00198
00199   def read(self, reg):
00200     return self.cmdrsp('EBM_STAT_read', gDb.Lem.ADDR_EBM, reg, '!I')
00201
00202   def send(self, cmd):
00203     return self.cmdrsp('EBM_STAT_cmd', gDb.Lem.ADDR_EBM, cmd)
00204
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gEGU.py Source File

database

gEGU.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Classes for handling raw/engineering unit (EGU) oconversions"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/04/13 03:28:48 $").split(' ')[1]
00014 __version__  = "$Revision: 2.4 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019 from math import *
00020
00021
00022 class GEGU(object):
00023   """\brief Base class for raw/engineering unit conversions.
00024
00025   """
00026   def __init__(self, units):
00027     self.__units  = units
00028
00029   def egu(self, value):
00030     """Overloadable method for converting raw units to engineering units
00031
00032     \param value Value in raw units.
00033
00034     \return Engineering units value after the conversion.
00035
00036     """
00037     return value
00038
00039   def raw(self, value):
00040     """Overloadable method for converting engineering units to raw units
00041
00042     \param value Value in engineering units.
00043
00044     \return Raw value after the conversion.
00045
00046     """
00047     return value
00048
00049   def units(self):
00050     """Method for returning the units string
00051
00052     \return Units string value.
00053
00054     """
00055     return self.__units
00056
00057
00058 class GEGU_linear(GEGU):
00059   """\brief EGU class for performing linear conversions.
00060
00061   """
00062   def __init__(self, slope, intercept, units=""):
00063     """Initialize a raw/EGU linear conversion object.
00064
00065       \param slope     Number of engineering unit counts per raw value tick
00066       \param intercept Offset in units of the engineering unit
00067       \param units     The engineering units name, e.g. 'cm'
00068
00069     """
00070     assert slope, "GEGU_linear.__init__: slope argument cannot be zero"
00071     GEGU.__init__(self, units)
00072     self.__slope     = slope
00073     self.__intercept = intercept
00074
00075   def egu(self, rawValue):
00076     """Convert a value in raw units to engineering units
00077
00078     \param rawValue Value in raw units.
00079
00080     \return Engineering units value after the conversion.
00081
00082     """
00083
00084     # Compensate for some pseudo quantities (like PSD_TEM_0)
00085     # where the rawValue may be received as a large positive
00086     # value although it is negative.
00087     if rawValue >= (1 << 31L):
00088       rawValue = rawValue - (1 << 32L)
00089
00090     return rawValue * self.__slope + self.__intercept
00091
00092   def raw(self, eguValue):
00093     """Convert a value in engineering units to raw units
00094
00095     \param eguValue Value in engineering units.
00096
00097     \return Raw value after the conversion.
00098
00099     """
00100     return int(round((eguValue - self.__intercept) / self.__slope))
00101
00102 class GEGU_poly3(GEGU):
00103   """\brief EGU class for performing 3rd degree polynominal conversions.
00104
00105   """
00106   def __init__(self, coeff0, coeff1, coeff2, coeff3, offset, units=""):
00107     """Initialize a raw/EGU linear conversion object.
00108
00109     \param slope     Number of engineering unit counts per raw value tick
00110     \param intercept Offset in units of the engineering unit
00111     \param units     The engineering units name, e.g. 'cm'
00112
00113     """
00114 #    assert slope, "GEGU_linear.__init__: slope argument cannot be zero"
00115     GEGU.__init__(self, units)
00116     self.__coeff0 = coeff0
00117     self.__coeff1 = coeff1
00118     self.__coeff2 = coeff2
00119     self.__coeff3 = coeff3
00120     self.__offset = offset
00121
00122   def egu(self, rawValue):
00123     """Convert a value in raw units to engineering units
00124
00125     \param rawValue Value in raw units
00126
00127     \return Engineering units value after the conversion.
00128
00129     """
00130     return self.__coeff0 + self.__coeff1*(rawValue-self.__offset) + self.__coeff2*(rawValue-self.__offset)**2 + self.__coeff3*(rawValue-self.__offset)**3
00131
00132   def raw(self, eguValue):
00133     """Convert a value in engineering units to raw units
00134
00135     \param eguValue Value in engineering units.
00136
00137     \return Raw value after the conversion.
00138
00139     """
00140     return 0
00141
00142
00143 class GEGU_thermistor(GEGU):
00144   """\brief EGU class for performing thermistor conversions.
00145
00146      Actual equation is:  R = (C1 / Counts) + C0
00147
00148      Temp (deg C) = C2 * ln(R) + C3
00149
00150      Nominal C0 = - 1.020 E5
00151      Nominal C1 =   4.096 E8
00152
00153      Fitted from (-40,80 degree) thermistor data from YSI.  30K ohm column (http://www.ysi.com/extranet/TEMPKL.nsf/447554deba0f52f2852569f500696b21/617d4fec8189026885256a03005d500a/$FILE/R_vs_T%20449XX.xls)
00154      Fitted C2 = - 20.319
00155      Fitted C3 =  234.69
00156
00157
00158   """
00159   def __init__(self, coeff0, coeff1, coeff2, coeff3, units=""):
00160     """Initialize a raw/EGU conversion object.
00161
00162     \param coeff[0-3] One of the coefficients of the function.  See function doc
00163     \param units     The engineering units name, e.g. 'cm'
00164
00165     """
00166     GEGU.__init__(self, units)
00167     self.__coeff0 = coeff0
00168     self.__coeff1 = coeff1
00169     self.__coeff2 = coeff2
00170     self.__coeff3 = coeff3
00171
00172   def egu(self, rawValue):
00173     """Convert a value in raw units to engineering units
00174
00175     \param rawValue Value in raw units
00176
00177     \return Engineering units value after the conversion.
00178
00179     """
00180     if rawValue == 0:   # protect divide by zero
00181       rawValue = 1
00182     R = (self.__coeff1 / rawValue) + self.__coeff0
00183     T = (self.__coeff2 * log(R)) + self.__coeff3
00184     return T
00185
00186   def raw(self, eguValue):
00187     """Convert a value in engineering units to raw units
00188
00189     \param eguValue Value in engineering units.
00190
00191     \return Raw value after the conversion.
00192
00193     """
00194     return 0
00195
00196
00197 class GEGU_rtd(GEGU):
00198   """\brief EGU class for performing RTD (Resistive Temp Device) conversions.
00199
00200      Actual equation is:
00201
00202       C = ( R/(R+C0) - 1/(C2) ) * C1
00203
00204                   C0 (C C2 + C1)
00205       R =      - -----------------
00206                  C C2 - C1 C2 + C1
00207
00208       Temp = ( R + C4 ) / C5
00209
00210       Nominal C0 = 1820
00211       Nominal C1 = 4096  (Exact)
00212       Nominal C2 = 3
00213
00214       Fitted from +/- 100 degree data from 0118MF literature from Goodrich (manufacturer)
00215       Fitted C3  = - 1994.5
00216       Fitted C4  = 7.9051
00217
00218   """
00219   def __init__(self, coeff0, coeff1, coeff2, coeff3, coeff4, units=""):
00220     """Initialize a raw/EGU linear conversion object.
00221
00222     \param coeff[0-4] One of the coefficients of the function.  See function doc
00223     \param units     The engineering units name, e.g. 'cm'
00224
00225     """
00226     GEGU.__init__(self, units)
00227     self.__coeff0 = coeff0
00228     self.__coeff1 = coeff1
00229     self.__coeff2 = coeff2
00230     self.__coeff3 = coeff3
00231     self.__coeff4 = coeff4
00232
00233   def egu(self, rawValue):
00234     """Convert a value in raw units to engineering units
00235
00236     \param rawValue Value in raw units
00237
00238     \return Engineering units value after the conversion.
00239
00240     """
00241     R = - self.__coeff0 * \
00242           ( ((rawValue*self.__coeff2) + self.__coeff1) / \
00243             ((rawValue*self.__coeff2) + self.__coeff1*(1-self.__coeff2)) )
00244     T = ( R + self.__coeff3 ) / self.__coeff4
00245     return T
00246
00247   def raw(self, eguValue):
00248     """Convert a value in engineering units to raw units
00249
00250     \param eguValue Value in engineering units.
00251
00252     \return Raw value after the conversion.
00253
00254     """
00255     return 0
00256
00257
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gEPU.py Source File

database

gEPU.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Node which describes an Event Process Unit"
00013 __author__  = "A. Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = ("$Date: 2004/12/05 21:09:11 $").split(' ')[1]
00015 __version__ = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__ = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import gDb
00022
00023 class GEPU(gDb.Gdb):
00024   """\brief EPU node.
00025   """
00026   __attrs = []
00027
00028   def __init__(self, client, parent, id):
00029     """\brief Initialize valid registers as Gattrs.
00030     """
00031     addr = gDb.Lem.ADDR_MASTER | (id+4)
00032     flags = {'CmdrspFabric'    : 'On',
00033              'EventFabric'     : 'On',
00034              'UsePdu1'         : False,
00035              'UseRedundantConv': False}
00036     gDb.Gdb.__init__(self, client, parent, id, self.__attrs, addr, flags)
00037
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gEvtCli.py Source File

client

gEvtCli.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 ## \namespace evtCli
00011 ##
00012 ## \brief Event handler classes
00013 ##
00014 ##  Event objects:
00015 ##
00016 ##    The following list contains the objects populated during parsing.
00017 ##    Please refer to the individual classes to find out how to access
00018 ##    event data stored in these objects:
00019 ##
00020 ##    - CAL_LogAccepts   -- List of evCAL_LogAccepts
00021 ##
00022 ##    - CAL_LogData      -- List of evCAL_LayerLogData
00023 ##
00024 ##    - TKRstrips        -- List of evTKR_StripData
00025 ##
00026 ##    - TKRaccepts       -- List of int
00027 ##
00028 ##    - TKRtots          -- List of evTKR_TOTdata
00029 ##
00030 ##    - diag             -- evDiag_Data
00031 ##
00032 ##    - errSummary       -- evErr_Summary
00033 ##
00034 ##    - errGCCCmsg       -- List of evErr_GCCC_Message
00035 ##
00036 ##    - errGTCCmsg       -- List of evErr_GTCC_Message
00037 ##
00038 ##    - errCablePhase    -- evErr_CablePhase
00039 ##
00040 ##    - errCableTimeOut  -- evErr_CableTimeOut
00041 ##
00042 ##    - aem              -- AEM
00043 ##
00044 ##    - aem.PHA          -- Dictionary of evAEM_PHA indexed by cable number
00045 ##
00046 ##    - gem              -- GEM
00047 ##
00048 ##    - gem.vetoList     -- evGEM_Veto_List
00049
00050 __facility__ = "Online"
00051 __abstract__ = "Event handler client"
00052 __author__   = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST I&T/Online"
00053 __date__     = ("$Date: 2005/09/01 01:50:56 $").split(' ')[1]
00054 __version__  = "$Revision: 2.37 $"
00055 __release__  = "$Name: R04-12-00 $"
00056 __credits__  = "SLAC"
00057
00058 import LATTE.copyright_SLAC
00059
00060 import          sys
00061 import          struct
00062 import          select
00063 import          traceback
00064 import logging  as     log
00065 from string     import *
00066 from os         import *
00067 from time       import sleep, time, gmtime, asctime
00068 from operator   import isNumberType
00069 from math       import modf
00070
00071 from gLog import logStack, logException
00072 from gException import LATInterfaceStatus, LATInterfaceException
00073 from gBits import BitField, q, dump_cells
00074 from gSocket import Socket
00075 from gOpcode import Opcode
00076
00077
00078 N_GCCC =  4
00079 N_GCRC =  4
00080 N_GCFE = 12
00081
00082 N_GTCC =  8
00083 N_GTRC =  9
00084 N_GTFE = 24
00085
00086 N_GARC = 12
00087 N_GAFE = 18
00088
00089 GTCC_MAP     = [6, 3, 7, 2, 5, 0, 4, 1]
00090 GTCC_ERR_MAP = [3, 6, 2, 7, 0, 5, 1, 4]
00091
00092 GCCC_MAP = [0, 2, 3, 1]
00093
00094 # AEM class
00095 class AEM(object):
00096   """\brief AEM event object
00097
00098   Members:
00099   - \c vetoHitVectors
00100   - \c acceptHitVectors
00101   - \c PHA
00102
00103   """
00104   EV_AEM_VETO = 1
00105   EV_AEM_ZEROSUP = 2
00106
00107   def __init__(self):
00108     self.clearEvent()
00109
00110   def clearEvent(self):
00111     """\brief Initialize accept and veto hit vectors
00112
00113     """
00114     self.vetoHitVectors = [0]*N_GARC
00115     self.acceptHitVectors = [0]*N_GARC
00116     self.PHA = {}
00117     for cbl in range(N_GARC):
00118       self.PHA[cbl] = []
00119
00120   def addPHA(self, cbl, pha):
00121     """\brief Adds a PHA value.
00122
00123     Called from evDumpAEM_PHA
00124
00125     \param cbl Cable number
00126     \param pha 16 bit PHA value
00127     """
00128     self.PHA[cbl].append(pha)
00129
00130 class evAEM_PHA(BitField):
00131   """\brief PHA object
00132
00133   Bit Fields:
00134   - \c more
00135   - \c range
00136   - \c ADC
00137   - \c parityErr
00138
00139   """
00140   evAEM_PHA_BF =  [
00141                     ('more',         14, 15),
00142                     ('range',        13, 14),
00143                     ('ADC',           1, 13),
00144                     ('parityErr',     0,  1)
00145                   ]
00146   def __init__(self, ui):
00147     BitField.__init__(self, ui, self.evAEM_PHA_BF)
00148
00149 class GEM(object):
00150   """\brief GEM event object.
00151
00152   Members:
00153   - \c ROI_Vector
00154   - \c TKR_Vector
00155   - \c CAL_HE_Vector
00156   - \c CAL_LE_Vector
00157   - \c deadzone
00158   - \c conditions
00159   - \c CNO_Vector
00160   - \c vetoList
00161   - \c liveTime
00162   - \c prescaled
00163   - \c discarded
00164   - \c condArrivalTimes
00165   - \c triggerTime
00166   - \c onePPSTime
00167   - \c deltaOpenWindowTime
00168   - \c deltaEventTime
00169
00170   \deprecated
00171   - \c \b triggerSummary Use 'conditions' instead
00172   - \c \b sent           Use 'condArrivalTimes' instead
00173
00174   """
00175   def __init__(self):
00176     self.vetoList = evGEM_Veto_List()
00177     self.condArrivalTimes = evGEM_Cond_Arrival_Times(0)
00178     self.clear()
00179
00180   def clear(self):
00181     self.ROI_Vector = 0
00182     self.TKR_Vector = 0
00183     self.CAL_HE_Vector = 0
00184     self.CAL_LE_Vector = 0
00185     self.triggerSummary = 0 # Deprecated
00186     self.deadzone = 0
00187     self.conditions = 0
00188     self.CNO_Vector = 0
00189     self.vetoList.clear()
00190     self.liveTime = 0
00191     self.prescaled = 0
00192     self.discarded = 0
00193     self.sent = 0 # Deprecated
00194     self.condArrivalTimes.set(0)
00195     self.triggerTime = 0
00196     self.onePPSTime = 0
00197     self.deltaOpenWindowTime = 0
00198     self.deltaEventTime = 0
00199
00200 class evGEM_Veto_List(object):
00201   """\brief GEM Veto List object.
00202
00203   Members:
00204   - \c XZP
00205   - \c XZM
00206   - \c YZP
00207   - \c YZM
00208   - \c XY
00209   - \c NA
00210   - \c RBN
00211
00212   """
00213   def __init__(self):
00214     self.clear()
00215
00216   def clear(self):
00217     self.XZP = 0
00218     self.XZM = 0
00219     self.YZP = 0
00220     self.YZM = 0
00221     self.XY  = 0
00222     self.NA  = 0
00223     self.RBN = 0
00224
00225 class evGEM_Cond_Arrival_Times(BitField):
00226   """\brief GEM Condition Arrival Times bitfield.
00227
00228   Members:
00229   - \c External
00230   - \c CNO
00231   - \c CAL_HE
00232   - \c CAL_LE
00233   - \c TKR
00234   - \c ROI
00235
00236   """
00237   evGEM_Cond_Arrival_Times_BF =  [
00238                     ('External',     25, 30),
00239                     ('CNO',          20, 25),
00240                     ('CAL_HE',       15, 20),
00241                     ('CAL_LE',       10, 15),
00242                     ('TKR',           5, 10),
00243                     ('ROI',           0,  5)
00244                   ]
00245   def __init__(self, ui):
00246     BitField.__init__(self, ui, self.evGEM_Cond_Arrival_Times_BF)
00247
00248
00249 class Evt(object):
00250   """\brief Event object
00251
00252   Members:
00253   - \c aem
00254   - \c gem
00255   - \c contributor
00256   - \c summary
00257   - \c TKRstrips
00258   - \c TKRaccepts
00259   - \c TKRtots
00260   - \c CAL_LogAccepts
00261   - \c CAL_LogData
00262   - \c diag
00263   - \c errSummary
00264   - \c errGCCCmsg
00265   - \c errGTCCmsg
00266   - \c errCablePhase
00267   - \c errCableTimeOut
00268
00269   """
00270   def __init__(self):
00271     """\brief Event object constructor.
00272
00273     Instantiate the AEM object and clear the event.
00274     """
00275     self.aem = AEM()
00276 ## New Event Format
00277     self.gem = GEM()
00278 ##
00279     self.clearEvent()
00280
00281   def clearEvent(self):
00282     """\brief Clear the event data
00283
00284     """
00285     self.contributor = None
00286     self.summary = None
00287     self.TKRstrips = []
00288     self.TKRaccepts = []
00289     self.TKRtots = []
00290     self.CAL_LogAccepts = []
00291     self.CAL_LogData = []
00292     self.diag = None
00293     self.errSummary = None
00294     self.errGCCCmsg = []
00295     self.errGTCCmsg = []
00296     self.errCablePhase = None
00297     self.errCableTimeOut = None
00298
00299   def addTKRstrip(self, cc, rc, strip):
00300     """\brief Add a stripData to the tracker strip hit list of evTKR_StripData objects.
00301
00302     \param cc    Cable controller id
00303     \param rc    Readout controller id
00304     \param strip evTKR_Strip object instance
00305     """
00306     self.TKRstrips.append(evTKR_StripData(cc, rc, strip))
00307
00308   def addTKRaccept(self, accept):
00309     """\brief Add a TKR accept to the list
00310
00311     \param 9-bit TKR accept value
00312     """
00313     self.TKRaccepts.append(accept)
00314
00315   def addTKRtot(self, cc, rc, tot):
00316     """\brief Add a TKR tot to the list of evTKR_TOTdata objects.
00317
00318     \param cc    Cable controller id
00319     \param rc    Readout controller id
00320     \param tot   8-bit tot value
00321     """
00322     self.TKRtots.append(evTKR_TOTdata(cc, rc, tot))
00323
00324   def addCAL_LogAccept(self, accept):
00325     """\brief Add a log accept to the list
00326
00327     \param accept An evCAL_LogAccepts object instance
00328     """
00329     self.CAL_LogAccepts.append(accept)
00330
00331   def addCAL_LogData(self, twr, layer, data):
00332     """\brief Add a log data to the list
00333
00334     \param layer A layer id in the form of 'x1', 'y1', etc.
00335     \param data  An evCAL_LogData object instance
00336     """
00337     self.CAL_LogData.append(evCAL_LayerLogData(twr, layer, data))
00338
00339   def addErrGCCCmsg(self, errGCCC):
00340     """\brief Add a GCCC error contribution to the event object
00341
00342     \param errGCCC An evErr_GCCC object instance
00343     """
00344     self.errGCCCmsg.append(errGCCC)
00345
00346   def addErrGTCCmsg(self, errGTCCmsg):
00347     """\brief Add a GTCC error message to the event object
00348
00349     \param errGTCCmsg An evErr_GTCC_Message object instance
00350     """
00351     self.errGTCCmsg.append(errGTCCmsg)
00352
00353 class evErr_Summary(BitField):
00354   """\brief Error summary bitfields
00355
00356   Bit Fields:
00357   - \c cblTimeOut
00358   - \c cblPhsErr
00359   - \c gtccErr
00360   - \c gcccErr
00361
00362   """
00363   evErr_Summary_BF =  [
00364                         ('cblTimeOut',  13, 14),
00365                         ('cblPhsErr',   12, 13),
00366                         ('gtccErr',      4, 12),
00367                         ('gcccErr',      0,  4)
00368                       ]
00369   def __init__(self, ui):
00370     BitField.__init__(self, ui, self.evErr_Summary_BF)
00371
00372 class evSummary(BitField):
00373   """\brief Event summary bitfields
00374
00375   Bit Fields:
00376   - \c startbit
00377   - \c calStrobe
00378   - \c tag
00379   - \c TACK
00380   - \c readout4
00381   - \c zeroSuppress
00382   - \c marker
00383   - \c error
00384   - \c diag
00385   - \c evNumber
00386   - \c trgParityErr
00387
00388   """
00389   evSummary_BF =  [
00390                     ('startbit ',     31, 32),
00391                     ('calStrobe',     30, 31),
00392                     ('tag',           28, 30),
00393                     ('TACK',          27, 28),
00394                     ('readout4',      26, 27),
00395                     ('zeroSuppress',  25, 26),
00396                     ('marker',        22, 25),
00397                     ('error',         21, 22),
00398                     ('diag',          20, 21),
00399                     ('evNumber',       1, 16),
00400                     ('trgParityErr',   0,  1)
00401                   ]
00402   def __init__(self, ui):
00403     BitField.__init__(self, ui, self.evSummary_BF)
00404
00405 class evSummary_Singleton(evSummary):
00406   def __init__(self, ui):
00407     evSummary.__init__(self, ui)
00408
00409   def __call__(self, ui):
00410     self.set(ui)
00411     return self
00412
00413 class evContPacket(BitField):
00414   """\brief Contribution Packet bitfields
00415
00416   Bit Fields:
00417   - \c error
00418   - \c sequence
00419   - \c length
00420
00421   """
00422   evContPacket_BF = [
00423                     ('error',     13, 16),
00424                     ('sequence',   8, 13),
00425                     ('length',     0,  8),
00426                   ]
00427   def __init__(self, ui):
00428     BitField.__init__(self, ui, self.evContPacket_BF)
00429
00430 class evContPacket_Singleton(evContPacket):
00431   def __init__(self, ui):
00432     evContPacket.__init__(self, ui)
00433
00434   def __call__(self, ui):
00435     self.set(ui)
00436     return self
00437
00438 class evTKR_TOTdata(object):
00439   """\brief TKR TOT data class
00440
00441   Members:
00442   - \c tot
00443   - \c cc
00444   - \c rc
00445
00446   """
00447   def __init__(self, cc, rc, tot):
00448     """\brief evTKR_TOTdata constructor
00449
00450     \param cc  Cable controller id
00451     \param rc  Readout controller id
00452     \param tot 8-bit TOT value
00453
00454     """
00455     self.tot = tot
00456     self.cc = cc
00457     self.rc = rc
00458
00459 class evTKR_Strip(BitField):
00460   """\brief TKR strip bitfields
00461
00462   Bit Fields:
00463   - \c done
00464   - \c gtfe
00465   - \c strip
00466
00467   """
00468   evTKR_Strip_BF =  [
00469                       ('done',    11, 12),
00470                       ('gtfe',     6, 11),
00471                       ('strip',    0,  6)
00472                     ]
00473   def __init__(self, ui):
00474     BitField.__init__(self, ui, self.evTKR_Strip_BF)
00475
00476 class evTKR_StripData(object):
00477   """\brief TKR StripData class
00478
00479   Members:
00480   - \c cc
00481   - \c rc
00482   - \c strip
00483
00484   """
00485   def __init__(self, cc, rc, strip):
00486     """\brief evTKR_StripData constructor
00487
00488     \param cc    Cable controller id
00489     \param rc    Readout controller id
00490     \param strip An evTKR_Strip object instance
00491     """
00492     self.strip = strip
00493     self.cc = cc
00494     self.rc = rc
00495
00496 class evCAL_LogAccepts(BitField):
00497   """\brief Log Accepts bitfields
00498
00499   Bit Fields:
00500   - \c y3
00501   - \c y2
00502   - \c y1
00503   - \c y0
00504   - \c x3
00505   - \c x2
00506   - \c x1
00507   - \c x0
00508
00509   """
00510   evCAL_LogAccepts_BF = [
00511                           ('y3',    28, 32),
00512                           ('y2',    24, 28),
00513                           ('y1',    20, 24),
00514                           ('y0',    16, 20),
00515                           ('x3',    12, 16),
00516                           ('x2',     8, 12),
00517                           ('x1',     4,  8),
00518                           ('x0',     0,  4)
00519                         ]
00520   def __init__(self, twr, ui):
00521     BitField.__init__(self, ui, self.evCAL_LogAccepts_BF)
00522     self.twr = twr
00523
00524 class evCAL_LayerLogData(object):
00525   """\brief Class that associates a layer with the log data
00526
00527   """
00528   def __init__(self, twr, layer, data):
00529     """\brief evCAL_LayerLogData constructor
00530
00531     \param layer CAL layer (such as 'x1', 'y1', etc)
00532     \param data  evCAL_LogData bitfield
00533     """
00534     self.twr   = twr
00535     self.layer = layer
00536     self.data  = data
00537
00538 class evCAL_LogData(BitField):
00539   """\brief Log Data bitfields
00540
00541   Bit Fields:
00542   - \c column
00543   - \c rangeADC_neg
00544   - \c valADC_neg
00545   - \c rangeADC_pos
00546   - \c valADC_pos
00547
00548   """
00549   evCAL_LogData_BF =  [
00550                         ('column',       28, 32),
00551                         ('rangeADC_neg', 26, 28),
00552                         ('valADC_neg',   14, 26),
00553                         ('rangeADC_pos', 12, 14),
00554                         ('valADC_pos',    0, 12)
00555                       ]
00556   def __init__(self, ui):
00557     BitField.__init__(self, ui, self.evCAL_LogData_BF)
00558
00559 class evDiag_CalLayerEnd(BitField):
00560   """\brief Calorimeter Layer End bitfields
00561
00562   Bit Fields:
00563   - \c trgRequestHigh
00564   - \c trgRequestLow
00565   - \c logAccepts
00566
00567   """
00568   evDiag_CalLayerEnd_BF =   [
00569                               ('trgRequestHigh',  13, 14),
00570                               ('trgRequestLow',   12, 13),
00571                               ('logAccepts',       0, 12)
00572                             ]
00573   def __init__(self, ui):
00574     BitField.__init__(self, ui, self.evDiag_CalLayerEnd_BF)
00575
00576 class evDiag_CalLayer:
00577   """\brief Calorimeter Layer class
00578
00579   Members:
00580   - \c gccc
00581   - \c layer
00582   - \c negLayerEnd
00583   - \c posLayerEnd
00584
00585   """
00586   def __init__(self):
00587     self.gccc        = None
00588     self.layer       = None
00589     self.negLayerEnd = evDiag_CalLayerEnd(0)
00590     self.posLayerEnd = evDiag_CalLayerEnd(0)
00591
00592
00593 class evDiag_TkrTrgReq(BitField):
00594   """\brief TKR Trigger Request bitfields
00595
00596   Members:
00597   - \c gtcc
00598
00599   Bit Fields:
00600   - \c trgRequests
00601
00602   """
00603   evDiag_TkrTrgReq_BF =   [
00604                             ('trgRequests',  0, 9)
00605                           ]
00606   def __init__(self, ui):
00607     BitField.__init__(self, ui, self.evDiag_TkrTrgReq_BF)
00608     self.gtcc = None
00609
00610 class evErr_GCCC(BitField):
00611   """\brief GCCC Error bitfields
00612
00613   Bit Fields:
00614
00615   - \c errParm
00616   - \c sweepNum
00617   - \c errType
00618
00619   """
00620   evErr_GCCC_BF =   [
00621                       ('errParm',   8, 16),
00622                       ('sweepNum',  6,  8),
00623                       ('errType',   0,  4)
00624                     ]
00625   def __init__(self, ui):
00626     BitField.__init__(self, ui, self.evErr_GCCC_BF)
00627
00628 class evErr_GCCC_Message(object):
00629   """\brief GCCC Error Message object
00630
00631   Members:
00632   - \c gccc
00633   - \c errGCCC
00634
00635   """
00636   def __init__(self, gccc, errGCCC):
00637     """\brief evErr_GCCC_Message constructor
00638
00639     \param gccc    GCCC id
00640     \param errGCCC evErr_GCCC object instance
00641     """
00642     self.gccc       = gccc
00643     self.errGCCC    = errGCCC
00644
00645 class evErr_CablePhase(BitField):
00646   """\brief Cable Controller Phasing Error bitfields
00647
00648   Bit Fields:
00649   - \c tag7
00650   - \c tag6
00651   - \c tag5
00652   - \c tag4
00653   - \c tag3
00654   - \c tag2
00655   - \c tag1
00656   - \c tag0
00657
00658   """
00659   evErr_CablePhase_BF = [
00660                           ('tag7', 14, 16),
00661                           ('tag6', 12, 14),
00662                           ('tag5', 10, 12),
00663                           ('tag4',  8, 10),
00664                           ('tag3',  6,  8),
00665                           ('tag2',  4,  6),
00666                           ('tag1',  2,  4),
00667                           ('tag0',  0,  2)
00668                         ]
00669   def __init__(self, ui):
00670     BitField.__init__(self, ui, self.evErr_CablePhase_BF)
00671
00672 class evErr_GTCC(BitField):
00673   """\brief GTCC Error bitfields
00674
00675   Bit Fields:
00676   - \c dataParity
00677   - \c GTRCsum
00678   - \c wrdCntParity
00679   - \c hdrParity
00680   - \c cblTimeOut
00681   - \c fifoFull
00682   - \c phsGTFE
00683   - \c phsGTRC
00684   - \c nGTRC
00685
00686   """
00687   evErr_GTCC_BF =   [
00688                       ('dataParity',    15, 16),
00689                       ('GTRCsum',       14, 15),
00690                       ('wrdCntParity',  13, 14),
00691                       ('hdrParity',     12, 13),
00692                       ('cblTimeOut',    11, 12),
00693                       ('fifoFull',      10, 11),
00694                       ('phsGTFE',        9, 10),
00695                       ('phsGTRC',        8,  9),
00696                       ('nGTRC',          0,  8)
00697                     ]
00698   def __init__(self, ui):
00699     BitField.__init__(self, ui, self.evErr_GTCC_BF)
00700
00701 class evErr_GTCC_Message(object):
00702   """\brief GTCC Error Message object
00703
00704   Members:
00705   - \c gtcc
00706   - \c errGTCC
00707   - \c parameters
00708
00709   """
00710   def __init__(self):
00711     self.gtcc       = None
00712     self.errGTCC    = None
00713     self.parameters = {}
00714
00715
00716 class evErr_CableTimeOut(BitField):
00717   """\brief Cable Timeout Error bitfields
00718
00719   Bit Fields:
00720   - \c tkr
00721   - \c cal
00722
00723   """
00724   evErr_CableTimeOut_BF = [
00725                             ('tkr',  4, 12),
00726                             ('cal',  0,  4)
00727                           ]
00728   def __init__(self, ui):
00729     BitField.__init__(self, ui, self.evErr_CableTimeOut_BF)
00730
00731
00732 class evDiag_Data(object):
00733   """\brief Diagnostic Data class
00734
00735   Members:
00736   - \c cal
00737   - \c tkr
00738
00739   """
00740   size = 48 # 8*(4 + 2)
00741   def __init__(self):
00742     self.cal = []
00743     self.tkr = []
00744     for i in range(8):
00745       inst = evDiag_CalLayer()
00746       self.cal.append(inst)
00747       inst = evDiag_TkrTrgReq(0)
00748       self.tkr.append(inst)
00749
00750 class evCellHeader(BitField):
00751   """\brief Cell Header bitfields
00752
00753   Bit Fields:
00754   - \c respond
00755   - \c destination
00756   - \c protocol
00757   - \c source
00758   - \c parity
00759
00760   """
00761   evCellHeader_BF = [
00762                       ('respond',    15, 16),
00763                       ('destination', 9, 15),
00764                       ('protocol',    7,  9),
00765                       ('source',      1,  7),
00766                       ('parity',      0,  1),
00767                     ]
00768   def __init__(self, ui):
00769     BitField.__init__(self, ui, self.evCellHeader_BF)
00770
00771 class evCellHeader_Singleton(evCellHeader):
00772   def __init__(self, ui):
00773     evCellHeader.__init__(self, ui)
00774
00775   def __call__(self, ui):
00776     self.set(ui)
00777     return self
00778
00779
00780 class EvtCliIO(Socket):
00781   """\brief Event client input/output class
00782
00783 \b Contents:
00784
00785   This base class contains all the input/output handling routines for the event client (EvtCli) class.
00786
00787   """
00788
00789   EVENT_SRC_SOCK = 0
00790   EVENT_SRC_FILE = 1
00791   PortNumber = 2000
00792
00793   def __init__(self, debug, port=PortNumber):
00794     Socket.__init__(self, port)
00795     self.read                = None
00796     self.__abort             = 0
00797     self.__timeout           = 1        # !!!!
00798     self.__timeoutEnabled    = 0
00799     self.__debugErrorOutput  = debug & (EvtCli.DEBUG_ALL | EvtCli.DEBUG_ERROR_OUTPUT)
00800
00801   def connect(self, host, force=False):
00802     Socket.connect(self, host)
00803     self.read = self.readSocket
00804     if force: opcode = Opcode(Opcode.ForceEventSocket)
00805     else:     opcode = Opcode(Opcode.SetEventSocket)
00806     self.send(opcode.packet())
00807     dat = self.recvall(8)
00808     [size, status] = struct.unpack('!2L', dat)
00809     if status & 0x3: raise LATInterfaceException(status)
00810
00811   def setSocket(self, sock):
00812     Socket.setSocket(self, sock)
00813     self.read = self.readSocket
00814
00815   def readSocket(self):
00816     """\brief The 'lightweight' event read routine.
00817
00818     This routine does the minimal work of reading the raw
00819     event data from a file or a socket.
00820
00821     \return Event buffer read
00822     """
00823     self.__abort = 0
00824     while not self.__abort:
00825       rd, wr, ex = select.select([self.socket()], [], [], self.__timeout)
00826       if rd:
00827         dat = self.recvall(28)
00828         header = struct.unpack('!7L', dat)
00829         numLeft = header[2] - 24
00830         dat += self.recvall(numLeft)
00831         return (header, dat[4:])
00832       elif self.__timeoutEnabled:
00833         raise IOError, "Event read timeout"
00834     # Abort:
00835     raise RuntimeError, "EvtCli.readSocket was aborted"
00836
00837   def readFile(self):
00838     """\brief Read the event from a file.
00839
00840     """
00841     # The archive file includes the first two datagram words
00842     dat = self.__f.read(20)
00843     header = (0,)
00844     header += struct.unpack('!5L', dat)
00845     numLeft = (header[2] & 0xFFFF) - 20
00846     dat += self.__f.read(numLeft)
00847     return (header, dat)
00848
00849   def open(self,filename,mode="r+b"):
00850     """\brief Open the event archive file for input.
00851
00852     \param filename Event archive file name
00853     """
00854     self.__f=file(filename, mode)
00855     self.read = self.readFile
00856
00857   def close(self):
00858     """\brief Close the event source file.
00859     """
00860     self.__f.close()
00861
00862   def abort(self):
00863     """\brief Abort out of a readEvent().
00864
00865     Can be used from another thread
00866     """
00867     self.__abort = 1
00868
00869   def setTimeoutEnabled(self, flag):
00870     """\brief Enable or disable event timeout
00871
00872     \param flag 1 = Enable event timeout
00873                 0 = Disable event timeout (default)
00874     """
00875     self.__timeoutEnabled = flag;
00876
00877   def isTimeoutEnabled(self):
00878     """\brief Checks the event timeout state
00879
00880     \return 1 = If event timeout is enabled
00881             0 = If event timeout is disabled
00882     """
00883     return self.__timeoutEnabled
00884
00885   def setTimeout(self, timeout = 1.0):
00886     """\brief Set the timeout value.
00887
00888     \param timeout Event timeout value as a floating point number in seconds.
00889                    Default is 1 second.  Use 'None' to disable the timeout.
00890     """
00891     #self.__timeout = timeout
00892     self.socket().settimeout(timeout)
00893
00894   def getTimeout(self):
00895     """\brief Query the current timeout value.
00896
00897     \return Current event timeout value as a floating point number in seconds
00898     """
00899     #return self.__timeout
00900     return self.socket().gettimeout()
00901
00902   def unpack(self, fmt, str):
00903     """\brief Wrapper method for unpack
00904
00905     \param  fmt Unpack format
00906     \param  str String to be unpacked
00907
00908     \return     Unpacked data tuple
00909     """
00910     try:
00911       result = struct.unpack(fmt, str)
00912     except:
00913       if self.__debugErrorOutput:
00914         logException()
00915         logStack()
00916       return ()
00917     else:
00918       return result
00919
00920
00921 class EvtCli(EvtCliIO):
00922   """\brief Event handler client
00923
00924 \b Contents:
00925
00926   Receives an event from TCP socket or a file stream and
00927   parses it into the evt object.
00928
00929 \b Overview:
00930
00931   The event client is responsible for communicating with the event server
00932   and retrieve events triggered by a script or an external source.
00933   The source of the event can be either a TCP socket or an archive file.
00934
00935   The event client uses lazy parsing to parse the event. This means the
00936   user application needs to call the parsing routines that corresponds
00937   to the section of the event that the user is interested in. The parser
00938   methods populate event objects inside the Evt class in the event client,
00939   so after the parser method is called these objects can be accessed or
00940   iterated over. The parser methods only apply to the current contribution.
00941   By default after readEvent() the first contribution after the GEM
00942   contribution is the current contribution. Use the setCurrentContribution
00943   method to change the current contribution. Use the getContributionList
00944   method to find out which contributions exist in the event.
00945
00946   Available parser methods:
00947     - evDumpSummary()
00948     - evDumpCAL_LogAccepts()
00949     - evDumpCAL_Logs()
00950     - evDumpTKR()
00951     - evDumpDiagnostic()
00952     - evDumpTEM_Error()
00953     - evDumpEventAEM()
00954
00955   Contribution related methods:
00956   - getContributionList()
00957   - getCurrentContribution()
00958   - setCurrentContribution()
00959   - dumpContributionData()
00960
00961   Retrieving the timestamp and timebase:
00962   - evGetTimestamp()
00963   - evGetTimebase()
00964
00965 \b Usage:
00966
00967   For reading events from a socket:
00968   \code
00969     from gEvtCli import *
00970     ec = EvtCli(debug=0)
00971     ec.connect('gitot')
00972     while ec.readEvent() == 0:
00973       ec.setCurrentContribution(...)
00974       if ec.getContributionStatus() == 0:
00975         ec.evDumpXXX()
00976         :
00977       else:
00978         print "Error %s in contribution %s ",
00979           (ec.getContributionStatusStr(), cId)
00980     ec.disconnect()
00981   \endcode
00982   For reading events from an archived event file:
00983   \code
00984     from gEvtCli import *
00985     ec = EvtCli(debug=0)
00986     ec.open('030305165528.ldf')
00987     while ec.readEvent() == 0:
00988       ec.setCurrentContribution(...)
00989       if ec.getContributionStatus() == 0:
00990         ec.evDumpXXX()
00991         :
00992       else:
00993         print "Error %s in contribution %s ",
00994           (ec.getContributionStatusStr(), cId)
00995     ec.close()
00996   \endcode
00997   For looping over contributions:
00998   \code
00999     from gEvtCli import *
01000     ec = EvtCli(debug=0)
01001     ec.connect('gitot')
01002     status = ec.readEvent()
01003     contList = ec.getContributionList()
01004     for cId in contList:
01005       ec.setCurrentContribution(cId)
01006       if ec.getContributionStatus() == 0:
01007         ec.evDumpSummary()
01008         if cId.startswith('TEM'):
01009           ec.evDumpCAL_LogAccepts()
01010           ec.evDumpCAL_Logs()
01011           ec.evDumpTKR()
01012           ec.evDumpTEM_Error()
01013           ec.evDumpDiagnostic()
01014         elif cId == 'AEM':
01015           ec.evDumpEventAEM()
01016       else:
01017         print "Error %s in contribution %s ",
01018           (ec.getContributionStatusStr(), cId)
01019   \endcode
01020   """
01021
01022   __SWEEP_MARKER = 5            # Arbitrary marker value for recognizing
01023                                 #   when the event pipeline is flushed
01024   EVENT_SRC_SOCK = 0
01025   EVENT_SRC_FILE = 1
01026   DATAGRAM_IDENTITY = 0x201F1010
01027   UNRECOGNIZED_BUFFER_IDENTITY = 0x201F1020
01028   MINIMAL_BYTES = 32
01029   FIRST_CONTRIBUTION_OFFSET = 4 # In 32-bit words
01030 ## New event format
01031 ##  EXPECTED_EVENT_VERSION = 0x101F0010
01032 ##  EXPECTED_EVENT_VERSION = 0x102F0010
01033 ##  EXPECTED_EVENT_VERSION = 0x103F0010
01034   EXPECTED_EVENT_VERSION = 0x104F0010
01035 ##
01036
01037   # Errors that the getOnlineStatus() method can return
01038   ERROR_BASE             = 0x1000
01039   GGLT_STATUS_ERROR      = ERROR_BASE + (1 << 0)
01040   MINIMAL_SIZE_ERROR     = ERROR_BASE + (1 << 1)
01041   EOE_ERROR              = ERROR_BASE + (1 << 2)
01042   UNPACK_ERROR           = ERROR_BASE + (1 << 3)
01043   IO_ERROR               = ERROR_BASE + (1 << 4)
01044   EVENT_VERSION_MISMATCH = ERROR_BASE + (1 << 5)
01045   PLAYBACK_ERROR         = ERROR_BASE + (1 << 6) # Agrees with evtSvr.c
01046   READ_TIMEOUT_ERROR     = ERROR_BASE + (1 << 7)
01047   EOF_ERROR              = ERROR_BASE + (1 << 8)
01048   ABORT_ERROR            = ERROR_BASE + (1 << 9)
01049
01050   # Errors that the getContributionStatus() method can return
01051   CONTRIB_ERR_NONE        = 0
01052   CONTRIB_ERR_PARITY      = 1
01053   CONTRIB_ERR_TRUNCATED   = 2
01054   CONTRIB_ERR_WRITE_FAULT = 3
01055   CONTRIB_ERR_TIMEDOUT    = 4
01056
01057   CONTRIBUTOR = {  0:'TEM0',
01058                    1:'TEM1',
01059                    2:'TEM2',
01060                    3:'TEM3',
01061                    4:'TEM4',
01062                    5:'TEM5',
01063                    6:'TEM6',
01064                    7:'TEM7',
01065                    8:'TEM8',
01066                    9:'TEM9',
01067                   10:'TEM10',
01068                   11:'TEM11',
01069                   12:'TEM12',
01070                   13:'TEM13',
01071                   14:'TEM14',
01072                   15:'TEM15',
01073                   16:'GEM',
01074                   17:'AEM',
01075                   32:'OSW'
01076                 }
01077
01078   (
01079     TEM0,
01080     TEM1,
01081     TEM2,
01082     TEM3,
01083     TEM4,
01084     TEM5,
01085     TEM6,
01086     TEM7,
01087     TEM8,
01088     TEM9,
01089     TEM10,
01090     TEM11,
01091     TEM12,
01092     TEM13,
01093     TEM14,
01094     TEM15,
01095     GEM,
01096     AEM,
01097     _NA,_NA,_NA,_NA,_NA,_NA,_NA,_NA,_NA,_NA,_NA,_NA,_NA,_NA,
01098     OSW,
01099   ) = \
01100   ( range (0,33) )
01101
01102   # Debug levels
01103   DEBUG_NONE          = 0
01104   DEBUG_ALL           = 1
01105   DEBUG_EVENT_DUMP    = 1 << 1
01106   DEBUG_WARNINGS      = 1 << 2
01107   DEBUG_PARSER_OUTPUT = 1 << 3
01108   DEBUG_ERROR_OUTPUT  = 1 << 4
01109
01110   def __init__(self, debug=0, port=EvtCliIO.PortNumber):
01111     """\brief Event client constructor
01112
01113     \param debug  Debug mode (0=Debug, 1=No debug)
01114     """
01115
01116     if debug is None:
01117       self.setDebug(0)
01118     else:
01119       self.setDebug(int(debug))
01120
01121     EvtCliIO.__init__(self, self.__debug, port)
01122
01123     self.__sock              = None
01124     self.__src               = None
01125     self.evt                 = Evt()
01126     self.__evContPacket      = evContPacket_Singleton(0)
01127     self.__evSummary         = evSummary_Singleton(0)
01128     self.__evCellHeader      = evCellHeader_Singleton(0)
01129     self.__oes_status        = 0
01130     self.__online_status     = 0
01131     self.__evt_status        = None
01132     self.__evt_size          = None
01133     self.__version_info      = None
01134     self.latInterfaceStatus  = LATInterfaceStatus(0)
01135
01136     # Make sure the custom event client does not override EvtCliIO.read() method
01137     customEvtCli = EvtCli.__subclasses__()
01138     if len(customEvtCli) != 0:
01139       customEvtCli = customEvtCli[0]
01140       if 'read' in customEvtCli.__dict__:
01141         raise RuntimeError, "Custom event client %s should not override the read() method" % customEvtCli.__name__
01142
01143   def setDebug(self, debug):
01144     """\brief Set the debug mode
01145
01146     \param debug Debug mode
01147                  The following debug modes are available and can be added together
01148                  for combinations:
01149                      0: No Debug
01150                      1: Debug All
01151                      2: Event Dump
01152                      4: Warnings
01153                      8: Parser Output
01154                     16: Error Output
01155     """
01156     self.__debug             = debug
01157     self.__debugWarnings     = debug & (EvtCli.DEBUG_ALL | EvtCli.DEBUG_WARNINGS)
01158     self.__debugEventDump    = debug & (EvtCli.DEBUG_ALL | EvtCli.DEBUG_EVENT_DUMP)
01159     self.__debugErrorOutput  = debug & (EvtCli.DEBUG_ALL | EvtCli.DEBUG_ERROR_OUTPUT)
01160     self.__debugParserOutput = debug & (EvtCli.DEBUG_ALL | EvtCli.DEBUG_PARSER_OUTPUT)
01161
01162
01163   def readEvent(self, dat=None):
01164     """\brief Read an event
01165
01166     Reads one event from an archive file or socket
01167
01168     \param  dat If not None then interpret this data as event instead
01169
01170     \return     oes_status
01171     """
01172     evt = self.evt
01173     evt.clearEvent()
01174     evt.cont_offset = EvtCli.FIRST_CONTRIBUTION_OFFSET
01175     self.__online_status = 0
01176
01177     if dat is not None:
01178       header = (0,)
01179       header += struct.unpack('!5L', dat[0:20])
01180       self.dat = dat
01181     else:
01182       (header, self.dat) = self.read()
01183       if header is None:
01184         return EvtCli.ABORT_ERROR
01185
01186     self.header = header
01187
01188     self.__oes_status   = header[0]
01189     self.__version_info = header[3]
01190     self.__evt_status   = header[4] >> 16
01191     self.__evt_size     = header[4] & 0xFFFF
01192
01193     if self.__debugEventDump:
01194       print "OES status    = 0x%08x" % self.__oes_status
01195       print "Event version = 0x%08x" % self.__version_info
01196       dump_cells(self.dat)
01197     if self.__oes_status != 0:
01198       raise LATInterfaceException(self.__oes_status)
01199     if len(self.dat) < EvtCli.MINIMAL_BYTES:
01200       self.__online_status |= EvtCli.MINIMAL_SIZE_ERROR
01201       if self.__debugWarnings:
01202         log.error("*** gEvtCli: datagram size %d less than minimal bytes %d"
01203                   %(len(self.dat), EvtCli.MINIMAL_BYTES))
01204
01205     if self.__version_info != EvtCli.EXPECTED_EVENT_VERSION:
01206       self.__online_status |= EvtCli.EVENT_VERSION_MISMATCH
01207       if self.__debugWarnings:
01208         log.error("*** gEvtCli: event version 0x%08x is not the expected 0x%08x"
01209                   %(self.__version_info, EvtCli.EXPECTED_EVENT_VERSION))
01210
01211     if self.__online_status != 0:
01212       return self.__online_status
01213
01214     # Get the summary word stored in the OSW contribution
01215     # to determine if the event has error.
01216     evt.summary = self.__evSummary(self.getDWord(self.evGetSummary()))
01217
01218     if self.__debugEventDump:
01219       print "\nEvent Size            =", self.__evt_size
01220       print "Event Status          =", self.__evt_status
01221       ts = self.evGetTimestamp()
01222       print "Event Timestamp (GMT) =", asctime(gmtime(ts)), \
01223                                       "and", int(modf(ts)[0]*1000), "ms"
01224       print "Event timebase        =", hex(self.evGetTimebase())
01225       print "Event Sequence MSW    =", hex(self.evGetEvtSeqMSW())
01226       print "Event Sequence        =", hex(self.evGetEvtSequence())
01227
01228     self.__evt_error = self.evt.summary.error
01229     self.__evt_trgParityError = self.evt.summary.trgParityErr
01230     # Get the OSW container packet
01231     osw_packet = self.__evContPacket(self.getDWord(evt.cont_offset) & 0xFFFF)
01232     self.__evt_packetError = osw_packet.error
01233
01234     # Contribution offset (skip over the OSW contribution)
01235     evt.cont_offset += ((header[5] & 0xFFFF) << 2)
01236     cont_header = self.getDWord(evt.cont_offset)
01237     evt.cont_packet = self.__evContPacket(cont_header & 0xFFFF)
01238     evt.cont_status = evt.cont_packet.error
01239     evt.summary = self.__evSummary(self.getDWord(self.evGetSummary()))
01240     evt.cont_cellHeader = self.__evCellHeader(cont_header >> 16)
01241     evt.contributor = evt.cont_cellHeader.source
01242     evt.cont_size   = (cont_header & 0x00FF) << 4
01243     evt.cont_end    = (evt.cont_offset << 2) + evt.cont_size
01244
01245     if self.__debugEventDump:
01246       print
01247       self.dumpContributionData()
01248
01249     return self.__online_status
01250
01251   def getGGLTStatus(self):
01252     """\brief Retrieve the GGLT status.
01253
01254     If this status value is non zero then the event is considered "bad"
01255     """
01256     return self.__oes_status
01257
01258   def getGGLTStatusStr(self):
01259     """\brief Return the string equivalent of the GGLT status code.
01260
01261     """
01262     return self.latInterfaceStatus.errstr(self.__oes_status)
01263
01264   def getOnlineStatus(self):
01265     """\brief Retrieve the Online status code.
01266
01267     See getOnlineStatusStr method for a list of possible errors
01268
01269     """
01270     return self.__online_status
01271
01272   def getEvtStatus(self):
01273     """\brief Return the event status from the event header.
01274
01275     """
01276     return self.__evt_status
01277
01278   def getContributionStatus(self):
01279     """\brief Return the contribution status
01280
01281     \return Contribution status
01282     """
01283     return self.evt.cont_status
01284
01285   def getContributionStatusStr(self):
01286     """\brief Return the contribution status string
01287
01288     \return Contribution status string
01289     """
01290     statusList = {0: 'NONE',
01291                   1: 'PARITY',
01292                   2: 'TRUNCATED',
01293                   3: 'WRITE_FAULT',
01294                   4: 'TIMEDOUT',
01295                  }
01296     if self.evt.cont_status in statusList:
01297       return statusList[self.evt.cont_status]
01298     else:
01299       return 'UNKNOWN ERROR'
01300
01301   def getOnlineStatusStr(self):
01302     """\brief Retrieve the string equivalent of the Online status code.
01303
01304     The error can be one of the following:
01305
01306     GGLT_STATUS_ERROR     : A bad event was received. Call getGGLTStatusStr method
01307                             for the description.
01308     MINIMAL_SIZE_ERROR    : The event size was below the acceptable size.
01309     EOE_ERROR             : End of event was reached before the parse completed.
01310     UNPACK_ERROR          : There was an error while unpacking part of the event for parsing.
01311     IO_ERROR              : An I/O error occurred while retrieving the event (socket or file).
01312     EVENT_VERSION_MISMATCH: An event with an old or unsupported format was received.
01313     PLAYBACK_ERROR        : End of file was received while playing back an event archive file.
01314     READ_TIMEOUT_ERROR    : A read timeout occurred while waiting for the event to be
01315                             retrieved (Set by rcTransitions).
01316     EOF_ERROR             : End of file is reached while reading the event file.
01317
01318     \return Online status string
01319
01320     """
01321     statusList = ['GGLT_STATUS_ERROR',
01322                   'MINIMAL_SIZE_ERROR',
01323                   'EOE_ERROR',
01324                   'UNPACK_ERROR',
01325                   'IO_ERROR',
01326                   'EVENT_VERSION_MISMATCH',
01327                   'PLAYBACK_ERROR',
01328                   'READ_TIMEOUT_ERROR',
01329                   'EOF_ERROR',
01330                  ]
01331     s = ''
01332     status = self.__online_status & 0xFFF
01333     bitIndex = 0
01334     while (bitIndex < 12):
01335       if (1 << bitIndex) & status:
01336         if bitIndex < len(statusList):
01337           s += statusList[bitIndex] + ' '
01338         else:
01339           s += 'UNKNOWN_ERROR '
01340       bitIndex += 1
01341     return s.strip()
01342
01343   def getEvtSize(self):
01344     """\brief Return the event size
01345
01346     \return Event size
01347     """
01348     return self.__evt_size
01349
01350   def isErrorEvent(self):
01351     """Determines whether at least one contribution
01352     has the error bit set in its summary word.
01353
01354     \return 1: If at least one contribution has an error.
01355             0: Otherwise
01356     """
01357     return self.__evt_error
01358
01359   def isTrgParityErrorEvent(self):
01360     """Determines whether at least one contribution
01361     has the trigger parity error bit set in its summary word.
01362
01363     \return 1: If at least one contribution has an error.
01364             0: Otherwise
01365     """
01366     return self.__evt_trgParityError
01367
01368   def isPacketErrorEvent(self):
01369     """Determines whether at least one contribution
01370     has a non-zero packet error set in the EBF contribution.
01371
01372     \return 1: If at least one contribution has an error.
01373             0: Otherwise
01374     """
01375     return self.__evt_packetError != 0
01376
01377   def isSweepEvent(self):
01378     """\brief Determine if a sweep event is received.
01379
01380     User script can call this method in process() to determine if
01381     the current event is a sweep event. A try block around the call
01382     should be used in case a bad event is received.
01383
01384     \return 0: Not a sweep event.
01385             1: A sweep event.
01386     """
01387     if self.evt.summary.marker == EvtCli.__SWEEP_MARKER:
01388       return 1
01389     else:
01390       return 0
01391
01392   def isGGLTStatus(self, status=None):
01393     """\brief Determine if the current event is bad.
01394
01395     User script can call this method in process() to determine if
01396     the current event is a bad event (gglt_status != 0).
01397
01398     \param  Optional status value
01399
01400     \return 0: Not a bad event.
01401             1: A bad event.
01402     """
01403     if status is None: status = self.__online_status
01404     return self.checkOnlineStatus(status, EvtCli.GGLT_STATUS_ERROR)
01405
01406   def checkOnlineStatus(self, status, mask):
01407     """\brief Checks if the bit mask \a mask matches the \a status that is
01408     assumed as an Online status.
01409
01410     \param status The status word to be checked against
01411     \param mask   The mask bit(s) to be checked
01412
01413     \return 1 if there is a match
01414             0 if there is no match
01415
01416     """
01417     if status < 0:
01418       return 0
01419     elif not (status & 0x1000):
01420       return 0
01421     else:
01422       return status & mask & 0xFFF
01423
01424   def checkGGLTstatus(self, status, mask):
01425     """\brief Checks if the bit mask \a mask matches the \a status
01426     that is assumed as a GGLT status.
01427
01428     \param status The status word to be checked against
01429     \param mask   The mask bit(s) to be checked
01430
01431     \return 1 if there is a match
01432             0 if there is no match
01433
01434     """
01435     if status > 0:
01436       return 0
01437     elif status & 0x1000:
01438       return 0
01439     else:
01440       return status & mask
01441
01442   # The following function is experimental code: Do Not Use.
01443   def readEventSocket(self):
01444     # Maybe better to do this with setsockopt(SO_RCVLOWAT, 12) and select()
01445     l   = 0
01446     buf = ""
01447     while l < 12:
01448       buf += self.recv(4096 - l)
01449       l    = len(buf)
01450     (retCode, version, status, length) = self.unpack('!lLhH', buf[0:12])
01451     i = 0
01452     #print "readEventSocket:           %u, length = %u, l = %u" % (i, length, l)
01453     while l < length:
01454       buf += self.recv(4096 - l)
01455       l    = len(buf)
01456       i   += 1
01457       print "readEventSocket: Got more: %u, length = %u, l = %u" % (i, length,l)
01458     return (retCode, buf, l)
01459
01460   def setCurrentContribution(self, contributionId):
01461     """\brief Given a contribution id, set the current contribution data
01462     needed for the parsing routines.
01463
01464     \param  contributionId Integer contribution id
01465
01466     \return The offset to the contribution requested.
01467             -1 If the contribution requested is not found
01468                or contribution offset was found to be larger
01469                than the event size
01470             Note: Use getContributionStatus() method after
01471                calling this routine to find out if the
01472                contribution has an error.
01473
01474     """
01475     cont_offset = EvtCli.FIRST_CONTRIBUTION_OFFSET
01476     if isNumberType(contributionId):
01477       cId = contributionId
01478     else:
01479       for (key, value) in EvtCli.CONTRIBUTOR.items():
01480         if value == contributionId:
01481           cId = key
01482           break
01483     evt = self.evt
01484     while(True):
01485       cont_header = self.getDWord(cont_offset)
01486       evt.cont_packet = self.__evContPacket(cont_header & 0xFFFF)
01487       contributor = (cont_header >> 17) & 0x3F
01488       cont_size = evt.cont_packet.length << 4
01489       cont_cellHeader = self.__evCellHeader(cont_header >> 16)
01490       if contributor == cId:
01491         evt.cont_status = evt.cont_packet.error
01492         # Make sure it is a good contribution
01493         if evt.cont_status == 0:
01494           evt.cont_cellHeader = cont_cellHeader
01495           evt.contributor = contributor
01496           evt.cont_size = cont_size
01497           evt.cont_offset = cont_offset
01498           evt.cont_end = (cont_offset << 2) + cont_size
01499           evt.summary = self.__evSummary(self.getDWord(self.evGetSummary()))
01500           if self.__debugEventDump:
01501             self.dumpContributionData()
01502           return self.evt.cont_offset
01503       cont_offset += (cont_size >> 2)
01504       if cont_cellHeader.respond == 0:
01505         return -1
01506       if not (self.__evt_size > (cont_offset << 2)):
01507         return -1
01508
01509   def getCurrentContribution(self):
01510     """\brief Return the integer id of the current contribution
01511
01512     \return Current constribution id
01513     """
01514     return self.evt.cont_cellHeader.source
01515
01516   def getContributionList(self):
01517     """\brief Walk through the whole event and construct a list of contribution id strings
01518
01519     \return A list of contributors that have contributed to the current event
01520     """
01521     cont_offset = EvtCli.FIRST_CONTRIBUTION_OFFSET
01522     contributorList = []
01523     evt = self.evt
01524     while(True):
01525       cont_header = self.getDWord(cont_offset)
01526       cont_size = (cont_header & 0x00FF) << 4
01527       evt.cont_cellHeader = self.__evCellHeader(self.getDWord(cont_offset) >> 16)
01528       #if cont_size == 0:
01529       #  return contributorList
01530       contributor = (cont_header >> 17) & 0x3F
01531       contributorList = contributorList + [EvtCli.CONTRIBUTOR[contributor]]
01532       cont_offset += (cont_size >> 2)
01533       if evt.cont_cellHeader.respond == 0:
01534         return contributorList
01535       if not (self.__evt_size > (cont_offset << 2)):
01536         return contributorList
01537
01538   def dumpContributionData(self):
01539     """\brief Prints out information pertaining to the current contribution.
01540
01541     """
01542     if self.getContributionStatus() != 0:
01543       print("   *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING ***")
01544       print("   ***    This contribution is suspect. Error: %-15s ***"
01545             % self.getContributionStatusStr())
01546       print("   *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING ***\n")
01547
01548     self.evDumpSummary(16)
01549     print
01550     print "Event Contributor=", EvtCli.CONTRIBUTOR[self.evt.contributor]
01551     print "Contribution size=", self.evt.cont_size
01552     print "\nPacket     = 0x%04X" % int(self.evt.cont_packet)
01553     print "\terror      =", hex(int(self.evt.cont_packet.error))
01554     print "\tsequence   =", hex(int(self.evt.cont_packet.sequence))
01555     print "\tlength     =", hex(int(self.evt.cont_packet.length))
01556     print "\nCell header= 0x%04X" % int(self.evt.cont_cellHeader)
01557     print "\tparity     =", hex(int(self.evt.cont_cellHeader.parity))
01558     print "\tsource     =", hex(int(self.evt.cont_cellHeader.source))
01559     print "\tprotocol   =", hex(int(self.evt.cont_cellHeader.protocol))
01560     print "\tdestination=", hex(int(self.evt.cont_cellHeader.destination))
01561     print "\trespond    =", hex(int(self.evt.cont_cellHeader.respond))
01562     dump_cells(self.dat[(self.evt.cont_offset<<2):self.evt.cont_end])
01563     print
01564
01565   def evGetTimestamp(self):
01566     """\brief Return the timestamp of the event in seconds.
01567
01568     The resolution of this timestamp is 1/60th of a second, by default.
01569     Consult VxWorks documentation for sysClkRateSet() and clock_setres()
01570     to see how to change this default. Beware that increasing the resolution
01571     from the default may cause adverse effects due to the increased
01572     interrupt rate generated.
01573
01574     \return Timestamp of the event in seconds.
01575     """
01576 ## New Event Format
01577 ##    tv_sec  = self.getDWord(EvtCli.FIRST_CONTRIBUTION_OFFSET+2)
01578 ##    tv_nsec = self.getDWord(EvtCli.FIRST_CONTRIBUTION_OFFSET+3)
01579     tv_sec  = self.getDWord(EvtCli.FIRST_CONTRIBUTION_OFFSET+3)
01580     tv_nsec = self.getDWord(EvtCli.FIRST_CONTRIBUTION_OFFSET+4)
01581 ##
01582     return (tv_sec + (tv_nsec / 1000000000.0))
01583
01584   def evGetTimebase(self):
01585     """\brief Return the timestamp of the event derived from the PPC timebase register.
01586
01587     This is a 64 bit value that increments at an SBC implementation dependant
01588     rate (60 nS on MVME2306s).  The value is reset at PPC reset time.
01589
01590     \return Timestamp of the event in PPC timebase ticks.
01591     """
01592     return self.unpack('!Q',
01593 ## New event format
01594 ##                       self.dat[(EvtCli.FIRST_CONTRIBUTION_OFFSET+4) << 2:
01595 ##                                (EvtCli.FIRST_CONTRIBUTION_OFFSET+6) << 2])[0]
01596                        self.dat[(EvtCli.FIRST_CONTRIBUTION_OFFSET+5) << 2:
01597                                 (EvtCli.FIRST_CONTRIBUTION_OFFSET+7) << 2])[0]
01598 ##
01599
01600   # Not used anymore -ST
01601   #def extend(self, buffer):
01602   #  if self.dat is not None:
01603   #    self.dat += buffer
01604
01605   def evGetEvtSeqMSW(self):
01606     """\brief Return the MSW portion of the event sequence
01607
01608     \return MSW portion of the event sequence.
01609     """
01610     return self.getDWord(EvtCli.FIRST_CONTRIBUTION_OFFSET+7)
01611
01612   def evGetEvtSequence(self):
01613     """\brief Return the Event Sequence
01614
01615     \return Event sequence.
01616     """
01617     return ((self.evGetEvtSeqMSW()     << 17) |
01618             (self.evt.summary.evNumber <<  2) |
01619             (self.evt.summary.tag      <<  0)
01620           )
01621
01622   def getUserId(self):
01623     """\brief Return the user id passed to the event client.
01624
01625     \return Current user id
01626     """
01627     return 123 # Deprecated.
01628
01629   def evGetTKR_Accepts(self, pAccept):
01630     """\brief Walks tower event contribution to the TKR accepts data.
01631
01632     Fills in the evGetTKR_Accepts structure pointed to by \a pAccept
01633     with the TKR accepts data.  Also returns a pointer to the TKR
01634     accepts information.
01635
01636     \param   pAccept Array to be filled with TKR accepts data
01637     \return  Offset to the start of TKR accepts data
01638
01639     """
01640     p = self.evGetCAL_LogAccepts() + 1 + self.evGetCAL_NumAccepts() * (1 + 3 * self.evt.summary.readout4)
01641     if pAccept != None:
01642       for i in range(N_GTCC):
01643         dWordOffset = int(p + (9 * i) / 32)
01644         bitOffset  = (9 * i) % 32
01645         if ((32 - bitOffset) >= 9):
01646           if (dWordOffset << 2) > self.evt.cont_end:
01647             self.print_EOE_Warning()
01648             return -1
01649           pAccept[i] = (self.getDWord(dWordOffset) >> (32 - bitOffset - 9)) & 0x1FF
01650           self.evt.addTKRaccept(pAccept[i])
01651         else:
01652           if ((dWordOffset+1) << 2) > self.evt.cont_end:
01653             self.print_EOE_Warning()
01654             return -1
01655           pAccept[i] = (self.getDWord(dWordOffset)   << (9 - (32 - bitOffset)) & 0x1FF) | \
01656                        (self.getDWord(dWordOffset+1) >> (32 - (9 - (32 - bitOffset))))
01657           self.evt.addTKRaccept(pAccept[i])
01658     return p
01659
01660   def evGetCAL_NumAccepts(self):
01661     """\brief Counts the number of hit calorimeter logs in the tower
01662     event contribution.
01663
01664     Given a pointer to an entire TEM event contribution walk the data
01665     structure to the calorimeter log accepts word and return the sum of
01666     the number of hit logs.
01667
01668     \return Number of hit logs
01669     """
01670     nAccepts = 0
01671     la = self.getDWord(self.evGetCAL_LogAccepts())
01672     for i in range(8):
01673       nAccepts = nAccepts + ((la >> (i<<2)) & 0xF)
01674     return nAccepts
01675
01676   def evDumpGEM(self):
01677     """\brief Parses the GEM contribution by populating the data in self.evt.gem
01678
01679     Requires calling evtCli.setCurrentContribution(EvtCli.GEM) before usage.
01680
01681     """
01682     offset = self.evGetSummary() + 1
01683     val = self.getDWord(offset)
01684     self.evt.gem.ROI_Vector = (val >> 16)
01685     self.evt.gem.TKR_Vector = val & 0xFFFF
01686     val = self.getDWord(offset+1)
01687     self.evt.gem.CAL_HE_Vector = (val >> 16)
01688     self.evt.gem.CAL_LE_Vector = val & 0xFFFF
01689     val = self.getDWord(offset+2)
01690     self.evt.gem.triggerSummary = (val >> 16)
01691     self.evt.gem.deadzone = (self.evt.gem.triggerSummary >> 8)
01692     self.evt.gem.conditions = self.evt.gem.triggerSummary & 0xFF
01693     self.evt.gem.CNO_Vector = val & 0xFFFF
01694     self.evDumpGEM_Veto_List(offset+3)
01695     self.evt.gem.liveTime = self.getDWord(offset+7)
01696     self.evt.gem.prescaled = self.getDWord(offset+8)
01697     self.evt.gem.discarded = self.getDWord(offset+9)
01698     self.evt.gem.sent = self.getDWord(offset+10) # Deprecated
01699     self.evt.gem.condArrivalTimes.set(self.evt.gem.sent)
01700     self.evt.gem.triggerTime = self.getDWord(offset+11)
01701     self.evt.gem.onePPSTime = self.getDWord(offset+12)
01702     val = self.getDWord(offset+13)
01703     self.evt.gem.deltaOpenWindowTime = (val >> 16)
01704     self.evt.gem.deltaEventTime = val & 0xFFFF
01705
01706     if self.__debugParserOutput:
01707       print "   ROI vector    = 0x%04x" % self.evt.gem.ROI_Vector
01708       print "   TKR vector    = 0x%04x" % self.evt.gem.TKR_Vector
01709       print "   CAL HE vector = 0x%04x" % self.evt.gem.CAL_HE_Vector
01710       print "   CAL LE vector = 0x%04x" % self.evt.gem.CAL_LE_Vector
01711       print "   Dead zone     = 0x%02x" % self.evt.gem.deadzone
01712       print "   Conditions    = 0x%02x" % self.evt.gem.conditions
01713       print "   CNO Vector    = 0x%04x" % self.evt.gem.CNO_Vector
01714       print "   Veto List:"
01715       print "     XZP, XZM    = 0x%04x, 0x%04x" % (self.evt.gem.vetoList.XZP,
01716                                                    self.evt.gem.vetoList.XZM)
01717       print "     YZP, YZM    = 0x%04x, 0x%04x" % (self.evt.gem.vetoList.YZP,
01718                                                    self.evt.gem.vetoList.YZM)
01719       print "     XY          = 0x%04x"         %  self.evt.gem.vetoList.XY
01720       print "     NA, RBN     = 0x%04x, 0x%04x" % (self.evt.gem.vetoList.NA,
01721                                                    self.evt.gem.vetoList.RBN)
01722       print "   Live time     = 0x%08x" % self.evt.gem.liveTime
01723       print "   Prescaled     = 0x%08x" % self.evt.gem.prescaled
01724       print "   Discarded     = 0x%08x" % self.evt.gem.discarded
01725       print "   Condition arrival:"
01726       print "     raw         = 0x%08x" % self.evt.gem.condArrivalTimes.ui
01727       print "     external    = 0x%02x" % self.evt.gem.condArrivalTimes.External
01728       print "     cno         = 0x%02x" % self.evt.gem.condArrivalTimes.CNO
01729       print "     calHE       = 0x%02x" % self.evt.gem.condArrivalTimes.CAL_HE
01730       print "     calLE       = 0x%02x" % self.evt.gem.condArrivalTimes.CAL_LE
01731       print "     tkr         = 0x%02x" % self.evt.gem.condArrivalTimes.TKR
01732       print "     roi         = 0x%02x" % self.evt.gem.condArrivalTimes.ROI
01733       print "   Trigger time  = 0x%08x" % self.evt.gem.triggerTime
01734       print "   One PPS time  = 0x%08x" % self.evt.gem.onePPSTime
01735       print "   Delta window open time = 0x%04x" % self.evt.gem.deltaOpenWindowTime
01736       print "   Delta event time       = 0x%04x" % self.evt.gem.deltaEventTime
01737       print
01738
01739   def evDumpGEM_Veto_List(self, offset):
01740     """\brief Parses the Veto List block of the GEM contribution
01741
01742     Used by evDumpGEM
01743
01744     \param offset 32-bit word offset to the veto list block
01745
01746     """
01747     veto = self.getDWord(offset)
01748     self.evt.gem.vetoList.XZP = (veto >> 16)
01749     self.evt.gem.vetoList.XZM = veto & 0xFFFF
01750     veto = self.getDWord(offset+1)
01751     self.evt.gem.vetoList.YZP = (veto >> 16)
01752     self.evt.gem.vetoList.YZM = veto & 0xFFFF
01753     self.evt.gem.vetoList.XY = self.getDWord(offset+2)
01754     veto = self.getDWord(offset+3)
01755     self.evt.gem.vetoList.NA = (veto >> 16)
01756     self.evt.gem.vetoList.RBN = veto & 0xFFFF
01757
01758   def getWord(self,wordOffset):
01759     """\brief Unpack and return a 16-bit word value located at wordOffset
01760
01761     \param  wordOffset Pointer to data
01762
01763     \return            16-bit word value
01764     """
01765     result = self.unpack('!H',self.dat[(wordOffset<<1):((wordOffset+1)<<1)])
01766     if result != ():
01767       return result[0]
01768     else:
01769       return 0
01770
01771   def getDWord(self,dWordOffset):
01772     """\brief Unpack and return a 32-bit word value located at dWordOffset
01773
01774     \param  dWordOffset Pointer to data
01775
01776     \return             32-bit word value
01777     """
01778     result = self.unpack('!L',self.dat[(dWordOffset<<2):((dWordOffset+1)<<2)])
01779     if result != ():
01780       return result[0]
01781     else:
01782       return 0
01783
01784   def getByte(self,byteOffset):
01785     """\brief Unpack and return an 8-bit byte value located at byteOffset
01786
01787     \param  byteOffset Pointer to data
01788
01789     \return            8-bit byte value
01790     """
01791     result = self.unpack('B',self.dat[byteOffset])
01792     if result != ():
01793       return result[0]
01794     else:
01795       return 0
01796
01797   def evGetCAL_Logs(self):
01798     """\brief Walks tower event contribution to the CAL log data.
01799
01800     Given a pointer to an entire TEM event contribution walk the data
01801     structure to the beginning of the calorimeter log data.
01802
01803     \return Offset to the beginning of the calorimeter log data
01804     """
01805     return self.evGetCAL_LogAccepts() + 1
01806
01807   def evGetCAL_LogAccepts(self):
01808     """\brief Walks the tower event contribution to the calorimeter
01809     log accepts word.
01810
01811     Given a pointer to an entire TEM event contribution walk the data
01812     structure returning a pointer to the calorimeter log accepts word.
01813
01814     The 32-bit calorimeter log accepts word is immediately after the event
01815     summary word, i.e. the 2nd 32-bit word in the data.
01816
01817     \return Offset to the calorimeter log accepts word.
01818     """
01819     return self.evGetSummary() + 1
01820
01821   def evDumpCAL_LogAccepts(self):
01822     """\brief Decodes the log accepts word and stores it in evt.CAL_LogAccepts.
01823
01824     """
01825     la = evCAL_LogAccepts(self.getCurrentContribution(), self.getDWord(self.evGetCAL_LogAccepts()))
01826     if self.__debugParserOutput:
01827       print("\n   CAL Log Accepts")
01828       # look for bogus accept values ( anything greater than 12 )
01829       for i in range(N_GCCC):
01830         if ((la.ui >> (i<<2)) & 0xF) > 12:
01831           print("   *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING ***")
01832           print("   *** Log accepts greater than 12.  This event is suspect     ***")
01833           print("   *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING ***\n")
01834
01835       print("   ================================================")
01836       print("   GCCC   | GCCC_01 | GCCC_03 | GCCC_02 | GCCC_00 |")
01837       print("   -------+---------+---------+---------+---------+-------------")
01838       print("   layer  | y3   y2 | y1   y0 | x3   x2 | x1   x0 |  Raw")
01839       print("   -------+----+----+----+----+----+----+----+----+-------------")
01840       print("   hits   | %02d   %02d | %02d   %02d | %02d   %02d | %02d   %02d |  0x%08x" %
01841            (la.y3, la.y2, la.y1, la.y0, la.x3, la.x2, la.x1, la.x0, la.ui))
01842     self.evt.addCAL_LogAccept(la)
01843
01844
01845   def evDumpCAL_Logs(self):
01846     """\brief Decodes all the log data for the event and stores it in evt.CAL_LogData
01847
01848     """
01849     la = evCAL_LogAccepts(0, self.getDWord(self.evGetCAL_LogAccepts()))
01850     if ( la.ui == 0 ):
01851       # nothing to decode
01852       return
01853
01854     # get log data
01855     pLogData = self.evGetCAL_Logs()
01856
01857     if self.__debugParserOutput:
01858       print("\n   CAL Log Data")
01859       print("   =====================================================")
01860       print("   -----   -----+------+------+------+------+-----------")
01861       print("   layer    Col   -Rng   -ADC   +Rng   +ADC   Raw")
01862       print("   -----   -----+------+------+------+------+-----------")
01863
01864     twr = self.getCurrentContribution()
01865     if ( self.evt.summary.readout4 == 0):
01866       # regular read out
01867       # step through the 8 layers
01868       for i in range(8):
01869         nHitLogs = (la.ui >> (i<<2)) & 0xF
01870         if (nHitLogs):
01871           for j in range(nHitLogs):
01872             self.__dumpCAL_Log(twr, pLogData, i)
01873             pLogData = pLogData + 1
01874     else:
01875       # read out 4 range data
01876       # loop over accepts in groups of 2 -- 8 all together
01877       for i in range(4):
01878         # loop over 4 ranges
01879         for j in range(4):
01880           # loop over current 2 accepts
01881           for k in range(2):
01882             nHitLogs = (la.ui >> (((i<<1) + k)<<2)) & 0xF
01883             for l in range(nHitLogs):
01884               self.__dumpCAL_Log(twr, pLogData, ((i<<1) + k))
01885               pLogData = pLogData + 1
01886
01887   def __dumpCAL_Log(self, twr, pLogData, layer):
01888     """\brief Decodes the log data
01889
01890     \param pLogData Pointer to data from one accepted CAL log
01891     \param layer    Which layer the log data is a member of
01892
01893     """
01894     if (pLogData<<2) > self.evt.cont_end:
01895       self.print_EOE_Warning()
01896     else:
01897       ld = evCAL_LogData(self.getDWord(pLogData))
01898       if self.__debugParserOutput:
01899         print("    %c%d       %02d    %d     %04x    %d     %04x   0x%08x" %
01900           (q(layer < 4,'x','y'), layer % 4,
01901           ld.column,
01902           ld.rangeADC_neg,
01903           ld.valADC_neg,
01904           ld.rangeADC_pos,
01905           ld.valADC_pos,
01906           ld.ui))
01907       self.evt.addCAL_LogData(twr, layer, ld)
01908
01909
01910   def evGetSummary(self):
01911     """\brief Return the offset to the summary word of the current contribution.
01912
01913     In a contribution, first word after the header is the summary word
01914
01915     \return Offset to the summary word of the current contribution
01916     """
01917     return self.evt.cont_offset + 1
01918
01919   def __dumpTkrStrip(self, pAccepts, acceptArray):
01920     """\brief Decodes all TKR event strip data and stores it in evt.TKRstrips
01921
01922     \param  pAccepts     Pointer to 32-bit aligned tracker event data
01923     \param  acceptArray  pointer to array of decoded tkr accept vectors
01924
01925     \return              Number of strip hits
01926     """
01927     nStrip = 0
01928     if self.__debugParserOutput:
01929       print("\n   TKR Strips")
01930       print("   ========================================================")
01931       print("   GTCC  | GTRC | GTFE | Strip # | Raw      |")
01932       print("   ------+------+------+---------+----------+")
01933     stripData = evTKR_Strip(0)
01934     for i in range(N_GTCC):
01935       # foreach set bit in GTCC accept vector
01936       accept = acceptArray[i]
01937       for j in range(N_GTRC):
01938         if ( (accept >> (N_GTRC - 1 - j)) & 0x1):
01939           # walk strip data until done bit found
01940           done = 0
01941           while 1:
01942             stripData = self.evGetTKR_StripN(pAccepts, nStrip)
01943
01944             if stripData.done != 0:
01945               stripData.done = 0
01946               done = 1
01947             self.evt.addTKRstrip(GTCC_MAP[i], j, stripData)
01948             nStrip = nStrip + 1
01949             if self.__debugParserOutput:
01950               print("    %d    |  %d   |  %02d  |   %02d    | 0x%03x    |" % (GTCC_MAP[i], j, stripData.gtfe, stripData.strip, stripData.ui))
01951             if done != 0: break
01952     return nStrip
01953
01954   def evGetTKR_StripN(self, pAccepts, stripN, stripData=None):
01955     """\brief Fetches a 12-bit strip word from pAccepts, indexed by stripN.
01956
01957     pAccepts points to the top of the accepts data ... the strip data
01958     starts 72 bits ( 8 * 9 ) from the beginning of accepts.  I.e. it
01959     starts 8 bits into the 3rd 32-bit word.
01960
01961     \param  pAccepts  Pointer to 32-bit aligned tracker event data
01962     \param  stripN    The index of the 12-bit strip to fetch from pAccepts
01963     \param  stripData Optional argument, if passed, avoid creating the object
01964     \return          An evTKR_Strip object instance.
01965     """
01966     # Don't create the object if we are only counting, ie. called from evGetTKR_NumStrips()
01967     if stripData is None:
01968       stripData = evTKR_Strip(0)
01969     # skip the first two 32-bit words
01970     pAccepts = pAccepts + 2
01971     # each strip is 12 bits long.  the first strip starts 8 bits into the 32-bit word
01972     nBits = 8 + 12 * stripN
01973     dWordOffset = pAccepts + (nBits / 32)
01974     bitOffset = nBits % 32
01975     if ((32 - bitOffset) >= 12):
01976       if (dWordOffset<<2) > self.evt.cont_end:
01977         self.print_EOE_Warning()
01978         stripData.done = 1
01979       else:
01980         # all 12 bits are in this word
01981         stripData.ui = (self.getDWord(dWordOffset) >> (32 - bitOffset - 12)) & 0xFFF
01982     else:
01983       if ((dWordOffset+1)<<2) > self.evt.cont_end:
01984         self.print_EOE_Warning()
01985         stripData.done = 1
01986       else:
01987         # need to sew bits together across word boundary
01988         stripData.ui = (((self.getDWord(dWordOffset)   << ( 12 - ( 32 - bitOffset))) & 0xFFF) | \
01989                     (self.getDWord(dWordOffset+1) >> ( 32 - ( 12 - ( 32 - bitOffset)))))
01990     return stripData
01991
01992
01993   def __dumpTkrTOT(self, pAccepts, acceptArray, nStrip):
01994     """\brief Decodes all TKR event TOT data and stores them in evt.TKTtots
01995
01996     \param pAccepts    Pointer to 32-bit aligned tracker event data
01997     \param acceptArray Pointer to array of decoded tkr accept vectors
01998     \param nStrip      Number of TKR strips decoded
01999
02000     """
02001     if self.__debugParserOutput:
02002       print("\n   TKR TOT")
02003       print("   ========================================================")
02004       print("   GTCC  | GTRC | TOT    |")
02005       print("   ------+------+--------+")
02006
02007     #determine where TOTs start -- count 8-bit bytes from the begining of the accepts
02008     #accepts bits = 9 bits * 8 GTCC = 72 bits = 9 bytes
02009     #strip bits   = 12 bits * nStrip = (12 bits * nStrip)/8 bytes
02010
02011     #if nStrip is odd then we're on a nibble boundry -- add one more byte
02012
02013     byteSkip = 9 + (( 12 * nStrip ) / 8)
02014     if ( nStrip & 0x1 ):
02015       byteSkip += 1
02016     # foreach GTCC
02017     for i in range(N_GTCC):
02018       # foreach set bit in GTCC accept vector
02019       for j in range(N_GTRC):
02020         if ( (acceptArray[i] >> (N_GTRC - j - 1)) & 0x1):
02021           # print TOT
02022           byteOffset = (pAccepts<<2) + byteSkip
02023           if byteOffset > self.evt.cont_end:
02024             self.print_EOE_Warning()
02025             return -1
02026           tot = self.getByte(byteOffset)
02027           if self.__debugParserOutput:
02028             print("    %d    |  %d   | 0x%02x   |"%(GTCC_MAP[i], j, tot))
02029           byteSkip += 1
02030           self.evt.addTKRtot(GTCC_MAP[i], j, tot)
02031
02032   def evDumpTKR(self):
02033     """\brief Decodes all the TKR event data and stores it in the event object.
02034
02035     """
02036     tkrAcpt = [0]*N_GTCC
02037     nAccept = 0
02038
02039     p = self.evGetTKR_Accepts(tkrAcpt)
02040     if p == -1: return
02041     if self.__debugParserOutput:
02042       print("\n   TKR Accepts")
02043       print("   ========================================================")
02044       #   print("   Raw word 0:  0x%08x\n", p[0])
02045       #   print("   Raw word 1:  0x%08x\n", p[1])
02046       #   print("   Raw word 2:  0x%08x\n", p[2])
02047       print("   ========================================================")
02048       print("   GTCC  |  X/Y  |  L/R  |  E/O  |  Accepts    | Raw")
02049       print("   ------+-------+-------+-------+-------------+-----------")
02050     for i in range(N_GTCC):
02051       if self.__debugParserOutput:
02052         print("    %d    |   %c   | %5s | %4s  |  " % (GTCC_MAP[i],
02053               q(i < 4,'x','y'),
02054               q(((i == 1) | (i == 2) | (i == 4) | ( i == 7)),"right","left"),
02055               q(i % 2,"even","odd"))),
02056       bits = ""
02057       for j in range(N_GTRC):
02058         if ( (tkrAcpt[i] >> (N_GTRC - j - 1)) & 0x1):
02059           bits += "1"
02060           nAccept += 1
02061         else:
02062           bits += "0"
02063       if self.__debugParserOutput:
02064         print("\b%s  | 0x%03x"%(bits,tkrAcpt[i]))
02065     if self.__debugParserOutput:
02066       print("   ------+-------+-------+-------+-------------+-----------")
02067
02068     if (nAccept != 0):
02069       # dump strip data
02070       nStrips = self.__dumpTkrStrip(p, tkrAcpt)
02071
02072       # dump TOT data
02073       self.__dumpTkrTOT(p, tkrAcpt, nStrips)
02074
02075   def evBitCount(self, x):
02076     """\brief Count the number of set bits in x
02077
02078     \param  x 32-bit word value
02079
02080     \return   Set bit count
02081     """
02082     count = 0
02083     for i in range(32):
02084       count = count + (( x >> i ) & 0x1)
02085     return count
02086
02087
02088   def evGetTKR_NumStrips(self):
02089     """Returns number of hit strips in the event
02090
02091     \return Number of hit strips
02092     """
02093     nStrip = 0
02094     tkrAcpt = [0]*N_GTCC
02095
02096     pAccepts = self.evGetTKR_Accepts(tkrAcpt)
02097     if pAccepts == -1: return
02098     stripData = evTKR_Strip(0)
02099     # foreach GTCC
02100     for i in range(N_GTCC):
02101       # foreach set bit in GTCC accept vector
02102       for j in range(N_GTRC):
02103         if ( (tkrAcpt[i] >> (N_GTRC - 1 - j)) & 0x1):
02104           # walk strip data until done bit found
02105           done = 0
02106           while not done:
02107             stripData = self.evGetTKR_StripN(pAccepts, nStrip, stripData)
02108             done = stripData.done
02109             nStrip += 1
02110     return nStrip
02111
02112   def evGetTKR_TOT(self):
02113     """\brief Returns pointer to start of tracker TOT list
02114
02115     \return Offset to the tracker TOT list
02116     """
02117     nStrips = self.evGetTKR_NumStrips()
02118
02119     if nStrips == 0:
02120       return 0
02121
02122
02123     #  the TOTs come after the accepts (72-bits or 9 bytes) and after
02124     #  the strips ( 12-bits per strip ).  If the number of strips is odd
02125     #  we need to add one extra byte.
02126
02127     pTOT = self.evGetTKR_Accepts(None) << 2
02128     pTOT += 9  # size of the accept words
02129     pTOT += (( 12 * nStrips ) / 8) # size of the strip words
02130     pTOT += (nStrips & 0x1)  # pad with one byte if number of strips is odd
02131     return pTOT
02132
02133
02134   def evGetTKR_NumAccepts(self):
02135     """\brief Counts the number of accepted TKR layer-ends.
02136
02137     \return Number of accepted TKR layer-ends.
02138     """
02139     tkrAcpt = [0]*N_GTCC
02140     self.evGetTKR_Accepts(tkrAcpt)
02141
02142     nBits = 0
02143     for i in range(N_GTCC):
02144       nBits += self.evBitCount(tkrAcpt[i])
02145     return nBits
02146
02147
02148   def evGetTEM_Diagnostic(self):
02149     """\brief Returns pointer to start of diagnostic event data.
02150
02151     Caller should check the event summary word if a diagnostic
02152     contribution is present before calling this function.
02153
02154     \return Offset to start of diagnostic event data
02155     """
02156     start = self.evGetTKR_Accepts(None) << 2
02157     nTkrAccepts = self.evGetTKR_NumAccepts()
02158     if nTkrAccepts == 0:
02159       # no tracker strip data, just skip over tracker accept data
02160       end = start + 9
02161     else:
02162       end = self.evGetTKR_TOT() # beginning of TOT data
02163       end += nTkrAccepts # one byte after the TOT data
02164
02165     #  the diagnostic data comes after the tracker data and must be on a
02166     #  32-bit boundary
02167
02168     offset = end - start
02169     #offset = offset + q((offset % 4), 4 - (offset % 4), 0)
02170     if (offset % 4):
02171       offset += (4 - (offset % 4))
02172     return ((start + offset) >> 2)
02173
02174   def evGetTEM_Error(self):
02175     """\brief Returns pointer to the error word contribution of event data.
02176
02177     Caller should check the event summary word if an error
02178     contribution is present before calling this function.
02179
02180     \return Offset to the error word contribution
02181     """
02182     # the error contribution comes after the diagnostic contribution
02183     pErr = self.evGetTEM_Diagnostic()
02184     # check if we have a diagnostic contribution
02185     es = self.evt.summary
02186     if es.diag:
02187       # skip over diagnostic contribution
02188       pErr += (evDiag_Data.size >> 2)
02189     return pErr
02190
02191
02192   def __dumpErrGCCC(self, es, pErr, nWord, forcePrint=0):
02193     """\brief Decodes the GCCC error contribution.
02194
02195     \param  es         Error summary 16-bit word
02196     \param  pErr       Pointer to 16-bit aligned tower event error contribution
02197     \param  nWord      Index into begining of error data
02198     \param  forcePrint If specified, dump the error even if in non-debug mode
02199
02200     \return            Current offset into the error contribution
02201     """
02202     errSummary = es
02203
02204     if self.__debugParserOutput or forcePrint: print
02205
02206     # loop over 4 GCCC
02207     for gcccId in range(N_GCCC):
02208       # test summary bit for this GCCC
02209       if ( ( errSummary.gcccErr >> gcccId) & 0x1 ):
02210         # dump the error message
02211         idx = nWord
02212         nWord += 1
02213         errLen = self.getWord(pErr+idx)
02214         if self.__debugParserOutput or forcePrint:
02215           print("GCCC error word count %d" % errLen)
02216         # obtained "mapped GCCC" number
02217         mGCCC = GCCC_MAP[gcccId]
02218         #layer = q(( mGCCC % 2 ),'y','x')
02219         if (mGCCC % 2):
02220           layer = 'y'
02221         else:
02222           layer = 'x'
02223         while (errLen):
02224           errLen -= 1
02225           idx = nWord
02226           nWord += 1
02227           errGCCC = evErr_GCCC(self.getWord(pErr+idx))
02228           self.evt.addErrGCCCmsg(evErr_GCCC_Message(mGCCC, errGCCC))
02229           if errGCCC.errType == 0:
02230             # start bit missing
02231             if self.__debugParserOutput or forcePrint:
02232               print("   GCCC %d Start Bit Missing: raw ( 0x%04x )" % (mGCCC, errGCCC.ui))
02233           elif errGCCC.errType == 1:
02234             # parity error
02235             if self.__debugParserOutput or forcePrint:
02236               print("   GCCC %d Parity Error: raw ( 0x%04x )\n" % (mGCCC, errGCCC.ui))
02237           else:
02238             # unknown GCCC error message
02239             print("****************************************************")
02240             print("**")
02241             print("** Unknown GCCC error message type:  %d\n" % errGCCC.errType)
02242             print("** Raw value                      :  0x%04x" % errGCCC.ui)
02243             print("**")
02244             print("****************************************************")
02245             return nWord
02246           # both error types have the same display format
02247           if self.__debugParserOutput or forcePrint:
02248             print("   ================================================")
02249             print("   | %c%d- | %c%d- | %c%d+ | %c%d+ | Sweep | Type |" %
02250               (layer, q(( mGCCC % 2 ) , (mGCCC + 2)%4 , mGCCC + 1),
02251                layer, q(( mGCCC % 2 ) , (mGCCC + 1)%4 , mGCCC),
02252                layer, q(( mGCCC % 2 ) , (mGCCC + 2)%4 , mGCCC + 1),
02253                layer, q(( mGCCC % 2 ) , (mGCCC + 1)%4 , mGCCC)
02254               )
02255             )
02256             print("   ------+-----+-----+-----+-------+------+--------")
02257             print("   | %d%d  | %d%d  | %d%d  | %d%d  |   %d   |  %d   |" %
02258               ((errGCCC.errParm >> 7) & 0x1, (errGCCC.errParm >> 6) & 0x1,
02259                (errGCCC.errParm >> 5) & 0x1, (errGCCC.errParm >> 4) & 0x1,
02260                (errGCCC.errParm >> 3) & 0x1, (errGCCC.errParm >> 2) & 0x1,
02261                (errGCCC.errParm >> 1) & 0x1, (errGCCC.errParm     ) & 0x1,
02262                errGCCC.sweepNum, errGCCC.errType
02263               )
02264             )
02265             print("   ------------------------------------------------")
02266             print
02267     return nWord
02268
02269
02270   def __dumpErrGTCC(self, es, pErr, nWord, forcePrint=0):
02271     """\brief Decodes the GTCC error contribution.
02272
02273     \param  es         Error summary 16-bit word
02274     \param  pErr       Pointer to 16-bit aligned tower event error contribution
02275     \param  nWord      Index into begining of error data
02276     \param  forcePrint If specified, dump the error even if in non-debug mode
02277
02278     \return            Current offset into the error contribution
02279     """
02280     errSummary = es
02281
02282     # loop over 8 GTCC
02283     for gtccId in range(N_GTCC):
02284       # test summary bit for this GTCC
02285       if ( ( errSummary.gtccErr >> gtccId) & 0x1 ):
02286         # dump the error message
02287         errLen = curErrLen = self.getWord(pErr+nWord)
02288         # loop over all errors
02289         while (curErrLen):
02290           curErrWords = 0
02291           errGTCCmsg = evErr_GTCC_Message()
02292           errGTCC = evErr_GTCC(self.getWord(pErr+nWord+curErrLen))
02293           errGTCCmsg.errGTCC = errGTCC
02294           errGTCCmsg.gtcc = GTCC_ERR_MAP[gtccId]
02295           self.evt.addErrGTCCmsg(errGTCCmsg)
02296           if self.__debugParserOutput or forcePrint:
02297             print
02298             print ("   GTCC %d, GTRC %d Error Message: raw ( 0x%04x )" %
02299                     ( errGTCCmsg.gtcc,
02300                       errGTCC.nGTRC,
02301                       errGTCC.ui
02302                     )
02303                   )
02304             print("   ================================================")
02305           # process error bits from LSB upto LSB
02306           if errGTCC.phsGTRC:
02307             # print GTRC error parameter from stack
02308             curErrWords+=1
02309             err = self.getWord(pErr+nWord+curErrLen-curErrWords)
02310             errGTCCmsg.parameters['PHS_GTRC'] = err
02311             if self.__debugParserOutput or forcePrint:
02312               print("   GTRC Phasing Error:   0x%04x" % err)
02313               print("   =============+=============")
02314               print("       Layer    |     Tag")
02315               print("   Rcvd   Expct | Rcvd   Expct")
02316               print("   =============+=============")
02317               print("    %02d     %02d   |  %d      %d" % ((err>>12) & 0xF, (err>>8) & 0xF, (err>>2) & 0x3, err & 0x3))
02318               print
02319           if ( errGTCC.phsGTFE):
02320             # print 5 GTFE error parameters from stack -- comes before
02321             # FIFO FULL error words if any.
02322             errGTCCmsg.parameters['PHS_GTFE'] = []
02323             for i in range(5):
02324               gtfePhs = self.getWord(pErr+nWord+curErrLen-curErrWords-5+i)
02325               errGTCCmsg.parameters['PHS_GTFE'].append(gtfePhs)
02326               if self.__debugParserOutput or forcePrint:
02327                 print("   GTFE Phasing Error:   0x%04x\n" % gtfePhs)
02328             curErrWords += 5
02329           if errGTCC.fifoFull:
02330             #  print 1 error parameter from stack -- last word on parameter stack, immediately
02331             #  before the error word.
02332             curErrWords+=1
02333             errGTCCmsg.parameters['FIFO_FULL'] = self.getWord(pErr+nWord+curErrLen-curErrWords)
02334             if self.__debugParserOutput or forcePrint:
02335               print("   FIFO Full Error:   0x%04x\n" % errGTCCmsg.parameters['FIFO_FULL'])
02336           if self.__debugParserOutput or forcePrint:
02337             if errGTCC.cblTimeOut:
02338                 print("   Cable Timeout Error")
02339             if errGTCC.hdrParity:
02340                 print("   Header Parity Error")
02341             if errGTCC.wrdCntParity:
02342                 print("   Word Count Parity Error")
02343             if errGTCC.GTRCsum:
02344                 print("   GTRC Summary Error")
02345             if errGTCC.dataParity:
02346                 print("   Data Parity Error")
02347           curErrLen -= curErrWords + 1
02348         if self.__debugParserOutput or forcePrint:
02349           print("   ------------------------------------------------")
02350           print
02351         nWord += errLen + 1
02352     return nWord
02353
02354   def __dumpErrCablePhase(self, pErr, nWord, forcePrint=0):
02355     """\brief Decodes the cable phase error contribution.
02356
02357     \param  pErr       Pointer to 16-bit aligned tower event error contribution
02358     \param  nWord      Index into begining of error data
02359     \param  forcePrint If specified, dump the error even if in non-debug mode
02360
02361     \return            Current offset into the error contribution
02362     """
02363
02364     # decode cable phase error structure
02365     cblPhs = evErr_CablePhase(self.getWord(pErr+nWord))
02366     self.evt.errCablePhase = cblPhs
02367     if self.__debugParserOutput or forcePrint:
02368       print("   Cable Controller Phasing Error: raw ( 0x%04x )" % cblPhs.ui)
02369       print("   ================================================")
02370       print("   GTCC |"),
02371     # loop over 8 GTCCs
02372       for i in range(N_GTCC):
02373         print("\b %d |" % GTCC_ERR_MAP[7 - i]),
02374       print
02375       print("   -----+"),
02376       # loop over 8 GTCCs
02377       for i in range(N_GTCC):
02378         print("\b---+"),
02379       print
02380       print("   Tag  |"),
02381       # loop over 8 GTCCs
02382       for i in range(N_GTCC):
02383         print("\b %d |" % (cblPhs.ui >> ((7-i) << 1) & 0x3)),
02384       print
02385       print("   ------------------------------------------------")
02386       print
02387
02388     # increment past cable phase error
02389     return nWord+1
02390
02391
02392   def __dumpErrCableTimeOut(self, pErr, nWord, forcePrint=0):
02393     """\brief Decodes the cable timeout error contribution.
02394
02395     \param  pErr       Pointer to 16-bit aligned tower event error contribution
02396     \parm   nWord      Index into begining of error data
02397     \param  forcePrint If specified, dump the error even if in non-debug mode
02398
02399     \return            Current offset into the error contribution
02400     """
02401     cblTimeOut = evErr_CableTimeOut(self.getWord(pErr+nWord))
02402     self.evt.errCableTimeOut = cblTimeOut
02403     if self.__debugParserOutput or forcePrint:
02404       print("   Cable Time Out Error: raw ( 0x%04x )" % cblTimeOut.ui)
02405       print("   ================================================")
02406       print("   GCCC | "),
02407     # loop over 4 GCCCs
02408       for i in range(N_GCCC):
02409         if (cblTimeOut.ui >> i) & 0x1:
02410           print("\b%d  " % GCCC_MAP[i]),
02411       print
02412       print("   ------------------------------------------------")
02413       print("   GTCC | "),
02414     # loop over 8 GTCCs
02415       for i in range(N_GTCC):
02416         if (cblTimeOut.ui >> (i+4)) & 0x1:
02417           print("\b%d  " % GTCC_ERR_MAP[i]),
02418       print
02419       print("   ------------------------------------------------")
02420       print
02421
02422     # increment past cable timeout error
02423     return nWord+1
02424
02425
02426   def evDumpTEM_Error(self, forcePrint=0):
02427     """\brief Decodes the event error contribution.
02428
02429     If an error contribution is present this prints up to 20 16-bit
02430     words of the error contribution.
02431
02432     \param  forcePrint If specified, dump the error even if in non-debug mode
02433     """
02434     errWord = 0
02435
02436     # check if we have an error contribution
02437     es = self.evt.summary
02438     if ( es.error == 0):
02439       return 0
02440
02441     pErr = self.evGetTEM_Error() << 1
02442     errVal = self.getWord(pErr+errWord)
02443     if errVal:
02444       if self.__debugParserOutput or forcePrint:
02445         print ("   Event Error Info")
02446         print ("   ================================================")
02447
02448       if self.__debugParserOutput or forcePrint:
02449         # print 16-bit error words
02450         errPtr = pErr
02451         i = 0
02452         while errPtr < self.evt.cont_size / 2:
02453           print ("    raw %d: 0x%04x" % (i, self.getWord(errPtr)))
02454           errPtr = errPtr + 1
02455           i += 1
02456           if i > 20: break
02457         print
02458
02459       # print error summary
02460       errSummary = evErr_Summary(errVal)
02461       self.evt.errSummary = errSummary
02462       if self.__debugParserOutput or forcePrint:
02463         print("   Error Summary: raw ( 0x%04x )" % errSummary.ui)
02464         print("   ================================================")
02465         print("   | cbl t/o | cbl phs |    TKR    |   CAL ")
02466         print("   ----------+---------+-----------+---------------")
02467       gtccErrBits = ""
02468       for i in range(N_GTCC):
02469         if ( (errSummary.gtccErr >> (7-i)) & 0x1):
02470           gtccErrBits = gtccErrBits + "1"
02471         else:
02472           gtccErrBits = gtccErrBits + "0"
02473       gcccErrBits = ""
02474       for i in range(4):
02475         if ( (errSummary.gcccErr >> (3-i)) & 0x1):
02476           gcccErrBits += "1"
02477         else:
02478           gcccErrBits += "0"
02479       if self.__debugParserOutput or forcePrint:
02480         print("   |    %d    |    %d    |  %s |  %s" % (errSummary.cblTimeOut, errSummary.cblPhsErr, gtccErrBits, gcccErrBits))
02481         print("   ------------------------------------------------")
02482
02483       # increment error pointer past error summary word
02484       errWord += 1
02485
02486       # error contributions are order as the LSB of the error summary,
02487       # i.e. the contributions come as: CAL, TKR, cable timeout, cable phase
02488
02489       if errSummary.gcccErr:
02490         errWord = self.__dumpErrGCCC( errSummary, pErr, errWord, forcePrint)
02491       if errSummary.gtccErr:
02492         errWord = self.__dumpErrGTCC( errSummary, pErr, errWord, forcePrint)
02493       if errSummary.cblPhsErr:
02494         errWord = self.__dumpErrCablePhase( pErr, errWord, forcePrint)
02495       if errSummary.cblTimeOut:
02496         errWord = self.__dumpErrCableTimeOut( pErr, errWord, forcePrint)
02497
02498       if self.__debugParserOutput or forcePrint:
02499         print("   ------------------------------------------------")
02500
02501     return 0
02502
02503   def __dumpCalDiag(self, diag):
02504     """\brief Decodes all the Calorimeter diagnostic info
02505
02506     \param diag Pointer to event diagnostic data
02507     """
02508     print("   Calorimeter Diagnostic Data")
02509     print("   ================================================")
02510
02511     for i in range(len(diag.cal)):
02512       print("                     layer %s    GCCC %d" % (diag.cal[i].layer, diag.cal[i].gccc ))
02513       print("               ----------------+-------------------")
02514       print("                Neg Layer-End  |  Pos Layer-End")
02515       print("               ----------------+-------------------")
02516       print("   Log Accepts "),
02517       nle_str = ""
02518       ple_str = ""
02519       for j in range(N_GCFE):
02520         if (diag.cal[i].negLayerEnd.logAccepts >> j) & 0x1:
02521           nle_str += "1"
02522         else:
02523           nle_str += "0"
02524       for j in range(N_GCFE):
02525         if (diag.cal[i].posLayerEnd.logAccepts >> j) & 0x1:
02526           ple_str += "1"
02527         else:
02528           ple_str += "0"
02529       print("%s   |  %s") % (nle_str, ple_str)
02530       print("               ----------------+-------------------")
02531       print("   Trg Low Eng         %d       |        %d" %
02532         (diag.cal[i].negLayerEnd.trgRequestLow, diag.cal[i].posLayerEnd.trgRequestLow))
02533       print("               ----------------+-------------------")
02534       print("   Trg High Eng        %d       |        %d" %
02535         (diag.cal[i].negLayerEnd.trgRequestHigh, diag.cal[i].posLayerEnd.trgRequestHigh))
02536       print("               ------------------------------------\n")
02537
02538   def __dumpTkrDiag(self, diag):
02539     """\brief Decodes all the tracker diagnostic info
02540
02541     \param diag Pointer to event diagnostic data
02542
02543     """
02544     print("   Tracker Diagnostic Data")
02545     print("   =============================")
02546
02547     print("   GTCC     | Trigger Request (GTRC)")
02548     print("   ---------+-------------------")
02549
02550     for i in range(len(diag.tkr)):
02551       print("   GTCC_%d   | " % diag.tkr[i].gtcc),
02552       trq_str = ""
02553       for j in range(N_GTRC):
02554         if (diag.tkr[i].trgRequests >> (N_GTRC - 1 - j)) & 0x1:
02555           trq_str += "1"
02556         else:
02557           trq_str += "0"
02558       print("%s" % trq_str)
02559       print("   ---------+-------------------")
02560     print
02561
02562   def evDumpDiagnostic(self):
02563     """\brief Decodes the event diagnostic contribution
02564
02565     """
02566
02567     # check if we have a diagnostic contribution
02568     es = self.evt.summary
02569     if es.diag == 0:
02570       return 0
02571
02572     pDiag = self.evGetTEM_Diagnostic() << 1
02573     if pDiag:
02574       diag = evDiag_Data()
02575       for i in range(len(diag.cal)):
02576         diag.cal[i].gccc           = GCCC_MAP[i>>1]
02577         diag.cal[i].layer          = "%c%d" % (q(i<4,'x','y'), i%4)
02578         diag.cal[i].negLayerEnd.ui = self.getWord(pDiag)
02579         pDiag += 1
02580         diag.cal[i].posLayerEnd.ui = self.getWord(pDiag)
02581         pDiag += 1
02582       for i in range(len(diag.tkr)):
02583         diag.tkr[i].ui = self.getWord(pDiag)
02584         diag.tkr[i].gtcc = GTCC_MAP[i]
02585         pDiag += 1
02586       self.evt.diag = diag
02587       if self.__debugParserOutput:
02588         # print out the diagnostic
02589         print("\n   Event Diagnostic Info")
02590         print("   ================================================\n")
02591         self.__dumpCalDiag( diag)
02592         self.__dumpTkrDiag( diag)
02593         print("   End of Event Diagnostic Info")
02594         print("   ================================================")
02595         print
02596     return 1
02597
02598   def evDumpSummary(self, minEvSize=24):
02599     """\brief Decodes the event summary word.
02600
02601     Given a pointer to tower event contribution print the event summary word.
02602
02603     \param minEvSize Minimum event size w/o error (default=24)
02604     """
02605     es = self.evt.summary
02606     print
02607     print("   Event Contribution Size (bytes): %d" % self.evt.cont_size)
02608     if self.evt.cont_size < minEvSize:
02609       print
02610       print("   *** WARNING *** WARNING *** WARNING *** WARNING ***")
02611       print("   *** Event size less than minimal bytes (%d)     ***" % minEvSize)
02612       print("   *** WARNING *** WARNING *** WARNING *** WARNING ***")
02613     print("   Event Contribution Source Addr : 0x%02x" % self.evt.contributor)
02614     print("   Event Contribution Summary Word: 0x%08x" % es.ui)
02615     print("   =====================================")
02616     print("   %-20s: %05d-%02d" % ("Event Number-Tag", es.evNumber, es.tag))
02617     print("   =====================================")
02618     print("   %-20s: %d" % ("Error", es.error))
02619     print("   %-20s: %d" % ("TRG Parity Error", es.trgParityErr))
02620     print("   =====================================")
02621     print("   %-20s: %d" % ("Diagnostic", es.diag))
02622     print("   %-20s: %d" % ("Cal Strobe", es.calStrobe))
02623     print("   %-20s: %d" % ("Readout 4", es.readout4))
02624     print("   %-20s: %d" % ("Zero suppress", es.zeroSuppress))
02625     print("   %-20s: %d" % ("TACK", es.TACK))
02626     print("   %-20s: %d" % ("Marker", es.marker))
02627
02628     if es.error or es.trgParityErr:
02629       print
02630       print("   *** WARNING *** WARNING *** WARNING *** WARNING ***")
02631       print("   *** This event has errors -- See Summary Word   ***")
02632       print("   *** WARNING *** WARNING *** WARNING *** WARNING ***")
02633     return 0
02634
02635   def __dumpAEMvec(self, cbl, type):
02636     """\brief Decodes the set bits specified by \a cbl and \a type
02637
02638     This method is used by the old AEM event parser evDumpEventAEM_G2
02639
02640     \param cbl  Which cable is being decoded
02641     \param type ACD vector type 1-veto, 2-zs
02642     """
02643     hitVect = self.evGetAEM_Vec(cbl, type)
02644     if self.__debugParserOutput:
02645       print("    %02d             " % cbl),
02646       for i in range(N_GAFE):
02647         print("%d" % ((hitVect >> i) & 0x1)),
02648       print("  0x%05x" % hitVect)
02649       print("   -----   ---------------------------------------------------------")
02650
02651   def __dumpAEMlist(self, type):
02652     """\brief Decodes the list of hit vectors specified by \a type.
02653
02654     This method is used by the old AEM event parser evDumpEventAEM_G2
02655
02656     This function is used to decode the AEM Veto List and the AEM Accepts List.
02657
02658     \param type ACD vector type
02659     """
02660     if self.__debugParserOutput:
02661       print("   -----   ---------------------------------------------------------")
02662       print("   Cable   Channel "),
02663       # number channels 17 down to 0
02664       for i in range(8):
02665         print("1"),
02666       for i in range(10):
02667         print("0"),
02668       print("  Raw")
02669       print("                   "),
02670       for i in range(17, -1, -1):
02671         print("%d" % (i % 10)),
02672       print
02673       print("   -----   ---------------------------------------------------------")
02674
02675     # find i_th 18 bit word
02676     for i in range(N_GARC):
02677       self.__dumpAEMvec(i, type)
02678
02679   def evDumpAEM_Vetos(self):
02680     """\brief Decodes the AEM veto hit list contribution
02681
02682     This method is used by the old AEM event parser evDumpEventAEM_G2
02683
02684     """
02685     if self.__debugParserOutput:
02686       print("\n   AEM Veto Hit Vectors")
02687       print("   =================================================================")
02688     self.__dumpAEMlist(AEM.EV_AEM_VETO)
02689     return 0
02690
02691   def __getCblDataAEM(self, cbl):
02692     """\brief Returns pointer to AEM event data header for cable specified by \a cbl.
02693
02694     This method is used by the old AEM event parser evDumpEventAEM_G2
02695
02696     \param  cbl Which cable is being decoded
02697     \return     Offset to the AEM event data header
02698     """
02699     # the data begins one word after the event summary
02700     pCur = (self.evGetSummary() + 1) << 1
02701     while (cbl):
02702       # skip to the third word and test the "PHAs Follow" bit
02703       pCur += 2
02704       if self.getWord(pCur) & (0x1 <<10):
02705         # walk PHAs
02706         pCur += 1
02707         morePHAs = 1
02708         while (morePHAs):
02709           # check bit 15 for more PHAs
02710           morePHAs = self.getWord(pCur) & 0x4000
02711           pCur += 1
02712       else:
02713         pCur += 1
02714       cbl -= 1
02715     return pCur
02716
02717   def evDumpAEM_Accepts(self):
02718     """\brief Decodes the AEM accept list contribution
02719
02720     This method is used by the old AEM event parser evDumpEventAEM_G2
02721
02722     """
02723     if self.__debugParserOutput:
02724       print("\n   AEM Accept Hit Vectors")
02725       print("   =================================================================")
02726     self.__dumpAEMlist(AEM.EV_AEM_ZEROSUP)
02727     return 0
02728
02729   def evGetAEM_PHA(self, cbl):
02730     """\brief Returns pointer to start of AEM PHA values
02731
02732     This method is used by the old AEM event parser evDumpEventAEM_G2
02733
02734     \param cbl Which cable is being decoded
02735     """
02736     # fetch pointer to header for requested cable
02737     pHdr = self.__getCblDataAEM(cbl)
02738     # check "has PHA" bit is set
02739     if self.getWord(pHdr+2) & (0x1 << 10):
02740       # return pointer to first PHA value
02741       pPHA = pHdr+3
02742     else:
02743       pPHA = None
02744     return pPHA
02745
02746   def evGetAEM_Vec(self, cbl, type):
02747     """\brief Returns the 18-bit vector for cable specified by \a cbl and \a type
02748
02749     This method is used by the old AEM event parser evDumpEventAEM_G2
02750
02751     \param  cbl  Which cable is being decoded
02752     \param  type ACD vector type
02753     \return      18-bit vector
02754
02755     """
02756     # fetch pointer to header for requested cable
02757     pHdr = self.__getCblDataAEM(cbl)
02758
02759     if ( type == AEM.EV_AEM_VETO):
02760       # decode veto vector
02761       vec = ((self.getWord(pHdr) << 3) | (self.getWord(pHdr+1) >> 13)) & 0x3FFFF
02762       self.evt.aem.vetoHitVectors[cbl] = vec
02763     elif ( type == AEM.EV_AEM_ZEROSUP ):
02764       # decode zero suppress vector
02765       vec = ((self.getWord(pHdr+1) << 5) | (self.getWord(pHdr+2) >> 11)) & 0x3FFFF
02766       self.evt.aem.acceptHitVectors[cbl] = vec
02767     else:
02768       vec = 0
02769
02770     return vec
02771
02772
02773   def evDumpAEM_PHA(self):
02774     """\brief Decodes the AEM PHA contribution.
02775
02776     This method is used by the old AEM event parser evDumpEventAEM_G2
02777
02778     Given a pointer to AEM event contribution print the PHA values.
02779     """
02780     if self.__debugParserOutput:
02781       print("\n   AEM PHA Values")
02782       print("   ================================================================")
02783       print("   ** Warning:  This decoder assumes GARC register MAX_PHA = 18")
02784       print("   ** and GARC registers PHA_EN_0/1 = 0xFFFF.")
02785       print("   ================================================================\n")
02786       print("   ----+-----+-------+------------+--------------------")
02787       print("   Cbl   Rng    ADC    Parity Err    Raw")
02788       print("   ----+-----+-------+------------+--------------------")
02789
02790     for cbl in range(N_GARC):
02791       # do we have any PHAs for this cable ?
02792       pRaw = self.evGetAEM_PHA(cbl)
02793       if pRaw != None:
02794         if ( self.getWord(pRaw) == 0 ):
02795           # null terminator PHA value -- go to next cable
02796           continue
02797         morePHAs = 1
02798         while (morePHAs):
02799           pha = evAEM_PHA(self.getWord(pRaw))
02800           self.evt.aem.addPHA(cbl, pha)
02801           pRaw += 1
02802           if self.__debugParserOutput:
02803             print("    %02d    %d    0x%03x      %d         0x%04x" % (cbl, pha.range, pha.ADC, pha.parityErr, pha.ui))
02804           # check bit 15 for more PHAs
02805           morePHAs = pha.more
02806
02807     if self.__debugParserOutput:
02808       print("   ----------------------------------------------------\n")
02809
02810     return 0
02811
02812
02813 # @fn       unsigned int evDumpEventAEM( unsigned int *pEv)
02814 # @param pEv pointer to 32-bit aligned AEM event contribution
02815 # @brief    Decodes the event contribution
02816 # @return   OK
02817
02818   def evDumpEventAEM_G2(self):
02819     """\brief Given a pointer to AEM event contribution print its contents.
02820
02821     This method is the old G2 compatible AEM event parser, please use the new
02822     event parser evDumpEventAEM for G3 based AEM events.
02823
02824     """
02825     if self.__debugParserOutput:
02826       # minimum event size is 24
02827       self.evDumpSummary(24)
02828
02829     self.evDumpAEM_Vetos()
02830     self.evDumpAEM_Accepts()
02831     self.evDumpAEM_PHA()
02832     # evDumpAEM_Error()
02833     return 0
02834
02835
02836   def evDumpEventAEM(self):
02837     """\brief The new AEM event parsing routine.
02838
02839     This parser works according to the latest specs
02840     where not all cable contributions are guaranteed to
02841     be provided.
02842     """
02843     self.evt.aem.clearEvent()
02844     if self.__debugParserOutput:
02845       # minimum contribution size is 16
02846       self.evDumpSummary(16)
02847     # the data begins one word after the event summary
02848     pHdr = (self.evGetSummary() + 1) << 1
02849     endOfCables = 0
02850     while not endOfCables:
02851       # Skip to the third word to check end of cables and cable number
02852       cblHdr3 = self.getWord(pHdr+2)
02853       cblNo = (cblHdr3 >> 4) & 0xF
02854       endOfCables = (cblHdr3 >> 8) & 0x1
02855       # Check if there are no contributions
02856       if endOfCables and cblNo == 0xF:
02857         break
02858       # decode veto vector
02859       vec = ((self.getWord(pHdr) << 3) | (self.getWord(pHdr+1) >> 13)) & 0x3FFFF
02860       self.evt.aem.vetoHitVectors[cblNo] = vec
02861       # decode zero suppress vector
02862       vec = ((self.getWord(pHdr+1) << 5) | (self.getWord(pHdr+2) >> 11)) & 0x3FFFF
02863       self.evt.aem.acceptHitVectors[cblNo] = vec
02864       # check "has PHA" bit is set
02865       if cblHdr3  & (0x1 << 10):
02866         pPHA = pHdr + 3
02867         morePHAs = 1
02868         while (morePHAs):
02869           pha = evAEM_PHA(self.getWord(pPHA))
02870           self.evt.aem.addPHA(cblNo, pha)
02871           pPHA += 1
02872           morePHAs = pha.more
02873         pHdr = pPHA
02874       else:
02875         pHdr += 3
02876     if self.__debugParserOutput:
02877       # Dump the hit vectors
02878       for typ in (AEM.EV_AEM_VETO, AEM.EV_AEM_ZEROSUP):
02879         if typ == AEM.EV_AEM_VETO:
02880           print("\n   AEM Veto Hit Vectors")
02881         else:
02882           print("\n   AEM Accept Hit Vectors")
02883         print("   =================================================================")
02884         print("   -----   ---------------------------------------------------------")
02885         print("   Cable   Channel "),
02886         # number channels 17 down to 0
02887         for i in range(8):
02888           print("1"),
02889         for i in range(10):
02890           print("0"),
02891         print("  Raw")
02892         print("                   "),
02893         for i in range(17, -1, -1):
02894           print("%d" % (i % 10)),
02895         print
02896         print("   -----   ---------------------------------------------------------")
02897         cbl = 0
02898         if typ == AEM.EV_AEM_VETO:
02899           hitVect = self.evt.aem.vetoHitVectors
02900         else:
02901           hitVect = self.evt.aem.acceptHitVectors
02902         for vec in hitVect:
02903           print("    %02d             " % cbl),
02904           for i in range(N_GAFE):
02905             print("%d" % ((vec >> i) & 0x1)),
02906           print("  0x%05x" % vec)
02907           print("   -----   ---------------------------------------------------------")
02908           cbl += 1
02909
02910       # Dump the PHA values
02911       print("\n   AEM PHA Values")
02912       print("   ================================================================")
02913       print("   ** Warning:  This decoder assumes GARC register MAX_PHA = 18")
02914       print("   ** and GARC registers PHA_EN_0/1 = 0xFFFF.")
02915       print("   ================================================================\n")
02916       print("   ----+-----+-------+------------+--------------------")
02917       print("   Cbl   Rng    ADC    Parity Err    Raw")
02918       print("   ----+-----+-------+------------+--------------------")
02919
02920       cablesWithPHA = self.evt.aem.PHA.keys()
02921       cablesWithPHA.sort()
02922       for cbl in cablesWithPHA:
02923         phaVect = self.evt.aem.PHA[cbl]
02924         for pha in phaVect:
02925           print("    %02d    %d    0x%03x      %d         0x%04x" %
02926                    (cbl, pha.range, pha.ADC, pha.parityErr, pha.ui) )
02927       print("   ----------------------------------------------------\n")
02928
02929
02930   def print_EOE_Warning(self):
02931     """\brief Print warning if we have reached the end of the contribution prematurely
02932
02933     """
02934     if self.__debugWarnings:
02935       log.error("   *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING ***")
02936       log.error("   *** Reached the end of event data while parsing             ***")
02937       log.error("   ***               This event is suspect                     ***")
02938       log.error("   *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING ***")
02939       logStack()
02940
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gEvtCliBT.py Source File

gEvtCliBT.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2006
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Replacement evtCli class for event merging"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "6/29/2006"
00014 __updated__  = ("$Date: 2006/07/19 16:24:56 $").split(' ')[1]
00015 __version__  = "$Revision: 1.2 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import struct
00022 from   array                              import array
00023 from   select                             import select
00024 import Queue
00025 import time
00026
00027 import LDF
00028
00029 from   LATTE.client.gEvtCli               import EvtCli, EvtCliIO
00030 from   LATTE.client.gSocket               import Socket
00031
00032 import LATTE.merger.geb                   as     geb
00033 from   LATTE.merger.ldfContribution       import LdfContribution
00034 from   LATTE.merger.ancillaryContribution import AncillaryContribution
00035
00036
00037 class SocketClosed(Exception):  pass
00038
00039 class LdfContributor(geb.GebContributor):
00040   """!\brief Concrete contributor class specifically meant to work with EvtCli.
00041   """
00042   def __init__(self, evtCli, offset = 1L):
00043     geb.GebContributor.__init__(self)
00044     self.__socket    = evtCli           # Must be a Socket object
00045     self.__timeout   = 1                # Same as EvtCliIO.__timeout
00046     self.__offset    = offset
00047
00048   def name(self):
00049     return "LdfContributor"
00050
00051   def sequence(self, sequence):
00052     """!\brief Method for remapping the ancillary contribution's sequence number
00053     into the same space as the other contributions' sequence numbers.
00054
00055     This method has the side effect that it can affect the next the value
00056     returned, so it assumes that it is called with sequential sequence numbers.
00057     This would be a problem if were called multiple times to retrieve the
00058     sequence number for the same sequence number.
00059     \todo Fix the side effect nature of this routine
00060     """
00061     # offset does double duty by compensating for the off-by-one nature of the
00062     # two event number spaces and by keeping track of the event number extention
00063     # needed to handle the raw 17 bit event number roll-over problem
00064     seq = sequence - self.__offset
00065     if sequence == 0x0001ffff:  self.__offset -= 0x00020000L
00066     return seq
00067
00068   def open(self):
00069     # Wait for the socket to be created
00070     while self.__socket.socket() is None:
00071       time.sleep(0.1)
00072
00073   def close(self):
00074     self.__quit = True
00075
00076   def read(self):
00077     """!\brief Method to read an LDF contribution from a socket.
00078     """
00079     markerMsk   = 0x7 << 22
00080     sweepFld    = 0x5 << 22             # Marker 5
00081     hdrLen      = 8
00082     self.__quit = 0
00083     rd, wr, ex = select([self.__socket.socket()], [], [], self.__timeout)
00084     while not self.__quit:
00085       if rd:
00086         data   = self.__socket.recvall(4 + hdrLen) # "4 +" for leading status
00087         status, typeId, length = struct.unpack('>3L', data)
00088         if status != 0:
00089           # Don't try to continue if bad status
00090           raise KeyError, "LdfContributor.read: Bad ocsmanager status %08x" % (status)
00091         if typeId != LDF.LATdatagram.ID:
00092           # Don't try to continue if bad typeId: we're lost or it's undefined
00093           raise KeyError, "LdfContributor.read: Unrecognized contribution %08x"%(typeId)
00094         data = self.__socket.recvall(length - hdrLen) # Only the LATcontribution(s) portion
00095         summary = struct.unpack('>L', data[3*4 : 4*4])[0]
00096         if (summary & markerMsk) == sweepFld:
00097           return geb.Geb.Sweep, status, LdfContribution(self, data)
00098         else:
00099           return geb.Geb.Build,     status, LdfContribution(self, data)
00100
00101       rd, wr, ex = select([self.__socket.socket()], [], [], self.__timeout)
00102
00103     return geb.Geb.Terminate, None, None
00104
00105
00106 class AncillaryContributor(geb.GebContributor):
00107   """!\brief Concrete contributor class specifically meant to work with EvtCli.
00108   """
00109   __typeIds = [AncillaryContribution.HeaderId,
00110                AncillaryContribution.TrailerId,
00111                AncillaryContribution.EventId]
00112   def __init__(self, (host, port), offset = 0L):
00113     geb.GebContributor.__init__(self)
00114     self.__socket    = Socket(port)
00115     self.__timeout   = 1                # Same as EvtCliIO.__timeout
00116     self.__host      = host
00117     self.__port      = port
00118     self.__offset    = offset
00119
00120   def name(self):
00121     return "AncContributor"
00122
00123   def sequence(self, sequence):
00124     """!\brief Method for remapping the ancillary contribution's sequence number
00125     into the same space as the other contributions' sequence numbers.
00126     """
00127     # offset does double duty by compensating for the off-by-one nature of the
00128     # two event number spaces and by keeping track of the event number extention
00129     # needed to handle the raw 17 bit event number roll-over problem
00130     seq = sequence - self.__offset
00131     if sequence == 0x0fffffff:  self.__offset -= 0x10000000L
00132     return seq
00133
00134   def open(self):
00135     """!\brief Method to open and connect to the server socket.
00136     It retries until a connection can be established, or the quit flag
00137     is seen to be set.
00138     """
00139     self.__quit = False
00140     while not self.__quit:
00141       try:
00142         self.__socket.connect(self.__host)
00143         break
00144       except Exception, e:
00145         import logging
00146         logging.debug("AncillaryContributor.open: %s" % (e))
00147         time.sleep(1.0)                 # Don't retry too quickly
00148     import logging
00149     logging.debug("AncillaryContributor.open: socket opened")
00150
00151   def close(self):
00152     """!\brief Method to signal the read loop to exit.
00153     """
00154     self.__quit = True
00155
00156   def read(self):
00157     """!\brief Method to read an ancillary contribution from a socket.
00158
00159     This method deals with reconnecting when the server restarted.
00160     """
00161     self.__quit = 0
00162     while not self.__quit:
00163       try:
00164         return self.__read()
00165       except SocketClosed:
00166         import logging
00167         logging.debug("AncillaryContributor.read: socket closed")
00168         self.__socket.disconnect()
00169         self.__socket = Socket(self.__port)
00170         self.open()
00171       except Exception, e:
00172         if "Connection reset by peer" in str(e):
00173           import logging
00174           logging.debug("AncillaryContributor.read: socket closed")
00175           self.__socket.disconnect()
00176           self.__socket = Socket(self.__port)
00177           self.open()
00178         else:
00179           import logging
00180           logging.exception("AncillaryContributor.read: %s" % (str(e)))
00181           # Do we need to do something here?
00182           break
00183
00184     return geb.Geb.Terminate, None, None
00185
00186   def __read(self):
00187     """!\brief Method to read an ancillary contribution from a socket.
00188     """
00189     self.__quit = 0
00190     rd, wr, ex = select([self.__socket.socket()], [], [], self.__timeout)
00191     initLen = 8
00192     while not self.__quit:
00193       if rd:
00194         data            = self.__socket.recvall(initLen)
00195         if len(data) != initLen:
00196           # This will happen only when the socket closed
00197           raise SocketClosed
00198         vTypeId, length = struct.unpack('<2L', data)
00199         typeId = vTypeId & 0x000fffff
00200         if typeId not in AncillaryContributor.__typeIds:
00201           # Don't try to continue if bad typeId: we're lost or it's undefined
00202           raise KeyError, "AncillaryContributor.read: Unrecognized contribution %08x" % (typeId)
00203         length &= 0x0fffffff
00204         data  += self.__socket.recvall(length - initLen)
00205         data = array('I', data)
00206         data.byteswap()                 # Get it into big endian form
00207         data = data.tostring()
00208
00209         status = 0
00210         if typeId == AncillaryContribution.EventId:
00211           return geb.Geb.Build,     status, AncillaryContribution(self, data)
00212         else:
00213           return geb.Geb.DontBuild, status, AncillaryContribution(self, data)
00214
00215       rd, wr, ex = select([self.__socket.socket()], [], [], self.__timeout)
00216
00217     self.__socket.disconnect()
00218     return geb.Geb.Terminate, None, None
00219
00220
00221 class Merger(geb.Geb):
00222   def __init__(self, contributors, queue):
00223     geb.Geb.__init__(self, contributors)
00224     self.__queue = queue
00225
00226   def dispose(self, buffer):
00227     """!\brief Method called by the base class to dispose of an event.
00228     """
00229     self.__queue.put(buffer)
00230
00231
00232 def getHostPort(hostPort):
00233   host_port = hostPort.split(':')
00234   host = host_port[0]
00235   if len(host_port) == 1:
00236     port = 2345
00237   else:
00238     port = int(host_port[1])
00239   return host, port
00240
00241
00242 class EvtCliBT(EvtCli):
00243   AncHostPort = "localhost:2345"
00244   def __init__(self, debug = 0,
00245                port        = EvtCliIO.PortNumber,
00246                ancHostPort = "localhost:2345"):  #EvtCliBT.AncHostPort):
00247     EvtCli.__init__(self, debug, port)
00248     self.__timeout = 1                  # same as EvtCliIO.__timeout
00249
00250     ldfContributor = LdfContributor(self)
00251     ancContributor = AncillaryContributor(getHostPort(ancHostPort))
00252     self.__queue   = Queue.Queue()
00253     self.__merger  = Merger([ldfContributor, ancContributor], self.__queue)
00254     #self.__merger  = Merger([ldfContributor], self.__queue)
00255     self.__merger.start()
00256
00257   def readEvent(self):
00258     """\brief Method used to read an event from the event merging code.
00259     """
00260     self.__abort = 0
00261     while not self.__abort:
00262       try:
00263         return self.__queue.get(block = True, timeout = self.__timeout)
00264       except Queue.Empty:
00265         if self.isTimeoutEnabled():
00266           raise IOError, "EvtCliBT.readEvent: Event read timeout"
00267     # Abort
00268     raise RuntimeError, "EvtCliBT.readEvent: Aborted"
00269
00270   def flushAll(self):
00271     self.__merger.flushAll()
00272
00273   def abort(self):
00274     """\brief Abort out of a readEvent().
00275
00276     Can be used from another thread
00277     """
00278     self.__abort = True
00279
00280   def shutdown(self):
00281     """\brief Method used to shut down the event merging threads.
00282
00283     This must be called from a different thread than the one in which the
00284     merger runs.
00285     """
00286     self.__merger.shutdown()
00287     self.__merger.join()   # Wait for the Event Builder thread to exit
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gException.py Source File

client

gException.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Exception classes"
00013 __author__   = "Amedeo Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/11/05 00:52:47 $").split(' ')[1]
00015 __version__  = "$Revision: 2.13 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import exceptions
00022 import gOcsMessages
00023 import gFswMessages
00024
00025 class LATInterfaceStatus(object):
00026   __ERRSTR = {}
00027
00028   def __invertdict(byid):
00029     byid.update(gOcsMessages.OcsMessages.OCSSTR)
00030     byid.update(gFswMessages.FswMessages.FSWSTR)
00031     byname = {}
00032     for (id, name) in byid.items():
00033       byname[name[0]] = id
00034     return byname
00035
00036   __ERRSTATUS = __invertdict(__ERRSTR)
00037
00038   def status(name):
00039     try:
00040       return LATInterfaceStatus.__ERRSTATUS[name]
00041     except:
00042       return None
00043
00044   def name(status):
00045     try:
00046       return LATInterfaceStatus.__ERRSTR[status]
00047     except:
00048       return ["OCS_UNKNERR",
00049               "OCS client/server don't agree on error code: 0x%08x" %status]
00050
00051   def message(status):
00052     [name, desc] = LATInterfaceStatus.name(status)
00053     return ' %s (0x%08x): %s' % (name, status, desc)
00054
00055   status  = staticmethod(status)
00056   name    = staticmethod(name)
00057   message = staticmethod(message)
00058
00059   def __init__(self, status):
00060     self.__status = status
00061
00062   def __str__(self):
00063     return LATInterfaceStatus.message(self.__status)
00064
00065   def errstr(self, status=None):
00066     if status is not None: self.__status = status
00067     return LATInterfaceStatus.name(self.__status)
00068
00069
00070 class LATInterfaceException(exceptions.Exception):
00071   def __init__(self, status):
00072     exceptions.Exception.__init__(self, status)
00073     self.status = status
00074
00075   def __str__(self):
00076     return LATInterfaceStatus.message(self.status)
00077
00078   def errstr(self):
00079     return LATInterfaceStatus.name(self.status)
00080
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gFabrics.py Source File

database

gFabrics.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Class used to initialize command/response and event fabrics"
00013 __author__  = "A. Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__    = ("$Date: 2004/12/14 19:22:03 $").split(' ')[1]
00015 __version__ = "$Revision: 2.5 $"
00016 __release__ = "$Name: R04-12-00 $"
00017 __credits__ = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 from LATTE.client.gException import LATInterfaceException
00022 from LATTE.client.gBits import population
00023
00024
00025 class Fabrics(object):
00026   def __init__(self, lcb):
00027     self.__lcb = lcb
00028
00029   def init_cmdrsp(self, cmdmask, cmdmset, pdumask, secmask):
00030     initdelay = 1
00031     tmo = self.__adjusttmo(initdelay, cmdmask)
00032     rsp = self.__lcb.cmdrsp('init_cmdrsp_fabric',
00033                             cmdmask, cmdmset, pdumask, secmask)
00034     self.__checkrsp(rsp, tmo)
00035
00036   def insert_cmdrsp(self, cmdmask, pdumask, secmask, arcmask, ctrmask):
00037     insertdelay = 1.5
00038     tmo = self.__adjusttmo(insertdelay, cmdmask, arcmask, ctrmask)
00039     rsp = self.__lcb.cmdrsp('insert_cmdrsp_fabric',
00040                             cmdmask, pdumask, secmask, arcmask, ctrmask)
00041     self.__checkrsp(rsp, tmo)
00042
00043   def extract_cmdrsp(self, cmdmask, pdumask, secmask, arcmask, ctrmask):
00044     extractdelay = 0.5
00045     tmo = self.__adjusttmo(extractdelay, cmdmask, arcmask, ctrmask)
00046     rsp = self.__lcb.cmdrsp('extract_cmdrsp_fabric',
00047                             cmdmask, pdumask, secmask, arcmask, ctrmask)
00048     self.__checkrsp(rsp, tmo)
00049
00050   def init_event(self, evtmask, evtmset):
00051     rsp = self.__lcb.cmdrsp('init_event_fabric', evtmask, evtmset)
00052     self.__checkrsp(rsp)
00053
00054   def insert_event(self, evtmask):
00055     rsp = self.__lcb.cmdrsp('insert_event_fabric', evtmask)
00056     self.__checkrsp(rsp)
00057
00058   def extract_event(self, evtmask):
00059     rsp = self.__lcb.cmdrsp('extract_event_fabric', evtmask)
00060     self.__checkrsp(rsp)
00061
00062   def __adjusttmo(self, delay, cmdmask, arcmask=0, ctrmask=0):
00063     tmo = self.__lcb.client().gettimeout()
00064     components  = population(0x3800ffffL & cmdmask) # EPUs+TEMs
00065     components += population(0x00000fffL & arcmask) # Free boards
00066     components += population(0xffffffffL & ctrmask) # CALs and TRKs
00067     if components:
00068       timeout = tmo + delay*components
00069       self.__lcb.client().settimeout(timeout)
00070     return tmo
00071
00072   def __checkrsp(self, rsp, tmo=None):
00073     if tmo is not None:
00074       if tmo != self.__lcb.client().gettimeout():
00075         self.__lcb.client().settimeout(tmo)
00076     if rsp.status() & 0x3:
00077       raise LATInterfaceException(rsp.status())
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gFswMessages.py Source File

client

gFswMessages.py

00001 # This file is generated by LATTE makefile system, do not edit.
00002 # To build this file:
00003 #   cd LATTE
00004 #   gmake client.fswmsgs
00005
00006 __version__ = "$Revision: 2.4 $"
00007
00008 import LATTE.copyright_SLAC
00009
00010 class FswMessages(object):
00011   FSWSTR = {
00012     0x0f802a9d: [  "LCBD_RUNDX", "Result item, LATp undefined error %0x%08x"],
00013     0x0f802abd: [  "LCBD_RUND3", "Result item, LATp undefined error 3"],
00014     0x0f802acd: [  "LCBD_RUND7", "Result item, LATp undefined error 7"],
00015     0x0f803895: [ "LCBD_RTOERR", "Result item, LATp timeout error"],
00016     0x0f804348: [   "LCBD___OK", "Success"],
00017     0x0f805679: [  "LCBD_NOCLK", "No 20MHz LATp side clock present"],
00018     0x0f8096c3: [ "LCBD_RIUND4", "Result in-bound, Undefined status #4, descriptor 0x%08x"],
00019     0x0f8096c7: [ "LCBD_RIUND5", "Result in-bound, Undefined status #5, descriptor 0x%08x"],
00020     0x0f8096cb: [ "LCBD_RIUND6", "Result in-bound, Undefined status #6, descriptor 0x%08x"],
00021     0x0f8096cf: [ "LCBD_RIUND7", "Result in-bound, Undefined status #7, descriptor 0x%0x08x"],
00022     0x0f809885: ["LCBD_RTRUNRN", "Result item, LATp transmit underrun error"],
00023     0x0f809ac3: [ "LCBD_ROUND4", "Result out-bound, Undefined status #4, descriptor %0x08x"],
00024     0x0f809acb: [ "LCBD_ROUND6", "Result out-bound, Undefined status #6, descriptor %0x08x"],
00025     0x0f80a395: [ "LCBD_RDPERR", "Result item, LATp cell parity error"],
00026     0x0f80a795: [ "LCBD_RHPERR", "Result item, LATp header parity error"],
00027     0x0f813d59: [ "LCBD_NOROOM", "No room to add the specified PCI/LATP allowable version numbers"],
00028     0x0f814857: [ "LCBD_ENBDSB", "Attempt to both enable and disable an interrupt source %x"],
00029     0x0f81520b: ["LCBD_RESFORK", "Response FORK creation failed %x"],
00030     0x0f8166b5: [ "LCBD_EIUND1", "Event receive, Undefined error #1, descriptor 0x%08x"],
00031     0x0f816ac3: [ "LCBD_EOUND4", "Event transfer, Undefined error #4, descriptor 0x%08x"],
00032     0x0f816acb: [ "LCBD_EOUND6", "Event transfer, Undefined error #6, descriptor 0x%08x"],
00033     0x0f817eeb: [ "LCBD_AIBSEM", "Asynch semaphore creation failed"],
00034     0x0f818625: [ "LCBD_AIBCAN", "Asynch initialization operation cancelled"],
00035     0x0f818718: [ "LCBD_AIBCOM", "Asynch initialization operation completed"],
00036     0x0f821031: ["LCBD_REQFULL", "Request queue is full"],
00037     0x0f82232d: ["LCBD_RINVLST", "Result item, LATp invalid or inconsistent list"],
00038     0x0f8260cd: [ "LCBD_UNINIT", "Driver is uninitialized"],
00039     0x0f82866f: ["LCBD_RIPCITA", "Result in-bound, PCI target abort, descriptor 0x%08x"],
00040     0x0f82885f: ["LCBD_RIPCIMA", "Result in-bound, PCI master abort, descriptor 0x%08x"],
00041     0x0f8288bb: ["LCBD_RIPCIPE", "Result in-bound, PCI parity error, descriptor 0x%08x"],
00042     0x0f82966f: ["LCBD_ROPCITA", "Result out-bound, PCI target abort, descriptor 0x%08x"],
00043     0x0f82985f: ["LCBD_ROPCIMA", "Result out-bound, PCI master abort, descriptor 0x%08x"],
00044     0x0f8298bb: ["LCBD_ROPCIPE", "Result out-bound, PCI parity error, descriptor 0x%08x"],
00045     0x0f82c0c3: [ "LCBD_UCBRWI", "UCB PBS/RW_init failed with code %d"],
00046     0x0f82c0cb: [ "LCBD_UCBRWD", "UCB PBS/RW_destroy failed with code %d"],
00047     0x0f8300d7: [ "LCBD_PIDIRQ", "Unable to connect PID interrupt handler"],
00048     0x0f8319d3: [ "LCBD_PCIREV", "PCI FPGA revision number 0x%2x is not supported by this driver"],
00049     0x0f831ed7: [ "LCBD_PCIIRQ", "Unable to connect PCI interrupt handler"],
00050     0x0f83c663: ["LCBD_STATSIFL", "Unable to initialize statistics block"],
00051     0x0f84269b: ["LCBD_NTFYTSK", "Unable to create notification service task"],
00052     0x0f8426eb: ["LCBD_NTFYSEM", "Unable to create semaphore for notification control block"],
00053     0x0f851691: ["LCBD_EITRUNC", "Event receive, LATp truncate error,  descriptor 0x%08x"],
00054     0x0f859395: ["LCBD_EIDPERR", "Event receive, LATp cell parity error, descriptor 0x%08x"],
00055     0x0f85d66f: ["LCBD_EOPCITA", "Event transfer, PCI target abort, descriptor 0x%08x"],
00056     0x0f85d85f: ["LCBD_EOPCIMA", "Event transfer, PCI master abort, descriptor 0x%08x"],
00057     0x0f85d8bb: ["LCBD_EOPCIPE", "Event transfer, PCI parity error, descriptor 0x%08x"],
00058     0x0f85fb9b: ["LCBD_AIBTASK", "Asynch initialization task creation failed %x"],
00059     0x0f862677: ["LCBD_ISRRSTQ", "The ISR RESULT FORK queue was not set before enabling"],
00060     0x0f863df7: ["LCBD_ISREVTQ", "The ISR EVENT FORK queue was not set before enabling"],
00061     0x0f86760b: ["LCBD_EVTFORK", "Event FORK creation failed %x"],
00062     0x0f86c63f: ["LCBD_DRNRSTF", "Found %d outstanding operations in the result FIFO"],
00063     0x0f86dd63: ["LCBD_DRNNPCI", "Could not drain ques, PCI side not initialized"],
00064     0x0f86ddbf: ["LCBD_DRNEVTF", "Found %d outstanding operations in the event  FIFO"],
00065     0x0f86f3df: ["LCBD_INSEBUF", "Insufficient memory to allocate event buffer"],
00066     0x0f879bdf: ["LCBD_INVEBUF", "Invalid event buffer %8.8x"],
00067     0x0f890f09: ["LCBD_OFFLINE", "Driver is offline"],
00068     0x0f8ab4d7: ["LCBD_ROQEMPTY", "Result out-bound, Result queue empty 0x%08x"],
00069     0x0f8abd43: ["LCBD_ROBUFEMP", "Result out-bound, Intermediate LCB FIFO buffer empty, descriptor 0x%08x"],
00070     0x0f8b9a13: ["LCBD_FCBMTXI", "PBS/MTX_init failed for event fcb code = %8.8x"],
00071     0x0f8b9a1b: ["LCBD_FCBMTXD", "PBS/MTX_destroy failed for event fcb code = %8.8x"],
00072     0x0f8bf8d3: ["LCBD_FPGAREV", "FPGA revision numbers combination PCI=0x%2x LATp=0x%2x is not support by this driver"],
00073     0x0f8c03bb: ["LCBD_PIDIRQD", "Unable to disconnect PID interrupt handler"],
00074     0x0f8c7bbb: ["LCBD_PCIIRQD", "Unable to disconnect PCI interrupt handler"],
00075     0x0f8c8873: ["LCBD_PCIFAIL", "Unable to detect PCI board with vendorID 0x%04x, deviceID 0x%04x"],
00076     0x0f90aafb: ["LCBD_NTFYNFND", "Unable to locate the nut on the que head"],
00077     0x0f90ba13: ["LCBD_NTFYMTXI", "Unable to create mutex for NUT que"],
00078     0x0f90ba1b: ["LCBD_NTFYMTXD", "Unable to destroy mutex for NUT que, code = %8.8x"],
00079     0x0f966777: ["LCBD_NULEVTCB", "Event callback handler specified as NULL"],
00080     0x0f97b4d7: ["LCBD_EOQEMPTY", "Event transfer, Event queue empty 0x%08x"],
00081     0x0f97bd43: ["LCBD_EOBUFEMP", "Event transfer, Intermediate LCB FIFO buffer empty, descriptor 0x%08x"],
00082     0x0f9ea7d7: ["LCBD_INVPROTO", "Invalid Protocol number, protocol = %d > 3"],
00083     0x0fa3ba6b: ["LCBD_CLTOOBIG", "Command List length is too big,  length = 0x%08x"],
00084     0x0fa586b7: ["LCBD_CLMISALN", "Command List is misaligned, list = 0x%08x"],
00085     0x0fb22263: ["LCBD_PCIMAPLP", "Unable to map local address to PCI memory"],
00086     0x0fb223b3: ["LCBD_PCIMAPPL", "Unable to map PCI memory to local address"],
00087     0x20801dd6: [    "LEM_INFO", "%s %04d: %s"],
00088     0x20801f97: [   "LEM_RIERR", "Result item has error field set"],
00089     0x20802f57: [   "LEM_TOHV1", "Timeout acquiring AEM Environment HV1"],
00090     0x20802f5b: [   "LEM_TOHV2", "Timeout acquiring AEM Environment HV2"],
00091     0x2080320b: [   "LEM_TOVDD", "Timeout acquiring AEM Environment VDD"],
00092     0x20803605: [    "LEM_WARN", "%s %04d: %s"],
00093     0x20803ad7: [   "LEM_ERROR", "%s %04d: %s"],
00094     0x20809d43: [  "LEM_TOTEMP", "Timeout acquiring AEM Environment TEMP"],
00095     0x2080c997: [  "LEM_SUMERR", "Summary error bit was set in response"],
00096     0x20815733: [  "LEM_NOIMPL", "Feature not implemented"],
00097     0x20824b4b: [  "LEM_OVRFLW", "Number of items (%d) exceeds maximum (%d)"],
00098     0x20827d97: [  "LEM_MEMERR", "Error allocating memory"],
00099     0x2082c3d7: [  "LEM_PARITY", "There was a parity error on the register read"],
00100     0x208333a8: [ "LEM_SUCCESS", "Success"],
00101     0x20848e97: [ "LEM_LISTERR", "Error handling command list"],
00102     0x208793eb: [ "LEM_INVALID", "Response from AEM Environment register block is invalid"],
00103     0x2089de97: [ "LEM_UNKNOWN", "Cannot map error %08x"],
00104     0x7f0308bb: [  "MSG_GAPEND", "Message blackout ends (%d messages dropped)"],
00105     0x7f0333a8: [ "MSG_SUCCESS", "Success"],
00106     0x7f094bbb: ["MSG_TNM2LONG", "A task name is restricted to <= %d letters"],
00107     0x7f0d2c6b: [ "MSG_PKT2FEW", "Initialization parameter packet count too small"],
00108     0x7f143873: ["MSG_ALOCFAIL", "Could not allocate %d bytes"],
00109     0x7f21b0fb: ["MSG_OUTNTFND", "Target of MSG_deletOutputRtn() not found"],
00110     0x7f268bd7: ["MSG_UNIXEROR", "Unrecognised message 0x%08x (possibly unix error)"],
00111     0x7f26ae38: ["MSG_UNIXGOOD", "Unrecognised message 0x%08x (possibly unix success)"],
00112     0x7f277a58: ["MSG_UNKNOWNS", "Unrecognised message 0x%08x (success)"],
00113     0x7f277a8b: ["MSG_UNKNOWNE", "Unrecognised message 0x%08x (error)"],
00114     0x7f277ab2: ["MSG_UNKNOWNI", "Unrecognised message 0x%08x (information)"],
00115     0x7f277b19: ["MSG_UNKNOWNW", "Unrecognised message 0x%08x (warning)"],
00116     0x7f2a3073: ["MSG_FORKFAIL", "Forking the message task failed"],
00117     0x7f2a6073: ["MSG_FINDFAIL", "Cannot find alternate messages in message database"],
00118     0x7f2b8363: ["MSG_MUALOCFL", "Allocation of mutex failed"],
00119     0x7f2e7873: ["MSG_FPAIFAIL", "FPA initialization failed"],
00120     0x7f2ec073: ["MSG_FPAGFAIL", "FPA_get() failed during start"],
00121     0x7f310e37: ["MSG_GAPBEGIN", "Message blackout starts (trying to report 0x%08x)"],
00122     0x7f326f2b: ["MSG_BADSTATE", "Request illegal in current state of message"],
00123     0x7f3493a3: ["MSG_PKT2SMAL", "Initialization parameter packet length too small"],
00124     0x21005033: [   "PIG_NOSUP", "PIG does not support this feature at this time."],
00125     0x21005927: [   "PIG_NOPDU", "No PDUs are selected for power"],
00126     0x210077f8: [   "PIG_INMUD", "Happy as a pig in mud"],
00127     0x21009433: [   "PIG_UNSUP", "Function unsupported"],
00128     0x210094db: [  "PIG_TEMCFG", "Application of configuration would cause TEM %d to be powered from both PDUs"],
00129     0x210109a2: [  "PIG_SQUEAL", "%s"],
00130     0x2101520b: [ "PIG_RESFORK", "Failed creating result queue with error %08x"],
00131     0x21017b8b: [  "PIG_LCBQUE", "Attempt to execute a command list failed with errors %x"],
00132     0x210194db: [  "PIG_ACDCFG", "Application of configuration would cause the ACD to be powered from both PDUs"],
00133     0x2101abdb: [  "PIG_EPUCFG", "Application of configuration would cause EPU %d to be powered from both PDUs"],
00134     0x210288b3: [  "PIG_FNCALL", "Function call on line %d of function %s returned error %08x"],
00135     0x21032cbb: [  "PIG_BADORD", "An attempt was made to reorder the order array with %d elements into a bad order (repeated or missing elements)"],
00136     0x21033107: [  "PIG_BADCPU", "Bad cpu_id passed to PIG_lcb_start %d"],
00137     0x210333a8: [ "PIG_SUCCESS", "Success"],
00138     0x210399db: [ "PIG_ERRREAD", "Error %x reading %s"],
00139     0x2103a79b: [ "PIG_ERRLOAD", "Error %x executing load number %d"],
00140     0x2104269b: [ "PIG_NTFYTSK", "Failed creating notify queue with error %08x"],
00141     0x2105dc73: [ "PIG_LCBFAIL", "LCB failed to initialise: Final state was %d"],
00142     0x2106760b: [ "PIG_EVTFORK", "Failed creating event queue with error %08x"],
00143     0x210c9ddb: [ "PIG_BADREAD", "Reading %s produced wrong result: 0x%x (received) != 0x%x (expected)"],
00144     0x21250c5b: ["PIG_OVERFLOW", "Too many command items (%d) have been placed on command list (capacity %d)"],
00145   }
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gGEM.py Source File

database

gGEM.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "GLAST GEM functional block"
00013 __author__  = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = ("$Date: 2005/06/15 17:45:10 $").split(' ')[1]
00015 __version__ = "$Revision: 2.19 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__ = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import gDb
00022 import gAttr
00023
00024 class GGEM(gDb.Gdb):
00025   """\brief GGEM node.
00026
00027   """
00028   __attrs = []
00029
00030   __EPU_ADDR = 0x20
00031
00032   def __init__(self, client, parent):
00033     """\brief Initialize child objects.
00034
00035     """
00036     self.GEMC    = None
00037     self.GEMMG   = None
00038     self.GEMST   = None
00039     self.GEMSC   = None
00040     self.GEMVG   = None
00041     self.GEMIE   = None
00042     self.GEMW    = None
00043     flags = {'CmdrspFabric'    : 'On',
00044              'EventFabric'     : 'On'}
00045     gDb.Gdb.__init__(self, client, parent, 0, self.__attrs, None, flags)
00046
00047   def getEPUaddr(self):
00048     # Hard code EPU_ADDR to 0x20 to work with the Caligula FSW release
00049     return GGEM.__EPU_ADDR
00050
00051   def downGEMC(self):
00052     """\brief Navigate to the GGEMC node
00053
00054     \return         The GGEMC object instance
00055     """
00056     return self.GEMC
00057
00058   def existsGEMC(self):
00059     """\brief Check if the GGEMC instance exists in the schema.
00060
00061     \return       1 if it exists, 0 if it doesn't.
00062     """
00063     return self.GEMC != None
00064
00065   def downGEMMG(self):
00066     """\brief Navigate to the GGEMMG node
00067
00068     \return         The GGEMMG object instance
00069     """
00070     return self.GEMMG
00071
00072   def existsGEMMG(self):
00073     """\brief Check if the GGEMMG instance exists in the schema.
00074
00075     \return       1 if it exists, 0 if it doesn't.
00076     """
00077     return self.GEMMG != None
00078
00079   def downGEMST(self):
00080     """\brief Navigate to the GGEMST node
00081
00082     \return         The GGEMST object instance
00083     """
00084     return self.GEMST
00085
00086   def existsGEMST(self):
00087     """\brief Check if the GGEMST instance exists in the schema.
00088
00089     \return       1 if it exists, 0 if it doesn't.
00090     """
00091     return self.GEMST != None
00092
00093   def downGEMSC(self):
00094     """\brief Navigate to the GGEMSC node
00095
00096     \return         The GGEMSC object instance
00097     """
00098     return self.GEMSC
00099
00100   def existsGEMSC(self):
00101     """\brief Check if the GGEMSC instance exists in the schema.
00102
00103     \return       1 if it exists, 0 if it doesn't.
00104     """
00105     return self.GEMSC != None
00106
00107   def downGEMVG(self):
00108     """\brief Navigate to the GGEMVG node
00109
00110     \return         The GGEMVG object instance
00111     """
00112     return self.GEMVG
00113
00114   def existsGEMVG(self):
00115     """\brief Check if the GGEMVG instance exists in the schema.
00116
00117     \return       1 if it exists, 0 if it doesn't.
00118     """
00119     return self.GEMVG != None
00120
00121   def downGEMIE(self):
00122     """\brief Navigate to the GGEMIE node
00123
00124     \return         The GGEMIE object instance
00125     """
00126     return self.GEMIE
00127
00128   def existsGEMIE(self):
00129     """\brief Check if the GGEMIE instance exists in the schema.
00130
00131     \return       1 if it exists, 0 if it doesn't.
00132     """
00133     return self.GEMIE != None
00134
00135   def downGEMW(self):
00136     """\brief Navigate to the GGEMW node
00137
00138     \return         The GGEMW object instance
00139     """
00140     return self.GEMW
00141
00142   def existsGEMW(self):
00143     """\brief Check if the GGEMW instance exists in the schema.
00144
00145     \return       1 if it exists, 0 if it doesn't.
00146     """
00147     return self.GEMW != None
00148
00149 ## private:
00150
00151   def __removeGEMC(self):
00152     self.GEMC = None
00153
00154   def __addGEMC(self):
00155     ggemc = GGEMC(self.client(), self)
00156     self.GEMC = ggemc
00157     return ggemc
00158
00159   def __removeGEMMG(self):
00160     self.GEMMG = None
00161
00162   def __addGEMMG(self):
00163     ggemmg = GGEMMG(self.client(), self)
00164     self.GEMMG = ggemmg
00165     return ggemmg
00166
00167   def __removeGEMST(self):
00168     self.GEMST = None
00169
00170   def __addGEMST(self):
00171     ggemst = GGEMST(self.client(), self)
00172     self.GEMST = ggemst
00173     return ggemst
00174
00175   def __removeGEMSC(self):
00176     self.GEMSC = None
00177
00178   def __addGEMSC(self):
00179     ggemsc = GGEMSC(self.client(), self)
00180     self.GEMSC = ggemsc
00181     return ggemsc
00182
00183   def __removeGEMVG(self):
00184     self.GEMVG = None
00185
00186   def __addGEMVG(self):
00187     ggemvg = GGEMVG(self.client(), self)
00188     self.GEMVG = ggemvg
00189     return ggemvg
00190
00191   def __removeGEMIE(self):
00192     self.GEMIE = None
00193
00194   def __addGEMIE(self):
00195     ggemie = GGEMIE(self.client(), self)
00196     self.GEMIE = ggemie
00197     return ggemie
00198
00199   def __removeGEMW(self):
00200     self.GEMW = None
00201
00202   def __addGEMW(self):
00203     ggemw = GGEMW(self.client(), self)
00204     self.GEMW = ggemw
00205     return ggemw
00206
00207
00208 class GGEMC(gDb.Gdb):
00209   """\brief GEMC sub-node of GGEM (controller).
00210
00211   Has GGEMC specific registers and dataless commands.
00212
00213   Valid Registers:
00214   - \c configuration
00215   - \c address
00216   - \c periodic_mode
00217   - \c periodic_limits
00218   - \c periodic_rate
00219   - \c sequence
00220   - \c cr_statistics
00221   - \c event_statistics
00222   - \c delay_ext_trg
00223
00224   Dataless Commands:
00225   - \c cmd_nop
00226   - \c cmd_reset
00227   - \c cmd_trigger
00228
00229   """
00230   __attrs = [
00231     # Registers
00232     gAttr.GattrRaw('configuration',    0, 4),
00233     gAttr.GattrRaw('address',          1, 4),
00234     gAttr.GattrRaw('periodic_mode',    3, 4),
00235     gAttr.GattrRaw('periodic_limits',  4, 4),
00236     gAttr.GattrRaw('periodic_rate',    5, 4),
00237     gAttr.GattrRaw('sequence',         6, 4),
00238     gAttr.GattrRaw('cr_statistics',    7, 4),
00239     gAttr.GattrRaw('event_statistics', 8, 4),
00240     gAttr.GattrRaw('delay_ext_trg',    9, 4),
00241     # Dataless Commands
00242     gAttr.GattrDlc('cmd_nop',          0, 0),
00243     gAttr.GattrDlc('cmd_reset',        1, 0),
00244     gAttr.GattrDlc('cmd_trigger',      2, 0),
00245     ]
00246
00247   def __init__(self, client, parent):
00248     """\brief Initialize valid registers as Gattrs
00249     """
00250     gDb.Gdb.__init__(self, client, parent, 0, self.__attrs)
00251
00252   def read(self, reg):
00253     return self.cmdrsp('GEM_read', gDb.Lem.ADDR_GEM, gDb.Lem.GEM_CC, reg, '!I')
00254
00255   def load(self, reg, value):
00256     return self.cmdrsp('GEM_load', gDb.Lem.ADDR_GEM, gDb.Lem.GEM_CC, reg, value)
00257
00258   def send(self, cmd):
00259     return self.cmdrsp('GEM_cmd', gDb.Lem.ADDR_GEM, gDb.Lem.GEM_CC, cmd)
00260
00261
00262 class GGEMMG(gDb.Gdb):
00263   """\brief GEMMG sub-node of GGEM (TAM generator).
00264
00265   Has GGEMMG specific registers and dataless commands.
00266
00267   Valid Registers:
00268   - \c engine_0
00269   - \c engine_1
00270   - \c engine_2
00271   - \c engine_3
00272   - \c engine_4
00273   - \c engine_5
00274   - \c engine_6
00275   - \c engine_7
00276   - \c engine_8
00277   - \c engine_9
00278   - \c engine_a
00279   - \c engine_b
00280   - \c engine_c
00281   - \c engine_d
00282   - \c engine_e
00283   - \c engine_f
00284
00285   """
00286   __attrs = [
00287     # Registers
00288     gAttr.GattrRaw('engine_0',    0, 4),
00289     gAttr.GattrRaw('engine_1',    1, 4),
00290     gAttr.GattrRaw('engine_2',    2, 4),
00291     gAttr.GattrRaw('engine_3',    3, 4),
00292     gAttr.GattrRaw('engine_4',    4, 4),
00293     gAttr.GattrRaw('engine_5',    5, 4),
00294     gAttr.GattrRaw('engine_6',    6, 4),
00295     gAttr.GattrRaw('engine_7',    7, 4),
00296     gAttr.GattrRaw('engine_8',    8, 4),
00297     gAttr.GattrRaw('engine_9',    9, 4),
00298     gAttr.GattrRaw('engine_a',   10, 4),
00299     gAttr.GattrRaw('engine_b',   11, 4),
00300     gAttr.GattrRaw('engine_c',   12, 4),
00301     gAttr.GattrRaw('engine_d',   13, 4),
00302     gAttr.GattrRaw('engine_e',   14, 4),
00303     gAttr.GattrRaw('engine_f',   15, 4),
00304     ]
00305
00306   def __init__(self, client, parent):
00307     """\brief Initialize valid registers as Gattrs.
00308     """
00309     gDb.Gdb.__init__(self, client, parent, 0, self.__attrs)
00310
00311   def read(self, reg):
00312     return self.cmdrsp('GEM_read', gDb.Lem.ADDR_GEM, gDb.Lem.GEM_TAM, reg, '!I')
00313
00314   def load(self, reg, value):
00315     return self.cmdrsp('GEM_load', gDb.Lem.ADDR_GEM, gDb.Lem.GEM_TAM, reg, value)
00316
00317
00318 class GGEMST(gDb.Gdb):
00319   """\brief GEMST sub-node of GGEM (statistics).
00320
00321   Has GGEMST specific registers and dataless commands.
00322
00323   Valid Registers:
00324   - \c livetime
00325   - \c prescaled
00326   - \c discarded
00327   - \c sent
00328   - \c tile_counters
00329   - \c tile_0
00330   - \c tile_1
00331   - \c cno_counters
00332   - \c cno_0
00333   - \c cno_1
00334   - \c one_pps
00335   - \c timebase
00336   - \c deadzone
00337
00338   \deprecated
00339   - \c \b missed Use 'deadzone' instead
00340
00341   """
00342   __attrs = [
00343     # Registers
00344     gAttr.GattrRaw('livetime',        0, 4),
00345     gAttr.GattrRaw('prescaled',       1, 4),
00346     gAttr.GattrRaw('discarded',       2, 4),
00347     gAttr.GattrRaw('sent',            3, 4),
00348     gAttr.GattrRaw('tile_counters',   4, 4),
00349     gAttr.GattrRaw('tile_0',          5, 4),
00350     gAttr.GattrRaw('tile_1',          6, 4),
00351     gAttr.GattrRaw('cno_counters',    7, 4),
00352     gAttr.GattrRaw('cno_0',           8, 4),
00353     gAttr.GattrRaw('cno_1',           9, 4),
00354     gAttr.GattrRaw('one_pps',        10, 4),
00355     gAttr.GattrRaw('timebase',       11, 4),
00356     gAttr.GattrRegDepr('missed',     12, 4), # Deprecated: use deadzone
00357     gAttr.GattrRaw('deadzone',       12, 4),
00358     ]
00359
00360   def __init__(self, client, parent):
00361     """\brief Initialize valid registers as Gattrs.
00362     """
00363     gDb.Gdb.__init__(self, client, parent, 0, self.__attrs)
00364
00365   def read(self, reg):
00366     return self.cmdrsp('GEM_read', gDb.Lem.ADDR_GEM, gDb.Lem.GEM_STAT, reg, '!I')
00367
00368   def load(self, reg, value):
00369     return self.cmdrsp('GEM_load', gDb.Lem.ADDR_GEM, gDb.Lem.GEM_STAT, reg, value)
00370
00371   def send(self, cmd):
00372     return self.cmdrsp('GEM_cmd', gDb.Lem.ADDR_GEM, gDb.Lem.GEM_STAT, cmd)
00373
00374   def extCtrEnable(self, reg):
00375     """\brief Enable the specified pseudo counter.
00376     By default all pseudo counters are disabled.
00377
00378     \param reg Register id of the pseudo counter.
00379                Can be retrieved by calling gemst.regs['regname'].id().
00380     \return A Response object
00381     """
00382     return self.cmdrsp('GEM_stat_enable', reg)
00383
00384   def extCtrDisable(self, reg):
00385     """\brief Disable the specified pseudo counter.
00386     By default all pseudo counters are disabled.
00387
00388     \param reg Register id of the pseudo counter.
00389                Can be retrieved by calling gemst.regs['regname'].id().
00390     \return A Response object
00391     """
00392     return self.cmdrsp('GEM_stat_disable', reg)
00393
00394   def extCtrLoopEnable(self):
00395     """\brief Enable the update loop that updates all
00396     counter pseudoregisters.
00397
00398     \return A Response object
00399     """
00400     return self.cmdrsp('GEM_stat_loop_enable')
00401
00402   def extCtrLoopDisable(self):
00403     """\brief Disable the update loop that updates all
00404     counter pseudoregisters.
00405
00406     \return A Response object
00407     """
00408     return self.cmdrsp('GEM_stat_loop_disable')
00409
00410   def extCtrSetLoopDelay(self, delay):
00411     """\brief Set the update loop interval for
00412     counter pseudoregisters.
00413
00414     \param Set the pseudo counter update loop delay
00415            in 1/60 second ticks. The default is 30 (2 Hz).
00416
00417     \return A Response object
00418     """
00419     return self.cmdrsp('GEM_stat_loop_delay', delay)
00420
00421   def extCtrRead(self, reg):
00422     """\brief Read the specified pseudocounter
00423
00424     \param reg Register id of the pseudo counter.
00425                Can be retrieved by calling gemst.regs['regname'].id().
00426     \return (value, timestamp) pair
00427     """
00428     return self.cmdrsp('GEM_stat_read', reg, '!Q', '!Q')
00429
00430   def extCtrClear(self):
00431     """\brief Clear the pseudocounters
00432     """
00433     return self.cmdrsp('GEM_stat_clear')
00434
00435   def extCtrClearStatus(self):
00436     """\brief Read the pseudocounter statuses
00437     """
00438     return self.cmdrsp('GEM_stat_clear_status')
00439
00440
00441
00442 class GGEMSC(gDb.Gdb):
00443   """\brief GEMSC sub-node of GGEM (scheduler).
00444
00445   Has GGEMSC specific registers and dataless commands.
00446
00447   Valid Registers:
00448   - \c conditions_00_07
00449   - \c conditions_08_0f
00450   - \c conditions_10_17
00451   - \c conditions_18_1f
00452   - \c conditions_20_27
00453   - \c conditions_28_2f
00454   - \c conditions_30_37
00455   - \c conditions_38_3f
00456   - \c conditions_40_47
00457   - \c conditions_48_4f
00458   - \c conditions_50_57
00459   - \c conditions_58_5f
00460   - \c conditions_60_67
00461   - \c conditions_68_6f
00462   - \c conditions_70_77
00463   - \c conditions_78_7f
00464   - \c conditions_80_87
00465   - \c conditions_88_8f
00466   - \c conditions_90_97
00467   - \c conditions_98_9f
00468   - \c conditions_a0_a7
00469   - \c conditions_a8_af
00470   - \c conditions_b0_b7
00471   - \c conditions_b8_bf
00472   - \c conditions_c0_c7
00473   - \c conditions_c8_cf
00474   - \c conditions_d0_d7
00475   - \c conditions_d8_df
00476   - \c conditions_e0_e7
00477   - \c conditions_e8_ef
00478   - \c conditions_f0_f7
00479   - \c conditions_f8_ff
00480
00481   """
00482   __attrs = [
00483     # Registers
00484     gAttr.GattrRaw('conditions_00_07', 0x00, 4),
00485     gAttr.GattrRaw('conditions_08_0f', 0x01, 4),
00486     gAttr.GattrRaw('conditions_10_17', 0x02, 4),
00487     gAttr.GattrRaw('conditions_18_1f', 0x03, 4),
00488     gAttr.GattrRaw('conditions_20_27', 0x04, 4),
00489     gAttr.GattrRaw('conditions_28_2f', 0x05, 4),
00490     gAttr.GattrRaw('conditions_30_37', 0x06, 4),
00491     gAttr.GattrRaw('conditions_38_3f', 0x07, 4),
00492     gAttr.GattrRaw('conditions_40_47', 0x08, 4),
00493     gAttr.GattrRaw('conditions_48_4f', 0x09, 4),
00494     gAttr.GattrRaw('conditions_50_57', 0x0a, 4),
00495     gAttr.GattrRaw('conditions_58_5f', 0x0b, 4),
00496     gAttr.GattrRaw('conditions_60_67', 0x0c, 4),
00497     gAttr.GattrRaw('conditions_68_6f', 0x0d, 4),
00498     gAttr.GattrRaw('conditions_70_77', 0x0e, 4),
00499     gAttr.GattrRaw('conditions_78_7f', 0x0f, 4),
00500     gAttr.GattrRaw('conditions_80_87', 0x10, 4),
00501     gAttr.GattrRaw('conditions_88_8f', 0x11, 4),
00502     gAttr.GattrRaw('conditions_90_97', 0x12, 4),
00503     gAttr.GattrRaw('conditions_98_9f', 0x13, 4),
00504     gAttr.GattrRaw('conditions_a0_a7', 0x14, 4),
00505     gAttr.GattrRaw('conditions_a8_af', 0x15, 4),
00506     gAttr.GattrRaw('conditions_b0_b7', 0x16, 4),
00507     gAttr.GattrRaw('conditions_b8_bf', 0x17, 4),
00508     gAttr.GattrRaw('conditions_c0_c7', 0x18, 4),
00509     gAttr.GattrRaw('conditions_c8_cf', 0x19, 4),
00510     gAttr.GattrRaw('conditions_d0_d7', 0x1a, 4),
00511     gAttr.GattrRaw('conditions_d8_df', 0x1b, 4),
00512     gAttr.GattrRaw('conditions_e0_e7', 0x1c, 4),
00513     gAttr.GattrRaw('conditions_e8_ef', 0x1d, 4),
00514     gAttr.GattrRaw('conditions_f0_f7', 0x1e, 4),
00515     gAttr.GattrRaw('conditions_f8_ff', 0x1f, 4),
00516     ]
00517
00518   def __init__(self, client, parent):
00519     """\brief Initialize valid registers as Gattrs.
00520     """
00521     gDb.Gdb.__init__(self, client, parent, 0, self.__attrs)
00522
00523   def read(self, reg):
00524     return self.cmdrsp('GEM_read', gDb.Lem.ADDR_GEM, gDb.Lem.GEM_SCHD, reg, '!I')
00525
00526   def load(self, reg, value):
00527     return self.cmdrsp('GEM_load', gDb.Lem.ADDR_GEM, gDb.Lem.GEM_SCHD, reg, value)
00528
00529
00530 class GGEMVG(gDb.Gdb):
00531   """\brief GEMVG sub-node of GGEM (ROI generator).
00532
00533   Has GGEMVG specific registers and dataless commands.
00534
00535   Valid Registers:
00536
00537   - \c ROI_00, ROI_01, ROI_02,...,ROI_53
00538
00539   """
00540   __attrs = []
00541   # Registers
00542   for i in range(54):
00543     __attrs.append(gAttr.GattrRaw('ROI_%02d' % i, i, 4))
00544
00545   def __init__(self, client, parent):
00546     """\brief Initialize valid registers as Gattrs.
00547     """
00548     gDb.Gdb.__init__(self, client, parent, 0, self.__attrs)
00549
00550   def read(self, reg):
00551     return self.cmdrsp('GEM_read', gDb.Lem.ADDR_GEM, gDb.Lem.GEM_ROI, reg, '!I')
00552
00553   def load(self, reg, value):
00554     return self.cmdrsp('GEM_load', gDb.Lem.ADDR_GEM, gDb.Lem.GEM_ROI, reg, value)
00555
00556
00557 class GGEMIE(gDb.Gdb):
00558   """\brief GEMIE sub-node of GGEM (input enables).
00559
00560   Has GGEMIE specific registers and dataless commands.
00561
00562   Valid Registers:
00563   - \c towers_0_3
00564   - \c towers_4_7
00565   - \c towers_8_11
00566   - \c towers_12_15
00567   - \c acd_cno
00568   - \c tiles_000_013
00569   - \c tiles_014_032
00570   - \c tiles_033_NA3
00571   - \c tiles_100_113
00572   - \c tiles_114_NA5
00573   - \c tiles_200_213
00574   - \c tiles_214_NA7
00575   - \c tiles_300_313
00576   - \c tiles_314_NA9
00577   - \c tiles_400_413
00578   - \c tiles_414_NA1
00579   - \c tiles_500_NA10
00580   - \c tower_busy
00581   - \c external
00582
00583   """
00584   __attrs = [
00585     # Registers
00586     gAttr.GattrRaw('external',       18, 4), # Specified first to support
00587                                              # older GASUs. See __commit() in
00588                                              # trigger.TrgGem for more information.
00589     gAttr.GattrRaw('towers_0_3',      0, 4),
00590     gAttr.GattrRaw('towers_4_7',      1, 4),
00591     gAttr.GattrRaw('towers_8_11',     2, 4),
00592     gAttr.GattrRaw('towers_12_15',    3, 4),
00593     gAttr.GattrRaw('acd_cno',         4, 4),
00594     gAttr.GattrRaw('tiles_000_013',   5, 4),
00595     gAttr.GattrRaw('tiles_014_032',   6, 4),
00596     gAttr.GattrRaw('tiles_033_NA3',   7, 4),
00597     gAttr.GattrRaw('tiles_100_113',   8, 4),
00598     gAttr.GattrRaw('tiles_114_NA5',   9, 4),
00599     gAttr.GattrRaw('tiles_200_213',  10, 4),
00600     gAttr.GattrRaw('tiles_214_NA7',  11, 4),
00601     gAttr.GattrRaw('tiles_300_313',  12, 4),
00602     gAttr.GattrRaw('tiles_314_NA9',  13, 4),
00603     gAttr.GattrRaw('tiles_400_413',  14, 4),
00604     gAttr.GattrRaw('tiles_414_NA1',  15, 4),
00605     gAttr.GattrRaw('tiles_500_NA10', 16, 4),
00606     gAttr.GattrRaw('tower_busy',     17, 4),
00607     ]
00608
00609   def __init__(self, client, parent):
00610     """\brief Initialize valid registers as Gattrs.
00611
00612     """
00613     gDb.Gdb.__init__(self, client, parent, 0, self.__attrs)
00614
00615   def read(self, reg):
00616     return self.cmdrsp('GEM_read', gDb.Lem.ADDR_GEM, gDb.Lem.GEM_IE, reg, '!I')
00617
00618   def load(self, reg, value):
00619     return self.cmdrsp('GEM_load', gDb.Lem.ADDR_GEM, gDb.Lem.GEM_IE, reg, value)
00620
00621
00622 class GGEMW(gDb.Gdb):
00623   """\brief GEMW sub-node of GGEM.
00624
00625   Has GGEMW specific registers.
00626
00627   Valid Registers:
00628   - \c window_width
00629   - \c window_open_mask
00630   """
00631   __attrs = [
00632     # Registers
00633     gAttr.GattrRaw('window_width',      0, 4),
00634     gAttr.GattrRaw('window_open_mask',  1, 4),
00635     ]
00636
00637   def __init__(self, client, parent):
00638     """\brief Initialize valid registers as Gattrs.
00639     """
00640     gDb.Gdb.__init__(self, client, parent, 0, self.__attrs)
00641
00642   def read(self, reg):
00643     return self.cmdrsp('GEM_read', gDb.Lem.ADDR_GEM, gDb.Lem.GEM_WIN, reg, '!I')
00644
00645   def load(self, reg, value):
00646     return self.cmdrsp('GEM_load', gDb.Lem.ADDR_GEM, gDb.Lem.GEM_WIN, reg, value)
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gGLT.py Source File

database

gGLT.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "GLAST GLT functional block"
00013 __author__  = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = ("$Date: 2005/02/02 00:42:04 $").split(' ')[1]
00015 __version__ = "$Revision: 2.7 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__ = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 from threading import Event
00022
00023 from gDb import Gdb
00024 import gAttr
00025 import LATTE.client.gBits as gBits
00026
00027 class GGLT(Gdb):
00028   """\brief Global Trigger
00029
00030   Has GGLT specific registers and dataless commands.
00031
00032   Valid Registers:
00033   - \c mask
00034   - \c busy_disable
00035   - \c ext_cal_strobe
00036   - \c ext_tack
00037   - \c counter_mask
00038   - \c counter
00039   - \c ext_clk_out_enable
00040
00041   Dataless Commands:
00042   - \c cmd_reset
00043   - \c cmd_self_trigger
00044
00045   <a name="option_fields"></a>
00046   Options Register Bit Fields:
00047   - \c parity
00048   - \c tag
00049   - \c event_number
00050
00051   <a name="conf_fields"></a>
00052   Configuration Register Bit Fields:
00053   - \c destination
00054   - \c marker
00055   - \c tack
00056   - \c zero_suppress
00057   - \c four_range_readout
00058   - \c cal_strobe
00059
00060   Mask Register Bit Fields:
00061   - \c internal_trg
00062   - \c external_trg
00063   - \c cal_low
00064   - \c cal_high
00065   - \c three_in_a_row
00066   - \c acd_veto_00
00067   - \c acd_veto_01
00068   - \c acd_veto_02
00069   - \c acd_veto_03
00070   - \c acd_veto_04
00071   - \c acd_veto_05
00072   - \c acd_veto_06
00073   - \c acd_veto_07
00074   - \c acd_veto_08
00075   - \c acd_veto_09
00076   - \c acd_veto_10
00077   - \c acd_veto_11
00078   - \c acd_veto_12
00079   - \c acd_veto_13
00080   - \c acd_veto_14
00081   - \c acd_veto_15
00082   - \c acd_veto_16
00083   - \c acd_veto_17
00084   - \c acd_cno
00085
00086   """
00087   __attrs = [
00088       # Registers
00089       gAttr.GattrRaw('mask',                1,  4),
00090       gAttr.GattrRaw('busy_disable',        3,  2),
00091       gAttr.GattrRaw('ext_cal_strobe',      4,  2),
00092       gAttr.GattrRaw('ext_tack',            5,  2),
00093       gAttr.GattrRaw('counter_mask',        6,  4),
00094       gAttr.GattrRaw('counter',             7,  4),
00095       gAttr.GattrRaw('ext_clk_out_enable',  8,  4),
00096       # Dataless Commands
00097       gAttr.GattrDlc('cmd_reset',           9,  0),
00098       gAttr.GattrDlc('cmd_self_trigger',   10,  0),
00099       # Bit fields
00100       gAttr.GattrRaw('parity',             11,  2),
00101       gAttr.GattrRaw('tag',                12,  2),
00102       gAttr.GattrRaw('event_number',       13,  2),
00103       gAttr.GattrRaw('destination',        14,  2),
00104       gAttr.GattrRaw('marker',             15,  2),
00105       gAttr.GattrRaw('tack',               16,  2),
00106       gAttr.GattrRaw('zero_suppress',      17,  2),
00107       gAttr.GattrRaw('four_range_readout', 18,  2),
00108       gAttr.GattrRaw('cal_strobe',         19,  2)
00109       ]
00110
00111   __mask_BF = [
00112       ('internal_trg',     0,  1),
00113       ('external_trg',     1,  2),
00114       ('cal_low',          2,  3),
00115       ('cal_high',         3,  4),
00116       ('three_in_a_row',   4,  5),
00117       ('acd_veto_00',      5,  6),
00118       ('acd_veto_01',      6,  7),
00119       ('acd_veto_02',      7,  8),
00120       ('acd_veto_03',      8,  9),
00121       ('acd_veto_04',      9, 10),
00122       ('acd_veto_05',     10, 11),
00123       ('acd_veto_06',     11, 12),
00124       ('acd_veto_07',     12, 13),
00125       ('acd_veto_08',     13, 14),
00126       ('acd_veto_09',     14, 15),
00127       ('acd_veto_10',     15, 16),
00128       ('acd_veto_11',     16, 17),
00129       ('acd_veto_12',     17, 18),
00130       ('acd_veto_13',     18, 19),
00131       ('acd_veto_14',     19, 20),
00132       ('acd_veto_15',     20, 21),
00133       ('acd_veto_16',     21, 22),
00134       ('acd_veto_17',     22, 23),
00135       ('acd_cno',         23, 24)
00136       ]
00137
00138   __TRG_DISABLE_MASK = 0xFFFFFFFFL
00139
00140   __EPU_ADDR = 0x20
00141
00142   def __init__(self, client, parent=None):
00143     """\brief Initialize valid registers as Gattrs.
00144
00145     Assign default values to members
00146     """
00147     self.__dirtyMask = 0
00148     self.__saveMask = None
00149     self.__bitsMask = 0xFFFFFFFFL
00150     self.__triggersEnabled = Event()
00151     self.__enableTime = None
00152     self.__disableTime = None
00153     self.__gltMode = 1
00154     self.__destinationOverride = 0
00155     self.__lcbAddr = None
00156     Gdb.__init__(self, client, parent, 0, self.__attrs)
00157
00158   def getEPUaddr(self):
00159     # Hard code EPU_ADDR to 0x20 to work with the Caligula FSW release
00160     return GGLT.__EPU_ADDR
00161
00162   def read(self, reg):
00163     return self.cmdrsp('ggGLTread', reg, '!I')
00164
00165   def load(self, reg, value):
00166     return self.cmdrsp('ggGLTload', reg, value)
00167
00168   def send(self, cmd):
00169     return self.cmdrsp('ggGLTcmd', cmd)
00170
00171   def initialize(self):
00172     if self.__gltMode == 1:
00173       # We need to find which bits are enabled
00174       self.refreshMask()
00175       #self.regs['mask'].set(self, GGLT.__TRG_DISABLE_MASK) # Revisit: Why next?
00176       Gdb.__setattr__(self, 'mask', GGLT.__TRG_DISABLE_MASK)
00177       self.__bitsMask = Gdb.__getattr__(self, 'mask')
00178       Gdb.__setattr__(self, 'mask', int(self.__saveMask))
00179     if self.__lcbAddr is None:
00180       self.__lcbAddr = self.getEPUaddr()
00181     if self.__destinationOverride == 0:
00182       Gdb.__setattr__(self, 'destination', self.__lcbAddr)
00183
00184   def waitForMaskEnable(self, tmo = None):
00185     """\brief Waits until the enableMask() method is called.
00186
00187     This is usually needed by non-self-triggering scripts where
00188     the _commandSynch thread needs to wait until RunControl
00189     actually enables the mask before continuing.
00190
00191     \param tmo  Optional parameter giving the wait timeout in seconds
00192     """
00193     self.__triggersEnabled.wait(tmo)
00194
00195   def enableMask(self):
00196     """\brief Commits the mask value to hardware.
00197
00198     \return The value of the dirty flag before the commit is made.
00199     """
00200     if self.__gltMode == 1:
00201       if self.__dirtyMask:
00202         if int(self.__saveMask) == GGLT.__TRG_DISABLE_MASK:
00203           self.__triggersEnabled.clear()
00204           Gdb.__setattr__(self, 'mask', int(self.__saveMask))
00205           self.__disableTime = self.regs['mask'].getTimeStamp()
00206         else:
00207           Gdb.__setattr__(self, 'mask', int(self.__saveMask))
00208           self.__enableTime = self.regs['mask'].getTimeStamp()
00209           self.__triggersEnabled.set()
00210         self.__dirtyMask = 0
00211         return 1
00212       else:
00213         return 0
00214     else:
00215       return 0
00216
00217   def disableMask(self):
00218     """\brief Disables all trigger masks but doesn't change the cached mask value.
00219
00220     This way when the triggers are enabled again, the old setting can be applied.
00221     """
00222     #Note: This method should not modify the cached value.
00223     if self.__gltMode == 1:
00224       self.__dirtyMask = 1
00225       self.__triggersEnabled.clear()
00226       Gdb.__setattr__(self, 'mask', GGLT.__TRG_DISABLE_MASK)
00227       self.__disableTime = self.regs['mask'].getTimeStamp()
00228
00229   def triggersDisabled(self):
00230     """\brief Check if the triggers are disabled.
00231
00232     \return True  if triggers are disabled,
00233             False if triggers are disabled.
00234     """
00235     return not self.__triggersEnabled.isSet()
00236
00237   def isMaskDirty(self):
00238     """\brief Return the mask dirty flag.
00239
00240     \return Mask dirty flag.
00241     """
00242     return self.__dirtyMask
00243
00244   def refreshMask(self):
00245     """\brief Refreshes the cached value of the mask from the hardware.
00246     """
00247     self.__saveMask = gBits.bf(Gdb.__getattr__(self, 'mask'))
00248
00249   def getEnableTime(self):
00250     """\brief Returns the VxWorks timestamp at the time the triggers are enabled.
00251
00252     \return Trigger enable time
00253     """
00254     return self.__enableTime
00255
00256   def getDisableTime(self):
00257     """\brief Returns the VxWorks timestamp at the time the triggers are disabled.
00258
00259     \return Trigger disable time
00260     """
00261     return self.__disableTime
00262
00263   def setDestinationOverride(self, override):
00264     """\brief Sets the flag to determine whether the user should be able to
00265     override the destination value.
00266
00267     \param override 0=Destination is supplied as the LCB address as returned by CmdCli.getLcbAddr()
00268                     1=The user supplied destination value takes effect
00269     """
00270     self.__destinationOverride = override
00271     if override == 0:
00272       Gdb.__setattr__(self, 'destination', self.__lcbAddr)
00273
00274
00275 ## private:
00276
00277   def __setGLTmode(self, mode):
00278     """Controls the GLT behaviour
00279
00280     \param mode If set to 0 the GLT behaves in immediate mode
00281                 meaning the trigger mask settings take effect
00282                 immediately.
00283                 If set to 1 then the settings are stored in a
00284                 cached variable and the script needs to call
00285                 enableMask() and/or disableMask() to commit
00286                 the changes from the cache to the hardware.
00287     """
00288     self.__gltMode = mode
00289
00290   def __getGLTmode(self):
00291     """Retrieves the current GLT mode
00292
00293     \return Current GLT mode
00294     """
00295     return self.__gltMode
00296
00297   def __getattr__(self, attribute):
00298     attr = attribute.lower()
00299     if attr == 'mask' and self.__gltMode == 1:
00300       return int(self.__saveMask)
00301     else:
00302       for (bitField, fromBit, toBit) in self.__mask_BF:
00303         if attr == bitField:
00304           if self.__gltMode == 1:
00305             return self.__saveMask[fromBit:toBit]
00306           else:
00307             mask = gBits.bf(Gdb.__getattr__(self, 'mask'))
00308             return mask[fromBit:toBit]
00309     return Gdb.__getattr__(self, attribute)
00310
00311   def __setattr__(self, attribute, value):
00312     attr = attribute.lower()
00313     if attr == 'mask' and self.__gltMode == 1:
00314       self.__dirtyMask = 1
00315       self.__saveMask = gBits.bf(value & self.__bitsMask)
00316       return
00317     elif attr == 'cmd_self_trigger':
00318       pass
00319     elif attr == 'destination':
00320       if not self.__destinationOverride:
00321         return
00322     else:
00323       for (bitField, fromBit, toBit) in self.__mask_BF:
00324         if attr == bitField:
00325           if self.__gltMode == 1:
00326             newVal = gBits.bf(0)
00327             newVal[fromBit:toBit] = value
00328             if (int(newVal) | self.__bitsMask) == self.__bitsMask:
00329               self.__dirtyMask = 1
00330               self.__saveMask[fromBit:toBit] = value
00331           else:
00332             mask = gBits.bf(Gdb.__getattr__(self, 'mask'))
00333             mask[fromBit:toBit] = value
00334             Gdb.__setattr__(self, 'mask', int(mask))
00335           return
00336     Gdb.__setattr__(self, attribute, value)
00337
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gGroup.py Source File

database

gGroup.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Class for handling named groups"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2004/08/11 03:10:10 $").split(' ')[1]
00014 __version__  = "$Revision: 2.1 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019
00020
00021 class Ggroup:
00022   def __init__(self, group, enabled = True):
00023     """Class for handling named groups.
00024     """
00025     self.__group   = group
00026     self.__enabled = enabled
00027
00028   def name(self):
00029     "Return the group's name."
00030     return self.__group
00031
00032   def enabled(self):
00033     "Return status of the group."
00034     return self.__enabled
00035
00036   def enable(self):
00037     "Enable a group."
00038     self.__enabled = True
00039
00040   def disable(self):
00041     "Disable a group."
00042     self.__enabled = False
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gHdb.py Source File

database

gHdb.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST Housekeeping system base class"
00012 __author__  = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/03/31 01:12:19 $").split(' ')[1]
00014 __version__ = "$Revision: 1.8 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__ = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import gAttr
00021 from LATTE.client.gNode     import Node
00022 from LATTE.database.gDb     import _regList
00023
00024
00025 class GattrHsk(gAttr.Gattr):
00026   """\brief Class which is instantiated for each housekeeping quantity
00027   """
00028   class __AttrHsk(object):
00029     """Helper class for private use in this file only.
00030     """
00031     def __init__(self, node, attr):
00032       self.__attr = attr
00033       self.__node = node
00034
00035       self.__data = None
00036
00037       #print id(self), id(attr), node.getName(), attr.getName(), attr.flags()
00038       if attr.flags() == (gAttr.ATTR_READ | gAttr.ATTR_NO_DIRECT_ACCESS):
00039         self.set = self.__badSet
00040         self.get = self.__badGet
00041       else:
00042         self.set = self.__set
00043         self.get = self.__get
00044
00045       # Callthroughs to 'parent' class
00046       self.setEGU        = self.__attr.setEGU
00047       self.setRule       = self.__attr.setRule
00048       self.setConstraint = self.__attr.setConstraint
00049       self.getEGU        = self.__attr.getEGU
00050       self.getRule       = self.__attr.getRule
00051       self.getConstraint = self.__attr.getConstraint
00052
00053       self.id               = attr.id
00054
00055     def __set(self, val, bypass=0, node=None):
00056       if node is not None:
00057         self.__data = self.__attr.set(node, val, bypass)
00058       else:                             # For backward compatibility
00059         self.__data = self.__attr.set(self.__node, val, bypass)
00060
00061     def __get(self, bypass=0, node=None):
00062       if node is not None:
00063         val = self.__attr.get(node, self.__data, bypass)
00064       else:                             # For backward compatibility
00065         val = self.__attr.get(self.__node, self.__data, bypass)
00066       return val
00067
00068     def __badSet(self, node, val, bypass=0):
00069       return -1                         # revisit
00070       #raise LATInterfaceException(1)
00071
00072     def __badGet(self, node, val, bypass=0):
00073       return -1                         # revisit
00074       #raise LATInterfaceException(1)
00075
00076     def getNode(self):
00077       return self.__node
00078
00079   def __init__(self, name, id,
00080                rule       = gAttr.Gattr.defaultRule,
00081                constraint = gAttr.Gattr.defaultConstraint,
00082                egu        = gAttr.Gattr.defaultEgu):
00083     """GattrHsk constructor
00084
00085     \param name        The name of the attribute.
00086     \param id          Positional identifier.
00087     \param rule        Optional. Attribute rule.
00088     \param constraint  Optional. Attribute constraint.
00089     \param egu         Optional. Attribute EGU
00090     """
00091     # instantiate the Gattr.
00092     gAttr.Gattr.__init__( self,
00093                           name=name, id=id, size=0, flags=gAttr.REG_READ_WRITE,
00094                           rule=rule, constraint=constraint, egu=egu )
00095
00096   def create(self, node):
00097     return GattrHsk.__AttrHsk(node, self)
00098
00099   def set(self, node, val, bypass=True):
00100     """
00101     Method for setting the value of an attribute.
00102     Calls the functions in the attribute's node for setting values.
00103
00104     \param val    Register value to be set
00105     \param bypass Optional. Flag for bypassing EGU conversion
00106                   Default is to *not* convert to EGU.
00107     """
00108     if bypass or val == None:
00109       raw = val
00110     else:
00111       (val, rejected) = self._Gattr__constraint.evaluate(val)
00112       if rejected:
00113         return None
00114       raw = self._Gattr__egu.raw(val)
00115
00116     return raw
00117
00118   def get(self, node, raw, bypass=False):
00119     """
00120     Method for getting the value of an attribute.
00121     If bypass=0 (the default), the value will be returned in EU.
00122     If bypass=1, the raw value will be returned.
00123     """
00124
00125     if bypass or raw == None:
00126       return raw
00127     else:
00128       egu = self._Gattr__egu.egu(raw)
00129       self._Gattr__rule.evaluate(egu, self, node)
00130       return egu
00131
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gHSK.py Source File

database

gHSK.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 ## \namespace gHSK
00011 ##
00012 ## \brief GLAST LAT record definitions.
00013 ##
00014 ## \b Contents:
00015 ##
00016 ##
00017 ## \b Overview:
00018 ##
00019 ##  This module provides classes that are used as the building blocks for the
00020 ##  Housekeeping hierarchy.
00021 ##
00022
00023 __facility__ = "Online"
00024 __abstract__ = "GLAST LAT functional block hierarchy"
00025 __author__  = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00026 __date__     = ("$Date: 2005/09/07 20:10:22 $").split(' ')[1]
00027 __version__ = "$Revision: 1.14 $"
00028 __release__  = "$Name: R04-12-00 $"
00029 __credits__ = "SLAC"
00030
00031 import LATTE.copyright_SLAC
00032
00033 import os, types
00034 import gSchemaConfig
00035 from gSchemaConfig import hasAttribute, getAttribute
00036 import gDb
00037 import gHdb
00038 import logging                    as     log
00039 from xml.dom                      import Node
00040 from xml.dom.ext.reader           import Sax2
00041 # from gHdb                         import GHdb
00042 from gGroup                       import *
00043
00044
00045 # GHSK class
00046 class GHSK(gDb.Gdb):
00047   """\brief GLAST HSK node Record
00048
00049   """
00050
00051   def __init__(self, client):
00052     """\brief Initialize valid attributes as Gattrs.
00053
00054     Assign default values to members
00055     """
00056     self.HTEM = gDb.Children(self, HTEM)
00057     self.HAEM = None
00058     self.HGEM = None
00059     self.HEBM = None
00060     self.HPDU = gDb.Children(self, HPDU)
00061     self.HCOM = None
00062     self.HCPU = None
00063     self.HNUL = HNUL(self)           # NULL node.  Used to reference non-used bytes in hsk
00064
00065     self.__schemaComments            = []
00066     self.__schemaName                = ''
00067     self.__configComments            = []
00068     self.__configName                = ''
00069     self.__configVersion             = ''
00070     self.__includeFiles              = []
00071     self.__declarations              = None
00072     self.__configurations            = {}
00073     self.__opaque                    = {}
00074     self.__serialnos                 = {}
00075     gDb.Gdb.__init__(self, client, None, None)
00076
00077   def downHTEM(self, childId):
00078     """\brief Navigate to the HTEM indicated by \a childId
00079
00080     \param  childId The id of the child HTEM
00081
00082     \return         A HARC object instance
00083     """
00084     return self.HTEM.down(childId)
00085
00086   def downHAEM(self):
00087     """\brief Navigate to the HAEM node
00088
00089     \return         The HAEM object instance
00090     """
00091     return self.HAEM
00092
00093   def downHGEM(self):
00094     """\brief Navigate to the HGEM node
00095
00096     \return         The HGEM object instance
00097     """
00098     return self.HGEM
00099
00100   def downHEBM(self):
00101     """\brief Navigate to the HEBM node
00102
00103     \return         The HEBM object instance
00104     """
00105     return self.HEBM
00106
00107   def downHPDU(self, childId):
00108     """\brief Navigate to the HPDU node
00109
00110     \return         The HPDU object instance
00111     """
00112     return self.HPDU.down(childId)
00113
00114   def downHCOM(self):
00115     """\brief Navigate to the HCOM node
00116
00117     \return         The HCOM object instance
00118     """
00119     return self.HCOM
00120
00121   def downHCPU(self):
00122     """\brief Navigate to the HCPU node
00123
00124     \return         The HCPU object instance
00125     """
00126     return self.HCPU
00127
00128   def downHNUL(self):
00129     """\brief Navigate to the HNUL node
00130
00131     \return         The HNUL object instance
00132     """
00133     return self.HNUL
00134
00135   def existsHTEM(self, temID):
00136     """\brief Check if the HTEM instance with the id
00137     \a temID exists in the schema.
00138
00139     \param  temID ACD readout controller id
00140
00141     \return       1 if it exists, 0 if it doesn't.
00142     """
00143     return self.HTEM.exists(temID)
00144
00145   def existsHAEM(self):
00146     """\brief Check if the HAEM instance exists in the schema.
00147
00148     \return       True if it exists, False if it doesn't.
00149     """
00150     return self.HAEM != None
00151
00152   def existsHGEM(self):
00153     """\brief Check if the HGEM instance exists in the schema.
00154
00155     \return       True if it exists, False if it doesn't.
00156     """
00157     return self.HGEM != None
00158
00159   def existsHEBM(self):
00160     """\brief Check if the HEBM instance exists in the schema.
00161
00162     \return       True if it exists, False if it doesn't.
00163     """
00164     return self.HEBM != None
00165
00166   def existsHPDU(self, hpduID):
00167     """\brief Check if the HPDU instance exists in the schema.
00168
00169     \return       True if it exists, False if it doesn't.
00170     """
00171     return self.HPDU.exists(hpduID)
00172
00173   def existsHCOM(self):
00174     """\brief Check if the HCOM instance exists in the schema.
00175
00176     \return       True if it exists, False if it doesn't.
00177     """
00178     return self.HCOM != None
00179
00180   def existsHCPU(self):
00181     """\brief Check if the HCPU instance exists in the schema.
00182
00183     \return       True if it exists, False if it doesn't.
00184     """
00185     return self.HCPU != None
00186
00187   def readSchema(self, schema):
00188     self.HTEM = gDb.Children(self, HTEM)
00189     self.HAEM = None
00190     self.HGEM = None
00191     self.HEBM = None
00192     self.HPDU = gDb.Children(self, HPDU)
00193     self.HCOM = None
00194     self.HCPU = None
00195     from gSchemaConfig import gSCprocessRegistry
00196     gSCprocessRegistry['GHSK'] = processGHSK
00197     gSchemaConfig.readSchema(self, schema)
00198
00199   def readConfig(self, cfgFileName):
00200     return readHskConfig(self, cfgFileName)
00201
00202   def applyConfig(self, seq):
00203     applyHskConfig(self, seq)
00204
00205   def getConfigurations(self):
00206     """\brief Get list of configurations.
00207
00208     Return a list of configuration tuples where
00209     each tuple contains the configDOM, configName and configRelease.
00210
00211     \return Configuration tuple list.
00212     """
00213     return self.__configurations
00214
00215   def getDeclarations(self):
00216     """\brief Get list of declarations.
00217
00218     Return a list of declarations
00219
00220     \return Declarations.
00221     """
00222     return self.__declarations
00223
00224   def getRules(self):
00225     """\brief Retrieves the rule dictionary as defined by the
00226     current schema/configuration.
00227
00228     \return Dictionary containing Grule objects (or its descendants).
00229     """
00230     return self.__declarations['rules']
00231
00232   def getOpaque(self, name):
00233     """\brief Retrieves the named opaque data included in the schema
00234
00235     \param  name Name of the opaque XML data
00236
00237     \return      A list of XML DOM objects matching \a name
00238     """
00239     if name in self.__opaque:
00240       return self.__opaque[name]
00241
00242   def __addHTEM(self, temID):
00243     return self.HTEM.add(temID)
00244
00245   def __addHAEM(self):
00246     self.HAEM = HAEM(self.client(), self)
00247     return self.HAEM
00248
00249   def __addHGEM(self):
00250     self.HGEM = HGEM(self.client(), self)
00251     return self.HGEM
00252
00253   def __addHEBM(self):
00254     self.HEBM = HEBM(self.client(), self)
00255     return self.HEBM
00256
00257   def __addHPDU(self, pduID):
00258     return self.HPDU.add(pduID)
00259
00260   def __addHCOM(self):
00261     self.HCOM = HCOM(self.client(), self)
00262     return self.HCOM
00263
00264   def __addHCPU(self):
00265     self.HCPU = HCPU(self.client(), self)
00266     return self.HCPU
00267
00268   def __removeHTEM(self, temID):
00269     self.HTEM.remove(temID)
00270
00271   def __removeHAEM(self):
00272     self.HAEM = None
00273
00274   def __removeHGEM(self):
00275     self.HGEM = None
00276
00277   def __removeHEBM(self):
00278     self.HEBM = None
00279
00280   def __removeHPDU(self, pduID):
00281     self.HPDU.remove(pduID)
00282
00283   def __removeHCOM(self):
00284     self.HCOM = None
00285
00286   def __removeHCPU(self):
00287     self.HCPU = None
00288
00289
00290 class HTEM(gDb.Gdb):
00291   """\brief GLAST TEM HSK node record
00292
00293   Valid Attributes:
00294   - \c tkr_digital_v
00295   - \c tkr_digital_i  DEPRECATED, no replace
00296   - \c tkr_analoga_v
00297   - \c tkr_analoga_i  DEPRECATED, no replace
00298   - \c tkr_analogb_v
00299   - \c tkr_analogb_i  DEPRECATED, no replace
00300   - \c tkr_bias_v     DEPRECATED, replaced by:
00301   - \c tkr_bias_v0
00302   - \c tkr_bias_i     DEPRECATED, no replace
00303   - \c cal_digital_v
00304   - \c cal_digital_i  DEPRECATED, replaced by:
00305   - \c tkr_bias_v1
00306   - \c cal_analog_v
00307   - \c cal_analog_i   DEPRECATED, replaced by:
00308   - \c cal_bias_v1
00309   - \c cal_bias_v     DEPRECATED, replaced by:
00310   - \c cal_bias_v0
00311   - \c cal_bias_i     DEPRECATED, replaced by:
00312   - \c tem_28_v0
00313   - \c tem_digital_v
00314   - \c tem_digital_i  DEPRECATED, replaced by:
00315   - \c tem_28_v0
00316   - \c afee_[0-3]_t[0-1]  (AFEE_*_t0 DEPRECATED)
00317   - \c tkr_c[0-7]_t[0-1]
00318   - \c tkr_lrs_0_low
00319   - \c tkr_lrs_0_high
00320   - \c tkr_lrs_1_low
00321   - \c tkr_lrs_1_high
00322   - \c tkr_lrs_mask
00323   - \c cal_lrs_0
00324   - \c cal_lrs_0_mask
00325   - \c cal_lrs_1
00326   - \c cal_lrs_1_mask
00327   - \c deadtime
00328   """
00329   # Environmental
00330   __regs = [
00331     gHdb.GattrHsk('TKR_DIGITAL_V',  0),
00332     gHdb.GattrHsk('TKR_DIGITAL_I',  1),  # DEPRECATED, no replace
00333     gHdb.GattrHsk('TKR_ANALOGA_V',  2),
00334     gHdb.GattrHsk('TKR_ANALOGA_I',  3),  # DEPRECATED, no replace
00335     gHdb.GattrHsk('TKR_ANALOGB_V',  4),
00336     gHdb.GattrHsk('TKR_ANALOGB_I',  5),  # DEPRECATED, no replace
00337     gHdb.GattrHsk('TKR_BIAS_V'   ,  6),  # DEPRECATED, replaced by:
00338     gHdb.GattrHsk('TKR_BIAS_V0'  ,  6),
00339     gHdb.GattrHsk('TKR_BIAS_I'   ,  7),  # DEPRECATED, no replace
00340     # mux boundary
00341     gHdb.GattrHsk('CAL_DIGITAL_V',  8),
00342     gHdb.GattrHsk('CAL_DIGITAL_I',  9),  # DEPRECATED, replaced by:
00343     gHdb.GattrHsk('TKR_BIAS_V1'  ,  9),
00344     gHdb.GattrHsk('CAL_ANALOG_V' , 10),
00345     gHdb.GattrHsk('CAL_ANALOG_I' , 11),  # DEPRECATED, replaced by:
00346     gHdb.GattrHsk('CAL_BIAS_V1',   11),
00347     gHdb.GattrHsk('CAL_BIAS_V'   , 12),  # DEPRECATED, replaced by:
00348     gHdb.GattrHsk('CAL_BIAS_V0'  , 12),
00349     gHdb.GattrHsk('CAL_BIAS_I'   , 13),  # DEPRECATED, replaced by:
00350     gHdb.GattrHsk('TEM_28_V0'    , 13),
00351     gHdb.GattrHsk('TEM_DIGITAL_V', 14),
00352     gHdb.GattrHsk('TEM_DIGITAL_I', 15),  # DEPRECATED, replaced by:
00353     gHdb.GattrHsk('TEM_28_V1'    , 15),
00354   ]
00355   offset = 16
00356   for i in range(4):
00357     __regs.append(gHdb.GattrHsk('AFEE_%d_T0'%i, offset   ))  # DEPRECATED
00358     __regs.append(gHdb.GattrHsk('AFEE_%d_T1'%i, offset+1 ))
00359     offset += 2
00360   for i in range(8):
00361     __regs.append(gHdb.GattrHsk('TKR_C%d_T0'%i, offset   ))
00362     __regs.append(gHdb.GattrHsk('TKR_C%d_T1'%i, offset+1 ))
00363     offset += 2
00364   # LRS counters
00365   __regs.append(gHdb.GattrHsk('TKR_LRS_0_LOW',  offset+0 ))
00366   __regs.append(gHdb.GattrHsk('TKR_LRS_0_HIGH', offset+1 ))
00367   __regs.append(gHdb.GattrHsk('TKR_LRS_1_LOW',  offset+2 ))
00368   __regs.append(gHdb.GattrHsk('TKR_LRS_1_HIGH', offset+3 ))
00369   __regs.append(gHdb.GattrHsk('TKR_LRS_MASK',   offset+4 ))
00370   __regs.append(gHdb.GattrHsk('CAL_LRS_0',      offset+5 ))
00371   __regs.append(gHdb.GattrHsk('CAL_LRS_0_MASK', offset+6 ))
00372   __regs.append(gHdb.GattrHsk('CAL_LRS_1',      offset+7 ))
00373   __regs.append(gHdb.GattrHsk('CAL_LRS_1_MASK', offset+8 ))
00374   __regs.append(gHdb.GattrHsk('DEADTIME',       offset+9 ))
00375
00376
00377   def __init__(self, client, parent, temID):
00378     """\brief Initialize valid housekeeping quantities as Gattrs
00379     """
00380     gDb.Gdb.__init__(self, client, parent, temID, self.__regs)
00381
00382
00383 class HAEM(gDb.Gdb):
00384   """\brief GLAST AEM HSK node Record
00385
00386   Valid Attributes:
00387   - \c FreeI
00388   - \c Temperature
00389   - \c HVI
00390   - \c DAQV
00391   - \c CommonStatus
00392   - \c CableStatus
00393
00394   """
00395   __regs = [
00396     # DAQ board hsk quantities
00397     gHdb.GattrHsk('FreeI'        , 0),
00398     gHdb.GattrHsk('Temperature'  , 1),
00399     gHdb.GattrHsk('HVI'          , 2),
00400     gHdb.GattrHsk('DAQV'         , 3),
00401     gHdb.GattrHsk('CommonStatus' , 4),
00402     gHdb.GattrHsk('CableStatus'  , 5),
00403   ]
00404   def __init__(self, client, parent):
00405     """\brief Initialize valid housekeeping quantities as Gattrs
00406     """
00407     self.HARC = gDb.Children(self, HARC)
00408     gDb.Gdb.__init__(self, client, parent, None, self.__regs)
00409
00410   def downHARC(self, arcID):
00411     """\brief Navigate to the HARC indicated by \a arcID
00412
00413     \param  arcID The id of the child HARC
00414
00415     \return         A HARC object instance
00416     """
00417     try:
00418       return self.HARC[arcID]
00419     except KeyError:
00420       return None
00421
00422   def existsHARC(self, arcID):
00423     """\brief Check if the HARC instance with the id
00424     \a arcID exists in the schema.
00425
00426     \param  arcId ACD readout controller id
00427
00428     \return       1 if it exists, 0 if it doesn't.
00429     """
00430     if arcID in self.HARC:
00431       return 1
00432     else:
00433       return 0
00434
00435   def __addHARC(self, arcID):
00436     if arcID in self.HARC:
00437       raise KeyError('*** HARC: ARC already exists with ID: %d' % arcID)
00438     else:
00439       self.HARC[arcID] = HARC(self.client(), self, arcID)
00440     return self.HARC[arcID]
00441
00442   def __removeHARC(self, arcID):
00443     if arcID in self.HARC:
00444       self.HARC.__delitem__(arcID)
00445
00446
00447 class HARC(gDb.Gdb):
00448   """\brief GLAST ARC HSK node record
00449
00450   Valid Attributes:
00451   - \c Vdd
00452   - \c Temperature
00453   - \c HV1
00454   - \c HV2
00455   """
00456   __regs = [
00457     gHdb.GattrHsk('Vdd'         , 0),
00458     gHdb.GattrHsk('Temperature' , 1),
00459     gHdb.GattrHsk('HV1'         , 2),
00460     gHdb.GattrHsk('HV2'         , 3),
00461   ]
00462   def __init__(self, client, parent, arcID):
00463     """\brief Initialize valid housekeeping quantities as Gattrs
00464     """
00465     gDb.Gdb.__init__(self, client, parent, arcID, self.__regs)
00466
00467 class HGEM(gDb.Gdb):
00468   """\brief GLAST GEM HSK node record
00469
00470   Valid Attributes:
00471   - \c Events
00472   - \c Livetime
00473   - \c Prescaled
00474   - \c Busy
00475   - \c Sent
00476   - \c PPS
00477   - \c LastPPS
00478   - \c TriggerTime
00479   """
00480   __regs = [
00481     gHdb.GattrHsk('Events'        , 0),
00482     gHdb.GattrHsk('Livetime'      , 1),
00483     gHdb.GattrHsk('Prescaled'     , 2),
00484     gHdb.GattrHsk('Busy'          , 3),
00485     gHdb.GattrHsk('Sent'          , 4),
00486     gHdb.GattrHsk('PPS'           , 5),
00487     gHdb.GattrHsk('LastPPS'       , 6),
00488     gHdb.GattrHsk('TriggerTime'   , 7),
00489   ]
00490   def __init__(self, client, parent):
00491     """\brief Initialize valid housekeeping quantities as Gattrs
00492     """
00493     gDb.Gdb.__init__(self, client, parent, None, self.__regs)
00494
00495 class HEBM(gDb.Gdb):
00496   """\brief GLAST EBM HSK node record
00497
00498   Valid Attributes:
00499   - \c Events
00500   - \c GEMreceive
00501   - \c TEM[0-15]receive
00502   - \c AEMreceive
00503   - \c SIU0receive
00504   - \c SIU1receive
00505   - \c EPU0receive
00506   - \c EPU1receive
00507   - \c EPU2receive
00508   - \c SIU0transmit
00509   - \c SIU1transmit
00510   - \c EPU0transmit
00511   - \c EPU1transmit
00512   - \c EPU2transmit
00513   - \c SSRtransmit
00514   """
00515   __regs = [
00516     gHdb.GattrHsk('Events'         ,  0),
00517     gHdb.GattrHsk('GEMreceive'     ,  1),
00518     gHdb.GattrHsk('TEM0receive'    ,  2),
00519     gHdb.GattrHsk('TEM1receive'    ,  3),
00520     gHdb.GattrHsk('TEM2receive'    ,  4),
00521     gHdb.GattrHsk('TEM3receive'    ,  5),
00522     gHdb.GattrHsk('TEM4receive'    ,  6),
00523     gHdb.GattrHsk('TEM5receive'    ,  7),
00524     gHdb.GattrHsk('TEM6receive'    ,  8),
00525     gHdb.GattrHsk('TEM7receive'    ,  9),
00526     gHdb.GattrHsk('TEM8receive'    , 10),
00527     gHdb.GattrHsk('TEM9receive'    , 11),
00528     gHdb.GattrHsk('TEM10receive'   , 12),
00529     gHdb.GattrHsk('TEM11receive'   , 13),
00530     gHdb.GattrHsk('TEM12receive'   , 14),
00531     gHdb.GattrHsk('TEM13receive'   , 15),
00532     gHdb.GattrHsk('TEM14receive'   , 16),
00533     gHdb.GattrHsk('TEM15receive'   , 17),
00534     gHdb.GattrHsk('AEMreceive'     , 18),
00535     gHdb.GattrHsk('SIU0receive'    , 19),
00536     gHdb.GattrHsk('SIU1receive'    , 20),
00537     gHdb.GattrHsk('EPU0receive'    , 21),
00538     gHdb.GattrHsk('EPU1receive'    , 22),
00539     gHdb.GattrHsk('EPU2receive'    , 23),
00540     gHdb.GattrHsk('SIU0transmit'   , 24),
00541     gHdb.GattrHsk('SIU1transmit'   , 25),
00542     gHdb.GattrHsk('EPU0transmit'   , 26),
00543     gHdb.GattrHsk('EPU1transmit'   , 27),
00544     gHdb.GattrHsk('EPU2transmit'   , 28),
00545     gHdb.GattrHsk('SSRtransmit'    , 29),
00546   ]
00547   def __init__(self, client, parent):
00548     """\brief Initialize valid housekeeping quantities as Gattrs
00549     """
00550     gDb.Gdb.__init__(self, client, parent, None, self.__regs)
00551
00552 class HPDU(gDb.Gdb):
00553   """\brief GLAST PDU HSK node record
00554
00555   Valid Attributes:
00556   - \c ACDShellTemp0
00557   - \c ACDShellTemp1
00558   - \c ACDconvTemp
00559   - \c ACDpowerState
00560   - \c ACDpowerSupply
00561   - \c GridTemp[0-12]
00562   - \c RadiatorTemp[0-12]
00563   - \c RadiatorAfrzTemp0
00564   - \c RadiatorAfrzTemp1
00565   - \c CalBaseplateTemp[0-16]
00566   - \c VHCP_DSHP_M_Temp[0-6]
00567   - \c VHCP_DSHP_P_Temp[0-6]
00568   - \c VHCP_XLHP_M_Temp[0-6]
00569   - \c VHCP_XLHP_P_Temp[0-6]
00570   - \c VHCPRes_M_Temp[0-6]
00571   - \c VHCPRes_P_Temp[0-6]
00572   - \c TEM[0-16]_PCBTemp
00573   - \c TEM[0-16]_digital33V
00574   - \c TEM[0-16]_PSTemp
00575   - \c TEM[0-16]_powerState
00576   - \c ACDpmtRailTemp[0-4]
00577   - \c ACDBEAgridTemp[0-1]
00578   - \c GridRadiatorTemp[0-4]
00579   - \c EPUdigitalVoltage[0-3]
00580   - \c EPUTemp[0-3]
00581   - \c EPUCratePowerStat[0-3]
00582   - \c EPUConverterStat[0-3]
00583   """
00584   __regs = []
00585   __regs.append(gHdb.GattrHsk('ACDShellTemp0',  0))
00586   __regs.append(gHdb.GattrHsk('ACDShellTemp1',  1))
00587   __regs.append(gHdb.GattrHsk('ACDconvTemp',    2))
00588   __regs.append(gHdb.GattrHsk('ACDpowerState',  3))
00589   __regs.append(gHdb.GattrHsk('ACDpowerSupply', 4))
00590   offset = 5
00591   for i in range(12):
00592     __regs.append(gHdb.GattrHsk('GridTemp%d'%i,     offset  ))
00593     __regs.append(gHdb.GattrHsk('RadiatorTemp%d'%i, offset+1))
00594     offset += 2
00595   __regs.append(gHdb.GattrHsk('RadiatorAfrzTemp0',  offset+0))
00596   __regs.append(gHdb.GattrHsk('RadiatorAfrzTemp1',  offset+1))
00597   offset += 2
00598   for i in range(16):
00599     __regs.append(gHdb.GattrHsk('CalBaseplateTemp%d'%i, offset))
00600     offset += 1
00601
00602   for i in range(6):
00603     __regs.append(gHdb.GattrHsk('VHCP_DSHP_M_Temp%d'%i, offset+0))
00604     __regs.append(gHdb.GattrHsk('VHCP_DSHP_P_Temp%d'%i, offset+1))
00605     __regs.append(gHdb.GattrHsk('VHCP_XLHP_M_Temp%d'%i, offset+2))
00606     __regs.append(gHdb.GattrHsk('VHCP_XLHP_P_Temp%d'%i, offset+3))
00607     __regs.append(gHdb.GattrHsk('VHCPRes_M_Temp%d'%i,   offset+4))
00608     __regs.append(gHdb.GattrHsk('VHCPRes_P_Temp%d'%i,   offset+5))
00609     offset += 6
00610
00611   for i in range(16):
00612     __regs.append(gHdb.GattrHsk('TEM%d_PCBTemp'%i,    offset+0))
00613     __regs.append(gHdb.GattrHsk('TEM%d_digital33V'%i, offset+1))
00614     __regs.append(gHdb.GattrHsk('TEM%d_PSTemp'%i,     offset+2))
00615     __regs.append(gHdb.GattrHsk('TEM%d_powerState'%i, offset+3))
00616     offset += 4
00617   for i in range(4):
00618     __regs.append(gHdb.GattrHsk('ACDpmtRailTemp%d'%i, offset))
00619     offset += 1
00620   __regs.append(gHdb.GattrHsk('ACDBEAgridTemp0',offset+0))
00621   __regs.append(gHdb.GattrHsk('ACDBEAgridTemp1',offset+1))
00622   offset += 2
00623   for i in range(4):
00624     __regs.append(gHdb.GattrHsk('GridRadiatorTemp%d'%i,offset))
00625     offset += 1
00626   for i in range(3):
00627     __regs.append(gHdb.GattrHsk('EPUdigitalVoltage%d'%i,offset+0))
00628     __regs.append(gHdb.GattrHsk('EPUTemp%d'%i,          offset+1))
00629     __regs.append(gHdb.GattrHsk('EPUCratePowerStat%d'%i,offset+2))
00630     __regs.append(gHdb.GattrHsk('EPUConverterStat%d'%i, offset+3))
00631     offset += 4
00632   __regs.append(gHdb.GattrHsk('Spare0',offset  ))
00633   __regs.append(gHdb.GattrHsk('Spare1',offset+1))
00634   offset += 2
00635
00636   def __init__(self, client, parent, pduID):
00637     """\brief Initialize valid housekeeping quantities as Gattrs
00638     """
00639     gDb.Gdb.__init__(self, client, parent, pduID, self.__regs)
00640
00641 class HCOM(gDb.Gdb):
00642   """\brief GLAST Communications statistics HSK node record
00643
00644   Valid Attributes:
00645   - \c Traffic_LCB0
00646   - \c Traffic_LCB0
00647   - \c Traffic_LCB0
00648   - \c Traffic_1553
00649   - \c Traffic_SSR
00650   """
00651   __regs = [
00652     gHdb.GattrHsk('Traffic_LCB0',0),
00653     gHdb.GattrHsk('Traffic_LCB0',1),
00654     gHdb.GattrHsk('Traffic_LCB0',2),
00655     gHdb.GattrHsk('Traffic_1553',3),
00656     gHdb.GattrHsk('Traffic_SSR' ,4),
00657   ]
00658   def __init__(self, client, parent):
00659     """\brief Initialize valid housekeeping quantities as Gattrs
00660     """
00661     gDb.Gdb.__init__(self, client, parent, None, self.__regs)
00662
00663 class HCPU(gDb.Gdb):
00664   """\brief GLAST CPU metrics HSK node record
00665
00666   Valid Attributes:
00667   - \c CPU_Idle_[0-3]
00668   - \c CPU_Temp_[0-3]
00669   - \c MemUsage_[0-3]
00670   - \c CacheMisses_[0-3]
00671   - \c TaskStats_[0-3]
00672   """
00673   __regs = []
00674   offset = 0
00675   for i in range(3):
00676     __regs.append(gHdb.GattrHsk('CPU_Idle_%d'%i,    offset+0))
00677     __regs.append(gHdb.GattrHsk('CPU_Temp_%d'%i,    offset+1))
00678     __regs.append(gHdb.GattrHsk('MemUsage_%d'%i,    offset+2))
00679     __regs.append(gHdb.GattrHsk('CacheMisses_%d'%i, offset+3))
00680     __regs.append(gHdb.GattrHsk('TaskStats_%d'%i,   offset+4))
00681     offset += 5
00682   def __init__(self, client, parent):
00683     """\brief Initialize valid housekeeping quantities as Gattrs
00684     """
00685     gDb.Gdb.__init__(self, client, parent, None, self.__regs)
00686
00687 class HNUL(gDb.Gdb):
00688   """\brief GLAST HSK null record
00689
00690   Valid Attributes:
00691   - \c EMPTY
00692   """
00693   __regs = [
00694     gHdb.GattrHsk('EMPTY',0),
00695   ]
00696   def __init__(self, parent):
00697     """\brief Initialize valid housekeeping quantities as Gattrs
00698     """
00699     gDb.Gdb.__init__(self, None, parent, None, self.__regs)
00700
00701 def processGHSK(isSchema, ghdb, node, declarations):
00702   fn = "processGHSK"
00703   for n in gSchemaConfig.getChildNodes(node):
00704     tagName = n.tagName.lower()
00705     if tagName   == 'htem':
00706       processHTEM(isSchema, ghdb, n, declarations)
00707     elif tagName == 'haem':
00708       processHAEM(isSchema, ghdb, n, declarations)
00709     elif tagName == 'hgem':
00710       processHGEM(isSchema, ghdb, n, declarations)
00711     elif tagName == 'hebm':
00712       processHEBM(isSchema, ghdb, n, declarations)
00713     elif tagName == 'hpdu':
00714       processHPDU(isSchema, ghdb, n, declarations)
00715     elif tagName == 'hcom':
00716       processHCOM(isSchema, ghdb, n, declarations)
00717     elif tagName == 'hcpu':
00718       processHCPU(isSchema, ghdb, n, declarations)
00719     elif tagName == 'opaque':
00720       gSchemaConfig.addOpaque(ghdb, n)
00721     elif isSchema:
00722       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00723     elif tagName in ghdb.regs:
00724       gSchemaConfig.setRegister(ghdb.regs[tagName], n, declarations)
00725     else:
00726       log.error("%s: Configuration error processing GHSK...Invalid attribute %s" % (fn, n.tagName))
00727
00728   return ghdb
00729
00730
00731 def processHTEM(isSchema, ghdb, node, declarations):
00732   fn = "processHTEM"
00733   if hasAttribute(node,'ID'):
00734     htemIdSeq = gSchemaConfig.uncompressSequence(getAttribute(node,'ID'))
00735   else:
00736     raise KeyError("%s: Configuration error processing HTEM ...No ID attribute for HTEM." % (fn) )
00737
00738   for htemId in htemIdSeq:
00739     if isSchema:
00740       htem = __privateFn(ghdb, '__addHTEM')(ghdb, htemId)
00741     elif ghdb.existsHTEM(htemId):
00742       htem = ghdb.downHTEM(htemId)
00743     else:
00744       log.debug("%s: Configuration error processing HTEM ...Not populated" %(fn))
00745       continue
00746     for n in gSchemaConfig.getChildNodes(node):
00747       tagName = n.tagName.lower()
00748       if tagName == 'opaque':
00749         gSchemaConfig.addOpaque(htem, n)
00750       elif isSchema:
00751         log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00752       elif tagName in htem.regs:
00753         gSchemaConfig.setRegister(htem.regs[tagName], n, declarations)
00754       else:
00755         log.error("%s: Configuration error processing HTEM # %d ...Invalid attribute %s" % (fn, htemId, n.tagName))
00756
00757 def processHAEM(isSchema, ghdb, node, declarations):
00758   fn = "processHAEM"
00759   if isSchema:
00760     haem = __privateFn(ghdb, '__addHAEM')(ghdb)
00761   elif ghdb.existsHAEM():
00762     haem = ghdb.downHAEM()
00763   else:
00764     log.debug("%s: Configuration error processing HAEM ...Not populated" %(fn))
00765     return
00766   for n in gSchemaConfig.getChildNodes(node):
00767     tagName = n.tagName.lower()
00768     if tagName == 'harc':
00769       processHARC(isSchema, haem, n, declarations)
00770     elif tagName == 'opaque':
00771       gSchemaConfig.addOpaque(haem, n)
00772     elif isSchema:
00773       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00774     elif tagName in haem.regs:
00775       gSchemaConfig.setRegister(haem.regs[tagName], n, declarations)
00776     else:
00777       log.error("%s: Configuration error processing HAEM ...Invalid attribute %s" %(fn, n.tagName))
00778
00779 def processHARC(isSchema, ghdb, node, declarations):
00780   fn = "processHARC"
00781   if hasAttribute(node,'ID'):
00782     harcIdSeq = gSchemaConfig.uncompressSequence(getAttribute(node,'ID'))
00783   else:
00784     raise KeyError("%s: Configuration error processing HARC ...No ID attribute for HARC." % (fn) )
00785
00786   for harcId in harcIdSeq:
00787     if isSchema:
00788       harc = __privateFn(ghdb, '__addHARC')(ghdb, harcId)
00789     elif ghdb.existsHARC(harcId):
00790       harc = ghdb.downHARC(harcId)
00791     else:
00792       log.debug("%s: Configuration error processing HARC ...Not populated" %(fn))
00793       continue
00794     for n in gSchemaConfig.getChildNodes(node):
00795       tagName = n.tagName.lower()
00796       if tagName == 'opaque':
00797         gSchemaConfig.addOpaque(harc, n)
00798       elif isSchema:
00799         log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00800       elif tagName in harc.regs:
00801         gSchemaConfig.setRegister(harc.regs[tagName], n, declarations)
00802       else:
00803         log.error("%s: Configuration error processing HARC # %d ...Invalid attribute %s" % (fn, harcId, n.tagName))
00804
00805
00806
00807
00808
00809 def processHGEM(isSchema, ghdb, node, declarations):
00810   fn = "processHGEM"
00811   if isSchema:
00812     hgem = __privateFn(ghdb, '__addHGEM')(ghdb)
00813   elif ghdb.existsHGEM():
00814     hgem = ghdb.downHGEM()
00815   else:
00816     log.debug("%s: Configuration error processing HGEM ...Not populated" %(fn))
00817     return
00818
00819   for n in gSchemaConfig.getChildNodes(node):
00820     tagName = n.tagName.lower()
00821     if tagName == 'opaque':
00822       gSchemaConfig.addOpaque(hgem, n)
00823     elif isSchema:
00824       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00825     elif tagName in hgem.regs:
00826       gSchemaConfig.setRegister(hgem.regs[tagName], n, declarations)
00827     else:
00828       log.error("%s: Configuration error processing HGEM ...Invalid attribute %s" %(fn, n.tagName))
00829
00830
00831 def processHEBM(isSchema, ghdb, node, declarations):
00832   fn = "processHEBM"
00833   if isSchema:
00834     hebm = __privateFn(ghdb, '__addHEBM')(ghdb)
00835   elif ghdb.existsHEBM():
00836     hebm = ghdb.downHEBM()
00837   else:
00838     log.debug("%s: Configuration error processing HEBM ...Not populated" %(fn))
00839     return
00840
00841   for n in gSchemaConfig.getChildNodes(node):
00842     tagName = n.tagName.lower()
00843     if tagName == 'opaque':
00844       gSchemaConfig.addOpaque(hebm, n)
00845     elif isSchema:
00846       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00847     elif tagName in hebm.regs:
00848       gSchemaConfig.setRegister(hebm.regs[tagName], n, declarations)
00849     else:
00850       log.error("%s: Configuration error processing HEBM ...Invalid attribute %s" %(fn, n.tagName))
00851
00852
00853 def processHPDU(isSchema, ghdb, node, declarations):
00854   fn = "processHPDU"
00855   if hasAttribute(node,'ID'):
00856     hpduIdSeq = gSchemaConfig.uncompressSequence(getAttribute(node,'ID'))
00857   else:
00858     raise KeyError("%s: Configuration error processing HPDU ...No ID attribute for HPDU." % (fn) )
00859
00860   for hpduId in hpduIdSeq:
00861     if isSchema:
00862       hpdu = __privateFn(ghdb, '__addHPDU')(ghdb,hpduId)
00863     elif ghdb.existsHPDU(hpduId):
00864       hpdu = ghdb.downHPDU(hpduId)
00865     else:
00866       log.debug("%s: Configuration error processing HPDU %d ...Not populated" %(fn, hpduId))
00867       return
00868
00869     for n in gSchemaConfig.getChildNodes(node):
00870       tagName = n.tagName.lower()
00871       if tagName == 'opaque':
00872         gSchemaConfig.addOpaque(hpdu, n)
00873       elif isSchema:
00874         log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00875       elif tagName in hpdu.regs:
00876         gSchemaConfig.setRegister(hpdu.regs[tagName], n, declarations)
00877       else:
00878         log.error("%s: Configuration error processing HPDU ...Invalid attribute %s" %(fn, n.tagName))
00879
00880
00881 def processHCOM(isSchema, ghdb, node, declarations):
00882   fn = "processHCOM"
00883   if isSchema:
00884     hcom = __privateFn(ghdb, '__addHCOM')(ghdb)
00885   elif ghdb.existsHCOM():
00886     hcom = ghdb.downHCOM()
00887   else:
00888     log.debug("%s: Configuration error processing HCOM ...Not populated" %(fn))
00889     return
00890
00891   for n in gSchemaConfig.getChildNodes(node):
00892     tagName = n.tagName.lower()
00893     if tagName == 'opaque':
00894       gSchemaConfig.addOpaque(hcom, n)
00895     elif isSchema:
00896       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00897     elif tagName in hcom.regs:
00898       gSchemaConfig.setRegister(hcom.regs[tagName], n, declarations)
00899     else:
00900       log.error("%s: Configuration error processing HCOM ...Invalid attribute %s" %(fn, n.tagName))
00901
00902
00903 def processHCPU(isSchema, ghdb, node, declarations):
00904   fn = "processHCPU"
00905   if isSchema:
00906     hcpu = __privateFn(ghdb, '__addHCPU')(ghdb)
00907   elif ghdb.existsHCPU():
00908     hcpu = ghdb.downHCPU()
00909   else:
00910     log.debug("%s: Configuration error processing HCPU ...Not populated" %(fn))
00911     return
00912
00913   for n in gSchemaConfig.getChildNodes(node):
00914     tagName = n.tagName.lower()
00915     if tagName == 'opaque':
00916       gSchemaConfig.addOpaque(hcpu, n)
00917     elif isSchema:
00918       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00919     elif tagName in hcpu.regs:
00920       gSchemaConfig.setRegister(hcpu.regs[tagName], n, declarations)
00921     else:
00922       log.error("%s: Configuration error processing HCPU ...Invalid attribute %s" %(fn, n.tagName))
00923
00924
00925
00926 def readHskConfig(ghsk, cfgFileName):
00927   """Read a hsk configuration XML file and add its DOM
00928   to the dictionary of configurations.
00929
00930   \param  ghsk        Populated schema
00931   \param  cfgFileName Name of the configuration file in XML format
00932   \return             The numeric key value of the dictionary entry.
00933                       -1 if it fails to read the configuration file.
00934   """
00935   fn = "readHskConfig"
00936   curDir = os.getcwd()
00937   mainFilePath = os.path.dirname(cfgFileName)
00938   mainFileName = os.path.basename(cfgFileName)
00939   if mainFilePath != '': os.chdir(mainFilePath)
00940
00941   try:
00942     cfgDoc = Sax2.FromXmlFile(cfgFileName)
00943   except:
00944     log.exception("%s: Error reading configuration file" % fn)
00945     os.chdir(curDir)
00946     return -1
00947
00948   cfgNode = cfgDoc.documentElement
00949
00950   includeFiles = []
00951   gSchemaConfig.processIncludes(cfgDoc, cfgNode, includeFiles, mainFilePath)
00952   ghsk._GHSK__includeFiles += includeFiles
00953   cfgDict = ghsk.getConfigurations()
00954   configSeq = len(cfgDict)
00955   configName = ''
00956   configVersion = ''
00957   if hasAttribute(cfgNode,'name'):
00958     configName = str(getAttribute(cfgNode,'name'))
00959   if hasAttribute(cfgNode,'version'):
00960     configVersion = str(getAttribute(cfgNode,'version'))
00961
00962   cfgDict[configSeq] = (cfgNode, configName, configVersion)
00963   os.chdir(curDir)
00964   return configSeq
00965
00966 def applyHskConfig(ghsk, seq=None):
00967   """Applies the configuration that may have existed when the schema is read.
00968      The configuration portion of the schema is stored as a DOM reference
00969      in the GHSK node. This function accesses that DOM and sets the attributes
00970      accordingly
00971
00972   Input ::
00973
00974     (1) GHSK root of the object model
00975     (2) Optional sequence number of the configuration
00976
00977   Output: None
00978
00979   Usage::
00980
00981     applyConfig(ghsk)"""
00982
00983   fn = "applyHskConfig"
00984   configs = []
00985   if seq is None:
00986     if len(ghsk.getConfigurations()) == 0:
00987       log.debug("%s: Nothing to do, no configuration exists" % fn)
00988       return
00989     else:
00990       configSeqList = ghsk.getConfigurations().keys()
00991       configSeqList.sort()
00992       for seq in configSeqList:
00993         configs.append(ghsk.getConfigurations()[seq][0])
00994   elif type(seq) == types.IntType:
00995     if ghsk.getConfigurations().has_key(seq):
00996       configs.append(ghsk.getConfigurations()[seq][0])
00997     else:
00998       log.error("%s: Configuration with sequence %d could not be found" % (fn, seq))
00999       return
01000
01001   for config in configs:
01002     for n in gSchemaConfig.getChildNodes(config):
01003       processHskConfigProperties(ghsk, n, ghsk.getDeclarations())
01004       if n.nodeType == Node.ELEMENT_NODE:
01005         tagname = n.tagName.lower()
01006         if tagname == 'ghsk':
01007           if hasAttribute(config,'name'):
01008             configName = getAttribute(config,'name')
01009           else:
01010             configName = '(no name)'
01011           log.debug("%s: Applying configuration: %s" % (fn, configName))
01012           processGHSK(0, ghsk, n, ghsk.getDeclarations())
01013
01014 def processHskConfigProperties(ghsk, node, declarations):
01015   fn = "processHskConfigProperties"
01016   if node.nodeType == Node.ELEMENT_NODE:
01017     cfgTagname = node.tagName.lower()
01018     if cfgTagname == 'declarations':
01019       gSchemaConfig.processDeclarations(0, node, declarations)
01020     elif cfgTagname == 'constraints':
01021       gSchemaConfig.processConstraints(node, declarations)
01022     elif cfgTagname == 'rules':
01023       gSchemaConfig.processRules(node, declarations)
01024     elif cfgTagname == 'egus':
01025       gSchemaConfig.processEGUs(node, declarations)
01026     elif cfgTagname in ('ghsk'):
01027       pass
01028     else:
01029       log.error("%s: Unrecognized configuration tag: %s" % (fn, cfgTagname))
01030
01031
01032
01033
01034 def __privateFn(cls, function):
01035   # local routine to return an arbitrary class attribute.
01036   # used to return private methods of classes.
01037   gname = cls.__class__.__name__
01038   gdict = cls.__class__.__dict__
01039   return gdict['_' + gname + function]
01040
01041
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gLAT.py Source File

database

gLAT.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 ## \namespace gLAT
00011 ##
00012 ## \brief GLAST LAT record definitions.
00013 ##
00014 ## \b Contents:
00015 ##
00016 ##  GLAST LAT functional block hierarchy representation in Python. See the following documents for more info:
00017 ##  <p><a href="http://www-glast.slac.stanford.edu/IntegrationTest/ONLINE/docs/TEM.pdf">The Tower Electronics Module (TEM) - Programming ICD specification (LAT-TD-00605-D1)</a>
00018 ##  <p><a href="http://www-glast.slac.stanford.edu/IntegrationTest/ONLINE/docs/AEM.pdf">ACD Electronics Module (AEM) - Programming ICD specification (LAT-TD-00639-D1)</a>
00019 ##  <p><a href="http://www-glast.slac.stanford.edu/IntegrationTest/ONLINE/docs/EBM.pdf">The Event Builder Module - Programming ICD specification (LAT-TD-01546)</a>
00020 ##  <p><a href="http://www-glast.slac.stanford.edu/IntegrationTest/ONLINE/docs/GEM.pdf">The GLT Electronics Module - Programming ICD specification (LAT-TD-01545)</a>
00021 ##  <p><a href="http://www-glast.slac.stanford.edu/IntegrationTest/ONLINE/docs/CRU.pdf">The Command/Response Unit - Programming ICD specification (LAT-TD-01547)</a>
00022 ##  <p><a href="http://www-glast.slac.stanford.edu/IntegrationTest/ONLINE/docs/PDU.pdf">The Power Distribution Unit - Programming ICD specification (LAT-TD-01543)</a>
00023 ##
00024 ## \b Overview:
00025 ##
00026 ##  This module provides classes that are used as the building blocks for the
00027 ##  LAT hierarchy. All classes inherit from Gnode class and add their own member
00028 ##  methods and functions where necessary. Here is a list of classes defined:
00029 ##
00030 ##    - GLAT: Root node for the hierarchy
00031 ##    - GPDU: Power Distribution Unit
00032 ##    - GPDUC: PDU Controller
00033 ##    - GPEQ: PDU Environmental Monitors
00034 ##    - GTWR: Tower
00035 ##    - GTEM: Tower Electronics Module
00036 ##    - GCCC: Calorimeter Cable Controller
00037 ##    - GCRC: Calorimeter Readout Controller
00038 ##    - GCFE: Calorimeter Front-end Controller
00039 ##    - GTCC: Tracker Cable Controller
00040 ##    - GTRC: Tracker Readout Controller
00041 ##    - GTFE: Tracker Front-end Controller
00042 ##    - GTIC: Trigger Interface Controller
00043 ##    - GAEM: ACD Common Controller
00044 ##    - GAEQ: ACD Environmental Monitors
00045 ##    - GARC: ACD Readout Controller
00046 ##    - GAFE: ACD Front-End Controller
00047 ##    - GGLT: Global Trigger
00048 ##    - GEBM: Event Builder Module
00049 ##    - GEBMC: Event Builder Module Controller
00050 ##    - GEBMST: Event Builder Module Statistics
00051 ##    - GGEM: GLT Electronics Module
00052 ##    - GGEMC: GLT Electronics Module Controller
00053 ##    - GGEMMG: GLT Electronics Module TAM generator
00054 ##    - GGEMST: GLT Electronics Module Statistics
00055 ##    - GGEMSC: GLT Electronics Module Scheduler
00056 ##    - GGEMVG: GLT Electronics Module ROI generator
00057 ##    - GGEMIE: GLT Electronics Module Input enables
00058 ##    - GGEMW: GLT Electronics Module Window
00059 ##    - GCRU: Command Response Unit
00060
00061 __facility__ = "Online"
00062 __abstract__ = "GLAST LAT functional block hierarchy"
00063 __author__  = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00064 __date__     = ("$Date: 2006/07/17 18:29:10 $").split(' ')[1]
00065 __version__ = "$Revision: 2.19 $"
00066 __release__  = "$Name: R04-12-00 $"
00067 __credits__ = "SLAC"
00068
00069 import LATTE.copyright_SLAC
00070 import gSchemaConfig
00071 import gDb
00072 import gAttr
00073
00074 from gLCB import GLCB
00075 from gCRU import GCRU
00076 from gEBM import GEBM
00077 from gGEM import GGEM
00078 from gAEM import GAEM
00079 from gPDU import GPDU
00080 from gTEM import GTEM
00081 from gSIU import GSIU
00082 from gEPU import GEPU
00083
00084
00085 # GLAT class
00086 class GLAT(gDb.Gdb):
00087   """\brief GLAST LAT node Record
00088
00089   The GLAT node provides access to parity registers and
00090   event statistics registers.
00091
00092   Valid Registers:
00093   - \c parity_latp_cell_header
00094   - \c parity_latp_cell_body
00095   - \c parity_tem_cmd_str
00096   - \c parity_tem_access_desc
00097   - \c parity_tem_cmd_payload
00098   - \c stats_failed_events
00099   - \c stats_failed_event_sends
00100   - \c stats_valid_events
00101   - \c stats_discarded_event_sends
00102   - \c stats_length_mismatch_count
00103   - \c stats_events_not_sent
00104
00105   \deprecated
00106   - \c \b parity_latp_cell_header     Use 'LCB.parity_latp_cell_header' instead
00107   - \c \b parity_latp_cell_body       Use 'LCB.parity_latp_cell_body' instead
00108   - \c \b stats_failed_events         Use 'OCS.stats_failed_events' instead
00109   - \c \b stats_failed_event_sends    Use 'OCS.stats_failed_event_sends' instead
00110   - \c \b stats_valid_events          Use 'OCS.stats_valid_events' instead
00111   - \c \b stats_discarded_event_sends Use 'OCS.stats_discarded_event_sends' instead
00112   - \c \b stats_length_mismatch_count Use 'OCS.stats_length_mismatch_count' instead
00113   - \c \b stats_events_not_sent       Use 'OCS.stats_events_not_sent' instead
00114
00115   Event statistics:
00116
00117   The following statistics registers are initialized
00118   at the start of each RunControl run:
00119
00120   - \c stats_failed_events -- Counts events where
00121   the eventHandler receives a bad status for the event.
00122
00123   - \c stats_failed_event_sends -- Counts events where
00124   the socket send failed with an error other than
00125   EWOULDBLOCK.
00126
00127   - \c stats_valid_events -- Counts when a valid event
00128   has been successfully sent to the client.
00129
00130   - \c stats_discarded_event_sends -- Counts cases when an
00131   event send failed due to the fact that the send
00132   returned an EWOULDBLOCK error.
00133
00134   - \c stats_length_mismatch_count -- Counts cases when
00135   the length argument passed to the event handler did
00136   not match the length provided in the event header.
00137
00138   - \c stats_events_not_sent -- Counts when the event
00139   mode is set to DONOT_SEND_EVENTS where the incoming
00140   events will not be forwarded to the client over the
00141   socket.
00142
00143   """
00144   __attrs = [
00145     # Registers
00146     gAttr.GattrRegDepr('parity_latp_cell_header',      0, 4), # Deprecated: use gLCB
00147     gAttr.GattrRegDepr('parity_latp_cell_body',        1, 4), # Deprecated: use gLCB
00148     gAttr.GattrReg(    'parity_tem_cmd_str',           2, 4),
00149     gAttr.GattrReg(    'parity_tem_access_desc',       3, 4),
00150     gAttr.GattrReg(    'parity_tem_cmd_payload',       4, 4),
00151     gAttr.GattrRegDepr('stats_failed_events',          8, 4), # Deprecated: use gOCS
00152     gAttr.GattrRegDepr('stats_failed_event_sends',     9, 4), # Deprecated: use gOCS
00153     gAttr.GattrRegDepr('stats_valid_events',          10, 4), # Deprecated: use gOCS
00154     gAttr.GattrRegDepr('stats_discarded_event_sends', 11, 4), # Deprecated: use gOCS
00155     gAttr.GattrRegDepr('stats_length_mismatch_count', 12, 4), # Deprecated: use gOCS
00156     gAttr.GattrRegDepr('stats_events_not_sent',       13, 4)  # Deprecated: use gOCS
00157     ]
00158
00159   def __init__(self, client):
00160     """\brief Initialize valid registers as Gattrs.
00161
00162     Assign default values to members
00163     """
00164     self.LCB                         = GLCB(client)
00165     self.CRU                         = None
00166     self.AEM                         = None
00167     self.GEM                         = None
00168     self.EBM                         = None
00169     self.PDU                         = gDb.Children(self, GPDU)
00170     self.TEM                         = gDb.Children(self, GTEM)
00171     self.SIU                         = gDb.Children(self, GSIU)
00172     self.EPU                         = gDb.Children(self, GEPU)
00173     self.__schemaComments            = []
00174     self.__schemaName                = ''
00175     self.__configComments            = []
00176     self.__configName                = ''
00177     self.__configVersion             = ''
00178     self.__includeFiles              = []
00179     self.__declarations              = None
00180     self.__configurations            = {}
00181     self.__deadChannels              = None
00182     self.__noisyChannels             = None
00183     self.__opaque                    = {}
00184     self.__serialnos                 = {}
00185     self.__xbrdExists                = False
00186     self.__excludes                  = {}
00187     gDb.Gdb.__init__(self, client, None, 0, self.__attrs)
00188
00189   def read(self, reg):
00190     return self.cmdrsp('ggLATread', reg, '!I')
00191
00192   def load(self, reg, value):
00193     return self.cmdrsp('ggLATload', reg, value)
00194
00195   def readSchema(self, name):
00196     self.CRU                         = None
00197     self.AEM                         = None
00198     self.GEM                         = None
00199     self.EBM                         = None
00200     self.PDU                         = gDb.Children(self, GPDU)
00201     self.TEM                         = gDb.Children(self, GTEM)
00202     self.SIU                         = gDb.Children(self, GSIU)
00203     self.EPU                         = gDb.Children(self, GEPU)
00204     return gSchemaConfig.readSchema(self, name)
00205
00206   def writeSchema(self, fileName):
00207     gSchemaConfig.writeSchema(self, file(fileName, "w+"), snapshotMode=0)
00208
00209   def writeConfig(self, fileName, seq=None):
00210     gSchemaConfig.writeConfig(self, file(fileName, "w+"), seq)
00211
00212   def takeSnapshot(self, stream, fileName,
00213                    captureGTIC, captureGAEQ,
00214                    trigger, configName, configVersion):
00215     return gSchemaConfig.takeSnapshot(self, stream, fileName,
00216                                captureGTIC, captureGAEQ,
00217                                trigger, configName, configVersion)
00218
00219   def readConfig(self, cfgFileName):
00220     return gSchemaConfig.readConfig(self, cfgFileName)
00221
00222   def applyConfig(self, seq=None, gxbrd=None):
00223     gSchemaConfig.applyConfig(self, seq, gxbrd)
00224
00225   def getSysReg(self, node, regName):
00226     """\brief Returns the system register value applied.
00227
00228     The value of the register applied in the configuration and specified by
00229     \a node and \a regName is returned.
00230
00231     \return Register value or None
00232     """
00233     return gSchemaConfig.getSysReg(self.__declarations, node, regName)
00234
00235   def downTEM(self, childId):
00236     """\brief Navigate to the GTEM indicated by \a childId
00237
00238     \param  childId The id of the child TEM
00239     \return         a GTEM object instance
00240     """
00241     return self.TEM.down(childId)
00242
00243   def allTEM(self):
00244     """\brief Navigate to the GTEM broadcast node.
00245
00246     \return the GTEM broadcast node instance
00247     """
00248     return self.TEM.all()
00249
00250   def downPDU(self, childId):
00251     """\brief Navigate to the GPDU indicated by \a childId
00252
00253     \param  childId The id of the child PDU
00254     \return         a GPDU object instance
00255     """
00256     return self.PDU.down(childId)
00257
00258   def downAEM(self):
00259     """\brief Navigate to the GAEM
00260
00261     \return the GAEM object instance
00262     """
00263     return self.AEM
00264
00265   def downGEM(self):
00266     """\brief Navigate to the GGEM
00267
00268     \return the GGEM object instance
00269     """
00270     return self.GEM
00271
00272   def downEBM(self):
00273     """\brief Navigate to the GEBM
00274
00275     \return the GEBM object instance
00276     """
00277     return self.EBM
00278
00279   def downLCB(self):
00280     """\brief Navigate to the GLCB
00281
00282     \return the GLCB object instance
00283     """
00284     return self.LCB
00285
00286   def downCRU(self):
00287     """\brief Navigate to the GCRU
00288
00289     \return the GCRU object instance
00290     """
00291     return self.CRU
00292
00293   def TEMcnt(self):
00294     """\brief Return the TEM count
00295
00296     \return Current TEM count
00297     """
00298     return len(self.TEM)
00299
00300   def existsTEM(self, temId):
00301     """\brief Check if the GTEM instance with the id \a temId exists
00302     in the schema.
00303
00304     \param  temId TEM id
00305     \return       1 if it exists, 0 if it doesn't.
00306     """
00307     return self.TEM.exists(temId)
00308
00309   def existsPDU(self, pduId):
00310     """\brief Check if the GPDU instance with the id \a pduId exists
00311     in the schema.
00312
00313     \param  pduId PDU id
00314     \return       1 if it exists, 0 if it doesn't.
00315     """
00316     return self.PDU.exists(pduId)
00317
00318   def existsAEM(self):
00319     """\brief Check if the GAEM instance exists in the schema.
00320
00321     \return 1 if it exists, 0 if it doesn't.
00322     """
00323     return self.AEM != None
00324
00325   def existsGEM(self):
00326     """\brief Check if the GGEM instance exists in the schema.
00327
00328     \return 1 if it exists, 0 if it doesn't.
00329     """
00330     return self.GEM != None
00331
00332   def existsEBM(self):
00333     """\brief Check if the GEBM instance exists in the schema.
00334
00335     \return 1 if it exists, 0 if it doesn't.
00336     """
00337     return self.EBM != None
00338
00339   def existsCRU(self):
00340     """\brief Check if the GCRU instance exists in the schema.
00341
00342     \return 1 if it exists, 0 if it doesn't.
00343     """
00344     return self.CRU != None
00345
00346   def existsLCB(self):
00347     """\brief Check if the GLCB instance exists in the schema.
00348
00349     \return 1 if it exists, 0 if it doesn't.
00350     """
00351     return self.LCB != None
00352
00353   def getConfigurations(self):
00354     """\brief Get list of configurations.
00355
00356     Return a list of configuration tuples where
00357     each tuple contains the configDOM, configName and configRelease.
00358
00359     \return Configuration tuple list.
00360     """
00361     return self.__configurations
00362
00363   def getDeclarations(self):
00364     """\brief Get list of declarations.
00365
00366     Return a list of declarations
00367
00368     \return Declarations.
00369     """
00370     return self.__declarations
00371
00372   def getRules(self):
00373     """\brief Retrieves the rule dictionary as defined by the
00374     current schema/configuration.
00375
00376     \return Dictionary containing Grule objects (or its descendants).
00377     """
00378     return self.__declarations['rules']
00379
00380   def getAllOpaque(self):
00381     """\brief Return all opaque data.
00382
00383     \return All opaque data regardless of the node they are
00384             associated with.
00385     """
00386     return self.__opaque
00387
00388   def getAllSerialNos(self):
00389     """\brief Return all opaque data.
00390
00391     \return All serial number data regardless of the node
00392             they are associated with.
00393     """
00394     return self.__serialnos
00395
00396   def getAllExcludeFlags(self):
00397     """\brief Return all exclude data.
00398
00399     \return All exclude data regardless of the node
00400             they are associated with.
00401     """
00402     return self.__excludes
00403
00404   ##private:
00405
00406   def __removeTEM(self, temId):
00407     self.TEM.remove(temId)
00408
00409   def __addTEM(self, temId):
00410     return self.TEM.add(temId)
00411
00412   def __removeSIU(self, temId):
00413     self.SIU.remove(temId)
00414
00415   def __addSIU(self, temId):
00416     return self.SIU.add(temId)
00417
00418   def __removeEPU(self, temId):
00419     self.EPU.remove(temId)
00420
00421   def __addEPU(self, temId):
00422     return self.EPU.add(temId)
00423
00424   def __removePDU(self, pduId):
00425     self.PDU.remove(pduId)
00426
00427   def __addPDU(self, pduId):
00428     return self.PDU.add(pduId)
00429
00430   def __removeAEM(self):
00431     self.AEM = None
00432
00433   def __addAEM(self):
00434     self.AEM = GAEM(self.client(), self)
00435     return self.AEM
00436
00437   def __removeEBM(self):
00438     self.EBM = None
00439
00440   def __addEBM(self):
00441     self.EBM = GEBM(self.client(), self)
00442     return self.EBM
00443
00444   def __removeGEM(self):
00445     self.GEM = None
00446
00447   def __addGEM(self):
00448     self.GEM = GGEM(self.client(), self)
00449     return self.GEM
00450
00451   def __removeCRU(self):
00452     self.CRU = None
00453
00454   def __addCRU(self):
00455     self.CRU = GCRU(self.client(), self)
00456     return self.CRU
00457
00458   def xbrdExists(self):
00459     """\brief Check if a GXBRD node was encountered during readSchema.
00460
00461     \return Boolean indicating whether a GXBRD node was encountered or not
00462     """
00463     return self.__xbrdExists
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gLCB.py Source File

database

gLCB.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "GLAST LCB functional block"
00013 __author__  = "R. Claus <claus@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = ("$Date: 2005/05/27 01:37:40 $").split(' ')[1]
00015 __version__ = "$Revision: 2.12 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__ = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import gDb
00022 import gAttr
00023
00024 import logging
00025
00026 class GLCB(gDb.Gdb):
00027   """\brief LCB node.
00028
00029   Has GLCB specific registers and dataless commands.
00030
00031   Valid Registers:
00032   - \c parity_latp_cell_header
00033   - \c parity_latp_cell_body
00034   - \c back_pressure_once
00035   - \c back_pressure
00036   - \c board_id
00037
00038   """
00039   Online        = 0
00040   Offline       = 1
00041   Uninitialized = 2
00042
00043   State = {Online:        "online",
00044            Offline:       "offline",
00045            Uninitialized: "uninitialized"}
00046
00047   __attrs = [
00048     # Registers
00049     gAttr.GattrBF('parity_latp_cell_header', 0, 4, 5),
00050     gAttr.GattrBF('parity_latp_cell_body',   0, 5, 6),
00051     gAttr.GattrBF('back_pressure_once',      0, 6, 7),
00052     gAttr.GattrBF('back_pressure',           0, 7, 8),
00053     gAttr.GattrBF('board_id',                0, 8, 13)
00054     ]
00055
00056   __tmo = 100
00057
00058   def __init__(self, client):
00059     """\brief Initialize valid registers as Gattrs.
00060     """
00061     flags = {'BoardId'           : 0x22,
00062              'UseRedundant'      : 0,
00063              'UseBitWide'        : 0,
00064              'UseTrailingIclock' : 0,
00065              'UseTrailingOclock' : 0,
00066              'IgnoreMissingNodes': 1}
00067     self.stats = GLCBSTATS(client, self)
00068     gDb.Gdb.__init__(self, client, None, 0, self.__attrs, None, flags)
00069
00070   def read(self, reg):
00071     return self.cmdrsp('LCBC_csr_access', 'lcb', 0, 0, self.__tmo, '!I', '!I')
00072
00073   def load(self, reg, value):
00074     return self.cmdrsp('LCBC_csr_access', 'lcb', value, 0xffff, self.__tmo, 0, 0)
00075
00076   def setEvtEnable(self, enable):
00077     """\brief Sets the LCB event enable bit to true or false.
00078
00079     \param enable boolean.
00080     """
00081     return self.cmdrsp('LCBD_evt_enable', 'lcb', enable)
00082
00083   def start(self, lcbmask):
00084     rsp = self.cmdrsp('load_lcb', lcbmask)
00085     return rsp.status()
00086
00087   def start_wait(self, lcbmask, timeout):
00088     tmo = self.client().gettimeout()
00089     if timeout is not None:
00090       self.client().settimeout(timeout)
00091     rsp = self.cmdrsp('load_wait_lcb', lcbmask)
00092     self.client().settimeout(tmo)
00093     return rsp.status()
00094
00095   def switch(self, lcbmask):
00096     rsp = self.cmdrsp('switch_lcb', lcbmask)
00097     return rsp.status()
00098
00099   def switch_wait(self, timeout):
00100     tmo = self.client().gettimeout()
00101     if timeout is not None:
00102       self.client().settimeout(timeout)
00103     rsp = self.cmdrsp('switch_wait_lcb')
00104     self.client().settimeout(tmo)
00105     return rsp.status()
00106
00107   def state(self):
00108     rsp = self.cmdrsp('LCBD_state_get', 'lcb')
00109     return rsp.status()
00110
00111
00112 class GLCBSTATS(gDb.Gdb):
00113   """\brief LCB stats access
00114
00115   Has stats-specific registers
00116
00117   Valid Registers:
00118   - \c packets_received Number of event packets received
00119   - \c body_parity_error Latched data cell parity error
00120   - \c header_parity_error Latched data header parity error
00121   - \c latp_address_error Improperly addressed packet rejected
00122   """
00123
00124     # Registers
00125   __attrs = [
00126     gAttr.GattrBF('packets_received'  ,  0,  0, 14, gAttr.ATTR_READ_ONLY),
00127     gAttr.GattrBF('body_parity_error',   0, 14, 15, gAttr.ATTR_READ_ONLY),
00128     gAttr.GattrBF('header_parity_error', 0, 15, 16, gAttr.ATTR_READ_ONLY),
00129     gAttr.GattrBF('latp_address_error',  0, 16, 17, gAttr.ATTR_READ_ONLY)
00130     ]
00131
00132   __tmo = 100
00133
00134   def __init__(self, client, parent):
00135     """\brief Initialize valid registers as Gattrs.
00136     """
00137     gDb.Gdb.__init__(self, client, parent, 0, self.__attrs)
00138
00139   def read(self, reg):
00140     return self.cmdrsp('LCBC_rxstats_access', 'lcb', 0, 0, self.__tmo, '!I', '!I')
00141
00142   def reset(self):
00143     return self.cmdrsp('LCBC_rxstats_access', 'lcb', 0, 0xFFFF, self.__tmo, 0, 0)
00144
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GlobalPanelImpl.py Source File

runcontrol

GlobalPanelImpl.py

00001 #!/usr/bin/env python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "RunControl Global Panel Implementation"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "10/11/2002"
00014 __version__  = "$Revision: 2.20 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 from qt                          import SIGNAL, QCursor, Qt, QAction, QKeySequence, QPixmap
00022 import                                  os
00023 import                                  sys
00024
00025 import                                  GlobalPanel
00026 from EnvMonImpl                  import EnvMonImpl
00027 from LATTE.browser.BrowserImpl   import BrowserImpl
00028 from LATTE.power.PorcinePanel    import PorcineWindow
00029 from LATTE.power.GpibPwrCtrlImpl import GpibPwrCtrlImpl
00030 from LATTE.browser.userAppBrowser import userAppBrowser
00031 from LATTE.browser.trgDisplayImpl import trgDisplayImpl
00032
00033 class GlobalPanelImpl(GlobalPanel.GlobalPanel):
00034
00035   def __init__(self, rc, common, parent = None, name = None, fl = 0):
00036     GlobalPanel.GlobalPanel.__init__(self, parent, name, fl)
00037     self.__rc       = rc
00038     self.__common   = common
00039     self.__parent   = parent
00040     self.__userapp  = None
00041     self.__operator = None
00042     self.__gpib     = None
00043     self.__power    = None
00044
00045     self.connect(self.MSGLoggerButton,SIGNAL("clicked()"),self.loadMSGLogger)
00046     self.connect(self.cmdEnvMon,SIGNAL("clicked()"),self.startEnvMon)
00047     self.connect(self.cmdBrowser,SIGNAL("clicked()"),self.startBrowser)
00048     self.connect(self.cmdBrowseExport,SIGNAL("clicked()"),self.browseExportedFiles)
00049     self.connect(self.cmdFabricPower,SIGNAL("clicked()"),self.fabricPowerControl)
00050     self.connect(self.cmdGPIBCtrl,SIGNAL("clicked()"),self.gpibPowerSupplyControl)
00051     self.connect(self.triggerdisplay,SIGNAL("clicked()"),self.startTriggerDisplay)
00052     self.toolsMessage_LoggerAction = QAction(self.__rc,"toolsMessage_LoggerAction")
00053     self.toolsEnvironmental_MonitoringAction = QAction(self.__rc,"toolsEnvironmental_MonitoringAction")
00054     self.toolsRegister_BrowserAction = QAction(self.__rc,"toolsRegister_BrowserAction")
00055     self.toolsBrowse_Exported_FilesAction = QAction(self.__rc,"toolsBrowse_Exported_FilesAction")
00056     self.toolsFabric_PowerAction = QAction(self.__rc,"toolsFabric_PowerAction")
00057     self.toolsGPIB_CtrlAction = QAction(self.__rc,"toolsGPIB_CtrlAction")
00058     self.toolsTrigger_DisplayAction = QAction(self.__rc,"toolstrigger_DisplayAction")
00059     self.toolsMessage_LoggerAction.setText("Message Logger")
00060     self.toolsMessage_LoggerAction.setMenuText("&Message Logger")
00061     self.toolsMessage_LoggerAction.setAccel(QKeySequence("Ctrl+Shift+M"))
00062     self.toolsEnvironmental_MonitoringAction.setText("Environmental Monitoring")
00063     self.toolsEnvironmental_MonitoringAction.setMenuText("&Environmental Monitoring")
00064     self.toolsEnvironmental_MonitoringAction.setAccel(QKeySequence("Ctrl+Shift+E"))
00065     self.toolsRegister_BrowserAction.setText("Register Browser")
00066     self.toolsRegister_BrowserAction.setMenuText("&Register Browser")
00067     self.toolsRegister_BrowserAction.setToolTip("Register Browser")
00068     self.toolsRegister_BrowserAction.setAccel(QKeySequence("Ctrl+Shift+R"))
00069     self.toolsBrowse_Exported_FilesAction.setText("Browse Exported Files")
00070     self.toolsBrowse_Exported_FilesAction.setMenuText("&Browse Exported Files")
00071     self.toolsBrowse_Exported_FilesAction.setToolTip("Browse Exported Files")
00072     self.toolsBrowse_Exported_FilesAction.setAccel(QKeySequence("Ctrl+Shift+B"))
00073     self.toolsFabric_PowerAction.setText("Fabric/Power Control")
00074     self.toolsFabric_PowerAction.setMenuText("&Fabric/Power Control")
00075     self.toolsFabric_PowerAction.setToolTip("Fabric/Power Control")
00076     self.toolsFabric_PowerAction.setAccel(QKeySequence("Ctrl+Shift+F"))
00077     self.toolsGPIB_CtrlAction.setText("GPIB Power Supply Control")
00078     self.toolsGPIB_CtrlAction.setMenuText("&GPIB Power Supply Control")
00079     self.toolsGPIB_CtrlAction.setToolTip("GPIB Power Supply Control")
00080     self.toolsGPIB_CtrlAction.setAccel(QKeySequence("Ctrl+Shift+G"))
00081     self.toolsTrigger_DisplayAction.setText("Trigger Display")
00082     self.toolsTrigger_DisplayAction.setMenuText("&Trigger Display")
00083     self.toolsTrigger_DisplayAction.setToolTip("Trigger Display")
00084     self.toolsTrigger_DisplayAction.setAccel(QKeySequence("Ctrl+Shift+T"))
00085     self.toolsMessage_LoggerAction.addTo(self.__rc.Tools)
00086     self.toolsEnvironmental_MonitoringAction.addTo(self.__rc.Tools)
00087     self.toolsRegister_BrowserAction.addTo(self.__rc.Tools)
00088     self.toolsBrowse_Exported_FilesAction.addTo(self.__rc.Tools)
00089     self.toolsFabric_PowerAction.addTo(self.__rc.Tools)
00090     self.toolsGPIB_CtrlAction.addTo(self.__rc.Tools)
00091     self.toolsTrigger_DisplayAction.addTo(self.__rc.Tools)
00092
00093     self.connect(self.toolsMessage_LoggerAction,SIGNAL("activated()"),self.loadMSGLogger)
00094     self.connect(self.toolsEnvironmental_MonitoringAction,SIGNAL("activated()"),self.startEnvMon)
00095     self.connect(self.toolsRegister_BrowserAction,SIGNAL("activated()"),self.startBrowser)
00096     self.connect(self.toolsBrowse_Exported_FilesAction,SIGNAL("activated()"),self.browseExportedFiles)
00097     self.connect(self.toolsFabric_PowerAction,SIGNAL("activated()"),self.fabricPowerControl)
00098     self.connect(self.toolsGPIB_CtrlAction,SIGNAL("activated()"),self.gpibPowerSupplyControl)
00099     self.connect(self.toolsTrigger_DisplayAction,SIGNAL("activated()"),self.startTriggerDisplay)
00100     if self.__common.options().securedir is not None:
00101       if os.path.splitext(os.path.split(sys.executable)[1])[0] == 'pythonw':
00102         self.loadMSGLogger()
00103
00104     if not self.isrealfile(sys.__stdout__):
00105       sys.stdout = NullStream()
00106
00107     if not self.isrealfile(sys.__stderr__):
00108       sys.stderr = NullStream()
00109
00110     if self.__common.options().appdir is not None:
00111       self.userAppAction = QAction(self.__rc, "userAppAction")
00112       self.userAppAction.setText("User Applications Browser")
00113       self.userAppAction.setMenuText("&User Applications Browser")
00114       self.userAppAction.setToolTip("User Applications Browser")
00115       self.userAppAction.setAccel(QKeySequence("Ctrl+Shift+U"))
00116       self.userAppAction.addTo(self.__rc.Tools)
00117       self.connect(self.userAppAction,SIGNAL("activated()"),self.startUserApp)
00118
00119   def isrealfile(self, file):
00120       """
00121       Test if file is on the os filesystem
00122       """
00123       if not hasattr(file, 'fileno'): return False
00124
00125       try: tmp = os.dup(file.fileno())
00126       except: return False
00127       else: os.close(tmp); return True
00128
00129   def checkFabricEnable(self, fabricEnable):
00130     if fabricEnable:
00131       self.toolsFabric_PowerAction.setEnabled(1)
00132       self.cmdFabricPower.setEnabled(1)
00133       if self.__operator is not None:
00134         self.applyPermissions(self.__operator)
00135     else:
00136       self.toolsFabric_PowerAction.setEnabled(0)
00137       self.cmdFabricPower.setEnabled(0)
00138
00139   def applyPermissions(self, operator):
00140     self.__operator = operator
00141     adminOverride = operator.isAdministrator()
00142     if 'start_message_logger' in operator.getPermissions() or adminOverride:
00143       self.toolsMessage_LoggerAction.setEnabled(1)
00144       self.MSGLoggerButton.setEnabled(1)
00145     else:
00146       self.toolsMessage_LoggerAction.setEnabled(0)
00147       self.MSGLoggerButton.setEnabled(0)
00148
00149     if 'start_env_monitor' in operator.getPermissions() or adminOverride:
00150       self.toolsEnvironmental_MonitoringAction.setEnabled(1)
00151       self.cmdEnvMon.setEnabled(1)
00152     else:
00153       self.toolsEnvironmental_MonitoringAction.setEnabled(0)
00154       self.cmdEnvMon.setEnabled(0)
00155
00156     if 'start_reg_browser' in operator.getPermissions() or adminOverride:
00157       self.toolsRegister_BrowserAction.setEnabled(1)
00158       self.cmdBrowser.setEnabled(1)
00159     else:
00160       self.toolsRegister_BrowserAction.setEnabled(0)
00161       self.cmdBrowser.setEnabled(0)
00162
00163     if 'browse_exported_files' in operator.getPermissions() or adminOverride:
00164       self.toolsBrowse_Exported_FilesAction.setEnabled(1)
00165       self.cmdBrowseExport.setEnabled(1)
00166     else:
00167       self.toolsBrowse_Exported_FilesAction.setEnabled(0)
00168       self.cmdBrowseExport.setEnabled(0)
00169
00170     if 'fabric_power_control' in operator.getPermissions() or adminOverride:
00171       self.toolsFabric_PowerAction.setEnabled(1)
00172       self.cmdFabricPower.setEnabled(1)
00173     else:
00174       self.toolsFabric_PowerAction.setEnabled(0)
00175       self.cmdFabricPower.setEnabled(0)
00176
00177     if 'trigger_display' in operator.getPermissions() or adminOverride:
00178       self.toolsTrigger_DisplayAction.setEnabled(1)
00179       self.triggerdisplay.setEnabled(1)
00180     else:
00181       self.toolsTrigger_DisplayAction.setEnabled(0)
00182       self.triggerdisplay.setEnabled(0)
00183
00184     if 'gpib_control' in operator.getPermissions() or adminOverride:
00185       self.toolsGPIB_CtrlAction.setEnabled(1)
00186       self.cmdGPIBCtrl.setEnabled(1)
00187     else:
00188       self.toolsGPIB_CtrlAction.setEnabled(0)
00189       self.cmdGPIBCtrl.setEnabled(0)
00190
00191   def loadMSGLogger(self):
00192     if self.__common.getMSGLogger() is not None:
00193       self.__common.getMSGLogger().show()
00194
00195   def startEnvMon(self):
00196     env = EnvMonImpl(self.__common, None, None)
00197     env.resize(698,438)
00198     env.show()
00199
00200   def startBrowser(self):
00201     lat = self.__common.getLAT()
00202     xbrd = self.__common.getXBRD()
00203     ocs = self.__common.getOCS()
00204     self.__browser = BrowserImpl(lat, xbrd, ocs, None, None, Qt.WDestructiveClose)
00205     self.__browser.resize(698,438)
00206     self.__browser.show()
00207
00208   def startTriggerDisplay(self):
00209     lat = self.__common.getLAT()
00210     ocs = self.__common.getOCS()
00211     server = self.__common.prefMan().preferences()["server"].strip()
00212     self.__triggerDisplay=trgDisplayImpl(lat,ocs,server,None,None,None,0,Qt.WDestructiveClose)
00213     self.__triggerDisplay.show()
00214
00215
00216   def browseExportedFiles(self):
00217     dbn = self.__common.getDBN()
00218     if '_LastExportPath' in dbn:
00219       import webbrowser
00220       webbrowser.open(url=self.__common.getDBN()['_LastExportPath'], new=1)
00221
00222   def fabricPowerControl(self):
00223     if self.__power is None:
00224       self.__power=PorcineWindow(self.__common, self.__rc, None, None)
00225       self.__power.setCaption("Fabric/Power Control")
00226     self.__power.show()
00227
00228   def gpibPowerSupplyControl(self):
00229     import gpibCtrl
00230     if self.__gpib is None:
00231       self.__gpib=GpibPwrCtrlImpl(gpibCtrl, self.__rc)
00232       self.__gpib.setCaption("GPIB Power Supply Control")
00233     self.__gpib.show()
00234
00235   def startUserApp(self):
00236     if self.__userapp is None:
00237       if self.__common.options().appdir is not None:
00238         appdir = self.__common.options().appdir
00239         self.__userapp = userAppBrowser(self.__rc, appdir)
00240         self.__userapp.updateSchema()
00241         self.__userapp.updateSuites()
00242         self.__userapp.show()
00243     elif self.__userapp.isVisible():
00244       self.__userapp.hide()
00245     else:
00246       self.__userapp.updateSchema()
00247       self.__userapp.show()
00248
00249   def getUserApp(self, appname=None):
00250     if appname is not None:
00251       return self.__userapp.getGui(appname)
00252     else:
00253       return self.__userapp
00254
00255   def getUserAppTree(self):
00256     return self.__userapp.getTree()
00257
00258 class NullStream:
00259     """
00260     A file like class that writes nothing
00261     """
00262     def close(self): pass
00263     def flush(self): pass
00264     def write(self, str): pass
00265     def writelines(self, sequence): pass
00266
00267
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gLog.py Source File

client

gLog.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Logging methods"
00013 __author__   = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/11/05 02:21:49 $").split(' ')[1]
00015 __version__  = "$Revision: 2.8 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import sys
00022 import traceback
00023 import logging as log
00024
00025 def logStack():
00026   for line in traceback.format_stack():
00027     log.debug(__stripLineFeed(line))
00028
00029 def logException(msg=""):
00030   etype, value, tb = sys.exc_info()
00031   if tb is None:
00032     logStack()
00033   else:
00034     #for line in traceback.format_exception(etype, value, tb):
00035     #  log.error(__stripLineFeed(line))
00036     log.exception(msg)
00037
00038 def __stripLineFeed(str):
00039   return str.replace('\n', ' ')
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gLoopback.py Source File

client

gLoopback.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Loopback mode handler class"
00013 __author__   = "Amedeo Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/08/24 22:57:25 $").split(' ')[1]
00015 __version__  = "$Revision: 2.2 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import socket
00020 import threading
00021 import struct
00022
00023 class Loopback(object):
00024   def __init__(self):
00025     self.__lock = threading.Lock()
00026     self.__lock.acquire()
00027     self.__sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
00028     self.__sock.bind(('localhost', 0))
00029     self.__sock.connect(self.__sock.getsockname())
00030
00031   def socket(self):
00032     return self.__sock
00033
00034   def commit(self, value):
00035     packet = struct.pack('I', value)
00036     self.__sock.send(packet)
00037     self.__lock.acquire()
00038
00039   def acknowledge(self):
00040     packet = self.__sock.recv(4)
00041     self.__lock.release()
00042     value = struct.unpack('I', packet)
00043     return value[0]
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gMem.py Source File

database

gMem.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "GLAST remote memory accessors"
00013 __author__  = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = ("$Date: 2004/09/20 18:13:04 $").split(' ')[1]
00015 __version__ = "$Revision: 1.5 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__ = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import struct
00022 import gDb
00023 import gAttr
00024
00025 class GMem(gDb.Gdb):
00026   """\brief Memory node.
00027
00028   Has GMem specific registers
00029
00030   Dataless Commands:
00031   none
00032
00033   """
00034   __VX_READ  = 0
00035   __VX_WRITE = 1
00036
00037   __fmt = {1 : 'B', 2 : 'H', 4 : 'I', 8 : 'Q'}
00038
00039   def __init__(self, client):
00040     """\brief Initialize valid registers as Gattrs.
00041     """
00042     gDb.Gdb.__init__(self, client, None, 0)
00043
00044   def gMEMread(self, addr, size=4):
00045     """SBC MEM read command
00046
00047     \param  addr SBC address
00048     \param  size Addressing used (1=8bit, 2=16bit, 4=32bit, 8=64bit, default is 4)
00049     \return A tuple containing the user id, status and value
00050
00051     """
00052     payload = '!' + self.__fmt[size]
00053     return self.cmdrsp('vxMemProbe', addr, GMem.__VX_READ, size, payload)
00054
00055   def gMEMload(self, addr, val, size=4):
00056     """SBC MEM load command
00057
00058     \param  addr SBC address
00059     \param  val  Value to be set at address \a addr
00060     \param  size Addressing used (1=8bit, 2=16bit, 4=32bit, 8=64bit, default is 4)
00061     \return A tuple containing the user id, status and timestamp
00062     """
00063     input = '>' + struct.pack('>'+self.__fmt[size], val) # val to big endian
00064     return self.cmdrsp('vxMemProbe', addr, GMem.__VX_WRITE, size, input)
00065
00066   def gMEMbusToLocal(self, space, addr):
00067     """Translate an address in some space to local (PPC) space
00068
00069     \param  space Bus address space in which \a addr resides
00070     \param  addr  Bus address to convert
00071     \return A tuple containing the user id, status, local address value and timestamp
00072
00073     """
00074     return self.cmdrsp('sysBusToLocalAdrs', space, addr, '!I')
00075
00076   def gMEMlocalToBus(self, space, addr):
00077     """Translate an address in local (PPC) space to some space
00078
00079     \param  space Bus address space in which \a addr resides
00080     \param  addr  Local address to convert
00081     \return A tuple containing the user id, status, bus address value and timestamp
00082
00083     """
00084     return self.cmdrsp('sysLocalToBusAdrs', space, addr, '!I')
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gNAT.py Source File

database

gNAT.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "GLAST COMM Card I/O node"
00013 __author__  = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = ("$Date: 2004/08/24 23:09:08 $").split(' ')[1]
00015 __version__ = "$Revision: 2.4 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__ = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import gDb
00022 import gAttr
00023
00024 class GNAT(gDb.Gdb):
00025   """\brief GNAT node Record
00026
00027   This node contains COMM card related functions.
00028   Each GNAT node is associated with one COMM card.
00029   A GNAT node can either be instantiated through the
00030   createGNATinstance method of GTEM, GAEM or GGLT nodes or
00031   it can be instantiated as a standalone node by creating an
00032   instance of it and calling its initHandle method with the
00033   pysical address of the COMM card. The other parameter that it
00034   needs is a slot. A slot is a placeholder for a GNAT handle.
00035   There are currently 16 slots available. When calling the
00036   createGNATinstance or initHandle methods the desired slot is
00037   passed and this is where the handle is stored for the duration
00038   of the session.
00039   Currently the GNAT node serves to major purposes:
00040
00041     (1) Statistics:
00042
00043         Contains registers for retrieving TX/RX ctrl and data cells
00044         as well as RX header parity and TX busy assert flags.
00045
00046     (2) Pattern generator functionality:
00047
00048         It is possible to use the exposed methods and registers to
00049         write bit streams to the COMM card. This functionality is
00050         available mostly for internal testing and should not be of
00051         and particular use to the subsystems.
00052   """
00053   __attrs = [
00054       # Registers
00055       gAttr.GattrRaw('stats_rx_ctrl_cells',     0, 2),
00056       gAttr.GattrRaw('stats_rx_data_cells',     1, 2),
00057       gAttr.GattrRaw('stats_rx_header_parity',  2, 2),
00058       gAttr.GattrRaw('stats_rx_cell_parity',    3, 2),
00059       gAttr.GattrRaw('stats_tx_ctrl_cells',     4, 2),
00060       gAttr.GattrRaw('stats_tx_data_cells',     5, 2),
00061       gAttr.GattrRaw('stats_tx_busy_assert',    6, 2),
00062       gAttr.GattrRaw('stats_clear',             7, 2),
00063       gAttr.GattrRaw('output_mask',             8, 4)
00064       ]
00065
00066   def __init__(self, client):
00067     """\brief Initialize valid registers as Gattrs.
00068
00069     Assign default values to members
00070
00071     Usage:
00072     \code
00073       gn = GNAT()
00074     \endcode
00075     """
00076     gDb.Gdb.__init__(self, client, None, 0, self.__attrs)
00077
00078   def initHandle(self, slot, physAddr):
00079     """\brief Initializes a new GNAT handle given a physical VME address.
00080
00081     \param slot     A number between 0 and 15 to hold the GNAT handle.
00082                     Each GNAT handle should be assigned a unique slot number.
00083                     The GNAT handle persists at that slot while the session is active.
00084     \param physAddr Physical VME address of the COMM card.
00085
00086     \return Status
00087
00088     Usage:
00089     \code
00090       gn = GNAT()
00091       gn.setCmd(lat.getCmd())
00092       gn.initHandle(0, 0x08000000)
00093     \endcode
00094     """
00095     if self.__cmdCli is not None:
00096       (userId, status, timestamp) = self.__cmdCli.gGNATgetGh(slot, physAddr)
00097       if status != 0:
00098         if self.__cmdCli.ignoreErrors():
00099           print "Error:", gutil.LATInterfaceStatus(status)
00100         else:
00101           raise gutil.LATInterfaceException(status)
00102       else:
00103         self._Gnode__id = slot
00104       return status
00105     else:
00106       raise RuntimeError, 'No command client. Use setCmd prior to calling this function'
00107
00108   def clearBuffer(self):
00109     """\brief Zero out the contents of the bundle.
00110
00111     Calls gBndlClear( gh);
00112
00113     \return Status
00114     """
00115     if self.__cmdCli is not None:
00116       (userId, status, timestamp) = self.__cmdCli.gGNATclearBuffer(self._Gnode__id)
00117       if status != 0:
00118         if self.__cmdCli.ignoreErrors():
00119           print "Error:", gutil.LATInterfaceStatus(status)
00120         else:
00121           raise gutil.LATInterfaceException(status)
00122       return status
00123     else:
00124       raise RuntimeError, 'No command client. Use setCmd prior to calling this function'
00125
00126   def addChannel(self, channelNo, itemList):
00127     """Inserts data into a channel
00128
00129     \param  channelNo The channel number (0 - 15) to insert the chnlData into.
00130                       The maximum channel number is defined in GNAT/gnat.h as MAX_CHANNEL.
00131     \param  itemList  A sequence of 32-bit words.
00132                       The maximum number of words in the array is 5.
00133
00134     \return           Status
00135
00136     Usage:
00137     \code
00138       data = [0xdeadbeefL, 0xdeadbeefL, 0xdeadbeefL]
00139       gn.addChannel(channelNo=1, itemList=data)
00140     \endcode
00141     """
00142     if self.__cmdCli is not None:
00143       (userId, status, timestamp) = self.__cmdCli.gGNATaddChannel(self._Gnode__id, channelNo, itemList)
00144       if status != 0:
00145         if self.__cmdCli.ignoreErrors():
00146           print "Error:", gutil.LATInterfaceStatus(status)
00147         else:
00148           raise gutil.LATInterfaceException(status)
00149       return status
00150
00151   def loadFIFO(self):
00152     """\brief This is a combination of gBndlGetBndl() and gWritePF16v().
00153
00154     It transfers the data from the intermediate bundle buffer into the
00155     playback FIFO.
00156
00157     \return  Status
00158     """
00159     if self.__cmdCli is not None:
00160       (userId, status, timestamp) = self.__cmdCli.gGNATloadFIFO(self._Gnode__id)
00161       if status != 0:
00162         if self.__cmdCli.ignoreErrors():
00163           print "Error:", gutil.LATInterfaceStatus(status)
00164         else:
00165           raise gutil.LATInterfaceException(status)
00166       return status
00167
00168   def flushPlaybackFIFO(self):
00169     """\brief This is a combination of gFlushPF() and gEnablePF().
00170
00171     Flushes the playback FIFO.
00172
00173     \return Status
00174     """
00175     if self.__cmdCli is not None:
00176       (userId, status, timestamp) = self.__cmdCli.gGNATflushPlaybackFIFO(self._Gnode__id)
00177       if status != 0:
00178         if self.__cmdCli.ignoreErrors():
00179           print "Error:", gutil.LATInterfaceStatus(status)
00180         else:
00181           raise gutil.LATInterfaceException(status)
00182       return status
00183
00184   def flushRecordFIFO(self):
00185     """\brief This is a combination of gFlushRF() and gEnableRF().
00186
00187     Flushes the record FIFO.
00188
00189     \return Status
00190     """
00191     if self.__cmdCli is not None:
00192       (userId, status, timestamp) = self.__cmdCli.gGNATflushRecordFIFO(self._Gnode__id)
00193       if status != 0:
00194         if self.__cmdCli.ignoreErrors():
00195           print "Error:", gutil.LATInterfaceStatus(status)
00196         else:
00197           raise gutil.LATInterfaceException(status)
00198       return status
00199
00200   def writeFIFO(self, data):
00201     """\brief A wrapper around gWritePF().
00202
00203     So user could write a single word to the
00204     FIFO or the user could prepare their own array of words,
00205     bypassing the bundle/channel interface.
00206
00207     \param  data   A single or a sequence of 16-bit words
00208     \return        Status
00209
00210     Usage:
00211     \code
00212       data = [0xa0a0, 0xb0b0, 0xc0c0]
00213       gn.writeFIFO(data)
00214       data = 0x1234
00215       gn.writeFIFO(data)
00216     \endcode
00217     """
00218     if self.__cmdCli is not None:
00219       if isNumberType(data):
00220         (userId, status, timestamp) = self.__cmdCli.gGNATwritePF16(self._Gnode__id, data)
00221       else:
00222         (userId, status, timestamp) = self.__cmdCli.gGNATwritePF16v(self._Gnode__id, data)
00223       if status != 0:
00224         if self.__cmdCli.ignoreErrors():
00225           print "Error:", gutil.LATInterfaceStatus(status)
00226         else:
00227           raise gutil.LATInterfaceException(status)
00228       return status
00229
00230   def writeFIFO32(self, data):
00231     """\brief A wrapper around gWritePF()
00232
00233     So user could write a single word to the
00234     FIFO or the user could prepare their own array of words,
00235     bypassing the bundle/channel interface.
00236
00237     \param data A single or a sequence of 16-bit words
00238
00239     \return     Status
00240
00241     Usage:
00242     \code
00243       data = [0xa0a0a0a0L, 0xdeadbeefL, 0xc0c0c0c0L]
00244       gn.writeFIFO32(data)
00245       data = 0x12345678L
00246       gn.writeFIFO(data)
00247     \endcode
00248     """
00249     if self.__cmdCli is not None:
00250       if isNumberType(data):
00251         (userId, status, timestamp) = self.__cmdCli.gGNATwritePF32(self._Gnode__id, data)
00252       else:
00253         (userId, status, timestamp) = self.__cmdCli.gGNATwritePF32v(self._Gnode__id, data)
00254       if status != 0:
00255         if self.__cmdCli.ignoreErrors():
00256           print "Error:", gutil.LATInterfaceStatus(status)
00257         else:
00258           raise gutil.LATInterfaceException(status)
00259       return status
00260
00261   def startPlayback(self):
00262     """\brief This is a wrapper around gStartPB().
00263
00264     Starts the playback.
00265
00266     \return Status
00267
00268     Usage:
00269     \code
00270       gn.startPlayback()
00271     \endcode
00272     """
00273     if self.__cmdCli is not None:
00274       (userId, status, timestamp) = self.__cmdCli.gGNATstartPlayback(self._Gnode__id)
00275       if status != 0:
00276         if self.__cmdCli.ignoreErrors():
00277           print "Error:", gutil.LATInterfaceStatus(status)
00278         else:
00279           raise gutil.LATInterfaceException(status)
00280       return status
00281
00282   def setLATpMode(self, mode):
00283     """\brief Sets the running mode of the COMM I/O board based on the boolean
00284     value of mode.
00285
00286     When mode is non-zero the mode bit of the COMM I/O
00287     control register is set to 1, which puts the board in "LATp mode".
00288     When mode is zero the mode bit is cleared, which puts the board in
00289     "dumb record FIFO mode".
00290
00291     \param mode The running mode of the COMM I/O board
00292
00293     \return     Status
00294
00295     Usage:
00296     \code
00297       gn.setLATpMode(0)
00298     \endcode
00299     """
00300     if self.__cmdCli is not None:
00301       (userId, status, timestamp) = self.__cmdCli.gGNATsetLATpMode(self._Gnode__id, mode)
00302       if status != 0:
00303         if self.__cmdCli.ignoreErrors():
00304           print "Error:", gutil.LATInterfaceStatus(status)
00305         else:
00306           raise gutil.LATInterfaceException(status)
00307       return status
00308
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gNode.py Source File

client

gNode.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Node class"
00013 __author__   = "Amedeo Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/08/24 22:57:25 $").split(' ')[1]
00015 __version__  = "$Revision: 2.2 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 class Node(object):
00022   def __init__(self, client):
00023     self.__client = client
00024
00025   def client(self):
00026     return self.__client
00027
00028   def cmdrsp(self, functionname, *arguments):
00029     return self.__client.cmdrsp(functionname, *arguments)
00030
00031   def read(self, reg):
00032     raise Exception, "*** gNode: read() not implemented for class %s" \
00033           %(self.__class__.__name__)
00034
00035   def load(self, reg, value):
00036     raise Exception, "*** gNode: load() not implemented for class %s" \
00037           %(self.__class__.__name__)
00038
00039   def send(self, cmd):
00040     raise Exception, "*** gNode: send() not implemented for class %s" \
00041           %(self.__class__.__name__)
00042
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gOCS.py Source File

database

gOCS.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "OCS node"
00013 __author__   = "Amedeo Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2005/06/23 23:54:48 $").split(' ')[1]
00015 __version__ = "$Revision: 2.29 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__ = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import logging
00022 import time
00023 import math
00024 import struct
00025 import gDb
00026 import gAttr
00027
00028 import LATTE.client.gException as gException
00029
00030 class GOCS(gDb.Gdb):
00031   """\brief OCS node.
00032
00033   Has OCS specific registers and methods.
00034
00035   Valid Registers:
00036   - \c stats_failed_events
00037   - \c stats_failed_event_sends
00038   - \c stats_valid_events
00039   - \c stats_discarded_event_sends
00040   - \c stats_length_mismatch_count
00041   - \c stats_events_not_sent
00042   - \c stats_filter_pkt_errors
00043   - \c stats_filter_src_errors
00044   - \c stats_filter_passes
00045   - \c stats_filter_fails
00046   - \c stats_handled_events
00047
00048   Event statistics:
00049
00050   The following statistics registers are initialized
00051   at the start of each RunControl run:
00052
00053   - \c stats_failed_events -- Counts events where
00054   the eventHandler receives a bad status for the event.
00055
00056   - \c stats_failed_event_sends -- Counts events where
00057   the socket send failed with an error other than
00058   EWOULDBLOCK.
00059
00060   - \c stats_valid_events -- Counts when a valid event
00061   has been successfully sent to the client.
00062
00063   - \c stats_discarded_event_sends -- Counts cases when an
00064   event send failed due to the fact that the send
00065   returned an EWOULDBLOCK error.
00066
00067   - \c stats_length_mismatch_count -- Counts cases when
00068   the length argument passed to the event handler did
00069   not match the length provided in the event header.
00070
00071   - \c stats_events_not_sent -- Counts when an event is
00072   not sent over the socket due a filter or a scaler.
00073
00074   - \c stats_filter_pkt_errors -- Counts when the filtered
00075   event has a packet error in its contribution.
00076
00077   - \c stats_filter_src_errors -- Counts when the filtered
00078   event has a source error in its contribution.
00079
00080   - \c stats_filter_passes -- Counts when the event goes through the filter.
00081
00082   - \c stats_filter_fails -- Counts when the event fails the filter.
00083
00084   - \c stats_handled_events -- Counts when the event is received by the SBC event handler.
00085
00086   """
00087   ProtocolVersion  = 2
00088   ProtocolRevision = 1
00089
00090   __attrs = [
00091     # Registers; IDs kept for backward compatibility with GLAT
00092     gAttr.GattrReg('stats_failed_events',          8, 4),
00093     gAttr.GattrReg('stats_failed_event_sends',     9, 4),
00094     gAttr.GattrReg('stats_valid_events',          10, 4),
00095     gAttr.GattrReg('stats_discarded_event_sends', 11, 4),
00096     gAttr.GattrReg('stats_length_mismatch_count', 12, 4),
00097     gAttr.GattrReg('stats_events_not_sent',       13, 4),
00098     gAttr.GattrReg('stats_filter_pkt_errors',     14, 4),
00099     gAttr.GattrReg('stats_filter_src_errors',     15, 4),
00100     gAttr.GattrReg('stats_filter_passes',         16, 4),
00101     gAttr.GattrReg('stats_filter_fails',          17, 4),
00102     gAttr.GattrReg('stats_handled_events',        18, 4),
00103     ]
00104
00105   def __init__(self, client):
00106     self.__cbDict = {}  # dictionary of callback parameters
00107     gDb.Gdb.__init__(self, client, None, 0, self.__attrs)
00108
00109   def read(self, reg):
00110     return self.cmdrsp('ggLATread', reg, '!I')
00111
00112   def load(self, reg, value):
00113     return self.cmdrsp('ggLATload', reg, value)
00114
00115   def evtHandlerSendAll(self):
00116     """\brief Sets the current event mode to send all events to the client.
00117     """
00118     name = 'evtHandlerSendAll'
00119     self.__cbDict.clear()
00120     self.__cbDict['name'] = name
00121     response = self.cmdrsp(name)
00122     return response.status()
00123
00124   def evtHandlerSendNothing(self):
00125     """\brief Sets the current event mode to send no data events to the client.
00126     """
00127     name = 'evtHandlerSendNothing'
00128     self.__cbDict.clear()
00129     self.__cbDict['name'] = name
00130     response = self.cmdrsp(name)
00131     return response.status()
00132
00133   def evtHandlerSendErrorsOnly(self):
00134     """\brief Sets the current event mode to send only error events to the client.
00135     """
00136     name = 'evtHandlerSendErrorsOnly'
00137     self.__cbDict.clear()
00138     self.__cbDict['name'] = name
00139     response = self.cmdrsp(name)
00140     return response.status()
00141
00142   def evtHandlerSendAcdScalers(self, marker, prescale=0):
00143     """\brief Sets the current event mode to send only events containing the
00144     ACD software scalers to the client upon recept of the given marker.  All
00145     marker zero events are accumulated by the scaler code.  If an event is
00146     triggered with the specified marker, the scaler data will be delivered with
00147     that event.  Thus, if the specified marker is zero, then all data events
00148     will be accompanied by the scaler data.  In addition, marker zero events can
00149     be prescaled before delivery to the client.  A \a prescale value of zero
00150     (the default) delivers every marker zero event.  A \a prescale value of
00151     0xffffffffL disables prescaling and delivers no events.
00152
00153     \param marker   - Marker to value to use
00154     \param prescale - Prescale value to use
00155     """
00156     name = 'evtHandlerSendAcdScalers'
00157     self.__cbDict.clear()
00158     self.__cbDict['name'] = name
00159     self.__cbDict['marker'] = marker
00160     self.__cbDict['prescale'] = prescale
00161     response = self.cmdrsp(name, marker, prescale)
00162     return response.status()
00163
00164   def evtHandlerSendPrescaled(self, prescale):
00165     """\brief Sets the current event mode to send prescaled events to the client.
00166     A \a prescale value of zero delivers every event.  A \a prescale value of
00167     0xffffffffL disables prescaling and delivers no events.
00168
00169     \param prescale - Prescale value to use
00170     """
00171     name = 'evtHandlerSendPrescaled'
00172     self.__cbDict.clear()
00173     self.__cbDict['name'] = name
00174     self.__cbDict['prescale'] = prescale
00175     response = self.cmdrsp(name, prescale)
00176     return response.status()
00177
00178   def evtHandlerPrescaleExternal(self, prescale):
00179     """\brief Sets the current event mode to prescale externally triggered events.
00180     Only events with only the external trigger firing will be prescaled.
00181     A \a prescale value of zero delivers every event.  A \a prescale value of
00182     0xffffffffL disables prescaling and delivers no events.
00183     \param prescale - Prescale value to use
00184     """
00185     name = 'evtHandlerPrescaleExternal'
00186     self.__cbDict.clear()
00187     self.__cbDict['name'] = name
00188     self.__cbDict['prescale'] = prescale
00189     response = self.cmdrsp(name, prescale)
00190     return response.status()
00191
00192   def evtHandlerFilterTkrHits(self, lowThreshold = 0, towerMask = 0xffff, highThreshold = 0xffffffffL, prescale = 0xffffffffL):
00193     """\brief Sets the current event mode to the Tracker Hit Filter
00194
00195     The Tracker Hit Filter filters events based on the number of hits in the
00196     tracker.  Only events with no errors will be filtered.
00197
00198     The filter algorithm sums up the number of hits found in the tracker
00199     contributions of the towers given in the \a towerMask and requires this
00200     total number of hits to be greater than or equal to the \a lowThreshold
00201     value and less than or equal to the \a highThreshold value in order to
00202     send the event downstream.  The default threshold values allow all events
00203     to pass the filter, i.e., the default low threshold is zero, and the default
00204     high threshold is larger than the full LAT can generate.
00205
00206     The \a towerMask value is constructed by setting the bit at the position
00207     corresponding to the tower address of the tower to be included.  Bit zero
00208     is the least significant, right-most bit and corresponds to the tower with
00209     LATp address zero.  By default, all 16 towers are included in the filter
00210     calculation.
00211
00212     A \a prescale can be applied to allow a fraction of the events that don't
00213     pass the TKR hit filter through.  If the \a prescale value is zero, the TKR
00214     hit filter is ignored.  If the \a prescale value is 0xffffffffL (the
00215     default), prescaling is disabled and filtering is determined by the TKR hit
00216     filter.  If prescaling is enabled, every event is considered for prescaling,
00217     not just the events that fail the TKR hit filter.
00218
00219     \param lowThreshold  - Minimum number of TKR hits needed to pass the event downstream
00220     \param towerMask     - Mask of the towers participating in the filter
00221     \param highThreshold - Maximum number of TKR hits allowed to pass the event downstream
00222     \param prescale      - Prescale value to use
00223     """
00224     name = 'evtHandlerFilterTkrHits'
00225     self.__cbDict.clear()
00226     self.__cbDict['name'] = name
00227     self.__cbDict['lowThreshold'] = lowThreshold
00228     self.__cbDict['towerMask'] = towerMask
00229     self.__cbDict['highThreshold'] = highThreshold
00230     self.__cbDict['prescale'] = prescale
00231     response = self.cmdrsp(name, lowThreshold, towerMask, highThreshold, prescale)
00232     return response.status()
00233
00234   def evtHandlerSetVerbosity(self, verbosity):
00235     """\brief Sets the event server verbosity.
00236
00237     \param verbosity - Verbosity value to use
00238     """
00239     response = self.cmdrsp('evtHandlerSetVerbosity', verbosity)
00240     return response.status()
00241
00242   def evtClearEvtSeqMSW(self):
00243     """\brief Clears the event sequence counter.
00244
00245     """
00246     response = self.cmdrsp('evtClearEvtSeqMSW')
00247     return response.status()
00248
00249   def synchronize(self):
00250     """\brief Synchronize the SBC's clock with the host's clock.
00251     """
00252     (fraction, integer) = math.modf(time.time())
00253     seconds = int(integer)
00254     nanoseconds = int(fraction*1000000000)
00255     return self.cmdrsp('ocsSetTime', seconds, nanoseconds)
00256
00257   def getCallbackParams(self):
00258     """\brief Return a dictionary of the parameters used in the active OES callback
00259     """
00260     return self.__cbDict
00261
00262   def getVersion(self):
00263     """\brief Get the protocol versions of code running on the SBC.
00264     """
00265     response = self.cmdrsp('ocsVersion', '!H', '!H')
00266     return (response.payloads()[0], response.payloads()[1])
00267
00268   def getStartupScriptInfo(self):
00269     """\brief Retrieve CVS $Id: gOCS.py,v 2.29 2005/06/23 23:54:48 perazzo Exp $ info for the startup script.
00270
00271     \return A list of CVS related info in the form: [filename, version, date, time, user]
00272     """
00273     format = '!128s'
00274     size = struct.calcsize(format)
00275     strng = self.cmdrsp('ocsstrncpy', format, "startupScriptInfo", size).payloads()
00276     value = ''.join(strng).rstrip('\x00')
00277     sValue = value.split(" ")
00278     if len(sValue) != 8:
00279       logging.error("*** Unable to retrieve startup script info")
00280       return None
00281     else:
00282       return [sValue[1].split(',')[0]] + sValue[2:6]
00283
00284   def verifyVersion(self):
00285     """\brief Verify that the protocol version of the code running on the SBC
00286     is one the host code is expected to support.
00287     """
00288     (version, revision) = self.getVersion()
00289     if version != GOCS.ProtocolVersion or revision < GOCS.ProtocolRevision:
00290       logging.error("gOCS: server protocol version is %d.%d expected %d.%d"
00291                     %(version, revision,
00292                       GOCS.ProtocolVersion, GOCS.ProtocolRevision))
00293       status = gException.LATInterfaceStatus.status('OCS_BDVER')
00294       raise gException.LATInterfaceException(status)
00295
00296   def cmxAsBuilt(self):
00297     asbuilt = {}
00298     format = '!32s'
00299     idptr = self.cmdrsp('CMX_asBuiltScan', 0).status()
00300     while idptr:
00301       version = self.__getVersion(idptr)
00302       time    = self.__getTime(idptr)
00303       name    = self.__getString(idptr, 'CMX_asBuiltGetConstit', format)
00304       package = self.__getString(idptr, 'CMX_asBuiltGetPackage', format)
00305       user    = self.__getString(idptr, 'CMX_asBuiltGetUser', format)
00306       idptr   = self.cmdrsp('CMX_asBuiltScan', idptr).status()
00307       asbuilt[name] = [package, version, user, time]
00308     return asbuilt
00309
00310   def __getString(self, constituent, function, format):
00311     size = struct.calcsize(format)
00312     ptr = self.cmdrsp(function, constituent).status()
00313     string = self.cmdrsp('strncpy', format, ptr, size).payloads()
00314     return ''.join(string).rstrip('\x00')
00315
00316   def __getVersion(self, constituent):
00317     response = self.cmdrsp('CMX_asBuiltGetVersion',
00318                            constituent,'!c','!H','!H','!H')
00319     ver = str(response.payloads()[0])
00320     if ver == 'U':
00321       return '<unknown>'
00322     elif ver == 'T':
00323       return '<test>'
00324     elif ver == 'D':
00325       return '<dev>'
00326     else:
00327       maj = str(response.payloads()[1])
00328       min = str(response.payloads()[2])
00329       rev = str(response.payloads()[3])
00330       return ''.join(['V',maj,'-',min,'-',rev])
00331
00332   def __getTime(self, constituent):
00333     GLATEPOCH = 0x3a4fc880
00334     buildtime = self.cmdrsp('CMX_asBuiltGetTime', constituent).status()
00335     return time.strftime('%Y-%02m-%02d %H:%02M:%02S',
00336                          time.gmtime(buildtime+GLATEPOCH))
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gOcsMessages.py Source File

client

gOcsMessages.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "OCS messages"
00013 __author__   = "Amedeo Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2005/04/07 23:43:15 $").split(' ')[1]
00015 __version__  = "$Revision: 2.4 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 class OcsMessages(object):
00022   OCSSTR = {
00023     0x00000000: [      "OCS_OK", "Ok"],
00024     0x00000003: [  "OCS_NOFUNC", "Function name unknown to OCS server"],
00025     0x00000013: [  "OCS_NOHAND", "Handler name unknown to OCS server"],
00026     0x00000023: [  "OCS_NOTYPE", "Argument type unknown to OCS server"],
00027     0x00000043: [   "OCS_NOREG", "Register non existent"],
00028     0x00000083: [  "OCS_BDRESP", "OCS server response has unexpected length"],
00029     0x00000103: [     "OCS_TMO", "OCS command/response timeout"],
00030     0x00000203: [   "OCS_NOSRV", "OCS server disconnected"],
00031     0x00000403: [   "OCS_BDADC", "ADC conversion is busy"],
00032     0x00000413: [  "OCS_GRPADC", "ADC conversion has wrong group"],
00033     0x00000423: [  "OCS_TMOADC", "ADC conversion timed out"],
00034     0x00000803: [   "OCS_BDVER", "OCS server version is incompatible"],
00035     0x00001003: ["OES_EVTALLOC", "OES server allocated by another client"],
00036     0x00002003: ["OES_PLAYBERR", "Playback error set in event"],
00037   }
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gOpcode.py Source File

client

gOpcode.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Pack possible opcodes"
00013 __author__   = "Amedeo Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/12/05 21:07:07 $").split(' ')[1]
00015 __version__  = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import struct
00022
00023 class Opcode:
00024   Close = 0
00025   Keepgoing = 1
00026   SetEventSocket = 2
00027   ForceEventSocket = 3
00028
00029   def __init__(self, value):
00030     self.__packet = struct.pack('!IHH', 4, 0, value)
00031
00032   def packet(self):
00033     return self.__packet
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gOptions.py Source File

client

gOptions.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Options class"
00013 __author__   = "Amedeo Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2005/03/06 19:46:21 $").split(' ')[1]
00015 __version__  = "$Revision: 2.5 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import sys
00022 import getopt
00023
00024 class Options(object):
00025   def __init__(self, mandatory, optional=[], switches=[]):
00026     self.opts = {}
00027
00028     self.__mand = mandatory
00029     self.__optn = optional
00030     self.__swtc = switches
00031
00032   def __getattr__(self, attribute):
00033     if attribute in self.opts:
00034       return self.opts[attribute]
00035     return None
00036
00037   def usage(self, notes=''):
00038     msg = 'usage: %s' %(sys.argv[0])
00039     for option in self.__mand:
00040       msg += ' --%s <%sname>' %(option, option)
00041     for option in self.__optn:
00042       msg += ' [--%s <%sname>]' %(option, option)
00043     for option in self.__swtc:
00044       msg += ' [--%s]' %(option)
00045     if notes != '':
00046       msg += '\nnotes: '
00047       msg += notes
00048     print msg
00049
00050
00051   def parse(self):
00052     opts = []
00053     for option in self.__mand:
00054       opts.append(option+'=')
00055     for option in self.__optn:
00056       opts.append(option+'=')
00057     for option in self.__swtc:
00058       opts.append(option)
00059     results = getopt.getopt(sys.argv[1:], '', opts)
00060     if len(results[1]) > 0:
00061       raise RuntimeError, 'unknown argument(s) \'%s\'' %(results[1])
00062     for opt in results[0]:
00063       self.opts[opt[0][2:]] = opt[1]
00064     for option in self.__mand:
00065       if option not in self.opts:
00066         raise RuntimeError, 'mandatory option \'--%s\' not found' %(option)
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GOSED_LDF.py Source File

gosed

GOSED_LDF.py

00001
00002 #!/usr/local/bin/python
00003 #
00004 #                               Copyright 2003
00005 #                                     by
00006 #                        The Board of Trustees of the
00007 #                     Leland Stanford Junior University.
00008 #                            All rights reserved.
00009 #
00010
00011
00012 __facility__ = "Online"
00013 __abstract__ = "GLAST Online Single Event Display - EBF Interface"
00014 __author__   = "A. Kavelaars <aliciak@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00015 __date__     = "11/18/2003"
00016 __version__  = "$Revision: 1.45 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020 from   qt import *
00021 import os, sys, string
00022 import LDF
00023 import Numeric
00024 import time
00025 import logging as myLog
00026 # Important Constants
00027
00028 NUM_XY_TKR = 24
00029 NUM_Z_TKR = 36
00030 NUM_Z_CAL = 8
00031 NUM_XY_CAL = 12
00032
00033 LOG_RANGE = 12
00034 NUMBER_STRIPS = 1536
00035 STRIP_RANGE = 36
00036
00037 LAYER = ['Y0','X0','X1','Y1','Y2','X2','X3','Y3','Y4','X4','X5','Y5','Y6',
00038           'X6','X7','Y7','Y8','X8','X9','Y9','Y10','X10','X11','Y11','Y12',
00039           'X12','X13','Y13','Y14','X14','X15','Y15','Y16','X16','X17','Y17']
00040
00041 #~ TCC = ['0,1','2,3','4,5']
00042
00043 RANGE_TKR_X = [1,2,5,6,9,10,13,14,17,18,21,22,25,26,29,30,33,34]
00044 RANGE1_TKR_X = [1, 5, 9, 13, 17, 21, 25, 29, 33]
00045 RANGE2_TKR_X = [2, 6, 10, 14, 18, 22, 26, 30, 34]
00046
00047 RANGE_TKR_Y = [0,3,4,7,8,11,12,15,16,19,20,23,24,27,28,31,32,35]
00048
00049 RANGE1_TKR_Y = [4, 8, 12, 16, 20, 24, 28, 32, 35]
00050 RANGE2_TKR_Y = [0, 3, 7, 11, 15, 19, 23, 27, 31]
00051 RANGE_CAL_X = [0,2,4,6]
00052 RANGE_CAL_Y = [1,3,5,7]
00053 # TEM cc geometry (real)
00054 #~ OFFSET = [0, 0, 1, 1, 3, 3, 2, 2]
00055 #~ Minitower cc geometry (inverted)
00056 #~ OFFSET = [1, 1, 0, 0, 2, 2, 3, 3]
00057
00058
00059 ACD_SIDE0 = 0
00060 ACD_SIDE1 = 1
00061 ACD_SIDE2 = 2
00062 ACD_SIDE3 = 3
00063 ACD_SIDE4 = 4
00064 ACD_SIDE5 = 5 # ???
00065 ACD_SIDE6 = 6 # ???
00066 ACD_NA    = 7 # ???
00067 LOOKUP_ACD_TILE = {"120" :  (ACD_SIDE1, 4, 2), "NA4" : (ACD_NA,    0, 0),
00068                    "502" :  (ACD_SIDE5, 0, 0), "NA5" : (ACD_NA,    0, 0),
00069                    "121" :  (ACD_SIDE1, 3, 2), "111" : (ACD_SIDE1, 3, 1),
00070                    "101" :  (ACD_SIDE1, 3, 0), "122" : (ACD_SIDE1, 2, 2),
00071                    "112" :  (ACD_SIDE1, 2, 1), "102" : (ACD_SIDE1, 2, 0),
00072                    "103" :  (ACD_SIDE1, 1, 0), "113" : (ACD_SIDE1, 1, 1),
00073                    "123" :  (ACD_SIDE1, 1, 2), "503" : (ACD_SIDE5, 0, 0),
00074                    "104" :  (ACD_SIDE1, 0, 0), "114" : (ACD_SIDE1, 0, 1),
00075                    "124" :  (ACD_SIDE1, 0, 2), "130" : (ACD_SIDE1, 0, 3),
00076                    "110" :  (ACD_SIDE1, 4, 1), "100" : (ACD_SIDE1, 4, 0),
00077                    "220" :  (ACD_SIDE2, 2, 4), "210" : (ACD_SIDE2, 1, 4),
00078                    "600" :  (ACD_SIDE6, 0, 0), "200" : (ACD_SIDE2, 0, 4),
00079                    "000" :  (ACD_SIDE0, 4, 4), "010" : (ACD_SIDE0, 3, 4),
00080                    "020" :  (ACD_SIDE0, 2, 4), "221" : (ACD_SIDE2, 2, 3),
00081                    "211" :  (ACD_SIDE2, 1, 3), "201" : (ACD_SIDE2, 0, 3),
00082                    "001" :  (ACD_SIDE0, 4, 3), "011" : (ACD_SIDE0, 3, 3),
00083                    "021" :  (ACD_SIDE0, 2, 3), "022" : (ACD_SIDE0, 2, 2),
00084                    "NA6" :  (ACD_NA,    0, 0), "002" : (ACD_SIDE0, 4, 2),
00085                    "222" :  (ACD_SIDE2, 2, 2), "602" : (ACD_SIDE6, 0, 0),
00086                    "212" :  (ACD_SIDE2, 1, 2), "202" : (ACD_SIDE2, 0, 2),
00087                    "012" :  (ACD_SIDE0, 3, 2), "013" : (ACD_SIDE0, 3, 1),
00088                    "003" :  (ACD_SIDE0, 4, 1), "203" : (ACD_SIDE2, 0, 1),
00089                    "213" :  (ACD_SIDE2, 1, 1), "223" : (ACD_SIDE2, 2, 1),
00090                    "014" :  (ACD_SIDE0, 3, 0), "004" : (ACD_SIDE0, 4, 0),
00091                    "204" :  (ACD_SIDE2, 0, 0), "NA7" : (ACD_NA,    0, 0),
00092                    "214" :  (ACD_SIDE2, 1, 0), "224" : (ACD_SIDE2, 2, 0),
00093                    "NA10" : (ACD_NA,    0, 0), "230" : (ACD_SIDE2, 3, 0),
00094                    "324" :  (ACD_SIDE3, 0, 1), "NA9" : (ACD_NA,    0, 0),
00095                    "501" :  (ACD_SIDE5, 0, 0), "NA8" : (ACD_NA,    0, 0),
00096                    "323" :  (ACD_SIDE3, 1, 1), "313" : (ACD_SIDE3, 1, 2),
00097                    "303" :  (ACD_SIDE3, 1, 3), "322" : (ACD_SIDE3, 2, 1),
00098                    "312" :  (ACD_SIDE3, 2, 2), "302" : (ACD_SIDE3, 2, 3),
00099                    "301" :  (ACD_SIDE3, 3, 3), "311" : (ACD_SIDE3, 3, 2),
00100                    "321" :  (ACD_SIDE3, 3, 1), "500" : (ACD_SIDE5, 0, 0),
00101                    "300" :  (ACD_SIDE3, 4, 3), "310" : (ACD_SIDE3, 4, 2),
00102                    "320" :  (ACD_SIDE3, 4, 1), "330" : (ACD_SIDE3, 0, 0),
00103                    "314" :  (ACD_SIDE3, 0, 2), "304" : (ACD_SIDE3, 0, 3),
00104                    "NA0" :  (ACD_NA,    0, 0), "424" : (ACD_SIDE4, 1, 0),
00105                    "603" :  (ACD_SIDE6, 0, 0), "414" : (ACD_SIDE4, 2, 0),
00106                    "404" :  (ACD_SIDE4, 3, 0), "044" : (ACD_SIDE0, 0, 0),
00107                    "034" :  (ACD_SIDE0, 1, 0), "024" : (ACD_SIDE0, 2, 0),
00108                    "423" :  (ACD_SIDE4, 1, 1), "413" : (ACD_SIDE4, 2, 1),
00109                    "403" :  (ACD_SIDE4, 3, 1), "043" : (ACD_SIDE0, 0, 1),
00110                    "033" :  (ACD_SIDE0, 1, 1), "023" : (ACD_SIDE0, 2, 1),
00111                    "NA1" :  (ACD_NA,    0, 0), "042" : (ACD_SIDE0, 0, 2),
00112                    "422" :  (ACD_SIDE4, 1, 2), "601" : (ACD_SIDE6, 0, 0),
00113                    "412" :  (ACD_SIDE4, 2, 2), "402" : (ACD_SIDE4, 3, 2),
00114                    "032" :  (ACD_SIDE0, 1, 2), "031" : (ACD_SIDE0, 1, 3),
00115                    "041" :  (ACD_SIDE0, 0, 3), "401" : (ACD_SIDE4, 3, 3),
00116                    "411" :  (ACD_SIDE4, 2, 3), "421" : (ACD_SIDE4, 1, 3),
00117                    "030" :  (ACD_SIDE0, 1, 4), "040" : (ACD_SIDE0, 0, 4),
00118                    "400" :  (ACD_SIDE4, 3, 4), "NA2" : (ACD_NA,    0, 0),
00119                    "410" :  (ACD_SIDE4, 2, 4), "420" : (ACD_SIDE4, 1, 4),
00120                    "NA3" :  (ACD_NA,    0, 0), "430" : (ACD_SIDE4, 0, 0),
00121                    }
00122 LOOKUP_ACD_XZM = ["200", "201", "202", "203", "204",
00123                   "210", "211", "212", "213", "214",
00124                   "220", "221", "222", "223", "224",
00125                   "230"]
00126 LOOKUP_ACD_XZP = ["400", "401", "402", "403", "404",
00127                   "410", "411", "412", "413", "414",
00128                   "420", "421", "422", "423", "424",
00129                   "430"]
00130 LOOKUP_ACD_YZM = ["100", "101", "102", "103", "104",
00131                   "110", "111", "112", "113", "114",
00132                   "120", "121", "122", "123", "124",
00133                   "130"]
00134 LOOKUP_ACD_YZP = ["300", "301", "302", "303", "304",
00135                   "310", "311", "312", "313", "314",
00136                   "320", "321", "322", "323", "324",
00137                   "330"]
00138 LOOKUP_ACD_XY  = ["000", "001", "002", "003", "004",
00139                   "010", "011", "012", "013", "014",
00140                   "020", "021", "022", "023", "024",
00141                   "030", "031", "032", "033", "034",
00142                   "040", "041", "042", "043", "044"]
00143 LOOKUP_ACD_RBN = ["500", "501", "502", "503",
00144                   "600", "601", "602", "603"]
00145 LOOKUP_ACD_NA  = ["NA0", "NA1", "NA2", "NA3", "NA4",
00146                   "NA5", "NA6", "NA7", "NA8", "NA9",
00147                   "NA10"]
00148
00149
00150 class GEMcontribution_(object):
00151   __condSumName = ["ROI", "TKR", "CAL_LE", "CAL_HE", "CNO", "Periodic", "Solicited", "External"]
00152   def __init__(self, event, contribution, gui):
00153     self.__event        = event
00154     self.__contribution = contribution
00155     self.__gui          = gui
00156
00157   def __getattr__(self, attr):
00158     """This method fakes up inheritance from an LDF.GEMcontribution.
00159     When a called method can not be found to belong to this class, this
00160     method is called.  We use it to redirect the call to the 'base' class.
00161     """
00162     return getattr(self.__contribution, attr)
00163
00164   def __drawRing(self, drawACDside, nX, nY, i, j, extraWPix, extraHPix):
00165     color = QColor("magenta")
00166
00167     tileWidth  = drawACDside.width()/nX
00168     tileHeight = drawACDside.height()/nY
00169
00170     pACD = QPainter(drawACDside.final)
00171     pACD.setPen(color)
00172     pACD.drawRect(tileWidth * i, tileHeight * j, tileWidth + extraWPix, tileHeight + extraHPix)
00173     pACD.end()
00174
00175   def __drawTile(self, drawACDside, nX, nY, mask, lookup):
00176     i = 0
00177     while (mask):
00178       if mask & 1:
00179         tile = lookup[i]
00180         tileIJ = LOOKUP_ACD_TILE[tile]
00181         if tile == "130" or tile == "330":
00182           nX = 1
00183           extraWPix = 0
00184         else:
00185           extraWPix = 1
00186         if tile == "230" or tile == "430":
00187           nY = 1
00188           extraHPix = 0
00189         else:
00190           extraHPix = 1
00191         self.__drawRing(drawACDside, nX, nY, tileIJ[1], tileIJ[2], extraWPix, extraHPix)
00192       mask >>= 1
00193       i += 1
00194
00195   def plot(self):
00196     gui = self.__gui
00197     tl  = self.tileList()
00198
00199     drawHatACD   = gui.drawHatACD
00200     drawSide1ACD = gui.drawSide1ACD
00201     drawSide2ACD = gui.drawSide2ACD
00202     drawSide3ACD = gui.drawSide3ACD
00203     drawSide4ACD = gui.drawSide4ACD
00204
00205     self.__drawTile(drawSide4ACD, 4, 5, tl.XZP(), LOOKUP_ACD_XZP)
00206     self.__drawTile(drawSide2ACD, 4, 5, tl.XZM(), LOOKUP_ACD_XZM)
00207     self.__drawTile(drawSide3ACD, 5, 4, tl.YZP(), LOOKUP_ACD_YZP)
00208     self.__drawTile(drawSide1ACD, 5, 4, tl.YZM(), LOOKUP_ACD_YZM)
00209     self.__drawTile(drawHatACD,   5, 5, tl.XY(),  LOOKUP_ACD_XY)
00210     #self.__drawTile(gui.drawNAACD,  tl.NA(),  LOOKUP_ACD_NA)
00211     #self.__drawTile(gui.drawRBNACD, tl.RBN(), LOOKUP_ACD_RBN)
00212
00213     # Request that the screen is updated, for those Widgets that need it
00214     if drawHatACD.isVisible():
00215       drawHatACD.update()
00216       drawSide1ACD.update()
00217       drawSide2ACD.update()
00218       drawSide3ACD.update()
00219       drawSide4ACD.update()
00220
00221     if gui.drawGOSEDData.isVisible():
00222       opt = self.onePPStime()
00223
00224       out = []
00225
00226       out.append(["ROI vector",    "0x%04x" % (self.roiVector())])
00227       out.append(["TKR vector",    "0x%04x" % (self.tkrVector())])
00228       out.append(["CAL HE vector", "0x%04x" % (self.calHEvector())])
00229       out.append(["CAL LE vector", "0x%04x" % (self.calLEvector())])
00230
00231       cs    = self.conditionSummary()
00232       csVal = cs
00233       csStr = ""
00234       csIdx = 0
00235       while csVal:
00236         if csVal & 0x1:  csStr = self.__condSumName[csIdx] + " " + csStr
00237         csIdx  += 1
00238         csVal >>= 1
00239
00240       out.append(["Condition summary", "0x%02x = %s" % (cs, csStr)])
00241       out.append(["Missed",            "0x%02x" % (self.missed())])
00242       out.append(["CNO vector",        "0x%04x" % (self.cnoVector())])
00243       out.append(["Veto list:",        ""])
00244       out.append(["  XZP, XZM",        "0x%04x, 0x%04x" % (tl.XZP(), tl.XZM())])
00245       out.append(["  YZP, YZM",        "0x%04x, 0x%04x" % (tl.YZP(), tl.YZM())])
00246       out.append(["  XY",              "0x%08x"       % (tl.XY())])
00247       out.append(["  NA, RBN",         "0x%04x, 0x%04x" % (tl.NA(), tl.RBN())])
00248       out.append(["Live time",         "0x%08x = %d" % (self.liveTime(), self.liveTime())])
00249       out.append(["Prescaled",         "0x%08x = %d" % (self.prescaled(), self.prescaled())])
00250       out.append(["Discarded",         "0x%08x = %d" % (self.discarded(), self.discarded())])
00251       #out.append(["Sent                   = 0x%08x = %d" % (self.sent(), self.sent()))
00252       out.append(["Condition arrival:",     ""])
00253       out.append(["  Raw",                  "0x%08x     " % (self.condArrTime().datum())])
00254       out.append(["  External",             "0x%02x = %d" % (self.condArrTime().external(), self.condArrTime().external() )])
00255       out.append(["  CNO",                  "0x%02x = %d" % (self.condArrTime().cno()     , self.condArrTime().cno()      )])
00256       out.append(["  CAL HE",               "0x%02x = %d" % (self.condArrTime().calHE()   , self.condArrTime().calHE()    )])
00257       out.append(["  CAL LE",               "0x%02x = %d" % (self.condArrTime().calLE()   , self.condArrTime().calLE()    )])
00258       out.append(["  TKR",                  "0x%02x = %d" % (self.condArrTime().tkr()     , self.condArrTime().tkr()      )])
00259       out.append(["  ROI",                  "0x%02x = %d" % (self.condArrTime().roi()     , self.condArrTime().roi()      )])
00260       out.append(["Trigger time",           "0x%08x = %d" % (self.triggerTime(), self.triggerTime())])
00261       out.append(["One PPS time:",          ""])
00262       out.append(["  seconds, timebase",    "0x%02x, 0x%07x = %d, %d" % \
00263                  (opt.seconds(), opt.timebase(), opt.seconds(), opt.timebase())])
00264       out.append(["Delta window open time", "0x%04x = %d" % (self.deltaWindowOpenTime(), self.deltaWindowOpenTime())])
00265       out.append(["Delta event time",       "0x%08x = %d" % (self.deltaEventTime(), self.deltaEventTime())])
00266
00267       view = gui.drawGOSEDData.trigger
00268       #~ view2 = gui.drawGOSEDData.trigger2
00269       #~ text = ""
00270       #~ for item in out:
00271         #~ text += item[0] + "   " + item[1] + "\n"
00272       #~ view2.setText(text)
00273       # Next 4 lines are a trick to freeze sorting
00274       view.setSorting(-1)
00275       firstParameter = out[0]
00276       oldItem = QListViewItem(view, firstParameter[0] + "   ", firstParameter[1])
00277       out = out[1:]
00278       for parameter in out:
00279         item = QListViewItem(view, oldItem, parameter[0] + "   ", parameter[1])
00280         oldItem = item
00281
00282 class AEMcontributionIterator_(LDF.AEMcontributionIterator):
00283   __drawSide = []
00284   def __init__(self,event,contribution, gui, lci):
00285     LDF.AEMcontributionIterator.__init__(self,event,contribution)
00286     self.__gui      = gui
00287     self.__acdPeds  = gui.GOSEDPreferencesGUI.getAcdPeds()
00288     self.__minValue = gui.GOSEDPreferencesGUI.minACD()
00289     self.__maxValue = gui.GOSEDPreferencesGUI.maxACD()
00290
00291     self.__drawSide.append(self.__drawHatTile)
00292     self.__drawSide.append(self.__drawSide1Tile)
00293     self.__drawSide.append(self.__drawSide2Tile)
00294     self.__drawSide.append(self.__drawSide3Tile)
00295     self.__drawSide.append(self.__drawSide4Tile)
00296     self.__drawSide.append(self.__drawSide5Tile)
00297     self.__drawSide.append(self.__drawSide6Tile)
00298     self.__drawSide.append(self.__drawNATile)
00299
00300   def __drawTile(self, drawACDside, nX, nY, i, j, ab, color):
00301     tileWidth  = drawACDside.width()/nX
00302     tileHeight = drawACDside.height()/nY
00303
00304     # To embed triangles in tiles:
00305     # For every i,   add 1
00306     # For every i+1, substract 1
00307     arr = QPointArray()
00308     if ab:
00309       arr.setPoints([tileWidth*i     + 1, tileHeight*j     + 1,
00310                      tileWidth*(i+1) - 1, tileHeight*j     + 1,
00311                      tileWidth*i     + 1, tileHeight*(j+1) - 1])
00312     else:
00313       arr.setPoints([tileWidth*(i+1) - 1, tileHeight*(j+1) - 1,
00314                      tileWidth*(i+1) - 1, tileHeight*j     + 1,
00315                      tileWidth*i     + 1, tileHeight*(j+1) - 1])
00316
00317     pACD = QPainter(drawACDside.final)
00318     #pACD.setRasterOp(Qt.AndROP)
00319     pACD.setBrush(color)
00320     pACD.setPen(color)
00321     pACD.drawPolygon(arr)
00322     pACD.end()
00323
00324   def __drawHatTile(self, i, j, ab, color):
00325     drawHatACD = self.__gui.drawHatACD
00326     self.__drawTile(drawHatACD, 5, 5, i, j, ab, color)
00327     # ATK-051110: Must be painted here to avoid that
00328     # the display flickers on update.
00329     drawHatACD.drawNames(drawHatACD.final)
00330
00331   def __drawSide1Tile(self, i, j, ab, color):
00332     drawSide1ACD = self.__gui.drawSide1ACD
00333     if j < 3:
00334       self.__drawTile(drawSide1ACD, 5, 4, i, j, ab, color)
00335     else:
00336       self.__drawTile(drawSide1ACD, 1, 4, i, j, ab, color)
00337     # ATK-051110: Must be painted here to avoid that
00338     # the display flickers on update.
00339     drawSide1ACD.drawNames(drawSide1ACD.final)
00340
00341   def __drawSide2Tile(self, i, j, ab, color):
00342     drawSide2ACD = self.__gui.drawSide2ACD
00343     if i < 3:
00344       self.__drawTile(drawSide2ACD, 4, 5, i, j, ab, color)
00345     else:
00346       self.__drawTile(drawSide2ACD, 4, 1, i, j, ab, color)
00347     # ATK-051110: Must be painted here to avoid that
00348     # the display flickers on update.
00349     drawSide2ACD.drawNames(drawSide2ACD.final)
00350
00351   def __drawSide3Tile(self, i, j, ab, color):
00352     drawSide3ACD = self.__gui.drawSide3ACD
00353     if j > 0:
00354       self.__drawTile(drawSide3ACD, 5, 4, i, j, ab, color)
00355     else:
00356       self.__drawTile(drawSide3ACD, 1, 4, i, j, ab, color)
00357     # ATK-051110: Must be painted here to avoid that
00358     # the display flickers on update.
00359     drawSide3ACD.drawNames(drawSide3ACD.final)
00360
00361   def __drawSide4Tile(self, i, j, ab, color):
00362     drawSide4ACD = self.__gui.drawSide4ACD
00363     if i > 0:
00364       self.__drawTile(drawSide4ACD, 4, 5, i, j, ab, color)
00365     else:
00366       self.__drawTile(drawSide4ACD, 4, 1, i, j, ab, color)
00367     # ATK-051110: Must be painted here to avoid that
00368     # the display flickers on update.
00369     drawSide4ACD.drawNames(drawSide4ACD.final)
00370
00371   def __drawSide5Tile(self, i, j, ab, color):
00372     pass
00373
00374   def __drawSide6Tile(self, i, j, ab, color):
00375     pass
00376
00377   def __drawNATile(self, i, j, ab, color):
00378     pass
00379
00380   def plot(self, prefix = ""):
00381     gui = self.__gui
00382
00383     drawHatACD   = gui.drawHatACD
00384     drawSide1ACD = gui.drawSide1ACD
00385     drawSide2ACD = gui.drawSide2ACD
00386     drawSide3ACD = gui.drawSide3ACD
00387     drawSide4ACD = gui.drawSide4ACD
00388
00389     self.iterate()
00390
00391     # Request that the screen is updated, for those Widgets that need it
00392     if drawHatACD.isVisible():
00393       drawHatACD.update()
00394       drawSide1ACD.update()
00395       drawSide2ACD.update()
00396       drawSide3ACD.update()
00397       drawSide4ACD.update()
00398
00399   def header(self, cable, hdr):
00400     # RiC 9/8/05 - Refrain from printing out "Cable has no data" cases
00401     if self.__gui.drawGOSEDData.isVisible() and hdr.phaVector():
00402       out = self.__gui.drawGOSEDData.acd
00403
00404       out.append( "Cable %d = FREE board '%s' header:" % \
00405                   (cable, self.map().freeName(self.event().identity(), cable)))
00406       out.append( "  start-bit           = %01x"   % (hdr.startBit()))
00407       out.append( "  hit-map             = 0x%05x" % (hdr.hitMap()))
00408       out.append( "  accept-map          = 0x%05x" % (hdr.acceptMap()))
00409       out.append( "  PHA vector          = %01x"   % (hdr.phaVector()))
00410       out.append( "  header parity error = %01x"   % (hdr.parityError()))
00411
00412       # RiC 9/8/05 - Changed to refrain from printing out "Cable has no data"
00413       #if ( hdr.phaVector() ):
00414       out.append( "                                Value    parity")
00415       out.append( "  Channel  Tile  Side Range (hex)  (dec) error  More")
00416       #else:
00417       #  out.append( "Cable %d has no data" % (cable))
00418
00419   def pha(self, cable, channel, p):
00420     id   = self.event().identity()
00421     tbl  = self.map().lookup(id, cable, channel)
00422     tile = tbl.name()
00423     pha  = p.ADCvalue()
00424     if self.__acdPeds is not None:   # subtract pedestals if available
00425       pha -= self.__acdPeds[cable,channel,p.ADCrange(),0]
00426
00427     if self.__gui.drawGOSEDData.isVisible():
00428       out = self.__gui.drawGOSEDData.acd
00429       if tbl.a():  side = 'A'
00430       else:        side = 'B'
00431       out.append("     %2d   %4s     %s    %d   0x%03x = %4d    %d     %d" % \
00432                  (channel, tbl.name(), side, p.ADCrange(), p.ADCvalue(),
00433                   p.ADCvalue(), p.parityError(), p.more()))
00434
00435     # Map range 0 to lower half scale, range 1 to upper half scale
00436     import colorScale
00437     dv = float(self.__maxValue - self.__minValue)
00438     if dv == 0.0:  dv = 1.0e-308
00439     v = 0.5 * (p.ADCrange() + (float(pha) - float(self.__minValue)) / dv)
00440     r, g, b = colorScale.colorScale(v)
00441
00442     color = QColor(r, g, b)
00443
00444     tileSide = LOOKUP_ACD_TILE[tile]
00445     self.__drawSide[tileSide[0]](tileSide[1], tileSide[2], tbl.a(), color)
00446
00447 # class CALcontributionIterator1(LDF.CALcontributionIterator):
00448 #   """ \brief CAL contribution Filter
00449
00450 #   This class obtains the information of CAL from EBF to setup the min and max
00451 #   engery of the event. To do so it filters by event, twr, and range. Using the
00452 #   GOSED Preferences menu (from the Tools tab on the menu bar), if the scale is
00453 #   selected as ACD Calibration, the min and max values will be determined for
00454 #   every event as the min and max value of ACD counts that that event has.
00455 #   If Default is selected, min and max will be 0 and 1000 ACD counts,
00456 #   respectively. If Custom is selected, the user will select its own min and
00457 #   max values of interest from the GOSED Preferences menu """
00458
00459 #   def __init__(self, event, contribution, gui, lci):
00460 #     """ CALcontributionIterator1 contructor
00461
00462 #     \param event         Event
00463 #     \param contribution  Contribution
00464 #     \param gui           GOSED
00465 #     """
00466
00467 #     LDF.CALcontributionIterator.__init__(self, event, contribution)
00468 #     self.__gui                = gui
00469
00470 #     # Determine which tower and range are currently selected
00471 #     self.__selectedTower      = \
00472 #                         self.__gui.drawGOSEDTWR.selectTWR.id(self.__gui.drawGOSEDTWR.selectTWR.selected())
00473 #     self.__selectedRange      = \
00474 #                         self.__gui.drawGOSEDCALTKR.selectRNG.id(self.__gui.drawGOSEDCALTKR.selectRNG.selected())
00475
00476 #     # Initialize variables
00477 #     self.__maxValue           = 0
00478 #     self.__minValue           = 1000000
00479
00480 #     self.__logCount           = 0
00481 #     self.__energyCount        = 0
00482
00483 #     self.__maxValue2          = 0
00484 #     self.__minValue2          = 1000000
00485
00486 #     self.__logCount2          = 0
00487 #     self.__energyCount2       = 0
00488
00489 #     self.__calPeds            = gui.GOSEDPreferencesGUI.getCalPeds()
00490
00491 #   def plot(self):
00492 #     """ This def will call the iterate() function to return the min and max
00493 #     value within the scale format selected by the user (Event, Custom or
00494 #     Default)
00495
00496 #     \return Values filtered in the iteration: minValue, maxValue, logCount,
00497 #             energyCount
00498 #     """
00499 #     # Determine the length of the event CAL data and return if it is 0
00500 #     length = self.contribution().numLogAccepts()
00501 #     if length == 0:
00502 #       return
00503
00504 #     # Obtain tower number from LDF. This tower will have CAL data since
00505 #     # it passed the filter above
00506 #     towerSource = LDF.LATPcellHeader.source(self.contribution().header())
00507
00508 #     # Enables TWRs with CAL data
00509 #     twrButton = self.__gui.drawGOSEDTWR.selectTWR.find(towerSource)
00510 #     twrButton.setEnabled(1)
00511
00512
00513 #     # If the file was just opened select the first twr entry in the event to
00514 #     # filter by it.
00515 #     if self.__selectedTower == -1:
00516 #       self.__selectedTower = towerSource
00517 #       twrButton.setChecked(1)
00518
00519 #     # Filter by twr ATK 12/05/03 We need to calculate limits for all the TWrs
00520 #     # to plot values in GOTED
00521 #     #~ if towerSource != self.__selectedTower:
00522 #       #~ return
00523
00524 #     # Iterate calls the log function for every event entry
00525 #     self.iterate()
00526
00527 #     # If no twr was selected, we set limits as Default (see if this is obsolete
00528 #     # since now we always select the first twr when opening the file)
00529 #     if self.__minValue == 1000000:
00530 #       self.__minValue = 0
00531
00532 #     if self.__maxValue == 0:
00533 #       self.__maxValue = 1000
00534
00535 #     # Change limits if user has changed scale format
00536 #     if self.__gui.preferredLimits == "Default":
00537 #       self.__minValue = 0
00538 #       self.__maxValue = 1000
00539
00540 #     elif self.__gui.preferredLimits == "Custom":
00541 #       self.__minValue = self.__gui.GOSEDPreferencesGUI.minCAL()
00542 #       self.__maxValue = self.__gui.GOSEDPreferencesGUI.maxCAL()
00543
00544 #     # And for the CAL & TKR Window:
00545 #     if self.__minValue2 == 1000000:
00546 #       self.__minValue2 = 0
00547
00548 #     if self.__maxValue2 == 0:
00549 #       self.__maxValue2 = 1000
00550
00551 #     # Change limits if user has changed scale format
00552 #     if self.__gui.preferredLimits == "Default":
00553 #       self.__minValue2 = 0
00554 #       self.__maxValue2 = 1000
00555
00556 #     elif self.__gui.preferredLimits == "Custom":
00557 #       self.__minValue2 = self.__gui.GOSEDPreferencesGUI.minCAL()
00558 #       self.__maxValue2 = self.__gui.GOSEDPreferencesGUI.maxCAL()
00559
00560 #     # Return calculated values in the iteration
00561 #     return {"minValue": self.__minValue, "maxValue": self.__maxValue,
00562 #             "logCount": self.__logCount, "energyCount": self.__energyCount,
00563 #             "minValue2": self.__minValue2, "maxValue2": self.__maxValue2,
00564 #             "logCount2": self.__logCount2, "energyCount2": self.__energyCount2}
00565
00566 #   def log(self, tower, layer, theLog):
00567 #     """ This function enables the TWR and RNG display buttons for which there
00568 #     is CAL data in the event. It also checks the TWR and RNG display button for
00569 #     the first entry in the event data. Log returns if the value of the TWR or
00570 #     RNG is not the same as the one selected (the first time it returns for all
00571 #     entries that have twr and rng values other than the the first tower and
00572 #     range entry in the event). If the entry passes the filter it obtains its
00573 #     energy value (in ACD counts) and range,and contrasts them with the actual
00574 #     min and max values to update them if necesary.
00575
00576 #     \return tower, layer, theLog
00577 #     """
00578 #     # Get range values, we are gonna make sure that posValue and negValue are
00579 #     # the same for each entry
00580 #     posValue = theLog.positive().value()
00581 #     negValue = theLog.negative().value()
00582
00583 #     posRange = theLog.positive().range()
00584 #     negRange = theLog.negative().range()
00585
00586 #     # Subtract pedestals if available
00587 #     if self.__calPeds is not None:
00588 #       posValue -= self.__calPeds[tower,layer,theLog.column(),0,posRange,0]
00589 #       negValue -= self.__calPeds[tower,layer,theLog.column(),1,negRange,0]
00590
00591 #     #Assuming positive and negative range are the same for an event log entry
00592 #     RNGButton = self.__gui.drawGOSEDCAL.selectRNG.find(posRange)
00593 #     RNGButton.setEnabled(1)
00594
00595 #     RNGButton2 = self.__gui.drawGOSEDCALTKR.selectRNG.find(posRange)
00596 #     RNGButton2.setEnabled(1)
00597
00598 #     #~ print "Exists data in CAL 1 iterator log function before filters"
00599
00600 #     # If the file was just opened select the first rng entry in the event to
00601 #     # filter by it.
00602 #     if self.__selectedRange == -1:
00603 #       self.__selectedRange   = posRange
00604 #       RNGButton.setChecked(1)
00605
00606 #     #~ if self.__selectedRange2 == -1:
00607 #       #~ self.__selectedRange2   = posRange
00608 #       #~ RNGButton2.setChecked(1)
00609
00610 #     # Return if the entry does not have the selected rng value.
00611 #     # If negRange is not the same as posRange the entry is discarded (check if
00612 #     # this is a good idea)
00613 #     if self.__selectedRange  != -1 and self.__selectedRange  != 4:
00614 #       if posRange != self.__selectedRange  or negRange != self.__selectedRange:
00615 #         pass
00616
00617 #       else:
00618 #         # Once we have filtered to obtain the desired entries calculate the average
00619 #         # energy in ACD counts and contrast it with the present min and max values.
00620 #         averageEnergy = (posValue + negValue)/2
00621
00622 #         # Update counts of log and energy entries
00623 #         self.__logCount += 1
00624 #         self.__energyCount += averageEnergy
00625
00626 #         # Update min and max values for the filtered event with the new value
00627 #         # if necessary.
00628 #         if averageEnergy > self.__maxValue:
00629 #           self.__maxValue = averageEnergy
00630
00631 #         if averageEnergy < self.__minValue:
00632 #           self.__minValue = averageEnergy
00633
00634 #     # Return if the entry does not have the selected rng value.
00635 #     # If negRange is not the same as posRange the entry is discarded (check if
00636 #     # this is a good idea)
00637 #     #~ if self.__selectedRange2  != -1 and self.__selectedRange2  != 4:
00638 #       #~ if posRange != self.__selectedRange2  or negRange != self.__selectedRange2:
00639 #         #~ return
00640
00641 #     # Once we have filtered to obtain the desired entries calculate the average
00642 #     # energy in ACD counts and contrast it with the present min and max values.
00643 #     #~ averageEnergy2 = (posValue + negValue)/2
00644
00645 #     #~ # Update counts of log and energy entries
00646 #     #~ self.__logCount2 += 1
00647 #     #~ self.__energyCount2 += averageEnergy2
00648
00649 #     #~ # Update min and max values for the filtered event with the new value
00650 #     #~ # if necessary.
00651 #     #~ if averageEnergy2 > self.__maxValue2:
00652 #       #~ self.__maxValue2 = averageEnergy2
00653
00654 #     #~ if averageEnergy2 < self.__minValue2:
00655 #       #~ self.__minValue2 = averageEnergy2
00656 #     #~ print "Exists data in CAL 1 iterator log function after filters"
00657
00658
00659 class CALcontributionIterator2(LDF.CALcontributionIterator):
00660   """ \brief CAL contribution Displayer
00661
00662   This class obtains the filtered entries from CALcontributorIterator1 and
00663   converts them to the appropriate format to display them
00664   """
00665
00666   def __init__(self, event, contribution, gui, limits, lci):
00667     """ CALcontributionIterator2 contructor
00668
00669     \param event         Event
00670     \param contribution  Contribution
00671     \param gui           GOSED
00672     \param limits        Tuple with filtered values (min value, max value,
00673                          log count and energy count) obtained from
00674                          CALcontributionIterator1
00675     """
00676
00677     LDF.CALcontributionIterator.__init__(self, event, contribution)
00678     self.__event              = event
00679     self.__contribution       = contribution
00680     self.__gui                = gui
00681     self.__limits             = limits
00682     self.__tower              = None
00683     self.__calPeds            = gui.GOSEDPreferencesGUI.getCalPeds()
00684
00685     # Create a dictionary of colors for range readout
00686     self.__rangeColorMap =  { 0 : QColor(255,0,0),
00687                               1 : QColor(255,255,0),
00688                               2 : QColor(0,170,0),
00689                               3 : QColor(0,0,255)
00690                             }
00691
00692     # Determine which tower and range are currently selected
00693     self.__scale = gui.drawGOSEDCAL.scaleSelection.currentItem()
00694     self.__scale2 = gui.drawGOSEDCALTKR.scaleSelection.currentItem()
00695
00696     self.__selectedTower      = \
00697                       gui.drawGOSEDTWR.selectTWR.id(gui.drawGOSEDTWR.selectTWR.selected())
00698     self.__selectedRange  = []
00699     self.__selectedRange2 = []
00700     for i in range(0, 5):
00701       button = gui.drawGOSEDCAL.selectRNG.find(i)
00702       if button.isChecked():
00703         self.__selectedRange.append(i)
00704       button2 = gui.drawGOSEDCALTKR.selectRNG.find(i)
00705       if button2.isChecked():
00706         self.__selectedRange2.append(i)
00707
00708     if self.__selectedRange == []:
00709       checkAll = False
00710       for i in range(0, 4):
00711         button = gui.drawGOSEDCAL.selectRNG.find(i)
00712         if button.isEnabled():
00713           checkAll = False
00714       if checkAll:
00715         self.__selectedRange.append(4)
00716         gui.drawGOSEDCAL.RNGAll.setChecked(1)
00717         gui.drawGOSEDCAL.RNGAll.setEnabled(1)
00718     if self.__selectedRange2 == []:
00719       checkAll = False
00720       for i in range(0, 4):
00721         button = gui.drawGOSEDCAL.selectRNG.find(i)
00722         if button.isEnabled():
00723           checkAll = False
00724       if checkAll:
00725         self.__selectedRange2.append(4)
00726         gui.drawGOSEDCALTKR.RNGAll.setEnabled(1)
00727         gui.drawGOSEDCALTKR.RNGAll.setChecked(1)
00728
00729
00730     #~ print "ranges: ", self.__selectedRange, self.__selectedRange2
00731     #~ self.__selectedRange      = \
00732                       #~ gui.drawGOSEDCAL.selectRNG.id(gui.drawGOSEDCALTKR.selectRNG.selected())
00733     #~ self.__selectedRange2     = \
00734                       #~ gui.drawGOSEDCALTKR.selectRNG.id(gui.drawGOSEDCALTKR.selectRNG.selected())
00735
00736     # Initialize GOTED TKR temporary Pixmaps
00737     self.__ebfZ_CAL = {}
00738
00739     # Initialize limits
00740     if limits is None:
00741       self.__minValue = 0
00742       self.__maxValue = 1000
00743
00744       self.__minValue2 = 0
00745       self.__maxValue2 = 1000
00746
00747       self.__logCount    = 0
00748       self.__energyCount = 0
00749
00750       #~ self.__minValue2 = 0
00751       #~ self.__maxValue2 = 1000
00752
00753       #~ self.__logCount2    = 0
00754       #~ self.__energyCount2 = 0
00755
00756       # Change limits if user has changed scale format
00757       if gui.preferredLimits == "Custom":
00758         self.__minValue = gui.GOSEDPreferencesGUI.minCAL()
00759         self.__maxValue = gui.GOSEDPreferencesGUI.maxCAL()
00760
00761       if gui.preferredLimits2 == "Custom":
00762         self.__minValue2 = gui.GOSEDPreferencesGUI.minCAL2()
00763         self.__maxValue2 = gui.GOSEDPreferencesGUI.maxCAL2()
00764
00765         #~ self.__minValue2 = gui.GOSEDPreferencesGUI.minCAL()
00766         #~ self.__maxValue2 = gui.GOSEDPreferencesGUI.maxCAL()
00767 #        return
00768
00769     else:
00770       # Do we ever get in here? -ATK 040705
00771       self.__minValue = limits["minValue"]
00772       self.__maxValue = limits["maxValue"]
00773
00774       self.__minValue2 = limits["minValue"]
00775       self.__maxValue2 = limits["maxValue"]
00776
00777       #~ self.__minValue2 = limits["minValue2"]
00778       #~ self.__maxValue2 = limits["maxValue2"]
00779
00780     # Create CAL color spectrum dividing the min to max interval in 6.
00781     # If Energy Scale has been selected as Default or Custom the corresponding
00782     # values will the input min and max values here.
00783 #    interval = (self.__maxValue - self.__minValue)/6
00784 #    self.__interval = interval
00785
00786     #~ for view in (gui.drawGOSEDCAL, gui.drawGOSEDCALTKR):
00787 #     gui.drawGOSEDCALTKR.redLbl.setText(str(self.__minValue) + " - " +
00788 #                                        str(self.__minValue + 1*interval))
00789 #     gui.drawGOSEDCALTKR.orangeLbl.setText(str(self.__minValue + 1*interval) +
00790 #                                           " - " +
00791 #                                           str(self.__minValue + 2*interval))
00792 #     gui.drawGOSEDCALTKR.yellowLbl.setText(str(self.__minValue + 2*interval) +
00793 #                                           " - " +
00794 #                                           str(self.__minValue + 3*interval))
00795 #     gui.drawGOSEDCALTKR.greenLbl.setText(str(self.__minValue + 3*interval) +
00796 #                                          " - " +
00797 #                                          str(self.__minValue + 4*interval))
00798 #     gui.drawGOSEDCALTKR.blueLbl.setText(str(self.__minValue + 4*interval) +
00799 #                                         " - " +
00800 #                                         str(self.__minValue + 5*interval))
00801 #     gui.drawGOSEDCALTKR.violetLbl.setText(str(self.__minValue + 5*interval) +
00802 #                                           " - " + str(self.__maxValue))
00803
00804     #~ self.__interval2 = (self.__maxValue2 - self.__minValue2)/6
00805     #~ gui.drawGOSEDCALTKR.redLbl.setText(str(self.__minValue2) + " - " +
00806                               #~ str(self.__minValue2 + 1*self.__interval2))
00807     #~ gui.drawGOSEDCALTKR.orangeLbl.setText(str(self.__minValue2 + 1*self.__interval2) +
00808                                  #~ " - " +
00809                                  #~ str(self.__minValue2 + 2*self.__interval2))
00810     #~ gui.drawGOSEDCALTKR.yellowLbl.setText(str(self.__minValue2 + 2*self.__interval2) +
00811                                  #~ " - " +
00812                                  #~ str(self.__minValue2 + 3*self.__interval2))
00813     #~ gui.drawGOSEDCALTKR.greenLbl.setText(str(self.__minValue2 + 3*self.__interval2) +
00814                                 #~ " - " +
00815                                 #~ str(self.__minValue2 + 4*self.__interval2))
00816     #~ gui.drawGOSEDCALTKR.blueLbl.setText(str(self.__minValue2 + 4*self.__interval2) +
00817                                #~ " - " +
00818                                #~ str(self.__minValue2 + 5*self.__interval2))
00819     #~ gui.drawGOSEDCALTKR.violetLbl.setText(str(self.__minValue2 + 5*self.__interval2) +
00820                                  #~ " - " + str(self.__maxValue2))
00821
00822
00823
00824   def plot(self):
00825     """ Plot here will call the iterate() function to display the filtered
00826     event within the scale format selected by the user (Event, Custom or
00827     Default)
00828
00829     There are three sorts of pixmaps (and the 3 equivalent for the YZ projection):
00830     background = Background Pixmap with the skeleton of the CAL
00831     final      = Final pixmap that is going to be loaded to the display. If no
00832                  data passed the filter, the custom widget drawXZ_CAL will
00833                  automatically load background to final for display
00834     ebfXZ_CAL  = Temporary Pixmap that, if there is data that passed the filter
00835                  for the current event, it gets painted with it over background.
00836                  If so it is then passed to final (once the iteration is over).
00837     """
00838     gui = self.__gui
00839     # Return if there is no CAL data in the event.
00840     length = self.__contribution.numLogAccepts()
00841     if length != 0:
00842       #~ return
00843
00844       # Obtain tower number from LDF. This tower will have CAL data since
00845       # it passed the filter above
00846       towerSource = LDF.LATPcellHeader.source(self.contribution().header())
00847
00848       # Enables TWRs with CAL data - ATK-040705
00849       twrButton = self.__gui.drawGOSEDTWR.selectTWR.find(towerSource)
00850       twrButton.setEnabled(1)
00851
00852       # If the file was just opened select the first twr entry in the event to
00853       # filter by it.              - ATK-040705
00854       if self.__selectedTower == -1:
00855         if gui.firstTower == None:
00856           gui.firstTower = towerSource
00857           self.__selectedTower = towerSource
00858           twrButton.setChecked(1)
00859           #~ gui.drawGOSEDCAL.RNGAll.setChecked(1)
00860           #~ gui.drawGOSEDCALTKR.RNGAll.setChecked(1)
00861
00862       # Initialize GOTED Frames, for all TWRs with CAL data
00863       #~ gui.drawGOTED.towerList[towerSource].setEnabled(1)
00864
00865       # Initialize GOTED CAL Pixmaps, for all TWRs with CAL data
00866       self.__ebfZ_CAL[towerSource] = QPixmap(gui.drawGOTED.TWR0.width(),
00867                                              gui.drawGOTED.TWR0.height())
00868
00869       # If there is already a pixmap loaded from TKR, build from it
00870       if gui.drawGOTED.final[towerSource].isNull():
00871         copyBlt(self.__ebfZ_CAL[towerSource], 0, 0, gui.drawGOTED.background)
00872       else:
00873         copyBlt(self.__ebfZ_CAL[towerSource], 0, 0,
00874                 gui.drawGOTED.final[towerSource])
00875
00876       # Iterate over event entries to paint filtered entries onto temporary pixmap
00877       self.iterate()
00878
00879       if length != 0:
00880         # ATK - 09 Jan 04: Implementation on hold, needs to consider
00881         # pairing of layers in trays to create proper top projection of the tower:
00882         # Here we presently just pass back white background pixmap instead of top
00883         # projection
00884         #
00885         # Pass GOTED Pixmaps
00886         bitBlt(gui.drawGOTED.towerList[towerSource], 0, 0,
00887                self.__ebfZ_CAL[towerSource], 0, 0)
00888         bitBlt(gui.drawGOTED.final[towerSource], 0, 0,
00889                self.__ebfZ_CAL[towerSource], 0, 0)
00890         #~ bitBlt(gui.towerList[towerSource], 0, 0,
00891                #~ self.__ebfZ_CAL[towerSource], 0, 0)
00892
00893         # Filter by selected tower:
00894         if towerSource != self.__selectedTower:
00895           return
00896
00897         # Frame in red the selected TWR
00898         Zpm = gui.clickTWR(self.__selectedTower)
00899         #~ if Zpm is not None:
00900         bitBlt(gui.drawGOTED.towerList[towerSource], 0, 0, Zpm , 0, 0)
00901         bitBlt(gui.drawGOTED.final[towerSource], 0, 0, Zpm , 0, 0)
00902
00903     # Request that the screen is updated, for those Widgets that need it
00904     if gui.drawXZ_CAL.isVisible():
00905       gui.drawYZ_CAL.update()
00906       gui.drawXZ_CAL.update()
00907     if gui.drawXZ_CAL2.isVisible():
00908       gui.drawYZ_CAL2.update()
00909       gui.drawXZ_CAL2.update()
00910     if gui.drawGOSEDData.isVisible():
00911       gui.drawGOSEDData.update()
00912
00913     # Fill in total count of Log hits and total average Energy
00914     gui.drawGOSEDData.totLogHits.setText(str(self.__logCount))
00915     gui.drawGOSEDData.totEnergy.setText(str(self.__energyCount))
00916
00917
00918   def __drawLog(self, final, posArr, posColor, negArr, negColor):
00919     # If the scale is range readout and the range is different than the selected ranges
00920     # paint a black rim - ATK 040706
00921     pCAL = QPainter(final)
00922
00923     # Positive Range
00924     pCAL.setBrush(posColor)
00925     pCAL.setPen(posColor)
00926     if posColor == QColor("black"):
00927       pCAL.setBrush(Qt.NoBrush)
00928     pCAL.drawPolygon(posArr)
00929
00930     # Negative Range
00931     pCAL.setBrush(negColor)
00932     pCAL.setPen(negColor)
00933     if negColor == QColor("black"):
00934       pCAL.setBrush(Qt.NoBrush)
00935     pCAL.drawPolygon(negArr)
00936
00937     pCAL.end()
00938
00939   def log(self, tower, layer, theLog):
00940     """ This function iterates over all current event entries and displays
00941     all those entries that passed the filter of for CAL in
00942     CALContributorIterator1.
00943
00944     \return tower, layer, theLog
00945     """
00946     # Initialize variables
00947     layerTag = ["X0", "Y0", "X1", "Y1", "X2", "Y2", "X3", "Y3"]
00948     gccc     = [  0,    3,    0,    3,    2,    1,    2,    1]
00949     gcrc     = [  0,    0,    1,    1,    2,    2,    3,    3]
00950
00951     # Initialize variables for the filtered entry
00952     gui    = self.__gui
00953     scale  = self.__scale
00954     scale2 = self.__scale2
00955
00956     # Initialize GOTED Pixmaps for TWRs with CAL data
00957     if gui.drawGOTED.final[tower].isNull():
00958       gui.drawGOTED.final[tower] = QPixmap(gui.drawGOTED.TWR0.width(),
00959                                            gui.drawGOTED.TWR0.height())
00960
00961     # ATK - 09 Jan 04: Implementation on hold, needs to consider
00962     # pairing of layers in trays to create proper top projection of the tower:
00963     #
00964     #~ # Paint XY GOTED projection for every tower with data
00965     #~ pCAL = QPainter(self.__ebfZ_CAL[tower])
00966     #~ pCAL.setBrush(color)
00967     #~ pCAL.setPen(color)
00968     #print gui.TWR0.geometry().width(), gui.TWR0.height()
00969     #~ pCAL.drawRect(column*gui.drawGOTED.TWR0.width()/12,
00970                        #~ column*gui.drawGOTED.TWR0.height()/12,
00971                        #~ gui.drawGOTED.TWR0.width()/12,
00972                        #~ gui.drawGOTED.TWR0.height()/12
00973                        #~ )
00974
00975     #~ pCAL.end()
00976
00977     # Filter by selected tower:
00978     if tower != self.__selectedTower:
00979       return
00980
00981     column = theLog.column()
00982
00983     positive = theLog.positive()
00984     negative = theLog.negative()
00985
00986     posRange = positive.range()
00987     posValue = positive.value()
00988     negRange = negative.range()
00989     negValue = negative.value()
00990
00991     # Subtract pedestals if available
00992     calPeds = self.__calPeds
00993     if calPeds is not None:
00994       posValue -= calPeds[tower,layer,theLog.column(),0,posRange,0]
00995       negValue -= calPeds[tower,layer,theLog.column(),1,negRange,0]
00996
00997     # Enable All Ranges Button
00998     rangeAll = gui.drawGOSEDCAL.RNGAll
00999     rangeAll.setEnabled(1)
01000     rangeAll2 = gui.drawGOSEDCALTKR.RNGAll
01001     rangeAll2.setEnabled(1)
01002
01003     #Assuming positive and negative range are the same for an event log entry
01004     RNGButton = gui.drawGOSEDCAL.selectRNG.find(posRange)
01005     RNGButton.setEnabled(1)
01006     if rangeAll.isChecked():
01007       RNGButton.setChecked(1)
01008       self.__selectedRange.append(posRange)
01009
01010     RNGButton2 = gui.drawGOSEDCALTKR.selectRNG.find(posRange)
01011     RNGButton2.setEnabled(1)
01012     if rangeAll2.isChecked():
01013       RNGButton2.setChecked(1)
01014       self.__selectedRange2.append(posRange)
01015
01016     # Update counts of log and energy entries
01017     value = (posValue + negValue)/2
01018     self.__logCount += 1
01019     self.__energyCount += value
01020
01021     # Ric is overriding the color here:
01022     import colorScale
01023     # Paint only selected range
01024     if posRange not in self.__selectedRange:
01025       scale = 1
01026     if negRange not in self.__selectedRange:
01027       scale = 1
01028     dv = float(self.__maxValue) - float(self.__minValue)
01029     if dv == 0.0:  dv = 1.0e-308
01030     v = (float(posValue) - float(self.__minValue)) / dv
01031     r, g, b = colorScale.colorScale(v)
01032     posColor = QColor(r, g, b)
01033     v = (float(negValue) - float(self.__minValue)) / dv
01034     r, g, b = colorScale.colorScale(v)
01035     negColor = QColor(r, g, b)
01036
01037     if posRange not in self.__selectedRange2:
01038       scale2 = 1
01039     if negRange not in self.__selectedRange2:
01040       scale2 = 1
01041     # Added new color for CAL/TKR window independent of CAL window
01042     dv = float(self.__maxValue2) - float(self.__minValue2)
01043     if dv == 0.0:  dv = 1.0e-308
01044     v = (float(posValue) - float(self.__minValue2)) / dv
01045     r, g, b = colorScale.colorScale(v)
01046     posColor2 = QColor(r, g, b)
01047     v = (float(negValue) - float(self.__minValue2)) / dv
01048     r, g, b = colorScale.colorScale(v)
01049     negColor2 = QColor(r, g, b)
01050
01051     # If we are scaling by range from 0 to 3, determine energy color for the
01052     # entry value within the range spectrum:
01053     if scale == 1:
01054       # Use correct colors for pos and neg range - ATK 040705
01055       posColor = self.__rangeColorMap[posRange]
01056       negColor = self.__rangeColorMap[negRange]
01057       # Paint a black rim if range not in selected set of ranges
01058       if posRange not in self.__selectedRange:
01059         posColor = QColor("black")
01060       if negRange not in self.__selectedRange:
01061         negColor = QColor("black")
01062       #~ if posRange == 0:
01063         #~ posColor = QColor(255,0,0)
01064       #~ elif posRange == 1:
01065         #~ posColor = QColor(255,255,0)
01066       #~ elif posRange == 2:
01067         #~ posColor = QColor(0,170,0)
01068       #~ elif posRange == 3:
01069         #~ posColor = QColor(0,0,255)
01070
01071       # negColor = color - ATK 040705
01072       # posColor = color - ATK 040705
01073
01074     # If we are scaling by range from 0 to 3, determine energy color for the
01075     # entry value within the range spectrum:
01076     if scale2 == 1:
01077       # Use correct colors for pos and neg range - ATK 040705
01078       posColor2 = self.__rangeColorMap[posRange]
01079       negColor2 = self.__rangeColorMap[negRange]
01080       # Paint a black rim if range not in selected set of ranges
01081       if posRange not in self.__selectedRange2:
01082         posColor2 = QColor("black")
01083       if negRange not in self.__selectedRange2:
01084         negColor2 = QColor("black")
01085
01086     # If there is data in the selected tower intialize final pixmaps in the draw class.
01087     logWidth  = gui.drawXZ_CAL.final.width() / 12
01088     logHeight = gui.drawXZ_CAL.final.height() / 8
01089
01090     arrA = QPointArray()
01091     # Points: Make them one pixel less in height, on bottom
01092     arrA.setPoints([logWidth*column     + 1, logHeight*layer     + 1,  # Top    Left
01093                     logWidth*(column+1) - 1, logHeight*layer     + 1,  # Top    Right
01094                     logWidth*column     + 1, logHeight*(layer+1) - 2]) # Bottom Left
01095     arrB = QPointArray()
01096     arrB.setPoints([logWidth*(column+1) - 1, logHeight*(layer+1) - 2,  # Bottom Right
01097                     logWidth*(column+1) - 1, logHeight*layer     + 1,  # Top    Right
01098                     logWidth*column     + 1, logHeight*(layer+1) - 2]) # Bottom Left
01099
01100     # Once the color has been determined, paint log with it
01101     # in the correct projection.
01102     if gui.drawXZ_CAL.isVisible():
01103       if layer in range(1, 9, 2):
01104         self.__drawLog(gui.drawXZ_CAL.final, arrA, posColor, arrB, negColor)
01105       elif layer in range(0, 8, 2):
01106         self.__drawLog(gui.drawYZ_CAL.final, arrA, posColor, arrB, negColor)
01107
01108     if gui.drawXZ_CAL2.isVisible():
01109       if layer in range(1, 9, 2):
01110         self.__drawLog(gui.drawXZ_CAL2.final, arrA, posColor2, arrB, negColor2)
01111       elif layer in range(0, 8, 2):
01112         self.__drawLog(gui.drawYZ_CAL2.final, arrA, posColor2, arrB, negColor2)
01113
01114     if 3 in self.__selectedRange and 4 not in self.__selectedRange:
01115       if gui.drawXZ_CAL.isVisible():
01116         if layer in range(1, 9, 2):
01117           self.__drawLog(gui.drawXZ_CAL.final, arrA, QColor("black"), arrB, QColor("black"))
01118         elif layer in range(0, 8, 2):
01119           self.__drawLog(gui.drawYZ_CAL.final, arrA, QColor("black"), arrB, QColor("black"))
01120
01121     if 3 in self.__selectedRange2 and 4 not in self.__selectedRange2:
01122       if gui.drawXZ_CAL2.isVisible():
01123         if layer in range(1, 9, 2):
01124           self.__drawLog(gui.drawXZ_CAL2.final, arrA, QColor("black"), arrB, QColor("black"))
01125         elif layer in range(0, 8, 2):
01126           self.__drawLog(gui.drawYZ_CAL2.final, arrA, QColor("black"), arrB, QColor("black"))
01127
01128     # Fill in CAL listview window with the entry data:
01129     if gui.drawGOSEDData.isVisible():
01130       messageItem = QListViewItem( gui.drawGOSEDData.CALview )
01131                                    #~ gui.drawGOSEDData.CALview.lastItem()) # ATK: This caused the slowdown
01132       messageItem.setText( 0, str(tower))
01133       messageItem.setText( 1, str(layerTag[layer]))  # RiC: Should be col 2
01134       messageItem.setText( 3, str(gccc[layer]))      # RiC: Should be col 1
01135       messageItem.setText( 2, str(column))
01136       if self.__calPeds is not None:
01137         messageItem.setText( 4, "%d" % posValue)
01138         messageItem.setText( 5, str(posRange))
01139         messageItem.setText( 6, "%d" % negValue)
01140         messageItem.setText( 7, str(negRange))
01141       else:
01142         messageItem.setText( 4, "0x%03x" % posValue)
01143         messageItem.setText( 5, str(posRange))
01144         messageItem.setText( 6, "0x%03x" % negValue)
01145         messageItem.setText( 7, str(negRange))
01146       messageItem.setText( 8, str(gcrc[layer]))
01147       messageItem.setText( 9, str(column))
01148
01149 class TKRcontributionIterator_(LDF.TKRcontributionIterator):
01150   """ \brief TKR contribution Displayer
01151
01152   This class obtains the information of TKR from EBF to setup the tkr data in
01153   GOSED. To do so it filters by event and twr, iterating over all the entries
01154   in the event.
01155   """
01156
01157   def __init__(self, event, contribution, gui):
01158     """ TKRcontributionIterator contructor
01159
01160     \param event         Event
01161     \param contribution  Contribution
01162     \param gui           GOSED
01163     """
01164
01165     # Initialize variables
01166     LDF.TKRcontributionIterator.__init__(self, event, contribution)
01167     self.__xy      = ['Y', 'X', 'X', 'Y']
01168     self.__gui     = gui
01169     self.__gtcc    = [6, 3, 7, 2, 5, 0, 4, 1]
01170     self.__event   = event
01171     self.__tower   = None
01172
01173     self.hitCount   = 0
01174     self.layerCount = 0
01175
01176     # Retreive current selected tower:
01177     self.__selectedTower = gui.drawGOSEDTWR.selectTWR.id(gui.drawGOSEDTWR.selectTWR.selected())
01178
01179     # Initialize GOTED TKR temporary Pixmaps
01180     self.__ebfZ_TKR = {}
01181
01182
01183   def plot(self):
01184     """ Plot here will call the iterateStrips() function to display the filtered
01185     event.
01186
01187     There are three sorts of pixmaps (and the 3 equivalent for the YZ projection):
01188     background = Background Pixmap with the skeleton of the TKR
01189     final      = Final pixmap that is going to be loaded to the display. If no
01190                  data passed the filter, the custom widget drawXZ_CAL will
01191                  automatically load background to final for display
01192     """
01193
01194     gui = self.__gui
01195
01196     # Return if there is no TKR data in the event.
01197     tkrContribution = self.contribution()
01198     length  = tkrContribution.numAccepts(self.__event)
01199     if length != 0:
01200       # Obtain tower number from EBF
01201       towerSource = LDF.LATPcellHeader.source(self.contribution().header())
01202
01203       # Initialize GOTED Frames, for all TWRs with TKR data
01204       #~ gui.drawGOTED.towerList[towerSource].setEnabled(1)
01205
01206       #~ print "tower Header", towerHeader
01207
01208       # Enable all towers that have data for the event
01209       twrButton = gui.drawGOSEDTWR.selectTWR.find(towerSource)
01210       twrButton.setEnabled(1)
01211
01212       # If we fix that tower can be passed directly to plot(), we can save having to
01213       # enter iteratestrips by adding the next 7 lines for all the towers that are not
01214       # the selected one. With the above line this is fixed. ATK 11/21/03
01215       if self.__selectedTower == -1:
01216         if gui.firstTower == None:
01217           gui.firstTower = towerSource
01218           self.__selectedTower = towerSource
01219           twrButton.setChecked(1)
01220
01221       # Initialize GOTED temporary pixmap, for all Towers with data.
01222       self.__ebfZ_TKR[towerSource] = QPixmap(gui.drawGOTED.towerList[towerSource].width(),
01223                                              gui.drawGOTED.towerList[towerSource].height())
01224
01225       if gui.drawGOTED.final[towerSource].isNull():
01226         copyBlt(self.__ebfZ_TKR[towerSource], 0, 0, gui.drawGOTED.background)
01227       else:
01228         copyBlt(self.__ebfZ_TKR[towerSource], 0, 0, gui.drawGOTED.final[towerSource])
01229
01230       #~ # Pass GOTED Pixmaps
01231       #~ bitBlt(gui.drawGOTED.towerList[towerSource], 0, 0, self.__ebfZ_TKR[towerSource], 0, 0)
01232       #~ bitBlt(gui.drawGOTED.final[towerSource], 0, 0, self.__ebfZ_TKR[towerSource], 0, 0)
01233
01234     # Iterate over strip data.
01235     self.iterateStrips()
01236
01237     if length != 0:
01238       # ATK - 09 Jan 04: Implementation on hold, needs to consider
01239       # pairing of layers in trays to create proper top projection of the tower:
01240       # Here we presently just pass back white background pixmap instead of top
01241       # projection
01242       #
01243       # Pass GOTED Pixmaps
01244       bitBlt(gui.drawGOTED.towerList[towerSource], 0, 0,
01245             self.__ebfZ_TKR[towerSource], 0, 0)
01246       bitBlt(gui.drawGOTED.final[towerSource], 0, 0,
01247             self.__ebfZ_TKR[towerSource], 0, 0)
01248       #~ bitBlt(gui.towerList[towerSource], 0, 0,
01249             #~ self.__ebfZ_TKR[towerSource], 0, 0)
01250
01251     # Iterate over TOT data
01252     self.iterateTOTs()
01253
01254     if length != 0:
01255       # Filter by selected tower:
01256       if towerSource != self.__selectedTower:
01257         return
01258
01259       # Frame in red the selected TWR
01260       Zpm = gui.clickTWR(self.__selectedTower)
01261       #~ if Zpm is not None:
01262       bitBlt(gui.drawGOTED.towerList[towerSource], 0, 0, Zpm , 0, 0)
01263       bitBlt(gui.drawGOTED.final[towerSource], 0, 0, Zpm , 0, 0)
01264
01265     # Request that the screen is updated, for those Widgets that need it
01266     if gui.drawYZ_TKR.isVisible():
01267       gui.drawYZ_TKR.update()
01268       gui.drawXZ_TKR.update()
01269     if gui.drawYZ_TKR2.isVisible():
01270       gui.drawYZ_TKR2.update()
01271       gui.drawXZ_TKR2.update()
01272
01273   def strip(self, tower, layerEnd, hit):
01274     """ This function iterates over all current event entries and displays
01275     all those entries that passed the filter of for TWR.
01276
01277     \return tower, layerEnd, hit
01278     """
01279     # Initialize variables
01280     gui   = self.__gui
01281     layer = layerEnd >> 1
01282     rc    = layer / 4
01283     cc    = self.__gtcc[layer % 4]
01284
01285     (xTKR, yTKR, zTKR, stripNum) = (LDF.TKRstrip.gtfe(hit),
01286                                     LDF.TKRstrip.gtfe(hit), layer, hit)
01287
01288     # Initialize GOTED Pixmaps for TWRs with TKR data
01289     if gui.drawGOTED.final[tower].isNull():
01290       gui.drawGOTED.final[tower] = QPixmap(gui.drawGOTED.TWR0.width(),
01291                                            gui.drawGOTED.TWR0.height())
01292
01293     # We only have the mageneta color for TKR
01294     color = QColor("magenta")
01295
01296     # ATK - 09 Jan 04: Implementation on hold, needs to consider
01297     # pairing of layers in trays to create proper top projection of the tower:
01298     #
01299     # Paint XY GOTED projection for every tower with data
01300     #~ self.pTKR = QPainter(self.__ebfZ_TKR[tower])
01301     #~ self.pTKR.setBrush(color)
01302     #~ self.pTKR.setPen(color)
01303     #~ self.pTKR.drawLine(stripNum*gui.drawGOTED.TWR0.width()/1536,
01304                        #~ stripNum*gui.drawGOTED.TWR0.height()/1536 - 2,
01305                        #~ stripNum*gui.drawGOTED.TWR0.width()/1536,
01306                        #~ stripNum*gui.drawGOTED.TWR0.height()/1536 + 2
01307                        #~ )
01308     #~ self.pTKR.drawLine(stripNum*gui.drawGOTED.TWR0.width()/1536 - 2,
01309                        #~ stripNum*gui.drawGOTED.TWR0.height()/1536 + 1,
01310                        #~ stripNum*gui.drawGOTED.TWR0.width()/1536 + 2,
01311                        #~ stripNum*gui.drawGOTED.TWR0.height()/1536 + 1
01312                        #~ )
01313     #~ self.pTKR.end()
01314
01315     # Filter by selected tower:
01316     if tower != self.__selectedTower:
01317       return
01318
01319     x = stripNum*gui.drawXZ_TKR.final.width()/NUMBER_STRIPS
01320     y = (35-zTKR)*7
01321
01322     # Paint ebf pixmap with filtered data of the current event
01323     if self.__xy[layer & 0x3] == "X":
01324       pTKR = QPainter(gui.drawXZ_TKR.final)
01325       pTKR.setBrush(color)
01326       pTKR.setPen(color)
01327       if y in RANGE1_TKR_X:
01328         pTKR.drawLine(x,     y + 1, x,     y + 1 + 6)
01329         pTKR.drawLine(x - 2, y + 4, x + 2, y + 4)
01330         #pTKR.drawRect(stripNum*STRIP_RANGE*4/NUMBER_STRIPS + 1,
01331         #              y + 1, 4 , 6)
01332       else:
01333         pTKR.drawLine(x,     y,     x,     y + 6 + 1)
01334         pTKR.drawLine(x - 2, y + 4, x + 2, y + 4)
01335         #pTKR.drawRect(x, y + 2, 1 , 6)
01336         #pTKR.drawRect(stripNum*STRIP_RANGE*4/NUMBER_STRIPS + 1,
01337         #              y + 2, 4 , 6)
01338       bitBlt(gui.drawXZ_TKR2.final, 0, 0, gui.drawXZ_TKR.final, 0, 0)
01339
01340     elif self.__xy[layer & 0x3] == "Y":
01341       pTKR = QPainter(gui.drawYZ_TKR.final)
01342       pTKR.setBrush(color)
01343       pTKR.setPen(color)
01344       if y in RANGE1_TKR_Y:
01345         pTKR.drawLine(x,     y + 2, x,     y + 2 + 6)
01346         pTKR.drawLine(x - 2, y + 4, x + 2, y + 4)
01347         #pTKR.drawRect(x, y + 2, 1, 6)
01348         #pTKR.drawRect(stripNum*STRIP_RANGE*4/NUMBER_STRIPS + 1,
01349         #              y + 1, 4 , 6)
01350
01351       else:
01352         pTKR.drawLine(x,     y + 1, x,     y + 1 + 6)
01353         pTKR.drawLine(x - 2, y + 4, x + 2, y + 4)
01354         #pTKR.drawRect(x, y + 1, 1 , 6)
01355         #pTKR.drawRect(stripNum*STRIP_RANGE*4/NUMBER_STRIPS + 1,
01356         #              y + 2, 4 , 6)
01357
01358       bitBlt(gui.drawYZ_TKR2.final, 0, 0, gui.drawYZ_TKR.final, 0, 0)
01359
01360     pTKR.end()
01361
01362     # Add one to the number of hits count
01363     self.hitCount += 1
01364
01365     # Load entry in the TKR list view
01366     if gui.drawGOSEDData.isVisible():
01367       towerValue = str(tower)
01368       xyValue    = str(LAYER[layer])
01369       layerValue = str(layer)
01370       tccValue   = str(cc) + ',' + str(cc + 1)
01371       trcValue   = str(rc)
01372       tfeValue   = str(LDF.TKRstrip.gtfe(hit))
01373       chanValue  = str(hit)
01374       hitValue   = "0x%04x" % hit
01375
01376       messageItem = QListViewItem( gui.drawGOSEDData.TKRview )
01377                       #, gui.drawGOSEDData.TKRview.lastItem()) # ATK: This caused the slowdown
01378       # If we wanted a check list here is how to do it:
01379       #messageItem = QCheckListItem( gui.drawGOSEDData.TKRview,"", QCheckListItem.CheckBox)
01380
01381       messageItem.setText( 0, towerValue)
01382       messageItem.setText( 1, xyValue)
01383       messageItem.setText( 2, layerValue)
01384       messageItem.setText( 3, tccValue )
01385       messageItem.setText( 4, trcValue)
01386       messageItem.setText( 5, tfeValue)
01387       messageItem.setText( 6, chanValue)
01388       messageItem.setText( 7, hitValue)
01389
01390     gui.drawGOSEDData.totHits.setText(str(self.hitCount))
01391
01392   # Not implemented
01393   def TOT(self, tower, layerEnd, tot):
01394     pass
01395
01396 class OSWcontributionIterator_(LDF.OSWcontributionIterator):
01397   def __init__(self, event, contribution):
01398     LDF.OSWcontributionIterator.__init__(self, event, contribution)
01399     self.__timestamp   = None
01400     self.__timebase    = None
01401     self.__evtSequence = None
01402
01403   def timestamp(self):
01404     return self.__timestamp
01405
01406   def evtSequence(self):
01407     return self.__evtSequence
01408
01409   def OSW_time(self, event, contribution):
01410     # Note that the next line COPIES the contribution in order to cast (YUCK)!
01411     tc = LDF.OSWtimeContribution(contribution)
01412
01413     eventNumber   = LDF.EventSummary.eventNumber(contribution.summary())
01414     eventTag      = LDF.EventSummary.tag(contribution.summary())
01415
01416     ts = LDF.OSWtimeSpec(tc.timeStamp())
01417
01418     self.__timestamp   = (ts.sec(), ts.nsec())
01419     self.__evtSequence = tc.evtSequence()
01420
01421     return 0
01422
01423
01424 class DIAGcontributionIterator_(LDF.DIAGcontributionIterator):
01425   __CALlayerLabel = ["x0", "x1", "x2", "x3", "y0", "y1", "y2", "y3"]
01426   __gccc          = [0, 2, 3, 1]
01427
01428   def __init__(self,event,contribution,dataStart, gui):
01429     LDF.DIAGcontributionIterator.__init__(self,event,contribution)
01430     self.offset(dataStart)  # Set the start of the diagnostic data
01431     self.__gui    = gui
01432     self.__diagCALView   = self.__gui.drawGOSEDData.diagCAL
01433     self.__diagTKRView   = self.__gui.drawGOSEDData.diagTKR
01434
01435   def CALdiag(self, tower, layer, diag):
01436     gccc          = self.__gccc[layer>>1]
01437     layer         = self.__CALlayerLabel[layer]
01438     negLogAccepts = diag.logAccepts (1)        # negative
01439     negHigh       = diag.high       (1)        # negative
01440     negLow        = diag.low        (1)        # negative
01441     posLogAccepts = diag.logAccepts (0)        # positive
01442     posHigh       = diag.high       (0)        # positive
01443     posLow        = diag.low        (0)        # positive
01444
01445     if self.__gui.drawGOSEDData.isVisible():
01446       item = QListViewItem(self.__diagCALView)
01447       item.setText(0, str(gccc))
01448       item.setText(1, str(layer))
01449       item.setText(2, "0x%03x" % negLogAccepts)
01450       item.setText(3, str(negHigh))
01451       item.setText(4, str(negLow))
01452       item.setText(5, "0x%03x" % posLogAccepts)
01453       item.setText(6, str(posHigh))
01454       item.setText(7, str(posLow))
01455
01456     #~ diagCALView.insertItem(item)
01457     return 0
01458
01459   def TKRdiag(self, tower, gtcc, diag):
01460     gtrc         = (diag.datum() & 0xffff)
01461
01462     if self.__gui.drawGOSEDData.isVisible():
01463       item = QListViewItem(self.__diagTKRView)
01464       item.setText(0, str(gtcc))
01465       item.setText(1, "0x%03x" % gtrc)
01466
01467     #print "    %1d   0x%03x" % (gtcc, (diag.datum() & 0xffff))
01468     return 0
01469
01470
01471 class ERRcontributionIterator_(LDF.ERRcontributionIterator):
01472   __gccc  = [0, 2, 3, 1]
01473   __gtcc  = [3, 6, 2, 7, 0, 5, 1, 4]
01474   __pn    = ["+", "-"]
01475   __xy    = ["X", "Y"]
01476   __layer = [0, 2, 2, 0]
01477
01478   def __init__(self,event,contribution,dataStart, gui):
01479     LDF.ERRcontributionIterator.__init__(self,event,contribution)
01480     self.offset(dataStart)  # Set the start of the error data
01481     self.__gui   = gui
01482
01483     self.__errorWindow = self.__gui.drawGOSEDData.error
01484
01485   def gcccError(self, tower, gccc, err):
01486     #if not self.__errorWindow.isVisible():  return 0
01487     if err.type() == 0:
01488
01489       self.__errorWindow.append("  GCCC %d had missing start bit(s) on sweep %d (raw: 0x%04x):" % \
01490              (gccc, err.sweep(), err.raw()))
01491     else:
01492       self.__errorWindow.append("  GCCC %d had parity error(s) on sweep %d (raw: 0x%04x):" % \
01493              (gccc, err.sweep(), err.raw()))
01494     for i in range(8):
01495       if err.param() & (1 << i):
01496         self.__errorWindow.append("    %s%s%d, wire %d" % \
01497                                    (self.__pn[i > 3],
01498                                     self.__xy[gccc & 1],
01499                                     self.__layer[gccc] + ((i >> 1) & 1),
01500                                     i & 1))
01501     self.__errorWindow.append(" ")
01502     return 0
01503
01504   def gtccError(self, tower, gtcc, err):
01505     #if not self.__errorWindow.isVisible():  return 0
01506     self.__errorWindow.append("GTCC %d, GTRC %d (msg: 0x%04x):" % \
01507                               (gtcc, err.GTRC(), err.raw()))
01508     return 0
01509
01510   def phaseError(self, tower, err):
01511     #if not self.__errorWindow.isVisible():  return 0
01512     self.__errorWindow.append(" ")
01513     self.__errorWindow.append("Cable Controller phasing error tags (raw: 0x%04x):" % \
01514            (err))
01515
01516     tag = [0, 0, 0, 0, 0, 0, 0, 0]
01517     msg  = ""
01518     for c in range(8):  tag[self.__gtcc[c]] = (err >> (c << 1)) & 0x0003
01519     self.__errorWindow.append("  GTCC:  0  1  2  3  4  5  6  7")
01520     for c in range(8):  msg += "  %d" % (tag[c])
01521     self.__errorWindow.append("   tag:%s" % (msg))
01522     self.__errorWindow.append(" ")
01523     return 0
01524
01525   def timeoutError(self, tower, err):
01526     #if not self.__errorWindow.isVisible():  return 0
01527     self.__errorWindow.append(" ")
01528     self.__errorWindow.append("Cable Controller timeouts (raw: 0x%03x):" % (err))
01529     cTmos = err & 0x000f
01530     msg = "    GCCC:"
01531     for i in range(4):
01532       if cTmos & (1 << i):  msg += " %d" % (self.__gccc[i])
01533     tTmos = (err >> 4) & 0x00ff
01534     msg  += ", GTCC:"
01535     for i in range(8):
01536       if tTmos & (1 << i):  msg += " %d" % (self.__gtcc[i])
01537     self.__errorWindow.append("  %s" % (msg))
01538     self.__errorWindow.append(" ")
01539     return 0
01540
01541   def gtrcPhaseError(self, tower, gtcc, gtrc, err):
01542     #if not self.__errorWindow.isVisible():  return 0
01543     self.__errorWindow.append("  GTRC phasing error (raw: 0x%04x)"   % \
01544                               (err.raw()))
01545     self.__errorWindow.append("    Current tag number:           %d" % \
01546                               (err.currentTag()))
01547     self.__errorWindow.append("    Layer 0 tag number:           %d" % \
01548                               (err.layer0Tag()))
01549     self.__errorWindow.append("    Expected layer number:        %d" % \
01550                               (err.expectedLayer()))
01551     self.__errorWindow.append("    Layer number received by TEM: %d" % \
01552                               (err.receivedLayer()))
01553     self.__errorWindow.append(" ")
01554     return 0
01555
01556   def __tag(self, tag, err):
01557     for i in range(5):
01558       tag.append(err & 0x3)
01559       err >>= 2
01560
01561     return tag
01562
01563   def gtfePhaseError(self, tower, gtcc, gtrc, err1, err2, err3, err4, err5):
01564     #if not self.__errorWindow.isVisible():  return 0
01565     tags = " 0x%03x 0x%03x 0x%03x 0x%03x 0x%03x" % (err1, err2, err3, err4, err5)
01566     self.__errorWindow.append("  GTFE phasing error tags (raw: %s)" % (tags))
01567     tag = []
01568     self.__tag(tag, err1)
01569     self.__tag(tag, err2)
01570     self.__tag(tag, err3)
01571     self.__tag(tag, err4)
01572     self.__tag(tag, err5 >> 2)
01573     self.__errorWindow.append("    GTFE  0  1  2  3  4  5  6  7  8  9 10 11")
01574     str = "      0-11 "
01575     for i in range(12):
01576       str += "%2d " % tag[i]
01577     self.__errorWindow.append( str )
01578     str = "     12-23 "
01579     for i in range(12, 24):
01580       str += "%2d " % tag[i]
01581     self.__errorWindow.append( str )
01582     self.__errorWindow.append(" ")
01583     return 0
01584
01585   def gtccFIFOerror(self, tower, gtcc, err):
01586     #if not self.__errorWindow.isVisible():  return 0
01587     self.__errorWindow.append("  FIFO full error, projected word count = 0x%04x" % \
01588            (err))
01589     return 0
01590
01591   def gtccTMOerror(self, tower, gtcc):
01592     #if not self.__errorWindow.isVisible():  return 0
01593     self.__errorWindow.append("  Cable timeout error")
01594     return 0
01595
01596   def gtccHDRParityError(self, tower, gtcc):
01597     #if not self.__errorWindow.isVisible():  return 0
01598     self.__errorWindow.append("  Header parity error")
01599     return 0
01600
01601   def gtccWCParityError(self, tower, gtcc):
01602     #if not self.__errorWindow.isVisible():  return 0
01603     self.__errorWindow.append("  Word count parity error")
01604     return 0
01605
01606   def gtrcSummaryError(self, tower, gtcc):
01607     #if not self.__errorWindow.isVisible():  return 0
01608     self.__errorWindow.append("  GTRC summary error")
01609     return 0
01610
01611   def gtccDataParityError(self, tower, gtcc):
01612     #if not self.__errorWindow.isVisible():  return 0
01613     self.__errorWindow.append("  Data parity error")
01614     return 0
01615
01616 class myLATcomponentIterator(LDF.LATcomponentIterator):
01617   """ \brief LAT component Displayer
01618
01619   This class obtains the information of all the LAT components from EBF and
01620   passes it to the corresponding component iterators, to be displayed in GOSED.
01621   """
01622   def __init__(self, gui):
01623     """ myLATcomponentIterator contructor
01624
01625     \param gui           GOSED
01626     """
01627
01628     # Initialize variables
01629     LDF.LATcomponentIterator.__init__(self)
01630     self.__calSrc          = None
01631     self.__tkrContribution = None
01632     self.__gui             = gui
01633     self.__diagnosticData  = 0
01634
01635   def UDFcomponent(self, event, ebfContribution):
01636     return 0
01637
01638   def __displayEvtStats(self, eventSequence, eventTag, trgParityErr, timestamp):
01639     draw = self.__gui.drawGOSEDData
01640     draw.eventNumber.setText(str(eventSequence))
01641     draw.eventTag.setText(str(eventTag))
01642     evtTime = time.ctime(timestamp[0])
01643     draw.timeStamp.setText("%s + %09d nS" % (evtTime, timestamp[1]))
01644     if trgParityErr:
01645       draw.flagLine.setPaletteForegroundColor( QColor("red"))
01646       draw.flagLine.setText("Event has TrgParityErr")
01647
01648   def GLTcomponent(self, event, contribution):
01649     """ Obtain the "fingerprints" of the event
01650     """
01651     buffer        = Numeric.fromstring(contribution.data(), 'i')
01652     eventNumber   = LDF.EventSummary.eventNumber(contribution.summary())
01653     eventTag      = LDF.EventSummary.tag(contribution.summary())
01654     eventSequence = (eventNumber << 2) | eventTag
01655     trgParityErr  = LDF.EventSummary.trgParityError(contribution.summary())
01656
01657     #timestamp = time.asctime(time.gmtime(buffer[0])) #+ str(buffer[1]) + " mS"
01658
01659     self.__displayEvtStats(eventSequence, eventTag, trgParityErr, buffer)
01660     return 0
01661
01662   def OSWcomponent(self, event, contribution):
01663     """ Obtain the 'fingerprints' of the event
01664     """
01665     oswContribIter = OSWcontributionIterator_(event, contribution)
01666     oswContribIter.iterate()
01667
01668     # RiC - Kludge this for now by printing instead of displaying in the GUI
01669     #eventNumber   = LDF.EventSummary.eventNumber(contribution.summary())
01670     eventTag      = LDF.EventSummary.tag(contribution.summary())
01671     eventSequence = oswContribIter.evtSequence()
01672     trgParityErr  = LDF.EventSummary.trgParityError(contribution.summary())
01673     if trgParityErr:
01674       print "Event %d = %08x has a Trigger Parity Error" % (eventSequence,
01675                                                             eventSequence)
01676
01677     self.__displayEvtStats(eventSequence, eventTag, trgParityErr,
01678                            oswContribIter.timestamp())
01679     return 0
01680
01681   def GEMcomponent(self, event, gemContribution):
01682     """ Obtain the ACD information of the event
01683     """
01684     # RiC - Kludge this for now by printing instead of displaying in the GUI
01685     if LDF.EventSummary.trgParityError(gemContribution.summary()):
01686       print "GEM contribution has a Trigger Parity Error"
01687
01688     gemContrib = GEMcontribution_(event, gemContribution, self.__gui)
01689     gemContrib.plot()
01690     return 0
01691
01692   def ACDcomponent(self, event, aemContribution):
01693     """ Obtain the ACD information of the event
01694     """
01695     # RiC - Kludge this for now by printing instead of displaying in the GUI
01696     if LDF.EventSummary.trgParityError(aemContribution.summary()):
01697       print "ACD contribution has a Trigger Parity Error"
01698
01699     acdContrib = AEMcontributionIterator_(event, aemContribution, self.__gui, self)
01700     acdContrib.plot()
01701     return 0
01702
01703   def TKRcomponent(self, event, tkrContribution):
01704     """ Obtain the TKR information of the event to be processed by
01705     TKRcontributionIterator.
01706     """
01707     # RiC - Kludge this for now by printing instead of displaying in the GUI
01708     source = LDF.LATPcellHeader.source(tkrContribution.header())
01709     if LDF.EventSummary.trgParityError(tkrContribution.summary()):
01710       print "TEM %d contribution (TKR) has a Trigger Parity Error" % (source)
01711
01712     tkrIterator  = TKRcontributionIterator_(event, tkrContribution, self.__gui)
01713     tkrIterator.plot()
01714
01715     if tkrIterator.diagnostic() is not None:
01716       self.TKRend(tkrIterator.diagnostic())
01717
01718     return 0
01719
01720
01721   def CALcomponent(self, event, calContribution):
01722     """ Obtain the CAL information of the event to be processed by
01723     CALcontributionIterator1 and CALcontributionIterator2.
01724     """
01725     # RiC - Kludge this for now by printing instead of displaying in the GUI
01726     source = LDF.LATPcellHeader.source(calContribution.header())
01727     if LDF.EventSummary.trgParityError(calContribution.summary()):
01728       print "TEM %d contribution (CAL) has a Trigger Parity Error" % (source)
01729
01730 #    calContrib1 = CALcontributionIterator1(event, calContribution, self.__gui, self)
01731
01732 #    limits = calContrib1.plot()
01733     #~ if limits is None:
01734       #~ return
01735
01736     limits = None
01737     calContrib2 = CALcontributionIterator2(event, calContribution, self.__gui, limits, self)
01738     calContrib2.plot()
01739
01740     self.CALend(calContrib2.CALend())
01741
01742     return 0
01743
01744
01745   def diagnostic(self, event, contribution):
01746     """ Obtain the diagnostic information of the event.
01747     """
01748     # Print the right message in the edit box for error and diagnostic
01749     self.__gui.drawGOSEDData.flagLine.setPaletteForegroundColor( QColor("black"))
01750     self.__gui.drawGOSEDData.flagLine.setText("Event has diagnostic data")
01751
01752     iter = DIAGcontributionIterator_(event,contribution,self.TKRend(),self.__gui)
01753
01754     #~ self.__gui.drawGOSEDData.diagCAL.setText(CALdata)
01755     iter.iterateCAL()
01756     iter.iterateTKR()
01757
01758     #12 longwords in diagnostic
01759     self.diagnosticEnd(self.TKRend() + iter.size())
01760     return 0
01761
01762
01763   def error(self, event, contribution):
01764     """ Obtain the error information of the event.
01765     """
01766     gui = self.__gui
01767
01768     # Instead print the right message in the edit box for error and diagnostic
01769     gui.drawGOSEDData.flagLine.setPaletteForegroundColor( QColor("red"))
01770     if LDF.EventSummary.diagnostic(contribution.summary()):
01771       gui.drawGOSEDData.flagLine.setText("Event has diagnostic and error data")
01772     else:
01773       gui.drawGOSEDData.flagLine.setText("Event has error data")
01774     errorWindow = gui.drawGOSEDData.error
01775
01776     # Dump error information for both CAL and TKR
01777     if  not LDF.EventSummary.error(contribution.summary()):
01778       return
01779
01780     if self.diagnosticEnd() != 0:
01781       offset=self.diagnosticEnd()
01782     else:
01783       offset=self.TKRend()
01784     iter = ERRcontributionIterator_(event, contribution, offset, gui)
01785     theError = iter.theError()
01786
01787     #if errorWindow.isVisible():
01788     source = LDF.LATPcellHeader.source(contribution.header())
01789     errorWindow.append("Tower %d:" % source)
01790     errorWindow.append(" Cable    Cable  ")
01791     errorWindow.append("timeout  phasing  TKR  CAL")
01792     errorWindow.append("   %1d        %1d    0x%02x  0x%01x" % \
01793                        (theError.tmo(),
01794                         theError.phs(),
01795                         theError.tkr(),
01796                         theError.cal()))
01797     errorWindow.append(" ")
01798
01799     iter.iterate()
01800
01801     errorWindow.append(" ")
01802
01803     self.errorEnd(offset + iter.size())
01804     return 0
01805
01806   #~ def cleanup(self, event, contribution):
01807     #~ prefix = "  "
01808     #~ src    = LATPcellHeader.source(contribution.header())
01809     #~ len    = (self.errorEnd() + 15) & 0xfffffff0L # Integer # of LATp cells
01810
01811     #~ # Check for extra data after the last LATp cell we expected
01812     #~ if (contribution.length() - len > 0):
01813       #~ print "%sFound %d bytes after end of TEM %d contribution" % \
01814             #~ (prefix, contribution.length() - len, src)
01815
01816     #~ # Check for non-zero data indicating we got lost during parsing
01817     #~ # LATp cell padding is expected to always be zeros
01818     #~ buffer  = Numeric.fromstring(contribution.payload(), 'u')
01819
01820     #~ mbz = buffer[(self.errorEnd())/4-2:]
01821
01822     #~ for word in mbz:
01823       #~ if word != 0:
01824         #~ print "%sNon-zero bytes beyond end of TEM %d contribution: 0x%08x" % \
01825               #~ (prefix, src, word)
01826     #~ return 0
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GOSEDACDImpl.py Source File

gosed

GOSEDACDImpl.py

00001 # -*- coding: utf-8 -*-
00002 #!/usr/local/bin/python
00003 #
00004 #                               Copyright 2003
00005 #                                     by
00006 #                        The Board of Trustees of the
00007 #                     Leland Stanford Junior University.
00008 #                            All rights reserved.
00009 #
00010
00011 __facility__ = "Online"
00012 __abstract__ = "GLAST Online ACD Event Display"
00013 __author__   = "A. Kavelaars <aliciak@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = "12/12/2003"
00015 __version__  = "$Revision: 1.9 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019 import sys, string
00020 import operator, math
00021 from qt import *
00022 from GOSEDACD import ACDSingleEvtDisplay
00023 import colorScale
00024
00025 class ACDSingleEvtDisplayImpl(ACDSingleEvtDisplay):
00026
00027   def __init__(self, preferences, parent = None,name = None,fl = 0):
00028     ACDSingleEvtDisplay.__init__(self,parent,name,fl)
00029
00030     self.__preferences = preferences
00031
00032     self.rainbowScaleACD.setMinimumWidth(440)
00033     self.rainbowScaleACD.setMinimumHeight(15)
00034     self.rainbowScaleACD.setMaximumWidth(440)
00035     self.rainbowScaleACD.setMaximumHeight(15)
00036     self.rainbowScaleACD.setEnabled(0)
00037
00038     # ATK-051111: Implemeneted in GOSEDPainter instead.
00039     #~ self.rainbowPixmap = QPixmap(440, 15)
00040     #~ p = QPainter(self.rainbowPixmap)
00041
00042     #~ minV  = 1.0e-15
00043     #~ maxV  = 1.0 - minV
00044     #~ value = minV
00045
00046     # Divide length of the frame (400) in intervals of 1
00047     #~ dV = (maxV - minV) / float(self.rainbowScaleACD.width())
00048     #~ tileWidth  = 1
00049     #~ tileHeight = 15
00050     #~ for i in range(0, self.rainbowScaleACD.width()):
00051       #~ r, g, b = colorScale.colorScale(value)
00052       #~ p.setBrush(QColor(r, g, b))
00053       #~ p.setPen(QColor(r, g, b))
00054       #~ p.drawRect(i*tileWidth,                0,
00055                  #~ (i + 1)*tileWidth, tileHeight
00056                  #~ )
00057       #~ value += dV
00058
00059     self.relabel()
00060
00061     #~ self.paintBackground()
00062
00063   def relabel(self):
00064     minValue = self.__preferences.minACD()
00065     maxValue = self.__preferences.maxACD()
00066
00067     interval = (maxValue - minValue)/5
00068
00069     self.redLbl.setText(str(minValue))
00070     self.orangeLbl.setText(str(minValue + 1*interval))
00071     self.yellowLbl.setText(str(minValue + 2*interval))
00072     self.greenLbl.setText(str(minValue  + 3*interval))
00073     self.blueLbl.setText(str(minValue   + 4*interval))
00074     self.violetLbl.setText(str(maxValue))
00075
00076   # ATK-051111: Implemeneted in GOSEDPainter instead.
00077   #~ def paintEvent(self, pe):
00078     #~ """ Paint Event function for the rainbow scale
00079     #~ \param pe            paint event
00080     #~ """
00081
00082     #~ self.paintBackground()
00083
00084   #~ def paintBackground(self):
00085     #~ bitBlt(self.rainbowScaleACD, 0 , 0, self.rainbowPixmap, 0, 0)
00086
00087 if __name__ == "__main__":
00088   a = QApplication(sys.argv)
00089   QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00090   w = ACDSingleEvtDisplayImpl()
00091   a.setMainWidget(w)
00092   w.show()
00093   a.exec_loop()
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GOSEDCALImpl.py Source File

gosed

GOSEDCALImpl.py

00001 # -*- coding: utf-8 -*-
00002
00003 __version__  = "$Revision: 1.9 $"
00004
00005 import sys
00006 from qt import *
00007 from GOSEDCAL import GOSEDCALWindow
00008 import colorScale
00009
00010
00011 class GOSEDCALImpl(GOSEDCALWindow):
00012   def __init__(self, preferences, parent = None,name = None,fl = 0):
00013     GOSEDCALWindow.__init__(self,parent,name,fl)
00014
00015     self.__preferences = preferences
00016
00017     self.rainbowScaleCAL.setMinimumWidth(410)
00018     self.rainbowScaleCAL.setMinimumHeight(15)
00019     self.rainbowScaleCAL.setMaximumWidth(410)
00020     self.rainbowScaleCAL.setMaximumHeight(15)
00021     self.rainbowScaleCAL.setEnabled(0)
00022
00023     # ATK-051111: Implemeneted in GOSEDPainter instead.
00024     #~ self.rainbowPixmap = QPixmap(410, 15)
00025     #~ p = QPainter(self.rainbowPixmap)
00026
00027     #~ minV  = 1.0e-15
00028     #~ maxV  = 1.0 - minV
00029     #~ value = minV
00030
00031     # Divide length of the frame (400) in intervals of 1
00032     #~ dV = (maxV - minV) / float(self.rainbowScaleCAL.width())
00033     #~ tileWidth  = 1
00034     #~ tileHeight = 15
00035     #~ for i in range(0, self.rainbowScaleCAL.width()):
00036       #~ r, g, b = colorScale.colorScale(value)
00037       #~ p.setBrush(QColor(r, g, b))
00038       #~ p.setPen(QColor(r, g, b))
00039       #~ p.drawRect(i*tileWidth,                0,
00040                  #~ (i + 1)*tileWidth, tileHeight
00041                  #~ )
00042       #~ value += dV
00043
00044     self.relabel()
00045
00046     #~ self.paintBackground()
00047
00048   def relabel(self):
00049     minValue = self.__preferences.minCAL()
00050     maxValue = self.__preferences.maxCAL()
00051
00052     interval = (maxValue - minValue)/5
00053
00054     self.redLbl.setText(str(minValue))
00055     self.orangeLbl.setText(str(minValue + 1*interval))
00056     self.yellowLbl.setText(str(minValue + 2*interval))
00057     self.greenLbl.setText(str(minValue + 3*interval))
00058     self.blueLbl.setText(str(minValue + 4*interval))
00059     self.violetLbl.setText(str(maxValue))
00060
00061   # ATK-051111: Implemeneted in GOSEDPainter instead.
00062   #~ def paintEvent(self, pe):
00063     #~ """ Paint Event function for the rainbow scale
00064     #~ \param pe            paint event
00065     #~ """
00066
00067     #~ self.paintBackground()
00068
00069   #~ def paintBackground(self):
00070     #~ bitBlt(self.rainbowScaleCAL, 0 , 0, self.rainbowPixmap, 0, 0)
00071
00072
00073 if __name__ == "__main__":
00074   a = QApplication(sys.argv)
00075   QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00076   w = GOSEDCALImpl()
00077   a.setMainWidget(w)
00078   w.show()
00079   a.exec_loop()
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GOSEDCALTKRImpl.py Source File

gosed

GOSEDCALTKRImpl.py

00001 # -*- coding: utf-8 -*-
00002
00003 __version__  = "$Revision: 1.11 $"
00004
00005 import sys
00006 from qt import *
00007 from GOSEDCALTKR import GOSEDCALTKRWindow
00008 import colorScale
00009
00010
00011 class GOSEDCALTKRImpl(GOSEDCALTKRWindow):
00012
00013   def __init__(self, preferences, parent,name = None,fl = 0):
00014     GOSEDCALTKRWindow.__init__(self,parent,name,fl)
00015
00016     self.__preferences = preferences
00017
00018     self.rainbowScaleCAL.setMinimumWidth(410)
00019     self.rainbowScaleCAL.setMinimumHeight(15)
00020     self.rainbowScaleCAL.setMaximumWidth(410)
00021     self.rainbowScaleCAL.setMaximumHeight(15)
00022     self.rainbowScaleCAL.setEnabled(0)
00023
00024     # ATK-051111: Implemeneted in GOSEDPainter instead.
00025     #~ self.rainbowPixmap = QPixmap(410, 15)
00026     #~ p = QPainter(self.rainbowPixmap)
00027
00028     #~ minV  = 1.0e-15
00029     #~ maxV  = 1.0 - minV
00030     #~ value = minV
00031
00032     # Divide length of the frame (400) in intervals of 1
00033     #~ dV = (maxV - minV) / float(self.rainbowScaleCAL.width())
00034     #~ tileWidth  = 1
00035     #~ tileHeight = 15
00036     #~ for i in range(0, self.rainbowScaleCAL.width()):
00037       #~ r, g, b = colorScale.colorScale(value)
00038       #~ p.setBrush(QColor(r, g, b))
00039       #~ p.setPen(QColor(r, g, b))
00040       #~ p.drawRect(i*tileWidth,                0,
00041                  #~ (i + 1)*tileWidth, tileHeight
00042                  #~ )
00043       #~ value += dV
00044
00045     self.relabel()
00046
00047     #~ self.paintBackground()
00048
00049   def relabel(self):
00050     minValue = self.__preferences.minCAL2()
00051     maxValue = self.__preferences.maxCAL2()
00052
00053     interval = (maxValue - minValue)/5
00054
00055     self.redLbl.setText(str(minValue))
00056     self.orangeLbl.setText(str(minValue + 1*interval))
00057     self.yellowLbl.setText(str(minValue + 2*interval))
00058     self.greenLbl.setText(str(minValue + 3*interval))
00059     self.blueLbl.setText(str(minValue + 4*interval))
00060     self.violetLbl.setText(str(maxValue))
00061
00062   # ATK-051111: Implemeneted in GOSEDPainter instead.
00063   #~ def paintEvent(self, pe):
00064     #~ """ Paint Event function for the rainbow scale
00065     #~ \param pe            paint event
00066     #~ """
00067
00068     #~ self.paintBackground()
00069
00070   #~ def paintBackground(self):
00071     #~ bitBlt(self.rainbowScaleCAL, 0, 0, self.rainbowPixmap, 0, 0)
00072
00073
00074 if __name__ == "__main__":
00075   a = QApplication(sys.argv)
00076   QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00077   w = GOSEDCALTKRImpl()
00078   a.setMainWidget(w)
00079   w.show()
00080   a.exec_loop()
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GOSEDDataImpl.py Source File

gosed

GOSEDDataImpl.py

00001 # -*- coding: utf-8 -*-
00002 #!/usr/local/bin/python
00003 #
00004 #                               Copyright 2003
00005 #                                     by
00006 #                        The Board of Trustees of the
00007 #                     Leland Stanford Junior University.
00008 #                            All rights reserved.
00009 #
00010
00011 __facility__ = "Online"
00012 __abstract__ = "GLAST Online ACD Event Display"
00013 __author__   = "A. Kavelaars <aliciak@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = "12/12/2003"
00015 __version__  = "$Revision: 1.10 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019 import sys, string
00020 import operator, math
00021 from qt import *
00022 from GOSEDData import GOSEDDataWindow
00023
00024
00025 class GOSEDDataImpl(GOSEDDataWindow):
00026
00027   def __init__(self, gui, parent = None,name = None,fl = 0):
00028     GOSEDDataWindow.__init__(self,parent,name,fl)
00029
00030     self.__gui = gui
00031
00032     #~ self.formatCALview()
00033     #~ self.formatTKRview()
00034     #~ self.formatDiagCALview()
00035     #~ self.formatDiagTKRview()
00036
00037   def formatCALview(self):
00038     CALheader = self.CALview.header()
00039
00040     self.CALview.setColumnWidth(0,40)
00041     self.CALview.setColumnWidth(1,40)
00042     self.CALview.setColumnWidth(2,40)
00043     self.CALview.setColumnWidth(3,50)
00044     self.CALview.setColumnWidth(4,50)
00045     self.CALview.setColumnWidth(5,60)
00046     self.CALview.setColumnWidth(6,50)
00047     self.CALview.setColumnWidth(7,60)
00048     self.CALview.setColumnWidth(8,40)
00049     self.CALview.setColumnWidth(9,40)
00050
00051
00052   def formatTKRview(self):
00053     TKRheader = self.TKRview.header()
00054
00055     self.TKRview.setColumnWidth(0,40)
00056     self.TKRview.setColumnWidth(1,35)
00057     self.TKRview.setColumnWidth(2,60)
00058     self.TKRview.setColumnWidth(3,50)
00059     self.TKRview.setColumnWidth(4,50)
00060     self.TKRview.setColumnWidth(5,50)
00061     self.TKRview.setColumnWidth(6,50)
00062     self.TKRview.setColumnWidth(7,50)
00063
00064   def formatDiagCALview(self):
00065     CALheader = self.diagCAL.header()
00066
00067     #~ CALheader.setFixedHeight(35)
00068     CALheader.setLabel(0, "GCCC")
00069     CALheader.setLabel(1, "Layer")
00070     CALheader.setLabel(2, "Negative Log Accepts")
00071     CALheader.setLabel(3, "Layer End High")
00072     CALheader.setLabel(4, "Layer End Low")
00073     CALheader.setLabel(5, "Positive Log Accepts")
00074     CALheader.setLabel(6, "Layer End High")
00075     CALheader.setLabel(7, "Layer End Low")
00076
00077     self.diagCAL.setColumnWidth(0,40)
00078     self.diagCAL.setColumnWidth(1,45)
00079     self.diagCAL.setColumnWidth(2,90)
00080     self.diagCAL.setColumnWidth(3,75)
00081     self.diagCAL.setColumnWidth(4,75)
00082     self.diagCAL.setColumnWidth(5,90)
00083     self.diagCAL.setColumnWidth(6,75)
00084     self.diagCAL.setColumnWidth(7,75)
00085
00086   def formatDiagTKRview(self):
00087     TKRheader = self.diagTKR.header()
00088     #~ TKRheader.setFixedHeight(35)
00089     TKRheader.setLabel(0, "GTCC")
00090     TKRheader.setLabel(1, "Trigger Request GTRC")
00091     #~ self.diagTKR.setColumnWidth(0,60)
00092     #~ self.diagTKR.setColumnWidth(1,90)
00093
00094   def showEvent(self, se):
00095     self.__gui.replot()
00096
00097
00098 if __name__ == "__main__":
00099   a = QApplication(sys.argv)
00100   QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00101   w = GOSEDDataImpl()
00102   a.setMainWidget(w)
00103   w.show()
00104   a.exec_loop()
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gosedImpl.py Source File

gosed

gosedImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST Online Single Event Display Modular"
00012 __author__   = "A. Kavelaars <aliciak@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "11/20/2003"
00014 __version__  = "$Revision: 1.32 $"
00015 __credits__  = "SLAC"
00016
00017
00018 import LATTE.copyright_SLAC
00019 from   qt                    import *
00020 import sys
00021 import struct
00022
00023 from   gosed                 import singleEvtDisplay
00024 from   ServerPreferencesImpl import ServerPreferencesImpl
00025 from   GOSEDPreferencesImpl  import GOSEDPreferencesImpl
00026 from   GOSEDReadme           import GOSEDReadme
00027
00028 import GOSEDACDImpl
00029 import GOSEDTWRImpl
00030 import GOSEDCALImpl
00031 import GOSEDTKRImpl
00032 import GOSEDCALTKRImpl
00033 import GOSEDDataImpl
00034 import GOSEDPainter
00035 import GOTEDImpl
00036 import GOSED_LDF
00037 import LDF
00038 import logging                as     myLog
00039 #~ import DataDistributorPoll as DDP
00040 #~ from   LATTE.client.gBits    import hexConvert
00041
00042 import atexit
00043
00044
00045 class singleEvtDisplayImpl(singleEvtDisplay):
00046   """ \brief Glast Online Single Event Display (GOSED)
00047
00048   This class:
00049   1. Manages all the GUI functions for GOSED.
00050   2. Retreives the TKR and CAL projections' pixmaps from GOSEDPainter.
00051   3. Loads all the information from the current event processed by GOSED_LDF,
00052   """
00053
00054   def __init__(self,filename = None,parent = None,name = None,fl = 0):
00055     """ singleEvtDisplayImpl contructor
00056
00057     \param filename      None
00058     \param parent        None
00059     \param name          None
00060     \param fl            0
00061     """
00062
00063     # Initialize variables
00064     singleEvtDisplay.__init__(self,parent,name,fl)
00065     self.flagDisabledPixmap = self.image4
00066     self.flagEnabledPixmap  = self.image3
00067     self.stopPixmap         = self.image7
00068     self.goPixmap           = self.image8
00069
00070     # Initialize variables
00071     self.__fn      = filename
00072     self.__ds      = None
00073     self.__file    = None
00074     self.__fits    = None
00075     self.__data    = None
00076     self.__evtList = []
00077
00078     self.__lci     = GOSED_LDF.myLATcomponentIterator(self)
00079     self.__ldbi    = LDF.LATdataBufferIterator(self.__lci)
00080
00081     # Set default led flags
00082     #~ self.errorFlag.setPixmap(self.flagDisabledPixmap)
00083     #~ self.diagnosticFlag.setPixmap(self.flagDisabledPixmap)
00084
00085     # Initialize Preferences windows
00086     import ConfigParser                 # Triage...
00087     self.__confParser = ConfigParser.ConfigParser() # Should have 1 Prefs GUI
00088     self.ServerPreferencesGUI = ServerPreferencesImpl(self.__confParser, self)
00089     self.GOSEDPreferencesGUI  = GOSEDPreferencesImpl(self.__confParser, self)
00090
00091     #~ if self.GOSEDPreferencesGUI.EventlimitsButton.isChecked():
00092       #~ self.preferredLimits = "Event"
00093     if self.GOSEDPreferencesGUI.CustomlimitsButton.isChecked():
00094       self.preferredLimits = "Custom"
00095     else:# self.GOSEDPreferencesGUI.CALlimitsButton.isChecked():
00096       self.preferredLimits = "Default"
00097
00098     if self.GOSEDPreferencesGUI.CustomlimitsButton2.isChecked():
00099       self.preferredLimits2 = "Custom"
00100     else:
00101       self.preferredLimits2 = "Default"
00102
00103     # Create dock windows
00104     self.createDockWindows()
00105
00106     prefs = self.GOSEDPreferencesGUI
00107
00108     # Create Painters
00109     self.drawGOSEDACD = GOSEDACDImpl.ACDSingleEvtDisplayImpl(prefs, self.__dwGOSEDACD)
00110     self.__dwGOSEDACD.setWidget(self.drawGOSEDACD)
00111
00112     self.drawGOSEDCAL = GOSEDCALImpl.GOSEDCALImpl(prefs, self.__dwGOSEDCAL)
00113     self.__dwGOSEDCAL.setWidget(self.drawGOSEDCAL)
00114
00115     self.drawGOSEDTKR = GOSEDTKRImpl.GOSEDTKRImpl(self.__dwGOSEDTKR)
00116     self.__dwGOSEDTKR.setWidget(self.drawGOSEDTKR)
00117
00118     self.drawGOSEDTWR = GOSEDTWRImpl.GOSEDTWRImpl(self.__dwGOSEDTWR)
00119     self.__dwGOSEDTWR.setWidget(self.drawGOSEDTWR)
00120
00121     self.drawGOSEDCALTKR = GOSEDCALTKRImpl.GOSEDCALTKRImpl(prefs, self.__dwGOSEDCALTKR)
00122     self.__dwGOSEDCALTKR.setWidget(self.drawGOSEDCALTKR)
00123
00124     self.drawGOSEDData = GOSEDDataImpl.GOSEDDataImpl(self, self.__dwGOSEDData)
00125     self.__dwGOSEDData.setWidget(self.drawGOSEDData)
00126
00127     self.drawGOTED = GOTEDImpl.towerEvtDisplayImpl(self.__dwGOTED)
00128     self.__dwGOTED.setWidget(self.drawGOTED)
00129
00130     # Add default setup Dock Windows ATK-060904 -- WORK THIS OUT!!
00131     self.addDockWindow(self.__dwGOSEDTWR , Qt.DockLeft, True)
00132     if not self.GOSEDPreferencesGUI.twr():  self.__dwGOSEDTWR.hide()
00133
00134     self.addDockWindow(self.__dwGOSEDCALTKR , Qt.DockLeft, False)
00135     if not self.GOSEDPreferencesGUI.calTkr():  self.__dwGOSEDCALTKR.hide()
00136
00137     self.addDockWindow(self.__dwGOSEDData, Qt.DockRight, False)
00138     if not self.GOSEDPreferencesGUI.data():  self.__dwGOSEDData.hide()
00139
00140     self.addDockWindow(self.__dwGOSEDTKR , Qt.DockLeft, False)
00141     if not self.GOSEDPreferencesGUI.tkr():  self.__dwGOSEDTKR.hide()
00142
00143     self.addDockWindow(self.__dwGOSEDACD , Qt.DockRight, True)
00144     if not self.GOSEDPreferencesGUI.acd():  self.__dwGOSEDACD.hide()
00145
00146     self.addDockWindow(self.__dwGOSEDCAL,  Qt.DockRight,  False)
00147     if not self.GOSEDPreferencesGUI.cal():  self.__dwGOSEDCAL.hide()
00148
00149     self.addDockWindow(self.__dwGOTED,  Qt.DockRight,  True)
00150     if not self.GOSEDPreferencesGUI.ted():  self.__dwGOTED.hide()
00151
00152     # Custom Widgets setup
00153     self.setFocusPolicy(QWidget.StrongFocus)
00154
00155     # TKR and CAL
00156     self.xzTKR = self.drawGOSEDTKR.xzTKR
00157     self.yzTKR = self.drawGOSEDTKR.yzTKR
00158     self.xzCAL = self.drawGOSEDCAL.xzCAL
00159     self.yzCAL = self.drawGOSEDCAL.yzCAL
00160     self.rainbowCAL = self.drawGOSEDCAL.rainbowScaleCAL
00161
00162     xzTKRLayout = QGridLayout(self.xzTKR,0,0,0,-1,"gosedLayout")
00163     yzTKRLayout = QGridLayout(self.yzTKR,0,0,0,-1,"gosedLayout")
00164     xzCALLayout = QGridLayout(self.xzCAL,0,0,0,-1,"gosedLayout")
00165     yzCALLayout = QGridLayout(self.yzCAL,0,0,0,-1,"gosedLayout")
00166     rainbowCALLayout = QGridLayout(self.rainbowCAL,0,0,0,-1,"gosedLayout")
00167
00168     self.drawXZ_TKR = GOSEDPainter.drawXZ_TKR(self, self.xzTKR)
00169     self.drawYZ_TKR = GOSEDPainter.drawYZ_TKR(self, self.yzTKR)
00170     self.drawXZ_CAL = GOSEDPainter.drawXZ_CAL(self, self.xzCAL)
00171     self.drawYZ_CAL = GOSEDPainter.drawYZ_CAL(self, self.yzCAL)
00172     self.drawRainbowCAL = GOSEDPainter.drawRainbowCAL(self, self.rainbowCAL)
00173
00174     xzTKRLayout.addWidget(self.drawXZ_TKR,0,0)
00175     yzTKRLayout.addWidget(self.drawYZ_TKR,0,0)
00176     xzCALLayout.addWidget(self.drawXZ_CAL,0,0)
00177     yzCALLayout.addWidget(self.drawYZ_CAL,0,0)
00178     rainbowCALLayout.addWidget(self.drawRainbowCAL,0,0)
00179
00180     self.xzTKR2 = self.drawGOSEDCALTKR.xzTKR
00181     self.yzTKR2 = self.drawGOSEDCALTKR.yzTKR
00182     self.xzCAL2 = self.drawGOSEDCALTKR.xzCAL
00183     self.yzCAL2 = self.drawGOSEDCALTKR.yzCAL
00184     self.rainbowCAL2 = self.drawGOSEDCALTKR.rainbowScaleCAL
00185
00186     xzTKRLayout2 = QGridLayout(self.xzTKR2,0,0,0,-1,"gosedLayout")
00187     yzTKRLayout2 = QGridLayout(self.yzTKR2,0,0,0,-1,"gosedLayout")
00188     xzCALLayout2 = QGridLayout(self.xzCAL2,0,0,0,-1,"gosedLayout")
00189     yzCALLayout2 = QGridLayout(self.yzCAL2,0,0,0,-1,"gosedLayout")
00190     rainbowCALLayout2 = QGridLayout(self.rainbowCAL2,0,0,0,-1,"gosedLayout")
00191
00192     self.drawXZ_TKR2 = GOSEDPainter.drawXZ_TKR(self, self.xzTKR2)
00193     self.drawYZ_TKR2 = GOSEDPainter.drawYZ_TKR(self, self.yzTKR2)
00194     self.drawXZ_CAL2 = GOSEDPainter.drawXZ_CAL(self, self.xzCAL2)
00195     self.drawYZ_CAL2 = GOSEDPainter.drawYZ_CAL(self, self.yzCAL2)
00196     self.drawRainbowCAL2 = GOSEDPainter.drawRainbowCAL(self, self.rainbowCAL2)
00197
00198     xzTKRLayout2.addWidget(self.drawXZ_TKR2,0,0)
00199     yzTKRLayout2.addWidget(self.drawYZ_TKR2,0,0)
00200     xzCALLayout2.addWidget(self.drawXZ_CAL2,0,0)
00201     yzCALLayout2.addWidget(self.drawYZ_CAL2,0,0)
00202     rainbowCALLayout2.addWidget(self.drawRainbowCAL2,0,0)
00203
00204     # ACD
00205     self.side1ACD = self.drawGOSEDACD.side1ACD
00206     self.side2ACD = self.drawGOSEDACD.side2ACD
00207     self.side3ACD = self.drawGOSEDACD.side3ACD
00208     self.side4ACD = self.drawGOSEDACD.side4ACD
00209     self.hatACD = self.drawGOSEDACD.hatACD
00210     self.rainbowACD = self.drawGOSEDACD.rainbowScaleACD
00211
00212     #hatWidth    = self.hatACD.width()
00213     #hatHeight   = self.hatACD.height()
00214     #side1Width  = self.side1ACD.width()
00215     #side1Height = self.side1ACD.height()
00216
00217     side1ACDLayout = QGridLayout(self.side1ACD,0,0,0,-1,"gosedLayout")
00218     self.side1ACDLayout = side1ACDLayout
00219     side2ACDLayout = QGridLayout(self.side2ACD,0,0,0,-1,"gosedLayout")
00220     side3ACDLayout = QGridLayout(self.side3ACD,0,0,0,-1,"gosedLayout")
00221     side4ACDLayout = QGridLayout(self.side4ACD,0,0,0,-1,"gosedLayout")
00222     hatACDLayout = QGridLayout(self.hatACD,0,0,0,-1,"gosedLayout")
00223     rainbowACDLayout = QGridLayout(self.rainbowACD,0,0,0,-1,"gosedLayout")
00224
00225     self.drawSide1ACD = GOSEDPainter.drawSide1ACD(self, self.side1ACD)
00226     self.drawSide2ACD = GOSEDPainter.drawSide2ACD(self, self.side2ACD)
00227     self.drawSide3ACD = GOSEDPainter.drawSide3ACD(self, self.side3ACD)
00228     self.drawSide4ACD = GOSEDPainter.drawSide4ACD(self, self.side4ACD)
00229     self.drawHatACD = GOSEDPainter.drawHatACD(self, self.hatACD)
00230     self.drawRainbowACD = GOSEDPainter.drawRainbowACD(self, self.rainbowACD)
00231
00232     #~ self.drawSide1ACD.setGeometry(0,0,hatWidth,side1Height)
00233     side1ACDLayout.addWidget(self.drawSide1ACD,0,0)
00234     side2ACDLayout.addWidget(self.drawSide2ACD,0,0)
00235     side3ACDLayout.addWidget(self.drawSide3ACD,0,0)
00236     side4ACDLayout.addWidget(self.drawSide4ACD,0,0)
00237     hatACDLayout.addWidget(self.drawHatACD,0,0)
00238     rainbowACDLayout.addWidget(self.drawRainbowACD,0,0)
00239
00240     # Buttons setup
00241     self.clearViews()
00242     self.clearButtonGroups()
00243
00244     self.Go.setEnabled(0)
00245     self.Next.setEnabled(0)
00246     self.Previous.setEnabled(0)
00247     self.Stop.setEnabled(0)
00248     self.SkipValue.setEnabled(0)
00249     self.Skip.setEnabled(0)
00250
00251     self.drawGOSEDTWR.selectTWR.setEnabled(0)
00252     #~ self.drawGOSEDCAL.selectRNG.setEnabled(0)
00253     self.drawGOSEDCAL.RNGAll.setEnabled(0)
00254     #~ self.drawGOSEDCALTKR.selectRNG.setEnabled(0)
00255     self.drawGOSEDCALTKR.RNGAll.setEnabled(0)
00256
00257     for i in range(16):
00258       self.drawGOTED.towerList[i].setEnabled(1)
00259
00260     # Initialize timer
00261     self.__timer = QTimer(self)
00262
00263     # Connections
00264     self.connect(self.__timer, SIGNAL("timeout()"), self.nextClicked)
00265     #~ self.connect(self.__timer, SIGNAL("timeout()"), self.next)
00266     self.connect(self.drawGOSEDTWR.selectTWR,         SIGNAL('clicked(int)'),   self.selectChange)
00267     self.connect(self.drawGOSEDCAL.scaleSelection,    SIGNAL('activated(int)'), self.scaleChange)
00268     self.connect(self.drawGOSEDCALTKR.scaleSelection, SIGNAL('activated(int)'), self.scaleChange2)
00269     self.connect(self.drawGOSEDCAL.selectRNG,         SIGNAL('clicked(int)'),   self.rangeChange)
00270     self.connect(self.drawGOSEDCALTKR.selectRNG,      SIGNAL('clicked(int)'),   self.rangeChange2)
00271     self.connect(self.drawGOTED.refreshButton,        SIGNAL('clicked()'),      self.selectChange)
00272     self.connect(self.drawGOSEDCAL.accessGOSEDPreferences,
00273                  SIGNAL('clicked()'), self.GOSEDPreferences)
00274     self.connect(self.drawGOSEDCALTKR.accessGOSEDPreferences,
00275                  SIGNAL('clicked()'), self.GOSEDPreferences)
00276     self.connect(self.__dwGOSEDTWR,    SIGNAL('visibilityChanged ( bool ) '), self.updateDockGOSEDTWR)
00277     self.connect(self.__dwGOSEDTKR,    SIGNAL('visibilityChanged ( bool ) '), self.updateDockGOSEDTKR)
00278     self.connect(self.__dwGOSEDCAL,    SIGNAL('visibilityChanged ( bool ) '), self.updateDockGOSEDCAL)
00279     self.connect(self.__dwGOSEDCALTKR, SIGNAL('visibilityChanged ( bool ) '), self.updateDockGOSEDCALTKR)
00280     self.connect(self.__dwGOSEDData,   SIGNAL('visibilityChanged ( bool ) '), self.updateDockGOSEDData)
00281     self.connect(self.__dwGOTED,       SIGNAL('visibilityChanged ( bool ) '), self.updateDockGOTED)
00282     self.connect(self.__dwGOSEDACD,    SIGNAL('visibilityChanged ( bool ) '), self.updateDockGOSEDACD)
00283
00284     self.connect(self.toolsPrintCALTKRAction, SIGNAL('activated()'),      self.printCALTKR)
00285     self.connect(self.toolsPrintACDAction,    SIGNAL('activated()'),      self.printACD)
00286
00287     atexit.register(self.fileExit)
00288
00289   def printCALTKR(self):
00290     XZ_TKR = QPixmap().grabWidget(self.drawXZ_TKR2)
00291     YZ_TKR = QPixmap().grabWidget(self.drawYZ_TKR2)
00292     XZ_CAL = QPixmap().grabWidget(self.drawXZ_CAL2)
00293     YZ_CAL = QPixmap().grabWidget(self.drawYZ_CAL2)
00294     redLbl = str(self.drawGOSEDACD.redLbl.text())
00295     orangeLbl = str(self.drawGOSEDCALTKR.orangeLbl.text())
00296     yellowLbl = str(self.drawGOSEDCALTKR.yellowLbl.text())
00297     greenLbl = str(self.drawGOSEDCALTKR.greenLbl.text())
00298     blueLbl = str(self.drawGOSEDCALTKR.blueLbl.text())
00299     violetLbl = str(self.drawGOSEDCALTKR.violetLbl.text())
00300     self.printer = QPrinter()
00301     self.printer.setup(self)
00302     self.printer.setOrientation(QPrinter.Landscape)
00303     p = QPainter()
00304     p.begin(self.printer)
00305     p.drawRect(250,50,560,690)
00306     p.drawRect(280,550,490,70)
00307     p.drawPixmap(360, 150, XZ_TKR, 0, 0, -1, -1)
00308     p.drawPixmap(540, 150, YZ_TKR, 0, 0, -1, -1)
00309     p.drawPixmap(360, 415, XZ_CAL, 0, 0, -1, -1)
00310     p.drawPixmap(540, 415, YZ_CAL, 0, 0, -1, -1)
00311     p.drawPixmap(320, 570, self.drawGOSEDCALTKR.rainbowPixmap, 0, 0, -1, -1)
00312     p.drawText(320, 600, redLbl)
00313     p.drawText(381, 600, orangeLbl)
00314     p.drawText(462, 600, yellowLbl)
00315     p.drawText(543, 600, greenLbl)
00316     p.drawText(624, 600, blueLbl)
00317     p.drawText(705, 600, violetLbl)
00318     filename = "File: " + str(self.drawGOSEDData.filename.text())
00319     timeStamp = "Timestamp: " + str(self.drawGOSEDData.timeStamp.text())
00320     event = "Event Seq.#:" + str(self.drawGOSEDData.eventNumber.text())
00321     eventTag = "Event Tag: " + str(self.drawGOSEDData.eventTag.text())
00322     flags = str(self.drawGOSEDData.flagLine.text())
00323     p.drawText(300, 645, filename)
00324     p.drawText(300, 665, timeStamp)
00325     p.drawText(300, 685, event)
00326     p.drawText(300, 705, eventTag)
00327     p.drawText(300, 725, flags)
00328     self.headerFont = QFont()
00329     self.headerFont.setFamily("Arial")
00330     self.headerFont.setPointSize(12)
00331     self.headerFont.setBold(1)
00332     p.setFont(self.headerFont)
00333     p.drawText(300, 100, "GLAST ONLINE SINGLE EVENT DISPLAY - GOSED CAL & TKR")
00334     p.end()
00335
00336   def printACD(self):
00337     side1ACD = QPixmap().grabWidget(self.drawSide1ACD)
00338     side2ACD = QPixmap().grabWidget(self.drawSide2ACD)
00339     side3ACD = QPixmap().grabWidget(self.drawSide3ACD)
00340     side4ACD = QPixmap().grabWidget(self.drawSide4ACD)
00341     hatACD = QPixmap().grabWidget(self.drawHatACD)
00342     redLbl = str(self.drawGOSEDACD.redLbl.text())
00343     orangeLbl = str(self.drawGOSEDACD.orangeLbl.text())
00344     yellowLbl = str(self.drawGOSEDACD.yellowLbl.text())
00345     greenLbl = str(self.drawGOSEDACD.greenLbl.text())
00346     blueLbl = str(self.drawGOSEDACD.blueLbl.text())
00347     violetLbl = str(self.drawGOSEDACD.violetLbl.text())
00348     self.printer = QPrinter()
00349     self.printer.setup(self)
00350     self.printer.setOrientation(QPrinter.Landscape)
00351     p = QPainter()
00352     p.begin(self.printer)
00353     p.drawRect(250,50,560,690)
00354     p.drawRect(280,560,480,70)
00355     p.drawPixmap(400, 460, side1ACD, 0, 0, -1, -1)
00356     p.drawPixmap(660, 200, side2ACD, 0, 0, -1, -1)
00357     p.drawPixmap(400, 100, side3ACD, 0, 0, -1, -1)
00358     p.drawPixmap(300, 200, side4ACD, 0, 0, -1, -1)
00359     p.drawPixmap(400, 200, hatACD, 0, 0, -1, -1)
00360     p.drawPixmap(300, 580, self.drawGOSEDACD.rainbowPixmap, 0, 0, -1, -1)
00361     p.drawText(300, 610, redLbl)
00362     p.drawText(383, 610, orangeLbl)
00363     p.drawText(466, 610, yellowLbl)
00364     p.drawText(549, 610, greenLbl)
00365     p.drawText(632, 610, blueLbl)
00366     p.drawText(715, 610, violetLbl)
00367     filename = "File: " + str(self.drawGOSEDData.filename.text())
00368     timeStamp = "Timestamp: " + str(self.drawGOSEDData.timeStamp.text())
00369     event = "Event Seq.#:" + str(self.drawGOSEDData.eventNumber.text())
00370     eventTag = "Event Tag: " + str(self.drawGOSEDData.eventTag.text())
00371     flags = str(self.drawGOSEDData.flagLine.text())
00372     p.drawText(300, 650, filename)
00373     p.drawText(300, 670, timeStamp)
00374     p.drawText(300, 690, event)
00375     p.drawText(300, 710, eventTag)
00376     p.drawText(300, 730, flags)
00377     self.headerFont = QFont()
00378     self.headerFont.setFamily("Arial")
00379     self.headerFont.setPointSize(12)
00380     self.headerFont.setBold(1)
00381     p.setFont(self.headerFont)
00382     p.drawText(300, 80, "GLAST ONLINE SINGLE EVENT DISPLAY - GOSED ACD")
00383     p.end()
00384
00385   def createDockWindows(self):
00386     # Create Dock for GLAST Online Single Event Display TWR Window (GOSEDTWR)
00387     self.__dwGOSEDTWR = QDockWindow()
00388     self.__dwGOSEDTWR.setResizeEnabled(0)
00389     self.__dwGOSEDTWR.setCloseMode(QDockWindow.Always)
00390     self.__dwGOSEDTWR.setCaption('GOSED TWR Display')
00391     #~ self.__teComments = self.__comments.getWidget()
00392     #~ self.__dwGOSEDTWR.setFixedExtentWidth(428)
00393     #~ self.__dwGOSEDTWR.setFixedExtentHeight(315)
00394
00395     # Create Dock for GLAST Online Single Event Display TKR Window (GOSEDTKR)
00396     self.__dwGOSEDTKR = QDockWindow()
00397     self.__dwGOSEDTKR.setResizeEnabled(0)
00398     self.__dwGOSEDTKR.setCloseMode(QDockWindow.Always)
00399     self.__dwGOSEDTKR.setCaption('GOSED TKR Display')
00400     #~ self.__teComments = self.__comments.getWidget()
00401     self.__dwGOSEDTKR.setFixedExtentWidth(428)
00402     self.__dwGOSEDTKR.setFixedExtentHeight(315)
00403
00404     # Create Dock for GLAST Online Single Event Display CAL Window (GOSEDCAL)
00405     self.__dwGOSEDCAL = QDockWindow()
00406     self.__dwGOSEDCAL.setResizeEnabled(0)
00407     self.__dwGOSEDCAL.setCloseMode(QDockWindow.Always)
00408     self.__dwGOSEDCAL.setCaption('GOSED CAL Display')
00409     #~ self.__teComments = self.__comments.getWidget()
00410     self.__dwGOSEDCAL.setFixedExtentWidth(428)
00411     self.__dwGOSEDCAL.setFixedExtentHeight(115)
00412
00413     # Create Dock for GLAST Online Single Event Display CAL & TKR Window (GOSEDCAL)
00414     self.__dwGOSEDCALTKR = QDockWindow()
00415     self.__dwGOSEDCALTKR.setResizeEnabled(0)
00416     self.__dwGOSEDCALTKR.setCloseMode(QDockWindow.Always)
00417     self.__dwGOSEDCALTKR.setCaption('GOSED CAL & TKR Display')
00418     #~ self.__teComments = self.__comments.getWidget()
00419     #~ self.__dwGOSEDCALTKR.setFixedExtentWidth(428)
00420     #~ self.__dwGOSEDCALTKR.setFixedExtentHeight(115)
00421
00422     # Create Dock for GLAST Online ACD Event Display (GOSEDACD)
00423     self.__dwGOSEDACD = QDockWindow()
00424     self.__dwGOSEDACD.setResizeEnabled(0)
00425     self.__dwGOSEDACD.setCloseMode(QDockWindow.Always)
00426     self.__dwGOSEDACD.setCaption('GOSED ACD Display')
00427     self.__dwGOSEDACD.setNewLine(True)
00428     #~ self.__teComments = self.__comments.getWidget()
00429     self.__dwGOSEDACD.setFixedExtentWidth(428)
00430     self.__dwGOSEDACD.setFixedExtentHeight(428)
00431
00432     # Create Dock for GLAST Online Single Event Display Data Window(GOSED Data)
00433     self.__dwGOSEDData = QDockWindow()
00434     self.__dwGOSEDData.setResizeEnabled(1)
00435     self.__dwGOSEDData.setCloseMode(QDockWindow.Always)
00436     self.__dwGOSEDData.setCaption('GOSED Data Window')
00437     self.__dwGOSEDData.setNewLine(True)
00438     #~ self.__teComments = self.__comments.getWidget()
00439     self.__dwGOSEDData.setFixedExtentWidth(435)
00440     self.__dwGOSEDData.setFixedExtentHeight(100)
00441
00442     # Create Dock for GLAST Online Tower Event Display (GOTED)
00443     self.__dwGOTED = QDockWindow()
00444     self.__dwGOTED.setResizeEnabled(1)
00445     self.__dwGOTED.setCloseMode(QDockWindow.Always)
00446     self.__dwGOTED.setCaption('GOTED Display')
00447     #~ self.__teComments = self.__comments.getWidget()
00448     self.__dwGOTED.setFixedExtentWidth(50)
00449     self.__dwGOTED.setFixedExtentHeight(50)
00450
00451   def dockGOSEDTWR(self):
00452     self.__dwGOSEDTWR.show()
00453     self.GOSEDPreferencesGUI.twr(True)
00454     self.__shown()
00455
00456   def dockGOSEDTKR(self):
00457     self.__dwGOSEDTKR.show()
00458     self.GOSEDPreferencesGUI.tkr(True)
00459     self.__shown()
00460
00461   def dockGOSEDCAL(self):
00462     self.__dwGOSEDCAL.show()
00463     self.GOSEDPreferencesGUI.cal(True)
00464     self.__shown()
00465
00466   def dockGOSEDCALTKR(self):
00467     self.__dwGOSEDCALTKR.show()
00468     self.GOSEDPreferencesGUI.calTkr(True)
00469     self.__shown()
00470
00471   def dockGOSEDData(self):
00472     self.__dwGOSEDData.show()
00473     self.GOSEDPreferencesGUI.data(True)
00474     self.__shown()
00475
00476   def dockGOTED(self):
00477     self.__dwGOTED.show()
00478     self.GOSEDPreferencesGUI.ted(True)
00479     self.__shown()
00480
00481   def dockGOSEDACD(self):
00482     self.__dwGOSEDACD.show()
00483     self.GOSEDPreferencesGUI.acd(True)
00484     self.__shown()
00485
00486   def updateDockGOSEDTWR(self):
00487     if not self.__dwGOSEDTWR.isVisible():
00488       self.GOSEDPreferencesGUI.twr(False)
00489       self.__shown()
00490
00491   def updateDockGOSEDTKR(self):
00492     if not self.__dwGOSEDTKR.isVisible():
00493       self.GOSEDPreferencesGUI.tkr(False)
00494       self.__shown()
00495
00496   def updateDockGOSEDCAL(self):
00497     if not self.__dwGOSEDCAL.isVisible():
00498       self.GOSEDPreferencesGUI.cal(False)
00499       self.__shown()
00500
00501   def updateDockGOSEDCALTKR(self):
00502     if not self.__dwGOSEDCALTKR.isVisible():
00503       self.GOSEDPreferencesGUI.calTkr(False)
00504       self.__shown()
00505
00506   def updateDockGOSEDData(self):
00507     if not self.__dwGOSEDData.isVisible():
00508       self.GOSEDPreferencesGUI.data(False)
00509       self.__shown()
00510
00511   def updateDockGOTED(self):
00512     if not self.__dwGOTED.isVisible():
00513       self.GOSEDPreferencesGUI.ted(False)
00514       self.__shown()
00515
00516   def updateDockGOSEDACD(self):
00517     if not self.__dwGOSEDACD.isVisible():
00518       self.GOSEDPreferencesGUI.acd(False)
00519       self.__shown()
00520
00521   def mousePressEvent(self, e):
00522     for i in range(16):
00523       if self.drawGOTED.towerList[i].hasMouse():
00524         Zpm = self.clickTWR(i)
00525         if Zpm is None:
00526           return
00527         twrButton = self.drawGOSEDTWR.selectTWR.find(i)
00528         twrButton.setOn(1)
00529         self.selectChange()
00530         bitBlt(self.drawGOTED.towerList[i], 0, 0, Zpm , 0, 0)
00531
00532
00533   def clickTWR(self, id):
00534     if self.drawGOTED.final[id].isNull():
00535       #~ bitBlt(Zpm, 0, 0, self.drawGOTED.noBgrZ , 0, 0)
00536       return
00537     Zpm = QPixmap(self.drawGOTED.towerList[id].width(),
00538                   self.drawGOTED.towerList[id].height())
00539     bitBlt(Zpm, 0, 0, self.drawGOTED.final[id] , 0, 0)
00540     self.pTWR = QPainter(Zpm)
00541     #~ self.pCAL.setBrush(color)
00542     self.pTWR.setPen(QColor("red"))
00543     self.pTWR.drawRect(0,0,
00544                        self.drawGOTED.towerList[id].width(),
00545                        self.drawGOTED.towerList[id].height()
00546                        )
00547     self.pTWR.end()
00548     return Zpm
00549
00550
00551   def plot(self, skip = 0):
00552     """ Plot is the heart of GOSED. It strips the information of the event
00553     from the data string and passes it to GOSED_LDF, initializing the
00554     iteration over all the entries of the event.
00555     It manages three kinds of sources of data:
00556     1. Data from .ldf files
00557     2. Data from .fits files
00558     3. Data from server
00559     It also manages the reinizialization of all the gui's outputs, calling
00560     clearviews() to delete the information from a previous event
00561     \param skip - Number of events to skip (ignored if source is not an LDF file)
00562                   Defaults to plotting next event in the file
00563     """
00564
00565     if self.__file is not None:
00566       if        str(self.__fn).endswith(".ldf", False) \
00567              or str(self.__fn).endswith(".arch", False) \
00568              or str(self.__fn).endswith(".dge", False):
00569
00570         n = 0
00571         while n <= skip:
00572           evtPtr = self.__file.tell()
00573           #~ print "plot: evtPtr =", evtPtr
00574
00575           self.__evtList.append(evtPtr)
00576           #~ print "-------> plot: eventList = ", self.__evtList
00577
00578           data = self.__file.read(8)
00579
00580           if len(data) < 8:
00581             print "End of File: " , (self.__fn)
00582             #~ self.__pauseDisplay = 1
00583             self.statusBar().message("End of File: %s" % (self.__fn), 2000)
00584             self.Next.setEnabled(0)
00585             self.Previous.setEnabled(1)
00586             self.Go.setEnabled(0)
00587             self.Stop.setEnabled(0)
00588             self.__timer.stop()
00589
00590             if self.__evtList.count(evtPtr) != 1:
00591               self.__evtList.pop()
00592               #~ print "-------> plot: eventList = ", self.__evtList
00593
00594             return
00595
00596           (identity, length) = struct.unpack('!LL', data)
00597           data              += self.__file.read(length - 8)
00598
00599           if n == skip:  break
00600
00601           if skip >= 1000:
00602             if n % 1000 == 0:  print n
00603           n += 1
00604
00605     elif self.__fits is not None:
00606       data = self.__fits.read()
00607       if data is None:
00608         print "End of File: " , (self.__fn)
00609         #~ self.__pauseDisplay = 1
00610         self.statusBar().message("End of File: %s" % (self.__fn), 2000)
00611         self.__timer.stop()
00612         self.Next.setEnabled(0)
00613         self.Go.setEnabled(0)
00614         self.Stop.setEnabled(0)
00615         return
00616
00617     elif self.__ds is not None:
00618       #import gutil
00619       data, sender = self.__ds.receive()
00620       if data is None or len(data) == 0:
00621         return
00622       #print gutil.hexConvert(data)
00623
00624     else:
00625       print "No data source open for display"
00626       self.statusBar().message("No data source open for display", 2000)
00627       self.__timer.stop()
00628       return
00629
00630     # Clear the display
00631     self.drawGOSEDData.totHits.clear()  # RiC 10/30/03 added this line
00632     self.clearViews()                   # RiC 10/30/03 added this line
00633
00634     # Iterate over all entries for the current data buffer
00635     # RiC: A buffer is allowed to contain more than one event, but doesn't now.
00636     #      May have to rethink this when it does.
00637     self.__ldbi.iterate(data, len(data)) # RiC 4/2/04 switched to the new way
00638
00639     # Make sure the data doesn't get garbage collected by keeping a link to it
00640     # that will be overwritten by the next event.  The previous one will then
00641     # be garbage collected.  This is important for replotting the asme event.
00642     self.__data = data
00643
00644   def replot(self):
00645     # Clear the display
00646     self.drawGOSEDData.totHits.clear()  # RiC 10/30/03 added this line
00647     self.clearViews()                   # RiC 10/30/03 added this line
00648
00649     # Iterate over all entries for the current data buffer
00650     # RiC: A buffer is allowed to contain more than one event, but doesn't now.
00651     #      May have to rethink this when it does.
00652     self.__ldbi.iterate() # RiC 4/2/04 switched to the new way
00653
00654   def rangeChange(self, buttonId):
00655     self.setGOSEDDefaults()
00656     self.maintainButtons(buttonId, self.drawGOSEDCAL.selectRNG)
00657
00658   def rangeChange2(self, buttonId):
00659     self.setGOSEDDefaults()
00660     self.maintainButtons(buttonId, self.drawGOSEDCALTKR.selectRNG)
00661
00662   def maintainButtons(self, buttonId, widget):
00663     button = widget.find(buttonId)
00664     if buttonId == 4:
00665       if button.isChecked():
00666         check = 1
00667       else:
00668         check = 0
00669       for i in range(0,4):
00670         button = widget.find(i)
00671         #~ if button.isEnabled():
00672         button.setChecked(check)
00673     else:
00674       if not button.isChecked():
00675         button = widget.find(4)
00676         button.setChecked(0)
00677     if self.__file is not None or \
00678        self.__fits is not None or \
00679        self.__ds is not None:
00680       self.__ldbi.iterate()
00681     if buttonId == 4:
00682       for i in range(0,4):
00683         button = widget.find(i)
00684         if not button.isEnabled():
00685           button.setChecked(0)
00686
00687   def scaleChange(self, scaleId):
00688     self.maintainScale(scaleId, self.drawGOSEDCAL)
00689
00690   def scaleChange2(self, scaleId):
00691     self.maintainScale(scaleId, self.drawGOSEDCALTKR)
00692
00693   def maintainScale(self, scaleId, window):
00694     if scaleId == 0:
00695       #~ window.selectRNG.setEnabled(1)
00696       #~ window.RNGAll.setChecked(1)
00697       window.CALenergy.setEnabled(1)
00698     else:
00699       #~ window.selectRNG.setEnabled(1)
00700       #~ window.RNGAll.setChecked(1)
00701       window.CALenergy.setEnabled(0)
00702     self.selectChange()
00703
00704   def selectChange(self):
00705     """ This function is called whenever the user makes a change of selection
00706     in TWR, RNG or Scale, to reload the event with the new filter settings.
00707     """
00708     # Pass the new filter only for the implemented Scale Selections - Not necessary ATK 040706
00709     #~ if (self.drawGOSEDCAL.scaleSelection.currentItem() == 0 or \
00710        #~ self.drawGOSEDCAL.scaleSelection.currentItem() == 1) and\
00711        #~ (self.drawGOSEDCALTKR.scaleSelection.currentItem() == 0 or \
00712         #~ self.drawGOSEDCALTKR.scaleSelection.currentItem() == 1):
00713     if self.__file is not None or \
00714        self.__fits is not None or \
00715        self.__ds is not None:
00716       self.setGOSEDDefaults()
00717       self.__ldbi.iterate()
00718
00719   def setGOSEDDefaults(self):
00720       #~ self.drawGOSEDCAL.RNGAll.setEnabled(0)
00721       # Reinitialize settings, we have to do it again here since we don't call
00722       # plot() for a new event, we reiterate the current event over a new
00723       # set of filters.
00724       self.clearViews()
00725       self.drawGOSEDData.totHits.setText(str(0))
00726
00727       # Load backgrounds. We do it here and not in clearviews() not to have a
00728       # white pixmap while the event is being processed.
00729       bitBlt(self.drawXZ_TKR, 0, 0, self.drawXZ_TKR.background)
00730       bitBlt(self.drawYZ_TKR, 0, 0, self.drawYZ_TKR.background)
00731       bitBlt(self.drawXZ_CAL, 0, 0, self.drawXZ_CAL.background)
00732       bitBlt(self.drawYZ_CAL, 0, 0, self.drawYZ_CAL.background)
00733
00734       bitBlt(self.drawXZ_TKR2, 0, 0, self.drawXZ_TKR2.background)
00735       bitBlt(self.drawYZ_TKR2, 0, 0, self.drawYZ_TKR2.background)
00736       bitBlt(self.drawXZ_CAL2, 0, 0, self.drawXZ_CAL2.background)
00737       bitBlt(self.drawYZ_CAL2, 0, 0, self.drawYZ_CAL2.background)
00738
00739       bitBlt(self.drawHatACD, 0, 0, self.drawHatACD.background)
00740       bitBlt(self.drawSide1ACD, 0, 0, self.drawSide1ACD.background)
00741       bitBlt(self.drawSide2ACD, 0, 0, self.drawSide2ACD.background)
00742       bitBlt(self.drawSide3ACD, 0, 0, self.drawSide3ACD.background)
00743       bitBlt(self.drawSide4ACD, 0, 0, self.drawSide4ACD.background)
00744
00745       #~ for i in range(16):
00746         #~ if not self.drawGOTED.final[i].isNull():
00747           #~ bitBlt(self.drawYZ_CAL, 0, 0, self.drawYZ_CAL.background)
00748
00749     #~ else:
00750       #~ self.statusBar().message("Auto Range not Implemented Yet", 2000)
00751
00752
00753   def clearViews(self):
00754     """ This function reloads GOSED defaults in order to process a new event.
00755     """
00756
00757 #     # Reinitialize final Pixmaps, they need to be Null at the beginning of
00758 #     # each event processing
00759 #     self.drawXZ_TKR.final = QPixmap()
00760 #     self.drawYZ_TKR.final = QPixmap()
00761 #     self.drawXZ_CAL.final = QPixmap()
00762 #     self.drawYZ_CAL.final = QPixmap()
00763
00764 #     self.drawXZ_TKR2.final = QPixmap()
00765 #     self.drawYZ_TKR2.final = QPixmap()
00766 #     self.drawXZ_CAL2.final = QPixmap()
00767 #     self.drawYZ_CAL2.final = QPixmap()
00768
00769 #     self.drawHatACD.finalHatACD = QPixmap()
00770 #     self.drawSide1ACD.finalSide1ACD = QPixmap()
00771 #     self.drawSide2ACD.finalSide2ACD = QPixmap()
00772 #     self.drawSide3ACD.finalSide3ACD = QPixmap()
00773 #     self.drawSide4ACD.finalSide4ACD = QPixmap()
00774
00775 #     #~ for i in range(16):
00776 #       #~ self.drawGOTED.final[i] = QPixmap()
00777 #       #~ bitBlt(self.drawGOTED.towerList[i], 0, 0,
00778 #              #~ self.drawGOTED.noBgrZ, 0, 0)
00779 #       #~ self.drawGOTED.towerList[i].setIcon(QPixmap())
00780
00781 #     for i in range(16):
00782 #       self.drawGOTED.final[i] = QPixmap()
00783 #       bitBlt(self.drawGOTED.towerList[i], 0, 0,
00784 #              self.drawGOTED.noBgrZ, 0, 0)
00785
00786     # Separate data from pixmaps - ATK-040405
00787     self.clearButtons()
00788     self.clearPixmaps()
00789
00790   def clearButtons(self):
00791     # Clear list views
00792     #self.drawGOSEDData.ACDview.clear()
00793     self.drawGOSEDData.acd.clear()
00794     self.drawGOSEDData.TKRview.clear()
00795     self.drawGOSEDData.CALview.clear()
00796     self.drawGOSEDData.diagTKR.clear()
00797     self.drawGOSEDData.diagCAL.clear()
00798     self.drawGOSEDData.error.clear()
00799     self.drawGOSEDData.trigger.clear()
00800
00801     # Disable button groups
00802     #~ for i in range(self.drawGOSEDTWR.selectTWR.count()): -ATK20050822
00803       #~ twrButton = self.drawGOSEDTWR.selectTWR.find(i)
00804       #~ twrButton.setEnabled(0)
00805       #~ twrButton.setChecked(0)
00806
00807     for i in range(0,4):
00808       RngButton = self.drawGOSEDCAL.selectRNG.find(i)
00809       RngButton.setEnabled(0)
00810       #~ RngButton.setChecked(0)
00811
00812     for i in range(0,4):
00813       RngButton = self.drawGOSEDCALTKR.selectRNG.find(i)
00814       RngButton.setEnabled(0)
00815       #~ RngButton.setChecked(0)
00816
00817     #~ for i in range(16):
00818       #~ self.drawGOTED.towerList[i].setEnabled(0)
00819
00820
00821   def clearPixmaps(self):
00822     # Reinitialize final Pixmaps, they need to be Null at the beginning of
00823     # each event processing
00824     self.drawXZ_TKR.clear()
00825     self.drawYZ_TKR.clear()
00826
00827     self.drawXZ_CAL.clear()
00828     self.drawYZ_CAL.clear()
00829
00830     self.drawXZ_TKR2.clear()
00831     self.drawYZ_TKR2.clear()
00832     self.drawXZ_CAL2.clear()
00833     self.drawYZ_CAL2.clear()
00834
00835     self.drawHatACD.clear()
00836     self.drawSide1ACD.clear()
00837     self.drawSide2ACD.clear()
00838     self.drawSide3ACD.clear()
00839     self.drawSide4ACD.clear()
00840
00841     #~ for i in range(16):
00842       #~ self.drawGOTED.clear()
00843       #~ bitBlt(self.drawGOTED.towerList[i], 0, 0,
00844              #~ self.drawGOTED.noBgrZ, 0, 0)
00845       #~ self.drawGOTED.towerList[i].setIcon(QPixmap())
00846
00847     for i in range(16):
00848       self.drawGOTED.clear()
00849       bitBlt(self.drawGOTED.towerList[i], 0, 0,
00850              self.drawGOTED.noBgrZ, 0, 0)
00851
00852   def clearButtonGroups(self):
00853     """ This function unchecks all the buttons. Contrary to clearviews(), this
00854     is only necesary when opening a new file, since we may have changed a
00855     selection in only one parameter (for example RNG only), and thus we don't
00856     want to loose the other filter by unchecking it (for example TWR).
00857     """
00858
00859     self.Go.setIconSet(QIconSet(self.goPixmap))
00860
00861     window = self.drawGOSEDData
00862     window.filename.clear()
00863     window.timeStamp.clear()
00864     window.eventNumber.clear()
00865     window.eventTag.clear()
00866     window.flagLine.clear()
00867
00868     for i in range(0,5):
00869       rngButton = self.drawGOSEDCAL.selectRNG.find(i)
00870       #~ if rngButton.isOn():
00871       rngButton.setChecked(0)
00872
00873     for i in range(0,5):
00874       rngButton = self.drawGOSEDCALTKR.selectRNG.find(i)
00875       #~ if rngButton.isOn():
00876       rngButton.setChecked(0)
00877
00878     self.drawXZ_TKR.update()
00879     self.drawYZ_TKR.update()
00880     self.drawXZ_CAL.update()
00881     self.drawYZ_CAL.update()
00882     self.drawXZ_TKR2.update()
00883     self.drawYZ_TKR2.update()
00884     self.drawXZ_CAL2.update()
00885     self.drawYZ_CAL2.update()
00886     self.drawHatACD.update()
00887     self.drawSide1ACD.update()
00888     self.drawSide2ACD.update()
00889     self.drawSide3ACD.update()
00890     self.drawSide4ACD.update()
00891     self.drawRainbowACD.update()
00892     self.drawRainbowCAL.update()
00893     self.drawRainbowCAL2.update()
00894     # GOTED Missing here - ATK 040705
00895
00896   #~ def clearTWRButtons(self):
00897     for i in range(self.drawGOSEDTWR.selectTWR.count()):
00898       twrButton = self.drawGOSEDTWR.selectTWR.find(i)
00899       if twrButton.isOn():
00900         twrButton.setChecked(0)
00901       twrButton.setEnabled(0)
00902
00903   def nextClicked(self, skip = 0):
00904     """ Plots next event when called
00905
00906     \param skip - Number of events to skip, negative means backward.
00907                   Defaults to going forward one 1 event
00908     """
00909
00910     # INVESTIGATE HOW TO REINICIALIZE THE SELECTED TOWER FOR A NEW EVENT HERE
00911     #~ GOSED_LDF.CALcontributionIterator1.__selectedTower = -1
00912     #~ self.GOSED_LDF.CALcontributionIterator2.__selectedTower = -1
00913     #~ self.GOSED_LDF.TKRcontributionIterator.__selectedTower = -1
00914
00915     # As easy as this:
00916     self.plot(skip)
00917
00918     #~ for i in range(16):
00919       #~ twrButton = self.drawGOSEDTWR.selectTWR.find(i)
00920       #~ if twrButton.isChecked():
00921         #~ Zpm = self.clickTWR(i)
00922         #~ if Zpm is None:
00923           #~ return
00924         #~ bitBlt(self.drawGOTED.towerList[i], 0, 0, Zpm , 0, 0)
00925
00926     # Enable Previous button
00927     if self.__ds is None and self.__fits is None and not self.__timer.isActive():
00928       self.Previous.setEnabled(1)
00929
00930     # Check if we have no data for either the CAL or the TKR and if so load
00931     # the background. We do it here and not in clearviews() not to have a
00932     # white pixmap while the event is being processed
00933 #     if self.drawGOSEDData.CALview.childCount() == 0:
00934 #       bitBlt(self.drawXZ_CAL, 0, 0, self.drawXZ_CAL.background)
00935 #       bitBlt(self.drawYZ_CAL, 0, 0, self.drawYZ_CAL.background)
00936
00937 #       bitBlt(self.drawXZ_CAL2, 0, 0, self.drawXZ_CAL2.background)
00938 #       bitBlt(self.drawYZ_CAL2, 0, 0, self.drawYZ_CAL2.background)
00939
00940 #     if self.drawGOSEDData.TKRview.childCount() == 0:
00941 #       bitBlt(self.drawXZ_TKR, 0, 0, self.drawXZ_TKR.background)
00942 #       bitBlt(self.drawYZ_TKR, 0, 0, self.drawYZ_TKR.background)
00943
00944 #       bitBlt(self.drawXZ_TKR2, 0, 0, self.drawXZ_TKR2.background)
00945 #       bitBlt(self.drawYZ_TKR2, 0, 0, self.drawYZ_TKR2.background)
00946
00947 #     if self.drawGOSEDData.acd.childCount() == 0:
00948 #       bitBlt(self.drawHatACD, 0, 0, self.drawHatACD.background)
00949 #       bitBlt(self.drawSide1ACD, 0, 0, self.drawSide1ACD.background)
00950 #       bitBlt(self.drawSide2ACD, 0, 0, self.drawSide2ACD.background)
00951 #       bitBlt(self.drawSide3ACD, 0, 0, self.drawSide3ACD.background)
00952 #       bitBlt(self.drawSide4ACD, 0, 0, self.drawSide4ACD.background)
00953
00954     #~ if not self.Go.isEnabled():
00955       #~ step = float(str(self.GOSEDPreferencesGUI.timestepValue.text()))
00956       #~ self.__timer.start(step*1000, False)   # seconds in milliseconds
00957      #~ self.__timer.start(500, False)
00958
00959
00960   def previousClicked(self, skip = -1):
00961     """ Finds previous event in the file and then plots it. It only
00962     works for .arch files.
00963
00964     \param skip - Number of events to skip, negative means backward.
00965                   Defaults to going backward one 1 event
00966     """
00967
00968     if self.__ds is not None:
00969       self.statusBar().message("Previous event is not available", 2000)
00970       self.Previous.setEnabled(0)
00971       return
00972
00973     if self.__fits is not None:
00974       self.statusBar().message("Can't go to Previous event in a Fits file", 2000)
00975       self.Previous.setEnabled(0)
00976       return
00977
00978     if self.__file is None:  return
00979
00980     evtPtr = 0
00981     self.Go.setIconSet(QIconSet(self.goPixmap))
00982
00983     if self.__evtList != []:
00984       evtPtr = self.__evtList.pop()  # points to beginning of current  event
00985       n = 0
00986       while n > skip:
00987         if self.__evtList == []:  break
00988         evtPtr = self.__evtList.pop()  # points to beginning of previous event
00989         if skip <= -1000:
00990           if n % 1000 == 0:  print n
00991         n -= 1
00992
00993     self.__file.seek(evtPtr)
00994     self.nextClicked()
00995
00996     self.Go.setEnabled(1)
00997     self.Next.setEnabled(1)
00998     self.SkipValue.setEnabled(1)
00999     self.Skip.setEnabled(1)
01000
01001     if evtPtr == 0:
01002       print "Beginning of File: " , (self.__fn)
01003       self.statusBar().message("Beginning of File: %s" % (self.__fn), 2000)
01004       self.Previous.setEnabled(0)
01005
01006
01007   def goClicked(self):
01008     """ Load events ininterruptedly in time steps selected by the user from
01009     the GOSED Preferences menu. It stops when the Stop Button is clicked.
01010     """
01011
01012     if self.__timer.isActive():
01013       self.__timer.stop()
01014       self.Go.setIconSet(QIconSet(self.goPixmap))
01015       # Enable back Browse buttons
01016       if self.__ds is None:
01017         self.Next.setEnabled(1)
01018         self.Skip.setEnabled(1) # ATK20050822
01019       # The Previous button is only enabled for .arch files
01020       if self.__ds is None and self.__fits is None:
01021         self.Previous.setEnabled(1)
01022     else:
01023       self.Go.setIconSet(QIconSet(self.stopPixmap))
01024       # Disable Browse buttons to avoid conflicting signals
01025       #~ self.Go.setEnabled(0)
01026       self.Previous.setEnabled(0)
01027       self.Next.setEnabled(0)
01028       #~ self.Stop.setEnabled(1)
01029       self.SkipValue.setEnabled(0)
01030       self.Skip.setEnabled(0)
01031       step = float(str(self.GOSEDPreferencesGUI.timestepValue.text()))
01032       self.__timer.start(step*1000, False)   # seconds in milliseconds
01033
01034   def stopClicked(self):
01035     """ Stop the ininterrupted display of events triggered by the Go Button
01036     """
01037     self.__timer.stop()
01038
01039     # Enable back Browse buttons
01040     self.Go.setEnabled(1)
01041     self.Stop.setEnabled(0)
01042     if self.__ds is None:
01043       self.Next.setEnabled(1)
01044     # The Previous and Skip buttons are only enabled for LDF files
01045     if self.__ds is None and self.__fits is None:
01046       self.Previous.setEnabled(1)
01047       self.SkipValue.setEnabled(1)
01048       self.Skip.setEnabled(1)
01049
01050   def skipClicked(self):
01051     """ Skip events forward or backward in an LDF file.
01052     A skip amount of:
01053        1 => display next event
01054        0 => replot current event
01055       -1 => display previous event
01056        N => display event with Event Number = current event's Event Number + N
01057       -N => display event with Event Number = current event's Event Number - N
01058     """
01059     try:
01060       skipAmount = int(str(self.SkipValue.text()))
01061     except (TypeError, ValueError):
01062       self.statusBar().message("Skip value must be a positive or negative integer")
01063       return
01064
01065     if skipAmount > 0:
01066       self.nextClicked(skipAmount - 1)
01067     else:
01068       self.previousClicked(skipAmount)
01069
01070   def fileOpen(self):
01071     """ Load data from a file
01072     """
01073
01074     # Prevent that gui gets hanged up if Cancel button is clicked at the dialog window
01075     self.__fn_Old = self.__fn
01076     self.__timer.stop()
01077
01078     self.__fn = QFileDialog.getOpenFileName(QString.null, "(*.ldf *.arch *.fits *.dge)", self)
01079
01080     # If Cancel was clicked in the File Open dialog reload existing file and return
01081     if str(self.__fn) == "":
01082       self.__fn = self.__fn_Old
01083       return
01084
01085     if not self.__fn.endsWith(".arch") and not self.__fn.endsWith(".ldf") and not str(self.__fn).endswith(".fits"):
01086       self.statusBar().message("Can't display a File other than with extension .arch or .fits", 2000)
01087       self.__fn = self.__fn_Old
01088       return
01089
01090     # Close previous data sources
01091     if self.__ds is not None:
01092       self.serverClose()
01093
01094     self.fileClose()
01095
01096     # Flag to check which one is my first tower and range in the File
01097     self.firstTower = None
01098     self.firstRNG   = None
01099     self.firstRNG2  = None
01100
01101     # Setup Browse buttons
01102     self.Go.setEnabled(1)
01103     self.Go.setIconSet(QIconSet(self.goPixmap))
01104     self.Next.setEnabled(1)
01105     self.Previous.setEnabled(0)
01106     self.Stop.setEnabled(1)
01107
01108     if self.__fn.endsWith(".fits"):
01109       try:
01110         from LATTE.runcontrol import rcFitsWriter
01111       except (ImportError, IOError), e:
01112         raise "rcFitsWriter or one of its dependencies not available: %s" % e
01113         self.statusBar().message("Dependencies to read FITS file not available", 2000)
01114
01115       self.__fits = rcFitsWriter.rcFitsWriter(fileName=str(self.__fn), mode=rcFitsWriter.MODE_READONLY, format=rcFitsWriter.FORMAT_BYTE)
01116     else:
01117       self.__file = open(str(self.__fn), 'rb')
01118       self.SkipValue.setEnabled(1)
01119       self.Skip.setEnabled(1)
01120
01121     self.__evtList = []
01122
01123
01124     self.statusBar().message("Beginning of File: %s" % (self.__fn), 2000)
01125     self.drawGOSEDData.filename.setText(str(self.__fn))
01126     self.drawGOSEDTWR.selectTWR.setEnabled(1)
01127     #~ if int(self.drawGOSEDCAL.scaleSelection.currentItem()) == 1:
01128       #~ self.drawGOSEDCAL.selectRNG.setEnabled(1)
01129       #~ self.drawGOSEDCALTKR.selectRNG.setEnabled(1)
01130     self.GOSEDPreferencesGUI.setCustomEnabled(1)
01131     self.GOSEDPreferencesGUI.setCustomEnabled2(1)
01132     self.GOSEDPreferencesGUI.setACDCustomEnabled(1)
01133
01134     # Plot data
01135     self.plot()
01136
01137
01138   def fileClose(self):
01139     """ Close file source
01140     """
01141     self.__timer.stop()
01142
01143     #INVESTIGATE HOW TO REINICIALIZE THE SELECTED TOWER FOR A NEW EVENT HERE
01144     #~ self.selectTWR.setButton(-1)
01145
01146     if self.__file is not None:
01147       self.__file.close()
01148       self.__file = None
01149     elif self.__fits is not None:
01150       self.__fits.close()
01151       self.__fits = None
01152     else:
01153       self.statusBar().message("No file open for display", 2000)
01154       return
01155
01156     # Reinitialize everything
01157     self.clearViews()
01158     self.GOSEDPreferencesGUI.setCustomEnabled(0)
01159     self.GOSEDPreferencesGUI.setACDCustomEnabled(0)
01160
01161     self.drawGOSEDTWR.selectTWR.setEnabled(0)
01162     #~ self.drawGOSEDCAL.selectRNG.setEnabled(0)
01163     #~ self.drawGOSEDCALTKR.selectRNG.setEnabled(0)
01164     self.clearButtonGroups()
01165
01166
01167   def __shown(self):
01168     self.GOSEDPreferencesGUI.twr(self.__dwGOSEDTWR.isVisible())
01169     self.GOSEDPreferencesGUI.calTkr(self.__dwGOSEDCALTKR.isVisible())
01170     self.GOSEDPreferencesGUI.data(self.__dwGOSEDData.isVisible())
01171     self.GOSEDPreferencesGUI.tkr(self.__dwGOSEDTKR.isVisible())
01172     self.GOSEDPreferencesGUI.acd(self.__dwGOSEDACD.isVisible())
01173     self.GOSEDPreferencesGUI.cal(self.__dwGOSEDCAL.isVisible())
01174     self.GOSEDPreferencesGUI.ted(self.__dwGOTED.isVisible())
01175
01176   def fileExit(self):
01177     """ Exits the gui
01178     """
01179     if self.__file is not None:
01180       self.fileClose()
01181     else:
01182       self.serverClose()
01183     self.__timer.stop()
01184     self.GOSEDPreferencesGUI.saveViews()
01185     self.close()
01186
01187   def serverOpen(self, state):
01188     """  Load event data from a network server
01189     """
01190     try:
01191       import LATTE.tools.DataDistributorPoll as DDP
01192     except IOError, e:
01193       myLog.warning("Unable to connect to Data Distribution server due to: %s" % e)
01194       self.statusBar().message("Unable to connect to Data Distribution server due to: %s" % e, 2000)
01195       #~ print "Unable to connect to Data Distribution server"
01196
01197     if state:
01198       # Close previous data sources
01199       if self.__file is not None or self.__fits is not None:
01200         self.fileClose()
01201         self.SkipValue.setEnabled(0)
01202         self.Skip.setEnabled(0)
01203
01204       # Obsolete
01205       #~ """Flag to check which one is my first tower and range in the File"""
01206       self.firstTower = None
01207       self.firstRNG   = None
01208       self.firstRNG2  = None
01209
01210       server = str(self.ServerPreferencesGUI.selectedServer.text())
01211       print "Listening on data server", server
01212       if server == "":
01213         return
01214
01215       dsName = 'LAT_EBFdata'
01216       if self.__ds is None:
01217         self.__ds = DDP.DataDistributorPoll(dsName)
01218         if self.__ds is not None:
01219           self.__ds.connect(server)
01220           self.__ds.start()
01221           self.drawGOSEDTWR.selectTWR.setEnabled(1)
01222           #~ if int(self.drawGOSEDCAL.scaleSelection.currentItem()) == 1:
01223             #~ self.drawGOSEDCAL.selectRNG.setEnabled(1)
01224             #~ self.drawGOSEDCALTKR.selectRNG.setEnabled(1)
01225           self.GOSEDPreferencesGUI.setCustomEnabled(1)
01226           self.GOSEDPreferencesGUI.setCustomEnabled2(1)
01227           self.GOSEDPreferencesGUI.setACDCustomEnabled(1)
01228           self.stopClicked()
01229           self.goClicked()
01230         else:
01231           print "Unable to connect to Data Distribution server", dsName
01232     else:
01233       self.stopClicked()
01234       self.Go.setEnabled(0)
01235       self.serverClose()
01236
01237
01238   def serverClose(self):
01239     """  Close network server
01240     """
01241     if self.__ds is not None:
01242       self.__ds.stop()
01243       self.__ds.disconnect()
01244       self.__ds = None
01245       self.clearViews()
01246       self.clearButtonGroups()
01247
01248   def ServerPreferences(self):
01249     """ Calls the Server Preferences window stopping the timer.
01250     """
01251     self.__timer.stop()
01252     self.serverClose()
01253     self.ServerPreferencesGUI.exec_loop()
01254     self.serverOpen(True)
01255     #~ self.Go.setIconSet(QIconSet(self.goPixmap))
01256
01257
01258
01259   def GOSEDPreferences(self):
01260     """ Calls the GOSED Preferences window stopping the timer. It also
01261     passes the new settings to GOSED.
01262     """
01263
01264     startTimer = False
01265     if self.__timer.isActive():
01266       self.__timer.stop()
01267       startTimer = True
01268
01269     self.GOSEDPreferencesGUI.exec_loop()
01270
01271     #~ if self.GOSEDPreferencesGUI.EventlimitsButton.isChecked():
01272       #~ self.preferredLimits = "Event"
01273     if self.GOSEDPreferencesGUI.CALlimitsButton.isChecked():
01274       self.preferredLimits = "Default"
01275     elif self.GOSEDPreferencesGUI.CustomlimitsButton.isChecked():
01276       self.preferredLimits = "Custom"
01277
01278     if self.GOSEDPreferencesGUI.CALlimitsButton2.isChecked():
01279       self.preferredLimits2 = "Default"
01280     elif self.GOSEDPreferencesGUI.CustomlimitsButton2.isChecked():
01281       self.preferredLimits2 = "Custom"
01282
01283     # Obsolete:
01284     #~ if self.GOSEDPreferencesGUI.energyScaleButton.isChecked():
01285       #~ self.preferredScale = "Energy"
01286       #~ self.CALenergy.setEnabled(1)
01287     #~ elif self.GOSEDPreferencesGUI.rangeScaleButton.isChecked():
01288       #~ self.preferredScale = "Range"
01289       #~ self.CALenergy.setEnabled(0)
01290
01291     # Return if no data source is loaded
01292     if (self.__file is None) and (self.__fits is None) and (self.__ds is None):
01293       return
01294
01295     # Reload Go Icon
01296     self.Go.setIconSet(QIconSet(self.goPixmap))
01297
01298     # If there is no event loaded click next (plot), otherwise reload the
01299     # same event with the new settings
01300     if self.__evtList == []:
01301       self.nextClicked()
01302     else:
01303       self.clearViews()
01304       # Obsolete:
01305       #~ self.existsTWRdata = 0
01306       #~ self.existsCALTWRdata = 0
01307       self.__ldbi.iterate()
01308
01309     if startTimer:
01310       step = float(str(self.GOSEDPreferencesGUI.timestepValue.text()))
01311       self.__timer.start(step*1000, False)
01312       self.Go.setIconSet(QIconSet(self.stopPixmap))
01313
01314   def closeEvent(self, e):
01315     self.GOSEDPreferencesGUI.saveGOSEDSize()
01316     e.accept()
01317
01318   def helpOnline(self):
01319     """This function opens a web browser with I&T URL for reference.
01320     """
01321     import webbrowser
01322     webbrowser.open('http://www-glast.slac.stanford.edu/IntegrationTest/ONLINE/Default.htm')
01323
01324
01325   def helpContents(self):
01326     """ Calls GOSED Readme file for reference.
01327     """
01328     self.GOSEDReadme = GOSEDReadme()
01329     self.GOSEDReadme.exec_loop()
01330
01331
01332   def helpAbout(self):
01333     """ Displays About GOSED info
01334     """
01335     QMessageBox.about(self,'Help About',
01336                            '                              GLAST Online Single Event Display\n' +
01337                            '                                  ' +
01338                            'I&T Online - Alicia T. Kavelaars\nhttp://www-glast.slac.stanford.edu/' +
01339                            'IntegrationTest/ONLINE/contact.htm\n' +
01340                            '                                      Copyright 2003 by\n' +
01341                            '       The Board of Trustees of the Leland Stanford Junior University.\n' +
01342                            '                                       All rights reserved.')
01343
01344
01345 if __name__ == "__main__":
01346   import os
01347   a = QApplication(sys.argv)
01348   QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
01349   if os.name == 'posix':
01350     font = a.font()
01351     size = font.pointSize()
01352     if size > 8:
01353       font.setPointSize ( 8 )
01354       a.setFont ( font, True )
01355   #if len(sys.argv) == 2:
01356   #  w = singleEvtDisplayImpl(sys.argv[1])
01357   #else:
01358   w = singleEvtDisplayImpl()
01359   a.setMainWidget(w)
01360   w.show()
01361   a.exec_loop()
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GOSEDPainter.py Source File

gosed

GOSEDPainter.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST Online Single Event Display Painter"
00012 __author__   = "A. Kavelaars <aliciak@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "11/20/2003"
00014 __version__  = "$Revision: 1.18 $"
00015 __credits__  = "SLAC"
00016
00017
00018 import LATTE.copyright_SLAC
00019
00020 from   qt import *
00021
00022 import GOSED_LDF
00023 import colorScale
00024
00025
00026 # Important Constants
00027 NUM_XY_TKR = 24
00028 NUM_Z_TKR  = 36
00029 NUM_Z_CAL  = 8
00030 NUM_XY_CAL = 12
00031
00032 RANGE_TKR_X = [1,2,5,6,9,10,13,14,17,18,21,22,25,26,29,30,33,34]
00033 RANGE1_TKR_X = [1, 5, 9, 13, 17, 21, 25, 29, 33]
00034 RANGE2_TKR_X = [2, 6, 10, 14, 18, 22, 26, 30, 34]
00035 RANGE_TKR_Y = [0,3,4,7,8,11,12,15,16,19,20,23,24,27,28,31,32,35]
00036 RANGE1_TKR_Y = [4, 8, 12, 16, 20, 24, 28, 32, 35]
00037 RANGE2_TKR_Y = [0, 3, 7, 11, 15, 19, 23, 27, 31]
00038
00039
00040 class drawSide1ACD(QWidget):
00041   """ Draws background Pixmap for the ACD Side 1 projection and updates
00042   the custom widget with the final pixmap processed by GOSED_LDF.
00043   """
00044
00045   def __init__(self, gui, parent = None,name = None,fl = 0):
00046     """ drawSide1ACD contructor
00047
00048     \param parent        None
00049     \param name          None
00050     \param fl            0
00051     """
00052
00053     # Initialize custom widget
00054     QWidget.__init__(self,parent,name,fl)
00055     self.__gui = gui
00056     custWidLayout = QGridLayout(self,1,1,0,6,"custWidLayout")
00057     self.clearWState(Qt.WState_Polished)
00058     self.setMinimumWidth(241)
00059     self.setMinimumHeight(81)
00060     self.setMaximumWidth(241)
00061     self.setMaximumHeight(81)
00062     #~ self.setSizePolicy(QSizePolicy(QSizePolicy(7,7,0,0,self.sizePolicy().hasHeightForWidth())))
00063
00064     tileWidth   = (self.width()  - 1)/5
00065     tileHeight  = (self.height() - 1)/4
00066     towerWidth  = self.width()/4
00067     towerHeight = self.height()/4
00068
00069     # Create a null final Pixmap that will indicate if there is
00070     # filtered ACD Side 1 data when it is filled in GOSED_LDF
00071     self.final      = QPixmap(241, 81)
00072     self.background = QPixmap(241, 81)#self.width(), self.height())
00073
00074     pACD = QPainter(self.background)
00075     pACD.setBrush(QColor("gray"))
00076     pACD.setPen(QColor(140, 140, 140))
00077     pACD.drawRect(0, 0, self.width(), self.height())
00078
00079     # Draw tile boundaries
00080     pACD.setPen(QColor(100, 100, 100))
00081
00082     for j in range(3):
00083       for i in range(5):
00084         pACD.drawRect(tileWidth * i, tileHeight * j,
00085                       tileWidth + 1, tileHeight + 1
00086                       )
00087
00088     pACD.drawRect(0, tileHeight * 3, tileWidth * 5 + 1, tileHeight + 1)
00089
00090     # Draw tower boundaries
00091     pACD.setPen(QColor(166, 163, 157))
00092
00093     for i in range(1,4):
00094       pACD.drawLine((towerWidth)*i, 1,(towerWidth)*i, self.height() - 1)
00095
00096     pACD.end()
00097
00098     # ATK-051110: Load the names in the background pixmap as default
00099     self.drawNames(self.background)
00100
00101     self.paintFace()
00102
00103   def drawNames(self, pixmap):
00104     tileWidth   = (self.width()  - 1)/5
00105     tileHeight  = (self.height() - 1)/4
00106
00107     pACD = QPainter(pixmap)
00108
00109     # Draw tile names
00110     pACD.setPen(QColor(50, 50, 50))
00111
00112     lookupTile = GOSED_LDF.LOOKUP_ACD_TILE
00113     width = tileWidth
00114     for tile in GOSED_LDF.LOOKUP_ACD_YZM:
00115       tileSide = lookupTile[tile]
00116       if tileSide[2] == 3:  width = self.width()
00117       pACD.drawText(width * tileSide[1], tileHeight * tileSide[2],
00118                     width, tileHeight, Qt.AlignCenter, tile)
00119
00120     pACD.end()
00121
00122   def clear(self):
00123     # Pass the background to the final Pixmap
00124     self.final.fill()
00125     bitBlt(self.final, 0, 0, self.background, 0, 0)
00126
00127   def showEvent(self, se):
00128     self.__gui.replot()
00129
00130   def paintEvent(self, pe):
00131     """ Paint Event function for the Side 1 projection, paints its
00132     background and updates it with the current event pixmap (final)
00133     created in GOSED_LDF. If no data passed the filter for ACD, final
00134     will be updated as the background.
00135
00136     \param pe            paint event
00137     """
00138     self.paintFace()
00139
00140   def paintFace(self):
00141     # Load the custom widget with the final pixmap
00142     #~ self.drawNames(self.final)# ATK-051110: See comment on drawHatACD
00143     bitBlt(self, 0, 0, self.final, 0, 0)
00144
00145 class drawSide2ACD(QWidget):
00146   """ Draws background Pixmap for the ACD Side 2 projection and updates
00147   the custom widget with the final pixmap processed by GOSED_LDF.
00148   """
00149
00150   def __init__(self, gui, parent = None,name = None,fl = 0):
00151     """ drawSide2ACD contructor
00152
00153     \param parent        None
00154     \param name          None
00155     \param fl            0
00156     """
00157
00158     # Initialize custom widget
00159     QWidget.__init__(self,parent,name,fl)
00160     self.__gui = gui
00161     custWidLayout = QGridLayout(self,1,1,0,6,"custWidLayout")
00162     #~ self.setSizePolicy(QSizePolicy(QSizePolicy(7,7,0,0,self.sizePolicy().hasHeightForWidth())))
00163     self.clearWState(Qt.WState_Polished)
00164     self.setMinimumWidth(81)
00165     self.setMinimumHeight(241)
00166     self.setMaximumWidth(81)
00167     self.setMaximumHeight(241)
00168
00169     tileWidth   = (self.width() - 1)/4
00170     tileHeight  = (self.height()- 1)/5
00171     towerWidth  = self.width()/4
00172     towerHeight = self.height()/4
00173
00174     # Create a null final Pixmap that will indicate if there is
00175     # filtered ACD Side 2 data when it is filled in GOSED_LDF
00176     self.final      = QPixmap(81, 241)#self.width(), self.height())
00177     self.background = QPixmap(81, 241)#self.width(), self.height())
00178
00179     pACD = QPainter(self.background)
00180     pACD.setBrush(QColor("gray"))
00181     pACD.setPen(QColor(140, 140, 140))
00182     pACD.drawRect(0, 0, self.width(), self.height())
00183
00184     # Draw tile boundaries
00185     pACD.setPen(QColor(100, 100, 100))
00186
00187     for i in range(3):
00188       for j in range(5):
00189         pACD.drawRect(tileWidth * i, tileHeight * j,
00190                       tileWidth + 1, tileHeight + 1
00191                       )
00192     pACD.drawRect(tileWidth * 3, 0, tileWidth + 1, self.height())
00193
00194     # Draw tower boundaries
00195     pACD.setPen(QColor(166, 163, 157))
00196
00197     for i in range(1,4):
00198       pACD.drawLine(1, (towerHeight)*i, self.width() - 1, (towerHeight)*i)
00199
00200     pACD.end()
00201
00202     # ATK-051110: Load the names in the background pixmap as default
00203     self.drawNames(self.background)
00204
00205     self.paintFace()
00206
00207   def drawNames(self, pixmap):
00208     tileWidth   = (self.width() - 1)/4
00209     tileHeight  = (self.height()- 1)/5
00210
00211     pACD = QPainter(pixmap)
00212
00213     # Draw tile name
00214     pACD.setPen(QColor(50, 50, 50))
00215
00216     lookupTile = GOSED_LDF.LOOKUP_ACD_TILE
00217     height = tileHeight
00218     for tile in GOSED_LDF.LOOKUP_ACD_XZM:
00219       tileSide = lookupTile[tile]
00220       if tileSide[1] == 3:  height = self.height()
00221       x = tileWidth * tileSide[1] + (tileWidth/2 - 5) # I don't understand ...
00222       y = height    * tileSide[2] + (height/2 + 10)   # ...these offsets
00223       pACD.translate(x, y)
00224       pACD.rotate(-90.0)
00225       pACD.drawText(0, 0, tileWidth, height, Qt.AlignAuto, tile)
00226       pACD.rotate(90.0)
00227       pACD.translate(-x, -y)
00228
00229     pACD.end()
00230
00231   def clear(self):
00232     # Pass the background to the final Pixmap
00233     self.final.fill()
00234     bitBlt(self.final, 0, 0, self.background, 0, 0)
00235
00236   def showEvent(self, se):
00237     self.__gui.replot()
00238
00239   def paintEvent(self, pe):
00240     """ Paint Event function for the Side 2 projection, paints its
00241     background and updates it with the current event pixmap (final)
00242     created in GOSED_LDF. If no data passed the filter for ACD, final
00243     will be updated as the background.
00244
00245     \param pe            paint event
00246     """
00247
00248     self.paintFace()
00249
00250   def paintFace(self):
00251     # Load the custom widget with the final pixmap
00252     #~ self.drawNames(self.final)# ATK-051110: See comment on drawHatACD
00253     bitBlt(self, 0, 0, self.final, 0, 0)
00254
00255
00256 class drawSide3ACD(QWidget):
00257   """ Draws background Pixmap for the ACD Side 3 projection and updates
00258   the custom widget with the final pixmap processed by GOSED_LDF.
00259   """
00260
00261   def __init__(self, gui, parent = None,name = None,fl = 0):
00262     """ drawSide3ACD contructor
00263
00264     \param parent        None
00265     \param name          None
00266     \param fl            0
00267     """
00268
00269     # Initialize custom widget
00270     QWidget.__init__(self,parent,name,fl)
00271     self.__gui = gui
00272     custWidLayout = QGridLayout(self,1,1,0,6,"custWidLayout")
00273     #~ self.setSizePolicy(QSizePolicy(QSizePolicy(7,7,0,0,self.sizePolicy().hasHeightForWidth())))
00274     self.clearWState(Qt.WState_Polished)
00275     self.setMinimumWidth(241)
00276     self.setMinimumHeight(81)
00277     self.setMaximumWidth(241)
00278     self.setMaximumHeight(81)
00279
00280     tileWidth   = (self.width()  - 1)/5
00281     tileHeight  = (self.height() - 1)/4
00282     towerWidth  = self.width()/4
00283     towerHeight = self.height()/4
00284
00285     # Create a null final Pixmap that will indicate if there is
00286     # filtered ACD Side 3 data when it is filled in GOSED_LDF
00287     self.final      = QPixmap(241, 81)#self.width(), self.height())
00288     self.background = QPixmap(241, 81)#self.width(), self.height())
00289
00290     pACD = QPainter(self.background)
00291     pACD.setBrush(QColor("gray"))
00292     pACD.setPen(QColor(140, 140, 140))
00293     pACD.drawRect(0, 0, self.width(), self.height())
00294
00295     # Draw tile boundaries
00296     pACD.setPen(QColor(100, 100, 100))
00297
00298     for i in range(5):
00299       for j in range(1, 4):
00300         pACD.drawRect(tileWidth *i,  tileHeight * j,
00301                       tileWidth + 1, tileHeight + 1
00302                       )
00303     pACD.drawRect(0, 0, self.width(), tileHeight + 1)
00304
00305     # Draw tower boundaries
00306     pACD.setPen(QColor(166, 163, 157))
00307
00308     for i in range(1,4):
00309       pACD.drawLine((towerWidth)*i, 1, (towerWidth)*i, self.height() - 1)
00310
00311     pACD.end()
00312
00313     # ATK-051110: Load the names in the background pixmap as default
00314     self.drawNames(self.background)
00315
00316     self.paintFace()
00317
00318   def drawNames(self, pixmap):
00319     tileWidth   = (self.width()  - 1)/5
00320     tileHeight  = (self.height() - 1)/4
00321
00322     pACD = QPainter(pixmap)
00323
00324     # Draw tile name
00325     pACD.setPen(QColor(50, 50, 50))
00326
00327     lookupTile = GOSED_LDF.LOOKUP_ACD_TILE
00328     width = tileWidth
00329     for tile in GOSED_LDF.LOOKUP_ACD_YZP:
00330       tileSide = lookupTile[tile]
00331       if tileSide[2] == 0:  width = self.width()
00332       pACD.drawText(width * tileSide[1], tileHeight * tileSide[2],
00333                     width, tileHeight, Qt.AlignCenter, tile)
00334
00335     pACD.end()
00336
00337   def clear(self):
00338     # Pass the background to the final Pixmap
00339     self.final.fill()
00340     bitBlt(self.final, 0, 0, self.background, 0, 0)
00341
00342   def showEvent(self, se):
00343     self.__gui.replot()
00344
00345   def paintEvent(self, pe):
00346     """ Paint Event function for the Side 3 projection, paints its
00347     background and updates it with the current event pixmap (final)
00348     created in GOSED_LDF. If no data passed the filter for ACD, final
00349     will be updated as the background.
00350
00351     \param pe            paint event
00352     """
00353
00354     self.paintFace()
00355
00356   def paintFace(self):
00357     # Load the custom widget with the final pixmap
00358     #~ self.drawNames(self.final) # ATK-051110: See comment on drawHatACD
00359     bitBlt(self, 0, 0, self.final, 0, 0)
00360
00361
00362 class drawSide4ACD(QWidget):
00363   """ Draws background Pixmap for the ACD Side 4 projection and updates
00364   the custom widget with the final pixmap processed by GOSED_LDF.
00365   """
00366
00367   def __init__(self, gui, parent = None,name = None,fl = 0):
00368     """ drawSide4ACD contructor
00369
00370     \param parent        None
00371     \param name          None
00372     \param fl            0
00373     """
00374
00375     # Initialize custom widget
00376     QWidget.__init__(self,parent,name,fl)
00377     self.__gui = gui
00378     custWidLayout = QGridLayout(self,1,1,0,6,"custWidLayout")
00379     #~ self.setSizePolicy(QSizePolicy(QSizePolicy(7,7,0,0,self.sizePolicy().hasHeightForWidth())))
00380     self.clearWState(Qt.WState_Polished)
00381     self.setMinimumWidth(81)
00382     self.setMinimumHeight(241)
00383     self.setMaximumWidth(81)
00384     self.setMaximumHeight(241)
00385
00386     tileWidth   = (self.width()  - 1)/4
00387     tileHeight  = (self.height() - 1)/5
00388     towerWidth  = self.width()/4
00389     towerHeight = self.height()/4
00390
00391     # Create a null final Pixmap that will indicate if there is
00392     # filtered ACD Side 4 data when it is filled in GOSED_LDF
00393     self.final      = QPixmap(self.width(), self.height())
00394     self.background = QPixmap(self.width(), self.height())
00395
00396     pACD = QPainter(self.background)
00397     pACD.setBrush(QColor("gray"))
00398     pACD.setPen(QColor(140, 140, 140))
00399     pACD.drawRect(0, 0, self.width(), self.height())
00400
00401     # Draw tile boundaries
00402     pACD.setPen(QColor(100, 100, 100))
00403
00404     for i in range(1,4):
00405       for j in range(5):
00406         pACD.drawRect(tileWidth * i, tileHeight * j,
00407                       tileWidth + 1, tileHeight + 1
00408                       )
00409     pACD.drawRect(0, 0, tileWidth + 1, self.height())
00410
00411     # Draw tower boundaries
00412     pACD.setPen(QColor(166, 163, 157))
00413
00414     for i in range(1,4):
00415       pACD.drawLine(1, (towerHeight)*i, self.width() - 1, (towerHeight)*i)
00416
00417     pACD.end()
00418
00419     # ATK-051110: Load the names in the background pixmap as default
00420     self.drawNames(self.background)
00421
00422     self.paintFace()
00423
00424   def drawNames(self, pixmap):
00425     tileWidth   = (self.width()  - 1)/4
00426     tileHeight  = (self.height() - 1)/5
00427
00428     pACD = QPainter(pixmap)
00429     #pACD.setRasterOp(Qt.XorROP)         # Set pen color to background...
00430
00431     # Draw tile name
00432     #pACD.setPen(QColor("gray"))         # Same as brush color for background
00433     pACD.setPen(QColor(50, 50, 50))
00434
00435     lookupTile = GOSED_LDF.LOOKUP_ACD_TILE
00436     height = tileHeight
00437     for tile in GOSED_LDF.LOOKUP_ACD_XZP:
00438       tileSide = lookupTile[tile]
00439       if tileSide[1] == 0:  height = self.height()
00440       x = tileWidth * tileSide[1] + (tileWidth - 2) # I don't understand ...
00441       y = height    * tileSide[2] + (height/2 - 9)  # ...these offsets
00442       pACD.translate(x, y)
00443       pACD.rotate(90.0)
00444       pACD.drawText(0, 0, tileWidth, height, Qt.AlignAuto, tile)
00445       pACD.rotate(-90.0)
00446       pACD.translate(-x, -y)
00447
00448     pACD.end()
00449
00450   def clear(self):
00451     # Pass the background to the final Pixmap
00452     self.final.fill()
00453     bitBlt(self.final, 0, 0, self.background, 0, 0)
00454
00455   def showEvent(self, se):
00456     self.__gui.replot()
00457
00458   def paintEvent(self, pe):
00459     """ Paint Event function for the Side 4 projection, paints its
00460     background and updates it with the current event pixmap (final)
00461     created in GOSED_LDF. If no data passed the filter for ACD, final
00462     will be updated as the background.
00463
00464     \param pe            paint event
00465     """
00466
00467     self.paintFace()
00468
00469   def paintFace(self):
00470     # Load the custom widget with the final pixmap
00471     #~ self.drawNames(self.final) # ATK-051110: See comment on drawHatACD
00472     bitBlt(self, 0, 0, self.final, 0, 0)
00473
00474
00475 class drawHatACD(QWidget):
00476   """ Draws background Pixmap for the ACD Hat projection and updates
00477   the custom widget with the final pixmap processed by GOSED_LDF.
00478   """
00479
00480   def __init__(self, gui, parent = None,name = None,fl = 0):
00481     """ drawHatACD contructor
00482
00483     \param parent        None
00484     \param name          None
00485     \param fl            0
00486     """
00487
00488     # Initialize custom widget
00489     QWidget.__init__(self,parent,name,fl)
00490     self.__gui = gui
00491     custWidLayout = QGridLayout(self,1,1,0,6,"custWidLayout")
00492     #~ self.setSizePolicy(QSizePolicy(QSizePolicy(7,7,0,0,self.sizePolicy().hasHeightForWidth())))
00493     self.clearWState(Qt.WState_Polished)
00494     self.setMinimumWidth(241)
00495     self.setMinimumHeight(241)
00496     self.setMaximumWidth(241)
00497     self.setMaximumHeight(241)
00498
00499     tileWidth   = (self.width()  - 1)/5
00500     tileHeight  = (self.height() - 1)/5
00501     towerWidth  = self.width()/4
00502     towerHeight = self.height()/4
00503
00504     # Create a null final Pixmap that will indicate if there is
00505     # filtered ACD Hat (top) data when it is filled in GOSED_LDF
00506     self.final      = QPixmap(self.width(), self.height())
00507     self.background = QPixmap(self.width(), self.height())
00508
00509
00510     pACD = QPainter(self.background)
00511     pACD.setBrush(QColor("gray"))
00512     pACD.setPen(QColor(140, 140, 140))
00513     pACD.drawRect(0, 0, self.width(), self.height())
00514
00515     # Draw tile boundaries
00516     pACD.setPen(QColor(100, 100, 100))
00517
00518     for j in range(5):
00519       for i in range(5):
00520         pACD.drawRect(tileWidth * i, tileHeight * j,
00521                       tileWidth + 1, tileHeight + 1
00522                       )
00523
00524     # Draw tower boundaries
00525     pACD.setPen(QColor(166, 163, 157))
00526
00527     for i in range(1,4):
00528       pACD.drawLine((towerWidth)*i, 1,
00529                        (towerWidth)*i, self.height() - 1
00530                        )
00531       pACD.drawLine(1, (towerHeight)*i,
00532                        self.width() - 1, (towerHeight)*i
00533                        )
00534
00535     pACD.end()
00536
00537     # ATK-051110: Load the names in the background pixmap as default
00538     self.drawNames(self.background)
00539
00540     self.paintFace()
00541
00542   def drawNames(self, pixmap):
00543     tileWidth   = (self.width()  - 1)/5
00544     tileHeight  = (self.height() - 1)/5
00545
00546     pACD = QPainter(pixmap)
00547
00548     # Draw tile name
00549     pACD.setPen(QColor(50, 50, 50))
00550
00551     lookupTile = GOSED_LDF.LOOKUP_ACD_TILE
00552     for tile in GOSED_LDF.LOOKUP_ACD_XY:
00553       tileSide = lookupTile[tile]
00554       pACD.drawText(tileWidth * tileSide[1], tileHeight * tileSide[2],
00555                          tileWidth, tileHeight, Qt.AlignCenter, tile)
00556
00557     pACD.end()
00558
00559   def clear(self):
00560     # Pass the background to the final Pixmap
00561     self.final.fill()
00562     bitBlt(self.final, 0, 0, self.background, 0, 0)
00563
00564   def showEvent(self, se):
00565     self.__gui.replot()
00566
00567   def paintEvent(self, pe):
00568     """ Paint Event function for the Hat projection, paints its
00569     background and updates it with the current event pixmap (final)
00570     created in GOSED_LDF. If no data passed the filter for ACD, final
00571     will be updated as the background.
00572
00573     \param pe            paint event
00574     """
00575     self.paintFace()
00576
00577   def paintFace(self):
00578     # Load the custom widget with the final pixmap
00579     # ATK-051110: The names can't be loaded here. The operation takes
00580     # time and makes the display flicker. Instead 1. drawNames to the
00581     # background pixmap as default.
00582     # If the pixmap gets populated in GOSED_LDF, drawNames to the final
00583     # pixmap there as part of the iteration process.
00584     #~ self.drawNames(self.final)
00585     bitBlt(self, 0 , 0, self.final, 0, 0)
00586
00587
00588 class drawXZ_TKR(QWidget):
00589   """ Draws background Pixmap for the XZ TKR projection and updates
00590   the custom widget with the final pixmap processed by GOSED_LDF.
00591   """
00592
00593   def __init__(self, gui, parent = None,name = None,fl = 0):
00594     """ drawXZ_TKR contructor
00595
00596     \param parent        None
00597     \param name          None
00598     \param fl            0
00599     """
00600
00601     # Initialize custom widget
00602     QWidget.__init__(self,parent,name,fl)
00603     self.__gui = gui
00604     custWidLayout = QGridLayout(self,1,1,0,6,"custWidLayout")
00605     self.clearWState(Qt.WState_Polished)
00606
00607     # Create a null final Pixmap that will indicate if there is
00608     # filtered TKR data when it is filled in GOSED_LDF
00609     self.final      = QPixmap(145, 254)
00610     self.background = QPixmap(145, 254)
00611
00612     # Initialize painter
00613     pTKR = QPainter(self.background)
00614     pTKR.setBrush(QColor("gray"))#110, 110, 110)) #"white"))
00615     pTKR.setPen(QColor(170, 170, 160))
00616     #~ pTKR.setPen(QColor("lightgray"))
00617
00618     # Draw background
00619     pTKR.drawRect(0, 0, 145, 254)
00620     for y in range(36):
00621       if y in RANGE1_TKR_X:
00622         pTKR.setPen(QColor(140,140,150))
00623         pTKR.drawRect( 0, y*7, 145, 8)
00624
00625       elif y in RANGE2_TKR_X:
00626         pTKR.setPen(QColor(140,140,150))
00627         pTKR.drawRect(0, y*7 + 1, 145, 8)
00628
00629       elif y != 0 and y in range (0, 36, 2):
00630         pTKR.setPen(QColor("lightgray"))
00631         pTKR.drawLine( 0, y*7 + 1, 145, y*7 + 1)
00632         #~ pTKR.drawRect( 1, y*7 - 8, 145, 9)
00633
00634     pTKR.end() # TBErased if implemented directly in frame
00635
00636     self.paintFace()
00637
00638   def clear(self):
00639     # Pass the background to the final Pixmap
00640     self.final.fill()
00641     bitBlt(self.final, 0, 0, self.background)
00642     #~ self.paintFace()
00643
00644   def showEvent(self, se):
00645     self.__gui.replot()
00646
00647   def paintEvent(self, pe):
00648     """ Paint Event function for the XZ TKR projection, paints its
00649     background and updates it with the current event pixmap (final)
00650     created in GOSED_LDF. If no data passed the filter for TKR, final
00651     will be updated as the background.
00652
00653     \param pe            paint event
00654     """
00655
00656     self.paintFace()
00657
00658   def paintFace(self):
00659     # Load the custom widget with the final pixmap
00660     bitBlt(self, 0, 0, self.final)
00661
00662
00663 class drawYZ_TKR(QWidget):
00664   """ Draws background Pixmap for the YZ TKR projection and updates
00665   the custom widget with the final pixmap processed by GOSED_LDF.
00666   """
00667
00668   def __init__(self, gui, parent = None,name = None,fl = 0):
00669     """ drawYZ_TKR constructor
00670
00671     \param parent        None
00672     \param name          None
00673     \param fl            0
00674     """
00675
00676     # Initialize custom widget
00677     QWidget.__init__(self,parent,name,fl)
00678     self.__gui = gui
00679     custWidLayout = QGridLayout(self,1,1,0,6,"custWidLayout")
00680     self.clearWState(Qt.WState_Polished)
00681
00682     # Initialize pixmaps
00683     self.final      = QPixmap(145, 254)
00684     self.background = QPixmap(145, 254)
00685
00686     # Initialize painter
00687     pTKR = QPainter(self.background)
00688     pTKR.setBrush(QColor("gray"))#110, 110, 110)) #"white"))
00689     pTKR.setPen(QColor(170, 170, 160))
00690     #~ pTKR.setBrush(QColor(110, 110, 110)) #"white"))
00691     #~ pTKR.setPen(QColor("lightgray"))
00692
00693     # Draw background
00694     pTKR.drawRect(0, 0, 145, 254)
00695     for y in range(36):
00696       if y in RANGE1_TKR_Y:
00697         pTKR.setPen(QColor(140,140,150))
00698         pTKR.drawRect( 0, y*7 + 1, 145, 8)
00699         #~ pTKR.drawRect( 0, y*7 + 2, 145, 8) #more symm but taller map
00700
00701       elif y in RANGE2_TKR_Y:
00702         pTKR.setPen(QColor(140,140,150))
00703         pTKR.drawRect(0, y*7, 145, 8)
00704         #~ pTKR.drawRect(0, y*7 + 1, 145, 8)
00705
00706       #~ elif y == 2:
00707         #~ pTKR.setPen(QColor("lightgray"))
00708         #~ pTKR.drawLine( 1, y*7, 145, y*7)
00709
00710       elif y in range (0, 36, 2):
00711         pTKR.setPen(QColor("lightgray"))
00712         if y == 2:
00713           pTKR.drawLine( 0, y*7, 145, y*7)
00714         else:
00715           pTKR.drawLine( 0, y*7 + 1, 145, y*7 + 1)
00716
00717     pTKR.end()
00718
00719     self.paintFace()
00720
00721   def clear(self):
00722     # Pass the background to the final Pixmap
00723     self.final.fill()
00724     bitBlt(self.final, 0, 0, self.background)
00725     #~ self.paintFace()
00726
00727   def showEvent(self, se):
00728     self.__gui.replot()
00729
00730   def paintEvent(self, pe):
00731     """ Paint Event function for the YZ TKR projection, paints its
00732     background and updates it with the current event pixmap (final)
00733     created in GOSED_LDF. If no data passed the filter for TKR, final
00734     will be updated as the background.
00735
00736     \param pe            paint event
00737     """
00738
00739     self.paintFace()
00740
00741   def paintFace(self):
00742     # Load the custom widget with the final pixmap
00743     bitBlt(self, 0, 0, self.final)
00744
00745
00746 class drawXZ_CAL(QWidget):
00747   """ Draws background Pixmap for the XZ CAL projection and updates
00748   the custom widget with the final pixmap processed by GOSED_LDF.
00749   """
00750
00751   def __init__(self, gui, parent = None,name = None,fl = 0):
00752     """ drawXZ_CAL constructor
00753
00754     \param parent        None
00755     \param name          None
00756     \param fl            0
00757     """
00758
00759     # Initialize custom widget
00760     QWidget.__init__(self,parent,name,fl)
00761     self.__gui = gui
00762     custWidLayout = QGridLayout(self,1,1,0,6,"custWidLayout")
00763     self.clearWState(Qt.WState_Polished)
00764
00765     # Initialize pixmaps
00766     self.final      = QPixmap(145, 80)
00767     self.background = QPixmap(145, 80)
00768
00769     # Initialize painter
00770     pXZ_CAL = QPainter(self.background)
00771     r, g, b = colorScale.colorScale(0.0)
00772     #~ pXZ_CAL.setBrush(QColor(r, g, b))  #"white"))
00773     #~ pXZ_CAL.setBrush(QColor(110, 110, 110))
00774     #~ pXZ_CAL.setPen(QColor(160,160,170))
00775     pXZ_CAL.setBrush(QColor("gray"))#110, 110, 110)) #"white"))
00776     pXZ_CAL.setPen(QColor(140,140,150))
00777
00778     # Paint background
00779     for y in range(NUM_Z_CAL):
00780       if y in range(0, NUM_Z_CAL, 2):
00781         pXZ_CAL.drawRect(0, y*10, 145, 10)
00782       else:
00783         for x in range(NUM_XY_CAL):
00784           pXZ_CAL.drawRect(x*12, y*10, 13, 10)
00785
00786     pXZ_CAL.end()
00787
00788     self.paintFace()
00789
00790   def clear(self):
00791     # Pass the background to the final Pixmap
00792     self.final.fill()
00793     bitBlt(self.final, 0, 0, self.background)
00794     #~ self.paintFace()
00795
00796   def showEvent(self, se):
00797     self.__gui.replot()
00798
00799   def paintEvent(self, pe):
00800     """ Paint Event function for the XZ CAL projection, paints its
00801     background and updates it with the current event pixmap (final)
00802     created in GOSED_LDF. If no data passed the filter for TKR, final
00803     will be updated as the background.
00804
00805     \param pe            paint event
00806     """
00807
00808     self.paintFace()
00809
00810   def paintFace(self):
00811     # Load the custom widget with the final pixmap
00812     bitBlt(self, 0, 0, self.final)
00813
00814
00815 class drawYZ_CAL(QWidget):
00816   """ Draws background Pixmap for the YZ TKR projection and updates
00817   the custom widget with the final pixmap processed by GOSED_LDF.
00818   """
00819
00820   def __init__(self, gui, parent = None,name = None,fl = 0):
00821     """ drawYZ_CAL constructor
00822
00823     \param parent        None
00824     \param name          None
00825     \param fl            0
00826     """
00827
00828     # Custom Widget setup
00829     QWidget.__init__(self,parent,name,fl)
00830     self.__gui = gui
00831     custWidLayout = QGridLayout(self,1,1,0,6,"custWidLayout")
00832     self.clearWState(Qt.WState_Polished)
00833
00834     # Create a null final Pixmap that will indicate if there is
00835     # filtered CAL data when it is filled in GOSED_LDF
00836     #CELLVERTPITCH = int( 21.35 / 2.0)
00837     #CELLHORPITCH  = int( 27.84 / 2.0)
00838     #CSILENGTH     = int(326.00 / 2.0)
00839     #CSIWIDTH      = int( 26.70 / 2.0)
00840     #CSIHEIGHT     = int( 19.90 / 2.0)
00841
00842     self.final      = QPixmap(145, 80)
00843     self.background = QPixmap(145, 80)
00844     #self.setMinimumWidth(NUM_XY_CAL * CELLHORPITCH)
00845     #self.setMinimumHeight(NUM_Z_CAL * CELLVERTPITCH)
00846     #self.setMaximumWidth(NUM_XY_CAL * CELLHORPITCH)
00847     #self.setMaximumHeight(NUM_Z_CAL * CELLVERTPITCH)
00848
00849     #self.final      = QPixmap(NUM_XY_CAL * CELLHORPITCH, NUM_Z_CAL * CELLVERTPITCH)
00850     #self.background = QPixmap(NUM_XY_CAL * CELLHORPITCH, NUM_Z_CAL * CELLVERTPITCH)
00851
00852     # Start painter
00853     pYZ_CAL = QPainter(self.background)
00854     r, g, b = colorScale.colorScale(0.0)
00855     #~ pYZ_CAL.setBrush(QColor(r, g, b))  #"white"))
00856     #~ pYZ_CAL.setBrush(QColor(110, 110, 110))
00857     #~ pYZ_CAL.setPen(QColor(160,160,170))
00858     pYZ_CAL.setBrush(QColor("gray"))#110, 110, 110)) #"white"))
00859     pYZ_CAL.setPen(QColor(140,140,150))
00860
00861     # Paint background in background Pixmap
00862     for y in range(NUM_Z_CAL):
00863       if y in range(1, NUM_Z_CAL, 2):
00864         pYZ_CAL.drawRect(0, y*10, 145, 10)
00865         #pYZ_CAL.drawRect(0, y*CELLVERTPITCH, NUM_XY_CAL * CELLHORPITCH, CELLVERTPITCH)
00866       else:
00867         for x in range(NUM_XY_CAL):
00868           pYZ_CAL.drawRect(x*12, y*10, 13, 10)
00869           #pYZ_CAL.drawRect(x*CELLHORPITCH, y*CELLVERTPITCH, CELLHORPITCH, CELLVERTPITCH)
00870
00871     pYZ_CAL.end()
00872
00873     self.paintFace()
00874
00875   def clear(self):
00876     # Pass the background to the final Pixmap
00877     self.final.fill()
00878     bitBlt(self.final, 0, 0, self.background)
00879     #~ self.paintFace()
00880
00881   def showEvent(self, se):
00882     self.__gui.replot()
00883
00884   def paintEvent(self, pe):
00885     """ Paint Event function for the YZ CAL projection, paints its
00886     background and updates it with the current event pixmap (final)
00887     created in GOSED_LDF. If no data passed the filter for TKR, final
00888     will be updated as the background.
00889
00890     \param pe            paint event
00891     """
00892
00893     self.paintFace()
00894
00895   def paintFace(self):
00896     # Load the custom widget with the final pixmap
00897     bitBlt(self, 0, 0, self.final)
00898
00899 class drawRainbowACD(QWidget):
00900   """ Draws background Pixmap for the ACD Rainbow and updates
00901   the custom widget with the final pixmap.
00902   """
00903
00904   def __init__(self, gui, parent = None,name = None,fl = 0):
00905     """ drawRainbowACD constructor
00906
00907     \param parent        None
00908     \param name          None
00909     \param fl            0
00910     """
00911
00912     # Custom Widget setup
00913     QWidget.__init__(self,parent,name,fl)
00914     self.__gui = gui
00915     custWidLayout = QGridLayout(self,1,1,0,6,"custWidLayout")
00916     self.clearWState(Qt.WState_Polished)
00917
00918     self.rainbowACD = QPixmap(440, 15)
00919     p = QPainter(self.rainbowACD)
00920
00921     minV  = 1.0e-15
00922     maxV  = 1.0 - minV
00923     value = minV
00924
00925     # Divide length of the frame (440) in intervals of 1
00926     dV = (maxV - minV) / float(440)
00927     tileWidth  = 1
00928     tileHeight = 15
00929     for i in range(0, 440):
00930       r, g, b = colorScale.colorScale(value)
00931       p.setBrush(QColor(r, g, b))
00932       p.setPen(QColor(r, g, b))
00933       p.drawRect(i*tileWidth,                0,
00934                  (i + 1)*tileWidth, tileHeight
00935                  )
00936       value += dV
00937     p.end()
00938
00939     self.paintRainbowACD()
00940
00941   def paintEvent(self, pe):
00942     """ Paint Event function for the ACD rainbow.
00943
00944     \param pe            paint event
00945     """
00946
00947     self.paintRainbowACD()
00948
00949   def paintRainbowACD(self):
00950     # Load the custom widget with the final pixmap
00951     bitBlt(self, 0, 0, self.rainbowACD)
00952
00953 class drawRainbowCAL(QWidget):
00954   """ Draws background Pixmap for the CAL Rainbow and updates
00955   the custom widget with the final pixmap.
00956   """
00957
00958   def __init__(self, gui, parent = None,name = None,fl = 0):
00959     """ drawRainbowCAL constructor
00960
00961     \param parent        None
00962     \param name          None
00963     \param fl            0
00964     """
00965
00966     # Custom Widget setup
00967     QWidget.__init__(self,parent,name,fl)
00968     self.__gui = gui
00969     custWidLayout = QGridLayout(self,1,1,0,6,"custWidLayout")
00970     self.clearWState(Qt.WState_Polished)
00971
00972     self.rainbowCAL = QPixmap(410, 15)
00973     p = QPainter(self.rainbowCAL)
00974
00975     minV  = 1.0e-15
00976     maxV  = 1.0 - minV
00977     value = minV
00978
00979     # Divide length of the frame (410) in intervals of 1
00980     dV = (maxV - minV) / float(410)
00981     tileWidth  = 1
00982     tileHeight = 15
00983     for i in range(0, 410):
00984       r, g, b = colorScale.colorScale(value)
00985       p.setBrush(QColor(r, g, b))
00986       p.setPen(QColor(r, g, b))
00987       p.drawRect(i*tileWidth,                0,
00988                  (i + 1)*tileWidth, tileHeight
00989                  )
00990       value += dV
00991     p.end()
00992
00993     self.paintRainbowCAL()
00994
00995   def paintEvent(self, pe):
00996     """ Paint Event function for the CAL rainbow.
00997
00998     \param pe            paint event
00999     """
01000
01001     self.paintRainbowCAL()
01002
01003   def paintRainbowCAL(self):
01004     # Load the custom widget with the final pixmap
01005     bitBlt(self, 0, 0, self.rainbowCAL)
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GOSEDPreferencesImpl.py Source File

gosed

GOSEDPreferencesImpl.py

00001 # -*- coding: utf-8 -*-
00002 #!/usr/local/bin/python
00003 #
00004 #                               Copyright 2003
00005 #                                     by
00006 #                        The Board of Trustees of the
00007 #                     Leland Stanford Junior University.
00008 #                            All rights reserved.
00009 #
00010
00011 __facility__ = "Online"
00012 __abstract__ = "GLAST Online Single Event Display preferences handler"
00013 __author__   = "A. Kavelaars <aliciak@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = "12/12/2003"
00015 __version__  = "$Revision: 1.18 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import sys
00021 import os, string
00022 from qt import *
00023 import Numeric
00024 import logging as myLog
00025 from GOSEDPreferences import GOSEDPreferences
00026 import ConfigParser
00027
00028
00029 class GOSEDPreferencesImpl(GOSEDPreferences):
00030   """!
00031   \brief Class for managing a GOSED user's preferences
00032
00033   GOSED keeps a user's preferences information in a file that is called
00034   .gosedrc when os.name returns 'posix', and gosed.cfg otherwise, e.g. Windows.
00035   If the file doesn't exist, a set of defaults are used.  These will be written
00036   to a file in the gosed source directory if it is writable.  GOSED searches
00037   for the preferences file in the following directories in the order specified:
00038   the current directory, the directory pointed to by the HOME environment
00039   variable, and the gosed source directory.
00040   """
00041   # Revisit: A button should be provided for the user to save the preferences
00042   #          file.  No attempt should be made to save the file otherwise.  The
00043   #          user should be able to select where this file is saved.
00044   # Revisit: If the gosed source directory is write protected, the user has no
00045   #          way to obtain or create a preferences file, unless he can copy one
00046   #          from somewhere else.
00047   def __init__(self, confParser, parent = None,name = None,modal = 0,fl = 0):
00048     GOSEDPreferences.__init__(self,parent,name,modal,fl)
00049
00050     self.__gui = parent
00051
00052     self.__twr     = True
00053     self.__calTkr  = True
00054     self.__data    = True
00055     self.__tkr     = False
00056     self.__acd     = False
00057     self.__cal     = False
00058     self.__ted     = False
00059     self.__acdPeds = None
00060     self.__calPeds = None
00061
00062     self.timestepValue.setText("1")
00063     self.connect(self.timestepSlider, SIGNAL('valueChanged(int)'), self.changeStepValue)
00064     self.connect(self.scaleBox, SIGNAL('clicked(int)'), self.selectScale)
00065     self.connect(self.scaleBox2, SIGNAL('clicked(int)'), self.selectScale2)
00066     self.connect(self.scaleBoxACD, SIGNAL('clicked(int)'), self.selectScaleACD)
00067
00068     self.connect(self.pedsBoxACD, SIGNAL('clicked(int)'), self.selectACDPeds)
00069     self.connect(self.pedsBoxCAL, SIGNAL('clicked(int)'), self.selectCALPeds)
00070     self.connect(self.acdPedsButton, SIGNAL('clicked()'), self.selectACDPedsFile)
00071     self.connect(self.calPedsButton, SIGNAL('clicked()'), self.selectCALPedsFile)
00072
00073     self.connect(self.buttonOk, SIGNAL('clicked()'), self.saveGOSED)
00074
00075     self.__confParser = confParser
00076
00077     # Revisit: Should check --config option and use that, if supplied
00078     if os.name == "posix":
00079       configName = ".gosedrc"
00080     else:
00081       configName = "gosed.cfg"
00082
00083     configFile = "./" + configName      # Current directory
00084     if not os.path.exists(configFile):
00085       try:
00086         home = os.environ['HOME']
00087         configFile = os.path.join(home, configName)    # Home directory
00088       except KeyError:
00089         pass
00090       if not os.path.exists(configFile):
00091         configFile = os.path.join(os.environ['ONLINE_ROOT'], # Source directory
00092                                   'LATTE/gosed/' + configName)
00093     self.__configFile = configFile
00094
00095     cp = self.__confParser
00096     if os.path.exists(self.__configFile):
00097       cp.read(self.__configFile)
00098       try:
00099         self.timestepValue.setText(cp.get("gosed options", "timestep"))
00100         preferredLimits = cp.get("gosed options", "preferredlimits")
00101         preferredLimits2 = cp.get("gosed options", "preferredlimits2")
00102         self.minEdit.setText(cp.get("gosed options", "min"))
00103         self.maxEdit.setText(cp.get("gosed options", "max"))
00104         self.minEdit2.setText(cp.get("gosed options", "min2"))
00105         self.maxEdit2.setText(cp.get("gosed options", "max2"))
00106         #~ if preferredLimits == "Event":
00107           #~ self.EventlimitsButton.setChecked(1)
00108         if preferredLimits == "Custom":
00109           self.CustomlimitsButton.setChecked(1)
00110           self.selectScale()
00111         else:# preferredLimits == "Default":
00112           self.CALlimitsButton.setChecked(1)
00113         if preferredLimits2 == "Custom":
00114           self.CustomlimitsButton2.setChecked(1)
00115           self.selectScale2()
00116         else:# preferredLimits == "Default":
00117           self.CALlimitsButton2.setChecked(1)
00118
00119         preferredLimits = cp.get("gosed options", "ACDpreferredLimits")
00120         self.minEditACD.setText(cp.get("gosed options", "minacd"))
00121         self.maxEditACD.setText(cp.get("gosed options", "maxacd"))
00122         if preferredLimits == "Default":
00123           self.ACDlimitsButton.setChecked(1)
00124         elif preferredLimits == "Custom":
00125           self.ACDCustomlimitsButton.setChecked(1)
00126           self.selectScaleACD()
00127
00128         mainWidth  = int(cp.get("gosed options", "mainWidth"))
00129         mainHeight = int(cp.get("gosed options", "mainHeight"))
00130         self.__gui.resize(mainWidth, mainHeight)
00131
00132         acdPedsFile = cp.get("gosed options", "acdpeds")
00133         if acdPedsFile == "Default":
00134           self.ACDDefaultPedsButton.setChecked(1)
00135         else:
00136           self.ACDCustomPedsButton.setChecked(1)
00137           self.acdPeds.setText(acdPedsFile)
00138         self.selectACDPeds()
00139
00140         calPedsFile = cp.get("gosed options", "calpeds")
00141         if calPedsFile == "Default":
00142           self.CALDefaultPedsButton.setChecked(1)
00143         else:
00144           self.CALCustomPedsButton.setChecked(1)
00145           self.calPeds.setText(calPedsFile)
00146         self.selectCALPeds()
00147
00148         self.__twr    = str(cp.get("gosed options", "twr")) == 'True'
00149         self.__calTkr = str(cp.get("gosed options", "caltkr")) == 'True'
00150         self.__data   = str(cp.get("gosed options", "data")) == 'True'
00151         self.__tkr    = str(cp.get("gosed options", "tkr")) == 'True'
00152         self.__acd    = str(cp.get("gosed options", "acd")) == 'True'
00153         self.__cal    = str(cp.get("gosed options", "cal")) == 'True'
00154         self.__ted    = str(cp.get("gosed options", "ted")) == 'True'
00155       except ConfigParser.NoSectionError:
00156         # Old behaviour
00157         self.CALlimitsButton.setChecked(1)
00158         self.CALlimitsButton2.setChecked(1)
00159         self.ACDlimitsButton.setChecked(1)
00160         self.ACDDefaultPedsButton.setChecked(1)
00161         self.CALDefaultPedsButton.setChecked(1)
00162         cp.add_section("gosed options")
00163         self.__defaults()
00164       except ConfigParser.NoOptionError:
00165         self.CALlimitsButton.setChecked(1)
00166         self.CALlimitsButton2.setChecked(1)
00167         self.ACDlimitsButton.setChecked(1)
00168         self.ACDDefaultPedsButton.setChecked(1)
00169         self.CALDefaultPedsButton.setChecked(1)
00170         self.__defaults()
00171
00172     else:
00173       cp.add_section("gosed options")
00174       self.CALlimitsButton.setChecked(1)
00175       self.CALlimitsButton2.setChecked(1)
00176       self.ACDlimitsButton.setChecked(1)
00177       self.ACDDefaultPedsButton.setChecked(1)
00178       self.CALDefaultPedsButton.setChecked(1)
00179       self.__defaults()
00180
00181     self.readPedestals()
00182
00183   def __defaults(self):
00184     cp = self.__confParser
00185     cp.set("gosed options", "timestep", '1')
00186     cp.set("gosed options", "preferredLimits", 'Default')
00187     cp.set("gosed options", "min", str(0))
00188     cp.set("gosed options", "max", str(1000))
00189     cp.set("gosed options", "preferredLimits2", 'Default')
00190     cp.set("gosed options", "min2", str(0))
00191     cp.set("gosed options", "max2", str(1000))
00192     cp.set("gosed options", "ACDpreferredLimits", 'Default')
00193     cp.set("gosed options", "minACD", str(0))
00194     cp.set("gosed options", "maxACD", str(4000))
00195     cp.set("gosed options", "acdpeds", 'Default')
00196     cp.set("gosed options", "calpeds", 'Default')
00197     #~ cp.set("gosed options", "mainWidth",  self.__gui.width())
00198     #~ cp.set("gosed options", "mainHeight", self.__gui.height())
00199
00200   def changeStepValue(self):
00201     self.timestepValue.setText(str(float(self.timestepSlider.value())/10.))
00202
00203   def setCustomEnabled(self, status):
00204     if status == 1:
00205       self.CustomlimitsButton.setEnabled(1)
00206     else:
00207       self.CustomlimitsButton.setEnabled(0)
00208
00209   def setCustomEnabled2(self, status):
00210     if status == 1:
00211       self.CustomlimitsButton2.setEnabled(1)
00212     else:
00213       self.CustomlimitsButton2.setEnabled(0)
00214
00215   def setACDCustomEnabled(self, status):
00216     if status == 1:
00217       self.ACDCustomlimitsButton.setEnabled(1)
00218     else:
00219       self.ACDCustomlimitsButton.setEnabled(0)
00220
00221   def selectScale(self):
00222     if self.CustomlimitsButton.isChecked():
00223       self.minEdit.setEnabled(1)
00224       self.maxEdit.setEnabled(1)
00225       self.minLbl.setEnabled(1)
00226       self.maxLbl.setEnabled(1)
00227     else:
00228       self.minEdit.setEnabled(0)
00229       self.maxEdit.setEnabled(0)
00230       self.minLbl.setEnabled(0)
00231       self.maxLbl.setEnabled(0)
00232       self.minEdit.setText("0")
00233       self.maxEdit.setText("1000")
00234
00235   def selectScale2(self):
00236     if self.CustomlimitsButton2.isChecked():
00237       self.minEdit2.setEnabled(1)
00238       self.maxEdit2.setEnabled(1)
00239       self.minLbl2.setEnabled(1)
00240       self.maxLbl2.setEnabled(1)
00241     else:
00242       self.minEdit2.setEnabled(0)
00243       self.maxEdit2.setEnabled(0)
00244       self.minLbl2.setEnabled(0)
00245       self.maxLbl2.setEnabled(0)
00246       self.minEdit2.setText("0")
00247       self.maxEdit2.setText("1000")
00248
00249   def selectScaleACD(self):
00250     if self.ACDCustomlimitsButton.isChecked():
00251       self.minEditACD.setEnabled(1)
00252       self.maxEditACD.setEnabled(1)
00253       self.minLblACD.setEnabled(1)
00254       self.maxLblACD.setEnabled(1)
00255     else:
00256       self.minEditACD.setEnabled(0)
00257       self.maxEditACD.setEnabled(0)
00258       self.minLblACD.setEnabled(0)
00259       self.maxLblACD.setEnabled(0)
00260       self.minEditACD.setText("0")
00261       self.maxEditACD.setText("4000")
00262
00263   def minCAL(self):
00264     min = 0
00265     if self.CustomlimitsButton.isChecked():
00266       try:
00267         min = int(str(self.__gui.GOSEDPreferencesGUI.minEdit.text()))
00268       except ValueError:
00269         print "CAL Window scale min value %s is not a number" % \
00270               str(self.__gui.GOSEDPreferencesGUI.minEdit.text())
00271         self.__gui.GOSEDPreferencesGUI.minEdit.setText(str(min))
00272     return min
00273
00274   def maxCAL(self):
00275     max = 1000
00276     if self.CustomlimitsButton.isChecked():
00277       try:
00278         max = int(str(self.__gui.GOSEDPreferencesGUI.maxEdit.text()))
00279       except ValueError:
00280         print "CAL Window scale max value %s is not a number" % \
00281               str(self.__gui.GOSEDPreferencesGUI.maxEdit.text())
00282         self.__gui.GOSEDPreferencesGUI.maxEdit.setText(str(max))
00283     return max
00284
00285   def minCAL2(self):
00286     min2 = 0
00287     if self.CustomlimitsButton2.isChecked():
00288       try:
00289         min2 = int(str(self.__gui.GOSEDPreferencesGUI.minEdit2.text()))
00290       except ValueError:
00291         print "CAL and TKR Window scale min value %s is not a number" % \
00292               str(self.__gui.GOSEDPreferencesGUI.minEdit2.text())
00293         self.__gui.GOSEDPreferencesGUI.minEdit2.setText(str(min2))
00294     return min2
00295
00296   def maxCAL2(self):
00297     max2 = 1000
00298     if self.CustomlimitsButton2.isChecked():
00299       try:
00300         max2 = int(str(self.__gui.GOSEDPreferencesGUI.maxEdit2.text()))
00301       except ValueError:
00302         print "CAL and TKR Window scale max value %s is not a number" % \
00303               str(self.__gui.GOSEDPreferencesGUI.maxEdit2.text())
00304         self.__gui.GOSEDPreferencesGUI.maxEdit2.setText(str(max2))
00305     return max2
00306
00307   def minACD(self):
00308     min = 0
00309     if self.ACDCustomlimitsButton.isChecked():
00310       try:
00311         min = int(str(self.__gui.GOSEDPreferencesGUI.minEditACD.text()))
00312       except ValueError:
00313         print "ACD min value %s is not a number" % \
00314               str(self.__gui.GOSEDPreferencesGUI.minEditACD.text())
00315         self.__gui.GOSEDPreferencesGUI.minEditACD.setText(str(min))
00316     return min
00317
00318   def maxACD(self):
00319     max = 4000
00320     if self.ACDCustomlimitsButton.isChecked():
00321       try:
00322         max = int(str(self.__gui.GOSEDPreferencesGUI.maxEditACD.text()))
00323       except ValueError:
00324         print "ACD max value %s is not a number" % \
00325               str(self.__gui.GOSEDPreferencesGUI.maxEditACD.text())
00326         self.__gui.GOSEDPreferencesGUI.maxEditACD.setText(str(max))
00327     return max
00328
00329   def twr(self, hide = None):
00330     value = self.__twr
00331     if hide is not None:  self.__twr = hide
00332     return value
00333
00334   def calTkr(self, hide = None):
00335     value = self.__calTkr
00336     if hide is not None:  self.__calTkr = hide
00337     return value
00338
00339   def data(self, hide = None):
00340     value = self.__data
00341     if hide is not None:  self.__data = hide
00342     return value
00343
00344   def tkr(self, hide = None):
00345     value = self.__tkr
00346     if hide is not None:  self.__tkr = hide
00347     return value
00348
00349   def acd(self, hide = None):
00350     value = self.__acd
00351     if hide is not None:  self.__acd = hide
00352     return value
00353
00354   def cal(self, hide = None):
00355     value = self.__cal
00356     if hide is not None:  self.__cal = hide
00357     return value
00358
00359   def ted(self, hide = None):
00360     value = self.__ted
00361     if hide is not None:  self.__ted = hide
00362     return value
00363
00364   def selectACDPeds(self):
00365     """ Operates the widget behaviour for the ACD Pedestal File
00366         type selection, default or custom.
00367     """
00368     if self.ACDDefaultPedsButton.isChecked():
00369       self.acdPeds.setEnabled(0)
00370       self.acdPedsButton.setEnabled(0)
00371     else:
00372       self.acdPeds.setEnabled(1)
00373       self.acdPedsButton.setEnabled(1)
00374
00375   def selectCALPeds(self):
00376     """ Operates the widget behaviour for the CAL Pedestal File
00377         type selection, default or custom.
00378     """
00379     if self.CALDefaultPedsButton.isChecked():
00380       self.calPeds.setEnabled(0)
00381       self.calPedsButton.setEnabled(0)
00382     else:
00383       self.calPeds.setEnabled(1)
00384       self.calPedsButton.setEnabled(1)
00385
00386   def selectACDPedsFile(self):
00387     """ Calls getPedsFile to obtain the ACD Pedestal File name
00388         and passes it to the corresponding widget.
00389     """
00390     acdPedsFile = self.getPedsFile()
00391     self.acdPeds.setText(acdPedsFile)
00392
00393   def selectCALPedsFile(self):
00394     """ Calls getPedsFile to obtain the CAL Pedestal File name
00395         and passes it to the corresponding widget.
00396     """
00397     calPedsFile = self.getPedsFile()
00398     self.calPeds.setText(calPedsFile)
00399
00400   def getPedsFile(self):
00401     """ Calls getOpenFileName() with 'ANCILLARY_ROOT' as default
00402         to pick up the Pedestal File name.
00403     """
00404     if 'ANCILLARY_ROOT' in os.environ:
00405       path = os.path.join(os.environ['ANCILLARY_ROOT'],'Consumer')
00406     else:
00407       path = QString.null
00408     fn = QFileDialog.getOpenFileName(path, "(*.txt)", self)
00409
00410     if not fn.endsWith(".txt"):
00411       self.__gui.statusBar().message("Can't select a Pedestal File without extension .txt", 2000)
00412       fn = ""
00413     return fn
00414
00415   def saveGOSED(self):
00416     cp = self.__confParser
00417     cp.set("gosed options", "timestep", str(self.timestepValue.text()))
00418     #~ if self.EventlimitsButton.isChecked():
00419       #~ preferredLimits = "Event"
00420     if self.CALlimitsButton.isChecked():
00421       preferredLimits = "Default"
00422     else:# self.CustomlimitsButton.isChecked():
00423       preferredLimits = "Custom"
00424       cp.set("gosed options", "min", self.minCAL())
00425       cp.set("gosed options", "max", self.maxCAL())
00426       #~ self.__gui.drawGOSEDCAL.relabel()
00427     self.__gui.drawGOSEDCAL.relabel()
00428     #~ else:
00429       #~ preferredLimits = "Event"
00430     cp.set("gosed options", "preferredlimits", preferredLimits)
00431
00432     if self.CALlimitsButton2.isChecked():
00433       preferredLimits2 = "Default"
00434     else:# self.CustomlimitsButton.isChecked():
00435       preferredLimits2 = "Custom"
00436       cp.set("gosed options", "min2", self.minCAL2())
00437       cp.set("gosed options", "max2", self.maxCAL2())
00438       self.__gui.drawGOSEDCAL.relabel()
00439     self.__gui.drawGOSEDCALTKR.relabel()
00440     #~ else:
00441       #~ preferredLimits = "Event"
00442     cp.set("gosed options", "preferredlimits2", preferredLimits2)
00443
00444     if self.ACDlimitsButton.isChecked():
00445       preferredLimits = "Default"
00446     elif self.ACDCustomlimitsButton.isChecked():
00447       preferredLimits = "Custom"
00448       cp.set("gosed options", "minacd", self.minACD())
00449       cp.set("gosed options", "maxacd", self.maxACD())
00450       self.__gui.drawGOSEDACD.relabel()
00451     else:
00452       preferredLimits = "Default"
00453     cp.set("gosed options", "acdpreferredlimits", preferredLimits)
00454
00455     if self.ACDDefaultPedsButton.isChecked():
00456       acdPedsFile = "Default"
00457     elif self.ACDCustomPedsButton.isChecked():
00458       acdPedsFile = str(self.acdPeds.text())
00459       if acdPedsFile == "":
00460         acdPedsFile = "Default"
00461     else:
00462       acdPedsFile = "Default"
00463     cp.set("gosed options", "acdPeds", acdPedsFile)
00464
00465     if self.CALDefaultPedsButton.isChecked():
00466       calPedsFile = "Default"
00467     elif self.CALCustomPedsButton.isChecked():
00468       calPedsFile = str(self.calPeds.text())
00469       if calPedsFile == "":
00470         calPedsFile = "Default"
00471     else:
00472       calPedsFile = "Default"
00473     cp.set("gosed options", "calPeds", calPedsFile)
00474
00475     # Write it out
00476     try:
00477       cp.write(file(self.__configFile, "w+"))
00478     except IOError, e:
00479       myLog.warning("Preferences file not saved due to: %s" % e)
00480
00481     self.readPedestals()
00482
00483     # Redraw screen using new settings
00484     self.__gui.replot()
00485
00486   def saveViews(self):
00487     cp = self.__confParser
00488     cp.set("gosed options", "twr",    self.__twr)
00489     cp.set("gosed options", "caltkr", self.__calTkr)
00490     cp.set("gosed options", "data",   self.__data)
00491     cp.set("gosed options", "tkr",    self.__tkr)
00492     cp.set("gosed options", "acd",    self.__acd)
00493     cp.set("gosed options", "cal",    self.__cal)
00494     cp.set("gosed options", "ted",    self.__ted)
00495
00496     try:
00497       cp.write(file(self.__configFile, "w+"))
00498     except IOError, e:
00499       myLog.warning("Preferences file not saved due to: %s" % e)
00500
00501   def saveGOSEDSize(self):
00502     cp = self.__confParser
00503     cp.set("gosed options", "mainWidth",  self.__gui.width())
00504     cp.set("gosed options", "mainHeight", self.__gui.height())
00505
00506     try:
00507       cp.write(file(self.__configFile, "w+"))
00508     except IOError, e:
00509       myLog.warning("Preferences file not saved due to: %s" % e)
00510
00511   def getAcdPeds(self):
00512     """ Returns the numarray of Acd pedestals
00513     Array shape is (12,18,2,2) (cable, channel, range, mean/rms)
00514     """
00515     return self.__acdPeds
00516
00517   def getCalPeds(self):
00518     """ Returns the numarray of Cal pedestals
00519     Array shape is (16,8,12,2,4,2) (tower, layer, column, end, range, mean/rms)
00520     """
00521     return self.__calPeds
00522
00523   def readPedestals(self):
00524     """ Retrieve pedestals from file. Needs ANCILLARY_ROOT in environment
00525     and assumes pedestal files are in ${ANCILLARY_ROOT}/Consumer/acdPeds.txt
00526     and calPeds.txt
00527     """
00528     (acdPedsFile, calPedsFile) = self.__obtainPedsFiles()
00529
00530     self.__readAcdPedestals(acdPedsFile)
00531     self.__readCalPedestals(calPedsFile)
00532
00533   def __readAcdPedestals(self, acdPedsFile):
00534     if acdPedsFile == 'Default':
00535       if 'ANCILLARY_ROOT' in os.environ:
00536         ifname = os.path.join(os.environ['ANCILLARY_ROOT'],'Consumer/acdPeds.txt')
00537       else:
00538         ifname = ""
00539     else:
00540       ifname = acdPedsFile
00541
00542     self.__acdPeds = None
00543     try:
00544       infile = open(ifname)
00545     except:
00546       return
00547     self.__acdPeds = Numeric.zeros((12,18,2,2))
00548     for line in infile.xreadlines():
00549       if line[0]=='!':
00550         continue
00551       # cable channel range mean rms
00552       entries = string.split(line)
00553       if len(entries)==5:
00554         self.__acdPeds[int(entries[0]),int(entries[1]),int(entries[2]),0] = float(entries[3])
00555         self.__acdPeds[int(entries[0]),int(entries[1]),int(entries[2]),1] = float(entries[4])
00556     infile.close()
00557     myLog.info('GOSEDPreferencesImpl.__readAcdPedestals: Read in ACD pedestals from %s'%(ifname))
00558
00559   def __readCalPedestals(self, calPedsFile):
00560     if calPedsFile == 'Default':
00561       if 'ANCILLARY_ROOT' in os.environ:
00562         ifname = os.path.join(os.environ['ANCILLARY_ROOT'],'Consumer/calPeds.txt')
00563       else:
00564         ifname = ""
00565     else:
00566       ifname = calPedsFile
00567
00568     self.__calPeds = None
00569     try:
00570       infile = open(ifname)
00571     except:
00572       return
00573     self.__calPeds = Numeric.zeros((16,8,12,2,4,2))
00574     for line in infile.xreadlines():
00575       if line[0]=='!':
00576         continue
00577       # tower layer column end range mean rms
00578       entries = string.split(line)
00579       if len(entries)==7:
00580         self.__calPeds[int(entries[0]),int(entries[1]),int(entries[2]),int(entries[3]),int(entries[4]),0] = float(entries[5])
00581         self.__calPeds[int(entries[0]),int(entries[1]),int(entries[2]),int(entries[3]),int(entries[4]),1] = float(entries[6])
00582     infile.close()
00583     myLog.info('GOSEDPreferencesImpl.__readCalPedestals: Read in CAL pedestals from %s'%(ifname))
00584
00585   def __obtainPedsFiles(self):
00586     cp = self.__confParser
00587     if os.path.exists(self.__configFile):
00588       cp.read(self.__configFile)
00589       try:
00590         acdPeds = cp.get("gosed options", "acdpeds")
00591         calPeds = cp.get("gosed options", "calpeds")
00592       except ConfigParser.NoSectionError:
00593         cp.add_section("gosed options")
00594         self.__pedDefaults()
00595       except ConfigParser.NoOptionError:
00596         self.__pedDefaults()
00597     else:
00598       self.__pedDefaults()
00599
00600     acdPedsFile = cp.get("gosed options", "acdpeds")
00601     calPedsFile = cp.get("gosed options", "calpeds")
00602     return (acdPedsFile, calPedsFile)
00603
00604   def __pedDefaults(self):
00605     cp = self.__confParser
00606     cp.set("gosed options", "acdpeds", 'Default')
00607     cp.set("gosed options", "calpeds", 'Default')
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GOSEDTKRImpl.py Source File

gosed

GOSEDTKRImpl.py

00001 # -*- coding: utf-8 -*-
00002
00003 __version__  = "$Revision: 1.2 $"
00004
00005 import sys
00006 from qt import *
00007 from GOSEDTKR import GOSEDTKRWindow
00008
00009
00010 class GOSEDTKRImpl(GOSEDTKRWindow):
00011
00012     def __init__(self,parent = None,name = None,fl = 0):
00013         GOSEDTKRWindow.__init__(self,parent,name,fl)
00014
00015 if __name__ == "__main__":
00016     a = QApplication(sys.argv)
00017     QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00018     w = GOSEDTKRImpl()
00019     a.setMainWidget(w)
00020     w.show()
00021     a.exec_loop()
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GOSEDTWRImpl.py Source File

gosed

GOSEDTWRImpl.py

00001 # -*- coding: utf-8 -*-
00002
00003 __version__  = "$Revision: 1.2 $"
00004
00005 import sys
00006 from qt import *
00007 from GOSEDTWR import GOSEDTWRWindow
00008
00009
00010 class GOSEDTWRImpl(GOSEDTWRWindow):
00011
00012     def __init__(self,parent = None,name = None,fl = 0):
00013         GOSEDTWRWindow.__init__(self,parent,name,fl)
00014
00015 if __name__ == "__main__":
00016     a = QApplication(sys.argv)
00017     QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00018     w = GOSEDTWRImpl()
00019     a.setMainWidget(w)
00020     w.show()
00021     a.exec_loop()
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GOTEDImpl.py Source File

gosed

GOTEDImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST Online Tower Event Display"
00012 __author__   = "A. Kavelaars <aliciak@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "11/26/2003"
00014 __version__  = "$Revision: 1.7 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018 import sys
00019 from qt import *
00020 from GOTED import towerEvtDisplay
00021
00022 class towerEvtDisplayImpl(towerEvtDisplay):
00023   def __init__(self,parent = None,name = None,modal = 0,fl = 0):
00024     towerEvtDisplay.__init__(self,parent,name,fl)
00025
00026     self.towerFrame = None
00027
00028     self.final = {}
00029
00030     for i in range(16):
00031       self.final[i] = QPixmap()
00032
00033     #~ self.background = QPixmap(200, 200)
00034     #~ self.noBgrZ = QPixmap(200, 200)
00035
00036     self.background  = QPixmap(self.TWR0.width(), \
00037                          self.TWR0.height())
00038     self.noBgrZ = QPixmap(self.TWR0.width(), \
00039                          self.TWR0.height())
00040
00041     self.towerList = [self.TWR0,
00042                       self.TWR1,
00043                       self.TWR2,
00044                       self.TWR3,
00045                       self.TWR4,
00046                       self.TWR5,
00047                       self.TWR6,
00048                       self.TWR7,
00049                       self.TWR8,
00050                       self.TWR9,
00051                       self.TWR10,
00052                       self.TWR11,
00053                       self.TWR12,
00054                       self.TWR13,
00055                       self.TWR14,
00056                       self.TWR15
00057                       ]
00058     self.connect
00059
00060   def clear(self):
00061     for i in range(16):
00062       self.final[i].fill()
00063
00064   def paintEvent(self, pe):
00065     self.background  = QPixmap(self.TWR0.width(), \
00066                          self.TWR0.height())
00067     self.noBgrZ = QPixmap(self.TWR0.width(), \
00068                          self.TWR0.height())
00069
00070     self.__pZ_TKR  = QPainter(self.background) #
00071
00072     self.__pZ_TKR.setBrush(QColor("white"))
00073     self.__pZ_TKR.setPen(QColor(166,163,157))
00074
00075     self.__pZ_TKR.drawRect(0, 0,\
00076                            self.towerList[0].width(), \
00077                            self.towerList[0].height())
00078
00079     self.__pZ_TKR  = QPainter(self.noBgrZ) #
00080
00081     self.__pZ_TKR.setBrush(QColor(212,208,200))
00082     self.__pZ_TKR.setPen(QColor(166,163,157))
00083
00084     self.__pZ_TKR.drawRect(0, 0, \
00085                            self.TWR0.width(), \
00086                            self.TWR0.height())
00087     self.__pZ_TKR.end()
00088
00089     for i in range(16):
00090       if not self.final[i].isNull():
00091         bitBlt(self.towerList[i], \
00092                0, 0, self.final[i])
00093
00094
00095 if __name__ == "__main__":
00096     a = QApplication(sys.argv)
00097     QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00098     w = towerEvtDisplayImpl()
00099     a.setMainWidget(w)
00100     w.show()
00101     a.exec_loop()
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gPDU.py Source File

database

gPDU.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "GLAST PDU functional block"
00013 __author__  = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = ("$Date: 2006/07/20 22:21:30 $").split(' ')[1]
00015 __version__ = "$Revision: 2.14 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__ = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import time
00022 import struct
00023 import gDb
00024 import gAttr
00025 import LATTE.client.gRegister as gRegister
00026 import LATTE.client.gException as gException
00027
00028 class GPDU(gDb.Gdb):
00029   """\brief PDU Controller.
00030
00031   Valid Registers:
00032   - \c configuration
00033   - \c address
00034   - \c cr_statistics
00035   - \c crates
00036   - \c tems
00037   - \c acd
00038   - \c monitor
00039
00040   Dataless commands:
00041   - \c cmd_nop
00042   - \c cmd_reset
00043
00044   """
00045   __attrs = [
00046     # Registers
00047     gAttr.GattrReg('configuration', 0, 4),
00048     gAttr.GattrReg('address',       1, 4),
00049     gAttr.GattrReg('cr_statistics', 2, 4),
00050     gAttr.GattrReg('crates',        3, 4),
00051     gAttr.GattrReg('tems',          4, 4),
00052     gAttr.GattrReg('acd',           5, 4),
00053     gAttr.GattrReg('monitor',       6, 4),
00054     # Dataless commands
00055     gAttr.GattrDlc('cmd_nop',       0, 0),
00056     gAttr.GattrDlc('cmd_reset',     1, 0),
00057     ]
00058
00059   __MONITOR = 6
00060
00061   def __init__(self, client, parent, id):
00062     """\brief Initialize valid registers as Gattrs.
00063
00064     Assign default values to members
00065     """
00066     if id < gDb.Lem.NPDUS:
00067       addr = gDb.Lem.ADDR_PDU_BASE+id
00068     else:
00069       raise KeyError("*** gPDU: GPDU id %d is invalid" %(id))
00070     self.PEQ = None
00071     flags = {'CmdrspFabric': 'On'}
00072     gDb.Gdb.__init__(self, client, parent, id, self.__attrs, addr, flags)
00073
00074   def read(self, reg):
00075     return self.cmdrsp('PDU_read', self.addr(), reg, '!I')
00076
00077   def load(self, reg, value):
00078     return self.cmdrsp('PDU_load', self.addr(), reg, value)
00079
00080   def send(self, cmd):
00081     return self.cmdrsp('PDU_cmd', self.addr(), cmd)
00082
00083   def downPEQ(self):
00084     """\brief Navigate to the GPEQ (PDU environmental monitors)
00085
00086     \return         A GPEQ object instance
00087     """
00088     return self.PEQ
00089
00090   def existsPEQ(self):
00091     """\brief Check if the GPEQ instance exists in the schema.
00092
00093     \return       1 if it exists, 0 if it doesn't.
00094     """
00095     return self.PEQ != None
00096
00097   ## private:
00098   def __removePEQ(self):
00099     self.PEQ = None
00100
00101   def __addPEQ(self):
00102     self.PEQ = GPEQ(self.client(), self)
00103     return self.PEQ
00104
00105
00106 class GPEQ(gDb.Gdb):
00107   """\brief PDU Environmental Monitors.
00108
00109   Has GPEQ specific registers and dataless commands.
00110
00111   Valid Registers:
00112   - \c adcs_00_07
00113   - \c adcs_08_15
00114   - \c adcs_16_19
00115   """
00116   __attrs = [
00117     # Registers
00118     gAttr.GattrReg('adcs_00_07', 0, 12, gAttr.REG_READ_ONLY),
00119     gAttr.GattrReg('adcs_08_15', 1, 12, gAttr.REG_READ_ONLY),
00120     gAttr.GattrReg('adcs_16_19', 2, 12, gAttr.REG_READ_ONLY),
00121
00122     # group 0
00123     gAttr.GattrReg('spare_v_0',               10,  2, gAttr.REG_READ_ONLY),
00124     gAttr.GattrReg('tem_v_12',                11,  2, gAttr.REG_READ_ONLY),
00125     gAttr.GattrReg('tem_v_02',                12,  2, gAttr.REG_READ_ONLY),
00126     gAttr.GattrReg('tem_t_08',                13,  2, gAttr.REG_READ_ONLY),
00127     gAttr.GattrReg('tem_t_12',                14,  2, gAttr.REG_READ_ONLY),
00128     gAttr.GattrReg('epu_t_2',                 15,  2, gAttr.REG_READ_ONLY),
00129     gAttr.GattrReg('epu_t_0',                 16,  2, gAttr.REG_READ_ONLY),
00130     gAttr.GattrReg('tem_t_06',                17,  2, gAttr.REG_READ_ONLY),
00131     gAttr.GattrReg('py_vchp_xlhp_intf_t_4',   18,  2, gAttr.REG_READ_ONLY),
00132     gAttr.GattrReg('spare_rtd_0',             19,  2, gAttr.REG_READ_ONLY),
00133     gAttr.GattrReg('spare_rtd_1',             20,  2, gAttr.REG_READ_ONLY),
00134     gAttr.GattrReg('spare_rtd_2',             21,  2, gAttr.REG_READ_ONLY),
00135     gAttr.GattrReg('spare_rtd_3',             22,  2, gAttr.REG_READ_ONLY),
00136     gAttr.GattrReg('spare_t_1',               23,  2, gAttr.REG_READ_ONLY),
00137     gAttr.GattrReg('py_grid_rad_intf_t_0',    24,  2, gAttr.REG_READ_ONLY),
00138     gAttr.GattrReg('my_grid_rad_intf_t_0',    25,  2, gAttr.REG_READ_ONLY),
00139     gAttr.GattrReg('grid_t_06',               26,  2, gAttr.REG_READ_ONLY),
00140     gAttr.GattrReg('grid_t_09',               27,  2, gAttr.REG_READ_ONLY),
00141     gAttr.GattrReg('grid_t_00',               28,  2, gAttr.REG_READ_ONLY),
00142     gAttr.GattrReg('grid_t_03',               29,  2, gAttr.REG_READ_ONLY),
00143
00144     # group 1
00145     gAttr.GattrReg('spare_v_1',               30,  2, gAttr.REG_READ_ONLY),
00146     gAttr.GattrReg('tem_v_13',                31,  2, gAttr.REG_READ_ONLY),
00147     gAttr.GattrReg('tem_v_03',                32,  2, gAttr.REG_READ_ONLY),
00148     gAttr.GattrReg('tem_t_09',                33,  2, gAttr.REG_READ_ONLY),
00149     gAttr.GattrReg('tem_t_13',                34,  2, gAttr.REG_READ_ONLY),
00150     gAttr.GattrReg('spare_t_0',               35,  2, gAttr.REG_READ_ONLY),
00151     gAttr.GattrReg('epu_t_1',                 36,  2, gAttr.REG_READ_ONLY),
00152     gAttr.GattrReg('tem_t_07',                37,  2, gAttr.REG_READ_ONLY),
00153     gAttr.GattrReg('py_vchp_xlhp_intf_t_5',   38,  2, gAttr.REG_READ_ONLY),
00154     gAttr.GattrReg('py_rad_antifrz_htr_t_00', 39,  2, gAttr.REG_READ_ONLY),
00155     gAttr.GattrReg('acd_shell_t_0',           40,  2, gAttr.REG_READ_ONLY),
00156     gAttr.GattrReg('my_rad_antifrz_htr_t_00', 41,  2, gAttr.REG_READ_ONLY),
00157     gAttr.GattrReg('acd_shell_t_1',           42,  2, gAttr.REG_READ_ONLY),
00158     gAttr.GattrReg('spare_t_2',               43,  2, gAttr.REG_READ_ONLY),
00159     gAttr.GattrReg('py_grid_rad_intf_t_1',    44,  2, gAttr.REG_READ_ONLY),
00160     gAttr.GattrReg('my_grid_rad_intf_t_1',    45,  2, gAttr.REG_READ_ONLY),
00161     gAttr.GattrReg('grid_t_07',               46,  2, gAttr.REG_READ_ONLY),
00162     gAttr.GattrReg('grid_t_10',               47,  2, gAttr.REG_READ_ONLY),
00163     gAttr.GattrReg('grid_t_01',               48,  2, gAttr.REG_READ_ONLY),
00164     gAttr.GattrReg('grid_t_04',               49,  2, gAttr.REG_READ_ONLY),
00165
00166     # group 2
00167     gAttr.GattrReg('spare_v_2',               50,  2, gAttr.REG_READ_ONLY),
00168     gAttr.GattrReg('tem_v_14',                51,  2, gAttr.REG_READ_ONLY),
00169     gAttr.GattrReg('tem_v_04',                52,  2, gAttr.REG_READ_ONLY),
00170     gAttr.GattrReg('tem_t_10',                53,  2, gAttr.REG_READ_ONLY),
00171     gAttr.GattrReg('tem_t_14',                54,  2, gAttr.REG_READ_ONLY),
00172     gAttr.GattrReg('tem_t_00',                55,  2, gAttr.REG_READ_ONLY),
00173     gAttr.GattrReg('tem_t_03',                56,  2, gAttr.REG_READ_ONLY),
00174     gAttr.GattrReg('tem_ps_t_06',             57,  2, gAttr.REG_READ_ONLY),
00175     gAttr.GattrReg('my_vchp_xlhp_intf_t_0',   58,  2, gAttr.REG_READ_ONLY),
00176     gAttr.GattrReg('py_rad_t_0',              59,  2, gAttr.REG_READ_ONLY),
00177     gAttr.GattrReg('py_vchp_rsvr_htr_t_0',    60,  2, gAttr.REG_READ_ONLY),
00178     gAttr.GattrReg('my_rad_t_0',              61,  2, gAttr.REG_READ_ONLY),
00179     gAttr.GattrReg('my_vchp_rsvr_htr_t_0',    62,  2, gAttr.REG_READ_ONLY),
00180     gAttr.GattrReg('acd_pmt_rail_t_0',        63,  2, gAttr.REG_READ_ONLY),
00181     gAttr.GattrReg('py_vchp_dshp_intf_t_0',   64,  2, gAttr.REG_READ_ONLY),
00182     gAttr.GattrReg('my_vchp_dshp_intf_t_0',   65,  2, gAttr.REG_READ_ONLY),
00183     gAttr.GattrReg('grid_t_08',               66,  2, gAttr.REG_READ_ONLY),
00184     gAttr.GattrReg('grid_t_11',               67,  2, gAttr.REG_READ_ONLY),
00185     gAttr.GattrReg('grid_t_02',               68,  2, gAttr.REG_READ_ONLY),
00186     gAttr.GattrReg('grid_t_05',               69,  2, gAttr.REG_READ_ONLY),
00187
00188     # group 3
00189     gAttr.GattrReg('spare_v_3',               70,  2, gAttr.REG_READ_ONLY),
00190     gAttr.GattrReg('tem_v_15',                71,  2, gAttr.REG_READ_ONLY),
00191     gAttr.GattrReg('tem_v_05',                72,  2, gAttr.REG_READ_ONLY),
00192     gAttr.GattrReg('tem_t_11',                73,  2, gAttr.REG_READ_ONLY),
00193     gAttr.GattrReg('tem_t_15',                74,  2, gAttr.REG_READ_ONLY),
00194     gAttr.GattrReg('tem_t_01',                75,  2, gAttr.REG_READ_ONLY),
00195     gAttr.GattrReg('tem_t_04',                76,  2, gAttr.REG_READ_ONLY),
00196     gAttr.GattrReg('tem_ps_t_07',             77,  2, gAttr.REG_READ_ONLY),
00197     gAttr.GattrReg('my_vchp_xlhp_intf_t_1',   78,  2, gAttr.REG_READ_ONLY),
00198     gAttr.GattrReg('py_rad_t_1',              79,  2, gAttr.REG_READ_ONLY),
00199     gAttr.GattrReg('py_vchp_rsvr_htr_t_1',    80,  2, gAttr.REG_READ_ONLY),
00200     gAttr.GattrReg('my_rad_t_1',              81,  2, gAttr.REG_READ_ONLY),
00201     gAttr.GattrReg('my_vchp_rsvr_htr_t_1',    82,  2, gAttr.REG_READ_ONLY),
00202     gAttr.GattrReg('acd_pmt_rail_t_1',        83,  2, gAttr.REG_READ_ONLY),
00203     gAttr.GattrReg('py_vchp_dshp_intf_t_1',   84,  2, gAttr.REG_READ_ONLY),
00204     gAttr.GattrReg('my_vchp_dshp_intf_t_1',   85,  2, gAttr.REG_READ_ONLY),
00205     gAttr.GattrReg('cal_baseplate_t_08',      86,  2, gAttr.REG_READ_ONLY),
00206     gAttr.GattrReg('cal_baseplate_t_12',      87,  2, gAttr.REG_READ_ONLY),
00207     gAttr.GattrReg('cal_baseplate_t_00',      88,  2, gAttr.REG_READ_ONLY),
00208     gAttr.GattrReg('cal_baseplate_t_04',      89,  2, gAttr.REG_READ_ONLY),
00209
00210     # group 4
00211     gAttr.GattrReg('tem_v_08',                90,  2, gAttr.REG_READ_ONLY),
00212     gAttr.GattrReg('epu_v_2',                 91,  2, gAttr.REG_READ_ONLY),
00213     gAttr.GattrReg('tem_v_06',                92,  2, gAttr.REG_READ_ONLY),
00214     gAttr.GattrReg('tem_ps_t_08',             93,  2, gAttr.REG_READ_ONLY),
00215     gAttr.GattrReg('tem_ps_t_12',             94,  2, gAttr.REG_READ_ONLY),
00216     gAttr.GattrReg('tem_t_02',                95,  2, gAttr.REG_READ_ONLY),
00217     gAttr.GattrReg('tem_t_05',                96,  2, gAttr.REG_READ_ONLY),
00218     gAttr.GattrReg('py_vchp_xlhp_intf_t_0',   97,  2, gAttr.REG_READ_ONLY),
00219     gAttr.GattrReg('my_vchp_xlhp_intf_t_2',   98,  2, gAttr.REG_READ_ONLY),
00220     gAttr.GattrReg('py_rad_t_2',              99,  2, gAttr.REG_READ_ONLY),
00221     gAttr.GattrReg('py_vchp_rsvr_htr_t_2',   100,  2, gAttr.REG_READ_ONLY),
00222     gAttr.GattrReg('my_rad_t_2',             101,  2, gAttr.REG_READ_ONLY),
00223     gAttr.GattrReg('my_vchp_rsvr_htr_t_2',   102,  2, gAttr.REG_READ_ONLY),
00224     gAttr.GattrReg('acd_pmt_rail_t_2',       103,  2, gAttr.REG_READ_ONLY),
00225     gAttr.GattrReg('py_vchp_dshp_intf_t_2',  104,  2, gAttr.REG_READ_ONLY),
00226     gAttr.GattrReg('my_vchp_dshp_intf_t_2',  105,  2, gAttr.REG_READ_ONLY),
00227     gAttr.GattrReg('cal_baseplate_t_09',     106,  2, gAttr.REG_READ_ONLY),
00228     gAttr.GattrReg('cal_baseplate_t_13',     107,  2, gAttr.REG_READ_ONLY),
00229     gAttr.GattrReg('cal_baseplate_t_01',     108,  2, gAttr.REG_READ_ONLY),
00230     gAttr.GattrReg('cal_baseplate_t_05',     109,  2, gAttr.REG_READ_ONLY),
00231
00232     # group 5
00233     gAttr.GattrReg('tem_v_09',                110,  2, gAttr.REG_READ_ONLY),
00234     gAttr.GattrReg('spare_v_4',               111,  2, gAttr.REG_READ_ONLY),
00235     gAttr.GattrReg('tem_v_07',                112,  2, gAttr.REG_READ_ONLY),
00236     gAttr.GattrReg('tem_ps_t_09',             113,  2, gAttr.REG_READ_ONLY),
00237     gAttr.GattrReg('tem_ps_t_13',             114,  2, gAttr.REG_READ_ONLY),
00238     gAttr.GattrReg('tem_ps_t_00',             115,  2, gAttr.REG_READ_ONLY),
00239     gAttr.GattrReg('tem_ps_t_03',             116,  2, gAttr.REG_READ_ONLY),
00240     gAttr.GattrReg('py_vchp_xlhp_intf_t_1',   117,  2, gAttr.REG_READ_ONLY),
00241     gAttr.GattrReg('my_vchp_xlhp_intf_t_3',   118,  2, gAttr.REG_READ_ONLY),
00242     gAttr.GattrReg('py_rad_t_3',              119,  2, gAttr.REG_READ_ONLY),
00243     gAttr.GattrReg('py_vchp_rsvr_htr_t_3',    120,  2, gAttr.REG_READ_ONLY),
00244     gAttr.GattrReg('my_rad_t_3',              121,  2, gAttr.REG_READ_ONLY),
00245     gAttr.GattrReg('my_vchp_rsvr_htr_t_3',    122,  2, gAttr.REG_READ_ONLY),
00246     gAttr.GattrReg('acd_pmt_rail_t_3',        123,  2, gAttr.REG_READ_ONLY),
00247     gAttr.GattrReg('py_vchp_dshp_intf_t_5',   124,  2, gAttr.REG_READ_ONLY),
00248     gAttr.GattrReg('my_vchp_dshp_intf_t_5',   125,  2, gAttr.REG_READ_ONLY),
00249     gAttr.GattrReg('cal_baseplate_t_15',      126,  2, gAttr.REG_READ_ONLY),
00250     gAttr.GattrReg('cal_baseplate_t_14',      127,  2, gAttr.REG_READ_ONLY),
00251     gAttr.GattrReg('cal_baseplate_t_07',      128,  2, gAttr.REG_READ_ONLY),
00252     gAttr.GattrReg('cal_baseplate_t_06',      129,  2, gAttr.REG_READ_ONLY),
00253
00254     # group 6
00255     gAttr.GattrReg('tem_v_10',                130,  2, gAttr.REG_READ_ONLY),
00256     gAttr.GattrReg('tem_v_00',                131,  2, gAttr.REG_READ_ONLY),
00257     gAttr.GattrReg('epu_v_0',                 132,  2, gAttr.REG_READ_ONLY),
00258     gAttr.GattrReg('tem_ps_t_10',             133,  2, gAttr.REG_READ_ONLY),
00259     gAttr.GattrReg('tem_ps_t_14',             134,  2, gAttr.REG_READ_ONLY),
00260     gAttr.GattrReg('tem_ps_t_01',             135,  2, gAttr.REG_READ_ONLY),
00261     gAttr.GattrReg('tem_ps_t_04',             136,  2, gAttr.REG_READ_ONLY),
00262     gAttr.GattrReg('py_vchp_xlhp_intf_t_2',   137,  2, gAttr.REG_READ_ONLY),
00263     gAttr.GattrReg('my_vchp_xlhp_intf_t_4',   138,  2, gAttr.REG_READ_ONLY),
00264     gAttr.GattrReg('py_rad_t_4',              139,  2, gAttr.REG_READ_ONLY),
00265     gAttr.GattrReg('py_vchp_rsvr_htr_t_4',    140,  2, gAttr.REG_READ_ONLY),
00266     gAttr.GattrReg('my_rad_t_4',              141,  2, gAttr.REG_READ_ONLY),
00267     gAttr.GattrReg('my_vchp_rsvr_htr_t_4',    142,  2, gAttr.REG_READ_ONLY),
00268     gAttr.GattrReg('acd_bea_grid_intf_t_0',   143,  2, gAttr.REG_READ_ONLY),
00269     gAttr.GattrReg('py_vchp_dshp_intf_t_4',   144,  2, gAttr.REG_READ_ONLY),
00270     gAttr.GattrReg('my_vchp_dshp_intf_t_4',   145,  2, gAttr.REG_READ_ONLY),
00271     gAttr.GattrReg('cal_baseplate_t_11',      146,  2, gAttr.REG_READ_ONLY),
00272     gAttr.GattrReg('cal_baseplate_t_10',      147,  2, gAttr.REG_READ_ONLY),
00273     gAttr.GattrReg('cal_baseplate_t_03',      148,  2, gAttr.REG_READ_ONLY),
00274     gAttr.GattrReg('cal_baseplate_t_02',      149,  2, gAttr.REG_READ_ONLY),
00275
00276     # group 7
00277     gAttr.GattrReg('tem_v_11',                150,  2, gAttr.REG_READ_ONLY),
00278     gAttr.GattrReg('tem_v_01',                151,  2, gAttr.REG_READ_ONLY),
00279     gAttr.GattrReg('epu_v_1',                 152,  2, gAttr.REG_READ_ONLY),
00280     gAttr.GattrReg('tem_ps_t_11',             153,  2, gAttr.REG_READ_ONLY),
00281     gAttr.GattrReg('tem_ps_t_15',             154,  2, gAttr.REG_READ_ONLY),
00282     gAttr.GattrReg('tem_ps_t_02',             155,  2, gAttr.REG_READ_ONLY),
00283     gAttr.GattrReg('tem_ps_t_05',             156,  2, gAttr.REG_READ_ONLY),
00284     gAttr.GattrReg('py_vchp_xlhp_intf_t_3',   157,  2, gAttr.REG_READ_ONLY),
00285     gAttr.GattrReg('my_vchp_xlhp_intf_t_5',   158,  2, gAttr.REG_READ_ONLY),
00286     gAttr.GattrReg('py_rad_t_5',              159,  2, gAttr.REG_READ_ONLY),
00287     gAttr.GattrReg('py_vchp_rsvr_htr_t_5',    160,  2, gAttr.REG_READ_ONLY),
00288     gAttr.GattrReg('my_rad_t_5',              161,  2, gAttr.REG_READ_ONLY),
00289     gAttr.GattrReg('my_vchp_rsvr_htr_t_5',    162,  2, gAttr.REG_READ_ONLY),
00290     gAttr.GattrReg('acd_bea_grid_intf_t_1',   163,  2, gAttr.REG_READ_ONLY),
00291     gAttr.GattrReg('py_vchp_dshp_intf_t_3',   164,  2, gAttr.REG_READ_ONLY),
00292     gAttr.GattrReg('my_vchp_dshp_intf_t_3',   165,  2, gAttr.REG_READ_ONLY),
00293     gAttr.GattrReg('spare_t_3',               166,  2, gAttr.REG_READ_ONLY),
00294     gAttr.GattrReg('spare_t_4',               167,  2, gAttr.REG_READ_ONLY),
00295     gAttr.GattrReg('spare_t_5',               168,  2, gAttr.REG_READ_ONLY),
00296     gAttr.GattrReg('spare_t_6',               169,  2, gAttr.REG_READ_ONLY),
00297     ]
00298
00299   __ADCS_BASE = 10
00300   __STALE_TMO = 1.0
00301
00302   def __init__(self, client, parent):
00303     """\brief Initialize valid registers as Gattrs.
00304
00305     Assign default values to members
00306     """
00307     self.__adcs = 8*[(None, 0)] # [gRegister.Register, time.time()]
00308     gDb.Gdb.__init__(self, client, parent, 0, self.__attrs)
00309
00310   def read(self, reg):
00311     if reg < GPEQ.__ADCS_BASE:
00312       rsp = self.cmdrsp('PDU_ENV_read', self.up().addr(), reg, '!III')
00313       payloads = (rsp.payloads()[2], rsp.payloads()[1], rsp.payloads()[0])
00314       return gRegister.Register(rsp.timestamp(), rsp.status(), payloads, 'III')
00315     else:
00316       return self.__fetchReg(reg)
00317
00318   def __fetchReg(self, reg):
00319     group = (reg - GPEQ.__ADCS_BASE) / 20
00320     which = (reg - GPEQ.__ADCS_BASE) % 20
00321     now = time.time()
00322     (rsp, rt) = self.__adcs[group]
00323     if ((rsp is None) or (now - rt) > GPEQ.__STALE_TMO):
00324       rsp = self.cmdrsp('PDU_ENV_acquire', self.up().addr(), group, '!III', '!III', '!III')
00325       for pos in [0, 3, 6]:
00326         grp      = (rsp.payloads()[pos]>>20)&0x7
00327         notready = (rsp.payloads()[pos]>>20)&0x8
00328         tmo      = (rsp.payloads()[pos]>>24)&0x7f
00329         if notready:
00330           status = gException.LATInterfaceStatus.status('OCS_BDADC')
00331           raise gException.LATInterfaceException(status)
00332         if tmo:
00333           status = gException.LATInterfaceStatus.status('OCS_TMOADC')
00334           raise gException.LATInterfaceException(status)
00335         if grp != group:
00336           status = gException.LATInterfaceStatus.status('OCS_GRPADC')
00337           raise gException.LATInterfaceException(status)
00338       self.__adcs[group] = (rsp, now)
00339     payloads = rsp.payloads()
00340     pos = (which/7)*3
00341     payload  = (long(payloads[pos]) << 64) | (long(payloads[pos+1]) << 32) | payloads[pos+2]
00342     timestamp = rsp.timestamp()
00343     status    = rsp.status()
00344     value     = int((payload >> (12 * (which % 7))) & 0xfff)
00345     payloads  = [value]
00346     return gRegister.Register(timestamp, status, payloads, 'H')
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: GpibPwrCtrlImpl.py Source File

power

GpibPwrCtrlImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Environmental Monitoring implementation GUI class"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/05/25 01:48:20 $").split(' ')[1]
00014 __version__  = "$Revision: 1.2 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019 from   LATTE.runcontrol.RunControlMainGUIImpl import rcFileSelector
00020
00021 from GpibPwrCtrl import GpibPwrCtrl
00022 from qt import *
00023
00024 import sys
00025 from ConfigParser import ConfigParser
00026 import logging as log
00027 import atexit
00028
00029 class GpibPwrCtrlImpl(GpibPwrCtrl):
00030   def __init__(self, gpib, parent = None, name = None, fl = 0):
00031     GpibPwrCtrl.__init__(self, None, name, fl)
00032     self.connect(self.buttonSelectConfig,SIGNAL("clicked()"),self.readPowerConfig)
00033     self.connect(self.buttonReset,SIGNAL("clicked()"),self.resetDevice)
00034     self.connect(self.buttonEnableOut,SIGNAL("clicked()"),self.enableOutput)
00035     self.connect(self.buttonDisableOut,SIGNAL("clicked()"),self.disableOutput)
00036     self.connect(self.buttonRelease,SIGNAL("clicked()"),self.releaseGpib)
00037     self.connect(self.comboConfig,SIGNAL("activated(const QString &)"),self.loadConfig)
00038     atexit.register(self.shutdown)
00039     self.__address = None
00040     self.__input = {'vmax':None, 'vset':None, 'imax':None, 'iset':None}
00041     self.__cmdWrite  = {'vmax':'VMAX %2.3fV',
00042                         'vset':'VSET %2.3fV',
00043                         'imax':'IMAX %2.3fA',
00044                         'iset':'ISET %2.3fA'
00045                        }
00046     self.__cmdRead   = {'ovp' : 'OVP?',
00047                         'vmax':'VMAX?',
00048                         'vset':'VSET?',
00049                         'imax':'IMAX?',
00050                         'iset':'ISET?'
00051                        }
00052
00053     self.__labelRead = {'ovp' : self.labelOVP,
00054                         'vmax': self.labelVMAX,
00055                         'vset': self.labelVSET,
00056                         'imax': self.labelIMAX,
00057                         'iset': self.labelISET
00058                        }
00059
00060     self.__txtWrite  = {'vmax': self.txtVMAX,
00061                         'vset': self.txtVSET,
00062                         'imax': self.txtIMAX,
00063                         'iset': self.txtISET
00064                        }
00065
00066     self.__funcApply = {'vmax': lambda: self.applyData('vmax'),
00067                         'vset': lambda: self.applyData('vset'),
00068                         'imax': lambda: self.applyData('imax'),
00069                         'iset': lambda: self.applyData('iset')
00070                        }
00071     self.connect(self.buttonApplyVMAX,SIGNAL("clicked()"),self.__funcApply['vmax'])
00072     self.connect(self.buttonApplyVSET,SIGNAL("clicked()"),self.__funcApply['vset'])
00073     self.connect(self.buttonApplyIMAX,SIGNAL("clicked()"),self.__funcApply['imax'])
00074     self.connect(self.buttonApplyISET,SIGNAL("clicked()"),self.__funcApply['iset'])
00075
00076     self.__currentCfg = ''
00077     self.__init  = False
00078     self.buttonRelease.setEnabled(0)
00079     self.__power = gpib.Power()
00080     self.__timer = QTimer(self)
00081     self.__interval = 5000
00082     self.connect(self.__timer, SIGNAL("timeout()"), self.updateReadout)
00083
00084   def readPowerConfig(self):
00085     self.stopTimer()
00086     self.txtError.setText('')
00087     self.labelStatus.setText('')
00088     cfgSel = rcFileSelector(self.__currentCfg, "(*.cfg)", self, "Select Power Configuration")
00089     cfgFilename = cfgSel.getValue()
00090     # Allow the C++ object to be deleted
00091     cfgSel.deleteLater()
00092     if cfgFilename is None: return
00093     self.__currentCfg = cfgFilename
00094     if self.comboConfig.listBox().findItem(cfgFilename) is None:
00095       self.comboConfig.insertItem(cfgFilename)
00096     self.comboConfig.clearEdit()
00097     self.comboConfig.setCurrentText(cfgFilename)
00098     self.loadConfig(cfgFilename)
00099
00100   def loadConfig(self, cfgFilename):
00101     self.waitCursor()
00102     qApp.processEvents()
00103     confParser = ConfigParser()
00104     confParser.read(str(cfgFilename))
00105     self.__address = None
00106     parseError = self.parserToScreen(confParser)
00107     if parseError:
00108       self.txtError.setPaletteForegroundColor(Qt.red)
00109       self.txtError.setText("Error in reading configuration file")
00110     elif self.__address is not None:
00111         if self.initGPIB() is not None:
00112           status = self.checkOutputEnable()
00113           self.startTimer()
00114     self.normalCursor()
00115
00116   def initGPIB(self):
00117     if self.__init:
00118       self.__power.unlock()
00119       self.__power.close()
00120     self.__init = False
00121     self.buttonRelease.setEnabled(0)
00122     status = self.__power.open(self.__address)
00123     if status == 0:
00124       status = self.__power.lock()
00125       if status != 0:
00126         self.updateError()
00127         return None
00128       else:
00129         self.__power.causeError(0)
00130       self.__init = True
00131       self.buttonRelease.setEnabled(1)
00132       return 0
00133     else:
00134       return None
00135
00136   def checkOutputEnable(self):
00137     self.__power.write("OUT?")
00138     data = self.__power.read()
00139     status = self.updateError()
00140     if status != 0:
00141       return status
00142     if data.strip(' \n\r') == "OUT 1":
00143       self.buttonEnableOut.setOn(1)
00144     else:
00145       self.buttonDisableOut.setOn(1)
00146     return 0
00147
00148   def applyData(self, type):
00149     self.__power.write(self.__cmdWrite[type] % float(str(self.__txtWrite[type].text())))
00150     status = self.updateError()
00151     if status == 0:
00152       self.__labelRead[type].setText(self.readData(type))
00153
00154   def readData(self, type):
00155     self.__power.write(self.__cmdRead[type])
00156     data = self.__power.read()
00157     status = self.updateError()
00158     if status != 0:
00159       return None
00160     if data is not None:
00161       data = data.strip(" \n\r")
00162     typeValue = data.split()
00163     if typeValue[0].lower() == type:
00164       data = typeValue[1]
00165     return data
00166
00167   def resetDevice(self):
00168     self.__power.write("RST")
00169     self.updateError()
00170
00171   def enableOutput(self):
00172     self.__power.write("OUT 1")
00173     self.updateError()
00174
00175   def disableOutput(self):
00176     self.__power.write("OUT 0")
00177     self.updateError()
00178
00179   def updateError(self):
00180     errorStr = self.__power.getErrorStr()
00181     if errorStr == 'No error':
00182       self.txtError.unsetPalette()
00183       self.txtError.setText(errorStr)
00184       self.labelStatus.unsetPalette()
00185       self.labelStatus.setText('READY')
00186       return 0
00187     else:
00188       self.txtError.setPaletteForegroundColor(Qt.red)
00189       self.txtError.setText(errorStr)
00190       errorNo = self.__power.getErrorNo()
00191       if errorNo == 11: # Locked
00192         self.labelStatus.setPaletteForegroundColor(Qt.red)
00193         self.labelStatus.setText('LOCKED')
00194       else:
00195         self.labelStatus.unsetPalette()
00196         self.labelStatus.setText('READY')
00197       return errorNo
00198
00199   def clearReadout(self):
00200     for label in self.__labelRead.values():
00201       label.setText('')
00202
00203   def clearSettings(self):
00204     for text in self.__txtWrite.values():
00205       text.setText('')
00206
00207   def updateReadout(self):
00208     self.clearReadout()
00209     for type in self.__cmdRead.keys():
00210       data = self.readData(type)
00211       status = self.updateError()
00212       if status == 11: # Locked
00213         self.labelStatus.setText('LOCKED')
00214         return
00215       elif status != 0:
00216         return
00217       else:
00218         self.labelStatus.setText('READY')
00219       self.__labelRead[type].setText(data)
00220
00221   def parserToScreen(self, confParser):
00222     error = False
00223     self.clearSettings()
00224     sections = confParser.sections()
00225     for section in sections:
00226       if section == 'device':
00227         for option in confParser.options(section):
00228           if option == 'address':
00229             self.__address = confParser.get(section, option)
00230             self.labelDevice.setText(self.__address.split(':')[1])
00231
00232       if section == 'input':
00233         for option in confParser.options(section):
00234           if option == 'vmax':
00235             self.__input['vmax'] = confParser.get(section, option)
00236             self.txtVMAX.setText(self.__input['vmax'])
00237           elif option == 'vset':
00238             self.__input['vset'] = confParser.get(section, option)
00239             self.txtVSET.setText(self.__input['vset'])
00240           elif option == 'imax':
00241             self.__input['imax'] = confParser.get(section, option)
00242             self.txtIMAX.setText(self.__input['imax'])
00243           elif option == 'iset':
00244             self.__input['iset'] = confParser.get(section, option)
00245             self.txtISET.setText(self.__input['iset'])
00246
00247     if self.__address is None:
00248       error = True
00249       log.error("'%s' option missing from section '%s'" % ('device', 'address'))
00250
00251     for inp in self.__input:
00252       if self.__input[inp] is None:
00253         error = True
00254         log.error("'%s' option missing from section '%s'" % (inp, 'input'))
00255
00256     return error
00257
00258   def releaseGpib(self):
00259     self.clearReadout()
00260     self.clearSettings()
00261     self.labelStatus.unsetPalette()
00262     self.labelStatus.setText('')
00263     self.txtError.unsetPalette()
00264     self.txtError.setText('')
00265     self.stopTimer()
00266     self.__power.unlock()
00267     self.__power.close()
00268     self.__init = False
00269     self.buttonRelease.setEnabled(0)
00270
00271   def startTimer(self):
00272     self.updateReadout()
00273     self.__timer.start(self.__interval)
00274
00275   def stopTimer(self):
00276     self.__timer.stop()
00277
00278   def showEvent(self, e):
00279     if self.__init:
00280       self.startTimer()
00281
00282   def closeEvent(self, e):
00283     self.stopTimer()
00284     e.accept()
00285
00286   def shutdown(self):
00287     self.unregisterExitHandler()
00288     self.stopTimer()
00289     self.__power.unlock()
00290     self.__power.close()
00291
00292   def unregisterExitHandler(self):
00293     for i in range(len(atexit._exithandlers)):
00294       if atexit._exithandlers[i][0] == self.shutdown:
00295         del atexit._exithandlers[i]
00296         break
00297
00298   def normalCursor(self):
00299     self.setCursor(QCursor(Qt.ArrowCursor))
00300
00301   def waitCursor(self):
00302     self.setCursor(QCursor(Qt.WaitCursor))
00303
00304 if __name__ == "__main__":
00305   import gpibCtrl
00306   a = QApplication(sys.argv)
00307   gpc = GpibPwrCtrlImpl(gpibCtrl)
00308   QObject.connect(a,SIGNAL("lastWindowClosed()"), a, SLOT("quit()"))
00309   a.setMainWidget(gpc)
00310   gpc.show()
00311   a.exec_loop()
00312
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gPlumber.py Source File

database

gPlumber.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Power and LCB initialization (plumbing) class"
00013 __author__  = "A. Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = ("$Date: 2005/09/23 01:44:13 $").split(' ')[1]
00015 __version__ = "$Revision: 2.13 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__ = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020 import logging
00021 import gFabrics
00022 import gLCB
00023
00024 import LATTE.client.gException as gException
00025
00026 class Plumber(object):
00027   __lcbred  = 8
00028   __lcbbit  = 9
00029   __lcbiclk = 10
00030   __lcboclk = 11
00031
00032   __cmdtem = 0
00033   __cmdgem = 16
00034   __cmdaem = 17
00035   __cmdebm = 18
00036   __cmdpdu = 19
00037   __cmdsiu = 24
00038   __cmdepu = 27
00039
00040   __evtgem = 0
00041   __evttem = 1
00042   __evtaem = 17
00043   __evtsiu = 18
00044   __evtepu = 21
00045
00046   __siumfs = 0
00047   __siupd0 = 1
00048   __siupd1 = 2
00049   __siuda0 = 3
00050   __siuda1 = 4
00051
00052   __ocsmsglevel  = 0x0f
00053   __ocsverbose   = 0x10
00054   __ocsinitforce = 0x20
00055   __ocsinitxbrd  = 0x40
00056   __ocsusexbrd   = 0x80
00057
00058   def __init__(self, lat, xbrd):
00059     self.__ocsopts=0
00060     self.__pwrmask=0
00061     self.__lcbmask=0
00062
00063     self.__cmdmask=0
00064     self.__pdumask=0
00065     self.__secmask=0
00066     self.__evtmask=0
00067
00068     integer = True
00069     self.__lat = lat
00070     self.__lcb = lat.LCB
00071
00072     ignore_missing_nodes = self.__lcb.getFlag('IgnoreMissingNodes', integer)
00073     if ignore_missing_nodes:
00074       self.__evtmset=0
00075       self.__cmdmset=0
00076     else:
00077       self.__evtmset=0xffffffffL
00078       self.__cmdmset=0xffffffffL
00079
00080     self.__lcbmask = self.__lcb.getFlag('BoardId', integer)
00081     if self.__lcb.getFlag('UseRedundant', integer):
00082       self.__lcbmask |= 1<<Plumber.__lcbred
00083     if self.__lcb.getFlag('UseBitWide', integer):
00084       self.__lcbmask |= 1<<Plumber.__lcbbit
00085     if self.__lcb.getFlag('UseTrailingIclock', integer):
00086       self.__lcbmask |= 1<<Plumber.__lcbiclk
00087     if self.__lcb.getFlag('UseTrailingOclock', integer):
00088       self.__lcbmask |= 1<<Plumber.__lcboclk
00089
00090     if xbrd is not None:
00091       self.__ocsopts |= Plumber.__ocsinitxbrd
00092       if xbrd.GLT is not None:
00093         self.__ocsopts |= Plumber.__ocsusexbrd
00094
00095     if lat.existsGEM():
00096       self.__setcmd(lat.GEM, Plumber.__cmdgem)
00097       self.__setevt(lat.GEM, Plumber.__evtgem)
00098
00099     if lat.existsAEM():
00100       self.__setcmd(lat.AEM, Plumber.__cmdaem)
00101       self.__setevt(lat.AEM, Plumber.__evtaem)
00102       if lat.AEM.getFlag('UsePdu1', integer):
00103         self.__pdumask |= (1<<(Plumber.__cmdaem))
00104       if lat.AEM.getFlag('UseRedundantConv', integer):
00105         self.__secmask |= (1<<(Plumber.__cmdaem))
00106
00107     if lat.existsEBM():
00108       self.__setcmd(lat.EBM, Plumber.__cmdebm)
00109
00110     for pdu in lat.PDU.values():
00111       self.__setcmd(pdu, Plumber.__cmdpdu+pdu.id())
00112
00113     for tem in lat.TEM.values():
00114       self.__setcmd(tem, Plumber.__cmdtem+tem.id())
00115       self.__setevt(tem, Plumber.__evttem+tem.id())
00116       if tem.getFlag('UsePdu1', integer):
00117         self.__pdumask |= (1<<(Plumber.__cmdtem+tem.id()))
00118
00119     for siu in lat.SIU.values():
00120       self.__setcmd(siu, Plumber.__cmdsiu+siu.id())
00121       self.__setevt(siu, Plumber.__evtsiu+siu.id())
00122       if siu.getFlag('UseSecMainFeed', integer):
00123         self.__pwrmask |= 1<<Plumber.__siumfs
00124       if siu.getFlag('PowerPdu0', integer):
00125         self.__pwrmask |= 1<<Plumber.__siupd0
00126       if siu.getFlag('PowerPdu1', integer):
00127         self.__pwrmask |= 1<<Plumber.__siupd1
00128       if siu.getFlag('PowerPrimDab', integer):
00129         self.__pwrmask |= 1<<Plumber.__siuda0
00130       if siu.getFlag('PowerSecDab', integer):
00131         self.__pwrmask |= 1<<Plumber.__siuda1
00132       break
00133
00134     for epu in lat.EPU.values():
00135       self.__setcmd(epu, Plumber.__cmdepu+epu.id())
00136       self.__setevt(epu, Plumber.__evtepu+epu.id())
00137       if epu.getFlag('UsePdu1', integer):
00138         self.__pdumask |= 1<<(Plumber.__cmdepu+epu.id())
00139       if epu.getFlag('UseRedundantConv', integer):
00140         self.__secmask |= 1<<(Plumber.__cmdepu+epu.id())
00141
00142     # Backward comp with schemas with no SIUs/EPUs: add SIU0 to EBM dest mask
00143     if len(lat.SIU.items()) == 0 and len(lat.EPU.items()) == 0:
00144       self.__evtmset |= 1<<(Plumber.__evtsiu+1)
00145       self.__evtmask |= 1<<(Plumber.__evtsiu+1)
00146
00147   def __setcmd(self, node, position):
00148     flag = node.getFlag('CmdrspFabric')
00149     if flag == 'On':
00150       self.__cmdmset |= 1<<position
00151       self.__cmdmask |= 1<<position
00152     elif flag == 'Off':
00153       self.__cmdmset |= 1<<position
00154     elif flag == 'Ignore':
00155       pass
00156     else:
00157       raise RuntimeError, "Node %s has invalid CmdrspFabric flag %s" \
00158             %(node.__class__.__name__, flag)
00159
00160   def __setevt(self, node, position):
00161     flag = node.getFlag('EventFabric')
00162     if flag == 'On':
00163       self.__evtmset |= 1<<position
00164       self.__evtmask |= 1<<position
00165     elif flag == 'Off':
00166       self.__evtmset |= 1<<position
00167     elif flag == 'Ignore':
00168       pass
00169     else:
00170       raise RuntimeError, "Node %s has invalid EventFabric flag %s" \
00171             %(node.__class__.__name__, flag)
00172
00173   def __init_ocs(self, fswmsglevel, ocsverbose, force):
00174     self.__ocsopts &= ~Plumber.__ocsmsglevel
00175     self.__ocsopts |= (fswmsglevel & Plumber.__ocsmsglevel)
00176     if ocsverbose:
00177       self.__ocsopts |= Plumber.__ocsverbose
00178     else:
00179       self.__ocsopts &= ~Plumber.__ocsverbose
00180     if force:
00181       logging.info('forcing fabric initialization')
00182       self.__ocsopts |= Plumber.__ocsinitforce
00183     else:
00184       self.__ocsopts &= ~Plumber.__ocsinitforce
00185     rsp = self.__lcb.cmdrsp('init_ocs', self.__ocsopts)
00186     if rsp.status() & 0x3:
00187       raise gException.LATInterfaceException(rsp.status())
00188
00189   def __init_oes(self):
00190     rsp = self.__lcb.cmdrsp('init_oes', self.__ocsopts)
00191     if rsp.status() & 0x3:
00192       raise gException.LATInterfaceException(rsp.status())
00193
00194   def __init_power(self):
00195     rsp = self.__lcb.cmdrsp('init_power', self.__pwrmask)
00196     if rsp.status() & 0x3:
00197       raise gException.LATInterfaceException(rsp.status())
00198
00199   def __start_lcb(self):
00200     status = self.__lcb.start(self.__lcbmask)
00201     timeout = None
00202     if status == gException.LATInterfaceStatus.status('LCBD_NOCLK'):
00203       logging.error('waiting for the 20 MHz clock')
00204       timeout = 60
00205     elif status & 0x3:
00206       raise gException.LATInterfaceException(status)
00207     status = self.__lcb.start_wait(self.__lcbmask, timeout)
00208     if status & 0x3:
00209       raise gException.LATInterfaceException(status)
00210     logging.info('LCB state is now %s' %(gLCB.GLCB.State[self.__lcb.state()]))
00211
00212   def __switch_lcb(self):
00213     state = self.__lcb.switch(self.__lcbmask)
00214     timeout = None
00215     if state == gLCB.GLCB.Offline:
00216       logging.error('waiting for the 20 MHz clock')
00217       timeout = 60
00218       state = self.__lcb.switch_wait(timeout)
00219     logging.info('LCB state is now %s' %(gLCB.GLCB.State[state]))
00220
00221   def __setInternal1PPS(self, cru):
00222     internal1PPS = cru.getFlag('EnableInternal1PPS', integer=True)
00223     cruConfig = cru.configuration
00224     if cruConfig & 0x1 == 0x1 and internal1PPS == 0:
00225       cruConfig &= 0xFFFE
00226       cru.configuration = cruConfig
00227     elif cruConfig & 0x1 == 0x0 and internal1PPS == 1:
00228       cruConfig |= 0x1
00229       cru.configuration = cruConfig
00230       logging.info("Enabling internal 1-PPS")
00231
00232   def initialize(self, fswmsglevel, ocsverbose, force, commander=True):
00233     self.__init_ocs(fswmsglevel, ocsverbose, force)
00234     state = self.__lcb.state()
00235     if state == gLCB.GLCB.Uninitialized:
00236       logging.info('LCB state is uninitialized, will load LCB')
00237       self.__init_power()
00238       self.__start_lcb()
00239     else:
00240       logging.info('LCB state is initialized, checking for clock')
00241       self.__switch_lcb()
00242     self.__init_oes()
00243     if commander:
00244       fabrics = gFabrics.Fabrics(self.__lcb)
00245       fabrics.init_cmdrsp(self.__cmdmask, self.__cmdmset,
00246                           self.__pdumask, self.__secmask)
00247       fabrics.init_event(self.__evtmask, self.__evtmset)
00248       if self.__lat.existsCRU():
00249         self.__setInternal1PPS(self.__lat.CRU)
00250
Generated on Fri Jul 21 13:26:28 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Graph Legend

Graph Legend

This page explains how to interpret the graphs that are generated by doxygen.

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };

/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };

/* Class not documented with doxygen comments */
class Undocumented { };

/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };

/*! A template class */
template<class T> class Templ { };

/*! Class that is inherited using protected inheritance */
class ProtectedBase { };

/*! Class that is inherited using private inheritance */
class PrivateBase { };

/*! Class that is used by the Inherited class */
class Used { };

/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
                  protected ProtectedBase,
                  private PrivateBase,
                  public Undocumented
                  public Templ<int>
{
  private:
    Used *m_usedClass;
};
If the MAX_DOT_GRAPH_HEIGHT tag in the configuration file is set to 240 this will result in the following graph:

The boxes in the above graph have the following meaning:

  • A filled black box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
The arrows have the following meaning:
  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
  • A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.
Generated on Fri Jul 21 13:28:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gRegister.py Source File

client

gRegister.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Register access class"
00013 __author__   = "Amedeo Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/08/24 22:57:25 $").split(' ')[1]
00015 __version__  = "$Revision: 2.3 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020 import struct
00021
00022 class Register:
00023   def __init__(self, timestamp, status, payloads, format):
00024     self.__timestamp = timestamp
00025     self.__status    = status
00026     p = 0
00027     shift = 0
00028     value = 0
00029     for payload in payloads:
00030       f = format[p]
00031       value |= payload << shift
00032       p += 1
00033       shift += struct.calcsize(f) << 3
00034     self.__value = value
00035
00036   def timestamp(self):
00037     return self.__timestamp
00038
00039   def status(self):
00040     return self.__status
00041
00042   def value(self):
00043     return self.__value
Generated on Fri Jul 21 13:26:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gResponse.py Source File

client

gResponse.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Response class"
00013 __author__   = "Amedeo Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2005/07/11 17:08:14 $").split(' ')[1]
00015 __version__  = "$Revision: 2.6 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020 import struct
00021 import gException
00022
00023 class Response:
00024   def __init__(self, command, result):
00025     self.__timestamp = 0x0L
00026     self.__status    = 0
00027     self.__payloads  = []
00028     self.__formats  = command.payloadfmts()
00029
00030     fmt = '!IQI'
00031     for payloadfmt in self.__formats:
00032       fmt += payloadfmt
00033     if len(result) != struct.calcsize(fmt):
00034       print "*** gResponse: received %d bytes but expected %d bytes" \
00035             %(len(result), struct.calcsize(fmt))
00036       self.__status = gException.LATInterfaceStatus.status('OCS_BDRESP')
00037     else:
00038       rsp = struct.unpack(fmt, result)
00039       self.__timestamp = rsp[1]
00040       self.__status    = rsp[2]
00041       self.__payloads  = rsp[3:]
00042
00043   def timestamp(self):
00044     return self.__timestamp
00045
00046   def status(self):
00047     return self.__status & 0x7fffffff
00048
00049   def rvalue(self):
00050     return self.__status
00051
00052   def value(self):
00053     return self.__payloads[0]
00054
00055   def payloads(self):
00056     return self.__payloads
Generated on Fri Jul 21 13:26:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gRule.py Source File

database

gRule.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Classes for defining rules"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/02/04 18:27:04 $").split(' ')[1]
00014 __version__  = "$Revision: 2.4 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019
00020 import               gGroup
00021 import logging as    log
00022 import LATTE.dispatch.dispatcher as dispatcher
00023
00024 class GruleBase(object):
00025   """\brief Base rule class for use when no rule is appropriate.
00026
00027   """
00028   def __init__(self):
00029     pass
00030   def evaluate(self, value, attr, node=None):
00031     pass
00032
00033
00034 class Grule(GruleBase):
00035   """\brief Base class for describing rules.
00036
00037   """
00038   def __init__(self, name, subsystem, category, enabled, continuous = False):
00039     """Constructor.
00040       \param name       Rule name
00041       \param subsystem  Subsystem gGroup to which the rule belongs
00042       \param category   Category gGroup to which the rule belongs
00043       \param enabled    Flag indicating whether rule is enabled
00044       \param continuous Flag indicating whether rule can fire repeatedly
00045
00046     """
00047     self.__name       = name
00048     self.__subsystem  = subsystem
00049     self.__category   = category
00050     self.__enabled    = enabled
00051     self.__continuous = continuous
00052     self.__fired      = {}  # A dict of node:bool pairs indicating if a partic node has fired.
00053     self.__actions    = {}
00054     # init self.__fired
00055     self.__fired[None]= False
00056
00057   def _eval_(self, value, attr, node):
00058     """Base method called from derived classes.
00059     determine whether or not this rule can fire or not.
00060
00061     \return a tuple containing the value of the test and whether the rule can fire or not.
00062     """
00063     key = (node, attr)
00064     # print "baseEval: ", self.__continuous, self.__fired.has_key(key)
00065
00066     if ( (self.__continuous) or\
00067          (not self.__fired.has_key(key)) or\
00068          (not self.__continuous and not self.__fired[key]) ):
00069       return (value, True)
00070     else:
00071       return (value, False)
00072
00073   def evaluate(self, value, attr, node=None):
00074     """This method is called to evaluate the rule on 'value'
00075
00076     \param value Value to be evaluated.
00077     \param attr  Attribute object whose \a value is being evaluated.
00078
00079     \return Result of the evaluation, if any.
00080
00081     """
00082     if self.__subsystem.enabled() and \
00083        self.__category.enabled()  and \
00084        self.__enabled:
00085       return self._eval_(value, attr, node)
00086     else:
00087       return (value, False)
00088
00089   def name(self):
00090     """Method to retrieve the rule's name
00091
00092     \return Rule's name.
00093
00094     """
00095     return self.__name
00096
00097   def subsystem(self):
00098     """Method for discovering this rule's subsystem
00099
00100     \return Rule's subsystem.
00101
00102     """
00103     return self.__subsystem
00104
00105   def category(self):
00106     """Method for discovering this rule's category
00107
00108     \return Rule's category.
00109
00110     """
00111     return self.__category
00112
00113   def enabled(self):
00114     """Method for discovering whether this rule is enabled
00115
00116     \return Whether this rule is enabled or not.
00117
00118     """
00119     return self.__enabled
00120
00121   def enable(self):
00122     """Method used to enable evaluation of this rule
00123
00124     """
00125     self.__enabled = True
00126
00127   def disable(self):
00128     """Method used to disable evaluation of this rule
00129
00130     """
00131     self.__enabled = False
00132
00133   def reset(self, node=None):
00134     """Method used to reenable evaluation of this rule in the case of
00135     noncontinuous mode after it has been violated
00136
00137     """
00138     self.__fired[node] = False
00139
00140   def fire(self, node=None):
00141     """Method used to tell the rule it has fired
00142     """
00143     self.__fired[node] = True
00144
00145   def fired(self, node=None):
00146     """Method for discovering whether this rule has fired
00147
00148     \return Whether this rule has fired or not
00149     """
00150     if node not in self.__fired:
00151       return False
00152     else:
00153       return self.__fired[node]
00154
00155   def registerAction(self, action, method, sender=dispatcher.Any):
00156     """Associate and action with a user \a method, optionally specifying a \a sender.
00157     If a \a sender is not specified, the rule \a action may be fired for all registers
00158     which declare its rule to be the rule of this \a action. If an attribute is
00159     specified as the \a sender then only if the evaluation of that specific attribute
00160     causes the \a action to be fired the \a method will be called.
00161
00162     \param action A string that represents the action to be taken.
00163                   This is specified under the <actions> tag in the schema/configuration.
00164     \param method A user method visible to the current context.
00165     \param sender Optional parameter that specifies the sender of the action registration.
00166                   If specifed, only the sendAction requests which specify the same sender
00167                   will be honored. Defaults to dispatcher.Any.
00168
00169     """
00170     if action not in self.__actions:
00171       log.error("Unable to register action %s, not specified in the configuration." % action)
00172     else:
00173       dispatcher.connect(method, signal=action, sender=sender)
00174
00175   def setActions(self, actions):
00176     """Convenience method that gets called from the rule constructor
00177     that defines the action names (which is read from the schema/configuration).
00178
00179     \param actions A list containing the action names.
00180
00181     """
00182     self.__actions = actions
00183
00184   def sendAction(self, action, sender, *arguments, **named):
00185     """Called from the rule evaluation method to fire the appropriate alarm action.
00186
00187     \param action     A string that represents the action to be taken.
00188                       This is specified under the <actions> tag in the schema/configuration.
00189     \param sender     The sender that made the rule firing request. This is usually the
00190                       attribute which is being evaluated.
00191     \param *arguments An optional list of arguments which gets passed to the action method.
00192
00193     \return A list of tuple pairs [(receiver, response), ... ]
00194     """
00195     return dispatcher.send(action, sender, *arguments, **named)
00196
00197   def clearAllActions(self):
00198     """
00199     Forces all registered actions to be cleared.
00200     If this is not done and the scripts re-register their
00201     actions there may be extraneous rule action firings.
00202     """
00203     dispatcher.connections = {}
00204
00205   def unregisterAction(self, action, method, sender=dispatcher.Any):
00206     """Reverse of registerAction, disassociates the action from the method.
00207
00208    \param action A string that represents the action to be taken.
00209                   This is specified under the <actions> tag in the schema/configuration.
00210     \param method A user method visible to the current context.
00211     \param sender Optional parameter that specifies the sender of the action registration.
00212                   If specifed, only the sendAction requests which specify the same sender
00213                   will be honored. Defaults to dispatcher.Any.
00214     """
00215     dispatcher.disconnect(method, action, sender)
00216
00217 class GruleLimit(Grule):
00218   """\brief Rule class that limits a passed in value to given limits.
00219
00220   """
00221   def __init__(self, name, subsystem, category, enabled, continuous,
00222                low, high):
00223     """Limit rule constructor.
00224
00225       \param name             Rule name
00226       \param subsystem        Subsystem gGroup to which the rule belongs
00227       \param category         Category gGroup to which the rule belongs
00228       \param enabled          Flag indicating whether rule is enabled
00229       \param continuous       Flag indicating whether rule can fire repeatedly
00230       \param low              Low limit
00231       \param high             High limit
00232
00233     """
00234     Grule.__init__(self, name, subsystem, category, enabled, continuous)
00235     self.__low  = low
00236     self.__high = high
00237
00238   def _eval_(self, value, attr, node):
00239     """Evaluate the rule.
00240     """
00241     if   value < self.__low:
00242       log.warning("%s rule: value is below low limit"  % self.name())
00243     elif value > self.__high:
00244       log.warning("%s rule: value is above high limit" % self.name())
00245
00246 class GruleAlarms(Grule):
00247   """\brief Alarm rule
00248
00249   If the value falls below the yellow or red lower limit or it exceeds
00250   the yellow or red upped limit the appropriate registered action is
00251   fired.
00252   """
00253   def __init__(self, name, subsystem, category, enabled, continuous,
00254                yellowUpperLimit, yellowLowerLimit,
00255                redUpperLimit, redLowerLimit, actions=[]):
00256     """Alarm rule constructor.
00257
00258       \param name             Rule name
00259       \param subsystem        Subsystem gGroup to which the rule belongs
00260       \param category         Category gGroup to which the rule belongs
00261       \param enabled          Flag indicating whether rule is enabled
00262       \param continuous       Flag indicating whether rule can fire repeatedly
00263       \param yellowUpperLimit Yellow alarm upper limit
00264       \param yellowLowerLimit Yellow alarm lower limit
00265       \param redUpperLimit    Red alarm upper limit
00266       \param redLowerLimit    Red alarm lower limit
00267     """
00268
00269     Grule.__init__(self, name, subsystem, category, enabled, continuous)
00270     self.__yellowLowerLimit = yellowLowerLimit
00271     self.__yellowUpperLimit = yellowUpperLimit
00272     self.__redLowerLimit = redLowerLimit
00273     self.__redUpperLimit = redUpperLimit
00274     self.setActions(actions)
00275
00276   def _eval_(self, value, attr, node):
00277     """Alarm rule evaluation method.
00278
00279     If the red alarm is fired then the yellow alarm does not get fired.
00280     """
00281     action = None
00282     key = (node, attr)
00283     if value < self.__redLowerLimit or value > self.__redUpperLimit:
00284       action = "redAction"
00285     elif value < self.__yellowLowerLimit or value > self.__yellowUpperLimit:
00286       action = "yellowAction"
00287     else:
00288       self.reset(key)
00289     temp, canFire = Grule._eval_(self, value, attr, node)
00290     if action is not None and canFire:
00291       self.fire(key)
00292       self.sendAction(action, attr, value, node=node)
00293
00294
Generated on Fri Jul 21 13:26:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gSchemaConfig.py Source File

database

gSchemaConfig.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = """Build the GLAST LAT database schema and configuration from
00012 an XML defintion.
00013 """
00014 __author__  = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00015 __date__    = ("$Date: 2006/07/17 18:42:26 $").split(' ')[1]
00016 __version__ = "$Revision: 2.81 $"
00017 __release__ = "$Name: R04-12-00 $"
00018 __credits__ = "SLAC"
00019
00020 import LATTE.copyright_SLAC
00021
00022
00023 import os
00024 import sys
00025 import inspect
00026 import types
00027 import logging          as     log
00028 import gc
00029
00030 from xml.dom             import Node
00031 #from xml.dom.ext.reader import Sax2
00032 #from xml.dom.NodeFilter import NodeFilter
00033 #from xml.dom.ext        import PrettyPrint
00034 #from xml.dom            import implementation
00035
00036 #import xml.dom.minidom  as minidom
00037
00038 from Ft.Xml.Domlette import NonvalidatingReader, PrettyPrint, implementation
00039 from Ft.Lib          import Uri
00040 from Ft.Xml          import EMPTY_NAMESPACE
00041
00042 from ihooks             import BasicModuleLoader
00043
00044 from gGroup             import *
00045
00046 from LATTE.client import gLog
00047 from LATTE.client import gBits
00048 from LATTE.client import gException
00049
00050 # Default namespace for all XML files used by LATTE.
00051 # This currently has to be None or '' since we do not
00052 # currently qualify tags and attributes with a namespace.
00053 LAT_NAMESPACE = EMPTY_NAMESPACE
00054
00055 # (tray, which) to layer map
00056 MAP_DETECTOR_TO_LAYER = {
00057                          (18, 'bot'): 'Y17',
00058                          (17, 'top'): 'X17',
00059                          (17, 'bot'): 'X16',
00060                          (16, 'top'): 'Y16',
00061                          (16, 'bot'): 'Y15',
00062                          (15, 'top'): 'X15',
00063                          (15, 'bot'): 'X14',
00064                          (14, 'top'): 'Y14',
00065                          (14, 'bot'): 'Y13',
00066                          (13, 'top'): 'X13',
00067                          (13, 'bot'): 'X12',
00068                          (12, 'top'): 'Y12',
00069                          (12, 'bot'): 'Y11',
00070                          (11, 'top'): 'X11',
00071                          (11, 'bot'): 'X10',
00072                          (10, 'top'): 'Y10',
00073                          (10, 'bot'): 'Y9',
00074                          ( 9, 'top'): 'X9',
00075                          ( 9, 'bot'): 'X8',
00076                          ( 8, 'top'): 'Y8',
00077                          ( 8, 'bot'): 'Y7',
00078                          ( 7, 'top'): 'X7',
00079                          ( 7, 'bot'): 'X6',
00080                          ( 6, 'top'): 'Y6',
00081                          ( 6, 'bot'): 'Y5',
00082                          ( 5, 'top'): 'X5',
00083                          ( 5, 'bot'): 'X4',
00084                          ( 4, 'top'): 'Y4',
00085                          ( 4, 'bot'): 'Y3',
00086                          ( 3, 'top'): 'X3',
00087                          ( 3, 'bot'): 'X2',
00088                          ( 2, 'top'): 'Y2',
00089                          ( 2, 'bot'): 'Y1',
00090                          ( 1, 'top'): 'X1',
00091                          ( 1, 'bot'): 'X0',
00092                          ( 0, 'top'): 'Y0'
00093                         }
00094
00095
00096 # layer to (cc lo, cc hi, rc) map
00097 MAP_LAYER_TO_CABLE = {
00098                         'Y17': (5,4,8),
00099                         'X17': (6,7,8),
00100                         'X16': (3,2,8),
00101                         'Y16': (0,1,8),
00102                         'Y15': (5,4,7),
00103                         'X15': (6,7,7),
00104                         'X14': (3,2,7),
00105                         'Y14': (0,1,7),
00106                         'Y13': (5,4,6),
00107                         'X13': (6,7,6),
00108                         'X12': (3,2,6),
00109                         'Y12': (0,1,6),
00110                         'Y11': (5,4,5),
00111                         'X11': (6,7,5),
00112                         'X10': (3,2,5),
00113                         'Y10': (0,1,5),
00114                         'Y9' : (5,4,4),
00115                         'X9' : (6,7,4),
00116                         'X8' : (3,2,4),
00117                         'Y8' : (0,1,4),
00118                         'Y7' : (5,4,3),
00119                         'X7' : (6,7,3),
00120                         'X6' : (3,2,3),
00121                         'Y6' : (0,1,3),
00122                         'Y5' : (5,4,2),
00123                         'X5' : (6,7,2),
00124                         'X4' : (3,2,2),
00125                         'Y4' : (0,1,2),
00126                         'Y3' : (5,4,1),
00127                         'X3' : (6,7,1),
00128                         'X2' : (3,2,1),
00129                         'Y2' : (0,1,1),
00130                         'Y1' : (5,4,0),
00131                         'X1' : (6,7,0),
00132                         'X0' : (3,2,0),
00133                         'Y0' : (0,1,0)
00134                      }
00135
00136 # Minitower configuration
00137 #MINITOWER_MAP_LAYER_TO_CABLE = {
00138 #                                  'Y3' : (6,7,1),
00139 #                                  'X3' : (4,5,1),
00140 #                                  'X2' : (0,1,1),
00141 #                                  'Y2' : (2,3,1),
00142 #                                  'Y1' : (6,7,0),
00143 #                                  'X1' : (4,5,0),
00144 #                                  'X0' : (0,1,0),
00145 #                                  'Y0' : (2,3,0)
00146 #                              }
00147
00148 MAP_TEM_TO_TOWER = {
00149                               #TEM_ID -> (col,row)
00150                               '0':(0,0),
00151                               '1':(1,0),
00152                               '2':(2,0),
00153                               '3':(3,0),
00154                               '4':(0,1),
00155                               '5':(1,1),
00156                               '6':(2,1),
00157                               '7':(3,1),
00158                               '8':(0,2),
00159                               '9':(1,2),
00160                               '10':(2,2),
00161                               '11':(3,2),
00162                               '12':(0,3),
00163                               '13':(1,3),
00164                               '14':(2,3),
00165                               '15':(3,3)
00166                    }
00167
00168 VALID_NODES = ['GLAT','GTEM','GTIC','GCCC','GCRC','GCFE','GTCC','GTRC','GTFE',
00169                'GAEM','GAEQ','GARC','GAFE','GCRU','GEBM','GEBMC','GEBMST',
00170                'GGEM','GGEMC','GGEMMG','GGEMST','GGEMSC','GGEMVG','GGEMIE','GGEMW',
00171                'GXBRD','GTWR','GLCB','GPDU','GPEQ','GGLT','GSIU', 'GEPU']
00172
00173
00174 def readSchema(glat, fileName):
00175   """Reads a LAT schema/config document from an XML file
00176   and returns the object model
00177
00178   Input ::
00179
00180     (1) Filename of the XML
00181     (2) Optional active (connected) command client reference.
00182         Not needed if the document does not contain a 'configuration' section
00183
00184   Output::
00185
00186     GLAT root of the object model
00187
00188   Usage::
00189
00190     lat = readSchema('testSchema.xml')"""
00191   #reader = PyExpat.Reader()
00192   #doc = reader.fromStream(file(fileName,'r'))
00193
00194   # Change the directory to the path of the schema file
00195   # in case the include files do not have absolute paths
00196   fn = "readSchema"
00197   curDir = os.getcwd()
00198   mainFilePath = os.path.dirname(fileName)
00199   mainFileName = os.path.basename(fileName)
00200   if mainFilePath != '': os.chdir(mainFilePath)
00201   try:
00202     #doc = Sax2.FromXmlFile(mainFileName)
00203     #doc = minidom.parse(mainFileName)
00204     file_uri = Uri.OsPathToUri(mainFileName, attemptAbsolute=1)
00205     doc = NonvalidatingReader.parseUri(file_uri)
00206   except Exception, e:
00207     if os.path.exists(curDir):
00208       os.chdir(curDir)
00209     log.exception("%s: Error parsing XML: %s" % (fn, mainFileName))
00210     raise e
00211
00212   comments = []
00213   for n in doc.childNodes:
00214     if n.nodeType == Node.COMMENT_NODE:
00215       comments.append(n.data)
00216   tagName = doc.documentElement.tagName.lower()
00217   if tagName != "latdoc":
00218     log.error("%s: Invalid LAT document tag: %s" % (fn,tagName))
00219     if os.path.exists(curDir):
00220       os.chdir(curDir)
00221     return None
00222
00223   includeFiles = []
00224   processIncludes(doc, doc.documentElement, includeFiles, mainFilePath)
00225
00226   declarations =  { 'imports':{},
00227                     'groups':{},
00228                     'constraints':{('default','default'):{}},
00229                     'rules':{('default','default'):{}},
00230                     'egus':{('default','default'):{}},
00231                     'options':{'skipsystemoverrides':0,
00232                                'explicitbroadcastnodes':0,
00233                                'ignorehardwaretimeouts':0
00234                                },
00235                     'sysregs': {},
00236                   }
00237   deadChannels  = {'calib':{}, 'data':{}, 'trig':{}}
00238   noisyChannels = {'calib':{}, 'data':{}, 'trig':{}}
00239   name = str(getAttribute(doc.documentElement, 'name'))
00240   pNodeClass = glat.__class__.__name__
00241   isSchema = None
00242   for n in getChildNodes(doc.documentElement):
00243     if n.nodeType == Node.ELEMENT_NODE:
00244       tagname = str(n.tagName).lower()
00245       if  tagname == 'declarations':
00246         processDeclarations(1, n, declarations)
00247       elif tagname == 'constraints':
00248         processConstraints(n, declarations)
00249       elif tagname == 'rules':
00250         processRules(n, declarations)
00251       elif tagname == 'egus':
00252         processEGUs(n, declarations)
00253       elif tagname == 'schema':
00254         isSchema = 0
00255         xbrdExists = False
00256         for node in getChildNodes(n):
00257           if pNodeClass in gSCprocessRegistry.keys() and \
00258              pNodeClass.lower() == node.tagName.lower():
00259             isSchema = 1
00260             gSCprocessRegistry[pNodeClass](isSchema, glat, node, declarations)
00261           elif node.tagName.lower() == 'gxbrd':
00262             xbrdExists = True
00263 #           if pNodeClass == 'GLAT' and node.tagName.lower() == 'glat':
00264 #             processGLAT(isSchema=1, glat=glat,
00265 #                         node=node, declarations=declarations)
00266 #             break
00267 #           elif pNodeClass == 'GXBRD' and node.tagName.lower() == 'gxbrd':
00268 #             processGXBRD(isSchema=1, gxbrd=glat,
00269 #                         node=node, declarations=declarations)
00270 #             break
00271           # Silently skip other root tags for now.
00272           #else:
00273           #  log.error("%s: Unexpected tag: %s for root: %s" % (fn, node.tagName, glat.__class__.__name__))
00274       elif tagname == 'configuration':
00275         configName = ''
00276         configVersion = ''
00277         if hasAttribute(n, 'name'):
00278           configName = str(getAttribute(n, 'name'))
00279         if hasAttribute(n, 'version'):
00280           configVersion = str(getAttribute(n, 'version'))
00281         configs = glat.getConfigurations()
00282         configSeq = len(configs)
00283         configs[configSeq] = (n, configName, configVersion)
00284       elif tagname == 'badstrips' and pNodeClass == 'GLAT':
00285         typ = str(getAttribute(n, 'badType'))
00286         if typ == 'dead':
00287           processBadChannels(n, deadChannels)
00288         elif typ == 'hot':
00289           processBadChannels(n, noisyChannels)
00290         else:
00291           log.error("%s: Unrecognized bad strip type: %s" % (fn, typ))
00292         doc.documentElement.removeChild(n)
00293         gc.collect()
00294       elif tagname == 'opaque':
00295         addOpaque(glat, n)
00296       elif tagname == 'flags':
00297         for flag_glat in getChildNodes(n):
00298           if str(flag_glat.tagName).lower() == pNodeClass.lower():
00299             processFlags(glat, flag_glat)
00300       elif pNodeClass == 'GLAT':
00301         log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00302         if os.path.exists(curDir):
00303           os.chdir(curDir)
00304         return None
00305
00306   # need to write some private attributes in the glat object, but there's no
00307   # guarantee of what the class's type actually is.  It doesn't matter if the
00308   # class doesn't have the attribute, this will create it.
00309   # Use the __dict__ and create the string on the fly.
00310   gname = glat.__class__.__name__
00311   gdict = glat.__dict__
00312   gdict["_" + gname + '__schemaName']        = name
00313   gdict["_" + gname + '__schemaComments']    = comments
00314   gdict["_" + gname + '__includeFiles']      = includeFiles
00315   gdict["_" + gname + '__declarations']      = declarations
00316   gdict["_" + gname + '__deadChannels']      = deadChannels
00317   gdict["_" + gname + '__noisyChannels']     = noisyChannels
00318
00319   if gname == 'GXBRD':
00320     gxbrd = glat
00321   else:
00322     gdict["_" + gname + '__xbrdExists']     = xbrdExists
00323     gxbrd = None
00324   applyConfig(glat, seq=None, gxbrd=gxbrd, enableSystemOverrides=False, enableRegWrite=False)
00325
00326   if os.path.exists(curDir):
00327     os.chdir(curDir)
00328   #PrettyPrint(doc, file("c:/projects/latte/tests/post.xml", "w"))
00329   if isSchema == 0:
00330     # A matching schema root tag (such as GLAT or GXBRD) was not found
00331     return None
00332   else:
00333     return glat
00334
00335 def processFlags(gnode, xnode):
00336   fn = "processFlags"
00337
00338   childNodes = []
00339   flags = {}
00340
00341   for n in getChildNodes(xnode):
00342     tagname = str(n.tagName)
00343     if tagname in VALID_NODES:
00344       childNodes.append(n)
00345     else:
00346       flags[tagname] = str(n.firstChild.data.strip())
00347   if flags != {}:
00348     for (key, value) in flags.items():
00349       gnode.setFlag(key, value)
00350
00351   for n in childNodes:
00352     tagname = str(n.tagName)
00353     if hasAttribute(n, 'ID'):
00354       seq = uncompressSequence(getAttribute(n, 'ID'))
00355       for nodeId in seq:
00356         downStr = "gnode."+ tagname[1:] + "[" + str(nodeId) + "]"
00357         try:
00358           cgnode = eval(downStr)
00359           processFlags(cgnode, n)
00360         except:
00361           log.error("%s: Error evaluating string %s" % (fn, downStr))
00362     else:
00363       downStr = "gnode."+ tagname[1:]
00364       try:
00365         cgnode = eval(downStr)
00366         processFlags(cgnode, n)
00367       except:
00368         log.error("%s: Error evaluating string %s" % (fn, downStr))
00369
00370 def addOpaque(gnode, xnode):
00371   name = str(getAttribute(xnode, 'name'))
00372   root = gnode.root()
00373   rname = root.__class__.__name__
00374   rdict = root.__dict__
00375   opaque = rdict["_" + rname + '__opaque']
00376   if gnode in opaque:
00377     opaqueDict = opaque[gnode]
00378   else:
00379     opaqueDict = opaque[gnode] = {}
00380   if name in opaqueDict:
00381     if not opaqueExists(opaqueDict[name], xnode):
00382       opaqueDict[name].append(ConfigElement(xnode))
00383   else:
00384     opaqueDict[name] = [ConfigElement(xnode)]
00385
00386 def opaqueExists(opaqueList, xnode):
00387   for opaque in opaqueList:
00388     if opaque._ConfigElement__dElement == xnode:
00389       return True
00390   return False
00391
00392 def addSerialNos(gnode, snode):
00393   root = gnode.root()
00394   rname = root.__class__.__name__
00395   rdict = root.__dict__
00396   serialnos = rdict["_" + rname + '__serialnos']
00397   if gnode in serialnos:
00398     serialDict = serialnos[gnode]
00399   else:
00400     serialDict = serialnos[gnode] = {}
00401   for i in range(len(snode.attributes)):
00402     name  = str(snode.attributes.values()[i].name).lower()
00403     value = str(snode.attributes.values()[i].value)
00404     serialDict[name] = value
00405
00406 def addExcludes(gnode, enode):
00407   root = gnode.root()
00408   rname = root.__class__.__name__
00409   rdict = root.__dict__
00410   excludes = rdict["_" + rname + '__excludes']
00411   if gnode in excludes:
00412     excludeList = excludes[gnode]
00413   else:
00414     excludeList = excludes[gnode] = []
00415   for i in range(len(enode.attributes)):
00416     name  = str(enode.attributes.values()[i].name).lower()
00417     value = str(enode.attributes.values()[i].value).lower()
00418     if value != "true":
00419       log.error("<exclude> tag attribute %s has invalid value %s. Only allowed value is 'True'"
00420                 % (name, value))
00421     elif name not in excludeList:
00422       excludeList.append(name)
00423
00424 def processIncludes(doc, node, includeFiles, mainFilePath):
00425   fn = "processIncludes"
00426   for n in getChildNodes(node):
00427     if n.nodeType == Node.ELEMENT_NODE and n.tagName.lower() == 'include':
00428       incFileName = os.path.expandvars(str(getAttribute(n, 'filename')))
00429       incFilePath = os.path.dirname(incFileName)
00430       if incFilePath == '' and mainFilePath != '':
00431         incFileName = os.path.join(mainFilePath, incFileName)
00432       #incDoc = Sax2.FromXmlFile(incFileName)
00433       incFileName = os.path.normpath(os.path.abspath(incFileName))
00434       try:
00435         #incDoc = minidom.parse(incFileName)
00436         file_uri = Uri.OsPathToUri(incFileName, attemptAbsolute=1)
00437         incDoc = NonvalidatingReader.parseUri(file_uri)
00438       except Exception, e:
00439         log.exception("%s: Error parsing XML include: %s" % (fn, incFileName))
00440         raise e
00441       if incFileName not in includeFiles:
00442         includeFiles.append(incFileName)
00443       processIncludes(incDoc, incDoc.documentElement, includeFiles, mainFilePath)
00444       incDom = doc.importNode(incDoc.documentElement,1)
00445       node.replaceChild(incDom, n)
00446     else:
00447       processIncludes(doc, n, includeFiles, mainFilePath)
00448
00449 def processConfigProperties(node, declarations):
00450   fn = "processConfigProperties"
00451   if node.nodeType == Node.ELEMENT_NODE:
00452     cfgTagname = node.tagName.lower()
00453     if cfgTagname == 'declarations':
00454       processDeclarations(0, node, declarations)
00455     elif cfgTagname == 'constraints':
00456       processConstraints(node, declarations)
00457     elif cfgTagname == 'rules':
00458       processRules(node, declarations)
00459     elif cfgTagname == 'egus':
00460       processEGUs(node, declarations)
00461     elif cfgTagname in ('glat', 'gglt', 'gxbrd', 'ghsk'):
00462       pass
00463     else:
00464       log.error("%s: Unrecognized configuration tag: %s" % (fn, cfgTagname))
00465
00466
00467 def readConfig(glat, cfgFileName):
00468   """Read a configuration XML file and add its DOM
00469   to the dictionary of configurations.
00470
00471   \param  glat        Populated schema
00472   \param  cfgFileName Name of the configuration file in XML format
00473   \return             The numeric key value of the dictionary entry.
00474                       -1 if it fails to read the configuration file.
00475
00476   """
00477   fn = "readConfig"
00478   curDir = os.getcwd()
00479   mainFilePath = os.path.dirname(cfgFileName)
00480   mainFileName = os.path.basename(cfgFileName)
00481   if mainFilePath != '': os.chdir(mainFilePath)
00482
00483   try:
00484     #cfgDoc = Sax2.FromXmlFile(mainFileName)
00485     #cfgDoc = minidom.parse(mainFileName)
00486     file_uri = Uri.OsPathToUri(mainFileName, attemptAbsolute=1)
00487     cfgDoc = NonvalidatingReader.parseUri(file_uri)
00488   except:
00489     log.exception("%s: Error reading configuration file: %s" % (fn, cfgFileName))
00490     if os.path.exists(curDir):
00491       os.chdir(curDir)
00492     return -1
00493
00494   cfgNode = cfgDoc.documentElement
00495
00496   includeFiles = []
00497   processIncludes(cfgDoc, cfgNode, includeFiles, mainFilePath)
00498   glat._GLAT__includeFiles += includeFiles
00499   #cfgDom = cfgDoc.importNode(cfgDoc,1)
00500   cfgDict = glat.getConfigurations()
00501   configSeq = len(cfgDict)
00502   configName = ''
00503   configVersion = ''
00504   if hasAttribute(cfgNode, 'name'):
00505     configName = str(getAttribute(cfgNode, 'name'))
00506   if hasAttribute(cfgNode, 'version'):
00507     configVersion = str(getAttribute(cfgNode, 'version'))
00508
00509   cfgDict[configSeq] = (cfgNode, configName, configVersion)
00510   if os.path.exists(curDir):
00511     os.chdir(curDir)
00512   return configSeq
00513
00514 def applyConfig(glat, seq=None, gxbrd=None, enableSystemOverrides=True, enableRegWrite=True):
00515   """Applies the configuration that may have existed when the schema is read.
00516      The configuration portion of the schema is stored as a DOM reference
00517      in the GLAT node. This function accesses that DOM and sets the registers
00518      accordingly
00519
00520   Input ::
00521
00522     (1) GLAT root of the object model
00523     (2) Optional sequence number of the configuration
00524
00525   Output: None
00526
00527   Usage::
00528
00529     applyConfig(lat)"""
00530
00531   fn = "applyConfig"
00532   options = glat.getDeclarations()['options']
00533   if enableSystemOverrides:
00534     options['__systemoverrides'] = True
00535   else:
00536     options['__systemoverrides'] = False
00537   if enableRegWrite:
00538     options['__regwrite'] = True
00539   else:
00540     options['__regwrite'] = False
00541   configs = []
00542   if seq is None:
00543     if len(glat.getConfigurations()) == 0:
00544       log.debug("%s: Nothing to do, no configuration exists" % fn)
00545     else:
00546       glat.getDeclarations()['sysregs'] = {}
00547       configSeqList = glat.getConfigurations().keys()
00548       configSeqList.sort()
00549       for seq in configSeqList:
00550         configs.append(glat.getConfigurations()[seq][0])
00551   elif type(seq) == types.IntType:
00552     if glat.getConfigurations().has_key(seq):
00553       configs.append(glat.getConfigurations()[seq][0])
00554     else:
00555       log.error("%s: Configuration with sequence %d could not be found" % (fn, seq))
00556       return
00557
00558   for config in configs:
00559     for n in getChildNodes(config):
00560       processConfigProperties(n, glat.getDeclarations())
00561       if n.nodeType == Node.ELEMENT_NODE:
00562         tagname = n.tagName.lower()
00563         if tagname == 'glat' and glat.__class__.__name__ == 'GLAT':
00564           if hasAttribute(config, 'name'):
00565             configName = getAttribute(config, 'name')
00566           else:
00567             configName = '(no name)'
00568           log.debug("%s: Applying LAT configuration: %s" % (fn, configName))
00569           processGLAT(isSchema=0, glat=glat,
00570                       node=n, declarations=glat.getDeclarations())
00571         elif tagname == 'gxbrd':
00572           if hasAttribute(config, 'name'):
00573             configName = getAttribute(config, 'name')
00574           else:
00575             configName = '(no name)'
00576           if gxbrd is not None:
00577             log.debug("%s: Applying XBRD configuration: %s" % (fn, configName))
00578             processGXBRD(isSchema=0, gxbrd=gxbrd,
00579                       node=n, declarations=glat.getDeclarations())
00580           # XBRD configuration should be optional -ST
00581           #else:
00582           #  log.warn("skipping XBRD configuration, no gXBRD given")
00583   options = glat.getDeclarations()['options']
00584   skipSystemOverrides = options['skipsystemoverrides']
00585   skipSystemOverrides = skipSystemOverrides or (not options['__systemoverrides'])
00586   if not skipSystemOverrides:
00587     configureSystem(glat, glat.TEM.keys())
00588
00589 def processGLAT(isSchema, glat, node, declarations):
00590   fn = "processGLAT"
00591   node = checkForDuplicateNode(node)
00592   for n in getChildNodes(node):
00593     tagName = n.tagName.lower()
00594     if tagName == 'gtem':
00595       processGTEM(isSchema, glat, n, declarations)
00596     elif tagName == 'gaem':
00597       processGAEM(isSchema, glat, n, declarations)
00598     elif tagName == 'gpdu':
00599       processGPDU(isSchema, glat, n, declarations)
00600     elif tagName == 'gebm':
00601       processGEBM(isSchema, glat, n, declarations)
00602     elif tagName == 'ggem':
00603       processGGEM(isSchema, glat, n, declarations)
00604     elif tagName == 'gcru':
00605       processGCRU(isSchema, glat, n, declarations)
00606     elif tagName == 'gsiu':
00607       processGSIU(isSchema, glat, n, declarations)
00608     elif tagName == 'gepu':
00609       processGEPU(isSchema, glat, n, declarations)
00610     elif tagName == 'opaque':
00611       addOpaque(glat, n)
00612     elif isSchema:
00613       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00614     elif tagName == 'serialnos':
00615       addSerialNos(glat, n)
00616     elif tagName == 'exclude':
00617       addExcludes(glat, n)
00618     elif tagName in glat.regs:
00619       setRegister(glat.regs[tagName], n, declarations)
00620     else:
00621       log.error("%s: Configuration error processing GLAT...Invalid register %s" % (fn, n.tagName))
00622
00623   return glat
00624
00625 def setRegister(gattr, node, declarations):
00626   fn = "setRegister"
00627
00628   if hasAttribute(node, 'constraint'):
00629     gNode = gattr.getNode()
00630     if gNode.getName() in ('GTIC', 'GAEQ', 'GPEQ'):
00631       gNode = gNode.up()
00632     serialNos = gNode.getSerialNos()
00633     consName = str(getAttribute(node, 'constraint'))
00634     if serialNos is not None:
00635       for (sId, sVal) in serialNos.items():
00636         if (sId, sVal) in declarations['constraints'] and \
00637            consName in declarations['constraints'][(sId, sVal)]:
00638           constraints = declarations['constraints'][(sId, sVal)]
00639           break
00640       else:
00641         constraints = declarations['constraints'][('default','default')]
00642     else:
00643       constraints = declarations['constraints'][('default','default')]
00644     cons = constraints[consName]
00645     if cons is not None:
00646       gattr.setConstraint(cons)
00647
00648   if hasAttribute(node, 'egu'):
00649     gNode = gattr.getNode()
00650     if gNode.getName() in ('GTIC', 'GAEQ', 'GPEQ'):
00651       gNode = gNode.up()
00652     eguName = str(getAttribute(node, 'egu'))
00653     serialNos = gNode.getSerialNos()
00654     if serialNos is not None:
00655       for (sId, sVal) in serialNos.items():
00656         if (sId, sVal) in declarations['egus'] and \
00657            eguName in declarations['egus'][(sId, sVal)]:
00658           egus = declarations['egus'][(sId, sVal)]
00659           break
00660       else:
00661         egus = declarations['egus'][('default','default')]
00662     else:
00663       egus = declarations['egus'][('default','default')]
00664     egu = egus[eguName]
00665     if egu is not None:
00666       gattr.setEGU(egu)
00667
00668   if hasAttribute(node, 'rule'):
00669     gNode = gattr.getNode()
00670     if gNode.getName() in ('GTIC', 'GAEQ', 'GPEQ'):
00671       gNode = gNode.up()
00672     ruleName = str(getAttribute(node, 'rule'))
00673     serialNos = gNode.getSerialNos()
00674     if serialNos is not None:
00675       for (sId, sVal) in serialNos.items():
00676         if (sId, sVal) in declarations['rules'] and \
00677            ruleName in declarations['rules'][(sId, sVal)]:
00678           rules = declarations['rules'][(sId, sVal)]
00679           break
00680       else:
00681         rules = declarations['rules'][('default','default')]
00682     else:
00683       rules = declarations['rules'][('default','default')]
00684     rule = rules[ruleName]
00685     if rule is not None:
00686       gattr.setRule(rule)
00687
00688   regVal = None
00689   if node.firstChild is not None and not gattr.isReadOnly():
00690     regVal = extractRegisterValue(node)
00691     if declarations['options']['__regwrite'] and 'nowrite' not in gattr.getNode().getExcludeFlags():
00692       try:
00693         gattr.set(regVal, bypass=1)
00694       except:
00695         log.error("%s: Error setting register %s.%s" % (fn, gattr.getNode().getName(), gattr.getName()))
00696         log.exception("")
00697   return regVal
00698
00699 def extractRegisterValue(node):
00700   regVal = node.firstChild.data.strip()
00701   if regVal.startswith('0x'):
00702     regVal = long(regVal,16)
00703   else:
00704     regVal = long(regVal)
00705   return regVal
00706
00707 def processGXBRD(isSchema, gxbrd, node, declarations):
00708   fn = "processGXBRD"
00709   node = checkForDuplicateNode(node)
00710   for n in getChildNodes(node):
00711     tagName = n.tagName.lower()
00712     if tagName == 'gtwr':
00713       processGTWR(isSchema, gxbrd, n, declarations)
00714     elif tagName == 'gglt':
00715       processGGLT(isSchema, gxbrd, n, declarations)
00716     elif isSchema:
00717       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00718     elif tagName in gxbrd.regs:
00719       setRegister(gxbrd.regs[tagName], n, declarations)
00720     else:
00721       log.error("%s: Configuration error processing GXBRD...Invalid register %s" % (fn, n.tagName))
00722   return gxbrd
00723
00724
00725 def processGTWR(isSchema, gxbrd, node, declarations):
00726   fn = "processGTWR"
00727   if hasAttribute(node, 'ID'):
00728     gtwrIdSeq = uncompressSequence(getAttribute(node, 'ID'))
00729   else:
00730     log.error("%s: Configuration error processing GTWR...Missing ID" % fn)
00731     return
00732   for gtwrId in gtwrIdSeq:
00733     if isSchema:
00734       gtwr = gxbrd._GXBRD__addTWR(gtwrId)
00735     elif gxbrd.existsTWR(gtwrId):
00736       gtwr = gxbrd.TWR[gtwrId]
00737     else:
00738       #log.debug("%s: Configuration error processing GTWR # %d ...Not populated" % (fn, gtwrId))
00739       continue
00740     node = checkForDuplicateNode(node)
00741     for n in getChildNodes(node):
00742       tagName = n.tagName.lower()
00743       if tagName == 'opaque':
00744         addOpaque(gtwr, n)
00745       elif isSchema:
00746         log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00747       elif tagName == 'serialnos':
00748         addSerialNos(gtwr, n)
00749       elif tagName == 'exclude':
00750         addExcludes(gtwr, n)
00751       elif tagName in gtwr.regs:
00752         setRegister(gtwr.regs[tagName], n, declarations)
00753       else:
00754         log.error("%s: Configuration error processing GTWR # %d ...Invalid register %s" % (fn, gtwrId, n.tagName))
00755
00756 def processGGLT(isSchema, gxbrd, node, declarations):
00757   fn = "processGGLT"
00758   if isSchema:
00759     gglt = gxbrd._GXBRD__addGLT()
00760   elif gxbrd.downGLT() != None:
00761     gglt = gxbrd.downGLT()
00762   else:
00763     #log.debug("%s: Configuration error processing GGLT...Not populated" % fn)
00764     return
00765   node = checkForDuplicateNode(node)
00766   for n in getChildNodes(node):
00767     tagName = n.tagName.lower()
00768     if tagName == 'opaque':
00769       addOpaque(gglt, n)
00770     elif isSchema:
00771       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00772     elif tagName == 'serialnos':
00773       addSerialNos(gglt, n)
00774     elif tagName == 'exclude':
00775       addExcludes(gglt, n)
00776     elif tagName in gglt.regs:
00777       setRegister(gglt.regs[tagName], n, declarations)
00778     else:
00779       log.error("%s: Configuration error processing GGLT...Invalid register %s" % (fn, n.tagName))
00780
00781 def processGPDU(isSchema, glat, node, declarations):
00782   fn = "processGPDU"
00783   if hasAttribute(node, 'ID'):
00784     gpduIdSeq = uncompressSequence(getAttribute(node, 'ID'))
00785   else:
00786     log.error("%s: Configuration error processing GPDU...Missing ID" % fn)
00787     return
00788
00789   for gpduId in gpduIdSeq:
00790     if isSchema:
00791       gpdu = glat._GLAT__addPDU(gpduId)
00792     elif glat.existsPDU(gpduId):
00793       gpdu = glat.downPDU(gpduId)
00794     else:
00795       #log.debug("%s: Configuration error processing GPDU...Not populated" % fn)
00796       return
00797
00798     node = checkForDuplicateNode(node)
00799     for n in getChildNodes(node):
00800       tagName = n.tagName.lower()
00801       if tagName == 'gpeq':
00802         processGPEQ(isSchema, gpdu, n, declarations)
00803       elif tagName == 'opaque':
00804         addOpaque(gpdu, n)
00805       elif isSchema:
00806         log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00807       elif tagName == 'serialnos':
00808         addSerialNos(gpdu, n)
00809       elif tagName == 'exclude':
00810         addExcludes(gpdu, n)
00811       elif tagName in gpdu.regs:
00812         setRegister(gpdu.regs[tagName], n, declarations)
00813       else:
00814         log.error("%s: Configuration error processing GPDU...Invalid register %s" % (fn, n.tagName))
00815
00816
00817 def processGPEQ(isSchema, gpdu, node, declarations):
00818   fn = "processGPEQ"
00819   if isSchema:
00820     gpeq = gpdu._GPDU__addPEQ()
00821   elif gpdu.existsPEQ():
00822     gpeq = gpdu.downPEQ()
00823   else:
00824     #log.debug("%s: Configuration error processing GPEQ...Not populated" % fn)
00825     return
00826   node = checkForDuplicateNode(node)
00827   for n in getChildNodes(node):
00828     tagName = n.tagName.lower()
00829     if tagName == 'opaque':
00830       addOpaque(gpeq, n)
00831     elif isSchema:
00832       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00833     elif tagName == 'serialnos':
00834       addSerialNos(gpeq, n)
00835     elif tagName == 'exclude':
00836       addExcludes(gpeq, n)
00837     elif tagName in gpeq.regs:
00838       setRegister(gpeq.regs[tagName], n, declarations)
00839     else:
00840       log.error("%s: Configuration error processing GPEQ...Invalid register %s" % (fn, n.tagName))
00841
00842 def processGEBM(isSchema, glat, node, declarations):
00843   fn = "processGEBM"
00844   if isSchema:
00845     gebm = glat._GLAT__addEBM()
00846   elif glat.existsEBM():
00847     gebm = glat.downEBM()
00848   else:
00849     #log.debug("%s: Configuration error processing GEBM...Not populated" % fn)
00850     return
00851   node = checkForDuplicateNode(node)
00852   for n in getChildNodes(node):
00853     tagName = n.tagName.lower()
00854     if tagName == 'gebmc':
00855       processGEBMC(isSchema, gebm, n, declarations)
00856     elif tagName == 'gebmst':
00857       processGEBMST(isSchema, gebm, n, declarations)
00858     elif tagName == 'opaque':
00859       addOpaque(gebm, n)
00860     elif isSchema:
00861       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00862     elif tagName == 'serialnos':
00863       addSerialNos(gebm, n)
00864     elif tagName == 'exclude':
00865       addExcludes(gebm, n)
00866     elif tagName in gebm.regs:
00867       setRegister(gebm.regs[tagName], n, declarations)
00868     else:
00869       log.error("%s: Configuration error processing GEBM...Invalid register %s" % (fn, n.tagName))
00870
00871 def processGEBMC(isSchema, gebm, node, declarations):
00872   fn = "processGEBMC"
00873   if isSchema:
00874     gebmc = gebm._GEBM__addEBMC()
00875   elif gebm.existsEBMC():
00876     gebmc = gebm.downEBMC()
00877   else:
00878     #log.debug("%s: Configuration error processing GEBMC...Not populated" % fn)
00879     return
00880   node = checkForDuplicateNode(node)
00881   for n in getChildNodes(node):
00882     tagName = n.tagName.lower()
00883     if tagName == 'opaque':
00884       addOpaque(gebmc, n)
00885     elif isSchema:
00886       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00887     elif tagName == 'serialnos':
00888       addSerialNos(gebmc, n)
00889     elif tagName == 'exclude':
00890       addExcludes(gebmc, n)
00891     elif tagName in gebmc.regs:
00892       regVal = setRegister(gebmc.regs[tagName], n, declarations)
00893       if tagName in  ('timeout'):
00894         setSysReg(declarations, gebmc, tagName, regVal)
00895     else:
00896       log.error("%s: Configuration error processing GEBMC...Invalid register %s" % (fn, n.tagName))
00897
00898 def processGEBMST(isSchema, gebm, node, declarations):
00899   fn = "processGEBMST"
00900   if isSchema:
00901     gebmst = gebm._GEBM__addEBMST()
00902   elif gebm.existsEBMST():
00903     gebmst = gebm.downEBMST()
00904   else:
00905     #log.debug("%s: Configuration error processing GEBMST...Not populated" % fn)
00906     return
00907   node = checkForDuplicateNode(node)
00908   for n in getChildNodes(node):
00909     tagName = n.tagName.lower()
00910     if tagName == 'opaque':
00911       addOpaque(gebmst, n)
00912     elif isSchema:
00913       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00914     elif tagName == 'serialnos':
00915       addSerialNos(gebmst, n)
00916     elif tagName == 'exclude':
00917       addExcludes(gebmst, n)
00918     elif tagName in gebmst.regs:
00919       setRegister(gebmst.regs[tagName], n, declarations)
00920     else:
00921       log.error("%s: Configuration error processing GEBMST...Invalid register %s" % (fn, n.tagName))
00922
00923 def processGGEM(isSchema, glat, node, declarations):
00924   fn = "processGGEM"
00925   if isSchema:
00926     ggem = glat._GLAT__addGEM()
00927   elif glat.existsGEM():
00928     ggem = glat.GEM
00929   else:
00930     #log.debug("%s: Configuration error processing GGEM...Not populated" % fn)
00931     return
00932   node = checkForDuplicateNode(node)
00933   for n in getChildNodes(node):
00934     tagName = n.tagName.lower()
00935     if tagName == 'ggemc':
00936       processGGEMC(isSchema, ggem, n, declarations)
00937     elif tagName == 'ggemmg':
00938       processGGEMMG(isSchema, ggem, n, declarations)
00939     elif tagName == 'ggemst':
00940       processGGEMST(isSchema, ggem, n, declarations)
00941     elif tagName == 'ggemsc':
00942       processGGEMSC(isSchema, ggem, n, declarations)
00943     elif tagName == 'ggemvg':
00944       processGGEMVG(isSchema, ggem, n, declarations)
00945     elif tagName == 'ggemie':
00946       processGGEMIE(isSchema, ggem, n, declarations)
00947     elif tagName == 'ggemw':
00948       processGGEMW(isSchema, ggem, n, declarations)
00949     elif tagName == 'opaque':
00950       addOpaque(ggem, n)
00951     elif isSchema:
00952       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00953     elif tagName == 'serialnos':
00954       addSerialNos(ggem, n)
00955     elif tagName == 'exclude':
00956       addExcludes(ggem, n)
00957     elif tagName in ggem.regs:
00958       setRegister(ggem.regs[tagName], n, declarations)
00959     else:
00960       log.error("%s: Configuration error processing GGEM...Invalid register %s" % (fn, n.tagName))
00961
00962 def processGGEMC(isSchema, ggem, node, declarations):
00963   fn = "processGGEMC"
00964   if isSchema:
00965     ggemc = ggem._GGEM__addGEMC()
00966   elif ggem.existsGEMC():
00967     ggemc = ggem.downGEMC()
00968   else:
00969     #log.debug("%s: Configuration error processing GGEMC...Not populated" % fn)
00970     return
00971   node = checkForDuplicateNode(node)
00972   for n in getChildNodes(node):
00973     tagName = n.tagName.lower()
00974     if tagName == 'opaque':
00975       addOpaque(ggemc, n)
00976     elif isSchema:
00977       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
00978     elif tagName == 'serialnos':
00979       addSerialNos(ggemc, n)
00980     elif tagName == 'exclude':
00981       addExcludes(ggemc, n)
00982     elif tagName in ggemc.regs:
00983       setRegister(ggemc.regs[tagName], n, declarations)
00984     else:
00985       log.error("%s: Configuration error processing GGEMC...Invalid register %s" % (fn, n.tagName))
00986
00987 def processGGEMMG(isSchema, ggem, node, declarations):
00988   fn = "processGGEMMG"
00989   if isSchema:
00990     ggemmg = ggem._GGEM__addGEMMG()
00991   elif ggem.existsGEMMG():
00992     ggemmg = ggem.downGEMMG()
00993   else:
00994     #log.debug("%s: Configuration error processing GGEMMG...Not populated" % fn)
00995     return
00996   node = checkForDuplicateNode(node)
00997   for n in getChildNodes(node):
00998     tagName = n.tagName.lower()
00999     if tagName == 'opaque':
01000       addOpaque(ggemmg, n)
01001     elif isSchema:
01002       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
01003     elif tagName == 'serialnos':
01004       addSerialNos(ggemmg, n)
01005     elif tagName == 'exclude':
01006       addExcludes(ggemmg, n)
01007     elif tagName in ggemmg.regs:
01008       setRegister(ggemmg.regs[tagName], n, declarations)
01009     else:
01010       log.error("%s: Configuration error processing GGEMMG...Invalid register %s" % (fn, n.tagName))
01011
01012 def processGGEMST(isSchema, ggem, node, declarations):
01013   fn = "processGGEMST"
01014   if isSchema:
01015     ggemst = ggem._GGEM__addGEMST()
01016   elif ggem.existsGEMST():
01017     ggemst = ggem.downGEMST()
01018   else:
01019     #log.debug("%s: Configuration error processing GGEMST...Not populated" % fn)
01020     return
01021   node = checkForDuplicateNode(node)
01022   for n in getChildNodes(node):
01023     tagName = n.tagName.lower()
01024     if tagName == 'opaque':
01025       addOpaque(ggemst, n)
01026     elif isSchema:
01027       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
01028     elif tagName == 'serialnos':
01029       addSerialNos(ggemst, n)
01030     elif tagName == 'exclude':
01031       addExcludes(ggemst, n)
01032     elif tagName in ggemst.regs:
01033       setRegister(ggemst.regs[tagName], n, declarations)
01034     else:
01035       log.error("%s: Configuration error processing GGEMST...Invalid register %s" % (fn, n.tagName))
01036
01037 def processGGEMSC(isSchema, ggem, node, declarations):
01038   fn = "processGGEMSC"
01039   if isSchema:
01040     ggemsc = ggem._GGEM__addGEMSC()
01041   elif ggem.existsGEMSC():
01042     ggemsc = ggem.downGEMSC()
01043   else:
01044     #log.debug("%s: Configuration error processing GGEMSC...Not populated" % fn)
01045     return
01046   node = checkForDuplicateNode(node)
01047   for n in getChildNodes(node):
01048     tagName = n.tagName.lower()
01049     if tagName == 'opaque':
01050       addOpaque(ggemsc, n)
01051     elif isSchema:
01052       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
01053     elif tagName == 'serialnos':
01054       addSerialNos(ggemsc, n)
01055     elif tagName == 'exclude':
01056       addExcludes(ggemsc, n)
01057     elif tagName in ggemsc.regs:
01058       setRegister(ggemsc.regs[tagName], n, declarations)
01059     else:
01060       log.error("%s: Configuration error processing GGEMSC...Invalid register %s" % (fn, n.tagName))
01061
01062 def processGGEMVG(isSchema, ggem, node, declarations):
01063   fn = "processGGEMVG"
01064   if isSchema:
01065     ggemvg = ggem._GGEM__addGEMVG()
01066   elif ggem.existsGEMVG():
01067     ggemvg = ggem.downGEMVG()
01068   else:
01069     #log.debug("%s: Configuration error processing GGEMVG...Not populated" % fn)
01070     return
01071   node = checkForDuplicateNode(node)
01072   for n in getChildNodes(node):
01073     tagName = n.tagName.lower()
01074     if tagName == 'opaque':
01075       addOpaque(ggemvg, n)
01076     elif isSchema:
01077       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
01078     elif tagName == 'serialnos':
01079       addSerialNos(ggemvg, n)
01080     elif tagName == 'exclude':
01081       addExcludes(ggemvg, n)
01082     elif tagName in ggemvg.regs:
01083       setRegister(ggemvg.regs[tagName], n, declarations)
01084     else:
01085       log.error("%s: Configuration error processing GGEMVG...Invalid register %s" % (fn, n.tagName))
01086
01087 def processGGEMIE(isSchema, ggem, node, declarations):
01088   fn = "processGGEMIE"
01089   if isSchema:
01090     ggemie = ggem._GGEM__addGEMIE()
01091   elif ggem.existsGEMIE():
01092     ggemie = ggem.downGEMIE()
01093   else:
01094     #log.debug("%s: Configuration error processing GGEMIE...Not populated" % fn)
01095     return
01096   node = checkForDuplicateNode(node)
01097   for n in getChildNodes(node):
01098     tagName = n.tagName.lower()
01099     if tagName == 'opaque':
01100       addOpaque(ggemie, n)
01101     elif isSchema:
01102       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
01103     elif tagName == 'serialnos':
01104       addSerialNos(ggemie, n)
01105     elif tagName == 'exclude':
01106       addExcludes(ggemie, n)
01107     elif tagName in ggemie.regs:
01108       setRegister(ggemie.regs[tagName], n, declarations)
01109     else:
01110       log.error("%s: Configuration error processing GGEMIE...Invalid register %s" % (fn, n.tagName))
01111
01112 def processGGEMW(isSchema, ggem, node, declarations):
01113   fn = "processGGEMW"
01114   if isSchema:
01115     ggemw = ggem._GGEM__addGEMW()
01116   elif ggem.existsGEMW():
01117     ggemw = ggem.downGEMW()
01118   else:
01119     #log.debug("%s: Configuration error processing GGEMW...Not populated" % fn)
01120     return
01121   node = checkForDuplicateNode(node)
01122   for n in getChildNodes(node):
01123     tagName = n.tagName.lower()
01124     if tagName == 'opaque':
01125       addOpaque(ggemw, n)
01126     elif isSchema:
01127       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
01128     elif tagName == 'serialnos':
01129       addSerialNos(ggemw, n)
01130     elif tagName == 'exclude':
01131       addExcludes(ggemw, n)
01132     elif tagName in ggemw.regs:
01133       setRegister(ggemw.regs[tagName], n, declarations)
01134     else:
01135       log.error("%s: Configuration error processing GGEMW...Invalid register %s" % (fn, n.tagName))
01136
01137
01138 def processGCRU(isSchema, glat, node, declarations):
01139   fn = "processGCRU"
01140   if isSchema:
01141     gcru = glat._GLAT__addCRU()
01142   elif glat.existsCRU():
01143     gcru = glat.downCRU()
01144   else:
01145     #log.debug("%s: Configuration error processing GCRU...Not populated" % fn)
01146     return
01147   node = checkForDuplicateNode(node)
01148   for n in getChildNodes(node):
01149     tagName = n.tagName.lower()
01150     if tagName == 'opaque':
01151       addOpaque(gcru, n)
01152     elif isSchema:
01153       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
01154     elif tagName == 'serialnos':
01155       addSerialNos(gcru, n)
01156     elif tagName == 'exclude':
01157       addExcludes(gcru, n)
01158     elif tagName in gcru.regs:
01159       setRegister(gcru.regs[tagName], n, declarations)
01160     else:
01161       log.error("%s: Configuration error processing GCRU...Invalid register %s" % (fn, n.tagName))
01162
01163
01164 def processGTEM(isSchema, glat, node, declarations):
01165   fn = "processGTEM"
01166   explicitBroadcastNodes = declarations['options']['explicitbroadcastnodes']
01167   skipSystemOverrides = declarations['options']['skipsystemoverrides']
01168   # LHM for multiple tem ancillary files, allow configurations embedded in TEM nodes.
01169   # this method will simply remove the configuration level similar to duplicate node.
01170   if not isSchema:
01171     node = checkForConfigurationNode(node)
01172   node = checkForDuplicateNode(node)
01173   if hasAttribute(node, 'ID'):
01174     gtemIdSeq = uncompressSequence(getAttribute(node, 'ID'))
01175     if isSchema and not explicitBroadcastNodes:
01176       gtemIdSeq += [255]
01177   else:
01178     if not explicitBroadcastNodes:
01179       gtemIdSeq = [255]
01180     else:
01181       log.error("%s: Missing ID attribute for GTEM tag" % fn)
01182       return
01183
01184   #if not isSchema and not skipSystemOverrides:
01185   #  configureSystem(glat, gtemIdSeq, node)
01186
01187   for gtemId in gtemIdSeq:
01188     if isSchema:
01189       if gtemId == 255 and glat.existsTEM(255):
01190         gtem = glat.allTEM()
01191       else:
01192         gtem = glat._GLAT__addTEM(gtemId)
01193     elif glat.existsTEM(gtemId):
01194       gtem = glat.downTEM(gtemId)
01195     else:
01196       #log.debug("%s: Configuration error processing GTEM # %d ...Not populated" % (fn, gtemId))
01197       continue
01198     for n in getChildNodes(node):
01199       tagName = str(n.tagName.lower())
01200       if tagName == 'gccc':
01201         processGCCC(isSchema, gtem, n, declarations)
01202       elif tagName == 'gtcc':
01203         processGTCC(isSchema, gtem, n, declarations)
01204       elif tagName == 'gtic':
01205         processGTIC(isSchema, gtem, n, declarations)
01206       elif tagName == 'opaque':
01207         addOpaque(gtem, n)
01208       elif isSchema:
01209         log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
01210       elif tagName == 'serialnos':
01211         addSerialNos(gtem, n)
01212       elif tagName == 'exclude':
01213         addExcludes(gtem, n)
01214       elif tagName == 'badstrips':
01215         gname = glat.__class__.__name__
01216         gdict = glat.__dict__
01217         deadChannels  = gdict["_" + gname + '__deadChannels']
01218         noisyChannels = gdict["_" + gname + '__noisyChannels']
01219         typ = str(getAttribute(n, 'badType'))
01220         if typ == 'dead':
01221           processBadChannels(n, deadChannels, temId=gtemId)
01222         elif typ == 'hot':
01223           processBadChannels(n, noisyChannels, temId=gtemId)
01224         else:
01225           log.error("%s: Unrecognized bad strip type: %s" % (fn, typ))
01226         node.removeChild(n)
01227         gc.collect()
01228       elif tagName in gtem.regs:
01229         if tagName == "cmd_reset":
01230           if not skipSystemOverrides:
01231             #Ignore any attempts to reset the TEM through the schema
01232             log.debug("%s: Ignoring TEM[%d].CMD_RESET coming from the schema" % (fn, gtemId))
01233             continue
01234           else:
01235             log.warn("%s: Doing TEM[%d].CMD_RESET as per the schema" % (fn, gtemId))
01236         elif tagName == "address":
01237           if not skipSystemOverrides:
01238             #Ignore any attempts to change the TEM address through the schema
01239             log.debug("%s: Ignoring TEM[%d].ADDRESS coming from the schema" % (fn, gtemId))
01240             continue
01241           else:
01242             log.warn("%s: Setting TEM[%d].ADDRESS as per the schema" % (fn, gtemId))
01243         regVal = setRegister(gtem.regs[tagName], n, declarations)
01244         if tagName in  ('configuration', 'status', 'command_response', 'data_masks'):
01245           setSysReg(declarations, gtem, tagName, regVal)
01246       else:
01247         log.error("%s: Configuration error processing GTEM # %d ...Invalid register %s" % (fn, gtemId, n.tagName))
01248
01249 def setSysReg(declarations, node, regName, value):
01250   """\brief Record the system register if specified in the schema.
01251
01252   \param declarations Declarations dictionary.
01253   \param node         Node where the system register is specified.
01254   \param regName      System register name.
01255   \param value        System register value as specified in the configuration(s).
01256
01257   """
01258   sysRegDict = declarations['sysregs']
01259   nodeName = node.getName()
01260   idTuple = node.getIdTuple()
01261   if nodeName not in sysRegDict:
01262     sysRegDict[nodeName] = {}
01263   if idTuple not in sysRegDict[nodeName]:
01264     sysRegDict[nodeName][idTuple] = {}
01265   sysRegDict[nodeName][idTuple][regName] = value
01266
01267 def getSysReg(declarations, node, regName):
01268   """\brief Check if the system register \a regName
01269   is specified in a configuration.
01270
01271   \param declarations Declarations dictionary.
01272   \param node         Node where we check for the system register.
01273   \param regName      System register name.
01274
01275   \return None if it is not specified in the configuration(s)
01276           Register value from the configurations(s) if it is specified.
01277   """
01278   sysRegDict = declarations['sysregs']
01279   nodeName = node.getName()
01280   if nodeName in sysRegDict:
01281     idTuple = node.getIdTuple()
01282     if idTuple in sysRegDict[nodeName]:
01283       if regName in sysRegDict[nodeName][idTuple]:
01284         return sysRegDict[nodeName][idTuple][regName]
01285     else:
01286       # search for broadcast nodes
01287       for t in sysRegDict[nodeName].keys():
01288         if tuplesMatch(idTuple, t):
01289           if regName in sysRegDict[nodeName][t]:
01290             return sysRegDict[nodeName][t][regName]
01291           else:
01292             return None
01293   return None
01294
01295 def tuplesMatch(t1, t2):
01296   # check if two tuples match in terms of broadcast nodes
01297   if len(t1) != len(t2):
01298     return False
01299   for i in range(len(t1)):
01300     if t1[i] != t2[i] and t2[i] != 255:
01301       return False
01302   return True
01303
01304 def configureSystem(glat, gtemIdSeq):
01305   # Revised based on LTE-198
01306   # More changes based on LTE-240
01307   fn = "cfgSys"
01308   cccsToEnable = range(4)
01309   tccsToEnable = range(8)
01310   maskCCbits = 0x0
01311   for cc in cccsToEnable:
01312     maskCCbits += (1 << (cc+8))
01313   for cc in tccsToEnable:
01314     maskCCbits += (1 << cc)
01315
01316   GEMtowerBusyMap = 0
01317
01318   # cc : (ccN0, rcN0), (ccP0, rcP0), (ccN1, rcN1), (ccP1, rcP1)
01319   layerMaskMap = { 0: ((2, 0), (0, 0), (2, 1), (0, 1)),
01320                    1: ((3, 2), (1, 2), (3, 3), (1, 3)),
01321                    2: ((2, 2), (0, 2), (2, 3), (0, 3)),
01322                    3: ((3, 0), (1, 0), (3, 1), (1, 1))
01323                  }
01324
01325   declarations = glat.getDeclarations()
01326
01327   for gtemId in gtemIdSeq:
01328     if gtemId == 255: continue
01329     gtem = glat.TEM[gtemId]
01330     try:
01331       dataMasksValue = gtem.DATA_MASKS
01332       oldDataMasksValue = dataMasksValue
01333     except gException.LATInterfaceException:
01334       if sys.exc_info()[1].errstr()[0] in ('LCB_RTOERR', 'LCBD_RTOERR') \
01335           and glat.getDeclarations()['options']['ignorehardwaretimeouts']:
01336         continue
01337       else:
01338         raise gException.LATInterfaceException(sys.exc_info()[1].status)
01339
01340     if dataMasksValue & maskCCbits != 0:
01341       dataMasksValue &= ~maskCCbits
01342
01343     for cc in cccsToEnable:
01344       cccConfiguration = gtem.CCC[cc].CONFIGURATION
01345       oldConfiguration = cccConfiguration
01346       cccConfiguration |= (1L << 31)
01347       if getSysReg(declarations, gtem.CCC[cc], 'configuration') is None:
01348         # set 'listen MSB' to zero
01349         cccConfiguration &= ~(0x0FL << 27)
01350         # set FIFO full (sum/diag)
01351         cccConfiguration &= ~(0x3FL << 16)
01352         cccConfiguration |=  (0x08L << 16)
01353         # set FIFO full (err)
01354         cccConfiguration &= ~(0x3FL <<  8)
01355         cccConfiguration |=  (0x08L <<  8)
01356         # set FIFO full (data)
01357         cccConfiguration &= ~(0x7FL <<  0)
01358         cccConfiguration |=  (0x20L <<  0)
01359       if cccConfiguration != oldConfiguration:
01360         log.debug("%s: [OVR] TEM[%d].CCC[%d].CONFIGURATION=0x%08x (0x%08x)" % (fn, gtemId, cc, cccConfiguration, oldConfiguration))
01361         gtem.CCC[cc].CONFIGURATION = cccConfiguration
01362
01363       layerMask = gtem.CCC[cc].LAYER_MASK_0
01364       oldLayerMask = layerMask
01365       (ccN0, rcN0), (ccP0, rcP0), (ccN1, rcN1), (ccP1, rcP1) = layerMaskMap[cc]
01366       if not gtem.CCC[ccN0].existsCRC(rcN0):
01367         if layerMask & 0x3FFF0000L != 0x3FFF0000L:
01368           layerMask |= 0x3FFF0000L
01369       if not gtem.CCC[ccP0].existsCRC(rcP0):
01370         if layerMask & 0x3FFF != 0x3FFF:
01371           layerMask |= 0x3FFF
01372       if layerMask != oldLayerMask:
01373         log.debug("%s: [OVR] TEM[%d].CCC[%d].LAYER_MASK_0=0x%08x (0x%08x)" % (fn, gtemId, cc, layerMask, oldLayerMask))
01374         gtem.CCC[cc].LAYER_MASK_0 = layerMask
01375
01376       layerMask = gtem.CCC[cc].LAYER_MASK_1
01377       oldLayerMask = layerMask
01378       if not gtem.CCC[ccN1].existsCRC(rcN1):
01379         if layerMask & 0x3FFF0000L != 0x3FFF0000L:
01380           layerMask |= 0x3FFF0000L
01381       if not gtem.CCC[ccP1].existsCRC(rcP1):
01382         if layerMask & 0x3FFF != 0x3FFF:
01383           layerMask |= 0x3FFF
01384       if layerMask != oldLayerMask:
01385         log.debug("%s: [OVR] TEM[%d].CCC[%d].LAYER_MASK_1=0x%08x (0x%08x)" % (fn, gtemId, cc, layerMask, oldLayerMask))
01386         gtem.CCC[cc].LAYER_MASK_1 = layerMask
01387
01388       if getSysReg(declarations, gtem.CCC[cc], 'fifo_status') is None:
01389         log.debug("%s: [CLR] TEM[%d].CCC[%d].FIFO_STATUS" % (fn, gtemId, cc))
01390         gtem.CCC[cc].FIFO_STATUS = 0
01391
01392       if getSysReg(declarations, gtem.CCC[cc], 'latched_status') is None:
01393         log.debug("%s: [CLR] TEM[%d].CCC[%d].LATCHED_STATUS" % (fn, gtemId, cc))
01394         gtem.CCC[cc].LATCHED_STATUS = 0
01395
01396       if getSysReg(declarations, gtem.CCC[cc], 'event_timeouts') is None:
01397         cccEventTimeouts = gtem.CCC[cc].EVENT_TIMEOUTS
01398         oldEventTimeouts = cccEventTimeouts
01399         cccEventTimeouts &= ~(0x3FFL << 16)
01400         cccEventTimeouts |=  (0x010L << 16) # Default per Eric Siskind (LTE-295)
01401         cccEventTimeouts &= ~0x3FF
01402         if cccEventTimeouts != oldEventTimeouts:
01403           log.debug("%s: [OVR] TEM[%d].CCC[%d].EVENT_TIMEOUTS=0x%08x (0x%08x)" % (fn, gtemId, cc, cccEventTimeouts, oldEventTimeouts))
01404           gtem.CCC[cc].EVENT_TIMEOUTS = cccEventTimeouts
01405
01406     for cc in tccsToEnable:
01407       ccDisable = False
01408       tccInputMask = gtem.TCC[cc].INPUT_MASK
01409       oldInputMask = tccInputMask
01410       for rc in range(9):
01411         if not gtem.TCC[cc].existsTRC(rc):
01412           if tccInputMask & (1L << rc) == 0:
01413             tccInputMask |= (1L << rc)
01414       # Check if we need to disable this cable controller completely
01415       if tccInputMask & 0x1FF == 0x1FF: # None of the GTRC are present in the schema so mask it
01416         tccInputMask |= (1L << 16)
01417         ccDisable = True
01418
01419       if tccInputMask != oldInputMask:
01420         log.debug("%s: [OVR] TEM[%d].TCC[%d].INPUT_MASK=0x%08x (0x%08x)" % (fn, gtemId, cc, tccInputMask, oldInputMask))
01421         gtem.TCC[cc].INPUT_MASK = tccInputMask
01422
01423       tccConfiguration = gtem.TCC[cc].CONFIGURATION
01424       oldConfiguration = tccConfiguration
01425       if ccDisable:
01426         tccConfiguration &= ~(1L << 31)
01427         dataMasksValue |= (1L << cc)
01428       else:
01429         tccConfiguration |= (1L << 31)
01430       if getSysReg(declarations, gtem.TCC[cc], 'configuration') is None:
01431         # set cable length
01432         tccConfiguration &= ~(0x0FL << 27)
01433         tccConfiguration |=  ((9L-len(gtem.TCC[cc].TRC)) << 27)
01434         # set FIFO full (sum/diag)
01435         tccConfiguration &= ~(0x3FL << 16)
01436         tccConfiguration |=  (0x05L << 16)
01437         # set FIFO full (err)
01438         tccConfiguration &= ~(0x7FL <<  8)
01439         tccConfiguration |=  (0x48L <<  8)
01440         # set FIFO full (data)
01441         tccConfiguration &= ~(0x7FL <<  0)
01442         tccConfiguration |=  (0x20L <<  0)
01443
01444       if tccConfiguration != oldConfiguration:
01445         log.debug("%s: [OVR] TEM[%d].TCC[%d].CONFIGURATION=0x%08x (0x%08x)" % (fn, gtemId, cc, tccConfiguration, oldConfiguration))
01446         gtem.TCC[cc].CONFIGURATION = tccConfiguration
01447
01448       if getSysReg(declarations, gtem.TCC[cc], 'fifo_status') is None:
01449         log.debug("%s: [CLR] TEM[%d].TCC[%d].FIFO_STATUS" % (fn, gtemId, cc))
01450         gtem.TCC[cc].FIFO_STATUS = 0
01451
01452       if getSysReg(declarations, gtem.TCC[cc], 'latched_status') is None:
01453         log.debug("%s: [CLR] TEM[%d].TCC[%d].LATCHED_STATUS" % (fn, gtemId, cc))
01454         gtem.TCC[cc].LATCHED_STATUS = 0
01455
01456       if getSysReg(declarations, gtem.TCC[cc], 'event_timeouts') is None:
01457         tccEventTimeouts = gtem.TCC[cc].EVENT_TIMEOUTS
01458         oldEventTimeouts = tccEventTimeouts
01459         tccEventTimeouts = 0x3FFF
01460         if tccEventTimeouts != oldEventTimeouts:
01461           log.debug("%s: [OVR] TEM[%d].TCC[%d].EVENT_TIMEOUTS=0x%08x (0x%08x)" % (fn, gtemId, cc, tccEventTimeouts, oldEventTimeouts))
01462           gtem.TCC[cc].EVENT_TIMEOUTS = tccEventTimeouts
01463
01464     if dataMasksValue != oldDataMasksValue:
01465       log.debug("%s: [OVR] TEM[%d].DATA_MASKS=0x%08x (0x%08x)" % (fn, gtemId, dataMasksValue, oldDataMasksValue))
01466       gtem.DATA_MASKS = dataMasksValue
01467
01468     # Set EBM and GEM redundant bits if necessary
01469     temConfiguration = gtem.CONFIGURATION
01470     oldConfiguration = temConfiguration
01471     if glat.LCB.getFlag('UseRedundant', integer=1) == 1:
01472       temConfiguration |= (3L << 24)
01473     else:
01474       temConfiguration &= ~(3L << 24)
01475     if getSysReg(declarations, gtem, 'configuration') is None:
01476       temConfiguration &= ~(0x7FFFFF)
01477     if temConfiguration != oldConfiguration:
01478       log.debug("%s: [OVR] TEM[%d].CONFIGURATION=0x%08x (0x%08x)" % (fn, gtemId, temConfiguration, oldConfiguration))
01479       gtem.CONFIGURATION = temConfiguration
01480
01481     if getSysReg(declarations, gtem, 'status') is None:
01482       log.debug("%s: [CLR] TEM[%d].STATUS" % (fn, gtemId))
01483       gtem.STATUS = 0
01484
01485     if getSysReg(declarations, gtem, 'command_response') is None:
01486       log.debug("%s: [CLR] TEM[%d].COMMAND_RESPONSE" % (fn, gtemId))
01487       gtem.COMMAND_RESPONSE = 0
01488
01489     if gtem.TIC is not None and getSysReg(declarations, gtem.TIC, 'status') is None:
01490       log.debug("%s: [CLR] TEM[%d].TIC.STATUS" % (fn, gtemId))
01491       gtem.TIC.status = 0
01492
01493     GEMtowerBusyMap |= ( 1L << gtemId )
01494
01495   if glat.existsGEM():   # override tower busy map with tem map.
01496     glat.GEM.GEMIE.tower_busy = GEMtowerBusyMap
01497
01498   if glat.existsAEM() and getSysReg(declarations, glat.AEM, 'timeout') is None:
01499     aemTimeout = glat.AEM.TIMEOUT
01500     oldTimeout = aemTimeout
01501     aemTimeout = 0xEFFF
01502     if aemTimeout != oldTimeout:
01503       log.debug("%s: [OVR] AEM.TIMEOUT=0x%08x (0x%08x)" % (fn, aemTimeout, oldTimeout))
01504       glat.AEM.TIMEOUT = aemTimeout
01505
01506   if glat.existsEBM() and glat.EBM.existsEBMC() and getSysReg(declarations, glat.EBM.EBMC, 'timeout') is None:
01507     ebmcTimeout = glat.EBM.EBMC.TIMEOUT
01508     oldTimeout = ebmcTimeout
01509     ebmcTimeout = 0xFFFF
01510     if ebmcTimeout != oldTimeout:
01511       log.debug("%s: [OVR] EBMC.TIMEOUT=0x%08x (0x%08x)" % (fn, ebmcTimeout, oldTimeout))
01512       glat.EBM.EBMC.TIMEOUT = ebmcTimeout
01513
01514
01515 def processGSIU(isSchema, glat, node, declarations):
01516   fn = "processGSIU"
01517   if hasAttribute(node, 'ID'):
01518     gsiuIdSeq = uncompressSequence(getAttribute(node, 'ID'))
01519   else:
01520     log.error("%s: Configuration error processing GSIU...Missing ID" % fn)
01521     return
01522
01523   for gsiuId in gsiuIdSeq:
01524     if isSchema:
01525       gsiu = glat._GLAT__addSIU(gsiuId)
01526     elif glat.existsSIU(gsiuId):
01527       gsiu = glat.downSIU(gsiuId)
01528     else:
01529       #log.debug("%s: Configuration error processing GSIU...Not populated" % fn)
01530       return
01531
01532 def processGEPU(isSchema, glat, node, declarations):
01533   fn = "processGEPU"
01534   if hasAttribute(node, 'ID'):
01535     gepuIdSeq = uncompressSequence(getAttribute(node, 'ID'))
01536   else:
01537     log.error("%s: Configuration error processing GEPU...Missing ID" % fn)
01538     return
01539
01540   for gepuId in gepuIdSeq:
01541     if isSchema:
01542       gepu = glat._GLAT__addEPU(gepuId)
01543     elif glat.existsEPU(gepuId):
01544       gepu = glat.downEPU(gepuId)
01545     else:
01546       #log.debug("%s: Configuration error processing GEPU...Not populated" % fn)
01547       return
01548
01549 def configureGCCC(node):
01550   layerMask0 = None
01551   layerMask1 = None
01552   configuration = None
01553   for n in getChildNodes(node):
01554     tagName = str(n.tagName.lower())
01555     if tagName == 'layer_mask_0':
01556       if layerMask0 is None:
01557         layerMask0 = extractRegisterValue(n)
01558     elif tagName == 'layer_mask_1':
01559       if layerMask1 is None:
01560         layerMask1 = extractRegisterValue(n)
01561     elif tagName == 'configuration':
01562       if configuration is None:
01563         configuration = extractRegisterValue(n)
01564
01565   return (configuration, layerMask0, layerMask1)
01566
01567 def checkForDuplicateNode(node):
01568   #printNode("***", node)
01569
01570   for child in getChildNodes(node):
01571     #printNode("child:", child)
01572     checkForDuplicateNode(child)
01573
01574     if child.nodeType != Node.TEXT_NODE and str(node.tagName) == str(child.tagName):
01575       sibling = child.nextSibling
01576       for n in getChildNodes(child):
01577         if sibling is None:
01578           node.appendChild(n)
01579         else:
01580           node.insertBefore(n, sibling)
01581
01582       #if getAttribute(node, "ID") == '' and getAttribute(child, "ID") != '':
01583       #  setAttribute(node, "ID", getAttribute(child, "ID"))
01584
01585       # The following generalizes the above two lines
01586       for i in range(len(child.attributes)):
01587         name = str(child.attributes.values()[i].name)
01588         if not hasAttribute(node, name):
01589           value = str(child.attributes.values()[i].value)
01590           setAttribute(node, name, value)
01591
01592       node.removeChild(child)
01593
01594   return node
01595
01596 def checkForConfigurationNode(node):
01597   # routine to allow including configuration node underneath
01598   # a gtem or other node. If a configuration child is found,
01599   # it finds a glat and appends glat's children
01600   for n in getChildNodes(node):
01601     if str(n.tagName.lower()) == 'configuration' and hasAttribute(n, 'name'):
01602       for cn in getChildNodes(n):
01603         if str(cn.tagName.lower()) == 'glat':
01604           for cnlat in getChildNodes(cn):
01605             node.appendChild(cnlat)
01606       node.removeChild(n)
01607   return node
01608
01609 def processGCCC(isSchema, gtem, node, declarations):
01610   fn = "processGCCC"
01611   explicitBroadcastNodes = declarations['options']['explicitbroadcastnodes']
01612   node = checkForDuplicateNode(node)
01613   if hasAttribute(node, 'ID'):
01614     gcccIdSeq = uncompressSequence(getAttribute(node, 'ID'))
01615     if isSchema and not explicitBroadcastNodes:
01616       gcccIdSeq += [255]
01617   else:
01618     if not explicitBroadcastNodes: gcccIdSeq = [255]
01619   for gcccId in gcccIdSeq:
01620     if isSchema:
01621       if gcccId == 255 and gtem.existsCCC(255):
01622         gccc = gtem.allCCC()
01623       elif gtem.id() == 255 and gtem.existsCCC(gcccId):
01624         continue
01625       else:
01626         gccc = gtem._GTEM__addCCC(gcccId)
01627     elif gtem.existsCCC(gcccId):
01628       gccc = gtem.downCCC(gcccId)
01629     else:
01630       #log.debug("%s: Configuration error processing GCCC # %d ...Not populated" % (fn, gcccId))
01631       continue
01632     for n in getChildNodes(node):
01633       tagName = str(n.tagName.lower())
01634       if tagName == 'gcrc':
01635         processGCRC(isSchema, gccc, n, declarations)
01636       elif tagName == 'opaque':
01637         addOpaque(gccc, n)
01638       elif isSchema:
01639         log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
01640       elif tagName == 'serialnos':
01641         addSerialNos(gccc, n)
01642       elif tagName == 'exclude':
01643         addExcludes(gccc, n)
01644       elif tagName in gccc.regs:
01645         regVal = setRegister(gccc.regs[tagName], n, declarations)
01646         if tagName in  ('configuration', 'fifo_status', 'latched_status', 'event_timeouts'):
01647           setSysReg(declarations, gccc, tagName, regVal)
01648       else:
01649         log.error("%s: Configuration error processing GCCC # %d ...Invalid register %s" % (fn, gcccId, n.tagName))
01650
01651 def processGTCC(isSchema, gtem, node, declarations):
01652   fn = "processGTCC"
01653   explicitBroadcastNodes = declarations['options']['explicitbroadcastnodes']
01654   node = checkForDuplicateNode(node)
01655   if hasAttribute(node, 'ID'):
01656     gtccIdSeq = uncompressSequence(getAttribute(node, 'ID'))
01657     if isSchema and not explicitBroadcastNodes:
01658       gtccIdSeq += [255]
01659   else:
01660     if not explicitBroadcastNodes: gtccIdSeq = [255]
01661   for gtccId in gtccIdSeq:
01662     if isSchema:
01663       if gtccId == 255 and gtem.existsTCC(255):
01664         gtcc = gtem.allTCC()
01665       elif gtem.id() == 255 and gtem.existsTCC(gtccId):
01666         continue
01667       else:
01668         gtcc = gtem._GTEM__addTCC(gtccId)
01669     elif gtem.existsTCC(gtccId):
01670       gtcc = gtem.downTCC(gtccId)
01671     else:
01672       #log.debug("%s: Configuration error processing GTCC # %d ...Not populated" % (fn, gtccId))
01673       continue
01674     for n in getChildNodes(node):
01675       tagName = str(n.tagName.lower())
01676       if tagName == 'gtrc':
01677         processGTRC(isSchema, gtcc, n, declarations)
01678       elif tagName == 'opaque':
01679         addOpaque(gtcc, n)
01680       elif isSchema:
01681         log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
01682       elif tagName == 'serialnos':
01683         addSerialNos(gtcc, n)
01684       elif tagName == 'exclude':
01685         addExcludes(gtcc, n)
01686       elif tagName in gtcc.regs:
01687         regVal = setRegister(gtcc.regs[tagName], n, declarations)
01688         if tagName in  ('configuration', 'fifo_status', 'latched_status', 'event_timeouts'):
01689           setSysReg(declarations, gtcc, tagName, regVal)
01690       else:
01691         log.error("%s: Configuration error processing GTCC # %d ...Invalid register %s" % (fn, gtccId, n.tagName))
01692
01693 def processGTIC(isSchema, gtem, node, declarations):
01694   fn = "processGTIC"
01695   if isSchema:
01696     gtic = gtem._GTEM__addTIC()
01697   elif gtem.downTIC() != None:
01698     gtic = gtem.downTIC()
01699   else:
01700     #log.debug("%s: Configuration error processing GTIC...Not populated" % fn)
01701     return
01702   node = checkForDuplicateNode(node)
01703   for n in getChildNodes(node):
01704     tagName = str(n.tagName.lower())
01705     if tagName == 'opaque':
01706       addOpaque(gtic, n)
01707     elif isSchema:
01708       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
01709     elif tagName == 'serialnos':
01710       addSerialNos(gtic, n)
01711     elif tagName == 'exclude':
01712       addExcludes(gtic, n)
01713     elif tagName in gtic.regs:
01714       regVal = setRegister(gtic.regs[tagName], n, declarations)
01715       if tagName in  ('status', 'busy_lrs_mask'):
01716         setSysReg(declarations, gtic, tagName, regVal)
01717     else:
01718       log.error("%s: Configuration error processing GTIC...Invalid register %s" % (fn, n.tagName))
01719
01720
01721 def processGCRC(isSchema, gccc, node, declarations):
01722   fn = "processGCRC"
01723   explicitBroadcastNodes = declarations['options']['explicitbroadcastnodes']
01724   node = checkForDuplicateNode(node)
01725   if hasAttribute(node, 'ID'):
01726     gcrcIdSeq = uncompressSequence(getAttribute(node, 'ID'))
01727     if isSchema and not explicitBroadcastNodes:
01728       gcrcIdSeq += [255]
01729   else:
01730     if not explicitBroadcastNodes: gcrcIdSeq = [255]
01731   for gcrcId in gcrcIdSeq:
01732     if isSchema:
01733       if gcrcId == 255 and gccc.existsCRC(255):
01734         gcrc = gccc.allCRC()
01735       elif gccc.id() == 255 and gccc.existsCRC(gcrcId):
01736         continue
01737       else:
01738         gcrc = gccc._GCCC__addCRC(gcrcId)
01739     elif gccc.existsCRC(gcrcId):
01740       gcrc = gccc.downCRC(gcrcId)
01741     else:
01742       #log.debug("%s: Configuration error processing GCRC # %d ...Not populated" % (fn, gcrcId))
01743       continue
01744     for n in getChildNodes(node):
01745       tagName = str(n.tagName.lower())
01746       if tagName == 'gcfe':
01747         processGCFE(isSchema, gcrc, n, declarations)
01748       elif tagName == 'opaque':
01749         addOpaque(gcrc, n)
01750       elif isSchema:
01751         log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
01752       elif tagName == 'serialnos':
01753         addSerialNos(gcrc, n)
01754       elif tagName == 'exclude':
01755         addExcludes(gcrc, n)
01756       elif tagName in gcrc.regs:
01757         setRegister(gcrc.regs[tagName], n, declarations)
01758       else:
01759         log.error("%s: Configuration error processing GCRC # %d ...Invalid register %s" % (fn, gcrcId, n.tagName))
01760
01761 def processGTRC(isSchema, gtcc, node, declarations):
01762   fn = "processGTRC"
01763   explicitBroadcastNodes = declarations['options']['explicitbroadcastnodes']
01764   node = checkForDuplicateNode(node)
01765   if hasAttribute(node, 'ID'):
01766     gtrcIdSeq = uncompressSequence(getAttribute(node, 'ID'))
01767     if isSchema and not explicitBroadcastNodes:
01768       gtrcIdSeq += [255]
01769   else:
01770     if not explicitBroadcastNodes: gtrcIdSeq = [255]
01771   for gtrcId in gtrcIdSeq:
01772     if isSchema:
01773       if gtrcId == 255 and gtcc.existsTRC(255):
01774         gtrc = gtcc.allTRC()
01775       elif gtcc.id() == 255 and gtcc.existsTRC(gtrcId):
01776         continue
01777       else:
01778         gtrc = gtcc._GTCC__addTRC(gtrcId)
01779     elif gtcc.existsTRC(gtrcId):
01780       gtrc = gtcc.downTRC(gtrcId)
01781     else:
01782       #log.debug("%s: Configuration error processing GTRC # %d ...Not populated" % (fn, gtrcId))
01783       continue
01784     for n in getChildNodes(node):
01785       tagName = str(n.tagName.lower())
01786       if tagName == 'gtfe':
01787         processGTFE(isSchema, gtrc, n, declarations)
01788       elif tagName == 'opaque':
01789         addOpaque(gtrc, n)
01790       elif isSchema:
01791         log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
01792       elif tagName == 'serialnos':
01793         addSerialNos(gtrc, n)
01794       elif tagName == 'exclude':
01795         addExcludes(gtrc, n)
01796       elif tagName in gtrc.regs:
01797         setRegister(gtrc.regs[tagName], n, declarations)
01798       else:
01799         log.error("%s: Configuration error processing GTRC # %d ...Invalid register %s" % (fn, gtrcId, n.tagName))
01800
01801
01802 def processGCFE(isSchema, gcrc, node, declarations):
01803   fn = "processGCFE"
01804   explicitBroadcastNodes = declarations['options']['explicitbroadcastnodes']
01805   node = checkForDuplicateNode(node)
01806   if hasAttribute(node, 'ID'):
01807     gcfeIdSeq = uncompressSequence(getAttribute(node, 'ID'))
01808     if isSchema and not explicitBroadcastNodes:
01809       gcfeIdSeq += [255]
01810   else:
01811     if not explicitBroadcastNodes: gcfeIdSeq = [255]
01812   for gcfeId in gcfeIdSeq:
01813     if isSchema:
01814       if gcfeId == 255 and gcrc.existsCFE(255):
01815         gcfe = gcrc.allCFE()
01816       elif gcrc.id() == 255 and gcrc.existsCFE(gcfeId):
01817         continue
01818       else:
01819         gcfe = gcrc._GCRC__addCFE(gcfeId)
01820     elif gcrc.existsCFE(gcfeId):
01821       gcfe = gcrc.downCFE(gcfeId)
01822     else:
01823       #log.debug("%s: Configuration error processing GCFE # %d ...Not populated" % (fn, gcfeId))
01824       continue
01825     for n in getChildNodes(node):
01826       tagName = str(n.tagName.lower())
01827       if tagName == 'opaque':
01828         addOpaque(gcfe, n)
01829       elif isSchema:
01830         log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
01831       elif tagName == 'serialnos':
01832         addSerialNos(gcfe, n)
01833       elif tagName == 'exclude':
01834         addExcludes(gcfe, n)
01835       elif tagName in gcfe.regs:
01836         setRegister(gcfe.regs[tagName], n, declarations)
01837       else:
01838         log.error("%s: Configuration error processing GCFE # %d ...Invalid register %s" % (fn, gcfeId, n.tagName))
01839
01840
01841 def processGTFE(isSchema, gtrc, node, declarations):
01842   fn = "processGTFE"
01843   explicitBroadcastNodes = declarations['options']['explicitbroadcastnodes']
01844   node = checkForDuplicateNode(node)
01845   if hasAttribute(node, 'ID'):
01846     gtfeIdSeq = uncompressSequence(getAttribute(node, 'ID'))
01847     if isSchema and not explicitBroadcastNodes:
01848       gtfeIdSeq += [255]
01849   else:
01850     if not explicitBroadcastNodes: gtfeIdSeq = [255]
01851   for gtfeId in gtfeIdSeq:
01852     if isSchema:
01853       if gtfeId == 255 and gtrc.existsTFE(255):
01854         gtfe = gtrc.allTFE()
01855       elif gtrc.id() == 255 and gtrc.existsTFE(gtfeId):
01856         continue
01857       else:
01858         gtfe = gtrc._GTRC__addTFE(gtfeId)
01859     elif gtrc.existsTFE(gtfeId):
01860       gtfe = gtrc.downTFE(gtfeId)
01861     else:
01862       #log.debug("%s: Configuration error processing GTFE # %d ...Not populated" % (fn, gtfeId))
01863       continue
01864     for n in getChildNodes(node):
01865       tagName = str(n.tagName.lower())
01866       if tagName == 'opaque':
01867         addOpaque(gtfe, n)
01868       elif isSchema:
01869         log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
01870       elif tagName == 'serialnos':
01871         addSerialNos(gtfe, n)
01872       elif tagName == 'exclude':
01873         addExcludes(gtfe, n)
01874       elif tagName in gtfe.regs:
01875         setRegister(gtfe.regs[tagName], n, declarations)
01876       else:
01877         log.error("%s: Configuration error processing GTFE # %d ...Invalid register %s" % (fn, gtfeId, n.tagName))
01878
01879
01880 def processGAEM(isSchema, glat, node, declarations):
01881   fn = "processGAEM"
01882   if isSchema:
01883     gaem = glat._GLAT__addAEM()
01884   elif glat.existsAEM():
01885     gaem = glat.downAEM()
01886   else:
01887     #log.debug("%s: Configuration error processing GAEM ...Not populated" %(fn))
01888     return
01889
01890   node = checkForDuplicateNode(node)
01891   for n in getChildNodes(node):
01892     tagName = str(n.tagName.lower())
01893     if tagName == 'garc':
01894       processGARC(isSchema, gaem, n, declarations)
01895     elif tagName == 'gaeq':
01896       processGAEQ(isSchema, gaem, n, declarations)
01897     elif tagName == 'opaque':
01898       addOpaque(gaem, n)
01899     elif isSchema:
01900       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
01901     elif tagName == 'serialnos':
01902       addSerialNos(gaem, n)
01903     elif tagName == 'exclude':
01904       addExcludes(gaem, n)
01905     elif tagName in gaem.regs:
01906       regVal = setRegister(gaem.regs[tagName], n, declarations)
01907       if tagName in  ('timeout'):
01908         setSysReg(declarations, gaem, tagName, regVal)
01909     else:
01910       log.error("%s: Configuration error processing GAEM ...Invalid register %s" %(fn, n.tagName))
01911
01912
01913 def processGAEQ(isSchema, gaem, node, declarations):
01914   fn = "processGAEQ"
01915   if isSchema:
01916     gaeq = gaem._GAEM__addAEQ()
01917   elif gaem.downAEQ() != None:
01918     gaeq = gaem.downAEQ()
01919   else:
01920     #log.debug("%s: Configuration error processing GAEQ...Not populated" % fn)
01921     return
01922   node = checkForDuplicateNode(node)
01923   for n in getChildNodes(node):
01924     tagName = str(n.tagName.lower())
01925     if tagName == 'opaque':
01926       addOpaque(gaeq, n)
01927     elif isSchema:
01928       log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
01929     elif tagName == 'serialnos':
01930       addSerialNos(gaeq, n)
01931     elif tagName == 'exclude':
01932       addExcludes(gaeq, n)
01933     elif tagName in gaeq.regs:
01934       setRegister(gaeq.regs[tagName], n, declarations)
01935     else:
01936       log.error("%s: Configuration error processing GAEQ...Invalid register %s" % (fn, n.tagName))
01937
01938
01939 def processGARC(isSchema, gaem, node, declarations):
01940   fn = "processGARC"
01941   explicitBroadcastNodes = declarations['options']['explicitbroadcastnodes']
01942   node = checkForDuplicateNode(node)
01943   if hasAttribute(node, 'ID'):
01944     garcIdSeq = uncompressSequence(getAttribute(node, 'ID'))
01945     if isSchema and not explicitBroadcastNodes:
01946       garcIdSeq += [255]
01947   else:
01948     if not explicitBroadcastNodes: garcIdSeq = [255]
01949   for garcId in garcIdSeq:
01950     if isSchema:
01951       if garcId == 255 and gaem.existsARC(255):
01952         garc = gaem.allARC()
01953       else:
01954         garc = gaem._GAEM__addARC(garcId)
01955     elif gaem.existsARC(garcId):
01956       garc = gaem.downARC(garcId)
01957     else:
01958       #log.debug("%s: Configuration error processing GARC # %d ...Not populated" % (fn, garcId))
01959       continue
01960     for n in getChildNodes(node):
01961       tagName = str(n.tagName.lower())
01962       if tagName == 'gafe':
01963         processGAFE(isSchema, garc, n, declarations)
01964       elif tagName == 'opaque':
01965         addOpaque(garc, n)
01966       elif isSchema:
01967         log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
01968       elif tagName == 'serialnos':
01969         addSerialNos(garc, n)
01970       elif tagName == 'exclude':
01971         addExcludes(garc, n)
01972       elif tagName in garc.regs:
01973         setRegister(garc.regs[tagName], n, declarations)
01974       else:
01975         log.error("%s: Configuration error processing GARC # %d ...Invalid register %s" % (fn, garcId, n.tagName))
01976
01977
01978 def processGAFE(isSchema, garc, node, declarations):
01979   fn = "processGAFE"
01980   explicitBroadcastNodes = declarations['options']['explicitbroadcastnodes']
01981   node = checkForDuplicateNode(node)
01982   if hasAttribute(node, 'ID'):
01983     gafeIdSeq = uncompressSequence(getAttribute(node, 'ID'))
01984     if isSchema and not explicitBroadcastNodes:
01985       gafeIdSeq += [255]
01986   else:
01987     if not explicitBroadcastNodes: gafeIdSeq = [255]
01988   for gafeId in gafeIdSeq:
01989     if isSchema:
01990       if gafeId == 255 and garc.existsAFE(255):
01991         gafe = garc.allAFE()
01992       elif garc.id() == 255 and garc.existsAFE(gafeId):
01993         continue
01994       else:
01995         gafe = garc._GARC__addAFE(gafeId)
01996     elif garc.existsAFE(gafeId):
01997       gafe = garc.downAFE(gafeId)
01998     else:
01999       #log.debug("%s: Configuration error processing GAFE # %d ...Not populated" % (fn, gafeId))
02000       continue
02001     if hasAttribute(node, 'TUBE'):
02002       gafe.setTube(getAttribute(node, 'TUBE'))
02003       aem = garc.up()
02004       garcId = garc.id()
02005       aem.tileMap[garcId, gafeId] = getAttribute(node, 'TUBE')
02006     for n in getChildNodes(node):
02007       tagName = str(n.tagName.lower())
02008       if tagName == 'opaque':
02009         addOpaque(gafe, n)
02010       elif isSchema:
02011         log.error("%s: Unexpected tag: %s" % (fn, n.tagName))
02012       elif tagName == 'serialnos':
02013         addSerialNos(gafe, n)
02014       elif tagName == 'exclude':
02015         addExcludes(gafe, n)
02016       elif tagName in gafe.regs:
02017         setRegister(gafe.regs[tagName], n, declarations)
02018       else:
02019         log.error("%s: Configuration error processing GAFE # %d ...Invalid register %s" % (fn, gafeId, n.tagName))
02020
02021
02022 def printTree(node):
02023   if node.nodeType == Node.TEXT_NODE and node.data[0] == '\n':
02024     pass
02025   else:
02026     print node
02027     if node.nodeType == Node.ELEMENT_NODE:
02028       tagName = node.tagName.lower()
02029       #print "Element:",tagName
02030       if tagName in ('schema', 'configuration', 'glat', 'gtem', 'gccc', 'gcrc', 'gcfe', 'gtic', \
02031                      'gtcc', 'gtrc', 'gtfe', 'gaem', 'gaeq', 'garc', 'gafe', \
02032                      'gpdu', 'gpduc', 'gpeq', 'gtwr','gebm','gebmc','gebmst', \
02033                      'ggem','ggemc','ggemmg', 'ggemst','ggemsc','ggemvg','ggemie','ggemw','gcru'):
02034         for n in node.childNodes:
02035           printTree(n)
02036
02037 def getChildNodes(node):
02038   childNodes = []
02039   for n in node.childNodes:
02040     if (n.nodeType == Node.TEXT_NODE and \
02041          (n.data[0] == '\n' or n.data[0].strip() == '')) \
02042         or n.nodeType == Node.COMMENT_NODE:
02043       pass
02044     else:
02045       childNodes.append(n)
02046   return childNodes
02047
02048 def getAttribute(node, attr):
02049   return node.getAttributeNS(LAT_NAMESPACE, attr)
02050
02051 def hasAttribute(node, attr):
02052   return node.hasAttributeNS(LAT_NAMESPACE, attr)
02053
02054 def setAttribute(node, attr, value):
02055   return node.setAttributeNS(LAT_NAMESPACE, attr, value)
02056
02057 def createElement(node, elem):
02058   return node.createElementNS(LAT_NAMESPACE, elem)
02059
02060 def isNumber(s):
02061   try:
02062     float(s)
02063     return 1
02064   except ValueError:
02065     return 0
02066
02067 def getParameterValue(parValue):
02068   if parValue.lower() in ('true', 'yes'):
02069     return 1
02070   elif parValue.lower() in ('false', 'no'):
02071     return 0
02072   elif parValue.lower() == 'none':
02073     return None
02074   elif parValue.startswith('0x'):
02075     return long(parValue,16)
02076   elif isNumber(parValue):
02077     return float(parValue)
02078   else:
02079     return parValue
02080
02081 def processConstraints(node, declarations):
02082   fn = "processConstraints"
02083   node = checkForDuplicateNode(node)
02084   groups = declarations['groups']
02085   constraints = declarations['constraints']
02086   if hasAttribute(node, 'serialKey'):
02087     serialKey = str(getAttribute(node, 'serialKey'))
02088   else:
02089     serialKey = 'default'
02090   if hasAttribute(node, 'serialNo'):
02091     serialNo = str(getAttribute(node, 'serialNo'))
02092   else:
02093     serialNo = 'default'
02094
02095   if (serialKey, serialNo) not in constraints:
02096     constraints[(serialKey, serialNo)] = {}
02097
02098   for n in getChildNodes(node):
02099     tagName = n.tagName.lower()
02100     if tagName == 'constraint':
02101       if hasAttribute(n, 'name'):
02102         consName = str(getAttribute(n, 'name'))
02103         consParList = {}
02104         #if constraints.has_key(consName):
02105         #  consClassModStr = constraints[consName][0]
02106         #  consClassNameStr = constraints[consName][1]
02107         #  consParList = constraints[consName][2]
02108         for consPropNode in getChildNodes(n):
02109           tagName = consPropNode.tagName.lower()
02110           if tagName == 'class':
02111             classStr = str(consPropNode.firstChild.data).strip()
02112             lastDot = classStr.rfind('.')
02113             if lastDot == -1:
02114               consClassNameStr = classStr
02115               consClassModStr = ''
02116             else:
02117               consClassNameStr = classStr[lastDot+1:]
02118               consClassModStr = classStr[:lastDot]
02119           elif tagName == 'parameters':
02120             consParList['name'] = consName
02121             for consParNode in getChildNodes(consPropNode):
02122               parName = str(consParNode.tagName.lower())
02123               parValue = str(consParNode.firstChild.data).strip()
02124               if parName == 'subsystem':
02125                 if groups.has_key(parValue):
02126                   parValue = groups[parValue]
02127                 else:
02128                   log.error("%s: Constraint subsystem group %s not defined" % (fn, parValue))
02129                   parValue = None
02130               elif parName == 'category':
02131                 if groups.has_key(parValue):
02132                   parValue = groups[parValue]
02133                 else:
02134                   log.error("%s: Constraint category group %s not defined" % (fn, parValue))
02135                   parValue = None
02136               else:
02137                 parValue = getParameterValue(parValue)
02138               consParList[str(consParNode.tagName)] = parValue
02139         constraints[(serialKey, serialNo)][consName] = instantiateClass(consClassModStr,
02140                                                          consClassNameStr,
02141                                                          consParList)
02142       else:
02143         log.error("%s: Missing constraint name" % fn)
02144         return None
02145     else:
02146       log.error("%s: Invalid tag: %s ...skipping" % (fn, n.tagName))
02147
02148 def processRules(node, declarations):
02149   fn = "processRules"
02150   node = checkForDuplicateNode(node)
02151   groups = declarations['groups']
02152   rules  = declarations['rules']
02153   if hasAttribute(node, 'serialKey'):
02154     serialKey = str(getAttribute(node, 'serialKey'))
02155   else:
02156     serialKey = 'default'
02157   if hasAttribute(node, 'serialNo'):
02158     serialNo = str(getAttribute(node, 'serialNo'))
02159   else:
02160     serialNo = 'default'
02161
02162   if (serialKey, serialNo) not in rules:
02163     rules[(serialKey, serialNo)] = {}
02164
02165   for n in getChildNodes(node):
02166     tagName = n.tagName.lower()
02167     if tagName == 'rule':
02168       if hasAttribute(n, 'name'):
02169         ruleName = str(getAttribute(n, 'name'))
02170         ruleParList = {}
02171         ruleActionList = []
02172         #if rules.has_key(ruleName):
02173         #  log.error("%s: Rule %s already defined." % (fn, ruleName))
02174         #  continue
02175         for rulePropNode in getChildNodes(n):
02176           tagName = rulePropNode.tagName.lower()
02177           if tagName == 'class':
02178             classStr = str(rulePropNode.firstChild.data).strip()
02179             lastDot = classStr.rfind('.')
02180             if lastDot == -1:
02181               ruleClassNameStr = classStr
02182               ruleClassModStr = ''
02183             else:
02184               ruleClassNameStr = classStr[lastDot+1:]
02185               ruleClassModStr = classStr[:lastDot]
02186           elif tagName == 'parameters':
02187             ruleParList['name'] = ruleName
02188             for ruleParNode in getChildNodes(rulePropNode):
02189               parName = str(ruleParNode.tagName.lower())
02190               parValue = str(ruleParNode.firstChild.data).strip()
02191               if parName == 'subsystem':
02192                 if groups.has_key(parValue):
02193                   parValue = groups[parValue]
02194                 else:
02195                   log.error("%s: Rule subsystem group %s not defined" % (fn, parValue))
02196                   parValue = None
02197               elif parName == 'category':
02198                 if groups.has_key(parValue):
02199                   parValue = groups[parValue]
02200                 else:
02201                   log.error("%s: Rule category group %s not defined" % (fn, parValue))
02202                   parValue = None
02203               elif parName == 'actions':
02204                 for ruleActionNode in getChildNodes(ruleParNode):
02205                   actName = str(ruleActionNode.tagName)
02206                   if actName not in ruleActionList:
02207                     ruleActionList.append(actName)
02208                   else:
02209                     log.error("%s: Rule action %s already defined." % (fn, actName))
02210                 parValue = ruleActionList
02211               else:
02212                 parValue = getParameterValue(parValue)
02213               ruleParList[str(ruleParNode.tagName)] = parValue
02214         rules[(serialKey, serialNo)][ruleName] = instantiateClass(ruleClassModStr,
02215                                                    ruleClassNameStr,
02216                                                    ruleParList)
02217       else:
02218         log.error("%s: Missing rule name" % fn)
02219         return None
02220     else:
02221       log.error("%s: Invalid tag: %s ...skipping" % (fn, n.tagName))
02222
02223 def processEGUs(node, declarations):
02224   fn = "processEGUs"
02225   node = checkForDuplicateNode(node)
02226   egus = declarations['egus']
02227   if hasAttribute(node, 'serialKey'):
02228     serialKey = str(getAttribute(node, 'serialKey'))
02229   else:
02230     serialKey = 'default'
02231   if hasAttribute(node, 'serialNo'):
02232     serialNo = str(getAttribute(node, 'serialNo'))
02233   else:
02234     serialNo = 'default'
02235
02236   if (serialKey, serialNo) not in egus:
02237     egus[(serialKey, serialNo)] = {}
02238
02239   for n in getChildNodes(node):
02240     tagName = n.tagName.lower()
02241     if tagName == 'egu':
02242       if hasAttribute(n, 'name'):
02243         eguName = str(getAttribute(n, 'name'))
02244         #if egus.has_key(eguName):
02245         #  eguClassModStr = egus[eguName][0]
02246         #  eguClassNameStr = egus[eguName][1]
02247         #  eguParList = egus[eguName][2]
02248         for eguPropNode in getChildNodes(n):
02249           tagName = eguPropNode.tagName.lower()
02250           if tagName == 'class':
02251             classStr = str(eguPropNode.firstChild.data).strip()
02252             lastDot = classStr.rfind('.')
02253             if lastDot == -1:
02254               eguClassNameStr = classStr
02255               eguClassModStr = ''
02256             else:
02257               eguClassNameStr = classStr[lastDot+1:]
02258               eguClassModStr = classStr[:lastDot]
02259           elif tagName == 'parameters':
02260             eguParList = {}
02261             for eguParNode in getChildNodes(eguPropNode):
02262               parValue = str(eguParNode.firstChild.data).strip()
02263               parValue = getParameterValue(parValue)
02264               eguParList[str(eguParNode.tagName)] = parValue
02265         egus[(serialKey, serialNo)][eguName] = instantiateClass(eguClassModStr,
02266                                                  eguClassNameStr,
02267                                                  eguParList)
02268       else:
02269         log.error("%s: Missing EGU name" % fn)
02270         return None
02271     else:
02272       log.error("%s: Invalid tag: %s ...skipping" % (fn, n.tagName))
02273
02274
02275 def processDeclarations(isSchema, node, declarations):
02276   fn = "processDeclarations"
02277   groups = declarations['groups']
02278   imports = declarations['imports']
02279   ml = BasicModuleLoader()
02280   for n in getChildNodes(node):
02281     tagName = n.tagName.lower()
02282     if tagName == 'import':
02283       if hasAttribute(n, 'name'):
02284         modName = str(getAttribute(n, 'name'))
02285         modPathSpec = str(n.firstChild.data.strip())
02286         imports[modName] = modPathSpec
02287         if modPathSpec.endswith('.py'):
02288           (modPath, modFile) = os.path.split(os.path.expandvars(modPathSpec))
02289           modstuff = ml.find_module(os.path.splitext(modFile)[0], (modPath,))
02290         elif modPathSpec.find('.') != -1:
02291           exec('import ' + modPathSpec + ' as ' + modName)
02292           modstuff = ''
02293           sys.modules[modName] = sys.modules[modPathSpec]
02294         else:
02295           modstuff = ml.find_module(modPathSpec, tuple(sys.path) + (os.getcwd(),))
02296         if modstuff is None:
02297           raise ImportError, "%s: Module not found: %s" % (fn, modPathSpec)
02298         if isinstance(modstuff, tuple):
02299           ml.load_module(modName, modstuff)
02300       else:
02301         log.error("%s: Missing module name" % fn)
02302         return None
02303     elif tagName == 'group':
02304       if hasAttribute(n, 'name'):
02305         groupName = str(getAttribute(n, 'name'))
02306       else:
02307         log.error("%s: Missing group name" % fn)
02308         return None
02309       if hasAttribute(n, 'enabled'):
02310         isGroupEnabled = str(getAttribute(n, 'enabled'))
02311         if isGroupEnabled.lower() in ('true', 'yes'):
02312           isGroupEnabled = 1
02313         elif isGroupEnabled.lower() in ('false', 'no'):
02314           isGroupEnabled = 0
02315         else:
02316           log.error("%s: Invalid enable flag value %d" % (fn, isGroupEnabled))
02317       else:
02318         log.error("%s: Missing enable flag for group %s" % (fn, groupName))
02319       groups[groupName] = Ggroup(groupName, isGroupEnabled)
02320     elif tagName == 'options':
02321       for on in getChildNodes(n):
02322         tagName = str(on.tagName).lower()
02323         if tagName == 'explicitbroadcastnodes':
02324           if not isSchema:
02325             log.error("%s: '%s' declaration option can not be used in a configuration block" % (fn, on.tagName))
02326           else:
02327             processBooleanDeclarationOption(on, declarations)
02328         elif tagName in ('skiptemoverrides', 'skipsystemoverrides'):
02329           processBooleanDeclarationOption(on, declarations, 'skipsystemoverrides')
02330         elif tagName == 'ignorehardwaretimeouts':
02331           if not isSchema:
02332             log.error("%s: '%s' declaration option can not be used in a configuration block" % (fn, on.tagName))
02333           else:
02334             processBooleanDeclarationOption(on, declarations)
02335         else:
02336           log.error("%s: Invalid declaration options tag: %s ...skipping" % (fn, on.tagName))
02337     else:
02338       log.error("%s: Invalid declaration tag: %s ...skipping" % (fn, n.tagName))
02339   return
02340
02341 def processBooleanDeclarationOption(on, declarations, tagName=None):
02342   if tagName is None:
02343     tagName = str(on.tagName).lower()
02344   val = str(on.firstChild.data).strip().lower()
02345   if val == '1' or val == 'true':
02346     declarations['options'][tagName] = 1
02347   else:
02348     declarations['options'][tagName] = 0
02349
02350 def processBadChannels(node, badChannels, mapLayerToCable=None, mapDetectorToLayer=None, temId=None):
02351   BAD_CHANNEL_MASKS = ['nOnbdCalib', 'nOnbdData', 'nOnbdTrig']
02352   fn = "processBadChannels"
02353   for badStripNode in getChildNodes(node):
02354     if badStripNode.tagName == 'tower':
02355       badStripTower = badStripNode
02356       if temId is None:
02357         row = int(getAttribute(badStripTower, 'row'))
02358         col = int(getAttribute(badStripTower, 'col'))
02359         temId = row*4 + col
02360       for uniplane in getChildNodes(badStripTower):
02361         if uniplane.tagName == 'uniplane':
02362           tray = int(getAttribute(uniplane, 'tray'))
02363           which = str(getAttribute(uniplane, 'which'))
02364           howBad = int(getAttribute(uniplane, 'howBad'))
02365           if mapLayerToCable is not None and mapDetectorToLayer is not None:
02366             ccpair_rc = mapLayerToCable[mapDetectorToLayer[(tray, which)]]
02367           else:
02368             ccpair_rc = MAP_LAYER_TO_CABLE[MAP_DETECTOR_TO_LAYER[(tray, which)]]
02369           maskAttrVal = {}
02370           atLeastOneIsTrue = False
02371           for maskAttr in BAD_CHANNEL_MASKS:
02372             maskAttrVal[maskAttr] = str(getAttribute(uniplane, maskAttr)).lower()
02373             if maskAttrVal[maskAttr] == 'true':
02374               atLeastOneIsTrue = True
02375           # For backward compatibility: If masks are not specified or
02376           # if all masks are set to 'false' then assume all are 'true'
02377           if not atLeastOneIsTrue:
02378             for maskAttr in BAD_CHANNEL_MASKS:
02379               maskAttrVal[maskAttr] = 'true'
02380           for maskAttr in BAD_CHANNEL_MASKS:
02381             if maskAttrVal[maskAttr] == 'true':
02382               mask = maskAttr.lower()[5:]
02383               if (temId, ccpair_rc) in badChannels[mask]:
02384                 stripBitField = badChannels[mask][(temId, ccpair_rc)]
02385               else:
02386                 stripBitField = gBits.bf(0)
02387               for stripListNode in getChildNodes(uniplane):
02388                 if stripListNode.tagName == 'stripList':
02389                   stripSeq = str(getAttribute(stripListNode, 'strips')).strip()
02390                   stripList = uncompressSequence(stripSeq, sepChar=' ')
02391                   for strip in stripList:
02392                     stripBitField[strip] = 1
02393               badChannels[mask][(temId, ccpair_rc)] = stripBitField
02394
02395 def readBadChannels(fileName, mapLayerToCable=None, mapDetectorToLayer=None, temId=None):
02396   fn = "readBadChannels"
02397   #doc = Sax2.FromXmlFile(fileName)
02398   try:
02399     #doc = minidom.parse(fileName)
02400     file_uri = Uri.OsPathToUri(fileName, attemptAbsolute=1)
02401     doc = NonvalidatingReader.parseUri(file_uri)
02402   except Exception, e:
02403     log.exception("%s: Error parsing bad channels file: %s" % (fn, fileName))
02404     raise e
02405   root = doc.documentElement
02406   tagName = root.tagName.lower()
02407   if tagName != "badstrips":
02408     log.error("%s: Invalid bad strips document tag: %s" % (fn, tagName))
02409     return None
02410   badChannels = {'calib':{}, 'data':{}, 'trig':{}}
02411   processBadChannels(root, badChannels, mapLayerToCable, mapDetectorToLayer, temId)
02412   return badChannels
02413
02414 def instantiateClass(classModStr, classNameStr, parList):
02415   fn = "instantiateClass"
02416   if sys.modules.has_key(classModStr):
02417     m = sys.modules[classModStr]
02418     try:
02419       return apply(getattr(m, classNameStr), (), parList)
02420     except:
02421       log.error("%s: Error: %s %s %s" % (fn, classModStr, classNameStr, sys.exc_value))
02422       log.error("%s: Class parameter list: %s" % (fn, parList))
02423       return None
02424   else:
02425     log.error("%s: Module %s for class %s not loaded" % (fn, classModStr, classNameStr))
02426     return None
02427
02428 def takeSnapshot(glat, stream=sys.stdout, fileName=None,
02429                  captureGTIC=1, captureGAEQ=1,
02430                  trigger=None,
02431                  configName='', configVersion=''):
02432   fn = "takeSnapshot"
02433   closeFlag=0
02434   if stream is None:
02435     try:
02436       stream = open(fileName,'w')
02437       closeFlag = 1
02438     except:
02439       log.error("%s: can't open snapshot file: %s" % (fn, fileName))
02440       return
02441   log.debug("%s: Generating snapshot: %s, configName= %s, configVersion= %s..." %
02442            (fn, fileName, configName, configVersion))
02443   result = writeSchema(glat, stream, snapshotMode=1,
02444               captureGTIC=captureGTIC, captureGAEQ=captureGAEQ,
02445               trigger=trigger,
02446               configName=configName, configVersion=configVersion)
02447   if closeFlag:
02448     stream.close()
02449   if result:
02450     log.debug("%s: Snapshot generation completed successfully" % fn)
02451   else:
02452     log.warning("%s: Snapshot generation completed with errors" % fn)
02453   return result
02454
02455 def writeConfig(glat, stream=sys.stdout, seq=None):
02456   fn = "writeConfig"
02457   configs = glat.getConfigurations()
02458   configSeqList = configs.keys()
02459   configSeqList.sort()
02460   for configSeq in configSeqList:
02461     if seq is None:
02462       PrettyPrint(configs[configSeq][0], stream)
02463       #toPrettyXML(configs[configSeq][0], stream, indent="  ", encoding="UTF-8")
02464     elif seq == configSeq:
02465       PrettyPrint(configs[seq][0], stream)
02466       #toPrettyXML(configs[seq][0], stream, indent="  ", encoding="UTF-8")
02467       return
02468   if seq is None:
02469     return
02470   else:
02471     log.error("%s: Configuration %d not found." % (fn, seq))
02472
02473 def writeRegisters(node, doc, xnode):
02474   fn = "writeRegisters"
02475   result = True
02476   for (reg, regObj) in node.regs.items():
02477     # Already writing the bit fields for the mask so skip it
02478     if node.__class__.__name__ == 'GGLT' and reg == 'mask':
02479       continue
02480     retryCount = 3
02481     if not regObj.isDeprecated() and \
02482        not regObj.isCommand() and \
02483        not regObj.isWriteOnly() and \
02484        not regObj.isNoDirectAccess() and \
02485        'noread' not in node.getExcludeFlags():
02486       while True:
02487         try:
02488           regVal = regObj.get(bypass=1)
02489           #print regObj.getName(), node.__class__.__name__, regVal.__class__.__name__
02490           #log.error("Added register to the snapshot: %s %s %s %s" \
02491           #            % (node.getName(), node.getIdTuple(), regObj.getName(), regVal))
02492           break
02493         except gException.LATInterfaceException:
02494           if sys.exc_info()[1].errstr()[0] in ('LCB_RTOERR', 'LCBD_RTOERR'):
02495             if not node.root().getDeclarations()['options']['ignorehardwaretimeouts']:
02496               log.error("%s: Error adding register to the snapshot: %s %s %s %s" \
02497                         % (fn, sys.exc_info()[1].errstr(), node.getName(),
02498                           node.getIdTuple(), regObj.getName()))
02499             return False
02500           elif sys.exc_info()[1].errstr()[0] == 'OCS_BDADC' and retryCount > 1:
02501             retryCount -= 1
02502             continue
02503           else:
02504             log.error("%s: Error adding register to the snapshot: %s %s %s %s" \
02505                       % (fn, sys.exc_info()[1].errstr(), node.getName(),
02506                         node.getIdTuple(), regObj.getName()))
02507             regVal = 0
02508             result = False
02509             break
02510
02511       xreg = createElement(doc, reg)
02512       xreg.appendChild(doc.createTextNode('0x%x' % regVal))
02513       xnode.appendChild(xreg)
02514   return result
02515
02516
02517 def writeSchema(glat, stream=sys.stdout, snapshotMode=0,
02518                 captureGTIC=1, captureGAEQ=1,
02519                 trigger=None,
02520                 configName='', configVersion=''):
02521   """Writes a LAT object model to an XML schema
02522
02523   Inputs::
02524
02525     GLAT root of the object model
02526     Output stream (defaults to sys.stdout if omitted)
02527
02528   Output: None
02529
02530   Usage::
02531
02532     f = open('mySchema.xml', 'w')
02533     writeSchema(lat, f)
02534     f.close()
02535       or
02536     writeSchema(lat) to output to sys.stdout.
02537   """
02538   fn = "writeSchema"
02539   result = True # Return False if there are any errors during snapshot
02540   if configName == '': configName = glat._GLAT__configName
02541   if configVersion == '': configVersion = glat._GLAT__configVersion
02542   #doc = minidom.getDOMImplementation().createDocument(None,None,None)
02543   doc = implementation.createDocument(None,None,None)
02544   if not snapshotMode:
02545     for c in glat._GLAT__schemaComments:
02546       doc.appendChild(doc.createComment(c))
02547     root = createElement(doc, "LATdoc")
02548     setAttribute(root, 'name', glat._GLAT__schemaName)
02549     doc.appendChild(root)
02550   else:
02551     root = createElement(doc, 'configuration')
02552     setAttribute(root, 'name', configName)
02553     setAttribute(root, 'version', configVersion)
02554     doc.appendChild(root)
02555
02556   xdecl = createElement(doc, "declarations")
02557   root.appendChild(xdecl)
02558   options = glat._GLAT__declarations['options']
02559   if len(options) > 0:
02560     xoptblk = createElement(doc, 'options')
02561     for (optName, optVal) in options.items():
02562       if optName.startswith("__"):
02563         continue
02564       xopt = createElement(doc, optName)
02565       xopt.appendChild(doc.createTextNode(str(optVal)))
02566       xoptblk.appendChild(xopt)
02567     xdecl.appendChild(xoptblk)
02568   imports = glat._GLAT__declarations['imports']
02569   if len(imports) > 0:
02570     for (impName, impPath) in imports.items():
02571       ximp = createElement(doc, 'import')
02572       setAttribute(ximp, 'name', impName)
02573       ximp.appendChild(doc.createTextNode(impPath))
02574       xdecl.appendChild(ximp)
02575   groups = glat._GLAT__declarations['groups']
02576   if len(groups) > 0:
02577     for (groupName, group) in groups.items():
02578       xgrp = createElement(doc, 'group')
02579       if group.enabled():
02580         setAttribute(xgrp, 'enabled', 'true')
02581       else:
02582         setAttribute(xgrp, 'enabled', 'false')
02583       setAttribute(xgrp, 'name', groupName)
02584       xdecl.appendChild(xgrp)
02585
02586   consDict = glat._GLAT__declarations['constraints']
02587   for ((serialKey, serialNo), constraints) in consDict.items():
02588     if len(constraints) > 0:
02589       xconsblk = createElement(doc, 'constraints')
02590       if serialKey != 'default':
02591         setAttribute(xconsblk, 'serialKey', serialKey)
02592       if serialNo != 'default':
02593         setAttribute(xconsblk, 'serialNo', serialNo)
02594       for (consName, cons) in constraints.items():
02595         if cons is None: continue
02596         xcons = createElement(doc, 'constraint')
02597         setAttribute(xcons, 'name', consName)
02598         xclass = createElement(doc, 'class')
02599         xclass.appendChild(doc.createTextNode(cons.__class__.__module__ +
02600                                               '.' + cons.__class__.__name__)
02601                                             )
02602         xcons.appendChild(xclass)
02603         xparblk = createElement(doc, 'parameters')
02604         (args, varargs, varkw) = inspect.getargs(cons.__init__.func_code)
02605         for arg in args:
02606           if arg == 'self': continue
02607           val = None
02608           for (dictVar, dictVal) in cons.__dict__.items():
02609             if dictVar.endswith('__' + arg):
02610               val = dictVal
02611               break
02612           if val is None:
02613           #if cons.__dict__.has_key('_Gconstraint__' + arg):
02614           #  val = cons.__dict__['_Gconstraint__' + arg]
02615           #elif cons.__dict__.has_key('_' + cons.__class__.__name__ + '__' + arg):
02616           #  val = cons.__dict__['_' + cons.__class__.__name__ + '__' + arg]
02617           #else:
02618             log.error("%s: Can not locate instance variable for "
02619                       "constraint parameter: %s ...skipping" % (fn, arg))
02620             continue
02621           if hasattr(val, 'name'):
02622             val = val.name()
02623           xpar = createElement(doc, arg)
02624           xval = doc.createTextNode(str(val))
02625           xpar.appendChild(xval)
02626           xparblk.appendChild(xpar)
02627         xcons.appendChild(xparblk)
02628         xconsblk.appendChild(xcons)
02629       root.appendChild(xconsblk)
02630
02631   rulesDict = glat._GLAT__declarations['rules']
02632   for ((serialKey, serialNo), rules) in rulesDict.items():
02633     if len(rules) > 0:
02634       xruleblk = createElement(doc, 'rules')
02635       if serialKey != 'default':
02636         setAttribute(xruleblk, 'serialKey', serialKey)
02637       if serialNo != 'default':
02638         setAttribute(xruleblk, 'serialNo', serialNo)
02639       for (ruleName, rule) in rules.items():
02640         if rule is None: continue
02641         xrule = createElement(doc, 'rule')
02642         setAttribute(xrule, 'name', ruleName)
02643         xclass = createElement(doc, 'class')
02644         xclass.appendChild(doc.createTextNode(rule.__class__.__module__ +
02645                                               '.' + rule.__class__.__name__)
02646                                             )
02647         xrule.appendChild(xclass)
02648         xparblk = createElement(doc, 'parameters')
02649         (args, varargs, varkw) = inspect.getargs(rule.__init__.func_code)
02650         for arg in args:
02651           if arg == 'self': continue
02652           val = None
02653           for (dictVar, dictVal) in rule.__dict__.items():
02654             if dictVar.endswith('__' + arg):
02655               val = dictVal
02656               break
02657           if val is None:
02658           #if rule.__dict__.has_key('_Grule__' + arg):
02659           #  val = rule.__dict__['_Grule__' + arg]
02660           #elif rule.__dict__.has_key('_' + rule.__class__.__name__ + '__' + arg):
02661           #  val = rule.__dict__['_' + rule.__class__.__name__ + '__' + arg]
02662           #else:
02663             log.error("%s: Can not locate instance variable for "
02664                       "rule parameter: %s ...skipping" % (fn, arg))
02665             continue
02666           if hasattr(val, 'name'):
02667             val = val.name()
02668           xpar = createElement(doc, arg)
02669           xval = doc.createTextNode(str(val))
02670           xpar.appendChild(xval)
02671           xparblk.appendChild(xpar)
02672         xrule.appendChild(xparblk)
02673         xruleblk.appendChild(xrule)
02674       root.appendChild(xruleblk)
02675
02676   egusDict = glat._GLAT__declarations['egus']
02677   for ((serialKey, serialNo), egus) in egusDict.items():
02678     if len(egus) > 0:
02679       xegublk = createElement(doc, 'egus')
02680       if serialKey != 'default':
02681         setAttribute(xegublk, 'serialKey', serialKey)
02682       if serialNo != 'default':
02683         setAttribute(xegublk, 'serialNo', serialNo)
02684       for (eguName, egu) in egus.items():
02685         if egu is None: continue
02686         xegu = createElement(doc, 'egu')
02687         setAttribute(xegu, 'name', eguName)
02688         xclass = createElement(doc, 'class')
02689         xclass.appendChild(doc.createTextNode(egu.__class__.__module__ +
02690                                               '.' + egu.__class__.__name__)
02691                                             )
02692         xegu.appendChild(xclass)
02693         xparblk = createElement(doc, 'parameters')
02694         (args, varargs, varkw) = inspect.getargs(egu.__init__.func_code)
02695         for arg in args:
02696           if arg == 'self': continue
02697           val = None
02698           for (dictVar, dictVal) in egu.__dict__.items():
02699             if dictVar.endswith('__' + arg):
02700               val = dictVal
02701               break
02702           if val is None:
02703           #if egu.__dict__.has_key('_GEGU__' + arg):
02704           #  val = egu.__dict__['_GEGU__' + arg]
02705           #elif egu.__dict__.has_key('_' + egu.__class__.__name__ + '__' + arg):
02706           #  val = egu.__dict__['_' + egu.__class__.__name__ + '__' + arg]
02707           #else:
02708             log.error("%s: Can not locate instance variable for "
02709                       "EGU parameter: %s ...skipping" % (fn, arg))
02710             continue
02711           if hasattr(val, 'name'):
02712             val = val.name()
02713           xpar = createElement(doc, arg)
02714           xval = doc.createTextNode(str(val))
02715           xpar.appendChild(xval)
02716           xparblk.appendChild(xpar)
02717         xegu.appendChild(xparblk)
02718         xegublk.appendChild(xegu)
02719       root.appendChild(xegublk)
02720
02721   options = glat._GLAT__declarations['options']
02722   if not snapshotMode:
02723     explicitBroadcastNodes = options['explicitbroadcastnodes']
02724   else:
02725     explicitBroadcastNodes = 0
02726
02727   lat = getPath(glat, explicitBroadcastNodes)
02728   if not snapshotMode:
02729     xsch = createElement(doc, 'schema')
02730     root.appendChild(xsch)
02731     xlat = createElement(doc, 'GLAT')
02732     xsch.appendChild(xlat)
02733   else:
02734     gem = lat[2]                                  # Check for a GEM
02735     if gem is None and trigger is not None:       # No gem, use GLT
02736       glt = trigger.GLT()                         # get GLT from trigger obj
02737       gltMask = ~( trigger.conditions().value() ) # GLT uses ~ logic
02738       gMask = gBits.bf(gltMask)
02739       xglt = createElement(doc, 'GGLT')
02740       for (bitField, fromBit, toBit) in glt._GGLT__mask_BF:
02741         xreg = createElement(doc, bitField)
02742         xreg.appendChild(doc.createTextNode('0x%x' % gMask[fromBit:toBit]))
02743         xglt.appendChild(xreg)
02744       # Add the rest of the GLT
02745       for reg in ('mask','parity','tag','event_number',
02746                   'destination','marker','tack',
02747                   'zero_suppress','four_range_readout','cal_strobe'):
02748         xreg = createElement(doc, reg)
02749         xreg.appendChild(doc.createTextNode('0x%x' % glt.regs[reg].get()))
02750         xglt.appendChild(xreg)
02751       root.appendChild(xglt)
02752     xlat = createElement(doc, 'GLAT')
02753     root.appendChild(xlat)
02754
02755   pdus = lat[0]
02756   for pdu in pdus:
02757     pduIds = pdu[0]
02758     if snapshotMode:
02759       for pduId in pduIds:
02760         xpdu = createElement(doc, 'GPDU')
02761         setAttribute(xpdu, 'ID', "%d"%pduId)
02762         gpdu = glat.PDU[pduId]
02763         if not writeRegisters(gpdu, doc, xpdu):
02764           result = False
02765           continue
02766         xlat.appendChild(xpdu)
02767         peq = pdu[1]
02768         if peq:
02769           xpeq = createElement(doc, 'GPEQ')
02770           xpdu.appendChild(xpeq)
02771           result &= writeRegisters(gpdu.PEQ, doc, xpeq)
02772     else:
02773       xpdu = createElement(doc, 'GPDU')
02774       setAttribute(xpdu, 'ID', compressSequence(pduIds))
02775       xlat.appendChild(xpdu)
02776       peq = pdu[1]
02777       if peq:
02778         xpeq = createElement(doc, 'GPEQ')
02779         xpdu.appendChild(xpeq)
02780   ebm = lat[1]
02781   if ebm is not None:
02782     xebm = createElement(doc, 'GEBM')
02783     xlat.appendChild(xebm)
02784     if snapshotMode:
02785       gebm = glat.EBM
02786       result &= writeRegisters(gebm, doc, xebm)
02787     (ebmc, ebmst) = ebm
02788     if ebmc:
02789       xebmc = createElement(doc, 'GEBMC')
02790       xebm.appendChild(xebmc)
02791       if snapshotMode:
02792         result &= writeRegisters(gebm.EBMC, doc, xebmc)
02793     if ebmst:
02794       xebmst = createElement(doc, 'GEBMST')
02795       xebm.appendChild(xebmst)
02796       if snapshotMode:
02797         result &= writeRegisters(gebm.EBMST, doc, xebmst)
02798   gem = lat[2]
02799   if gem is not None:
02800     xgem = createElement(doc, 'GGEM')
02801     xlat.appendChild(xgem)
02802     if snapshotMode:
02803       ggem = glat.GEM
02804       result &= writeRegisters(ggem, doc, xgem)
02805     (gemc, gemmg, gemst, gemsc, gemvg, gemie, gemw) = gem
02806     if gemc:
02807       xgemc = createElement(doc, 'GGEMC')
02808       xgem.appendChild(xgemc)
02809       if snapshotMode:
02810         result &= writeRegisters(ggem.GEMC, doc, xgemc)
02811     if gemmg:
02812       xgemmg = createElement(doc, 'GGEMMG')
02813       xgem.appendChild(xgemmg)
02814       if snapshotMode:
02815         result &= writeRegisters(ggem.GEMMG, doc, xgemmg)
02816     if gemst:
02817       xgemst = createElement(doc, 'GGEMST')
02818       xgem.appendChild(xgemst)
02819       if snapshotMode:
02820         result &= writeRegisters(ggem.GEMST, doc, xgemst)
02821     if gemsc:
02822       xgemsc = createElement(doc, 'GGEMSC')
02823       xgem.appendChild(xgemsc)
02824       if snapshotMode:
02825         result &= writeRegisters(ggem.GEMSC, doc, xgemsc)
02826     if gemvg:
02827       xgemvg = createElement(doc, 'GGEMVG')
02828       xgem.appendChild(xgemvg)
02829       if snapshotMode:
02830         result &= writeRegisters(ggem.GEMVG, doc, xgemvg)
02831     if gemie:
02832       xgemie = createElement(doc, 'GGEMIE')
02833       xgem.appendChild(xgemie)
02834       if snapshotMode:
02835         result &= writeRegisters(ggem.GEMIE, doc, xgemie)
02836     if gemw:
02837        xgemw = createElement(doc, 'GGEMW')
02838        xgem.appendChild(xgemw)
02839        if snapshotMode:
02840          result &= writeRegisters(ggem.GEMW, doc, xgemw)
02841          if trigger is not None:
02842            for n in getChildNodes(xgemw):
02843              if str(n.tagName.lower()) == 'window_open_mask':
02844                old_wom = getChildNodes(n)[0]
02845                new_wom = doc.createTextNode('0x%x' % trigger.conditions().value())
02846                n.replaceChild(new_wom, old_wom)
02847                break
02848   cru = lat[3]
02849   if cru:
02850     xcru = createElement(doc, 'GCRU')
02851     xlat.appendChild(xcru)
02852     if snapshotMode:
02853       result &= writeRegisters(glat.CRU, doc, xcru)
02854   tems = lat[4]
02855   for tem in tems:
02856     temIds = tem[0]
02857     if snapshotMode:
02858       for temId in temIds:
02859         xtem = createElement(doc, 'GTEM')
02860         setAttribute(xtem, 'ID', "%d"%temId)
02861         gtem = glat.TEM[temId]
02862         if not writeRegisters(gtem, doc, xtem):
02863           result = False
02864           continue
02865         xlat.appendChild(xtem)
02866         ccs = tem[1]
02867         cccs = ccs[0]
02868         for ccc in cccs:
02869           cccIds = ccc[0]
02870           for cccId in cccIds:
02871             xccc = createElement(doc, 'GCCC')
02872             setAttribute(xccc, 'ID', "%d"%cccId)
02873             gccc = gtem.CCC[cccId]
02874             if not writeRegisters(gccc, doc, xccc):
02875               result = False
02876               continue
02877             xtem.appendChild(xccc)
02878             crcs = ccc[1]
02879             for crc in crcs:
02880               crcIds = crc[0]
02881               for crcId in crcIds:
02882                 xcrc = createElement(doc, 'GCRC')
02883                 setAttribute(xcrc, 'ID', "%d"%crcId)
02884                 gcrc = gccc.CRC[crcId]
02885                 if not writeRegisters(gcrc, doc, xcrc):
02886                   result = False
02887                   continue
02888                 xccc.appendChild(xcrc)
02889                 cfeIds = crc[1]
02890                 if cfeIds != ():
02891                   for cfeId in cfeIds:
02892                     xcfe = createElement(doc, 'GCFE')
02893                     setAttribute(xcfe, 'ID', "%d"%cfeId)
02894                     gcfe = gcrc.CFE[cfeId]
02895                     if not writeRegisters(gcfe, doc, xcfe):
02896                       result = False
02897                       continue
02898                     xcrc.appendChild(xcfe)
02899         tccs = ccs[1]
02900         for tcc in tccs:
02901           tccIds = tcc[0]
02902           for tccId in tccIds:
02903             xtcc = createElement(doc, 'GTCC')
02904             setAttribute(xtcc, 'ID', "%d"%tccId)
02905             gtcc = gtem.TCC[tccId]
02906             if not writeRegisters(gtcc, doc, xtcc):
02907               result = False
02908               continue
02909             xtem.appendChild(xtcc)
02910             trcs = tcc[1]
02911             for trc in trcs:
02912               trcIds = trc[0]
02913               for trcId in trcIds:
02914                 xtrc = createElement(doc, 'GTRC')
02915                 setAttribute(xtrc, 'ID', "%d"%trcId)
02916                 gtrc = gtcc.TRC[trcId]
02917                 if not writeRegisters(gtrc, doc, xtrc):
02918                   result = False
02919                   continue
02920                 xtcc.appendChild(xtrc)
02921                 tfeIds = trc[1]
02922                 if tfeIds != ():
02923                   for tfeId in tfeIds:
02924                     xtfe = createElement(doc, 'GTFE')
02925                     setAttribute(xtfe, 'ID', "%d"%tfeId)
02926                     gtfe = gtrc.TFE[tfeId]
02927                     if not writeRegisters(gtfe, doc, xtfe):
02928                       result = False
02929                       continue
02930                     xtrc.appendChild(xtfe)
02931         if captureGTIC:
02932           tic = ccs[2]
02933           if tic:
02934             xtic = createElement(doc, 'GTIC')
02935             gtic = gtem.TIC
02936             result &= writeRegisters(gtic, doc, xtic)
02937             xtem.appendChild(xtic)
02938     else:
02939       xtem = createElement(doc, 'GTEM')
02940       setAttribute(xtem, 'ID', compressSequence(temIds))
02941       xlat.appendChild(xtem)
02942       ccs = tem[1]
02943       cccs = ccs[0]
02944       for ccc in cccs:
02945         cccIds = ccc[0]
02946         xccc = createElement(doc, 'GCCC')
02947         setAttribute(xccc, 'ID', compressSequence(cccIds))
02948         xtem.appendChild(xccc)
02949         crcs = ccc[1]
02950         for crc in crcs:
02951           crcIds = crc[0]
02952           xcrc = createElement(doc, 'GCRC')
02953           setAttribute(xcrc, 'ID', compressSequence(crcIds))
02954           xccc.appendChild(xcrc)
02955           cfeIds = crc[1]
02956           if cfeIds != ():
02957             xcfe = createElement(doc, 'GCFE')
02958             setAttribute(xcfe, 'ID', compressSequence(cfeIds))
02959             xcrc.appendChild(xcfe)
02960       tccs = ccs[1]
02961       for tcc in tccs:
02962         tccIds = tcc[0]
02963         xtcc = createElement(doc, 'GTCC')
02964         setAttribute(xtcc, 'ID', compressSequence(tccIds))
02965         xtem.appendChild(xtcc)
02966         trcs = tcc[1]
02967         for trc in trcs:
02968           trcIds = trc[0]
02969           xtrc = createElement(doc, 'GTRC')
02970           setAttribute(xtrc, 'ID', compressSequence(trcIds))
02971           xtcc.appendChild(xtrc)
02972           tfeIds = trc[1]
02973           if tfeIds != ():
02974             xtfe = createElement(doc, 'GTFE')
02975             setAttribute(xtfe, 'ID', compressSequence(tfeIds))
02976             xtrc.appendChild(xtfe)
02977       tic = ccs[2]
02978       if tic:
02979         xtic = createElement(doc, 'GTIC')
02980         xtem.appendChild(xtic)
02981   aem = lat[5]
02982   if aem != None:
02983     xaem = createElement(doc, 'GAEM')
02984     if aem[0]:
02985       aemIds = (0,255)
02986       setAttribute(xaem, 'ID', compressSequence(aemIds))
02987     if snapshotMode:
02988       gaem = glat.AEM
02989       result &= writeRegisters(gaem, doc, xaem)
02990     xlat.appendChild(xaem)
02991     if snapshotMode:
02992       if captureGAEQ:
02993         aeq = aem[1]
02994         if aeq:
02995           xaeq = createElement(doc, 'GAEQ')
02996           gaeq = gaem.AEQ
02997           result &= writeRegisters(gaeq, doc, xaeq)
02998           xaem.appendChild(xaeq)
02999     else:
03000       aeq = aem[1]
03001       if aeq:
03002         xaeq = createElement(doc, 'GAEQ')
03003         xaem.appendChild(xaeq)
03004     for arc in aem[2]:
03005       arcIds = arc[0]
03006       if snapshotMode:
03007         for arcId in arcIds:
03008           xarc = createElement(doc, 'GARC')
03009           setAttribute(xarc, 'ID', "%d"%arcId)
03010           garc = gaem.ARC[arcId]
03011           result &= writeRegisters(garc, doc, xarc)
03012           xaem.appendChild(xarc)
03013           afeIds = arc[1]
03014           if afeIds != ():
03015             for afeId in afeIds:
03016               xafe = createElement(doc, 'GAFE')
03017               setAttribute(xafe, 'ID', "%d"%afeId)
03018               gafe = garc.AFE[afeId]
03019               result &= writeRegisters(gafe, doc, xafe)
03020               xarc.appendChild(xafe)
03021       else:
03022         xarc = createElement(doc, 'GARC')
03023         setAttribute(xarc, 'ID', compressSequence(arcIds))
03024         xaem.appendChild(xarc)
03025         afeIds = arc[1]
03026         if afeIds != ():
03027           xafe = createElement(doc, 'GAFE')
03028           setAttribute(xafe, 'ID', compressSequence(afeIds))
03029           xarc.appendChild(xafe)
03030
03031   if not snapshotMode:
03032     configSeqList = glat.getConfigurations().keys()
03033     configSeqList.sort()
03034     for seq in configSeqList:
03035       xcnf = doc.importNode(glat.getConfigurations()[seq][0],1)
03036       root.appendChild(xcnf)
03037   PrettyPrint(doc, stream)
03038   #toPrettyXML(doc, stream, indent="  ", encoding="UTF-8")
03039   del doc
03040   gc.collect()
03041   return result
03042
03043
03044 def getPath(gnode, explicitBroadcastNodes):
03045   fn = 'getPath'
03046   if gnode.__class__.__name__ == 'GCRC':
03047     gcrcChildren = gnode.CFE.keys()
03048     gcrcChildren = tuple(gcrcChildren)
03049     return gcrcChildren
03050   elif gnode.__class__.__name__ == 'GCCC':
03051     gcrcSeqMap = {}
03052     for (gcrcId, gcrc) in gnode.CRC.items():
03053       if not explicitBroadcastNodes and gcrcId == 255: continue
03054       gcfeIdTuple = getPath(gcrc, explicitBroadcastNodes)
03055       if gcrcSeqMap.has_key(gcfeIdTuple):
03056         gcrcSeqMap[gcfeIdTuple] += (gcrcId,)
03057       else:
03058         gcrcSeqMap[gcfeIdTuple] = (gcrcId,)
03059     gcrcSeqTuple = ()
03060     for (gcfeIds, gcrcIds) in gcrcSeqMap.items():
03061       gcrcSeqTuple = ((gcrcIds, gcfeIds,),) + gcrcSeqTuple
03062     return gcrcSeqTuple
03063   if gnode.__class__.__name__ == 'GTRC':
03064     gtrcChildren = gnode.TFE.keys()
03065     gtrcChildren = tuple(gtrcChildren)
03066     return gtrcChildren
03067   elif gnode.__class__.__name__ == 'GTCC':
03068     gtrcSeqMap = {}
03069     for (gtrcId, gtrc) in gnode.TRC.items():
03070       if not explicitBroadcastNodes and gtrcId == 255: continue
03071       gtfeIdTuple = getPath(gtrc, explicitBroadcastNodes)
03072       if gtrcSeqMap.has_key(gtfeIdTuple):
03073         gtrcSeqMap[gtfeIdTuple] += (gtrcId,)
03074       else:
03075         gtrcSeqMap[gtfeIdTuple] = (gtrcId,)
03076     gtrcSeqTuple = ()
03077     for (gtfeIds, gtrcIds) in gtrcSeqMap.items():
03078       gtrcSeqTuple = ((gtrcIds, gtfeIds,),) + gtrcSeqTuple
03079     return gtrcSeqTuple
03080   elif gnode.__class__.__name__ == 'GTEM':
03081     gcccSeqMap = {}
03082     cccItems = gnode.CCC.items()
03083     if explicitBroadcastNodes and gnode.allCCC() is not None:
03084       cccItems.append((255,gnode.allCCC()))
03085     for (gcccId, gccc) in cccItems:
03086       gcrcIdTuple = getPath(gccc, explicitBroadcastNodes)
03087       if gcccSeqMap.has_key(gcrcIdTuple):
03088         gcccSeqMap[gcrcIdTuple] += (gcccId,)
03089       else:
03090         gcccSeqMap[gcrcIdTuple] = (gcccId,)
03091     gcccSeqTuple = ()
03092     for (gcrcIds, gcccIds) in gcccSeqMap.items():
03093       gcccSeqTuple = ((gcccIds, gcrcIds,),) + gcccSeqTuple
03094
03095     gtccSeqMap = {}
03096     tccItems = gnode.TCC.items()
03097     if explicitBroadcastNodes and gnode.allTCC() is not None:
03098       tccItems.append((255,gnode.allTCC()))
03099     for (gtccId, gtcc) in tccItems:
03100       gtrcIdTuple = getPath(gtcc, explicitBroadcastNodes)
03101       if gtccSeqMap.has_key(gtrcIdTuple):
03102         gtccSeqMap[gtrcIdTuple] += (gtccId,)
03103       else:
03104         gtccSeqMap[gtrcIdTuple] = (gtccId,)
03105     gtccSeqTuple = ()
03106     for (gtrcIds, gtccIds) in gtccSeqMap.items():
03107       gtccSeqTuple = ((gtccIds, gtrcIds,),) + gtccSeqTuple
03108     if gnode.downTIC() != None:
03109       return (gcccSeqTuple , gtccSeqTuple, 1)
03110     else:
03111       return (gcccSeqTuple , gtccSeqTuple, 0)
03112   elif gnode.__class__.__name__ == 'GLAT':
03113     gtemSeqMap = {}
03114     temItems = gnode.TEM.items()
03115     if explicitBroadcastNodes and gnode.allTEM() is not None:
03116       temItems.append((255,gnode.allTEM()))
03117     for (gtemId, gtem) in temItems:
03118       gcccIdTuple = getPath(gtem, explicitBroadcastNodes)
03119       if gtemSeqMap.has_key(gcccIdTuple):
03120         gtemSeqMap[gcccIdTuple] += (gtemId,)
03121       else:
03122         gtemSeqMap[gcccIdTuple] = (gtemId,)
03123     gtemSeqTuple = ()
03124     for (gcccIds, gtemIds) in gtemSeqMap.items():
03125       gtemSeqTuple = ((gtemIds, gcccIds,),) + gtemSeqTuple
03126     gpduSeqMap = {}
03127     for (gpduId, gpdu) in gnode.PDU.items():
03128
03129       gpduTuple = getPath(gpdu, explicitBroadcastNodes)
03130       if gpduTuple in gpduSeqMap:
03131         gpduSeqMap[gpduTuple] += (gpduId,)
03132       else:
03133         gpduSeqMap[gpduTuple] = (gpduId,)
03134     gpduSeqTuple = ()
03135     for (gpduTuple, gpduIds) in gpduSeqMap.items():
03136       gpduSeqTuple = ((gpduIds, gpduTuple,),) + gpduSeqTuple
03137
03138     if gnode.downAEM() == None:
03139       gaemTuple = None
03140     else:
03141       gaemTuple = getPath(gnode.downAEM(), explicitBroadcastNodes)
03142       gaemTuple = (0,) + gaemTuple
03143     ebm = gnode.downEBM()
03144     if ebm is not None:
03145       gebmTuple = ()
03146       ebmc = ebm.downEBMC()
03147       if ebmc is not None:
03148         gebmTuple += (1,)
03149       else:
03150         gebmTuple += (0,)
03151       ebmst = ebm.downEBMST()
03152       if ebmst is not None:
03153         gebmTuple += (1,)
03154       else:
03155         gebmTuple += (0,)
03156     else:
03157       gebmTuple = None
03158     gem = gnode.downGEM()
03159     if gem is not None:
03160       ggemTuple = ()
03161       gemc = gem.downGEMC()
03162       if gemc is not None:
03163         ggemTuple += (1,)
03164       else:
03165         ggemTuple += (0,)
03166       gemmg = gem.downGEMMG()
03167       if gemmg is not None:
03168         ggemTuple += (1,)
03169       else:
03170         ggemTuple += (0,)
03171       gemst = gem.downGEMST()
03172       if gemst is not None:
03173         ggemTuple += (1,)
03174       else:
03175         ggemTuple += (0,)
03176       gemsc = gem.downGEMSC()
03177       if gemsc is not None:
03178         ggemTuple += (1,)
03179       else:
03180         ggemTuple += (0,)
03181       gemvg = gem.downGEMVG()
03182       if gemvg is not None:
03183         ggemTuple += (1,)
03184       else:
03185         ggemTuple += (0,)
03186       gemie = gem.downGEMIE()
03187       if gemie is not None:
03188         ggemTuple += (1,)
03189       else:
03190         ggemTuple += (0,)
03191       gemw = gem.downGEMW()
03192       if gemw is not None:
03193         ggemTuple += (1,)
03194       else:
03195         ggemTuple += (0,)
03196     else:
03197       ggemTuple = None
03198     if gnode.existsCRU():
03199       gcru = 1
03200     else:
03201       gcru = 0
03202     return (gpduSeqTuple, gebmTuple, ggemTuple, gcru, gtemSeqTuple , gaemTuple)
03203   elif gnode.__class__.__name__ == 'GPDU':
03204     gpduChildren = ()
03205     peq = gnode.downPEQ()
03206     if peq is not None:
03207       gpduChildren += (1,)
03208     else:
03209       gpduChildren += (0,)
03210     return gpduChildren
03211   elif gnode.__class__.__name__ == 'GAEM':
03212     garcSeqMap = {}
03213     arcItems = gnode.ARC.items()
03214     if explicitBroadcastNodes and gnode.allARC() is not None:
03215       arcItems.append((255,gnode.allARC()))
03216     for (garcId, garc) in arcItems:
03217       gafeIdTuple = getPath(garc, explicitBroadcastNodes)
03218       if garcSeqMap.has_key(gafeIdTuple):
03219         garcSeqMap[gafeIdTuple] += (garcId,)
03220       else:
03221         garcSeqMap[gafeIdTuple] = (garcId,)
03222     garcSeqTuple = ()
03223     for (gafeIds, garcIds) in garcSeqMap.items():
03224       garcSeqTuple = ((garcIds, gafeIds,),) + garcSeqTuple
03225     if gnode.downAEQ() != None:
03226       return (1, garcSeqTuple)
03227     else:
03228       return (0, garcSeqTuple)
03229
03230   elif gnode.__class__.__name__ == 'GARC':
03231     garcChildren = gnode.AFE.keys()
03232     garcChildren = tuple(garcChildren)
03233     return garcChildren
03234   else:
03235     log.warn("%s: Unhandled node: %s" % (fn, gnode.__class__.__name__ ))
03236     return None
03237
03238 def uncompressSequence(seqStr, sepChar=','):
03239   l = []
03240   s = seqStr.split(sepChar)
03241   for x in s:
03242     x = x.strip()
03243     p = x.find('-')
03244     if p == -1:
03245       if x == '*':
03246         l.append(255)
03247       elif x != '':
03248         l.append(int(x))
03249     else:
03250       fNum = int(x[0:p])
03251       tNum = int(x[p+1:])
03252       l += range(fNum, tNum+1)
03253   return l
03254
03255 def compressSequence(idTuple, sepChar=','):
03256   fromId = -1
03257   toId = -1
03258   idStr = ''
03259   for idVal in idTuple:
03260     if fromId == -1:
03261       fromId = idVal
03262       toId = idVal
03263     elif (idVal - toId) == 1:
03264       toId = idVal
03265     else:
03266       if idStr != '':
03267         idStr += sepChar
03268       if fromId == toId:
03269         idStr += str(fromId)
03270       elif (toId - fromId) == 1:
03271         idStr += str(fromId) + sepChar + str(toId)
03272       else:
03273         idStr += str(fromId) + "-" + str(toId)
03274       fromId = idVal
03275       toId = idVal
03276   if idStr != '':
03277     idStr += sepChar
03278   if fromId == toId:
03279     if fromId == 255: fromId = '*'
03280     idStr += str(fromId)
03281   elif (toId - fromId) == 1:
03282     idStr += str(fromId) + sepChar + str(toId)
03283   else:
03284     idStr += str(fromId) + "-" + str(toId)
03285   return idStr
03286
03287 # Currently does not work for Domlette, use Ft.Xml.Domlette.PrettyPrint instead.
03288 # copied and modified from Python/Lib/xml/dom/minidom.py
03289 # With the default routine the text nodes were being written
03290 # on a separate line. Now they are on the same line as their parent tags.
03291 def toPrettyXML(doc, writer, indent="\t", newl="\n", encoding = None):
03292   # indent = the indentation string to prepend, per level
03293   # newl = the newline string to append
03294   if encoding is not None:
03295     import codecs
03296     # Can't use codecs.getwriter to preserve 2.0 compatibility
03297     writer = codecs.lookup(encoding)[3](writer)
03298     writer.write('<?xml version="1.0" encoding="%s"?>\n' % encoding)
03299   else:
03300     writer.write('<?xml version="1.0" ?>\n')
03301   if doc.nodeType == Node.ELEMENT_NODE:
03302     writeXML(doc, writer, indent="",addindent="  ",newl="\n")
03303   else:
03304     for node in doc.childNodes:
03305       if (node.nodeType == Node.TEXT_NODE and \
03306         (node.data[0] == '\n' or node.data[0].strip() == '')):
03307         pass
03308       elif node.nodeType == Node.ELEMENT_NODE:
03309         writeXML(node, writer, indent="",addindent=indent,newl=newl)
03310       else:
03311         node.writexml(writer, indent="",addindent=indent,newl=newl)
03312
03313 # copied and modified from Python/Lib/xml/dom/minidom.py
03314 def writeXML(n, writer, indent="", addindent="", newl=""):
03315   # indent = current indentation
03316   # addindent = indentation to add to higher levels
03317   # newl = newline string
03318   writer.write(indent+"<" + n.tagName)
03319
03320   #attrs = n._get_attributes()
03321   a_names = [x.name for x in n.attributes.values()]
03322   a_names.sort()
03323
03324   for a_name in a_names:
03325     writer.write(" %s=\"" % a_name)
03326     _write_data(writer, getAttribute(n, a_name))
03327     writer.write("\"")
03328   if n.childNodes:
03329     if len(n.childNodes) == 1 and n.childNodes[0].nodeType == Node.TEXT_NODE:
03330       node = n.childNodes[0]
03331       writer.write(">")
03332       node.writexml(writer,"",addindent,"")
03333       writer.write("</%s>%s" % (n.tagName,newl))
03334     else:
03335       writer.write(">%s"%(newl))
03336       for node in n.childNodes:
03337         if (node.nodeType == Node.TEXT_NODE and \
03338            (node.data[0] == '\n' or node.data[0].strip() == '')):
03339           pass
03340         elif node.nodeType == Node.ELEMENT_NODE:
03341           writeXML(node,writer,indent+addindent,addindent,newl)
03342         else:
03343           node.writexml(writer,indent+addindent,addindent,newl)
03344       writer.write("%s</%s>%s" % (indent,n.tagName,newl))
03345   else:
03346       writer.write("/>%s"%(newl))
03347
03348 # copied from Python/Lib/xml/dom/minidom.py
03349 def _write_data(writer, data):
03350   "Writes datachars to writer."
03351   data = data.replace("&", "&amp;").replace("<", "&lt;")
03352   data = data.replace("\"", "&quot;").replace(">", "&gt;")
03353   writer.write(data)
03354
03355 class ConfigElement(object):
03356   """\brief Wrapper class for providing a compatibility layer
03357   between the old minidom XML DOMs and the new 4Suite Domlette
03358   DOMs.
03359
03360   """
03361   def __init__(self, domletteElement):
03362     self.__dElement = domletteElement
03363
03364   def getAttribute(self, attr):
03365     return self.__dElement.getAttributeNS(LAT_NAMESPACE, attr)
03366
03367   def getElementsByTagName(self, tagName):
03368     if self.__dElement.tagName == tagName:
03369       found = [ConfigElement(self.__dElement)]
03370     else:
03371       found = []
03372     return found + self.__getElementsByTagName(self.__dElement, tagName)
03373
03374   def __getElementsByTagName(self, elem, tagName):
03375     found = []
03376     for n in getChildNodes(elem):
03377       if n.tagName == tagName:
03378         found.append(ConfigElement(n))
03379       found += self.__getElementsByTagName(n, tagName)
03380     return found
03381
03382   def __getattr__(self, attr):
03383     if attr == 'childNodes':
03384       return map(ConfigElement, getChildNodes(self.__dElement))
03385     else:
03386       return getattr(self.__dElement, attr)
03387
03388
03389 # Registry dictionary to allow readSchema to read non locally defined
03390 # objects.  (Example GHSK)
03391 # Usage:  gSCprocessRegistry['GHSK']=processGHSK
03392 gSCprocessRegistry = {
03393   'GLAT'   :    processGLAT,
03394   'GXBRD'  :    processGXBRD,
03395 }
03396
03397
Generated on Fri Jul 21 13:26:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gSIU.py Source File

database

gSIU.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Node which describes a Spacecraft Interface Unit"
00013 __author__  = "A. Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = ("$Date: 2004/12/05 21:09:12 $").split(' ')[1]
00015 __version__ = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__ = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import gDb
00022
00023 class GSIU(gDb.Gdb):
00024   """\brief SIU node.
00025   """
00026   __attrs = []
00027
00028   def __init__(self, client, parent, id):
00029     """\brief Initialize valid registers as Gattrs.
00030     """
00031     addr = gDb.Lem.ADDR_MASTER | (id+1)
00032     flags = {'CmdrspFabric'  : 'On',
00033              'EventFabric'   : 'On',
00034              'UseSecMainFeed': False,
00035              'PowerPdu0'     : False,
00036              'PowerPdu1'     : False,
00037              'PowerPrimDab'  : False,
00038              'PowerSecDab'   : False}
00039     gDb.Gdb.__init__(self, client, parent, id, self.__attrs, addr, flags)
00040
Generated on Fri Jul 21 13:26:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gSocket.py Source File

client

gSocket.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Socket class"
00013 __author__   = "Amedeo Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2005/10/28 22:02:14 $").split(' ')[1]
00015 __version__  = "$Revision: 2.13 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import socket
00022 import threading
00023 import logging as log
00024
00025 class Socket(object):
00026   __TIMEOUT = 5
00027
00028   def __init__(self, portnumber):
00029     self.__port = portnumber
00030     self.__sock = None
00031     self.__host = None
00032     self.__lock = threading.Lock()
00033
00034   def connect(self, host):
00035     if host is None:
00036       raise RuntimeError, 'gSocket: host server name not specified'
00037     try:
00038       self.__sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
00039       self.__sock.settimeout(Socket.__TIMEOUT)  # TMOs are not handled correctly
00040       self.__sock.connect((host, self.__port))
00041       self.__host = host
00042     except socket.error, msg:
00043       self.disconnect()
00044       raise RuntimeError, \
00045             'gSocket: unable to connect to %s on port %d: %s' \
00046             %(host, self.__port, str(msg))
00047     ss = 2*1024*1024
00048     self.__sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, ss)
00049
00050   def disconnect(self):
00051     if self.isConnected():
00052       self.__sock.close()
00053       self.__sock = None
00054
00055   def isConnected(self):
00056     return (self.__sock is not None)
00057
00058   def socket(self):
00059     return self.__sock
00060
00061   def setSocket(self, sock):
00062     self.__sock = sock
00063
00064   def port(self):
00065     return self.__port
00066
00067   def setPort(self, port):
00068     self.__port = port
00069
00070   def lock(self):
00071     self.__lock.acquire()
00072
00073   def release(self):
00074     self.__lock.release()
00075
00076   def gettimeout(self):
00077     return self.__sock.gettimeout()
00078
00079   def settimeout(self, seconds):
00080     self.__sock.settimeout(seconds)
00081
00082   def send(self, packet):
00083     return self.__sock.send(packet)
00084
00085   def recv(self, size):
00086     return self.__sock.recv(size)
00087
00088   def sendall(self, packet):
00089     return self.__sock.sendall(packet)
00090
00091   def recvall(self, size):
00092     # The following is not supported on Windows, at least.
00093     # return self.__sock.recv(size, socket.MSG_WAITALL)
00094
00095     data = ''
00096     remaining = size
00097     sock = self.__sock
00098     count = 0
00099     while remaining > 0:
00100       try:
00101         received = sock.recv(remaining)
00102         reclen = len(received)
00103         # When a recv returns 0 bytes, other side has closed
00104         if reclen == 0: return received
00105         remaining -= reclen
00106         data += received
00107       except socket.error, e:
00108         if str(e) != "timed out": raise # Throw away "timed out" exceptions
00109         log.warn("Exception seen in recvall: %s" % str(e))
00110         if count > 5:
00111           raise
00112         count += 1
00113     return data
00114
00115   def purge(self):
00116     """\brief Purge all stale data out of the socket.
00117     """
00118     max  = 64*1024
00119     sock = self.__sock
00120     tmo  = sock.gettimeout()
00121     size = 0
00122     sock.settimeout(0.1)
00123     try:
00124       # While loop will break on exception
00125       while True:
00126         received = sock.recv(max)
00127         # When a recv returns 0 bytes, other side has closed
00128         reclen = len(received)
00129         if reclen == 0:
00130           break
00131         size += reclen
00132     except socket.error, e:
00133       if str(e) != "timed out":  raise # Throw away "timed out" exceptions
00134     sock.settimeout(tmo)
00135     return size
Generated on Fri Jul 21 13:26:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gTEM.py Source File

database

gTEM.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "GLAST TEM functional block hierarchy"
00013 __author__  = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = ("$Date: 2005/10/20 02:35:43 $").split(' ')[1]
00015 __version__ = "$Revision: 2.27 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__ = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import struct
00022 import time
00023 import gDb
00024 import gAttr
00025 import LATTE.client.gRegister  as gRegister
00026 import LATTE.client.gException as gException
00027
00028 #  TEM{}
00029 #   |
00030 #   |----------------
00031 #   |       |       |
00032 #  TIC     CCC{}   TCC{}
00033 #           |       |
00034 #          CRC{}   TRC{}
00035 #           |       |
00036 #          CFE{}   TFE{}
00037
00038
00039 class GTEM(gDb.Gdb):
00040   """\brief TEM node Record
00041
00042   Valid Registers:
00043   - \c configuration
00044   - \c data_masks
00045   - \c status
00046   - \c command_response
00047   - \c tkr_trgseq
00048   - \c cal_trgseq
00049   - \c address
00050
00051   Dataless Commands:
00052   - \c cmd_reset
00053   - \c cmd_look_at_me
00054
00055   """
00056   __attrs = [
00057     # Registers
00058     gAttr.GattrRaw('configuration',     0, 4),
00059     gAttr.GattrRaw('data_masks',        1, 4),
00060     gAttr.GattrRaw('status',            2, 4),
00061     gAttr.GattrRaw('command_response',  3, 4),
00062     gAttr.GattrRaw('tkr_trgseq',        4, 4),
00063     gAttr.GattrRaw('cal_trgseq',        5, 4),
00064     gAttr.GattrRaw('address',           6, 4),
00065     # Dataless Commands
00066     gAttr.GattrDlc('cmd_reset',         1),
00067     gAttr.GattrDlc('cmd_look_at_me',    9)
00068     ]
00069
00070   def __init__(self, client, parent, id):
00071     """\brief Initialize valid registers as Gattrs.
00072
00073     Assign default values to members
00074     """
00075
00076     # As stated in LTE-322, using ADDR_SLV_BCAST for a TEM broadcast
00077     # is dangerous therefore if the parent TEM is a broadcast node
00078     # the read and send methods are redefined so that we loop
00079     # over each TEM defined in the schema
00080     if id == gDb.Children.BCASTID:
00081       self.read = None
00082       self.load = self.__bcast_load
00083       self.send = self.__bcast_send
00084
00085     if id < gDb.Lem.NTEMS:
00086       addr = gDb.Lem.ADDR_TEM_BASE+id
00087     elif id == gDb.Children.BCASTID:
00088       addr = gDb.Lem.ADDR_SLV_BCAST
00089     else:
00090       raise KeyError("*** gTEM: GTEM id %d is invalid" %(id))
00091     self.CCC = gDb.Children(self, GCCC)
00092     self.TCC = gDb.Children(self, GTCC)
00093     self.TIC = None
00094     flags = {'CmdrspFabric': 'On',
00095              'EventFabric' : 'On',
00096              'UsePdu1'     : False}
00097     gDb.Gdb.__init__(self, client, parent, id, self.__attrs, addr, flags)
00098
00099   def read(self, reg):
00100     return self.cmdrsp('TEM_read', self.addr(), reg, '!I')
00101
00102   def load(self, reg, value):
00103     # If you modify this method, change __bcast_load as well
00104     return self.cmdrsp('TEM_load', self.addr(), reg, value)
00105
00106   def send(self, cmd):
00107     # If you modify this method, change __bcast_send as well
00108     if cmd == 9:
00109       return self.cmdrsp('LookAtMe', self.addr())
00110     else:
00111       return self.cmdrsp('TEM_cmd', self.addr(), cmd)
00112
00113   def __bcast_load(self, reg, value):
00114     for temId in self.up().TEM:
00115       rsp = self.cmdrsp('TEM_load', gDb.Lem.ADDR_TEM_BASE+temId, reg, value)
00116       if rsp.status() != 0: break
00117     return rsp
00118
00119   def __bcast_send(self, cmd):
00120     for temId in self.up().TEM:
00121       if cmd == 9:
00122         rsp = self.cmdrsp('LookAtMe', gDb.Lem.ADDR_TEM_BASE+temId)
00123       else:
00124         rsp = self.cmdrsp('TEM_cmd', gDb.Lem.ADDR_TEM_BASE+temId, cmd)
00125       if rsp.status() != 0: break
00126     return rsp
00127
00128   def downCCC(self, childId):
00129     """\brief Navigate to the GCCC indicated by \a childId
00130
00131     \param  childId The id of the child GCCC
00132
00133     \return         A GCCC object instance
00134     """
00135     return self.CCC.down(childId)
00136
00137   def downTCC(self, childId):
00138     """\brief Navigate to the GTCC indicated by \a childId
00139
00140     \param  childId The id of the child GTCC
00141
00142     \return         A GTCC object instance
00143     """
00144     return self.TCC.down(childId)
00145
00146   def allCCC(self):
00147     """\brief Navigate to the broadcast GCCC
00148
00149     \return         The broadcast GCCC object instance
00150     """
00151     return self.CCC.all()
00152
00153   def allTCC(self):
00154     """\brief Navigate to the broadcast GTCC
00155
00156     \return         The broadcast GTCC object instance
00157     """
00158     return self.TCC.all()
00159
00160   def CCCcnt(self):
00161     """\brief Return the GCCC count
00162
00163     \return Current GCCC count
00164     """
00165     return len(self.CCC)
00166
00167   def TCCcnt(self):
00168     """\brief Return the GTCC count
00169
00170     \return Current GTCC count
00171     """
00172     return len(self.TCC)
00173
00174   def downTIC(self):
00175     """\brief Navigate to the GTIC node
00176
00177     \return         The GTIC object instance
00178     """
00179     return self.TIC
00180
00181   def existsTIC(self):
00182     """\brief Check if the GTIC instance exists in the schema.
00183
00184     \return       1 if it exists, 0 if it doesn't.
00185     """
00186     return self.TIC != None
00187
00188   def existsCCC(self, cccId):
00189     """\brief Check if the GCCC instance with the id
00190     \a cccId exists in the schema.
00191
00192     \param  cccId Calorimeter cable controller id
00193
00194     \return       1 if it exists, 0 if it doesn't.
00195     """
00196     return self.CCC.exists(cccId)
00197
00198   def existsTCC(self, tccId):
00199     """\brief Check if the GTCC instance with the id
00200     \a tccId exists in the schema.
00201
00202     \param  tccId Tracker cable controller id
00203
00204     \return       1 if it exists, 0 if it doesn't.
00205     """
00206     return self.TCC.exists(tccId)
00207
00208
00209 ## private:
00210   def __removeCCC(self, cccId):
00211     self.CCC.remove(cccId)
00212
00213   def __addCCC(self, cccId):
00214     return self.CCC.add(cccId)
00215
00216   def __removeTCC(self, tccId):
00217     self.TCC.remove(tccId)
00218
00219   def __addTCC(self, tccId):
00220     return self.TCC.add(tccId)
00221
00222   def __removeTIC(self):
00223     self.TIC = None
00224
00225   def __addTIC(self):
00226     self.TIC = GTIC(self.client(), self)
00227     return self.TIC
00228
00229
00230 class GCCC(gDb.Gdb):
00231   """\brief Calorimeter Cable Controller node Record.
00232
00233   Has GCCC specific registers and dataless commands.
00234
00235   Valid Registers:
00236   - \c configuration
00237   - \c layer_mask_0
00238   - \c layer_mask_1
00239   - \c fifo_status
00240   - \c latched_status
00241   - \c event_timeouts
00242   - \c trg_alignment
00243
00244   Dataless Commands:
00245   - \c cmd_nop
00246   - \c cmd_reset
00247
00248   """
00249   __attrs = [
00250     # Registers
00251     gAttr.GattrRaw('configuration',   0, 4),
00252     gAttr.GattrRaw('layer_mask_0',    1, 4),
00253     gAttr.GattrRaw('layer_mask_1',    2, 4),
00254     gAttr.GattrRaw('fifo_status',     3, 4),
00255     gAttr.GattrRaw('latched_status',  4, 4),
00256     gAttr.GattrRaw('event_timeouts',  5, 4),
00257     gAttr.GattrRaw('trg_alignment',   6, 4),
00258     # Dataless Commands
00259     gAttr.GattrDlc('cmd_nop',         0, 0),
00260     gAttr.GattrDlc('cmd_reset',       1, 0)
00261     ]
00262
00263   def __init__(self, client, parent, id):
00264     """\brief Initialize valid registers as Gattrs.
00265
00266     Assign default values to members
00267     """
00268
00269     # As stated in LTE-322, using ADDR_SLV_BCAST for a TEM broadcast
00270     # is dangerous therefore if the parent TEM is a broadcast node
00271     # the read and send methods are redefined so that we loop
00272     # over each TEM defined in the schema
00273     if parent.id() == gDb.Children.BCASTID:
00274       self.read = None
00275       self.load = self.__bcast_load
00276       self.send = self.__bcast_send
00277
00278     if id < gDb.Lem.NCCCS:
00279       addr = id
00280     elif id == gDb.Children.BCASTID:
00281       addr = gDb.Lem.CCCBCAST
00282     else:
00283       raise KeyError("*** gTEM: GCCC id %d is invalid" %(id))
00284     self.CRC = gDb.Children(self, GCRC)
00285     gDb.Gdb.__init__(self, client, parent, id, self.__attrs, addr)
00286
00287   def read(self, reg):
00288     return self.cmdrsp('CCC_read', self.up().addr(), self.addr(), reg, '!I')
00289
00290   def load(self, reg, value):
00291     # If you modify this method, change __bcast_load as well
00292     return self.cmdrsp('CCC_load', self.up().addr(), self.addr(), reg, value)
00293
00294   def send(self, cmd):
00295     # If you modify this method, change __bcast_send as well
00296     return self.cmdrsp('CCC_cmd', self.up().addr(), self.addr(), cmd)
00297
00298   def __bcast_load(self, reg, value):
00299     for temId in self.up().up().TEM:
00300       rsp = self.cmdrsp('CCC_load', gDb.Lem.ADDR_TEM_BASE+temId, self.addr(), reg, value)
00301       if rsp.status() != 0: break
00302     return rsp
00303
00304   def __bcast_send(self, cmd):
00305     for temId in self.up().up().TEM:
00306       rsp = self.cmdrsp('CCC_cmd', gDb.Lem.ADDR_TEM_BASE+temId, self.addr(), cmd)
00307       if rsp.status() != 0: break
00308     return rsp
00309
00310   def downCRC(self, childId):
00311     """\brief Navigate to the GCRC indicated by \a childId
00312
00313     \param  childId The id of the child GCRC
00314
00315     \return         A GCRC object instance
00316     """
00317     return self.CRC.down(childId)
00318
00319   def allCRC(self):
00320     """\brief Navigate to the broadcast GCRC
00321
00322     \return The broadcast GCRC object instance
00323     """
00324     return self.CRC.all()
00325
00326   def existsCRC(self, crcId):
00327     """\brief Check if the GCRC instance with the id
00328     \a crcId exists in the schema.
00329
00330     \param  crcId Calorimeter readout controller id
00331
00332     \return       1 if it exists, 0 if it doesn't.
00333     """
00334     return self.CRC.exists(crcId)
00335
00336 ## private:
00337   def __removeCRC(self, rcrId):
00338     self.CRC.remove(rcrId)
00339
00340   def __addCRC(self, rcrId):
00341     return self.CRC.add(rcrId)
00342
00343
00344 class GCRC(gDb.Gdb):
00345   """\brief Calorimeter Readout Controller node Record.
00346
00347   Has GCRC specific registers and dataless commands.
00348
00349   Valid Registers:
00350   - \c csr
00351   - \c last_cmd
00352   - \c delay_1
00353   - \c delay_2
00354   - \c delay_3
00355   - \c dac
00356   - \c config
00357
00358   Dataless Commands:
00359   - \c cmd_nop
00360   - \c cmd_reset
00361   - \c cmd_calstrobe
00362                  ]
00363
00364   """
00365   __attrs = [
00366     # Registers
00367     gAttr.GattrRaw('csr',              0, 2),
00368     gAttr.GattrRaw('last_cmd',         1, 2),
00369     gAttr.GattrRaw('delay_1',          3, 2),
00370     gAttr.GattrRaw('delay_2',          4, 2),
00371     gAttr.GattrRaw('delay_3',          5, 2),
00372     gAttr.GattrRaw('dac',              6, 2),
00373     gAttr.GattrRaw('config',           7, 2),
00374     # Dataless Commands
00375     gAttr.GattrDlc('cmd_nop',          0, 0),
00376     gAttr.GattrDlc('cmd_reset',        1, 0),
00377     gAttr.GattrDlc('cmd_calstrobe',    3, 0)
00378     ]
00379
00380   def __init__(self, client, parent, id):
00381     """\brief Initialize valid registers as Gattrs.
00382
00383     Assign default values to members
00384     """
00385
00386     # As stated in LTE-322, using ADDR_SLV_BCAST for a TEM broadcast
00387     # is dangerous therefore if the parent TEM is a broadcast node
00388     # the read and send methods are redefined so that we loop
00389     # over each TEM defined in the schema
00390     if parent.up().id() == gDb.Children.BCASTID:
00391       self.read = None
00392       self.load = self.__bcast_load
00393       self.send = self.__bcast_send
00394
00395     if id < gDb.Lem.NCRCS:
00396       addr = id
00397     elif id == gDb.Children.BCASTID:
00398       addr = gDb.Lem.CRCBCAST
00399     else:
00400       raise KeyError("*** gTEM: GCRC id %d is invalid" %(id))
00401     self.CFE = gDb.Children(self, GCFE)
00402     gDb.Gdb.__init__(self, client, parent, id, self.__attrs, addr)
00403
00404   def read(self, reg):
00405     return self.cmdrsp('CRC_read', self.up().up().addr(), self.up().addr(), self.addr(), reg, '!I')
00406
00407   def load(self, reg, value):
00408     # If you modify this method, change __bcast_load as well
00409     return self.cmdrsp('CRC_load', self.up().up().addr(), self.up().addr(), self.addr(), reg, value)
00410
00411   def send(self, cmd):
00412     # If you modify this method, change __bcast_send as well
00413     return self.cmdrsp('CRC_cmd', self.up().up().addr(), self.up().addr(), self.addr(), cmd)
00414
00415   def __bcast_load(self, reg, value):
00416     for temId in self.up().up().up().TEM:
00417       rsp = self.cmdrsp('CRC_load', gDb.Lem.ADDR_TEM_BASE+temId, self.up().addr(), self.addr(), reg, value)
00418       if rsp.status() != 0: break
00419     return rsp
00420
00421   def __bcast_send(self, cmd):
00422     for temId in self.up().up().up().TEM:
00423       rsp = self.cmdrsp('CRC_cmd', gDb.Lem.ADDR_TEM_BASE+temId, self.up().addr(), self.addr(), cmd)
00424       if rsp.status() != 0: break
00425     return rsp
00426
00427   def downCFE(self, childId):
00428     """\brief Navigate to the GCFE indicated by \a childId
00429
00430     \param  childId The id of the child GCFE
00431
00432     \return         A GCFE object instance
00433     """
00434     return self.CFE.down(childId)
00435
00436   def allCFE(self):
00437     """\brief Navigate to the broadcast GCFE
00438
00439     \return The broadcast GCFE object instance
00440     """
00441     return self.CFE.all()
00442
00443   def existsCFE(self, cfeId):
00444     """\brief Check if the GCFE instance with the id
00445     \a cfeId exists in the schema.
00446
00447     \param  cfeId Calorimeter front-end id
00448
00449     \return       1 if it exists, 0 if it doesn't.
00450     """
00451     return self.CFE.exists(cfeId)
00452
00453 ## private:
00454
00455   def __removeCFE(self, cfeId):
00456     self.CFE.remove(cfeId)
00457
00458   def __addCFE(self, cfeId):
00459     return self.CFE.add(cfeId)
00460
00461
00462 class GCFE(gDb.Gdb):
00463   """\brief Calorimeter Front End node Record.
00464
00465   Has GCFE specific registers and dataless commands.
00466
00467   Valid Registers:
00468   - \c config_0
00469   - \c config_1
00470   - \c fle_dac
00471   - \c fhe_dac
00472   - \c log_acpt
00473   - \c rng_uld_dac
00474   - \c ref_dac
00475
00476   Dataless Commands:
00477   - \c cmd_nop
00478
00479   """
00480   __attrs = [
00481     # Registers
00482     gAttr.GattrRaw('config_0',    0, 2),
00483     gAttr.GattrRaw('config_1',    1, 2),
00484     gAttr.GattrRaw('fle_dac',     2, 2),
00485     gAttr.GattrRaw('fhe_dac',     3, 2),
00486     gAttr.GattrRaw('log_acpt',    4, 2),
00487     gAttr.GattrRaw('rng_uld_dac', 5, 2),
00488     gAttr.GattrRaw('ref_dac',     6, 2),
00489     # Dataless Commands
00490     gAttr.GattrDlc('cmd_nop',     0, 0)
00491     ]
00492
00493   def __init__(self, client, parent, id):
00494     """\brief Initialize valid registers as Gattrs
00495
00496     """
00497
00498     # As stated in LTE-322, using ADDR_SLV_BCAST for a TEM broadcast
00499     # is dangerous therefore if the parent TEM is a broadcast node
00500     # the read and send methods are redefined so that we loop
00501     # over each TEM defined in the schema
00502     if parent.up().up().id() == gDb.Children.BCASTID:
00503       self.read = None
00504       self.load = self.__bcast_load
00505       self.send = self.__bcast_send
00506
00507     if id < gDb.Lem.NCFES:
00508       addr = id
00509     elif id == gDb.Children.BCASTID:
00510       addr = gDb.Lem.CFEBCAST
00511     else:
00512       raise KeyError("*** gTEM: GCFE id %d is invalid" %(id))
00513     gDb.Gdb.__init__(self, client, parent, id, self.__attrs, addr)
00514
00515   def read(self, reg):
00516     return self.cmdrsp('CFE_read', self.up().up().up().addr(), self.up().up().addr(), self.up().addr(), self.addr(), reg, '!I')
00517
00518   def load(self, reg, value):
00519     # If you modify this method, change __bcast_load as well
00520     return self.cmdrsp('CFE_load', self.up().up().up().addr(), self.up().up().addr(), self.up().addr(), self.addr(), reg, value)
00521
00522   def send(self, cmd):
00523     # If you modify this method, change __bcast_send as well
00524     return self.cmdrsp('CFE_cmd', self.up().up().up().addr(), self.up().up().addr(), self.up().addr(), self.addr(), cmd)
00525
00526   def __bcast_load(self, reg, value):
00527     for temId in self.up().up().up().up().TEM:
00528       rsp = self.cmdrsp('CFE_load', gDb.Lem.ADDR_TEM_BASE+temId, self.up().up().addr(), self.up().addr(), self.addr(), reg, value)
00529       if rsp.status() != 0: break
00530     return rsp
00531
00532   def __bcast_send(self, cmd):
00533     for temId in self.up().up().up().up().TEM:
00534       rsp = self.cmdrsp('CFE_cmd', gDb.Lem.ADDR_TEM_BASE+temId, self.up().up().addr(), self.up().addr(), self.addr(), cmd)
00535       if rsp.status() != 0: break
00536     return rsp
00537
00538 class GTCC(gDb.Gdb):
00539   """\brief Tracker Cable Controller node record.
00540
00541   Has GTCC specific registers and dataless commands.
00542
00543   Valid Registers:
00544   - \c configuration
00545   - \c input_mask
00546   - \c fifo_status
00547   - \c latched_status
00548   - \c event_timeouts
00549   - \c trg_alignment
00550
00551   Dataless Commands:
00552   - \c cmd_nop
00553   - \c cmd_reset
00554
00555   """
00556   __attrs = [
00557     # Registers
00558     gAttr.GattrRaw('configuration',   0, 4),
00559     gAttr.GattrRaw('input_mask',      1, 4),
00560     gAttr.GattrRaw('fifo_status',     2, 4),
00561     gAttr.GattrRaw('latched_status',  3, 4),
00562     gAttr.GattrRaw('event_timeouts',  4, 4),
00563     gAttr.GattrRaw('trg_alignment',   5, 4),
00564     # Dataless Commands
00565     gAttr.GattrDlc('cmd_nop',         0, 0, gAttr.REG_WRITE_ONLY),
00566     gAttr.GattrDlc('cmd_reset',       1, 0, gAttr.REG_WRITE_ONLY)
00567     ]
00568
00569   def __init__(self, client, parent, id):
00570     """\brif Initialize valid registers as Gattrs.
00571
00572     Assign default values to members
00573     """
00574
00575     # As stated in LTE-322, using ADDR_SLV_BCAST for a TEM broadcast
00576     # is dangerous therefore if the parent TEM is a broadcast node
00577     # the read and send methods are redefined so that we loop
00578     # over each TEM defined in the schema
00579     if parent.id() == gDb.Children.BCASTID:
00580       self.read = None
00581       self.load = self.__bcast_load
00582       self.send = self.__bcast_send
00583
00584     if id < gDb.Lem.NTCCS:
00585       addr = id
00586     elif id == gDb.Children.BCASTID:
00587       addr = gDb.Lem.TCCBCAST
00588     else:
00589       raise KeyError("*** gTEM: GTCC id %d is invalid" %(id))
00590     self.TRC = gDb.Children(self, GTRC)
00591     gDb.Gdb.__init__(self, client, parent, id, self.__attrs, addr)
00592
00593   def read(self, reg):
00594     return self.cmdrsp('TCC_read', self.up().addr(), self.addr(), reg, '!I')
00595
00596   def load(self, reg, value):
00597     # If you modify this method, change __bcast_load as well
00598     return self.cmdrsp('TCC_load', self.up().addr(), self.addr(), reg, value)
00599
00600   def send(self, cmd):
00601     # If you modify this method, change __bcast_send as well
00602     return self.cmdrsp('TCC_cmd', self.up().addr(), self.addr(), cmd)
00603
00604   def __bcast_load(self, reg, value):
00605     for temId in self.up().up().TEM:
00606       rsp = self.cmdrsp('TCC_load', gDb.Lem.ADDR_TEM_BASE+temId, self.addr(), reg, value)
00607       if rsp.status() != 0: break
00608     return rsp
00609
00610   def __bcast_send(self, cmd):
00611     for temId in self.up().up().TEM:
00612       rsp = self.cmdrsp('TCC_cmd', gDb.Lem.ADDR_TEM_BASE+temId, self.addr(), cmd)
00613       if rsp.status() != 0: break
00614     return rsp
00615
00616   def downTRC(self, childId):
00617     """\brief Navigate to the GTRC indicated by \a childId
00618
00619     \param  childId The id of the child GTRC
00620
00621     \return         A GTRC object instance
00622     """
00623     return self.TRC.down(childId)
00624
00625   def allTRC(self):
00626     """\brief Navigate to the broadcast GTRC
00627
00628     \return The broadcast GTRC object instance
00629     """
00630     return self.TRC.all()
00631
00632   def existsTRC(self, trcId):
00633     """\brief Check if the GTRC instance with the id
00634     \a trcId exists in the schema.
00635
00636     \param  trcId Tracker readout controller id
00637
00638     \return       1 if it exists, 0 if it doesn't.
00639     """
00640     return self.TRC.exists(trcId)
00641
00642 ## private:
00643
00644   def __removeTRC(self, trcId):
00645     self.TRC.remove(trcId)
00646
00647   def __addTRC(self, trcId):
00648     return self.TRC.add(trcId)
00649
00650
00651 class GTRC(gDb.Gdb):
00652   """\brief Tracker Readout Controller node Record.
00653
00654   Has GTRC specific registers and dataless commands.
00655
00656   Valid Registers:
00657   - \c csr
00658   - \c sync
00659
00660   Dataless Commands:
00661   - \c cmd_nop
00662   - \c cmd_reset
00663
00664   """
00665   __attrs = [
00666     # Registers
00667     gAttr.GattrRaw('csr',       0, 8),
00668     gAttr.GattrRaw('sync',      1, 8),
00669     # Dataless Commands
00670     gAttr.GattrDlc('cmd_nop',   0, 0),
00671     gAttr.GattrDlc('cmd_reset', 1, 0)
00672     ]
00673
00674   def __init__(self, client, parent, id):
00675     """\brief Initialize valid registers as Gattrs.
00676
00677     Assign default values to members
00678     """
00679
00680     # As stated in LTE-322, using ADDR_SLV_BCAST for a TEM broadcast
00681     # is dangerous therefore if the parent TEM is a broadcast node
00682     # the read and send methods are redefined so that we loop
00683     # over each TEM defined in the schema
00684     if parent.up().id() == gDb.Children.BCASTID:
00685       self.read = None
00686       self.load = self.__bcast_load
00687       self.send = self.__bcast_send
00688
00689     if id < gDb.Lem.NTRCS:
00690       addr = id
00691     elif id == gDb.Children.BCASTID:
00692       addr = gDb.Lem.TRCBCAST
00693     else:
00694       raise KeyError("*** gTEM: GTRC id %d is invalid" %(id))
00695     self.TFE = gDb.Children(self, GTFE)
00696     gDb.Gdb.__init__(self, client, parent, id, self.__attrs, addr)
00697
00698   def read(self, reg):
00699     rsp = self.cmdrsp('TRC_read', self.up().up().addr(), self.up().addr(), self.addr(), reg, '!I', '!I')
00700     timestamp = rsp.timestamp()
00701     status    = rsp.status()
00702     payloads  = (rsp.payloads()[1], rsp.payloads()[0])
00703     return gRegister.Register(timestamp, status, payloads, 'II')
00704
00705   def load(self, reg, value):
00706     # If you modify this method, change __bcast_load as well
00707     [lower, upper] = struct.unpack('II', struct.pack('Q', value))
00708     return self.cmdrsp('TRC_load', self.up().up().addr(), self.up().addr(), self.addr(), reg, upper, lower)
00709
00710   def send(self, cmd):
00711     # If you modify this method, change __bcast_send as well
00712     return self.cmdrsp('TRC_cmd', self.up().up().addr(), self.up().addr(), self.addr(), cmd)
00713
00714   def __bcast_load(self, reg, value):
00715     [lower, upper] = struct.unpack('II', struct.pack('Q', value))
00716     for temId in self.up().up().up().TEM:
00717       rsp = self.cmdrsp('TRC_load', gDb.Lem.ADDR_TEM_BASE+temId, self.up().addr(), self.addr(), reg, upper, lower)
00718       if rsp.status() != 0: break
00719     return rsp
00720
00721   def __bcast_send(self, cmd):
00722     for temId in self.up().up().up().TEM:
00723       rsp = self.cmdrsp('TRC_cmd', gDb.Lem.ADDR_TEM_BASE+temId, self.up().addr(), self.addr(), cmd)
00724       if rsp.status() != 0: break
00725     return rsp
00726
00727   def downTFE(self, childId):
00728     """\brief Navigate to the GTFE indicated by \a childId
00729
00730     \param  childId The id of the child GTFE
00731
00732     \return         A GTFE object instance
00733     """
00734     return self.TFE.down(childId)
00735
00736   def allTFE(self):
00737     """\brief Navigate to the broadcast GTFE
00738
00739     \return The broadcast GTFE object instance
00740     """
00741     return self.TFE.all()
00742
00743   def existsTFE(self, tfeId):
00744     """\brief Check if the GTFE instance with the id
00745     \a tfeId exists in the schema.
00746
00747     \param  tfeId Tracker front-end id
00748
00749     \return       1 if it exists, 0 if it doesn't.
00750     """
00751     return self.TFE.exists(tfeId)
00752
00753   def getNoisyChannelsByMask(self, mask, feId=None):
00754     """\brief Get the noisy channels for this RC or for a specific FE
00755     belonging to this RC based on the mask provided.
00756
00757     \param  mask  A string containing one of 'calib', 'data' or 'trig'
00758     \param  feId  Front-end id.
00759
00760     \return      If \a feId is None return a list of noisy channels.
00761                  If \a feId is not None return a bitmap of noisy channels.
00762     """
00763     LAYER_CC_PAIRS = {0:(0,1), 1:(0,1), 2:(3,2), 3:(3,2), 4:(5,4),
00764                       5:(5,4), 6:(6,7), 7:(6,7)
00765                      }
00766     tcc = self.up()
00767     tem = tcc.up()
00768     lat = tem.up()
00769     key = (tem.id(),LAYER_CC_PAIRS[tcc.id()]+(self.id(),))
00770     if key in lat._GLAT__noisyChannels[mask]:
00771       chList = lat._GLAT__noisyChannels[mask][key].getOnBits()
00772       if feId is not None:
00773         mask = 0L
00774         for ch in chList:
00775           chFE = ch / 64
00776           if chFE == feId:
00777             mask |= 1L << (ch % 64)
00778         return mask
00779       else:
00780         return chList
00781     else:
00782       if feId is not None:
00783         return 0L
00784       else:
00785         return []
00786
00787
00788   def getNoisyChannels(self, feId=None, calib=True, data=True, trig=True):
00789     """\brief Get the noisy channels for this RC or for a specific FE
00790     belonging to this RC.
00791
00792     \param  feId  Front-end id.
00793     \param  calib Flag indicating whether calib mask noisy channels
00794                   should be included.
00795     \param  data  Flag indicating whether data mask noisy channels
00796                   should be included.
00797     \param  trig  Flag indicating whether trigger mask noisy channels
00798                   should be included.
00799
00800     \return      If \a feId is None return a list of noisy channels.
00801                  If \a feId is not None return a bitmap of noisy channels.
00802     """
00803     if feId is None:
00804       calibChan = []
00805       dataChan  = []
00806       trigChan  = []
00807     else:
00808       calibChan = 0L
00809       dataChan  = 0L
00810       trigChan  = 0L
00811
00812     if calib:
00813       calibChan = self.getNoisyChannelsByMask('calib', feId)
00814     if data:
00815       dataChan  = self.getNoisyChannelsByMask( 'data', feId)
00816     if trig:
00817       trigChan  = self.getNoisyChannelsByMask( 'trig', feId)
00818
00819     if feId is None:
00820       chanList = []
00821       for maskList in (calibChan, dataChan, trigChan):
00822         for chan in maskList:
00823           if chan not in chanList:
00824             chanList.append(chan)
00825       return chanList
00826     else:
00827       return calibChan | dataChan | trigChan
00828
00829   def getDeadChannelsByMask(self, mask, feId=None):
00830     """\brief Get the dead channels for this RC or for a specific FE
00831     belonging to this RC based on the mask provided.
00832
00833     \param  mask  A string containing one of 'calib', 'data' or 'trig'
00834     \param  feId  Front-end id.
00835
00836     \return      If \a feId is None return a list of dead channels.
00837                  If \a feId is not None return a bitmap of dead channels.
00838     """
00839     LAYER_CC_PAIRS = {0:(0,1), 1:(0,1), 2:(3,2), 3:(3,2), 4:(5,4),
00840                       5:(5,4), 6:(6,7), 7:(6,7)
00841                      }
00842     tcc = self.up()
00843     tem = tcc.up()
00844     lat = tem.up()
00845     key = (tem.id(),LAYER_CC_PAIRS[tcc.id()]+(self.id(),))
00846     if key in lat._GLAT__deadChannels[mask]:
00847       chList = lat._GLAT__deadChannels[mask][key].getOnBits()
00848       if feId is not None:
00849         mask = 0L
00850         for ch in chList:
00851           chFE = ch / 64
00852           if chFE == feId:
00853             mask |= 1L << (ch % 64)
00854         return mask
00855       else:
00856         return chList
00857     else:
00858       if feId is not None:
00859         return 0L
00860       else:
00861         return []
00862
00863
00864   def getDeadChannels(self, feId=None, calib=True, data=True, trig=True):
00865     """\brief Get the dead channels for this RC or for a specific FE
00866     belonging to this RC.
00867
00868     \param  feId Front-end id.
00869     \param  calib Flag indicating whether calib mask noisy channels
00870                   should be included.
00871     \param  data  Flag indicating whether data mask noisy channels
00872                   should be included.
00873     \param  trig  Flag indicating whether trigger mask noisy channels
00874                   should be included.
00875
00876     \return      If \a feId is None return a list of dead channels.
00877                  If \a feId is not None return a bitmap of dead channels.
00878     """
00879     if feId is None:
00880       calibChan = []
00881       dataChan  = []
00882       trigChan  = []
00883     else:
00884       calibChan = 0L
00885       dataChan  = 0L
00886       trigChan  = 0L
00887
00888     if calib:
00889       calibChan = self.getDeadChannelsByMask('calib', feId)
00890     if data:
00891       dataChan  = self.getDeadChannelsByMask( 'data', feId)
00892     if trig:
00893       trigChan  = self.getDeadChannelsByMask( 'trig', feId)
00894
00895     if feId is None:
00896       chanList = []
00897       for maskList in (calibChan, dataChan, trigChan):
00898         for chan in maskList:
00899           if chan not in chanList:
00900             chanList.append(chan)
00901       return chanList
00902     else:
00903       return calibChan | dataChan | trigChan
00904
00905
00906 ## private:
00907
00908   def __removeTFE(self, tfeId):
00909     self.TFE.remove(tfeId)
00910
00911   def __addTFE(self, tfeId):
00912     return self.TFE.add(tfeId)
00913
00914
00915 class GTFE(gDb.Gdb):
00916   """\brief Tracker Front-End node Record.
00917
00918   Has GTFE specific registers and dataless commands.
00919
00920   Valid Registers:
00921   - \c data_mask
00922   - \c calib_mask
00923   - \c trig_mask
00924   - \c dac
00925   - \c mode
00926
00927   Dataless Commands:
00928   - \c cmd_nop
00929   - \c cmd_reset
00930   - \c cmd_calstrobe
00931   - \c cmd_readevent
00932
00933   """
00934   __attrs = [# Registers
00935     gAttr.GattrRaw('data_mask',       0, 8),
00936     gAttr.GattrRaw('calib_mask',      1, 8),
00937     gAttr.GattrRaw('trig_mask',       2, 8),
00938     gAttr.GattrRaw('dac',             3, 8),
00939     gAttr.GattrRaw('mode',            4, 8),
00940     # Dataless Commands
00941     gAttr.GattrDlc('cmd_nop',         0, 0),
00942     gAttr.GattrDlc('cmd_reset',       2, 0),
00943     gAttr.GattrDlc('cmd_calstrobe',   3, 0),
00944     gAttr.GattrDlc('cmd_readevent',   4, 0)
00945     ]
00946
00947   def __init__(self, client, parent, id):
00948     """\brief Initialize valid registers as Gattrs.
00949
00950     Assign default values to members
00951     """
00952
00953     # As stated in LTE-322, using ADDR_SLV_BCAST for a TEM broadcast
00954     # is dangerous therefore if the parent TEM is a broadcast node
00955     # the read and send methods are redefined so that we loop
00956     # over each TEM defined in the schema
00957     if parent.up().up().id() == gDb.Children.BCASTID:
00958       self.read = None
00959       self.load = self.__bcast_load
00960       self.send = self.__bcast_send
00961
00962     if id < gDb.Lem.NTFES:
00963       addr = id
00964     elif id == gDb.Children.BCASTID:
00965       addr = gDb.Lem.TFEBCAST
00966     else:
00967       raise KeyError("*** gTEM: GTFE id %d is invalid" %(id))
00968     gDb.Gdb.__init__(self, client, parent, id, self.__attrs, addr)
00969
00970   def read(self, reg):
00971     rsp = self.cmdrsp('TFE_read', self.up().up().up().addr(), self.up().up().addr(), self.up().addr(), self.addr(), reg, '!I', '!I')
00972     timestamp = rsp.timestamp()
00973     status    = rsp.status()
00974     payloads  = (rsp.payloads()[1], rsp.payloads()[0])
00975     return gRegister.Register(timestamp, status, payloads, 'II')
00976
00977   def load(self, reg, value):
00978     # If you modify this method, change __bcast_load as well
00979     [lower, upper] = struct.unpack('II', struct.pack('Q', value))
00980     return self.cmdrsp('TFE_load', self.up().up().up().addr(), self.up().up().addr(), self.up().addr(), self.addr(), reg, upper, lower)
00981
00982   def send(self, cmd):
00983     # If you modify this method, change __bcast_send as well
00984     return self.cmdrsp('TFE_cmd', self.up().up().up().addr(), self.up().up().addr(), self.up().addr(), self.addr(), cmd)
00985
00986   def __bcast_load(self, reg, value):
00987     [lower, upper] = struct.unpack('II', struct.pack('Q', value))
00988     for temId in self.up().up().up().up().TEM:
00989       rsp = self.cmdrsp('TFE_load', gDb.Lem.ADDR_TEM_BASE+temId, self.up().up().addr(), self.up().addr(), self.addr(), reg, upper, lower)
00990       if rsp.status() != 0: break
00991     return rsp
00992
00993   def __bcast_send(self, cmd):
00994     for temId in self.up().up().up().up().TEM:
00995       rsp = self.cmdrsp('TFE_cmd', gDb.Lem.ADDR_TEM_BASE+temId, self.up().up().addr(), self.up().addr(), self.addr(), cmd)
00996       if rsp.status() != 0: break
00997     return rsp
00998
00999
01000 class GTIC(gDb.Gdb):
01001   """\brief Trigger Interface Controller.
01002
01003   Has GTIC specific registers and dataless commands.
01004
01005   Valid Registers:
01006   - \c power_supply
01007   - \c status
01008   - \c cal_in_mask
01009   - \c cal_lrs_mask
01010   - \c cal_lrs_counters
01011   - \c tkr_layer_enable_0
01012   - \c tkr_layer_enable_1
01013   - \c tkr_out_mask
01014   - \c tkr_out_lrs_mask
01015   - \c tkr_lrs_counter_0
01016   - \c tkr_lrs_counter_1
01017   - \c busy_lrs_mask
01018   - \c busy_lrs_counter
01019   - \c adcs
01020   - \c mux_config
01021   - \c tkr_biasdac
01022   - \c cal_biasdac
01023   - \c adc_tkr_digital_2_5v
01024   - \c adc_tkr_digital_2_5i
01025   - \c adc_tkr_analog_a_1_5v
01026   - \c adc_tkr_analog_a_1_5i
01027   - \c adc_tkr_analog_b_2_5v
01028   - \c adc_tkr_analog_b_2_5i
01029   - \c adc_tkr_bias_v
01030   - \c adc_tkr_bias_v0
01031   - \c adc_tkr_bias_i
01032   - \c adc_cal_digital_3_3v
01033   - \c adc_cal_digital_3_3i
01034   - \c adc_tkr_bias_v1
01035   - \c adc_cal_analog_3_3v
01036   - \c adc_cal_analog_3_3i
01037   - \c adc_cal_bias_v1
01038   - \c adc_cal_bias_v
01039   - \c adc_cal_bias_v0
01040   - \c adc_cal_bias_i
01041   - \c adc_28_v0
01042   - \c adc_tem_digital_3_3v
01043   - \c adc_tem_digital_3_3i
01044   - \c adc_28_v1
01045   - \c adc_afee0_t0
01046   - \c adc_afee0_t1
01047   - \c adc_afee1_t0
01048   - \c adc_afee1_t1
01049   - \c adc_afee2_t0
01050   - \c adc_afee2_t1
01051   - \c adc_afee3_t0
01052   - \c adc_afee3_t1
01053   - \c adc_tkr_c0_t0
01054   - \c adc_tkr_c0_t1
01055   - \c adc_tkr_c1_t0
01056   - \c adc_tkr_c1_t1
01057   - \c adc_tkr_c2_t0
01058   - \c adc_tkr_c2_t1
01059   - \c adc_tkr_c3_t0
01060   - \c adc_tkr_c3_t1
01061   - \c adc_tkr_c4_t0
01062   - \c adc_tkr_c4_t1
01063   - \c adc_tkr_c5_t0
01064   - \c adc_tkr_c5_t1
01065   - \c adc_tkr_c6_t0
01066   - \c adc_tkr_c6_t1
01067   - \c adc_tkr_c7_t0
01068   - \c adc_tkr_c7_t1
01069
01070   Deadtime Counters:
01071   - \c sat_cal_lrs_ctr_0
01072   - \c sat_cal_lrs_ctr_1
01073   - \c sat_tkr_lrs_ctr_0
01074   - \c sat_tkr_lrs_ctr_1
01075   - \c sat_tkr_lrs_ctr_2
01076   - \c sat_tkr_lrs_ctr_3
01077   - \c sat_deadtime_lrs_ctr
01078
01079   Pseudo Registers:
01080   - \c psd_tkr_bias_i
01081   - \c psd_cal_bias_i
01082   - \c psd_tem_i
01083
01084   Dataless Commands:
01085   - \c cmd_nop
01086   - \c cmd_reset
01087
01088   """
01089   __attrs = [
01090     # Registers
01091     gAttr.GattrReg('power_supply',           0,  4),
01092     gAttr.GattrReg('status',                 1,  4),
01093     gAttr.GattrReg('cal_in_mask',            2,  4),
01094     gAttr.GattrReg('cal_lrs_mask',           3,  4),
01095     gAttr.GattrReg('cal_lrs_counters',       4,  4),
01096     gAttr.GattrReg('tkr_layer_enable_0',     5,  4),
01097     gAttr.GattrReg('tkr_layer_enable_1',     6,  4),
01098     gAttr.GattrReg('tkr_out_mask',           7,  2),
01099     gAttr.GattrReg('tkr_out_lrs_mask',       8,  2),
01100     gAttr.GattrReg('tkr_lrs_counter_0',     10,  4),
01101     gAttr.GattrReg('tkr_lrs_counter_1',     11,  4),
01102     gAttr.GattrReg('busy_lrs_mask',         12,  2),
01103     gAttr.GattrReg('busy_lrs_counter',      13,  4),
01104     gAttr.GattrReg('adcs',                  14, 16),
01105     gAttr.GattrReg('mux_config',            15,  4),
01106     gAttr.GattrReg('tkr_biasdac',           16,  4),
01107     gAttr.GattrReg('cal_biasdac',           17,  4),
01108     gAttr.GattrReg('adc_tkr_digital_2_5v',  18,  2, gAttr.REG_READ_ONLY),
01109     gAttr.GattrReg('adc_tkr_digital_2_5i',  19,  2, gAttr.REG_READ_ONLY),
01110     gAttr.GattrReg('adc_tkr_analog_a_1_5v', 20,  2, gAttr.REG_READ_ONLY),
01111     gAttr.GattrReg('adc_tkr_analog_a_1_5i', 21,  2, gAttr.REG_READ_ONLY),
01112     gAttr.GattrReg('adc_tkr_analog_b_2_5v', 22,  2, gAttr.REG_READ_ONLY),
01113     gAttr.GattrReg('adc_tkr_analog_b_2_5i', 23,  2, gAttr.REG_READ_ONLY),
01114     gAttr.GattrReg('adc_tkr_bias_v',        24,  2, gAttr.REG_READ_ONLY),
01115     gAttr.GattrReg('adc_tkr_bias_v0',       24,  2, gAttr.REG_READ_ONLY),
01116     gAttr.GattrReg('adc_tkr_bias_i',        25,  2, gAttr.REG_READ_ONLY),
01117     gAttr.GattrReg('adc_cal_digital_3_3v',  26,  2, gAttr.REG_READ_ONLY),
01118     gAttr.GattrReg('adc_cal_digital_3_3i',  27,  2, gAttr.REG_READ_ONLY),
01119     gAttr.GattrReg('adc_tkr_bias_v1',       27,  2, gAttr.REG_READ_ONLY),
01120     gAttr.GattrReg('adc_cal_analog_3_3v',   28,  2, gAttr.REG_READ_ONLY),
01121     gAttr.GattrReg('adc_cal_analog_3_3i',   29,  2, gAttr.REG_READ_ONLY),
01122     gAttr.GattrReg('adc_cal_bias_v1',       29,  2, gAttr.REG_READ_ONLY),
01123     gAttr.GattrReg('adc_cal_bias_v',        30,  2, gAttr.REG_READ_ONLY),
01124     gAttr.GattrReg('adc_cal_bias_v0',       30,  2, gAttr.REG_READ_ONLY),
01125     gAttr.GattrReg('adc_cal_bias_i',        31,  2, gAttr.REG_READ_ONLY),
01126     gAttr.GattrReg('adc_28_v0',             31,  2, gAttr.REG_READ_ONLY),
01127     gAttr.GattrReg('adc_tem_digital_3_3v',  32,  2, gAttr.REG_READ_ONLY),
01128     gAttr.GattrReg('adc_tem_digital_3_3i',  33,  2, gAttr.REG_READ_ONLY),
01129     gAttr.GattrReg('adc_28_v1',             33,  2, gAttr.REG_READ_ONLY),
01130     gAttr.GattrReg('adc_afee0_t0',          34,  2, gAttr.REG_READ_ONLY),
01131     gAttr.GattrReg('adc_afee0_t1',          35,  2, gAttr.REG_READ_ONLY),
01132     gAttr.GattrReg('adc_afee1_t0',          36,  2, gAttr.REG_READ_ONLY),
01133     gAttr.GattrReg('adc_afee1_t1',          37,  2, gAttr.REG_READ_ONLY),
01134     gAttr.GattrReg('adc_afee2_t0',          38,  2, gAttr.REG_READ_ONLY),
01135     gAttr.GattrReg('adc_afee2_t1',          39,  2, gAttr.REG_READ_ONLY),
01136     gAttr.GattrReg('adc_afee3_t0',          40,  2, gAttr.REG_READ_ONLY),
01137     gAttr.GattrReg('adc_afee3_t1',          41,  2, gAttr.REG_READ_ONLY),
01138     gAttr.GattrReg('adc_tkr_c0_t0',         42,  2, gAttr.REG_READ_ONLY),
01139     gAttr.GattrReg('adc_tkr_c0_t1',         43,  2, gAttr.REG_READ_ONLY),
01140     gAttr.GattrReg('adc_tkr_c1_t0',         44,  2, gAttr.REG_READ_ONLY),
01141     gAttr.GattrReg('adc_tkr_c1_t1',         45,  2, gAttr.REG_READ_ONLY),
01142     gAttr.GattrReg('adc_tkr_c2_t0',         46,  2, gAttr.REG_READ_ONLY),
01143     gAttr.GattrReg('adc_tkr_c2_t1',         47,  2, gAttr.REG_READ_ONLY),
01144     gAttr.GattrReg('adc_tkr_c3_t0',         48,  2, gAttr.REG_READ_ONLY),
01145     gAttr.GattrReg('adc_tkr_c3_t1',         49,  2, gAttr.REG_READ_ONLY),
01146     gAttr.GattrReg('adc_tkr_c4_t0',         50,  2, gAttr.REG_READ_ONLY),
01147     gAttr.GattrReg('adc_tkr_c4_t1',         51,  2, gAttr.REG_READ_ONLY),
01148     gAttr.GattrReg('adc_tkr_c5_t0',         52,  2, gAttr.REG_READ_ONLY),
01149     gAttr.GattrReg('adc_tkr_c5_t1',         53,  2, gAttr.REG_READ_ONLY),
01150     gAttr.GattrReg('adc_tkr_c6_t0',         54,  2, gAttr.REG_READ_ONLY),
01151     gAttr.GattrReg('adc_tkr_c6_t1',         55,  2, gAttr.REG_READ_ONLY),
01152     gAttr.GattrReg('adc_tkr_c7_t0',         56,  2, gAttr.REG_READ_ONLY),
01153     gAttr.GattrReg('adc_tkr_c7_t1',         57,  2, gAttr.REG_READ_ONLY),
01154     # Low Rate Science Counters
01155     gAttr.GattrReg('sat_cal_lrs_ctr_0',     58,  4, gAttr.REG_READ_ONLY),
01156     gAttr.GattrReg('sat_cal_lrs_ctr_1',     59,  4, gAttr.REG_READ_ONLY),
01157     gAttr.GattrReg('sat_tkr_lrs_ctr_0',     60,  4, gAttr.REG_READ_ONLY),
01158     gAttr.GattrReg('sat_tkr_lrs_ctr_1',     61,  4, gAttr.REG_READ_ONLY),
01159     gAttr.GattrReg('sat_tkr_lrs_ctr_2',     62,  4, gAttr.REG_READ_ONLY),
01160     gAttr.GattrReg('sat_tkr_lrs_ctr_3',     63,  4, gAttr.REG_READ_ONLY),
01161     gAttr.GattrReg('sat_deadtime_lrs_ctr',  64,  4, gAttr.REG_READ_ONLY),
01162     # Pseudo-registers
01163     gAttr.GattrReg('psd_tkr_bias_i',        65,  4, gAttr.REG_READ_ONLY),
01164     gAttr.GattrReg('psd_cal_bias_i',        66,  4, gAttr.REG_READ_ONLY),
01165     gAttr.GattrReg('psd_tem_i',             67,  4, gAttr.REG_READ_ONLY),
01166     # Dataless Commands
01167     gAttr.GattrDlc('cmd_nop',                0,  0),
01168     gAttr.GattrDlc('cmd_reset',              1,  0)
01169     ]
01170   __ADCS                 = 14
01171   __MUX_CONFIG           = 15
01172   __CAL_BIASDAC          = 17
01173   __ADC_TKR_DIGITAL_2_5V = 18
01174   __ADC_TKR_BIAS_V0      = 24
01175   __ADC_TKR_BIAS_V1      = 27
01176   __ADC_CAL_BIAS_V0      = 30
01177   __ADC_CAL_BIAS_V1      = 29
01178   __ADC_28_V0            = 31
01179   __ADC_28_V1            = 33
01180   __SAT_CAL_LRS_CTR_0    = 58
01181   __PSD_TKR_BIAS_I       = 65
01182   __PSD_CAL_BIAS_I       = 66
01183   __PSD_TEM_I            = 67
01184   __STALE_TMO = 1.0     # Timeout in seconds before considering adcs value stale
01185
01186   def __init__(self, client, parent):
01187     """\brief Initialize valid registers as Gattrs.
01188
01189     """
01190
01191     # As stated in LTE-322, using ADDR_SLV_BCAST for a TEM broadcast
01192     # is dangerous therefore if the parent TEM is a broadcast node
01193     # the read and send methods are redefined so that we loop
01194     # over each TEM defined in the schema
01195     if parent.id() == gDb.Children.BCASTID:
01196       self.read = None
01197       self.load = self.__bcast_load
01198       self.send = self.__bcast_send
01199
01200     self.__adcs = 5*[(None, 0)]           # [gRegister.Register, time.time()]
01201     gDb.Gdb.__init__(self, client, parent, 0, self.__attrs)
01202
01203   def satCtrEnable(self, reg):
01204     """\brief Enable the specified saturation counter.
01205     By default all saturation counters are disabled.
01206
01207     \param reg Register id of the saturation counter.
01208                Can be retrieved by calling tic.regs['regname'].id().
01209     \return A Response object
01210     """
01211     return self.cmdrsp('TEM_GTIC_sat_enable', self.up().addr(), reg)
01212
01213   def satCtrDisable(self, reg):
01214     """\brief Disable the specified saturation counter.
01215     By default all saturation counters are disabled.
01216
01217     \param reg Register id of the saturation counter.
01218                Can be retrieved by calling tic.regs['regname'].id().
01219     \return A Response object
01220     """
01221     return self.cmdrsp('TEM_GTIC_sat_disable', self.up().addr(), reg)
01222
01223   def satCtrLoopEnable(self):
01224     """\brief Enable the update loop that updates all
01225     saturation counter pseudoregisters.
01226
01227     \return A Response object
01228     """
01229     return self.cmdrsp('TEM_GTIC_sat_loop_enable')
01230
01231   def satCtrLoopDisable(self):
01232     """\brief Disable the update loop that updates all
01233     saturation counter pseudoregisters.
01234
01235     \return A Response object
01236     """
01237     return self.cmdrsp('TEM_GTIC_sat_loop_disable')
01238
01239   def satCtrSetLoopDelay(self, delay):
01240     """\brief Set the update loop interval for
01241     saturation counter pseudoregisters.
01242
01243     \param Set the saturation counter update loop delay
01244            in 1/60 second ticks. The default is 30 (2 Hz).
01245
01246     \return A Response object
01247     """
01248     return self.cmdrsp('TEM_GTIC_sat_loop_delay', delay)
01249
01250   def read(self, reg):
01251     if (reg != GTIC.__ADCS) and (reg <= GTIC.__CAL_BIASDAC):
01252       return self.cmdrsp('TIC_read', self.up().addr(), reg, '!I')
01253     elif (reg == GTIC.__ADCS):
01254       rsp = self.cmdrsp('TIC_ENV_read', self.up().addr(), '!HHHHHHHH', '!H', '!H')
01255       payloads = rsp.payloads()
01256       payload = [ payloads[0]         +
01257                  (payloads[1] << 12L) +
01258                  (payloads[2] << 24L) +
01259                  (payloads[3] << 36L) +
01260                  (payloads[4] << 48L) +
01261                  (payloads[5] << 60L) +
01262                  (payloads[6] << 72L) +
01263                  (payloads[7] << 84L) +
01264                  (payloads[8] << 96L) +
01265                  (payloads[9] << 99L)
01266                 ]
01267       return gRegister.Register(rsp.timestamp(), rsp.status(), payload, 'H')
01268     elif (reg < GTIC.__SAT_CAL_LRS_CTR_0):
01269       return self.__fetchReg(reg)
01270     elif (reg < GTIC.__PSD_TKR_BIAS_I):
01271       return self.cmdrsp('TEM_GTIC_read_sat', self.up().addr(), reg, '!I', '!Q')
01272     elif (reg == GTIC.__PSD_TKR_BIAS_I):
01273       return self.__diffReg(GTIC.__ADC_TKR_BIAS_V0, GTIC.__ADC_TKR_BIAS_V1)
01274     elif (reg == GTIC.__PSD_CAL_BIAS_I):
01275       return self.__diffReg(GTIC.__ADC_CAL_BIAS_V0, GTIC.__ADC_CAL_BIAS_V1)
01276     elif (reg == GTIC.__PSD_TEM_I):
01277       return self.__diffReg(GTIC.__ADC_28_V0, GTIC.__ADC_28_V1)
01278     else:
01279       raise Exception, "Invalid GTIC register %d" % (reg)
01280
01281   def load(self, reg, value):
01282     # If you modify this method, change __bcast_load as well
01283     if (reg < GTIC.__SAT_CAL_LRS_CTR_0):
01284       return self.cmdrsp('TIC_load', self.up().addr(), reg, value)
01285     elif (reg < GTIC.__PSD_TKR_BIAS_I):
01286       return self.cmdrsp('TEM_GTIC_sat_clear', self.up().addr(), reg)
01287     else:
01288       raise Exception, "Invalid GTIC register %d" % (reg)
01289
01290   def send(self, cmd):
01291     # If you modify this method, change __bcast_send as well
01292     return self.cmdrsp('TIC_cmd', self.up().addr(), cmd)
01293
01294   def __bcast_load(self, reg, value):
01295     for temId in self.up().up().TEM:
01296       if (reg < GTIC.__SAT_CAL_LRS_CTR_0):
01297         rsp = self.cmdrsp('TIC_load', gDb.Lem.ADDR_TEM_BASE+temId, reg, value)
01298         if rsp.status() != 0: break
01299       elif (reg < GTIC.__PSD_TKR_BIAS_I):
01300         rsp = self.cmdrsp('TEM_GTIC_sat_clear', gDb.Lem.ADDR_TEM_BASE+temId, reg)
01301         if rsp.status() != 0: break
01302       else:
01303         raise Exception, "Invalid GTIC register %d" % (reg)
01304     return rsp
01305
01306   def __bcast_send(self, cmd):
01307     for temId in self.up().up().TEM:
01308       rsp = self.cmdrsp('TIC_cmd', gDb.Lem.ADDR_TEM_BASE+temId, cmd)
01309       if rsp.status() != 0: break
01310     return rsp
01311
01312   def __fetchReg(self, reg):
01313     """\brief Fetch the value of an item from the ADC conversion data block,
01314     updating the block if it is deemed to be stale.
01315     \param reg - The item in the ADC conversion block to fetch
01316     \return A gRegister object containing the requested item
01317     """
01318     mux   = (reg - 18) / 8
01319     which = (reg - 18) % 8
01320     now = time.time()
01321     (rsp, rt) = self.__adcs[mux]
01322     if ((rsp is None) or (now - rt) > GTIC.__STALE_TMO):
01323       rsp = self.cmdrsp('TIC_ENV_acquire', self.up().addr(), mux, '!HHHHHHHH', '!H', '!H')
01324       channel = rsp.payloads()[8]
01325       valid   = rsp.payloads()[9]
01326       if not valid:
01327         status = gException.LATInterfaceStatus.status('OCS_BDADC')
01328         raise gException.LATInterfaceException(status)
01329       if channel != mux:
01330         status = gException.LATInterfaceStatus.status('OCS_GRPADC')
01331         raise gException.LATInterfaceException(status)
01332       self.__adcs[mux] = (rsp, now)
01333     timestamp = rsp.timestamp()
01334     status    = rsp.status()
01335     payloads  = rsp.payloads()[which:which+1]
01336     return gRegister.Register(timestamp, status, payloads, 'H')
01337
01338   def __diffReg(self, reg1, reg2):
01339     """\brief Calculate the difference between two registers to form a
01340     pseudo-register result.  Order is result = reg2 - reg1.
01341     \param reg1 - First register
01342     \param reg2 - Second register
01343     \return A gRegister object containing reg2 - reg1
01344     """
01345     rsp1 = self.__fetchReg(reg1)
01346     rsp2 = self.__fetchReg(reg2)
01347     timestamp = rsp2.timestamp()
01348     payloads  = [rsp2.value() - rsp1.value()]
01349     status    = rsp2.status()
01350     if status == 0:  status = rsp1.status()
01351     return gRegister.Register(timestamp, status, payloads, 'H')
Generated on Fri Jul 21 13:26:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gTPG.py Source File

database

gTPG.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Trigger Pattern Generator node"
00013 __author__   = "Amedeo Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2005/03/21 00:06:58 $").split(' ')[1]
00015 __version__ = "$Revision: 2.4 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__ = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020 import struct
00021 import gDb
00022
00023 class GTPG(gDb.Gdb):
00024   def __init__(self, client):
00025     gDb.Gdb.__init__(self, client, None, 0)
00026
00027   def clear(self):
00028     return self.cmdrsp('TPGclear', 'tpg')
00029
00030   def clearBuf(self, bufferId):
00031     return self.cmdrsp('TPGclearBuf', 'tpg', bufferId)
00032
00033   def start(self):
00034     return self.cmdrsp('TPGstart', 'tpg')
00035
00036   def startCmd(self):
00037     return self.cmdrsp('TPGstartCmd', 'tpg')
00038
00039   def load(self):
00040     tpgdelays = '>' + struct.pack('>IIIIIII', 0, 0, 0, 0, 0, 0, 0)
00041     return self.cmdrsp('TPGload', 'tpg', tpgdelays)
00042
00043   def setTEM(self, tem_id, trg, start, pattern, pat_len, repetitions):
00044     return self.cmdrsp('TPGsetTEM', 'tpg', tem_id, trg, start, pattern, pat_len, repetitions)
00045
00046   def setVETO(self, free_id, veto_id, start, pattern, pat_len, repetitions):
00047     return self.cmdrsp('TPGsetVETO', 'tpg', free_id, veto_id, start, pattern, pat_len, repetitions)
00048
00049   def setCNO(self, free_id, start, pattern, pat_len, repetitions):
00050     return self.cmdrsp('TPGsetCNO', 'tpg', free_id, start, pattern, pat_len, repetitions)
00051
00052   def setExtTrig(self, start, pattern, pat_len, repetitions):
00053     return self.cmdrsp('TPGsetExtTrig', 'tpg', start, pattern, pat_len, repetitions)
Generated on Fri Jul 21 13:26:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: guiBridges.py Source File

tools

guiBridges.py

00001 #!/usr/bin/env python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Classes for launching Qt objects from non-GUI threads"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "12/19/2003"
00014 __version__  = "$Revision: 2.8 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import logging       as     log
00020 from   qt            import *
00021 from   Queue         import Queue
00022 import threading
00023 import sys
00024
00025
00026 class GUIbridge(object):
00027   """\brief Class for providing a bridge between the GUI thread and other threads.
00028
00029   This bridge is needed whenever a non-GUI thread needs to interact with the
00030   GUI.  The GUI is handled by the 'GUI thread'.  A 'GUI thread' is defined to
00031   be the one in which the Qt QApplication class's exec_loop() method is
00032   executed.  There can be only one GUI thread in a program.
00033
00034   The solution to the problem is handled by sending a message (an 'event', in
00035   Qt terms) from the non-GUI thread to the GUI thread.  The message contains
00036   information on how it is to be handled.  In some cases, this handling produces
00037   a result that must be sent back to the initiating non-GUI thread.  The
00038   requests and responses are passed around via queues.  Separate queues are
00039   maintained for the different non-GUI threads so that responses don't end up
00040   handed off to the wrong thread.
00041   """
00042   GUI_CMD_INST    = QEvent.Type(QEvent.User + 1)
00043   GUI_CMD_FUNC    = QEvent.Type(QEvent.User + 2)
00044   GUI_CMD_FUNC_NR = QEvent.Type(QEvent.User + 3)
00045
00046   def __init__(self, guiThread):
00047     """\brief This is the constructor of the GUIbridge class.
00048
00049     It must be called from the GUI thread.
00050     """
00051     self.__guiThread  = guiThread
00052     self.__cmdQueue   = Queue()
00053     self.__respQueues = {}
00054     self.__qtBridge   = QtThreadBridge("QtBridge", self.__cmdQueue)
00055     self.__qtBridge.start()
00056     self.__pyBridge   = PyThreadBridge("PyBridge", self.__cmdQueue)
00057
00058   def shutdown(self):
00059     """\brief This method is used to shut the GUI bridge down.
00060     """
00061     self.__qtBridge.quit()
00062
00063   def isGUIthread(self):
00064     """\brief Returns True if this method is being called from the GUI thread.
00065     """
00066     return threading.currentThread() == self.__guiThread
00067
00068   def createGUI(self, qObject, obj, *args, **kwargs):
00069     """\brief Method used for instantiating a GUI from a non-GUI thread.
00070
00071     \param qObject - The Qt object that will receive the customEvent callback
00072     \param obj     - The GUI object class type to create
00073     \param args    - Arguments for the object class constructor
00074     \param kwargs  - Keyword arguments for the object class constructor
00075     \return An instance of the requested GUI object class
00076     """
00077     # Don't use the GUI bridge if we're being called from the GUI thread
00078     if self.isGUIthread():  return apply(obj, args, kwargs)
00079
00080     currentThread = threading.currentThread()
00081     if currentThread not in self.__respQueues:
00082       self.__respQueues[currentThread] = Queue()
00083
00084     respQ = self.__respQueues[currentThread]
00085     self.__pyBridge.pushEvent((GUIbridge.GUI_CMD_INST, qObject,
00086                                (obj,) + args + (kwargs, respQ)))
00087     return self.__pyBridge.pullResponse(respQ)
00088
00089   def execGUImethodNR(self, qObject, func, *args, **kwargs):
00090     """\brief Method used for executing a GUI function from a non-GUI thread.
00091
00092     Use this method when no (useful) response is expected or
00093     when waiting for one could cause a deadlock.  Any response from the
00094     function is lost.
00095     \param qObject - The Qt object that will receive the customEvent callback
00096     \param func    - The GUI function or method to call
00097     \param args    - Arguments for the function or method
00098     \param kwargs  - Keyword arguments for the function or method
00099     """
00100     if not self.isGUIthread():
00101       respQ = None                      # No response expected or required
00102       self.__pyBridge.pushEvent((GUIbridge.GUI_CMD_FUNC_NR, qObject,
00103                                  (func,) + args + (kwargs, respQ)))
00104     else:
00105       apply(func, args, kwargs)
00106
00107   def execGUImethod(self, qObject, func, *args, **kwargs):
00108     """\brief Method used for executing a GUI function from a non-GUI thread.
00109
00110     Use this method when a response is expected from the function and
00111     when it is appropriate to wait for it (no deadlock arises)
00112     \param qObject - The Qt object that will receive the customEvent callback
00113     \param func    - The GUI function or method to call
00114     \param args    - Arguments for the function or method
00115     \param kwargs  - Keyword arguments for the function or method
00116     \return The called GUI function's return value
00117     """
00118     # Don't use the GUI bridge if we're being called from the GUI thread
00119     if self.isGUIthread():  return apply(func, args, kwargs)
00120
00121     currentThread = threading.currentThread()
00122     if currentThread not in self.__respQueues:
00123       self.__respQueues[currentThread] = Queue()
00124
00125     respQ = self.__respQueues[currentThread]
00126     self.__pyBridge.pushEvent((GUIbridge.GUI_CMD_FUNC, qObject,
00127                                (func,) + args + (kwargs, respQ)))
00128     return self.__pyBridge.pullResponse(respQ)
00129
00130   if __name__ == "__main__":
00131     def execGUImethod2(self, qObject, func, *args, **kwargs):
00132       # Don't use the GUI bridge if we're being called from the GUI thread
00133       if self.isGUIthread():  return apply(func, args, kwargs)
00134
00135       currentThread = threading.currentThread()
00136       if currentThread not in self.__respQueues:
00137         if '_GUIbridge__respQueue' not in self.__dict__:
00138           self.__respQueue = Queue()
00139         self.__respQueues[currentThread] = self.__respQueue #Queue()
00140
00141       respQ = self.__respQueues[currentThread]
00142       self.__pyBridge.pushEvent((GUIbridge.GUI_CMD_FUNC, qObject,
00143                                  (func,) + args + (kwargs, respQ)))
00144       #time.sleep(0.01)                    # Delay to allow a task switch
00145       return self.__pyBridge.pullResponse(respQ)
00146
00147   def handleCustomEvent(self, e):
00148     try:
00149       # This method overrides the QObject base class's
00150       data = e.data()
00151       func     = data[0]
00152       args     = data[1:-3]
00153       kwargs   = data[-3]
00154       respQ    = data[-2]
00155       qtBridge = data[-1]
00156       if e.type() == GUIbridge.GUI_CMD_INST:
00157         qtBridge.pushResponse(respQ, func(*args, **kwargs))
00158       elif e.type() == GUIbridge.GUI_CMD_FUNC:
00159         qtBridge.pushResponse(respQ, func(*args, **kwargs))
00160       elif e.type() == GUIbridge.GUI_CMD_FUNC_NR:
00161         func(*args, **kwargs)
00162     except Exception, exc:
00163       log.exception("GUIbridge.handleCustomEvent(): Caught exception")
00164       if e.type() == GUIbridge.GUI_CMD_INST or \
00165          e.type() == GUIbridge.GUI_CMD_FUNC:
00166         qtBridge.pushResponse(respQ, None, exc)
00167
00168
00169 class QtThreadBridge(QThread):
00170   def __init__(self, name, cmdQueue):
00171     QThread.__init__(self)
00172     self._cmdQueue = cmdQueue
00173     self.__quit = False
00174
00175   def quit(self):
00176     self.__quit = True
00177     self._cmdQueue.put( (None) )
00178
00179   def pushResponse(self, respQueue, event, exception=None):
00180     respQueue.put((event, exception))
00181
00182   def run(self):
00183     while not self.__quit:
00184       try:
00185         tplEvent = self._cmdQueue.get(True)
00186         if tplEvent is None:  break     # Quit signal is None
00187         tplEventType = tplEvent[0]
00188         tplEventDest = tplEvent[1]
00189         tplEventData = tplEvent[2]
00190         evt = QCustomEvent(tplEventType)
00191         evt.setData(tplEventData + (self,))
00192         QApplication.postEvent(tplEventDest, evt)
00193         self.msleep(1)                  # RiC: Why's this here?
00194       except Exception, e:
00195         log.exception(e)
00196
00197       # Drop references to this object to allow it to be garbage collected
00198       tplEvent     = None
00199       tplEventType = None
00200       tplEventDest = None
00201       tplEventData = None
00202
00203     # logging already shut down?
00204     #log.info(self.__class__.__name__ + ": terminating")
00205
00206
00207 class PyThreadBridge(object):
00208   def __init__(self,name, cmdQueue):
00209     self._cmdQueue = cmdQueue
00210
00211   def pushEvent(self, event):
00212     try:
00213       self._cmdQueue.put(event)
00214     except Exception, e:
00215       log.exception(e)
00216
00217   def pullResponse(self, respQueue, blnBlock = 1):
00218     try:
00219       response, exception = respQueue.get(blnBlock)
00220       if exception is None:  return response
00221       raise exception
00222     except Exception, e:
00223       log.exception(e)
00224     #  raise e
00225
00226
00227 if __name__ == "__main__":
00228   import time
00229
00230   class GUIbridgeTest(threading.Thread):
00231     def __init__(self, qObject, guiBridge, id, label):
00232       threading.Thread.__init__(self)
00233
00234       self.__qObject   = qObject
00235       self.__guiBridge = guiBridge
00236       self.__id        = id
00237       self.__label     = label
00238       self.__quit      = False
00239
00240     def shutdown(self):
00241       self.__quit  = True
00242
00243     def run(self):
00244       qo = self.__qObject
00245       gb = self.__guiBridge
00246       tf = self.__label
00247       id = self.__id
00248       count = 0
00249       start = time.time()
00250       while not self.__quit:
00251         string = "Thread %d: %12d" % (id, count)
00252
00253         # Write value
00254         gb.execGUImethodNR(qo, tf.setText, string)
00255
00256         # Old method:
00257         #v = gb.execGUImethod2(qo, tf.text)
00258         # New method:
00259         v = gb.execGUImethod(qo, tf.text)
00260
00261         # Bypass GUI thread:
00262         #v = tf.text("Thread %d: %d" % (id, count)) # This doesn't reliably work
00263
00264         # Compare result
00265         if str(v) != string:  print "Thread %d: '%s' != '%s'" % (id, string, v)
00266
00267         #time.sleep(.001)
00268         if id == 1:
00269           count += 1
00270           time.sleep(0.123) # To get some beating betwee the two tasks
00271         else:        count -= 1
00272       end  = time.time()
00273       if id == 2:  count = -count
00274       rate = count / (end - start)
00275       print "Exiting thread %d, %d calls = %.1f setText()s per second" % \
00276             (self.__id, count, rate)
00277
00278
00279   class TestWindow(QMainWindow):
00280     def __init__(self, parent = None, name = None, fl = 0):
00281       QMainWindow.__init__(self, parent, name, fl)
00282
00283       self.setName("TestWindow")
00284
00285       self.mainWidget = QWidget(self) # dummy widget to containt the layout mgr
00286       self.setCentralWidget(self.mainWidget)
00287       layout = QVBoxLayout(self.centralWidget(), 11, 6, "Test_Window_Layout")
00288
00289       self.__label1 = QLabel("Thread 1:", self.mainWidget)
00290       self.__label2 = QLabel("Thread 2:", self.mainWidget)
00291       self.__quit   = QPushButton("Quit", self.mainWidget, "quit")
00292       self.connect(self.__quit, SIGNAL("clicked()"), self.quit)
00293
00294       layout.addWidget(self.__label1)
00295       layout.addWidget(self.__label2)
00296       layout.addWidget(self.__quit)
00297
00298       self.__guiBridge = GUIbridge(threading.currentThread())
00299
00300       self.__gbt1 = GUIbridgeTest(self, self.__guiBridge, 1, self.__label1)
00301       self.__gbt2 = GUIbridgeTest(self, self.__guiBridge, 2, self.__label2)
00302
00303       self.__gbt1.start()
00304       self.__gbt2.start()
00305
00306     def customEvent(self, e):
00307       self.__guiBridge.handleCustomEvent(e)
00308
00309     def quit(self):
00310       self.__gbt1.shutdown()
00311       self.__gbt2.shutdown()
00312       time.sleep(0.1) # Seems to be required to yield and allow things to exit
00313       self.__guiBridge.shutdown()
00314       self.close()
00315
00316   def startTest(args):
00317     app = QApplication(args)
00318     app.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
00319
00320     win = TestWindow()
00321     app.setMainWidget(win)
00322     win.show()
00323
00324     app.exec_loop()
00325
00326
00327   # Start the test
00328   startTest(sys.argv)
Generated on Fri Jul 21 13:26:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gVersions.py Source File

database

gVersions.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 """Version retrieval utility class
00011
00012 Contents:
00013
00014   Provides accessor methods to retrieve version information from
00015   both the software and hardware.
00016   Displays version info from loaded libraries.
00017   Used for troubleshooting problems.
00018
00019 Overview:
00020
00021   Each driver on VxWorks side and each module on the client side
00022   provides its version number through functions. When the function
00023   cmd.getVersions() is called the command server packetizes this
00024   information and sends it over the socket to the command client
00025   which gets decoded into a tuple. The getModuleVersions() function
00026   converts this tuple to a dictionary and adds the python module
00027   versions to it.
00028
00029 Usage:
00030
00031   To retrieve version information one can write::
00032
00033     python versions.py
00034
00035     or
00036
00037     import versions
00038     versions.Gversions.getModuleVersions()
00039 """
00040
00041 __facility__ = "Online"
00042 __abstract__ = "Version retrieval utility"
00043 __author__   = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST I&T/Online"
00044 __date__     = ("$Date: 2006/07/03 21:03:14 $").split(' ')[1]
00045 __version__  = "$Revision: 2.35 $"
00046 __release__  = "$Name: R04-12-00 $"
00047 __credits__  = "SLAC"
00048
00049 import LATTE.copyright_SLAC
00050
00051
00052 import sha
00053 import marshal
00054 import inspect
00055 import os
00056 import sys
00057 import glob
00058 import logging as log
00059 import compiler
00060
00061 ROOT_DIR_ENVS = ['LATTE_ROOT','VXW_ROOT','LAT_ROOT','INT_ROOT','ACD_ROOT','CAL_ROOT','TKR_ROOT','ELX_ROOT','TRG_ROOT']
00062
00063 class Gversions(object):
00064   def getModuleVersions(ocs=None):
00065     """Static class method which returns a dictionary of modules
00066        with their versions.
00067
00068     \param ocs GOCS node
00069
00070     \return Dictionary of modules with their versions
00071     """
00072     ignoreList =  [ 'scipy.gplt','ROOT'
00073                     #'__main__','_xmlplus','cPickle','pickle','sre','urllib',
00074                     #'xml','_xmlplus','xml.parsers.expat', 'xml.parsers.pyexpat',
00075                     #'pyexpat'
00076                   ]
00077     versions = {}
00078     if ocs is not None:
00079       (server_version, server_revision) = ocs.getVersion()
00080       versions['OCS(server)'] = '%d.%d' %(server_version, server_revision)
00081       for (name, data) in ocs.cmxAsBuilt().items():
00082         package = data[0]
00083         version = data[1]
00084         #user    = data[2]
00085         #time    = data[3]
00086         versions['%s[%s]' % (package, name)] = version
00087       startupScriptInfo = ocs.getStartupScriptInfo()
00088       if startupScriptInfo is not None:
00089         versions[startupScriptInfo[0]] = startupScriptInfo[1]
00090     mstrList = sys.modules.keys()
00091     mstrList.sort()
00092     for mStr in mstrList:
00093       if mStr in ignoreList: continue
00094       m = sys.modules[mStr]
00095       if hasattr(m, '__version__'):
00096         v = Gversions.extractVersion(str(getattr(m, '__version__')))
00097         if v.strip() != '' or Gversions.isModuleInReleases(m):
00098           versions[mStr] = v
00099       elif Gversions.isModuleInReleases(m):
00100         versions[mStr] = ''
00101
00102     versions['Python'] = str(hex(sys.hexversion))
00103     try:
00104       import qt
00105       versions['Qt']     = qt.QT_VERSION_STR
00106     except: pass
00107     try:
00108       import sip
00109       if 'SIP_VERSION' in dir(sip):
00110         versions['SIP'] = hex(sip.SIP_VERSION)
00111     except: pass
00112     try:
00113       if 'PYQT_VERSION_STR' in dir(qt):
00114         versions['PyQt'] = qt.PYQT_VERSION_STR
00115       else:
00116         versions['PyQt']   = qt.PYQT_VERSION
00117     except: pass
00118     return versions
00119   getModuleVersions = staticmethod(getModuleVersions)
00120
00121   def isModuleInReleases(m, rootDirEnvs=None):
00122     if rootDirEnvs is None:
00123       rootDirEnvs = ROOT_DIR_ENVS
00124     if hasattr(m, '__file__'):
00125       srcFile = inspect.getsourcefile(m)
00126       if srcFile is not None:
00127         srcFile = os.path.normpath(os.path.normcase(srcFile))
00128         for rootDirEnv in rootDirEnvs:
00129           if os.environ.has_key(rootDirEnv):
00130             rootDir = os.path.normpath(os.path.normcase(os.environ[rootDirEnv].strip()))
00131             if srcFile.startswith(rootDir):
00132               return True
00133     return False
00134   isModuleInReleases = staticmethod(isModuleInReleases)
00135
00136
00137   def extractVersion(verStr):
00138     """Static class method which extracts the version string from the CVS
00139     keyword string, if that's what it appears to be.  If it doesn't, just
00140     return the input."""
00141     colon  = verStr.find(':')
00142     if colon != -1:
00143       dollar = verStr.find('$', colon)
00144       if dollar != -1:
00145         return verStr[colon+2:dollar-1]
00146     return verStr
00147   extractVersion = staticmethod(extractVersion)
00148
00149   def calcDigest(filePath):
00150     digest = sha.new()
00151     f = file(filePath, 'rb')
00152     data = f.read(65536)
00153     while len(data) != 0:
00154       digest.update(data)
00155       data = f.read(65536)
00156     f.close()
00157     #return digest.hexdigest()
00158     return digest.digest()
00159   calcDigest = staticmethod(calcDigest)
00160
00161
00162   def getModuleDigests():
00163     ignoreList = ['scipy.gplt','ROOT']
00164     digests = {}
00165     mstrList = sys.modules.keys()
00166     mstrList.sort()
00167     for mStr in mstrList:
00168       if mStr in ignoreList: continue
00169       m = sys.modules[mStr]
00170       if hasattr(m, '__version__') and hasattr(m, '__file__'):
00171         srcFile = inspect.getsourcefile(m)
00172         digest_value = Gversions.calcDigest(srcFile)
00173         if digest_value is not None:
00174           digests[mStr] = digest_value
00175     return digests
00176   getModuleDigests = staticmethod(getModuleDigests)
00177
00178   def getReleaseFromDigest(digestDataFile=None, rootDirEnv='LATTE_ROOT'):
00179     if os.environ.has_key(rootDirEnv):
00180       rootDir = os.environ[rootDirEnv].strip()
00181     else:
00182       rootDir = ''
00183     if digestDataFile == None and rootDir == '':
00184       raise RuntimeError, "Can not find the digest database file at the indicated location: $%s" % rootDirEnv
00185     elif digestDataFile == None:
00186       digestDataFile = os.path.join(rootDir, 'digestData')
00187     f = file(digestDataFile,'rb')
00188     try:
00189       dc = marshal.load(f)
00190     except ValueError:
00191       log.exception("")
00192       Gversions.logBadMarshalDataMessage()
00193       return
00194     exec(dc)
00195     return _digestData._release
00196   getReleaseFromDigest = staticmethod(getReleaseFromDigest)
00197
00198   def logBadMarshalDataMessage():
00199     log.error("If the above exception is a 'bad marshal data' error,")
00200     log.error("it is likely that you need to update one or more of the")
00201     log.error("digestData files pointed to by the XXX_ROOT environment")
00202     log.error("variables. To create the digestData file, enter the")
00203     log.error("following command for each of the XXX_ROOT that you have:")
00204     log.error("%%ONLINE_ROOT%%\LATTE\setup\createDigestData %%XXX_ROOT%% %s XXX_00_00_00" % sys.prefix)
00205   logBadMarshalDataMessage = staticmethod(logBadMarshalDataMessage)
00206
00207   def verifyModuleDigests(digestDataFile=None, rootDirEnv='LATTE_ROOT', additionalFilesToVerify=[]):
00208     ignoreList = ['scipy.gplt','ROOT']
00209     failedModules = []
00210     rootDir = ''
00211     if os.environ.has_key(rootDirEnv):
00212       rootDir = os.environ[rootDirEnv].strip()
00213     if digestDataFile == None and rootDir == '':
00214       raise RuntimeError, "Can not find the digest database file at the indicated location: $%s" % rootDirEnv
00215     elif digestDataFile == None:
00216       digestDataFile = os.path.join(rootDir, 'digestData')
00217     f = file(digestDataFile,'rb')
00218     try:
00219       dc = marshal.load(f)
00220     except ValueError:
00221       log.exception("")
00222       Gversions.logBadMarshalDataMessage()
00223       return (None, [])
00224     exec(dc)
00225     mstrList = sys.modules.keys()
00226     mstrList.sort()
00227     for mStr in mstrList:
00228       if mStr in ignoreList: continue
00229       #raw_input("Entering %s}" % mStr)
00230       m = sys.modules[mStr]
00231       if hasattr(m, '__file__'):
00232         srcFile = inspect.getsourcefile(m)
00233         if srcFile is not None:
00234           srcFile = os.path.normpath(os.path.normcase(srcFile))
00235           if srcFile.startswith(os.path.normpath(os.path.normcase(rootDir))):
00236             found = False
00237             for (filename, digest) in _digestData._digests.items():
00238               if srcFile == os.path.normpath(os.path.normcase(filename)):
00239                 found = True
00240                 digest_value = Gversions.calcDigest(srcFile)
00241                 if digest_value is None or digest != digest_value:
00242                   failedModules.append(mStr)
00243                 break
00244             if not found:
00245               failedModules.append(mStr)
00246       #raw_input("Exiting %s}" % mStr)
00247
00248     for fileSpec in additionalFilesToVerify:
00249       for filePath in glob.glob(fileSpec):
00250         normPath = os.path.normpath(os.path.normcase(filePath))
00251         if normPath.startswith(os.path.normpath(os.path.normcase(rootDir))):
00252           for (filename, digest) in _digestData._digests.items():
00253             if normPath == os.path.normpath(os.path.normcase(filename)):
00254               digest_value = Gversions.calcDigest(normPath)
00255               if digest_value is None or digest != digest_value:
00256                 failedModules.append(os.path.split(filePath)[1])
00257               break
00258
00259     return (_digestData._release, failedModules)
00260   verifyModuleDigests = staticmethod(verifyModuleDigests)
00261
00262   def findVersionSymbol(filePath):
00263     """\brief Find the __version__ symbol in the file.
00264
00265     \param filePath Full path of the module source code
00266
00267     \return Version number or None if not found.
00268     """
00269     found = False
00270     try:
00271       ast = compiler.parseFile(filePath)
00272       for node in ast.node.nodes:
00273         if node.__class__.__name__ == 'Assign':
00274           if sys.hexversion > 0x20305f0:
00275             if node.asList()[0].asList()[0] == '__version__':
00276               version = node.asList()[1].asList()[0]
00277             else:
00278               continue
00279           else:
00280             if node.asList()[0][0] == '__version__':
00281               version = node.asList()[1][0]
00282             else:
00283               continue
00284           if type(version) is str and version.startswith('$Revision:'):
00285             return Gversions.extractVersion(version)
00286           else:
00287             #print "*** %s: __version__ symbol found but does not begin with $Revision:" % filePath
00288             return None
00289     except:
00290       log.exception("Error in parsing file: %s" % filePath)
00291
00292     if not found:
00293       #print "*** %s: Missing __version__" % filePath
00294       return None
00295   findVersionSymbol = staticmethod(findVersionSymbol)
00296
00297   def verifyFileDigests(path=None, rootDirEnv='LATTE_ROOT', digestDataFile=None):
00298     skipVersionCheck = {'LATTE_ROOT': ['sipconfig.py', 'pyqtconfig.py', 'testAppNoVersion.py']}
00299     failedFiles = []
00300     rootDir = ''
00301     if os.environ.has_key(rootDirEnv):
00302       rootDir = os.environ[rootDirEnv].strip()
00303     if path is None and rootDir == '':
00304       raise RuntimeError, "Can not determine which path to verify"
00305     elif path is None:
00306       path = rootDir
00307     #digests = Gversions.collectDigests(path)
00308     if digestDataFile is None and rootDir == '':
00309       msg = "Can not find the digest database file at the indicated location: $%s" % rootDirEnv
00310       log.error(msg)
00311       raise RuntimeError, msg
00312     elif digestDataFile is None:
00313       digestDataFile = os.path.join(rootDir, 'digestData')
00314     f = file(digestDataFile,'rb')
00315     try:
00316       dc = marshal.load(f)
00317     except ValueError:
00318       log.exception("")
00319       Gversions.logBadMarshalDataMessage()
00320       return (None, [])
00321     exec(dc)
00322     for (filename, digest) in _digestData._digests.items():
00323       if os.path.exists(filename):
00324         fileDigest = Gversions.calcDigest(filename)
00325         if digest != fileDigest:
00326           failedFiles.append(filename)
00327         if os.path.splitext(filename)[1] == '.py':
00328           if rootDirEnv in skipVersionCheck:
00329             if os.path.split(filename)[1] in skipVersionCheck[rootDirEnv]:
00330               continue
00331           if Gversions.findVersionSymbol(filename) is None:
00332             failedFiles.append(filename)
00333       else:
00334         failedFiles.append(filename)
00335     return (_digestData._release, failedFiles)
00336   verifyFileDigests = staticmethod(verifyFileDigests)
00337
00338   def collectDigests(path):
00339     def collectDigests2(digests, dir, files):
00340       ignoredDirs = ['CVS', 'cfitsio_swig']
00341       validExtensions = ['.py','.exe','.xml','.vx','.o']
00342       l = len(files)
00343       for i in range(l-1,-1,-1):
00344         if files[i] in ignoredDirs:
00345           del files[i]
00346         else:
00347           fullFilename = os.path.normpath(os.path.join(dir, files[i]))
00348           if not os.path.isdir(fullFilename) and not os.path.islink(fullFilename):
00349             if os.path.splitext(files[i])[1].lower() in validExtensions:
00350               digest = Gversions.calcDigest(fullFilename)
00351               if digest is not None:
00352                 if digests.has_key(fullFilename):
00353                   print "DUPLICATE ENTRY DETECTED:", fullFilename
00354                 else:
00355                   digests[fullFilename] = digest
00356               else:
00357                 print "NO DIGEST FOR", files[i]
00358     digests = {}
00359     path = os.path.normpath(os.path.abspath(path))
00360     if os.path.isdir(path):
00361       os.path.walk(path, collectDigests2, digests)
00362     #~ for (file, digest) in digests.items():
00363       #~ print file #, repr(digest)
00364     #~ x = digests.keys()
00365     #~ x.sort()
00366     #~ for f in x:
00367       #~ print f
00368       return digests
00369     else:
00370       return None
00371   collectDigests = staticmethod(collectDigests)
00372
00373
00374   def getHardwareVersions(lat, xbrd=None):
00375     """Static class method which retrieves
00376        hardware versions.
00377
00378     Keyword arguments:
00379
00380     cmd -- optional command client (default None)
00381
00382     """
00383     versions = {}
00384     glt = None
00385     if xbrd is not None: glt = xbrd.GLT
00386     if glt is not None:
00387       glt.initialize()
00388       # set trigger mask to allow commanding
00389       glt.disableMask()
00390       save_busy_disable = glt.busy_disable
00391       glt.busy_disable = 0x0
00392     gtemVersions = []
00393     gcrcVersions = []
00394     gtrcVersions = []
00395     for (temId, tem) in lat.TEM.items():
00396       try:
00397         temVer = int((tem.status >> 16) & 0x3F)
00398         if temVer not in gtemVersions:
00399           gtemVersions.append(temVer)
00400         for (cccId, ccc) in tem.CCC.items():
00401           for (crcId, crc) in ccc.CRC.items():
00402             try:
00403               crcVer = int((crc.config >> 12) & 7)
00404               if crcVer not in gcrcVersions:
00405                 gcrcVersions.append(crcVer)
00406             except: pass
00407         for (tccId, tcc) in tem.TCC.items():
00408           for (trcId, trc) in tcc.TRC.items():
00409             try:
00410               trcVer = int((trc.csr >> 34) & 0x0F)
00411               if trcVer not in gtrcVersions:
00412                 gtrcVersions.append(trcVer)
00413             except: pass
00414       except: pass
00415     if len(gtemVersions) > 1:
00416       versions['TEM'] = str(gtemVersions)
00417     elif len(gtemVersions) == 1:
00418       versions['TEM'] = str(gtemVersions[0])
00419     if len(gcrcVersions) > 1:
00420       versions['GCRC'] = str(gcrcVersions)
00421     elif len(gcrcVersions) == 1:
00422       versions['GCRC'] = str(gcrcVersions[0])
00423     if len(gtrcVersions) > 1:
00424       versions['GTRC'] = str(gtrcVersions)
00425     elif len(gtrcVersions) == 1:
00426       versions['GTRC'] = str(gtrcVersions[0])
00427     aem = lat.AEM
00428     if aem is not None:
00429       try:
00430         versions['AEM'] = str(aem.configuration & 0xFF)
00431         garcVersions = []
00432         gafeVersions = []
00433         for (arcId, arc) in aem.ARC.items():
00434           try:
00435             arcVer = str(arc.garc_version)
00436             if arcVer not in garcVersions:
00437               garcVersions.append(arcVer)
00438             for (afeId, afe) in arc.AFE.items():
00439               try:
00440                 afeVer = afe.vers_addr
00441                 if afeVer not in gafeVersions:
00442                   gafeVersions.append(afeVer)
00443               except: pass
00444           except: pass
00445         if len(garcVersions) > 1:
00446           versions['GARC'] = str(garcVersions)
00447         elif len(garcVersions) == 1:
00448           versions['GARC'] = str(garcVersions[0])
00449         if len(gafeVersions) > 1:
00450           versions['GAFE'] = str(gafeVersions)
00451         elif len(gafeVersions) == 1:
00452           versions['GAFE'] = str(gafeVersions[0])
00453       except: pass
00454     if glt is not None:
00455       glt = xbrd.GLT
00456       glt.enableMask()
00457       glt.busy_disable = save_busy_disable
00458     #except IOError:
00459     #  pass
00460     return versions
00461   getHardwareVersions = staticmethod(getHardwareVersions)
00462
00463   def printVersions(ocs, lat=None, xbrd=None):
00464     print "\nCurrent Release: %s\n" % Gversions.getReleaseFromDigest()
00465     print "%-30s %10.10s" % ("Module", "Version")
00466     print "%-30s %10.10s" % ("--------", "-------")
00467     versions = Gversions.getModuleVersions(ocs)
00468     modList = versions.keys()
00469     modList.sort()
00470     for module in modList:
00471       print "%-30s %10.10s" % (module, versions[module])
00472     if lat is not None:
00473       hw_versions = Gversions.getHardwareVersions(lat, xbrd)
00474       if hw_versions != {}:
00475         print
00476         print "%-30s %10.10s" % ("Component", "Version")
00477         print "%-30s %10.10s" % ("---------", "-------")
00478         for (hw_comp, version) in hw_versions.items():
00479           print "%-30s %10.10s" % (hw_comp, version)
00480   printVersions = staticmethod(printVersions)
00481
00482 if __name__ == '__main__':
00483   # Imports here are specified so that the versions for
00484   # all loaded modules can be retrieved. Add any additional
00485   # module imports here if they are to be reported in the
00486   # output of versions.bat
00487   # In order for all module versions to be reported, the __all__
00488   # variable in __init__.py of each package needs to be fully
00489   # populated.
00490   from LATTE.client import *
00491   from LATTE.database import *
00492   from LATTE.browser import *
00493   from LATTE.client import *
00494   from LATTE.consumer import *
00495   from LATTE.dispatch import *
00496   from LATTE.gosed import *
00497   from LATTE.logger import *
00498   from LATTE.monitoring import *
00499   from LATTE.monitoring.tools import *
00500   from LATTE.power import *
00501   from LATTE.runcontrol import *
00502   from LATTE.start import *
00503   from LATTE.tests import *
00504   from LATTE.tools import *
00505   from LATTE.trigger import *
00506
00507   import LDF
00508   import qt
00509   import sihippo
00510   import cfitsio
00511
00512   options = gOptions.Options(['server'], ['schema'])
00513   try:
00514     options.parse()
00515   except Exception, msg:
00516     options.usage(str(msg))
00517   else:
00518     cmd = gCmdCli.CmdCli()
00519     ocs = gOCS.GOCS(cmd)
00520     if options.schema is not None:
00521       lat = gLAT.GLAT(cmd)
00522       lat.readSchema(options.schema)
00523       xbrd = gXBR.GXBRD(cmd)
00524       xbrd.readSchema(options.schema)
00525     else:
00526       lat = None
00527       xbrd = None
00528     cmd.connect(options.server)
00529     Gversions.printVersions(ocs, lat, xbrd)
00530     cmd.disconnect()
Generated on Fri Jul 21 13:26:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: gXBR.py Source File

database

gXBR.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "GLAST XBR functional block"
00013 __author__  = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = ("$Date: 2006/07/21 15:13:17 $").split(' ')[1]
00015 __version__ = "$Revision: 2.18 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__ = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import gSchemaConfig
00022
00023 import gDb
00024 import gAttr
00025 import gGLT
00026 import logging as log
00027 from   LATTE.client import gLog
00028 from   LATTE.client import gRegister
00029
00030 class GXBRD(gDb.Gdb):
00031   """\brief Tower controller node Record
00032
00033   Valid Registers:
00034   - \c dac_tem_voltage
00035   - \c dac_tkr_analog_2_5
00036   - \c dac_tkr_digital_2_5
00037   - \c dac_tkr_cal_analog
00038   - \c dac_cal_digital_3_3
00039   - \c path_cmd_resp_reset
00040   - \c path_trigger
00041   - \c path_event
00042   - \c evt_flow_ctrl
00043
00044   Dataless commands:
00045   - \c cmd_tem_hw_reset
00046   """
00047   __regs = [
00048     # Registers
00049     gAttr.GattrReg('dac_tem_voltage',     0, 2),
00050     gAttr.GattrReg('dac_tkr_analog_2_5',  1, 2),
00051     gAttr.GattrReg('dac_tkr_digital_2_5', 2, 2),
00052     gAttr.GattrReg('dac_tkr_cal_analog',  3, 2),
00053     gAttr.GattrReg('dac_cal_digital_3_3', 4, 2),
00054     gAttr.GattrReg('path_cmd_resp_reset', 5, 2),
00055     gAttr.GattrReg('path_trigger',        6, 2),
00056     gAttr.GattrReg('path_event',          7, 2),
00057     gAttr.GattrReg('evt_flow_ctrl',       8, 2, gAttr.REG_WRITE_ONLY),
00058     # Dataless commands
00059     gAttr.GattrDlc('cmd_tem_hw_reset',    0, 0, gAttr.REG_WRITE_ONLY)
00060     ]
00061
00062   def __init__(self, client):
00063     """\brief Initialize valid registers as Gattrs.
00064
00065     Assign default values to members
00066     """
00067     self.GLT = None
00068     self.TWR = gDb.Children(self, GTWR)
00069     self.__schemaComments            = []
00070     self.__schemaName                = ''
00071     self.__configComments            = []
00072     self.__configName                = ''
00073     self.__configVersion             = ''
00074     self.__includeFiles              = []
00075     self.__declarations              = None
00076     self.__configurations            = {}
00077     self.__opaque                    = {}
00078     self.__serialnos                 = {}
00079     self.__excludes                  = {}
00080     gDb.Gdb.__init__(self, client, None, 0, self.__regs)
00081
00082   def read(self, reg):
00083     if reg in (7,8):
00084       log.error("gXBRD.GXBRD:read(): Register no longer available")
00085       gLog.logStack()
00086       return gRegister.Register(0, 0, [0], 'H')
00087     else:
00088       return self.cmdrsp('ggXBRDread', reg, '!H')
00089
00090   def load(self, reg, value):
00091     if reg in (7,8):
00092       log.error("gXBRD.GXBRD:load(): Register no longer available")
00093       gLog.logStack()
00094       return gRegister.Register(0, 0, [0], 'H')
00095     else:
00096       return self.cmdrsp('ggXBRDload', reg, value)
00097
00098   def send(self, cmd):
00099     return self.cmdrsp('ggXBRDcmd', cmd)
00100
00101   def readSchema(self, name):
00102     self.GLT = None
00103     self.TWR = gDb.Children(self, GTWR)
00104     return gSchemaConfig.readSchema(self, name)
00105
00106   def readConfig(self, cfgFileName):
00107     return gSchemaConfig.readConfig(self, cfgFileName)
00108
00109   def applyConfig(self, seq=None):
00110     gSchemaConfig.applyConfig(self, seq)
00111
00112   def getConfigurations(self):
00113     """\brief Get list of configurations.
00114
00115     Return a list of configuration tuples where
00116     each tuple contains the configDOM, configName and configRelease.
00117
00118     \return Configuration tuple list.
00119     """
00120     return self.__configurations
00121
00122   def getDeclarations(self):
00123     """\brief Get list of declarations.
00124
00125     Return a list of declarations
00126
00127     \return Declarations.
00128     """
00129     return self.__declarations
00130
00131   def downGLT(self):
00132     """\brief Navigate to the GGLT
00133
00134     \return The GGLT object instance
00135     """
00136     return self.GLT
00137
00138   def existsGLT(self):
00139     """\brief Check if the GGLT instance exists in the schema.
00140
00141     \return  1 if it exists, 0 if it doesn't.
00142     """
00143     return self.GLT != None
00144
00145   def downTWR(self, twrId):
00146     """\brief Navigate to the GTWR indicated by \a childId
00147
00148     \param  childId The id of the child tower
00149     \return         A GTWR object instance
00150     """
00151     return self.TWR.down(twrId)
00152
00153   def existsTWR(self, twrId):
00154     """\brief Check if the GTWR instance with the id \a twrId
00155     exists in the schema.
00156
00157     \param  twrId Tower id
00158     \return       1 if it exists, 0 if it doesn't.
00159     """
00160     return self.TWR.exists(twrId)
00161
00162 ## private:
00163   def __removeGLT(self):
00164     self.GLT = None
00165
00166   def __addGLT(self):
00167     self.GLT = gGLT.GGLT(self.client(), self)
00168     return self.GLT
00169
00170   def __removeTWR(self, twrId):
00171     self.TWR.remove(twrId)
00172
00173   def __addTWR(self, twrId):
00174     return self.TWR.add(twrId)
00175
00176
00177 class GTWR(gDb.Gdb):
00178   """\brief Tower node Record
00179
00180   Valid Registers:
00181   - \c adc_ps_temp_0
00182   - \c adc_ps_temp_1
00183   - \c adc_tem_temp_0
00184   - \c adc_tem_temp_1
00185   - \c adc_tem_voltage_0
00186   - \c adc_tem_voltage_1
00187   """
00188   __regs = [
00189     # Registers
00190     gAttr.GattrReg('adc_ps_temp_0',     0, 4),
00191     gAttr.GattrReg('adc_ps_temp_1',     1, 4),
00192     gAttr.GattrReg('adc_tem_temp_0',    2, 4),
00193     gAttr.GattrReg('adc_tem_temp_1',    3, 4),
00194     gAttr.GattrReg('adc_tem_voltage_0', 4, 4),
00195     gAttr.GattrReg('adc_tem_voltage_1', 5, 4)
00196     ]
00197
00198   def __init__(self, client, parent, id):
00199     """\brief Initialize valid registers as Gattrs.
00200
00201     Assign default values to members
00202     """
00203     gDb.Gdb.__init__(self, client, parent, id, self.__regs)
00204
00205   def read(self, reg):
00206     return self.cmdrsp('ggTWRread', self.up().addr(), reg, '!I')
00207
00208   def load(self, reg, value):
00209     return self.cmdrsp('ggTWRload', self.up().addr(), reg, value)
Generated on Fri Jul 21 13:26:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskAlarms.py Source File

monitoring

HskAlarms.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Housekeeping server infrastructure"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "07/28/04"
00014 __version__  = "$Revision: 1.9 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019 import time
00020 import sys
00021 import os
00022
00023 from LATTE.tools.gAlert       import *
00024
00025 def sendAlert(value, signal, sender, node, level):
00026   rule   = sender.getRule()
00027   system = rule.subsystem().name()
00028   cat    = rule.category().name()
00029   dispatch = "%s %s" % (system, cat)
00030
00031   if 'MACHINEID' in os.environ:
00032     machine = int(os.environ['MACHINEID'])
00033   else:
00034     machine = 0
00035
00036   measurand = NodeString(node) + sender.getName()
00037   strVal    = str(value)
00038   if sender.getEGU() is not None:
00039     strVal += sender.getEGU().units()
00040
00041   msg = "%s has violated rule %s, causing a %s Alarm.  Value = %s" % \
00042         (measurand, rule.name(), alertDict[level], strVal)
00043   alert( msg, dispatch, level, machine)
00044
00045 def yellowAlert(value, signal, sender, node):
00046   sendAlert(value, signal, sender, node, YELLOWALERT)
00047
00048 def redAlert(value, signal, sender, node):
00049   sendAlert(value, signal, sender, node, REDALERT)
00050
00051 def yellowPrintMessage(value, signal, sender, node):
00052   msg =  'Yellow Alarm: ' + NodeString(node) + sender.getName()
00053   msg += ' is almost out of range: ' + str(value)
00054   if sender.getEGU() is not None:
00055     msg += sender.getEGU().units()
00056   log.warning( msg)
00057
00058 def redPrintMessage(value, signal, sender, node):
00059   msg =  'Red Alarm: ' + NodeString(node) + sender.getName()
00060   msg += ' is out of range: ' + str(value)
00061   if sender.getEGU() is not None:
00062     msg += ' ' + sender.getEGU().units()
00063   log.error(msg)
00064
00065   ### Useful
00066   rs = sender.getRule()
00067   # print "AAAjim: ruleset name=%s, subsys=%s, cat=%s" % ( rs.name(), rs.subsystem().name(), rs.category().name() )
00068
00069
00070 def NodeString(node):
00071   """Useful little recursive function to generate a string representation
00072   of a gDb-like object.
00073
00074   \param node  Any gDb-like object.  (i.e. GLAT, GHSK)
00075   Object must support getName(), up() and id() methods.
00076   """
00077   string = ''
00078   if node is not None:
00079     string += NodeString(node.up())
00080     string += node.getName()
00081     if node.id() is not None:
00082       string += '[' + str(node.id()) + ']'
00083     string += '.'
00084   return string
Generated on Fri Jul 21 13:26:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskCli.py Source File

monitoring

HskCli.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Housekeeping handler client"
00013 __author__   = "Jim Panetta SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2005/01/26 23:35:26 $").split(' ')[1]
00015 __created__  = "2004/08/27"
00016 __version__  = "$Revision: 1.3 $"
00017 __release__  = "$Name: R04-12-00 $"
00018 __credits__  = "SLAC"
00019
00020 import LATTE.copyright_SLAC
00021 import logging as log
00022 import select
00023 import struct
00024 import threading
00025 import time
00026
00027 import LATTE.client.gCommand      as gCommand
00028 import LATTE.client.gSocket       as gSocket
00029 import LATTE.client.gException    as gException
00030
00031
00032 CMD_RX_PORT    = 8000
00033 CMD_TX_PORT    = 8001
00034 TELEM_PORT     = 8002
00035
00036 CMD_RX_SIZE    = 62
00037 CMD_TX_SIZE    = 62
00038 TELEM_SIZE     = 842
00039 HSK_SIZE       = 116
00040
00041
00042 class HskCli(object):
00043   """\brief Housekeeping client input/output class
00044
00045   This class instantiates and controls the sockets for the housekeeping process.
00046   """
00047   def __init__(self, handler=None):
00048     self.__cmdRx = HskCmdRxSocket(handler)
00049     self.__cmdTx = HskCmdTxSocket(handler)
00050     self.__telem = HskTelemSocket(handler)
00051     self.readCmdRx = self.__cmdRx.read
00052     self.readCmdTx = self.__cmdTx.read
00053     self.readTelem = self.__telem.read
00054
00055   def connect(self, server):
00056     """\brief connect method
00057
00058     \param server  the hostname where the housekeeping server process runs
00059     connect the housekeeping system to the housekeeping server
00060     """
00061     self.__cmdRx.connect(server)
00062     self.__cmdTx.connect(server)
00063     self.__telem.connect(server)
00064     self.readCmdRx = self.__cmdRx.read
00065     self.readCmdTx = self.__cmdTx.read
00066     self.readTelem = self.__telem.read
00067
00068   def disconnect(self):
00069     """\brief disconnect method
00070
00071     disconnect the housekeeping system from housekeeping server
00072     """
00073     self.__cmdRx.disconnect()
00074     self.__cmdTx.disconnect()
00075     self.__telem.disconnect()
00076
00077   def handler(self, newhandler):
00078     self.__cmdRx.handler(newhandler)
00079     self.__cmdTx.handler(newhandler)
00080     self.__telem.handler(newhandler)
00081
00082 class ccsdsSocket(gSocket.Socket):
00083   UNPACK_ERROR   = -1001
00084
00085   def __init__(self, handler=None, debug=0, port=0):
00086     gSocket.Socket.__init__(self, port)
00087     self.__handler = handler
00088
00089     self.__timeout         = 30
00090     self.__timeoutEnabled  = False
00091     self.read              = None
00092
00093   def connect(self, host):
00094     gSocket.Socket.connect(self, host)
00095     self.read = self.readCCSDS
00096
00097   def disconnect(self):
00098     gSocket.Socket.disconnect(self)
00099     self.read = None
00100
00101   def handler(self, newhandler):
00102     self.__handler = newhandler
00103
00104   def readCCSDS(self):
00105     """\brief CCSDS read routine.
00106
00107     This routine does the minimal work of reading the raw CCSDS
00108     data from a socket.
00109
00110     \return socket buffer read
00111     """
00112     self.lock()
00113     try:
00114       # read CCSDS primary header...
00115       dat = self.recvall(6)
00116       h = struct.unpack('!HHH',dat)
00117       # CCSDS packet length encoding:
00118       #   h[2] = 2ndary hdr (8) + payload (102) - 1
00119       #   total bytes left = h[2] + 1
00120       numLeft = h[2] + 1
00121       dat += self.recvall(numLeft)
00122       self.release()
00123     except:
00124       self.release()
00125       if self.__handler is not None:
00126         self.__handler.timedout()
00127       status = gException.LATInterfaceStatus.status('OCS_TMO')
00128       raise gException.LATInterfaceException(status)
00129
00130     if len(dat) == 0:
00131       if self.__handler is not None:
00132         self.__handler.disconnected()
00133       status = gException.LATInterfaceStatus.status('OCS_NOSRV')
00134       raise gException.LATInterfaceException(status)
00135
00136     return (0, dat)
00137
00138   def setTimeoutEnabled(self, flag):
00139     """\brief Enable or disable event timeout
00140
00141     \param flag 1 = Enable event timeout
00142                 0 = Disable event timeout (default)
00143     """
00144     self.__timeoutEnabled = flag;
00145
00146   def isTimeoutEnabled(self):
00147     """\brief Checks the event timeout state
00148
00149     \return 1 = If event timeout is enabled
00150             0 = If event timeout is disabled
00151     """
00152     return self.__timeoutEnabled
00153
00154   def setTimeout(self, timeout):
00155     """\brief Set the timeout value.
00156
00157     \param timeout Event timeout value as a floating point number in seconds.
00158                    Default is 1 second.
00159     """
00160     self.__timeout = timeout
00161
00162   def getTimeout(self):
00163     """\brief Query the current timeout value.
00164
00165     \return Current event timeout value as a floating point number in seconds
00166     """
00167     return self.__timeout
00168
00169 class HskCmdRxSocket(ccsdsSocket):
00170   def __init__(self, handler=None, debug=0, port=CMD_RX_PORT):
00171     ccsdsSocket.__init__(self, handler, debug, port)
00172
00173 class HskCmdTxSocket(ccsdsSocket):
00174   def __init__(self, handler=None, debug=0, port=CMD_TX_PORT):
00175     ccsdsSocket.__init__(self, handler, debug, port)
00176
00177 class HskTelemSocket(ccsdsSocket):
00178   def __init__(self, handler=None, debug=0, port=TELEM_PORT):
00179     ccsdsSocket.__init__(self, handler, debug, port)
00180
00181
00182 class ConnectState:
00183   Disconnected = 0
00184   Waiting      = 1
00185   Connected    = 2
00186
00187 class HskHandler(object):
00188   """\brief HskHandler class
00189
00190   Defines connection protocol to hsk server.
00191   This class needs to define two calls:  disconnected and timeout.
00192
00193   Inherit from this to create GUI versions of HskSvr
00194   """
00195   def __init__(self, server, host):
00196     self.__server = server
00197     self.__host   = host
00198     server.handler(self)
00199     self.__connection_state = ConnectState.Disconnected    # disconnected at startup
00200     self.connect()
00201
00202   def connect(self):
00203     """\brief connect
00204
00205     Connect to the command/hsk server
00206     """
00207     self.__connection_state = ConnectState.Waiting
00208     self.__tries = 0
00209     self.__connect()
00210
00211   def disconnected(self):
00212     """\brief disconnected
00213
00214     """
00215     self.__disconnect()
00216
00217   def timedout(self):
00218     """\brief timedout
00219     """
00220     self.__disconnect()
00221
00222   def __disconnect(self):
00223     # disconnect from the server
00224     self.__server.disconnect()
00225     # deal with the outcome of disconnecting
00226     self.__connection_notthere()
00227
00228   def __connect(self):
00229     # spawn the connecting thread in the background
00230     connecthdlr = threading.Thread(None, self.__connection_handler, 'ConnectHandler',())
00231     connecthdlr.setDaemon(True)
00232     connecthdlr.start()
00233
00234   def __connection_handler(self):
00235     while (True):
00236       try:
00237         self.__server.connect(self.__host)
00238         log.info("HSK server is now connected")
00239         self.__connection_state = ConnectState.Connected
00240         self.__tries = 0
00241         break
00242       except RuntimeError, msg:
00243         if self.__tries == 0:
00244           log.error(msg)
00245         self.__tries += 1
00246         state = self.__connection_state
00247         if state == ConnectState.Disconnected: break
00248         time.sleep(3)
00249
00250   def __connection_notthere(self):
00251     # Do this once...
00252     if self.__connection_state == ConnectState.Connected:
00253       log.error("HSK server disconnected, trying to reconnect")
00254       self.__connection_state = ConnectState.Waiting
00255       self.__connect()
00256
00257
Generated on Fri Jul 21 13:26:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskCollector.py Source File

monitoring

HskCollector.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Housekeeping server infrastructure"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "10/06/04"
00014 __version__  = "$Revision: 1.8 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import logging as log
00021 import logging.handlers
00022 import sys
00023
00024 # base classes
00025 from LATTE.monitoring.Collector    import Collector
00026 from ConfigParser                  import *
00027
00028 from LATTE.client.gCmdCli          import CmdCli
00029 from LATTE.database.gLAT           import GLAT
00030 from LATTE.database.gHSK           import GHSK
00031 from LATTE.monitoring.HskCli       import *
00032 from LATTE.logger.socketLogging    import socketLogging
00033 from LATTE.tools.gAlert            import *
00034
00035
00036 class HskConfiguration(ConfigParser):
00037   """
00038   """
00039   def __init__(self):
00040     ConfigParser.__init__(self)
00041     self.__fileName = None
00042
00043   def read(self, fileName):
00044     self.__fileName = fileName
00045     ConfigParser.read(self, fileName)
00046
00047   def verify(self):
00048     # test the config for required parameters
00049     cSect    = self.sections()
00050     REQUIRED = ('core', 'database', 'inputs')
00051     for sect in REQUIRED:
00052       if sect not in cSect:
00053         msg = 'Config file %s is missing required section: %s' % ( self.__fileName, sect )
00054         raise KeyError, msg
00055
00056     # core check
00057     coItems  = self.options('core')
00058     REQUIRED = ('loghost',)
00059     for item in REQUIRED:
00060       if item not in coItems:
00061         msg = 'Config file %s is missing required key %s in core section' % ( self.__fileName, item )
00062         raise KeyError, msg
00063
00064     # database check
00065     dbItems  = self.options('database')
00066     REQUIRED = ('type',)
00067     for item in REQUIRED:
00068       if item not in dbItems:
00069         msg = 'Config file %s is missing required key %s in database section' % ( self.__fileName,item )
00070         raise KeyError, msg
00071
00072     # inputs check
00073     inItems  = self.options('inputs')
00074     REQUIRED = ('latschema', 'hskschema', 'server', 'packet')
00075     for item in REQUIRED:
00076       if item not in inItems:
00077         msg = 'Config file %s is missing required key %s in inputs section' % ( self.__fileName, item )
00078         raise KeyError, msg
00079
00080
00081 class HskCollector(Collector):
00082   """\brief Configurable housekeeping collector
00083
00084   Takes a HskConfiguration object as input.
00085   """
00086   def __init__(self, config):
00087     Collector.__init__(self)
00088
00089     # connect to the message logger and configure logging.
00090     logHost = config.get('core', 'loghost')
00091     if logHost is not "None":
00092       # Needs to be done before the first call to log
00093       if config.has_option('core', 'loglevel'):
00094         # Logger has levels like DEBUG CRITICAL, etc.  must be upper
00095         logLevel = config.get('core', 'loglevel').upper()
00096       else:
00097         logLevel = "DEBUG"
00098       socketLogging(logHost, logLevel)
00099
00100     # Required inputs.  Checked in setup of configuration
00101     latSchema = config.get('inputs', 'latSchema')
00102     hskSchema = config.get('inputs', 'hskSchema')
00103     cmdServer = config.get('inputs', 'server')
00104
00105
00106     # set up command client
00107     self.__cmdCli     = CmdCli()
00108     self.__cmdHandler = HskHandler(self.__cmdCli, cmdServer)
00109
00110     # set up LAT database (Needed for commanding)
00111     self.__latDB = GLAT(self.__cmdCli)
00112     self.__latDB.readSchema(latSchema)
00113
00114     # set up HSK database
00115     self.__hskDB      = GHSK(self.__cmdCli)
00116     self.__hskDB.readSchema(hskSchema)
00117     self.__hskDB.applyConfig(None)
00118
00119     # Delay setting is optional, default = 10 seconds
00120     try:
00121       self.setDelay(config.getint('core', 'delay'))
00122     except:
00123       pass
00124
00125     # set up retrievers
00126     if config.getboolean('inputs', 'packet'):
00127       # HskPacket reads
00128       log.debug("Adding HskPacketRetriever to HSK fabric")
00129       from LATTE.monitoring.HskCli             import HskCli
00130       from LATTE.monitoring.HskPacketRetriever import HskPacketRetriever
00131       self.__hskCli     = HskCli()
00132       self.__hskHandler = HskHandler(self.__hskCli, cmdServer)
00133       self.addRetriever( "HSK", HskPacketRetriever(self.__hskCli) )
00134       # no delay in packetized housekeeping.  Camp on the connection.
00135       self.setDelay(0)
00136     else:
00137       # LAT single register reads
00138       log.debug("Adding HskLatRetriever to HSK fabric")
00139       from LATTE.monitoring.HskRetriever       import HskLatRetriever
00140       self.addRetriever( "HSK", HskLatRetriever(self.__latDB) )
00141
00142     # set up recorders:
00143     # Alarming system
00144     from LATTE.monitoring.HskRecorder          import HskAlarmRecorder
00145     self.addRecorder( HskAlarmRecorder(self.__hskDB) )
00146
00147     # Systems to write data out
00148     if config.get('database', 'type') == 'sql':
00149       # set up SQL recorder
00150       log.debug("Attempting to add HskSqlRecorder to HSK fabric")
00151       import MySQLdb
00152       from LATTE.monitoring.HskSqlInterface   import HskSqlRecorder
00153       host = config.get('database', 'host')
00154       user = config.get('database', 'user')
00155       src  = config.getint('database', 'machineid')
00156
00157       log.debug("Connecting to database on %s" % host)
00158       sqlDB = MySQLdb.connect(host=host, db='itosdb', user=user)
00159       self.addRecorder(HskSqlRecorder(self.__hskDB, sqlDB.cursor(), src))
00160     else:
00161       # text/flatfile database
00162       log.debug("Attempting to add HskFileRecorder to HSK fabric")
00163       dataFile = config.get('database', 'datafile')
00164       from LATTE.monitoring.HskRecorder       import HskFileRecorder
00165       self.addRecorder(HskFileRecorder(self.__hskDB, dataFile))
00166
00167     # optional UDP broadcast
00168     if config.has_section('udp') & config.getboolean('udp', 'broadcast'):
00169       log.debug("Attempting to add UDPRecorder to HSK fabric")
00170       from LATTE.monitoring.Recorder          import UDPRecorder
00171       serverName = config.get('udp', 'serverName')
00172       serverAddr = config.get('udp', 'serverAddr')
00173
00174       udpR = UDPRecorder()
00175       udpR.startUDPServer(serverName,serverAddr)
00176       self.addRecorder(udpR)
00177
00178     # alert("test alert 1 from hsk system", "LATTE")
00179
00180   def latDB(self): return self.__latDB
00181   def hskDB(self): return self.__hskDB
00182
00183
00184
00185
00186
00187
Generated on Fri Jul 21 13:26:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskGuiReceiver.py Source File

monitoring

HskGuiReceiver.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Housekeeping server infrastructure"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "07/28/04"
00014 __version__  = "$Revision: 1.9 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 from LATTE.monitoring.HskReceiver import HskCfgTextReceiver
00021 from LATTE.client.gOptions        import Options
00022
00023 import logging
00024 import gc,sys
00025 from   linecache import *
00026 import time
00027 import qt
00028 from sihippo import Observer
00029 import sihippo
00030
00031 second  = 1
00032 minute  = 60 * second
00033 hour    = minute * 60
00034 day     = hour * 24
00035 era     = 10**9
00036
00037 timeFmt      = '%H:%M:%S'
00038 dataFile     = None
00039 timeDepth    = 2*hour
00040
00041 class QtReceiver(qt.QObject,HskCfgTextReceiver):
00042
00043   class TrendUpdateEvent(qt.QCustomEvent):
00044     def __init__(self,trendMap):
00045       qt.QCustomEvent.__init__(self,qt.QEvent.MaxUser-20)
00046       self.trendMap = trendMap
00047
00048   def __init__(self, flatFile, startTime, trendList):
00049     HskCfgTextReceiver.__init__(self, flatFile, startTime, trendList)
00050     qt.QObject.__init__(self)
00051
00052   def process(self,trendMap):
00053     qt.QApplication.postEvent(self,QtReceiver.TrendUpdateEvent(trendMap))
00054
00055   def customEvent(self,event):
00056     self.emit(qt.PYSIGNAL('TrendUpdate(trendMap)'),(event.trendMap,))
00057
00058
00059
00060 class TrendPlotter(qt.QWidget):
00061   def __init__(self,keyList,*args):
00062     qt.QWidget.__init__(self,*args)
00063
00064     self.__ntuples       = {}
00065     self.__plots         = {}
00066     self.__views         = {}
00067     self.__gen           = {}
00068     self.__defaultDepth  = 500                 # assuming 1 hz data rate
00069     self.__defaultLabels = ['Time','']
00070
00071     self.__dynamic       = True
00072     self.__keyList       = keyList
00073
00074     self.grid            = qt.QGridLayout(self,3,2)
00075     self.grid.setAutoAdd(1)
00076     self.true            = True
00077
00078   def isDynamic(self):
00079     return self.__dynamic
00080   def setDynamic(self,bool):
00081     self.__dynamic=bool
00082
00083   def addPlot(self, key):
00084     labels  = self.__defaultLabels
00085     depth   = self.__defaultDepth
00086     name    = self.__keyList[key]
00087
00088     # Create the Circular buffer to store the data
00089     ntc     = sihippo.NTupleController.instance()
00090     nt      = ntc.createCircularBuffer(labels)
00091     nt.reserve(depth)
00092     nt.setTitle(name)
00093     nt.setName(name)
00094
00095     # Create the Plot
00096     dc      = sihippo.DisplayController.instance()
00097     plot=dc.createDisplay('XY Plot',nt,labels)
00098     # plot    = dc.createDisplay('Strip Chart',nt,labels)
00099
00100     # kludge so that the range is initialized, and autoscales when we need.
00101     plot.setRange('x',0,1)
00102     plot.setAutoRanging('x',True)
00103
00104     # Add the time axis observer
00105     gen     = TimeAxisGen()
00106     gen.setPlotter(plot, key)
00107     plot.addObserver(gen)
00108
00109     # Add the plot to the screen
00110     view    = sihippo.QtViewWidget(self)
00111     view.setPlotter(plot)
00112     view.setDoubleBuffering(1)
00113     view.resize(200,100)
00114     view.setMinimumSize(qt.QSize(100,50))
00115     # self.grid.addWidget(view)
00116     view.show()
00117
00118     # Maintain a reference to the created objects to prevent garbage collection
00119     self.__ntuples[key]  = nt
00120     self.__plots[key]    = plot
00121     self.__views[key]    = view
00122     self.__gen[key]      = gen
00123
00124   def update(self, trendMap):
00125     # if not self.true: return
00126     self.true=False
00127     # trendMap has timestamp, val1, val2, val3...
00128     timeStamp = trendMap['TimeStamp']
00129     for key in trendMap:
00130       if key == 'TimeStamp': continue
00131       if key not in self.__views.keys() and self.__dynamic:
00132         self.addPlot(key)
00133       if key not in self.__views.keys():
00134         return
00135       x=timeStamp
00136       y=trendMap[key]
00137       if y is None:
00138         continue
00139       self.__ntuples[key].addRow([x,y])
00140
00141 class TimeAxisGen ( Observer ) :
00142   __labelFmt   = '%Y/%m/%d'
00143   __tickFmt    = '%H:%M'
00144   __stepSet    = [ 1*second, 5*second, 10*second, 30*second,
00145                    1*minute, 2*minute, 5*minute, 10*minute, 15*minute, 20*minute, 30*minute,
00146                    1*hour, 2*hour, 6*hour, 12*hour,
00147                    1*day, 3*day, 7*day, 30*day, 90*day, 180*day, 364*day,
00148                    era]
00149
00150   def setPlotter ( self, plotter, name ) :
00151     self.plotter = plotter
00152     self.name    = name
00153     self.__goodStep = 0
00154
00155   def update ( self, obs ) :
00156     # return
00157     lowTime = self.plotter.getLowRangeOnX()
00158     highTime = self.plotter.getHighRangeOnX()
00159
00160     if ((highTime - lowTime)/TimeAxisGen.__stepSet[self.__goodStep]) < 1:
00161       # print "reset of goodStep", self.name, self.__goodStep , highTime, lowTime,  ((highTime - lowTime)/TimeAxisGen.__stepSet[self.__goodStep])
00162       self.__goodStep -= 1
00163     if ((highTime - lowTime)/TimeAxisGen.__stepSet[self.__goodStep]) > 6:
00164       # print self.name, highTime, lowTime,  ((highTime - lowTime)/TimeAxisGen.__stepSet[self.__goodStep])
00165       step = 0
00166       while ((highTime - lowTime)/TimeAxisGen.__stepSet[step]) > 5:
00167         # print "step:", step
00168         step += 1
00169       self.__goodStep = step
00170     step = TimeAxisGen.__stepSet[self.__goodStep]
00171
00172     lowTick = lowTime - (lowTime % step) + step
00173     values = []
00174     values.append( lowTick )
00175
00176     labels = []
00177     labels.append( time.strftime(TimeAxisGen.__tickFmt, time.localtime(lowTick)) )
00178     tick = lowTick
00179     tick += step
00180     while tick < highTime:
00181       values.append ( tick )
00182       labels.append ( time.strftime(TimeAxisGen.__tickFmt, time.localtime(tick)) )
00183       tick += step
00184
00185     self.plotter.setAutoTicksOnX( False )
00186     self.plotter.setTicksOnX( values, labels )
00187
00188     # REALLY REALLY don't do this:
00189     #   setLabel calls "notifyObservers", which brings us back here...
00190     # xlabel = time.strftime(TimeAxisGen.__labelFmt, time.localtime(highTime))
00191     # self.plotter.setLabel( 'x', xlabel )
00192
00193 def memget():
00194   import win32pdh
00195   hq = win32pdh.OpenQuery()
00196   # ch = win32pdh.AddCounter(hq, "\\\\gitow1\\Process(python)\\Private Bytes")
00197   ch = win32pdh.AddCounter(hq, "\\\\gitow1\\Process(python#1)\\Private Bytes")
00198   win32pdh.CollectQueryData(hq)
00199   type, val =win32pdh.GetFormattedCounterValue(ch,win32pdh.PDH_FMT_LONG)
00200   return val
00201
00202 def startup():
00203   # print memget()
00204   logging.basicConfig()
00205   logging.root.setLevel(logging.DEBUG)
00206   gc.set_debug(gc.DEBUG_LEAK)
00207   print "Garbage collection: ", gc.isenabled()#, gc.get_objects()
00208
00209 def startQT(dataFile, startTime, keyList):
00210   import sys
00211
00212   app=qt.QApplication(sys.argv)
00213   r=QtReceiver(dataFile, startTime, keyList.keys())
00214
00215   gui=TrendPlotter(keyList)
00216   gui.connect(r,qt.PYSIGNAL('TrendUpdate(trendMap)'),gui.update)
00217
00218   app.connect(app,qt.SIGNAL("lastWindowClosed()"),
00219               app,qt.SLOT("quit()"))
00220
00221   app.setMainWidget(gui)
00222   gui.show()
00223
00224   r.setReceiving(1)
00225   app.exec_loop()
00226   r.shutdown()
00227
00228 def usage():
00229   return """
00230
00231 HskGuiReceiver Usage:
00232
00233 Mandatory options:
00234 --dataFile  define the flat file that contains housekeeping data.
00235
00236 Optional options:
00237 --timeDepth define the time depth of the housekeeping plots.  Default is 2 hours.
00238             Units are in seconds
00239 --keyFile   define the file of variables to plot
00240             Note: keyFile format is "KEY  :  Plot title"
00241
00242 Example:
00243 $ HskGuiReceiver --dataFile c:\TEMP\lat-elf11.dat --timeDepth 3600 --keyFile keys.dat
00244
00245 """
00246
00247
00248 if __name__ == '__main__':
00249   startup()
00250
00251   # Options, first list mandatory, second list optional
00252   options = Options(['dataFile'], ['timeDepth', 'keyFile'])
00253   try:
00254     options.parse()
00255   except Exception, msg:
00256     options.usage()
00257     raise Exception, msg
00258
00259   dataFile = options.dataFile
00260   if options.timeDepth is not None:
00261     timeDepth = int(options.timeDepth)
00262   else:
00263     timeDepth = 2*hour
00264   startTime = time.time() - timeDepth
00265
00266   if options.keyFile is not None:
00267     keyFile = options.keyFile
00268     from HskReceiver import parseKeyFile
00269     keyList = parseKeyFile(keyFile)
00270   else:  # really really basic set of histos.
00271     keyList = {'LHKAEMDAQB33V':'AEM DAQ board 3.3 V',
00272                'LHKAEMFR11T'  :'AEM Free board 11 Temp',
00273                'LHKAEMDAQBT'  :'AEM DAQ board Temp',
00274                'LHKAEMFR11V1' :'AEM Free 11 HV 1',
00275                'LHKAEMFR11V2' :'AEM Free 11 HV 2',
00276                'LHKAEMFR11VD' :'AEM Free 11 VDD',
00277                }
00278
00279   startQT(dataFile, startTime, keyList)
00280
Generated on Fri Jul 21 13:26:29 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacket.py Source File

monitoring

HskPacket.py

00001 __version__  = "$Revision: 1.2 $"
00002 from LATTE.monitoring.HskPacketDecoder import HskPacketBase
00003
00004 class HskPacket(HskPacketBase):
00005   bitDict = {
00006     'ADCV': 12,
00007     'ADCS': 4,
00008     'TSP8': 8,
00009     'PDUCRATEPWR': 16,
00010     'PDUTEMPWR': 16,
00011     'PDUACDPWR': 16,
00012     'PDUEPUPWRST': 1,
00013     'PDUEPUCVTST': 1,
00014     'TSP1': 1,
00015     'PDUTEMPWRST': 1,
00016     'PDUACDPWRST': 1,
00017     'PDUACDCNVT': 1,
00018     'PDUACDPWRSUP': 1,
00019     'CALBIASDAC': 16,
00020     'AEMFRPWRST': 1,
00021     'TSP16': 16,
00022     'GEMLRSLIVE': 32,
00023     'GEMPRSCL': 32,
00024     'GEMLRSDISC': 32,
00025     'FILESTATE': 32,
00026     'FILESIZETOT': 32,
00027     'FILESIZECUR': 32,
00028     'FILESIZECOM': 32,
00029     'FILEPKTCNT': 32,
00030     'FILEOFFCUT': 32,
00031     'FILERRCODE': 32,
00032     'FILERRCNT': 32,
00033     'FILEBUFADR': 32,
00034     'FILEIDCOM': 32,
00035     'CMDCNTS': 32,
00036     'CMDDISPF': 16,
00037     'CMDEXEF': 32,
00038     'TIMESEC': 32,
00039     'TIMESUBSEC': 32,
00040     'GEMLRSSENT': 32,
00041     'TSP13': 13,
00042     'TSP4': 4,
00043     'TSP10': 10,
00044     'CPUJT': 32,
00045     'RTERR': 32,
00046     'INTRCNT': 32,
00047     'CRXPCNT': 32,
00048     'CRXBCNT': 32,
00049     'CTXPCNT': 32,
00050     'CTXBCNT': 32,
00051     'HKPCNT': 32,
00052     'HKBCNT': 32,
00053     'TLMPCNT': 32,
00054     'TLMBCNT': 32,
00055     'RLCNT': 16,
00056     'RLLIM': 16,
00057     'RLDEV': 16,
00058     'RLADC': 16,
00059     'MLDSTAT': 32,
00060     'MLDACT': 32,
00061     'MLDSTADR': 32,
00062     'MLDBYTS': 32,
00063     'MLDOFF': 32,
00064     'MDPSTAT': 32,
00065     'MDPACT': 32,
00066     'MDPSTADR': 32,
00067     'MDPBYTS': 32,
00068     'MDPADDR': 32,
00069     'MDPFCD': 32,
00070     'MDPTXID': 32,
00071     'AVGLDSEC': 32,
00072     'AVGLDMIN': 32,
00073     'MAXLDMIN': 32,
00074     'MINLDMIN': 32,
00075     'PIDSTAT': 16,
00076     'GBMPIDP': 1,
00077     'GBMPIDR': 1,
00078     'SCPIDIN0': 1,
00079     'SCPIDIN1': 1,
00080     'SCPIDIN2': 1,
00081     'SensorHpNum': 4,
00082     'SensorStatus': 4,
00083     'ActiveHtPipe': 16,
00084     'RawAdcStatVal': 16,
00085     'TempCelsius': 16,
00086     'HeaterCmdMask': 16,
00087     'SensorType': 4,
00088   }
00089   def __init__(self, ui):
00090     HskPacketBase.__init__(self, ui)
00091
00092 class HskPacket210(HskPacket):
00093   mnemList = [
00094     ('LHKSPARE08', 'TSP8'),
00095     ('LHKSPARE08', 'TSP8'),
00096     ('LHKSPARE08', 'TSP8'),
00097     ('LHKSPARE08', 'TSP8'),
00098     ('LHKSPARE08', 'TSP8'),
00099     ('LHKSPARE08', 'TSP8'),
00100     ('LHKT0TKR25VDST', 'ADCS'),
00101     ('LHKT0TKR25VD', 'ADCV'),
00102     ('LHKSPARE16', 'TSP16'),
00103     ('LHKT0TKR15VAAST', 'ADCS'),
00104     ('LHKT0TKR15VAA', 'ADCV'),
00105     ('LHKSPARE16', 'TSP16'),
00106     ('LHKT0TKR25VABST', 'ADCS'),
00107     ('LHKT0TKR25VAB', 'ADCV'),
00108     ('LHKSPARE16', 'TSP16'),
00109     ('LHKT0TKRBV0ST', 'ADCS'),
00110     ('LHKT0TKRBV0', 'ADCV'),
00111     ('LHKSPARE16', 'TSP16'),
00112     ('LHKT0CAL33VDST', 'ADCS'),
00113     ('LHKT0CAL33VD', 'ADCV'),
00114     ('LHKT0TKRBV1ST', 'ADCS'),
00115     ('LHKT0TKRBV1', 'ADCV'),
00116     ('LHKT0CAL33VAST', 'ADCS'),
00117     ('LHKT0CAL33VA', 'ADCV'),
00118     ('LHKT0CALBSV1ST', 'ADCS'),
00119     ('LHKT0CALBSV1', 'ADCV'),
00120     ('LHKT0CALBSV0ST', 'ADCS'),
00121     ('LHKT0CALBSV0', 'ADCV'),
00122     ('LHKT0TEM28V0ST', 'ADCS'),
00123     ('LHKT0TEM28V0', 'ADCV'),
00124     ('LHKT0TEM33VST', 'ADCS'),
00125     ('LHKT0TEM33V', 'ADCV'),
00126     ('LHKT0TEM28V1ST', 'ADCS'),
00127     ('LHKT0TEM28V1', 'ADCV'),
00128     ('LHKT1TKR25VDST', 'ADCS'),
00129     ('LHKT1TKR25VD', 'ADCV'),
00130     ('LHKSPARE16', 'TSP16'),
00131     ('LHKT1TKR15VAAST', 'ADCS'),
00132     ('LHKT1TKR15VAA', 'ADCV'),
00133     ('LHKSPARE16', 'TSP16'),
00134     ('LHKT1TKR25VABST', 'ADCS'),
00135     ('LHKT1TKR25VAB', 'ADCV'),
00136     ('LHKSPARE16', 'TSP16'),
00137     ('LHKT1TKRBV0ST', 'ADCS'),
00138     ('LHKT1TKRBV0', 'ADCV'),
00139     ('LHKSPARE16', 'TSP16'),
00140     ('LHKT1CAL33VDST', 'ADCS'),
00141     ('LHKT1CAL33VD', 'ADCV'),
00142     ('LHKT1TKRBV1ST', 'ADCS'),
00143     ('LHKT1TKRBV1', 'ADCV'),
00144     ('LHKT1CAL33VAST', 'ADCS'),
00145     ('LHKT1CAL33VA', 'ADCV'),
00146     ('LHKT1CALBSV1ST', 'ADCS'),
00147     ('LHKT1CALBSV1', 'ADCV'),
00148     ('LHKT1CALBSV0ST', 'ADCS'),
00149     ('LHKT1CALBSV0', 'ADCV'),
00150     ('LHKT1TEM28V0ST', 'ADCS'),
00151     ('LHKT1TEM28V0', 'ADCV'),
00152     ('LHKT1TEM33VST', 'ADCS'),
00153     ('LHKT1TEM33V', 'ADCV'),
00154     ('LHKT1TEM28V1ST', 'ADCS'),
00155     ('LHKT1TEM28V1', 'ADCV'),
00156     ('LHKT2TKR25VDST', 'ADCS'),
00157     ('LHKT2TKR25VD', 'ADCV'),
00158     ('LHKSPARE16', 'TSP16'),
00159     ('LHKT2TKR15VAAST', 'ADCS'),
00160     ('LHKT2TKR15VAA', 'ADCV'),
00161     ('LHKSPARE16', 'TSP16'),
00162     ('LHKT2TKR25VABST', 'ADCS'),
00163     ('LHKT2TKR25VAB', 'ADCV'),
00164     ('LHKSPARE16', 'TSP16'),
00165     ('LHKT2TKRBV0ST', 'ADCS'),
00166     ('LHKT2TKRBV0', 'ADCV'),
00167     ('LHKSPARE16', 'TSP16'),
00168     ('LHKT2CAL33VDST', 'ADCS'),
00169     ('LHKT2CAL33VD', 'ADCV'),
00170     ('LHKT2TKRBV1ST', 'ADCS'),
00171     ('LHKT2TKRBV1', 'ADCV'),
00172     ('LHKT2CAL33VAST', 'ADCS'),
00173     ('LHKT2CAL33VA', 'ADCV'),
00174     ('LHKT2CALBSV1ST', 'ADCS'),
00175     ('LHKT2CALBSV1', 'ADCV'),
00176     ('LHKT2CALBSV0ST', 'ADCS'),
00177     ('LHKT2CALBSV0', 'ADCV'),
00178     ('LHKT2TEM28V0ST', 'ADCS'),
00179     ('LHKT2TEM28V0', 'ADCV'),
00180     ('LHKT2TEM33VST', 'ADCS'),
00181     ('LHKT2TEM33V', 'ADCV'),
00182     ('LHKT2TEM28V1ST', 'ADCS'),
00183     ('LHKT2TEM28V1', 'ADCV'),
00184     ]
00185   def __init__(self, ui):
00186     HskPacket.__init__(self, ui)
00187     self.name  = "TemEnvPwr0"
00188     self.brief = "TEM Power Packet 0"
00189     self.descr = "Contains power specific ADC values for TEMs 0, 1, and 2."
00190     self.read()
00191
00192
00193 class HskPacket211(HskPacket):
00194   mnemList = [
00195     ('LHKSPARE08', 'TSP8'),
00196     ('LHKSPARE08', 'TSP8'),
00197     ('LHKSPARE08', 'TSP8'),
00198     ('LHKSPARE08', 'TSP8'),
00199     ('LHKSPARE08', 'TSP8'),
00200     ('LHKSPARE08', 'TSP8'),
00201     ('LHKT3TKR25VDST', 'ADCS'),
00202     ('LHKT3TKR25VD', 'ADCV'),
00203     ('LHKSPARE16', 'TSP16'),
00204     ('LHKT3TKR15VAAST', 'ADCS'),
00205     ('LHKT3TKR15VAA', 'ADCV'),
00206     ('LHKSPARE16', 'TSP16'),
00207     ('LHKT3TKR25VABST', 'ADCS'),
00208     ('LHKT3TKR25VAB', 'ADCV'),
00209     ('LHKSPARE16', 'TSP16'),
00210     ('LHKT3TKRBV0ST', 'ADCS'),
00211     ('LHKT3TKRBV0', 'ADCV'),
00212     ('LHKSPARE16', 'TSP16'),
00213     ('LHKT3CAL33VDST', 'ADCS'),
00214     ('LHKT3CAL33VD', 'ADCV'),
00215     ('LHKT3TKRBV1ST', 'ADCS'),
00216     ('LHKT3TKRBV1', 'ADCV'),
00217     ('LHKT3CAL33VAST', 'ADCS'),
00218     ('LHKT3CAL33VA', 'ADCV'),
00219     ('LHKT3CALBSV1ST', 'ADCS'),
00220     ('LHKT3CALBSV1', 'ADCV'),
00221     ('LHKT3CALBSV0ST', 'ADCS'),
00222     ('LHKT3CALBSV0', 'ADCV'),
00223     ('LHKT3TEM28V0ST', 'ADCS'),
00224     ('LHKT3TEM28V0', 'ADCV'),
00225     ('LHKT3TEM33VST', 'ADCS'),
00226     ('LHKT3TEM33V', 'ADCV'),
00227     ('LHKT3TEM28V1ST', 'ADCS'),
00228     ('LHKT3TEM28V1', 'ADCV'),
00229     ('LHKT4TKR25VDST', 'ADCS'),
00230     ('LHKT4TKR25VD', 'ADCV'),
00231     ('LHKSPARE16', 'TSP16'),
00232     ('LHKT4TKR15VAAST', 'ADCS'),
00233     ('LHKT4TKR15VAA', 'ADCV'),
00234     ('LHKSPARE16', 'TSP16'),
00235     ('LHKT4TKR25VABST', 'ADCS'),
00236     ('LHKT4TKR25VAB', 'ADCV'),
00237     ('LHKSPARE16', 'TSP16'),
00238     ('LHKT4TKRBV0ST', 'ADCS'),
00239     ('LHKT4TKRBV0', 'ADCV'),
00240     ('LHKSPARE16', 'TSP16'),
00241     ('LHKT4CAL33VDST', 'ADCS'),
00242     ('LHKT4CAL33VD', 'ADCV'),
00243     ('LHKT4TKRBV1ST', 'ADCS'),
00244     ('LHKT4TKRBV1', 'ADCV'),
00245     ('LHKT4CAL33VAST', 'ADCS'),
00246     ('LHKT4CAL33VA', 'ADCV'),
00247     ('LHKT4CALBSV1ST', 'ADCS'),
00248     ('LHKT4CALBSV1', 'ADCV'),
00249     ('LHKT4CALBSV0ST', 'ADCS'),
00250     ('LHKT4CALBSV0', 'ADCV'),
00251     ('LHKT4TEM28V0ST', 'ADCS'),
00252     ('LHKT4TEM28V0', 'ADCV'),
00253     ('LHKT4TEM33VST', 'ADCS'),
00254     ('LHKT4TEM33V', 'ADCV'),
00255     ('LHKT4TEM28V1ST', 'ADCS'),
00256     ('LHKT4TEM28V1', 'ADCV'),
00257     ('LHKT5TKR25VDST', 'ADCS'),
00258     ('LHKT5TKR25VD', 'ADCV'),
00259     ('LHKSPARE16', 'TSP16'),
00260     ('LHKT5TKR15VAAST', 'ADCS'),
00261     ('LHKT5TKR15VAA', 'ADCV'),
00262     ('LHKSPARE16', 'TSP16'),
00263     ('LHKT5TKR25VABST', 'ADCS'),
00264     ('LHKT5TKR25VAB', 'ADCV'),
00265     ('LHKSPARE16', 'TSP16'),
00266     ('LHKT5TKRBV0ST', 'ADCS'),
00267     ('LHKT5TKRBV0', 'ADCV'),
00268     ('LHKSPARE16', 'TSP16'),
00269     ('LHKT5CAL33VDST', 'ADCS'),
00270     ('LHKT5CAL33VD', 'ADCV'),
00271     ('LHKT5TKRBV1ST', 'ADCS'),
00272     ('LHKT5TKRBV1', 'ADCV'),
00273     ('LHKT5CAL33VAST', 'ADCS'),
00274     ('LHKT5CAL33VA', 'ADCV'),
00275     ('LHKT5CALBSV1ST', 'ADCS'),
00276     ('LHKT5CALBSV1', 'ADCV'),
00277     ('LHKT5CALBSV0ST', 'ADCS'),
00278     ('LHKT5CALBSV0', 'ADCV'),
00279     ('LHKT5TEM28V0ST', 'ADCS'),
00280     ('LHKT5TEM28V0', 'ADCV'),
00281     ('LHKT5TEM33VST', 'ADCS'),
00282     ('LHKT5TEM33V', 'ADCV'),
00283     ('LHKT5TEM28V1ST', 'ADCS'),
00284     ('LHKT5TEM28V1', 'ADCV'),
00285     ]
00286   def __init__(self, ui):
00287     HskPacket.__init__(self, ui)
00288     self.name  = "TemEnvPwr1"
00289     self.brief = "TEM Power Packet 1"
00290     self.descr = "Contains power specific ADC values for TEMs 3,4, and 5."
00291     self.read()
00292
00293
00294 class HskPacket212(HskPacket):
00295   mnemList = [
00296     ('LHKSPARE08', 'TSP8'),
00297     ('LHKSPARE08', 'TSP8'),
00298     ('LHKSPARE08', 'TSP8'),
00299     ('LHKSPARE08', 'TSP8'),
00300     ('LHKSPARE08', 'TSP8'),
00301     ('LHKSPARE08', 'TSP8'),
00302     ('LHKT6TKR25VDST', 'ADCS'),
00303     ('LHKT6TKR25VD', 'ADCV'),
00304     ('LHKSPARE16', 'TSP16'),
00305     ('LHKT6TKR15VAAST', 'ADCS'),
00306     ('LHKT6TKR15VAA', 'ADCV'),
00307     ('LHKSPARE16', 'TSP16'),
00308     ('LHKT6TKR25VABST', 'ADCS'),
00309     ('LHKT6TKR25VAB', 'ADCV'),
00310     ('LHKSPARE16', 'TSP16'),
00311     ('LHKT6TKRBV0ST', 'ADCS'),
00312     ('LHKT6TKRBV0', 'ADCV'),
00313     ('LHKSPARE16', 'TSP16'),
00314     ('LHKT6CAL33VDST', 'ADCS'),
00315     ('LHKT6CAL33VD', 'ADCV'),
00316     ('LHKT6TKRBV1ST', 'ADCS'),
00317     ('LHKT6TKRBV1', 'ADCV'),
00318     ('LHKT6CAL33VAST', 'ADCS'),
00319     ('LHKT6CAL33VA', 'ADCV'),
00320     ('LHKT6CALBSV1ST', 'ADCS'),
00321     ('LHKT6CALBSV1', 'ADCV'),
00322     ('LHKT6CALBSV0ST', 'ADCS'),
00323     ('LHKT6CALBSV0', 'ADCV'),
00324     ('LHKT6TEM28V0ST', 'ADCS'),
00325     ('LHKT6TEM28V0', 'ADCV'),
00326     ('LHKT6TEM33VST', 'ADCS'),
00327     ('LHKT6TEM33V', 'ADCV'),
00328     ('LHKT6TEM28V1ST', 'ADCS'),
00329     ('LHKT6TEM28V1', 'ADCV'),
00330     ('LHKT7TKR25VDST', 'ADCS'),
00331     ('LHKT7TKR25VD', 'ADCV'),
00332     ('LHKSPARE16', 'TSP16'),
00333     ('LHKT7TKR15VAAST', 'ADCS'),
00334     ('LHKT7TKR15VAA', 'ADCV'),
00335     ('LHKSPARE16', 'TSP16'),
00336     ('LHKT7TKR25VABST', 'ADCS'),
00337     ('LHKT7TKR25VAB', 'ADCV'),
00338     ('LHKSPARE16', 'TSP16'),
00339     ('LHKT7TKRBV0ST', 'ADCS'),
00340     ('LHKT7TKRBV0', 'ADCV'),
00341     ('LHKSPARE16', 'TSP16'),
00342     ('LHKT7CAL33VDST', 'ADCS'),
00343     ('LHKT7CAL33VD', 'ADCV'),
00344     ('LHKT7TKRBV1ST', 'ADCS'),
00345     ('LHKT7TKRBV1', 'ADCV'),
00346     ('LHKT7CAL33VAST', 'ADCS'),
00347     ('LHKT7CAL33VA', 'ADCV'),
00348     ('LHKT7CALBSV1ST', 'ADCS'),
00349     ('LHKT7CALBSV1', 'ADCV'),
00350     ('LHKT7CALBSV0ST', 'ADCS'),
00351     ('LHKT7CALBSV0', 'ADCV'),
00352     ('LHKT7TEM28V0ST', 'ADCS'),
00353     ('LHKT7TEM28V0', 'ADCV'),
00354     ('LHKT7TEM33VST', 'ADCS'),
00355     ('LHKT7TEM33V', 'ADCV'),
00356     ('LHKT7TEM28V1ST', 'ADCS'),
00357     ('LHKT7TEM28V1', 'ADCV'),
00358     ('LHKT8TKR25VDST', 'ADCS'),
00359     ('LHKT8TKR25VD', 'ADCV'),
00360     ('LHKSPARET8M0ADC1', 'TSP16'),
00361     ('LHKT8TKR15VAAST', 'ADCS'),
00362     ('LHKT8TKR15VAA', 'ADCV'),
00363     ('LHKSPARET8M0ADC3', 'TSP16'),
00364     ('LHKT8TKR25VABST', 'ADCS'),
00365     ('LHKT8TKR25VAB', 'ADCV'),
00366     ('LHKSPARET8M0ADC5', 'TSP16'),
00367     ('LHKT8TKRBV0ST', 'ADCS'),
00368     ('LHKT8TKRBV0', 'ADCV'),
00369     ('LHKSPARET8M0ADC7', 'TSP16'),
00370     ('LHKT8CAL33VDST', 'ADCS'),
00371     ('LHKT8CAL33VD', 'ADCV'),
00372     ('LHKT8TKRBV1ST', 'ADCS'),
00373     ('LHKT8TKRBV1', 'ADCV'),
00374     ('LHKT8CAL33VAST', 'ADCS'),
00375     ('LHKT8CAL33VA', 'ADCV'),
00376     ('LHKT8CALBSV1ST', 'ADCS'),
00377     ('LHKT8CALBSV1', 'ADCV'),
00378     ('LHKT8CALBSV0ST', 'ADCS'),
00379     ('LHKT8CALBSV0', 'ADCV'),
00380     ('LHKT8TEM28V0ST', 'ADCS'),
00381     ('LHKT8TEM28V0', 'ADCV'),
00382     ('LHKT8TEM33VST', 'ADCS'),
00383     ('LHKT8TEM33V', 'ADCV'),
00384     ('LHKT8TEM28V1ST', 'ADCS'),
00385     ('LHKT8TEM28V1', 'ADCV'),
00386     ]
00387   def __init__(self, ui):
00388     HskPacket.__init__(self, ui)
00389     self.name  = "TemEnvPwr2"
00390     self.brief = "TEM Power Packet 2"
00391     self.descr = "Contains power specific ADC values for TEMs 6, 7, and 8."
00392     self.read()
00393
00394
00395 class HskPacket213(HskPacket):
00396   mnemList = [
00397     ('LHKSPARE08', 'TSP8'),
00398     ('LHKSPARE08', 'TSP8'),
00399     ('LHKSPARE08', 'TSP8'),
00400     ('LHKSPARE08', 'TSP8'),
00401     ('LHKSPARE08', 'TSP8'),
00402     ('LHKSPARE08', 'TSP8'),
00403     ('LHKT9TKR25VDST', 'ADCS'),
00404     ('LHKT9TKR25VD', 'ADCV'),
00405     ('LHKSPARET9M0ADC1', 'TSP16'),
00406     ('LHKT9TKR15VAAST', 'ADCS'),
00407     ('LHKT9TKR15VAA', 'ADCV'),
00408     ('LHKSPARET9M0ADC3', 'TSP16'),
00409     ('LHKT9TKR25VABST', 'ADCS'),
00410     ('LHKT9TKR25VAB', 'ADCV'),
00411     ('LHKSPARET9M0ADC5', 'TSP16'),
00412     ('LHKT9TKRBV0ST', 'ADCS'),
00413     ('LHKT9TKRBV0', 'ADCV'),
00414     ('LHKSPARET9M0ADC7', 'TSP16'),
00415     ('LHKT9CAL33VDST', 'ADCS'),
00416     ('LHKT9CAL33VD', 'ADCV'),
00417     ('LHKT9TKRBV1ST', 'ADCS'),
00418     ('LHKT9TKRBV1', 'ADCV'),
00419     ('LHKT9CAL33VAST', 'ADCS'),
00420     ('LHKT9CAL33VA', 'ADCV'),
00421     ('LHKT9CALBSV1ST', 'ADCS'),
00422     ('LHKT9CALBSV1', 'ADCV'),
00423     ('LHKT9CALBSV0ST', 'ADCS'),
00424     ('LHKT9CALBSV0', 'ADCV'),
00425     ('LHKT9TEM28V0ST', 'ADCS'),
00426     ('LHKT9TEM28V0', 'ADCV'),
00427     ('LHKT9TEM33VST', 'ADCS'),
00428     ('LHKT9TEM33V', 'ADCV'),
00429     ('LHKT9TEM28V1ST', 'ADCS'),
00430     ('LHKT9TEM28V1', 'ADCV'),
00431     ('LHKTATKR25VDST', 'ADCS'),
00432     ('LHKTATKR25VD', 'ADCV'),
00433     ('LHKSPARETAM0ADC1', 'TSP16'),
00434     ('LHKTATKR15VAAST', 'ADCS'),
00435     ('LHKTATKR15VAA', 'ADCV'),
00436     ('LHKSPARETAM0ADC3', 'TSP16'),
00437     ('LHKTATKR25VABST', 'ADCS'),
00438     ('LHKTATKR25VAB', 'ADCV'),
00439     ('LHKSPARETAM0ADC5', 'TSP16'),
00440     ('LHKTATKRBV0ST', 'ADCS'),
00441     ('LHKTATKRBV0', 'ADCV'),
00442     ('LHKSPARETAM0ADC7', 'TSP16'),
00443     ('LHKTACAL33VDST', 'ADCS'),
00444     ('LHKTACAL33VD', 'ADCV'),
00445     ('LHKTATKRBV1ST', 'ADCS'),
00446     ('LHKTATKRBV1', 'ADCV'),
00447     ('LHKTACAL33VAST', 'ADCS'),
00448     ('LHKTACAL33VA', 'ADCV'),
00449     ('LHKTACALBSV1ST', 'ADCS'),
00450     ('LHKTACALBSV1', 'ADCV'),
00451     ('LHKTACALBSV0ST', 'ADCS'),
00452     ('LHKTACALBSV0', 'ADCV'),
00453     ('LHKTATEM28V0ST', 'ADCS'),
00454     ('LHKTATEM28V0', 'ADCV'),
00455     ('LHKTATEM33VST', 'ADCS'),
00456     ('LHKTATEM33V', 'ADCV'),
00457     ('LHKTATEM28V1ST', 'ADCS'),
00458     ('LHKTATEM28V1', 'ADCV'),
00459     ('LHKTBTKR25VDST', 'ADCS'),
00460     ('LHKTBTKR25VD', 'ADCV'),
00461     ('LHKSPARETBM0ADC1', 'TSP16'),
00462     ('LHKTBTKR15VAAST', 'ADCS'),
00463     ('LHKTBTKR15VAA', 'ADCV'),
00464     ('LHKSPARETBM0ADC3', 'TSP16'),
00465     ('LHKTBTKR25VABST', 'ADCS'),
00466     ('LHKTBTKR25VAB', 'ADCV'),
00467     ('LHKSPARETBM0ADC5', 'TSP16'),
00468     ('LHKTBTKRBV0ST', 'ADCS'),
00469     ('LHKTBTKRBV0', 'ADCV'),
00470     ('LHKSPARETBM0ADC7', 'TSP16'),
00471     ('LHKTBCAL33VDST', 'ADCS'),
00472     ('LHKTBCAL33VD', 'ADCV'),
00473     ('LHKTBTKRBV1ST', 'ADCS'),
00474     ('LHKTBTKRBV1', 'ADCV'),
00475     ('LHKTBCAL33VAST', 'ADCS'),
00476     ('LHKTBCAL33VA', 'ADCV'),
00477     ('LHKTBCALBSV1ST', 'ADCS'),
00478     ('LHKTBCALBSV1', 'ADCV'),
00479     ('LHKTBCALBSV0ST', 'ADCS'),
00480     ('LHKTBCALBSV0', 'ADCV'),
00481     ('LHKTBTEM28V0ST', 'ADCS'),
00482     ('LHKTBTEM28V0', 'ADCV'),
00483     ('LHKTBTEM33VST', 'ADCS'),
00484     ('LHKTBTEM33V', 'ADCV'),
00485     ('LHKTBTEM28V1ST', 'ADCS'),
00486     ('LHKTBTEM28V1', 'ADCV'),
00487     ]
00488   def __init__(self, ui):
00489     HskPacket.__init__(self, ui)
00490     self.name  = "TemEnvPwr3"
00491     self.brief = "TEM Power Packet 3"
00492     self.descr = "Contains power specific ADC values for TEMs 9, 10, and 11."
00493     self.read()
00494
00495
00496 class HskPacket214(HskPacket):
00497   mnemList = [
00498     ('LHKSPARE08', 'TSP8'),
00499     ('LHKSPARE08', 'TSP8'),
00500     ('LHKSPARE08', 'TSP8'),
00501     ('LHKSPARE08', 'TSP8'),
00502     ('LHKSPARE08', 'TSP8'),
00503     ('LHKSPARE08', 'TSP8'),
00504     ('LHKTCTKR25VDST', 'ADCS'),
00505     ('LHKTCTKR25VD', 'ADCV'),
00506     ('LHKSPARETCM0ADC1', 'TSP16'),
00507     ('LHKTCTKR15VAAST', 'ADCS'),
00508     ('LHKTCTKR15VAA', 'ADCV'),
00509     ('LHKSPARETCM0ADC3', 'TSP16'),
00510     ('LHKTCTKR25VABST', 'ADCS'),
00511     ('LHKTCTKR25VAB', 'ADCV'),
00512     ('LHKSPARETCM0ADC5', 'TSP16'),
00513     ('LHKTCTKRBV0ST', 'ADCS'),
00514     ('LHKTCTKRBV0', 'ADCV'),
00515     ('LHKSPARETCM0ADC7', 'TSP16'),
00516     ('LHKTCCAL33VDST', 'ADCS'),
00517     ('LHKTCCAL33VD', 'ADCV'),
00518     ('LHKTCTKRBV1ST', 'ADCS'),
00519     ('LHKTCTKRBV1', 'ADCV'),
00520     ('LHKTCCAL33VAST', 'ADCS'),
00521     ('LHKTCCAL33VA', 'ADCV'),
00522     ('LHKTCCALBSV1ST', 'ADCS'),
00523     ('LHKTCCALBSV1', 'ADCV'),
00524     ('LHKTCCALBSV0ST', 'ADCS'),
00525     ('LHKTCCALBSV0', 'ADCV'),
00526     ('LHKTCTEM28V0ST', 'ADCS'),
00527     ('LHKTCTEM28V0', 'ADCV'),
00528     ('LHKTCTEM33VST', 'ADCS'),
00529     ('LHKTCTEM33V', 'ADCV'),
00530     ('LHKTCTEM28V1ST', 'ADCS'),
00531     ('LHKTCTEM28V1', 'ADCV'),
00532     ('LHKTDTKR25VDST', 'ADCS'),
00533     ('LHKTDTKR25VD', 'ADCV'),
00534     ('LHKSPARETDM0ADC1', 'TSP16'),
00535     ('LHKTDTKR15VAAST', 'ADCS'),
00536     ('LHKTDTKR15VAA', 'ADCV'),
00537     ('LHKSPARETDM0ADC3', 'TSP16'),
00538     ('LHKTDTKR25VABST', 'ADCS'),
00539     ('LHKTDTKR25VAB', 'ADCV'),
00540     ('LHKSPARETDM0ADC5', 'TSP16'),
00541     ('LHKTDTKRBV0ST', 'ADCS'),
00542     ('LHKTDTKRBV0', 'ADCV'),
00543     ('LHKSPARETDM0ADC7', 'TSP16'),
00544     ('LHKTDCAL33VDST', 'ADCS'),
00545     ('LHKTDCAL33VD', 'ADCV'),
00546     ('LHKTDTKRBV1ST', 'ADCS'),
00547     ('LHKTDTKRBV1', 'ADCV'),
00548     ('LHKTDCAL33VAST', 'ADCS'),
00549     ('LHKTDCAL33VA', 'ADCV'),
00550     ('LHKTDCALBSV1ST', 'ADCS'),
00551     ('LHKTDCALBSV1', 'ADCV'),
00552     ('LHKTDCALBSV0ST', 'ADCS'),
00553     ('LHKTDCALBSV0', 'ADCV'),
00554     ('LHKTDTEM28V0ST', 'ADCS'),
00555     ('LHKTDTEM28V0', 'ADCV'),
00556     ('LHKTDTEM33VST', 'ADCS'),
00557     ('LHKTDTEM33V', 'ADCV'),
00558     ('LHKTDTEM28V1ST', 'ADCS'),
00559     ('LHKTDTEM28V1', 'ADCV'),
00560     ('LHKTETKR25VDST', 'ADCS'),
00561     ('LHKTETKR25VD', 'ADCV'),
00562     ('LHKSPARETEM0ADC1', 'TSP16'),
00563     ('LHKTETKR15VAAST', 'ADCS'),
00564     ('LHKTETKR15VAA', 'ADCV'),
00565     ('LHKSPARETEM0ADC3', 'TSP16'),
00566     ('LHKTETKR25VABST', 'ADCS'),
00567     ('LHKTETKR25VAB', 'ADCV'),
00568     ('LHKSPARETEM0ADC5', 'TSP16'),
00569     ('LHKTETKRBV0ST', 'ADCS'),
00570     ('LHKTETKRBV0', 'ADCV'),
00571     ('LHKSPARETEM0ADC7', 'TSP16'),
00572     ('LHKTECAL33VDST', 'ADCS'),
00573     ('LHKTECAL33VD', 'ADCV'),
00574     ('LHKTETKRBV1ST', 'ADCS'),
00575     ('LHKTETKRBV1', 'ADCV'),
00576     ('LHKTECAL33VAST', 'ADCS'),
00577     ('LHKTECAL33VA', 'ADCV'),
00578     ('LHKTECALBSV1ST', 'ADCS'),
00579     ('LHKTECALBSV1', 'ADCV'),
00580     ('LHKTECALBSV0ST', 'ADCS'),
00581     ('LHKTECALBSV0', 'ADCV'),
00582     ('LHKTETEM28V0ST', 'ADCS'),
00583     ('LHKTETEM28V0', 'ADCV'),
00584     ('LHKTETEM33VST', 'ADCS'),
00585     ('LHKTETEM33V', 'ADCV'),
00586     ('LHKTETEM28V1ST', 'ADCS'),
00587     ('LHKTETEM28V1', 'ADCV'),
00588     ]
00589   def __init__(self, ui):
00590     HskPacket.__init__(self, ui)
00591     self.name  = "TemEnvPwr4"
00592     self.brief = "TEM Power Packet 4"
00593     self.descr = "Contains power specific ADC values for TEMs 12, 13, and 14."
00594     self.read()
00595
00596
00597 class HskPacket215(HskPacket):
00598   mnemList = [
00599     ('LHKSPARE08', 'TSP8'),
00600     ('LHKSPARE08', 'TSP8'),
00601     ('LHKSPARE08', 'TSP8'),
00602     ('LHKSPARE08', 'TSP8'),
00603     ('LHKSPARE08', 'TSP8'),
00604     ('LHKSPARE08', 'TSP8'),
00605     ('LHKTFTKR25VDST', 'ADCS'),
00606     ('LHKTFTKR25VD', 'ADCV'),
00607     ('LHKSPARETFM0ADC1', 'TSP16'),
00608     ('LHKTFTKR15VAAST', 'ADCS'),
00609     ('LHKTFTKR15VAA', 'ADCV'),
00610     ('LHKSPARETFM0ADC3', 'TSP16'),
00611     ('LHKTFTKR25VABST', 'ADCS'),
00612     ('LHKTFTKR25VAB', 'ADCV'),
00613     ('LHKSPARETFM0ADC5', 'TSP16'),
00614     ('LHKTFTKRBV0ST', 'ADCS'),
00615     ('LHKTFTKRBV0', 'ADCV'),
00616     ('LHKSPARETFM0ADC7', 'TSP16'),
00617     ('LHKTFCAL33VDST', 'ADCS'),
00618     ('LHKTFCAL33VD', 'ADCV'),
00619     ('LHKTFTKRBV1ST', 'ADCS'),
00620     ('LHKTFTKRBV1', 'ADCV'),
00621     ('LHKTFCAL33VAST', 'ADCS'),
00622     ('LHKTFCAL33VA', 'ADCV'),
00623     ('LHKTFCALBSV1ST', 'ADCS'),
00624     ('LHKTFCALBSV1', 'ADCV'),
00625     ('LHKTFCALBSV0ST', 'ADCS'),
00626     ('LHKTFCALBSV0', 'ADCV'),
00627     ('LHKTFTEM28V0ST', 'ADCS'),
00628     ('LHKTFTEM28V0', 'ADCV'),
00629     ('LHKTFTEM33VST', 'ADCS'),
00630     ('LHKTFTEM33V', 'ADCV'),
00631     ('LHKTFTEM28V1ST', 'ADCS'),
00632     ('LHKTFTEM28V1', 'ADCV'),
00633     ('LHKRTERRCNT', 'RTERR'),
00634     ('LHKRTINTRCNT', 'INTRCNT'),
00635     ('LHKRTCXPCNT', 'CRXPCNT'),
00636     ('LHKRTCXBCNT', 'CRXBCNT'),
00637     ('LHKRTTXPCNT', 'CTXPCNT'),
00638     ('LHKRTTXBCNT', 'CTXBCNT'),
00639     ('LHKRTHKPCNT', 'HKPCNT'),
00640     ('LHKRTHKBCNT', 'HKBCNT'),
00641     ('LHKRTTLMPCNT', 'TLMPCNT'),
00642     ('LHKRTTLMBCNT', 'TLMBCNT'),
00643     ('LHKSPARE16', 'TSP16'),
00644     ('LHKSPARE16', 'TSP16'),
00645     ('LHKSPARE16', 'TSP16'),
00646     ('LHKSPARE16', 'TSP16'),
00647     ('LHKSPARE16', 'TSP16'),
00648     ('LHKSPARE16', 'TSP16'),
00649     ('LHKSPARE16', 'TSP16'),
00650     ('LHKSPARE16', 'TSP16'),
00651     ('LHKSPARE16', 'TSP16'),
00652     ('LHKSPARE16', 'TSP16'),
00653     ('LHKSPARE16', 'TSP16'),
00654     ('LHKSPARE16', 'TSP16'),
00655     ]
00656   def __init__(self, ui):
00657     HskPacket.__init__(self, ui)
00658     self.name  = "TemEnvPwr5"
00659     self.brief = "TEM Power Packet 5"
00660     self.descr = "Contains powr specific ADC values for TEM 15.  Contains the 1553 remote terminal statistics block."
00661     self.read()
00662
00663
00664 class HskPacket216(HskPacket):
00665   mnemList = [
00666     ('LHKSPARE08', 'TSP8'),
00667     ('LHKSPARE08', 'TSP8'),
00668     ('LHKSPARE08', 'TSP8'),
00669     ('LHKSPARE08', 'TSP8'),
00670     ('LHKSPARE08', 'TSP8'),
00671     ('LHKSPARE08', 'TSP8'),
00672     ('LHKT0CALAF0T0ST', 'ADCS'),
00673     ('LHKT0CALAF0T0', 'ADCV'),
00674     ('LHKT0CALAF0T1ST', 'ADCS'),
00675     ('LHKT0CALAF0T1', 'ADCV'),
00676     ('LHKT0CALAF1T0ST', 'ADCS'),
00677     ('LHKT0CALAF1T0', 'ADCV'),
00678     ('LHKT0CALAF1T1ST', 'ADCS'),
00679     ('LHKT0CALAF1T1', 'ADCV'),
00680     ('LHKT0CALAF2T0ST', 'ADCS'),
00681     ('LHKT0CALAF2T0', 'ADCV'),
00682     ('LHKT0CALAF2T1ST', 'ADCS'),
00683     ('LHKT0CALAF2T1', 'ADCV'),
00684     ('LHKT0CALAF3T0ST', 'ADCS'),
00685     ('LHKT0CALAF3T0', 'ADCV'),
00686     ('LHKT0CALAF3T1ST', 'ADCS'),
00687     ('LHKT0CALAF3T1', 'ADCV'),
00688     ('LHKT0TKRC0T0ST', 'ADCS'),
00689     ('LHKT0TKRC0T0', 'ADCV'),
00690     ('LHKT0TKRC0T1ST', 'ADCS'),
00691     ('LHKT0TKRC0T1', 'ADCV'),
00692     ('LHKT0TKRC1T0ST', 'ADCS'),
00693     ('LHKT0TKRC1T0', 'ADCV'),
00694     ('LHKT0TKRC1T1ST', 'ADCS'),
00695     ('LHKT0TKRC1T1', 'ADCV'),
00696     ('LHKT0TKRC2T0ST', 'ADCS'),
00697     ('LHKT0TKRC2T0', 'ADCV'),
00698     ('LHKT0TKRC2T1ST', 'ADCS'),
00699     ('LHKT0TKRC2T1', 'ADCV'),
00700     ('LHKT0TKRC3T0ST', 'ADCS'),
00701     ('LHKT0TKRC3T0', 'ADCV'),
00702     ('LHKT0TKRC3T1ST', 'ADCS'),
00703     ('LHKT0TKRC3T1', 'ADCV'),
00704     ('LHKT0TKRC4T0ST', 'ADCS'),
00705     ('LHKT0TKRC4T0', 'ADCV'),
00706     ('LHKT0TKRC4T1ST', 'ADCS'),
00707     ('LHKT0TKRC4T1', 'ADCV'),
00708     ('LHKT0TKRC5T0ST', 'ADCS'),
00709     ('LHKT0TKRC5T0', 'ADCV'),
00710     ('LHKT0TKRC5T1ST', 'ADCS'),
00711     ('LHKT0TKRC5T1', 'ADCV'),
00712     ('LHKT0TKRC6T0ST', 'ADCS'),
00713     ('LHKT0TKRC6T0', 'ADCV'),
00714     ('LHKT0TKRC6T1ST', 'ADCS'),
00715     ('LHKT0TKRC6T1', 'ADCV'),
00716     ('LHKT0TKRC7T0ST', 'ADCS'),
00717     ('LHKT0TKRC7T0', 'ADCV'),
00718     ('LHKT0TKRC7T1ST', 'ADCS'),
00719     ('LHKT0TKRC7T1', 'ADCV'),
00720     ('LHKT1CALAF0T0ST', 'ADCS'),
00721     ('LHKT1CALAF0T0', 'ADCV'),
00722     ('LHKT1CALAF0T1ST', 'ADCS'),
00723     ('LHKT1CALAF0T1', 'ADCV'),
00724     ('LHKT1CALAF1T0ST', 'ADCS'),
00725     ('LHKT1CALAF1T0', 'ADCV'),
00726     ('LHKT1CALAF1T1ST', 'ADCS'),
00727     ('LHKT1CALAF1T1', 'ADCV'),
00728     ('LHKT1CALAF2T0ST', 'ADCS'),
00729     ('LHKT1CALAF2T0', 'ADCV'),
00730     ('LHKT1CALAF2T1ST', 'ADCS'),
00731     ('LHKT1CALAF2T1', 'ADCV'),
00732     ('LHKT1CALAF3T0ST', 'ADCS'),
00733     ('LHKT1CALAF3T0', 'ADCV'),
00734     ('LHKT1CALAF3T1ST', 'ADCS'),
00735     ('LHKT1CALAF3T1', 'ADCV'),
00736     ('LHKT1TKRC0T0ST', 'ADCS'),
00737     ('LHKT1TKRC0T0', 'ADCV'),
00738     ('LHKT1TKRC0T1ST', 'ADCS'),
00739     ('LHKT1TKRC0T1', 'ADCV'),
00740     ('LHKT1TKRC1T0ST', 'ADCS'),
00741     ('LHKT1TKRC1T0', 'ADCV'),
00742     ('LHKT1TKRC1T1ST', 'ADCS'),
00743     ('LHKT1TKRC1T1', 'ADCV'),
00744     ('LHKT1TKRC2T0ST', 'ADCS'),
00745     ('LHKT1TKRC2T0', 'ADCV'),
00746     ('LHKT1TKRC2T1ST', 'ADCS'),
00747     ('LHKT1TKRC2T1', 'ADCV'),
00748     ('LHKT1TKRC3T0ST', 'ADCS'),
00749     ('LHKT1TKRC3T0', 'ADCV'),
00750     ('LHKT1TKRC3T1ST', 'ADCS'),
00751     ('LHKT1TKRC3T1', 'ADCV'),
00752     ('LHKT1TKRC4T0ST', 'ADCS'),
00753     ('LHKT1TKRC4T0', 'ADCV'),
00754     ('LHKT1TKRC4T1ST', 'ADCS'),
00755     ('LHKT1TKRC4T1', 'ADCV'),
00756     ('LHKT1TKRC5T0ST', 'ADCS'),
00757     ('LHKT1TKRC5T0', 'ADCV'),
00758     ('LHKT1TKRC5T1ST', 'ADCS'),
00759     ('LHKT1TKRC5T1', 'ADCV'),
00760     ('LHKT1TKRC6T0ST', 'ADCS'),
00761     ('LHKT1TKRC6T0', 'ADCV'),
00762     ('LHKT1TKRC6T1ST', 'ADCS'),
00763     ('LHKT1TKRC6T1', 'ADCV'),
00764     ('LHKT1TKRC7T0ST', 'ADCS'),
00765     ('LHKT1TKRC7T0', 'ADCV'),
00766     ('LHKT1TKRC7T1ST', 'ADCS'),
00767     ('LHKT1TKRC7T1', 'ADCV'),
00768     ]
00769   def __init__(self, ui):
00770     HskPacket.__init__(self, ui)
00771     self.name  = "TemEnvTemp0"
00772     self.brief = "TEM Temperature Packet 0"
00773     self.descr = "Contains temperature specific ADC values for TEMs 0 and 1."
00774     self.read()
00775
00776
00777 class HskPacket217(HskPacket):
00778   mnemList = [
00779     ('LHKSPARE08', 'TSP8'),
00780     ('LHKSPARE08', 'TSP8'),
00781     ('LHKSPARE08', 'TSP8'),
00782     ('LHKSPARE08', 'TSP8'),
00783     ('LHKSPARE08', 'TSP8'),
00784     ('LHKSPARE08', 'TSP8'),
00785     ('LHKT2CALAF0T0ST', 'ADCS'),
00786     ('LHKT2CALAF0T0', 'ADCV'),
00787     ('LHKT2CALAF0T1ST', 'ADCS'),
00788     ('LHKT2CALAF0T1', 'ADCV'),
00789     ('LHKT2CALAF1T0ST', 'ADCS'),
00790     ('LHKT2CALAF1T0', 'ADCV'),
00791     ('LHKT2CALAF1T1ST', 'ADCS'),
00792     ('LHKT2CALAF1T1', 'ADCV'),
00793     ('LHKT2CALAF2T0ST', 'ADCS'),
00794     ('LHKT2CALAF2T0', 'ADCV'),
00795     ('LHKT2CALAF2T1ST', 'ADCS'),
00796     ('LHKT2CALAF2T1', 'ADCV'),
00797     ('LHKT2CALAF3T0ST', 'ADCS'),
00798     ('LHKT2CALAF3T0', 'ADCV'),
00799     ('LHKT2CALAF3T1ST', 'ADCS'),
00800     ('LHKT2CALAF3T1', 'ADCV'),
00801     ('LHKT2TKRC0T0ST', 'ADCS'),
00802     ('LHKT2TKRC0T0', 'ADCV'),
00803     ('LHKT2TKRC0T1ST', 'ADCS'),
00804     ('LHKT2TKRC0T1', 'ADCV'),
00805     ('LHKT2TKRC1T0ST', 'ADCS'),
00806     ('LHKT2TKRC1T0', 'ADCV'),
00807     ('LHKT2TKRC1T1ST', 'ADCS'),
00808     ('LHKT2TKRC1T1', 'ADCV'),
00809     ('LHKT2TKRC2T0ST', 'ADCS'),
00810     ('LHKT2TKRC2T0', 'ADCV'),
00811     ('LHKT2TKRC2T1ST', 'ADCS'),
00812     ('LHKT2TKRC2T1', 'ADCV'),
00813     ('LHKT2TKRC3T0ST', 'ADCS'),
00814     ('LHKT2TKRC3T0', 'ADCV'),
00815     ('LHKT2TKRC3T1ST', 'ADCS'),
00816     ('LHKT2TKRC3T1', 'ADCV'),
00817     ('LHKT2TKRC4T0ST', 'ADCS'),
00818     ('LHKT2TKRC4T0', 'ADCV'),
00819     ('LHKT2TKRC4T1ST', 'ADCS'),
00820     ('LHKT2TKRC4T1', 'ADCV'),
00821     ('LHKT2TKRC5T0ST', 'ADCS'),
00822     ('LHKT2TKRC5T0', 'ADCV'),
00823     ('LHKT2TKRC5T1ST', 'ADCS'),
00824     ('LHKT2TKRC5T1', 'ADCV'),
00825     ('LHKT2TKRC6T0ST', 'ADCS'),
00826     ('LHKT2TKRC6T0', 'ADCV'),
00827     ('LHKT2TKRC6T1ST', 'ADCS'),
00828     ('LHKT2TKRC6T1', 'ADCV'),
00829     ('LHKT2TKRC7T0ST', 'ADCS'),
00830     ('LHKT2TKRC7T0', 'ADCV'),
00831     ('LHKT2TKRC7T1ST', 'ADCS'),
00832     ('LHKT2TKRC7T1', 'ADCV'),
00833     ('LHKT3CALAF0T0ST', 'ADCS'),
00834     ('LHKT3CALAF0T0', 'ADCV'),
00835     ('LHKT3CALAF0T1ST', 'ADCS'),
00836     ('LHKT3CALAF0T1', 'ADCV'),
00837     ('LHKT3CALAF1T0ST', 'ADCS'),
00838     ('LHKT3CALAF1T0', 'ADCV'),
00839     ('LHKT3CALAF1T1ST', 'ADCS'),
00840     ('LHKT3CALAF1T1', 'ADCV'),
00841     ('LHKT3CALAF2T0ST', 'ADCS'),
00842     ('LHKT3CALAF2T0', 'ADCV'),
00843     ('LHKT3CALAF2T1ST', 'ADCS'),
00844     ('LHKT3CALAF2T1', 'ADCV'),
00845     ('LHKT3CALAF3T0ST', 'ADCS'),
00846     ('LHKT3CALAF3T0', 'ADCV'),
00847     ('LHKT3CALAF3T1ST', 'ADCS'),
00848     ('LHKT3CALAF3T1', 'ADCV'),
00849     ('LHKT3TKRC0T0ST', 'ADCS'),
00850     ('LHKT3TKRC0T0', 'ADCV'),
00851     ('LHKT3TKRC0T1ST', 'ADCS'),
00852     ('LHKT3TKRC0T1', 'ADCV'),
00853     ('LHKT3TKRC1T0ST', 'ADCS'),
00854     ('LHKT3TKRC1T0', 'ADCV'),
00855     ('LHKT3TKRC1T1ST', 'ADCS'),
00856     ('LHKT3TKRC1T1', 'ADCV'),
00857     ('LHKT3TKRC2T0ST', 'ADCS'),
00858     ('LHKT3TKRC2T0', 'ADCV'),
00859     ('LHKT3TKRC2T1ST', 'ADCS'),
00860     ('LHKT3TKRC2T1', 'ADCV'),
00861     ('LHKT3TKRC3T0ST', 'ADCS'),
00862     ('LHKT3TKRC3T0', 'ADCV'),
00863     ('LHKT3TKRC3T1ST', 'ADCS'),
00864     ('LHKT3TKRC3T1', 'ADCV'),
00865     ('LHKT3TKRC4T0ST', 'ADCS'),
00866     ('LHKT3TKRC4T0', 'ADCV'),
00867     ('LHKT3TKRC4T1ST', 'ADCS'),
00868     ('LHKT3TKRC4T1', 'ADCV'),
00869     ('LHKT3TKRC5T0ST', 'ADCS'),
00870     ('LHKT3TKRC5T0', 'ADCV'),
00871     ('LHKT3TKRC5T1ST', 'ADCS'),
00872     ('LHKT3TKRC5T1', 'ADCV'),
00873     ('LHKT3TKRC6T0ST', 'ADCS'),
00874     ('LHKT3TKRC6T0', 'ADCV'),
00875     ('LHKT3TKRC6T1ST', 'ADCS'),
00876     ('LHKT3TKRC6T1', 'ADCV'),
00877     ('LHKT3TKRC7T0ST', 'ADCS'),
00878     ('LHKT3TKRC7T0', 'ADCV'),
00879     ('LHKT3TKRC7T1ST', 'ADCS'),
00880     ('LHKT3TKRC7T1', 'ADCV'),
00881     ]
00882   def __init__(self, ui):
00883     HskPacket.__init__(self, ui)
00884     self.name  = "TemEnvTemp1"
00885     self.brief = "TEM Temperature Packet 1"
00886     self.descr = "Contains temperature specific ADC values for TEMs 2 and 3."
00887     self.read()
00888
00889
00890 class HskPacket218(HskPacket):
00891   mnemList = [
00892     ('LHKSPARE08', 'TSP8'),
00893     ('LHKSPARE08', 'TSP8'),
00894     ('LHKSPARE08', 'TSP8'),
00895     ('LHKSPARE08', 'TSP8'),
00896     ('LHKSPARE08', 'TSP8'),
00897     ('LHKSPARE08', 'TSP8'),
00898     ('LHKT4CALAF0T0ST', 'ADCS'),
00899     ('LHKT4CALAF0T0', 'ADCV'),
00900     ('LHKT4CALAF0T1ST', 'ADCS'),
00901     ('LHKT4CALAF0T1', 'ADCV'),
00902     ('LHKT4CALAF1T0ST', 'ADCS'),
00903     ('LHKT4CALAF1T0', 'ADCV'),
00904     ('LHKT4CALAF1T1ST', 'ADCS'),
00905     ('LHKT4CALAF1T1', 'ADCV'),
00906     ('LHKT4CALAF2T0ST', 'ADCS'),
00907     ('LHKT4CALAF2T0', 'ADCV'),
00908     ('LHKT4CALAF2T1ST', 'ADCS'),
00909     ('LHKT4CALAF2T1', 'ADCV'),
00910     ('LHKT4CALAF3T0ST', 'ADCS'),
00911     ('LHKT4CALAF3T0', 'ADCV'),
00912     ('LHKT4CALAF3T1ST', 'ADCS'),
00913     ('LHKT4CALAF3T1', 'ADCV'),
00914     ('LHKT4TKRC0T0ST', 'ADCS'),
00915     ('LHKT4TKRC0T0', 'ADCV'),
00916     ('LHKT4TKRC0T1ST', 'ADCS'),
00917     ('LHKT4TKRC0T1', 'ADCV'),
00918     ('LHKT4TKRC1T0ST', 'ADCS'),
00919     ('LHKT4TKRC1T0', 'ADCV'),
00920     ('LHKT4TKRC1T1ST', 'ADCS'),
00921     ('LHKT4TKRC1T1', 'ADCV'),
00922     ('LHKT4TKRC2T0ST', 'ADCS'),
00923     ('LHKT4TKRC2T0', 'ADCV'),
00924     ('LHKT4TKRC2T1ST', 'ADCS'),
00925     ('LHKT4TKRC2T1', 'ADCV'),
00926     ('LHKT4TKRC3T0ST', 'ADCS'),
00927     ('LHKT4TKRC3T0', 'ADCV'),
00928     ('LHKT4TKRC3T1ST', 'ADCS'),
00929     ('LHKT4TKRC3T1', 'ADCV'),
00930     ('LHKT4TKRC4T0ST', 'ADCS'),
00931     ('LHKT4TKRC4T0', 'ADCV'),
00932     ('LHKT4TKRC4T1ST', 'ADCS'),
00933     ('LHKT4TKRC4T1', 'ADCV'),
00934     ('LHKT4TKRC5T0ST', 'ADCS'),
00935     ('LHKT4TKRC5T0', 'ADCV'),
00936     ('LHKT4TKRC5T1ST', 'ADCS'),
00937     ('LHKT4TKRC5T1', 'ADCV'),
00938     ('LHKT4TKRC6T0ST', 'ADCS'),
00939     ('LHKT4TKRC6T0', 'ADCV'),
00940     ('LHKT4TKRC6T1ST', 'ADCS'),
00941     ('LHKT4TKRC6T1', 'ADCV'),
00942     ('LHKT4TKRC7T0ST', 'ADCS'),
00943     ('LHKT4TKRC7T0', 'ADCV'),
00944     ('LHKT4TKRC7T1ST', 'ADCS'),
00945     ('LHKT4TKRC7T1', 'ADCV'),
00946     ('LHKT5CALAF0T0ST', 'ADCS'),
00947     ('LHKT5CALAF0T0', 'ADCV'),
00948     ('LHKT5CALAF0T1ST', 'ADCS'),
00949     ('LHKT5CALAF0T1', 'ADCV'),
00950     ('LHKT5CALAF1T0ST', 'ADCS'),
00951     ('LHKT5CALAF1T0', 'ADCV'),
00952     ('LHKT5CALAF1T1ST', 'ADCS'),
00953     ('LHKT5CALAF1T1', 'ADCV'),
00954     ('LHKT5CALAF2T0ST', 'ADCS'),
00955     ('LHKT5CALAF2T0', 'ADCV'),
00956     ('LHKT5CALAF2T1ST', 'ADCS'),
00957     ('LHKT5CALAF2T1', 'ADCV'),
00958     ('LHKT5CALAF3T0ST', 'ADCS'),
00959     ('LHKT5CALAF3T0', 'ADCV'),
00960     ('LHKT5CALAF3T1ST', 'ADCS'),
00961     ('LHKT5CALAF3T1', 'ADCV'),
00962     ('LHKT5TKRC0T0ST', 'ADCS'),
00963     ('LHKT5TKRC0T0', 'ADCV'),
00964     ('LHKT5TKRC0T1ST', 'ADCS'),
00965     ('LHKT5TKRC0T1', 'ADCV'),
00966     ('LHKT5TKRC1T0ST', 'ADCS'),
00967     ('LHKT5TKRC1T0', 'ADCV'),
00968     ('LHKT5TKRC1T1ST', 'ADCS'),
00969     ('LHKT5TKRC1T1', 'ADCV'),
00970     ('LHKT5TKRC2T0ST', 'ADCS'),
00971     ('LHKT5TKRC2T0', 'ADCV'),
00972     ('LHKT5TKRC2T1ST', 'ADCS'),
00973     ('LHKT5TKRC2T1', 'ADCV'),
00974     ('LHKT5TKRC3T0ST', 'ADCS'),
00975     ('LHKT5TKRC3T0', 'ADCV'),
00976     ('LHKT5TKRC3T1ST', 'ADCS'),
00977     ('LHKT5TKRC3T1', 'ADCV'),
00978     ('LHKT5TKRC4T0ST', 'ADCS'),
00979     ('LHKT5TKRC4T0', 'ADCV'),
00980     ('LHKT5TKRC4T1ST', 'ADCS'),
00981     ('LHKT5TKRC4T1', 'ADCV'),
00982     ('LHKT5TKRC5T0ST', 'ADCS'),
00983     ('LHKT5TKRC5T0', 'ADCV'),
00984     ('LHKT5TKRC5T1ST', 'ADCS'),
00985     ('LHKT5TKRC5T1', 'ADCV'),
00986     ('LHKT5TKRC6T0ST', 'ADCS'),
00987     ('LHKT5TKRC6T0', 'ADCV'),
00988     ('LHKT5TKRC6T1ST', 'ADCS'),
00989     ('LHKT5TKRC6T1', 'ADCV'),
00990     ('LHKT5TKRC7T0ST', 'ADCS'),
00991     ('LHKT5TKRC7T0', 'ADCV'),
00992     ('LHKT5TKRC7T1ST', 'ADCS'),
00993     ('LHKT5TKRC7T1', 'ADCV'),
00994     ]
00995   def __init__(self, ui):
00996     HskPacket.__init__(self, ui)
00997     self.name  = "TemEnvTemp2"
00998     self.brief = "TEM Temperature Packet 2"
00999     self.descr = "Contains temperature specific ADC values for TEMs 4 and 5."
01000     self.read()
01001
01002
01003 class HskPacket219(HskPacket):
01004   mnemList = [
01005     ('LHKSPARE08', 'TSP8'),
01006     ('LHKSPARE08', 'TSP8'),
01007     ('LHKSPARE08', 'TSP8'),
01008     ('LHKSPARE08', 'TSP8'),
01009     ('LHKSPARE08', 'TSP8'),
01010     ('LHKSPARE08', 'TSP8'),
01011     ('LHKT6CALAF0T0ST', 'ADCS'),
01012     ('LHKT6CALAF0T0', 'ADCV'),
01013     ('LHKT6CALAF0T1ST', 'ADCS'),
01014     ('LHKT6CALAF0T1', 'ADCV'),
01015     ('LHKT6CALAF1T0ST', 'ADCS'),
01016     ('LHKT6CALAF1T0', 'ADCV'),
01017     ('LHKT6CALAF1T1ST', 'ADCS'),
01018     ('LHKT6CALAF1T1', 'ADCV'),
01019     ('LHKT6CALAF2T0ST', 'ADCS'),
01020     ('LHKT6CALAF2T0', 'ADCV'),
01021     ('LHKT6CALAF2T1ST', 'ADCS'),
01022     ('LHKT6CALAF2T1', 'ADCV'),
01023     ('LHKT6CALAF3T0ST', 'ADCS'),
01024     ('LHKT6CALAF3T0', 'ADCV'),
01025     ('LHKT6CALAF3T1ST', 'ADCS'),
01026     ('LHKT6CALAF3T1', 'ADCV'),
01027     ('LHKT6TKRC0T0ST', 'ADCS'),
01028     ('LHKT6TKRC0T0', 'ADCV'),
01029     ('LHKT6TKRC0T1ST', 'ADCS'),
01030     ('LHKT6TKRC0T1', 'ADCV'),
01031     ('LHKT6TKRC1T0ST', 'ADCS'),
01032     ('LHKT6TKRC1T0', 'ADCV'),
01033     ('LHKT6TKRC1T1ST', 'ADCS'),
01034     ('LHKT6TKRC1T1', 'ADCV'),
01035     ('LHKT6TKRC2T0ST', 'ADCS'),
01036     ('LHKT6TKRC2T0', 'ADCV'),
01037     ('LHKT6TKRC2T1ST', 'ADCS'),
01038     ('LHKT6TKRC2T1', 'ADCV'),
01039     ('LHKT6TKRC3T0ST', 'ADCS'),
01040     ('LHKT6TKRC3T0', 'ADCV'),
01041     ('LHKT6TKRC3T1ST', 'ADCS'),
01042     ('LHKT6TKRC3T1', 'ADCV'),
01043     ('LHKT6TKRC4T0ST', 'ADCS'),
01044     ('LHKT6TKRC4T0', 'ADCV'),
01045     ('LHKT6TKRC4T1ST', 'ADCS'),
01046     ('LHKT6TKRC4T1', 'ADCV'),
01047     ('LHKT6TKRC5T0ST', 'ADCS'),
01048     ('LHKT6TKRC5T0', 'ADCV'),
01049     ('LHKT6TKRC5T1ST', 'ADCS'),
01050     ('LHKT6TKRC5T1', 'ADCV'),
01051     ('LHKT6TKRC6T0ST', 'ADCS'),
01052     ('LHKT6TKRC6T0', 'ADCV'),
01053     ('LHKT6TKRC6T1ST', 'ADCS'),
01054     ('LHKT6TKRC6T1', 'ADCV'),
01055     ('LHKT6TKRC7T0ST', 'ADCS'),
01056     ('LHKT6TKRC7T0', 'ADCV'),
01057     ('LHKT6TKRC7T1ST', 'ADCS'),
01058     ('LHKT6TKRC7T1', 'ADCV'),
01059     ('LHKT7CALAF0T0ST', 'ADCS'),
01060     ('LHKT7CALAF0T0', 'ADCV'),
01061     ('LHKT7CALAF0T1ST', 'ADCS'),
01062     ('LHKT7CALAF0T1', 'ADCV'),
01063     ('LHKT7CALAF1T0ST', 'ADCS'),
01064     ('LHKT7CALAF1T0', 'ADCV'),
01065     ('LHKT7CALAF1T1ST', 'ADCS'),
01066     ('LHKT7CALAF1T1', 'ADCV'),
01067     ('LHKT7CALAF2T0ST', 'ADCS'),
01068     ('LHKT7CALAF2T0', 'ADCV'),
01069     ('LHKT7CALAF2T1ST', 'ADCS'),
01070     ('LHKT7CALAF2T1', 'ADCV'),
01071     ('LHKT7CALAF3T0ST', 'ADCS'),
01072     ('LHKT7CALAF3T0', 'ADCV'),
01073     ('LHKT7CALAF3T1ST', 'ADCS'),
01074     ('LHKT7CALAF3T1', 'ADCV'),
01075     ('LHKT7TKRC0T0ST', 'ADCS'),
01076     ('LHKT7TKRC0T0', 'ADCV'),
01077     ('LHKT7TKRC0T1ST', 'ADCS'),
01078     ('LHKT7TKRC0T1', 'ADCV'),
01079     ('LHKT7TKRC1T0ST', 'ADCS'),
01080     ('LHKT7TKRC1T0', 'ADCV'),
01081     ('LHKT7TKRC1T1ST', 'ADCS'),
01082     ('LHKT7TKRC1T1', 'ADCV'),
01083     ('LHKT7TKRC2T0ST', 'ADCS'),
01084     ('LHKT7TKRC2T0', 'ADCV'),
01085     ('LHKT7TKRC2T1ST', 'ADCS'),
01086     ('LHKT7TKRC2T1', 'ADCV'),
01087     ('LHKT7TKRC3T0ST', 'ADCS'),
01088     ('LHKT7TKRC3T0', 'ADCV'),
01089     ('LHKT7TKRC3T1ST', 'ADCS'),
01090     ('LHKT7TKRC3T1', 'ADCV'),
01091     ('LHKT7TKRC4T0ST', 'ADCS'),
01092     ('LHKT7TKRC4T0', 'ADCV'),
01093     ('LHKT7TKRC4T1ST', 'ADCS'),
01094     ('LHKT7TKRC4T1', 'ADCV'),
01095     ('LHKT7TKRC5T0ST', 'ADCS'),
01096     ('LHKT7TKRC5T0', 'ADCV'),
01097     ('LHKT7TKRC5T1ST', 'ADCS'),
01098     ('LHKT7TKRC5T1', 'ADCV'),
01099     ('LHKT7TKRC6T0ST', 'ADCS'),
01100     ('LHKT7TKRC6T0', 'ADCV'),
01101     ('LHKT7TKRC6T1ST', 'ADCS'),
01102     ('LHKT7TKRC6T1', 'ADCV'),
01103     ('LHKT7TKRC7T0ST', 'ADCS'),
01104     ('LHKT7TKRC7T0', 'ADCV'),
01105     ('LHKT7TKRC7T1ST', 'ADCS'),
01106     ('LHKT7TKRC7T1', 'ADCV'),
01107     ]
01108   def __init__(self, ui):
01109     HskPacket.__init__(self, ui)
01110     self.name  = "TemEnvTemp3"
01111     self.brief = "TEM Temperature Packet 3"
01112     self.descr = "Contains temperature specific ADC values for TEMs 6 and 7."
01113     self.read()
01114
01115
01116 class HskPacket21a(HskPacket):
01117   mnemList = [
01118     ('LHKSPARE08', 'TSP8'),
01119     ('LHKSPARE08', 'TSP8'),
01120     ('LHKSPARE08', 'TSP8'),
01121     ('LHKSPARE08', 'TSP8'),
01122     ('LHKSPARE08', 'TSP8'),
01123     ('LHKSPARE08', 'TSP8'),
01124     ('LHKT8CALAF0T0ST', 'ADCS'),
01125     ('LHKT8CALAF0T0', 'ADCV'),
01126     ('LHKT8CALAF0T1ST', 'ADCS'),
01127     ('LHKT8CALAF0T1', 'ADCV'),
01128     ('LHKT8CALAF1T0ST', 'ADCS'),
01129     ('LHKT8CALAF1T0', 'ADCV'),
01130     ('LHKT8CALAF1T1ST', 'ADCS'),
01131     ('LHKT8CALAF1T1', 'ADCV'),
01132     ('LHKT8CALAF2T0ST', 'ADCS'),
01133     ('LHKT8CALAF2T0', 'ADCV'),
01134     ('LHKT8CALAF2T1ST', 'ADCS'),
01135     ('LHKT8CALAF2T1', 'ADCV'),
01136     ('LHKT8CALAF3T0ST', 'ADCS'),
01137     ('LHKT8CALAF3T0', 'ADCV'),
01138     ('LHKT8CALAF3T1ST', 'ADCS'),
01139     ('LHKT8CALAF3T1', 'ADCV'),
01140     ('LHKT8TKRC0T0ST', 'ADCS'),
01141     ('LHKT8TKRC0T0', 'ADCV'),
01142     ('LHKT8TKRC0T1ST', 'ADCS'),
01143     ('LHKT8TKRC0T1', 'ADCV'),
01144     ('LHKT8TKRC1T0ST', 'ADCS'),
01145     ('LHKT8TKRC1T0', 'ADCV'),
01146     ('LHKT8TKRC1T1ST', 'ADCS'),
01147     ('LHKT8TKRC1T1', 'ADCV'),
01148     ('LHKT8TKRC2T0ST', 'ADCS'),
01149     ('LHKT8TKRC2T0', 'ADCV'),
01150     ('LHKT8TKRC2T1ST', 'ADCS'),
01151     ('LHKT8TKRC2T1', 'ADCV'),
01152     ('LHKT8TKRC3T0ST', 'ADCS'),
01153     ('LHKT8TKRC3T0', 'ADCV'),
01154     ('LHKT8TKRC3T1ST', 'ADCS'),
01155     ('LHKT8TKRC3T1', 'ADCV'),
01156     ('LHKT8TKRC4T0ST', 'ADCS'),
01157     ('LHKT8TKRC4T0', 'ADCV'),
01158     ('LHKT8TKRC4T1ST', 'ADCS'),
01159     ('LHKT8TKRC4T1', 'ADCV'),
01160     ('LHKT8TKRC5T0ST', 'ADCS'),
01161     ('LHKT8TKRC5T0', 'ADCV'),
01162     ('LHKT8TKRC5T1ST', 'ADCS'),
01163     ('LHKT8TKRC5T1', 'ADCV'),
01164     ('LHKT8TKRC6T0ST', 'ADCS'),
01165     ('LHKT8TKRC6T0', 'ADCV'),
01166     ('LHKT8TKRC6T1ST', 'ADCS'),
01167     ('LHKT8TKRC6T1', 'ADCV'),
01168     ('LHKT8TKRC7T0ST', 'ADCS'),
01169     ('LHKT8TKRC7T0', 'ADCV'),
01170     ('LHKT8TKRC7T1ST', 'ADCS'),
01171     ('LHKT8TKRC7T1', 'ADCV'),
01172     ('LHKT9CALAF0T0ST', 'ADCS'),
01173     ('LHKT9CALAF0T0', 'ADCV'),
01174     ('LHKT9CALAF0T1ST', 'ADCS'),
01175     ('LHKT9CALAF0T1', 'ADCV'),
01176     ('LHKT9CALAF1T0ST', 'ADCS'),
01177     ('LHKT9CALAF1T0', 'ADCV'),
01178     ('LHKT9CALAF1T1ST', 'ADCS'),
01179     ('LHKT9CALAF1T1', 'ADCV'),
01180     ('LHKT9CALAF2T0ST', 'ADCS'),
01181     ('LHKT9CALAF2T0', 'ADCV'),
01182     ('LHKT9CALAF2T1ST', 'ADCS'),
01183     ('LHKT9CALAF2T1', 'ADCV'),
01184     ('LHKT9CALAF3T0ST', 'ADCS'),
01185     ('LHKT9CALAF3T0', 'ADCV'),
01186     ('LHKT9CALAF3T1ST', 'ADCS'),
01187     ('LHKT9CALAF3T1', 'ADCV'),
01188     ('LHKT9TKRC0T0ST', 'ADCS'),
01189     ('LHKT9TKRC0T0', 'ADCV'),
01190     ('LHKT9TKRC0T1ST', 'ADCS'),
01191     ('LHKT9TKRC0T1', 'ADCV'),
01192     ('LHKT9TKRC1T0ST', 'ADCS'),
01193     ('LHKT9TKRC1T0', 'ADCV'),
01194     ('LHKT9TKRC1T1ST', 'ADCS'),
01195     ('LHKT9TKRC1T1', 'ADCV'),
01196     ('LHKT9TKRC2T0ST', 'ADCS'),
01197     ('LHKT9TKRC2T0', 'ADCV'),
01198     ('LHKT9TKRC2T1ST', 'ADCS'),
01199     ('LHKT9TKRC2T1', 'ADCV'),
01200     ('LHKT9TKRC3T0ST', 'ADCS'),
01201     ('LHKT9TKRC3T0', 'ADCV'),
01202     ('LHKT9TKRC3T1ST', 'ADCS'),
01203     ('LHKT9TKRC3T1', 'ADCV'),
01204     ('LHKT9TKRC4T0ST', 'ADCS'),
01205     ('LHKT9TKRC4T0', 'ADCV'),
01206     ('LHKT9TKRC4T1ST', 'ADCS'),
01207     ('LHKT9TKRC4T1', 'ADCV'),
01208     ('LHKT9TKRC5T0ST', 'ADCS'),
01209     ('LHKT9TKRC5T0', 'ADCV'),
01210     ('LHKT9TKRC5T1ST', 'ADCS'),
01211     ('LHKT9TKRC5T1', 'ADCV'),
01212     ('LHKT9TKRC6T0ST', 'ADCS'),
01213     ('LHKT9TKRC6T0', 'ADCV'),
01214     ('LHKT9TKRC6T1ST', 'ADCS'),
01215     ('LHKT9TKRC6T1', 'ADCV'),
01216     ('LHKT9TKRC7T0ST', 'ADCS'),
01217     ('LHKT9TKRC7T0', 'ADCV'),
01218     ('LHKT9TKRC7T1ST', 'ADCS'),
01219     ('LHKT9TKRC7T1', 'ADCV'),
01220     ]
01221   def __init__(self, ui):
01222     HskPacket.__init__(self, ui)
01223     self.name  = "TemEnvTemp4"
01224     self.brief = "TEM Temperature Packet 4"
01225     self.descr = "Contains temperature specific ADC values for TEMs 8 and 9."
01226     self.read()
01227
01228
01229 class HskPacket21b(HskPacket):
01230   mnemList = [
01231     ('LHKSPARE08', 'TSP8'),
01232     ('LHKSPARE08', 'TSP8'),
01233     ('LHKSPARE08', 'TSP8'),
01234     ('LHKSPARE08', 'TSP8'),
01235     ('LHKSPARE08', 'TSP8'),
01236     ('LHKSPARE08', 'TSP8'),
01237     ('LHKTACALAF0T0ST', 'ADCS'),
01238     ('LHKTACALAF0T0', 'ADCV'),
01239     ('LHKTACALAF0T1ST', 'ADCS'),
01240     ('LHKTACALAF0T1', 'ADCV'),
01241     ('LHKTACALAF1T0ST', 'ADCS'),
01242     ('LHKTACALAF1T0', 'ADCV'),
01243     ('LHKTACALAF1T1ST', 'ADCS'),
01244     ('LHKTACALAF1T1', 'ADCV'),
01245     ('LHKTACALAF2T0ST', 'ADCS'),
01246     ('LHKTACALAF2T0', 'ADCV'),
01247     ('LHKTACALAF2T1ST', 'ADCS'),
01248     ('LHKTACALAF2T1', 'ADCV'),
01249     ('LHKTACALAF3T0ST', 'ADCS'),
01250     ('LHKTACALAF3T0', 'ADCV'),
01251     ('LHKTACALAF3T1ST', 'ADCS'),
01252     ('LHKTACALAF3T1', 'ADCV'),
01253     ('LHKTATKRC0T0ST', 'ADCS'),
01254     ('LHKTATKRC0T0', 'ADCV'),
01255     ('LHKTATKRC0T1ST', 'ADCS'),
01256     ('LHKTATKRC0T1', 'ADCV'),
01257     ('LHKTATKRC1T0ST', 'ADCS'),
01258     ('LHKTATKRC1T0', 'ADCV'),
01259     ('LHKTATKRC1T1ST', 'ADCS'),
01260     ('LHKTATKRC1T1', 'ADCV'),
01261     ('LHKTATKRC2T0ST', 'ADCS'),
01262     ('LHKTATKRC2T0', 'ADCV'),
01263     ('LHKTATKRC2T1ST', 'ADCS'),
01264     ('LHKTATKRC2T1', 'ADCV'),
01265     ('LHKTATKRC3T0ST', 'ADCS'),
01266     ('LHKTATKRC3T0', 'ADCV'),
01267     ('LHKTATKRC3T1ST', 'ADCS'),
01268     ('LHKTATKRC3T1', 'ADCV'),
01269     ('LHKTATKRC4T0ST', 'ADCS'),
01270     ('LHKTATKRC4T0', 'ADCV'),
01271     ('LHKTATKRC4T1ST', 'ADCS'),
01272     ('LHKTATKRC4T1', 'ADCV'),
01273     ('LHKTATKRC5T0ST', 'ADCS'),
01274     ('LHKTATKRC5T0', 'ADCV'),
01275     ('LHKTATKRC5T1ST', 'ADCS'),
01276     ('LHKTATKRC5T1', 'ADCV'),
01277     ('LHKTATKRC6T0ST', 'ADCS'),
01278     ('LHKTATKRC6T0', 'ADCV'),
01279     ('LHKTATKRC6T1ST', 'ADCS'),
01280     ('LHKTATKRC6T1', 'ADCV'),
01281     ('LHKTATKRC7T0ST', 'ADCS'),
01282     ('LHKTATKRC7T0', 'ADCV'),
01283     ('LHKTATKRC7T1ST', 'ADCS'),
01284     ('LHKTATKRC7T1', 'ADCV'),
01285     ('LHKTBCALAF0T0ST', 'ADCS'),
01286     ('LHKTBCALAF0T0', 'ADCV'),
01287     ('LHKTBCALAF0T1ST', 'ADCS'),
01288     ('LHKTBCALAF0T1', 'ADCV'),
01289     ('LHKTBCALAF1T0ST', 'ADCS'),
01290     ('LHKTBCALAF1T0', 'ADCV'),
01291     ('LHKTBCALAF1T1ST', 'ADCS'),
01292     ('LHKTBCALAF1T1', 'ADCV'),
01293     ('LHKTBCALAF2T0ST', 'ADCS'),
01294     ('LHKTBCALAF2T0', 'ADCV'),
01295     ('LHKTBCALAF2T1ST', 'ADCS'),
01296     ('LHKTBCALAF2T1', 'ADCV'),
01297     ('LHKTBCALAF3T0ST', 'ADCS'),
01298     ('LHKTBCALAF3T0', 'ADCV'),
01299     ('LHKTBCALAF3T1ST', 'ADCS'),
01300     ('LHKTBCALAF3T1', 'ADCV'),
01301     ('LHKTBTKRC0T0ST', 'ADCS'),
01302     ('LHKTBTKRC0T0', 'ADCV'),
01303     ('LHKTBTKRC0T1ST', 'ADCS'),
01304     ('LHKTBTKRC0T1', 'ADCV'),
01305     ('LHKTBTKRC1T0ST', 'ADCS'),
01306     ('LHKTBTKRC1T0', 'ADCV'),
01307     ('LHKTBTKRC1T1ST', 'ADCS'),
01308     ('LHKTBTKRC1T1', 'ADCV'),
01309     ('LHKTBTKRC2T0ST', 'ADCS'),
01310     ('LHKTBTKRC2T0', 'ADCV'),
01311     ('LHKTBTKRC2T1ST', 'ADCS'),
01312     ('LHKTBTKRC2T1', 'ADCV'),
01313     ('LHKTBTKRC3T0ST', 'ADCS'),
01314     ('LHKTBTKRC3T0', 'ADCV'),
01315     ('LHKTBTKRC3T1ST', 'ADCS'),
01316     ('LHKTBTKRC3T1', 'ADCV'),
01317     ('LHKTBTKRC4T0ST', 'ADCS'),
01318     ('LHKTBTKRC4T0', 'ADCV'),
01319     ('LHKTBTKRC4T1ST', 'ADCS'),
01320     ('LHKTBTKRC4T1', 'ADCV'),
01321     ('LHKTBTKRC5T0ST', 'ADCS'),
01322     ('LHKTBTKRC5T0', 'ADCV'),
01323     ('LHKTBTKRC5T1ST', 'ADCS'),
01324     ('LHKTBTKRC5T1', 'ADCV'),
01325     ('LHKTBTKRC6T0ST', 'ADCS'),
01326     ('LHKTBTKRC6T0', 'ADCV'),
01327     ('LHKTBTKRC6T1ST', 'ADCS'),
01328     ('LHKTBTKRC6T1', 'ADCV'),
01329     ('LHKTBTKRC7T0ST', 'ADCS'),
01330     ('LHKTBTKRC7T0', 'ADCV'),
01331     ('LHKTBTKRC7T1ST', 'ADCS'),
01332     ('LHKTBTKRC7T1', 'ADCV'),
01333     ]
01334   def __init__(self, ui):
01335     HskPacket.__init__(self, ui)
01336     self.name  = "TemEnvTemp5"
01337     self.brief = "TEM Temperature Packet 5"
01338     self.descr = "Contains temperature specific ADC values for TEMs A and B."
01339     self.read()
01340
01341
01342 class HskPacket21c(HskPacket):
01343   mnemList = [
01344     ('LHKSPARE08', 'TSP8'),
01345     ('LHKSPARE08', 'TSP8'),
01346     ('LHKSPARE08', 'TSP8'),
01347     ('LHKSPARE08', 'TSP8'),
01348     ('LHKSPARE08', 'TSP8'),
01349     ('LHKSPARE08', 'TSP8'),
01350     ('LHKTCCALAF0T0ST', 'ADCS'),
01351     ('LHKTCCALAF0T0', 'ADCV'),
01352     ('LHKTCCALAF0T1ST', 'ADCS'),
01353     ('LHKTCCALAF0T1', 'ADCV'),
01354     ('LHKTCCALAF1T0ST', 'ADCS'),
01355     ('LHKTCCALAF1T0', 'ADCV'),
01356     ('LHKTCCALAF1T1ST', 'ADCS'),
01357     ('LHKTCCALAF1T1', 'ADCV'),
01358     ('LHKTCCALAF2T0ST', 'ADCS'),
01359     ('LHKTCCALAF2T0', 'ADCV'),
01360     ('LHKTCCALAF2T1ST', 'ADCS'),
01361     ('LHKTCCALAF2T1', 'ADCV'),
01362     ('LHKTCCALAF3T0ST', 'ADCS'),
01363     ('LHKTCCALAF3T0', 'ADCV'),
01364     ('LHKTCCALAF3T1ST', 'ADCS'),
01365     ('LHKTCCALAF3T1', 'ADCV'),
01366     ('LHKTCTKRC0T0ST', 'ADCS'),
01367     ('LHKTCTKRC0T0', 'ADCV'),
01368     ('LHKTCTKRC0T1ST', 'ADCS'),
01369     ('LHKTCTKRC0T1', 'ADCV'),
01370     ('LHKTCTKRC1T0ST', 'ADCS'),
01371     ('LHKTCTKRC1T0', 'ADCV'),
01372     ('LHKTCTKRC1T1ST', 'ADCS'),
01373     ('LHKTCTKRC1T1', 'ADCV'),
01374     ('LHKTCTKRC2T0ST', 'ADCS'),
01375     ('LHKTCTKRC2T0', 'ADCV'),
01376     ('LHKTCTKRC2T1ST', 'ADCS'),
01377     ('LHKTCTKRC2T1', 'ADCV'),
01378     ('LHKTCTKRC3T0ST', 'ADCS'),
01379     ('LHKTCTKRC3T0', 'ADCV'),
01380     ('LHKTCTKRC3T1ST', 'ADCS'),
01381     ('LHKTCTKRC3T1', 'ADCV'),
01382     ('LHKTCTKRC4T0ST', 'ADCS'),
01383     ('LHKTCTKRC4T0', 'ADCV'),
01384     ('LHKTCTKRC4T1ST', 'ADCS'),
01385     ('LHKTCTKRC4T1', 'ADCV'),
01386     ('LHKTCTKRC5T0ST', 'ADCS'),
01387     ('LHKTCTKRC5T0', 'ADCV'),
01388     ('LHKTCTKRC5T1ST', 'ADCS'),
01389     ('LHKTCTKRC5T1', 'ADCV'),
01390     ('LHKTCTKRC6T0ST', 'ADCS'),
01391     ('LHKTCTKRC6T0', 'ADCV'),
01392     ('LHKTCTKRC6T1ST', 'ADCS'),
01393     ('LHKTCTKRC6T1', 'ADCV'),
01394     ('LHKTCTKRC7T0ST', 'ADCS'),
01395     ('LHKTCTKRC7T0', 'ADCV'),
01396     ('LHKTCTKRC7T1ST', 'ADCS'),
01397     ('LHKTCTKRC7T1', 'ADCV'),
01398     ('LHKTDCALAF0T0ST', 'ADCS'),
01399     ('LHKTDCALAF0T0', 'ADCV'),
01400     ('LHKTDCALAF0T1ST', 'ADCS'),
01401     ('LHKTDCALAF0T1', 'ADCV'),
01402     ('LHKTDCALAF1T0ST', 'ADCS'),
01403     ('LHKTDCALAF1T0', 'ADCV'),
01404     ('LHKTDCALAF1T1ST', 'ADCS'),
01405     ('LHKTDCALAF1T1', 'ADCV'),
01406     ('LHKTDCALAF2T0ST', 'ADCS'),
01407     ('LHKTDCALAF2T0', 'ADCV'),
01408     ('LHKTDCALAF2T1ST', 'ADCS'),
01409     ('LHKTDCALAF2T1', 'ADCV'),
01410     ('LHKTDCALAF3T0ST', 'ADCS'),
01411     ('LHKTDCALAF3T0', 'ADCV'),
01412     ('LHKTDCALAF3T1ST', 'ADCS'),
01413     ('LHKTDCALAF3T1', 'ADCV'),
01414     ('LHKTDTKRC0T0ST', 'ADCS'),
01415     ('LHKTDTKRC0T0', 'ADCV'),
01416     ('LHKTDTKRC0T1ST', 'ADCS'),
01417     ('LHKTDTKRC0T1', 'ADCV'),
01418     ('LHKTDTKRC1T0ST', 'ADCS'),
01419     ('LHKTDTKRC1T0', 'ADCV'),
01420     ('LHKTDTKRC1T1ST', 'ADCS'),
01421     ('LHKTDTKRC1T1', 'ADCV'),
01422     ('LHKTDTKRC2T0ST', 'ADCS'),
01423     ('LHKTDTKRC2T0', 'ADCV'),
01424     ('LHKTDTKRC2T1ST', 'ADCS'),
01425     ('LHKTDTKRC2T1', 'ADCV'),
01426     ('LHKTDTKRC3T0ST', 'ADCS'),
01427     ('LHKTDTKRC3T0', 'ADCV'),
01428     ('LHKTDTKRC3T1ST', 'ADCS'),
01429     ('LHKTDTKRC3T1', 'ADCV'),
01430     ('LHKTDTKRC4T0ST', 'ADCS'),
01431     ('LHKTDTKRC4T0', 'ADCV'),
01432     ('LHKTDTKRC4T1ST', 'ADCS'),
01433     ('LHKTDTKRC4T1', 'ADCV'),
01434     ('LHKTDTKRC5T0ST', 'ADCS'),
01435     ('LHKTDTKRC5T0', 'ADCV'),
01436     ('LHKTDTKRC5T1ST', 'ADCS'),
01437     ('LHKTDTKRC5T1', 'ADCV'),
01438     ('LHKTDTKRC6T0ST', 'ADCS'),
01439     ('LHKTDTKRC6T0', 'ADCV'),
01440     ('LHKTDTKRC6T1ST', 'ADCS'),
01441     ('LHKTDTKRC6T1', 'ADCV'),
01442     ('LHKTDTKRC7T0ST', 'ADCS'),
01443     ('LHKTDTKRC7T0', 'ADCV'),
01444     ('LHKTDTKRC7T1ST', 'ADCS'),
01445     ('LHKTDTKRC7T1', 'ADCV'),
01446     ]
01447   def __init__(self, ui):
01448     HskPacket.__init__(self, ui)
01449     self.name  = "TemEnvTemp6"
01450     self.brief = "TEM Temperature Packet 6"
01451     self.descr = "Contains temperature specific ADC values for TEMs C and D."
01452     self.read()
01453
01454
01455 class HskPacket21d(HskPacket):
01456   mnemList = [
01457     ('LHKSPARE08', 'TSP8'),
01458     ('LHKSPARE08', 'TSP8'),
01459     ('LHKSPARE08', 'TSP8'),
01460     ('LHKSPARE08', 'TSP8'),
01461     ('LHKSPARE08', 'TSP8'),
01462     ('LHKSPARE08', 'TSP8'),
01463     ('LHKTECALAF0T0ST', 'ADCS'),
01464     ('LHKTECALAF0T0', 'ADCV'),
01465     ('LHKTECALAF0T1ST', 'ADCS'),
01466     ('LHKTECALAF0T1', 'ADCV'),
01467     ('LHKTECALAF1T0ST', 'ADCS'),
01468     ('LHKTECALAF1T0', 'ADCV'),
01469     ('LHKTECALAF1T1ST', 'ADCS'),
01470     ('LHKTECALAF1T1', 'ADCV'),
01471     ('LHKTECALAF2T0ST', 'ADCS'),
01472     ('LHKTECALAF2T0', 'ADCV'),
01473     ('LHKTECALAF2T1ST', 'ADCS'),
01474     ('LHKTECALAF2T1', 'ADCV'),
01475     ('LHKTECALAF3T0ST', 'ADCS'),
01476     ('LHKTECALAF3T0', 'ADCV'),
01477     ('LHKTECALAF3T1ST', 'ADCS'),
01478     ('LHKTECALAF3T1', 'ADCV'),
01479     ('LHKTETKRC0T0ST', 'ADCS'),
01480     ('LHKTETKRC0T0', 'ADCV'),
01481     ('LHKTETKRC0T1ST', 'ADCS'),
01482     ('LHKTETKRC0T1', 'ADCV'),
01483     ('LHKTETKRC1T0ST', 'ADCS'),
01484     ('LHKTETKRC1T0', 'ADCV'),
01485     ('LHKTETKRC1T1ST', 'ADCS'),
01486     ('LHKTETKRC1T1', 'ADCV'),
01487     ('LHKTETKRC2T0ST', 'ADCS'),
01488     ('LHKTETKRC2T0', 'ADCV'),
01489     ('LHKTETKRC2T1ST', 'ADCS'),
01490     ('LHKTETKRC2T1', 'ADCV'),
01491     ('LHKTETKRC3T0ST', 'ADCS'),
01492     ('LHKTETKRC3T0', 'ADCV'),
01493     ('LHKTETKRC3T1ST', 'ADCS'),
01494     ('LHKTETKRC3T1', 'ADCV'),
01495     ('LHKTETKRC4T0ST', 'ADCS'),
01496     ('LHKTETKRC4T0', 'ADCV'),
01497     ('LHKTETKRC4T1ST', 'ADCS'),
01498     ('LHKTETKRC4T1', 'ADCV'),
01499     ('LHKTETKRC5T0ST', 'ADCS'),
01500     ('LHKTETKRC5T0', 'ADCV'),
01501     ('LHKTETKRC5T1ST', 'ADCS'),
01502     ('LHKTETKRC5T1', 'ADCV'),
01503     ('LHKTETKRC6T0ST', 'ADCS'),
01504     ('LHKTETKRC6T0', 'ADCV'),
01505     ('LHKTETKRC6T1ST', 'ADCS'),
01506     ('LHKTETKRC6T1', 'ADCV'),
01507     ('LHKTETKRC7T0ST', 'ADCS'),
01508     ('LHKTETKRC7T0', 'ADCV'),
01509     ('LHKTETKRC7T1ST', 'ADCS'),
01510     ('LHKTETKRC7T1', 'ADCV'),
01511     ('LHKTFCALAF0T0ST', 'ADCS'),
01512     ('LHKTFCALAF0T0', 'ADCV'),
01513     ('LHKTFCALAF0T1ST', 'ADCS'),
01514     ('LHKTFCALAF0T1', 'ADCV'),
01515     ('LHKTFCALAF1T0ST', 'ADCS'),
01516     ('LHKTFCALAF1T0', 'ADCV'),
01517     ('LHKTFCALAF1T1ST', 'ADCS'),
01518     ('LHKTFCALAF1T1', 'ADCV'),
01519     ('LHKTFCALAF2T0ST', 'ADCS'),
01520     ('LHKTFCALAF2T0', 'ADCV'),
01521     ('LHKTFCALAF2T1ST', 'ADCS'),
01522     ('LHKTFCALAF2T1', 'ADCV'),
01523     ('LHKTFCALAF3T0ST', 'ADCS'),
01524     ('LHKTFCALAF3T0', 'ADCV'),
01525     ('LHKTFCALAF3T1ST', 'ADCS'),
01526     ('LHKTFCALAF3T1', 'ADCV'),
01527     ('LHKTFTKRC0T0ST', 'ADCS'),
01528     ('LHKTFTKRC0T0', 'ADCV'),
01529     ('LHKTFTKRC0T1ST', 'ADCS'),
01530     ('LHKTFTKRC0T1', 'ADCV'),
01531     ('LHKTFTKRC1T0ST', 'ADCS'),
01532     ('LHKTFTKRC1T0', 'ADCV'),
01533     ('LHKTFTKRC1T1ST', 'ADCS'),
01534     ('LHKTFTKRC1T1', 'ADCV'),
01535     ('LHKTFTKRC2T0ST', 'ADCS'),
01536     ('LHKTFTKRC2T0', 'ADCV'),
01537     ('LHKTFTKRC2T1ST', 'ADCS'),
01538     ('LHKTFTKRC2T1', 'ADCV'),
01539     ('LHKTFTKRC3T0ST', 'ADCS'),
01540     ('LHKTFTKRC3T0', 'ADCV'),
01541     ('LHKTFTKRC3T1ST', 'ADCS'),
01542     ('LHKTFTKRC3T1', 'ADCV'),
01543     ('LHKTFTKRC4T0ST', 'ADCS'),
01544     ('LHKTFTKRC4T0', 'ADCV'),
01545     ('LHKTFTKRC4T1ST', 'ADCS'),
01546     ('LHKTFTKRC4T1', 'ADCV'),
01547     ('LHKTFTKRC5T0ST', 'ADCS'),
01548     ('LHKTFTKRC5T0', 'ADCV'),
01549     ('LHKTFTKRC5T1ST', 'ADCS'),
01550     ('LHKTFTKRC5T1', 'ADCV'),
01551     ('LHKTFTKRC6T0ST', 'ADCS'),
01552     ('LHKTFTKRC6T0', 'ADCV'),
01553     ('LHKTFTKRC6T1ST', 'ADCS'),
01554     ('LHKTFTKRC6T1', 'ADCV'),
01555     ('LHKTFTKRC7T0ST', 'ADCS'),
01556     ('LHKTFTKRC7T0', 'ADCV'),
01557     ('LHKTFTKRC7T1ST', 'ADCS'),
01558     ('LHKTFTKRC7T1', 'ADCV'),
01559     ]
01560   def __init__(self, ui):
01561     HskPacket.__init__(self, ui)
01562     self.name  = "TemEnvTemp7"
01563     self.brief = "TEM Temperature Packet 7"
01564     self.descr = "Contains temperature specific ADC values for TEMs E and F."
01565     self.read()
01566
01567
01568 class HskPacket21e(HskPacket):
01569   mnemList = [
01570     ('LHKSPARE08', 'TSP8'),
01571     ('LHKSPARE08', 'TSP8'),
01572     ('LHKSPARE08', 'TSP8'),
01573     ('LHKSPARE08', 'TSP8'),
01574     ('LHKSPARE08', 'TSP8'),
01575     ('LHKSPARE08', 'TSP8'),
01576     ('LHKP0TEMFPM', 'PDUTEMPWRST'),
01577     ('LHKP0TEMEPM', 'PDUTEMPWRST'),
01578     ('LHKP0TEMDPM', 'PDUTEMPWRST'),
01579     ('LHKP0TEMCPM', 'PDUTEMPWRST'),
01580     ('LHKP0TEMBPM', 'PDUTEMPWRST'),
01581     ('LHKP0TEMAPM', 'PDUTEMPWRST'),
01582     ('LHKP0TEM9PM', 'PDUTEMPWRST'),
01583     ('LHKP0TEM8PM', 'PDUTEMPWRST'),
01584     ('LHKP0TEM7PM', 'PDUTEMPWRST'),
01585     ('LHKP0TEM6PM', 'PDUTEMPWRST'),
01586     ('LHKP0TEM5PM', 'PDUTEMPWRST'),
01587     ('LHKP0TEM4PM', 'PDUTEMPWRST'),
01588     ('LHKP0TEM3PM', 'PDUTEMPWRST'),
01589     ('LHKP0TEM2PM', 'PDUTEMPWRST'),
01590     ('LHKP0TEM1PM', 'PDUTEMPWRST'),
01591     ('LHKP0TEM0PM', 'PDUTEMPWRST'),
01592     ('LHKSPARE10', 'TSP10'),
01593     ('LHKP0EPU2CNVT', 'PDUEPUCVTST'),
01594     ('LHKP0EPU1CNVT', 'PDUEPUCVTST'),
01595     ('LHKP0EPU0CNVT', 'PDUEPUCVTST'),
01596     ('LHKP0EPU2PM', 'PDUEPUPWRST'),
01597     ('LHKP0EPU1PM', 'PDUEPUPWRST'),
01598     ('LHKP0EPU0PM', 'PDUEPUPWRST'),
01599     ('LHKSPARE13', 'TSP13'),
01600     ('LHKP0ACDCNVT', 'PDUACDCNVT'),
01601     ('LHKP0ACDPSP', 'PDUACDPWRSUP'),
01602     ('LHKP0ACDPM', 'PDUACDPWRST'),
01603     ('LHKP0TEM033VST', 'ADCS'),
01604     ('LHKP0TEM033V', 'ADCV'),
01605     ('LHKP0TEM133VST', 'ADCS'),
01606     ('LHKP0TEM133V', 'ADCV'),
01607     ('LHKP0TEM233VST', 'ADCS'),
01608     ('LHKP0TEM233V', 'ADCV'),
01609     ('LHKP0TEM333VST', 'ADCS'),
01610     ('LHKP0TEM333V', 'ADCV'),
01611     ('LHKP0TEM433VST', 'ADCS'),
01612     ('LHKP0TEM433V', 'ADCV'),
01613     ('LHKP0TEM533VST', 'ADCS'),
01614     ('LHKP0TEM533V', 'ADCV'),
01615     ('LHKP0TEM633VST', 'ADCS'),
01616     ('LHKP0TEM633V', 'ADCV'),
01617     ('LHKP0TEM733VST', 'ADCS'),
01618     ('LHKP0TEM733V', 'ADCV'),
01619     ('LHKP0TEM833VST', 'ADCS'),
01620     ('LHKP0TEM833V', 'ADCV'),
01621     ('LHKP0TEM933VST', 'ADCS'),
01622     ('LHKP0TEM933V', 'ADCV'),
01623     ('LHKP0TEMA33VST', 'ADCS'),
01624     ('LHKP0TEMA33V', 'ADCV'),
01625     ('LHKP0TEMB33VST', 'ADCS'),
01626     ('LHKP0TEMB33V', 'ADCV'),
01627     ('LHKP0TEMC33VST', 'ADCS'),
01628     ('LHKP0TEMC33V', 'ADCV'),
01629     ('LHKP0TEMD33VST', 'ADCS'),
01630     ('LHKP0TEMD33V', 'ADCV'),
01631     ('LHKP0TEME33VST', 'ADCS'),
01632     ('LHKP0TEME33V', 'ADCV'),
01633     ('LHKP0TEMF33VST', 'ADCS'),
01634     ('LHKP0TEMF33V', 'ADCV'),
01635     ('LHKP0TEM0PCTST', 'ADCS'),
01636     ('LHKP0TEM0PCT', 'ADCV'),
01637     ('LHKP0TEM1PCTST', 'ADCS'),
01638     ('LHKP0TEM1PCT', 'ADCV'),
01639     ('LHKP0TEM2PCTST', 'ADCS'),
01640     ('LHKP0TEM2PCT', 'ADCV'),
01641     ('LHKP0TEM3PCTST', 'ADCS'),
01642     ('LHKP0TEM3PCT', 'ADCV'),
01643     ('LHKP0TEM4PCTST', 'ADCS'),
01644     ('LHKP0TEM4PCT', 'ADCV'),
01645     ('LHKP0TEM5PCTST', 'ADCS'),
01646     ('LHKP0TEM5PCT', 'ADCV'),
01647     ('LHKP0TEM6PCTST', 'ADCS'),
01648     ('LHKP0TEM6PCT', 'ADCV'),
01649     ('LHKP0TEM7PCTST', 'ADCS'),
01650     ('LHKP0TEM7PCT', 'ADCV'),
01651     ('LHKP0TEM8PCTST', 'ADCS'),
01652     ('LHKP0TEM8PCT', 'ADCV'),
01653     ('LHKP0TEM9PCTST', 'ADCS'),
01654     ('LHKP0TEM9PCT', 'ADCV'),
01655     ('LHKP0TEMAPCTST', 'ADCS'),
01656     ('LHKP0TEMAPCT', 'ADCV'),
01657     ('LHKP0TEMBPCTST', 'ADCS'),
01658     ('LHKP0TEMBPCT', 'ADCV'),
01659     ('LHKP0TEMCPCTST', 'ADCS'),
01660     ('LHKP0TEMCPCT', 'ADCV'),
01661     ('LHKP0TEMDPCTST', 'ADCS'),
01662     ('LHKP0TEMDPCT', 'ADCV'),
01663     ('LHKP0TEMEPCTST', 'ADCS'),
01664     ('LHKP0TEMEPCT', 'ADCV'),
01665     ('LHKP0TEMFPCTST', 'ADCS'),
01666     ('LHKP0TEMFPCT', 'ADCV'),
01667     ('LHKP0EPU033VST', 'ADCS'),
01668     ('LHKP0EPU033V', 'ADCV'),
01669     ('LHKP0EPU133VST', 'ADCS'),
01670     ('LHKP0EPU133V', 'ADCV'),
01671     ('LHKP0EPU233VST', 'ADCS'),
01672     ('LHKP0EPU233V', 'ADCV'),
01673     ('LHKP0EPU0TST', 'ADCS'),
01674     ('LHKP0EPU0T', 'ADCV'),
01675     ('LHKP0EPU1TST', 'ADCS'),
01676     ('LHKP0EPU1T', 'ADCV'),
01677     ('LHKP0EPU2TST', 'ADCS'),
01678     ('LHKP0EPU2T', 'ADCV'),
01679     ('LHKAFR33ISUMST', 'ADCS'),
01680     ('LHKAFR33ISUM', 'ADCV'),
01681     ('LHKADABTEMPSTAT', 'ADCS'),
01682     ('LHKADABTEMP', 'ADCV'),
01683     ('LHKAFR28ISUMST', 'ADCS'),
01684     ('LHKAFR28ISUM', 'ADCV'),
01685     ('LHKADAB33VSTAT', 'ADCS'),
01686     ('LHKADAB33V', 'ADCV'),
01687     ('LHKSPARE08', 'TSP8'),
01688     ('LHKSPARE08', 'TSP8'),
01689     ('LHKSPARE08', 'TSP8'),
01690     ('LHKSPARE08', 'TSP8'),
01691     ('LHKSPARE08', 'TSP8'),
01692     ('LHKSPARE08', 'TSP8'),
01693     ]
01694   def __init__(self, ui):
01695     HskPacket.__init__(self, ui)
01696     self.name  = "PduEnv0"
01697     self.brief = "PDU Environmental Packet 0"
01698     self.descr = "PDU Packet 0"
01699     self.read()
01700
01701
01702 class HskPacket21f(HskPacket):
01703   mnemList = [
01704     ('LHKSPARE08', 'TSP8'),
01705     ('LHKSPARE08', 'TSP8'),
01706     ('LHKSPARE08', 'TSP8'),
01707     ('LHKSPARE08', 'TSP8'),
01708     ('LHKSPARE08', 'TSP8'),
01709     ('LHKSPARE08', 'TSP8'),
01710     ('LHKP0TEM0PSTST', 'ADCS'),
01711     ('LHKP0TEM0PST', 'ADCV'),
01712     ('LHKP0TEM1PSTST', 'ADCS'),
01713     ('LHKP0TEM1PST', 'ADCV'),
01714     ('LHKP0TEM2PSTST', 'ADCS'),
01715     ('LHKP0TEM2PST', 'ADCV'),
01716     ('LHKP0TEM3PSTST', 'ADCS'),
01717     ('LHKP0TEM3PST', 'ADCV'),
01718     ('LHKP0TEM4PSTST', 'ADCS'),
01719     ('LHKP0TEM4PST', 'ADCV'),
01720     ('LHKP0TEM5PSTST', 'ADCS'),
01721     ('LHKP0TEM5PST', 'ADCV'),
01722     ('LHKP0TEM6PSTST', 'ADCS'),
01723     ('LHKP0TEM6PST', 'ADCV'),
01724     ('LHKP0TEM7PSTST', 'ADCS'),
01725     ('LHKP0TEM7PST', 'ADCV'),
01726     ('LHKP0TEM8PSTST', 'ADCS'),
01727     ('LHKP0TEM8PST', 'ADCV'),
01728     ('LHKP0TEM9PSTST', 'ADCS'),
01729     ('LHKP0TEM9PST', 'ADCV'),
01730     ('LHKP0TEMAPSTST', 'ADCS'),
01731     ('LHKP0TEMAPST', 'ADCV'),
01732     ('LHKP0TEMBPSTST', 'ADCS'),
01733     ('LHKP0TEMBPST', 'ADCV'),
01734     ('LHKP0TEMCPSTST', 'ADCS'),
01735     ('LHKP0TEMCPST', 'ADCV'),
01736     ('LHKP0TEMDPSTST', 'ADCS'),
01737     ('LHKP0TEMDPST', 'ADCV'),
01738     ('LHKP0TEMEPSTST', 'ADCS'),
01739     ('LHKP0TEMEPST', 'ADCV'),
01740     ('LHKP0TEMFPSTST', 'ADCS'),
01741     ('LHKP0TEMFPST', 'ADCV'),
01742     ('LHKP0CAL0BPTST', 'ADCS'),
01743     ('LHKP0CAL0BPT', 'ADCV'),
01744     ('LHKP0CAL1BPTST', 'ADCS'),
01745     ('LHKP0CAL1BPT', 'ADCV'),
01746     ('LHKP0CAL2BPTST', 'ADCS'),
01747     ('LHKP0CAL2BPT', 'ADCV'),
01748     ('LHKP0CAL3BPTST', 'ADCS'),
01749     ('LHKP0CAL3BPT', 'ADCV'),
01750     ('LHKP0CAL4BPTST', 'ADCS'),
01751     ('LHKP0CAL4BPT', 'ADCV'),
01752     ('LHKP0CAL5BPTST', 'ADCS'),
01753     ('LHKP0CAL5BPT', 'ADCV'),
01754     ('LHKP0CAL6BPTST', 'ADCS'),
01755     ('LHKP0CAL6BPT', 'ADCV'),
01756     ('LHKP0CAL7BPTST', 'ADCS'),
01757     ('LHKP0CAL7BPT', 'ADCV'),
01758     ('LHKP0CAL8BPTST', 'ADCS'),
01759     ('LHKP0CAL8BPT', 'ADCV'),
01760     ('LHKP0CAL9BPTST', 'ADCS'),
01761     ('LHKP0CAL9BPT', 'ADCV'),
01762     ('LHKP0CALABPTST', 'ADCS'),
01763     ('LHKP0CALABPT', 'ADCV'),
01764     ('LHKP0CALBBPTST', 'ADCS'),
01765     ('LHKP0CALBBPT', 'ADCV'),
01766     ('LHKP0CALCBPTST', 'ADCS'),
01767     ('LHKP0CALCBPT', 'ADCV'),
01768     ('LHKP0CALDBPTST', 'ADCS'),
01769     ('LHKP0CALDBPT', 'ADCV'),
01770     ('LHKP0CALEBPTST', 'ADCS'),
01771     ('LHKP0CALEBPT', 'ADCV'),
01772     ('LHKP0CALFBPTST', 'ADCS'),
01773     ('LHKP0CALFBPT', 'ADCV'),
01774     ('LHKSPARE08', 'TSP8'),
01775     ('LHKSPARE08', 'TSP8'),
01776     ('LHKSPARE08', 'TSP8'),
01777     ('LHKSPARE08', 'TSP8'),
01778     ('LHKSPARE08', 'TSP8'),
01779     ('LHKSPARE08', 'TSP8'),
01780     ('LHKSPARE08', 'TSP8'),
01781     ('LHKSPARE08', 'TSP8'),
01782     ('LHKSPARE08', 'TSP8'),
01783     ('LHKSPARE08', 'TSP8'),
01784     ('LHKSPARE08', 'TSP8'),
01785     ('LHKSPARE08', 'TSP8'),
01786     ('LHKSPARE08', 'TSP8'),
01787     ('LHKSPARE08', 'TSP8'),
01788     ('LHKSPARE08', 'TSP8'),
01789     ('LHKSPARE08', 'TSP8'),
01790     ('LHKSPARE08', 'TSP8'),
01791     ('LHKSPARE08', 'TSP8'),
01792     ('LHKSPARE08', 'TSP8'),
01793     ('LHKSPARE08', 'TSP8'),
01794     ('LHKSPARE08', 'TSP8'),
01795     ('LHKSPARE08', 'TSP8'),
01796     ('LHKSPARE08', 'TSP8'),
01797     ('LHKSPARE08', 'TSP8'),
01798     ('LHKSPARE08', 'TSP8'),
01799     ('LHKSPARE08', 'TSP8'),
01800     ('LHKSPARE08', 'TSP8'),
01801     ('LHKSPARE08', 'TSP8'),
01802     ('LHKSPARE08', 'TSP8'),
01803     ('LHKSPARE08', 'TSP8'),
01804     ('LHKSPARE08', 'TSP8'),
01805     ('LHKSPARE08', 'TSP8'),
01806     ]
01807   def __init__(self, ui):
01808     HskPacket.__init__(self, ui)
01809     self.name  = "PduEnv1"
01810     self.brief = "PDU Environmental Packet 1"
01811     self.descr = "PDU Packet 1"
01812     self.read()
01813
01814
01815 class HskPacket220(HskPacket):
01816   mnemList = [
01817     ('LHKSPARE08', 'TSP8'),
01818     ('LHKSPARE08', 'TSP8'),
01819     ('LHKSPARE08', 'TSP8'),
01820     ('LHKSPARE08', 'TSP8'),
01821     ('LHKSPARE08', 'TSP8'),
01822     ('LHKSPARE08', 'TSP8'),
01823     ('LHKP0PHP0DSITST', 'ADCS'),
01824     ('LHKP0PHP0DSIT', 'ADCV'),
01825     ('LHKP0PHP1DSITST', 'ADCS'),
01826     ('LHKP0PHP1DSIT', 'ADCV'),
01827     ('LHKP0PHP2DSITST', 'ADCS'),
01828     ('LHKP0PHP2DSIT', 'ADCV'),
01829     ('LHKP0PHP3DSITST', 'ADCS'),
01830     ('LHKP0PHP3DSIT', 'ADCV'),
01831     ('LHKP0PHP4DSITST', 'ADCS'),
01832     ('LHKP0PHP4DSIT', 'ADCV'),
01833     ('LHKP0PHP5DSITST', 'ADCS'),
01834     ('LHKP0PHP5DSIT', 'ADCV'),
01835     ('LHKP0MHP0DSITST', 'ADCS'),
01836     ('LHKP0MHP0DSIT', 'ADCV'),
01837     ('LHKP0MHP1DSITST', 'ADCS'),
01838     ('LHKP0MHP1DSIT', 'ADCV'),
01839     ('LHKP0MHP2DSITST', 'ADCS'),
01840     ('LHKP0MHP2DSIT', 'ADCV'),
01841     ('LHKP0MHP3DSITST', 'ADCS'),
01842     ('LHKP0MHP3DSIT', 'ADCV'),
01843     ('LHKP0MHP4DSITST', 'ADCS'),
01844     ('LHKP0MHP4DSIT', 'ADCV'),
01845     ('LHKP0MHP5DSITST', 'ADCS'),
01846     ('LHKP0MHP5DSIT', 'ADCV'),
01847     ('LHKP0PHP0XLITST', 'ADCS'),
01848     ('LHKP0PHP0XLIT', 'ADCV'),
01849     ('LHKP0PHP1XLITST', 'ADCS'),
01850     ('LHKP0PHP1XLIT', 'ADCV'),
01851     ('LHKP0PHP2XLITST', 'ADCS'),
01852     ('LHKP0PHP2XLIT', 'ADCV'),
01853     ('LHKP0PHP3XLITST', 'ADCS'),
01854     ('LHKP0PHP3XLIT', 'ADCV'),
01855     ('LHKP0PHP4XLITST', 'ADCS'),
01856     ('LHKP0PHP4XLIT', 'ADCV'),
01857     ('LHKP0PHP5XLITST', 'ADCS'),
01858     ('LHKP0PHP5XLIT', 'ADCV'),
01859     ('LHKP0MHP0XLITST', 'ADCS'),
01860     ('LHKP0MHP0XLIT', 'ADCV'),
01861     ('LHKP0MHP1XLITST', 'ADCS'),
01862     ('LHKP0MHP1XLIT', 'ADCV'),
01863     ('LHKP0MHP2XLITST', 'ADCS'),
01864     ('LHKP0MHP2XLIT', 'ADCV'),
01865     ('LHKP0MHP3XLITST', 'ADCS'),
01866     ('LHKP0MHP3XLIT', 'ADCV'),
01867     ('LHKP0MHP4XLITST', 'ADCS'),
01868     ('LHKP0MHP4XLIT', 'ADCV'),
01869     ('LHKP0MHP5XLITST', 'ADCS'),
01870     ('LHKP0MHP5XLIT', 'ADCV'),
01871     ('LHKP0PHP0RVHTST', 'ADCS'),
01872     ('LHKP0PHP0RVHT', 'ADCV'),
01873     ('LHKP0PHP1RVHTST', 'ADCS'),
01874     ('LHKP0PHP1RVHT', 'ADCV'),
01875     ('LHKP0PHP2RVHTST', 'ADCS'),
01876     ('LHKP0PHP2RVHT', 'ADCV'),
01877     ('LHKP0PHP3RVHTST', 'ADCS'),
01878     ('LHKP0PHP3RVHT', 'ADCV'),
01879     ('LHKP0PHP4RVHTST', 'ADCS'),
01880     ('LHKP0PHP4RVHT', 'ADCV'),
01881     ('LHKP0PHP5RVHTST', 'ADCS'),
01882     ('LHKP0PHP5RVHT', 'ADCV'),
01883     ('LHKP0MHP0RVHTST', 'ADCS'),
01884     ('LHKP0MHP0RVHT', 'ADCV'),
01885     ('LHKP0MHP1RVHTST', 'ADCS'),
01886     ('LHKP0MHP1RVHT', 'ADCV'),
01887     ('LHKP0MHP2RVHTST', 'ADCS'),
01888     ('LHKP0MHP2RVHT', 'ADCV'),
01889     ('LHKP0MHP3RVHTST', 'ADCS'),
01890     ('LHKP0MHP3RVHT', 'ADCV'),
01891     ('LHKP0MHP4RVHTST', 'ADCS'),
01892     ('LHKP0MHP4RVHT', 'ADCV'),
01893     ('LHKP0MHP5RVHTST', 'ADCS'),
01894     ('LHKP0MHP5RVHT', 'ADCV'),
01895     ('LHKSPARE08', 'TSP8'),
01896     ('LHKSPARE08', 'TSP8'),
01897     ('LHKSPARE08', 'TSP8'),
01898     ('LHKSPARE08', 'TSP8'),
01899     ('LHKSPARE08', 'TSP8'),
01900     ('LHKSPARE08', 'TSP8'),
01901     ('LHKSPARE08', 'TSP8'),
01902     ('LHKSPARE08', 'TSP8'),
01903     ('LHKSPARE08', 'TSP8'),
01904     ('LHKSPARE08', 'TSP8'),
01905     ('LHKSPARE08', 'TSP8'),
01906     ('LHKSPARE08', 'TSP8'),
01907     ('LHKSPARE08', 'TSP8'),
01908     ('LHKSPARE08', 'TSP8'),
01909     ('LHKSPARE08', 'TSP8'),
01910     ('LHKSPARE08', 'TSP8'),
01911     ('LHKSPARE08', 'TSP8'),
01912     ('LHKSPARE08', 'TSP8'),
01913     ('LHKSPARE08', 'TSP8'),
01914     ('LHKSPARE08', 'TSP8'),
01915     ('LHKSPARE08', 'TSP8'),
01916     ('LHKSPARE08', 'TSP8'),
01917     ('LHKSPARE08', 'TSP8'),
01918     ('LHKSPARE08', 'TSP8'),
01919     ]
01920   def __init__(self, ui):
01921     HskPacket.__init__(self, ui)
01922     self.name  = "PduEnv2"
01923     self.brief = "PDU Environmental Packet 2"
01924     self.descr = "PDU Packet 2"
01925     self.read()
01926
01927
01928 class HskPacket221(HskPacket):
01929   mnemList = [
01930     ('LHKSPARE08', 'TSP8'),
01931     ('LHKSPARE08', 'TSP8'),
01932     ('LHKSPARE08', 'TSP8'),
01933     ('LHKSPARE08', 'TSP8'),
01934     ('LHKSPARE08', 'TSP8'),
01935     ('LHKSPARE08', 'TSP8'),
01936     ('LHKP0GRID0TST', 'ADCS'),
01937     ('LHKP0GRID0T', 'ADCV'),
01938     ('LHKP0GRID1TST', 'ADCS'),
01939     ('LHKP0GRID1T', 'ADCV'),
01940     ('LHKP0GRID2TST', 'ADCS'),
01941     ('LHKP0GRID2T', 'ADCV'),
01942     ('LHKP0GRID3TST', 'ADCS'),
01943     ('LHKP0GRID3T', 'ADCV'),
01944     ('LHKP0GRID4TST', 'ADCS'),
01945     ('LHKP0GRID4T', 'ADCV'),
01946     ('LHKP0GRID5TST', 'ADCS'),
01947     ('LHKP0GRID5T', 'ADCV'),
01948     ('LHKP0GRID6TST', 'ADCS'),
01949     ('LHKP0GRID6T', 'ADCV'),
01950     ('LHKP0GRID7TST', 'ADCS'),
01951     ('LHKP0GRID7T', 'ADCV'),
01952     ('LHKP0GRID8TST', 'ADCS'),
01953     ('LHKP0GRID8T', 'ADCV'),
01954     ('LHKP0GRID9TST', 'ADCS'),
01955     ('LHKP0GRID9T', 'ADCV'),
01956     ('LHKP0GRID10TST', 'ADCS'),
01957     ('LHKP0GRID10T', 'ADCV'),
01958     ('LHKP0GRID11TST', 'ADCS'),
01959     ('LHKP0GRID11T', 'ADCV'),
01960     ('LHKP0ACDSHT0', 'ADCV'),
01961     ('LHKP0ACDSHT0ST', 'ADCS'),
01962     ('LHKP0ACDSHT1', 'ADCV'),
01963     ('LHKP0ACDSHT1ST', 'ADCS'),
01964     ('LHKP0ACDPRT0ST', 'ADCS'),
01965     ('LHKP0ACDPRT0', 'ADCV'),
01966     ('LHKP0ACDPRT1ST', 'ADCS'),
01967     ('LHKP0ACDPRT1', 'ADCV'),
01968     ('LHKP0ACDPRT2ST', 'ADCS'),
01969     ('LHKP0ACDPRT2', 'ADCV'),
01970     ('LHKP0ACDPRT3ST', 'ADCS'),
01971     ('LHKP0ACDPRT3', 'ADCV'),
01972     ('LHKP0ACDBGT0ST', 'ADCS'),
01973     ('LHKP0ACDBGT0', 'ADCV'),
01974     ('LHKP0ACDBGT1ST', 'ADCS'),
01975     ('LHKP0ACDBGT1', 'ADCV'),
01976     ('LHKP0RADAFHT0ST', 'ADCS'),
01977     ('LHKP0RADAFHT0', 'ADCV'),
01978     ('LHKP0RADAFHT1ST', 'ADCS'),
01979     ('LHKP0RADAFHT1', 'ADCV'),
01980     ('LHKP0GRAD0IFTST', 'ADCS'),
01981     ('LHKP0GRAD0IFT', 'ADCV'),
01982     ('LHKP0GRAD1IFTST', 'ADCS'),
01983     ('LHKP0GRAD1IFT', 'ADCV'),
01984     ('LHKP0GRAD2IFTST', 'ADCS'),
01985     ('LHKP0GRAD2IFT', 'ADCV'),
01986     ('LHKP0GRAD3IFTST', 'ADCS'),
01987     ('LHKP0GRAD3IFT', 'ADCV'),
01988     ('LHKP0RAD0TST', 'ADCS'),
01989     ('LHKP0RAD0T', 'ADCV'),
01990     ('LHKP0RAD1TST', 'ADCS'),
01991     ('LHKP0RAD1T', 'ADCV'),
01992     ('LHKP0RAD2TST', 'ADCS'),
01993     ('LHKP0RAD2T', 'ADCV'),
01994     ('LHKP0RAD3TST', 'ADCS'),
01995     ('LHKP0RAD3T', 'ADCV'),
01996     ('LHKP0RAD4TST', 'ADCS'),
01997     ('LHKP0RAD4T', 'ADCV'),
01998     ('LHKP0RAD5TST', 'ADCS'),
01999     ('LHKP0RAD5T', 'ADCV'),
02000     ('LHKP0RAD6TST', 'ADCS'),
02001     ('LHKP0RAD6T', 'ADCV'),
02002     ('LHKP0RAD7TST', 'ADCS'),
02003     ('LHKP0RAD7T', 'ADCV'),
02004     ('LHKP0RAD8TST', 'ADCS'),
02005     ('LHKP0RAD8T', 'ADCV'),
02006     ('LHKP0RAD9TST', 'ADCS'),
02007     ('LHKP0RAD9T', 'ADCV'),
02008     ('LHKP0RAD10TST', 'ADCS'),
02009     ('LHKP0RAD10T', 'ADCV'),
02010     ('LHKP0RAD11TST', 'ADCS'),
02011     ('LHKP0RAD11T', 'ADCV'),
02012     ('LHKSPARE08', 'TSP8'),
02013     ('LHKSPARE08', 'TSP8'),
02014     ('LHKSPARE08', 'TSP8'),
02015     ('LHKSPARE08', 'TSP8'),
02016     ('LHKSPARE08', 'TSP8'),
02017     ('LHKSPARE08', 'TSP8'),
02018     ('LHKSPARE08', 'TSP8'),
02019     ('LHKSPARE08', 'TSP8'),
02020     ('LHKSPARE08', 'TSP8'),
02021     ('LHKSPARE08', 'TSP8'),
02022     ('LHKSPARE08', 'TSP8'),
02023     ('LHKSPARE08', 'TSP8'),
02024     ('LHKSPARE08', 'TSP8'),
02025     ('LHKSPARE08', 'TSP8'),
02026     ('LHKSPARE08', 'TSP8'),
02027     ('LHKSPARE08', 'TSP8'),
02028     ('LHKSPARE08', 'TSP8'),
02029     ('LHKSPARE08', 'TSP8'),
02030     ('LHKSPARE08', 'TSP8'),
02031     ('LHKSPARE08', 'TSP8'),
02032     ]
02033   def __init__(self, ui):
02034     HskPacket.__init__(self, ui)
02035     self.name  = "PduEnv3"
02036     self.brief = "PDU Environmental Packet 3"
02037     self.descr = "PDU Packet 3"
02038     self.read()
02039
02040
02041 class HskPacket222(HskPacket):
02042   mnemList = [
02043     ('LHKSPARE08', 'TSP8'),
02044     ('LHKSPARE08', 'TSP8'),
02045     ('LHKSPARE08', 'TSP8'),
02046     ('LHKSPARE08', 'TSP8'),
02047     ('LHKSPARE08', 'TSP8'),
02048     ('LHKSPARE08', 'TSP8'),
02049     ('LHKP1TEMFPM', 'PDUTEMPWRST'),
02050     ('LHKP1TEMEPM', 'PDUTEMPWRST'),
02051     ('LHKP1TEMDPM', 'PDUTEMPWRST'),
02052     ('LHKP1TEMCPM', 'PDUTEMPWRST'),
02053     ('LHKP1TEMBPM', 'PDUTEMPWRST'),
02054     ('LHKP1TEMAPM', 'PDUTEMPWRST'),
02055     ('LHKP1TEM9PM', 'PDUTEMPWRST'),
02056     ('LHKP1TEM8PM', 'PDUTEMPWRST'),
02057     ('LHKP1TEM7PM', 'PDUTEMPWRST'),
02058     ('LHKP1TEM6PM', 'PDUTEMPWRST'),
02059     ('LHKP1TEM5PM', 'PDUTEMPWRST'),
02060     ('LHKP1TEM4PM', 'PDUTEMPWRST'),
02061     ('LHKP1TEM3PM', 'PDUTEMPWRST'),
02062     ('LHKP1TEM2PM', 'PDUTEMPWRST'),
02063     ('LHKP1TEM1PM', 'PDUTEMPWRST'),
02064     ('LHKP1TEM0PM', 'PDUTEMPWRST'),
02065     ('LHKSPARE10', 'TSP10'),
02066     ('LHKP1EPU2CNVT', 'PDUEPUCVTST'),
02067     ('LHKP1EPU1CNVT', 'PDUEPUCVTST'),
02068     ('LHKP1EPU0CNVT', 'PDUEPUCVTST'),
02069     ('LHKP1EPU2PM', 'PDUEPUPWRST'),
02070     ('LHKP1EPU1PM', 'PDUEPUPWRST'),
02071     ('LHKP1EPU0PM', 'PDUEPUPWRST'),
02072     ('LHKSPARE13', 'TSP13'),
02073     ('LHKP1ACDCNVT', 'PDUACDCNVT'),
02074     ('LHKP1ACDPSP', 'PDUACDPWRSUP'),
02075     ('LHKP1ACDPM', 'PDUACDPWRST'),
02076     ('LHKP1TEM033VST', 'ADCS'),
02077     ('LHKP1TEM033V', 'ADCV'),
02078     ('LHKP1TEM133VST', 'ADCS'),
02079     ('LHKP1TEM133V', 'ADCV'),
02080     ('LHKP1TEM233VST', 'ADCS'),
02081     ('LHKP1TEM233V', 'ADCV'),
02082     ('LHKP1TEM333VST', 'ADCS'),
02083     ('LHKP1TEM333V', 'ADCV'),
02084     ('LHKP1TEM433VST', 'ADCS'),
02085     ('LHKP1TEM433V', 'ADCV'),
02086     ('LHKP1TEM533VST', 'ADCS'),
02087     ('LHKP1TEM533V', 'ADCV'),
02088     ('LHKP1TEM633VST', 'ADCS'),
02089     ('LHKP1TEM633V', 'ADCV'),
02090     ('LHKP1TEM733VST', 'ADCS'),
02091     ('LHKP1TEM733V', 'ADCV'),
02092     ('LHKP1TEM833VST', 'ADCS'),
02093     ('LHKP1TEM833V', 'ADCV'),
02094     ('LHKP1TEM933VST', 'ADCS'),
02095     ('LHKP1TEM933V', 'ADCV'),
02096     ('LHKP1TEMA33VST', 'ADCS'),
02097     ('LHKP1TEMA33V', 'ADCV'),
02098     ('LHKP1TEMB33VST', 'ADCS'),
02099     ('LHKP1TEMB33V', 'ADCV'),
02100     ('LHKP1TEMC33VST', 'ADCS'),
02101     ('LHKP1TEMC33V', 'ADCV'),
02102     ('LHKP1TEMD33VST', 'ADCS'),
02103     ('LHKP1TEMD33V', 'ADCV'),
02104     ('LHKP1TEME33VST', 'ADCS'),
02105     ('LHKP1TEME33V', 'ADCV'),
02106     ('LHKP1TEMF33VST', 'ADCS'),
02107     ('LHKP1TEMF33V', 'ADCV'),
02108     ('LHKP1TEM0PCTST', 'ADCS'),
02109     ('LHKP1TEM0PCT', 'ADCV'),
02110     ('LHKP1TEM1PCTST', 'ADCS'),
02111     ('LHKP1TEM1PCT', 'ADCV'),
02112     ('LHKP1TEM2PCTST', 'ADCS'),
02113     ('LHKP1TEM2PCT', 'ADCV'),
02114     ('LHKP1TEM3PCTST', 'ADCS'),
02115     ('LHKP1TEM3PCT', 'ADCV'),
02116     ('LHKP1TEM4PCTST', 'ADCS'),
02117     ('LHKP1TEM4PCT', 'ADCV'),
02118     ('LHKP1TEM5PCTST', 'ADCS'),
02119     ('LHKP1TEM5PCT', 'ADCV'),
02120     ('LHKP1TEM6PCTST', 'ADCS'),
02121     ('LHKP1TEM6PCT', 'ADCV'),
02122     ('LHKP1TEM7PCTST', 'ADCS'),
02123     ('LHKP1TEM7PCT', 'ADCV'),
02124     ('LHKP1TEM8PCTST', 'ADCS'),
02125     ('LHKP1TEM8PCT', 'ADCV'),
02126     ('LHKP1TEM9PCTST', 'ADCS'),
02127     ('LHKP1TEM9PCT', 'ADCV'),
02128     ('LHKP1TEMAPCTST', 'ADCS'),
02129     ('LHKP1TEMAPCT', 'ADCV'),
02130     ('LHKP1TEMBPCTST', 'ADCS'),
02131     ('LHKP1TEMBPCT', 'ADCV'),
02132     ('LHKP1TEMCPCTST', 'ADCS'),
02133     ('LHKP1TEMCPCT', 'ADCV'),
02134     ('LHKP1TEMDPCTST', 'ADCS'),
02135     ('LHKP1TEMDPCT', 'ADCV'),
02136     ('LHKP1TEMEPCTST', 'ADCS'),
02137     ('LHKP1TEMEPCT', 'ADCV'),
02138     ('LHKP1TEMFPCTST', 'ADCS'),
02139     ('LHKP1TEMFPCT', 'ADCV'),
02140     ('LHKP1EPU033VST', 'ADCS'),
02141     ('LHKP1EPU033V', 'ADCV'),
02142     ('LHKP1EPU133VST', 'ADCS'),
02143     ('LHKP1EPU133V', 'ADCV'),
02144     ('LHKP1EPU233VST', 'ADCS'),
02145     ('LHKP1EPU233V', 'ADCV'),
02146     ('LHKP1EPU0TST', 'ADCS'),
02147     ('LHKP1EPU0T', 'ADCV'),
02148     ('LHKP1EPU1TST', 'ADCS'),
02149     ('LHKP1EPU1T', 'ADCV'),
02150     ('LHKP1EPU2TST', 'ADCS'),
02151     ('LHKP1EPU2T', 'ADCV'),
02152     ('LHKSPARE08', 'TSP8'),
02153     ('LHKSPARE08', 'TSP8'),
02154     ('LHKSPARE08', 'TSP8'),
02155     ('LHKSPARE08', 'TSP8'),
02156     ('LHKSPARE08', 'TSP8'),
02157     ('LHKSPARE08', 'TSP8'),
02158     ('LHKSPARE08', 'TSP8'),
02159     ('LHKSPARE08', 'TSP8'),
02160     ('LHKSPARE08', 'TSP8'),
02161     ('LHKSPARE08', 'TSP8'),
02162     ('LHKSPARE08', 'TSP8'),
02163     ('LHKSPARE08', 'TSP8'),
02164     ('LHKSPARE08', 'TSP8'),
02165     ('LHKSPARE08', 'TSP8'),
02166     ]
02167   def __init__(self, ui):
02168     HskPacket.__init__(self, ui)
02169     self.name  = "PduEnv4"
02170     self.brief = "PDU Environmental Packet 4"
02171     self.descr = "PDU Packet 4"
02172     self.read()
02173
02174
02175 class HskPacket223(HskPacket):
02176   mnemList = [
02177     ('LHKSPARE08', 'TSP8'),
02178     ('LHKSPARE08', 'TSP8'),
02179     ('LHKSPARE08', 'TSP8'),
02180     ('LHKSPARE08', 'TSP8'),
02181     ('LHKSPARE08', 'TSP8'),
02182     ('LHKSPARE08', 'TSP8'),
02183     ('LHKP1TEM0PSTST', 'ADCS'),
02184     ('LHKP1TEM0PST', 'ADCV'),
02185     ('LHKP1TEM1PSTST', 'ADCS'),
02186     ('LHKP1TEM1PST', 'ADCV'),
02187     ('LHKP1TEM2PSTST', 'ADCS'),
02188     ('LHKP1TEM2PST', 'ADCV'),
02189     ('LHKP1TEM3PSTST', 'ADCS'),
02190     ('LHKP1TEM3PST', 'ADCV'),
02191     ('LHKP1TEM4PSTST', 'ADCS'),
02192     ('LHKP1TEM4PST', 'ADCV'),
02193     ('LHKP1TEM5PSTST', 'ADCS'),
02194     ('LHKP1TEM5PST', 'ADCV'),
02195     ('LHKP1TEM6PSTST', 'ADCS'),
02196     ('LHKP1TEM6PST', 'ADCV'),
02197     ('LHKP1TEM7PSTST', 'ADCS'),
02198     ('LHKP1TEM7PST', 'ADCV'),
02199     ('LHKP1TEM8PSTST', 'ADCS'),
02200     ('LHKP1TEM8PST', 'ADCV'),
02201     ('LHKP1TEM9PSTST', 'ADCS'),
02202     ('LHKP1TEM9PST', 'ADCV'),
02203     ('LHKP1TEMAPSTST', 'ADCS'),
02204     ('LHKP1TEMAPST', 'ADCV'),
02205     ('LHKP1TEMBPSTST', 'ADCS'),
02206     ('LHKP1TEMBPST', 'ADCV'),
02207     ('LHKP1TEMCPSTST', 'ADCS'),
02208     ('LHKP1TEMCPST', 'ADCV'),
02209     ('LHKP1TEMDPSTST', 'ADCS'),
02210     ('LHKP1TEMDPST', 'ADCV'),
02211     ('LHKP1TEMEPSTST', 'ADCS'),
02212     ('LHKP1TEMEPST', 'ADCV'),
02213     ('LHKP1TEMFPSTST', 'ADCS'),
02214     ('LHKP1TEMFPST', 'ADCV'),
02215     ('LHKP1CAL0BPTST', 'ADCS'),
02216     ('LHKP1CAL0BPT', 'ADCV'),
02217     ('LHKP1CAL1BPTST', 'ADCS'),
02218     ('LHKP1CAL1BPT', 'ADCV'),
02219     ('LHKP1CAL2BPTST', 'ADCS'),
02220     ('LHKP1CAL2BPT', 'ADCV'),
02221     ('LHKP1CAL3BPTST', 'ADCS'),
02222     ('LHKP1CAL3BPT', 'ADCV'),
02223     ('LHKP1CAL4BPTST', 'ADCS'),
02224     ('LHKP1CAL4BPT', 'ADCV'),
02225     ('LHKP1CAL5BPTST', 'ADCS'),
02226     ('LHKP1CAL5BPT', 'ADCV'),
02227     ('LHKP1CAL6BPTST', 'ADCS'),
02228     ('LHKP1CAL6BPT', 'ADCV'),
02229     ('LHKP1CAL7BPTST', 'ADCS'),
02230     ('LHKP1CAL7BPT', 'ADCV'),
02231     ('LHKP1CAL8BPTST', 'ADCS'),
02232     ('LHKP1CAL8BPT', 'ADCV'),
02233     ('LHKP1CAL9BPTST', 'ADCS'),
02234     ('LHKP1CAL9BPT', 'ADCV'),
02235     ('LHKP1CALABPTST', 'ADCS'),
02236     ('LHKP1CALABPT', 'ADCV'),
02237     ('LHKP1CALBBPTST', 'ADCS'),
02238     ('LHKP1CALBBPT', 'ADCV'),
02239     ('LHKP1CALCBPTST', 'ADCS'),
02240     ('LHKP1CALCBPT', 'ADCV'),
02241     ('LHKP1CALDBPTST', 'ADCS'),
02242     ('LHKP1CALDBPT', 'ADCV'),
02243     ('LHKP1CALEBPTST', 'ADCS'),
02244     ('LHKP1CALEBPT', 'ADCV'),
02245     ('LHKP1CALFBPTST', 'ADCS'),
02246     ('LHKP1CALFBPT', 'ADCV'),
02247     ('LHKSPARE08', 'TSP8'),
02248     ('LHKSPARE08', 'TSP8'),
02249     ('LHKSPARE08', 'TSP8'),
02250     ('LHKSPARE08', 'TSP8'),
02251     ('LHKSPARE08', 'TSP8'),
02252     ('LHKSPARE08', 'TSP8'),
02253     ('LHKSPARE08', 'TSP8'),
02254     ('LHKSPARE08', 'TSP8'),
02255     ('LHKSPARE08', 'TSP8'),
02256     ('LHKSPARE08', 'TSP8'),
02257     ('LHKSPARE08', 'TSP8'),
02258     ('LHKSPARE08', 'TSP8'),
02259     ('LHKSPARE08', 'TSP8'),
02260     ('LHKSPARE08', 'TSP8'),
02261     ('LHKSPARE08', 'TSP8'),
02262     ('LHKSPARE08', 'TSP8'),
02263     ('LHKSPARE08', 'TSP8'),
02264     ('LHKSPARE08', 'TSP8'),
02265     ('LHKSPARE08', 'TSP8'),
02266     ('LHKSPARE08', 'TSP8'),
02267     ('LHKSPARE08', 'TSP8'),
02268     ('LHKSPARE08', 'TSP8'),
02269     ('LHKSPARE08', 'TSP8'),
02270     ('LHKSPARE08', 'TSP8'),
02271     ('LHKSPARE08', 'TSP8'),
02272     ('LHKSPARE08', 'TSP8'),
02273     ('LHKSPARE08', 'TSP8'),
02274     ('LHKSPARE08', 'TSP8'),
02275     ('LHKSPARE08', 'TSP8'),
02276     ('LHKSPARE08', 'TSP8'),
02277     ('LHKSPARE08', 'TSP8'),
02278     ('LHKSPARE08', 'TSP8'),
02279     ]
02280   def __init__(self, ui):
02281     HskPacket.__init__(self, ui)
02282     self.name  = "PduEnv5"
02283     self.brief = "PDU Environmental Packet 5"
02284     self.descr = "PDU Packet 5"
02285     self.read()
02286
02287
02288 class HskPacket224(HskPacket):
02289   mnemList = [
02290     ('LHKSPARE08', 'TSP8'),
02291     ('LHKSPARE08', 'TSP8'),
02292     ('LHKSPARE08', 'TSP8'),
02293     ('LHKSPARE08', 'TSP8'),
02294     ('LHKSPARE08', 'TSP8'),
02295     ('LHKSPARE08', 'TSP8'),
02296     ('LHKP1PHP0DSITST', 'ADCS'),
02297     ('LHKP1PHP0DSIT', 'ADCV'),
02298     ('LHKP1PHP1DSITST', 'ADCS'),
02299     ('LHKP1PHP1DSIT', 'ADCV'),
02300     ('LHKP1PHP2DSITST', 'ADCS'),
02301     ('LHKP1PHP2DSIT', 'ADCV'),
02302     ('LHKP1PHP3DSITST', 'ADCS'),
02303     ('LHKP1PHP3DSIT', 'ADCV'),
02304     ('LHKP1PHP4DSITST', 'ADCS'),
02305     ('LHKP1PHP4DSIT', 'ADCV'),
02306     ('LHKP1PHP5DSITST', 'ADCS'),
02307     ('LHKP1PHP5DSIT', 'ADCV'),
02308     ('LHKP1MHP0DSITST', 'ADCS'),
02309     ('LHKP1MHP0DSIT', 'ADCV'),
02310     ('LHKP1MHP1DSITST', 'ADCS'),
02311     ('LHKP1MHP1DSIT', 'ADCV'),
02312     ('LHKP1MHP2DSITST', 'ADCS'),
02313     ('LHKP1MHP2DSIT', 'ADCV'),
02314     ('LHKP1MHP3DSITST', 'ADCS'),
02315     ('LHKP1MHP3DSIT', 'ADCV'),
02316     ('LHKP1MHP4DSITST', 'ADCS'),
02317     ('LHKP1MHP4DSIT', 'ADCV'),
02318     ('LHKP1MHP5DSITST', 'ADCS'),
02319     ('LHKP1MHP5DSIT', 'ADCV'),
02320     ('LHKP1PHP0XLITST', 'ADCS'),
02321     ('LHKP1PHP0XLIT', 'ADCV'),
02322     ('LHKP1PHP1XLITST', 'ADCS'),
02323     ('LHKP1PHP1XLIT', 'ADCV'),
02324     ('LHKP1PHP2XLITST', 'ADCS'),
02325     ('LHKP1PHP2XLIT', 'ADCV'),
02326     ('LHKP1PHP3XLITST', 'ADCS'),
02327     ('LHKP1PHP3XLIT', 'ADCV'),
02328     ('LHKP1PHP4XLITST', 'ADCS'),
02329     ('LHKP1PHP4XLIT', 'ADCV'),
02330     ('LHKP1PHP5XLITST', 'ADCS'),
02331     ('LHKP1PHP5XLIT', 'ADCV'),
02332     ('LHKP1MHP0XLITST', 'ADCS'),
02333     ('LHKP1MHP0XLIT', 'ADCV'),
02334     ('LHKP1MHP1XLITST', 'ADCS'),
02335     ('LHKP1MHP1XLIT', 'ADCV'),
02336     ('LHKP1MHP2XLITST', 'ADCS'),
02337     ('LHKP1MHP2XLIT', 'ADCV'),
02338     ('LHKP1MHP3XLITST', 'ADCS'),
02339     ('LHKP1MHP3XLIT', 'ADCV'),
02340     ('LHKP1MHP4XLITST', 'ADCS'),
02341     ('LHKP1MHP4XLIT', 'ADCV'),
02342     ('LHKP1MHP5XLITST', 'ADCS'),
02343     ('LHKP1MHP5XLIT', 'ADCV'),
02344     ('LHKP1PHP0RVHTST', 'ADCS'),
02345     ('LHKP1PHP0RVHT', 'ADCV'),
02346     ('LHKP1PHP1RVHTST', 'ADCS'),
02347     ('LHKP1PHP1RVHT', 'ADCV'),
02348     ('LHKP1PHP2RVHTST', 'ADCS'),
02349     ('LHKP1PHP2RVHT', 'ADCV'),
02350     ('LHKP1PHP3RVHTST', 'ADCS'),
02351     ('LHKP1PHP3RVHT', 'ADCV'),
02352     ('LHKP1PHP4RVHTST', 'ADCS'),
02353     ('LHKP1PHP4RVHT', 'ADCV'),
02354     ('LHKP1PHP5RVHTST', 'ADCS'),
02355     ('LHKP1PHP5RVHT', 'ADCV'),
02356     ('LHKP1MHP0RVHTST', 'ADCS'),
02357     ('LHKP1MHP0RVHT', 'ADCV'),
02358     ('LHKP1MHP1RVHTST', 'ADCS'),
02359     ('LHKP1MHP1RVHT', 'ADCV'),
02360     ('LHKP1MHP2RVHTST', 'ADCS'),
02361     ('LHKP1MHP2RVHT', 'ADCV'),
02362     ('LHKP1MHP3RVHTST', 'ADCS'),
02363     ('LHKP1MHP3RVHT', 'ADCV'),
02364     ('LHKP1MHP4RVHTST', 'ADCS'),
02365     ('LHKP1MHP4RVHT', 'ADCV'),
02366     ('LHKP1MHP5RVHTST', 'ADCS'),
02367     ('LHKP1MHP5RVHT', 'ADCV'),
02368     ('LHKSPARE08', 'TSP8'),
02369     ('LHKSPARE08', 'TSP8'),
02370     ('LHKSPARE08', 'TSP8'),
02371     ('LHKSPARE08', 'TSP8'),
02372     ('LHKSPARE08', 'TSP8'),
02373     ('LHKSPARE08', 'TSP8'),
02374     ('LHKSPARE08', 'TSP8'),
02375     ('LHKSPARE08', 'TSP8'),
02376     ('LHKSPARE08', 'TSP8'),
02377     ('LHKSPARE08', 'TSP8'),
02378     ('LHKSPARE08', 'TSP8'),
02379     ('LHKSPARE08', 'TSP8'),
02380     ('LHKSPARE08', 'TSP8'),
02381     ('LHKSPARE08', 'TSP8'),
02382     ('LHKSPARE08', 'TSP8'),
02383     ('LHKSPARE08', 'TSP8'),
02384     ('LHKSPARE08', 'TSP8'),
02385     ('LHKSPARE08', 'TSP8'),
02386     ('LHKSPARE08', 'TSP8'),
02387     ('LHKSPARE08', 'TSP8'),
02388     ('LHKSPARE08', 'TSP8'),
02389     ('LHKSPARE08', 'TSP8'),
02390     ('LHKSPARE08', 'TSP8'),
02391     ('LHKSPARE08', 'TSP8'),
02392     ]
02393   def __init__(self, ui):
02394     HskPacket.__init__(self, ui)
02395     self.name  = "PduEnv6"
02396     self.brief = "PDU Environmental Packet 6"
02397     self.descr = "PDU Packet 6"
02398     self.read()
02399
02400
02401 class HskPacket225(HskPacket):
02402   mnemList = [
02403     ('LHKSPARE08', 'TSP8'),
02404     ('LHKSPARE08', 'TSP8'),
02405     ('LHKSPARE08', 'TSP8'),
02406     ('LHKSPARE08', 'TSP8'),
02407     ('LHKSPARE08', 'TSP8'),
02408     ('LHKSPARE08', 'TSP8'),
02409     ('LHKP1GRID0TST', 'ADCS'),
02410     ('LHKP1GRID0T', 'ADCV'),
02411     ('LHKP1GRID1TST', 'ADCS'),
02412     ('LHKP1GRID1T', 'ADCV'),
02413     ('LHKP1GRID2TST', 'ADCS'),
02414     ('LHKP1GRID2T', 'ADCV'),
02415     ('LHKP1GRID3TST', 'ADCS'),
02416     ('LHKP1GRID3T', 'ADCV'),
02417     ('LHKP1GRID4TST', 'ADCS'),
02418     ('LHKP1GRID4T', 'ADCV'),
02419     ('LHKP1GRID5TST', 'ADCS'),
02420     ('LHKP1GRID5T', 'ADCV'),
02421     ('LHKP1GRID6TST', 'ADCS'),
02422     ('LHKP1GRID6T', 'ADCV'),
02423     ('LHKP1GRID7TST', 'ADCS'),
02424     ('LHKP1GRID7T', 'ADCV'),
02425     ('LHKP1GRID8TST', 'ADCS'),
02426     ('LHKP1GRID8T', 'ADCV'),
02427     ('LHKP1GRID9TST', 'ADCS'),
02428     ('LHKP1GRID9T', 'ADCV'),
02429     ('LHKP1GRID10TST', 'ADCS'),
02430     ('LHKP1GRID10T', 'ADCV'),
02431     ('LHKP1GRID11TST', 'ADCS'),
02432     ('LHKP1GRID11T', 'ADCV'),
02433     ('LHKP1ACDSHT0', 'ADCV'),
02434     ('LHKP1ACDSHT0ST', 'ADCS'),
02435     ('LHKP1ACDSHT1', 'ADCV'),
02436     ('LHKP1ACDSHT1ST', 'ADCS'),
02437     ('LHKP1ACDPRT0ST', 'ADCS'),
02438     ('LHKP1ACDPRT0', 'ADCV'),
02439     ('LHKP1ACDPRT1ST', 'ADCS'),
02440     ('LHKP1ACDPRT1', 'ADCV'),
02441     ('LHKP1ACDPRT2ST', 'ADCS'),
02442     ('LHKP1ACDPRT2', 'ADCV'),
02443     ('LHKP1ACDPRT3ST', 'ADCS'),
02444     ('LHKP1ACDPRT3', 'ADCV'),
02445     ('LHKP1ACDBGT0ST', 'ADCS'),
02446     ('LHKP1ACDBGT0', 'ADCV'),
02447     ('LHKP1ACDBGT1ST', 'ADCS'),
02448     ('LHKP1ACDBGT1', 'ADCV'),
02449     ('LHKP1RADAFHT0ST', 'ADCS'),
02450     ('LHKP1RADAFHT0', 'ADCV'),
02451     ('LHKP1RADAFHT1ST', 'ADCS'),
02452     ('LHKP1RADAFHT1', 'ADCV'),
02453     ('LHKP1GRAD0IFTST', 'ADCS'),
02454     ('LHKP1GRAD0IFT', 'ADCV'),
02455     ('LHKP1GRAD1IFTST', 'ADCS'),
02456     ('LHKP1GRAD1IFT', 'ADCV'),
02457     ('LHKP1GRAD2IFTST', 'ADCS'),
02458     ('LHKP1GRAD2IFT', 'ADCV'),
02459     ('LHKP1GRAD3IFTST', 'ADCS'),
02460     ('LHKP1GRAD3IFT', 'ADCV'),
02461     ('LHKP1RAD0TST', 'ADCS'),
02462     ('LHKP1RAD0T', 'ADCV'),
02463     ('LHKP1RAD1TST', 'ADCS'),
02464     ('LHKP1RAD1T', 'ADCV'),
02465     ('LHKP1RAD2TST', 'ADCS'),
02466     ('LHKP1RAD2T', 'ADCV'),
02467     ('LHKP1RAD3TST', 'ADCS'),
02468     ('LHKP1RAD3T', 'ADCV'),
02469     ('LHKP1RAD4TST', 'ADCS'),
02470     ('LHKP1RAD4T', 'ADCV'),
02471     ('LHKP1RAD5TST', 'ADCS'),
02472     ('LHKP1RAD5T', 'ADCV'),
02473     ('LHKP1RAD6TST', 'ADCS'),
02474     ('LHKP1RAD6T', 'ADCV'),
02475     ('LHKP1RAD7TST', 'ADCS'),
02476     ('LHKP1RAD7T', 'ADCV'),
02477     ('LHKP1RAD8TST', 'ADCS'),
02478     ('LHKP1RAD8T', 'ADCV'),
02479     ('LHKP1RAD9TST', 'ADCS'),
02480     ('LHKP1RAD9T', 'ADCV'),
02481     ('LHKP1RAD10TST', 'ADCS'),
02482     ('LHKP1RAD10T', 'ADCV'),
02483     ('LHKP1RAD11TST', 'ADCS'),
02484     ('LHKP1RAD11T', 'ADCV'),
02485     ('LHKSPARE08', 'TSP8'),
02486     ('LHKSPARE08', 'TSP8'),
02487     ('LHKSPARE08', 'TSP8'),
02488     ('LHKSPARE08', 'TSP8'),
02489     ('LHKSPARE08', 'TSP8'),
02490     ('LHKSPARE08', 'TSP8'),
02491     ('LHKSPARE08', 'TSP8'),
02492     ('LHKSPARE08', 'TSP8'),
02493     ('LHKSPARE08', 'TSP8'),
02494     ('LHKSPARE08', 'TSP8'),
02495     ('LHKSPARE08', 'TSP8'),
02496     ('LHKSPARE08', 'TSP8'),
02497     ('LHKSPARE08', 'TSP8'),
02498     ('LHKSPARE08', 'TSP8'),
02499     ('LHKSPARE08', 'TSP8'),
02500     ('LHKSPARE08', 'TSP8'),
02501     ('LHKSPARE08', 'TSP8'),
02502     ('LHKSPARE08', 'TSP8'),
02503     ('LHKSPARE08', 'TSP8'),
02504     ('LHKSPARE08', 'TSP8'),
02505     ]
02506   def __init__(self, ui):
02507     HskPacket.__init__(self, ui)
02508     self.name  = "PduEnv7"
02509     self.brief = "PDU Environmental Packet 7"
02510     self.descr = "PDU Packet 7"
02511     self.read()
02512
02513
02514 class HskPacket226(HskPacket):
02515   mnemList = [
02516     ('LHKSPARE08', 'TSP8'),
02517     ('LHKSPARE08', 'TSP8'),
02518     ('LHKSPARE08', 'TSP8'),
02519     ('LHKSPARE08', 'TSP8'),
02520     ('LHKSPARE04', 'TSP4'),
02521     ('LHKAEMFR11PWRST', 'AEMFRPWRST'),
02522     ('LHKAEMFR10PWRST', 'AEMFRPWRST'),
02523     ('LHKAEMFR9PWRST', 'AEMFRPWRST'),
02524     ('LHKAEMFR8PWRST', 'AEMFRPWRST'),
02525     ('LHKAEMFR7PWRST', 'AEMFRPWRST'),
02526     ('LHKAEMFR6PWRST', 'AEMFRPWRST'),
02527     ('LHKAEMFR5PWRST', 'AEMFRPWRST'),
02528     ('LHKAEMFR4PWRST', 'AEMFRPWRST'),
02529     ('LHKAEMFR3PWRST', 'AEMFRPWRST'),
02530     ('LHKAEMFR2PWRST', 'AEMFRPWRST'),
02531     ('LHKAEMFR1PWRST', 'AEMFRPWRST'),
02532     ('LHKAEMFR0PWRST', 'AEMFRPWRST'),
02533     ('LHKAEMFR0VDST', 'ADCS'),
02534     ('LHKAEMFR0VD', 'ADCV'),
02535     ('LHKAEMFR0TST', 'ADCS'),
02536     ('LHKAEMFR0T', 'ADCV'),
02537     ('LHKAEMFR0V1ST', 'ADCS'),
02538     ('LHKAEMFR0V1', 'ADCV'),
02539     ('LHKAEMFR0V2ST', 'ADCS'),
02540     ('LHKAEMFR0V2', 'ADCV'),
02541     ('LHKAEMFR1VDST', 'ADCS'),
02542     ('LHKAEMFR1VD', 'ADCV'),
02543     ('LHKAEMFR1TST', 'ADCS'),
02544     ('LHKAEMFR1T', 'ADCV'),
02545     ('LHKAEMFR1V1ST', 'ADCS'),
02546     ('LHKAEMFR1V1', 'ADCV'),
02547     ('LHKAEMFR1V2ST', 'ADCS'),
02548     ('LHKAEMFR1V2', 'ADCV'),
02549     ('LHKAEMFR2VDST', 'ADCS'),
02550     ('LHKAEMFR2VD', 'ADCV'),
02551     ('LHKAEMFR2TST', 'ADCS'),
02552     ('LHKAEMFR2T', 'ADCV'),
02553     ('LHKAEMFR2V1ST', 'ADCS'),
02554     ('LHKAEMFR2V1', 'ADCV'),
02555     ('LHKAEMFR2V2ST', 'ADCS'),
02556     ('LHKAEMFR2V2', 'ADCV'),
02557     ('LHKAEMFR3VDST', 'ADCS'),
02558     ('LHKAEMFR3VD', 'ADCV'),
02559     ('LHKAEMFR3TST', 'ADCS'),
02560     ('LHKAEMFR3T', 'ADCV'),
02561     ('LHKAEMFR3V1ST', 'ADCS'),
02562     ('LHKAEMFR3V1', 'ADCV'),
02563     ('LHKAEMFR3V2ST', 'ADCS'),
02564     ('LHKAEMFR3V2', 'ADCV'),
02565     ('LHKAEMFR4VDST', 'ADCS'),
02566     ('LHKAEMFR4VD', 'ADCV'),
02567     ('LHKAEMFR4TST', 'ADCS'),
02568     ('LHKAEMFR4T', 'ADCV'),
02569     ('LHKAEMFR4V1ST', 'ADCS'),
02570     ('LHKAEMFR4V1', 'ADCV'),
02571     ('LHKAEMFR4V2ST', 'ADCS'),
02572     ('LHKAEMFR4V2', 'ADCV'),
02573     ('LHKAEMFR5VDST', 'ADCS'),
02574     ('LHKAEMFR5VD', 'ADCV'),
02575     ('LHKAEMFR5TST', 'ADCS'),
02576     ('LHKAEMFR5T', 'ADCV'),
02577     ('LHKAEMFR5V1ST', 'ADCS'),
02578     ('LHKAEMFR5V1', 'ADCV'),
02579     ('LHKAEMFR5V2ST', 'ADCS'),
02580     ('LHKAEMFR5V2', 'ADCV'),
02581     ('LHKAEMFR6VDST', 'ADCS'),
02582     ('LHKAEMFR6VD', 'ADCV'),
02583     ('LHKAEMFR6TST', 'ADCS'),
02584     ('LHKAEMFR6T', 'ADCV'),
02585     ('LHKAEMFR6V1ST', 'ADCS'),
02586     ('LHKAEMFR6V1', 'ADCV'),
02587     ('LHKAEMFR6V2ST', 'ADCS'),
02588     ('LHKAEMFR6V2', 'ADCV'),
02589     ('LHKAEMFR7VDST', 'ADCS'),
02590     ('LHKAEMFR7VD', 'ADCV'),
02591     ('LHKAEMFR7TST', 'ADCS'),
02592     ('LHKAEMFR7T', 'ADCV'),
02593     ('LHKAEMFR7V1ST', 'ADCS'),
02594     ('LHKAEMFR7V1', 'ADCV'),
02595     ('LHKAEMFR7V2ST', 'ADCS'),
02596     ('LHKAEMFR7V2', 'ADCV'),
02597     ('LHKAEMFR8VDST', 'ADCS'),
02598     ('LHKAEMFR8VD', 'ADCV'),
02599     ('LHKAEMFR8TST', 'ADCS'),
02600     ('LHKAEMFR8T', 'ADCV'),
02601     ('LHKAEMFR8V1ST', 'ADCS'),
02602     ('LHKAEMFR8V1', 'ADCV'),
02603     ('LHKAEMFR8V2ST', 'ADCS'),
02604     ('LHKAEMFR8V2', 'ADCV'),
02605     ('LHKAEMFR9VDST', 'ADCS'),
02606     ('LHKAEMFR9VD', 'ADCV'),
02607     ('LHKAEMFR9TST', 'ADCS'),
02608     ('LHKAEMFR9T', 'ADCV'),
02609     ('LHKAEMFR9V1ST', 'ADCS'),
02610     ('LHKAEMFR9V1', 'ADCV'),
02611     ('LHKAEMFR9V2ST', 'ADCS'),
02612     ('LHKAEMFR9V2', 'ADCV'),
02613     ('LHKAEMFR10VDST', 'ADCS'),
02614     ('LHKAEMFR10VD', 'ADCV'),
02615     ('LHKAEMFR10TST', 'ADCS'),
02616     ('LHKAEMFR10T', 'ADCV'),
02617     ('LHKAEMFR10V1ST', 'ADCS'),
02618     ('LHKAEMFR10V1', 'ADCV'),
02619     ('LHKAEMFR10V2ST', 'ADCS'),
02620     ('LHKAEMFR10V2', 'ADCV'),
02621     ('LHKAEMFR11VDST', 'ADCS'),
02622     ('LHKAEMFR11VD', 'ADCV'),
02623     ('LHKAEMFR11TST', 'ADCS'),
02624     ('LHKAEMFR11T', 'ADCV'),
02625     ('LHKAEMFR11V1ST', 'ADCS'),
02626     ('LHKAEMFR11V1', 'ADCV'),
02627     ('LHKAEMFR11V2ST', 'ADCS'),
02628     ('LHKAEMFR11V2', 'ADCV'),
02629     ]
02630   def __init__(self, ui):
02631     HskPacket.__init__(self, ui)
02632     self.name  = "AemEnv0"
02633     self.brief = "AEM Environmental Monitor Packet 0"
02634     self.descr = "AEM Packet 0"
02635     self.read()
02636
02637
02638 class HskPacket270(HskPacket):
02639   mnemList = [
02640     ('LHKSPARE08', 'TSP8'),
02641     ('LHKSPARE08', 'TSP8'),
02642     ('LHKSPARE08', 'TSP8'),
02643     ('LHKSPARE08', 'TSP8'),
02644     ('LHKSPARE08', 'TSP8'),
02645     ('LHKSPARE08', 'TSP8'),
02646     ('LHKT0TKR25VDST', 'ADCS'),
02647     ('LHKT0TKR25VD', 'ADCV'),
02648     ('LHKSPARE16', 'TSP16'),
02649     ('LHKT0TKR15VAAST', 'ADCS'),
02650     ('LHKT0TKR15VAA', 'ADCV'),
02651     ('LHKSPARE16', 'TSP16'),
02652     ('LHKT0TKR25VABST', 'ADCS'),
02653     ('LHKT0TKR25VAB', 'ADCV'),
02654     ('LHKSPARE16', 'TSP16'),
02655     ('LHKT0TKRBV0ST', 'ADCS'),
02656     ('LHKT0TKRBV0', 'ADCV'),
02657     ('LHKSPARE16', 'TSP16'),
02658     ('LHKT0CAL33VDST', 'ADCS'),
02659     ('LHKT0CAL33VD', 'ADCV'),
02660     ('LHKT0TKRBV1ST', 'ADCS'),
02661     ('LHKT0TKRBV1', 'ADCV'),
02662     ('LHKT0CAL33VAST', 'ADCS'),
02663     ('LHKT0CAL33VA', 'ADCV'),
02664     ('LHKT0CALBSV1ST', 'ADCS'),
02665     ('LHKT0CALBSV1', 'ADCV'),
02666     ('LHKT0CALBSV0ST', 'ADCS'),
02667     ('LHKT0CALBSV0', 'ADCV'),
02668     ('LHKT0TEM28V0ST', 'ADCS'),
02669     ('LHKT0TEM28V0', 'ADCV'),
02670     ('LHKT0TEM33VST', 'ADCS'),
02671     ('LHKT0TEM33V', 'ADCV'),
02672     ('LHKT0TEM28V1ST', 'ADCS'),
02673     ('LHKT0TEM28V1', 'ADCV'),
02674     ('LHKT1TKR25VDST', 'ADCS'),
02675     ('LHKT1TKR25VD', 'ADCV'),
02676     ('LHKSPARE16', 'TSP16'),
02677     ('LHKT1TKR15VAAST', 'ADCS'),
02678     ('LHKT1TKR15VAA', 'ADCV'),
02679     ('LHKSPARE16', 'TSP16'),
02680     ('LHKT1TKR25VABST', 'ADCS'),
02681     ('LHKT1TKR25VAB', 'ADCV'),
02682     ('LHKSPARE16', 'TSP16'),
02683     ('LHKT1TKRBV0ST', 'ADCS'),
02684     ('LHKT1TKRBV0', 'ADCV'),
02685     ('LHKSPARE16', 'TSP16'),
02686     ('LHKT1CAL33VDST', 'ADCS'),
02687     ('LHKT1CAL33VD', 'ADCV'),
02688     ('LHKT1TKRBV1ST', 'ADCS'),
02689     ('LHKT1TKRBV1', 'ADCV'),
02690     ('LHKT1CAL33VAST', 'ADCS'),
02691     ('LHKT1CAL33VA', 'ADCV'),
02692     ('LHKT1CALBSV1ST', 'ADCS'),
02693     ('LHKT1CALBSV1', 'ADCV'),
02694     ('LHKT1CALBSV0ST', 'ADCS'),
02695     ('LHKT1CALBSV0', 'ADCV'),
02696     ('LHKT1TEM28V0ST', 'ADCS'),
02697     ('LHKT1TEM28V0', 'ADCV'),
02698     ('LHKT1TEM33VST', 'ADCS'),
02699     ('LHKT1TEM33V', 'ADCV'),
02700     ('LHKT1TEM28V1ST', 'ADCS'),
02701     ('LHKT1TEM28V1', 'ADCV'),
02702     ('LHKT2TKR25VDST', 'ADCS'),
02703     ('LHKT2TKR25VD', 'ADCV'),
02704     ('LHKSPARE16', 'TSP16'),
02705     ('LHKT2TKR15VAAST', 'ADCS'),
02706     ('LHKT2TKR15VAA', 'ADCV'),
02707     ('LHKSPARE16', 'TSP16'),
02708     ('LHKT2TKR25VABST', 'ADCS'),
02709     ('LHKT2TKR25VAB', 'ADCV'),
02710     ('LHKSPARE16', 'TSP16'),
02711     ('LHKT2TKRBV0ST', 'ADCS'),
02712     ('LHKT2TKRBV0', 'ADCV'),
02713     ('LHKSPARE16', 'TSP16'),
02714     ('LHKT2CAL33VDST', 'ADCS'),
02715     ('LHKT2CAL33VD', 'ADCV'),
02716     ('LHKT2TKRBV1ST', 'ADCS'),
02717     ('LHKT2TKRBV1', 'ADCV'),
02718     ('LHKT2CAL33VAST', 'ADCS'),
02719     ('LHKT2CAL33VA', 'ADCV'),
02720     ('LHKT2CALBSV1ST', 'ADCS'),
02721     ('LHKT2CALBSV1', 'ADCV'),
02722     ('LHKT2CALBSV0ST', 'ADCS'),
02723     ('LHKT2CALBSV0', 'ADCV'),
02724     ('LHKT2TEM28V0ST', 'ADCS'),
02725     ('LHKT2TEM28V0', 'ADCV'),
02726     ('LHKT2TEM33VST', 'ADCS'),
02727     ('LHKT2TEM33V', 'ADCV'),
02728     ('LHKT2TEM28V1ST', 'ADCS'),
02729     ('LHKT2TEM28V1', 'ADCV'),
02730     ]
02731   def __init__(self, ui):
02732     HskPacket.__init__(self, ui)
02733     self.name  = "DiagTemEnvPwr0"
02734     self.brief = "Diagnostic TEM Power Packet 0"
02735     self.descr = "Contains power specific ADC values for TEMs 0, 1, and 2."
02736     self.read()
02737
02738
02739 class HskPacket271(HskPacket):
02740   mnemList = [
02741     ('LHKSPARE08', 'TSP8'),
02742     ('LHKSPARE08', 'TSP8'),
02743     ('LHKSPARE08', 'TSP8'),
02744     ('LHKSPARE08', 'TSP8'),
02745     ('LHKSPARE08', 'TSP8'),
02746     ('LHKSPARE08', 'TSP8'),
02747     ('LHKT3TKR25VDST', 'ADCS'),
02748     ('LHKT3TKR25VD', 'ADCV'),
02749     ('LHKSPARE16', 'TSP16'),
02750     ('LHKT3TKR15VAAST', 'ADCS'),
02751     ('LHKT3TKR15VAA', 'ADCV'),
02752     ('LHKSPARE16', 'TSP16'),
02753     ('LHKT3TKR25VABST', 'ADCS'),
02754     ('LHKT3TKR25VAB', 'ADCV'),
02755     ('LHKSPARE16', 'TSP16'),
02756     ('LHKT3TKRBV0ST', 'ADCS'),
02757     ('LHKT3TKRBV0', 'ADCV'),
02758     ('LHKSPARE16', 'TSP16'),
02759     ('LHKT3CAL33VDST', 'ADCS'),
02760     ('LHKT3CAL33VD', 'ADCV'),
02761     ('LHKT3TKRBV1ST', 'ADCS'),
02762     ('LHKT3TKRBV1', 'ADCV'),
02763     ('LHKT3CAL33VAST', 'ADCS'),
02764     ('LHKT3CAL33VA', 'ADCV'),
02765     ('LHKT3CALBSV1ST', 'ADCS'),
02766     ('LHKT3CALBSV1', 'ADCV'),
02767     ('LHKT3CALBSV0ST', 'ADCS'),
02768     ('LHKT3CALBSV0', 'ADCV'),
02769     ('LHKT3TEM28V0ST', 'ADCS'),
02770     ('LHKT3TEM28V0', 'ADCV'),
02771     ('LHKT3TEM33VST', 'ADCS'),
02772     ('LHKT3TEM33V', 'ADCV'),
02773     ('LHKT3TEM28V1ST', 'ADCS'),
02774     ('LHKT3TEM28V1', 'ADCV'),
02775     ('LHKT4TKR25VDST', 'ADCS'),
02776     ('LHKT4TKR25VD', 'ADCV'),
02777     ('LHKSPARE16', 'TSP16'),
02778     ('LHKT4TKR15VAAST', 'ADCS'),
02779     ('LHKT4TKR15VAA', 'ADCV'),
02780     ('LHKSPARE16', 'TSP16'),
02781     ('LHKT4TKR25VABST', 'ADCS'),
02782     ('LHKT4TKR25VAB', 'ADCV'),
02783     ('LHKSPARE16', 'TSP16'),
02784     ('LHKT4TKRBV0ST', 'ADCS'),
02785     ('LHKT4TKRBV0', 'ADCV'),
02786     ('LHKSPARE16', 'TSP16'),
02787     ('LHKT4CAL33VDST', 'ADCS'),
02788     ('LHKT4CAL33VD', 'ADCV'),
02789     ('LHKT4TKRBV1ST', 'ADCS'),
02790     ('LHKT4TKRBV1', 'ADCV'),
02791     ('LHKT4CAL33VAST', 'ADCS'),
02792     ('LHKT4CAL33VA', 'ADCV'),
02793     ('LHKT4CALBSV1ST', 'ADCS'),
02794     ('LHKT4CALBSV1', 'ADCV'),
02795     ('LHKT4CALBSV0ST', 'ADCS'),
02796     ('LHKT4CALBSV0', 'ADCV'),
02797     ('LHKT4TEM28V0ST', 'ADCS'),
02798     ('LHKT4TEM28V0', 'ADCV'),
02799     ('LHKT4TEM33VST', 'ADCS'),
02800     ('LHKT4TEM33V', 'ADCV'),
02801     ('LHKT4TEM28V1ST', 'ADCS'),
02802     ('LHKT4TEM28V1', 'ADCV'),
02803     ('LHKT5TKR25VDST', 'ADCS'),
02804     ('LHKT5TKR25VD', 'ADCV'),
02805     ('LHKSPARE16', 'TSP16'),
02806     ('LHKT5TKR15VAAST', 'ADCS'),
02807     ('LHKT5TKR15VAA', 'ADCV'),
02808     ('LHKSPARE16', 'TSP16'),
02809     ('LHKT5TKR25VABST', 'ADCS'),
02810     ('LHKT5TKR25VAB', 'ADCV'),
02811     ('LHKSPARE16', 'TSP16'),
02812     ('LHKT5TKRBV0ST', 'ADCS'),
02813     ('LHKT5TKRBV0', 'ADCV'),
02814     ('LHKSPARE16', 'TSP16'),
02815     ('LHKT5CAL33VDST', 'ADCS'),
02816     ('LHKT5CAL33VD', 'ADCV'),
02817     ('LHKT5TKRBV1ST', 'ADCS'),
02818     ('LHKT5TKRBV1', 'ADCV'),
02819     ('LHKT5CAL33VAST', 'ADCS'),
02820     ('LHKT5CAL33VA', 'ADCV'),
02821     ('LHKT5CALBSV1ST', 'ADCS'),
02822     ('LHKT5CALBSV1', 'ADCV'),
02823     ('LHKT5CALBSV0ST', 'ADCS'),
02824     ('LHKT5CALBSV0', 'ADCV'),
02825     ('LHKT5TEM28V0ST', 'ADCS'),
02826     ('LHKT5TEM28V0', 'ADCV'),
02827     ('LHKT5TEM33VST', 'ADCS'),
02828     ('LHKT5TEM33V', 'ADCV'),
02829     ('LHKT5TEM28V1ST', 'ADCS'),
02830     ('LHKT5TEM28V1', 'ADCV'),
02831     ]
02832   def __init__(self, ui):
02833     HskPacket.__init__(self, ui)
02834     self.name  = "DiagTemEnvPwr1"
02835     self.brief = "Diagnostic TEM Power Packet 1"
02836     self.descr = "Contains power specific ADC values for TEMs 3,4, and 5."
02837     self.read()
02838
02839
02840 class HskPacket272(HskPacket):
02841   mnemList = [
02842     ('LHKSPARE08', 'TSP8'),
02843     ('LHKSPARE08', 'TSP8'),
02844     ('LHKSPARE08', 'TSP8'),
02845     ('LHKSPARE08', 'TSP8'),
02846     ('LHKSPARE08', 'TSP8'),
02847     ('LHKSPARE08', 'TSP8'),
02848     ('LHKT6TKR25VDST', 'ADCS'),
02849     ('LHKT6TKR25VD', 'ADCV'),
02850     ('LHKSPARE16', 'TSP16'),
02851     ('LHKT6TKR15VAAST', 'ADCS'),
02852     ('LHKT6TKR15VAA', 'ADCV'),
02853     ('LHKSPARE16', 'TSP16'),
02854     ('LHKT6TKR25VABST', 'ADCS'),
02855     ('LHKT6TKR25VAB', 'ADCV'),
02856     ('LHKSPARE16', 'TSP16'),
02857     ('LHKT6TKRBV0ST', 'ADCS'),
02858     ('LHKT6TKRBV0', 'ADCV'),
02859     ('LHKSPARE16', 'TSP16'),
02860     ('LHKT6CAL33VDST', 'ADCS'),
02861     ('LHKT6CAL33VD', 'ADCV'),
02862     ('LHKT6TKRBV1ST', 'ADCS'),
02863     ('LHKT6TKRBV1', 'ADCV'),
02864     ('LHKT6CAL33VAST', 'ADCS'),
02865     ('LHKT6CAL33VA', 'ADCV'),
02866     ('LHKT6CALBSV1ST', 'ADCS'),
02867     ('LHKT6CALBSV1', 'ADCV'),
02868     ('LHKT6CALBSV0ST', 'ADCS'),
02869     ('LHKT6CALBSV0', 'ADCV'),
02870     ('LHKT6TEM28V0ST', 'ADCS'),
02871     ('LHKT6TEM28V0', 'ADCV'),
02872     ('LHKT6TEM33VST', 'ADCS'),
02873     ('LHKT6TEM33V', 'ADCV'),
02874     ('LHKT6TEM28V1ST', 'ADCS'),
02875     ('LHKT6TEM28V1', 'ADCV'),
02876     ('LHKT7TKR25VDST', 'ADCS'),
02877     ('LHKT7TKR25VD', 'ADCV'),
02878     ('LHKSPARE16', 'TSP16'),
02879     ('LHKT7TKR15VAAST', 'ADCS'),
02880     ('LHKT7TKR15VAA', 'ADCV'),
02881     ('LHKSPARE16', 'TSP16'),
02882     ('LHKT7TKR25VABST', 'ADCS'),
02883     ('LHKT7TKR25VAB', 'ADCV'),
02884     ('LHKSPARE16', 'TSP16'),
02885     ('LHKT7TKRBV0ST', 'ADCS'),
02886     ('LHKT7TKRBV0', 'ADCV'),
02887     ('LHKSPARE16', 'TSP16'),
02888     ('LHKT7CAL33VDST', 'ADCS'),
02889     ('LHKT7CAL33VD', 'ADCV'),
02890     ('LHKT7TKRBV1ST', 'ADCS'),
02891     ('LHKT7TKRBV1', 'ADCV'),
02892     ('LHKT7CAL33VAST', 'ADCS'),
02893     ('LHKT7CAL33VA', 'ADCV'),
02894     ('LHKT7CALBSV1ST', 'ADCS'),
02895     ('LHKT7CALBSV1', 'ADCV'),
02896     ('LHKT7CALBSV0ST', 'ADCS'),
02897     ('LHKT7CALBSV0', 'ADCV'),
02898     ('LHKT7TEM28V0ST', 'ADCS'),
02899     ('LHKT7TEM28V0', 'ADCV'),
02900     ('LHKT7TEM33VST', 'ADCS'),
02901     ('LHKT7TEM33V', 'ADCV'),
02902     ('LHKT7TEM28V1ST', 'ADCS'),
02903     ('LHKT7TEM28V1', 'ADCV'),
02904     ('LHKT8TKR25VDST', 'ADCS'),
02905     ('LHKT8TKR25VD', 'ADCV'),
02906     ('LHKSPARET8M0ADC1', 'TSP16'),
02907     ('LHKT8TKR15VAAST', 'ADCS'),
02908     ('LHKT8TKR15VAA', 'ADCV'),
02909     ('LHKSPARET8M0ADC3', 'TSP16'),
02910     ('LHKT8TKR25VABST', 'ADCS'),
02911     ('LHKT8TKR25VAB', 'ADCV'),
02912     ('LHKSPARET8M0ADC5', 'TSP16'),
02913     ('LHKT8TKRBV0ST', 'ADCS'),
02914     ('LHKT8TKRBV0', 'ADCV'),
02915     ('LHKSPARET8M0ADC7', 'TSP16'),
02916     ('LHKT8CAL33VDST', 'ADCS'),
02917     ('LHKT8CAL33VD', 'ADCV'),
02918     ('LHKT8TKRBV1ST', 'ADCS'),
02919     ('LHKT8TKRBV1', 'ADCV'),
02920     ('LHKT8CAL33VAST', 'ADCS'),
02921     ('LHKT8CAL33VA', 'ADCV'),
02922     ('LHKT8CALBSV1ST', 'ADCS'),
02923     ('LHKT8CALBSV1', 'ADCV'),
02924     ('LHKT8CALBSV0ST', 'ADCS'),
02925     ('LHKT8CALBSV0', 'ADCV'),
02926     ('LHKT8TEM28V0ST', 'ADCS'),
02927     ('LHKT8TEM28V0', 'ADCV'),
02928     ('LHKT8TEM33VST', 'ADCS'),
02929     ('LHKT8TEM33V', 'ADCV'),
02930     ('LHKT8TEM28V1ST', 'ADCS'),
02931     ('LHKT8TEM28V1', 'ADCV'),
02932     ]
02933   def __init__(self, ui):
02934     HskPacket.__init__(self, ui)
02935     self.name  = "DiagTemEnvPwr2"
02936     self.brief = "Diagnostic TEM Power Packet 2"
02937     self.descr = "Contains power specific ADC values for TEMs 6, 7, and 8."
02938     self.read()
02939
02940
02941 class HskPacket273(HskPacket):
02942   mnemList = [
02943     ('LHKSPARE08', 'TSP8'),
02944     ('LHKSPARE08', 'TSP8'),
02945     ('LHKSPARE08', 'TSP8'),
02946     ('LHKSPARE08', 'TSP8'),
02947     ('LHKSPARE08', 'TSP8'),
02948     ('LHKSPARE08', 'TSP8'),
02949     ('LHKT9TKR25VDST', 'ADCS'),
02950     ('LHKT9TKR25VD', 'ADCV'),
02951     ('LHKSPARET9M0ADC1', 'TSP16'),
02952     ('LHKT9TKR15VAAST', 'ADCS'),
02953     ('LHKT9TKR15VAA', 'ADCV'),
02954     ('LHKSPARET9M0ADC3', 'TSP16'),
02955     ('LHKT9TKR25VABST', 'ADCS'),
02956     ('LHKT9TKR25VAB', 'ADCV'),
02957     ('LHKSPARET9M0ADC5', 'TSP16'),
02958     ('LHKT9TKRBV0ST', 'ADCS'),
02959     ('LHKT9TKRBV0', 'ADCV'),
02960     ('LHKSPARET9M0ADC7', 'TSP16'),
02961     ('LHKT9CAL33VDST', 'ADCS'),
02962     ('LHKT9CAL33VD', 'ADCV'),
02963     ('LHKT9TKRBV1ST', 'ADCS'),
02964     ('LHKT9TKRBV1', 'ADCV'),
02965     ('LHKT9CAL33VAST', 'ADCS'),
02966     ('LHKT9CAL33VA', 'ADCV'),
02967     ('LHKT9CALBSV1ST', 'ADCS'),
02968     ('LHKT9CALBSV1', 'ADCV'),
02969     ('LHKT9CALBSV0ST', 'ADCS'),
02970     ('LHKT9CALBSV0', 'ADCV'),
02971     ('LHKT9TEM28V0ST', 'ADCS'),
02972     ('LHKT9TEM28V0', 'ADCV'),
02973     ('LHKT9TEM33VST', 'ADCS'),
02974     ('LHKT9TEM33V', 'ADCV'),
02975     ('LHKT9TEM28V1ST', 'ADCS'),
02976     ('LHKT9TEM28V1', 'ADCV'),
02977     ('LHKTATKR25VDST', 'ADCS'),
02978     ('LHKTATKR25VD', 'ADCV'),
02979     ('LHKSPARETAM0ADC1', 'TSP16'),
02980     ('LHKTATKR15VAAST', 'ADCS'),
02981     ('LHKTATKR15VAA', 'ADCV'),
02982     ('LHKSPARETAM0ADC3', 'TSP16'),
02983     ('LHKTATKR25VABST', 'ADCS'),
02984     ('LHKTATKR25VAB', 'ADCV'),
02985     ('LHKSPARETAM0ADC5', 'TSP16'),
02986     ('LHKTATKRBV0ST', 'ADCS'),
02987     ('LHKTATKRBV0', 'ADCV'),
02988     ('LHKSPARETAM0ADC7', 'TSP16'),
02989     ('LHKTACAL33VDST', 'ADCS'),
02990     ('LHKTACAL33VD', 'ADCV'),
02991     ('LHKTATKRBV1ST', 'ADCS'),
02992     ('LHKTATKRBV1', 'ADCV'),
02993     ('LHKTACAL33VAST', 'ADCS'),
02994     ('LHKTACAL33VA', 'ADCV'),
02995     ('LHKTACALBSV1ST', 'ADCS'),
02996     ('LHKTACALBSV1', 'ADCV'),
02997     ('LHKTACALBSV0ST', 'ADCS'),
02998     ('LHKTACALBSV0', 'ADCV'),
02999     ('LHKTATEM28V0ST', 'ADCS'),
03000     ('LHKTATEM28V0', 'ADCV'),
03001     ('LHKTATEM33VST', 'ADCS'),
03002     ('LHKTATEM33V', 'ADCV'),
03003     ('LHKTATEM28V1ST', 'ADCS'),
03004     ('LHKTATEM28V1', 'ADCV'),
03005     ('LHKTBTKR25VDST', 'ADCS'),
03006     ('LHKTBTKR25VD', 'ADCV'),
03007     ('LHKSPARETBM0ADC1', 'TSP16'),
03008     ('LHKTBTKR15VAAST', 'ADCS'),
03009     ('LHKTBTKR15VAA', 'ADCV'),
03010     ('LHKSPARETBM0ADC3', 'TSP16'),
03011     ('LHKTBTKR25VABST', 'ADCS'),
03012     ('LHKTBTKR25VAB', 'ADCV'),
03013     ('LHKSPARETBM0ADC5', 'TSP16'),
03014     ('LHKTBTKRBV0ST', 'ADCS'),
03015     ('LHKTBTKRBV0', 'ADCV'),
03016     ('LHKSPARETBM0ADC7', 'TSP16'),
03017     ('LHKTBCAL33VDST', 'ADCS'),
03018     ('LHKTBCAL33VD', 'ADCV'),
03019     ('LHKTBTKRBV1ST', 'ADCS'),
03020     ('LHKTBTKRBV1', 'ADCV'),
03021     ('LHKTBCAL33VAST', 'ADCS'),
03022     ('LHKTBCAL33VA', 'ADCV'),
03023     ('LHKTBCALBSV1ST', 'ADCS'),
03024     ('LHKTBCALBSV1', 'ADCV'),
03025     ('LHKTBCALBSV0ST', 'ADCS'),
03026     ('LHKTBCALBSV0', 'ADCV'),
03027     ('LHKTBTEM28V0ST', 'ADCS'),
03028     ('LHKTBTEM28V0', 'ADCV'),
03029     ('LHKTBTEM33VST', 'ADCS'),
03030     ('LHKTBTEM33V', 'ADCV'),
03031     ('LHKTBTEM28V1ST', 'ADCS'),
03032     ('LHKTBTEM28V1', 'ADCV'),
03033     ]
03034   def __init__(self, ui):
03035     HskPacket.__init__(self, ui)
03036     self.name  = "DiagTemEnvPwr3"
03037     self.brief = "Diagnostic TEM Power Packet 3"
03038     self.descr = "Contains power specific ADC values for TEMs 9, 10, and 11."
03039     self.read()
03040
03041
03042 class HskPacket274(HskPacket):
03043   mnemList = [
03044     ('LHKSPARE08', 'TSP8'),
03045     ('LHKSPARE08', 'TSP8'),
03046     ('LHKSPARE08', 'TSP8'),
03047     ('LHKSPARE08', 'TSP8'),
03048     ('LHKSPARE08', 'TSP8'),
03049     ('LHKSPARE08', 'TSP8'),
03050     ('LHKTCTKR25VDST', 'ADCS'),
03051     ('LHKTCTKR25VD', 'ADCV'),
03052     ('LHKSPARETCM0ADC1', 'TSP16'),
03053     ('LHKTCTKR15VAAST', 'ADCS'),
03054     ('LHKTCTKR15VAA', 'ADCV'),
03055     ('LHKSPARETCM0ADC3', 'TSP16'),
03056     ('LHKTCTKR25VABST', 'ADCS'),
03057     ('LHKTCTKR25VAB', 'ADCV'),
03058     ('LHKSPARETCM0ADC5', 'TSP16'),
03059     ('LHKTCTKRBV0ST', 'ADCS'),
03060     ('LHKTCTKRBV0', 'ADCV'),
03061     ('LHKSPARETCM0ADC7', 'TSP16'),
03062     ('LHKTCCAL33VDST', 'ADCS'),
03063     ('LHKTCCAL33VD', 'ADCV'),
03064     ('LHKTCTKRBV1ST', 'ADCS'),
03065     ('LHKTCTKRBV1', 'ADCV'),
03066     ('LHKTCCAL33VAST', 'ADCS'),
03067     ('LHKTCCAL33VA', 'ADCV'),
03068     ('LHKTCCALBSV1ST', 'ADCS'),
03069     ('LHKTCCALBSV1', 'ADCV'),
03070     ('LHKTCCALBSV0ST', 'ADCS'),
03071     ('LHKTCCALBSV0', 'ADCV'),
03072     ('LHKTCTEM28V0ST', 'ADCS'),
03073     ('LHKTCTEM28V0', 'ADCV'),
03074     ('LHKTCTEM33VST', 'ADCS'),
03075     ('LHKTCTEM33V', 'ADCV'),
03076     ('LHKTCTEM28V1ST', 'ADCS'),
03077     ('LHKTCTEM28V1', 'ADCV'),
03078     ('LHKTDTKR25VDST', 'ADCS'),
03079     ('LHKTDTKR25VD', 'ADCV'),
03080     ('LHKSPARETDM0ADC1', 'TSP16'),
03081     ('LHKTDTKR15VAAST', 'ADCS'),
03082     ('LHKTDTKR15VAA', 'ADCV'),
03083     ('LHKSPARETDM0ADC3', 'TSP16'),
03084     ('LHKTDTKR25VABST', 'ADCS'),
03085     ('LHKTDTKR25VAB', 'ADCV'),
03086     ('LHKSPARETDM0ADC5', 'TSP16'),
03087     ('LHKTDTKRBV0ST', 'ADCS'),
03088     ('LHKTDTKRBV0', 'ADCV'),
03089     ('LHKSPARETDM0ADC7', 'TSP16'),
03090     ('LHKTDCAL33VDST', 'ADCS'),
03091     ('LHKTDCAL33VD', 'ADCV'),
03092     ('LHKTDTKRBV1ST', 'ADCS'),
03093     ('LHKTDTKRBV1', 'ADCV'),
03094     ('LHKTDCAL33VAST', 'ADCS'),
03095     ('LHKTDCAL33VA', 'ADCV'),
03096     ('LHKTDCALBSV1ST', 'ADCS'),
03097     ('LHKTDCALBSV1', 'ADCV'),
03098     ('LHKTDCALBSV0ST', 'ADCS'),
03099     ('LHKTDCALBSV0', 'ADCV'),
03100     ('LHKTDTEM28V0ST', 'ADCS'),
03101     ('LHKTDTEM28V0', 'ADCV'),
03102     ('LHKTDTEM33VST', 'ADCS'),
03103     ('LHKTDTEM33V', 'ADCV'),
03104     ('LHKTDTEM28V1ST', 'ADCS'),
03105     ('LHKTDTEM28V1', 'ADCV'),
03106     ('LHKTETKR25VDST', 'ADCS'),
03107     ('LHKTETKR25VD', 'ADCV'),
03108     ('LHKSPARETEM0ADC1', 'TSP16'),
03109     ('LHKTETKR15VAAST', 'ADCS'),
03110     ('LHKTETKR15VAA', 'ADCV'),
03111     ('LHKSPARETEM0ADC3', 'TSP16'),
03112     ('LHKTETKR25VABST', 'ADCS'),
03113     ('LHKTETKR25VAB', 'ADCV'),
03114     ('LHKSPARETEM0ADC5', 'TSP16'),
03115     ('LHKTETKRBV0ST', 'ADCS'),
03116     ('LHKTETKRBV0', 'ADCV'),
03117     ('LHKSPARETEM0ADC7', 'TSP16'),
03118     ('LHKTECAL33VDST', 'ADCS'),
03119     ('LHKTECAL33VD', 'ADCV'),
03120     ('LHKTETKRBV1ST', 'ADCS'),
03121     ('LHKTETKRBV1', 'ADCV'),
03122     ('LHKTECAL33VAST', 'ADCS'),
03123     ('LHKTECAL33VA', 'ADCV'),
03124     ('LHKTECALBSV1ST', 'ADCS'),
03125     ('LHKTECALBSV1', 'ADCV'),
03126     ('LHKTECALBSV0ST', 'ADCS'),
03127     ('LHKTECALBSV0', 'ADCV'),
03128     ('LHKTETEM28V0ST', 'ADCS'),
03129     ('LHKTETEM28V0', 'ADCV'),
03130     ('LHKTETEM33VST', 'ADCS'),
03131     ('LHKTETEM33V', 'ADCV'),
03132     ('LHKTETEM28V1ST', 'ADCS'),
03133     ('LHKTETEM28V1', 'ADCV'),
03134     ]
03135   def __init__(self, ui):
03136     HskPacket.__init__(self, ui)
03137     self.name  = "DiagTemEnvPwr4"
03138     self.brief = "Diagnostic TEM Power Packet 4"
03139     self.descr = "Contains power specific ADC values for TEMs 12, 13, and 14."
03140     self.read()
03141
03142
03143 class HskPacket275(HskPacket):
03144   mnemList = [
03145     ('LHKSPARE08', 'TSP8'),
03146     ('LHKSPARE08', 'TSP8'),
03147     ('LHKSPARE08', 'TSP8'),
03148     ('LHKSPARE08', 'TSP8'),
03149     ('LHKSPARE08', 'TSP8'),
03150     ('LHKSPARE08', 'TSP8'),
03151     ('LHKTFTKR25VDST', 'ADCS'),
03152     ('LHKTFTKR25VD', 'ADCV'),
03153     ('LHKSPARETFM0ADC1', 'TSP16'),
03154     ('LHKTFTKR15VAAST', 'ADCS'),
03155     ('LHKTFTKR15VAA', 'ADCV'),
03156     ('LHKSPARETFM0ADC3', 'TSP16'),
03157     ('LHKTFTKR25VABST', 'ADCS'),
03158     ('LHKTFTKR25VAB', 'ADCV'),
03159     ('LHKSPARETFM0ADC5', 'TSP16'),
03160     ('LHKTFTKRBV0ST', 'ADCS'),
03161     ('LHKTFTKRBV0', 'ADCV'),
03162     ('LHKSPARETFM0ADC7', 'TSP16'),
03163     ('LHKTFCAL33VDST', 'ADCS'),
03164     ('LHKTFCAL33VD', 'ADCV'),
03165     ('LHKTFTKRBV1ST', 'ADCS'),
03166     ('LHKTFTKRBV1', 'ADCV'),
03167     ('LHKTFCAL33VAST', 'ADCS'),
03168     ('LHKTFCAL33VA', 'ADCV'),
03169     ('LHKTFCALBSV1ST', 'ADCS'),
03170     ('LHKTFCALBSV1', 'ADCV'),
03171     ('LHKTFCALBSV0ST', 'ADCS'),
03172     ('LHKTFCALBSV0', 'ADCV'),
03173     ('LHKTFTEM28V0ST', 'ADCS'),
03174     ('LHKTFTEM28V0', 'ADCV'),
03175     ('LHKTFTEM33VST', 'ADCS'),
03176     ('LHKTFTEM33V', 'ADCV'),
03177     ('LHKTFTEM28V1ST', 'ADCS'),
03178     ('LHKTFTEM28V1', 'ADCV'),
03179     ('LHKRTERRCNT', 'RTERR'),
03180     ('LHKRTINTRCNT', 'INTRCNT'),
03181     ('LHKRTCXPCNT', 'CRXPCNT'),
03182     ('LHKRTCXBCNT', 'CRXBCNT'),
03183     ('LHKRTTXPCNT', 'CTXPCNT'),
03184     ('LHKRTTXBCNT', 'CTXBCNT'),
03185     ('LHKRTHKPCNT', 'HKPCNT'),
03186     ('LHKRTHKBCNT', 'HKBCNT'),
03187     ('LHKRTTLMPCNT', 'TLMPCNT'),
03188     ('LHKRTTLMBCNT', 'TLMBCNT'),
03189     ('LHKSPARE16', 'TSP16'),
03190     ('LHKSPARE16', 'TSP16'),
03191     ('LHKSPARE16', 'TSP16'),
03192     ('LHKSPARE16', 'TSP16'),
03193     ('LHKSPARE16', 'TSP16'),
03194     ('LHKSPARE16', 'TSP16'),
03195     ('LHKSPARE16', 'TSP16'),
03196     ('LHKSPARE16', 'TSP16'),
03197     ('LHKSPARE16', 'TSP16'),
03198     ('LHKSPARE16', 'TSP16'),
03199     ('LHKSPARE16', 'TSP16'),
03200     ('LHKSPARE16', 'TSP16'),
03201     ]
03202   def __init__(self, ui):
03203     HskPacket.__init__(self, ui)
03204     self.name  = "DiagTemEnvPwr5"
03205     self.brief = "Diagnostic TEM Power Packet 5"
03206     self.descr = "Contains powr specific ADC values for TEM 15."
03207     self.read()
03208
03209
03210 class HskPacket276(HskPacket):
03211   mnemList = [
03212     ('LHKSPARE08', 'TSP8'),
03213     ('LHKSPARE08', 'TSP8'),
03214     ('LHKSPARE08', 'TSP8'),
03215     ('LHKSPARE08', 'TSP8'),
03216     ('LHKSPARE08', 'TSP8'),
03217     ('LHKSPARE08', 'TSP8'),
03218     ('LHKT0CALAF0T0ST', 'ADCS'),
03219     ('LHKT0CALAF0T0', 'ADCV'),
03220     ('LHKT0CALAF0T1ST', 'ADCS'),
03221     ('LHKT0CALAF0T1', 'ADCV'),
03222     ('LHKT0CALAF1T0ST', 'ADCS'),
03223     ('LHKT0CALAF1T0', 'ADCV'),
03224     ('LHKT0CALAF1T1ST', 'ADCS'),
03225     ('LHKT0CALAF1T1', 'ADCV'),
03226     ('LHKT0CALAF2T0ST', 'ADCS'),
03227     ('LHKT0CALAF2T0', 'ADCV'),
03228     ('LHKT0CALAF2T1ST', 'ADCS'),
03229     ('LHKT0CALAF2T1', 'ADCV'),
03230     ('LHKT0CALAF3T0ST', 'ADCS'),
03231     ('LHKT0CALAF3T0', 'ADCV'),
03232     ('LHKT0CALAF3T1ST', 'ADCS'),
03233     ('LHKT0CALAF3T1', 'ADCV'),
03234     ('LHKT0TKRC0T0ST', 'ADCS'),
03235     ('LHKT0TKRC0T0', 'ADCV'),
03236     ('LHKT0TKRC0T1ST', 'ADCS'),
03237     ('LHKT0TKRC0T1', 'ADCV'),
03238     ('LHKT0TKRC1T0ST', 'ADCS'),
03239     ('LHKT0TKRC1T0', 'ADCV'),
03240     ('LHKT0TKRC1T1ST', 'ADCS'),
03241     ('LHKT0TKRC1T1', 'ADCV'),
03242     ('LHKT0TKRC2T0ST', 'ADCS'),
03243     ('LHKT0TKRC2T0', 'ADCV'),
03244     ('LHKT0TKRC2T1ST', 'ADCS'),
03245     ('LHKT0TKRC2T1', 'ADCV'),
03246     ('LHKT0TKRC3T0ST', 'ADCS'),
03247     ('LHKT0TKRC3T0', 'ADCV'),
03248     ('LHKT0TKRC3T1ST', 'ADCS'),
03249     ('LHKT0TKRC3T1', 'ADCV'),
03250     ('LHKT0TKRC4T0ST', 'ADCS'),
03251     ('LHKT0TKRC4T0', 'ADCV'),
03252     ('LHKT0TKRC4T1ST', 'ADCS'),
03253     ('LHKT0TKRC4T1', 'ADCV'),
03254     ('LHKT0TKRC5T0ST', 'ADCS'),
03255     ('LHKT0TKRC5T0', 'ADCV'),
03256     ('LHKT0TKRC5T1ST', 'ADCS'),
03257     ('LHKT0TKRC5T1', 'ADCV'),
03258     ('LHKT0TKRC6T0ST', 'ADCS'),
03259     ('LHKT0TKRC6T0', 'ADCV'),
03260     ('LHKT0TKRC6T1ST', 'ADCS'),
03261     ('LHKT0TKRC6T1', 'ADCV'),
03262     ('LHKT0TKRC7T0ST', 'ADCS'),
03263     ('LHKT0TKRC7T0', 'ADCV'),
03264     ('LHKT0TKRC7T1ST', 'ADCS'),
03265     ('LHKT0TKRC7T1', 'ADCV'),
03266     ('LHKT1CALAF0T0ST', 'ADCS'),
03267     ('LHKT1CALAF0T0', 'ADCV'),
03268     ('LHKT1CALAF0T1ST', 'ADCS'),
03269     ('LHKT1CALAF0T1', 'ADCV'),
03270     ('LHKT1CALAF1T0ST', 'ADCS'),
03271     ('LHKT1CALAF1T0', 'ADCV'),
03272     ('LHKT1CALAF1T1ST', 'ADCS'),
03273     ('LHKT1CALAF1T1', 'ADCV'),
03274     ('LHKT1CALAF2T0ST', 'ADCS'),
03275     ('LHKT1CALAF2T0', 'ADCV'),
03276     ('LHKT1CALAF2T1ST', 'ADCS'),
03277     ('LHKT1CALAF2T1', 'ADCV'),
03278     ('LHKT1CALAF3T0ST', 'ADCS'),
03279     ('LHKT1CALAF3T0', 'ADCV'),
03280     ('LHKT1CALAF3T1ST', 'ADCS'),
03281     ('LHKT1CALAF3T1', 'ADCV'),
03282     ('LHKT1TKRC0T0ST', 'ADCS'),
03283     ('LHKT1TKRC0T0', 'ADCV'),
03284     ('LHKT1TKRC0T1ST', 'ADCS'),
03285     ('LHKT1TKRC0T1', 'ADCV'),
03286     ('LHKT1TKRC1T0ST', 'ADCS'),
03287     ('LHKT1TKRC1T0', 'ADCV'),
03288     ('LHKT1TKRC1T1ST', 'ADCS'),
03289     ('LHKT1TKRC1T1', 'ADCV'),
03290     ('LHKT1TKRC2T0ST', 'ADCS'),
03291     ('LHKT1TKRC2T0', 'ADCV'),
03292     ('LHKT1TKRC2T1ST', 'ADCS'),
03293     ('LHKT1TKRC2T1', 'ADCV'),
03294     ('LHKT1TKRC3T0ST', 'ADCS'),
03295     ('LHKT1TKRC3T0', 'ADCV'),
03296     ('LHKT1TKRC3T1ST', 'ADCS'),
03297     ('LHKT1TKRC3T1', 'ADCV'),
03298     ('LHKT1TKRC4T0ST', 'ADCS'),
03299     ('LHKT1TKRC4T0', 'ADCV'),
03300     ('LHKT1TKRC4T1ST', 'ADCS'),
03301     ('LHKT1TKRC4T1', 'ADCV'),
03302     ('LHKT1TKRC5T0ST', 'ADCS'),
03303     ('LHKT1TKRC5T0', 'ADCV'),
03304     ('LHKT1TKRC5T1ST', 'ADCS'),
03305     ('LHKT1TKRC5T1', 'ADCV'),
03306     ('LHKT1TKRC6T0ST', 'ADCS'),
03307     ('LHKT1TKRC6T0', 'ADCV'),
03308     ('LHKT1TKRC6T1ST', 'ADCS'),
03309     ('LHKT1TKRC6T1', 'ADCV'),
03310     ('LHKT1TKRC7T0ST', 'ADCS'),
03311     ('LHKT1TKRC7T0', 'ADCV'),
03312     ('LHKT1TKRC7T1ST', 'ADCS'),
03313     ('LHKT1TKRC7T1', 'ADCV'),
03314     ]
03315   def __init__(self, ui):
03316     HskPacket.__init__(self, ui)
03317     self.name  = "DiagTemEnvTemp0"
03318     self.brief = "Diagnostic TEM Temperature Packet 0"
03319     self.descr = "Contains temperature specific ADC values for TEMs 0 and 1."
03320     self.read()
03321
03322
03323 class HskPacket277(HskPacket):
03324   mnemList = [
03325     ('LHKSPARE08', 'TSP8'),
03326     ('LHKSPARE08', 'TSP8'),
03327     ('LHKSPARE08', 'TSP8'),
03328     ('LHKSPARE08', 'TSP8'),
03329     ('LHKSPARE08', 'TSP8'),
03330     ('LHKSPARE08', 'TSP8'),
03331     ('LHKT2CALAF0T0ST', 'ADCS'),
03332     ('LHKT2CALAF0T0', 'ADCV'),
03333     ('LHKT2CALAF0T1ST', 'ADCS'),
03334     ('LHKT2CALAF0T1', 'ADCV'),
03335     ('LHKT2CALAF1T0ST', 'ADCS'),
03336     ('LHKT2CALAF1T0', 'ADCV'),
03337     ('LHKT2CALAF1T1ST', 'ADCS'),
03338     ('LHKT2CALAF1T1', 'ADCV'),
03339     ('LHKT2CALAF2T0ST', 'ADCS'),
03340     ('LHKT2CALAF2T0', 'ADCV'),
03341     ('LHKT2CALAF2T1ST', 'ADCS'),
03342     ('LHKT2CALAF2T1', 'ADCV'),
03343     ('LHKT2CALAF3T0ST', 'ADCS'),
03344     ('LHKT2CALAF3T0', 'ADCV'),
03345     ('LHKT2CALAF3T1ST', 'ADCS'),
03346     ('LHKT2CALAF3T1', 'ADCV'),
03347     ('LHKT2TKRC0T0ST', 'ADCS'),
03348     ('LHKT2TKRC0T0', 'ADCV'),
03349     ('LHKT2TKRC0T1ST', 'ADCS'),
03350     ('LHKT2TKRC0T1', 'ADCV'),
03351     ('LHKT2TKRC1T0ST', 'ADCS'),
03352     ('LHKT2TKRC1T0', 'ADCV'),
03353     ('LHKT2TKRC1T1ST', 'ADCS'),
03354     ('LHKT2TKRC1T1', 'ADCV'),
03355     ('LHKT2TKRC2T0ST', 'ADCS'),
03356     ('LHKT2TKRC2T0', 'ADCV'),
03357     ('LHKT2TKRC2T1ST', 'ADCS'),
03358     ('LHKT2TKRC2T1', 'ADCV'),
03359     ('LHKT2TKRC3T0ST', 'ADCS'),
03360     ('LHKT2TKRC3T0', 'ADCV'),
03361     ('LHKT2TKRC3T1ST', 'ADCS'),
03362     ('LHKT2TKRC3T1', 'ADCV'),
03363     ('LHKT2TKRC4T0ST', 'ADCS'),
03364     ('LHKT2TKRC4T0', 'ADCV'),
03365     ('LHKT2TKRC4T1ST', 'ADCS'),
03366     ('LHKT2TKRC4T1', 'ADCV'),
03367     ('LHKT2TKRC5T0ST', 'ADCS'),
03368     ('LHKT2TKRC5T0', 'ADCV'),
03369     ('LHKT2TKRC5T1ST', 'ADCS'),
03370     ('LHKT2TKRC5T1', 'ADCV'),
03371     ('LHKT2TKRC6T0ST', 'ADCS'),
03372     ('LHKT2TKRC6T0', 'ADCV'),
03373     ('LHKT2TKRC6T1ST', 'ADCS'),
03374     ('LHKT2TKRC6T1', 'ADCV'),
03375     ('LHKT2TKRC7T0ST', 'ADCS'),
03376     ('LHKT2TKRC7T0', 'ADCV'),
03377     ('LHKT2TKRC7T1ST', 'ADCS'),
03378     ('LHKT2TKRC7T1', 'ADCV'),
03379     ('LHKT3CALAF0T0ST', 'ADCS'),
03380     ('LHKT3CALAF0T0', 'ADCV'),
03381     ('LHKT3CALAF0T1ST', 'ADCS'),
03382     ('LHKT3CALAF0T1', 'ADCV'),
03383     ('LHKT3CALAF1T0ST', 'ADCS'),
03384     ('LHKT3CALAF1T0', 'ADCV'),
03385     ('LHKT3CALAF1T1ST', 'ADCS'),
03386     ('LHKT3CALAF1T1', 'ADCV'),
03387     ('LHKT3CALAF2T0ST', 'ADCS'),
03388     ('LHKT3CALAF2T0', 'ADCV'),
03389     ('LHKT3CALAF2T1ST', 'ADCS'),
03390     ('LHKT3CALAF2T1', 'ADCV'),
03391     ('LHKT3CALAF3T0ST', 'ADCS'),
03392     ('LHKT3CALAF3T0', 'ADCV'),
03393     ('LHKT3CALAF3T1ST', 'ADCS'),
03394     ('LHKT3CALAF3T1', 'ADCV'),
03395     ('LHKT3TKRC0T0ST', 'ADCS'),
03396     ('LHKT3TKRC0T0', 'ADCV'),
03397     ('LHKT3TKRC0T1ST', 'ADCS'),
03398     ('LHKT3TKRC0T1', 'ADCV'),
03399     ('LHKT3TKRC1T0ST', 'ADCS'),
03400     ('LHKT3TKRC1T0', 'ADCV'),
03401     ('LHKT3TKRC1T1ST', 'ADCS'),
03402     ('LHKT3TKRC1T1', 'ADCV'),
03403     ('LHKT3TKRC2T0ST', 'ADCS'),
03404     ('LHKT3TKRC2T0', 'ADCV'),
03405     ('LHKT3TKRC2T1ST', 'ADCS'),
03406     ('LHKT3TKRC2T1', 'ADCV'),
03407     ('LHKT3TKRC3T0ST', 'ADCS'),
03408     ('LHKT3TKRC3T0', 'ADCV'),
03409     ('LHKT3TKRC3T1ST', 'ADCS'),
03410     ('LHKT3TKRC3T1', 'ADCV'),
03411     ('LHKT3TKRC4T0ST', 'ADCS'),
03412     ('LHKT3TKRC4T0', 'ADCV'),
03413     ('LHKT3TKRC4T1ST', 'ADCS'),
03414     ('LHKT3TKRC4T1', 'ADCV'),
03415     ('LHKT3TKRC5T0ST', 'ADCS'),
03416     ('LHKT3TKRC5T0', 'ADCV'),
03417     ('LHKT3TKRC5T1ST', 'ADCS'),
03418     ('LHKT3TKRC5T1', 'ADCV'),
03419     ('LHKT3TKRC6T0ST', 'ADCS'),
03420     ('LHKT3TKRC6T0', 'ADCV'),
03421     ('LHKT3TKRC6T1ST', 'ADCS'),
03422     ('LHKT3TKRC6T1', 'ADCV'),
03423     ('LHKT3TKRC7T0ST', 'ADCS'),
03424     ('LHKT3TKRC7T0', 'ADCV'),
03425     ('LHKT3TKRC7T1ST', 'ADCS'),
03426     ('LHKT3TKRC7T1', 'ADCV'),
03427     ]
03428   def __init__(self, ui):
03429     HskPacket.__init__(self, ui)
03430     self.name  = "DiagTemEnvTemp1"
03431     self.brief = "Diagnostic TEM Temperature Packet 1"
03432     self.descr = "Contains temperature specific ADC values for TEMs 2 and 3."
03433     self.read()
03434
03435
03436 class HskPacket278(HskPacket):
03437   mnemList = [
03438     ('LHKSPARE08', 'TSP8'),
03439     ('LHKSPARE08', 'TSP8'),
03440     ('LHKSPARE08', 'TSP8'),
03441     ('LHKSPARE08', 'TSP8'),
03442     ('LHKSPARE08', 'TSP8'),
03443     ('LHKSPARE08', 'TSP8'),
03444     ('LHKT4CALAF0T0ST', 'ADCS'),
03445     ('LHKT4CALAF0T0', 'ADCV'),
03446     ('LHKT4CALAF0T1ST', 'ADCS'),
03447     ('LHKT4CALAF0T1', 'ADCV'),
03448     ('LHKT4CALAF1T0ST', 'ADCS'),
03449     ('LHKT4CALAF1T0', 'ADCV'),
03450     ('LHKT4CALAF1T1ST', 'ADCS'),
03451     ('LHKT4CALAF1T1', 'ADCV'),
03452     ('LHKT4CALAF2T0ST', 'ADCS'),
03453     ('LHKT4CALAF2T0', 'ADCV'),
03454     ('LHKT4CALAF2T1ST', 'ADCS'),
03455     ('LHKT4CALAF2T1', 'ADCV'),
03456     ('LHKT4CALAF3T0ST', 'ADCS'),
03457     ('LHKT4CALAF3T0', 'ADCV'),
03458     ('LHKT4CALAF3T1ST', 'ADCS'),
03459     ('LHKT4CALAF3T1', 'ADCV'),
03460     ('LHKT4TKRC0T0ST', 'ADCS'),
03461     ('LHKT4TKRC0T0', 'ADCV'),
03462     ('LHKT4TKRC0T1ST', 'ADCS'),
03463     ('LHKT4TKRC0T1', 'ADCV'),
03464     ('LHKT4TKRC1T0ST', 'ADCS'),
03465     ('LHKT4TKRC1T0', 'ADCV'),
03466     ('LHKT4TKRC1T1ST', 'ADCS'),
03467     ('LHKT4TKRC1T1', 'ADCV'),
03468     ('LHKT4TKRC2T0ST', 'ADCS'),
03469     ('LHKT4TKRC2T0', 'ADCV'),
03470     ('LHKT4TKRC2T1ST', 'ADCS'),
03471     ('LHKT4TKRC2T1', 'ADCV'),
03472     ('LHKT4TKRC3T0ST', 'ADCS'),
03473     ('LHKT4TKRC3T0', 'ADCV'),
03474     ('LHKT4TKRC3T1ST', 'ADCS'),
03475     ('LHKT4TKRC3T1', 'ADCV'),
03476     ('LHKT4TKRC4T0ST', 'ADCS'),
03477     ('LHKT4TKRC4T0', 'ADCV'),
03478     ('LHKT4TKRC4T1ST', 'ADCS'),
03479     ('LHKT4TKRC4T1', 'ADCV'),
03480     ('LHKT4TKRC5T0ST', 'ADCS'),
03481     ('LHKT4TKRC5T0', 'ADCV'),
03482     ('LHKT4TKRC5T1ST', 'ADCS'),
03483     ('LHKT4TKRC5T1', 'ADCV'),
03484     ('LHKT4TKRC6T0ST', 'ADCS'),
03485     ('LHKT4TKRC6T0', 'ADCV'),
03486     ('LHKT4TKRC6T1ST', 'ADCS'),
03487     ('LHKT4TKRC6T1', 'ADCV'),
03488     ('LHKT4TKRC7T0ST', 'ADCS'),
03489     ('LHKT4TKRC7T0', 'ADCV'),
03490     ('LHKT4TKRC7T1ST', 'ADCS'),
03491     ('LHKT4TKRC7T1', 'ADCV'),
03492     ('LHKT5CALAF0T0ST', 'ADCS'),
03493     ('LHKT5CALAF0T0', 'ADCV'),
03494     ('LHKT5CALAF0T1ST', 'ADCS'),
03495     ('LHKT5CALAF0T1', 'ADCV'),
03496     ('LHKT5CALAF1T0ST', 'ADCS'),
03497     ('LHKT5CALAF1T0', 'ADCV'),
03498     ('LHKT5CALAF1T1ST', 'ADCS'),
03499     ('LHKT5CALAF1T1', 'ADCV'),
03500     ('LHKT5CALAF2T0ST', 'ADCS'),
03501     ('LHKT5CALAF2T0', 'ADCV'),
03502     ('LHKT5CALAF2T1ST', 'ADCS'),
03503     ('LHKT5CALAF2T1', 'ADCV'),
03504     ('LHKT5CALAF3T0ST', 'ADCS'),
03505     ('LHKT5CALAF3T0', 'ADCV'),
03506     ('LHKT5CALAF3T1ST', 'ADCS'),
03507     ('LHKT5CALAF3T1', 'ADCV'),
03508     ('LHKT5TKRC0T0ST', 'ADCS'),
03509     ('LHKT5TKRC0T0', 'ADCV'),
03510     ('LHKT5TKRC0T1ST', 'ADCS'),
03511     ('LHKT5TKRC0T1', 'ADCV'),
03512     ('LHKT5TKRC1T0ST', 'ADCS'),
03513     ('LHKT5TKRC1T0', 'ADCV'),
03514     ('LHKT5TKRC1T1ST', 'ADCS'),
03515     ('LHKT5TKRC1T1', 'ADCV'),
03516     ('LHKT5TKRC2T0ST', 'ADCS'),
03517     ('LHKT5TKRC2T0', 'ADCV'),
03518     ('LHKT5TKRC2T1ST', 'ADCS'),
03519     ('LHKT5TKRC2T1', 'ADCV'),
03520     ('LHKT5TKRC3T0ST', 'ADCS'),
03521     ('LHKT5TKRC3T0', 'ADCV'),
03522     ('LHKT5TKRC3T1ST', 'ADCS'),
03523     ('LHKT5TKRC3T1', 'ADCV'),
03524     ('LHKT5TKRC4T0ST', 'ADCS'),
03525     ('LHKT5TKRC4T0', 'ADCV'),
03526     ('LHKT5TKRC4T1ST', 'ADCS'),
03527     ('LHKT5TKRC4T1', 'ADCV'),
03528     ('LHKT5TKRC5T0ST', 'ADCS'),
03529     ('LHKT5TKRC5T0', 'ADCV'),
03530     ('LHKT5TKRC5T1ST', 'ADCS'),
03531     ('LHKT5TKRC5T1', 'ADCV'),
03532     ('LHKT5TKRC6T0ST', 'ADCS'),
03533     ('LHKT5TKRC6T0', 'ADCV'),
03534     ('LHKT5TKRC6T1ST', 'ADCS'),
03535     ('LHKT5TKRC6T1', 'ADCV'),
03536     ('LHKT5TKRC7T0ST', 'ADCS'),
03537     ('LHKT5TKRC7T0', 'ADCV'),
03538     ('LHKT5TKRC7T1ST', 'ADCS'),
03539     ('LHKT5TKRC7T1', 'ADCV'),
03540     ]
03541   def __init__(self, ui):
03542     HskPacket.__init__(self, ui)
03543     self.name  = "DiagTemEnvTemp2"
03544     self.brief = "Diagnostic TEM Temperature Packet 2"
03545     self.descr = "Contains temperature specific ADC values for TEMs 4 and 5."
03546     self.read()
03547
03548
03549 class HskPacket279(HskPacket):
03550   mnemList = [
03551     ('LHKSPARE08', 'TSP8'),
03552     ('LHKSPARE08', 'TSP8'),
03553     ('LHKSPARE08', 'TSP8'),
03554     ('LHKSPARE08', 'TSP8'),
03555     ('LHKSPARE08', 'TSP8'),
03556     ('LHKSPARE08', 'TSP8'),
03557     ('LHKT6CALAF0T0ST', 'ADCS'),
03558     ('LHKT6CALAF0T0', 'ADCV'),
03559     ('LHKT6CALAF0T1ST', 'ADCS'),
03560     ('LHKT6CALAF0T1', 'ADCV'),
03561     ('LHKT6CALAF1T0ST', 'ADCS'),
03562     ('LHKT6CALAF1T0', 'ADCV'),
03563     ('LHKT6CALAF1T1ST', 'ADCS'),
03564     ('LHKT6CALAF1T1', 'ADCV'),
03565     ('LHKT6CALAF2T0ST', 'ADCS'),
03566     ('LHKT6CALAF2T0', 'ADCV'),
03567     ('LHKT6CALAF2T1ST', 'ADCS'),
03568     ('LHKT6CALAF2T1', 'ADCV'),
03569     ('LHKT6CALAF3T0ST', 'ADCS'),
03570     ('LHKT6CALAF3T0', 'ADCV'),
03571     ('LHKT6CALAF3T1ST', 'ADCS'),
03572     ('LHKT6CALAF3T1', 'ADCV'),
03573     ('LHKT6TKRC0T0ST', 'ADCS'),
03574     ('LHKT6TKRC0T0', 'ADCV'),
03575     ('LHKT6TKRC0T1ST', 'ADCS'),
03576     ('LHKT6TKRC0T1', 'ADCV'),
03577     ('LHKT6TKRC1T0ST', 'ADCS'),
03578     ('LHKT6TKRC1T0', 'ADCV'),
03579     ('LHKT6TKRC1T1ST', 'ADCS'),
03580     ('LHKT6TKRC1T1', 'ADCV'),
03581     ('LHKT6TKRC2T0ST', 'ADCS'),
03582     ('LHKT6TKRC2T0', 'ADCV'),
03583     ('LHKT6TKRC2T1ST', 'ADCS'),
03584     ('LHKT6TKRC2T1', 'ADCV'),
03585     ('LHKT6TKRC3T0ST', 'ADCS'),
03586     ('LHKT6TKRC3T0', 'ADCV'),
03587     ('LHKT6TKRC3T1ST', 'ADCS'),
03588     ('LHKT6TKRC3T1', 'ADCV'),
03589     ('LHKT6TKRC4T0ST', 'ADCS'),
03590     ('LHKT6TKRC4T0', 'ADCV'),
03591     ('LHKT6TKRC4T1ST', 'ADCS'),
03592     ('LHKT6TKRC4T1', 'ADCV'),
03593     ('LHKT6TKRC5T0ST', 'ADCS'),
03594     ('LHKT6TKRC5T0', 'ADCV'),
03595     ('LHKT6TKRC5T1ST', 'ADCS'),
03596     ('LHKT6TKRC5T1', 'ADCV'),
03597     ('LHKT6TKRC6T0ST', 'ADCS'),
03598     ('LHKT6TKRC6T0', 'ADCV'),
03599     ('LHKT6TKRC6T1ST', 'ADCS'),
03600     ('LHKT6TKRC6T1', 'ADCV'),
03601     ('LHKT6TKRC7T0ST', 'ADCS'),
03602     ('LHKT6TKRC7T0', 'ADCV'),
03603     ('LHKT6TKRC7T1ST', 'ADCS'),
03604     ('LHKT6TKRC7T1', 'ADCV'),
03605     ('LHKT7CALAF0T0ST', 'ADCS'),
03606     ('LHKT7CALAF0T0', 'ADCV'),
03607     ('LHKT7CALAF0T1ST', 'ADCS'),
03608     ('LHKT7CALAF0T1', 'ADCV'),
03609     ('LHKT7CALAF1T0ST', 'ADCS'),
03610     ('LHKT7CALAF1T0', 'ADCV'),
03611     ('LHKT7CALAF1T1ST', 'ADCS'),
03612     ('LHKT7CALAF1T1', 'ADCV'),
03613     ('LHKT7CALAF2T0ST', 'ADCS'),
03614     ('LHKT7CALAF2T0', 'ADCV'),
03615     ('LHKT7CALAF2T1ST', 'ADCS'),
03616     ('LHKT7CALAF2T1', 'ADCV'),
03617     ('LHKT7CALAF3T0ST', 'ADCS'),
03618     ('LHKT7CALAF3T0', 'ADCV'),
03619     ('LHKT7CALAF3T1ST', 'ADCS'),
03620     ('LHKT7CALAF3T1', 'ADCV'),
03621     ('LHKT7TKRC0T0ST', 'ADCS'),
03622     ('LHKT7TKRC0T0', 'ADCV'),
03623     ('LHKT7TKRC0T1ST', 'ADCS'),
03624     ('LHKT7TKRC0T1', 'ADCV'),
03625     ('LHKT7TKRC1T0ST', 'ADCS'),
03626     ('LHKT7TKRC1T0', 'ADCV'),
03627     ('LHKT7TKRC1T1ST', 'ADCS'),
03628     ('LHKT7TKRC1T1', 'ADCV'),
03629     ('LHKT7TKRC2T0ST', 'ADCS'),
03630     ('LHKT7TKRC2T0', 'ADCV'),
03631     ('LHKT7TKRC2T1ST', 'ADCS'),
03632     ('LHKT7TKRC2T1', 'ADCV'),
03633     ('LHKT7TKRC3T0ST', 'ADCS'),
03634     ('LHKT7TKRC3T0', 'ADCV'),
03635     ('LHKT7TKRC3T1ST', 'ADCS'),
03636     ('LHKT7TKRC3T1', 'ADCV'),
03637     ('LHKT7TKRC4T0ST', 'ADCS'),
03638     ('LHKT7TKRC4T0', 'ADCV'),
03639     ('LHKT7TKRC4T1ST', 'ADCS'),
03640     ('LHKT7TKRC4T1', 'ADCV'),
03641     ('LHKT7TKRC5T0ST', 'ADCS'),
03642     ('LHKT7TKRC5T0', 'ADCV'),
03643     ('LHKT7TKRC5T1ST', 'ADCS'),
03644     ('LHKT7TKRC5T1', 'ADCV'),
03645     ('LHKT7TKRC6T0ST', 'ADCS'),
03646     ('LHKT7TKRC6T0', 'ADCV'),
03647     ('LHKT7TKRC6T1ST', 'ADCS'),
03648     ('LHKT7TKRC6T1', 'ADCV'),
03649     ('LHKT7TKRC7T0ST', 'ADCS'),
03650     ('LHKT7TKRC7T0', 'ADCV'),
03651     ('LHKT7TKRC7T1ST', 'ADCS'),
03652     ('LHKT7TKRC7T1', 'ADCV'),
03653     ]
03654   def __init__(self, ui):
03655     HskPacket.__init__(self, ui)
03656     self.name  = "DiagTemEnvTemp3"
03657     self.brief = "Diagnostic TEM Temperature Packet 3"
03658     self.descr = "Contains temperature specific ADC values for TEMs 6 and 7."
03659     self.read()
03660
03661
03662 class HskPacket27a(HskPacket):
03663   mnemList = [
03664     ('LHKSPARE08', 'TSP8'),
03665     ('LHKSPARE08', 'TSP8'),
03666     ('LHKSPARE08', 'TSP8'),
03667     ('LHKSPARE08', 'TSP8'),
03668     ('LHKSPARE08', 'TSP8'),
03669     ('LHKSPARE08', 'TSP8'),
03670     ('LHKT8CALAF0T0ST', 'ADCS'),
03671     ('LHKT8CALAF0T0', 'ADCV'),
03672     ('LHKT8CALAF0T1ST', 'ADCS'),
03673     ('LHKT8CALAF0T1', 'ADCV'),
03674     ('LHKT8CALAF1T0ST', 'ADCS'),
03675     ('LHKT8CALAF1T0', 'ADCV'),
03676     ('LHKT8CALAF1T1ST', 'ADCS'),
03677     ('LHKT8CALAF1T1', 'ADCV'),
03678     ('LHKT8CALAF2T0ST', 'ADCS'),
03679     ('LHKT8CALAF2T0', 'ADCV'),
03680     ('LHKT8CALAF2T1ST', 'ADCS'),
03681     ('LHKT8CALAF2T1', 'ADCV'),
03682     ('LHKT8CALAF3T0ST', 'ADCS'),
03683     ('LHKT8CALAF3T0', 'ADCV'),
03684     ('LHKT8CALAF3T1ST', 'ADCS'),
03685     ('LHKT8CALAF3T1', 'ADCV'),
03686     ('LHKT8TKRC0T0ST', 'ADCS'),
03687     ('LHKT8TKRC0T0', 'ADCV'),
03688     ('LHKT8TKRC0T1ST', 'ADCS'),
03689     ('LHKT8TKRC0T1', 'ADCV'),
03690     ('LHKT8TKRC1T0ST', 'ADCS'),
03691     ('LHKT8TKRC1T0', 'ADCV'),
03692     ('LHKT8TKRC1T1ST', 'ADCS'),
03693     ('LHKT8TKRC1T1', 'ADCV'),
03694     ('LHKT8TKRC2T0ST', 'ADCS'),
03695     ('LHKT8TKRC2T0', 'ADCV'),
03696     ('LHKT8TKRC2T1ST', 'ADCS'),
03697     ('LHKT8TKRC2T1', 'ADCV'),
03698     ('LHKT8TKRC3T0ST', 'ADCS'),
03699     ('LHKT8TKRC3T0', 'ADCV'),
03700     ('LHKT8TKRC3T1ST', 'ADCS'),
03701     ('LHKT8TKRC3T1', 'ADCV'),
03702     ('LHKT8TKRC4T0ST', 'ADCS'),
03703     ('LHKT8TKRC4T0', 'ADCV'),
03704     ('LHKT8TKRC4T1ST', 'ADCS'),
03705     ('LHKT8TKRC4T1', 'ADCV'),
03706     ('LHKT8TKRC5T0ST', 'ADCS'),
03707     ('LHKT8TKRC5T0', 'ADCV'),
03708     ('LHKT8TKRC5T1ST', 'ADCS'),
03709     ('LHKT8TKRC5T1', 'ADCV'),
03710     ('LHKT8TKRC6T0ST', 'ADCS'),
03711     ('LHKT8TKRC6T0', 'ADCV'),
03712     ('LHKT8TKRC6T1ST', 'ADCS'),
03713     ('LHKT8TKRC6T1', 'ADCV'),
03714     ('LHKT8TKRC7T0ST', 'ADCS'),
03715     ('LHKT8TKRC7T0', 'ADCV'),
03716     ('LHKT8TKRC7T1ST', 'ADCS'),
03717     ('LHKT8TKRC7T1', 'ADCV'),
03718     ('LHKT9CALAF0T0ST', 'ADCS'),
03719     ('LHKT9CALAF0T0', 'ADCV'),
03720     ('LHKT9CALAF0T1ST', 'ADCS'),
03721     ('LHKT9CALAF0T1', 'ADCV'),
03722     ('LHKT9CALAF1T0ST', 'ADCS'),
03723     ('LHKT9CALAF1T0', 'ADCV'),
03724     ('LHKT9CALAF1T1ST', 'ADCS'),
03725     ('LHKT9CALAF1T1', 'ADCV'),
03726     ('LHKT9CALAF2T0ST', 'ADCS'),
03727     ('LHKT9CALAF2T0', 'ADCV'),
03728     ('LHKT9CALAF2T1ST', 'ADCS'),
03729     ('LHKT9CALAF2T1', 'ADCV'),
03730     ('LHKT9CALAF3T0ST', 'ADCS'),
03731     ('LHKT9CALAF3T0', 'ADCV'),
03732     ('LHKT9CALAF3T1ST', 'ADCS'),
03733     ('LHKT9CALAF3T1', 'ADCV'),
03734     ('LHKT9TKRC0T0ST', 'ADCS'),
03735     ('LHKT9TKRC0T0', 'ADCV'),
03736     ('LHKT9TKRC0T1ST', 'ADCS'),
03737     ('LHKT9TKRC0T1', 'ADCV'),
03738     ('LHKT9TKRC1T0ST', 'ADCS'),
03739     ('LHKT9TKRC1T0', 'ADCV'),
03740     ('LHKT9TKRC1T1ST', 'ADCS'),
03741     ('LHKT9TKRC1T1', 'ADCV'),
03742     ('LHKT9TKRC2T0ST', 'ADCS'),
03743     ('LHKT9TKRC2T0', 'ADCV'),
03744     ('LHKT9TKRC2T1ST', 'ADCS'),
03745     ('LHKT9TKRC2T1', 'ADCV'),
03746     ('LHKT9TKRC3T0ST', 'ADCS'),
03747     ('LHKT9TKRC3T0', 'ADCV'),
03748     ('LHKT9TKRC3T1ST', 'ADCS'),
03749     ('LHKT9TKRC3T1', 'ADCV'),
03750     ('LHKT9TKRC4T0ST', 'ADCS'),
03751     ('LHKT9TKRC4T0', 'ADCV'),
03752     ('LHKT9TKRC4T1ST', 'ADCS'),
03753     ('LHKT9TKRC4T1', 'ADCV'),
03754     ('LHKT9TKRC5T0ST', 'ADCS'),
03755     ('LHKT9TKRC5T0', 'ADCV'),
03756     ('LHKT9TKRC5T1ST', 'ADCS'),
03757     ('LHKT9TKRC5T1', 'ADCV'),
03758     ('LHKT9TKRC6T0ST', 'ADCS'),
03759     ('LHKT9TKRC6T0', 'ADCV'),
03760     ('LHKT9TKRC6T1ST', 'ADCS'),
03761     ('LHKT9TKRC6T1', 'ADCV'),
03762     ('LHKT9TKRC7T0ST', 'ADCS'),
03763     ('LHKT9TKRC7T0', 'ADCV'),
03764     ('LHKT9TKRC7T1ST', 'ADCS'),
03765     ('LHKT9TKRC7T1', 'ADCV'),
03766     ]
03767   def __init__(self, ui):
03768     HskPacket.__init__(self, ui)
03769     self.name  = "DiagTemEnvTemp4"
03770     self.brief = "Diagnostic TEM Temperature Packet 4"
03771     self.descr = "Contains temperature specific ADC values for TEMs 8 and 9."
03772     self.read()
03773
03774
03775 class HskPacket27b(HskPacket):
03776   mnemList = [
03777     ('LHKSPARE08', 'TSP8'),
03778     ('LHKSPARE08', 'TSP8'),
03779     ('LHKSPARE08', 'TSP8'),
03780     ('LHKSPARE08', 'TSP8'),
03781     ('LHKSPARE08', 'TSP8'),
03782     ('LHKSPARE08', 'TSP8'),
03783     ('LHKTACALAF0T0ST', 'ADCS'),
03784     ('LHKTACALAF0T0', 'ADCV'),
03785     ('LHKTACALAF0T1ST', 'ADCS'),
03786     ('LHKTACALAF0T1', 'ADCV'),
03787     ('LHKTACALAF1T0ST', 'ADCS'),
03788     ('LHKTACALAF1T0', 'ADCV'),
03789     ('LHKTACALAF1T1ST', 'ADCS'),
03790     ('LHKTACALAF1T1', 'ADCV'),
03791     ('LHKTACALAF2T0ST', 'ADCS'),
03792     ('LHKTACALAF2T0', 'ADCV'),
03793     ('LHKTACALAF2T1ST', 'ADCS'),
03794     ('LHKTACALAF2T1', 'ADCV'),
03795     ('LHKTACALAF3T0ST', 'ADCS'),
03796     ('LHKTACALAF3T0', 'ADCV'),
03797     ('LHKTACALAF3T1ST', 'ADCS'),
03798     ('LHKTACALAF3T1', 'ADCV'),
03799     ('LHKTATKRC0T0ST', 'ADCS'),
03800     ('LHKTATKRC0T0', 'ADCV'),
03801     ('LHKTATKRC0T1ST', 'ADCS'),
03802     ('LHKTATKRC0T1', 'ADCV'),
03803     ('LHKTATKRC1T0ST', 'ADCS'),
03804     ('LHKTATKRC1T0', 'ADCV'),
03805     ('LHKTATKRC1T1ST', 'ADCS'),
03806     ('LHKTATKRC1T1', 'ADCV'),
03807     ('LHKTATKRC2T0ST', 'ADCS'),
03808     ('LHKTATKRC2T0', 'ADCV'),
03809     ('LHKTATKRC2T1ST', 'ADCS'),
03810     ('LHKTATKRC2T1', 'ADCV'),
03811     ('LHKTATKRC3T0ST', 'ADCS'),
03812     ('LHKTATKRC3T0', 'ADCV'),
03813     ('LHKTATKRC3T1ST', 'ADCS'),
03814     ('LHKTATKRC3T1', 'ADCV'),
03815     ('LHKTATKRC4T0ST', 'ADCS'),
03816     ('LHKTATKRC4T0', 'ADCV'),
03817     ('LHKTATKRC4T1ST', 'ADCS'),
03818     ('LHKTATKRC4T1', 'ADCV'),
03819     ('LHKTATKRC5T0ST', 'ADCS'),
03820     ('LHKTATKRC5T0', 'ADCV'),
03821     ('LHKTATKRC5T1ST', 'ADCS'),
03822     ('LHKTATKRC5T1', 'ADCV'),
03823     ('LHKTATKRC6T0ST', 'ADCS'),
03824     ('LHKTATKRC6T0', 'ADCV'),
03825     ('LHKTATKRC6T1ST', 'ADCS'),
03826     ('LHKTATKRC6T1', 'ADCV'),
03827     ('LHKTATKRC7T0ST', 'ADCS'),
03828     ('LHKTATKRC7T0', 'ADCV'),
03829     ('LHKTATKRC7T1ST', 'ADCS'),
03830     ('LHKTATKRC7T1', 'ADCV'),
03831     ('LHKTBCALAF0T0ST', 'ADCS'),
03832     ('LHKTBCALAF0T0', 'ADCV'),
03833     ('LHKTBCALAF0T1ST', 'ADCS'),
03834     ('LHKTBCALAF0T1', 'ADCV'),
03835     ('LHKTBCALAF1T0ST', 'ADCS'),
03836     ('LHKTBCALAF1T0', 'ADCV'),
03837     ('LHKTBCALAF1T1ST', 'ADCS'),
03838     ('LHKTBCALAF1T1', 'ADCV'),
03839     ('LHKTBCALAF2T0ST', 'ADCS'),
03840     ('LHKTBCALAF2T0', 'ADCV'),
03841     ('LHKTBCALAF2T1ST', 'ADCS'),
03842     ('LHKTBCALAF2T1', 'ADCV'),
03843     ('LHKTBCALAF3T0ST', 'ADCS'),
03844     ('LHKTBCALAF3T0', 'ADCV'),
03845     ('LHKTBCALAF3T1ST', 'ADCS'),
03846     ('LHKTBCALAF3T1', 'ADCV'),
03847     ('LHKTBTKRC0T0ST', 'ADCS'),
03848     ('LHKTBTKRC0T0', 'ADCV'),
03849     ('LHKTBTKRC0T1ST', 'ADCS'),
03850     ('LHKTBTKRC0T1', 'ADCV'),
03851     ('LHKTBTKRC1T0ST', 'ADCS'),
03852     ('LHKTBTKRC1T0', 'ADCV'),
03853     ('LHKTBTKRC1T1ST', 'ADCS'),
03854     ('LHKTBTKRC1T1', 'ADCV'),
03855     ('LHKTBTKRC2T0ST', 'ADCS'),
03856     ('LHKTBTKRC2T0', 'ADCV'),
03857     ('LHKTBTKRC2T1ST', 'ADCS'),
03858     ('LHKTBTKRC2T1', 'ADCV'),
03859     ('LHKTBTKRC3T0ST', 'ADCS'),
03860     ('LHKTBTKRC3T0', 'ADCV'),
03861     ('LHKTBTKRC3T1ST', 'ADCS'),
03862     ('LHKTBTKRC3T1', 'ADCV'),
03863     ('LHKTBTKRC4T0ST', 'ADCS'),
03864     ('LHKTBTKRC4T0', 'ADCV'),
03865     ('LHKTBTKRC4T1ST', 'ADCS'),
03866     ('LHKTBTKRC4T1', 'ADCV'),
03867     ('LHKTBTKRC5T0ST', 'ADCS'),
03868     ('LHKTBTKRC5T0', 'ADCV'),
03869     ('LHKTBTKRC5T1ST', 'ADCS'),
03870     ('LHKTBTKRC5T1', 'ADCV'),
03871     ('LHKTBTKRC6T0ST', 'ADCS'),
03872     ('LHKTBTKRC6T0', 'ADCV'),
03873     ('LHKTBTKRC6T1ST', 'ADCS'),
03874     ('LHKTBTKRC6T1', 'ADCV'),
03875     ('LHKTBTKRC7T0ST', 'ADCS'),
03876     ('LHKTBTKRC7T0', 'ADCV'),
03877     ('LHKTBTKRC7T1ST', 'ADCS'),
03878     ('LHKTBTKRC7T1', 'ADCV'),
03879     ]
03880   def __init__(self, ui):
03881     HskPacket.__init__(self, ui)
03882     self.name  = "DiagTemEnvTemp5"
03883     self.brief = "Diagnostic TEM Temperature Packet 5"
03884     self.descr = "Contains temperature specific ADC values for TEMs A and B."
03885     self.read()
03886
03887
03888 class HskPacket27c(HskPacket):
03889   mnemList = [
03890     ('LHKSPARE08', 'TSP8'),
03891     ('LHKSPARE08', 'TSP8'),
03892     ('LHKSPARE08', 'TSP8'),
03893     ('LHKSPARE08', 'TSP8'),
03894     ('LHKSPARE08', 'TSP8'),
03895     ('LHKSPARE08', 'TSP8'),
03896     ('LHKTCCALAF0T0ST', 'ADCS'),
03897     ('LHKTCCALAF0T0', 'ADCV'),
03898     ('LHKTCCALAF0T1ST', 'ADCS'),
03899     ('LHKTCCALAF0T1', 'ADCV'),
03900     ('LHKTCCALAF1T0ST', 'ADCS'),
03901     ('LHKTCCALAF1T0', 'ADCV'),
03902     ('LHKTCCALAF1T1ST', 'ADCS'),
03903     ('LHKTCCALAF1T1', 'ADCV'),
03904     ('LHKTCCALAF2T0ST', 'ADCS'),
03905     ('LHKTCCALAF2T0', 'ADCV'),
03906     ('LHKTCCALAF2T1ST', 'ADCS'),
03907     ('LHKTCCALAF2T1', 'ADCV'),
03908     ('LHKTCCALAF3T0ST', 'ADCS'),
03909     ('LHKTCCALAF3T0', 'ADCV'),
03910     ('LHKTCCALAF3T1ST', 'ADCS'),
03911     ('LHKTCCALAF3T1', 'ADCV'),
03912     ('LHKTCTKRC0T0ST', 'ADCS'),
03913     ('LHKTCTKRC0T0', 'ADCV'),
03914     ('LHKTCTKRC0T1ST', 'ADCS'),
03915     ('LHKTCTKRC0T1', 'ADCV'),
03916     ('LHKTCTKRC1T0ST', 'ADCS'),
03917     ('LHKTCTKRC1T0', 'ADCV'),
03918     ('LHKTCTKRC1T1ST', 'ADCS'),
03919     ('LHKTCTKRC1T1', 'ADCV'),
03920     ('LHKTCTKRC2T0ST', 'ADCS'),
03921     ('LHKTCTKRC2T0', 'ADCV'),
03922     ('LHKTCTKRC2T1ST', 'ADCS'),
03923     ('LHKTCTKRC2T1', 'ADCV'),
03924     ('LHKTCTKRC3T0ST', 'ADCS'),
03925     ('LHKTCTKRC3T0', 'ADCV'),
03926     ('LHKTCTKRC3T1ST', 'ADCS'),
03927     ('LHKTCTKRC3T1', 'ADCV'),
03928     ('LHKTCTKRC4T0ST', 'ADCS'),
03929     ('LHKTCTKRC4T0', 'ADCV'),
03930     ('LHKTCTKRC4T1ST', 'ADCS'),
03931     ('LHKTCTKRC4T1', 'ADCV'),
03932     ('LHKTCTKRC5T0ST', 'ADCS'),
03933     ('LHKTCTKRC5T0', 'ADCV'),
03934     ('LHKTCTKRC5T1ST', 'ADCS'),
03935     ('LHKTCTKRC5T1', 'ADCV'),
03936     ('LHKTCTKRC6T0ST', 'ADCS'),
03937     ('LHKTCTKRC6T0', 'ADCV'),
03938     ('LHKTCTKRC6T1ST', 'ADCS'),
03939     ('LHKTCTKRC6T1', 'ADCV'),
03940     ('LHKTCTKRC7T0ST', 'ADCS'),
03941     ('LHKTCTKRC7T0', 'ADCV'),
03942     ('LHKTCTKRC7T1ST', 'ADCS'),
03943     ('LHKTCTKRC7T1', 'ADCV'),
03944     ('LHKTDCALAF0T0ST', 'ADCS'),
03945     ('LHKTDCALAF0T0', 'ADCV'),
03946     ('LHKTDCALAF0T1ST', 'ADCS'),
03947     ('LHKTDCALAF0T1', 'ADCV'),
03948     ('LHKTDCALAF1T0ST', 'ADCS'),
03949     ('LHKTDCALAF1T0', 'ADCV'),
03950     ('LHKTDCALAF1T1ST', 'ADCS'),
03951     ('LHKTDCALAF1T1', 'ADCV'),
03952     ('LHKTDCALAF2T0ST', 'ADCS'),
03953     ('LHKTDCALAF2T0', 'ADCV'),
03954     ('LHKTDCALAF2T1ST', 'ADCS'),
03955     ('LHKTDCALAF2T1', 'ADCV'),
03956     ('LHKTDCALAF3T0ST', 'ADCS'),
03957     ('LHKTDCALAF3T0', 'ADCV'),
03958     ('LHKTDCALAF3T1ST', 'ADCS'),
03959     ('LHKTDCALAF3T1', 'ADCV'),
03960     ('LHKTDTKRC0T0ST', 'ADCS'),
03961     ('LHKTDTKRC0T0', 'ADCV'),
03962     ('LHKTDTKRC0T1ST', 'ADCS'),
03963     ('LHKTDTKRC0T1', 'ADCV'),
03964     ('LHKTDTKRC1T0ST', 'ADCS'),
03965     ('LHKTDTKRC1T0', 'ADCV'),
03966     ('LHKTDTKRC1T1ST', 'ADCS'),
03967     ('LHKTDTKRC1T1', 'ADCV'),
03968     ('LHKTDTKRC2T0ST', 'ADCS'),
03969     ('LHKTDTKRC2T0', 'ADCV'),
03970     ('LHKTDTKRC2T1ST', 'ADCS'),
03971     ('LHKTDTKRC2T1', 'ADCV'),
03972     ('LHKTDTKRC3T0ST', 'ADCS'),
03973     ('LHKTDTKRC3T0', 'ADCV'),
03974     ('LHKTDTKRC3T1ST', 'ADCS'),
03975     ('LHKTDTKRC3T1', 'ADCV'),
03976     ('LHKTDTKRC4T0ST', 'ADCS'),
03977     ('LHKTDTKRC4T0', 'ADCV'),
03978     ('LHKTDTKRC4T1ST', 'ADCS'),
03979     ('LHKTDTKRC4T1', 'ADCV'),
03980     ('LHKTDTKRC5T0ST', 'ADCS'),
03981     ('LHKTDTKRC5T0', 'ADCV'),
03982     ('LHKTDTKRC5T1ST', 'ADCS'),
03983     ('LHKTDTKRC5T1', 'ADCV'),
03984     ('LHKTDTKRC6T0ST', 'ADCS'),
03985     ('LHKTDTKRC6T0', 'ADCV'),
03986     ('LHKTDTKRC6T1ST', 'ADCS'),
03987     ('LHKTDTKRC6T1', 'ADCV'),
03988     ('LHKTDTKRC7T0ST', 'ADCS'),
03989     ('LHKTDTKRC7T0', 'ADCV'),
03990     ('LHKTDTKRC7T1ST', 'ADCS'),
03991     ('LHKTDTKRC7T1', 'ADCV'),
03992     ]
03993   def __init__(self, ui):
03994     HskPacket.__init__(self, ui)
03995     self.name  = "DiagTemEnvTemp6"
03996     self.brief = "Diagnostic TEM Temperature Packet 6"
03997     self.descr = "Contains temperature specific ADC values for TEMs C and D."
03998     self.read()
03999
04000
04001 class HskPacket27d(HskPacket):
04002   mnemList = [
04003     ('LHKSPARE08', 'TSP8'),
04004     ('LHKSPARE08', 'TSP8'),
04005     ('LHKSPARE08', 'TSP8'),
04006     ('LHKSPARE08', 'TSP8'),
04007     ('LHKSPARE08', 'TSP8'),
04008     ('LHKSPARE08', 'TSP8'),
04009     ('LHKTECALAF0T0ST', 'ADCS'),
04010     ('LHKTECALAF0T0', 'ADCV'),
04011     ('LHKTECALAF0T1ST', 'ADCS'),
04012     ('LHKTECALAF0T1', 'ADCV'),
04013     ('LHKTECALAF1T0ST', 'ADCS'),
04014     ('LHKTECALAF1T0', 'ADCV'),
04015     ('LHKTECALAF1T1ST', 'ADCS'),
04016     ('LHKTECALAF1T1', 'ADCV'),
04017     ('LHKTECALAF2T0ST', 'ADCS'),
04018     ('LHKTECALAF2T0', 'ADCV'),
04019     ('LHKTECALAF2T1ST', 'ADCS'),
04020     ('LHKTECALAF2T1', 'ADCV'),
04021     ('LHKTECALAF3T0ST', 'ADCS'),
04022     ('LHKTECALAF3T0', 'ADCV'),
04023     ('LHKTECALAF3T1ST', 'ADCS'),
04024     ('LHKTECALAF3T1', 'ADCV'),
04025     ('LHKTETKRC0T0ST', 'ADCS'),
04026     ('LHKTETKRC0T0', 'ADCV'),
04027     ('LHKTETKRC0T1ST', 'ADCS'),
04028     ('LHKTETKRC0T1', 'ADCV'),
04029     ('LHKTETKRC1T0ST', 'ADCS'),
04030     ('LHKTETKRC1T0', 'ADCV'),
04031     ('LHKTETKRC1T1ST', 'ADCS'),
04032     ('LHKTETKRC1T1', 'ADCV'),
04033     ('LHKTETKRC2T0ST', 'ADCS'),
04034     ('LHKTETKRC2T0', 'ADCV'),
04035     ('LHKTETKRC2T1ST', 'ADCS'),
04036     ('LHKTETKRC2T1', 'ADCV'),
04037     ('LHKTETKRC3T0ST', 'ADCS'),
04038     ('LHKTETKRC3T0', 'ADCV'),
04039     ('LHKTETKRC3T1ST', 'ADCS'),
04040     ('LHKTETKRC3T1', 'ADCV'),
04041     ('LHKTETKRC4T0ST', 'ADCS'),
04042     ('LHKTETKRC4T0', 'ADCV'),
04043     ('LHKTETKRC4T1ST', 'ADCS'),
04044     ('LHKTETKRC4T1', 'ADCV'),
04045     ('LHKTETKRC5T0ST', 'ADCS'),
04046     ('LHKTETKRC5T0', 'ADCV'),
04047     ('LHKTETKRC5T1ST', 'ADCS'),
04048     ('LHKTETKRC5T1', 'ADCV'),
04049     ('LHKTETKRC6T0ST', 'ADCS'),
04050     ('LHKTETKRC6T0', 'ADCV'),
04051     ('LHKTETKRC6T1ST', 'ADCS'),
04052     ('LHKTETKRC6T1', 'ADCV'),
04053     ('LHKTETKRC7T0ST', 'ADCS'),
04054     ('LHKTETKRC7T0', 'ADCV'),
04055     ('LHKTETKRC7T1ST', 'ADCS'),
04056     ('LHKTETKRC7T1', 'ADCV'),
04057     ('LHKTFCALAF0T0ST', 'ADCS'),
04058     ('LHKTFCALAF0T0', 'ADCV'),
04059     ('LHKTFCALAF0T1ST', 'ADCS'),
04060     ('LHKTFCALAF0T1', 'ADCV'),
04061     ('LHKTFCALAF1T0ST', 'ADCS'),
04062     ('LHKTFCALAF1T0', 'ADCV'),
04063     ('LHKTFCALAF1T1ST', 'ADCS'),
04064     ('LHKTFCALAF1T1', 'ADCV'),
04065     ('LHKTFCALAF2T0ST', 'ADCS'),
04066     ('LHKTFCALAF2T0', 'ADCV'),
04067     ('LHKTFCALAF2T1ST', 'ADCS'),
04068     ('LHKTFCALAF2T1', 'ADCV'),
04069     ('LHKTFCALAF3T0ST', 'ADCS'),
04070     ('LHKTFCALAF3T0', 'ADCV'),
04071     ('LHKTFCALAF3T1ST', 'ADCS'),
04072     ('LHKTFCALAF3T1', 'ADCV'),
04073     ('LHKTFTKRC0T0ST', 'ADCS'),
04074     ('LHKTFTKRC0T0', 'ADCV'),
04075     ('LHKTFTKRC0T1ST', 'ADCS'),
04076     ('LHKTFTKRC0T1', 'ADCV'),
04077     ('LHKTFTKRC1T0ST', 'ADCS'),
04078     ('LHKTFTKRC1T0', 'ADCV'),
04079     ('LHKTFTKRC1T1ST', 'ADCS'),
04080     ('LHKTFTKRC1T1', 'ADCV'),
04081     ('LHKTFTKRC2T0ST', 'ADCS'),
04082     ('LHKTFTKRC2T0', 'ADCV'),
04083     ('LHKTFTKRC2T1ST', 'ADCS'),
04084     ('LHKTFTKRC2T1', 'ADCV'),
04085     ('LHKTFTKRC3T0ST', 'ADCS'),
04086     ('LHKTFTKRC3T0', 'ADCV'),
04087     ('LHKTFTKRC3T1ST', 'ADCS'),
04088     ('LHKTFTKRC3T1', 'ADCV'),
04089     ('LHKTFTKRC4T0ST', 'ADCS'),
04090     ('LHKTFTKRC4T0', 'ADCV'),
04091     ('LHKTFTKRC4T1ST', 'ADCS'),
04092     ('LHKTFTKRC4T1', 'ADCV'),
04093     ('LHKTFTKRC5T0ST', 'ADCS'),
04094     ('LHKTFTKRC5T0', 'ADCV'),
04095     ('LHKTFTKRC5T1ST', 'ADCS'),
04096     ('LHKTFTKRC5T1', 'ADCV'),
04097     ('LHKTFTKRC6T0ST', 'ADCS'),
04098     ('LHKTFTKRC6T0', 'ADCV'),
04099     ('LHKTFTKRC6T1ST', 'ADCS'),
04100     ('LHKTFTKRC6T1', 'ADCV'),
04101     ('LHKTFTKRC7T0ST', 'ADCS'),
04102     ('LHKTFTKRC7T0', 'ADCV'),
04103     ('LHKTFTKRC7T1ST', 'ADCS'),
04104     ('LHKTFTKRC7T1', 'ADCV'),
04105     ]
04106   def __init__(self, ui):
04107     HskPacket.__init__(self, ui)
04108     self.name  = "DiagTemEnvTemp7"
04109     self.brief = "Diagnostic TEM Temperature Packet 7"
04110     self.descr = "Contains temperature specific ADC values for TEMs E and F."
04111     self.read()
04112
04113
04114 class HskPacket27e(HskPacket):
04115   mnemList = [
04116     ('LHKSPARE08', 'TSP8'),
04117     ('LHKSPARE08', 'TSP8'),
04118     ('LHKSPARE08', 'TSP8'),
04119     ('LHKSPARE08', 'TSP8'),
04120     ('LHKSPARE08', 'TSP8'),
04121     ('LHKSPARE08', 'TSP8'),
04122     ('LHKP0TEMFPM', 'PDUTEMPWRST'),
04123     ('LHKP0TEMEPM', 'PDUTEMPWRST'),
04124     ('LHKP0TEMDPM', 'PDUTEMPWRST'),
04125     ('LHKP0TEMCPM', 'PDUTEMPWRST'),
04126     ('LHKP0TEMBPM', 'PDUTEMPWRST'),
04127     ('LHKP0TEMAPM', 'PDUTEMPWRST'),
04128     ('LHKP0TEM9PM', 'PDUTEMPWRST'),
04129     ('LHKP0TEM8PM', 'PDUTEMPWRST'),
04130     ('LHKP0TEM7PM', 'PDUTEMPWRST'),
04131     ('LHKP0TEM6PM', 'PDUTEMPWRST'),
04132     ('LHKP0TEM5PM', 'PDUTEMPWRST'),
04133     ('LHKP0TEM4PM', 'PDUTEMPWRST'),
04134     ('LHKP0TEM3PM', 'PDUTEMPWRST'),
04135     ('LHKP0TEM2PM', 'PDUTEMPWRST'),
04136     ('LHKP0TEM1PM', 'PDUTEMPWRST'),
04137     ('LHKP0TEM0PM', 'PDUTEMPWRST'),
04138     ('LHKSPARE10', 'TSP10'),
04139     ('LHKP0EPU2CNVT', 'PDUEPUCVTST'),
04140     ('LHKP0EPU1CNVT', 'PDUEPUCVTST'),
04141     ('LHKP0EPU0CNVT', 'PDUEPUCVTST'),
04142     ('LHKP0EPU2PM', 'PDUEPUPWRST'),
04143     ('LHKP0EPU1PM', 'PDUEPUPWRST'),
04144     ('LHKP0EPU0PM', 'PDUEPUPWRST'),
04145     ('LHKSPARE13', 'TSP13'),
04146     ('LHKP0ACDCNVT', 'PDUACDCNVT'),
04147     ('LHKP0ACDPSP', 'PDUACDPWRSUP'),
04148     ('LHKP0ACDPM', 'PDUACDPWRST'),
04149     ('LHKP0TEM033VST', 'ADCS'),
04150     ('LHKP0TEM033V', 'ADCV'),
04151     ('LHKP0TEM133VST', 'ADCS'),
04152     ('LHKP0TEM133V', 'ADCV'),
04153     ('LHKP0TEM233VST', 'ADCS'),
04154     ('LHKP0TEM233V', 'ADCV'),
04155     ('LHKP0TEM333VST', 'ADCS'),
04156     ('LHKP0TEM333V', 'ADCV'),
04157     ('LHKP0TEM433VST', 'ADCS'),
04158     ('LHKP0TEM433V', 'ADCV'),
04159     ('LHKP0TEM533VST', 'ADCS'),
04160     ('LHKP0TEM533V', 'ADCV'),
04161     ('LHKP0TEM633VST', 'ADCS'),
04162     ('LHKP0TEM633V', 'ADCV'),
04163     ('LHKP0TEM733VST', 'ADCS'),
04164     ('LHKP0TEM733V', 'ADCV'),
04165     ('LHKP0TEM833VST', 'ADCS'),
04166     ('LHKP0TEM833V', 'ADCV'),
04167     ('LHKP0TEM933VST', 'ADCS'),
04168     ('LHKP0TEM933V', 'ADCV'),
04169     ('LHKP0TEMA33VST', 'ADCS'),
04170     ('LHKP0TEMA33V', 'ADCV'),
04171     ('LHKP0TEMB33VST', 'ADCS'),
04172     ('LHKP0TEMB33V', 'ADCV'),
04173     ('LHKP0TEMC33VST', 'ADCS'),
04174     ('LHKP0TEMC33V', 'ADCV'),
04175     ('LHKP0TEMD33VST', 'ADCS'),
04176     ('LHKP0TEMD33V', 'ADCV'),
04177     ('LHKP0TEME33VST', 'ADCS'),
04178     ('LHKP0TEME33V', 'ADCV'),
04179     ('LHKP0TEMF33VST', 'ADCS'),
04180     ('LHKP0TEMF33V', 'ADCV'),
04181     ('LHKP0TEM0PCTST', 'ADCS'),
04182     ('LHKP0TEM0PCT', 'ADCV'),
04183     ('LHKP0TEM1PCTST', 'ADCS'),
04184     ('LHKP0TEM1PCT', 'ADCV'),
04185     ('LHKP0TEM2PCTST', 'ADCS'),
04186     ('LHKP0TEM2PCT', 'ADCV'),
04187     ('LHKP0TEM3PCTST', 'ADCS'),
04188     ('LHKP0TEM3PCT', 'ADCV'),
04189     ('LHKP0TEM4PCTST', 'ADCS'),
04190     ('LHKP0TEM4PCT', 'ADCV'),
04191     ('LHKP0TEM5PCTST', 'ADCS'),
04192     ('LHKP0TEM5PCT', 'ADCV'),
04193     ('LHKP0TEM6PCTST', 'ADCS'),
04194     ('LHKP0TEM6PCT', 'ADCV'),
04195     ('LHKP0TEM7PCTST', 'ADCS'),
04196     ('LHKP0TEM7PCT', 'ADCV'),
04197     ('LHKP0TEM8PCTST', 'ADCS'),
04198     ('LHKP0TEM8PCT', 'ADCV'),
04199     ('LHKP0TEM9PCTST', 'ADCS'),
04200     ('LHKP0TEM9PCT', 'ADCV'),
04201     ('LHKP0TEMAPCTST', 'ADCS'),
04202     ('LHKP0TEMAPCT', 'ADCV'),
04203     ('LHKP0TEMBPCTST', 'ADCS'),
04204     ('LHKP0TEMBPCT', 'ADCV'),
04205     ('LHKP0TEMCPCTST', 'ADCS'),
04206     ('LHKP0TEMCPCT', 'ADCV'),
04207     ('LHKP0TEMDPCTST', 'ADCS'),
04208     ('LHKP0TEMDPCT', 'ADCV'),
04209     ('LHKP0TEMEPCTST', 'ADCS'),
04210     ('LHKP0TEMEPCT', 'ADCV'),
04211     ('LHKP0TEMFPCTST', 'ADCS'),
04212     ('LHKP0TEMFPCT', 'ADCV'),
04213     ('LHKP0EPU033VST', 'ADCS'),
04214     ('LHKP0EPU033V', 'ADCV'),
04215     ('LHKP0EPU133VST', 'ADCS'),
04216     ('LHKP0EPU133V', 'ADCV'),
04217     ('LHKP0EPU233VST', 'ADCS'),
04218     ('LHKP0EPU233V', 'ADCV'),
04219     ('LHKP0EPU0TST', 'ADCS'),
04220     ('LHKP0EPU0T', 'ADCV'),
04221     ('LHKP0EPU1TST', 'ADCS'),
04222     ('LHKP0EPU1T', 'ADCV'),
04223     ('LHKP0EPU2TST', 'ADCS'),
04224     ('LHKP0EPU2T', 'ADCV'),
04225     ('LHKAFR33ISUMST', 'ADCS'),
04226     ('LHKAFR33ISUM', 'ADCV'),
04227     ('LHKADABTEMPSTAT', 'ADCS'),
04228     ('LHKADABTEMP', 'ADCV'),
04229     ('LHKAFR28ISUMST', 'ADCS'),
04230     ('LHKAFR28ISUM', 'ADCV'),
04231     ('LHKADAB33VSTAT', 'ADCS'),
04232     ('LHKADAB33V', 'ADCV'),
04233     ('LHKSPARE08', 'TSP8'),
04234     ('LHKSPARE08', 'TSP8'),
04235     ('LHKSPARE08', 'TSP8'),
04236     ('LHKSPARE08', 'TSP8'),
04237     ('LHKSPARE08', 'TSP8'),
04238     ('LHKSPARE08', 'TSP8'),
04239     ]
04240   def __init__(self, ui):
04241     HskPacket.__init__(self, ui)
04242     self.name  = "DiagPduEnv0"
04243     self.brief = "Diagnostic PDU Environmental Packet 0"
04244     self.descr = "PDU Packet 0"
04245     self.read()
04246
04247
04248 class HskPacket27f(HskPacket):
04249   mnemList = [
04250     ('LHKSPARE08', 'TSP8'),
04251     ('LHKSPARE08', 'TSP8'),
04252     ('LHKSPARE08', 'TSP8'),
04253     ('LHKSPARE08', 'TSP8'),
04254     ('LHKSPARE08', 'TSP8'),
04255     ('LHKSPARE08', 'TSP8'),
04256     ('LHKP0TEM0PSTST', 'ADCS'),
04257     ('LHKP0TEM0PST', 'ADCV'),
04258     ('LHKP0TEM1PSTST', 'ADCS'),
04259     ('LHKP0TEM1PST', 'ADCV'),
04260     ('LHKP0TEM2PSTST', 'ADCS'),
04261     ('LHKP0TEM2PST', 'ADCV'),
04262     ('LHKP0TEM3PSTST', 'ADCS'),
04263     ('LHKP0TEM3PST', 'ADCV'),
04264     ('LHKP0TEM4PSTST', 'ADCS'),
04265     ('LHKP0TEM4PST', 'ADCV'),
04266     ('LHKP0TEM5PSTST', 'ADCS'),
04267     ('LHKP0TEM5PST', 'ADCV'),
04268     ('LHKP0TEM6PSTST', 'ADCS'),
04269     ('LHKP0TEM6PST', 'ADCV'),
04270     ('LHKP0TEM7PSTST', 'ADCS'),
04271     ('LHKP0TEM7PST', 'ADCV'),
04272     ('LHKP0TEM8PSTST', 'ADCS'),
04273     ('LHKP0TEM8PST', 'ADCV'),
04274     ('LHKP0TEM9PSTST', 'ADCS'),
04275     ('LHKP0TEM9PST', 'ADCV'),
04276     ('LHKP0TEMAPSTST', 'ADCS'),
04277     ('LHKP0TEMAPST', 'ADCV'),
04278     ('LHKP0TEMBPSTST', 'ADCS'),
04279     ('LHKP0TEMBPST', 'ADCV'),
04280     ('LHKP0TEMCPSTST', 'ADCS'),
04281     ('LHKP0TEMCPST', 'ADCV'),
04282     ('LHKP0TEMDPSTST', 'ADCS'),
04283     ('LHKP0TEMDPST', 'ADCV'),
04284     ('LHKP0TEMEPSTST', 'ADCS'),
04285     ('LHKP0TEMEPST', 'ADCV'),
04286     ('LHKP0TEMFPSTST', 'ADCS'),
04287     ('LHKP0TEMFPST', 'ADCV'),
04288     ('LHKP0CAL0BPTST', 'ADCS'),
04289     ('LHKP0CAL0BPT', 'ADCV'),
04290     ('LHKP0CAL1BPTST', 'ADCS'),
04291     ('LHKP0CAL1BPT', 'ADCV'),
04292     ('LHKP0CAL2BPTST', 'ADCS'),
04293     ('LHKP0CAL2BPT', 'ADCV'),
04294     ('LHKP0CAL3BPTST', 'ADCS'),
04295     ('LHKP0CAL3BPT', 'ADCV'),
04296     ('LHKP0CAL4BPTST', 'ADCS'),
04297     ('LHKP0CAL4BPT', 'ADCV'),
04298     ('LHKP0CAL5BPTST', 'ADCS'),
04299     ('LHKP0CAL5BPT', 'ADCV'),
04300     ('LHKP0CAL6BPTST', 'ADCS'),
04301     ('LHKP0CAL6BPT', 'ADCV'),
04302     ('LHKP0CAL7BPTST', 'ADCS'),
04303     ('LHKP0CAL7BPT', 'ADCV'),
04304     ('LHKP0CAL8BPTST', 'ADCS'),
04305     ('LHKP0CAL8BPT', 'ADCV'),
04306     ('LHKP0CAL9BPTST', 'ADCS'),
04307     ('LHKP0CAL9BPT', 'ADCV'),
04308     ('LHKP0CALABPTST', 'ADCS'),
04309     ('LHKP0CALABPT', 'ADCV'),
04310     ('LHKP0CALBBPTST', 'ADCS'),
04311     ('LHKP0CALBBPT', 'ADCV'),
04312     ('LHKP0CALCBPTST', 'ADCS'),
04313     ('LHKP0CALCBPT', 'ADCV'),
04314     ('LHKP0CALDBPTST', 'ADCS'),
04315     ('LHKP0CALDBPT', 'ADCV'),
04316     ('LHKP0CALEBPTST', 'ADCS'),
04317     ('LHKP0CALEBPT', 'ADCV'),
04318     ('LHKP0CALFBPTST', 'ADCS'),
04319     ('LHKP0CALFBPT', 'ADCV'),
04320     ('LHKSPARE08', 'TSP8'),
04321     ('LHKSPARE08', 'TSP8'),
04322     ('LHKSPARE08', 'TSP8'),
04323     ('LHKSPARE08', 'TSP8'),
04324     ('LHKSPARE08', 'TSP8'),
04325     ('LHKSPARE08', 'TSP8'),
04326     ('LHKSPARE08', 'TSP8'),
04327     ('LHKSPARE08', 'TSP8'),
04328     ('LHKSPARE08', 'TSP8'),
04329     ('LHKSPARE08', 'TSP8'),
04330     ('LHKSPARE08', 'TSP8'),
04331     ('LHKSPARE08', 'TSP8'),
04332     ('LHKSPARE08', 'TSP8'),
04333     ('LHKSPARE08', 'TSP8'),
04334     ('LHKSPARE08', 'TSP8'),
04335     ('LHKSPARE08', 'TSP8'),
04336     ('LHKSPARE08', 'TSP8'),
04337     ('LHKSPARE08', 'TSP8'),
04338     ('LHKSPARE08', 'TSP8'),
04339     ('LHKSPARE08', 'TSP8'),
04340     ('LHKSPARE08', 'TSP8'),
04341     ('LHKSPARE08', 'TSP8'),
04342     ('LHKSPARE08', 'TSP8'),
04343     ('LHKSPARE08', 'TSP8'),
04344     ('LHKSPARE08', 'TSP8'),
04345     ('LHKSPARE08', 'TSP8'),
04346     ('LHKSPARE08', 'TSP8'),
04347     ('LHKSPARE08', 'TSP8'),
04348     ('LHKSPARE08', 'TSP8'),
04349     ('LHKSPARE08', 'TSP8'),
04350     ('LHKSPARE08', 'TSP8'),
04351     ('LHKSPARE08', 'TSP8'),
04352     ]
04353   def __init__(self, ui):
04354     HskPacket.__init__(self, ui)
04355     self.name  = "DiagPduEnv1"
04356     self.brief = "Diagnostic PDU Environmental Packet 1"
04357     self.descr = "PDU Packet 1"
04358     self.read()
04359
04360
04361 class HskPacket280(HskPacket):
04362   mnemList = [
04363     ('LHKSPARE08', 'TSP8'),
04364     ('LHKSPARE08', 'TSP8'),
04365     ('LHKSPARE08', 'TSP8'),
04366     ('LHKSPARE08', 'TSP8'),
04367     ('LHKSPARE08', 'TSP8'),
04368     ('LHKSPARE08', 'TSP8'),
04369     ('LHKP0PHP0DSITST', 'ADCS'),
04370     ('LHKP0PHP0DSIT', 'ADCV'),
04371     ('LHKP0PHP1DSITST', 'ADCS'),
04372     ('LHKP0PHP1DSIT', 'ADCV'),
04373     ('LHKP0PHP2DSITST', 'ADCS'),
04374     ('LHKP0PHP2DSIT', 'ADCV'),
04375     ('LHKP0PHP3DSITST', 'ADCS'),
04376     ('LHKP0PHP3DSIT', 'ADCV'),
04377     ('LHKP0PHP4DSITST', 'ADCS'),
04378     ('LHKP0PHP4DSIT', 'ADCV'),
04379     ('LHKP0PHP5DSITST', 'ADCS'),
04380     ('LHKP0PHP5DSIT', 'ADCV'),
04381     ('LHKP0MHP0DSITST', 'ADCS'),
04382     ('LHKP0MHP0DSIT', 'ADCV'),
04383     ('LHKP0MHP1DSITST', 'ADCS'),
04384     ('LHKP0MHP1DSIT', 'ADCV'),
04385     ('LHKP0MHP2DSITST', 'ADCS'),
04386     ('LHKP0MHP2DSIT', 'ADCV'),
04387     ('LHKP0MHP3DSITST', 'ADCS'),
04388     ('LHKP0MHP3DSIT', 'ADCV'),
04389     ('LHKP0MHP4DSITST', 'ADCS'),
04390     ('LHKP0MHP4DSIT', 'ADCV'),
04391     ('LHKP0MHP5DSITST', 'ADCS'),
04392     ('LHKP0MHP5DSIT', 'ADCV'),
04393     ('LHKP0PHP0XLITST', 'ADCS'),
04394     ('LHKP0PHP0XLIT', 'ADCV'),
04395     ('LHKP0PHP1XLITST', 'ADCS'),
04396     ('LHKP0PHP1XLIT', 'ADCV'),
04397     ('LHKP0PHP2XLITST', 'ADCS'),
04398     ('LHKP0PHP2XLIT', 'ADCV'),
04399     ('LHKP0PHP3XLITST', 'ADCS'),
04400     ('LHKP0PHP3XLIT', 'ADCV'),
04401     ('LHKP0PHP4XLITST', 'ADCS'),
04402     ('LHKP0PHP4XLIT', 'ADCV'),
04403     ('LHKP0PHP5XLITST', 'ADCS'),
04404     ('LHKP0PHP5XLIT', 'ADCV'),
04405     ('LHKP0MHP0XLITST', 'ADCS'),
04406     ('LHKP0MHP0XLIT', 'ADCV'),
04407     ('LHKP0MHP1XLITST', 'ADCS'),
04408     ('LHKP0MHP1XLIT', 'ADCV'),
04409     ('LHKP0MHP2XLITST', 'ADCS'),
04410     ('LHKP0MHP2XLIT', 'ADCV'),
04411     ('LHKP0MHP3XLITST', 'ADCS'),
04412     ('LHKP0MHP3XLIT', 'ADCV'),
04413     ('LHKP0MHP4XLITST', 'ADCS'),
04414     ('LHKP0MHP4XLIT', 'ADCV'),
04415     ('LHKP0MHP5XLITST', 'ADCS'),
04416     ('LHKP0MHP5XLIT', 'ADCV'),
04417     ('LHKP0PHP0RVHTST', 'ADCS'),
04418     ('LHKP0PHP0RVHT', 'ADCV'),
04419     ('LHKP0PHP1RVHTST', 'ADCS'),
04420     ('LHKP0PHP1RVHT', 'ADCV'),
04421     ('LHKP0PHP2RVHTST', 'ADCS'),
04422     ('LHKP0PHP2RVHT', 'ADCV'),
04423     ('LHKP0PHP3RVHTST', 'ADCS'),
04424     ('LHKP0PHP3RVHT', 'ADCV'),
04425     ('LHKP0PHP4RVHTST', 'ADCS'),
04426     ('LHKP0PHP4RVHT', 'ADCV'),
04427     ('LHKP0PHP5RVHTST', 'ADCS'),
04428     ('LHKP0PHP5RVHT', 'ADCV'),
04429     ('LHKP0MHP0RVHTST', 'ADCS'),
04430     ('LHKP0MHP0RVHT', 'ADCV'),
04431     ('LHKP0MHP1RVHTST', 'ADCS'),
04432     ('LHKP0MHP1RVHT', 'ADCV'),
04433     ('LHKP0MHP2RVHTST', 'ADCS'),
04434     ('LHKP0MHP2RVHT', 'ADCV'),
04435     ('LHKP0MHP3RVHTST', 'ADCS'),
04436     ('LHKP0MHP3RVHT', 'ADCV'),
04437     ('LHKP0MHP4RVHTST', 'ADCS'),
04438     ('LHKP0MHP4RVHT', 'ADCV'),
04439     ('LHKP0MHP5RVHTST', 'ADCS'),
04440     ('LHKP0MHP5RVHT', 'ADCV'),
04441     ('LHKSPARE08', 'TSP8'),
04442     ('LHKSPARE08', 'TSP8'),
04443     ('LHKSPARE08', 'TSP8'),
04444     ('LHKSPARE08', 'TSP8'),
04445     ('LHKSPARE08', 'TSP8'),
04446     ('LHKSPARE08', 'TSP8'),
04447     ('LHKSPARE08', 'TSP8'),
04448     ('LHKSPARE08', 'TSP8'),
04449     ('LHKSPARE08', 'TSP8'),
04450     ('LHKSPARE08', 'TSP8'),
04451     ('LHKSPARE08', 'TSP8'),
04452     ('LHKSPARE08', 'TSP8'),
04453     ('LHKSPARE08', 'TSP8'),
04454     ('LHKSPARE08', 'TSP8'),
04455     ('LHKSPARE08', 'TSP8'),
04456     ('LHKSPARE08', 'TSP8'),
04457     ('LHKSPARE08', 'TSP8'),
04458     ('LHKSPARE08', 'TSP8'),
04459     ('LHKSPARE08', 'TSP8'),
04460     ('LHKSPARE08', 'TSP8'),
04461     ('LHKSPARE08', 'TSP8'),
04462     ('LHKSPARE08', 'TSP8'),
04463     ('LHKSPARE08', 'TSP8'),
04464     ('LHKSPARE08', 'TSP8'),
04465     ]
04466   def __init__(self, ui):
04467     HskPacket.__init__(self, ui)
04468     self.name  = "DiagPduEnv2"
04469     self.brief = "Diagnostic PDU Environmental Packet 2"
04470     self.descr = "PDU Packet 2"
04471     self.read()
04472
04473
04474 class HskPacket281(HskPacket):
04475   mnemList = [
04476     ('LHKSPARE08', 'TSP8'),
04477     ('LHKSPARE08', 'TSP8'),
04478     ('LHKSPARE08', 'TSP8'),
04479     ('LHKSPARE08', 'TSP8'),
04480     ('LHKSPARE08', 'TSP8'),
04481     ('LHKSPARE08', 'TSP8'),
04482     ('LHKP0GRID0TST', 'ADCS'),
04483     ('LHKP0GRID0T', 'ADCV'),
04484     ('LHKP0GRID1TST', 'ADCS'),
04485     ('LHKP0GRID1T', 'ADCV'),
04486     ('LHKP0GRID2TST', 'ADCS'),
04487     ('LHKP0GRID2T', 'ADCV'),
04488     ('LHKP0GRID3TST', 'ADCS'),
04489     ('LHKP0GRID3T', 'ADCV'),
04490     ('LHKP0GRID4TST', 'ADCS'),
04491     ('LHKP0GRID4T', 'ADCV'),
04492     ('LHKP0GRID5TST', 'ADCS'),
04493     ('LHKP0GRID5T', 'ADCV'),
04494     ('LHKP0GRID6TST', 'ADCS'),
04495     ('LHKP0GRID6T', 'ADCV'),
04496     ('LHKP0GRID7TST', 'ADCS'),
04497     ('LHKP0GRID7T', 'ADCV'),
04498     ('LHKP0GRID8TST', 'ADCS'),
04499     ('LHKP0GRID8T', 'ADCV'),
04500     ('LHKP0GRID9TST', 'ADCS'),
04501     ('LHKP0GRID9T', 'ADCV'),
04502     ('LHKP0GRID10TST', 'ADCS'),
04503     ('LHKP0GRID10T', 'ADCV'),
04504     ('LHKP0GRID11TST', 'ADCS'),
04505     ('LHKP0GRID11T', 'ADCV'),
04506     ('LHKP0ACDSHT0', 'ADCV'),
04507     ('LHKP0ACDSHT0ST', 'ADCS'),
04508     ('LHKP0ACDSHT1', 'ADCV'),
04509     ('LHKP0ACDSHT1ST', 'ADCS'),
04510     ('LHKP0ACDPRT0ST', 'ADCS'),
04511     ('LHKP0ACDPRT0', 'ADCV'),
04512     ('LHKP0ACDPRT1ST', 'ADCS'),
04513     ('LHKP0ACDPRT1', 'ADCV'),
04514     ('LHKP0ACDPRT2ST', 'ADCS'),
04515     ('LHKP0ACDPRT2', 'ADCV'),
04516     ('LHKP0ACDPRT3ST', 'ADCS'),
04517     ('LHKP0ACDPRT3', 'ADCV'),
04518     ('LHKP0ACDBGT0ST', 'ADCS'),
04519     ('LHKP0ACDBGT0', 'ADCV'),
04520     ('LHKP0ACDBGT1ST', 'ADCS'),
04521     ('LHKP0ACDBGT1', 'ADCV'),
04522     ('LHKP0RADAFHT0ST', 'ADCS'),
04523     ('LHKP0RADAFHT0', 'ADCV'),
04524     ('LHKP0RADAFHT1ST', 'ADCS'),
04525     ('LHKP0RADAFHT1', 'ADCV'),
04526     ('LHKP0GRAD0IFTST', 'ADCS'),
04527     ('LHKP0GRADIFT0', 'ADCV'),
04528     ('LHKP0GRAD1IFTST', 'ADCS'),
04529     ('LHKP0GRAD1IFT', 'ADCV'),
04530     ('LHKP0GRAD2IFTST', 'ADCS'),
04531     ('LHKP0GRAD2IFT', 'ADCV'),
04532     ('LHKP0GRAD3IFTST', 'ADCS'),
04533     ('LHKP0GRAD3IFT', 'ADCV'),
04534     ('LHKP0RAD0TST', 'ADCS'),
04535     ('LHKP0RAD0T', 'ADCV'),
04536     ('LHKP0RAD1TST', 'ADCS'),
04537     ('LHKP0RAD1T', 'ADCV'),
04538     ('LHKP0RAD2TST', 'ADCS'),
04539     ('LHKP0RAD2T', 'ADCV'),
04540     ('LHKP0RAD3TST', 'ADCS'),
04541     ('LHKP0RAD3T', 'ADCV'),
04542     ('LHKP0RAD4TST', 'ADCS'),
04543     ('LHKP0RAD4T', 'ADCV'),
04544     ('LHKP0RAD5TST', 'ADCS'),
04545     ('LHKP0RAD5T', 'ADCV'),
04546     ('LHKP0RAD6TST', 'ADCS'),
04547     ('LHKP0RAD6T', 'ADCV'),
04548     ('LHKP0RAD7TST', 'ADCS'),
04549     ('LHKP0RAD7T', 'ADCV'),
04550     ('LHKP0RAD8TST', 'ADCS'),
04551     ('LHKP0RAD8T', 'ADCV'),
04552     ('LHKP0RAD9TST', 'ADCS'),
04553     ('LHKP0RAD9T', 'ADCV'),
04554     ('LHKP0RAD10TST', 'ADCS'),
04555     ('LHKP0RAD10T', 'ADCV'),
04556     ('LHKP0RAD11TST', 'ADCS'),
04557     ('LHKP0RAD11T', 'ADCV'),
04558     ('LHKSPARE08', 'TSP8'),
04559     ('LHKSPARE08', 'TSP8'),
04560     ('LHKSPARE08', 'TSP8'),
04561     ('LHKSPARE08', 'TSP8'),
04562     ('LHKSPARE08', 'TSP8'),
04563     ('LHKSPARE08', 'TSP8'),
04564     ('LHKSPARE08', 'TSP8'),
04565     ('LHKSPARE08', 'TSP8'),
04566     ('LHKSPARE08', 'TSP8'),
04567     ('LHKSPARE08', 'TSP8'),
04568     ('LHKSPARE08', 'TSP8'),
04569     ('LHKSPARE08', 'TSP8'),
04570     ('LHKSPARE08', 'TSP8'),
04571     ('LHKSPARE08', 'TSP8'),
04572     ('LHKSPARE08', 'TSP8'),
04573     ('LHKSPARE08', 'TSP8'),
04574     ('LHKSPARE08', 'TSP8'),
04575     ('LHKSPARE08', 'TSP8'),
04576     ('LHKSPARE08', 'TSP8'),
04577     ('LHKSPARE08', 'TSP8'),
04578     ]
04579   def __init__(self, ui):
04580     HskPacket.__init__(self, ui)
04581     self.name  = "DiagPduEnv3"
04582     self.brief = "Diagnostic PDU Environmental Packet 3"
04583     self.descr = "PDU Packet 3"
04584     self.read()
04585
04586
04587 class HskPacket282(HskPacket):
04588   mnemList = [
04589     ('LHKSPARE08', 'TSP8'),
04590     ('LHKSPARE08', 'TSP8'),
04591     ('LHKSPARE08', 'TSP8'),
04592     ('LHKSPARE08', 'TSP8'),
04593     ('LHKSPARE08', 'TSP8'),
04594     ('LHKSPARE08', 'TSP8'),
04595     ('LHKP1TEMFPM', 'PDUTEMPWRST'),
04596     ('LHKP1TEMEPM', 'PDUTEMPWRST'),
04597     ('LHKP1TEMDPM', 'PDUTEMPWRST'),
04598     ('LHKP1TEMCPM', 'PDUTEMPWRST'),
04599     ('LHKP1TEMBPM', 'PDUTEMPWRST'),
04600     ('LHKP1TEMAPM', 'PDUTEMPWRST'),
04601     ('LHKP1TEM9PM', 'PDUTEMPWRST'),
04602     ('LHKP1TEM8PM', 'PDUTEMPWRST'),
04603     ('LHKP1TEM7PM', 'PDUTEMPWRST'),
04604     ('LHKP1TEM6PM', 'PDUTEMPWRST'),
04605     ('LHKP1TEM5PM', 'PDUTEMPWRST'),
04606     ('LHKP1TEM4PM', 'PDUTEMPWRST'),
04607     ('LHKP1TEM3PM', 'PDUTEMPWRST'),
04608     ('LHKP1TEM2PM', 'PDUTEMPWRST'),
04609     ('LHKP1TEM1PM', 'PDUTEMPWRST'),
04610     ('LHKP1TEM0PM', 'PDUTEMPWRST'),
04611     ('LHKSPARE10', 'TSP10'),
04612     ('LHKP1EPU2CNVT', 'PDUEPUCVTST'),
04613     ('LHKP1EPU1CNVT', 'PDUEPUCVTST'),
04614     ('LHKP1EPU0CNVT', 'PDUEPUCVTST'),
04615     ('LHKP1EPU2PM', 'PDUEPUPWRST'),
04616     ('LHKP1EPU1PM', 'PDUEPUPWRST'),
04617     ('LHKP1EPU0PM', 'PDUEPUPWRST'),
04618     ('LHKSPARE13', 'TSP13'),
04619     ('LHKP1ACDCNVT', 'PDUACDCNVT'),
04620     ('LHKP1ACDPSP', 'PDUACDPWRSUP'),
04621     ('LHKP1ACDPM', 'PDUACDPWRST'),
04622     ('LHKP1TEM033VST', 'ADCS'),
04623     ('LHKP1TEM033V', 'ADCV'),
04624     ('LHKP1TEM133VST', 'ADCS'),
04625     ('LHKP1TEM133V', 'ADCV'),
04626     ('LHKP1TEM233VST', 'ADCS'),
04627     ('LHKP1TEM233V', 'ADCV'),
04628     ('LHKP1TEM333VST', 'ADCS'),
04629     ('LHKP1TEM333V', 'ADCV'),
04630     ('LHKP1TEM433VST', 'ADCS'),
04631     ('LHKP1TEM433V', 'ADCV'),
04632     ('LHKP1TEM533VST', 'ADCS'),
04633     ('LHKP1TEM533V', 'ADCV'),
04634     ('LHKP1TEM633VST', 'ADCS'),
04635     ('LHKP1TEM633V', 'ADCV'),
04636     ('LHKP1TEM733VST', 'ADCS'),
04637     ('LHKP1TEM733V', 'ADCV'),
04638     ('LHKP1TEM833VST', 'ADCS'),
04639     ('LHKP1TEM833V', 'ADCV'),
04640     ('LHKP1TEM933VST', 'ADCS'),
04641     ('LHKP1TEM933V', 'ADCV'),
04642     ('LHKP1TEMA33VST', 'ADCS'),
04643     ('LHKP1TEMA33V', 'ADCV'),
04644     ('LHKP1TEMB33VST', 'ADCS'),
04645     ('LHKP1TEMB33V', 'ADCV'),
04646     ('LHKP1TEMC33VST', 'ADCS'),
04647     ('LHKP1TEMC33V', 'ADCV'),
04648     ('LHKP1TEMD33VST', 'ADCS'),
04649     ('LHKP1TEMD33V', 'ADCV'),
04650     ('LHKP1TEME33VST', 'ADCS'),
04651     ('LHKP1TEME33V', 'ADCV'),
04652     ('LHKP1TEMF33VST', 'ADCS'),
04653     ('LHKP1TEMF33V', 'ADCV'),
04654     ('LHKP1TEM0PCTST', 'ADCS'),
04655     ('LHKP1TEM0PCT', 'ADCV'),
04656     ('LHKP1TEM1PCTST', 'ADCS'),
04657     ('LHKP1TEM1PCT', 'ADCV'),
04658     ('LHKP1TEM2PCTST', 'ADCS'),
04659     ('LHKP1TEM2PCT', 'ADCV'),
04660     ('LHKP1TEM3PCTST', 'ADCS'),
04661     ('LHKP1TEM3PCT', 'ADCV'),
04662     ('LHKP1TEM4PCTST', 'ADCS'),
04663     ('LHKP1TEM4PCT', 'ADCV'),
04664     ('LHKP1TEM5PCTST', 'ADCS'),
04665     ('LHKP1TEM5PCT', 'ADCV'),
04666     ('LHKP1TEM6PCTST', 'ADCS'),
04667     ('LHKP1TEM6PCT', 'ADCV'),
04668     ('LHKP1TEM7PCTST', 'ADCS'),
04669     ('LHKP1TEM7PCT', 'ADCV'),
04670     ('LHKP1TEM8PCTST', 'ADCS'),
04671     ('LHKP1TEM8PCT', 'ADCV'),
04672     ('LHKP1TEM9PCTST', 'ADCS'),
04673     ('LHKP1TEM9PCT', 'ADCV'),
04674     ('LHKP1TEMAPCTST', 'ADCS'),
04675     ('LHKP1TEMAPCT', 'ADCV'),
04676     ('LHKP1TEMBPCTST', 'ADCS'),
04677     ('LHKP1TEMBPCT', 'ADCV'),
04678     ('LHKP1TEMCPCTST', 'ADCS'),
04679     ('LHKP1TEMCPCT', 'ADCV'),
04680     ('LHKP1TEMDPCTST', 'ADCS'),
04681     ('LHKP1TEMDPCT', 'ADCV'),
04682     ('LHKP1TEMEPCTST', 'ADCS'),
04683     ('LHKP1TEMEPCT', 'ADCV'),
04684     ('LHKP1TEMFPCTST', 'ADCS'),
04685     ('LHKP1TEMFPCT', 'ADCV'),
04686     ('LHKP1EPU033VST', 'ADCS'),
04687     ('LHKP1EPU033V', 'ADCV'),
04688     ('LHKP1EPU133VST', 'ADCS'),
04689     ('LHKP1EPU133V', 'ADCV'),
04690     ('LHKP1EPU233VST', 'ADCS'),
04691     ('LHKP1EPU233V', 'ADCV'),
04692     ('LHKP1EPU0TST', 'ADCS'),
04693     ('LHKP1EPU0T', 'ADCV'),
04694     ('LHKP1EPU1TST', 'ADCS'),
04695     ('LHKP1EPU1T', 'ADCV'),
04696     ('LHKP1EPU2TST', 'ADCS'),
04697     ('LHKP1EPU2T', 'ADCV'),
04698     ('LHKSPARE08', 'TSP8'),
04699     ('LHKSPARE08', 'TSP8'),
04700     ('LHKSPARE08', 'TSP8'),
04701     ('LHKSPARE08', 'TSP8'),
04702     ('LHKSPARE08', 'TSP8'),
04703     ('LHKSPARE08', 'TSP8'),
04704     ('LHKSPARE08', 'TSP8'),
04705     ('LHKSPARE08', 'TSP8'),
04706     ('LHKSPARE08', 'TSP8'),
04707     ('LHKSPARE08', 'TSP8'),
04708     ('LHKSPARE08', 'TSP8'),
04709     ('LHKSPARE08', 'TSP8'),
04710     ('LHKSPARE08', 'TSP8'),
04711     ('LHKSPARE08', 'TSP8'),
04712     ]
04713   def __init__(self, ui):
04714     HskPacket.__init__(self, ui)
04715     self.name  = "DiagPduEnv4"
04716     self.brief = "Diagnostic PDU Environmental Packet 4"
04717     self.descr = "PDU Packet 4"
04718     self.read()
04719
04720
04721 class HskPacket283(HskPacket):
04722   mnemList = [
04723     ('LHKSPARE08', 'TSP8'),
04724     ('LHKSPARE08', 'TSP8'),
04725     ('LHKSPARE08', 'TSP8'),
04726     ('LHKSPARE08', 'TSP8'),
04727     ('LHKSPARE08', 'TSP8'),
04728     ('LHKSPARE08', 'TSP8'),
04729     ('LHKP1TEM0PSTST', 'ADCS'),
04730     ('LHKP1TEM0PST', 'ADCV'),
04731     ('LHKP1TEM1PSTST', 'ADCS'),
04732     ('LHKP1TEM1PST', 'ADCV'),
04733     ('LHKP1TEM2PSTST', 'ADCS'),
04734     ('LHKP1TEM2PST', 'ADCV'),
04735     ('LHKP1TEM3PSTST', 'ADCS'),
04736     ('LHKP1TEM3PST', 'ADCV'),
04737     ('LHKP1TEM4PSTST', 'ADCS'),
04738     ('LHKP1TEM4PST', 'ADCV'),
04739     ('LHKP1TEM5PSTST', 'ADCS'),
04740     ('LHKP1TEM5PST', 'ADCV'),
04741     ('LHKP1TEM6PSTST', 'ADCS'),
04742     ('LHKP1TEM6PST', 'ADCV'),
04743     ('LHKP1TEM7PSTST', 'ADCS'),
04744     ('LHKP1TEM7PST', 'ADCV'),
04745     ('LHKP1TEM8PSTST', 'ADCS'),
04746     ('LHKP1TEM8PST', 'ADCV'),
04747     ('LHKP1TEM9PSTST', 'ADCS'),
04748     ('LHKP1TEM9PST', 'ADCV'),
04749     ('LHKP1TEMAPSTST', 'ADCS'),
04750     ('LHKP1TEMAPST', 'ADCV'),
04751     ('LHKP1TEMBPSTST', 'ADCS'),
04752     ('LHKP1TEMBPST', 'ADCV'),
04753     ('LHKP1TEMCPSTST', 'ADCS'),
04754     ('LHKP1TEMCPST', 'ADCV'),
04755     ('LHKP1TEMDPSTST', 'ADCS'),
04756     ('LHKP1TEMDPST', 'ADCV'),
04757     ('LHKP1TEMEPSTST', 'ADCS'),
04758     ('LHKP1TEMEPST', 'ADCV'),
04759     ('LHKP1TEMFPSTST', 'ADCS'),
04760     ('LHKP1TEMFPST', 'ADCV'),
04761     ('LHKP1CAL0BPTST', 'ADCS'),
04762     ('LHKP1CAL0BPT', 'ADCV'),
04763     ('LHKP1CAL1BPTST', 'ADCS'),
04764     ('LHKP1CAL1BPT', 'ADCV'),
04765     ('LHKP1CAL2BPTST', 'ADCS'),
04766     ('LHKP1CAL2BPT', 'ADCV'),
04767     ('LHKP1CAL3BPTST', 'ADCS'),
04768     ('LHKP1CAL3BPT', 'ADCV'),
04769     ('LHKP1CAL4BPTST', 'ADCS'),
04770     ('LHKP1CAL4BPT', 'ADCV'),
04771     ('LHKP1CAL5BPTST', 'ADCS'),
04772     ('LHKP1CAL5BPT', 'ADCV'),
04773     ('LHKP1CAL6BPTST', 'ADCS'),
04774     ('LHKP1CAL6BPT', 'ADCV'),
04775     ('LHKP1CAL7BPTST', 'ADCS'),
04776     ('LHKP1CAL7BPT', 'ADCV'),
04777     ('LHKP1CAL8BPTST', 'ADCS'),
04778     ('LHKP1CAL8BPT', 'ADCV'),
04779     ('LHKP1CAL9BPTST', 'ADCS'),
04780     ('LHKP1CAL9BPT', 'ADCV'),
04781     ('LHKP1CALABPTST', 'ADCS'),
04782     ('LHKP1CALABPT', 'ADCV'),
04783     ('LHKP1CALBBPTST', 'ADCS'),
04784     ('LHKP1CALBBPT', 'ADCV'),
04785     ('LHKP1CALCBPTST', 'ADCS'),
04786     ('LHKP1CALCBPT', 'ADCV'),
04787     ('LHKP1CALDBPTST', 'ADCS'),
04788     ('LHKP1CALDBPT', 'ADCV'),
04789     ('LHKP1CALEBPTST', 'ADCS'),
04790     ('LHKP1CALEBPT', 'ADCV'),
04791     ('LHKP1CALFBPTST', 'ADCS'),
04792     ('LHKP1CALFBPT', 'ADCV'),
04793     ('LHKSPARE08', 'TSP8'),
04794     ('LHKSPARE08', 'TSP8'),
04795     ('LHKSPARE08', 'TSP8'),
04796     ('LHKSPARE08', 'TSP8'),
04797     ('LHKSPARE08', 'TSP8'),
04798     ('LHKSPARE08', 'TSP8'),
04799     ('LHKSPARE08', 'TSP8'),
04800     ('LHKSPARE08', 'TSP8'),
04801     ('LHKSPARE08', 'TSP8'),
04802     ('LHKSPARE08', 'TSP8'),
04803     ('LHKSPARE08', 'TSP8'),
04804     ('LHKSPARE08', 'TSP8'),
04805     ('LHKSPARE08', 'TSP8'),
04806     ('LHKSPARE08', 'TSP8'),
04807     ('LHKSPARE08', 'TSP8'),
04808     ('LHKSPARE08', 'TSP8'),
04809     ('LHKSPARE08', 'TSP8'),
04810     ('LHKSPARE08', 'TSP8'),
04811     ('LHKSPARE08', 'TSP8'),
04812     ('LHKSPARE08', 'TSP8'),
04813     ('LHKSPARE08', 'TSP8'),
04814     ('LHKSPARE08', 'TSP8'),
04815     ('LHKSPARE08', 'TSP8'),
04816     ('LHKSPARE08', 'TSP8'),
04817     ('LHKSPARE08', 'TSP8'),
04818     ('LHKSPARE08', 'TSP8'),
04819     ('LHKSPARE08', 'TSP8'),
04820     ('LHKSPARE08', 'TSP8'),
04821     ('LHKSPARE08', 'TSP8'),
04822     ('LHKSPARE08', 'TSP8'),
04823     ('LHKSPARE08', 'TSP8'),
04824     ('LHKSPARE08', 'TSP8'),
04825     ]
04826   def __init__(self, ui):
04827     HskPacket.__init__(self, ui)
04828     self.name  = "DiagPduEnv5"
04829     self.brief = "Diagnostic PDU Environmental Packet 5"
04830     self.descr = "PDU Packet 5"
04831     self.read()
04832
04833
04834 class HskPacket284(HskPacket):
04835   mnemList = [
04836     ('LHKSPARE08', 'TSP8'),
04837     ('LHKSPARE08', 'TSP8'),
04838     ('LHKSPARE08', 'TSP8'),
04839     ('LHKSPARE08', 'TSP8'),
04840     ('LHKSPARE08', 'TSP8'),
04841     ('LHKSPARE08', 'TSP8'),
04842     ('LHKP1PHP0DSITST', 'ADCS'),
04843     ('LHKP1PHP0DSIT', 'ADCV'),
04844     ('LHKP1PHP1DSITST', 'ADCS'),
04845     ('LHKP1PHP1DSIT', 'ADCV'),
04846     ('LHKP1PHP2DSITST', 'ADCS'),
04847     ('LHKP1PHP2DSIT', 'ADCV'),
04848     ('LHKP1PHP3DSITST', 'ADCS'),
04849     ('LHKP1PHP3DSIT', 'ADCV'),
04850     ('LHKP1PHP4DSITST', 'ADCS'),
04851     ('LHKP1PHP4DSIT', 'ADCV'),
04852     ('LHKP1PHP5DSITST', 'ADCS'),
04853     ('LHKP1PHP5DSIT', 'ADCV'),
04854     ('LHKP1MHP0DSITST', 'ADCS'),
04855     ('LHKP1MHP0DSIT', 'ADCV'),
04856     ('LHKP1MHP1DSITST', 'ADCS'),
04857     ('LHKP1MHP1DSIT', 'ADCV'),
04858     ('LHKP1MHP2DSITST', 'ADCS'),
04859     ('LHKP1MHP2DSIT', 'ADCV'),
04860     ('LHKP1MHP3DSITST', 'ADCS'),
04861     ('LHKP1MHP3DSIT', 'ADCV'),
04862     ('LHKP1MHP4DSITST', 'ADCS'),
04863     ('LHKP1MHP4DSIT', 'ADCV'),
04864     ('LHKP1MHP5DSITST', 'ADCS'),
04865     ('LHKP1MHP5DSIT', 'ADCV'),
04866     ('LHKP1PHP0XLITST', 'ADCS'),
04867     ('LHKP1PHP0XLIT', 'ADCV'),
04868     ('LHKP1PHP1XLITST', 'ADCS'),
04869     ('LHKP1PHP1XLIT', 'ADCV'),
04870     ('LHKP1PHP2XLITST', 'ADCS'),
04871     ('LHKP1PHP2XLIT', 'ADCV'),
04872     ('LHKP1PHP3XLITST', 'ADCS'),
04873     ('LHKP1PHP3XLIT', 'ADCV'),
04874     ('LHKP1PHP4XLITST', 'ADCS'),
04875     ('LHKP1PHP4XLIT', 'ADCV'),
04876     ('LHKP1PHP5XLITST', 'ADCS'),
04877     ('LHKP1PHP5XLIT', 'ADCV'),
04878     ('LHKP1MHP0XLITST', 'ADCS'),
04879     ('LHKP1MHP0XLIT', 'ADCV'),
04880     ('LHKP1MHP1XLITST', 'ADCS'),
04881     ('LHKP1MHP1XLIT', 'ADCV'),
04882     ('LHKP1MHP2XLITST', 'ADCS'),
04883     ('LHKP1MHP2XLIT', 'ADCV'),
04884     ('LHKP1MHP3XLITST', 'ADCS'),
04885     ('LHKP1MHP3XLIT', 'ADCV'),
04886     ('LHKP1MHP4XLITST', 'ADCS'),
04887     ('LHKP1MHP4XLIT', 'ADCV'),
04888     ('LHKP1MHP5XLITST', 'ADCS'),
04889     ('LHKP1MHP5XLIT', 'ADCV'),
04890     ('LHKP1PHP0RVHTST', 'ADCS'),
04891     ('LHKP1PHP0RVHT', 'ADCV'),
04892     ('LHKP1PHP1RVHTST', 'ADCS'),
04893     ('LHKP1PHP1RVHT', 'ADCV'),
04894     ('LHKP1PHP2RVHTST', 'ADCS'),
04895     ('LHKP1PHP2RVHT', 'ADCV'),
04896     ('LHKP1PHP3RVHTST', 'ADCS'),
04897     ('LHKP1PHP3RVHT', 'ADCV'),
04898     ('LHKP1PHP4RVHTST', 'ADCS'),
04899     ('LHKP1PHP4RVHT', 'ADCV'),
04900     ('LHKP1PHP5RVHTST', 'ADCS'),
04901     ('LHKP1PHP5RVHT', 'ADCV'),
04902     ('LHKP1MHP0RVHTST', 'ADCS'),
04903     ('LHKP1MHP0RVHT', 'ADCV'),
04904     ('LHKP1MHP1RVHTST', 'ADCS'),
04905     ('LHKP1MHP1RVHT', 'ADCV'),
04906     ('LHKP1MHP2RVHTST', 'ADCS'),
04907     ('LHKP1MHP2RVHT', 'ADCV'),
04908     ('LHKP1MHP3RVHTST', 'ADCS'),
04909     ('LHKP1MHP3RVHT', 'ADCV'),
04910     ('LHKP1MHP4RVHTST', 'ADCS'),
04911     ('LHKP1MHP4RVHT', 'ADCV'),
04912     ('LHKP1MHP5RVHTST', 'ADCS'),
04913     ('LHKP1MHP5RVHT', 'ADCV'),
04914     ('LHKSPARE08', 'TSP8'),
04915     ('LHKSPARE08', 'TSP8'),
04916     ('LHKSPARE08', 'TSP8'),
04917     ('LHKSPARE08', 'TSP8'),
04918     ('LHKSPARE08', 'TSP8'),
04919     ('LHKSPARE08', 'TSP8'),
04920     ('LHKSPARE08', 'TSP8'),
04921     ('LHKSPARE08', 'TSP8'),
04922     ('LHKSPARE08', 'TSP8'),
04923     ('LHKSPARE08', 'TSP8'),
04924     ('LHKSPARE08', 'TSP8'),
04925     ('LHKSPARE08', 'TSP8'),
04926     ('LHKSPARE08', 'TSP8'),
04927     ('LHKSPARE08', 'TSP8'),
04928     ('LHKSPARE08', 'TSP8'),
04929     ('LHKSPARE08', 'TSP8'),
04930     ('LHKSPARE08', 'TSP8'),
04931     ('LHKSPARE08', 'TSP8'),
04932     ('LHKSPARE08', 'TSP8'),
04933     ('LHKSPARE08', 'TSP8'),
04934     ('LHKSPARE08', 'TSP8'),
04935     ('LHKSPARE08', 'TSP8'),
04936     ('LHKSPARE08', 'TSP8'),
04937     ('LHKSPARE08', 'TSP8'),
04938     ]
04939   def __init__(self, ui):
04940     HskPacket.__init__(self, ui)
04941     self.name  = "DiagPduEnv6"
04942     self.brief = "Diagnostic PDU Environmental Packet 6"
04943     self.descr = "PDU Packet 6"
04944     self.read()
04945
04946
04947 class HskPacket285(HskPacket):
04948   mnemList = [
04949     ('LHKSPARE08', 'TSP8'),
04950     ('LHKSPARE08', 'TSP8'),
04951     ('LHKSPARE08', 'TSP8'),
04952     ('LHKSPARE08', 'TSP8'),
04953     ('LHKSPARE08', 'TSP8'),
04954     ('LHKSPARE08', 'TSP8'),
04955     ('LHKP1GRID0TST', 'ADCS'),
04956     ('LHKP1GRID0T', 'ADCV'),
04957     ('LHKP1GRID1TST', 'ADCS'),
04958     ('LHKP1GRID1T', 'ADCV'),
04959     ('LHKP1GRID2TST', 'ADCS'),
04960     ('LHKP1GRID2T', 'ADCV'),
04961     ('LHKP1GRID3TST', 'ADCS'),
04962     ('LHKP1GRID3T', 'ADCV'),
04963     ('LHKP1GRID4TST', 'ADCS'),
04964     ('LHKP1GRID4T', 'ADCV'),
04965     ('LHKP1GRID5TST', 'ADCS'),
04966     ('LHKP1GRID5T', 'ADCV'),
04967     ('LHKP1GRID6TST', 'ADCS'),
04968     ('LHKP1GRID6T', 'ADCV'),
04969     ('LHKP1GRID7TST', 'ADCS'),
04970     ('LHKP1GRID7T', 'ADCV'),
04971     ('LHKP1GRID8TST', 'ADCS'),
04972     ('LHKP1GRID8T', 'ADCV'),
04973     ('LHKP1GRID9TST', 'ADCS'),
04974     ('LHKP1GRID9T', 'ADCV'),
04975     ('LHKP1GRID10TST', 'ADCS'),
04976     ('LHKP1GRID10T', 'ADCV'),
04977     ('LHKP1GRID11TST', 'ADCS'),
04978     ('LHKP1GRID11T', 'ADCV'),
04979     ('LHKP1ACDSHT0', 'ADCV'),
04980     ('LHKP1ACDSHT0ST', 'ADCS'),
04981     ('LHKP1ACDSHT1', 'ADCV'),
04982     ('LHKP1ACDSHT1ST', 'ADCS'),
04983     ('LHKP1ACDPRT0ST', 'ADCS'),
04984     ('LHKP1ACDPRT0', 'ADCV'),
04985     ('LHKP1ACDPRT1ST', 'ADCS'),
04986     ('LHKP1ACDPRT1', 'ADCV'),
04987     ('LHKP1ACDPRT2ST', 'ADCS'),
04988     ('LHKP1ACDPRT2', 'ADCV'),
04989     ('LHKP1ACDPRT3ST', 'ADCS'),
04990     ('LHKP1ACDPRT3', 'ADCV'),
04991     ('LHKP1ACDBGT0ST', 'ADCS'),
04992     ('LHKP1ACDBGT0', 'ADCV'),
04993     ('LHKP1ACDBGT1ST', 'ADCS'),
04994     ('LHKP1ACDBGT1', 'ADCV'),
04995     ('LHKP1RADAFHT0ST', 'ADCS'),
04996     ('LHKP1RADAFHT0', 'ADCV'),
04997     ('LHKP1RADAFHT1ST', 'ADCS'),
04998     ('LHKP1RADAFHT1', 'ADCV'),
04999     ('LHKP1GRAD0IFTST', 'ADCS'),
05000     ('LHKP1GRADIFT0', 'ADCV'),
05001     ('LHKP1GRAD1IFTST', 'ADCS'),
05002     ('LHKP1GRAD1IFT', 'ADCV'),
05003     ('LHKP1GRAD2IFTST', 'ADCS'),
05004     ('LHKP1GRAD2IFT', 'ADCV'),
05005     ('LHKP1GRAD3IFTST', 'ADCS'),
05006     ('LHKP1GRAD3IFT', 'ADCV'),
05007     ('LHKP1RAD0TST', 'ADCS'),
05008     ('LHKP1RAD0T', 'ADCV'),
05009     ('LHKP1RAD1TST', 'ADCS'),
05010     ('LHKP1RAD1T', 'ADCV'),
05011     ('LHKP1RAD2TST', 'ADCS'),
05012     ('LHKP1RAD2T', 'ADCV'),
05013     ('LHKP1RAD3TST', 'ADCS'),
05014     ('LHKP1RAD3T', 'ADCV'),
05015     ('LHKP1RAD4TST', 'ADCS'),
05016     ('LHKP1RAD4T', 'ADCV'),
05017     ('LHKP1RAD5TST', 'ADCS'),
05018     ('LHKP1RAD5T', 'ADCV'),
05019     ('LHKP1RAD6TST', 'ADCS'),
05020     ('LHKP1RAD6T', 'ADCV'),
05021     ('LHKP1RAD7TST', 'ADCS'),
05022     ('LHKP1RAD7T', 'ADCV'),
05023     ('LHKP1RAD8TST', 'ADCS'),
05024     ('LHKP1RAD8T', 'ADCV'),
05025     ('LHKP1RAD9TST', 'ADCS'),
05026     ('LHKP1RAD9T', 'ADCV'),
05027     ('LHKP1RAD10TST', 'ADCS'),
05028     ('LHKP1RAD10T', 'ADCV'),
05029     ('LHKP1RAD11TST', 'ADCS'),
05030     ('LHKP1RAD11T', 'ADCV'),
05031     ('LHKSPARE08', 'TSP8'),
05032     ('LHKSPARE08', 'TSP8'),
05033     ('LHKSPARE08', 'TSP8'),
05034     ('LHKSPARE08', 'TSP8'),
05035     ('LHKSPARE08', 'TSP8'),
05036     ('LHKSPARE08', 'TSP8'),
05037     ('LHKSPARE08', 'TSP8'),
05038     ('LHKSPARE08', 'TSP8'),
05039     ('LHKSPARE08', 'TSP8'),
05040     ('LHKSPARE08', 'TSP8'),
05041     ('LHKSPARE08', 'TSP8'),
05042     ('LHKSPARE08', 'TSP8'),
05043     ('LHKSPARE08', 'TSP8'),
05044     ('LHKSPARE08', 'TSP8'),
05045     ('LHKSPARE08', 'TSP8'),
05046     ('LHKSPARE08', 'TSP8'),
05047     ('LHKSPARE08', 'TSP8'),
05048     ('LHKSPARE08', 'TSP8'),
05049     ('LHKSPARE08', 'TSP8'),
05050     ('LHKSPARE08', 'TSP8'),
05051     ]
05052   def __init__(self, ui):
05053     HskPacket.__init__(self, ui)
05054     self.name  = "DiagPduEnv7"
05055     self.brief = "Diagnostic PDU Environmental Packet 7"
05056     self.descr = "PDU Packet 7"
05057     self.read()
05058
05059
05060 class HskPacket286(HskPacket):
05061   mnemList = [
05062     ('LHKSPARE08', 'TSP8'),
05063     ('LHKSPARE08', 'TSP8'),
05064     ('LHKSPARE08', 'TSP8'),
05065     ('LHKSPARE08', 'TSP8'),
05066     ('LHKSPARE04', 'TSP4'),
05067     ('LHKAEMFR11PWRST', 'AEMFRPWRST'),
05068     ('LHKAEMFR10PWRST', 'AEMFRPWRST'),
05069     ('LHKAEMFR9PWRST', 'AEMFRPWRST'),
05070     ('LHKAEMFR8PWRST', 'AEMFRPWRST'),
05071     ('LHKAEMFR7PWRST', 'AEMFRPWRST'),
05072     ('LHKAEMFR6PWRST', 'AEMFRPWRST'),
05073     ('LHKAEMFR5PWRST', 'AEMFRPWRST'),
05074     ('LHKAEMFR4PWRST', 'AEMFRPWRST'),
05075     ('LHKAEMFR3PWRST', 'AEMFRPWRST'),
05076     ('LHKAEMFR2PWRST', 'AEMFRPWRST'),
05077     ('LHKAEMFR1PWRST', 'AEMFRPWRST'),
05078     ('LHKAEMFR0PWRST', 'AEMFRPWRST'),
05079     ('LHKAEMFR0VDST', 'ADCS'),
05080     ('LHKAEMFR0VD', 'ADCV'),
05081     ('LHKAEMFR0TST', 'ADCS'),
05082     ('LHKAEMFR0T', 'ADCV'),
05083     ('LHKAEMFR0V1ST', 'ADCS'),
05084     ('LHKAEMFR0V1', 'ADCV'),
05085     ('LHKAEMFR0V2ST', 'ADCS'),
05086     ('LHKAEMFR0V2', 'ADCV'),
05087     ('LHKAEMFR1VDST', 'ADCS'),
05088     ('LHKAEMFR1VD', 'ADCV'),
05089     ('LHKAEMFR1TST', 'ADCS'),
05090     ('LHKAEMFR1T', 'ADCV'),
05091     ('LHKAEMFR1V1ST', 'ADCS'),
05092     ('LHKAEMFR1V1', 'ADCV'),
05093     ('LHKAEMFR1V2ST', 'ADCS'),
05094     ('LHKAEMFR1V2', 'ADCV'),
05095     ('LHKAEMFR2VDST', 'ADCS'),
05096     ('LHKAEMFR2VD', 'ADCV'),
05097     ('LHKAEMFR2TST', 'ADCS'),
05098     ('LHKAEMFR2T', 'ADCV'),
05099     ('LHKAEMFR2V1ST', 'ADCS'),
05100     ('LHKAEMFR2V1', 'ADCV'),
05101     ('LHKAEMFR2V2ST', 'ADCS'),
05102     ('LHKAEMFR2V2', 'ADCV'),
05103     ('LHKAEMFR3VDST', 'ADCS'),
05104     ('LHKAEMFR3VD', 'ADCV'),
05105     ('LHKAEMFR3TST', 'ADCS'),
05106     ('LHKAEMFR3T', 'ADCV'),
05107     ('LHKAEMFR3V1ST', 'ADCS'),
05108     ('LHKAEMFR3V1', 'ADCV'),
05109     ('LHKAEMFR3V2ST', 'ADCS'),
05110     ('LHKAEMFR3V2', 'ADCV'),
05111     ('LHKAEMFR4VDST', 'ADCS'),
05112     ('LHKAEMFR4VD', 'ADCV'),
05113     ('LHKAEMFR4TST', 'ADCS'),
05114     ('LHKAEMFR4T', 'ADCV'),
05115     ('LHKAEMFR4V1ST', 'ADCS'),
05116     ('LHKAEMFR4V1', 'ADCV'),
05117     ('LHKAEMFR4V2ST', 'ADCS'),
05118     ('LHKAEMFR4V2', 'ADCV'),
05119     ('LHKAEMFR5VDST', 'ADCS'),
05120     ('LHKAEMFR5VD', 'ADCV'),
05121     ('LHKAEMFR5TST', 'ADCS'),
05122     ('LHKAEMFR5T', 'ADCV'),
05123     ('LHKAEMFR5V1ST', 'ADCS'),
05124     ('LHKAEMFR5V1', 'ADCV'),
05125     ('LHKAEMFR5V2ST', 'ADCS'),
05126     ('LHKAEMFR5V2', 'ADCV'),
05127     ('LHKAEMFR6VDST', 'ADCS'),
05128     ('LHKAEMFR6VD', 'ADCV'),
05129     ('LHKAEMFR6TST', 'ADCS'),
05130     ('LHKAEMFR6T', 'ADCV'),
05131     ('LHKAEMFR6V1ST', 'ADCS'),
05132     ('LHKAEMFR6V1', 'ADCV'),
05133     ('LHKAEMFR6V2ST', 'ADCS'),
05134     ('LHKAEMFR6V2', 'ADCV'),
05135     ('LHKAEMFR7VDST', 'ADCS'),
05136     ('LHKAEMFR7VD', 'ADCV'),
05137     ('LHKAEMFR7TST', 'ADCS'),
05138     ('LHKAEMFR7T', 'ADCV'),
05139     ('LHKAEMFR7V1ST', 'ADCS'),
05140     ('LHKAEMFR7V1', 'ADCV'),
05141     ('LHKAEMFR7V2ST', 'ADCS'),
05142     ('LHKAEMFR7V2', 'ADCV'),
05143     ('LHKAEMFR8VDST', 'ADCS'),
05144     ('LHKAEMFR8VD', 'ADCV'),
05145     ('LHKAEMFR8TST', 'ADCS'),
05146     ('LHKAEMFR8T', 'ADCV'),
05147     ('LHKAEMFR8V1ST', 'ADCS'),
05148     ('LHKAEMFR8V1', 'ADCV'),
05149     ('LHKAEMFR8V2ST', 'ADCS'),
05150     ('LHKAEMFR8V2', 'ADCV'),
05151     ('LHKAEMFR9VDST', 'ADCS'),
05152     ('LHKAEMFR9VD', 'ADCV'),
05153     ('LHKAEMFR9TST', 'ADCS'),
05154     ('LHKAEMFR9T', 'ADCV'),
05155     ('LHKAEMFR9V1ST', 'ADCS'),
05156     ('LHKAEMFR9V1', 'ADCV'),
05157     ('LHKAEMFR9V2ST', 'ADCS'),
05158     ('LHKAEMFR9V2', 'ADCV'),
05159     ('LHKAEMFR10VDST', 'ADCS'),
05160     ('LHKAEMFR10VD', 'ADCV'),
05161     ('LHKAEMFR10TST', 'ADCS'),
05162     ('LHKAEMFR10T', 'ADCV'),
05163     ('LHKAEMFR10V1ST', 'ADCS'),
05164     ('LHKAEMFR10V1', 'ADCV'),
05165     ('LHKAEMFR10V2ST', 'ADCS'),
05166     ('LHKAEMFR10V2', 'ADCV'),
05167     ('LHKAEMFR11VDST', 'ADCS'),
05168     ('LHKAEMFR11VD', 'ADCV'),
05169     ('LHKAEMFR11TST', 'ADCS'),
05170     ('LHKAEMFR11T', 'ADCV'),
05171     ('LHKAEMFR11V1ST', 'ADCS'),
05172     ('LHKAEMFR11V1', 'ADCV'),
05173     ('LHKAEMFR11V2ST', 'ADCS'),
05174     ('LHKAEMFR11V2', 'ADCV'),
05175     ]
05176   def __init__(self, ui):
05177     HskPacket.__init__(self, ui)
05178     self.name  = "DiagAemEnv0"
05179     self.brief = "Diagnostic AEM Environmental Monitor Packet 0"
05180     self.descr = "AEM Packet 0"
05181     self.read()
05182
05183
05184 class HskPacket227(HskPacket):
05185   mnemList = [
05186     ('LHKSPARE16', 'TSP16'),
05187     ('LHKSPARE16', 'TSP16'),
05188     ('LHKSPARE16', 'TSP16'),
05189     ('LHKGLRSSEC', 'TIMESEC'),
05190     ('LHKGLRSSUB', 'TIMESUBSEC'),
05191     ('LHKGLRSLIVE', 'GEMLRSLIVE'),
05192     ('LHKGLRSPRESC', 'GEMPRSCL'),
05193     ('LHKGLRSDISC', 'GEMLRSDISC'),
05194     ('LHKGLRSSENT', 'GEMLRSSENT'),
05195     ('LHKSPARE16', 'TSP16'),
05196     ('LHKSPARE16', 'TSP16'),
05197     ('LHKSPARE16', 'TSP16'),
05198     ('LHKSPARE16', 'TSP16'),
05199     ('LHKSPARE16', 'TSP16'),
05200     ('LHKSPARE16', 'TSP16'),
05201     ('LHKSPARE16', 'TSP16'),
05202     ('LHKSPARE16', 'TSP16'),
05203     ('LHKSPARE16', 'TSP16'),
05204     ('LHKSPARE16', 'TSP16'),
05205     ('LHKSPARE16', 'TSP16'),
05206     ('LHKSPARE16', 'TSP16'),
05207     ('LHKSPARE16', 'TSP16'),
05208     ('LHKSPARE16', 'TSP16'),
05209     ('LHKSPARE16', 'TSP16'),
05210     ('LHKSPARE16', 'TSP16'),
05211     ('LHKSPARE16', 'TSP16'),
05212     ('LHKSPARE16', 'TSP16'),
05213     ('LHKSPARE16', 'TSP16'),
05214     ('LHKSPARE16', 'TSP16'),
05215     ('LHKSPARE16', 'TSP16'),
05216     ('LHKSPARE16', 'TSP16'),
05217     ('LHKSPARE16', 'TSP16'),
05218     ('LHKSPARE16', 'TSP16'),
05219     ('LHKSPARE16', 'TSP16'),
05220     ('LHKSPARE16', 'TSP16'),
05221     ('LHKSPARE16', 'TSP16'),
05222     ('LHKSPARE16', 'TSP16'),
05223     ('LHKSPARE16', 'TSP16'),
05224     ('LHKSPARE16', 'TSP16'),
05225     ('LHKSPARE16', 'TSP16'),
05226     ('LHKSPARE16', 'TSP16'),
05227     ('LHKSPARE16', 'TSP16'),
05228     ('LHKSPARE16', 'TSP16'),
05229     ('LHKSPARE16', 'TSP16'),
05230     ('LHKSPARE16', 'TSP16'),
05231     ]
05232   def __init__(self, ui):
05233     HskPacket.__init__(self, ui)
05234     self.name  = "Lrs0"
05235     self.brief = "Low-rate Science Packet"
05236     self.descr = "Contains GEM low-rate science counters"
05237     self.read()
05238
05239
05240 class HskPacket287(HskPacket):
05241   mnemList = [
05242     ('LHKSPARE16', 'TSP16'),
05243     ('LHKSPARE16', 'TSP16'),
05244     ('LHKSPARE16', 'TSP16'),
05245     ('LHKGLRSSEC', 'TIMESEC'),
05246     ('LHKGLRSSUB', 'TIMESUBSEC'),
05247     ('LHKGLRSLIVE', 'GEMLRSLIVE'),
05248     ('LHKGLRSPRESC', 'GEMPRSCL'),
05249     ('LHKGLRSDISC', 'GEMLRSDISC'),
05250     ('LHKGLRSSENT', 'GEMLRSSENT'),
05251     ('LHKSPARE16', 'TSP16'),
05252     ('LHKSPARE16', 'TSP16'),
05253     ('LHKSPARE16', 'TSP16'),
05254     ('LHKSPARE16', 'TSP16'),
05255     ('LHKSPARE16', 'TSP16'),
05256     ('LHKSPARE16', 'TSP16'),
05257     ('LHKSPARE16', 'TSP16'),
05258     ('LHKSPARE16', 'TSP16'),
05259     ('LHKSPARE16', 'TSP16'),
05260     ('LHKSPARE16', 'TSP16'),
05261     ('LHKSPARE16', 'TSP16'),
05262     ('LHKSPARE16', 'TSP16'),
05263     ('LHKSPARE16', 'TSP16'),
05264     ('LHKSPARE16', 'TSP16'),
05265     ('LHKSPARE16', 'TSP16'),
05266     ('LHKSPARE16', 'TSP16'),
05267     ('LHKSPARE16', 'TSP16'),
05268     ('LHKSPARE16', 'TSP16'),
05269     ('LHKSPARE16', 'TSP16'),
05270     ('LHKSPARE16', 'TSP16'),
05271     ('LHKSPARE16', 'TSP16'),
05272     ('LHKSPARE16', 'TSP16'),
05273     ('LHKSPARE16', 'TSP16'),
05274     ('LHKSPARE16', 'TSP16'),
05275     ('LHKSPARE16', 'TSP16'),
05276     ('LHKSPARE16', 'TSP16'),
05277     ('LHKSPARE16', 'TSP16'),
05278     ('LHKSPARE16', 'TSP16'),
05279     ('LHKSPARE16', 'TSP16'),
05280     ('LHKSPARE16', 'TSP16'),
05281     ('LHKSPARE16', 'TSP16'),
05282     ('LHKSPARE16', 'TSP16'),
05283     ('LHKSPARE16', 'TSP16'),
05284     ('LHKSPARE16', 'TSP16'),
05285     ('LHKSPARE16', 'TSP16'),
05286     ('LHKSPARE16', 'TSP16'),
05287     ]
05288   def __init__(self, ui):
05289     HskPacket.__init__(self, ui)
05290     self.name  = "DiagLrs0"
05291     self.brief = "Diagnostic Low-rate Science Packet"
05292     self.descr = "Contains GEM low-rate science counters"
05293     self.read()
05294
05295
05296 class HskPacket228(HskPacket):
05297   mnemList = [
05298     ('LHKSPARE16', 'TSP16'),
05299     ('LHKSPARE16', 'TSP16'),
05300     ('LHKSPARE16', 'TSP16'),
05301     ('LHKLCMCMDSEC', 'TIMESEC'),
05302     ('LHKLCMCMDSUB', 'TIMESUBSEC'),
05303     ('LHKLCMCMDSENT', 'CMDCNTS'),
05304     ('LHKLCMCMDEXEF', 'CMDEXEF'),
05305     ('LHKLFSCMDSEC', 'TIMESEC'),
05306     ('LHKLFSCMDSUB', 'TIMESUBSEC'),
05307     ('LHKLFSCMDSENT', 'CMDCNTS'),
05308     ('LHKLFSCMDEXEF', 'CMDEXEF'),
05309     ('LHKLHKCMDSEC', 'TIMESEC'),
05310     ('LHKLHKCMDSUB', 'TIMESUBSEC'),
05311     ('LHKLHKCMDSENT', 'CMDCNTS'),
05312     ('LHKLHKCMDEXEF', 'CMDEXEF'),
05313     ('LHKLIMCMDSEC', 'TIMESEC'),
05314     ('LHKLIMCMDSUB', 'TIMESUBSEC'),
05315     ('LHKLIMCMDSENT', 'CMDCNTS'),
05316     ('LHKLIMCMDEXEF', 'CMDEXEF'),
05317     ('LHKLSMMCMDSEC', 'TIMESEC'),
05318     ('LHKLSMMCMDSUB', 'TIMESUBSEC'),
05319     ('LHKLSMMCMDSENT', 'CMDCNTS'),
05320     ('LHKLSMMCMDEXEF', 'CMDEXEF'),
05321     ('LHKLSMSCMDSEC', 'TIMESEC'),
05322     ('LHKLSMSCMDSUB', 'TIMESUBSEC'),
05323     ('LHKLSMSCMDSENT', 'CMDCNTS'),
05324     ('LHKLSMSCMDEXEF', 'CMDEXEF'),
05325     ]
05326   def __init__(self, ui):
05327     HskPacket.__init__(self, ui)
05328     self.name  = "CmdCnt0"
05329     self.brief = "Command Statistics Packet 0"
05330     self.descr = "Contains task level command statistics."
05331     self.read()
05332
05333
05334 class HskPacket229(HskPacket):
05335   mnemList = [
05336     ('LHKSPARE16', 'TSP16'),
05337     ('LHKSPARE16', 'TSP16'),
05338     ('LHKSPARE16', 'TSP16'),
05339     ('LHKLCICMDSEC', 'TIMESEC'),
05340     ('LHKLCICMDSUB', 'TIMESUBSEC'),
05341     ('LHKLCICMDSENT', 'CMDCNTS'),
05342     ('LHKLCICMDEXEF', 'CMDEXEF'),
05343     ('LHKLMCCMDSEC', 'TIMESEC'),
05344     ('LHKLMCCMDSUB', 'TIMESUBSEC'),
05345     ('LHKLMCCMDSENT', 'CMDCNTS'),
05346     ('LHKLMCCMDEXEF', 'CMDEXEF'),
05347     ('LHKLTCCMDSEC', 'TIMESEC'),
05348     ('LHKLTCCMDSUB', 'TIMESUBSEC'),
05349     ('LHKLTCCMDSENT', 'CMDCNTS'),
05350     ('LHKLTCCMDEXEF', 'CMDEXEF'),
05351     ('LHKLPACMDSEC', 'TIMESEC'),
05352     ('LHKLPACMDSUB', 'TIMESUBSEC'),
05353     ('LHKLPACMDSENT', 'CMDCNTS'),
05354     ('LHKLPACMDEXEF', 'CMDEXEF'),
05355     ('LHKLDFCMDSEC', 'TIMESEC'),
05356     ('LHKLDFCMDSUB', 'TIMESUBSEC'),
05357     ('LHKLDFCMDSENT', 'CMDCNTS'),
05358     ('LHKLDFCMDEXEF', 'CMDEXEF'),
05359     ('LHKSPARECMDSEC', 'TIMESEC'),
05360     ('LHKSPARECMDSUB', 'TIMESUBSEC'),
05361     ('LHKSPARECMDSENT', 'CMDCNTS'),
05362     ('LHKSPARECMDEXEF', 'CMDEXEF'),
05363     ]
05364   def __init__(self, ui):
05365     HskPacket.__init__(self, ui)
05366     self.name  = "CmdCnt1"
05367     self.brief = "Command Statistics Packet 1"
05368     self.descr = "Contains task level command statistics"
05369     self.read()
05370
05371
05372 class HskPacket288(HskPacket):
05373   mnemList = [
05374     ('LHKSPARE16', 'TSP16'),
05375     ('LHKSPARE16', 'TSP16'),
05376     ('LHKSPARE16', 'TSP16'),
05377     ('LHKLCMCMDSEC', 'TIMESEC'),
05378     ('LHKLCMCMDSUB', 'TIMESUBSEC'),
05379     ('LHKLCMCMDSENT', 'CMDCNTS'),
05380     ('LHKLCMCMDEXEF', 'CMDEXEF'),
05381     ('LHKLFSCMDSEC', 'TIMESEC'),
05382     ('LHKLFSCMDSUB', 'TIMESUBSEC'),
05383     ('LHKLFSCMDSENT', 'CMDCNTS'),
05384     ('LHKLFSCMDEXEF', 'CMDEXEF'),
05385     ('LHKLHKCMDSEC', 'TIMESEC'),
05386     ('LHKLHKCMDSUB', 'TIMESUBSEC'),
05387     ('LHKLHKCMDSENT', 'CMDCNTS'),
05388     ('LHKLHKCMDEXEF', 'CMDEXEF'),
05389     ('LHKLIMCMDSEC', 'TIMESEC'),
05390     ('LHKLIMCMDSUB', 'TIMESUBSEC'),
05391     ('LHKLIMCMDSENT', 'CMDCNTS'),
05392     ('LHKLIMCMDEXEF', 'CMDEXEF'),
05393     ('LHKLSMMCMDSEC', 'TIMESEC'),
05394     ('LHKLSMMCMDSUB', 'TIMESUBSEC'),
05395     ('LHKLSMMCMDSENT', 'CMDCNTS'),
05396     ('LHKLSMMCMDEXEF', 'CMDEXEF'),
05397     ('LHKLSMSCMDSEC', 'TIMESEC'),
05398     ('LHKLSMSCMDSUB', 'TIMESUBSEC'),
05399     ('LHKLSMSCMDSENT', 'CMDCNTS'),
05400     ('LHKLSMSCMDEXEF', 'CMDEXEF'),
05401     ]
05402   def __init__(self, ui):
05403     HskPacket.__init__(self, ui)
05404     self.name  = "DiagCmdCnt0"
05405     self.brief = "Diagnostic Command Statistics Packet 0"
05406     self.descr = "Contains task level command statistics"
05407     self.read()
05408
05409
05410 class HskPacket289(HskPacket):
05411   mnemList = [
05412     ('LHKSPARE16', 'TSP16'),
05413     ('LHKSPARE16', 'TSP16'),
05414     ('LHKSPARE16', 'TSP16'),
05415     ('LHKLCICMDSEC', 'TIMESEC'),
05416     ('LHKLCICMDSUB', 'TIMESUBSEC'),
05417     ('LHKLCICMDSENT', 'CMDCNTS'),
05418     ('LHKLCICMDEXEF', 'CMDEXEF'),
05419     ('LHKLMCCMDSEC', 'TIMESEC'),
05420     ('LHKLMCCMDSUB', 'TIMESUBSEC'),
05421     ('LHKLMCCMDSENT', 'CMDCNTS'),
05422     ('LHKLMCCMDEXEF', 'CMDEXEF'),
05423     ('LHKLTCCMDSEC', 'TIMESEC'),
05424     ('LHKLTCCMDSUB', 'TIMESUBSEC'),
05425     ('LHKLTCCMDSENT', 'CMDCNTS'),
05426     ('LHKLTCCMDEXEF', 'CMDEXEF'),
05427     ('LHKLPACMDSEC', 'TIMESEC'),
05428     ('LHKLPACMDSUB', 'TIMESUBSEC'),
05429     ('LHKLPACMDSENT', 'CMDCNTS'),
05430     ('LHKLPACMDEXEF', 'CMDEXEF'),
05431     ('LHKLDFCMDSEC', 'TIMESEC'),
05432     ('LHKLDFCMDSUB', 'TIMESUBSEC'),
05433     ('LHKLDFCMDSENT', 'CMDCNTS'),
05434     ('LHKLDFCMDEXEF', 'CMDEXEF'),
05435     ('LHKSPARECMDSEC', 'TIMESEC'),
05436     ('LHKSPARECMDSUB', 'TIMESUBSEC'),
05437     ('LHKSPARECMDSENT', 'CMDCNTS'),
05438     ('LHKSPARECMDEXEF', 'CMDEXEF'),
05439     ]
05440   def __init__(self, ui):
05441     HskPacket.__init__(self, ui)
05442     self.name  = "DiagCmdCnt1"
05443     self.brief = "Diagnostic Command Statistics Packet 1"
05444     self.descr = "Contains task level command statistics."
05445     self.read()
05446
05447
05448 class HskPacket22a(HskPacket):
05449   mnemList = [
05450     ('LHKSPARE16', 'TSP16'),
05451     ('LHKSPARE16', 'TSP16'),
05452     ('LHKSPARE16', 'TSP16'),
05453     ('LHKSFILSTATE', 'FILESTATE'),
05454     ('LHKSFILCURSIZE', 'FILESIZECUR'),
05455     ('LHKSFILPKTCNT', 'FILEPKTCNT'),
05456     ('LHKSFILERRCODE', 'FILERRCODE'),
05457     ('LHKSFILERRCNT', 'FILERRCNT'),
05458     ('LHKSFILCOMID', 'FILEIDCOM'),
05459     ('LHKE0FILSTATE', 'FILESTATE'),
05460     ('LHKE0FILCURSIZE', 'FILESIZECUR'),
05461     ('LHKE0FILPKTCNT', 'FILEPKTCNT'),
05462     ('LHKE0FILERRCODE', 'FILERRCODE'),
05463     ('LHKE0FILERRCNT', 'FILERRCNT'),
05464     ('LHKE0FILCOMID', 'FILEIDCOM'),
05465     ('LHKE1FILSTATE', 'FILESTATE'),
05466     ('LHKE1FILCURSIZE', 'FILESIZECUR'),
05467     ('LHKE1FILPKTCNT', 'FILEPKTCNT'),
05468     ('LHKE1FILERRCODE', 'FILERRCODE'),
05469     ('LHKE1FILERRCNT', 'FILERRCNT'),
05470     ('LHKE1FILCOMID', 'FILEIDCOM'),
05471     ('LHKE2FILSTATE', 'FILESTATE'),
05472     ('LHKE2FILCURSIZE', 'FILESIZECUR'),
05473     ('LHKE2FILPKTCNT', 'FILEPKTCNT'),
05474     ('LHKE2FILERRCODE', 'FILERRCODE'),
05475     ('LHKE2FILERRCNT', 'FILERRCNT'),
05476     ('LHKE2FILCOMID', 'FILEIDCOM'),
05477     ]
05478   def __init__(self, ui):
05479     HskPacket.__init__(self, ui)
05480     self.name  = "FileStats"
05481     self.brief = "File System Statistics Packet"
05482     self.descr = "Contains FILE statistics for each CPU."
05483     self.read()
05484
05485
05486 class HskPacket28a(HskPacket):
05487   mnemList = [
05488     ('LHKSPARE16', 'TSP16'),
05489     ('LHKSPARE16', 'TSP16'),
05490     ('LHKSPARE16', 'TSP16'),
05491     ('LHKSFILSTATE', 'FILESTATE'),
05492     ('LHKSFILCURSIZE', 'FILESIZECUR'),
05493     ('LHKSFILPKTCNT', 'FILEPKTCNT'),
05494     ('LHKSFILERRCODE', 'FILERRCODE'),
05495     ('LHKSFILERRCNT', 'FILERRCNT'),
05496     ('LHKSFILCOMID', 'FILEIDCOM'),
05497     ('LHKE0FILSTATE', 'FILESTATE'),
05498     ('LHKE0FILCURSIZE', 'FILESIZECUR'),
05499     ('LHKE0FILPKTCNT', 'FILEPKTCNT'),
05500     ('LHKE0FILERRCODE', 'FILERRCODE'),
05501     ('LHKE0FILERRCNT', 'FILERRCNT'),
05502     ('LHKE0FILCOMID', 'FILEIDCOM'),
05503     ('LHKE1FILSTATE', 'FILESTATE'),
05504     ('LHKE1FILCURSIZE', 'FILESIZECUR'),
05505     ('LHKE1FILPKTCNT', 'FILEPKTCNT'),
05506     ('LHKE1FILERRCODE', 'FILERRCODE'),
05507     ('LHKE1FILERRCNT', 'FILERRCNT'),
05508     ('LHKE1FILCOMID', 'FILEIDCOM'),
05509     ('LHKE2FILSTATE', 'FILESTATE'),
05510     ('LHKE2FILCURSIZE', 'FILESIZECUR'),
05511     ('LHKE2FILPKTCNT', 'FILEPKTCNT'),
05512     ('LHKE2FILERRCODE', 'FILERRCODE'),
05513     ('LHKE2FILERRCNT', 'FILERRCNT'),
05514     ('LHKE2FILCOMID', 'FILEIDCOM'),
05515     ]
05516   def __init__(self, ui):
05517     HskPacket.__init__(self, ui)
05518     self.name  = "DiagFileStats"
05519     self.brief = "Diagnositc File System Statistics Packet"
05520     self.descr = "Contains FILE system statistics for each CPU."
05521     self.read()
05522
05523
05524 class HskPacket22b(HskPacket):
05525   mnemList = [
05526     ('LHKSPARE16', 'TSP16'),
05527     ('LHKSPARE16', 'TSP16'),
05528     ('LHKSPARE01', 'TSP1'),
05529     ('LHKSPARE10', 'TSP10'),
05530     ('LHKSIUPIDSCIN2', 'SCPIDIN2'),
05531     ('LHKSIUPIDSCIN1', 'SCPIDIN1'),
05532     ('LHKSIUPIDSCIN0', 'SCPIDIN0'),
05533     ('LHKSIUPIDGBMR', 'GBMPIDR'),
05534     ('LHKSIUPIDGBMP', 'GBMPIDP'),
05535     ('LHKSIUCPUJTEMP', 'CPUJT'),
05536     ('LHKSIUCPUAVLDS', 'AVGLDSEC'),
05537     ('LHKSIUCPUAVLDM', 'AVGLDMIN'),
05538     ('LHKSIUCPULDMIN', 'MINLDMIN'),
05539     ('LHKSIUCPULDMAX', 'MAXLDMIN'),
05540     ('LHKEPU0CPUJTEMP', 'CPUJT'),
05541     ('LHKEPU0CPUAVLDS', 'AVGLDSEC'),
05542     ('LHKEPU0CPUAVLDM', 'AVGLDMIN'),
05543     ('LHKEPU0CPULDMIN', 'MINLDMIN'),
05544     ('LHKEPU0CPULDMAX', 'MAXLDMIN'),
05545     ('LHKEPU1CPUJTEMP', 'CPUJT'),
05546     ('LHKEPU1CPUAVLDS', 'AVGLDSEC'),
05547     ('LHKEPU1CPUAVLDM', 'AVGLDMIN'),
05548     ('LHKEPU1CPULDMIN', 'MINLDMIN'),
05549     ('LHKEPU1CPULDMAX', 'MAXLDMIN'),
05550     ('LHKEPU2CPUJTEMP', 'CPUJT'),
05551     ('LHKEPU2CPUAVLDS', 'AVGLDSEC'),
05552     ('LHKEPU2CPUAVLDM', 'AVGLDMIN'),
05553     ('LHKEPU2CPULDMIN', 'MINLDMIN'),
05554     ('LHKEPU2CPULDMAX', 'MAXLDMIN'),
05555     ('LHKSPARE16', 'TSP16'),
05556     ('LHKSPARE16', 'TSP16'),
05557     ('LHKSPARE16', 'TSP16'),
05558     ('LHKSPARE16', 'TSP16'),
05559     ('LHKSPARE16', 'TSP16'),
05560     ('LHKSPARE16', 'TSP16'),
05561     ('LHKSPARE16', 'TSP16'),
05562     ('LHKSPARE16', 'TSP16'),
05563     ]
05564   def __init__(self, ui):
05565     HskPacket.__init__(self, ui)
05566     self.name  = "CpuMetr"
05567     self.brief = "CPU Metrics"
05568     self.descr = "Contains CPU temperature and loading metrics for all LAT CPUs."
05569     self.read()
05570
05571
05572 class HskPacket28b(HskPacket):
05573   mnemList = [
05574     ('LHKSPARE16', 'TSP16'),
05575     ('LHKSPARE16', 'TSP16'),
05576     ('LHKSPARE01', 'TSP1'),
05577     ('LHKSPARE10', 'TSP10'),
05578     ('LHKSIUPIDSCIN2', 'SCPIDIN2'),
05579     ('LHKSIUPIDSCIN1', 'SCPIDIN1'),
05580     ('LHKSIUPIDSCIN0', 'SCPIDIN0'),
05581     ('LHKSIUPIDGBMR', 'GBMPIDR'),
05582     ('LHKSIUPIDGBMP', 'GBMPIDP'),
05583     ('LHKSIUCPUJTEMP', 'CPUJT'),
05584     ('LHKSIUCPUAVLDS', 'AVGLDSEC'),
05585     ('LHKSIUCPUAVLDM', 'AVGLDMIN'),
05586     ('LHKSIUCPULDMIN', 'MINLDMIN'),
05587     ('LHKSIUCPULDMAX', 'MAXLDMIN'),
05588     ('LHKEPU0CPUJTEMP', 'CPUJT'),
05589     ('LHKEPU0CPUAVLDS', 'AVGLDSEC'),
05590     ('LHKEPU0CPUAVLDM', 'AVGLDMIN'),
05591     ('LHKEPU0CPULDMIN', 'MINLDMIN'),
05592     ('LHKEPU0CPULDMAX', 'MAXLDMIN'),
05593     ('LHKEPU1CPUJTEMP', 'CPUJT'),
05594     ('LHKEPU1CPUAVLDS', 'AVGLDSEC'),
05595     ('LHKEPU1CPUAVLDM', 'AVGLDMIN'),
05596     ('LHKEPU1CPULDMIN', 'MINLDMIN'),
05597     ('LHKEPU1CPULDMAX', 'MAXLDMIN'),
05598     ('LHKEPU2CPUJTEMP', 'CPUJT'),
05599     ('LHKEPU2CPUAVLDS', 'AVGLDSEC'),
05600     ('LHKEPU2CPUAVLDM', 'AVGLDMIN'),
05601     ('LHKEPU2CPULDMIN', 'MINLDMIN'),
05602     ('LHKEPU2CPULDMAX', 'MAXLDMIN'),
05603     ('LHKSPARE16', 'TSP16'),
05604     ('LHKSPARE16', 'TSP16'),
05605     ('LHKSPARE16', 'TSP16'),
05606     ('LHKSPARE16', 'TSP16'),
05607     ('LHKSPARE16', 'TSP16'),
05608     ('LHKSPARE16', 'TSP16'),
05609     ('LHKSPARE16', 'TSP16'),
05610     ('LHKSPARE16', 'TSP16'),
05611     ]
05612   def __init__(self, ui):
05613     HskPacket.__init__(self, ui)
05614     self.name  = "DiagCpuMetr"
05615     self.brief = "Diagnostic CPU Metrics"
05616     self.descr = "Contains CPU termperature and loading metrics for all LAT CPUs."
05617     self.read()
05618
05619
05620 class HskPacket353(HskPacket):
05621   mnemList = [
05622     ('LHKALRTREDDEV', 'RLDEV'),
05623     ('LHKALRTREDADC', 'RLADC'),
05624     ('LHKALRTREDCNT', 'RLCNT'),
05625     ('LHKALRTREDLIM', 'RLLIM'),
05626     ]
05627   def __init__(self, ui):
05628     HskPacket.__init__(self, ui)
05629     self.name  = "RedLimAlrt"
05630     self.brief = "Red Limit Alert Packet"
05631     self.descr = "This packet reports alert data related to an ADC limit threshold violation."
05632     self.read()
05633
05634
05635 class HskPacket22c(HskPacket):
05636   mnemList = [
05637     ('LHKSPARE16', 'TSP16'),
05638     ('LHKSPARE16', 'TSP16'),
05639     ('LHKSPARE16', 'TSP16'),
05640     ('LHKSMEMLDSTAT', 'MLDSTAT'),
05641     ('LHKSMEMLDACT', 'MLDACT'),
05642     ('LHKSMEMLDSTART', 'MLDSTADR'),
05643     ('LHKSMEMLDBYTES', 'MLDBYTS'),
05644     ('LHKSMEMLDOFST', 'MLDOFF'),
05645     ('LHKSMEMDMPSTAT', 'MDPSTAT'),
05646     ('LHKSMEMDMPACT', 'MDPACT'),
05647     ('LHKSMEMDMPSTRT', 'MDPSTADR'),
05648     ('LHKSMEMDMPBYT', 'MDPBYTS'),
05649     ('LHKSMEMDMPADDR', 'MDPADDR'),
05650     ('LHKSMEMDMPFCDE', 'MDPFCD'),
05651     ('LHKSMEM0MPTID', 'MDPTXID'),
05652     ('LHKE0MEMLDSTAT', 'MLDSTAT'),
05653     ('LHKE0MEMLDACT', 'MLDACT'),
05654     ('LHKE0MEMLDSTART', 'MLDSTADR'),
05655     ('LHKE0MEMLDBYTES', 'MLDBYTS'),
05656     ('LHKE0MEMLDOFST', 'MLDOFF'),
05657     ('LHKE0MEMDMPSTAT', 'MDPSTAT'),
05658     ('LHKE0MEMDMPACT', 'MDPACT'),
05659     ('LHKE0MEMDMPSTRT', 'MDPSTADR'),
05660     ('LHKE0MEMDMPBYT', 'MDPBYTS'),
05661     ('LHKE0MEMDMPADDR', 'MDPADDR'),
05662     ('LHKE0MEMDMPFCDE', 'MDPFCD'),
05663     ('LHKE0MEMDMPTID', 'MDPTXID'),
05664     ]
05665   def __init__(self, ui):
05666     HskPacket.__init__(self, ui)
05667     self.name  = "MemStats0"
05668     self.brief = "Memory Load/Dump Statistics"
05669     self.descr = "Contains the statistics for memory loads and dumps on the SIU and EPU0."
05670     self.read()
05671
05672
05673 class HskPacket22d(HskPacket):
05674   mnemList = [
05675     ('LHKSPARE16', 'TSP16'),
05676     ('LHKSPARE16', 'TSP16'),
05677     ('LHKSPARE16', 'TSP16'),
05678     ('LHKE1MEMLDSTAT', 'MLDSTAT'),
05679     ('LHKE1MEMLDACT', 'MLDACT'),
05680     ('LHKE1MEMLDSTART', 'MLDSTADR'),
05681     ('LHKE1MEMLDBYTES', 'MLDBYTS'),
05682     ('LHKE1MEMLDOFST', 'MLDOFF'),
05683     ('LHKE1MEMDMPSTAT', 'MDPSTAT'),
05684     ('LHKE1MEMDMPACT', 'MDPACT'),
05685     ('LHKE1MEMDMPSTRT', 'MDPSTADR'),
05686     ('LHKE1MEMDMPBYT', 'MDPBYTS'),
05687     ('LHKE1MEMDMPADDR', 'MDPADDR'),
05688     ('LHKE1MEMDMPFCDE', 'MDPFCD'),
05689     ('LHKE1MEMDMPTID', 'MDPTXID'),
05690     ('LHKE2MEMLDSTAT', 'MLDSTAT'),
05691     ('LHKE2MEMLDACT', 'MLDACT'),
05692     ('LHKE2MEMLDSTART', 'MLDSTADR'),
05693     ('LHKE2MEMLDBYTES', 'MLDBYTS'),
05694     ('LHKE2MEMLDOFST', 'MLDOFF'),
05695     ('LHKE2MEMDMPSTAT', 'MDPSTAT'),
05696     ('LHKE2MEMDMPACT', 'MDPACT'),
05697     ('LHKE2MEMDMPSTRT', 'MDPSTADR'),
05698     ('LHKE2MEMDMPBYT', 'MDPBYTS'),
05699     ('LHKE2MEMDMPADDR', 'MDPADDR'),
05700     ('LHKE2MEMDMPFCDE', 'MDPFCD'),
05701     ('LHKE2MEMDMPTID', 'MDPTXID'),
05702     ]
05703   def __init__(self, ui):
05704     HskPacket.__init__(self, ui)
05705     self.name  = "MemStats1"
05706     self.brief = "Memory Load/Dump Statistics"
05707     self.descr = "Contains the statistics for memory loads and dumps on the EPU1 and EPU2."
05708     self.read()
05709
05710
05711 class HskPacket28c(HskPacket):
05712   mnemList = [
05713     ('LHKSPARE16', 'TSP16'),
05714     ('LHKSPARE16', 'TSP16'),
05715     ('LHKSPARE16', 'TSP16'),
05716     ('LHKSMEMLDSTAT', 'MLDSTAT'),
05717     ('LHKSMEMLDACT', 'MLDACT'),
05718     ('LHKSMEMLDSTART', 'MLDSTADR'),
05719     ('LHKSMEMLDBYTES', 'MLDBYTS'),
05720     ('LHKSMEMLDOFST', 'MLDOFF'),
05721     ('LHKSMEMDMPSTAT', 'MDPSTAT'),
05722     ('LHKSMEMDMPACT', 'MDPACT'),
05723     ('LHKSMEMDMPSTRT', 'MDPSTADR'),
05724     ('LHKSMEMDMPBYT', 'MDPBYTS'),
05725     ('LHKSMEMDMPADDR', 'MDPADDR'),
05726     ('LHKSMEMDMPFCDE', 'MDPFCD'),
05727     ('LHKSMEM0MPTID', 'MDPTXID'),
05728     ('LHKE0MEMLDSTAT', 'MLDSTAT'),
05729     ('LHKE0MEMLDACT', 'MLDACT'),
05730     ('LHKE0MEMLDSTART', 'MLDSTADR'),
05731     ('LHKE0MEMLDBYTES', 'MLDBYTS'),
05732     ('LHKE0MEMLDOFST', 'MLDOFF'),
05733     ('LHKE0MEMDMPSTAT', 'MDPSTAT'),
05734     ('LHKE0MEMDMPACT', 'MDPACT'),
05735     ('LHKE0MEMDMPSTRT', 'MDPSTADR'),
05736     ('LHKE0MEMDMPBYT', 'MDPBYTS'),
05737     ('LHKE0MEMDMPADDR', 'MDPADDR'),
05738     ('LHKE0MEMDMPFCDE', 'MDPFCD'),
05739     ('LHKE0MEMDMPTID', 'MDPTXID'),
05740     ]
05741   def __init__(self, ui):
05742     HskPacket.__init__(self, ui)
05743     self.name  = "DiagMemStats0"
05744     self.brief = "Diagnostic Memory Load/Dump Statistics"
05745     self.descr = "Contains the statistics for memory loads and dumps on the SIU and EPU0."
05746     self.read()
05747
05748
05749 class HskPacket28d(HskPacket):
05750   mnemList = [
05751     ('LHKSPARE16', 'TSP16'),
05752     ('LHKSPARE16', 'TSP16'),
05753     ('LHKSPARE16', 'TSP16'),
05754     ('LHKE1MEMLDSTAT', 'MLDSTAT'),
05755     ('LHKE1MEMLDACT', 'MLDACT'),
05756     ('LHKE1MEMLDSTART', 'MLDSTADR'),
05757     ('LHKE1MEMLDBYTES', 'MLDBYTS'),
05758     ('LHKE1MEMLDOFST', 'MLDOFF'),
05759     ('LHKE1MEMDMPSTAT', 'MDPSTAT'),
05760     ('LHKE1MEMDMPACT', 'MDPACT'),
05761     ('LHKE1MEMDMPSTRT', 'MDPSTADR'),
05762     ('LHKE1MEMDMPBYT', 'MDPBYTS'),
05763     ('LHKE1MEMDMPADDR', 'MDPADDR'),
05764     ('LHKE1MEMDMPFCDE', 'MDPFCD'),
05765     ('LHKE1MEMDMPTID', 'MDPTXID'),
05766     ('LHKE2MEMLDSTAT', 'MLDSTAT'),
05767     ('LHKE2MEMLDACT', 'MLDACT'),
05768     ('LHKE2MEMLDSTART', 'MLDSTADR'),
05769     ('LHKE2MEMLDBYTES', 'MLDBYTS'),
05770     ('LHKE2MEMLDOFST', 'MLDOFF'),
05771     ('LHKE2MEMDMPSTAT', 'MDPSTAT'),
05772     ('LHKE2MEMDMPACT', 'MDPACT'),
05773     ('LHKE2MEMDMPSTRT', 'MDPSTADR'),
05774     ('LHKE2MEMDMPBYT', 'MDPBYTS'),
05775     ('LHKE2MEMDMPADDR', 'MDPADDR'),
05776     ('LHKE2MEMDMPFCDE', 'MDPFCD'),
05777     ('LHKE2MEMDMPTID', 'MDPTXID'),
05778     ]
05779   def __init__(self, ui):
05780     HskPacket.__init__(self, ui)
05781     self.name  = "DiagMemStats1"
05782     self.brief = "Diagnostic Memory Load/Dump Statistics"
05783     self.descr = "Contains the statistics for memory loads and dumps on the EPU1 and EPU2."
05784     self.read()
05785
05786
05787 class HskPacket22e(HskPacket):
05788   mnemList = [
05789     ('LHKSPARE16', 'TSP16'),
05790     ('LHKSPARE16', 'TSP16'),
05791     ('LHKSPARE16', 'TSP16'),
05792     ('LTCHP0SELRESHPN', 'SensorHpNum'),
05793     ('LTCHP0SELRESTYP', 'SensorType'),
05794     ('LTCHP0SELRITHPN', 'SensorHpNum'),
05795     ('LTCHP0SELRITTYP', 'SensorType'),
05796     ('LTCHP1SELRESHPN', 'SensorHpNum'),
05797     ('LTCHP1SELRESTYP', 'SensorType'),
05798     ('LTCHP1SELRITHPN', 'SensorHpNum'),
05799     ('LTCHP1SELRITTYP', 'SensorType'),
05800     ('LTCHP2SELRESHPN', 'SensorHpNum'),
05801     ('LTCHP2SELRESTYP', 'SensorType'),
05802     ('LTCHP2SELRITHPN', 'SensorHpNum'),
05803     ('LTCHP2SELRITTYP', 'SensorType'),
05804     ('LTCHP3SELRESHPN', 'SensorHpNum'),
05805     ('LTCHP3SELRESTYP', 'SensorType'),
05806     ('LTCHP3SELRITHPN', 'SensorHpNum'),
05807     ('LTCHP3SELRITTYP', 'SensorType'),
05808     ('LTCHP4SELRESHPN', 'SensorHpNum'),
05809     ('LTCHP4SELRESTYP', 'SensorType'),
05810     ('LTCHP4SELRITHPN', 'SensorHpNum'),
05811     ('LTCHP4SELRITTYP', 'SensorType'),
05812     ('LTCHP5SELRESHPN', 'SensorHpNum'),
05813     ('LTCHP5SELRESTYP', 'SensorType'),
05814     ('LTCHP5SELRITHPN', 'SensorHpNum'),
05815     ('LTCHP5SELRITTYP', 'SensorType'),
05816     ('LTCHP6SELRESHPN', 'SensorHpNum'),
05817     ('LTCHP6SELRESTYP', 'SensorType'),
05818     ('LTCHP6SELRITHPN', 'SensorHpNum'),
05819     ('LTCHP6SELRITTYP', 'SensorType'),
05820     ('LTCHP7SELRESHPN', 'SensorHpNum'),
05821     ('LTCHP7SELRESTYP', 'SensorType'),
05822     ('LTCHP7SELRITHPN', 'SensorHpNum'),
05823     ('LTCHP7SELRITTYP', 'SensorType'),
05824     ('LTCHP8SELRESHPN', 'SensorHpNum'),
05825     ('LTCHP8SELRESTYP', 'SensorType'),
05826     ('LTCHP8SELRITHPN', 'SensorHpNum'),
05827     ('LTCHP8SELRITTYP', 'SensorType'),
05828     ('LTCHP9SELRESHPN', 'SensorHpNum'),
05829     ('LTCHP9SELRESTYP', 'SensorType'),
05830     ('LTCHP9SELRITHPN', 'SensorHpNum'),
05831     ('LTCHP9SELRITTYP', 'SensorType'),
05832     ('LTCHP10SELRESHPN', 'SensorHpNum'),
05833     ('LTCHP10SELRESTYP', 'SensorType'),
05834     ('LTCHP10SELRITHPN', 'SensorHpNum'),
05835     ('LTCHP10SELRITTYP', 'SensorType'),
05836     ('LTCHP11SELRESHPN', 'SensorHpNum'),
05837     ('LTCHP11SELRESTYP', 'SensorType'),
05838     ('LTCHP11SELRITHPN', 'SensorHpNum'),
05839     ('LTCHP11SELRITTYP', 'SensorType'),
05840     ('LTCHP0RITSTAT', 'SensorStatus'),
05841     ('LTCHP0RESSTAT', 'SensorStatus'),
05842     ('LTCHP1RITSTAT', 'SensorStatus'),
05843     ('LTCHP1RESSTAT', 'SensorStatus'),
05844     ('LTCHP2RITSTAT', 'SensorStatus'),
05845     ('LTCHP2RESSTAT', 'SensorStatus'),
05846     ('LTCHP3RITSTAT', 'SensorStatus'),
05847     ('LTCHP3RESSTAT', 'SensorStatus'),
05848     ('LTCHP4RITSTAT', 'SensorStatus'),
05849     ('LTCHP4RESSTAT', 'SensorStatus'),
05850     ('LTCHP5RITSTAT', 'SensorStatus'),
05851     ('LTCHP5RESSTAT', 'SensorStatus'),
05852     ('LTCHP6RITSTAT', 'SensorStatus'),
05853     ('LTCHP6RESSTAT', 'SensorStatus'),
05854     ('LTCHP7RITSTAT', 'SensorStatus'),
05855     ('LTCHP7RESSTAT', 'SensorStatus'),
05856     ('LTCHP8RITSTAT', 'SensorStatus'),
05857     ('LTCHP8RESSTAT', 'SensorStatus'),
05858     ('LTCHP9RITSTAT', 'SensorStatus'),
05859     ('LTCHP9RESSTAT', 'SensorStatus'),
05860     ('LTCHP10RITSTAT', 'SensorStatus'),
05861     ('LTCHP10RESSTAT', 'SensorStatus'),
05862     ('LTCHP11RITSTAT', 'SensorStatus'),
05863     ('LTCHP11RESSTAT', 'SensorStatus'),
05864     ('LTCACTVHP', 'ActiveHtPipe'),
05865     ('LTCHTRCMD', 'HeaterCmdMask'),
05866     ('LTCHP0RITTEMP', 'TempCelsius'),
05867     ('LTCHP0RESTEMP', 'TempCelsius'),
05868     ('LTCHP1RITTEMP', 'TempCelsius'),
05869     ('LTCHP1RESTEMP', 'TempCelsius'),
05870     ('LTCHP2RITTEMP', 'TempCelsius'),
05871     ('LTCHP2RESTEMP', 'TempCelsius'),
05872     ('LTCHP3RITTEMP', 'TempCelsius'),
05873     ('LTCHP3RESTEMP', 'TempCelsius'),
05874     ('LTCHP4RITTEMP', 'TempCelsius'),
05875     ('LTCHP4RESTEMP', 'TempCelsius'),
05876     ('LTCHP5RITTEMP', 'TempCelsius'),
05877     ('LTCHP5RESTEMP', 'TempCelsius'),
05878     ('LTCHP6RITTEMP', 'TempCelsius'),
05879     ('LTCHP6RESTEMP', 'TempCelsius'),
05880     ('LTCHP7RITTEMP', 'TempCelsius'),
05881     ('LTCHP7RESTEMP', 'TempCelsius'),
05882     ('LTCHP8RITTEMP', 'TempCelsius'),
05883     ('LTCHP8RESTEMP', 'TempCelsius'),
05884     ('LTCHP9RITTEMP', 'TempCelsius'),
05885     ('LTCHP9RESTEMP', 'TempCelsius'),
05886     ('LTCHP10RITTEMP', 'TempCelsius'),
05887     ('LTCHP10RESTEMP', 'TempCelsius'),
05888     ('LTCHP11RITTEMP', 'TempCelsius'),
05889     ('LTCHP11RESTEMP', 'TempCelsius'),
05890     ('LHKSPARE16', 'TSP16'),
05891     ('LHKSPARE16', 'TSP16'),
05892     ('LHKSPARE16', 'TSP16'),
05893     ('LHKSPARE16', 'TSP16'),
05894     ]
05895   def __init__(self, ui):
05896     HskPacket.__init__(self, ui)
05897     self.name  = "LtcData0"
05898     self.brief = "Thermal Control Data Packet 0"
05899     self.descr = ""
05900     self.read()
05901
05902
05903 class HskPacket22f(HskPacket):
05904   mnemList = [
05905     ('LHKSPARE16', 'TSP16'),
05906     ('LHKSPARE16', 'TSP16'),
05907     ('LHKSPARE16', 'TSP16'),
05908     ('LTCHP0RITLOLIM', 'TempCelsius'),
05909     ('LTCHP1RITLOLIM', 'TempCelsius'),
05910     ('LTCHP2RITLOLIM', 'TempCelsius'),
05911     ('LTCHP3RITLOLIM', 'TempCelsius'),
05912     ('LTCHP4RITLOLIM', 'TempCelsius'),
05913     ('LTCHP5RITLOLIM', 'TempCelsius'),
05914     ('LTCHP6RITLOLIM', 'TempCelsius'),
05915     ('LTCHP7RITLOLIM', 'TempCelsius'),
05916     ('LTCHP8RITLOLIM', 'TempCelsius'),
05917     ('LTCHP9RITLOLIM', 'TempCelsius'),
05918     ('LTCHP10RITLOLIM', 'TempCelsius'),
05919     ('LTCHP11RITLOLIM', 'TempCelsius'),
05920     ('LTCHP0RITHILIM', 'TempCelsius'),
05921     ('LTCHP1RITHILIM', 'TempCelsius'),
05922     ('LTCHP2RITHILIM', 'TempCelsius'),
05923     ('LTCHP3RITHILIM', 'TempCelsius'),
05924     ('LTCHP4RITHILIM', 'TempCelsius'),
05925     ('LTCHP5RITHILIM', 'TempCelsius'),
05926     ('LTCHP6RITHILIM', 'TempCelsius'),
05927     ('LTCHP7RITHILIM', 'TempCelsius'),
05928     ('LTCHP8RITHILIM', 'TempCelsius'),
05929     ('LTCHP9RITHILIM', 'TempCelsius'),
05930     ('LTCHP10RITHILIM', 'TempCelsius'),
05931     ('LTCHP11RITHILIM', 'TempCelsius'),
05932     ('LTCHP0RESLOLIM', 'TempCelsius'),
05933     ('LTCHP1RESLOLIM', 'TempCelsius'),
05934     ('LTCHP2RESLOLIM', 'TempCelsius'),
05935     ('LTCHP3RESLOLIM', 'TempCelsius'),
05936     ('LTCHP4RESLOLIM', 'TempCelsius'),
05937     ('LTCHP5RESLOLIM', 'TempCelsius'),
05938     ('LTCHP6RESLOLIM', 'TempCelsius'),
05939     ('LTCHP7RESLOLIM', 'TempCelsius'),
05940     ('LTCHP8RESLOLIM', 'TempCelsius'),
05941     ('LTCHP9RESLOLIM', 'TempCelsius'),
05942     ('LTCHP10RESLOLIM', 'TempCelsius'),
05943     ('LTCHP11RESLOLIM', 'TempCelsius'),
05944     ('LTCHP0RESHILIM', 'TempCelsius'),
05945     ('LTCHP1RESHILIM', 'TempCelsius'),
05946     ('LTCHP2RESHILIM', 'TempCelsius'),
05947     ('LTCHP3RESHILIM', 'TempCelsius'),
05948     ('LTCHP4RESHILIM', 'TempCelsius'),
05949     ('LTCHP5RESHILIM', 'TempCelsius'),
05950     ('LTCHP6RESHILIM', 'TempCelsius'),
05951     ('LTCHP7RESHILIM', 'TempCelsius'),
05952     ('LTCHP8RESHILIM', 'TempCelsius'),
05953     ('LTCHP9RESHILIM', 'TempCelsius'),
05954     ('LTCHP10RESHILIM', 'TempCelsius'),
05955     ('LTCHP11RESHILIM', 'TempCelsius'),
05956     ]
05957   def __init__(self, ui):
05958     HskPacket.__init__(self, ui)
05959     self.name  = "LtcData1"
05960     self.brief = "Thermal Control Data Packet 1"
05961     self.descr = ""
05962     self.read()
05963
05964
05965 class HskPacket230(HskPacket):
05966   mnemList = [
05967     ('LHKSPARE16', 'TSP16'),
05968     ('LHKSPARE16', 'TSP16'),
05969     ('LHKSPARE16', 'TSP16'),
05970     ('LTCHP0DBDLTLIM', 'TempCelsius'),
05971     ('LTCHP1DBDLTLIM', 'TempCelsius'),
05972     ('LTCHP2DBDLTLIM', 'TempCelsius'),
05973     ('LTCHP3DBDLTLIM', 'TempCelsius'),
05974     ('LTCHP4DBDLTLIM', 'TempCelsius'),
05975     ('LTCHP5DBDLTLIM', 'TempCelsius'),
05976     ('LTCHP6DBDLTLIM', 'TempCelsius'),
05977     ('LTCHP7DBDLTLIM', 'TempCelsius'),
05978     ('LTCHP8DBDLTLIM', 'TempCelsius'),
05979     ('LTCHP9DBDLTLIM', 'TempCelsius'),
05980     ('LTCHP10DBDLTLIM', 'TempCelsius'),
05981     ('LTCHP11DBDLTLIM', 'TempCelsius'),
05982     ('LTCHP0RAWADC0', 'RawAdcStatVal'),
05983     ('LTCHP0RAWADC1', 'RawAdcStatVal'),
05984     ('LTCHP0RAWADC2', 'RawAdcStatVal'),
05985     ('LTCHP0RAWADC3', 'RawAdcStatVal'),
05986     ('LTCHP0RAWADC4', 'RawAdcStatVal'),
05987     ('LTCHP0RAWADC5', 'RawAdcStatVal'),
05988     ('LTCHP1RAWADC0', 'RawAdcStatVal'),
05989     ('LTCHP1RAWADC1', 'RawAdcStatVal'),
05990     ('LTCHP1RAWADC2', 'RawAdcStatVal'),
05991     ('LTCHP1RAWADC3', 'RawAdcStatVal'),
05992     ('LTCHP1RAWADC4', 'RawAdcStatVal'),
05993     ('LTCHP1RAWADC5', 'RawAdcStatVal'),
05994     ('LTCHP2RAWADC0', 'RawAdcStatVal'),
05995     ('LTCHP2RAWADC1', 'RawAdcStatVal'),
05996     ('LTCHP2RAWADC2', 'RawAdcStatVal'),
05997     ('LTCHP2RAWADC3', 'RawAdcStatVal'),
05998     ('LTCHP2RAWADC4', 'RawAdcStatVal'),
05999     ('LTCHP2RAWADC5', 'RawAdcStatVal'),
06000     ('LTCHP3RAWADC0', 'RawAdcStatVal'),
06001     ('LTCHP3RAWADC1', 'RawAdcStatVal'),
06002     ('LTCHP3RAWADC2', 'RawAdcStatVal'),
06003     ('LTCHP3RAWADC3', 'RawAdcStatVal'),
06004     ('LTCHP3RAWADC4', 'RawAdcStatVal'),
06005     ('LTCHP3RAWADC5', 'RawAdcStatVal'),
06006     ('LTCHP4RAWADC0', 'RawAdcStatVal'),
06007     ('LTCHP4RAWADC1', 'RawAdcStatVal'),
06008     ('LTCHP4RAWADC2', 'RawAdcStatVal'),
06009     ('LTCHP4RAWADC3', 'RawAdcStatVal'),
06010     ('LTCHP4RAWADC4', 'RawAdcStatVal'),
06011     ('LTCHP4RAWADC5', 'RawAdcStatVal'),
06012     ('LTCHP5RAWADC0', 'RawAdcStatVal'),
06013     ('LTCHP5RAWADC1', 'RawAdcStatVal'),
06014     ('LTCHP5RAWADC2', 'RawAdcStatVal'),
06015     ('LTCHP5RAWADC3', 'RawAdcStatVal'),
06016     ('LTCHP5RAWADC4', 'RawAdcStatVal'),
06017     ('LTCHP5RAWADC5', 'RawAdcStatVal'),
06018     ]
06019   def __init__(self, ui):
06020     HskPacket.__init__(self, ui)
06021     self.name  = "LtcData2"
06022     self.brief = "Thermal Control Data Packet 2"
06023     self.descr = ""
06024     self.read()
06025
06026
06027 class HskPacket231(HskPacket):
06028   mnemList = [
06029     ('LHKSPARE16', 'TSP16'),
06030     ('LHKSPARE16', 'TSP16'),
06031     ('LHKSPARE16', 'TSP16'),
06032     ('LTCHP6RAWADC0', 'RawAdcStatVal'),
06033     ('LTCHP6RAWADC1', 'RawAdcStatVal'),
06034     ('LTCHP6RAWADC2', 'RawAdcStatVal'),
06035     ('LTCHP6RAWADC3', 'RawAdcStatVal'),
06036     ('LTCHP6RAWADC4', 'RawAdcStatVal'),
06037     ('LTCHP6RAWADC5', 'RawAdcStatVal'),
06038     ('LTCHP7RAWADC0', 'RawAdcStatVal'),
06039     ('LTCHP7RAWADC1', 'RawAdcStatVal'),
06040     ('LTCHP7RAWADC2', 'RawAdcStatVal'),
06041     ('LTCHP7RAWADC3', 'RawAdcStatVal'),
06042     ('LTCHP7RAWADC4', 'RawAdcStatVal'),
06043     ('LTCHP7RAWADC5', 'RawAdcStatVal'),
06044     ('LTCHP8RAWADC0', 'RawAdcStatVal'),
06045     ('LTCHP8RAWADC1', 'RawAdcStatVal'),
06046     ('LTCHP8RAWADC2', 'RawAdcStatVal'),
06047     ('LTCHP8RAWADC3', 'RawAdcStatVal'),
06048     ('LTCHP8RAWADC4', 'RawAdcStatVal'),
06049     ('LTCHP8RAWADC5', 'RawAdcStatVal'),
06050     ('LTCHP9RAWADC0', 'RawAdcStatVal'),
06051     ('LTCHP9RAWADC1', 'RawAdcStatVal'),
06052     ('LTCHP9RAWADC2', 'RawAdcStatVal'),
06053     ('LTCHP9RAWADC3', 'RawAdcStatVal'),
06054     ('LTCHP9RAWADC4', 'RawAdcStatVal'),
06055     ('LTCHP9RAWADC5', 'RawAdcStatVal'),
06056     ('LTCHP10RAWADC0', 'RawAdcStatVal'),
06057     ('LTCHP10RAWADC1', 'RawAdcStatVal'),
06058     ('LTCHP10RAWADC2', 'RawAdcStatVal'),
06059     ('LTCHP10RAWADC3', 'RawAdcStatVal'),
06060     ('LTCHP10RAWADC4', 'RawAdcStatVal'),
06061     ('LTCHP10RAWADC5', 'RawAdcStatVal'),
06062     ('LTCHP11RAWADC0', 'RawAdcStatVal'),
06063     ('LTCHP11RAWADC1', 'RawAdcStatVal'),
06064     ('LTCHP11RAWADC2', 'RawAdcStatVal'),
06065     ('LTCHP11RAWADC3', 'RawAdcStatVal'),
06066     ('LTCHP11RAWADC4', 'RawAdcStatVal'),
06067     ('LTCHP11RAWADC5', 'RawAdcStatVal'),
06068     ('LHKSPARE16', 'TSP16'),
06069     ('LHKSPARE16', 'TSP16'),
06070     ('LHKSPARE16', 'TSP16'),
06071     ('LHKSPARE16', 'TSP16'),
06072     ('LHKSPARE16', 'TSP16'),
06073     ('LHKSPARE16', 'TSP16'),
06074     ('LHKSPARE16', 'TSP16'),
06075     ('LHKSPARE16', 'TSP16'),
06076     ('LHKSPARE16', 'TSP16'),
06077     ('LHKSPARE16', 'TSP16'),
06078     ('LHKSPARE16', 'TSP16'),
06079     ('LHKSPARE16', 'TSP16'),
06080     ]
06081   def __init__(self, ui):
06082     HskPacket.__init__(self, ui)
06083     self.name  = "LtcData3"
06084     self.brief = "Thermal Control Data Packet 3"
06085     self.descr = ""
06086     self.read()
06087
06088
06089 class HskPacket28e(HskPacket):
06090   mnemList = [
06091     ('LHKSPARE16', 'TSP16'),
06092     ('LHKSPARE16', 'TSP16'),
06093     ('LHKSPARE16', 'TSP16'),
06094     ('LTCDHP0SELRESHPN', 'SensorHpNum'),
06095     ('LTCDHP0SELRESTYP', 'SensorType'),
06096     ('LTCDHP0SELRITHPN', 'SensorHpNum'),
06097     ('LTCDHP0SELRITTYP', 'SensorType'),
06098     ('LTCDHP1SELRESHPN', 'SensorHpNum'),
06099     ('LTCDHP1SELRESTYP', 'SensorType'),
06100     ('LTCDHP1SELRITHPN', 'SensorHpNum'),
06101     ('LTCDHP1SELRITTYP', 'SensorType'),
06102     ('LTCDHP2SELRESHPN', 'SensorHpNum'),
06103     ('LTCDHP2SELRESTYP', 'SensorType'),
06104     ('LTCDHP2SELRITHPN', 'SensorHpNum'),
06105     ('LTCDHP2SELRITTYP', 'SensorType'),
06106     ('LTCDHP3SELRESHPN', 'SensorHpNum'),
06107     ('LTCDHP3SELRESTYP', 'SensorType'),
06108     ('LTCDHP3SELRITHPN', 'SensorHpNum'),
06109     ('LTCDHP3SELRITTYP', 'SensorType'),
06110     ('LTCDHP4SELRESHPN', 'SensorHpNum'),
06111     ('LTCDHP4SELRESTYP', 'SensorType'),
06112     ('LTCDHP4SELRITHPN', 'SensorHpNum'),
06113     ('LTCDHP4SELRITTYP', 'SensorType'),
06114     ('LTCDHP5SELRESHPN', 'SensorHpNum'),
06115     ('LTCDHP5SELRESTYP', 'SensorType'),
06116     ('LTCDHP5SELRITHPN', 'SensorHpNum'),
06117     ('LTCDHP5SELRITTYP', 'SensorType'),
06118     ('LTCDHP6SELRESHPN', 'SensorHpNum'),
06119     ('LTCDHP6SELRESTYP', 'SensorType'),
06120     ('LTCDHP6SELRITHPN', 'SensorHpNum'),
06121     ('LTCDHP6SELRITTYP', 'SensorType'),
06122     ('LTCDHP7SELRESHPN', 'SensorHpNum'),
06123     ('LTCDHP7SELRESTYP', 'SensorType'),
06124     ('LTCDHP7SELRITHPN', 'SensorHpNum'),
06125     ('LTCDHP7SELRITTYP', 'SensorType'),
06126     ('LTCDHP8SELRESHPN', 'SensorHpNum'),
06127     ('LTCDHP8SELRESTYP', 'SensorType'),
06128     ('LTCDHP8SELRITHPN', 'SensorHpNum'),
06129     ('LTCDHP8SELRITTYP', 'SensorType'),
06130     ('LTCDHP9SELRESHPN', 'SensorHpNum'),
06131     ('LTCDHP9SELRESTYP', 'SensorType'),
06132     ('LTCDHP9SELRITHPN', 'SensorHpNum'),
06133     ('LTCDHP9SELRITTYP', 'SensorType'),
06134     ('LTCDHP10SELRESHPN', 'SensorHpNum'),
06135     ('LTCDHP10SELRESTYP', 'SensorType'),
06136     ('LTCDHP10SELRITHPN', 'SensorHpNum'),
06137     ('LTCDHP10SELRITTYP', 'SensorType'),
06138     ('LTCDHP11SELRESHPN', 'SensorHpNum'),
06139     ('LTCDHP11SELRESTYP', 'SensorType'),
06140     ('LTCDHP11SELRITHPN', 'SensorHpNum'),
06141     ('LTCDHP11SELRITTYP', 'SensorType'),
06142     ('LTCDHP0RITSTAT', 'SensorStatus'),
06143     ('LTCDHP0RESSTAT', 'SensorStatus'),
06144     ('LTCDHP1RITSTAT', 'SensorStatus'),
06145     ('LTCDHP1RESSTAT', 'SensorStatus'),
06146     ('LTCDHP2RITSTAT', 'SensorStatus'),
06147     ('LTCDHP2RESSTAT', 'SensorStatus'),
06148     ('LTCDHP3RITSTAT', 'SensorStatus'),
06149     ('LTCDHP3RESSTAT', 'SensorStatus'),
06150     ('LTCDHP4RITSTAT', 'SensorStatus'),
06151     ('LTCDHP4RESSTAT', 'SensorStatus'),
06152     ('LTCDHP5RITSTAT', 'SensorStatus'),
06153     ('LTCDHP5RESSTAT', 'SensorStatus'),
06154     ('LTCDHP6RITSTAT', 'SensorStatus'),
06155     ('LTCDHP6RESSTAT', 'SensorStatus'),
06156     ('LTCDHP7RITSTAT', 'SensorStatus'),
06157     ('LTCDHP7RESSTAT', 'SensorStatus'),
06158     ('LTCDHP8RITSTAT', 'SensorStatus'),
06159     ('LTCDHP8RESSTAT', 'SensorStatus'),
06160     ('LTCDHP9RITSTAT', 'SensorStatus'),
06161     ('LTCDHP9RESSTAT', 'SensorStatus'),
06162     ('LTCDHP10RITSTAT', 'SensorStatus'),
06163     ('LTCDHP10RESSTAT', 'SensorStatus'),
06164     ('LTCDHP11RITSTAT', 'SensorStatus'),
06165     ('LTCDHP11RESSTAT', 'SensorStatus'),
06166     ('LTCDACTVHP', 'ActiveHtPipe'),
06167     ('LTCDHTRCMD', 'HeaterCmdMask'),
06168     ('LTCDHP0RITTEMP', 'TempCelsius'),
06169     ('LTCDHP0RESTEMP', 'TempCelsius'),
06170     ('LTCDHP1RITTEMP', 'TempCelsius'),
06171     ('LTCDHP1RESTEMP', 'TempCelsius'),
06172     ('LTCDHP2RITTEMP', 'TempCelsius'),
06173     ('LTCDHP2RESTEMP', 'TempCelsius'),
06174     ('LTCDHP3RITTEMP', 'TempCelsius'),
06175     ('LTCDHP3RESTEMP', 'TempCelsius'),
06176     ('LTCDHP4RITTEMP', 'TempCelsius'),
06177     ('LTCDHP4RESTEMP', 'TempCelsius'),
06178     ('LTCDHP5RITTEMP', 'TempCelsius'),
06179     ('LTCDHP5RESTEMP', 'TempCelsius'),
06180     ('LTCDHP6RITTEMP', 'TempCelsius'),
06181     ('LTCDHP6RESTEMP', 'TempCelsius'),
06182     ('LTCDHP7RITTEMP', 'TempCelsius'),
06183     ('LTCDHP7RESTEMP', 'TempCelsius'),
06184     ('LTCDHP8RITTEMP', 'TempCelsius'),
06185     ('LTCDHP8RESTEMP', 'TempCelsius'),
06186     ('LTCDHP9RITTEMP', 'TempCelsius'),
06187     ('LTCDHP9RESTEMP', 'TempCelsius'),
06188     ('LTCDHP10RITTEMP', 'TempCelsius'),
06189     ('LTCDHP10RESTEMP', 'TempCelsius'),
06190     ('LTCDHP11RITTEMP', 'TempCelsius'),
06191     ('LTCDHP11RESTEMP', 'TempCelsius'),
06192     ('LHKSPARE16', 'TSP16'),
06193     ('LHKSPARE16', 'TSP16'),
06194     ('LHKSPARE16', 'TSP16'),
06195     ('LHKSPARE16', 'TSP16'),
06196     ]
06197   def __init__(self, ui):
06198     HskPacket.__init__(self, ui)
06199     self.name  = "DiagLtcData0"
06200     self.brief = "Diagnostic Thermal Control Data Packet 0"
06201     self.descr = ""
06202     self.read()
06203
06204
06205 class HskPacket28f(HskPacket):
06206   mnemList = [
06207     ('LHKSPARE16', 'TSP16'),
06208     ('LHKSPARE16', 'TSP16'),
06209     ('LHKSPARE16', 'TSP16'),
06210     ('LTCDHP0RITLOLIM', 'TempCelsius'),
06211     ('LTCDHP1RITLOLIM', 'TempCelsius'),
06212     ('LTCDHP2RITLOLIM', 'TempCelsius'),
06213     ('LTCDHP3RITLOLIM', 'TempCelsius'),
06214     ('LTCDHP4RITLOLIM', 'TempCelsius'),
06215     ('LTCDHP5RITLOLIM', 'TempCelsius'),
06216     ('LTCDHP6RITLOLIM', 'TempCelsius'),
06217     ('LTCDHP7RITLOLIM', 'TempCelsius'),
06218     ('LTCDHP8RITLOLIM', 'TempCelsius'),
06219     ('LTCDHP9RITLOLIM', 'TempCelsius'),
06220     ('LTCDHP10RITLOLIM', 'TempCelsius'),
06221     ('LTCDHP11RITLOLIM', 'TempCelsius'),
06222     ('LTCDHP0RITHILIM', 'TempCelsius'),
06223     ('LTCDHP1RITHILIM', 'TempCelsius'),
06224     ('LTCDHP2RITHILIM', 'TempCelsius'),
06225     ('LTCDHP3RITHILIM', 'TempCelsius'),
06226     ('LTCDHP4RITHILIM', 'TempCelsius'),
06227     ('LTCDHP5RITHILIM', 'TempCelsius'),
06228     ('LTCDHP6RITHILIM', 'TempCelsius'),
06229     ('LTCDHP7RITHILIM', 'TempCelsius'),
06230     ('LTCDHP8RITHILIM', 'TempCelsius'),
06231     ('LTCDHP9RITHILIM', 'TempCelsius'),
06232     ('LTCDHP10RITHILIM', 'TempCelsius'),
06233     ('LTCDHP11RITHILIM', 'TempCelsius'),
06234     ('LTCDHP0RESLOLIM', 'TempCelsius'),
06235     ('LTCDHP1RESLOLIM', 'TempCelsius'),
06236     ('LTCDHP2RESLOLIM', 'TempCelsius'),
06237     ('LTCDHP3RESLOLIM', 'TempCelsius'),
06238     ('LTCDHP4RESLOLIM', 'TempCelsius'),
06239     ('LTCDHP5RESLOLIM', 'TempCelsius'),
06240     ('LTCDHP6RESLOLIM', 'TempCelsius'),
06241     ('LTCDHP7RESLOLIM', 'TempCelsius'),
06242     ('LTCDHP8RESLOLIM', 'TempCelsius'),
06243     ('LTCDHP9RESLOLIM', 'TempCelsius'),
06244     ('LTCDHP10RESLOLIM', 'TempCelsius'),
06245     ('LTCDHP11RESLOLIM', 'TempCelsius'),
06246     ('LTCDHP0RESHILIM', 'TempCelsius'),
06247     ('LTCDHP1RESHILIM', 'TempCelsius'),
06248     ('LTCDHP2RESHILIM', 'TempCelsius'),
06249     ('LTCDHP3RESHILIM', 'TempCelsius'),
06250     ('LTCDHP4RESHILIM', 'TempCelsius'),
06251     ('LTCDHP5RESHILIM', 'TempCelsius'),
06252     ('LTCDHP6RESHILIM', 'TempCelsius'),
06253     ('LTCDHP7RESHILIM', 'TempCelsius'),
06254     ('LTCDHP8RESHILIM', 'TempCelsius'),
06255     ('LTCDHP9RESHILIM', 'TempCelsius'),
06256     ('LTCDHP10RESHILIM', 'TempCelsius'),
06257     ('LTCDHP11RESHILIM', 'TempCelsius'),
06258     ]
06259   def __init__(self, ui):
06260     HskPacket.__init__(self, ui)
06261     self.name  = "DiagLtcData1"
06262     self.brief = "Diagnostic Thermal Control Data Packet 1"
06263     self.descr = ""
06264     self.read()
06265
06266
06267 class HskPacket290(HskPacket):
06268   mnemList = [
06269     ('LHKSPARE16', 'TSP16'),
06270     ('LHKSPARE16', 'TSP16'),
06271     ('LHKSPARE16', 'TSP16'),
06272     ('LTCDHP0DBDLTLIM', 'TempCelsius'),
06273     ('LTCDHP1DBDLTLIM', 'TempCelsius'),
06274     ('LTCDHP2DBDLTLIM', 'TempCelsius'),
06275     ('LTCDHP3DBDLTLIM', 'TempCelsius'),
06276     ('LTCDHP4DBDLTLIM', 'TempCelsius'),
06277     ('LTCDHP5DBDLTLIM', 'TempCelsius'),
06278     ('LTCDHP6DBDLTLIM', 'TempCelsius'),
06279     ('LTCDHP7DBDLTLIM', 'TempCelsius'),
06280     ('LTCDHP8DBDLTLIM', 'TempCelsius'),
06281     ('LTCDHP9DBDLTLIM', 'TempCelsius'),
06282     ('LTCDHP10DBDLTLIM', 'TempCelsius'),
06283     ('LTCDHP11DBDLTLIM', 'TempCelsius'),
06284     ('LTCDHP0RAWADC0', 'RawAdcStatVal'),
06285     ('LTCDHP0RAWADC1', 'RawAdcStatVal'),
06286     ('LTCDHP0RAWADC2', 'RawAdcStatVal'),
06287     ('LTCDHP0RAWADC3', 'RawAdcStatVal'),
06288     ('LTCDHP0RAWADC4', 'RawAdcStatVal'),
06289     ('LTCDHP0RAWADC5', 'RawAdcStatVal'),
06290     ('LTCDHP1RAWADC0', 'RawAdcStatVal'),
06291     ('LTCDHP1RAWADC1', 'RawAdcStatVal'),
06292     ('LTCDHP1RAWADC2', 'RawAdcStatVal'),
06293     ('LTCDHP1RAWADC3', 'RawAdcStatVal'),
06294     ('LTCDHP1RAWADC4', 'RawAdcStatVal'),
06295     ('LTCDHP1RAWADC5', 'RawAdcStatVal'),
06296     ('LTCDHP2RAWADC0', 'RawAdcStatVal'),
06297     ('LTCDHP2RAWADC1', 'RawAdcStatVal'),
06298     ('LTCDHP2RAWADC2', 'RawAdcStatVal'),
06299     ('LTCDHP2RAWADC3', 'RawAdcStatVal'),
06300     ('LTCDHP2RAWADC4', 'RawAdcStatVal'),
06301     ('LTCDHP2RAWADC5', 'RawAdcStatVal'),
06302     ('LTCDHP3RAWADC0', 'RawAdcStatVal'),
06303     ('LTCDHP3RAWADC1', 'RawAdcStatVal'),
06304     ('LTCDHP3RAWADC2', 'RawAdcStatVal'),
06305     ('LTCDHP3RAWADC3', 'RawAdcStatVal'),
06306     ('LTCDHP3RAWADC4', 'RawAdcStatVal'),
06307     ('LTCDHP3RAWADC5', 'RawAdcStatVal'),
06308     ('LTCDHP4RAWADC0', 'RawAdcStatVal'),
06309     ('LTCDHP4RAWADC1', 'RawAdcStatVal'),
06310     ('LTCDHP4RAWADC2', 'RawAdcStatVal'),
06311     ('LTCDHP4RAWADC3', 'RawAdcStatVal'),
06312     ('LTCDHP4RAWADC4', 'RawAdcStatVal'),
06313     ('LTCDHP4RAWADC5', 'RawAdcStatVal'),
06314     ('LTCDHP5RAWADC0', 'RawAdcStatVal'),
06315     ('LTCDHP5RAWADC1', 'RawAdcStatVal'),
06316     ('LTCDHP5RAWADC2', 'RawAdcStatVal'),
06317     ('LTCDHP5RAWADC3', 'RawAdcStatVal'),
06318     ('LTCDHP5RAWADC4', 'RawAdcStatVal'),
06319     ('LTCDHP5RAWADC5', 'RawAdcStatVal'),
06320     ]
06321   def __init__(self, ui):
06322     HskPacket.__init__(self, ui)
06323     self.name  = "DiagLtcData2"
06324     self.brief = "Diagnostic Thermal Control Data Packet 2"
06325     self.descr = ""
06326     self.read()
06327
06328
06329 class HskPacket291(HskPacket):
06330   mnemList = [
06331     ('LHKSPARE16', 'TSP16'),
06332     ('LHKSPARE16', 'TSP16'),
06333     ('LHKSPARE16', 'TSP16'),
06334     ('LTCDHP6RAWADC0', 'RawAdcStatVal'),
06335     ('LTCDHP6RAWADC1', 'RawAdcStatVal'),
06336     ('LTCDHP6RAWADC2', 'RawAdcStatVal'),
06337     ('LTCDHP6RAWADC3', 'RawAdcStatVal'),
06338     ('LTCDHP6RAWADC4', 'RawAdcStatVal'),
06339     ('LTCDHP6RAWADC5', 'RawAdcStatVal'),
06340     ('LTCDHP7RAWADC0', 'RawAdcStatVal'),
06341     ('LTCDHP7RAWADC1', 'RawAdcStatVal'),
06342     ('LTCDHP7RAWADC2', 'RawAdcStatVal'),
06343     ('LTCDHP7RAWADC3', 'RawAdcStatVal'),
06344     ('LTCDHP7RAWADC4', 'RawAdcStatVal'),
06345     ('LTCDHP7RAWADC5', 'RawAdcStatVal'),
06346     ('LTCDHP8RAWADC0', 'RawAdcStatVal'),
06347     ('LTCDHP8RAWADC1', 'RawAdcStatVal'),
06348     ('LTCDHP8RAWADC2', 'RawAdcStatVal'),
06349     ('LTCDHP8RAWADC3', 'RawAdcStatVal'),
06350     ('LTCDHP8RAWADC4', 'RawAdcStatVal'),
06351     ('LTCDHP8RAWADC5', 'RawAdcStatVal'),
06352     ('LTCDHP9RAWADC0', 'RawAdcStatVal'),
06353     ('LTCDHP9RAWADC1', 'RawAdcStatVal'),
06354     ('LTCDHP9RAWADC2', 'RawAdcStatVal'),
06355     ('LTCDHP9RAWADC3', 'RawAdcStatVal'),
06356     ('LTCDHP9RAWADC4', 'RawAdcStatVal'),
06357     ('LTCDHP9RAWADC5', 'RawAdcStatVal'),
06358     ('LTCDHP10RAWADC0', 'RawAdcStatVal'),
06359     ('LTCDHP10RAWADC1', 'RawAdcStatVal'),
06360     ('LTCDHP10RAWADC2', 'RawAdcStatVal'),
06361     ('LTCDHP10RAWADC3', 'RawAdcStatVal'),
06362     ('LTCDHP10RAWADC4', 'RawAdcStatVal'),
06363     ('LTCDHP10RAWADC5', 'RawAdcStatVal'),
06364     ('LTCDHP11RAWADC0', 'RawAdcStatVal'),
06365     ('LTCDHP11RAWADC1', 'RawAdcStatVal'),
06366     ('LTCDHP11RAWADC2', 'RawAdcStatVal'),
06367     ('LTCDHP11RAWADC3', 'RawAdcStatVal'),
06368     ('LTCDHP11RAWADC4', 'RawAdcStatVal'),
06369     ('LTCDHP11RAWADC5', 'RawAdcStatVal'),
06370     ('LHKSPARE16', 'TSP16'),
06371     ('LHKSPARE16', 'TSP16'),
06372     ('LHKSPARE16', 'TSP16'),
06373     ('LHKSPARE16', 'TSP16'),
06374     ('LHKSPARE16', 'TSP16'),
06375     ('LHKSPARE16', 'TSP16'),
06376     ('LHKSPARE16', 'TSP16'),
06377     ('LHKSPARE16', 'TSP16'),
06378     ('LHKSPARE16', 'TSP16'),
06379     ('LHKSPARE16', 'TSP16'),
06380     ('LHKSPARE16', 'TSP16'),
06381     ('LHKSPARE16', 'TSP16'),
06382     ]
06383   def __init__(self, ui):
06384     HskPacket.__init__(self, ui)
06385     self.name  = "DiagLtcData3"
06386     self.brief = "Diagnostic Thermal Control Data Packet 3"
06387     self.descr = ""
06388     self.read()
06389
06390
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacketDecoder.py Source File

monitoring

HskPacketDecoder.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Housekeeping handler client"
00013 __author__   = "Amedeo Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/10/06 20:50:21 $").split(' ')[1]
00015 __version__  = "$Revision: 1.3 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020 import logging as log
00021
00022 import struct
00023
00024 from LATTE.client.gBits import *
00025
00026 ccsdsFmt = "!LHLL"      # 14 byte header
00027
00028 # Note:  HSK packet length = 116 bytes --> HSK payload = 102 bytes
00029
00030 class ccsdsPacket(object):
00031   """\brief Interface to a generic CCSDS packet
00032
00033   \param ui The raw binary representation of the packet in big-endian byte order
00034
00035   Methods:
00036   apid()          return packet APID
00037   secHead()       return packet secondary header bit
00038   type()          return packet type bit
00039   version()       return packet version
00040   seqCnt()        return sequence count
00041   seqFlg()        return sequence flag
00042   length()        return packet length in bytes
00043   seconds()       return timestamp seconds
00044   subSeconds()    return timestamp sub seconds
00045   payload()       return packet payload (opaque)
00046
00047   """
00048   def __init__(self, ui):
00049     self.__ui      = ui
00050     self.__decode()
00051
00052   def __decode(self):
00053     # print "ccsdspacket:decode string=%d, fmt=%d" % (len(self.__ui[0:14]), struct.calcsize(ccsdsFmt))
00054     ( header, self.__length, self.__seconds, self.__subSeconds ) = \
00055       struct.unpack(ccsdsFmt, self.__ui[0:14])
00056     self.__header  = ccsdsHeader(header)
00057     self.__payload = self.__ui[14:]
00058
00059   def apid(self):        return self.__header.apid
00060   def secHead(self):     return self.__header.secHead
00061   def type(self):        return self.__header.type
00062   def version(self):     return self.__header.version
00063   def seqCnt(self):      return self.__header.seqCnt
00064   def seqFlg(self):      return self.__header.seqFlg
00065   def length(self):      return self.__length
00066   def seconds(self):     return self.__seconds
00067   def subSeconds(self):  return self.__subSeconds
00068   def payload(self):     return self.__payload
00069
00070
00071 class ccsdsHeader(BitField):
00072   """\brief CCSDS Header bitfield definition
00073   """
00074   cch_BF = [
00075              ( 'apid',     0, 11 ),
00076              ( 'secHead', 11, 12 ),
00077              ( 'type',    12, 13 ),
00078              ( 'version', 13, 16 ),
00079              ( 'seqCnt',  16, 30 ),
00080              ( 'seqFlg',  30, 32 )
00081            ]
00082   def __init__(self, ui):
00083     BitField.__init__(self, ui, self.cch_BF)
00084
00085
00086 class HskPacketBase(ccsdsPacket):
00087   def __init__(self, ui):
00088     ccsdsPacket.__init__(self, ui)
00089     self.__bitsRead = 0
00090     # print "HskPacketBase:decode string=%d, fmt=%d" % (len(self.payload()), struct.calcsize('!51H'))
00091     self.__longArray = struct.unpack('!51H', self.payload())
00092
00093   def __readBits(self, bits):
00094     # parse out n bits from the struct.
00095     # keep a count of the bits read
00096     if bits >= 16:
00097       return self.__readBitsBig(bits)
00098     mask = ( 1 << bits ) - 1
00099     retVal = ( self.__longArray[self.__bitsRead/16] >> (self.__bitsRead%16) ) & mask
00100     self.__bitsRead += bits
00101     return retVal
00102
00103   def __readBitsBig(self, bits):
00104     # more than 16 bits.  Build an n bit number.
00105     nChunk = bits/16 + ( bits%16 != 0 )   # True == 1
00106     chunk = 0
00107     br = self.__bitsRead/16
00108     for i in range(nChunk):
00109       chunk |= long(self.__longArray[br+i]) << ( 16 * (nChunk - i - 1) )
00110
00111     mask = (long(1) << bits) - 1
00112
00113     retVal = ( chunk >> (self.__bitsRead%16) ) & mask
00114     self.__bitsRead += bits
00115     return retVal
00116
00117   def read(self):
00118     for mnem,key in self.mnemList:
00119       self.__dict__[mnem] = self.__readBits(self.bitDict[key])
00120
00121 def packetFactory(packet):
00122   # create a hsk class from a packet and return it
00123   theShort = struct.unpack('!H', packet[0:2])
00124   apid = theShort[0] & 0x7ff
00125   classRet = "HskPacket%03x" % apid
00126   exec('from LATTE.monitoring.HskPacket import ' + classRet)
00127   classStr = classRet + '(packet)'
00128   return eval(classStr)
00129
00130
00131 # eof
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskPacketRetriever.py Source File

monitoring

HskPacketRetriever.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Housekeeping server infrastructure"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "07/28/04"
00014 __version__  = "$Revision: 1.2 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019 import time
00020
00021 from LATTE.monitoring.Retriever        import Retriever
00022 from LATTE.monitoring.Trendable        import Trendable
00023 from LATTE.monitoring.HskPacketDecoder import packetFactory
00024 import time
00025
00026 class HskPacketRetriever(Retriever):
00027   """Retrieve HSK ccsds packets from ethernet connection
00028   """
00029   def __init__(self, hskCli):
00030     Retriever.__init__(self)
00031     self.__client = hskCli
00032
00033   def retrievePacket(self):
00034     packet = []
00035     (err, payload) = self.__client.readTelem()
00036     if err == 0:
00037       hskClass = packetFactory(payload)
00038     else:
00039       print "got an error from readTelem: %d", err
00040       return None
00041
00042     # create the packet
00043
00044     # kludge up the timestamp, as the returned timestamp from HSK relative to VxWorks boot
00045     # timestamp = hskClass.seconds() + hskClass.subSeconds()/10000000
00046     timestamp = time.time()  # time() returns seconds since epoch, UTC
00047
00048     for mnem, tag in hskClass.mnemList:
00049       value = hskClass.__dict__[mnem]
00050       packet.append( Trendable( mnem, timestamp, { 'Raw Value' : value } ) )
00051     return packet
00052
00053
00054
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskReceiver.py Source File

monitoring

HskReceiver.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Housekeeping server infrastructure"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "07/28/04"
00014 __version__  = "$Revision: 1.9 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 from LATTE.monitoring.Receiver       import Receiver
00021 from LATTE.client.gOptions           import Options
00022
00023 import logging
00024 from linecache import *
00025 import time
00026
00027 second  = 1
00028 minute  = 60 * second
00029 hour    = minute * 60
00030 day     = hour * 24
00031 era     = 10**9
00032
00033 timeFmt = '%Y/%m/%d  %H:%M:%S'
00034 dataFile     = None
00035 timeDepth    = 2*hour / 5
00036
00037 class HskSimpleTextReceiver(Receiver):
00038   """
00039   """
00040   def __init__(self, flatFile, startTime):
00041     Receiver.__init__(self)
00042     self.log     = logging.getLogger('HskSimpleTextReceiver')
00043     self.__flatFile   = flatFile
00044     self.__keyList    = []
00045     self.__lineNumber = 1
00046     self.__startTime  = startTime
00047
00048   def shutdown(self):
00049     self.setReceiving(0)
00050
00051   def receive(self):
00052     if self.__lineNumber == 1:
00053       checkcache()
00054       keyList = getline(self.__flatFile, self.__lineNumber)
00055       if keyList == '': time.sleep(0.1); return
00056       # create a list of keys from whitespace separated text blobs
00057       self.__keyList = keyList.split()
00058       self.__lineNumber += 1
00059     while True:
00060       line = getline(self.__flatFile, self.__lineNumber)
00061       # print line
00062       if line == '':
00063         checkcache()
00064         break
00065       # if self.__lineNumber % 100 == 3:
00066         # from HskGuiReceiver import memget
00067         # print  memget()
00068       self.__lineNumber += 1
00069       trendMap = {}
00070       values = line.split()
00071       # first key is 'TimeStamp', so this is always safe:
00072       if float(values[0]) < self.__startTime:
00073         continue
00074       for key in self.__keyList:
00075         v = values[self.__keyList.index(key)]
00076         if v == 'None':    # No value in table.
00077           trendMap[key] = None
00078         else:
00079           trendMap[key] = float(values[self.__keyList.index(key)])
00080       self.dispatch(trendMap)
00081     time.sleep(10)
00082
00083   def dispatch(self, trendMap):
00084     if trendMap == {}: return
00085     print time.strftime(timeFmt, time.localtime(trendMap['TimeStamp'])), '    ' \
00086           'DAQ TEMP:', trendMap['LHKAEMDAQBT']
00087
00088 class HskCfgTextReceiver(HskSimpleTextReceiver):
00089   def __init__(self, flatFile, startTime, trendList):
00090     HskSimpleTextReceiver.__init__(self, flatFile, startTime)
00091     self.__trendList = trendList
00092
00093   def dispatch(self, trendMap):
00094     if trendMap == {}: return
00095     dispatchMap = {'TimeStamp':trendMap['TimeStamp']}
00096     for item in trendMap:
00097       if self.trendItem(item):
00098         dispatchMap[item] = trendMap[item]
00099     self.process(dispatchMap)
00100
00101   def process(self, dispatchMap):
00102     line = ''
00103     for item in dispatchMap:
00104       line += item + ":" + str(dispatchMap[item]) + "    "
00105     # print line
00106
00107   def trendItem(self, item):
00108     if item in self.__trendList:
00109       return True
00110     else:
00111       return False
00112
00113 def parseKeyFile(keyFile):
00114   keyList = {}
00115   f       = open(keyFile, 'r')
00116   for line in f.readlines():
00117     line.strip()
00118     if line[0] != '#' and line != '':
00119       (key,title)  = line.split(':', 1)
00120       keyList[key.strip()] = title.strip()
00121   f.close()
00122   return keyList
00123
00124 def startup():
00125   logging.basicConfig()
00126   logging.root.setLevel(logging.DEBUG)
00127
00128 def usage():
00129   pass
00130
00131 if __name__ == '__main__':
00132   startup()
00133
00134   # Options, first list mandatory, second list optional
00135   options = Options(['dataFile'], ['timeDepth', 'keyFile'])
00136   try:
00137     options.parse()
00138   except Exception, msg:
00139     options.usage(usage())
00140     raise Exception, msg
00141
00142   dataFile = options.dataFile
00143   if options.timeDepth is not None:
00144     timeDepth = int(options.timeDepth)
00145   else:
00146     timeDepth = 2*hour
00147   startTime = time.time() - timeDepth
00148
00149   if options.keyFile is not None:
00150     keyFile = options.keyFile
00151     keyList = parseKeyFile(keyFile)
00152   else:  # really really basic set of histos.
00153     keyList = {'LHKAEMDAQB33V':'AEM DAQ board 3.3 V',
00154                'LHKAEMFR11T'  :'AEM Free board 11 Temp',
00155                'LHKAEMDAQBT'  :'AEM DAQ board Temp',
00156                'LHKAEMFR11V1' :'AEM Free 11 HV 1',
00157                'LHKAEMFR11V2' :'AEM Free 11 HV 2',
00158                'LHKAEMFR11VD' :'AEM Free 11 VDD',
00159                }
00160
00161   # r = HskSimpleTextReceiver(dataFile, startTime)
00162   r = HskCfgTextReceiver(dataFile, startTime, keyList.keys())
00163
00164
00165   r.setReceiving(1)
00166
00167   try:
00168     while 1:
00169       time.sleep(1)
00170   except Exception, e:
00171     r.shutdown()
00172
00173
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskRecorder.py Source File

monitoring

HskRecorder.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Housekeeping server infrastructure"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "07/28/04"
00014 __version__  = "$Revision: 1.7 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 from LATTE.monitoring.Recorder     import Recorder
00021 from LATTE.database.gHSK           import GHSK
00022 from LATTE.monitoring.TrendMaps    import GHSKTrendMap
00023 import logging as log
00024
00025 class HskAlarmRecorder(Recorder):
00026   """Applys the trends to the housekeeping node structure.
00027      As alarms are part of the node structure, we get those for
00028      free.
00029   """
00030   def __init__(self, ghsk):
00031     Recorder.__init__(self)
00032     self.__ghsk = ghsk
00033     self.__trendMap = GHSKTrendMap(ghsk)
00034
00035   def processTrends(self, trendables):
00036     if trendables is None: return
00037     for t in trendables:
00038       key   = t.name
00039       value = t.content['Raw Value']
00040       tuple = self.__trendMap.mapGet(key)
00041       if tuple is not None:
00042         node, attr = tuple
00043         if node is not None:
00044           if  attr != '' and attr is not None:
00045             node.regs[attr.lower()].set(value, bypass=True)
00046           elif isinstance(node, str):
00047             pass
00048
00049 class HskFileRecorder(Recorder):
00050   """Writes the Hsk EGUs to a flat file for later retrieval.
00051   """
00052   def __init__(self, ghsk, flatFile):
00053     Recorder.__init__(self)
00054     self.__ghsk = ghsk
00055     self.__trendMap = GHSKTrendMap(ghsk)
00056     self.__flatFile = open(flatFile, 'a+')
00057
00058     keyList         = self.__flatFile.readline()
00059     if keyList == '':  # No file,
00060       self.processTrends = self.__createFileHeader
00061     else:
00062       # create a list of keys from whitespace separated text blobs
00063       self.__keyList = keyList.split()
00064       self.processTrends = self.__processTrends
00065     self.__flatFile.seek(0,2)
00066     self.__pad = '   '
00067
00068   def __processTrends(self, trendables):
00069     if trendables is None: return
00070
00071     from TrendMaps import makeSimpleMap
00072     trendMap  = makeSimpleMap(trendables, self.__trendMap)
00073
00074     line = ''
00075     for k in self.__keyList:
00076       if k in trendMap:
00077         line += str(trendMap[k]) + self.__pad
00078       else:
00079         line += "None     " + self.__pad
00080     line += '\n'
00081     self.__flatFile.write(line)
00082     self.__flatFile.flush()
00083
00084   def __createFileHeader(self, trendables):
00085     if trendables is None: return
00086     # 1: reset function pointer to processTrends
00087     self.processTrends = self.__processTrends
00088     # 2: create the sorted key list
00089     self.__keyList     = []
00090     for t in trendables:
00091       self.__keyList.append(t.name)
00092     self.__keyList.sort()
00093     self.__keyList.insert(0, 'TimeStamp')
00094     line = ''
00095     # 3: write the index line of the file:
00096     for k in self.__keyList:
00097       line += (k + self.__pad)
00098     line += '\n'
00099     self.__flatFile.writelines([line])
00100     # 4: Profit!
00101     self.processTrends(trendables)
00102
00103 class HskPacketRecorder(Recorder):
00104   def __init__(self, ghsk, flatFile):
00105     Recorder.__init__(self)
00106     self.__ghsk = ghsk
00107     self.__trendMap = GHSKTrendMap(ghsk)
00108     self.__flatFile = open(flatFile, 'a+')
00109     self.__flatFile.seek(0,2)
00110     self.__pad = '   '
00111
00112   def processTrends(self, trendables):
00113     if trendables is None: return
00114     trendMap  = {}
00115     # Add the timestamp
00116     timeStamp = trendables[0].time
00117     trendMap['TimeStamp'] =timeStamp
00118     line = ''
00119
00120     line += 'TimeStamp' + ':' + str(timeStamp) + self.__pad
00121
00122     for t in trendables:
00123       key    = t.name
00124       tuple  = self.__trendMap.mapGet(key)
00125       if tuple is not None:
00126         node, attr = tuple
00127         if node is not None and attr != '':
00128           value = node.regs[attr.lower()].get(bypass=False)
00129           raw = node.regs[attr.lower()].get(bypass=True)
00130
00131           line += key + ':' + str(value) + self.__pad
00132     line += '\n'
00133     self.__flatFile.write(line)
00134     self.__flatFile.flush()
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskRegisters.py Source File

monitoring

HskRegisters.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Housekeeping server infrastructure"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "07/28/04"
00014 __version__  = "$Revision: 1.2 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019 import logging
00020 from   LATTE.client.gException   import LATInterfaceException
00021
00022 class RegisterInterface(object):
00023   """Represents a LAT housekeeping register for reading.
00024   """
00025   def __init__(self, node, name):
00026     """\brief RegisterReader constructor
00027
00028     \param  node:        a gNode (like GAEQ)
00029     \param  name:        a name  (like env_free_1la)
00030     """
00031
00032     self.__readOnly = False
00033     try:
00034       node.regs.has_key(name)
00035     except AttributeError, e:
00036       self.__node = None
00037     else:
00038       self.__node = node
00039       if node.regs[name].isReadOnly():
00040         self.__readOnly = True
00041
00042     self.__name          = name
00043     self.__lastReadValue = None
00044     self.__log           = logging.getLogger()
00045
00046   def name(self): return self.__name
00047
00048   def read(self, cachedValue=False):
00049     """\brief read method
00050
00051     \return the raw value in the register or None
00052     """
00053     if cachedValue:
00054       return self.__lastReadValue
00055
00056     if self.__node:
00057       try:
00058         self.__lastReadValue = self.__node.regs[self.__name].get(bypass=1)
00059       except LATInterfaceException, e:
00060         self.__lastReadValue=None
00061         print e
00062         self.__log.error(e)
00063     else:
00064       self.__log.debug("There is no register %s to read.", self.__name)
00065
00066     return self.__lastReadValue
00067
00068   def write(self, value):
00069     """
00070     writes to the register
00071     """
00072     if self.__readOnly:
00073       self.log.error("Cannot write to a Read Only Register (%s)",
00074                      self.name)
00075     if self.__node:
00076       try:
00077         self.__node.regs[self.__name].set(value,bypass=1)
00078       except LATInterfaceException, e:
00079         #print e
00080         self.__log.error(e)
00081     else:
00082       # If we are running headless, I'll just put this
00083       # in the cached value variable
00084       self.__log.debug("There is no register %s to write 0x%x to.",
00085                      self.name, value)
00086       self.__lastReadValue=value
00087
00088
00089 class NodeRegisterList(object):
00090   """
00091   """
00092   def __init__(self, node):
00093     self.__node = node
00094
00095     self.__regMap = {}
00096     for regKey in node.regs.keys():
00097       self.__regMap[regKey] = RegisterInterface( node, regKey )
00098
00099   def map(self):
00100     return self.__regMap
00101
00102
00103 class AEQHskRegMap:
00104   """
00105   """
00106   regMap = {
00107     "env_free_1la" : [ "Vdd", "Temperature", "HV1", "HV2" ],
00108     "env_free_1rb" : [ "Vdd", "Temperature", "HV1", "HV2" ],
00109     "env_free_2la" : [ "Vdd", "Temperature", "HV1", "HV2" ],
00110     "env_free_2lb" : [ "Vdd", "Temperature", "HV1", "HV2" ],
00111     "env_free_2ra" : [ "Vdd", "Temperature", "HV1", "HV2" ],
00112     "env_free_2rb" : [ "Vdd", "Temperature", "HV1", "HV2" ],
00113     "env_free_3la" : [ "Vdd", "Temperature", "HV1", "HV2" ],
00114     "env_free_3rb" : [ "Vdd", "Temperature", "HV1", "HV2" ],
00115     "env_free_4la" : [ "Vdd", "Temperature", "HV1", "HV2" ],
00116     "env_free_4lb" : [ "Vdd", "Temperature", "HV1", "HV2" ],
00117     "env_free_4ra" : [ "Vdd", "Temperature", "HV1", "HV2" ],
00118     "env_free_4rb" : [ "Vdd", "Temperature", "HV1", "HV2" ],
00119     "env_daq" :      [ "FreeI", "Temperature", "HVI", "DAQV" ]
00120   }
00121   def __init__(self):
00122     pass
00123
00124   def decodeRegister(self, key, regValue):
00125     """
00126     decode an AEM register.  Each 16 bit section looks like:
00127     MBZ[3] Timeout[1] Val[12]
00128
00129     \return a map of parsed values
00130     """
00131     keyList = self.regMap[key]
00132     retMap  = {}
00133     if ( regValue >> 63 ) & 0x1: # not ready
00134       for i in range(4):
00135         retMap[keyList[i]] = None
00136     else:
00137       for i in range(4):
00138         word    = ( regValue >> (16*i) ) & 0xffff
00139         timeout = word >> 15 & 0x1
00140         if timeout:
00141           value = None
00142         else:
00143           value = word & 0x7fff
00144         retMap[keyList[i]] = value
00145     return retMap
00146
00147
00148
00149
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskRetriever.py Source File

monitoring

HskRetriever.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Housekeeping server infrastructure"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "07/28/04"
00014 __version__  = "$Revision: 1.9 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019 import time
00020
00021 from LATTE.monitoring.Retriever    import Retriever
00022 from LATTE.monitoring.Trendable    import Trendable
00023 from LATTE.database.gLAT           import GLAT
00024
00025 class HskLatRetriever(Retriever):
00026   """Fully populated LAT retriever.
00027      Should get all available LAT housekeeping quantities and trend them.
00028   """
00029   def __init__(self, glat):
00030     Retriever.__init__(self)
00031     from LATTE.monitoring.TrendMaps    import GLATTrendMap
00032     self.__trendMap = GLATTrendMap(glat)
00033     # Deal with GEBM TEM multiplexer...
00034     self.__mux = []
00035     for i in range(16):
00036       self.__mux.append('LHKETEM%XRS'%i)
00037
00038   def retrievePacket(self):
00039     packet = []
00040     timestamp = time.time()  # time() returns seconds since epoch, UTC
00041     for key in self.__trendMap.mapKeys():
00042       atuple = self.__trendMap.mapGet(key)
00043       if atuple is not None:
00044         node, attr = atuple
00045         if node is not None and attr != '':
00046           try:
00047             if key in self.__mux:   # have a GEBM TEM multiplexer...
00048               muxes = node.downEBMC().tem_statistics
00049               mux0 = ( muxes      ) & 0xf
00050               mux1 = ( muxes >> 4 ) & 0xf
00051               tem = self.__mux.index(key)
00052               if tem == mux0:
00053                 value = node.downEBMST().regs['receive_tem_mux0'].get(bypass=1)
00054               elif tem == mux1:
00055                 value = node.downEBMST().regs['receive_tem_mux1'].get(bypass=1)
00056               else:
00057                 value = 0
00058             else:
00059               value = node.regs[attr.lower()].get(bypass=1)
00060           except Exception, e:
00061             # print e
00062             value = None
00063           packet.append( Trendable( key, timestamp, { 'Raw Value' : value } ) )
00064     return packet
00065
00066 class HskTestRetriever(Retriever):
00067   """ Test HskRetriever
00068   """
00069   def __init__(self, glat):
00070     self.__monitorList={}
00071     from HskRegisters import NodeRegisterList
00072
00073     AEQ = glat.downAEM().downAEQ()
00074     self.__monitorList["AEQ"] = NodeRegisterList(AEQ)
00075     from LATTE.monitoring.HskRegisters import AEQHskRegMap
00076     self.__hskMap = AEQHskRegMap()
00077
00078   def retrievePacket(self):
00079     packet=[]
00080     timestamp = time.time()  # time() returns seconds since epoch, UTC
00081
00082     for reg in self.__monitorList["AEQ"].map().values():
00083       reg.write(self.aeqBuildDummy(timestamp))
00084       parsed = self.__hskMap.decodeRegister(reg.name(), reg.read())
00085       for key in parsed:
00086         tName = reg.name() + ":" + key
00087         packet.append( Trendable(tName, timestamp, {'Raw Value' : parsed[key]}) )
00088
00089     return packet
00090
00091   def aeqBuildDummy(self,timestamp):
00092     import math
00093     ret = 0L
00094     for i in range(2):
00095       word = long( math.fabs(math.sin( (timestamp*math.pi)/(i*12+12) )) * 0xfff)
00096       ret |= word << (16*i)
00097     return ret
00098
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskSqlGuiReceiver.py Source File

monitoring

HskSqlGuiReceiver.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Housekeeping server infrastructure"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "07/28/04"
00014 __version__  = "$Revision: 1.7 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 # from LATTE.monitoring.HskReceiver import HskCfgTextReceiver
00021 from LATTE.client.gOptions            import Options
00022 from LATTE.monitoring.HskSqlInterface import HskSqlReceiver
00023
00024 import logging
00025 import sys
00026 import time
00027 import qt
00028 from   sihippo                        import Observer
00029 import sihippo
00030 import MySQLdb
00031
00032 second  = 1
00033 minute  = 60 * second
00034 hour    = minute * 60
00035 day     = hour * 24
00036 era     = 10**9
00037
00038 timeFmt      = '%H:%M:%S'
00039 dataFile     = None
00040 timeDepth    = 2*hour
00041
00042 sqlDatabase  = None
00043 dataSource   = None
00044
00045 class QtReceiver(qt.QObject, HskSqlReceiver):
00046
00047   class TrendUpdateEvent(qt.QCustomEvent):
00048     def __init__(self,trendMap):
00049       qt.QCustomEvent.__init__(self,qt.QEvent.MaxUser-20)
00050       self.trendMap = trendMap
00051
00052   def __init__(self, sqlDB, timeDepth, trendList):
00053     HskSqlReceiver.__init__(self, sqlDB, timeDepth, trendList)
00054     qt.QObject.__init__(self)
00055
00056   def process(self,trendMap):
00057     qt.QApplication.postEvent(self,QtReceiver.TrendUpdateEvent(trendMap))
00058
00059   def customEvent(self,event):
00060     self.emit(qt.PYSIGNAL('TrendUpdate(trendMap)'),(event.trendMap,))
00061
00062
00063
00064 class TrendPlotter(qt.QWidget):
00065   def __init__(self, keyList, depth, *args):
00066     qt.QWidget.__init__(self,*args)
00067
00068     self.__ntuples       = {}
00069     self.__plots         = {}
00070     self.__views         = {}
00071     self.__gen           = {}
00072     self.__defaultDepth  = depth                 # assuming 1 hz data rate
00073     self.__defaultLabels = ['Time','']
00074
00075     self.__dynamic       = True
00076     self.__keyList       = keyList
00077
00078     self.grid            = qt.QGridLayout(self,3,2)
00079     self.grid.setAutoAdd(1)
00080     self.true            = True
00081
00082   def isDynamic(self):
00083     return self.__dynamic
00084   def setDynamic(self,bool):
00085     self.__dynamic=bool
00086
00087   def addPlot(self, key):
00088     labels  = self.__defaultLabels
00089     depth   = self.__defaultDepth
00090     name    = self.__keyList[key]
00091
00092     # Create the Circular buffer to store the data
00093     ntc     = sihippo.NTupleController.instance()
00094     nt      = ntc.createCircularBuffer(labels)
00095     nt.reserve(depth)
00096     nt.setTitle(name)
00097     nt.setName(name)
00098
00099     # Create the Plot
00100     dc      = sihippo.DisplayController.instance()
00101     plot    = dc.createDisplay('XY Plot', nt, labels)
00102     # plot    = dc.createDisplay('Strip Chart',nt,labels)
00103
00104     # kludge so that the range is initialized, and autoscales when we need.
00105     plot.setRange('x',0,1)
00106     plot.setAutoRanging('x',True)
00107
00108     # Add the time axis observer
00109     gen     = TimeAxisGen()
00110     gen.setPlotter(plot, key)
00111     plot.addObserver(gen)
00112
00113     # Add the plot to the screen
00114     view    = sihippo.QtViewWidget(self)
00115     view.setPlotter(plot)
00116     view.setDoubleBuffering(1)
00117     view.resize(200,100)
00118     view.setMinimumSize(qt.QSize(100,50))
00119     # self.grid.addWidget(view)
00120     view.show()
00121
00122     # Maintain a reference to the created objects to prevent garbage collection
00123     self.__ntuples[key]  = nt
00124     self.__plots[key]    = plot
00125     self.__views[key]    = view
00126     self.__gen[key]      = gen
00127
00128   def update(self, trendMap):
00129     # if not self.true: return
00130     self.true=False
00131     # trendMap has timestamp, val1, val2, val3...
00132     timeStamp = trendMap['TimeStamp']
00133     for key in trendMap:
00134       if key == 'TimeStamp': continue
00135       if key not in self.__views.keys() and self.__dynamic:
00136         self.addPlot(key)
00137       if key not in self.__views.keys():
00138         return
00139       x=timeStamp
00140       y=trendMap[key]
00141       if y is None:
00142         continue
00143       self.__ntuples[key].addRow([x,y])
00144
00145 class TimeAxisGen ( Observer ) :
00146   __labelFmt   = '%Y/%m/%d'
00147   __tickFmt    = '%H:%M'
00148   __dayFmt     = '%m/%d %H:%M'
00149   __stepSet    = [ 1*second, 5*second, 10*second, 30*second,
00150                    1*minute, 2*minute, 5*minute, 10*minute, 15*minute, 20*minute, 30*minute,
00151                    1*hour, 2*hour, 6*hour, 12*hour,
00152                    1*day, 2*day, 7*day, 30*day, 90*day, 180*day, 364*day,
00153                    era]
00154
00155   def setPlotter ( self, plotter, name ) :
00156     self.plotter = plotter
00157     self.name    = name
00158     self.__goodStep = 0
00159
00160   def update ( self, obs ) :
00161     # return
00162     lowTime = self.plotter.getLowRangeOnX()
00163     highTime = self.plotter.getHighRangeOnX()
00164
00165     if ((highTime - lowTime)/TimeAxisGen.__stepSet[self.__goodStep]) < 1:
00166       # print "reset of goodStep", self.name, self.__goodStep , highTime, lowTime,  ((highTime - lowTime)/TimeAxisGen.__stepSet[self.__goodStep])
00167       self.__goodStep -= 1
00168     if ((highTime - lowTime)/TimeAxisGen.__stepSet[self.__goodStep]) > 6:
00169       # print self.name, highTime, lowTime,  ((highTime - lowTime)/TimeAxisGen.__stepSet[self.__goodStep])
00170       step = 0
00171       while ((highTime - lowTime)/TimeAxisGen.__stepSet[step]) > 5:
00172         # print "step:", step
00173         step += 1
00174       self.__goodStep = step
00175     step = TimeAxisGen.__stepSet[self.__goodStep]
00176     if step < 1*day:
00177       tickFmt = TimeAxisGen.__tickFmt
00178     else:
00179       tickFmt = TimeAxisGen.__dayFmt
00180
00181     lowTick = lowTime - (lowTime % step) + step
00182     values = []
00183     values.append( lowTick )
00184
00185     labels = []
00186     labels.append( time.strftime(tickFmt, time.localtime(lowTick)) )
00187     tick = lowTick
00188     tick += step
00189     while tick < highTime:
00190       values.append ( tick )
00191       labels.append ( time.strftime(tickFmt, time.localtime(tick)) )
00192       tick += step
00193
00194     self.plotter.setAutoTicksOnX( False )
00195     self.plotter.setTicksOnX( values, labels )
00196
00197     # REALLY REALLY don't do this:
00198     #   setLabel calls "notifyObservers", which brings us back here...
00199     # xlabel = time.strftime(TimeAxisGen.__labelFmt, time.localtime(highTime))
00200     # self.plotter.setLabel( 'x', xlabel )
00201
00202 def memget():
00203   import win32pdh
00204   hq = win32pdh.OpenQuery()
00205   # ch = win32pdh.AddCounter(hq, "\\\\gitow1\\Process(python)\\Private Bytes")
00206   ch = win32pdh.AddCounter(hq, "\\\\gitow1\\Process(python#1)\\Private Bytes")
00207   win32pdh.CollectQueryData(hq)
00208   type, val =win32pdh.GetFormattedCounterValue(ch,win32pdh.PDH_FMT_LONG)
00209   return val
00210
00211 def startup():
00212   # print memget()
00213   logging.basicConfig()
00214   logging.root.setLevel(logging.DEBUG)
00215
00216 def startQT(sqlDB, timeDepth, keyList, source):
00217   import sys
00218
00219   app=qt.QApplication(sys.argv)
00220   r=QtReceiver(sqlDB, timeDepth, keyList.keys())
00221   r.setSource(source)
00222
00223   gui=TrendPlotter(keyList, timeDepth/5)
00224   gui.connect(r,qt.PYSIGNAL('TrendUpdate(trendMap)'),gui.update)
00225
00226   app.connect(app,qt.SIGNAL("lastWindowClosed()"),
00227               app,qt.SLOT("quit()"))
00228
00229   app.setMainWidget(gui)
00230   gui.show()
00231
00232   r.setReceiving(1)
00233   app.exec_loop()
00234   r.shutdown()
00235
00236
00237 def configParse(configFile):
00238   global sqlDatabase, dataSource
00239   from ConfigParser import ConfigParser
00240   parser = ConfigParser()
00241   parser.read(configFile)
00242
00243   # test the config for required parameters
00244   cSect    = parser.sections()
00245   if "database" not in cSect:
00246     msg = 'Config file %s is missing required section: %s' % ( configFile, "database" )
00247     raise KeyError, msg
00248
00249   if parser.get('database', 'type') != 'sql':
00250     msg = 'HskSqlGuiReceiver requires a connection to an SQL database.\nPlease check your config file'
00251     raise KeyError, msg
00252
00253   host        = parser.get('database', 'host')
00254   user        = parser.get('database', 'user')
00255   sqlDatabase = MySQLdb.connect(host=host, db='itosdb', user=user)
00256
00257   dataSource  = parser.getint('database', 'machineid')
00258
00259
00260 def usage():
00261   return """
00262
00263 HskGuiReceiver Usage:
00264
00265 Mandatory options:
00266 --config    specify the configuration file to read
00267
00268 Optional options:
00269 --timeDepth define the time depth of the housekeeping plots.  Default is 2 hours.
00270             Units are in seconds
00271 --keyFile   define the file of variables to plot
00272             Note: keyFile format is "KEY  :  Plot title"
00273
00274 Example:
00275 $ HskGuiReceiver --dataFile c:\TEMP\lat-elf11.dat --timeDepth 3600 --keyFile keys.dat
00276
00277 """
00278
00279
00280 if __name__ == '__main__':
00281   startup()
00282
00283   # Options, first list mandatory, second list optional
00284   options = Options(['config'], ['timeDepth', 'keyFile'])
00285   try:
00286     options.parse()
00287   except Exception, msg:
00288     options.usage()
00289     raise Exception, msg
00290
00291   if options.timeDepth is not None:
00292     timeDepth = int(options.timeDepth)
00293   else:
00294     timeDepth = 2*hour
00295
00296   if options.keyFile is not None:
00297     keyFile = options.keyFile
00298     from HskReceiver import parseKeyFile
00299     keyList = parseKeyFile(keyFile)
00300   else:  # really really basic set of histos.
00301     keyList = {'LHKADAB33V'   :'AEM DAQ board 3.3 V',
00302                'LHKAEMFR11T'  :'AEM Free board 11 Temp',
00303                'LHKADABTEMP'  :'AEM DAQ board Temp',
00304                'LHKAEMFR11V1' :'AEM Free 11 HV 1',
00305                'LHKAEMFR11V2' :'AEM Free 11 HV 2',
00306                'LHKAEMFR11VD' :'AEM Free 11 VDD',
00307                }
00308
00309   configParse(options.config)
00310
00311   startQT(sqlDatabase.cursor(), timeDepth, keyList, dataSource)
00312
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskSqlInterface.py Source File

monitoring

HskSqlInterface.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Housekeeping server infrastructure"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "10/07/04"
00014 __version__  = "$Revision: 1.7 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019 import MySQLdb
00020 import logging
00021 import time
00022
00023 from LATTE.monitoring.Recorder     import Recorder
00024 from LATTE.monitoring.Receiver     import Receiver
00025 from LATTE.database.gHSK           import GHSK
00026 from LATTE.monitoring.TrendMaps    import GHSKTrendMap, makeSimpleMap
00027
00028 class HskSqlRecorder(Recorder):
00029   def __init__(self, ghsk, sqlCursor, source):
00030     Recorder.__init__(self)
00031     self.__ghsk     = ghsk
00032     self.__trendMap = GHSKTrendMap(ghsk)
00033     self.__database = sqlCursor
00034     self.__pad      = '   '
00035     self.log        = logging.getLogger('HskSqlRecorder')
00036     self.__mnemMap  = {}
00037     self.__makeMmap()
00038     self.__source   = source
00039
00040   def processTrends(self, trendables):
00041     if trendables is None: return
00042
00043     trendMap  = makeSimpleMap(trendables, self.__trendMap)
00044
00045     sqlCmd = ''
00046     sqlBase = 'insert ignore into VALfields (MNEMID,USECS,SOURCE,VALUE) VALUES '
00047     sqlCmd += sqlBase
00048     dTime = trendMap['TimeStamp']
00049     for mnem in trendMap.keys():
00050       if mnem == 'TimeStamp': continue
00051       mnemid = self.__mnemMap[mnem]
00052       value  = trendMap[mnem]
00053       if value == None: # No value, insert Null into database
00054         sqlCmd += '(%d, %f, %d, NULL),' % (mnemid, dTime, self.__source)
00055       else:
00056         sqlCmd += '(%d, %f, %d, %f),' % (mnemid, dTime, self.__source, value)
00057       if len(sqlCmd) > 4000:
00058         sqlCmd = sqlCmd.strip(',')
00059         sqlCmd += ';'
00060         self.__database.execute(sqlCmd)
00061         sqlCmd = '' + sqlBase
00062
00063     sqlCmd = sqlCmd.strip(',')
00064     if len(sqlCmd) != len(sqlBase):  # prevent call of empty set
00065       sqlCmd += ';'
00066       self.__database.execute(sqlCmd)
00067
00068     # gotta commit the transaction
00069     self.__database.connection.commit()
00070
00071   def __makeMmap(self):
00072     sqlCmd = 'select t.mnemid, t.mnem from tlmfields t;'
00073     self.__database.execute(sqlCmd)
00074     m = self.__database.fetchall()
00075     for mnemid, mnem in m:
00076       self.__mnemMap[mnem] = int(mnemid)
00077     # for k in self.__mnemMap.keys():
00078       # print k, self.__mnemMap[k]
00079
00080 class HskSqlReceiver(Receiver):
00081   def __init__(self, sqlCursor, timeDepth, trendList):
00082     Receiver.__init__(self)
00083     self.log     = logging.getLogger('HskSqlReceiver')
00084     self.__trendList = trendList
00085     self.__database  = sqlCursor
00086     self.__lastTime  = time.time() - timeDepth
00087     # self.__lastTime  = 1794 - timeDepth
00088     # self.__lastTime = 0
00089     self.__mnemMap  = {}
00090     self.__makeMmap()
00091     self.__source   = 000
00092
00093   def setSource(self, source):
00094     self.__source = source
00095
00096   def __makeMmap(self):
00097     sqlCmd = 'select t.mnemid, t.mnem from tlmfields t;'
00098     self.__database.execute(sqlCmd)
00099     m = self.__database.fetchall()
00100     for mnemid, mnem in m:
00101       self.__mnemMap[mnem] = int(mnemid)
00102     # for k in self.__mnemMap.keys():
00103       # print k, self.__mnemMap[k]
00104
00105   def receive(self):
00106     while True:
00107       alist = {}
00108       # loop once, getting the full set from the DB
00109       for mnem in self.__trendList:
00110         msg = "select v.usecs, v.value from valfields v where v.mnemid='%s' and v.usecs>%f and v.source=%d;" % (self.__mnemMap[mnem], self.__lastTime, self.__source)
00111         self.__database.execute(msg)
00112         alist[mnem] = self.__database.fetchall()
00113         # print len(alist[mnem]), alist[mnem], self.__lastTime
00114       # loop over the set and dispatch
00115       lt = 1E12
00116       timestamp = lt
00117       for mnem in self.__trendList:
00118         for i in range(len(alist[mnem])):
00119           # create a two item dict: timestamp, mnemonic
00120           timestamp, value = alist[mnem][i]
00121           # print timeValPair
00122           dispatchMap = {'TimeStamp':timestamp, mnem:value}
00123           # print "dispatching: ", i, mnem, dispatchMap
00124           self.dispatch(dispatchMap)
00125         if lt > timestamp: lt = timestamp
00126       if lt != 1E12: self.__lastTime = lt
00127       break
00128     # print "waiting for godot", self.__lastTime
00129     time.sleep(10)
00130
00131   def receiveRegion(self, start, end):
00132     # print "trendList: ", self.__trendList
00133     for mnem in self.__trendList:
00134       msg =  "select v.usecs, v.value from valfields v "
00135       msg += "where v.mnemid='%s' and v.usecs>%f and v.usecs<%f and v.source=%d;" % \
00136           (self.__mnemMap[mnem], start, end, self.__source)
00137       self.__database.execute(msg)
00138       alist = self.__database.fetchall()
00139       for i in range(len(alist)):
00140         timestamp, value = alist[i]
00141         # print timeValPair
00142         dispatchMap = {'TimeStamp':timestamp, mnem:value}
00143         # print "dispatching: ", i, mnem, dispatchMap
00144         self.dispatch(dispatchMap)
00145
00146
00147   def dispatch(self, trendMap):
00148     self.process(trendMap)
00149
00150   def process(self, dispatchMap):
00151     line = ''
00152     for item in dispatchMap:
00153       line += item + ":" + str(dispatchMap[item]) + "    "
00154     print line
00155
00156   def trendItem(self, item):
00157     if item in self.__trendList:
00158       return True
00159     else:
00160       return False
00161
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskSqlSvr.py Source File

monitoring

HskSqlSvr.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Housekeeping server infrastructure"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "07/28/04"
00014 __version__  = "$Revision: 1.4 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019 import logging as log
00020 import MySQLdb
00021
00022 # Hsk core code
00023 from LATTE.monitoring.HskRetriever import *
00024 from LATTE.monitoring.HskCollector import *
00025 from LATTE.monitoring.HskCli       import HskCli, HskHandler
00026
00027 # LATTE infrastructure
00028 from LATTE.client.gCmdCli          import CmdCli
00029 from LATTE.database.gLAT           import GLAT
00030 from LATTE.database.gHSK           import GHSK
00031 from LATTE.client.gOptions         import Options
00032
00033 latSchema = None
00034 hskSchema = None
00035 comSchema = None
00036 cmdServer = None
00037
00038 def startup():
00039   log.basicConfig()
00040   log.root.setLevel(log.DEBUG)
00041
00042
00043 def testCollector(sqlDB):
00044
00045   # set up command/housekeeping clients
00046   cmdCli = CmdCli()
00047   # hskCli = HskCli()
00048   # set up command/hsk connection handlers
00049   cmdHandler = HskHandler(cmdCli, cmdServer)
00050   # hskHandler = HskHandler(hskCli, cmdServer)
00051
00052   # set up LAT schema
00053   latDB = GLAT(cmdCli)
00054   latDB.readSchema(latSchema)
00055
00056   # set up HSK schema
00057   hskDB = GHSK(cmdCli)
00058   hskDB.readSchema(hskSchema)
00059   hskDB.applyConfig(None)
00060
00061   # set up CMD schema
00062   cmdDB = GLAT(cmdCli)
00063   cmdDB.readSchema(cmdSchema)
00064
00065   alarmSetup(hskDB, cmdDB)
00066
00067   collector = HskCollector(cmdCli)
00068   collector.setDelay(501)           # 5 second delay
00069
00070   from HskRetriever import HskLatRetriever
00071   firstRetriever = HskLatRetriever(latDB)
00072   collector.addRetriever("HSK", firstRetriever)
00073
00074   from LATTE.monitoring.HskRecorder import HskAlarmRecorder
00075   firstRecorder = HskAlarmRecorder(hskDB)
00076   collector.addRecorder(firstRecorder)
00077
00078   from LATTE.monitoring.HskSqlInterface import HskSqlRecorder
00079   secondRecorder = HskSqlRecorder(hskDB, sqlDB, source=1)
00080   collector.addRecorder(secondRecorder)
00081
00082
00083   log.info( "Collector delay: " + str(collector.getDelay()/10) + " seconds" )
00084   collector.setAcquiring(True)
00085
00086   from time import sleep
00087   try:
00088     while 1:
00089       sleep(.1)
00090   except Exception, e:
00091     collector.shutdown()
00092
00093   cmdHandler.disconnect()
00094   hskHandler.disconnect()
00095
00096
00097 def alarmSetup(hskDB, cmdDB):
00098   # Retrieve the global rule list for HSK
00099   ruleSet = hskDB.getRules()
00100   # print ruleSet
00101   # Access any of the rule objects and call clearAllActions() to clear actions.
00102   ruleSet.values()[0].clearAllActions()
00103
00104   # add some trivial yellow/red alarms
00105   from HskAlarms import yellowPrintMessage, redPrintMessage
00106   ruleSet['tempMonitor'].registerAction('yellowAction', yellowPrintMessage)
00107   # ruleSet['tempMonitor'].registerAction('redAction',    redPrintMessage)
00108
00109 def usage():
00110   return """
00111
00112 HskSvr Usage:
00113
00114 Mandatory options:
00115 --server    specify the hostname or the IP address of the teststand crate
00116             to connect to.
00117 --latSchema specify the LAT schema file that defines the detector.
00118 --hskSchema specify the Housekeeping schema file to load.
00119
00120 Optional options:
00121 --cmdSchema specify the LAT schema file to be used for commanding.
00122             Default is to use latSchema
00123
00124 Example:
00125 $ HskSvr --server lat-elf1 --latSchema LAT.xml  --hskSchema HSK.xml  --cmdSchema LAT.xml
00126
00127 """
00128
00129 if __name__ == '__main__':
00130
00131   startup()
00132
00133   # Options, first list mandatory, second list optional
00134   options = Options(['server', 'latSchema', 'hskSchema', 'sqlHost'],
00135                     ['cmdSchema',])
00136   try:
00137     options.parse()
00138   except Exception, msg:
00139     options.usage(usage())
00140     raise Exception, msg
00141
00142   cmdServer = options.server
00143   latSchema = options.latSchema
00144   hskSchema = options.hskSchema
00145   if options.cmdSchema is not None:
00146     cmdSchema = options.cmdSchema
00147   else:
00148     cmdSchema = latSchema
00149
00150   sqlDb = MySQLdb.connect(host=options.sqlHost, db='itosdb', user='itosdb')
00151
00152   testCollector(sqlDb.cursor())
00153
00154
00155
00156
00157
00158
00159
00160
00161
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskSvr.py Source File

monitoring

HskSvr.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Housekeeping server infrastructure"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "07/28/04"
00014 __version__  = "$Revision: 1.13 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019 import logging as log
00020
00021 # Hsk core code
00022 from LATTE.monitoring.HskCollector import *
00023 from LATTE.client.gOptions         import Options
00024
00025 def alarmSetup(hskDB, cmdDB):
00026   # Retrieve the global rule list for HSK
00027   ruleSet = hskDB.getRules()
00028   # print ruleSet
00029   # Access any of the rule objects and call clearAllActions() to clear actions.
00030   ruleSet.values()[0].clearAllActions()
00031
00032   # add some trivial yellow/red alarms
00033   from HskAlarms import yellowAlert, redAlert
00034   for key in ruleSet.keys():
00035     ruleSet[key].registerAction('yellowAction', yellowAlert)
00036     ruleSet[key].registerAction('redAction',    redAlert)
00037
00038 def usage():
00039   return """
00040
00041 HskSvr Usage:
00042
00043 Mandatory options:
00044 --config    specify the configuration file to read
00045
00046 Example:
00047 $ HskSvr --config hskConfig.cfg
00048
00049 """
00050
00051 if __name__ == '__main__':
00052
00053   # Options, first list mandatory, second list optional
00054   options = Options(['config'])
00055   try:
00056     options.parse()
00057   except Exception, msg:
00058     options.usage(usage())
00059     raise Exception, msg
00060
00061   # parse config file
00062   # get the configuration and verify that it's consistent
00063   config = HskConfiguration()
00064   config.read(options.config)
00065   config.verify()
00066
00067   # build the collector from the config
00068   collector = HskCollector(config)
00069   alarmSetup(collector.hskDB(), collector.latDB())
00070
00071   # turn it on
00072   collector.setAcquiring(True)
00073
00074   # wait for control-c
00075   from time import sleep
00076   try:
00077     while 1:
00078       sleep(.1)
00079   except Exception, e:
00080     collector.shutdown()
00081
00082
00083
00084
00085
00086
00087
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: HskTestSvr.py Source File

monitoring

HskTestSvr.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Housekeeping server infrastructure"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "07/28/04"
00014 __version__  = "$Revision: 1.3 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019 import logging
00020
00021 from LATTE.monitoring              import *
00022 from LATTE.client.gCmdCli          import CmdCli
00023 from LATTE.database.gLAT           import GLAT
00024 from LATTE.database.gHSK           import GHSK
00025 from HskCollector import *
00026 from HskRetriever import *
00027
00028
00029 latSchema = "c:/panetta/LATTE/repos/hskAEM.xml"
00030 hskSchema = "c:/panetta/LATTE/repos/hskTestSchema.xml"
00031 dataFile  = "c:/TEMP/database.txt"
00032 udpServerName='testTrendingServer'
00033 udpServerAddr='54320@239.255.1.14'
00034
00035
00036 def testCollector():
00037   logging.basicConfig()
00038   logging.root.setLevel(logging.DEBUG)
00039
00040   cmdCli = CmdCli()
00041   cmdCli.connect("localhost")
00042
00043   collector = HskCollector(cmdCli)
00044
00045   # set up LAT schema
00046   latDB = GLAT(cmdCli)
00047   latDB.readSchema(latSchema)
00048
00049   # set up HSK schema
00050   hskDB = GHSK(cmdCli)
00051   hskDB.readSchema(hskSchema)
00052   hskDB.applyConfig(None)
00053
00054   from HskRetriever import HskLatRetriever
00055   firstRetriever = HskLatRetriever(latDB)
00056   collector.addRetriever("HSK", firstRetriever)
00057
00058   from LATTE.monitoring.HskRecorder import HskAlarmRecorder
00059   firstRecorder = HskAlarmRecorder(hskDB)
00060   collector.addRecorder(firstRecorder)
00061
00062   from LATTE.monitoring.HskRecorder import HskFileRecorder
00063   secondRecorder = HskFileRecorder(hskDB, dataFile)
00064   collector.addRecorder(secondRecorder)
00065
00066   from LATTE.monitoring.Recorder import UDPRecorder
00067   thirdRecorder=UDPRecorder()
00068   thirdRecorder.startUDPServer(udpServerName,udpServerAddr)
00069   collector.addRecorder(thirdRecorder)
00070
00071   # from LATTE.monitoring.HskRecorder import HskAlarmRecorder
00072   # thirdRecorder = HskAlarmRecorder(hskDB)
00073   # collector.addRecorder(thirdRecorder)
00074
00075   print "Collector delay: ", collector.getDelay()/10, " seconds"
00076   collector.setAcquiring(True)
00077
00078   from time import sleep
00079   try:
00080     while 1:
00081       sleep(.1)
00082   except Exception, e:
00083     collector.shutdown()
00084
00085
00086
00087
00088
00089
00090
00091
00092 if __name__ == '__main__':
00093   testCollector()
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: hTestAppEvt.py Source File

hTestAppEvt.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example TKR test application"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/03/31 02:55:06 $").split(' ')[1]
00014 __version__  = "$Revision: 1.6 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 import threading
00022 import sys
00023
00024 from   LATTE.runcontrol.rcTransitions import rcTransitions
00025 from   LATTE.runcontrol.ArgumentImpl  import ArgumentImpl
00026
00027 from   sihippo       import *
00028 import logging       as     log
00029 import                      time
00030
00031 import LDF
00032
00033 from support.SimpleGasuExample   import *
00034 from support.MiniGLTExample      import *
00035
00036
00037 def _unsigned(arg):
00038   """\brief Convert an unsigned int argument to an unsigned long
00039
00040   This funtion exists to help format unsigned ints greater than 0x7fffffff,
00041   which in Python 2.4 and up will be displayed as signed strings.
00042   """
00043   return arg & (2L * sys.maxint + 1)
00044
00045
00046 class myTKRcontributionIterator(LDF.TKRcontributionIterator):
00047   def __init__(self, hists):
00048     LDF.TKRcontributionIterator.__init__(self)
00049     self.__hists = hists
00050
00051   def strip(self, tower, layerEnd, hit):
00052     self.__hists[0].addRow([hit])
00053
00054   def TOT(self, tower, layerEnd, tot):
00055     self.__hists[1].addRow([tot])
00056
00057 class myLATcomponentIterator(LDF.LATcomponentIterator):
00058   def __init__(self, hists):
00059     LDF.LATcomponentIterator.__init__(self)
00060     self.__tkrIterator = myTKRcontributionIterator(hists)
00061
00062   def CALcomponent(self, event, calContribution):
00063     return 0
00064
00065   def TKRcomponent(self, event, contribution):
00066     self.__tkrIterator.iterateStrips(event, contribution)
00067     self.__tkrIterator.iterateTOTs(contribution)
00068
00069     return 0
00070
00071
00072 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00073 #  the userApplication example to get the number of self triggers to take.
00074 class userArgument(ArgumentImpl):
00075   "GUI for getting the user to input some sort of value."
00076   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00077     ArgumentImpl.__init__(self, parent, name, modal, fl)
00078     self.__value = 0
00079     self.setCaption("Hello world!")
00080
00081   def OKButtonClicked(self):
00082     self.__value = int(self.ArgumentList.text().latin1())
00083     self.close()
00084
00085   def getValue(self, caption):
00086     self.setCaption(caption)
00087     self.show()
00088     self.exec_loop()
00089     return self.__value
00090
00091 class userArgText(object):
00092   "Text user interface for getting the user to input some sort of value"
00093   def __init__(self):
00094     pass
00095
00096   def getValue(self, caption):
00097     return int(raw_input("%s: " % (caption)))
00098
00099
00100 #  Example application implementation.
00101 #  Note that the name of the class must be userApplication.
00102 #  Look at rcTransitions for names of other transition methods that can be used.
00103 class userApplication(rcTransitions):
00104   "Implmentation class for a user application"
00105   def __init__(self, gui, userId, debug):
00106     rcTransitions.__init__(self, gui, userId, debug)
00107     print "userApplication.__init__()"
00108     self.__eventSem    = threading.Semaphore(0)
00109     self.__cmdSynchSem = threading.Semaphore(0)
00110
00111     self.gui.execGUImethod(self.__initHippo)
00112
00113     self.__lci         = myLATcomponentIterator(self.__hists)
00114     self.__ldbi        = LDF.LATdataBufferIterator(self.__lci)
00115
00116
00117   def getName(self):
00118     return "hTestAppEvt"
00119
00120   def setup(self):
00121     print "userApplication.setup()"
00122
00123     if self.rc is None:
00124       self.__arg = userArgText()
00125     else:
00126       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00127
00128     # Get a TEM instance
00129     if self.lat.TEMcnt() == 1:
00130       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00131     elif self.lat.TEMcnt() > 1:
00132       tem = self.lat.TEM.all()
00133     else:
00134       log.fatal("No TEM(s) found in the schema")
00135       return -1
00136
00137     tcc = tem.allTCC()
00138
00139     #
00140     # Configure GTRCs
00141     #
00142
00143     # our board is connected CC = 2, RC = 0 and CC = 3, RC = 0
00144     # reset GTRC # required before all triggers
00145
00146     trc = tcc.allTRC()
00147
00148     trc.CMD_RESET = 1
00149
00150     # number of GTFE to readout left
00151     nGTFEsLeft  = 7
00152     nGTFEsRight = 0
00153
00154     # max hits per GTRC # 31 max
00155     maxHits = 31
00156
00157     enMask  = 0x6
00158
00159     dLO = (enMask << 28) | ((nGTFEsRight << 7)& 0xF80) | (maxHits & 0x7F);
00160     print "dLO=", dLO, hex(dLO)
00161
00162     # cable controller 2, readout controller 0
00163     tcc = tem.downTCC(2)
00164     trc = tcc.downTRC(1)
00165
00166     trc.CSR = dLO
00167
00168     dLO = (enMask << 28) | ((nGTFEsLeft << 7)& 0xF80) | (maxHits & 0x7F);
00169     print "dLO=", dLO, hex(dLO)
00170
00171     # cable controller 3, readout controller 0
00172     tcc = tem.downTCC(3)
00173     trc = tcc.downTRC(1)
00174
00175     trc.CSR = dLO
00176
00177     #
00178     # Configure GTFEs
00179     #
00180
00181     tfe = trc.allTFE()
00182     tfe.TRIG_MASK = 0x0
00183     tfe.DATA_MASK = 0x0
00184     tfe.CALIB_MASK = 0x0
00185     tfe.DAC = 0x00001902
00186     # configure front ends # all listen to left
00187     tfe.MODE = 0
00188     #tfe = trc.downTFE(0)
00189
00190     # configure default DACs for threshold and calibration
00191     # Calibration DAC Range and Resolution
00192     # Low Range (B6=0):  DAC output voltage in mV = 1.57 + 1.53*DAC_Value
00193     # High Range (B6=1): DAC output voltage in mV = 15.0 + 14.6*DAC_Value
00194     # Discriminator Threshold DAC Range and Resolution
00195     # Low Range (B6=0):  DAC output voltage in mV = 4.5 + 4.5*DAC_Value
00196     # High Range (B6=1): DAC output voltage in mV = 12.9 + 12.9*DAC_Value
00197
00198
00199     # calRng = 1
00200     # thrRng = 0
00201     # calDAC = 60
00202     # thrDAC = 10
00203
00204     tfe.DAC = 0x00001952  # based on the above Rng and DAC values
00205
00206     # enable GTFE for data taking # all channels
00207     tfe.TRIG_MASK = 0xffffffffffffffff
00208     tfe.DATA_MASK = 0xffffffffffffffff
00209
00210     # Cal strobe channels 4 and 48 only
00211     tfe.CALIB_MASK = 0x0001000000000010
00212
00213     #~ #Mask of the following Registers
00214     #~ tfe = trc.downTFE(13)
00215     #~ tfe.DATA_MASK = 0x0L
00216     #~ tfe.CALIB_MASK = 0x0L
00217     #~ tfe.TRIG_MASK = 0x0L
00218
00219     #~ tfe = trc.downTFE(14)
00220     #~ tfe.DATA_MASK = 0x0L
00221     #~ tfe.CALIB_MASK = 0x0L
00222     #~ tfe.TRIG_MASK = 0x0L
00223
00224     #~ tfe = trc.downTFE(19)
00225     #~ #tfe.DATA_MASK = 0x0L
00226     #~ tfe.CALIB_MASK = 0x0L
00227     #~ tfe.TRIG_MASK = 0x0L
00228
00229     #~ tfe = trc.downTFE(20)
00230     #~ #tfe.DATA_MASK = 0x0L
00231     #~ tfe.CALIB_MASK = 0x0L
00232     #~ tfe.TRIG_MASK = 0x0L
00233
00234     # Two choices for the trigger, GEM and MiniGLT
00235     if self.lat.existsGEM():
00236       self.trigger( SimpleGasuExample() )
00237     else:
00238       self.trigger( MiniGLTExample() )
00239
00240     # A state transition can be rejected by not returning None
00241     return None
00242
00243   def startRun(self):
00244     log.debug("userApplication.startRun()")
00245
00246     caption = "Enter number of triggers to take"
00247     if self.gui is None:
00248       cnt = self.__arg.getValue(caption)
00249     else:
00250       cnt = self.gui.execGUImethod(self.__arg.getValue, caption)
00251       # Allow the C++ object to be deleted
00252       self.__arg.deleteLater()
00253
00254     # The user pressed 'Cancel'
00255     if cnt is None:  return -1
00256     self.__cnt = cnt
00257
00258     self.gui.execGUImethod(self.__initPlots)
00259     self.__cmdSynchQuit = False
00260
00261     # A state transition can be rejected by not returning None
00262     return None
00263
00264   def stopRun(self):
00265     self.setCompletionStatus(self.COMPL_STATUS_SUCCESS)
00266     self.__cmdSynchQuit = True
00267     self.__eventSem.release()
00268
00269     # The STOP_RUN transition can not be rejected
00270
00271   def resume(self):
00272     # Issue self trigger to make up for the one that was lost during PAUSE
00273     self.trigger().solicit()
00274
00275     return None
00276
00277   def stop (self):
00278     return self.stopRun()
00279
00280   def process(self, (status, buffer)):
00281     "Method called back for each data event taken"
00282     ##log.debug("userApplication.process()")
00283
00284     evtCli = self.evtCli
00285
00286     if status != 0:
00287       if evtCli.isGGLTStatus():
00288         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00289       elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00290         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00291       self.__eventSem.release()
00292       return
00293     try:
00294       # In the future this event may contain additional data
00295       if evtCli.isSweepEvent(): return
00296     except:
00297       # Event summary word inaccessible, handle the bad event here
00298       log.exception("")
00299       return
00300
00301     self.__ldbi.iterate(buffer, len(buffer))
00302
00303     self.__hists[2].addRow([evtCli.getEvtSize()])  #event.length()])
00304
00305     # Get next event triggered
00306     self.__eventSem.release()
00307
00308
00309   def commandSynch(self):
00310     "Method called by the command synchronization task"
00311     trigger  = self.trigger()
00312     eventSem = self.__eventSem
00313     t0  = time.time()
00314     cnt = 0
00315     count = self.__cnt
00316
00317     # Wait for START_RUN to enable triggers
00318     trigger.waitForMaskEnable()
00319
00320     while cnt < count and not self.__cmdSynchQuit:
00321       cnt = cnt + 1
00322       trigger.solicit()                 # Issue an internal trigger
00323       eventSem.acquire()                # Wait for the event to be processed
00324       time.sleep(.001)
00325
00326     wc = WindowController.instance()
00327     canvas = wc.currentCanvas()
00328     canvas.setIntervalEnabled ( 0 )
00329     dT = time.time() - t0
00330     if dT == 0.0:  dT = 0.000001
00331     print "%s processed %d events in %.3f seconds = %.1f events/second" % \
00332           (self.getName(), cnt, dT, self.evtCnt/dT)
00333
00334     # Get out of waiting when in suite or standalone mode
00335     self.sync()
00336
00337     # execute the GUI functions for stopRun, just in case
00338     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00339       if self.rc is not None:
00340         self.rc.doStop()
00341
00342   def wait(self):
00343     self.__cmdSynchSem.acquire()
00344
00345   def sync(self):
00346     if __name__ == "__main__" or self.isRunFromSuite():
00347       self.__cmdSynchSem.release()
00348
00349   def __initHippo(self):
00350     self.__label  = [0, 0, 0]
00351     self.__label[0] = ['Strip Hits']
00352     self.__label[1] = ['TOTs']
00353     self.__label[2] = ['Event Size']
00354     ntc = NTupleController.instance()
00355     self.__hists  = [0, 0, 0]
00356     self.__hists[0] = ntc.createNTuple(1)
00357     self.__hists[1] = ntc.createNTuple(1)
00358     self.__hists[2] = ntc.createNTuple(1)
00359     self.__hists[0].setTitle('TKR Event Strip Readout')
00360     self.__hists[1].setTitle('TKR Event TOT Readout')
00361     self.__hists[2].setTitle('Event length')
00362     self.__hists[0].setLabels(self.__label[0])
00363     self.__hists[1].setLabels(self.__label[1])
00364     self.__hists[2].setLabels(self.__label[2])
00365     if __name__ == "__main__":
00366 ##       app = HDApp()
00367 ##       canvas = app.canvas()
00368       app = QApplication ( sys.argv )
00369       canvas = CanvasWindow()
00370       canvas.show()
00371     else:
00372       wc = WindowController.instance()
00373       canvas = wc.currentCanvas()
00374 ##  already done by main applicaton:    canvas.show()
00375 ##     ntuple_list = [0.0]
00376 ##     self.__nt.addRow(ntuple_list)
00377 ##    self.__nt2.addRow(ntuple_list)
00378
00379 ## see new way below
00380 ##     hist = Display('Histogram',self.__nt,'Strip Hits')
00381 ##     hist2 = Display('Histogram',self.__nt2,'Event
00382
00383   def __initPlots(self):
00384     wc = WindowController.instance()
00385     canvas = wc.currentCanvas()
00386     canvas.clear()
00387     self.__hists[0].clear()
00388     self.__hists[1].clear()
00389     self.__hists[2].clear()
00390     dc = DisplayController.instance()
00391     hist1 = dc.createDisplay ( 'Histogram', self.__hists[0], self.__label[0] )
00392     hist2 = dc.createDisplay ( 'Histogram', self.__hists[1], self.__label[1] )
00393     hist3 = dc.createDisplay ( 'Histogram', self.__hists[2], self.__label[2] )
00394     canvas.addDisplay(hist1)
00395     canvas.addDisplay(hist2)
00396     canvas.addDisplay(hist3)
00397     self.__hists[0].setIntervalCount ( 2000 )
00398     self.__hists[1].setIntervalCount ( 1000 )
00399     self.__hists[2].setIntervalCount ( 400 )
00400     canvas.setIntervalEnabled ( 0 )
00401     canvas.show()
00402     canvas.setIntervalEnabled ( 1 )
00403
00404 #Standalone mode:
00405 if __name__ == "__main__":
00406   import sys
00407   from qt import *
00408   from sihippo import *
00409
00410   ua = userApplication(None, 321, 0)
00411   ua.rcSetup('../repos/simpleTemSchema.xml')
00412   ua.rcStartRun()
00413   ua.wait()
00414   ua.rcStopRun()
00415   ua.rcTeardown()
00416   raw_input("Press any key to end")
00417
00418 # History:
00419 #     $Log: hTestAppEvt.py,v $
00420 #     Revision 1.6  2005/03/31 02:55:06  stuvi
00421 #     Fixed TRCs according to Selim's teststand.
00422 #
00423 #     Revision 1.5  2005/03/30 06:04:33  stuvi
00424 #     Removed configuration settings which should normally come from the schema.
00425 #
00426 #     Revision 1.4  2005/03/21 17:58:11  claus
00427 #     Modified to use the first TEM found in the schema, if only one is there, or
00428 #     broadcast to all TEMs if there are multiple.
00429 #
00430 #     Revision 1.3  2004/10/22 20:32:48  stuvi
00431 #     Fixed log.exception()
00432 #
00433 #     Revision 1.2  2004/08/18 18:00:15  stuvi
00434 #     Updated for LATTE 4.
00435 #     All hippo functions go through the Qt GUI bridge now.
00436 #
00437 #     Revision 1.1  2004/08/07 02:14:33  stuvi
00438 #     no message
00439 #
00440 #     Revision 1.8  2004/07/15 22:58:35  stuvi
00441 #     Added waitForMaskEnable
00442 #
00443 #     Revision 1.7  2004/05/03 21:19:46  stuvi
00444 #     Moved non-Runcontrol scripts to the support directory and modified imports accordingly.
00445 #
00446 #     Revision 1.6  2004/04/17 02:22:17  stuvi
00447 #     Various Hippo related fixes
00448 #     Added teardown() to delete the C++ object for the userArgument
00449 #
00450 #     Revision 1.5  2004/04/08 03:16:44  stuvi
00451 #     Added canvas clearing.
00452 #
00453 #     Revision 1.4  2004/04/08 01:48:42  claus
00454 #     Reworked to work with LDF.
00455 #
00456 #     Revision 1.3  2004/04/07 22:20:51  stuvi
00457 #     no message
00458 #
00459 #     Revision 1.2  2004/03/10 22:24:50  panetta
00460 #     Upgraded trigger interface.
00461 #     Removed dependencies on self.glt.
00462 #
00463 #     Revision 1.1  2004/01/30 04:39:53  claus
00464 #     Test application to histogram data from EBF events.
00465 #     This is not yet working.
00466 #
00467 #     Revision 1.9  2003/01/12 19:45:41  pfkeb
00468 #     Move interval counting to ntuple
00469 #
00470 #     Revision 1.8  2003/01/08 00:22:21  pfkeb
00471 #     New interface to NTupleController
00472 #
00473 #     Revision 1.7  2003/01/06 23:57:21  claus
00474 #     Merged Ric's changes with Paul's
00475 #
00476 #     Revision 1.6  2003/01/05 00:18:50  pfkeb
00477 #     Make use of new HippoDraw features
00478 #
00479 #     Revision 1.5  2002/12/23 19:00:25  pfkeb
00480 #     Add HippoDraw to RunControl
00481 #
00482 #     Revision 1.4  2002/12/19 19:59:52  claus
00483 #     Mods for Hippo
00484 #
00485 #     Revision 1.3  2002/12/11 21:18:07  stuvi
00486 #     Changed glt register assignments to bit field assignments
00487 #
00488 #     Revision 1.2  2002/12/10 02:42:03  stuvi
00489 #     Put the event size plotting outside the tracker strip look
00490 #
00491 #     Revision 1.1  2002/12/10 00:59:16  stuvi
00492 #     Runcontrol example that uses Hippo. Currently it doesn't work in GUI mode.
00493 #
00494 #     Revision 1.4  2002/12/02 17:17:09  claus
00495 #     Added provision to allow application to run stand-alone
00496 #
00497 #     Revision 1.3  2002/11/28 02:02:04  claus
00498 #     Shuffled constructor arguments
00499 #
00500 #     Revision 1.2  2002/11/27 23:49:27  claus
00501 #     Initialize semaphore with zero count
00502 #
00503 #     Revision 1.1  2002/11/27 05:02:48  claus
00504 #     Initial version of Run Control
00505 #
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: hTestAppTkr.py Source File

hTestAppTkr.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example TKR test application"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/03/30 06:04:33 $").split(' ')[1]
00014 __version__  = "$Revision: 1.6 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import threading
00021 import sys
00022
00023 from   LATTE.runcontrol.rcTransitions import rcTransitions
00024 from   LATTE.runcontrol.ArgumentImpl  import ArgumentImpl
00025
00026 from   sihippo       import *
00027 from   time          import sleep
00028 import logging       as     log
00029
00030 from support.SimpleGasuExample   import *
00031 from support.MiniGLTExample      import *
00032
00033 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00034 #  the userApplication example to get the number of self triggers to take.
00035 class userArgument(ArgumentImpl):
00036   "GUI for getting the user to input some sort of value."
00037   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00038     ArgumentImpl.__init__(self, parent, name, modal, fl)
00039     self.__value = 0
00040     self.setCaption("Hello world!")
00041
00042   def OKButtonClicked(self):
00043     self.__value = int(self.ArgumentList.text().latin1())
00044     self.close()
00045
00046   def CancelButtonClicked(self):
00047     self.__value = None
00048     self.close()
00049
00050   def getValue(self, caption):
00051     self.setCaption(caption)
00052     self.show()
00053     self.exec_loop()
00054     return self.__value
00055
00056 class userArgText(object):
00057   "Text user interface for getting the user to input some sort of value"
00058   def __init__(self):
00059     pass
00060
00061   def getValue(self, caption):
00062     return int(raw_input("%s: " % (caption)))
00063
00064
00065 #  Example application implementation.
00066 #  Note that the name of the class must be userApplication.
00067 #  Look at rcTransitions for names of other transition methods that can be used.
00068 class userApplication(rcTransitions):
00069   "Implmentation class for a user application"
00070   def __init__(self, gui, userId, debug):
00071     rcTransitions.__init__(self, gui, userId, debug)
00072     log.debug("userApplication.__init__()")
00073     self.__eventSem    = threading.Semaphore(0)
00074     self.__cmdSynchSem = threading.Semaphore(0)
00075
00076   def getName(self):
00077     return __name__
00078
00079   def setup(self):
00080     log.debug("userApplication.setup()")
00081
00082     if self.gui is None:
00083       self.__arg = userArgText()
00084     else:
00085       self.__arg = self.gui.createGUI(userArgument, self.gui, 'test1', 1)
00086
00087     self.gui.execGUImethod(self.__initHippo)
00088
00089     # Get a TEM instance
00090     if self.lat.TEMcnt() == 1:
00091       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00092     elif self.lat.TEMcnt() > 1:
00093       tem = self.lat.TEM.all()
00094     else:
00095       log.fatal("No TEM(s) found in the schema")
00096       return -1
00097
00098     tcc = tem.allTCC()
00099
00100     #
00101     # Configure GTRCs
00102     #
00103
00104     # our board is connected CC = 2, RC = 0 and CC = 3, RC = 0
00105     # reset GTRC # required before all triggers
00106
00107     trc = tcc.allTRC()
00108
00109     trc.CMD_RESET = 1
00110
00111     # number of GTFE to readout left
00112     nGTFEsLeft  = 7
00113     nGTFEsRight = 0
00114
00115     # max hits per GTRC # 31 max
00116     maxHits = 31
00117
00118     enMask  = 0x6
00119
00120     dLO = (enMask << 28) | ((nGTFEsRight << 7)& 0xF80) | (maxHits & 0x7F);
00121     log.debug("dLO= %d %s" % (dLO, hex(dLO)))
00122
00123     # cable controller 2, readout controller 0
00124     tcc = tem.downTCC(2)
00125     trc = tcc.downTRC(1)
00126
00127     trc.CSR = dLO
00128
00129     dLO = (enMask << 28) | ((nGTFEsLeft << 7)& 0xF80) | (maxHits & 0x7F);
00130     log.debug("dLO= %d %s" % (dLO, hex(dLO)))
00131
00132     # cable controller 3, readout controller 0
00133     tcc = tem.downTCC(3)
00134     trc = tcc.downTRC(1)
00135
00136     trc.CSR = dLO
00137
00138     #
00139     # Configure GTFEs
00140     #
00141
00142     tfe = trc.allTFE()
00143     tfe.TRIG_MASK = 0x0
00144     tfe.DATA_MASK = 0x0
00145     tfe.CALIB_MASK = 0x0
00146     #tfe.DAC = 0x00001902
00147     tfe.DAC = 0x00000000
00148     # configure front ends # all listen to left
00149     tfe.MODE = 0
00150     #tfe = trc.downTFE(0)
00151
00152     # configure default DACs for threshold and calibration
00153     # Calibration DAC Range and Resolution
00154     # Low Range (B6=0):  DAC output voltage in mV = 1.57 + 1.53*DAC_Value
00155     # High Range (B6=1): DAC output voltage in mV = 15.0 + 14.6*DAC_Value
00156     # Discriminator Threshold DAC Range and Resolution
00157     # Low Range (B6=0):  DAC output voltage in mV = 4.5 + 4.5*DAC_Value
00158     # High Range (B6=1): DAC output voltage in mV = 12.9 + 12.9*DAC_Value
00159
00160
00161     # calRng = 1
00162     # thrRng = 0
00163     # calDAC = 60
00164     # thrDAC = 10
00165
00166     #tfe.DAC = 0x00001952  # based on the above Rng and DAC values
00167     tfe.DAC = 0x00000000
00168
00169     # enable GTFE for data taking # all channels
00170     tfe.TRIG_MASK = 0xffffffffffffffff
00171     tfe.DATA_MASK = 0xffffffffffffffff
00172
00173     # Cal strobe channels 4 and 48 only
00174     tfe.CALIB_MASK = 0x0001000000000010
00175
00176     #~ #Mask of the following Registers
00177     #~ tfe = trc.downTFE(13)
00178     #~ tfe.DATA_MASK = 0x0L
00179     #~ tfe.CALIB_MASK = 0x0L
00180     #~ tfe.TRIG_MASK = 0x0L
00181
00182     #~ tfe = trc.downTFE(14)
00183     #~ tfe.DATA_MASK = 0x0L
00184     #~ tfe.CALIB_MASK = 0x0L
00185     #~ tfe.TRIG_MASK = 0x0L
00186
00187     #~ tfe = trc.downTFE(19)
00188     #~ #tfe.DATA_MASK = 0x0L
00189     #~ tfe.CALIB_MASK = 0x0L
00190     #~ tfe.TRIG_MASK = 0x0L
00191
00192     #~ tfe = trc.downTFE(20)
00193     #~ #tfe.DATA_MASK = 0x0L
00194     #~ tfe.CALIB_MASK = 0x0L
00195     #~ tfe.TRIG_MASK = 0x0L
00196
00197     # Two choices for the trigger, GEM and MiniGLT
00198     if self.lat.existsGEM():
00199       self.trigger( SimpleGasuExample() )
00200     else:
00201       self.trigger( MiniGLTExample() )
00202
00203     # A state transition can be rejected by not returning None
00204     return None
00205
00206   def startRun(self):
00207     log.debug("userApplication.startRun()")
00208
00209     caption = "Enter number of triggers to take"
00210     if self.gui is None:
00211       cnt = self.__arg.getValue(caption)
00212     else:
00213       cnt = self.gui.execGUImethod(self.__arg.getValue, caption)
00214
00215     # The user pressed 'Cancel'
00216     if cnt is None:  return -1
00217     self.__cnt = cnt
00218     self.gui.execGUImethod(self.__initPlots)
00219
00220     # Spawn a thread to synchronize commands with events
00221     self.__cmdSynchQuit = False
00222
00223     # A state transition can be rejected by not returning None
00224     return None
00225
00226   def stopRun(self):
00227     self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00228     self.__cmdSynchQuit = True
00229     self.__eventSem.release()
00230     # The STOP_RUN transition can not be rejected
00231
00232   def resume(self):
00233     # Issue self trigger to make up for the one that was lost during PAUSE
00234     self.trigger().solicit()
00235     return None
00236
00237   def stop (self):
00238     return self.stopRun()
00239
00240   def teardown(self):
00241     log.debug("userApplication.teardown()")
00242     # Allow the C++ object to be deleted
00243     if self.gui is not None and self.__arg is not None:
00244       self.__arg.deleteLater()
00245
00246   def process(self, (status, buffer)):
00247     "Method called back for each data event taken"
00248     ###print "userApplication.process()"
00249
00250     evtCli = self.evtCli
00251
00252     if status != 0:
00253       if evtCli.isGGLTStatus():
00254         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00255       elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00256         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00257       self.__eventSem.release()
00258       return
00259     try:
00260       # In the future this event may contain additional data
00261       if evtCli.isSweepEvent(): return
00262     except:
00263       # Event summary word inaccessible, handle the bad event here
00264       log.exception("")
00265       return
00266
00267     evtCli.evDumpTKR()
00268     for stripData in evtCli.evt.TKRstrips:
00269       self.__nt.addRow([stripData.strip.ui])
00270     self.__nt2.addRow([evtCli.getEvtSize()])
00271
00272     # Get next event triggered
00273     self.__eventSem.release()
00274
00275   def commandSynch(self):
00276     "Method called by the command synchronization task"
00277     import time
00278     trigger  = self.trigger()
00279     eventSem = self.__eventSem
00280     # Drain the semaphore release count
00281     # Handles the case when the stop run release collided with a trigger release
00282     while eventSem.acquire(0):  pass
00283
00284     t0  = time.time()
00285
00286     # Compensate for the extra CMD_SELF_TRIGGER below
00287     cnt = 1
00288     count = self.__cnt
00289
00290     # Wait for START_RUN to enable triggers
00291     trigger.waitForMaskEnable()
00292
00293     trigger.solicit()                   # Issue an internal trigger
00294     eventSem.acquire()                  # Wait for the event to be processed
00295
00296     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00297
00298     while cnt < count and not self.__cmdSynchQuit:
00299       cnt += 1
00300       trigger.solicit()                 # Issue an internal trigger
00301       eventSem.acquire()                # Wait for the event to be processed
00302       #trigger.disable()                # Disable GLT triggers
00303       # Do stuff
00304       #trigger.enable()                 # Enable GLT triggers
00305
00306     t2 = trigger.getTimeStamp()         # Get the last trigger timestamp
00307     # When we get here the triggers should still be enabled.
00308     # If the glt.MASK needs to be set through any other means
00309     # then it needs to be restored to its SETUP value here.
00310
00311     if t1 is None:
00312       t1 = t0
00313     if t2 is None:
00314       t2 = time.time()
00315     dT = t2 - t1
00316     if dT == 0.0:  dT = 0.000001
00317     log.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00318              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00319
00320     # Get out of waiting when in standalone mode
00321     self.sync()
00322
00323     # execute the GUI functions for stopRun, just in case
00324     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00325       if self.gui is not None:
00326         self.gui.doStop()
00327
00328   def wait(self):
00329     self.__cmdSynchSem.acquire()
00330
00331   def sync(self):
00332     if __name__ == "__main__":
00333       self.__cmdSynchSem.release()
00334
00335
00336   def __initHippo(self):
00337     label1 = ['Strip Hits']
00338     label2 = ['Event Size']
00339     ntc = NTupleController.instance()
00340     self.__nt = ntc.createNTuple(1)
00341     self.__nt2 = ntc.createNTuple ( label2 )
00342     self.__nt.setTitle('Event Readout #1')
00343     self.__nt2.setTitle('Event Readout #2')
00344     self.__nt.setLabels(label1)
00345 #    self.__nt2.setLabels(label2)
00346     self.__nt.reserve ( 512 )
00347     self.__nt2.reserve ( 512 )
00348     if __name__ == "__main__":
00349 ##       app = HDApp()
00350 ##       canvas = app.canvas()
00351       self.__canvas = CanvasWindow()
00352       self.__canvas.show()
00353     else:
00354       wc = WindowController.instance()
00355       self.__canvas = wc.currentCanvas()
00356 ##  already done by main applicaton:    canvas.show()
00357 ##     ntuple_list = [0.0]
00358 ##     self.__nt.addRow(ntuple_list)
00359 ##    self.__nt2.addRow(ntuple_list)
00360
00361 ## see new way below
00362 ##     hist = Display('Histogram',self.__nt,'Strip Hits')
00363 ##     hist2 = Display('Histogram',self.__nt2,'Event
00364
00365   def __initPlots(self):
00366     label1 = ['Strip Hits']
00367     label2 = ['Event Size']
00368     self.__canvas.clear()
00369     self.__nt.clear()
00370     self.__nt2.clear()
00371     self.__nt.setIntervalCount ( 500 )
00372     self.__nt2.setIntervalCount ( 100 )
00373     dc = DisplayController.instance()
00374     self.__hist = dc.createDisplay ( 'Histogram', self.__nt, label1 )
00375     self.__hist2 = dc.createDisplay ( 'Histogram', self.__nt2, label2 )
00376     self.__canvas.addDisplay(self.__hist)
00377     self.__canvas.addDisplay(self.__hist2)
00378     self.__canvas.setIntervalEnabled ( 1 )
00379     self.__canvas.show()
00380
00381 # Standalone mode:
00382 if __name__ == "__main__":
00383   from qt import *
00384   app = QApplication ( sys.argv )
00385   ua = userApplication(None, 321, 0)
00386   ua.rcSetup('../repos/simpleTemSchema.xml')
00387   ua.rcStartRun()
00388   ua.wait()
00389   ua.rcStopRun()
00390   ua.rcTeardown()
00391   app.exec_loop()
00392
00393 # History:
00394 #     $Log: hTestAppTkr.py,v $
00395 #     Revision 1.6  2005/03/30 06:04:33  stuvi
00396 #     Removed configuration settings which should normally come from the schema.
00397 #
00398 #     Revision 1.5  2005/03/24 03:37:09  stuvi
00399 #     Removed TEM reset and other system register related accesses.
00400 #
00401 #     Revision 1.4  2005/03/21 17:58:11  claus
00402 #     Modified to use the first TEM found in the schema, if only one is there, or
00403 #     broadcast to all TEMs if there are multiple.
00404 #
00405 #     Revision 1.3  2004/10/22 20:32:48  stuvi
00406 #     Fixed log.exception()
00407 #
00408 #     Revision 1.2  2004/08/18 18:00:15  stuvi
00409 #     Updated for LATTE 4.
00410 #     All hippo functions go through the Qt GUI bridge now.
00411 #
00412 #     Revision 1.1  2004/08/07 02:14:33  stuvi
00413 #     no message
00414 #
00415 #     Revision 1.16  2004/07/09 23:14:17  stuvi
00416 #     Added "operatorobj" preference that contains the rcUser object and left the "operator" preference to contain the user name.
00417 #
00418 #     Revision 1.15  2004/05/03 21:19:47  stuvi
00419 #     Moved non-Runcontrol scripts to the support directory and modified imports accordingly.
00420 #
00421 #     Revision 1.14  2004/04/17 02:22:17  stuvi
00422 #     Various Hippo related fixes
00423 #     Added teardown() to delete the C++ object for the userArgument
00424 #
00425 #     Revision 1.13  2004/03/19 00:17:31  stuvi
00426 #     The plots are now cleared every time the test is run.
00427 #
00428 #     Revision 1.12  2004/03/10 22:24:50  panetta
00429 #     Upgraded trigger interface.
00430 #     Removed dependencies on self.glt.
00431 #
00432 #     Revision 1.11  2004/02/24 02:13:34  stuvi
00433 #     Changes for long transition support.
00434 #
00435 #     Revision 1.10  2003/11/04 18:30:52  panetta
00436 #     Changed the commandSynch logic so that the enableMask() call would not pose a threat to snapshot taking.
00437 #
00438 #     Revision 1.9  2003/10/31 01:09:37  panetta
00439 #     1)  Moved register writes from startRun to setup
00440 #     2)  Added GLT enabling logic to __commandSynch
00441 #     3)  Gave example of getting the start/stop time from the hardware/event stream
00442 #
00443 #     Revision 1.8  2003/07/17 00:01:35  stuvi
00444 #     no message
00445 #
00446 #     Revision 1.7  2003/06/13 23:26:24  stuvi
00447 #     Added TEM reset
00448 #
00449 #     Revision 1.6  2003/04/09 00:45:15  stuvi
00450 #     Commented out references to DATA_MASKS register which should not be touched during script execution.
00451 #
00452 #     Revision 1.5  2003/04/01 21:04:59  stuvi
00453 #     Fixed event count discrepancy when the run is stopped in the middle.
00454 #
00455 #     Revision 1.4  2003/03/31 19:28:53  stuvi
00456 #     Fixed name
00457 #
00458 #     Revision 1.3  2003/03/26 21:59:36  stuvi
00459 #     Fixed standalone mode
00460 #
00461 #     Revision 1.2  2003/03/25 04:52:40  stuvi
00462 #     Reduced event timeout value.
00463 #     Changed to no diags.
00464 #     Made sure the semaphores are drained
00465 #
00466 #     Revision 1.1  2003/03/11 21:20:54  stuvi
00467 #     Moved from RunControl directory
00468 #
00469 #     Revision 1.12  2003/02/06 05:23:15  claus
00470 #     Added resume; StopRun bug fix
00471 #
00472 #     Revision 1.11  2003/02/06 01:31:23  stuvi
00473 #     Added a delay in commandsnyc
00474 #
00475 #     Revision 1.10  2003/01/15 16:47:56  stuvi
00476 #     Delay the showing of canvas until the test app starts
00477 #
00478 #     Revision 1.9  2003/01/12 19:45:41  pfkeb
00479 #     Move interval counting to ntuple
00480 #
00481 #     Revision 1.8  2003/01/08 00:22:21  pfkeb
00482 #     New interface to NTupleController
00483 #
00484 #     Revision 1.7  2003/01/06 23:57:21  claus
00485 #     Merged Ric's changes with Paul's
00486 #
00487 #     Revision 1.6  2003/01/05 00:18:50  pfkeb
00488 #     Make use of new HippoDraw features
00489 #
00490 #     Revision 1.5  2002/12/23 19:00:25  pfkeb
00491 #     Add HippoDraw to RunControl
00492 #
00493 #     Revision 1.4  2002/12/19 19:59:52  claus
00494 #     Mods for Hippo
00495 #
00496 #     Revision 1.3  2002/12/11 21:18:07  stuvi
00497 #     Changed glt register assignments to bit field assignments
00498 #
00499 #     Revision 1.2  2002/12/10 02:42:03  stuvi
00500 #     Put the event size plotting outside the tracker strip look
00501 #
00502 #     Revision 1.1  2002/12/10 00:59:16  stuvi
00503 #     Runcontrol example that uses Hippo. Currently it doesn't work in GUI mode.
00504 #
00505 #     Revision 1.4  2002/12/02 17:17:09  claus
00506 #     Added provision to allow application to run stand-alone
00507 #
00508 #     Revision 1.3  2002/11/28 02:02:04  claus
00509 #     Shuffled constructor arguments
00510 #
00511 #     Revision 1.2  2002/11/27 23:49:27  claus
00512 #     Initialize semaphore with zero count
00513 #
00514 #     Revision 1.1  2002/11/27 05:02:48  claus
00515 #     Initial version of Run Control
00516 #
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: hTestEnv.py Source File

hTestEnv.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example TKR test application"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "11/21/2002"
00014 __version__  = "$Revision: 1.2 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import threading
00020 from   sihippo       import *
00021 from   time          import sleep, time
00022 import logging       as     log
00023
00024 from   LATTE.runcontrol.rcTransitions import rcTransitions
00025 from   LATTE.runcontrol.ArgumentImpl  import ArgumentImpl
00026
00027 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00028 #  the userApplication example to get the number of self triggers to take.
00029 class userArgument(ArgumentImpl):
00030   "GUI for getting the user to input some sort of value."
00031   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00032     ArgumentImpl.__init__(self, parent, name, modal, fl)
00033     self.__value = 0
00034     self.setCaption("Hello world!")
00035
00036   def OKButtonClicked(self):
00037     self.__value = int(self.ArgumentList.text().latin1())
00038     self.close()
00039
00040   def CancelButtonClicked(self):
00041     self.__value = None
00042     self.close()
00043
00044   def getValue(self, caption):
00045     self.setCaption(caption)
00046     self.show()
00047     self.exec_loop()
00048     return self.__value
00049
00050 class userArgText(object):
00051   "Text user interface for getting the user to input some sort of value"
00052   def __init__(self):
00053     pass
00054
00055   def getValue(self, caption):
00056     return int(raw_input("%s: " % (caption)))
00057
00058
00059 #  Example application implementation.
00060 #  Note that the name of the class must be userApplication.
00061 #  Look at rcTransitions for names of other transition methods that can be used.
00062 class userApplication(rcTransitions):
00063   "Implmentation class for a user application"
00064   def __init__(self, gui, userId, debug):
00065     rcTransitions.__init__(self, gui, userId, debug)
00066     log.debug("userApplication.__init__()")
00067     self.__cmdSynchSem = threading.Semaphore(0)
00068
00069   def getName(self):
00070     return __name__
00071
00072   def setup(self):
00073     log.debug("userApplication.setup()")
00074     if self.gui is None:
00075       self.__arg = userArgText()
00076     else:
00077       self.__arg = self.gui.createGUI(userArgument, self.gui, 'test1', 1)
00078
00079     self.gui.execGUImethod(self.__initHippo)
00080
00081     # A state transition can be rejected by not returning None
00082     return None
00083
00084
00085   def startRun(self):
00086     log.debug("userApplication.startRun()")
00087     self.__cmdSynchQuit = False
00088     caption = "Enter number of data groups to read"
00089     if self.gui is None:
00090       cnt = self.__arg.getValue(caption)
00091     else:
00092       cnt = self.gui.execGUImethod(self.__arg.getValue, caption)
00093
00094     # The user pressed 'Cancel'
00095     if cnt is None:  return -1
00096     self.__cnt = cnt
00097
00098     self.gui.execGUImethod(self.__initPlots)
00099
00100     # A state transition can be rejected by not returning None
00101     return None
00102
00103   def stopRun(self):
00104     self.__cmdSynchQuit = True
00105
00106     # The STOP_RUN transition can not be rejected
00107
00108   def stop (self):
00109     return self.stopRun()
00110
00111   def teardown(self):
00112     log.debug("userApplication.teardown()")
00113     # Allow the C++ object to be deleted
00114     if self.gui is not None and self.__arg is not None:
00115       self.__arg.deleteLater()
00116
00117   def process(self, (status, buffer)):
00118     "Method called back for each data event taken"
00119     ###print "userApplication.process()"
00120
00121   #def __commandSynch(self, count):
00122   def commandSynch(self):
00123     "Method called by the command synchronization task"
00124     cnt = 0
00125     count = self.__cnt
00126     tic = self.lat.TEM[0].TIC
00127     while cnt < count and not self.__cmdSynchQuit:
00128       cnt = cnt + 1
00129       volts = tic.adc_tem_digital_3_3v
00130       amps = tic.adc_tem_digital_3_3i
00131       self.__nt.addRow([cnt, volts])
00132       self.__nt2.addRow([cnt, amps])
00133       sleep(.1)
00134
00135     # Get out of waiting when in standalone mode
00136     self.sync()
00137
00138     # execute the GUI functions for stopRun, just in case
00139     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00140       if self.rc is not None:
00141         self.rc.doStop()
00142
00143
00144   def wait(self):
00145     self.__cmdSynchSem.acquire()
00146
00147   def sync(self):
00148     if __name__ == "__main__":
00149       self.__cmdSynchSem.release()
00150
00151   def __initHippo(self):
00152     label1 = ['Time', 'TEM Voltage']
00153     label2 = ['Time', 'TEM Current']
00154     ntc = NTupleController.instance()
00155     self.__nt = ntc.createCircularBuffer(2)
00156     self.__nt2 = ntc.createCircularBuffer(2)
00157     self.__nt.setLabels(label1)
00158     self.__nt2.setLabels(label2)
00159     self.__nt.setTitle('GTIC Test')
00160     self.__nt2.setTitle('GTIC Test2')
00161     self.__nt.reserve(100)
00162     self.__nt2.reserve(100)
00163     if __name__ == "__main__":
00164       app = QApplication ( sys.argv )
00165       self.__canvas = CanvasWindow()
00166       self.__canvas.show()
00167     else:
00168       wc = WindowController.instance()
00169       self.__canvas = wc.currentCanvas()
00170
00171     dc = DisplayController.instance()
00172
00173   def __initPlots(self):
00174     self.__canvas.clear()
00175
00176     self.__nt.clear()
00177     self.__nt2.clear()
00178
00179     #self.__nt.setIntervalCount ( 500 )
00180     #self.__nt2.setIntervalCount ( 100 )
00181     dc = DisplayController.instance()
00182     self.__hist = dc.createDisplay('Strip Chart',self.__nt,['Time', 'TEM Voltage'])
00183     self.__hist2 = dc.createDisplay('Strip Chart',self.__nt2,['Time', 'TEM Current'])
00184     self.__canvas.addDisplay(self.__hist)
00185     self.__canvas.addDisplay(self.__hist2)
00186     self.__hist.setRange ( 'y', 2660, 2680 )
00187     self.__hist2.setRange ( 'y', 200, 300 )
00188     #self.__canvas.setIntervalEnabled ( 1 )
00189     self.__canvas.show()
00190
00191 if __name__ == "__main__":
00192   ua = userApplication(None, 321, 0)
00193   ua.rcSetup('../repos/simpleTEMSchema.xml')
00194   ua.rcStartRun()
00195   ua.wait()
00196   ua.rcStopRun()
00197   ua.rcTeardown()
00198   raw_input("Press any key to end")
00199
00200 # History:
00201 #     $Log: hTestEnv.py,v $
00202 #     Revision 1.2  2004/08/18 18:00:15  stuvi
00203 #     Updated for LATTE 4.
00204 #     All hippo functions go through the Qt GUI bridge now.
00205 #
00206 #     Revision 1.1  2004/08/07 02:14:33  stuvi
00207 #     no message
00208 #
00209 #     Revision 1.8  2004/04/17 02:22:17  stuvi
00210 #     Various Hippo related fixes
00211 #     Added teardown() to delete the C++ object for the userArgument
00212 #
00213 #     Revision 1.7  2004/04/08 00:32:39  stuvi
00214 #     Modularized hippodraw code.
00215 #     Changed tuples to circular buffer.
00216 #
00217 #     Revision 1.6  2004/03/10 22:24:50  panetta
00218 #     Upgraded trigger interface.
00219 #     Removed dependencies on self.glt.
00220 #
00221 #     Revision 1.5  2004/02/24 02:13:34  stuvi
00222 #     Changes for long transition support.
00223 #
00224 #     Revision 1.4  2003/07/17 00:01:35  stuvi
00225 #     no message
00226 #
00227 #     Revision 1.3  2003/03/31 19:28:53  stuvi
00228 #     Fixed name
00229 #
00230 #     Revision 1.2  2003/03/26 21:59:36  stuvi
00231 #     Fixed standalone mode
00232 #
00233 #     Revision 1.1  2003/03/11 21:20:54  stuvi
00234 #     Moved from RunControl directory
00235 #
00236 #     Revision 1.3  2003/02/06 05:20:22  claus
00237 #     Added resume; StopRun bug fix
00238 #
00239 #     Revision 1.2  2003/01/16 02:38:25  stuvi
00240 #     Removed extra stuff
00241 #
00242 #     Revision 1.1  2002/12/10 00:59:16  stuvi
00243 #     Runcontrol example that uses Hippo. Currently it doesn't work in GUI mode.
00244 #
00245 #     Revision 1.4  2002/12/02 17:17:09  claus
00246 #     Added provision to allow application to run stand-alone
00247 #
00248 #     Revision 1.3  2002/11/28 02:02:04  claus
00249 #     Shuffled constructor arguments
00250 #
00251 #     Revision 1.2  2002/11/27 23:49:27  claus
00252 #     Initialize semaphore with zero count
00253 #
00254 #     Revision 1.1  2002/11/27 05:02:48  claus
00255 #     Initial version of Run Control
00256 #
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: hTestStrip.py Source File

hTestStrip.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example TKR test application"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "11/21/2002"
00014 __version__  = "$Revision: 1.1 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import threading
00020 from   sihippo       import *
00021 from   time          import sleep, time
00022 import random
00023 import math
00024 import logging       as     log
00025
00026 from   LATTE.runcontrol.rcTransitions import rcTransitions
00027 from   LATTE.runcontrol.ArgumentImpl  import ArgumentImpl
00028
00029 from support.MiniGLTExample      import *
00030
00031 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00032 #  the userApplication example to get the number of self triggers to take.
00033 class userArgument(ArgumentImpl):
00034   "GUI for getting the user to input some sort of value."
00035   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00036     ArgumentImpl.__init__(self, parent, name, modal, fl)
00037     self._value = 0
00038     self.setCaption("Hello world!")
00039
00040   def OKButtonClicked(self):
00041     self._value = int(self.ArgumentList.text().latin1())
00042     self.close()
00043
00044   def CancelButtonClicked(self):
00045     self.__value = None
00046     self.close()
00047
00048   def getValue(self, caption):
00049     self.setCaption(caption)
00050     self.show()
00051     self.exec_loop()
00052     return self._value
00053
00054 class userArgText(object):
00055   "Text user interface for getting the user to input some sort of value"
00056   def __init__(self):
00057     pass
00058
00059   def getValue(self, caption):
00060     return int(raw_input("%s: " % (caption)))
00061
00062
00063 #  Example application implementation.
00064 #  Note that the name of the class must be userApplication.
00065 #  Look at rcTransitions for names of other transition methods that can be used.
00066 class userApplication(rcTransitions):
00067   "Implmentation class for a user application"
00068   def __init__(self, gui, userId, debug):
00069     rcTransitions.__init__(self, gui, userId, debug)
00070     log.debug("userApplication.__init__()")
00071     self.phase = 0.0
00072
00073   def getName(self):
00074     return __name__
00075
00076   def setup(self):
00077     log.debug("userApplication.setup()")
00078
00079     if self.gui is None:
00080       self.__arg = userArgText()
00081     else:
00082       self.__arg = self.gui.createGUI(userArgument, self.gui, 'test1', 1)
00083
00084     self.gui.execGUImethod(self.__initHippo)
00085
00086     # A state transition can be rejected by not returning None
00087     return None
00088
00089
00090   def startRun(self):
00091     log.debug("userApplication.startRun()")
00092     self._cmdSynchQuit = False
00093     caption = "Enter number of data groups to read"
00094     if self.gui is None:
00095       cnt = self.__arg.getValue(caption)
00096     else:
00097       cnt = self.gui.execGUImethod(self.__arg.getValue, caption)
00098
00099     # The user pressed 'Cancel'
00100     if cnt is None:  return -1
00101     self.__cnt = cnt
00102
00103     self.gui.execGUImethod(self.__initPlots)
00104
00105     #self.hippoDisplay = threading.Thread(None, self.initHippo, 'HippoDisplay', ())
00106     #self.hippoDisplay.start()
00107
00108     # A state transition can be rejected by not returning None
00109     return None
00110
00111   def stopRun(self):
00112     self._cmdSynchQuit = True
00113     #self.__canvas.savePlotAsImage(self.__hist, "c:/temp/plot.jpg")
00114     #self.__canvas.savePlotAsImage(self.__hist2, "c:/temp/plot2.jpg")
00115
00116     # The STOP_RUN transition can not be rejected
00117
00118   def stop (self):
00119     return self.stopRun()
00120
00121   def teardown(self):
00122     log.debug("userApplication.teardown()")
00123     # Allow the C++ object to be deleted
00124     if self.gui is not None and self.__arg is not None:
00125       self.__arg.deleteLater()
00126
00127   def process(self, (status, buffer)):
00128     "Method called back for each data event taken"
00129     ###print "userApplication.process()"
00130
00131   def commandSynch(self):
00132     "Method called by the command synchronization task"
00133     count = self.__cnt
00134     cnt = 0
00135     while cnt < count and not self._cmdSynchQuit:
00136       if self.phase > math.pi - 0.0001: self.phase = 0.0
00137       cnt = cnt + 1
00138       volts = math.sin(self.phase) * (-1.0 +2.0*random.random())
00139       amps  = 0.8 - (2.0 * self.phase/math.pi) +0.4*random.random()
00140       self.__nt.addRow([cnt, volts])
00141       self.__nt2.addRow([cnt, amps])
00142       sleep(.1)
00143       self.phase += math.pi*0.02
00144
00145   def wait(self):
00146     pass
00147
00148   def __initHippo(self):
00149     label1 = ['Time', 'TEM Voltage']
00150     label2 = ['Time', 'TEM Current']
00151     ntc = NTupleController.instance()
00152     self.__nt = ntc.createCircularBuffer(2)
00153     self.__nt2 = ntc.createCircularBuffer(2)
00154     self.__nt.setLabels(label1)
00155     self.__nt2.setLabels(label2)
00156     self.__nt.setTitle('GTIC Test')
00157     self.__nt2.setTitle('GTIC Test2')
00158     self.__nt.reserve(100)
00159     self.__nt2.reserve(100)
00160     if __name__ == "__main__":
00161       app = QApplication ( sys.argv )
00162       self.__canvas = CanvasWindow()
00163     else:
00164       wc = WindowController.instance()
00165       self.__canvas = wc.currentCanvas()
00166
00167     #hist.setRange ( 'y', 2660, 2680 )
00168     #hist2.setRange ( 'y', 200, 300 )
00169
00170   def __initPlots(self):
00171     self.__canvas.clear()
00172     self.__nt.clear()
00173     self.__nt2.clear()
00174     #self.__nt.setIntervalCount ( 500 )
00175     #self.__nt2.setIntervalCount ( 100 )
00176     dc = DisplayController.instance()
00177     self.__hist = dc.createDisplay('Strip Chart',self.__nt,['Time', 'TEM Voltage'])
00178     self.__hist2 = dc.createDisplay('Strip Chart',self.__nt2,['Time', 'TEM Current'])
00179     self.__canvas.addDisplay(self.__hist)
00180     self.__canvas.addDisplay(self.__hist2)
00181     #self.__canvas.setIntervalEnabled ( 1 )
00182     self.__canvas.show()
00183
00184
00185 if __name__ == "__main__":
00186   ua = userApplication(None, 321, 0)
00187   ua.rcSetup('../repos/simpleTEMSchema.xml')
00188   ua.rcStartRun()
00189   ua.wait()
00190   ua.rcStopRun()
00191   ua.rcTeardown()
00192   raw_input("Press any key to end")
00193
00194 # History:
00195 #     $Log: hTestStrip.py,v $
00196 #     Revision 1.1  2004/08/18 18:00:15  stuvi
00197 #     Updated for LATTE 4.
00198 #     All hippo functions go through the Qt GUI bridge now.
00199 #
00200 #     Revision 1.9  2004/05/03 21:19:47  stuvi
00201 #     Moved non-Runcontrol scripts to the support directory and modified imports accordingly.
00202 #
00203 #     Revision 1.8  2004/04/17 02:22:17  stuvi
00204 #     Various Hippo related fixes
00205 #     Added teardown() to delete the C++ object for the userArgument
00206 #
00207 #     Revision 1.7  2004/04/07 23:28:29  stuvi
00208 #     Modularized hippodraw code.
00209 #
00210 #     Revision 1.6  2004/03/31 01:03:21  stuvi
00211 #     Fixed so that it works with the new trigger interface.
00212 #
00213 #     Revision 1.5  2004/03/10 22:24:50  panetta
00214 #     Upgraded trigger interface.
00215 #     Removed dependencies on self.glt.
00216 #
00217 #     Revision 1.4  2004/02/24 02:13:34  stuvi
00218 #     Changes for long transition support.
00219 #
00220 #     Revision 1.3  2003/07/17 00:01:35  stuvi
00221 #     no message
00222 #
00223 #     Revision 1.2  2003/03/31 19:28:53  stuvi
00224 #     Fixed name
00225 #
00226 #     Revision 1.1  2003/03/11 21:20:54  stuvi
00227 #     Moved from RunControl directory
00228 #
00229 #     Revision 1.2  2003/02/06 05:20:22  claus
00230 #     Added resume; StopRun bug fix
00231 #
00232 #     Revision 1.1  2003/01/10 01:41:52  stuvi
00233 #     Example strip chart example for hippo
00234 #
00235 #     Revision 1.1  2002/12/10 00:59:16  stuvi
00236 #     Runcontrol example that uses Hippo. Currently it doesn't work in GUI mode.
00237 #
00238 #     Revision 1.4  2002/12/02 17:17:09  claus
00239 #     Added provision to allow application to run stand-alone
00240 #
00241 #     Revision 1.3  2002/11/28 02:02:04  claus
00242 #     Shuffled constructor arguments
00243 #
00244 #     Revision 1.2  2002/11/27 23:49:27  claus
00245 #     Initialize semaphore with zero count
00246 #
00247 #     Revision 1.1  2002/11/27 05:02:48  claus
00248 #     Initial version of Run Control
00249 #
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: imagedata.py Source File

browser

imagedata.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Trigger"
00012 __abstract__ = "Checkmarks for trigger display"
00013 __author__   = "Martin Kocian, SLAC"
00014 __date__     = ("$Date: 2005/06/15 23:42:30 $").split(' ')[1]
00015 __version__  = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 image0_data = [
00020 "14 14 3 1",
00021 "# c #00ff00",
00022 "a c #808080",
00023 ". c #e6dedc",
00024 "..............",
00025 "..............",
00026 "...........#a.",
00027 "..........##aa",
00028 ".........###aa",
00029 "........###aa.",
00030 "..#a...###aa..",
00031 ".##aa.###aa...",
00032 ".##aa###aa....",
00033 ".##a###aa.....",
00034 ".#####aa......",
00035 ".####aa.......",
00036 "..##aa........",
00037 "..aaa........."
00038 ]
00039 image1_data = [
00040 "14 14 8 1",
00041 ". c #e6dedc",
00042 "e c #fb4747",
00043 "c c #ff0000",
00044 "d c #ff0c0c",
00045 "a c #ff2626",
00046 "b c #ff6c6c",
00047 "f c #ff8585",
00048 "# c #ff9c9c",
00049 "..............",
00050 "..............",
00051 "..............",
00052 "....#....aab..",
00053 "...ccd..acc#..",
00054 "...#ccecce....",
00055 "....ccccd.....",
00056 "....eccc......",
00057 "....cccc......",
00058 "...acccca.....",
00059 "..dcce.cc#....",
00060 ".bccf..bcf....",
00061 "eccd....e.....",
00062 "ccc..........."
00063 ]
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: LATsweep.py Source File

runcontrol

LATsweep.py

00001 #!/usr/bin/env python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Sweep handler class"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/03/04 21:32:00 $").split(' ')[1]
00014 __version__  = "$Revision: 2.13 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import sys
00021
00022 from LATTE.database import gLAT
00023 from LATTE.client   import gException
00024
00025 class LATsweep(object):
00026   """Saves the current values of the registers, sets the TEM to a
00027   valid and known state for reliable event data taking. Triggers the event and
00028   then restores the registers to their prior values. This is done to make sure
00029   the sweep events that are retrieved from the TEM are good events.
00030
00031   \param lat        The LAT object hierarchy
00032   \param trigger    The trigger object
00033   \param sweepEvent Event() object passed to the trigger
00034
00035   """
00036
00037   def __init__(self, lat, trigger, shut):
00038     self.__lat = lat
00039     self.__trigger = trigger
00040     self.__shut    = shut
00041
00042   def shut(self, sweepEvent, progress = None):
00043     # Disable the trigger since we are going to access registers
00044     self.__trigger.disable()
00045
00046     # Use a temporary LAT hierarchy in case the current lat
00047     # doesn't define what we need to access.
00048     tempLAT = gLAT.GLAT(self.__lat.client())
00049     tkrTimeouts = {}
00050     tkrConfig = {}
00051     calConfig = {}
00052     for (temId, tem) in self.__lat.TEM.items():
00053       try:
00054         tem.configuration # Check to see if this TEM really exists
00055         tempTEM = tempLAT._GLAT__addTEM(temId)
00056       except gException.LATInterfaceException:
00057         if sys.exc_info()[1].errstr()[0] in ('LCB_RTOERR', 'LCBD_RTOERR') \
00058             and self.__lat.getDeclarations()['options']['ignorehardwaretimeouts']:
00059           continue
00060         else:
00061           raise gException.LATInterfaceException(sys.exc_info()[1].status)
00062
00063       # Save the configuration register values of the CCCs and TCCCs
00064       # that are defined in the schema
00065       tkrConfig[temId] = {}
00066       tkrTimeouts[temId] = {}
00067       for cc in range(8):
00068         tempTCC = tempTEM._GTEM__addTCC(cc)
00069         timeouts = tempTCC.event_timeouts
00070         if timeouts != 0:
00071           tkrTimeouts[temId][cc] = timeouts
00072         tkrConfig[temId][cc] = tempTCC.configuration
00073       calConfig[temId] = {}
00074       for cc in range(4):
00075         tempCCC = tempTEM._GTEM__addCCC(cc)
00076         calConfig[temId][cc] = tempCCC.configuration
00077     # Broadcast to all TEMS
00078     if self.__lat.TEMcnt() > 0:
00079       tempTEMall = tempLAT._GLAT__addTEM(255)
00080       allTCC = tempTEMall._GTEM__addTCC(255)
00081       allTCC.event_timeouts = (1L << 14) - 1
00082       allTCC.configuration = (1L << 31)
00083       tempTEMall._GTEM__addCCC(255).configuration = (1L << 31)
00084       # Put back the timeouts that werent zero.
00085       for temId in tkrTimeouts.keys():
00086         for cc in tkrTimeouts[temId]:
00087           tempLAT.TEM[temId].TCC[cc].event_timeouts = tkrTimeouts[temId][cc]
00088       # Put back the configuration values that we saved ORing with (1<<31)
00089       for temId in tkrConfig.keys():
00090         tempTEM = tempLAT.TEM[temId]
00091         for cc in tkrConfig[temId]:
00092           tempTEM.TCC[cc].configuration = (tkrConfig[temId][cc] | (1L << 31))
00093         for cc in calConfig[temId]:
00094           tempTEM.CCC[cc].configuration = (calConfig[temId][cc] | (1L << 31))
00095
00096     #self.__trigger._shut(sweepEvent, progress)
00097     swept = self.__shut(sweepEvent, progress)
00098
00099     # Finally restore the configuration register values to their initial settings.
00100     for temId in tkrConfig.keys():
00101       tempTEM = tempLAT.TEM[temId]
00102       for cc in tkrConfig[temId].keys():
00103         tempTEM.TCC[cc].configuration = tkrConfig[temId][cc]
00104       for cc in calConfig[temId].keys():
00105         tempTEM.CCC[cc].configuration = calConfig[temId][cc]
00106
00107     return swept
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ldf2fits.py Source File

runcontrol

ldf2fits.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Archive to FITS converter"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "02/27/2003"
00014 __version__  = "$Revision: 2.2 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import sys
00020 import getopt
00021
00022 def __usage():
00023   print "\n%s Usage:" % (sys.argv[0])
00024   print "\t-h or --help for Help"
00025   print "\t-a or --archive to specify an input archive file (*.ldf)"
00026   print "\t-f or --fits to specify the output FITS file (append .gz to the filename for compression)"
00027   print "\t-r or --runreport to specify an input run report filename (ie. rcReport.out)"
00028   print "\t-v or --verbose to specify progress messages during the conversion"
00029
00030
00031 if __name__ == '__main__':
00032   archiveFile=''
00033   fitsFile=''
00034   verbose=0
00035   runReportFile=''
00036   try:
00037     opts, args = getopt.getopt(sys.argv[1:], "ha:f:vr:",
00038                                ["help", "archive=", "fits=", "verbose", "runreport="])
00039   except getopt.GetoptError:
00040     # print help information and exit:
00041     __usage()
00042     sys.exit(2)
00043   for o, a in opts:
00044     if o in ("-h", "--help"):
00045       __usage()
00046       sys.exit()
00047     if o in ("-a", "--archive"):
00048       archiveFile = a
00049     if o in ("-f", "--fits"):
00050       fitsFile = a
00051     if o in ("-v", "--verbose"):
00052       verbose = 1
00053     if o in ("-r", "--runreport"):
00054       runReportFile = a
00055
00056   if archiveFile == '':
00057     print "\nERROR: Missing archive file parameter"
00058     __usage()
00059     sys.exit(2)
00060
00061   if fitsFile == '':
00062     print "\nERROR: Missing FITS file parameter"
00063     __usage()
00064     sys.exit(2)
00065
00066   if runReportFile == '':
00067     print "\nERROR: Missing Run Report file parameter"
00068     __usage()
00069     sys.exit(2)
00070
00071   import rcArchiver
00072   arch = rcArchiver.rcArchiver(fileName=archiveFile, mode=rcArchiver.MODE_READONLY)
00073
00074   import rcReportGen
00075   reportGen = rcReportGen.rcReportGen(fileName=runReportFile)
00076   reportGen.initialize()
00077   reportGen.readReportXML()
00078
00079   import rcFitsWriter
00080   fits = rcFitsWriter.rcFitsWriter(fileName=fitsFile, format=rcFitsWriter.FORMAT_BYTE, reportGen=reportGen)
00081
00082   cnt=0
00083   while(True):
00084     dat = arch.read()
00085     if dat == None: break
00086     cnt+=1
00087     if verbose and (cnt % 100) == 0: print "Progress line:", cnt
00088     fits.write(dat)
00089   if verbose and (cnt % 100) != 0: print "Progress line:", cnt
00090
00091   arch.close()
00092   fits.close()
00093
00094   if verbose: print "Conversion completed successfully!"
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ldfContribution.py Source File

merger

ldfContribution.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2006
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "LDF event contribution class"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "3/30/2006"
00014 __updated__  = ("$Date: 2006/07/14 22:27:33 $").split(' ')[1]
00015 __version__  = "$Revision: 1.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 #import copyright_SLAC
00020
00021 import struct
00022 import LDF
00023
00024 import LATTE.merger.geb as geb
00025
00026
00027 class LdfContribution(geb.GebContribution):
00028   def __init__(self, contributor, contribution):
00029     geb.GebContribution.__init__(self, contributor)
00030     #self.__contribution = LDF.EBFevent.create(contribution, len(contribution)) # Swaps
00031     self.__contribution = contribution
00032
00033   def identity(self):
00034     #return self.__contribution.identity().value()
00035     return struct.unpack('>L', self.__contribution[0*4:1*4])[0]
00036
00037   def length(self):
00038     #return self.__contribution.length()
00039     return struct.unpack('>L', self.__contribution[1*4:2*4])[0]
00040
00041   def sequence(self):
00042     summary = struct.unpack('>L', self.__contribution[3*4:4*4])[0]
00043     #evtNo = LDF.EventSummary.eventNumber(summary)
00044     #tag   = LDF.EventSummary.tag        (summary)
00045     evtNo  = (summary <<  1) & 0x1fffc  # 0x7fff << 2
00046     tag    = (summary >> 28) & 0x0003
00047     return self.contributor().sequence(evtNo | tag)
00048
00049   def buffer(self):
00050     #return self.__contribution.string() # Swaps
00051     return self.__contribution
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ldfFile.py Source File

ldfFile.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2006
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Read LDF event contributions from a file"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "3/30/2006"
00014 __updated__  = ("$Date: 2006/07/19 16:08:50 $").split(' ')[1]
00015 __version__  = "$Revision: 1.2 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import struct
00022 import logging as log
00023 import LDF
00024
00025 import LATTE.merger.geb             as     geb
00026 from   LATTE.merger.ldfContribution import LdfContribution
00027
00028
00029 class LdfContributor(geb.GebContributor):
00030   def __init__(self, filename, offset = 1):
00031     geb.GebContributor.__init__(self)
00032     self.__filename = filename
00033     self.__fakeEvent = struct.pack(">3L", LDF.EBFevent.ID, 3*4, 0xabadcafeL)
00034     self.__offset = offset
00035
00036   def name(self):
00037     return "LDF"
00038
00039   def offset(self):
00040     return self.__offset
00041
00042   def open(self):
00043     self.__file = file(self.__filename, 'rb')
00044     print "LdfContrib.open: %s opened" % (self.__filename)
00045
00046   def close(self):
00047     self.__file.close()
00048
00049   def read(self):
00050     """!\brief Method to read an LDF contribution from a file.
00051     """
00052     data = self.__file.read(8)
00053     if len(data) == 0:  raise EOFError, "LdfContrib.read: End of file on %s" % (self.__filename)
00054     (typeId, length) = struct.unpack('>2L', data)
00055     if typeId != LDF.LATdatagram.ID:
00056       # Don't try to continue if bad typeId: we're lost or it's undefined
00057       raise KeyError, "ldfContrib.read: Unrecognized contribution %08x"%(typeId)
00058     #print "ldfContrib.read:   id = %08x, len = %08x" % (typeId, length)
00059     data = self.__file.read(length - 8) # Only the LATcontribution(s) portion
00060
00061     status = 0
00062     return geb.Geb.Build, status, LdfContribution(self, data)
00063
00064   def fake(self):
00065     return self.__fakeEvent
00066
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ldfSocket.py Source File

ldfSocket.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2006
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Read LDF event contributions from a socket"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "3/30/2006"
00014 __updated__  = ("$Date: 2006/07/14 22:34:28 $").split(' ')[1]
00015 __version__  = "$Revision: 1.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import struct
00022 import logging                      as     log
00023 import LDF
00024
00025 import LATTE.merger.geb             as     geb
00026 from   LATTE.merger.ldfContribution import LdfContribution
00027 from   LATTE.client.gSocket         import Socket
00028
00029
00030 class LdfContributor(geb.GebContributor):
00031   def __init__(self, (host, port), offset = 1):
00032     geb.GebContributor.__init__(self)
00033     self.__socket    = Socket(port)
00034     self.__host      = host
00035     self.__fakeEvent = struct.pack(">3L", LDF.EBFevent.ID, 3*4, 0xabadcafeL)
00036     self.__offset    = offset
00037
00038   def name(self):
00039     return "LDF"
00040
00041   def offset(self):
00042     return self.__offset
00043
00044   def open(self):
00045     self.__socket.connect(self.__host)
00046     self.__socket.settimeout(9999)
00047     print "LdfContrib.open: socket opened"
00048
00049   def read(self):
00050     """!\brief Method to read an LDF contribution from a socket.
00051     """
00052     data = self.__socket.recvall(8)
00053     (typeId, length) = struct.unpack('>2L', data)
00054     if typeId != LDF.LATdatagram.ID:
00055       # Don't try to continue if bad typeId: we're lost or it's undefined
00056       raise KeyError, "Unrecognized contribution %08x"%(typeId)
00057     #print "ldfContrib.read:   id = %08x, len = %08x" % (typeId, length)
00058     data = self.__socket.recvall(length - 8) # Only the LATcontribution(s) portion
00059
00060     status = 0
00061     return geb.Geb.Build, status, LdfContribution(self, data)
00062
00063   def close(self):
00064     self.__socket.disconnect()
00065
00066   def fake(self):
00067     return self.__fakeEvent
00068
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: listmean.py Source File

browser

listmean.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Trigger"
00012 __abstract__ = "Helper function for trigger display"
00013 __author__   = "Martin Kocian, SLAC"
00014 __date__     = ("$Date: 2005/05/16 18:30:35 $").split(' ')[1]
00015 __version__  = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 def listmean(list,element,numsamples):
00020   list.append(element)
00021   while len(list)>numsamples:
00022     list.pop(0)
00023   mean=0.
00024   if len(list)>0:
00025     for el in list:
00026       mean+=el
00027     mean/=len(list)
00028   return mean
00029
00030
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MailAlert.py Source File

tools

MailAlert.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT alert email tool"
00012 __author__   = "Jim Panetta <panetta@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "09/03/2004"
00014 __version__  = "$Revision: 1.2 $"
00015 __credits__  = "SLAC"
00016
00017 # import LATTE.copyright_SLAC
00018
00019
00020 import sys, smtplib
00021 from email.MIMEText import MIMEText
00022
00023 class MailAlert(object):
00024   def __init__(self, smtpServer):
00025     self.__smtp = smtpServer
00026
00027   def sendMail(self, email):
00028     smtp = smtplib.SMTP( self.__smtp )
00029     smtp.sendmail( email.sender(), email.recipient(), email.body() )
00030     smtp.quit()
00031
00032 class SLACmail(MailAlert):
00033   # Define the SLAC mail server
00034   def __init__(self):
00035     MailAlert.__init__(self, 'mailgate01.slac.stanford.edu')
00036
00037 class Email(MIMEText):
00038   def __init__(self):
00039     MIMEText.__init__(self, '')
00040
00041   def sender(self, s=None):
00042     if s is not None:
00043       self['From'] = s
00044     return self['From']
00045
00046   def recipient(self, r=None):
00047     if r is not None:
00048       self['To'] = r
00049     return self['To']
00050
00051   def subject(self, s=None):
00052     if s is not None:
00053       self['Subject'] = s
00054     return self['Subject']
00055
00056   def body(self, b=None):
00057     if b is not None:
00058       self.set_payload(b)
00059     return self.get_payload()
00060
00061
00062
00063
00064
00065
00066
00067
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: mask.py Source File

browser

mask.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Trigger"
00012 __abstract__ = "Mask widget for trigger display"
00013 __author__   = "Martin Kocian, SLAC"
00014 __date__     = ("$Date: 2005/06/03 23:03:42 $").split(' ')[1]
00015 __version__  = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 from qt import *
00020 import sys
00021
00022 class mask (QWidget):
00023
00024         def __init__(self,parent= None,name = None,fl = 0):
00025                 QWidget.__init__(self,parent,name,fl)
00026         if not name:
00027             self.setName("mask")
00028                 self.__nbox=0
00029         self.__box=[]
00030         self.__mask=0x0
00031         self.__labels=[]
00032         self.__title=QLabel(self,"title")
00033         self.__title.setAlignment(QLabel.AlignCenter|QLabel.AlignVCenter)
00034         self.clearWState(Qt.WState_Polished)
00035
00036         def setup(self,nbox):
00037         self.__nbox=nbox
00038         for i in range(nbox):
00039             self.__box.append(QCheckBox(self,""))
00040             self.__labels.append(QLabel(self,""))
00041             self.__labels[i].setAlignment(QLabel.AlignRight|QLabel.AlignVCenter)
00042             font=self.__labels[i].font()
00043             font.setPointSize(8)
00044             self.__labels[i].setFont(font)
00045             QObject.connect(self.__box[i],SIGNAL("clicked()"),self.updateMask)
00046
00047         def setTitle(self,text):
00048         self.__title.setText(text)
00049         def setLabel(self,i,text):
00050         self.__labels[i].setText(text)
00051         def updateMask(self):
00052         self.__mask=0x0
00053         for i in range(self.__nbox):
00054             if self.__box[i].isChecked():
00055                 self.__mask|=1<<i
00056                 self.emit(PYSIGNAL("update"), (self.__mask,))
00057         def getMask(self):
00058         return self.__mask
00059     def setMask(self,mask):
00060         m=0x0
00061         for i in range (self.__nbox):
00062             m|=1<<i
00063             self.__box[i].setChecked(mask&(1<<i))
00064         self.__mask=mask&m
00065
00066     def resizeEvent(self,rev):
00067         height=rev.size().height()
00068         width=rev.size().width()
00069         ch=(height-15)/self.__nbox
00070         self.__title.setGeometry(0,height-15,width,15)
00071         for i in range(self.__nbox):
00072             self.__labels[i].setGeometry(0,i*ch,width-12,ch)
00073                         self.__box[i].setGeometry(width-12,i*ch+ch/2-6,12,12)
00074
00075
00076
00077 if __name__ == "__main__":
00078         a = QApplication(sys.argv)
00079         QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00080         w = mask()
00081     w.setup(12)
00082     w.setLabel(10,"a")
00083     w.setTitle("Hallo")
00084     w.setMask(0xffff)
00085     w.setGeometry(300,400,50,164)
00086         a.setMainWidget(w)
00087         w.show()
00088         a.exec_loop()
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MiniGLTExample.py Source File

MiniGLTExample.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009 #
00010
00011 __facility__ = "Online"
00012 __abstract__ = "GLAST LAT Coincidence based Trigger System Interface classes"
00013 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00014 __date__     = "2/14/04"
00015 __version__  = "$Revision: 1.3 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 # This class uses
00022 from LATTE.trigger.TrgUsingTiles      import TrgUsingTiles
00023 from LATTE.trigger.NullObjects        import NoInputsEnabled
00024 from LATTE.trigger.rcTrgFunctions     import rcTrgEngines
00025 from LATTE.trigger.TrgEngines         import *
00026 from LATTE.trigger.rcTrgMiniGLT       import rcTrgMiniGLT
00027 from LATTE.trigger.TrgMiniGLT         import MiniGLTTrgConditionsValue
00028
00029 """\brief Interface for Coincidence based Trigger System"""
00030
00031 class MiniGLTExample(rcTrgMiniGLT):
00032   """\brief MiniTower example interface to MiniGLT
00033   """
00034   def __init__(self):
00035     """\brief AcdTriggerExample constructor
00036     """
00037     rcTrgMiniGLT.__init__(self)
00038     self.__engines      = MiniGLTTrgEngines()
00039     self.__conditions   = MiniGLTSolicitedCondition()
00040
00041   def engines(self):
00042     """\brief Implementation of engines 'pure virtual' method from TrgAbstract
00043     """
00044     return self.__engines
00045
00046   def conditions(self):
00047     """\brief Implementation of conditions 'pure virtual' method from TrgAbstract
00048     """
00049     return self.__conditions
00050
00051 # implementaions of user-level trigger classes
00052 class MiniGLTTrgEngines(rcTrgEngines):
00053   def __init__(self):
00054     rcTrgEngines.__init__(self)
00055     # There are two engines in the MiniGLT.
00056     # 0) User defined engine
00057     # 15) Marker engine
00058
00059     eng = MiniGLTSolicitedEngine()
00060     self.replaceEngine(0,eng)
00061
00062 class MiniGLTSolicitedEngine(TrgEngine):
00063   """This class defines an engine which reads out the detector
00064      whenever there is a solicited trigger.
00065      This engine is not prescaled.
00066   """
00067   def __init__(self):
00068     TrgEngine.__init__(self)
00069     self.__request = ZsupTrgReadout()
00070   def participate(self,conditionsValue):
00071     # This function relies on the programmer's knowledge that the
00072     # conditionsValue is a bitfield.
00073     cond = MiniGLTSolicitedCondition()
00074     condValue = cond.value()
00075     if conditionsValue & condValue:
00076       return True
00077     return False
00078   def prescale(self):
00079     return 0
00080   def request(self):
00081     return self.__request
00082
00083 class MiniGLTSolicitedCondition(MiniGLTTrgConditionsValue):
00084   """ Define a condition where only the CNO trigger is asserted
00085   """
00086   def __init__(self):
00087     MiniGLTTrgConditionsValue.__init__(self)
00088   def solicited(self):
00089     return True
00090
00091 class ZsupTrgReadout(TrgReadout):
00092   """\brief ZsupTrgReadout class definition
00093
00094   Directs a module to send to its Front-End Electronics a command sequence
00095   which is composed only of the TACK command. This command will trigger
00096   a readout of the module's Front-End Electronics.
00097   Zero suppression is turned on.
00098   """
00099   def __init__(self):
00100     """\brief TrgReadout constructor
00101     """
00102     TrgReadout.__init__(self)
00103
00104   def zeroSuppress(self):
00105     return True
00106
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: monitoringDbSyncIn.py Source File

monitoringDbSyncIn.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Housekeeping Database Synch Out"
00012 __author__   = "J. Panetta <panetta@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "11/20/2004"
00014 __version__  = "$Revision: 1.1 $"
00015 __credits__  = "SLAC"
00016
00017
00018 import LATTE.copyright_SLAC
00019
00020 import os, sys, struct, gzip, time
00021 from LATTE.client.gOptions         import Options
00022 import MySQLdb
00023
00024 tlmFieldsList = "MNEMID, MNEM, DESTTYPE, EUCONV, DESCRIP, OPSYMBOL, SUBS, EUSTRING, EVENTFLAG, ARYLENGTH, LIMITS, INIT, NOTASSIGNABLE"
00025 valFieldsList = "USECS, VALUE, MNEMID, SOURCE"
00026 srcFieldsList = "SOURCE, DESCRIP"
00027
00028 valInsert     = "insert ignore into valfields (%s) values " % valFieldsList
00029
00030 valPackFmt    = "!ddLH"
00031 chunkSize     = 5000
00032
00033 def dumpVALfields(inFile, db):
00034
00035   fmtSize = struct.calcsize(valPackFmt)
00036   n = 0
00037   cursor = db.cursor()
00038   while True:
00039     if n%50 == 0:
00040       print "Optimizing VALFIELDS..."
00041       cursor.execute("optimize table valfields")
00042
00043     valList = ""
00044     set = inFile.read((fmtSize)*chunkSize)
00045     nChunks = len(set) / fmtSize
00046     if len(set) == 0: break
00047     for i in range(nChunks):
00048       startPoint = i*(fmtSize)
00049       datum = struct.unpack(valPackFmt, set[startPoint:startPoint+fmtSize])
00050       valList += "(%s, %s, %s, %s), " % datum
00051
00052     cursor.execute( valInsert + valList[:len(valList)-2] )
00053     db.commit()
00054     n += 1
00055     print n*chunkSize, time.time()
00056
00057
00058 if __name__ == '__main__':
00059
00060   # Options, first list mandatory, second list optional
00061   options = Options([],
00062                     [])
00063   try:
00064     options.parse()
00065   except Exception, msg:
00066     # options.usage(usage())
00067     raise Exception, msg
00068
00069   sqlDb = MySQLdb.connect(db='FOODB', user='itosdb', host='localhost')
00070   # cursor = None
00071
00072   valIn = gzip.open('val.out.gz')
00073   dumpVALfields(valIn, sqlDb)
00074   valIn.close()
00075
00076
00077
00078
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: monitoringDbSyncOut.py Source File

monitoringDbSyncOut.py

00001 #!/usr/local/bin/python
00002 #
00003 # monitoringDbSyncOut.py
00004 #
00005 #
00006 #
00007 #
00008 #                               Copyright 2005
00009 #                                     by
00010 #                        The Board of Trustees of the
00011 #                     Leland Stanford Junior University.
00012 #                            All rights reserved.
00013 #
00014
00015 __facility__ = "Online"
00016 __abstract__ = "Housekeeping Database Synch Out"
00017 __author__   = "J. Panetta <panetta@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00018 __date__     = "11/20/2004"
00019 __version__  = "$Revision: 1.5 $"
00020 __credits__  = "SLAC"
00021
00022 import LATTE.copyright_SLAC
00023
00024 import os, sys, struct, time, gzip
00025 from LATTE.client.gOptions         import Options
00026 import MySQLdb
00027
00028 tlmFieldsList = "MNEMID, MNEM, DESTTYPE, EUCONV, DESCRIP, OPSYMBOL, SUBS, EUSTRING, EVENTFLAG, ARYLENGTH, LIMITS, INIT, NOTASSIGNABLE"
00029 valFieldsList = "USECS, VALUE, MNEMID, SOURCE"
00030 srcFieldsList = "SOURCE, DESCRIP"
00031
00032 noAuto    = "set AUTOCOMMIT=0"
00033 lockMsg   = "LOCK TABLES valfields WRITE;"
00034 unlockMsg = "UNLOCK TABLES;"
00035
00036
00037 valPackFmt    = "!ddLH"
00038 chunkSize     = 1000
00039 nullValue     = 1000000000.0000001    # Standard python does not have IEEE NaN available
00040
00041 def lockTransact(db, msg):
00042   """Locking database transactor for INNODB databases
00043   """
00044   db.execute(noAuto)
00045   db.execute(lockMsg)
00046   db.execute(msg)
00047   rc = db.rowcount
00048   db.connection.commit()
00049   db.execute(unlockMsg)
00050   return rc
00051
00052 def dateMnemSelect(db, start, end):
00053   """Returns all used mnemonics in a time period
00054   """
00055   msg = "select distinct mnemid from valfields where %f<usecs and usecs<%f" % (start, end)
00056   db.execute(msg)
00057   m = db.fetchall()
00058   ret = []
00059   for item in m:
00060     ret.append(item[0])
00061   return ret
00062
00063 def dumpVALfields(db, outFile, start, end):
00064   # Get the mnemonic space to iterate over
00065   mnemSet = dateMnemSelect(db, start, end)
00066   for mnem in mnemSet:
00067     # print time.ctime(), "Starting select mnemid =", mnem
00068     selectMsg = "select %s from valfields" % (valFieldsList)
00069     qualifier = " where mnemid=%d and %f<usecs and usecs<%f and VALIDITY is NULL" %\
00070            (mnem, start, end)
00071     db.execute(selectMsg + qualifier)    # doesn't need locking transaction
00072     m = db.fetchall()
00073
00074     for set in m:
00075       if set[1] is None:  # Deal with NULL returns
00076         s = list(set)
00077         s[1] = nullValue
00078         set = tuple(s)
00079       str = struct.pack(valPackFmt, *set)
00080       outFile.write(str)
00081
00082     updMsg = "update valfields set VALIDITY=1"
00083     limitMsg  = " LIMIT %d" % chunkSize
00084     block=0
00085     # print time.ctime(), "starting update"
00086     while True:
00087       # print time.ctime(), "update block", block
00088       rows = lockTransact(db, updMsg + qualifier + limitMsg)
00089       block += 1
00090       if rows < chunkSize:
00091         break
00092
00093
00094 #   while True:
00095 #     msg = "select %s from valfields where VALIDITY is NULL AND USECS>%f and USECS<%f limit %d" %\
00096 #       (valFieldsList, start, end, chunkSize)
00097 #     db.execute(msg)
00098 #     rc = db.rowcount
00099 #     if rc == 0: break
00100 #
00101 #     m = db.fetchmany(chunkSize)
00102 #     for set in m:
00103 #       if set[1] is None:  # Deal with NULL returns
00104 #         s = list(set)
00105 #         s[1] = nullValue
00106 #         set = tuple(s)
00107 #       str = struct.pack(valPackFmt, *set)
00108 #       outFile.write(str)
00109 #
00110 #     updMsg = "update valfields set VALIDITY=1 where VALIDITY is NULL AND USECS>%f and USECS<%f limit %d" %\
00111 #              ( start, end, chunkSize)
00112 #     db.execute("LOCK TABLES valfields WRITE;")
00113 #     rc = db.execute(updMsg)
00114 #     db.connection.commit()
00115 #     db.execute("UNLOCK TABLES;")
00116 #
00117
00118 def findMinTime(db):
00119   msg = "select min(usecs) from valfields where validity is NULL"
00120   db.execute(msg)
00121   m = db.fetchall()   # returns tuple(tuple,)
00122   return m[0][0]
00123
00124
00125 def dumpTLMfields(db, outFile):
00126   msg = "select %s from tlmfields;" % (tlmFieldsList)
00127   db.execute(msg)
00128
00129   m = db.fetchall()
00130
00131   print >> outFile, tlmFieldsList
00132   for set in m:
00133     print >> outFile, set
00134
00135
00136 def usage():
00137   print """
00138 monitoringDbSyncOut Usage:
00139 $ monitoringDbSyncOut --outdir <dir> [--start <start>] [--end <end>]
00140
00141 Options:
00142   --outdir    Specify the output directory root.  A subdirectory will be created there
00143               of the form YYYYMMDD-HHMMSS containing the output files.  The time used is
00144               from the --end option, below.
00145   --start     Specify the start time in seconds since Jan 0 1970.
00146               Default is 0
00147   --end       Specify the end time in seconds since Jan 0 1970
00148               Default is the output of time.time() when the program is run.
00149   """
00150
00151 if __name__ == '__main__':
00152
00153   # Options, first list mandatory, second list optional
00154   options = Options(["outdir"],
00155                     ["start", "end"])
00156   try:
00157     options.parse()
00158   except Exception, msg:
00159     # options.usage(usage())
00160     raise Exception, msg
00161
00162   start  = -1
00163   end    = int(time.time())
00164   if options.start:
00165     start = int(options.start)
00166   if options.end:
00167     end   = int(options.end)
00168
00169   endTimeStr = time.strftime("%Y%m%d-%H%M%S", time.gmtime(end))
00170   outDir = os.path.join(options.outdir, endTimeStr)
00171
00172   if not os.path.isdir(outDir):
00173     os.mkdir(outDir)
00174
00175   sqlDb = MySQLdb.connect(db='itosdb', user='itosdb', host='localhost')
00176   cursor = sqlDb.cursor()
00177
00178   if start == -1:
00179     start  = findMinTime(cursor)
00180
00181   valOut = gzip.open(os.path.join(outDir,'val.out'),mode='wb+')
00182   dumpVALfields(cursor, valOut, start, end)
00183   valOut.close()
00184
00185   tlmOut = open(os.path.join(outDir,'tlm.out'),mode='wt+')
00186   dumpTLMfields(cursor, tlmOut)
00187   tlmOut.close()
00188
00189   done = open(os.path.join(outDir, 'zzz.done'), mode='w')
00190   done.close()
00191
00192
00193
00194
Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: MSGLogGUIImpl.py Source File

logger

MSGLogGUIImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Message Logger GUI"
00012 __author__   = """A. Kavelaars <AliciaK@SLAC.Stanford.edu>
00013                                SLAC - GLAST LAT I&T/Online"""
00014 __date__     = "12/3/2002"
00015 __version__  = "$Revision: 2.12 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 from qt import *
00022 from MSGLogGUI import MSGLogGUI
00023 from select import select
00024 import sys, string, struct, types, cPickle, socket
00025 import logging, logging.handlers, logging.config
00026 logging.raiseExceptions = 1
00027 import threading
00028 import atexit
00029
00030 #~ #
00031 #~ # Levels
00032
00033 #~ CRITICAL = 50
00034 #~ FATAL = CRITICAL
00035 #~ ERROR = 40
00036 #~ WARN = 30
00037 #~ INFO = 20
00038 #~ DEBUG = 10
00039 #~ NOTSET = 0
00040
00041 #~ import RunControlCommon
00042 #~ from RunControlCommon import RunControlCommon
00043
00044 imageInfo_data = [
00045 "20 18 3 1",
00046 "# c #000080",
00047 "a c #808080",
00048 ". c #ffffff",
00049 ".......######.......",
00050 ".....##########.....",
00051 "....############....",
00052 "...######..######...",
00053 "..#######..#######..",
00054 "..################..",
00055 ".##################.",
00056 ".########..########.",
00057 ".########..########.",
00058 ".########..########.",
00059 ".########..########.",
00060 "..#######..#######a.",
00061 "..#######..#######..",
00062 "..a######..######a..",
00063 "...a############a...",
00064 "....a##########a....",
00065 ".....aa######aa.....",
00066 ".......aaaaaa......."
00067 ]
00068
00069 imageFatal_data = [
00070 "20 18 19 1",
00071 "p c #004040",
00072 "b c #484242",
00073 "d c #5e4f4f",
00074 "j c #675656",
00075 "m c #685151",
00076 "g c #695555",
00077 "a c #808080",
00078 "h c #cddcdc",
00079 "e c #cedcdc",
00080 "k c #d4e1e1",
00081 "n c #e1eded",
00082 "q c #ebefef",
00083 "i c #ecf6f6",
00084 "f c #edf7f7",
00085 "l c #f1fafa",
00086 "o c #f2f6f6",
00087 "c c #f3fcfc",
00088 "# c #ff0000",
00089 ". c #ffffff",
00090 "......########......",
00091 ".....##########.....",
00092 "....############....",
00093 "...#####....#####...",
00094 "..#####......#####..",
00095 ".#####........#####.",
00096 ".####..aa..aa..####.",
00097 ".####...a..a...####.",
00098 ".####..........####.",
00099 ".#####...aa...#####.",
00100 ".######......######.",
00101 ".a######.aa.######a.",
00102 ".ba#####....#####aa.",
00103 ".cda####....####aae.",
00104 "..fga##########aah..",
00105 "...ija########aak...",
00106 "....lmaaaaaaaaan....",
00107 ".....oppppppppq....."
00108 ]
00109
00110 imageWarn_data = [
00111 "20 18 4 1",
00112 "a c #004040",
00113 "b c #808080",
00114 "# c #ffff00",
00115 ". c #ffffff",
00116 ".........##.........",
00117 "........####........",
00118 "........####........",
00119 ".......######.......",
00120 ".......##aa##.......",
00121 "......###aa###......",
00122 "......###aa###......",
00123 ".....####aa####.....",
00124 ".....####aa####.....",
00125 "....#####aa#####....",
00126 "....#####aa#####....",
00127 "...######aa######...",
00128 "...##############...",
00129 "..################..",
00130 "..#######aa#######..",
00131 ".########aa########.",
00132 ".##################.",
00133 "..bbbbbbbbbbbbbbbbb."
00134 ]
00135
00136 imageError_data = [
00137 "20 18 3 1",
00138 "a c #808080",
00139 "# c #ff0000",
00140 ". c #ffffff",
00141 ".......######.......",
00142 ".....##########.....",
00143 "....############....",
00144 "...##############...",
00145 "..###..#####..####..",
00146 "..###...###...####..",
00147 ".#####...#...######.",
00148 ".######.....#######.",
00149 ".#######...########.",
00150 ".######.....#######.",
00151 ".#####...#...######.",
00152 ".a###...###...####a.",
00153 "..###..#####..####..",
00154 "..a##############a..",
00155 "...a############a...",
00156 "....a##########a....",
00157 ".....aa######aa.....",
00158 ".......aaaaaa......."
00159 ]
00160
00161 imageNotset_data = [
00162 "20 18 19 1",
00163 "p c #004040",
00164 "# c #008000",
00165 "b c #484242",
00166 "d c #5e4f4f",
00167 "j c #675656",
00168 "m c #685151",
00169 "g c #695555",
00170 "a c #808080",
00171 "h c #cddcdc",
00172 "e c #cedcdc",
00173 "k c #d4e1e1",
00174 "n c #e1eded",
00175 "q c #ebefef",
00176 "i c #ecf6f6",
00177 "f c #edf7f7",
00178 "l c #f1fafa",
00179 "o c #f2f6f6",
00180 "c c #f3fcfc",
00181 ". c #ffffff",
00182 "......########......",
00183 ".....##########.....",
00184 "....#####..#####....",
00185 "...######..######...",
00186 "..#######..#######..",
00187 ".########..########.",
00188 ".########..########.",
00189 ".########..########.",
00190 ".########..########.",
00191 ".########..########.",
00192 ".##################.",
00193 ".a################a.",
00194 ".ba######..######aa.",
00195 ".cda#####..#####aae.",
00196 "..fga##########aah..",
00197 "...ija########aak...",
00198 "....lmaaaaaaaaan....",
00199 ".....oppppppppq....."
00200 ]
00201
00202 imageDebug_data = [
00203 "20 18 19 1",
00204 "p c #004040",
00205 "b c #484242",
00206 "d c #5e4f4f",
00207 "j c #675656",
00208 "m c #685151",
00209 "g c #695555",
00210 "a c #808080",
00211 "# c #c0c0c0",
00212 "h c #cddcdc",
00213 "e c #cedcdc",
00214 "k c #d4e1e1",
00215 "n c #e1eded",
00216 "q c #ebefef",
00217 "i c #ecf6f6",
00218 "f c #edf7f7",
00219 "l c #f1fafa",
00220 "o c #f2f6f6",
00221 "c c #f3fcfc",
00222 ". c #ffffff",
00223 "......########......",
00224 ".....##########.....",
00225 "....#####..#####....",
00226 "...######..######...",
00227 "..################..",
00228 ".##################.",
00229 ".########..########.",
00230 ".########..########.",
00231 ".########..########.",
00232 ".########..########.",
00233 ".########..########.",
00234 ".a#######..#######a.",
00235 ".ba######..######aa.",
00236 ".cda#####..#####aae.",
00237 "..fga##########aah..",
00238 "...ija########aak...",
00239 "....lmaaaaaaaaan....",
00240 ".....oppppppppq....."
00241 ]
00242
00243 #~##
00244 from SocketServer import ThreadingTCPServer, StreamRequestHandler
00245 import errno
00246 import select
00247
00248
00249 MAX_ENTRIES    = 9000
00250 DELETE_ENTRIES = 100
00251
00252 class LogRecordStreamHandler(StreamRequestHandler):
00253     """
00254     Handler for a streaming logging request. It basically logs the record
00255     using whatever logging policy is configured locally.
00256     """
00257
00258     def handle(self):
00259         """
00260         Handle multiple requests - each expected to be a 4-byte length,
00261         followed by the LogRecord in pickle format. Logs the record
00262         according to whatever policy is configured locally.
00263         """
00264         while 1:
00265             try:
00266                 chunk = self.connection.recv(4)
00267                 if len(chunk) < 4:
00268                     break
00269                 slen = struct.unpack(">L", chunk)[0]
00270                 #print slen
00271                 chunk = self.connection.recv(slen)
00272                 while len(chunk) < slen:
00273                     chunk = chunk + self.connection.recv(slen - len(chunk))
00274                 obj = self.unPickle(chunk)
00275                 record = logging.makeLogRecord(obj)
00276                 #record = logging.LogRecord(None, None, "", 0, "", (), None)
00277                 #record.__dict__.update(obj)
00278                 self.handleLogRecord(record)
00279             except socket.error, e:
00280                 if type(e.args) != types.TupleType:
00281                     raise e
00282                 else:
00283                     errcode = e.args[0]
00284                     if errcode != errno.ECONNRESET:
00285                         raise e
00286                     break
00287
00288     def unPickle(self, data):
00289         return cPickle.loads(data)
00290
00291     def handleLogRecord(self, record):
00292         #if a name is specified, we use the named logger rather than the one
00293         #implied by the record. This is so test harnesses don't get into
00294         #endless loops (particularly log_test.py, which has this code and the
00295         #client code in the same Python instance)
00296         if self.server.logname is not None:
00297             name = self.server.logname
00298         else:
00299             name = record.name
00300         logger = logging.getLogger(name)
00301         #logger.handle(record)
00302         #print logger.handlers[0].format(record)
00303
00304         #~ self.__actualData = logger.handlers[0].format(record)
00305
00306         self.server.gui.appendLogData(logger.handlers[0].format(record))
00307
00308
00309 class MSGLogSocketReceiver(ThreadingTCPServer):
00310   allow_reuse_address = 1
00311
00312   def __init__(self, gui, host='', port=logging.handlers.DEFAULT_TCP_LOGGING_PORT,
00313       handler=LogRecordStreamHandler):
00314     ThreadingTCPServer.__init__(self, (host, port), handler)
00315     self.__abort = 0
00316     self.timeout = 1
00317     self.logname = None
00318     self.gui = gui
00319     self.handler = handler
00320
00321   def abort(self):
00322     self.__abort = 1
00323
00324   def serve_until_stopped(self):
00325     while not self.__abort:
00326       rd, wr, ex = select.select([self.socket.fileno()],
00327                                  [], [],
00328                                  self.timeout)
00329       if rd:
00330         self.handle_request()
00331
00332 class MSGLogGUIImpl(MSGLogGUI):
00333
00334   def __init__(self, port=logging.handlers.DEFAULT_TCP_LOGGING_PORT,
00335                updateInterval=100, parent = None,name = None,fl = 0):
00336     MSGLogGUI.__init__(self,parent,name,fl)
00337     #self.setCentralWidget( self.Logger )
00338     self.__secure = 0
00339     self.__timer = QTimer(self)
00340     QObject.connect(self.__timer, SIGNAL("timeout()"), self.addLogDataToView)
00341     self.__updateInterval = updateInterval
00342     self.__timer.start(self.__updateInterval)
00343     self.__port = port
00344     self.__level = 0
00345     self.__filename = None
00346     self.printer = QPrinter()
00347     self.filename = QString.null
00348     self.tcpserver = None
00349     self.__logname = "MSGLogger"
00350     self.__logData = []
00351     self.__logList = []
00352     self.__count = 0
00353     self.__previousMSG = ["","","",""]
00354     self.__previousMSGcut = ["",""]
00355
00356     self.imageFatal = QPixmap(imageFatal_data)
00357     self.imageError = QPixmap(imageError_data)
00358     self.imageWarn = QPixmap(imageWarn_data)
00359     self.imageInfo = QPixmap(imageInfo_data)
00360     self.imageDebug = QPixmap(imageDebug_data)
00361     self.imageNotset = QPixmap(imageNotset_data)
00362
00363     self.connect(self.filterbyCritical,SIGNAL("activated()"),self.levelCritical)
00364     self.connect(self.filterbyFatal,SIGNAL("activated()"),self.levelFatal)
00365     self.connect(self.filterbyError,SIGNAL("activated()"),self.levelError)
00366     self.connect(self.filterbyWarn,SIGNAL("activated()"),self.levelWarn)
00367     self.connect(self.filterbyInfo,SIGNAL("activated()"),self.levelInfo)
00368     self.connect(self.filterbyDebug,SIGNAL("activated()"),self.levelDebug)
00369     self.connect(self.filterbyNotset,SIGNAL("activated()"),self.levelNotset)
00370     self.connect(self.noFilter,SIGNAL("activated()"),self.levelNoFilter)
00371
00372     #~ self.connect(self.Logger,SIGNAL("currentChanged(QListViewItem*)"),self.preventSaturation)
00373     self.connect(self.Logger,SIGNAL("currentChanged(QListViewItem*)"),self.showEntries)
00374     self.connect(self.Logger, SIGNAL('clicked(QListViewItem*)'), self.preventCheck)
00375     self.connect(self.RunningLogButton,SIGNAL("clicked()"),self.switchToRunningLog)
00376     self.connect(self.FileLogButton,SIGNAL("clicked()"),self.fileOpen)
00377
00378     #atexit.register(logging.shutdown)
00379     atexit.register(self.__shutdown)
00380
00381     self.__hdlr = logging.StreamHandler()
00382     fmt = logging.Formatter("%(asctime)s %(filename)s:%(lineno)d %(levelname)-5s - %(message)s")
00383     self.__hdlr.setFormatter(fmt)
00384     logger = logging.getLogger(self.__logname)
00385     logger.addHandler(self.__hdlr)
00386     #logger.propagate = 0
00387
00388     self.Logger.setColumnAlignment(0, Qt.AlignCenter)
00389     self.Logger.header().setMovingEnabled(0)
00390
00391     self.Logger.setSorting(-1,1)
00392
00393     self.Logger.setColumnWidth(0,0)
00394     #~ self.Logger.setColumnWidth(1,40)
00395     #~ self.Logger.setColumnWidth(2,20)
00396     #~ self.Logger.setColumnWidth(3,80)
00397     #~ self.Logger.setColumnWidth(4,30)
00398
00399     #~ self.noFilter.setOn(1)
00400     logging.addLevelName(60, 'ALERT')
00401     logging.ALERT = 60
00402
00403   def preventSaturation(self):
00404     if self.Logger.childCount() >= MAX_ENTRIES:
00405       #print "too many entries"
00406       self.__timer.stop()
00407       item = self.Logger.firstChild()
00408       count = 0
00409       while (count < DELETE_ENTRIES):
00410         if QString.compare(item.text(1),'CRITICAL') != 0 and QString.compare(item.text(1),'FATAL') != 0 :
00411           count += 1
00412           if count >= self.Logger.childCount(): break
00413           saveItem = item.nextSibling()
00414           self.Logger.takeItem(item)
00415           item = saveItem
00416         else:
00417           item = item.nextSibling()
00418
00419         #~ item = item.nextSibling()
00420       self.__timer.start(self.__updateInterval)
00421
00422   def showEntries(self):
00423       self.statusBar().message('Number of entries: ' + str(self.Logger.childCount()))
00424
00425   def preventCheck(self):
00426     item = self.Logger.currentItem()
00427     if item is not None:
00428       if item.isOn():
00429         if QString.compare(item.text(1),'CRITICAL') == 0 or QString.compare(item.text(1),'FATAL') == 0 :
00430           self.statusBar().message('CRITICAL or FATAL error: Uncheck to Acknowledge',2000)
00431         else:
00432           self.statusBar().message('CRITICAL and FATAL errors check boxes ONLY are enabled to be acknowledged',2500)
00433           item.setOn(0)
00434
00435   def appendLogData(self, data):
00436     self.__logData.append(data)
00437 #    if len(self.__logList) > 10000:
00438 #      rc = QMessageBox.information(self,'GLAT Online Message Logger',
00439 #                  'The Active Logger has reached the maximum of 10000 entries and will now close. Would you like to keep listening in a new log?',
00440 #                  'Yes','No')
00441 #      if rc == 0:
00442 #        # Fill in here what to do
00443 #        e.ignore()
00444 #      else:
00445 #        e.accept()
00446 #    else:
00447 #      self.__logList.append(data)
00448
00449   def switchToRunningLog(self):
00450     self.LogType.setText("Active Run Control Log")
00451     self.Logger.clear()
00452     #~ print "Data: ", self.__logData
00453     self.addLogDataToView()
00454     if not self.runTCPThread.isAlive():
00455       self.startListenerThread()
00456
00457     #~ for data in self.__logData:
00458
00459
00460   def abortListenerThread(self):
00461     if self.runTCPThread.isAlive():
00462       self.tcpserver.abort()
00463       self.runTCPThread.join()
00464
00465
00466   def startListenerThread(self):
00467     self.Logger.clear()
00468     self.LogType.setText("Active Run Control Log")
00469     self.LogType.setAlignment(QLineEdit.AlignLeft)
00470
00471     self.tcpserver = MSGLogSocketReceiver(self, host='', port=self.__port)
00472     self.tcpserver.logname = self.__logname
00473     self.runTCPThread = threading.Thread(target=self.runTCP, name=self.__logname, args=(self.tcpserver,))
00474     self.runTCPThread.start()
00475
00476
00477   def runTCP(self, tcpserver):
00478     try:
00479       tcpserver.serve_until_stopped()
00480     finally:
00481       tcpserver.server_close()
00482
00483
00484   def clearLevels(self):
00485     self.filterbyCritical.setOn(0)
00486     self.filterbyError.setOn(0)
00487     self.filterbyInfo.setOn(0)
00488     self.filterbyDebug.setOn(0)
00489     self.filterbyNotset.setOn(0)
00490     self.filterbyFatal.setOn(0)
00491     self.filterbyWarn.setOn(0)
00492     self.noFilter.setOn(0)
00493
00494   def levelCritical(self):
00495     self.clearLevels()
00496     self.filterbyCritical.setOn(1)
00497     self.__level = logging.CRITICAL
00498     #~ for i in range(self.Logger.childCount()-1):
00499     if QString.compare(self.LogType.text(), "Active Run Control Log") == 0 :
00500       self.switchToRunningLog()
00501     else:
00502       self.load( )
00503
00504   def levelFatal(self):
00505     self.clearLevels()
00506     self.filterbyFatal.setOn(1)
00507     self.__level = logging.CRITICAL
00508     if QString.compare(self.LogType.text(), "Active Run Control Log") == 0 :
00509       self.switchToRunningLog()
00510     else:
00511       self.load( )
00512
00513   def levelError(self):
00514     self.clearLevels()
00515     self.filterbyError.setOn(1)
00516     self.__level = logging.ERROR
00517     if QString.compare(self.LogType.text(), "Active Run Control Log") == 0 :
00518       self.switchToRunningLog()
00519     else:
00520       self.load( )
00521
00522   def levelWarn(self):
00523     self.clearLevels()
00524     self.filterbyWarn.setOn(1)
00525     self.__level = logging.WARN
00526     if QString.compare(self.LogType.text(), "Active Run Control Log") == 0 :
00527       self.switchToRunningLog()
00528     else:
00529       self.load( )
00530
00531   def levelInfo(self):
00532     self.clearLevels()
00533     self.filterbyInfo.setOn(1)
00534     self.__level = logging.INFO
00535     if QString.compare(self.LogType.text(), "Active Run Control Log") == 0 :
00536       self.switchToRunningLog()
00537     else:
00538       self.load( )
00539
00540   def levelDebug(self):
00541     self.clearLevels()
00542     self.filterbyDebug.setOn(1)
00543     self.__level = logging.DEBUG
00544     if QString.compare(self.LogType.text(), "Active Run Control Log") == 0 :
00545       self.switchToRunningLog()
00546     else:
00547       self.load( )
00548
00549   def levelNotset(self):
00550     self.clearLevels()
00551     self.filterbyNotset.setOn(1)
00552     self.__level = logging.NOTSET
00553     if QString.compare(self.LogType.text(), "Active Run Control Log") == 0 :
00554       self.switchToRunningLog()
00555     else:
00556       self.load(  )
00557
00558   def levelNoFilter(self):
00559     self.clearLevels()
00560     self.noFilter.setOn(1)
00561     self.__level = logging.NOTSET
00562     if QString.compare(self.LogType.text(), "Active Run Control Log") == 0 :
00563       #~ self.addLogDataToView()
00564       self.switchToRunningLog()
00565     else:
00566       self.load(  )
00567
00568   def setListViewItem(self, data):
00569     #~ imageFatal = QPixmap(imageFatal_data)
00570     #~ imageError = QPixmap(imageError_data)
00571     #~ imageWarn = QPixmap(imageWarn_data)
00572     #~ imageInfo = QPixmap(imageInfo_data)
00573     #~ imageDebug = QPixmap(imageDebug_data)
00574     #~ imageNotset = QPixmap(imageNotset_data)
00575
00576     level = self.__level
00577
00578     p = data.rstrip()
00579
00580     s = string.splitfields(p)
00581     temps = string.splitfields(p)
00582     r = string.splitfields(p, ' - ',3)
00583
00584     #Corrects the fact that FATAL is not included in the defs of
00585     # __init__.py for logging in python22
00586
00587     if temps[3] == 'FATAL':
00588       temps[3] = 'CRITICAL'
00589
00590     if logging._levelNames[temps[3]] >= level:
00591       if s[2] == self.__previousMSG[2] and s[3] == self.__previousMSG[3] \
00592           and r[1] == self.__previousMSGcut:
00593         #print s[2], s[3], r[1], self.__count
00594         self.__count += 1
00595
00596       else:
00597         if self.__count >= 3:
00598           messageItem = QCheckListItem( self.Logger,self.Logger.lastItem(), "", QCheckListItem.CheckBox )
00599
00600           messageItem.setText( 1, self.__previousMSG[3])
00601           messageItem.setText( 2, self.__previousMSG[0])
00602           messageItem.setText( 3, self.__previousMSG[1])
00603           messageItem.setText( 4, self.__previousMSG[2])
00604           #~ for i in range (0, 4):
00605             #~ messageItem.setText( i, self.__previousMSG[i])
00606           self.__countMSG = "The previous message was repeated " + str(self.__count) + " time(s)."
00607           messageItem.setText(5, self.__countMSG)
00608
00609           if self.__previousMSG[3] == 'CRITICAL' or \
00610              self.__previousMSG[3] == 'FATAL'    or \
00611              self.__previousMSG[3] == 'ALERT':
00612             messageItem.setPixmap(1, self.imageFatal)
00613             messageItem.setOn(1)
00614
00615           elif self.__previousMSG[3] == 'ERROR':
00616             messageItem.setPixmap(1, self.imageError)
00617
00618           elif self.__previousMSG[3] == 'WARNING':
00619             messageItem.setPixmap(1, self.imageWarn)
00620
00621           elif self.__previousMSG[3] == 'INFO':
00622             messageItem.setPixmap(1, self.imageInfo)
00623
00624           elif self.__previousMSG[3] == 'DEBUG':
00625             messageItem.setPixmap(1, self.imageDebug)
00626
00627           elif self.__previousMSG[3] == 'NOTSET':
00628             messageItem.setPixmap(1, self.imageNotset)
00629           self.__count = 0
00630
00631         item = QCheckListItem( self.Logger, self.Logger.lastItem(), "", QCheckListItem.CheckBox)
00632
00633         item.setText( 1, s[3])
00634         item.setText( 2, s[0])
00635         item.setText( 3, s[1])
00636         item.setText( 4, s[2])
00637         #~ for i in range (0, 4):
00638           #~ item
00639           #~ item.setText( i, s[i])
00640         item.setText(5, r[1])
00641
00642         if s[3]   == 'ALERT':
00643           item.setPixmap(1, self.imageFatal)
00644           item.setOn(1)
00645           self.handleAlert(s)
00646
00647         elif s[3] == 'CRITICAL' or s[3] == 'FATAL':
00648           item.setPixmap(1, self.imageFatal)
00649           item.setOn(1)
00650
00651         elif s[3] == 'ERROR':
00652           item.setPixmap(1, self.imageError)
00653
00654         elif s[3] == 'WARNING':
00655           item.setPixmap(1, self.imageWarn)
00656
00657         elif s[3] == 'INFO':
00658           item.setPixmap(1, self.imageInfo)
00659
00660         elif s[3] == 'DEBUG':
00661           item.setPixmap(1, self.imageDebug)
00662
00663         elif s[3] == 'NOTSET':
00664           item.setPixmap(1, self.imageNotset)
00665
00666         self.__previousMSG = s
00667         self.__previousMSGcut = r[1]
00668
00669       self.preventSaturation()
00670
00671   def handleAlert(self, s):
00672     pass
00673     # print "handleAlert", s
00674
00675   def addLogDataToView(self):
00676   #~ list = []
00677   #~ list.append(data)
00678     self.Logger.blockSignals(1)
00679     while len(self.__logData) > 0:
00680       data = self.__logData.pop(0)
00681       self.setListViewItem(data)
00682
00683     vScroll = self.Logger.verticalScrollBar()
00684     #~ print vScroll.value(), vScroll.maxValue()
00685     if not self.PauseLogButton.isOn() and not vScroll.draggingSlider() :
00686       vScroll.setValue(vScroll.maxValue())
00687
00688     self.Logger.blockSignals(0)
00689     self.showEntries()
00690
00691   #~ def switchToRunningLog(self):
00692     #~ self.Logger.clear()
00693     #~ for data in self.__logList:
00694       #~ self.setListViewItem(data)
00695
00696   def load( self ):
00697
00698     if self.tcpserver is not None:
00699       self.abortListenerThread()
00700     self.Logger.clear()
00701
00702     f = file( str(self.__filename), 'r' )
00703
00704     #~ if not f.open( IO_ReadOnly ):
00705         #~ return
00706
00707     #self.__filename = filename
00708     #~ t = QTextStream( f )
00709
00710     #~ self.noFilter.setOn(1)
00711     multi_line = 0
00712     while 1:
00713       data = f.readline()
00714       data = data[:len(data)-1]
00715       if data == "":
00716         break
00717       if multi_line == 0:
00718         (data1, data2) = data.split(" - ",1)
00719         if data2.startswith("<//") > 0 and multi_line == 0:
00720           datax = data1 + " - " + data2[3:]
00721           multi_line = 1
00722           continue
00723       if multi_line:
00724         if data.endswith("//>"):
00725           datax += "\n" + data[:-3]
00726           multi_line = 0
00727         else:
00728           datax += "\n" + data
00729           continue
00730       else:
00731         datax = data
00732       self.setListViewItem(datax)
00733
00734     f.close()
00735
00736   def filePrint(self):
00737     Margin = 50
00738     pageNo = 1
00739     column = [0, 50, 110, 180, 260, 400]#, 325] # Magic numbers
00740
00741     # If there are no items, don't try to print
00742     if not self.Logger.firstChild():
00743       return
00744
00745     if self.printer.setup(self):
00746       self.statusBar().message('Printing...')
00747
00748       p = QPainter()
00749       p.begin(self.printer)
00750       p.setFont(self.Logger.font())
00751       yPos = 0
00752       fm = p.fontMetrics()
00753       metrics = QPaintDeviceMetrics(self.printer)
00754
00755       if QString.compare(self.LogType.text(), "Active Run Control Log") == 0 :
00756         header = "Message Logger Source: Active Run Control Log"
00757       else:
00758         header = "Message Logger Source: " + str(self.__filename)
00759
00760       page = "Page: 1"
00761       p.drawText(Margin,Margin + yPos,metrics.width(),fm.lineSpacing(),Qt.ExpandTabs | Qt.DontClip, header)
00762       yPos = yPos + fm.lineSpacing()
00763       p.drawText(Margin,Margin + yPos,metrics.width(),fm.lineSpacing(),Qt.ExpandTabs | Qt.DontClip, page)
00764       yPos = yPos + 2*fm.lineSpacing()
00765
00766       columnHeader = ['','Severity','Date','Time','Source','Message']
00767
00768       for i in range (0,6):
00769           p.drawText(column[i],Margin + yPos,metrics.width(),fm.lineSpacing(),
00770                     Qt.ExpandTabs | Qt.DontClip, columnHeader[i])
00771       yPos = yPos + fm.lineSpacing()
00772
00773       item = self.Logger.firstChild()
00774       for j in range(self.Logger.childCount()):
00775         if Margin + yPos > metrics.height() - Margin:
00776           pageNo = pageNo + 1
00777           page = "Page: " + str(pageNo)
00778           self.statusBar().message('Printing (page %d)...' % (pageNo))
00779           self.printer.newPage()
00780           yPos = 0
00781           p.drawText(Margin,Margin + yPos,metrics.width(),fm.lineSpacing(),Qt.ExpandTabs | Qt.DontClip, header)
00782           yPos = yPos + fm.lineSpacing()
00783           p.drawText(Margin,Margin + yPos,metrics.width(),fm.lineSpacing(),Qt.ExpandTabs | Qt.DontClip, page)
00784           yPos = yPos + 2*fm.lineSpacing()
00785
00786           for i in range (0,6):
00787             p.drawText(column[i],Margin + yPos,metrics.width(),fm.lineSpacing(),
00788                       Qt.ExpandTabs | Qt.DontClip, columnHeader[i])
00789           yPos = yPos + fm.lineSpacing()
00790
00791         for i in range (0,6):
00792           p.drawText(column[i],Margin + yPos,metrics.width(),fm.lineSpacing(),
00793                     Qt.ExpandTabs | Qt.DontClip,item.text(i))
00794         yPos = yPos + fm.lineSpacing()
00795         item = item.nextSibling()
00796
00797       p.end()
00798       self.statusBar().message('Printing completed',2000)
00799     else:
00800       self.statusBar().message('Printing aborted',2000)
00801
00802   def Help(self):
00803     pass
00804
00805   def fileNew(self):
00806     print "MSGLogGUIImpl.fileNew(): Not implemented yet"
00807
00808   def fileOpen(self):
00809     fn = QFileDialog.getOpenFileName( QString.null, "(*.log)", self, "Log file dialog",
00810                                             "Choose a Log File" )
00811     if not fn.isEmpty():
00812       self.__filename = fn
00813       self.LogType.setText(str(self.__filename))
00814       self.LogType.setAlignment(QLineEdit.AlignRight)
00815       self.load( )
00816
00817   def fileSave(self):
00818     if self.__filename.isEmpty():
00819       self.fileSaveAs()
00820       return
00821
00822     self.Logger.save( self.__filename )
00823
00824   def fileSaveAs(self):
00825     fn = QFileDialog.getSaveFileName( QString.null, QString.null, self )
00826     if not fn.isEmpty():
00827       self.__filename = fn
00828       self.fileSave()
00829
00830   def fileExit(self):
00831     self.close()
00832
00833   def closeEvent(self, e):
00834     if self.__secure:
00835       e.ignore()
00836       return
00837     if self.Logger.childCount() == 0:
00838       e.accept()
00839     item = self.Logger.firstChild()
00840     for i in range(self.Logger.childCount()-1):
00841       if item.isOn() :#and item.text(3) == "CRITICAL":# or item.text(3) == 'FATAL':
00842         rc = QMessageBox.information(self,'GLAT Online Message Logger',
00843                   'Please acknowledge all CRITICAL and FATAL errors before exit by unchecking the box at the beginning of the entry',
00844                   'OK','Exit Anyway')
00845         if rc == 0:
00846           e.ignore()
00847           break
00848         else:
00849           e.accept()
00850           break
00851
00852       item = item.nextSibling()
00853       e.accept()
00854
00855   def __shutdown(self):
00856     self.abortListenerThread()
00857
00858   def setSecure(self, secure):
00859     self.__secure = secure
00860
00861
00862 if __name__ == "__main__":
00863   import logging.handlers
00864   from LATTE.client.gOptions import Options
00865   def usage(msg):
00866     print """
00867   Error %s
00868   Usage:  python MSGLogGUIImpl.py [--port <portno>] (default: %d)
00869   """ % (msg, logging.handlers.DEFAULT_TCP_LOGGING_PORT)
00870
00871   options = Options([],['port'],[])
00872   try:
00873     options.parse()
00874   except Exception, msg:
00875     usage(msg)
00876     sys.exit()
00877
00878   a = QApplication(sys.argv)
00879   QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00880   if options.port is None:
00881     port = logging.handlers.DEFAULT_TCP_LOGGING_PORT
00882   else:
00883     port = int(options.port)
00884   w = MSGLogGUIImpl(port)
00885   w.startListenerThread()
00886   a.setMainWidget(w)
00887   w.show()
00888   a.exec_loop()
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: multibar.py Source File

browser

multibar.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Trigger"
00012 __abstract__ = "Multibar with scale for trigger display"
00013 __author__   = "Martin Kocian, SLAC"
00014 __date__     = ("$Date: 2005/06/15 23:42:30 $").split(' ')[1]
00015 __version__  = "$Revision: 2.5 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019
00020 from qt import *
00021 from bar import bar
00022 from math import *
00023
00024
00025 class multibar(QWidget):
00026     def __init__(self,parent = None,name = None,fl = 0):
00027         QWidget.__init__(self,parent,name,fl)
00028         if not name:
00029             self.setName("multibar")
00030     def setup(self,nbars,lw=0):
00031
00032         self.__minscale=1
00033         self.__fullscale=1
00034         self.lwid=lw
00035         self.line2 = QFrame(self,"line2")
00036         self.line2.setFrameShape(QFrame.HLine)
00037         self.line2.setFrameShadow(QFrame.Plain)
00038         self.line2.setLineWidth(3)
00039         self.line2.setFrameShape(QFrame.HLine)
00040
00041         self.line1 = QFrame(self,"line1")
00042         self.line1.setFrameShape(QFrame.VLine)
00043         self.line1.setFrameShadow(QFrame.Plain)
00044         self.line1.setLineWidth(3)
00045         self.line1.setFrameShape(QFrame.VLine)
00046
00047         self.line2_2 = QFrame(self,"line2_2")
00048         self.line2_2.setFrameShape(QFrame.HLine)
00049         self.line2_2.setFrameShadow(QFrame.Plain)
00050         self.line2_2.setLineWidth(3)
00051         self.line2_2.setFrameShape(QFrame.HLine)
00052
00053         self.low = QLabel(self,"low")
00054         self.low.setAlignment(QLabel.AlignVCenter | QLabel.AlignRight)
00055         self.low.setScaledContents(1)
00056
00057         self.font=QFont("Times")
00058         self.titlefont=QFont("Times")
00059
00060         self.nbars=nbars
00061         self.bars=[]
00062         self.labels=[]
00063         self.__values=[]
00064         for i in range (nbars):
00065             self.bars.append( bar(self,"bar_%d"%i))
00066             self.labels.append(QLabel(self,"label_%d"%i))
00067             self.labels[i].setAlignment(QLabel.AlignVCenter | QLabel.AlignCenter)
00068             self.labels[i].setScaledContents(1)
00069             self.__values.append(0)
00070
00071         self.line5_2 = QFrame(self,"line5_2")
00072         self.line5_2.setFrameShape(QFrame.HLine)
00073         self.line5_2.setFrameShadow(QFrame.Plain)
00074         self.line5_2.setLineWidth(2)
00075         self.line5_2.setFrameShape(QFrame.HLine)
00076
00077         self.line2_3 = QFrame(self,"line2_3")
00078         self.line2_3.setFrameShape(QFrame.HLine)
00079         self.line2_3.setFrameShadow(QFrame.Plain)
00080         self.line2_3.setLineWidth(3)
00081         self.line2_3.setFrameShape(QFrame.HLine)
00082
00083         self.line5_2_2 = QFrame(self,"line5_2_2")
00084         self.line5_2_2.setFrameShape(QFrame.HLine)
00085         self.line5_2_2.setFrameShadow(QFrame.Plain)
00086         self.line5_2_2.setLineWidth(2)
00087         self.line5_2_2.setFrameShape(QFrame.HLine)
00088
00089
00090         self.high = QLabel(self,"high")
00091         self.high.setAlignment(QLabel.AlignVCenter | QLabel.AlignRight)
00092         self.high.setScaledContents(1)
00093
00094         self.title=QLabel(self,"title")
00095         self.title.setAlignment(QLabel.AlignVCenter| QLabel.AlignCenter)
00096         self.title.setScaledContents(1)
00097
00098         self.languageChange()
00099
00100         #self.resize(QSize(124,168).expandedTo(self.minimumSizeHint()))
00101         self.clearWState(Qt.WState_Polished)
00102
00103
00104     def languageChange(self):
00105         self.setCaption(self.__tr("Form1"))
00106         self.low.setText(self.__tr("low"))
00107         self.title.setText(self.__tr("Title"))
00108         for i in range(self.nbars):
00109             self.labels[i].setText(self.__tr("level"))
00110         self.high.setText(self.__tr("high"))
00111
00112
00113     def __tr(self,s,c = None):
00114         return qApp.translate("multibar",s,c)
00115
00116     def resizeEvent(self,rev):
00117         xel=float(rev.size().width())/(8.+self.lwid+self.nbars*6)
00118         yel=float(rev.size().height())/17.
00119         self.line2.setGeometry(QRect(xel*(5.+self.lwid),yel*2+yel*12-3,xel*2,3))
00120         self.line1.setGeometry(QRect(xel*(5+self.lwid),yel*2,3,yel*12))
00121         self.line2_2.setGeometry(QRect(xel*(5+self.lwid),yel*2+yel*6-1,xel*2,3))
00122         self.low.setGeometry(QRect(0,yel*2+yel*11,xel*(5+self.lwid),yel*1.))
00123         self.line5_2.setGeometry(QRect(xel*(5+self.lwid),yel*2+yel*3-2,xel*1.5,2))
00124         self.line2_3.setGeometry(QRect(xel*(5+self.lwid),yel*2,xel*2,3))
00125         self.line5_2_2.setGeometry(QRect(xel*(5+self.lwid),yel*2+yel*9-2,xel*1.5,2))
00126         self.high.setGeometry(QRect(0,yel*2,xel*(5+self.lwid),yel*1.))
00127         self.title.setGeometry(xel*(7+self.lwid),0,xel*self.nbars*6,yel*2)
00128         self.titlefont.setPointSizeFloat(yel*1.4)
00129         self.title.setFont(self.titlefont)
00130         self.font.setPointSizeFloat(yel*.7)
00131         self.low.setFont(self.font)
00132         self.high.setFont(self.font)
00133         for i in range (self.nbars):
00134             self.bars[i].setGeometry(QRect(xel*(8+self.lwid)+i*6*xel,yel*2,xel*4,yel*12))
00135             self.labels[i].setGeometry(QRect(i*6*xel+(7+self.lwid)*xel,yel*2+yel*12,xel*6,yel*3.))
00136             self.labels[i].setFont(self.font)
00137
00138
00139     def setHigh(self,high):
00140         self.high.setText(self.__tr(high))
00141
00142     def setLow(self,low):
00143         self.low.setText(self.__tr(low))
00144
00145     def setBarTitle(self,i,title):
00146         if i<self.nbars:
00147             self.labels[i].setText(self.__tr(title))
00148
00149     def setTitle(self,title):
00150         self.title.setText(self.__tr(title))
00151
00152     def setScale(self,scale):
00153         for i in range(self.nbars):
00154             self.bars[i].setScale(scale)
00155
00156     def setMinScale(self,min):
00157         self.__minscale=min
00158
00159     def setSlidingScale(self,scale):
00160         self.__fullscale=scale
00161         self.setScale(scale)
00162         self.setHigh("%d"%scale)
00163         self.setLow("0")
00164
00165     def displaySlidingScaleValue(self,i,val):
00166         self.__values[i]=val
00167         maxval=max(self.__values)
00168         if maxval>0 and (maxval>self.__fullscale or maxval<self.__fullscale*.2):
00169             l=pow(10,floor(log10(maxval)))
00170             if maxval/l>5:newscale=10*l
00171             elif maxval/l>2:newscale=5*l
00172             else:newscale=2*l
00173             if newscale<self.__minscale:
00174                 newscale=self.__minscale
00175             self.setSlidingScale(newscale)
00176         self.bars[i].displayValue(val)
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Class Members

- _ -

  • _cleanupConnections() : dispatcher
  • _removeReceiver() : dispatcher
  • _removeSender() : dispatcher
  • _testDg() : BTdump
  • _unsigned() : testSAppEvt, testAppEvt, splitOutTem, hTestAppEvt
  • _write_data() : gSchemaConfig

- a -

  • applyConfig() : gSchemaConfig
  • applyHskConfig() : gHSK

- c -

  • colorScale() : colorScale
  • connect() : dispatcher

- d -

  • dateMnemSelect() : monitoringDbSyncOut
  • disconnect() : dispatcher

- f -

  • FreeSpace() : FreeSpace
  • function() : robustapply

- g -

  • getAllReceivers() : dispatcher
  • getReceivers() : dispatcher
  • getSysReg() : gSchemaConfig

- h -

  • hexConvert() : gBits

- i -

  • importModule() : rcUtil

- l -

  • liveReceivers() : dispatcher
  • lockTransact() : monitoringDbSyncOut

- n -

  • NodeString() : HskAlarms

- r -

  • read() : gEvtCliBT
  • readConfig() : gSchemaConfig
  • readHskConfig() : gHSK
  • readSchema() : gSchemaConfig
  • robustApply() : robustapply

- s -

  • safeRef() : saferef
  • send() : dispatcher
  • sendExact() : dispatcher
  • sequence() : gEvtCliBT
  • setSysReg() : gSchemaConfig
  • startupMainGui() : startupMainGUI

- t -

  • testRaw() : BTdump

- u -

  • usage() : socketMerge, fileMerge

- w -

  • writeSchema() : gSchemaConfig
Generated on Fri Jul 21 13:28:41 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: nullApp.py Source File

nullApp.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Null application for testing"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "August 18, 2004"
00014 __version__  = "$Revision: 1.2 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 from   LATTE.runcontrol.rcTransitions  import rcTransitions
00021
00022
00023 #  Null application implementation.
00024 class userApplication(rcTransitions):
00025   "Implmentation class for Null application"
00026   def __init__(self, rc, userId, debug):
00027     rcTransitions.__init__(self, rc, userId, debug)
00028
00029   def getName(self):
00030     return __name__
00031
00032   def setup(self):
00033     # A state transition can be rejected by not returning None
00034     return None
00035
00036   def startRun(self):
00037     # A state transition can be rejected by not returning None
00038     return None
00039
00040   def stopRun(self):
00041     self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00042
00043     # The STOP_RUN transition can not be rejected
00044
00045   def stop(self):
00046     return self.stopRun()
00047
00048   def process(self, (status, buffer)):
00049     "Method called back for each data event taken"
00050     pass
00051
00052   def wait(self):
00053     pass
00054
00055
00056 # Standalone mode:
00057 if __name__ == "__main__":
00058   import os
00059   import logging as log
00060   log.basicConfig()
00061   log.getLogger("").setLevel(log.DEBUG)
00062   ua = userApplication(None, 321, 0)
00063   prefs = {'datasave': 1, 'datadir':os.path.join(os.environ['ONLINE_ROOT'],'temp')}
00064   ua.setPrefs(prefs)
00065   ua.rcSetup(os.path.join(os.environ['ONLINE_ROOT'], 'repos/simpleTemSchema.xml'))
00066   ua.rcStartRun()
00067   ua.wait()
00068   ua.rcStopRun()
00069   ua.rcTeardown()
00070
00071 # History:
00072 #     $Log: nullApp.py,v $
00073 #     Revision 1.2  2004/08/25 04:00:39  stuvi
00074 #     no message
00075 #
00076 #     Revision 1.1  2004/08/19 01:55:50  claus
00077 #     Null application used for testing.
00078 #
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: NullObjects.py Source File

trigger

NullObjects.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Trigger Tower Interface classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.3 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 from TrgTower           import TrgTower
00022 from TrgTower           import TrgCalorimeter
00023 from TrgTower           import TrgTracker
00024
00025 from TrgInputEnables    import TrgInputEnables
00026 from TrgInputEnables    import TrgTowerEnables
00027 from TrgInputEnables    import TrgTileEnables
00028 from TrgInputEnables    import TrgCnoEnables
00029 from TrgInputEnables    import TrgTowerBusyEnables
00030 from TrgInputEnables    import TrgExtEnables
00031
00032 from TrgCoincidences    import TrgRoi
00033 from TrgCoincidences    import TrgCoincidence
00034
00035 from TrgEngines         import TrgEngine
00036 from TrgEngines         import TrgEngineRequest
00037 from TrgEngines         import TrgReadout
00038
00039 """NullObjects: Interfaces for when there are no objects in the system"""
00040
00041 ### Tower system
00042
00043 class NullTower(TrgTower):
00044   """NullTower class:
00045      Class defines a tower with no calorimeter active and no tracker active.
00046   """
00047   def __init__(self):
00048     TrgTower.__init__(self)
00049     self.__cal = NullCal()
00050     self.__tkr = NullTkr()
00051   def calorimeter(self):
00052     return self.__cal
00053   def tracker(self):
00054     return self.__tkr
00055
00056 class NullCal(TrgCalorimeter):
00057   """NullCal class:
00058      Class defines a calorimeter which is inactive.
00059      Used by NullTower
00060   """
00061   def __init__(self):
00062     TrgCalorimeter.__init__(self)
00063   def useHighEnergy(self):
00064     return False
00065   def useLowEnergy(self):
00066     return False
00067
00068 class NullTkr(TrgTracker):
00069   """NullTkr class:
00070      Class defines a tracker which is inactive.
00071      Used by NullTower
00072   """
00073   def __init__(self):
00074     TrgTracker.__init__(self)
00075   def use(self):
00076     return False
00077
00078
00079 ###  Input Enables
00080
00081 class NoTowersEnabled(TrgTowerEnables):
00082   def __init__(self):
00083     TrgTowerEnables.__init__(self)
00084     self.__null = NullTower()
00085   def tower(self,towerNumber):
00086     return self.__null
00087
00088 class NoTilesEnabled(TrgTileEnables):
00089   """NoTilesEnabled class:
00090      Class defining a system where no tiles are enabled.
00091   """
00092   def __init__(self):
00093     TrgTileEnables.__init__(self)
00094   def tile(self,tileNumber):
00095     return 0
00096
00097 class NoCnoEnabled(TrgCnoEnables):
00098   """NoCnoEnabled class:
00099   Class defining a system where all CNO inputs are disabled.
00100   """
00101   def __init__(self):
00102     TrgCnoEnables.__init__(self)
00103     #Do nothing else.  Default is all disabled.
00104
00105 class NoTowersBusy(TrgTowerBusyEnables):
00106   """NoTowersBusy class:
00107      Class defining a system where no tower busy bits are enabled.
00108   """
00109   def __init__(self):
00110     TrgTowerBusyEnables.__init__(self)
00111   def tower(self, towerNumber):
00112     return False
00113
00114 class NoExternal(TrgExtEnables):
00115   """NoExternal class:
00116      Class defining a system where no trigger is enabled.
00117   """
00118   def __init__(self):
00119     TrgExtEnables.__init__(self)
00120   def external(self):
00121     return False
00122
00123 class NoInputsEnabled(TrgInputEnables):
00124   """NoInputsEnabled class:
00125   Class defining a system where no inputs are enabled.
00126   """
00127   def __init__(self):
00128     TrgInputEnables.__init__(self)
00129     self.__towers  = NoTowersEnabled()
00130     self.__tiles   = NoTilesEnabled()
00131     self.__cno     = NoCnoEnabled()
00132     self.__twrBusy = NoTowersBusy()
00133     self.__ext     = NoExternal()
00134
00135   def towers(self):     return self.__towers
00136   def tiles(self):      return self.__tiles
00137   def cno(self):        return self.__cno
00138   def towerBusy(self):  return self.__twrBusy
00139   def external(self):   return self.__ext
00140
00141 ### Coincidence system
00142
00143 class NullRoi(TrgRoi):
00144   """NullRoi class:
00145      Class defining a system where the ROI contains no tiles.
00146   """
00147   def __init__(self):
00148     TrgRoi.__init__(self)
00149   def tile(self, tileNumber):
00150     return False
00151
00152 class NullCoincidence(TrgCoincidence):
00153   """NullCoincidence class:
00154   Class defining a coincidence set that is all null.
00155   """
00156   def __init__(self):
00157     TrgCoincidence.__init__(self)
00158
00159   def inCoincidence(self,tileNumber):
00160     return -1  # Tile not in coincidence List
00161
00162 # TrgEngines
00163
00164 class NullEngine(TrgEngine):
00165   """NullEngine class:
00166   This class defines an engine doesn't do anything.
00167   Prescale is set to -1 to prevent engine from firing.
00168   """
00169   def __init__(self):
00170     TrgEngine.__init__(self)
00171     self.__request = NullRequest()
00172   def participate(self,conditionsValue):
00173     return False
00174   def prescale(self):
00175     return -1
00176   def request(self):
00177     return self.__request
00178
00179 class NullRequest(TrgEngineRequest):
00180   """NullRequest class:
00181      This class defines an engineRequest that doesn't do anything
00182      However sequence must be set, so the detector will be read out.
00183   """
00184   def __init__(self):
00185     """\brief constructor
00186     """
00187     TrgEngineRequest.__init__(self)
00188   def sequence(self):
00189     return 2
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: parseFswHsk.py Source File

parseFswHsk.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Housekeeping trending tester module"
00012 __author__   = "J. Panetta <panetta@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "7/20/2004"
00014 __version__  = "$Revision: 1.3 $"
00015 __credits__  = "SLAC"
00016
00017
00018 import LATTE.copyright_SLAC
00019
00020 import os, sys
00021 import xml.dom.minidom             as minidom
00022 from LATTE.client.gOptions         import Options
00023 from LATTE.database.gSchemaConfig  import getChildNodes
00024
00025 class HskPacketWriter(object):
00026   def __init__(self, codeFile=sys.stdout, sqlFile=sys.stdout):
00027     self.__name      = None
00028     self.__apid      = None
00029     self.__length    = None
00030     self.__brief     = None
00031     self.__descr     = None
00032     self.__payload   = []
00033     self.codeFile    = codeFile
00034     self.sqlFile     = sqlFile
00035     pass
00036
00037   def dump(self):
00038     prefix = '  '
00039     # print "HSK telemetry packet: "
00040     # print "%sHeader:"              % ( prefix )
00041     # print "%s%sapid    = 0x%04x"   % ( prefix, prefix, self.apid()   )
00042     # print "%s%slength  = 0x%04x"   % ( prefix, prefix, self.length() )
00043     # print "%s%sbrief   = %s"       % ( prefix, prefix, self.brief()  )
00044     # print "%s%sdescr   = %s"       % ( prefix, prefix, self.descr()  )
00045     # print "%sPayload: "            % ( prefix )
00046     # print self.payload()
00047     # print ""
00048
00049   def writeCode(self):
00050     className = "HskPacket%03x" % self.apid()
00051     t         = '  '
00052
00053     msg = ""
00054     msg += "class %s(HskPacket):\n" % className
00055     # insert readList here.
00056     msg += t + "mnemList = [\n"
00057     for tag,bitkey,brief in self.payload():
00058       msg += t + t + '(\'' + tag + '\', \'' + bitkey + '\'),\n'
00059     msg += t + t + "]\n"
00060
00061     msg += t + "def __init__(self, ui):\n"
00062     msg += t + t + "HskPacket.__init__(self, ui)\n"
00063     msg += t + t + "self.name  = \"%s\"\n" % self.name()
00064     msg += t + t + "self.brief = \"%s\"\n" % self.brief()
00065     msg += t + t + "self.descr = \"%s\"\n" % self.descr()
00066     msg += t + t + "self.read()\n"
00067     print >> self.codeFile, msg
00068     print >> self.codeFile, ""
00069
00070   def writeSQL(self):
00071     for tag,bitkey,brief in self.payload():
00072       msg = ''
00073       msg += 'INSERT ignore INTO tlmfields (MNEM,DESCRIP) VALUES'
00074       msg += '(\'' + tag + '\', \'' + brief + '\');'
00075       print >> self.sqlFile, msg
00076
00077   def name(self, a=None):
00078     if a is not None:
00079       self.__name = str(a)
00080     return self.__name
00081
00082   def apid(self, a=None):
00083     if a is not None:
00084       self.__apid = int(a)
00085     return self.__apid
00086
00087   def length(self, a=None):
00088     if a is not None:
00089       self.__length = int(a)/8
00090     return self.__length
00091
00092   def brief(self, a=None):
00093     if a is not None:
00094       self.__brief = a
00095     return self.__brief
00096
00097   def descr(self, a=None):
00098     if a is not None:
00099       self.__descr = a
00100     return self.__descr
00101
00102   def payload(self):
00103     return self.__payload
00104
00105   def addPayload(self, item):
00106     self.__payload.append(item)
00107
00108
00109
00110 def readCATH(fileName, codeFile, sqlFile):
00111   fn = "readCATH"
00112   curDir = os.getcwd()
00113   mainFilePath = os.path.dirname(fileName)
00114   mainFileName = os.path.basename(fileName)
00115   if mainFilePath != '': os.chdir(mainFilePath)
00116   try:
00117     doc = minidom.parse(mainFileName)
00118   except Exception, e:
00119     os.chdir(curDir)
00120     raise e
00121
00122   comments = []
00123   for n in doc.childNodes:
00124     if n.nodeType == minidom.Node.COMMENT_NODE:
00125       comments.append(n.data)
00126
00127   for n in getChildNodes(doc.documentElement):
00128     if n.nodeType == minidom.Node.ELEMENT_NODE:
00129       tagName = n.tagName.lower()
00130       if tagName == "tlm_pkt":
00131         processTlmPkt(n, codeFile, sqlFile)
00132       if tagName == "tlm_fld":
00133         processTlmFld(n, codeFile)
00134
00135 def processTlmFld(node, codeFile):
00136   nodeID = node.getAttribute('id')
00137   t = '  '
00138   for n in getChildNodes(node):
00139     tagName = n.tagName.lower()
00140     if tagName == 'length':
00141       length = n.firstChild.data.strip()
00142
00143   msg = t + t + '\'' + nodeID + '\': ' + length + ','
00144   print >> codeFile, msg
00145
00146 def processTlmPkt(node, codeFile, sqlFile):
00147   nodeID = node.getAttribute('id')
00148   packetCode = HskPacketWriter(codeFile, sqlFile)
00149   packetCode.name(nodeID)
00150   for n in getChildNodes(node):
00151     tagName = n.tagName.lower()
00152     if   tagName == 'apid':
00153       apid = n.firstChild.data.strip()
00154       packetCode.apid(apid)
00155     elif tagName == 'length':
00156       length = n.firstChild.data.strip()
00157       packetCode.length(length)
00158     elif tagName == 'brief':
00159       brief = n.firstChild.data.strip()
00160       packetCode.brief(brief)
00161     elif tagName == 'descr':
00162       descr = n.firstChild.data.strip()
00163       packetCode.descr(descr)
00164     elif tagName == 'tlm_payload':
00165       processTlmPayload(n, packetCode)
00166     else:
00167       pass
00168   packetCode.writeSQL()
00169   packetCode.writeCode()
00170
00171 def processTlmPayload(node, packetCode):
00172   for n in getChildNodes(node):
00173     tagName = n.tagName.lower()
00174     if   tagName == 'tlm_itos':
00175       processTlmITOS(n, packetCode)
00176     else:
00177       pass
00178
00179 def processTlmITOS(node, packetCode):
00180   for n in getChildNodes(node):
00181     tagName = n.tagName.lower()
00182     if   tagName == 'tlm_mne':
00183       processMnemonic(n, packetCode)
00184     else:
00185       raise KeyError, 'unrecognized node= ', tagName
00186
00187 def processMnemonic(node, packetCode):
00188   nodeID     = str(node.getAttribute('id'))
00189   nodeField  = str(node.getAttribute('tlm_fld'))
00190   for n in getChildNodes(node):
00191     tagName = n.tagName.lower()
00192     if   tagName == 'brief':
00193       brief = n.firstChild.data.strip()
00194     else:
00195       pass
00196   packetCode.addPayload( (nodeID, nodeField, brief) )
00197
00198
00199
00200
00201 def startHeader(codeFile):
00202   t = '  '
00203   msg = ''
00204   msg += "from LATTE.monitoring.HskPacketDecoder import HskPacketBase\n"
00205   msg += "\n"
00206   msg += "class HskPacket(HskPacketBase):\n"
00207   msg += t + 'bitDict = {'
00208   print >> codeFile, msg
00209
00210
00211 def endHeader(codeFile):
00212   t = '  '
00213   msg = ''
00214   msg += t + '}\n'
00215   msg += t + "def __init__(self, ui):\n"
00216   msg += t + t + "HskPacketBase.__init__(self, ui)\n"
00217   print >> codeFile, msg
00218   # print >> codeFile, "\n"
00219
00220 if __name__ == '__main__':
00221
00222   # Options, first list mandatory, second list optional
00223   options = Options(['field','packet'],
00224                     [])
00225   try:
00226     options.parse()
00227   except Exception, msg:
00228     # options.usage(usage())
00229     raise Exception, msg
00230
00231   field  = options.field
00232   packet = options.packet
00233
00234   online = os.environ['ONLINE_ROOT']
00235
00236   codeFile = open(os.path.join(online, 'LATTE/monitoring/HskPacket.py'), 'w')
00237   sqlFile  = open(os.path.join(online, 'LATTE/monitoring/HskSql.sql'),   'w')
00238
00239   print >> sqlFile, "__version__  = $Revision: 1.3 $"
00240   print >> sqlFile, "use itosdb;"
00241
00242   startHeader(codeFile)
00243   readCATH(field,  codeFile, sqlFile)
00244   endHeader(codeFile)
00245   readCATH(packet, codeFile, sqlFile)
00246
00247
00248
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: PorcinePanel.py Source File

power

PorcinePanel.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GUI to control Power and Configuration of Event and Command Fabrics "
00012 __author__  = "Gregg Thayer <jgt@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/10/21 00:04:04 $").split(' ')[1]
00014 __version__ = "$Revision: 1.8 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__ = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019 import qt
00020 import logging
00021 import atexit
00022 import threading
00023 from LATTE.database.gFabrics import Fabrics
00024 from LATTE.tools.taskEngine import TaskEngine
00025
00026 # This class exists to create a PIG gui as a MainWindow
00027 class PorcineWindow(qt.QMainWindow):
00028     def __init__(self,common,rc,*args):
00029         qt.QMainWindow.__init__(self,*args)
00030         self.__rc = rc
00031         self.__common = common
00032         self.__panel=PorcinePanel(self)
00033         self.setCentralWidget(self.__panel)
00034         self.__inShutdown = False
00035         self.__refreshComplete = threading.Event()
00036         self.__refreshComplete.set()
00037         atexit.register(self.shutdown)
00038
00039     def shutdown(self):
00040         self.__inShutdown = True
00041         self.windowActivationChange = None
00042         self.__panel.shutdown()
00043         self.__refreshComplete.wait()
00044         self.close()
00045
00046     def windowActivationChange(self, oldActive):
00047       if self.__inShutdown: return
00048       self.__refreshComplete.clear()
00049       if self.isActiveWindow():
00050         app = self.__rc.getApp()
00051         powerOn = self.__panel.getPowerTab().insertButton
00052         powerOff = self.__panel.getPowerTab().extractButton
00053         currentState = 'RESET'
00054         if app is not None:
00055           if app.__class__.__name__ == 'userSuite':
00056             currentState = app.getScriptState()
00057           elif self.__rc.getFSM() is not None:
00058             currentState = self.__rc.getFSM().current_state
00059         if currentState == 'RESET':
00060           powerOn.setEnabled(1)
00061           powerOff.setEnabled(1)
00062         else:
00063           powerOn.setEnabled(0)
00064           powerOff.setEnabled(0)
00065         self.__panel.refreshSchema(self.__common.getLAT(), self.__common.getXBRD())
00066         self.__panel.refreshStatus()
00067       self.__refreshComplete.set()
00068
00069
00070
00071 # This class is the PIG gui Panel, which can be placed in any gui
00072 class PorcinePanel(qt.QVBox):
00073     __CR_TEM_OFFSET=0
00074     __CR_GEM_OFFSET=16
00075     __CR_AEM_OFFSET=17
00076     __CR_EBM_OFFSET=18
00077     __CR_PDU_OFFSET=19
00078     __CR_EPU_OFFSET=27
00079
00080     __EV_GEM_OFFSET=0
00081     __EV_TEM_OFFSET=1
00082     __EV_AEM_OFFSET=17
00083     __EV_EPU_OFFSET=21
00084     def __init__(self,*args):
00085         qt.QVBox.__init__(self,*args)
00086
00087         # This is a TaskEngine to execute our commands in
00088         # a non-gui thread
00089         self.__taskengine=TaskEngine()
00090
00091         # These are our 2 tabs Fabric and Front End Power
00092         self.__tabs=qt.QTabWidget(self)
00093         self.__fabtab=FabricPanel(self.__tabs)
00094         self.__tabs.addTab(self.__fabtab,'Fabric Control')
00095         self.__powertab=FrontEndPowerPanel(self.__tabs)
00096         self.__tabs.addTab(self.__powertab,'Front End Power')
00097         # Displat the Power controls by default
00098         self.__tabs.setCurrentPage(1)
00099
00100         # This variable is used to decide whether or not
00101         # to change the status of the event fabric based
00102         # on whether the EBM is in the C/R fabric
00103         self.__use_event_fabric=True
00104
00105         # Connect to control buttons
00106         self.connect(self.__fabtab.insertButton,
00107                      qt.SIGNAL('clicked()'),
00108                      self.fabricInsert)
00109         self.connect(self.__fabtab.extractButton,
00110                      qt.SIGNAL('clicked()'),
00111                      self.fabricExtract)
00112         self.connect(self.__powertab.insertButton,
00113                      qt.SIGNAL('clicked()'),
00114                      self.powerOn)
00115         self.connect(self.__powertab.extractButton,
00116                      qt.SIGNAL('clicked()'),
00117                      self.powerOff)
00118
00119         # Update our GUI to reflect the schema
00120         self.__taskengine.start()
00121         #self.refreshSchema()
00122         #self.refreshStatus()
00123
00124     def getPowerTab(self):
00125       return self.__powertab
00126
00127     def shutdown(self):
00128         self.__taskengine.shutdown()
00129
00130
00131     # These are the commands to turn things on and off
00132     def fabricInsert(self):
00133         self.__taskengine.spawn(self.__insert_fabrics,
00134                                 self.__getOCSMasks(self.__getSelect()))
00135     def fabricExtract(self):
00136         self.__taskengine.spawn(self.__extract_fabrics,
00137                                 self.__getOCSMasks(self.__getSelect()))
00138     def powerOn(self):
00139         self.__taskengine.spawn(self.__insert_power,
00140                                 self.__getOCSMasks(self.__getSelect()))
00141     def powerOff(self):
00142         self.__taskengine.spawn(self.__extract_power,
00143                                 self.__getOCSMasks(self.__getSelect()))
00144
00145     # This function parses the Schema and applies it
00146     def refreshSchema(self, lat, xbrd):
00147         # These are our pointers to the latte infrastructure
00148         self.__lat=lat
00149         self.__xbrd=xbrd
00150         if self.__lat:
00151             self.__fabrics=Fabrics(self.__lat.LCB)
00152         else:
00153             self.__fabrics=None
00154
00155         if not self.__lat: return {}
00156         cru=1&self.__lat.existsCRU()
00157         ebm=1&self.__lat.existsEBM()
00158         pdu0=1&self.__lat.existsPDU(0)
00159         pdu1=1&self.__lat.existsPDU(1)
00160         basemap={'cmd':cru,
00161                  'evt':ebm,
00162                  'pdu':(pdu1<<1)|pdu0,
00163                  'sec':(pdu1|pdu0)<<1|(pdu1|pdu0)}
00164         gasu={}
00165         arc={}
00166         if self.__lat.existsGEM():
00167             gasu['GEM']=basemap
00168         if self.__lat.existsEBM():
00169             gasu['EBM']=basemap
00170         if self.__lat.existsAEM():
00171             gasu['AEM']=basemap
00172             for free in self.__lat.AEM.ARC.values():
00173                 arc[free.id()]={'arc':1}
00174         crates={}
00175         for epu in self.__lat.EPU.values():
00176             crates[epu.id()]=basemap
00177         towers={}
00178         basemap.update({'cal':1,'tkr':1})
00179         for tem in self.__lat.TEM.values():
00180             towers[tem.id()]=basemap
00181         self.__fabtab.gasupanel.setEnables(gasu)
00182         self.__fabtab.cratepanel.setEnables(crates)
00183         self.__fabtab.towerpanel.setEnables(towers)
00184         self.__powertab.towerpanel.setEnables(towers)
00185         self.__powertab.acdpanel.setEnables(arc)
00186
00187     # This function will go off and get the status
00188     # from the lat hierarchy.
00189     # One day, it might just suck off the LHK stream
00190     def refreshStatus(self):
00191         self.__taskengine.spawn(self.__getStatus)
00192
00193     # Here are utility routines to retrieve the Fabric and Power Panels
00194     def getFabricControl(self):
00195         return self.__fabtab
00196     def getPowerControl(self):
00197         return self.__powertab
00198
00199     # This function is called when commands queued to the
00200     # task engine begin and finish
00201     def __setCommanding(self,bool,message):
00202         logging.info(message)
00203         if bool:
00204             self.setCursor(qt.QCursor(qt.QWidget.WaitCursor))
00205         else:
00206             self.setCursor(qt.QCursor(qt.QWidget.ArrowCursor))
00207         self.__fabtab.powerBox.setEnabled(not bool)
00208         self.__powertab.powerBox.setEnabled(not bool)
00209
00210     # These are the functions that are queued to the
00211     # task engine and which actually call the PIG
00212     # commands
00213     def __insert_fabrics(self,masks):
00214         if not self.__fabrics: return
00215         (cmd,pdu,sec,arc,ctr,evt)=masks
00216         qt.QApplication.postEvent(self,PorcineEvent(PorcineEvent.CommandingChangeType,(True,'Adding to Fabrics--Begun')))
00217         try:
00218             self.__fabrics.insert_cmdrsp(cmd,pdu,sec,0,0)
00219             if self.__updateEventUsage():
00220                 self.__fabrics.insert_event(evt)
00221             self.__getStatus()
00222         except Exception, e:
00223             logging.exception(e)
00224         qt.QApplication.postEvent(self,PorcineEvent(PorcineEvent.CommandingChangeType,(False,'Adding to Fabrics--Complete')))
00225     def __extract_fabrics(self,masks):
00226         if not self.__fabrics: return
00227         (cmd,pdu,sec,arc,ctr,evt)=masks
00228         qt.QApplication.postEvent(self,PorcineEvent(PorcineEvent.CommandingChangeType,(True,'Removing from Fabrics--Begun')))
00229         try:
00230             if self.__updateEventUsage():
00231                 self.__fabrics.extract_event(evt)
00232             self.__fabrics.extract_cmdrsp(cmd,pdu,sec,0,0)
00233             self.__getStatus()
00234         except Exception, e:
00235             logging.exception(e)
00236         qt.QApplication.postEvent(self,PorcineEvent(PorcineEvent.CommandingChangeType,(False,'Removing from Fabrics--Complete')))
00237     def __insert_power(self,masks):
00238         if not self.__fabrics: return
00239         (cmd,pdu,sec,arc,ctr,evt)=masks
00240         qt.QApplication.postEvent(self,PorcineEvent(PorcineEvent.CommandingChangeType,(True,'Powering Up Front Ends--Begun')))
00241         try:
00242             self.__fabrics.insert_cmdrsp(0,0,0,arc,ctr)
00243             self.__getStatus()
00244         except Exception, e:
00245             logging.exception(e)
00246         qt.QApplication.postEvent(self,PorcineEvent(PorcineEvent.CommandingChangeType,(False,'Powering Up Front Ends--Complete')))
00247     def __extract_power(self,masks):
00248         if not self.__fabrics: return
00249         (cmd,pdu,sec,arc,ctr,evt)=masks
00250         qt.QApplication.postEvent(self,PorcineEvent(PorcineEvent.CommandingChangeType,(True,'Powering Down Front Ends--Begun')))
00251         try:
00252             self.__fabrics.extract_cmdrsp(0,0,0,arc,ctr)
00253             self.__getStatus()
00254         except Exception, e:
00255             logging.exception(e)
00256         qt.QApplication.postEvent(self,PorcineEvent(PorcineEvent.CommandingChangeType,(False,'Powering Down Front Ends--Complete')))
00257
00258     # This function will poll the registers and return
00259     # status masks the masks have the canonical format
00260     # It is  "hidden" becuase it should be queued to the
00261     # task engine. Users should use refreshStatus
00262     def __getStatus(self):
00263         (cru,ebm,pdu0,pdu1,sec,arc,cal,tkr)=(0,0,0,0,0,0,0,0)
00264         if not self.__lat: return (0,0,0,0,0,0,0,0)
00265         if self.__lat.existsCRU():
00266             cru=self.__lat.CRU.command_enable
00267         if self.__lat.existsPDU(0):
00268             tems=self.__lat.PDU[0].tems
00269             crates=self.__lat.PDU[0].crates
00270             acd=self.__lat.PDU[0].acd
00271             pdu0=((crates&7)<<self.__CR_EPU_OFFSET)|((acd&1)<<self.__CR_AEM_OFFSET)|tems
00272             sec|=((acd&2)>>1)<<self.__CR_AEM_OFFSET
00273         if self.__lat.existsPDU(1):
00274             tems=self.__lat.PDU[1].tems
00275             crates=self.__lat.PDU[1].crates
00276             acd=self.__lat.PDU[1].acd
00277             pdu1=((crates&7)<<self.__CR_EPU_OFFSET)|((acd&1)<<self.__CR_AEM_OFFSET)|tems
00278             sec|=((acd&2)>>1)<<self.__CR_AEM_OFFSET
00279
00280         if self.__lat.existsEBM() and self.__updateEventUsage():
00281             ebm=self.__lat.EBM.downEBMC().input_enables
00282         for tem in self.__lat.TEM.values():
00283             if not cru&(1<<tem.id()): continue
00284             power=tem.TIC.power_supply
00285             t=power&1
00286             c=(power&2)>>1
00287             cal|=c<<tem.id()
00288             tkr|=t<<tem.id()
00289         if self.__lat.existsAEM() and cru&(1<<self.__CR_AEM_OFFSET):
00290             arc=self.__lat.AEM.power_status
00291         status=(cru,ebm,pdu0,pdu1,sec,arc,cal,tkr)
00292         qt.QApplication.postEvent(self,PorcineEvent(PorcineEvent.StatusChangeType,status))
00293
00294     # This function will check the CRU register to see if
00295     # the EBM is enabled. If not, we should not modify the
00296     # event fabric
00297     def __updateEventUsage(self):
00298         if not self.__lat: return True
00299         if self.__lat.existsEBM() and \
00300                self.__lat.CRU.command_enable&(1<<self.__CR_EBM_OFFSET):
00301             use_event=True
00302         else:
00303             use_event=False
00304         self.__use_event_fabric=use_event
00305         return use_event
00306
00307     # This function will set the status of all of the panels,
00308     # it accepts input in the form of the status event
00309     # posted by __getStatus()
00310     def __setStatus(self,cru,ebm,pdu0,pdu1,sec,arc,cal,tkr):
00311         # First I'll build the TEM status
00312         statmap={}
00313         for i in range(16):
00314             croff=self.__CR_TEM_OFFSET+i
00315             evoff=self.__EV_TEM_OFFSET+i
00316             statmap[i]={'cmd':(cru>>croff)&1,
00317                         'evt':(ebm>>evoff)&1,
00318                         'pdu':(((pdu1>>croff)&1)<<1)|((pdu0>>croff)&1),
00319                         'cal':cal>>croff&1,
00320                         'tkr':tkr>>croff&1}
00321             if not self.__use_event_fabric:
00322                 del statmap[i]['evt']
00323         self.__fabtab.towerpanel.setStatus(statmap)
00324         self.__powertab.towerpanel.setStatus(statmap)
00325         # Now the Gasu
00326         statmap.clear()
00327         croff=self.__CR_AEM_OFFSET
00328         evoff=self.__EV_AEM_OFFSET
00329         aempdu=(((pdu1>>croff)&1)<<1)|((pdu0>>croff)&1)
00330         if (sec>>croff)&1:
00331             aemsec=aempdu and 2
00332         else:
00333             aemsec=aempdu and 1
00334         statmap['AEM']={'cmd':(cru>>croff)&1,
00335                         'evt':(ebm>>evoff)&1,
00336                         'pdu':aempdu,
00337                         'sec':aemsec}
00338         if not self.__use_event_fabric:
00339             del statmap['AEM']['evt']
00340         croff=self.__CR_GEM_OFFSET
00341         evoff=self.__EV_GEM_OFFSET
00342         statmap['GEM']={'cmd':cru>>croff&1,
00343                         'evt':ebm>>evoff&1}
00344         if not self.__use_event_fabric:
00345             del statmap['GEM']['evt']
00346         croff=self.__CR_EBM_OFFSET
00347         statmap['EBM']={'cmd':cru>>croff&1}
00348         self.__fabtab.gasupanel.setStatus(statmap)
00349         # Now the Crates
00350         statmap.clear()
00351         for i in range(3):
00352             croff=self.__CR_EPU_OFFSET+i
00353             evoff=self.__EV_EPU_OFFSET+i
00354             statmap[i]={'cmd':cru>>croff&1,
00355                         'evt':ebm>>evoff&1,
00356                         'pdu':(((pdu1>>croff)&1)<<1)|((pdu0>>croff)&1)}
00357             if not self.__use_event_fabric:
00358                 del statmap[i]['evt']
00359         self.__fabtab.cratepanel.setStatus(statmap)
00360         # lastly the FREE boards
00361         statmap.clear()
00362         for i in range(12):
00363             statmap[i]={'arc':(arc>>i)&1}
00364         self.__powertab.acdpanel.setStatus(statmap)
00365
00366     # Creates OCS masks from getSelect output
00367     def __getOCSMasks(self,selects):
00368         (fabtower,fabcrate,fabgasu,powertower,poweracd)=selects
00369         (cmd,pdu,sec,arc,ctr,evt)=(0L,0L,0L,0L,0L,0L)
00370         # Towers
00371         for i in range(16):
00372             cmd|=fabtower[i]['cmd']<<(self.__CR_TEM_OFFSET+i)
00373             pdu|=(fabtower[i]['pdu']>>1)<<(self.__CR_TEM_OFFSET+i)
00374             evt|=fabtower[i]['evt']<<(self.__EV_TEM_OFFSET+i)
00375             ctr|=powertower[i]['tkr']<<(self.__CR_TEM_OFFSET+i+16)
00376             ctr|=powertower[i]['cal']<<(self.__CR_TEM_OFFSET+i)
00377         # Gasu
00378         cmd|=fabgasu['GEM']['cmd']<<self.__CR_GEM_OFFSET
00379         evt|=fabgasu['GEM']['evt']<<self.__EV_GEM_OFFSET
00380         cmd|=fabgasu['EBM']['cmd']<<self.__CR_EBM_OFFSET
00381         cmd|=fabgasu['AEM']['cmd']<<self.__CR_AEM_OFFSET
00382         evt|=fabgasu['AEM']['evt']<<self.__EV_AEM_OFFSET
00383         pdu|=(fabgasu['AEM']['pdu']>>1)<<self.__CR_AEM_OFFSET
00384         sec|=(fabgasu['AEM']['sec']>>1)<<self.__CR_AEM_OFFSET
00385         # Crates
00386         for i in range(3):
00387             cmd|=fabcrate[i]['cmd']<<(self.__CR_EPU_OFFSET+i)
00388             evt|=fabcrate[i]['evt']<<(self.__EV_EPU_OFFSET+i)
00389             pdu|=(fabcrate[i]['pdu']>>1)<<(self.__CR_EPU_OFFSET+i)
00390         # Frees
00391         for i in range(12):
00392             arc|=poweracd[i]['arc']<<i
00393
00394         return (cmd,pdu,sec,arc,ctr,evt)
00395
00396     # This function returns the dicts from the panels.getSelect()
00397     def __getSelect(self):
00398         fabtower=self.__fabtab.towerpanel.getSelect()
00399         fabcrate=self.__fabtab.cratepanel.getSelect()
00400         fabgasu=self.__fabtab.gasupanel.getSelect()
00401         powertower=self.__powertab.towerpanel.getSelect()
00402         poweracd=self.__powertab.acdpanel.getSelect()
00403         return (fabtower,fabcrate,fabgasu,powertower,poweracd)
00404
00405     # This function recieves the events from the thread
00406     # which executes all of the PIG calls and updates
00407     # the status of widgets in the GUI thread.
00408     def customEvent(self,e):
00409         if e.type()==PorcineEvent.StatusChangeType:
00410             apply(self.__setStatus,e.data())
00411         if e.type()==PorcineEvent.CommandingChangeType:
00412             apply(self.__setCommanding,e.data())
00413
00414 # This class contains the information which gets passed between
00415 # the thread executing the commands to OCS and the GUI thread
00416 class PorcineEvent(qt.QCustomEvent):
00417     StatusChangeType=qt.QEvent.Type(qt.QEvent.User+10)
00418     CommandingChangeType=qt.QEvent.Type(qt.QEvent.User+11)
00419     def __init__(self,type,data):
00420         qt.QCustomEvent.__init__(self,type,data)
00421
00422 # This Panel controls adding and removing Electronic Modules
00423 # from the command and event fabrics
00424 class FabricPanel(qt.QVBox):
00425     def __init__(self,*args):
00426         qt.QVBox.__init__(self,*args)
00427         self.setSpacing(5)
00428
00429         # This Panel contains all of the convienience buttons
00430         self.__setupControlBox()
00431         # The Main selection Panel has 2 columns lbox and rbox
00432         hbox=qt.QHBox(self)
00433         hbox.setSpacing(5)
00434         hbox.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Minimum,
00435                                           qt.QSizePolicy.Fixed))
00436         self.towerpanel=TowerPanel(hbox)
00437
00438         rbox=qt.QVBox(hbox)
00439         rbox.setSpacing(5)
00440         self.gasupanel=GasuPanel(rbox)
00441         self.cratepanel=CratePanel(rbox)
00442
00443         # These are the insert and extract Buttons
00444         self.powerBox=qt.QHGroupBox(self)
00445         self.powerBox.setFrameStyle(qt.QFrame.NoFrame)
00446         self.powerBox.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Minimum,
00447                                                    qt.QSizePolicy.Fixed))
00448         commandFont=qt.QFont()
00449         commandFont.setPointSize(18)
00450         self.insertButton=qt.QPushButton('Add to Fabrics',self.powerBox)
00451         self.insertButton.setMinimumHeight(45)
00452         self.insertButton.setFont(commandFont)
00453         self.extractButton=qt.QPushButton('Remove from Fabrics',self.powerBox)
00454         self.extractButton.setMinimumHeight(45)
00455         self.extractButton.setFont(commandFont)
00456
00457     def __setupControlBox(self):
00458         control=qt.QGroupBox(2,qt.Qt.Vertical,'Selection Controls',self)
00459         control.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Minimum,
00460                                              qt.QSizePolicy.Fixed))
00461         control.setLineWidth(2)
00462         self.allselb=qt.QPushButton('Select All',control)
00463         self.connect(self.allselb,qt.SIGNAL('clicked()'),self.allsel)
00464         self.allclearb=qt.QPushButton('Clear All',control)
00465         self.connect(self.allclearb,qt.SIGNAL('clicked()'),self.allclear)
00466
00467         self.allselcrb=qt.QPushButton('Select All CMD Fabric',control)
00468         self.connect(self.allselcrb,qt.SIGNAL('clicked()'),self.allselcr)
00469         self.allclearcrb=qt.QPushButton('Clear All CMD Fabric',control)
00470         self.connect(self.allclearcrb,qt.SIGNAL('clicked()'),self.allclearcr)
00471
00472         self.allselevtb=qt.QPushButton('Select All Event Fabric',control)
00473         self.connect(self.allselevtb,qt.SIGNAL('clicked()'),self.allselevt)
00474         self.allclearevtb=qt.QPushButton('Clear All Event Fabric',control)
00475         self.connect(self.allclearevtb,qt.SIGNAL('clicked()'),self.allclearevt)
00476
00477         self.allselpdu0b=qt.QPushButton('Select All PDU 0',control)
00478         self.connect(self.allselpdu0b,qt.SIGNAL('clicked()'),self.allselpdu0)
00479         self.allselpdu1b=qt.QPushButton('Select All PDU 1',control)
00480         self.connect(self.allselpdu1b,qt.SIGNAL('clicked()'),self.allselpdu1)
00481
00482     def selectAll(self,select):
00483         self.towerpanel.setAllSelect(select)
00484         self.gasupanel.setAllSelect(select)
00485         self.cratepanel.setAllSelect(select)
00486     def allsel(self):
00487         self.selectAll({'cmd':1,'evt':1})
00488     def allclear(self):
00489         self.selectAll({'cmd':0,'evt':0})
00490     def allselcr(self):
00491         self.selectAll({'cmd':1})
00492     def allclearcr(self):
00493         self.selectAll({'cmd':0})
00494     def allselevt(self):
00495         self.selectAll({'evt':1})
00496     def allclearevt(self):
00497         self.selectAll({'evt':0})
00498     def allselpdu0(self):
00499         self.selectAll({'pdu':1})
00500     def allselpdu1(self):
00501         self.selectAll({'pdu':2})
00502
00503 # This Panel controls powering up and down the front ends
00504 class FrontEndPowerPanel(qt.QHBox):
00505     def __init__(self,*args):
00506         qt.QVBox.__init__(self,*args)
00507
00508         qt.QHBox(self)
00509         vbox=qt.QVBox(self)
00510         hbox=qt.QHBox(vbox)
00511         hbox.setSpacing(5)
00512         self.towerpanel=TowerPowerPanel(hbox)
00513         self.acdpanel=ACDPowerPanel(hbox)
00514         qt.QHBox(self)
00515
00516         self.powerBox=qt.QVGroupBox(vbox)
00517         self.powerBox.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Minimum,
00518                                                    qt.QSizePolicy.Fixed))
00519         self.powerBox.setFrameStyle(qt.QFrame.NoFrame)
00520
00521         commandFont=qt.QFont()
00522         commandFont.setPointSize(18)
00523         self.insertButton=qt.QPushButton('Power Up',self.powerBox)
00524         self.insertButton.setMinimumHeight(45)
00525         self.insertButton.setFont(commandFont)
00526
00527         self.extractButton=qt.QPushButton('Power Down',self.powerBox)
00528         self.extractButton.setMinimumHeight(45)
00529         self.extractButton.setFont(commandFont)
00530
00531 # This is the base class for groups of related EMPanels (Towers,Gasu,...)
00532 class GroupPanel(qt.QVGroupBox):
00533     def __init__(self,*args):
00534         qt.QVGroupBox.__init__(self,*args)
00535         self.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Minimum,
00536                                           qt.QSizePolicy.Minimum))
00537         self.setLineWidth(2)
00538         self.__modules={}
00539         self.constructControls()
00540         self.constructGrid()
00541         self.__lockbox.setChecked(1)
00542     # This function is overloaded by child classes
00543     # to consrtuct the grid of EMPanels
00544     def constructGrid(self):
00545         pass
00546     # This is where we set up the controls for this Panel
00547     def constructControls(self):
00548         self.__controls=qt.QHBox(self)
00549         self.__lockbox=qt.QCheckBox('Lock Like Selections',
00550                                     self.__controls)
00551         self.connect(self.__lockbox,
00552                      qt.SIGNAL('toggled(bool)'),
00553                      self.__lockSelections)
00554     # This function is used to add modules to this panel
00555     def setModule(self,tag,module):
00556         self.__modules[tag]=module
00557     # This function sets the enables for all of the
00558     # EMPanels
00559     def setEnables(self,enables):
00560         for k,m in self.__modules.items():
00561             if enables.has_key(k):
00562                 m.setEnables(enables[k])
00563             else:
00564                 m.setEnables({})
00565     # This function returns a map of maps representing
00566     # the selected state of all the EMPanels
00567     def getSelect(self):
00568         select={}
00569         for k,s in self.__modules.items():
00570             select[k]=s.getSelect()
00571         return select
00572     # This function accepts a map of status maps for each
00573     # of the EMPanel status infos
00574     def setStatus(self,statusmap):
00575         for k,s in statusmap.items():
00576             if self.__modules.has_key(k):
00577                 self.__modules[k].setStatus(s)
00578     # This connects all of the EMPanels selectChanged signals
00579     # to our function to set all selections to the one which
00580     # changed
00581     def __lockSelections(self,bool):
00582         if bool:
00583             for m in self.__modules.values():
00584                 self.connect(m,qt.PYSIGNAL('selectChanged'),
00585                              self.setAllSelect)
00586         else:
00587             for m in self.__modules.values():
00588                 self.disconnect(m,qt.PYSIGNAL('selectChanged'),
00589                                 self.setAllSelect)
00590     # This function sets all EMPanel selections to be select
00591     # select has the same form as returned by EMPanel.getSelect()
00592     def setAllSelect(self,select,name=''):
00593         # We want to disable the locking for the duration
00594         # of this call
00595         lock=self.__lockbox.isChecked()
00596         self.__lockbox.setChecked(0)
00597         if name and select.has_key(name):
00598             select={name:select[name]}
00599         elif name:
00600             select={}
00601         # Now we can loop over all of the EMPanels
00602         for m in self.__modules.values():
00603             m.setSelect(select)
00604         # set the lock back to the previous setting
00605         self.__lockbox.setChecked(lock)
00606
00607 # This class defines the power controls for the Tower FEs
00608 class TowerPowerPanel(GroupPanel):
00609     def __init__(self,*args):
00610         GroupPanel.__init__(self,*args)
00611         self.setTitle('Towers')
00612     def constructGrid(self):
00613         grid=qt.QGrid(4,qt.Qt.Horizontal,self)
00614         grid.setSpacing(10)
00615         # I reverse the array so that
00616         # the orientation of the Towers is the same as it is
00617         # on the LAT (looking from the -z side.
00618         for t in range(15,-1,-1):
00619             tower=EMPanel('TEM'+str(t),grid)
00620             tower.setOrientation(qt.Qt.Vertical)
00621             tower.addSelectable('tkr',CheckLed('tkr','TKR',tower))
00622             tower.addSelectable('cal',CheckLed('cal','CAL',tower))
00623             self.setModule(t,tower)
00624
00625 # This class defines the power controls for the ACD FEs
00626 class ACDPowerPanel(GroupPanel):
00627     # This is just a map of Free board names
00628     FreeMap=['1LA','1RB','2LA','2LB','2RA','2RB',
00629              '3LA','3RB','4LA','4LB','4RA','4RB']
00630     def __init__(self,*args):
00631         GroupPanel.__init__(self,*args)
00632         self.setTitle('ACD')
00633     def constructGrid(self):
00634         grid=qt.QGrid(2,qt.Qt.Horizontal,self)
00635         for f in range(12):
00636             name=ACDPowerPanel.FreeMap[f]
00637             free=EMPanel(name,grid)
00638             free.addSelectable('arc',CheckLed('arc',name,free))
00639             free.setFrameStyle(qt.QFrame.NoFrame)
00640             free.setTitle('')
00641             self.setModule(f,free)
00642
00643 # This class defines the fabric controls for the Towers
00644 class TowerPanel(GroupPanel):
00645     def __init__(self,*args):
00646         GroupPanel.__init__(self,*args)
00647         self.setTitle('Towers')
00648     def constructGrid(self):
00649         grid=qt.QGrid(4,qt.Qt.Horizontal,self)
00650         # I reverse the array so that
00651         # the orientation of the Towers is the same as it is
00652         # on the LAT (looking from the -z side.
00653         for t in range(15,-1,-1):
00654             tower=EMPanel('TEM'+str(t),grid)
00655             tower.addSelectable('cmd',CheckLed('cmd','CMD',tower))
00656             tower.addSelectable('evt',CheckLed('evt','EVT',tower))
00657             states={0:('','OFF'),
00658                     1:('0','PDU0'),
00659                     2:('1','PDU1'),
00660                     3:('','ERR')}
00661             tower.addSelectable('pdu',ExclusiveButtonGroup('pdu',
00662                                                            states,
00663                                                            StatusLabel(tower),
00664                                                            tower))
00665             self.setModule(t,tower)
00666
00667 # This class defines the fabric controls for the Crates
00668 class CratePanel(GroupPanel):
00669     def __init__(self,*args):
00670         GroupPanel.__init__(self,*args)
00671         self.setTitle('Crates')
00672     def constructGrid(self):
00673         # I reverse the array so that
00674         # the orientation of the EPUs is the same as it is
00675         # on the LAT (looking from the -z side.
00676         grid=qt.QGrid(2,qt.Qt.Horizontal,self)
00677         qt.QHBox(grid)
00678         for e in range(2,-1,-1):
00679             epu=EMPanel('EPU'+`e`,grid)
00680             epu.addSelectable('cmd',CheckLed('cmd','CMD',epu))
00681             epu.addSelectable('evt',CheckLed('evt','EVT',epu))
00682             states={0:('','OFF'),
00683                     1:('0','PDU0'),
00684                     2:('1','PDU1'),
00685                     3:('','ERR')}
00686             epu.addSelectable('pdu',ExclusiveButtonGroup('pdu',
00687                                                          states,
00688                                                          StatusLabel(epu),
00689                                                          epu))
00690             self.setModule(e,epu)
00691
00692 # This class defines the fabric controls for the GASU
00693 class GasuPanel(GroupPanel):
00694     def __init__(self,*args):
00695         GroupPanel.__init__(self,*args)
00696         self.setTitle('GASU')
00697     def constructGrid(self):
00698         hbox=qt.QHBox(self)
00699         # Build the AEM
00700         aem=EMPanel('AEM',hbox)
00701         aem.addSelectable('cmd',CheckLed('cmd','CMD',aem))
00702         aem.addSelectable('evt',CheckLed('evt','EVT',aem))
00703         states={0:('','OFF'),
00704                 1:('0','PDU0'),
00705                 2:('1','PDU1'),
00706                 3:('','ERR')}
00707         aem.addSelectable('pdu',ExclusiveButtonGroup('pdu',
00708                                                      states,
00709                                                      StatusLabel(aem),
00710                                                      aem))
00711         states={0:('','OFF'),
00712                 1:('P','P Supply'),
00713                 2:('R','R Supply'),
00714                 3:('','ERR')}
00715         aem.addSelectable('sec',ExclusiveButtonGroup('sec',
00716                                                      states,
00717                                                      StatusLabel(aem),
00718                                                      aem))
00719         vbox=qt.QVBox(hbox)
00720         self.setModule('AEM',aem)
00721
00722         # Build the GEM
00723         gem=EMPanel('GEM',vbox)
00724         gem.addSelectable('cmd',CheckLed('cmd','CMD',gem))
00725         gem.addSelectable('evt',CheckLed('evt','EVT',gem))
00726         self.setModule('GEM',gem)
00727
00728         # Build the EBM
00729         ebm=EMPanel('EBM',vbox)
00730         ebm.addSelectable('cmd',CheckLed('cmd','CMD',ebm))
00731         self.setModule('EBM',ebm)
00732
00733 # This class defines a panel which represents an electronics
00734 # module from the standpoint of PIG, which is to say, it
00735 # has a number devices for selecting and displaying power
00736 # and fabric configurations
00737 class EMPanel(qt.QGroupBox):
00738     def __init__(self,name,*args):
00739         qt.QGroupBox.__init__(self,2,qt.Qt.Horizontal,name,*args)
00740         self.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Minimum,
00741                                           qt.QSizePolicy.Fixed))
00742         self.setInsideMargin(5)
00743         self.setInsideSpacing(3)
00744         self.__selectables={}
00745     # This function will add a selectable to this panel
00746     def addSelectable(self,key,sel):
00747         self.__selectables[key]=sel
00748         self.connect(sel,qt.PYSIGNAL('selectChanged'),self.selectChanged)
00749     # This function returns the selections for each of
00750     # its checkleds and button groups.
00751     # (checkboxes return 1 or 0, button groups return the bitfield
00752     # representing the button selected.)
00753     def getSelect(self):
00754         select={}
00755         for k,b in self.__selectables.items():
00756             select[k]=b.getSelect()
00757         return select
00758     # This function sets the status of the selectables
00759     # it takes an argument of the same form as the output
00760     # of getSelect
00761     def setStatus(self,status):
00762         for k,s in status.items():
00763             if self.__selectables.has_key(k):
00764                 self.__selectables[k].setStatus(s)
00765     # This function sets the selection of the selectables,
00766     # and also has the same form as above
00767     def setSelect(self,select):
00768         for k,s in select.items():
00769             if self.__selectables.has_key(k):
00770                 self.__selectables[k].setSelect(s)
00771     # This PYSIGNAL is emitted if any of our selectables
00772     # are clicked, its parameter is the return value of getSelect
00773     def selectChanged(self,name):
00774         self.emit(qt.PYSIGNAL('selectChanged'),(self.getSelect(),name))
00775     # This function sets the enables for this panel
00776     def setEnables(self,enablemap):
00777         enable=0
00778         for k,s in self.__selectables.items():
00779             if enablemap.has_key(k):
00780                 s.setEnables(enablemap[k])
00781                 enable|=enablemap[k]
00782             else:
00783                 s.setEnables(0)
00784         self.setEnabled(enable)
00785
00786 # This class defines a check box with a label and an 'LED' which
00787 # displays a color based on the status
00788 class CheckLed(qt.QHBox):
00789     statusColors={0:'gray',
00790                   1:'green'}
00791     def __init__(self,name,label,*args):
00792         qt.QHBox.__init__(self,*args)
00793         self.__box=qt.QCheckBox(label,self)
00794         self.setFrameStyle(qt.QFrame.Panel|qt.QFrame.Sunken)
00795         self.setMargin(2)
00796         self.setStatus(0)
00797         qt.QObject.connect(self.__box,
00798                            qt.SIGNAL('toggled(bool)'),
00799                            self.emitChanged)
00800         self.__name=name
00801     def setSelect(self,select):
00802         if self.isEnabled():
00803             self.__box.setChecked(select)
00804     def getSelect(self):
00805         return 1L&self.__box.isChecked()
00806     def setStatus(self,status):
00807         self.setPaletteBackgroundColor(\
00808             qt.QColor(CheckLed.statusColors[status]))
00809     def emitChanged(self,bool):
00810         self.emit(qt.PYSIGNAL('selectChanged'),(self.__name,))
00811     def setEnables(self,enable):
00812         self.setEnabled(1&enable)
00813     def setEnabled(self,bool):
00814         self.__box.setChecked(0)
00815         qt.QWidget.setEnabled(self,bool)
00816
00817 # This class is a simple status label, which clears when disabled
00818 class StatusLabel(qt.QLabel):
00819     def __init__(self,*args):
00820         qt.QLabel.__init__(self,*args)
00821         self.setAlignment(qt.Qt.AlignCenter)
00822         self.setFrameStyle(qt.QFrame.Panel|qt.QFrame.Sunken)
00823         self.setMargin(2)
00824     def setEnabled(self,bool):
00825         if not bool:
00826             self.setText('')
00827         qt.QWidget.setEnabled(self,bool)
00828
00829 # This class will create a group of exclusive radio buttons
00830 # with an abbreviated label for the button, and an associated
00831 # status for when that button is selected to be applied to
00832 # a status label. The selected buttons will be retrieved as
00833 # a bitmask, and the status will be set similarly.
00834 # The statemap has the following form
00835 #  -> {buttonbit:(buttonlabel,status),buttonbit:(buttonlabel,status),...}
00836 # A status for a null button bit can also be defined.
00837 class ExclusiveButtonGroup(qt.QHButtonGroup):
00838     def __init__(self,name,statemap,statuslabel,*args):
00839         qt.QHButtonGroup.__init__(self,*args)
00840         self.setFrameStyle(qt.QFrame.NoFrame)
00841         self.setInsideMargin(0)
00842         self.setInsideSpacing(0)
00843         self.__statemap=statemap
00844         self.__status=statuslabel
00845         self.__buttons={}
00846         self.__name=name
00847         # Here we create the buttons for states with only one bit set
00848         buttonbits=statemap.keys()
00849         buttonbits.sort()
00850         for state in buttonbits:
00851             if self.__xor(state):
00852                 self.__buttons[state]=qt.QRadioButton(statemap[state][0],self)
00853         # The first button is checked by default.
00854         self.__buttons[1].setChecked(1)
00855         # This signal is emitted whenever a button is clicked
00856         # we will then emit a PYSIGNAL which contains the
00857         # bitfield of the selected button.
00858         qt.QObject.connect(self,qt.SIGNAL('clicked(int)'),self.__emitChanged)
00859     # This is my stupid function which provides an xor
00860     # of the bits in a integer. I can't remember the
00861     # trick to do this smartly.
00862     def __xor(self,int):
00863         ret=0
00864         while int:
00865             ret+=int&1
00866             if ret>1: return 0
00867             int>>=1
00868         return ret
00869     # This function will get called whenever the selection
00870     # changes, and emits the selectChanged signal
00871     def __emitChanged(self,int):
00872         select=self.getSelect()
00873         self.emit(qt.PYSIGNAL('selectChanged'),(self.__name,))
00874     # These functions get/set the bitfield which specifies
00875     # which buttons are selected
00876     def getSelect(self):
00877         select=0
00878         for k,b in self.__buttons.items():
00879             if b.isChecked(): select|=long(k)
00880         return select
00881     def setSelect(self,select):
00882         for k,b in self.__buttons.items():
00883             if k&select:
00884                 b.setChecked(b.isEnabled())
00885     # This function sets which buttons are available
00886     def setEnables(self,enable):
00887         # Since we want the lowest enabled box
00888         # to be selected by default, we'll go through the
00889         # sorted keys
00890         keys=self.__buttons.keys()
00891         keys.sort()
00892         keys.reverse()
00893         for k in keys:
00894             self.__buttons[k].setEnabled(k&enable)
00895             self.__buttons[k].setChecked(k&enable)
00896         # If there are no buttons enabled, disable the
00897         # status label, and the button group
00898         self.__status.setEnabled(enable)
00899         qt.QWidget.setEnabled(self,enable)
00900     # Should we be disabled, turn everything off
00901     # otherwise set the default button on
00902     def setEnabled(self,bool):
00903         if not bool:
00904             for b in self.__buttons.values():
00905                 b.setChecked(0)
00906         else:
00907             self.__buttons[1].setChecked(1)
00908         qt.QWidget.setEnabled(self,bool)
00909     # This function recieves a bitfield and sets the
00910     # status label appropriately
00911     def setStatus(self,status):
00912         if self.__statemap.has_key(status):
00913             self.__status.setText(self.__statemap[status][1])
00914
00915 def simple_test(args):
00916     app=qt.QApplication(args)
00917     gui=PorcinePanel(None, None)
00918     app.connect(app,qt.SIGNAL("lastWindowClosed()"),
00919                 app,qt.SLOT("quit()"))
00920     app.setMainWidget(gui)
00921     gui.show()
00922     app.exec_loop()
00923
00924 if __name__=='__main__':
00925     import sys
00926     simple_test(sys.argv)
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: PowerPanelImpl.py Source File

runcontrol

PowerPanelImpl.py

00001 #!/usr/bin/env python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "RunControl Power Panel Implementation"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "10/11/2002"
00014 __version__  = "$Revision: 2.10 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 from qt import SIGNAL, QCursor, Qt, QAction, QKeySequence, QPixmap
00021
00022 import PowerPanel
00023 import FEpowerUp
00024
00025 class PowerPanelImpl(PowerPanel.PowerPanel):
00026
00027   image_green_off = \
00028     "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \
00029     "\x49\x48\x44\x52\x00\x00\x00\x0e\x00\x00\x00\x0e" \
00030     "\x08\x06\x00\x00\x00\x1f\x48\x2d\xd1\x00\x00\x01" \
00031     "\x46\x49\x44\x41\x54\x78\x9c\x85\x92\x2d\x92\xc2" \
00032     "\x30\x1c\xc5\x7f\xed\x44\x44\x20\x10\x08\x44\x05" \
00033     "\x02\x51\x81\xac\xa8\x40\x70\x00\x04\xb2\x07\xe8" \
00034     "\x01\x2a\x57\x54\x56\xac\x40\x70\x00\xe4\x8a\x4a" \
00035     "\x04\x07\x58\x81\x40\x44\x20\x10\x08\x44\x45\x45" \
00036     "\x04\x02\x51\x81\xe8\x4c\x56\xf4\x63\xda\xa1\xcc" \
00037     "\xbe\x99\x4c\xbe\xde\xcb\x7b\x49\xfe\x16\x03\x38" \
00038     "\xe7\x37\xd3\x8c\x7d\xc7\xb5\x86\x38\x3d\x68\xad" \
00039     "\x8d\xd6\xda\x74\x85\x00\x87\xc3\xc1\x7c\xd2\xd0" \
00040     "\x15\x84\xdf\xa1\x59\x46\x4b\x13\xc6\xa1\xf9\x24" \
00041     "\xb6\x1a\x51\x56\x3e\x39\xe7\x17\xd2\x74\xc7\xf3" \
00042     "\x55\xb6\x84\xb1\x14\x04\x41\xc4\x4c\x4b\x94\x52" \
00043     "\x24\x49\x62\x01\xd8\xdd\xbb\xa4\xe9\x8e\xeb\xa3" \
00044     "\x64\x22\x25\x79\x01\x79\x01\xd7\x47\x49\x9a\xee" \
00045     "\xde\x12\x5a\x4d\xbc\xfd\xcf\x96\x53\x76\x61\xe6" \
00046     "\x7a\x00\x9c\x94\x6a\x49\xce\x08\x26\x52\xb2\x1a" \
00047     "\xad\x00\x48\x92\xc4\xb2\x1b\xb7\x86\x94\xdd\x14" \
00048     "\xd9\x4d\xe1\x8c\x68\x1b\x40\x59\x96\x68\x74\x7b" \
00049     "\x98\xed\x3b\x6e\xe5\x5a\xc0\x58\x88\xe1\x26\x05" \
00050     "\x42\x88\x5e\x54\xd1\x75\xf4\x23\xdf\x50\x32\x08" \
00051     "\x77\xea\xc2\x1d\xf4\xb4\x72\xb5\xbb\x4f\x1d\x04" \
00052     "\x51\x7d\x54\x1f\x02\x01\x45\x3d\xa9\xa3\xb7\x77" \
00053     "\xeb\xfe\xd3\xf6\x77\xcb\xe3\xf5\x62\x2c\x05\x8b" \
00054     "\xe9\xa2\x5a\xbc\xd7\x9b\x73\xd8\x7f\xed\xad\x5e" \
00055     "\x39\xc5\x71\x6c\x00\x3c\xcf\xe3\xa8\x8e\xd5\xa2" \
00056     "\xee\x10\xe6\x55\xf7\x26\xec\x3a\xab\xfa\x3b\x34" \
00057     "\xba\x8d\x07\xb0\x76\xd7\x6c\x36\x9b\xff\xeb\xf7" \
00058     "\x13\xfe\x00\xbe\x37\x89\x8a\x88\xac\xe1\x96\x00" \
00059     "\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82"
00060   image_green_on = \
00061     "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \
00062     "\x49\x48\x44\x52\x00\x00\x00\x0e\x00\x00\x00\x0e" \
00063     "\x08\x06\x00\x00\x00\x1f\x48\x2d\xd1\x00\x00\x01" \
00064     "\x16\x49\x44\x41\x54\x78\x9c\x8d\x92\x2b\xb2\xc2" \
00065     "\x30\x14\x86\xbf\x32\x15\x88\x2b\x2b\x10\x08\x04" \
00066     "\x02\x81\xa8\xcc\x22\x10\x91\x5d\x08\x0b\xc8\x02" \
00067     "\x58\x02\xa2\xb2\x12\xc1\x22\x22\x2b\x2a\x2a\x2a" \
00068     "\x22\x22\x22\x90\x15\x88\xcc\xe4\x8a\xd2\xde\xe6" \
00069     "\x52\x66\x38\x2a\xe7\xf1\xcd\x7f\x1e\x49\x58\x30" \
00070     "\xad\x75\x18\xdf\x42\x88\x64\xa9\x66\x35\x77\x9c" \
00071     "\x73\xc1\x39\x17\xfe\x17\xdd\x6e\xb7\xb7\x58\x04" \
00072     "\x8d\x4a\xb2\x95\x41\x78\x11\x64\x2b\xc3\x27\x38" \
00073     "\x19\x21\x63\x0c\x7a\xad\xa9\x8e\x15\x0f\x9e\x53" \
00074     "\x41\xc6\x9a\xa2\x29\xd8\x99\x1d\x75\x57\xa3\xce" \
00075     "\x2a\x89\x5a\x15\x42\x24\x23\x94\xb2\x99\xc0\x07" \
00076     "\x4f\xaa\x63\x35\x38\xfd\x6c\x46\xad\x75\x30\xc6" \
00077     "\x20\x5b\x19\x3c\x3e\x82\x46\xf3\x78\xca\x43\x09" \
00078     "\x3f\xa0\x2e\x2a\xbc\x2d\x67\x28\x72\x78\xdc\x1b" \
00079     "\x6c\xf7\x16\xdb\xdb\xc9\x4f\xe7\xc9\x94\x94\x2c" \
00080     "\x0e\x4d\xb6\xe9\xe2\x4e\xd2\xf9\x9d\x84\x17\x1f" \
00081     "\xd7\x9e\x55\x19\x58\xb0\xdb\x41\x75\x05\x7f\xab" \
00082     "\x2e\x9a\xe2\x2b\x35\x78\x9d\x63\x0e\x03\x94\x87" \
00083     "\x92\x66\x6f\x38\x76\xbb\x41\x09\x60\x1c\x6f\x0b" \
00084     "\x57\x75\x4d\xa2\xef\xa4\x2e\x2a\xd0\x43\x9e\xe7" \
00085     "\xdc\xeb\x7b\x0c\xbc\x20\x58\x00\xe7\xca\x75\x57" \
00086     "\x0f\x5c\x6f\xa3\xfc\x29\x3f\x21\xa5\x5c\xfc\xbf" \
00087     "\x5f\xd9\x2f\x41\x44\x7e\xe4\x06\x4c\xc7\x96\x00" \
00088     "\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82"
00089
00090
00091   image_green_off_old = \
00092     "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \
00093     "\x49\x48\x44\x52\x00\x00\x00\x1c\x00\x00\x00\x1c" \
00094     "\x08\x06\x00\x00\x00\x72\x0d\xdf\x94\x00\x00\x02" \
00095     "\xc9\x49\x44\x41\x54\x78\x9c\xbd\x96\x21\x73\xdb" \
00096     "\x30\x14\xc7\xff\xee\x09\x04\x04\x14\x14\x08\x04" \
00097     "\x14\x06\x18\x14\x08\x04\x04\x14\x0c\x06\x04\x14" \
00098     "\xf8\x43\x14\x04\x04\x0c\x14\x0c\x04\x04\x04\x18" \
00099     "\x0c\xf6\x03\x18\x0c\x08\x04\x0c\x14\x18\x0c\x18" \
00100     "\x08\x0c\x18\x14\x0c\x14\x04\x18\x14\x04\x18\x04" \
00101     "\xe8\xce\x03\xce\x93\x25\x5b\x76\x9b\xbb\xdd\x5e" \
00102     "\xce\x97\x44\x92\xdf\xef\xfd\x9f\xf4\x24\x01\xff" \
00103     "\xd9\x82\x4b\x06\x67\x87\xd7\xaa\xdd\x36\x9b\x4c" \
00104     "\x2f\xf2\xc1\x3e\x03\xb9\x65\xd7\x9d\xf6\x37\x7d" \
00105     "\xbc\x84\x63\xac\x37\x3a\x1f\x88\x20\x7d\xaa\xa4" \
00106     "\x94\x15\x00\x2c\x97\xcb\x5e\xbf\xde\x8e\xa2\x28" \
00107     "\x9c\xd4\x71\xce\x3f\x95\x36\x02\x0e\x41\x3b\x8d" \
00108     "\x36\xec\x4d\x1f\x8d\x9a\x38\x4b\xaa\x3c\x7d\x41" \
00109     "\x5e\xe4\x60\x60\x98\xf2\x29\x50\x02\x0b\xb1\x70" \
00110     "\x9c\x7f\x04\x75\x1a\xec\x34\x92\x2a\x29\x65\xb5" \
00111     "\x4b\x77\x00\x00\x0d\xed\x55\xc6\xc0\xb0\xbe\x5f" \
00112     "\x1b\x80\x94\xb2\x52\x4a\x41\x08\xd1\x81\x5e\xd9" \
00113     "\x7f\x08\x46\x73\x15\x67\x49\xb5\x4d\xb7\xd0\xe7" \
00114     "\xcf\xf1\xd4\x7d\x28\x90\x6d\xba\x45\x9c\x25\xce" \
00115     "\x54\x28\xa5\x3a\xc1\x19\xa0\xbd\xe4\x67\x93\x69" \
00116     "\x10\x67\x49\x95\x24\x31\x00\xe0\x78\xd2\xc8\xdf" \
00117     "\x35\x0e\x25\x3a\x4f\xfe\xde\x80\x93\x24\x86\x94" \
00118     "\xb2\xea\x4b\xb1\x03\x6c\xab\xcb\xf7\x2f\x06\x76" \
00119     "\x28\x81\xb9\x10\xb8\xbb\x19\x79\x53\x7a\x28\x61" \
00120     "\xa0\xbb\x74\x07\x29\x65\xb5\xd9\x6c\x02\x9f\xca" \
00121     "\xab\xf6\xcb\xa4\x2e\x2f\x73\xe3\x6c\x2e\x04\xbe" \
00122     "\x3d\xac\xf0\x10\x3d\x62\x32\xf6\x32\x71\x28\xeb" \
00123     "\x6f\x0d\x0d\xa5\x94\xa3\xcc\xfe\xcd\x80\x26\x9d" \
00124     "\x46\x5d\xda\xa8\x23\xcb\x0e\xbf\xf1\x33\x4b\x8d" \
00125     "\x63\x9f\x1d\x4f\x1a\xd7\x23\x86\xb4\x4c\x01\x4b" \
00126     "\x98\xad\xd2\xbb\xd3\xe4\x45\xee\xfc\xff\xa5\x14" \
00127     "\xde\x5e\xd5\x20\xac\x6d\xc5\xb8\xc0\x62\xba\xc0" \
00128     "\x7e\xbf\x07\xe7\xdc\x0f\xa4\x9a\x0b\x79\x68\xa0" \
00129     "\x76\x0a\xfb\xd2\xd9\x36\xad\xeb\xcc\xec\xd5\xbe" \
00130     "\xd3\x67\x80\xf6\xde\x48\xb0\xeb\xd1\xc0\x56\xeb" \
00131     "\x2f\xc9\xda\x29\xeb\x7f\xef\x0a\x68\x94\xd1\x5c" \
00132     "\x86\xe3\xb0\x71\xda\xf7\x78\x49\xfd\x41\x74\x86" \
00133     "\xd8\x1b\x32\x07\x47\x8e\xbc\xee\x1d\x50\xe2\x33" \
00134     "\x7d\xd2\x60\x94\x99\x82\xbe\x0a\xd3\xdf\x29\x0b" \
00135     "\x00\xd8\x6c\x36\x01\xa3\x58\x3e\x11\xb5\x3d\xae" \
00136     "\x04\xea\x7d\xb6\x65\x54\x1a\x1d\x20\x75\x3c\x44" \
00137     "\x8f\x1d\x67\x83\x30\x5d\x97\xc5\xfc\xf6\xae\x6e" \
00138     "\xfb\xe3\x0e\xa1\xd2\x70\x80\x76\x81\xae\x66\x51" \
00139     "\x10\x45\xab\x8f\xa1\x04\xd3\x1a\x37\xa3\xf3\x4e" \
00140     "\xd4\x2e\x9f\xb1\x3b\xbc\x63\xe6\x20\x9d\x2d\x83" \
00141     "\x38\x4b\xaa\x1f\xc9\xf7\xfa\xa4\xf0\x8d\x3e\xcf" \
00142     "\xb1\x51\x56\x02\xd6\x94\x01\xe7\x12\x2c\xc6\x75" \
00143     "\xa3\xa3\xb0\x7d\x94\x48\x29\xab\xd5\x2c\x0a\xd6" \
00144     "\xf7\x6b\x84\x3c\x04\x03\x33\xa9\xa3\x39\x66\x8c" \
00145     "\x21\x9c\x84\xcd\x4b\x36\xac\xa5\x0e\xe8\x39\xf1" \
00146     "\xe9\x3c\x03\x00\x21\x84\x09\x86\x0e\x61\xaf\xb5" \
00147     "\x95\x91\x3a\x0b\xf8\xfc\xf5\x39\x18\xbc\x3a\x3c" \
00148     "\x3d\x3d\x39\x47\x8b\x10\x02\x4a\x29\x67\x99\x03" \
00149     "\x1e\x90\x07\x16\xde\x7f\xc1\x6a\x16\x05\x83\xeb" \
00150     "\x8f\xd4\x91\x5a\xa5\x14\x8a\xc2\xe7\xbd\x1f\x44" \
00151     "\x76\x5b\xd4\x0b\xea\xe2\xcb\x91\x1d\x00\x99\x51" \
00152     "\xdc\xb3\xd7\x2e\xa6\xcd\xbd\xe7\xa2\x4b\xec\x50" \
00153     "\x40\x4a\x29\xb3\x12\xc9\x78\xc9\xbd\xf7\x9a\x7f" \
00154     "\x6a\xed\x6c\xb4\xed\x2f\x6a\x02\x7f\xd3\xbb\x1f" \
00155     "\xcf\x2c\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42" \
00156     "\x60\x82"
00157
00158   image_green_on_old = \
00159     "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \
00160     "\x49\x48\x44\x52\x00\x00\x00\x1c\x00\x00\x00\x1c" \
00161     "\x08\x06\x00\x00\x00\x72\x0d\xdf\x94\x00\x00\x02" \
00162     "\x71\x49\x44\x41\x54\x78\x9c\xbd\x96\xaf\x92\xdb" \
00163     "\x30\x10\xc6\x3f\x67\x0c\x0e\x04\x14\x04\x18\x18" \
00164     "\x04\x18\x14\x04\x08\x14\x1c\x34\x28\x0c\x30\x0c" \
00165     "\xbc\x47\x30\xb8\x07\x30\x38\x10\x70\x20\x0f\x51" \
00166     "\x10\x28\x10\x50\x70\x20\xa0\xc0\x50\xe0\x40\x81" \
00167     "\x81\x81\x81\x41\x40\x40\x80\x81\x67\x5c\xe0\xac" \
00168     "\xa2\x7f\xb1\x93\xb4\xd3\x9d\xc9\x64\x2c\xad\xf7" \
00169     "\xa7\x6f\x77\x25\x19\xf8\xcf\xe6\xdd\xea\x98\xe7" \
00170     "\x79\x77\x6d\xee\xf9\xf9\xf9\xe6\x38\x83\x8e\x04" \
00171     "\x99\xcf\xe7\xd6\x5c\x59\x96\x0f\x41\xaf\x3a\xe5" \
00172     "\x79\xde\x99\x20\x13\x62\xc2\x38\xe7\x1d\x00\x24" \
00173     "\x49\x72\x35\xae\x73\xa2\xae\x6b\x2d\x7d\x41\x10" \
00174     "\xdc\xb4\x7a\x02\x0e\x41\xad\x41\x15\x56\x96\xa5" \
00175     "\x5c\xfd\x46\x6c\xba\xfd\xd3\x1e\x75\x54\xf7\x8b" \
00176     "\x28\x02\x00\x40\xdc\xc4\x48\x59\x2a\xe3\x8c\x41" \
00177     "\xb5\x01\x35\x8d\xa4\x6a\x23\x36\xdd\x76\xb1\x1d" \
00178     "\x55\xb7\xfa\x5c\x49\x30\xe7\xbc\x13\x85\x00\x8b" \
00179     "\x98\x05\x9d\xb8\x60\x54\x2b\x13\x76\x40\x63\xfd" \
00180     "\xc8\xb6\x8b\x2d\x36\x62\xa3\x95\x42\x14\xc2\x5a" \
00181     "\xd8\xc4\x1a\x41\xdf\x04\x2a\xac\x45\xab\x05\x57" \
00182     "\xed\x80\x06\x2d\x5a\x09\xe5\x9c\x77\xaa\x2a\x35" \
00183     "\xc5\x1a\xd0\x54\xb7\x7f\xda\xcb\x80\x47\xb4\xf0" \
00184     "\x11\xc0\x47\xe0\x84\x1e\xd1\x4a\xe8\x7a\xb9\x06" \
00185     "\xe7\xbc\xcb\x5e\x33\x0f\x27\x40\x08\x5d\xe5\x04" \
00186     "\xd0\x37\x35\xa9\xa3\xe6\x00\x00\x1f\x01\xd6\xc7" \
00187     "\x0c\x71\xfb\xdd\x09\x24\x28\x99\x28\x44\xaf\x6c" \
00188     "\x6a\xab\xf4\xd5\x97\x4c\x75\xad\x12\xe4\xe7\xf4" \
00189     "\x17\xf6\xfe\xc7\x55\x20\xf9\xfb\xf0\x21\x96\x02" \
00190     "\xd8\x5d\xc6\xd5\x5a\x3a\x6b\x48\xea\x68\xd5\x2d" \
00191     "\x6a\x7c\xf8\x3f\xd0\xa2\x76\xb9\x4b\x23\xff\x3a" \
00192     "\xaa\x51\x9d\x2a\xb0\x88\xa1\xaa\x2a\xcd\xc7\x09" \
00193     "\xa4\x3d\xf6\x45\x4f\xc0\xa8\x91\x3f\x65\x66\x27" \
00194     "\x76\x96\x8f\x8c\xa8\x1e\x5b\xa4\xd0\x87\x8f\xd9" \
00195     "\x9d\x50\x7a\xef\x9a\x0d\x2a\x7c\xd4\x86\xde\x77" \
00196     "\x02\xe3\x26\xfe\x2b\xa0\xb4\x73\xf9\xaa\xd3\xa5" \
00197     "\x8e\x13\xe0\x72\xda\xd3\xbf\x7a\x36\xde\x6b\x07" \
00198     "\x34\x98\x6d\x67\xd6\x38\x6d\x0d\xa9\xd0\xbc\x62" \
00199     "\x56\x9f\xab\x87\x60\xf1\xdb\xb7\xfe\x41\x6f\x4e" \
00200     "\xb9\x35\xb4\x94\xaa\x1b\x34\x65\xa9\x77\x0f\xf4" \
00201     "\x80\x06\x8b\x62\x3e\xea\xe7\x6c\x27\x79\x91\xb2" \
00202     "\xc4\x33\xaf\x25\x97\xb5\x68\x2f\xca\x00\x5d\x5d" \
00203     "\x78\x1e\x3a\xd7\x51\x53\x68\x5e\x25\x9c\xf3\x2e" \
00204     "\x65\xa9\xf7\xf2\xfb\x05\x41\x11\xc8\xee\xa3\x83" \
00205     "\x9c\xc6\xd8\x1b\x73\xc3\x1c\x66\x29\x4c\x92\xc4" \
00206     "\xa3\xfb\x4c\x55\xcb\xbf\x72\x2f\x7b\xcf\x3a\xb5" \
00207     "\xe3\x2c\x33\xa7\x42\xdb\x65\xb0\x1b\xb3\xf7\xac" \
00208     "\xaf\xe9\x09\xc0\x14\x60\x11\x83\x28\x04\x2c\xa8" \
00209     "\x6b\x0d\x06\x2c\x9c\x86\xc8\x5e\x33\x6f\xf0\x18" \
00210     "\x61\x51\x9f\x2a\x21\x04\xe8\xaa\x31\xcf\xc6\x31" \
00211     "\x90\x19\xeb\xee\x8f\x23\xc0\xb8\xc9\x4f\x40\x35" \
00212     "\x52\xb8\x25\x5b\xca\xfe\x78\x78\x83\x9b\x0b\x72" \
00213     "\xa5\x3a\x9c\x86\xce\xef\x9a\x7f\x6a\x66\x36\x4c" \
00214     "\xfb\x03\xae\x8f\x50\xbe\x7d\x72\xee\xdd\x00\x00" \
00215     "\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82"
00216
00217   image_yellow_on = \
00218     "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \
00219     "\x49\x48\x44\x52\x00\x00\x00\x1c\x00\x00\x00\x1c" \
00220     "\x08\x06\x00\x00\x00\x72\x0d\xdf\x94\x00\x00\x02" \
00221     "\x38\x49\x44\x41\x54\x78\x9c\xbd\x96\xaf\x72\xab" \
00222     "\x40\x14\xc6\x3f\x3a\x88\x8a\x88\x48\x44\x05\x22" \
00223     "\x02\x11\x11\x51\x81\x88\x40\xf4\x01\xf6\x21\x22" \
00224     "\xf2\x00\x57\x54\x44\x46\x44\x56\x22\x10\x7d\x04" \
00225     "\x44\xc5\x15\x11\x88\x08\x44\x05\x22\x02\x81\x40" \
00226     "\x54\x20\x22\x10\x2b\x22\x76\x66\xaf\x60\x96\x2e" \
00227     "\xbb\x0b\xdd\xb4\x73\x7b\x0c\x19\xce\xe6\xfc\xce" \
00228     "\xf7\xed\x3f\x80\x5f\x0e\xc7\x76\x60\x9e\xe7\x7c" \
00229     "\x2c\x17\x86\xa1\x75\x9d\xc9\x81\x02\x12\x04\xbe" \
00230     "\x96\x2b\xcb\xfa\x5b\xd0\xd1\x41\x79\x9e\x73\x15" \
00231     "\xa4\x42\x54\x58\x9a\xa6\x1c\x00\x08\x21\xa3\x75" \
00232     "\x8d\x89\xb6\x6d\x06\xf6\xcd\xe7\x9e\x55\xf7\x02" \
00233     "\x38\x05\xbd\x9b\x82\x95\x65\xdd\xc3\xb2\x2c\xe1" \
00234     "\x55\xb9\xe5\x8c\x85\x9c\xb1\xb0\xff\x9d\x65\x89" \
00235     "\x11\x22\xc3\xe5\x18\x74\x21\xdb\x28\x83\xd6\xeb" \
00236     "\xe4\x4b\x75\xa7\xd3\x06\x51\xb4\xe9\xad\x6d\xca" \
00237     "\x33\xbc\x60\xa9\x29\xed\x15\xca\x30\x31\x57\xb6" \
00238     "\x30\x00\x58\xaf\x13\xc8\x6a\x01\xa0\x29\xcf\xda" \
00239     "\x38\xcd\x52\xa0\x5b\x04\xb7\xc0\x64\x28\xf0\x69" \
00240     "\x6d\x73\xbd\x6a\xd6\xf6\x40\x55\xdd\xad\x30\x11" \
00241     "\x8c\x85\x3c\x4d\x53\xbe\x7d\xde\x39\x00\x50\x14" \
00242     "\xef\x83\xfc\x1d\x30\xdc\xd4\x42\x9d\x5a\x88\xd2" \
00243     "\x14\x8c\x3d\x59\x41\x55\x2b\x65\x95\xae\x9c\x10" \
00244     "\xea\x1e\xbc\x61\x57\x5d\xe7\x99\x15\x0c\x00\x9e" \
00245     "\xc8\x07\x62\xec\x39\xd0\xd9\x2a\x37\x60\x9c\x43" \
00246     "\x7f\x51\x68\xef\xe6\xf3\x17\xb8\xee\xd1\x0a\xe8" \
00247     "\x2f\x0a\xd0\xba\x86\x17\x2c\x71\xb9\xb4\x68\xae" \
00248     "\xd7\x69\x60\x5d\xad\xac\x0a\x8f\x07\x03\x00\x54" \
00249     "\x7f\xdf\xb4\x4c\x0f\x94\x8f\x2d\x93\xc2\xdb\xc2" \
00250     "\x1d\xcd\x18\x15\xfe\x34\xa6\x1c\xfa\x2f\x96\x1e" \
00251     "\x5f\x69\x57\xc7\xbd\x07\x00\x5c\x2e\xed\x10\x28" \
00252     "\x4e\x7b\xf1\x5c\x04\xb1\xf5\xfd\xa6\x07\x05\x6d" \
00253     "\xef\xb5\xb7\xf1\xa1\x5b\xb5\xbd\x42\xf5\x8a\x39" \
00254     "\x9d\x36\xdf\x82\x25\xbb\xce\x1d\xa1\x0e\x00\x7c" \
00255     "\x36\xb2\x4a\xe5\x0d\x1a\x45\x1b\xe7\x36\x68\x07" \
00256     "\x33\xa9\x93\xc3\xb8\x9c\x04\x38\x8a\x88\xe5\x99" \
00257     "\xca\x06\x30\x93\x3a\x5a\xd7\x00\x0c\x17\xb0\x7a" \
00258     "\xd8\x8a\x83\xb8\x2a\xb7\x1c\x10\x5b\x86\x02\x98" \
00259     "\xa1\xae\x56\x38\xbe\x0e\xe7\x4c\x86\xc9\x40\x00" \
00260     "\xf8\x13\x27\x8e\xa6\x90\x10\xe2\x88\xfb\x4c\x6e" \
00261     "\x60\x11\x10\x27\x3e\xec\x39\xad\xd9\x40\x19\x60" \
00262     "\x07\x13\x31\xb9\x1a\xe3\xc3\x9e\xcb\xc7\xd2\x6a" \
00263     "\xf5\x88\xa6\x3c\xf7\xf6\x98\x20\x63\xb0\x99\xef" \
00264     "\x63\xfb\xbc\xd3\x15\xca\xe1\x05\x4b\x78\xf8\xbc" \
00265     "\x62\x8a\xe2\xbd\xdb\x53\x23\x90\x31\x98\xa8\x05" \
00266     "\x58\x7e\x97\xaa\xf3\xaa\xde\x71\xb3\xa6\x99\xfc" \
00267     "\xbf\x50\x67\x0d\xb4\x69\x48\xb5\x5a\x80\x4c\xdf" \
00268     "\x35\xbf\x1a\xff\x00\xb3\xe3\x40\xd9\xc1\x60\x1b" \
00269     "\x94\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60" \
00270     "\x82"
00271
00272   image_yellow_off = \
00273     "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \
00274     "\x49\x48\x44\x52\x00\x00\x00\x1c\x00\x00\x00\x1c" \
00275     "\x08\x06\x00\x00\x00\x72\x0d\xdf\x94\x00\x00\x02" \
00276     "\xc0\x49\x44\x41\x54\x78\x9c\xbd\x96\x21\x77\xa3" \
00277     "\x40\x10\xc7\xff\xf4\xad\x40\x44\x20\x10\x08\x04" \
00278     "\x22\x12\x81\xa8\x88\xa8\xbc\x0f\x80\x88\x38\x71" \
00279     "\xf2\x44\xc4\x89\x7e\x80\x8a\xca\xca\x48\xc4\x89" \
00280     "\x13\x11\x15\x88\xfd\x00\x15\x27\x2a\x10\x27\x22" \
00281     "\x10\x15\x11\x08\x04\x62\x05\x02\xb1\x62\xde\xe3" \
00282     "\x04\x6f\xc9\x2e\x2c\x69\x5a\xd1\x79\x8f\x17\xb2" \
00283     "\xbb\xec\x6f\xfe\xb3\xcc\x0c\xc0\x17\x9b\x73\xed" \
00284     "\xc2\xa2\x28\xfa\xa5\xb9\xcd\x66\x73\xf5\x3e\x17" \
00285     "\x17\x2a\x48\x14\x86\xb3\xb9\xaa\xae\x3f\x05\x5d" \
00286     "\x5c\x54\x14\x45\x3f\x05\x4d\x21\x53\x18\xe7\xbc" \
00287     "\x07\x80\x34\x4d\x17\xf7\xb5\x4e\x34\x75\x6d\x84" \
00288     "\x2f\x08\xc3\xab\xbc\x57\xc0\x4b\xd0\xd9\xa0\x0e" \
00289     "\xab\xea\x7a\xf4\x3e\xcf\xf6\xbd\x38\x96\x70\x45" \
00290     "\x09\x5a\x85\x20\xd7\x03\x93\x2d\xfc\xf4\x87\xb1" \
00291     "\x39\xe7\xbc\xa7\xa6\x02\x0b\x22\x2b\xd4\x18\xd0" \
00292     "\xc3\xa8\x54\x71\xce\x7b\xc1\x0f\x60\x9d\x3d\x9c" \
00293     "\x00\x40\xab\xd0\x00\xe7\xd9\xbe\x07\x60\x85\xde" \
00294     "\xd8\x60\xea\xac\xf2\x6c\xdf\xb7\x87\xa7\x11\xd6" \
00295     "\x4a\x39\xbb\x00\x80\x75\x35\xda\xc3\x93\x01\x2a" \
00296     "\x1b\x01\x6a\xaa\x99\x73\x37\xb3\x11\x0c\x2f\x41" \
00297     "\x9e\xed\xfb\xee\xe5\x79\x50\x40\x84\xb7\x96\xd0" \
00298     "\x48\x36\xbb\xde\x5a\x02\x11\x01\x00\xba\x97\x67" \
00299     "\x70\xce\xfb\x34\x4d\x9d\x38\xf0\x51\x36\xc2\x38" \
00300     "\x57\x03\x38\x55\xd7\x16\xaf\xa3\xaa\x53\x07\x44" \
00301     "\xeb\x04\xeb\x30\xb2\x86\xf4\xd4\x61\x84\x0a\x7e" \
00302     "\x00\xe7\xbc\xdf\xee\xee\x1d\x00\x38\x1e\xff\xcd" \
00303     "\x15\xea\x49\xad\xd4\xa9\x30\x36\x92\x21\x5a\x27" \
00304     "\x48\x1f\x1e\x71\xb7\xfd\x6e\x05\x2a\x28\x30\x84" \
00305     "\x77\x1a\x4a\x5d\xa5\x11\x52\xa5\x4e\x1c\x4b\x00" \
00306     "\x67\xaf\xd5\x5c\xb9\x90\x87\xca\xd4\xfa\xb6\x78" \
00307     "\x45\x9e\xed\xfb\x38\xf0\x87\x71\xcd\x01\x66\x7b" \
00308     "\xd0\x15\xa5\xe1\x75\x75\x3a\xa2\x7a\xf8\x75\x11" \
00309     "\x06\x00\x1d\x11\x3c\xc6\xc0\xba\x1a\xe2\x58\xc2" \
00310     "\x4f\x62\x08\xd1\xa2\xd4\xd6\x58\x5f\x1a\xe9\xc7" \
00311     "\x00\x80\xf5\x0a\x08\xdc\xb3\xca\xc0\x25\xe3\xd2" \
00312     "\x4d\xff\x4f\x72\xb8\xff\x5b\x9e\x66\x7b\x8f\x0a" \
00313     "\xf5\xb2\xa5\x14\x32\xc6\xe0\x31\x06\xcf\x9d\x2d" \
00314     "\x07\x00\x6d\xdc\x9c\x63\x2e\x83\xe9\xce\xd9\xac" \
00315     "\x0a\x69\x35\x2f\xd6\x1f\x31\xfd\xec\xaf\x02\x7a" \
00316     "\x9b\xbb\xcf\xc3\x24\x01\x5e\x64\x8c\x09\xd1\x9a" \
00317     "\x40\x55\x2f\xd5\xef\x76\x77\xef\x7c\x56\x65\x07" \
00318     "\x02\xb9\xde\x6c\x5c\x55\xa1\x51\xe1\xb4\xc5\x7c" \
00319     "\x54\x25\x49\x42\x2b\x25\xdc\xf0\x16\x00\x50\x32" \
00320     "\xe3\x80\x51\x36\x02\x06\x50\x87\x01\x83\xca\xd5" \
00321     "\xb7\xe5\x44\x9f\xc2\x3a\x10\x56\xfe\xda\x0a\x8b" \
00322     "\x49\x8e\xf7\xd6\x3c\xd4\x1b\x69\x9e\xed\xfb\xb6" \
00323     "\x78\x5d\xec\x16\x0a\xe6\x86\xb7\x20\x0b\x4c\x59" \
00324     "\xd0\x34\x00\x26\x0a\x55\x2b\xa1\xa6\x02\x35\xd5" \
00325     "\x58\x13\x7f\xfe\xc9\x1d\xe9\xc7\x20\x22\x90\xa4" \
00326     "\x31\xcf\x5a\x29\x01\x3f\x1a\xc3\x68\x33\x5d\x1d" \
00327     "\xb0\xd0\xf1\x55\x13\x05\x86\x56\xa3\xab\x55\x65" \
00328     "\x6f\x6a\x4b\xca\x74\xe0\x2e\xfb\xed\x5c\xfc\x74" \
00329     "\x78\x7c\x7c\x30\x5a\x8b\xaa\x8d\xb6\x0a\xf2\x1e" \
00330     "\xcc\x4f\x62\x6c\x77\xf7\x8e\xf5\x0c\x95\x25\xc9" \
00331     "\x2d\xa8\xa9\xc6\x37\xac\x6c\x84\x91\x53\xd7\x80" \
00332     "\x94\xa9\x48\x7d\xf8\xe3\x48\x77\x40\x99\x72\xc2" \
00333     "\x06\x02\xce\xea\xae\x06\xbe\x67\x2a\xa9\xa7\xe7" \
00334     "\xeb\x27\xf1\xe2\xc7\xd4\x97\xd9\x7f\xcc\x73\xa6" \
00335     "\x1e\xf4\x37\xb0\x0e\x00\x00\x00\x00\x49\x45\x4e" \
00336     "\x44\xae\x42\x60\x82"
00337
00338   def __init__(self, rc, common, parent = None, name = None, fl = 0):
00339     PowerPanel.PowerPanel.__init__(self, parent, name, fl)
00340     self.__rc     = rc
00341     self.__common = common
00342     self.__parent = parent
00343     self.__fePowerUp = FEpowerUp.FEpowerUp()
00344     if self.chkCALTKR.isChecked():
00345       self.__bothCALandTKR = 1
00346     else:
00347       self.__bothCALandTKR = 0
00348     # Hide the warning message
00349     self.TextLabel.hide()
00350     # Hide the schema button
00351     self.cmdSelectSchema.hide()
00352
00353     self.connect(self.PwrUpButton,SIGNAL("clicked()"), self.powerUp)
00354     self.connect(self.PwrDownButton,SIGNAL("clicked()"), self.powerDown)
00355     self.connect(self.cmdRefresh,SIGNAL("clicked()"),self.refreshPowerStatus)
00356     self.connect(self.cmdSelectAllACD,SIGNAL("clicked()"),self.selectAllACD)
00357     self.connect(self.cmdSelectAllCAL,SIGNAL("clicked()"),self.selectAllCAL)
00358     self.connect(self.cmdSelectAllTKR,SIGNAL("clicked()"),self.selectAllTKR)
00359     self.connect(self.cmdDeselectAllACD,SIGNAL("clicked()"),self.deSelectAllACD)
00360     self.connect(self.cmdDeselectAllCAL,SIGNAL("clicked()"),self.deSelectAllCAL)
00361     self.connect(self.cmdDeselectAllTKR,SIGNAL("clicked()"),self.deSelectAllTKR)
00362     self.connect(self.chkCALTKR,SIGNAL("toggled(bool)"),self.selectBothCALTKR)
00363     self.connect(self.bgCAL,SIGNAL("clicked(int)"),self.selectCAL)
00364     self.connect(self.bgTKR,SIGNAL("clicked(int)"),self.selectTKR)
00365
00366     self.imgGreenOff = QPixmap()
00367     self.imgGreenOff.loadFromData(PowerPanelImpl.image_green_off,"PNG")
00368     self.imgGreenOn = QPixmap()
00369     self.imgGreenOn.loadFromData(PowerPanelImpl.image_green_on,"PNG")
00370     self.imgYellowOn = QPixmap()
00371     self.imgYellowOn.loadFromData(PowerPanelImpl.image_yellow_on,"PNG")
00372     self.imgYellowOff = QPixmap()
00373     self.imgYellowOff.loadFromData(PowerPanelImpl.image_yellow_off,"PNG")
00374
00375     self.__operator = None
00376     self.__adminOverride = None
00377     self.setEnablePowerUpButton(1)
00378     self.setEnablePowerDownButton(1)
00379
00380   def applyPermissions(self, operator):
00381     self.__operator = operator
00382     self.__adminOverride = operator.isAdministrator()
00383     self.setEnablePowerUpButton(1)
00384     self.setEnablePowerDownButton(1)
00385
00386   def setEnablePowerUpButton(self, enable):
00387     if self.__common.options().securedir is not None:
00388       if self.__operator is not None:
00389         if not 'enable_power_up' in self.__operator.getPermissions() and not self.__adminOverride:
00390           self.PwrUpButton.setEnabled(0)
00391           return
00392     self.PwrUpButton.setEnabled(enable)
00393
00394   def setEnablePowerDownButton(self, enable):
00395     if self.__common.options().securedir is not None:
00396       if self.__operator is not None:
00397         if not 'enable_power_down' in self.__operator.getPermissions() and not self.__adminOverride:
00398           self.PwrDownButton.setEnabled(0)
00399           return
00400     self.PwrDownButton.setEnabled(enable)
00401
00402
00403   def selectBothCALTKR(self, state):
00404     if state:
00405       self.__bothCALandTKR = 1
00406     else:
00407       self.__bothCALandTKR = 0
00408
00409   def selectCAL(self, id):
00410     if id > 15: return
00411     check = self.bgCAL.find(id)
00412     if check.isChecked():
00413       state = 1
00414     else:
00415       state = 0
00416     if self.__bothCALandTKR:
00417       check = self.bgTKR.find(id)
00418       check.setChecked(state)
00419
00420   def selectTKR(self, id):
00421     if id > 15: return
00422     check = self.bgTKR.find(id)
00423     if check.isChecked():
00424       state = 1
00425     else:
00426       state = 0
00427     if self.__bothCALandTKR:
00428       check = self.bgCAL.find(id)
00429       check.setChecked(state)
00430
00431   def selectAllACD(self):
00432     if self.__lat.existsAEM():
00433       for arcId in self.__lat.AEM.ARC:
00434         check = self.bgACD.find(arcId)
00435         check.setChecked(1)
00436
00437   def deSelectAllACD(self):
00438     if self.__lat.existsAEM():
00439       for arcId in self.__lat.AEM.ARC:
00440         check = self.bgACD.find(arcId)
00441         check.setChecked(0)
00442
00443   def selectAllCAL(self):
00444     for temId in self.__lat.TEM:
00445       check = self.bgCAL.find(temId)
00446       check.setChecked(1)
00447       self.selectCAL(temId)
00448
00449   def deSelectAllCAL(self):
00450     for temId in self.__lat.TEM:
00451       check = self.bgCAL.find(temId)
00452       check.setChecked(0)
00453       self.selectCAL(temId)
00454
00455   def selectAllTKR(self):
00456     for temId in self.__lat.TEM:
00457       check = self.bgTKR.find(temId)
00458       check.setChecked(1)
00459       self.selectTKR(temId)
00460
00461   def deSelectAllTKR(self):
00462     for temId in self.__lat.TEM:
00463       check = self.bgTKR.find(temId)
00464       check.setChecked(0)
00465       self.selectTKR(temId)
00466
00467   def activate(self):
00468     self.__lat    = self.__common.getLAT()
00469     if self.__lat is None:
00470       self.__rc.loadSchema()
00471     self.__xbrd   = self.__common.getXBRD()
00472     self.disableAllCheck()
00473     self.__fePowerUp.initialize(self.__lat, self.__xbrd)
00474     self.refreshPowerStatus()
00475     app = self.__rc.getApp()
00476     currentState = 'RESET'
00477     if app is not None:
00478       if app.__class__.__name__ == 'userSuite':
00479         currentState = app.getScriptState()
00480       elif self.__rc.getFSM() is not None:
00481         currentState = self.__rc.getFSM().current_state
00482     if currentState == 'RESET':
00483       self.setEnablePowerUpButton(1)
00484       self.setEnablePowerDownButton(1)
00485     else:
00486       self.setEnablePowerUpButton(0)
00487       self.setEnablePowerDownButton(0)
00488
00489
00490
00491   def disableAllCheck(self, preserveExisting=0):
00492     lat = self.__lat
00493     for i in range(12):
00494       check = self.bgACD.find(i)
00495       if preserveExisting and lat.existsAEM() and lat.AEM.existsARC(i):
00496         pass
00497       else:
00498         check.setEnabled(0)
00499         check.setChecked(0)
00500     for i in range(16):
00501       if preserveExisting and lat.existsTEM(i):
00502         pass
00503       else:
00504         check = self.bgCAL.find(i)
00505         check.setEnabled(0)
00506         check.setChecked(0)
00507     for i in range(16):
00508       if preserveExisting and lat.existsTEM(i):
00509         pass
00510       else:
00511         check = self.bgTKR.find(i)
00512         check.setEnabled(0)
00513         check.setChecked(0)
00514
00515   def initCheckPower(self):
00516     lat = self.__lat
00517     if self.__fePowerUp.isAEMactive(lat.AEM):
00518       for arcId in lat.AEM.ARC.keys():
00519         check = self.bgACD.find(arcId)
00520         check.setEnabled(1)
00521     activeTEMs = self.__fePowerUp.getActiveTEMs(lat)
00522     for temId in activeTEMs.keys():
00523       check = self.bgCAL.find(temId)
00524       check.setEnabled(1)
00525       check = self.bgTKR.find(temId)
00526       check.setEnabled(1)
00527
00528   def getACDPowerUps(self):
00529     acdPowerUp = []
00530     for i in range(self.bgACD.count()):
00531       check = self.bgACD.find(i)
00532       if check.isOn():
00533         acdPowerUp.append(i)
00534     return acdPowerUp
00535
00536   def getTEMPowerUps(self):
00537     temPowerUp = {}
00538     for i in range(self.bgCAL.count()):
00539       powerSupply = 0
00540       check = self.bgCAL.find(i)
00541       if check.isOn():
00542         powerSupply |= 2
00543       check = self.bgTKR.find(i)
00544       if check.isOn():
00545         powerSupply |= 1
00546       if powerSupply != 0: temPowerUp[i] = powerSupply
00547     return temPowerUp
00548
00549   def powerUp(self):
00550     self.__fePowerUp.setAcdPowerUp(self.getACDPowerUps())
00551     self.__fePowerUp.setTemPowerUp(self.getTEMPowerUps())
00552     (acdPowerCheck, calPowerCheck, tkrPowerCheck) = self.__fePowerUp.up()
00553     self.refreshLEDs(acdPowerCheck, calPowerCheck, tkrPowerCheck)
00554
00555   def powerDown(self):
00556     self.__fePowerUp.setAcdPowerUp(self.getACDPowerUps())
00557     self.__fePowerUp.setTemPowerUp(self.getTEMPowerUps())
00558     (acdPowerCheck, calPowerCheck, tkrPowerCheck) = self.__fePowerUp.down()
00559     self.refreshLEDs(acdPowerCheck, calPowerCheck, tkrPowerCheck)
00560
00561   def refreshPowerStatus(self):
00562     self.initCheckPower()
00563     apply(self.refreshLEDs, self.__fePowerUp.refreshPowerStatus())
00564
00565   def refreshLEDs(self, acdPowerCheck, calPowerCheck, tkrPowerCheck):
00566     for i in range(12):
00567       acdLed = eval("self.acdLed"+str(i))
00568       if i in acdPowerCheck:
00569         acdLed.setPixmap(self.imgGreenOn)
00570       else:
00571         acdLed.setPixmap(self.imgGreenOff)
00572     for i in range(16):
00573       calLed = eval("self.calLed"+str(i))
00574       tkrLed = eval("self.tkrLed"+str(i))
00575       if i in calPowerCheck:
00576         calLed.setPixmap(self.imgGreenOn)
00577       else:
00578         calLed.setPixmap(self.imgGreenOff)
00579       if i in tkrPowerCheck:
00580         tkrLed.setPixmap(self.imgGreenOn)
00581       else:
00582         tkrLed.setPixmap(self.imgGreenOff)
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: radiomask.py Source File

browser

radiomask.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Trigger"
00012 __abstract__ = "Radio button mask widget for trigger display"
00013 __author__   = "Martin Kocian, SLAC"
00014 __date__     = ("$Date: 2005/06/03 23:03:42 $").split(' ')[1]
00015 __version__  = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 from qt import *
00020 import sys
00021
00022 class radiomask (QWidget):
00023
00024         def __init__(self,parent= None,name = None,fl = 0):
00025                 QWidget.__init__(self,parent,name,fl)
00026         if not name:
00027             self.setName("mask")
00028                 self.__nbox=0
00029         self.__box=[]
00030         self.__mask=0x1
00031         self.__labels=[]
00032         self.__title=QLabel(self,"title")
00033         self.__title.setAlignment(QLabel.AlignCenter|QLabel.AlignVCenter)
00034         self.clearWState(Qt.WState_Polished)
00035
00036         def setup(self,nbox):
00037         if self.__nbox>0:
00038             for i in range(self.__nbox):
00039                 self.__labels[i].deleteLater()
00040                 self.__box[i].deleteLater()
00041             self.buttongroup.deleteLater()
00042             self.__mask=0x1
00043             self.__labels=[]
00044             self.__box=[]
00045         self.__nbox=nbox
00046         self.buttongroup=QButtonGroup(self,"group")
00047         for i in range(nbox):
00048             self.__box.append(QRadioButton(self.buttongroup,""))
00049             self.buttongroup.insert(self.__box[i],i)
00050             self.__labels.append(QLabel(self.buttongroup,""))
00051             self.__labels[i].setAlignment(QLabel.AlignCenter|QLabel.AlignVCenter)
00052         self.__box[0].setChecked(1)
00053         QObject.connect(self.buttongroup,SIGNAL("clicked(int)"),self.updateMask)
00054         def setTitle(self,text):
00055         self.__title.setText(text)
00056         def click(self,id):
00057         self.__box[id].setChecked(1)
00058         self.updateMask(id)
00059         def setLabel(self,i,text):
00060         self.__labels[i].setText(text)
00061         def updateMask(self,i):
00062         self.__mask=i
00063         self.emit(PYSIGNAL("update"), (self.__mask,))
00064         def getMask(self):
00065         return self.__mask
00066
00067     def resizeEvent(self,rev):
00068         height=rev.size().height()
00069         width=rev.size().width()
00070         ch=(width)/self.__nbox
00071         self.__title.setGeometry(0,0,width,20)
00072         self.buttongroup.setGeometry(2,22,width-4,36)
00073         for i in range(self.__nbox):
00074             self.__labels[i].setGeometry(i*ch+5,20,ch-12,12)
00075                         self.__box[i].setGeometry(i*ch+ch/2+2-7,4,16,18)
00076
00077
00078
00079 if __name__ == "__main__":
00080         a = QApplication(sys.argv)
00081         QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00082         w = radiomask()
00083     w.setup(16)
00084     w.setLabel(10,"10")
00085     w.setLabel(11,"11")
00086     w.setTitle("Hallo")
00087     w.click(4)
00088     w.setGeometry(300,400,350,60)
00089         w.setup(2)
00090         a.setMainWidget(w)
00091         w.show()
00092         a.exec_loop()
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcArchiver.py Source File

runcontrol

rcArchiver.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Event archiver class"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "02/13/2003"
00014 __version__  = "$Revision: 2.3 $"
00015 __credits__  = "SLAC"
00016
00017 from time import gmtime, strftime
00018 import os
00019 from struct import unpack
00020 from struct import pack
00021
00022 from LATTE.client.gEvtCli import EvtCli
00023
00024 MODE_CREATE = 0
00025 MODE_APPEND = 1
00026 MODE_READONLY = 2
00027
00028 class rcArchiver(object):
00029   """\brief Event Archiver
00030
00031   Default event archiver class to store event data to a file.
00032   This class can be inherited to create a custom event class and
00033   using it from a RunControl class by calling the setArchiverClass
00034   method.
00035   """
00036
00037   def __init__(self, filePath=None, fileName=None, mode=MODE_CREATE, userId=123):
00038     if fileName is None:
00039       ts   = strftime('%y%m%d%H%M%S', gmtime())
00040       self.__fileName = rcArchiver.getFileNameFromTS(ts)
00041     else:
00042       self.__fileName = fileName
00043     if filePath is None:
00044       self.__filePath = ""
00045     else:
00046       self.__filePath = filePath + os.sep
00047     self.__mode = mode
00048     if mode == MODE_CREATE:
00049       fileMode = 'w+b'
00050       self.__archFile = file(os.path.join(self.__filePath, self.__fileName), fileMode)
00051     elif mode == MODE_APPEND:
00052       fileMode = 'a+b'
00053       self.__archFile = file(os.path.join(self.__filePath, self.__fileName), fileMode)
00054     elif mode == MODE_READONLY:
00055       fileMode = 'rb'
00056       self.__archFile = None
00057       self.__evtCli = EvtCli()
00058       self.__evtCli.open(os.path.join(self.__filePath, self.__fileName), fileMode)
00059     else:
00060       raise RuntimeError, "Invalid archive file mode"
00061
00062   def write(self, rawEventData):
00063     if not self.__archFile.closed:
00064       self.__archFile.write(rawEventData)
00065
00066   def writeTuple(self, tuple):
00067     for item in tuple:
00068       self.__archFile.write(item)
00069
00070   def read(self):
00071     try:
00072       (header, dat) = self.__evtCli.read()
00073       return dat
00074     except:
00075       return None
00076
00077   def close(self):
00078     if self.__mode == MODE_READONLY:
00079       self.__evtCli.close()
00080     else:
00081       self.__archFile.close()
00082
00083   def isClosed(self):
00084     return self.__archFile.closed
00085
00086   def getFileName(self):
00087       return self.__fileName
00088
00089   def getFilePath(self):
00090     return self.__filePath
00091
00092   def getFileNameFromTS(ts):
00093     return ts + ".ldf"
00094   getFileNameFromTS = staticmethod(getFileNameFromTS)
00095
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcCommentPanel.py Source File

runcontrol

rcCommentPanel.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Comment panel for RunControl"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/08/03 20:25:36 $").split(' ')[1]
00014 __version__  = "$Revision: 2.4 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 from   qt import *
00021 import os
00022 import time
00023
00024 class rcCommentPanel(QWidget):
00025   def __init__(self,parent = None,name = None,fl = 0):
00026     QWidget.__init__(self,parent,name,fl)
00027
00028     if not name:
00029         self.setName("rcComments")
00030
00031
00032     Form2Layout = QGridLayout(self,1,1,0,6,"Form2Layout")
00033
00034     self.__teComments = CommentEntryWidget(self)
00035
00036     Form2Layout.addWidget(self.__teComments,0,0)
00037
00038     self.languageChange()
00039
00040     self.resize(QSize(291,219).expandedTo(self.minimumSizeHint()))
00041
00042   def getWidget(self):
00043     return self.__teComments
00044
00045   def languageChange(self):
00046     self.setCaption(self.tr("rcComments"))
00047
00048 class CommentEntryWidget(QTextEdit):
00049   def __init__(self, parent=None):
00050     QTextEdit.__init__(self, parent)
00051
00052     self.__prompt = "--> "
00053
00054     # last line + last incomplete lines
00055     self.line    = QString()
00056     self.lines   = []
00057     # the cursor position in the last line
00058     self.point   = 0
00059     # flag: readline() is being used for e.g. raw_input() and input()
00060     self.reading = 0
00061     # history
00062     self.__history = []
00063     self.__timeStamps = []
00064     self.pointer = 0
00065     self.xLast   = 0
00066     self.yLast   = 0
00067     self.__xLastBP = 0
00068     self.__yLastBP = 0
00069     self.clip = QApplication.clipboard()
00070
00071     # user interface setup
00072     self.setTextFormat(QTextEdit.PlainText)
00073     self.setWrapPolicy(QTextEdit.Anywhere)
00074     # font
00075     if os.name == 'posix':
00076       font = QFont("Fixed", 12)
00077     elif os.name == 'nt' or os.name == 'dos':
00078       font = QFont("Courier New", 8)
00079     else:
00080       raise SystemExit, "FIXME for 'os2', 'mac', 'ce' or 'riscos'"
00081     font.setFixedPitch(1)
00082     self.setFont(font)
00083     self.connect(self, SIGNAL("clicked(int,int)"), self.handleClicked)
00084
00085     # geometry
00086     height = 40*QFontMetrics(font).lineSpacing()
00087     request = QSize(600, height)
00088     if parent is not None:
00089       request = request.boundedTo(parent.size())
00090     self.resize(request)
00091     self.setReadOnly(1)
00092     self.clearDisplay()
00093
00094   def getHistory(self):
00095     return self.__history
00096
00097   def getTimestamps(self):
00098     return self.__timeStamps
00099
00100   def clearHistory(self):
00101     self.__history = []
00102     self.__timeStamps = []
00103
00104   def clearDisplay(self):
00105     self.clear()
00106     self.write(self.__prompt)
00107     #if self.isReadOnly():
00108     #  self.enterComment('Comment entry is disabled.')
00109     #else:
00110     #  self.enterComment('Comment entry is enabled.')
00111
00112   def setPrompt(self, prompt):
00113     self.__prompt = prompt
00114
00115   def getPrompt(self):
00116     return self.__prompt
00117
00118   def flush(self):
00119     """
00120     Simulate stdin, stdout, and stderr.
00121     """
00122     pass
00123
00124   def isatty(self):
00125     """
00126     Simulate stdin, stdout, and stderr.
00127     """
00128     return 1
00129
00130   def readline(self):
00131     """
00132     Simulate stdin, stdout, and stderr.
00133     """
00134     self.reading = 1
00135     self.__clearLine()
00136     self.moveCursor(QTextEdit.MoveEnd, 0)
00137     while self.reading:
00138       qApp.processOneEvent()
00139     if self.line.length() == 0:
00140       return '\n'
00141     else:
00142       return str(self.line)
00143
00144   def write(self, text):
00145     """
00146     Simulate stdin, stdout, and stderr.
00147     """
00148     # The output of self.append(text) contains to many newline characters,
00149     # so work around QTextEdit's policy for handling newline characters.
00150     hack = self.text()
00151     hack.append(text)
00152     self.setText(hack)
00153     #self.setText(self.text().append(text)) # segmentation fault
00154     self.moveCursor(QTextEdit.MoveEnd, 0)
00155     self.yLast, self.xLast = self.getCursorPosition()
00156
00157   def writelines(self, text):
00158     """
00159     Simulate stdin, stdout, and stderr.
00160     """
00161     map(self.write, text)
00162     print "DO WE EVER GET HERE? IF YES, OPTIMIZATION POSSIBLE"
00163
00164   def enterComment(self, comment, addToHistory=0, source='system'):
00165     """This can be called from a user script to add to comments.
00166     The text is prepended with \a source to indicate that it is a
00167     machine generated comment.
00168
00169     \param comment      The text of the comment to be entered
00170     \param addtoHistory Whether this comment will be persistent or not
00171     \param source       The text to be prepended before the comment
00172
00173     """
00174     self.line = comment.rstrip()
00175     if source != "":
00176       self.line = '[' + source + '] ' + self.line
00177     self.line = QString(self.line)
00178     self.write(self.line)
00179     self.__xLastBP, self.__yLastBP = self.xLast, self.yLast
00180     self.__xLastBP += 11 # Add the length of the timestamp
00181     self.write('\n')
00182     self.__run(addToHistory)
00183
00184   def flushComment(self):
00185     if self.line.length() > 0:
00186       self.write('\n')
00187       self.__run()
00188
00189   def __run(self, addToHistory=1):
00190     self.pointer = 0
00191     y, x = self.getCursorPosition()
00192     yFirst = y - len(self.lines) - 1
00193     self.setSelection(yFirst, 0, yFirst, 4)
00194     self.removeSelectedText()
00195     tStamp = time.gmtime()
00196     self.insertAt(time.strftime('[%H:%M:%S] ', tStamp), y - len(self.lines) - 1, 0)
00197     if addToHistory:
00198       self.__history.append(str(self.line))
00199       self.__timeStamps.append(tStamp)
00200     self.lines.append(str(self.line))
00201     self.write(self.__prompt)
00202     self.lines = []
00203     self.__clearLine()
00204
00205   def __clearLine(self):
00206     """
00207     Clear input line buffer
00208     """
00209     self.line.truncate(0)
00210     self.point = 0
00211
00212   def insertText(self, text, offsetY=0, absX=0, overwrite=0):
00213     """
00214     \param text     Text to be inserted
00215     \param offsetY  The position of the comment text relative to the current position
00216     \param absX     The absolute position of the comment text
00217     """
00218     posy = self.__yLastBP + offsetY
00219     posx = absX + 11 # Skip over the timestamp
00220     self.setCursorPosition(posy, posx)
00221     if overwrite:
00222       self.setSelection(posy, posx, posy, posx+len(text), 0)
00223       self.removeSelectedText()
00224     self.__insertText(QString(text), posy, posx)
00225
00226   def __insertText(self, text, posY=0, posX=0):
00227     """
00228     Insert text at the current cursor position.
00229     """
00230     y, x = self.getCursorPosition()
00231     if posX != 0: x = posX
00232     if posY != 0: y = posY
00233     self.insertAt(text, y, x)
00234     self.line.insert(self.point, text)
00235     self.point += text.length()
00236     self.setCursorPosition(y, x + text.length())
00237
00238   def keyPressEvent(self, e):
00239     """
00240     Handle user input a key at a time.
00241     """
00242
00243     if self.isReadOnly() or not self.isEnabled():
00244       e.ignore()
00245       return
00246     text  = e.text()
00247     key   = e.key()
00248     ascii = e.ascii()
00249
00250     if text.length() and ascii>=32 and ascii<127:
00251       self.__insertText(text)
00252       return
00253
00254     if e.state() & Qt.ControlButton or e.state() & Qt.ShiftButton:
00255       e.ignore()
00256       return
00257
00258     if key == Qt.Key_Backspace:
00259       if self.point:
00260         self.doKeyboardAction(QTextEdit.ActionBackspace)
00261         self.point -= 1
00262         self.line.remove(self.point, 1)
00263     elif key == Qt.Key_Delete:
00264       self.doKeyboardAction(QTextEdit.ActionDelete)
00265       self.line.remove(self.point, 1)
00266     elif key == Qt.Key_Return or key == Qt.Key_Enter:
00267       self.write('\n')
00268       if self.reading:
00269         self.reading = 0
00270       else:
00271         self.__run()
00272     elif key == Qt.Key_Tab:
00273       self.__insertText(text)
00274     elif key == Qt.Key_Left:
00275       if self.point:
00276         self.moveCursor(QTextEdit.MoveBackward,0)
00277         self.point -= 1
00278     elif key == Qt.Key_Right:
00279       if self.point < self.line.length():
00280         self.moveCursor(QTextEdit.MoveForward,0)
00281         self.point += 1
00282     elif key == Qt.Key_Home:
00283       self.setCursorPosition(self.yLast, self.xLast)
00284       self.point = 0
00285     elif key == Qt.Key_End:
00286       self.moveCursor(QTextEdit.MoveLineEnd,0)
00287       self.point = self.line.length()
00288     elif key == Qt.Key_Up:
00289       if len(self.__history):
00290         if self.pointer == 0:
00291           self.pointer = len(self.__history)
00292         self.pointer -= 1
00293         self.__recall()
00294     elif key == Qt.Key_Down:
00295       if len(self.__history):
00296         self.pointer += 1
00297         if self.pointer == len(self.__history):
00298           self.pointer = 0
00299         self.__recall()
00300     elif key == Qt.Key_Escape:
00301       self.__deleteLine()
00302     else:
00303         e.ignore()
00304
00305   def __deleteLine(self):
00306     self.setCursorPosition(self.yLast, self.xLast)
00307     self.setSelection(self.yLast, self.xLast,
00308                       self.yLast, self.paragraphLength(self.yLast))
00309     self.removeSelectedText()
00310     self.__clearLine()
00311
00312   def __recall(self):
00313     """
00314     Display the current item from the command history.
00315     """
00316     self.__deleteLine()
00317     self.__insertText(QString(self.__history[self.pointer]))
00318
00319
00320   def focusNextPrevChild(self, next):
00321     """
00322     Suppress tabbing to the next window in multi-line commands.
00323     """
00324     return QTextEdit.focusNextPrevChild(self, next)
00325
00326   def handleClicked(self, para, pos):
00327     """
00328     Keep the cursor after the last prompt.
00329     """
00330     if self.hasSelectedText():
00331       if len(self.selectedText()) > 0:
00332         self.clip.setText(self.selectedText())
00333     self.moveCursor(QTextEdit.MoveEnd, 0)
00334     return
00335
00336   def contentsContextMenuEvent(self,ev):
00337     """
00338     Suppress the right button context menu.
00339     Instead paste the contents of the clipboard.
00340     """
00341     if not self.isReadOnly():
00342       self.__insertText(self.clip.text())
00343     ev.accept()
00344     return
00345
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcComplStatus.py Source File

runcontrol

rcComplStatus.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Completion status helper class"
00012 __author__   = "S. Tuvi <Stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2004/11/24 01:07:47 $").split(' ')[1]
00014 __version__  = "$Revision: 2.5 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 class rcCompletionStatus(object):
00021   """This helper class provides methods to facilitate the management
00022   of completion codes.
00023   """
00024   __csDict = {
00025                      0: 'PASSED',
00026                     -1: 'UNDEFINED',
00027                     -2: 'ABORTED',
00028                     -3: 'FAILED',
00029                     -4: 'PASSED CONDITIONALLY',
00030                     -5: 'MARGINAL',
00031                     -6: 'OPERATOR ABORTED',
00032                     -7: 'INCOMPLETE',
00033                   }
00034
00035   def getCompletionStatus(statStr):
00036     """Return the completion status code based
00037     on the description.
00038
00039     \param statStr Completion status description
00040
00041     \return Completion status code or None if it doesn't exist.
00042     """
00043     for (status, statusStr) in rcCompletionStatus.__csDict.items():
00044       if statusStr == statStr:
00045         return status
00046   getCompletionStatus = staticmethod(getCompletionStatus)
00047
00048   def getCompletionStatusStr(self, status):
00049     """Return the completion status string based
00050     on the code.
00051
00052     \param status Completion status code
00053
00054     \return Completion status description or None if it doesn't exist.
00055     """
00056     if status in self.__csDict:
00057       return self.__csDict[status]
00058
00059   def isCompletionStatus(self, status):
00060     """Check if \a status is already in the dictionary.
00061
00062     \param status Completion status code
00063
00064     \return True : If it is already defined.
00065             False: Otherwise
00066     """
00067     return (status in self.__csDict)
00068
00069   def addCompletionStatus(self, status, statusStr):
00070     """Adds the new completion status code and its
00071     description to the dictionary.
00072
00073     \param status    Completion status code
00074     \param statusStr Completion status description
00075
00076     \return  0: If add is successful.
00077             -1: If status code already exists.
00078             -2: If a duplicate description was found.
00079     """
00080     if self.getCompletionStatus(statusStr) is not None:
00081       # Duplicate description
00082       return -2
00083     if status not in self.__csDict:
00084       self.__csDict[status] = statusStr
00085       # Status added successfully
00086       return 0
00087     else:
00088       # Already exists
00089       return -1
00090
00091   def getAll(self):
00092     return self.__csDict
00093
00094 #-------------------------------------------------------------------------------
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcDefaultTrigger.py Source File

trigger

rcDefaultTrigger.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Coincidence based Trigger System Interface classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.2 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 # This class uses
00021 from TrgUsingTiles      import TrgUsingTiles
00022 from TrgMiniGLT         import MiniGLTTrgConditionsValue
00023 from rcTrgMiniGLT       import rcTrgMiniGLT
00024 from rcTrgFunctions     import rcTrgEngines
00025 from TrgEngines         import TrgEngine
00026 from TrgEngines         import TrgReadout
00027 from NullObjects        import NoInputsEnabled
00028 from TrgConditionsValue import TrgConditionsValue
00029
00030 class rcGEMDefaultTrigger(TrgUsingTiles):
00031   """\brief rcGEMDefaultTrigger
00032   """
00033   def __init__(self):
00034     """\brief rcGEMDefaultTrigger constructor
00035     """
00036     TrgUsingTiles.__init__(self)
00037     self.__inputEnables             = NoInputsEnabled()
00038     self.__engines                  = rcGEMTrgEngines()
00039     self.__conditions               = rcSolicitedCondition()
00040
00041   # Pure Virtual function implementation
00042   def conditions(self):
00043     return self.__conditions
00044
00045   def coincidences(self):
00046     """\brief Implementation of coincdences 'pure virtual' method from TrgUsingTiles
00047     """
00048     # it just so happens that the roi is exactly the same as the coincidences object
00049     return self.roi()
00050
00051   def inputEnables(self):
00052     """\brief Implementation of inputEnables 'pure virtual' method from TrgAbstract
00053     """
00054     return self.__inputEnables
00055
00056   def engines(self):
00057     """\brief Implementation of engines 'pure virtual' method from TrgAbstract
00058     """
00059     return self.__engines
00060
00061   def useAcdAsTrigger(self):
00062     """Don't use ACD as a trigger source.
00063     """
00064     return False
00065
00066   def sweepOnShut(self):
00067     return False
00068
00069   def shut(self, sweepEvent=None, progress=None):
00070     pass
00071
00072 class rcMiniGLTDefaultTrigger(rcTrgMiniGLT):
00073   """\brief rcMiniGLTDefaultTrigger
00074   """
00075   def __init__(self):
00076     rcTrgMiniGLT.__init__(self)
00077     self.__engines      = rcMiniGLTTrgEngines()
00078     self.__conditions   = rcMiniGLTSolicitedCondition()
00079
00080   def engines(self):
00081     """\brief Implementation of engines 'pure virtual' method from TrgAbstract
00082     """
00083     return self.__engines
00084
00085   def conditions(self):
00086     """\brief Implementation of conditions 'pure virtual' method from TrgAbstract
00087     """
00088     return self.__conditions
00089
00090   def sweepOnShut(self):
00091     return False
00092
00093   def shut(self, sweepEvent=None, progress=None):
00094     pass
00095
00096 # implementaions of user-level trigger classes
00097
00098 class rcGEMTrgEngines(rcTrgEngines):
00099   """Class rcGEMTrgEngines:
00100      Initialize the trigger engines list class.
00101   """
00102   def __init__(self):
00103     rcTrgEngines.__init__(self)
00104     eng1 = rcSolicitedEngine()
00105     self.replaceEngine(0,eng1)
00106
00107 class rcSolicitedEngine(TrgEngine):
00108   """This class defines an engine which reads out the detector
00109      whenever there is a solicited trigger.
00110      This engine is not prescaled.
00111   """
00112   def __init__(self):
00113     TrgEngine.__init__(self)
00114     self.__request = TrgReadout()
00115   def participate(self,conditionsValue):
00116     # This function relies on the programmer's knowledge that the
00117     # conditionsValue is a bitfield.
00118     cond = rcSolicitedCondition()
00119     if conditionsValue & cond.value():
00120       return True
00121     return False
00122   def prescale(self):
00123     return 0
00124   def request(self):
00125     return self.__request
00126
00127 class rcSolicitedCondition(TrgConditionsValue):
00128   """ Define a condition where only the solicited trigger is asserted
00129   """
00130   def __init__(self):
00131     TrgConditionsValue.__init__(self)
00132   def solicited(self):
00133     return True
00134
00135 # implementaions of user-level trigger classes
00136 class rcMiniGLTTrgEngines(rcTrgEngines):
00137   def __init__(self):
00138     rcTrgEngines.__init__(self)
00139     # There are two engines in the MiniGLT.
00140     # 0) User defined engine
00141     # 15) Marker engine
00142     eng = rcMiniGLTSolicitedEngine()
00143     self.replaceEngine(0,eng)
00144
00145 class rcMiniGLTSolicitedEngine(TrgEngine):
00146   """This class defines an engine which reads out the detector
00147      whenever there is a solicited trigger.
00148      This engine is not prescaled.
00149   """
00150   def __init__(self):
00151     TrgEngine.__init__(self)
00152     self.__request = TrgReadout()
00153   def participate(self,conditionsValue):
00154     # This function relies on the programmer's knowledge that the
00155     # conditionsValue is a bitfield.
00156     cond = rcMiniGLTSolicitedCondition()
00157     condValue = cond.value()
00158     if conditionsValue & condValue:
00159       return True
00160     return False
00161   def prescale(self):
00162     return 0
00163   def request(self):
00164     return self.__request
00165
00166 class rcMiniGLTSolicitedCondition(MiniGLTTrgConditionsValue):
00167   """ Define a condition where only the CNO trigger is asserted
00168   """
00169   def __init__(self):
00170     TrgConditionsValue.__init__(self)
00171   def solicited(self):
00172     return True
00173
00174
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcEndRunDlgImpl.py Source File

runcontrol

rcEndRunDlgImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "End Run Comments dialog"
00012 __author__   = "S. Tuvi <STuvi@SLAC.Stanford.edu>"
00013 __date__     = ("$Date: 2005/08/03 20:27:12 $").split(' ')[1]
00014 __version__  = "$Revision: 2.4 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 from qt import *
00021 import sys
00022 from rcEndRunDlg   import rcEndRunDlg
00023 from rcComplStatus import rcCompletionStatus
00024
00025
00026 class rcEndRunDlgImpl(rcEndRunDlg):
00027
00028   def __init__(self, parent = None, name = None, fl = 0):
00029     rcEndRunDlg.__init__(self, parent, name, fl)
00030     QObject.connect(self.comboComplStatus, SIGNAL("activated(const QString&)"), self.complStatusChanged)
00031     QObject.connect(self.CANCEL,SIGNAL("clicked()"),self.cancel)
00032     QObject.connect(self.OK,SIGNAL("clicked()"),self.ok)
00033
00034     self.__parent = parent
00035     self.__compl = rcCompletionStatus()
00036
00037   def initialize(self, secMan, loginId):
00038     self.__secMan = secMan
00039     self.__loginId = loginId
00040     combo = self.comboComplStatus
00041     combo.clear()
00042     csDict = self.__compl.getAll()
00043     csStrList = csDict.values()
00044     csStrList.sort()
00045     for csStr in csStrList:
00046       combo.insertItem(csStr)
00047     app = self.__parent.getApp()
00048     while app.__class__.__name__ != 'userApplication':
00049       app = app.getApp()
00050     curComplStatusStr = app.getCompletionStatusStr()
00051     combo.setCurrentText(curComplStatusStr)
00052     self.comments.getWidget().clearDisplay()
00053     self.comments.getWidget().clearHistory()
00054     self.comments.getWidget().setReadOnly(0)
00055     self.txtPassword.setEnabled(0)
00056     self.txtPassword.clear()
00057
00058   def complStatusChanged(self, complStatusStr):
00059     if self.__parent.getApp().__class__.__name__ == 'userSuite':
00060       curComplStatus = self.__parent.getApp().getApp().getCompletionStatusStr()
00061     else:
00062       curComplStatus = self.__parent.getApp().getCompletionStatusStr()
00063     if curComplStatus != complStatusStr:
00064       self.txtPassword.setEnabled(1)
00065     else:
00066       self.txtPassword.setEnabled(0)
00067
00068   def getNewCompletionStatus(self, curComplStatusStr):
00069     csStr = self.getCompletionStatusStr()
00070     for (cv, cs) in self.__compl.getAll().items():
00071       if cs == csStr:
00072         if cs != curComplStatusStr:
00073           return (cv, cs)
00074     return (None, None)
00075
00076   def ok(self):
00077     if self.txtPassword.isEnabled():
00078       res = self.__secMan.authenticateUser(self.__loginId, str(self.txtPassword.text()).strip())
00079       if res != 0:
00080         QMessageBox.critical( self, "Authentication Error",
00081                         "Incorrect Password",
00082                         QMessageBox.Ok + QMessageBox.Default )
00083         return
00084     self.comments.getWidget().flushComment()
00085     QDialog.done(self, QDialog.Accepted)
00086
00087   def cancel(self):
00088     self.comments.getWidget().clearHistory()
00089     QDialog.done(self, QDialog.Rejected)
00090
00091   def getCompletionStatusStr(self):
00092     return str(self.comboComplStatus.currentText())
00093
00094   def enterComment(self, comment, addToHistory=0, source='system'):
00095     self.comments.getWidget().enterComment(comment, addToHistory, source)
00096
00097   def clearHistory(self):
00098     self.comments.getWidget().clearHistory()
00099
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcFitsWriter.py Source File

runcontrol

rcFitsWriter.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "FITS writer class"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/01/21 23:50:49 $").split(' ')[1]
00014 __version__  = "$Revision: 2.5 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import os.path
00021 #import pyfits
00022 #import numarray
00023 from cfitsio import *
00024 import time
00025 import struct
00026 import types
00027 import sys
00028 import rcReportGen
00029
00030 FORMAT_WORD = 0
00031 FORMAT_BYTE = 1
00032
00033 MODE_CREATE = 0
00034 MODE_READONLY = 2
00035
00036 RUN_REPORT_VERSION = "1.0"
00037
00038 class rcFitsWriter(object):
00039   #~ def __init__(self, fileName=None):
00040     #~ if fileMame is None:
00041       #~ ts   = strftime('%y%m%d%H%M%S', gmtime())
00042       #~ self.__fileName = 'ebf' + ts + '.fits'
00043     #~ else:
00044       #~ self.__fileName = fileName
00045     #~ self.__fitsobj = pyfits.HDUList()
00046     #~ hdu = pyfits.PrimaryHDU()
00047     #~ self.__fitsobj.append(hdu)
00048
00049   #~ def write(self, eventSummary, rawEventData):
00050     #~ hdu = pyfits.ImageHDU(numarray.fromstring(rawEventData, numarray.Int32))
00051     #~ #col1 = pyfits.Column(name='event_data', format='i',
00052     #~ #                     array=numarray.fromstring(rawEventData, numarray.UInt32))
00053     #~ #hdu = pyfits.new_table([col1])
00054     #~ #hdu.data.field(0).byteswap()
00055     #~ hdu.header.update('EVT_NO', eventSummary.evNumber, "Event number")
00056     #~ hdu.header.update('EVT_TAG', eventSummary.tag, "Event tag")
00057     #~ self.__fitsobj.append(hdu)
00058
00059   #~ def close(self):
00060     #~ self.__fitsobj.writeto(self.__fileName)
00061
00062   def __init__(self, filePath=None, fileName=None, mode=MODE_CREATE, format=FORMAT_WORD, tableSize=1000, compress=0, flushInterval=0, reportGen=None):
00063     if fileName is None:
00064       ts   = time.strftime('%y%m%d%H%M%S', time.gmtime())
00065       self.__fileName = getFileNameFromTS(ts)
00066     else:
00067       self.__fileName = fileName
00068     if compress: self.__fileName += '.gz'
00069     if filePath is None:
00070       self.__filePath = ""
00071     else:
00072       self.__filePath = filePath
00073     self.__format = format
00074     self.__tableSize = tableSize
00075     self.__mode = mode
00076     self.__flushInterval = flushInterval
00077     self.__reportGen = reportGen
00078     if mode == MODE_READONLY:
00079       if format != FORMAT_BYTE:
00080         raise RuntimeError, "Sorry FITS file reading currently only works in BYTE mode"
00081       (self.__status, self.__fptr) = cfitsio.fits_open_file(os.path.join(self.__filePath, self.__fileName), cfitsio.READONLY)
00082       if self.__status != 0:
00083         raise IOError, "fits_open_file: %s" % cfitsio.fits_get_errstatus(self.__status)
00084       else:
00085         if reportGen is not None:
00086           self.getHeaders()
00087         self.__tablenum = 2
00088         status = self.moveToHDU(self.__tablenum)
00089         self.__rownum = 0
00090     elif mode == MODE_CREATE:
00091       (self.__status, self.__fptr) = cfitsio.fits_create_file(os.path.join(self.__filePath, self.__fileName))
00092       if self.__status != 0:
00093         raise IOError, "fits_create_file: %s" % cfitsio.fits_get_errstatus(self.__status)
00094       else:
00095         naxis = 0
00096         naxes = []
00097         self.__status = cfitsio.fits_create_img(self.__fptr, cfitsio.SHORT_IMG, naxis, naxes)
00098         if self.__status != 0:
00099           raise IOError, "fits_create_img: %s" % cfitsio.fits_get_errstatus(self.__status)
00100         else:
00101           try:
00102             from LDF import LDF
00103           except:
00104             raise RuntimeError, (__name__ + "Can't find LDF, aborting...")
00105           comment1 = "The data in this file can be parsed using %s of the Online software" % LDF.__version__
00106           comment2 = "package LDF or a similar package designed according to LAT-TD-00606-D1,"
00107           comment3 = " V/I 2.1/1; LAT-TD-00605-D1, V/I 3.1/1; LAT-TD-00639-D1, V/I 2.9/1 and"
00108           comment4 = " LAT-TD-01545, V/I 2.0/2 ."
00109           status = cfitsio.fits_write_comment(self.__fptr, " ")
00110           status = cfitsio.fits_write_comment(self.__fptr, comment1)
00111           status = cfitsio.fits_write_comment(self.__fptr, comment2)
00112           status = cfitsio.fits_write_comment(self.__fptr, comment3)
00113           status = cfitsio.fits_write_comment(self.__fptr, comment4)
00114           self.__tablenum = 0
00115     else:
00116       raise RuntimeError, "Invalid FITS file mode"
00117
00118
00119   def createNewTable(self, datagram_id=None, version_info=None):
00120     if datagram_id is not None:
00121       tmp = self.bcLong2Int(datagram_id)
00122       self.__status = cfitsio.fits_write_key_lng(self.__fptr, "DGRAMID",
00123                                                  tmp, "Datagram Identity")
00124     if version_info is not None:
00125       tmp = self.bcLong2Int(version_info)
00126       self.__status = cfitsio.fits_write_key_lng(self.__fptr, "EVTVERSN",
00127                                                  tmp, "Event Version")
00128     ttype = ['event_data']
00129     if self.__format == FORMAT_BYTE:
00130       tform = ['1PB(4096)']
00131     else:
00132       tform = ['1PV(1024)']
00133     tunit=[' ']
00134     extname='Event Data'
00135     tfields=1
00136     self.__status = cfitsio.fits_create_tbl(self.__fptr, cfitsio.BINARY_TBL,
00137                         self.__tableSize, tfields, ttype, tform, tunit, extname)
00138     if self.__status != 0:
00139       raise IOError, "fits_create_tbl: %s" % cfitsio.fits_get_errstatus(self.__status)
00140     self.__status = cfitsio.fits_write_key_lng(self.__fptr, "EVTCOUNT",
00141                                                 0, "Event Count")
00142     if self.__status != 0:
00143       raise IOError, "fits_write_key_lng: %s" % cfitsio.fits_get_errstatus(self.__status)
00144     self.__rownum = 1
00145     self.__tablenum += 1
00146
00147   def bcLong2Int(self, datum):
00148     # cfitsio has a problem with putting any long integer with bit 32 set into
00149     # a key.  (fits_write_key_ulng does not exist in nasa space)
00150     # do some bizarre ass bit conversions with integer arithmetic to make sure that the type
00151     # stays "int"
00152     if datum & 0x80000000L:
00153       shiftword = -2147483648                 # - 2^31, really 0x8000000 expressed as an int
00154       truncated = int(datum & 0x7fffffff)     # Slice off bit 31
00155       datum = truncated+shiftword             # add on bit 31
00156     return datum
00157
00158
00159   def write(self, rawEventData):
00160     if self.__tablenum == 0:
00161       (datagram_id, datagram_length, version_info) = struct.unpack('!III', rawEventData[:12])
00162       self.createNewTable(datagram_id, version_info)
00163     elif self.__rownum > self.__tableSize:
00164       self.__status = cfitsio.fits_update_key_lng(self.__fptr, "EVTCOUNT",
00165                                                  self.__rownum - 1, "Event Count")
00166       if self.__status != 0:
00167         raise IOError, "fits_update_key_lng: %s" % cfitsio.fits_get_errstatus(self.__status)
00168       if self.__flushInterval > 0:
00169           self.__status = cfitsio.fits_flush_file(self.__fptr)
00170           if self.__status != 0:
00171             raise IOError, "fits_flush_file: %s" % cfitsio.fits_get_errstatus(self.__status)
00172       self.createNewTable()
00173     l = len(rawEventData)
00174     if self.__format == FORMAT_BYTE:
00175       self.__status = cfitsio.fits_write_col_byt(self.__fptr, 1, self.__rownum,
00176                                                  1, l, rawEventData)
00177       if self.__status != 0:
00178         raise IOError, "fits_write_col_byt: %s" % cfitsio.fits_get_errstatus(self.__status)
00179     else:
00180       extra = l % 4
00181       nelem = (l - extra) / 4
00182       if extra != 0:
00183         data = list(struct.unpack('!'+'i'*nelem, rawEventData[:-extra]))
00184       else:
00185         data = list(struct.unpack('!'+'i'*nelem, rawEventData))
00186       self.__status = cfitsio.fits_write_col_uint(self.__fptr, 1, self.__rownum,
00187                                                   1, nelem, data)
00188       if self.__status != 0:
00189         raise IOError, "fits_write_col_uint: %s" % cfitsio.fits_get_errstatus(self.__status)
00190     if (self.__flushInterval > 0) and (self.__rownum % self.__flushInterval == 0):
00191       self.__status = cfitsio.fits_update_key_lng(self.__fptr, "EVTCOUNT",
00192                                                 self.__rownum, "Event Count")
00193       if self.__status != 0:
00194         raise IOError, "fits_update_key_lng: %s" % cfitsio.fits_get_errstatus(self.__status)
00195       self.__status = cfitsio.fits_flush_buffer(self.__fptr, 0)
00196       if self.__status != 0:
00197         raise IOError, "fits_flush_buffer: %s" % cfitsio.fits_get_errstatus(self.__status)
00198     self.__rownum +=1
00199
00200
00201   def moveToHDU(self, tablenum):
00202     (self.__status, hdutype) = cfitsio.fits_movabs_hdu(self.__fptr, tablenum)
00203     if self.__status != 0:
00204       return self.__status
00205     (self.__status, self.__eventCount, comment) = cfitsio.fits_read_key_lng(self.__fptr, 'EVTCOUNT')
00206     # Skip the exception if there are tables after the event data (202 is keyword not found)
00207     if self.__status != 0 and self.__status != 202:
00208       raise IOError, "fits_read_key_lng: %s" % cfitsio.fits_get_errstatus(self.__status)
00209     return self.__status
00210
00211
00212   def read(self):
00213     self.__rownum += 1
00214     if self.__rownum > self.__eventCount:
00215       self.__tablenum += 1
00216       status = self.moveToHDU(self.__tablenum)
00217       if status != 0:
00218         return None
00219       self.__rownum = 1
00220     (self.__status, event_size, heap_addr) = cfitsio.fits_read_descript(self.__fptr, 1, self.__rownum)
00221     if self.__status != 0:
00222       raise IOError, "fits_read_descript: %s" % cfitsio.fits_get_errstatus(self.__status)
00223     (self.__status, dat) = cfitsio.fits_read_col_byt(self.__fptr, 1, self.__rownum, 1, event_size, None)
00224     if self.__status != 0:
00225       raise IOError, "fits_read_col_byt: %s" % cfitsio.fits_get_errstatus(self.__status)
00226     return dat
00227
00228
00229   def close(self, inShutdown=0):
00230     if self.__mode != MODE_READONLY:
00231       if self.__tablenum > 0:
00232         self.__status = cfitsio.fits_update_key_lng(self.__fptr, "EVTCOUNT",
00233                                                    self.__rownum - 1, "Event Count")
00234         if self.__status != 0:
00235           raise IOError, "fits_update_key_lng: %s" % cfitsio.fits_get_errstatus(self.__status)
00236       if self.__reportGen is not None and not inShutdown:
00237         self.updateRunReportFields()
00238
00239     self.__status = cfitsio.fits_close_file(self.__fptr)
00240     if self.__status != 0:
00241       raise IOError, "fits_close_file: %s" % cfitsio.fits_get_errstatus(self.__status)
00242     self.__fptr = None
00243
00244   def updateRunReportFields(self):
00245     (self.__status, hdutype) = cfitsio.fits_movabs_hdu(self.__fptr, 1)
00246
00247     # Write the version for the run report keyword/value dump in case
00248     # we need to modify it in the future
00249     self.__status = cfitsio.fits_write_key_str(self.__fptr, "RPTVERSN",
00250                                                RUN_REPORT_VERSION,
00251                                                "Run Report Fields Version")
00252     if self.__status != 0:
00253       raise IOError, "fits_write_key_str: %s" % cfitsio.fits_get_errstatus(self.__status)
00254
00255     reportFields      = self.__reportGen.getReportFields()
00256     reportData        = self.__reportGen.getReportData()
00257     reportUnits       = self.__reportGen.getReportUnits()
00258
00259     self.__status = cfitsio.fits_write_key_lng(self.__fptr, "NUM_KVS",
00260                                                len(reportFields),
00261                                                "Number of Key/Value pairs")
00262     if self.__status != 0:
00263       raise IOError, "fits_write_key_lng: %s" % cfitsio.fits_get_errstatus(self.__status)
00264
00265     for i in range(len(reportFields)):
00266       listType = 0
00267       dictType = 0
00268       x = None
00269     #  self.__status = cfitsio.fits_write_key_str(self.__fptr,
00270     #                                             reportShortNames[i],
00271     #                                             reportData[i],
00272     #                                             reportFields[i])
00273       try:
00274         exec("x=" + reportData[i])
00275         if type(x) == types.ListType:
00276           listType = 1
00277         elif type(x) == types.DictType:
00278           dictType = 1
00279       except:
00280         #print sys.exc_info()
00281         pass
00282       if listType and len(x) > 0:
00283         ttype = ['list_value']
00284         tform = ['80A']
00285         tunit=[' ']
00286         extname= reportFields[i]
00287         tfields=1
00288         self.__status = cfitsio.fits_create_tbl(self.__fptr, cfitsio.BINARY_TBL,
00289                             len(x), tfields, ttype, tform, tunit, extname)
00290         if self.__status != 0:
00291           raise IOError, "fits_create_tbl: %s" % cfitsio.fits_get_errstatus(self.__status)
00292
00293         self.__status = cfitsio.fits_write_col_str(self.__fptr, 1, 1, 1, map(str, x))
00294         if self.__status != 0:
00295           raise IOError, "fits_write_col_str: %s" % cfitsio.fits_get_errstatus(self.__status)
00296         (self.__status, hdutype) = cfitsio.fits_movabs_hdu(self.__fptr, 1)
00297         if self.__status != 0:
00298           raise IOError, "fits_movabs_hdu %s" % cfitsio.fits_get_errstatus(self.__status)
00299       elif dictType and len(x) > 0:
00300         ttype = ['dict_key', 'dict_value']
00301         tform = ['80A','80A']
00302         tunit=[' ',' ']
00303         extname= reportFields[i]
00304         tfields=2
00305         self.__status = cfitsio.fits_create_tbl(self.__fptr, cfitsio.BINARY_TBL,
00306                             len(x), tfields, ttype, tform, tunit, extname)
00307         if self.__status != 0:
00308           raise IOError, "fits_create_tbl: %s" % cfitsio.fits_get_errstatus(self.__status)
00309
00310         self.__status = cfitsio.fits_write_col_str(self.__fptr, 1, 1, 1, map(str, x.keys()))
00311         if self.__status != 0:
00312           raise IOError, "fits_write_col_str: %s" % cfitsio.fits_get_errstatus(self.__status)
00313         self.__status = cfitsio.fits_write_col_str(self.__fptr, 2, 1, 1, map(str, x.values()))
00314         if self.__status != 0:
00315           raise IOError, "fits_write_col_str: %s" % cfitsio.fits_get_errstatus(self.__status)
00316
00317         (self.__status, hdutype) = cfitsio.fits_movabs_hdu(self.__fptr, 1)
00318         if self.__status != 0:
00319           raise IOError, "fits_movabs_hdu: %s" % cfitsio.fits_get_errstatus(self.__status)
00320       self.__status = cfitsio.fits_write_key_str(self.__fptr,
00321                                                   "KEY_%04d" % i,
00322                                                   reportFields[i],
00323                                                   "")
00324       if self.__status != 0:
00325         raise IOError, "fits_write_key_str: %s" % cfitsio.fits_get_errstatus(self.__status)
00326
00327       if (listType or dictType):
00328         if len(x) > 0:
00329           self.__status = cfitsio.fits_write_key_str(self.__fptr,
00330                                                     "VAL_%04d" % i,
00331                                                     "",
00332                                                     "See table '" + reportFields[i] + "'")
00333         else:
00334           self.__status = cfitsio.fits_write_key_str(self.__fptr,
00335                                                     "VAL_%04d" % i,
00336                                                     "",
00337                                                     "")
00338         if self.__status != 0:
00339           raise IOError, "fits_write_key_str: %s" % cfitsio.fits_get_errstatus(self.__status)
00340       else:
00341         if reportUnits[i] == rcReportGen.UNITS_STRING:
00342           self.__status = cfitsio.fits_write_key_str(self.__fptr,
00343                                                     "VAL_%04d" % i,
00344                                                     reportData[i],
00345                                                     "")
00346           if self.__status != 0:
00347             raise IOError, "fits_write_key_str: %s" % cfitsio.fits_get_errstatus(self.__status)
00348
00349         elif reportUnits[i] in (rcReportGen.UNITS_INT, rcReportGen.UNITS_LONG):
00350           self.__status = cfitsio.fits_write_key_lng(self.__fptr,
00351                                                     "VAL_%04d" % i,
00352                                                     long(reportData[i]),
00353                                                     "")
00354           if self.__status != 0:
00355             raise IOError, "fits_write_key_lng: %s" % cfitsio.fits_get_errstatus(self.__status)
00356         elif reportUnits[i] == rcReportGen.UNITS_FLOAT:
00357           self.__status = cfitsio.fits_write_key_fixflt(self.__fptr,
00358                                                     "VAL_%04d" % i,
00359                                                     float(reportData[i]),
00360                                                     4,
00361                                                     "")
00362           if self.__status != 0:
00363             raise IOError, "fits_write_key_flt: %s" % cfitsio.fits_get_errstatus(self.__status)
00364         else:
00365           self.__status = cfitsio.fits_write_key_str(self.__fptr,
00366                                                     "VAL_%04d" % i,
00367                                                     reportData[i],
00368                                                     "")
00369           if self.__status != 0:
00370             raise IOError, "fits_write_key_str: %s" % cfitsio.fits_get_errstatus(self.__status)
00371
00372
00373   def setFlushInterval(self, flushInterval):
00374     self.__flushInterval = flushInterval
00375
00376   def getStatus(self):
00377     return self.__status
00378
00379   def getFileName(self):
00380       return self.__fileName
00381
00382   def getFilePath(self):
00383     return self.__filePath
00384
00385   def getHeaders(self):
00386     """If we are in read only mode and reportGen is provided then read the headers of off the FITS file
00387
00388     """
00389     (self.__status, nkv, comment) = cfitsio.fits_read_key_lng(self.__fptr, "NUM_KVS")
00390     if self.__status != 0:
00391       raise IOError, "fits_read_key_lng: %s" % cfitsio.fits_get_errstatus(self.__status)
00392     #print "NUMBER OF KEYWORDS=", nkv
00393     for i in range(nkv):
00394       (self.__status, keyValue, comment) = cfitsio.fits_read_key_str(self.__fptr, "KEY_%04d" % i)
00395       if self.__status != 0:
00396         raise IOError, "fits_read_key_str: %s" % cfitsio.fits_get_errstatus(self.__status)
00397       #print "KEY_%04d=%s %s" % (i,keyValue,comment)
00398       (self.__status, valValue, comment) = cfitsio.fits_read_key_str(self.__fptr, "VAL_%04d" % i)
00399       if self.__status != 0:
00400         raise IOError, "fits_read_key_str: %s" % cfitsio.fits_get_errstatus(self.__status)
00401       #print "VAL_%04d=%s %s" % (i,valValue,comment)
00402       if valValue == '':
00403         #print "Moving to HDU", keyValue
00404         self.__status = cfitsio.fits_movnam_hdu(self.__fptr, cfitsio.ANY_HDU, keyValue, 0)
00405         if self.__status != 0:
00406           #print "fits_movnam_hdu %s" % cfitsio.fits_get_errstatus(self.__status)
00407           self.__reportGen.addField(keyValue, "[]")
00408         else:
00409           repData = self.processTable()
00410           self.__reportGen.addField(keyValue, str(repData))
00411         (self.__status, hdutype) = cfitsio.fits_movabs_hdu(self.__fptr, 1)
00412       else:
00413         self.__reportGen.addField(keyValue, str(valValue))
00414
00415   def processTable(self):
00416     (self.__status, nCols) = cfitsio.fits_get_num_cols(self.__fptr)
00417     if self.__status != 0:
00418       raise IOError, "fits_get_num_cols %s" % cfitsio.fits_get_errstatus(self.__status)
00419     #print "Number of columns=", nCols
00420     (self.__status, nRows) = cfitsio.fits_get_num_rows(self.__fptr)
00421     if self.__status != 0:
00422       raise IOError, "fits_get_num_rows %s" % cfitsio.fits_get_errstatus(self.__status)
00423     #print "Number of rows=", nRows
00424     if nCols == 1:
00425       (self.__status, repList) = cfitsio.fits_read_col_str(self.__fptr, 1, 1, 1, nRows)
00426       if self.__status != 0:
00427         raise IOError, "fits_read_col_str %s" % cfitsio.fits_get_errstatus(self.__status)
00428       return repList
00429     elif nCols == 2:
00430       (self.__status, keyList) = cfitsio.fits_read_col_str(self.__fptr, 1, 1, 1, nRows)
00431       if self.__status != 0:
00432         raise IOError, "fits_read_col_str %s" % cfitsio.fits_get_errstatus(self.__status)
00433       (self.__status, valList) = cfitsio.fits_read_col_str(self.__fptr, 2, 1, 1, nRows)
00434       if self.__status != 0:
00435         raise IOError, "fits_read_col_str %s" % cfitsio.fits_get_errstatus(self.__status)
00436       repDict={}
00437       for key,value in map(None,keyList,valList):
00438           repDict[key]=value
00439       return repDict
00440
00441 # ----- End rcFitsWriter ------
00442
00443 def getFileNameFromTS(ts):
00444     return "ebf" + ts + ".fits"
00445
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcHouseKeeping.py Source File

runcontrol

rcHouseKeeping.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Housekeeping FITS file generation class for RunControl"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/03/03 19:52:37 $").split(' ')[1]
00014 __version__  = "$Revision: 2.4 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import              os
00021 from cfitsio import *
00022 import              time
00023 from struct import  unpack
00024 import              threading
00025 import              operator
00026 import              calendar
00027 import logging as log
00028
00029 MODE_CREATE = 0
00030 MODE_READONLY = 2
00031
00032 TEM_ENV_REGS = 0
00033 AEM_ENV_REGS = 1
00034
00035 HSK_VERSION_STR = '1.0'
00036
00037 TEM_ENV_REG_LIST = [
00038                     'tkr_biasdac',
00039                     'cal_biasdac',
00040                     'adc_tkr_digital_2_5v',
00041                     'adc_tkr_digital_2_5i',
00042                     'adc_tkr_analog_a_1_5v',
00043                     'adc_tkr_analog_a_1_5i',
00044                     'adc_tkr_analog_b_2_5v',
00045                     'adc_tkr_analog_b_2_5i',
00046                     'adc_tkr_bias_v',
00047                     'adc_tkr_bias_i',
00048                     'adc_cal_digital_3_3v',
00049                     'adc_cal_digital_3_3i',
00050                     'adc_cal_analog_3_3v',
00051                     'adc_cal_analog_3_3i',
00052                     'adc_cal_bias_v',
00053                     'adc_cal_bias_i',
00054                     'adc_tem_digital_3_3v',
00055                     'adc_tem_digital_3_3i',
00056                     'adc_afee0_t0',
00057                     'adc_afee0_t1',
00058                     'adc_afee1_t0',
00059                     'adc_afee1_t1',
00060                     'adc_afee2_t0',
00061                     'adc_afee2_t1',
00062                     'adc_afee3_t0',
00063                     'adc_afee3_t1',
00064                     'adc_tkr_c0_t0',
00065                     'adc_tkr_c0_t1',
00066                     'adc_tkr_c1_t0',
00067                     'adc_tkr_c1_t1',
00068                     'adc_tkr_c2_t0',
00069                     'adc_tkr_c2_t1',
00070                     'adc_tkr_c3_t0',
00071                     'adc_tkr_c3_t1',
00072                     'adc_tkr_c4_t0',
00073                     'adc_tkr_c4_t1',
00074                     'adc_tkr_c5_t0',
00075                     'adc_tkr_c5_t1',
00076                     'adc_tkr_c6_t0',
00077                     'adc_tkr_c6_t1',
00078                     'adc_tkr_c7_t0',
00079                     'adc_tkr_c7_t1',
00080                     'sat_cal_lrs_ctr_0',
00081                     'sat_cal_lrs_ctr_1',
00082                     'sat_tkr_lrs_ctr_0',
00083                     'sat_tkr_lrs_ctr_1',
00084                     'sat_tkr_lrs_ctr_2',
00085                     'sat_tkr_lrs_ctr_3',
00086                     'sat_deadtime_lrs_ctr'
00087                     ]
00088
00089 AEM_ENV_REG_LIST = [
00090                     'env_free_00',
00091                     'env_free_01',
00092                     'env_free_02',
00093                     'env_free_03',
00094                     'env_free_04',
00095                     'env_free_05',
00096                     'env_free_06',
00097                     'env_free_07',
00098                     'env_free_08',
00099                     'env_free_09',
00100                     'env_free_10',
00101                     'env_free_11',
00102                     ]
00103
00104 class rcHouseKeeping(object):
00105   def __init__(self, lat, latFilename, mode=MODE_CREATE, tableSize=1000, flushInterval=0):
00106     self.__lat = lat
00107     self.__latFilename = latFilename
00108     self.__threadQuit = 0
00109     self.__threadPause = 0
00110     self.__envRegs = []
00111     self.__envUnits = []
00112     self.__envNames = []
00113     self.__updateInterval = 1.0 # default to 1 second
00114     self.__sampleCount = 0
00115     self.__envValues = []
00116     self.__envTStamps = []
00117     self.__tableSize = tableSize
00118     self.__fptr = None
00119     self.__mode = mode
00120     self.__flushInterval = flushInterval
00121     self.__status = 0
00122     self.__fileName = None
00123     self.__filePath = None
00124
00125   def initialize(self, filePath=None, fileName=None, compress=0):
00126     if self.__mode == MODE_CREATE:
00127       if filePath is not None or fileName is not None:
00128         if fileName is None:
00129           ts   = time.strftime('%y%m%d%H%M%S', time.gmtime())
00130           self.__fileName = getFileNameFromTS(ts)
00131           self.__timestamp = int(time.time())
00132         else:
00133           self.__fileName = fileName
00134           try:
00135             self.__timestamp = int(calendar.timegm(
00136                           time.strptime(self.__fileName.split('.',1)[0][3:], '%y%m%d%H%M%S')
00137                         ))
00138           except:
00139             self.__timestamp = 0
00140         if compress: self.__fileName += '.gz'
00141         if filePath is None:
00142           self.__filePath = ""
00143         else:
00144           self.__filePath = filePath
00145       fname = os.path.join(self.__filePath, self.__fileName)
00146       (self.__status, self.__fptr) = cfitsio.fits_create_file(fname)
00147       if self.__status != 0:
00148         raise IOError, "fits_create_file: %s filename=%s" % (cfitsio.fits_get_errstatus(self.__status), fname)
00149       naxis = 0
00150       naxes = []
00151       self.__status = cfitsio.fits_create_img(self.__fptr, cfitsio.SHORT_IMG, naxis, naxes)
00152       if self.__status != 0:
00153         raise IOError, "fits_create_img: %s" % cfitsio.fits_get_errstatus(self.__status)
00154       comment1 = "Housekeeping data file"
00155       status = cfitsio.fits_write_comment(self.__fptr, " ")
00156       status = cfitsio.fits_write_comment(self.__fptr, comment1)
00157       self.__status = cfitsio.fits_write_key_str(self.__fptr, "HSK_VER", HSK_VERSION_STR, "Housekeeping File Version")
00158       self.checkStatus("fits_write_key_str", self.__status)
00159       self.__status = cfitsio.fits_write_key_str(self.__fptr, "SCHEMA", self.__latFilename, "Schema File Name")
00160       self.checkStatus("fits_write_key_str", self.__status)
00161       self.__status = cfitsio.fits_write_key_lng(self.__fptr, "TIMESTMP",
00162                                                   self.__timestamp, "Housekeeping Timestamp")
00163       self.__tablenum = 0
00164     elif self.__mode == MODE_READONLY:
00165       pass
00166     else:
00167       raise RuntimeError, "Invalid Housekeeping mode"
00168
00169   def createNewTable(self):
00170     tfields = len(self.__envNames) + 1
00171     ttype = ['timestamp'] + self.__envNames
00172     tform = ['1D'] +  ['1V'] * (tfields - 1)
00173     tunit = ['seconds'] + self.__envUnits
00174     extname='Environmental Quantities'
00175     self.__status = cfitsio.fits_create_tbl(self.__fptr, cfitsio.BINARY_TBL,
00176                         self.__tableSize, tfields, ttype, tform, tunit, extname)
00177     if self.__status != 0:
00178       raise IOError, "fits_create_tbl: %s" % cfitsio.fits_get_errstatus(self.__status)
00179     self.__status = cfitsio.fits_write_key_lng(self.__fptr, "RECCOUNT",
00180                                                 0, "Record Count")
00181     if self.__status != 0:
00182       raise IOError, "fits_write_key_lng: %s" % cfitsio.fits_get_errstatus(self.__status)
00183     #for i in range(tfields):
00184     #  hdrLabel = "TDISP%d" % (i+1)
00185     #  if i == 0:
00186     #    hdrValue = "F10.3"
00187     #  else:
00188     #    hdrValue = "I12.1"
00189
00190     hdrLabel = "TDISP1"
00191     hdrValue = "F10.3"
00192
00193     self.__status = cfitsio.fits_write_key_str(self.__fptr, hdrLabel, hdrValue, "")
00194     self.checkStatus("fits_write_key_str", self.__status)
00195     self.__rownum = 1
00196     self.__tablenum += 1
00197
00198   def write(self):
00199     if self.__tablenum == 0:
00200       self.createNewTable()
00201     elif self.__rownum > self.__tableSize:
00202       self.__status = cfitsio.fits_update_key_lng(self.__fptr, "RECCOUNT",
00203                                                  self.__rownum - 1, "Record Count")
00204       if self.__status != 0:
00205         raise IOError, "fits_update_key_lng: %s" % cfitsio.fits_get_errstatus(self.__status)
00206       if self.__flushInterval > 0:
00207           self.__status = cfitsio.fits_flush_file(self.__fptr)
00208           if self.__status != 0:
00209             raise IOError, "fits_flush_file: %s" % cfitsio.fits_get_errstatus(self.__status)
00210       self.createNewTable()
00211
00212
00213     colNum = 1
00214     recTstamp = max(self.__envTStamps)
00215     self.__status = cfitsio.fits_write_col_dbl(self.__fptr, colNum, self.__rownum,
00216                                                1, 1, [recTstamp])
00217     if self.__status != 0:
00218       raise IOError, "fits_write_col_dbl: %s" % cfitsio.fits_get_errstatus(self.__status)
00219     for value in self.__envValues:
00220       colNum += 1
00221       self.__status = cfitsio.fits_write_col_lng(self.__fptr, colNum, self.__rownum,
00222                                                  1, [value])
00223       if self.__status != 0:
00224         raise IOError, "fits_write_col_lng %s" % cfitsio.fits_get_errstatus(self.__status)
00225
00226     if (self.__flushInterval > 0) and (self.__rownum % self.__flushInterval == 0):
00227       self.__status = cfitsio.fits_update_key_lng(self.__fptr, "RECCOUNT",
00228                                                 self.__rownum, "Record Count")
00229       if self.__status != 0:
00230         raise IOError, "fits_update_key_lng: %s" % cfitsio.fits_get_errstatus(self.__status)
00231       self.__status = cfitsio.fits_flush_buffer(self.__fptr, 0)
00232       if self.__status != 0:
00233         raise IOError, "fits_flush_buffer: %s" % cfitsio.fits_get_errstatus(self.__status)
00234     self.__rownum +=1
00235
00236
00237   def moveToHDU(self, tablenum):
00238     (self.__status, hdutype) = cfitsio.fits_movabs_hdu(self.__fptr, tablenum)
00239     if self.__status != 0:
00240       return self.__status
00241     (self.__status, self.__eventCount, comment) = cfitsio.fits_read_key_lng(self.__fptr, 'RECCOUNT')
00242     if self.__status != 0:
00243       raise IOError, "fits_read_key_lng: %s" % cfitsio.fits_get_errstatus(self.__status)
00244     return self.__status
00245
00246
00247   def read(self):
00248     self.__rownum += 1
00249     if self.__rownum > self.__eventCount:
00250       self.__tablenum += 1
00251       status = self.moveToHDU(self.__tablenum)
00252       if status != 0:
00253         return None
00254       self.__rownum = 1
00255     (self.__status, event_size, heap_addr) = cfitsio.fits_read_descript(self.__fptr, 1, self.__rownum)
00256     if self.__status != 0:
00257       raise IOError, "fits_read_descript: %s" % cfitsio.fits_get_errstatus(self.__status)
00258     (self.__status, dat) = cfitsio.fits_read_col_byt(self.__fptr, 1, self.__rownum, 1, event_size, None)
00259     if self.__status != 0:
00260       raise IOError, "fits_read_col_byt: %s" % cfitsio.fits_get_errstatus(self.__status)
00261     return dat
00262
00263
00264   def close(self):
00265     if self.__fptr is not None:
00266       if self.__mode != MODE_READONLY:
00267         if self.__tablenum > 0:
00268           self.__status = cfitsio.fits_update_key_lng(self.__fptr, "RECCOUNT",
00269                                                     self.__rownum - 1, "Event Count")
00270           if self.__status != 0:
00271             raise IOError, "fits_update_key_lng: %s" % cfitsio.fits_get_errstatus(self.__status)
00272       self.__status = cfitsio.fits_close_file(self.__fptr)
00273       if self.__status != 0:
00274         raise IOError, "fits_close_file: %s" % cfitsio.fits_get_errstatus(self.__status)
00275
00276   def setFlushInterval(self, flushInterval):
00277     self.__flushInterval = flushInterval
00278
00279   def getStatus(self):
00280     return self.__status
00281
00282   def getFileName(self, full=0):
00283     if self.__filePath is None or self.__fileName is None:
00284       return None
00285     elif full:
00286       return os.path.join(self.__filePath, self.__fileName)
00287     else:
00288       return self.__fileName
00289
00290   def setEnvRegs(self, regList, componentId=None):
00291     self.__envRegs = []
00292     self.__envUnits = []
00293     self.__envNames = []
00294     self.addEnvRegs(regList, componentId)
00295
00296   def addEnvRegs(self, regList, componentId=None):
00297     if operator.isNumberType(regList):
00298       if regList == TEM_ENV_REGS:
00299         if componentId is None:
00300           raise RuntimeError, "Please specify from which TEM " \
00301                               "the environment values are going to be collected."
00302         if not self.__lat.existsTEM(componentId):
00303           raise RuntimeError, "TEM[%d] node not found in LAT hierarchy" % componentId
00304         tem = self.__lat.TEM[componentId]
00305         if not tem.existsTIC():
00306           raise RuntimeError, "GTIC node not found in LAT hierarchy"
00307         regNode  = tem.TIC
00308         regNames = TEM_ENV_REG_LIST
00309       elif regList == AEM_ENV_REGS:
00310         if not self.__lat.existsAEM():
00311           raise RuntimeError, "AEM node not found in LAT hierarchy"
00312         aem = self.__lat.AEM
00313         if not aem.existsAEQ():
00314           raise RuntimeError, "GAEQ node not found in LAT hierarchy"
00315         regNode = aem.AEQ
00316         regNames = AEM_ENV_REG_LIST
00317       else:
00318         raise RuntimeError, "Invalid register template id: %d" % regList
00319       regList = []
00320       for regName in regNames:
00321         reg = regNode.regs[regName]
00322         regList.append(regNode.regs[regName])
00323     self.__envRegs += regList
00324     for reg in self.__envRegs:
00325       node = reg.getNode()
00326       ids = str(node.getIdTuple())
00327       if ids[-2] == ',':
00328         ids = ids[:-2] + ids[-1]
00329       self.__envNames.append(self.getRegLabel(reg))
00330       self.__envUnits.append(reg.getEGU().units())
00331
00332   def setUpdateInterval(self, updateInterval):
00333     self.__updateInterval = updateInterval
00334
00335   def stop(self):
00336     self.__threadQuit = 1
00337     if self.__envThread.isAlive():
00338       self.__envThread.join()
00339     self.close()
00340
00341   def pause(self):
00342     self.__threadPause = 1
00343
00344   def resume(self):
00345     self.__threadPause = 0
00346
00347   def getRegLabel(self, reg):
00348     node = reg.getNode()
00349     ids = str(node.getIdTuple())
00350     if ids[-2] == ',':
00351       ids = ids[:-2] + ids[-1]
00352     return node.getName() + ids + "." + reg.getName()
00353
00354
00355
00356   def getSampleCount(self):
00357     return self.__sampleCount
00358
00359   def getEnvNames(self):
00360     return self.__envNames
00361
00362   def getCachedValues(self):
00363     return self.__envValues
00364
00365   def getCachedValue(self, reg, bypass=1, strVal=0):
00366     regName = reg.getName()
00367     regLabel = self.getRegLabel(reg)
00368     if regLabel in self.__envNames:
00369       val = self.__envValues[self.__envNames.index(regLabel)]
00370       if bypass == 0:
00371         if self.__mode != MODE_READONLY:
00372           val = reg.getEGU().egu(val)
00373         if strVal == 1:
00374           val = '%8.2f' %val + "%-2s" %reg.getEGU().units()
00375       else:
00376         if self.__mode == MODE_READONLY:
00377           val = reg.getEGU().raw(val)
00378         if strVal == 1:
00379           val = str(val)
00380       return val
00381     else:
00382       #print regName, "not found in", self.__envNames
00383       return None
00384
00385   def getEnvQuantities(self, regList, bypass=0):
00386     values = []
00387     tstamps = []
00388     for reg in regList:
00389       if reg.isCommand() or reg.isWriteOnly() or reg.isNoDirectAccess():
00390         raise RuntimeError, "Invalid environmental quantity register: %s" % reg.getName()
00391       try:
00392         value = reg.get(bypass)
00393       except:
00394         value = 0
00395       tstamp = reg.getTimeStamp()
00396       name = reg.getName()
00397       values.append(value)
00398       tstamps.append(tstamp)
00399     return (values, tstamps)
00400
00401   def updateValues(self): #revisit
00402      if self.__mode == MODE_READONLY:
00403        (values, tstamps) = self.getEnvQuantities(self.__envRegs, bypass=0)
00404        self.__envValues = values
00405      else:
00406        (values, tstamps) = self.getEnvQuantities(self.__envRegs, bypass=1)
00407        self.__envValues = map(long, values)
00408      self.__envTStamps = tstamps
00409      if self.__fptr is not None:
00410        self.write()
00411      self.__sampleCount += 1
00412
00413   def start(self):
00414     self.__threadQuit = 0
00415     self.__envThread = threading.Thread(target=self.run,name="HouseKeeping")
00416     self.__envThread.start()
00417     # Let the thread get at least one measurement
00418     time.sleep(1)
00419
00420   def run(self):
00421     if len(self.__envRegs) == 0:
00422       if self.__lat.existsTEM(0):
00423         self.addEnvRegs(TEM_ENV_REGS, 0)
00424       if self.__lat.existsAEM():
00425         self.addEnvRegs(AEM_ENV_REGS)
00426       if not self.__lat.existsTEM(0) and not self.__lat.existsAEM():
00427         #Probably in GASU mode, exit the thread
00428         return
00429     while(not self.__threadQuit):
00430       # get data here
00431       if not self.__threadPause:
00432         self.updateValues()
00433       t0 = time.time()
00434       while (time.time() - t0 < self.__updateInterval):
00435         time.sleep(.001)
00436         if self.__threadQuit:
00437           break
00438
00439   def checkStatus(self, cfitsio_function, status):
00440     if status != 0:
00441       raise IOError, "%s: %s" % (cfitsio_function, cfitsio.fits_get_errstatus(status))
00442
00443 # ---- End rcHouseKeeping -----
00444
00445 def getFileNameFromTS(ts):
00446     return "env" + ts + ".fits"
00447
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcLoginImpl.py Source File

runcontrol

rcLoginImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Dialog for authenticating the user"
00012 __author__   = "S. Tuvi <STuvi@SLAC.Stanford.edu>"
00013 __date__     = ("$Date: 2004/08/24 23:15:53 $").split(' ')[1]
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 from rcLogin import rcLogin
00021
00022 class rcLoginImpl(rcLogin):
00023   def __init__(self, parent=None, name="rcLoginImpl", fl=0):
00024     rcLogin.__init__(self,parent,name,fl)
00025
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcParamVerifier.py Source File

runcontrol

rcParamVerifier.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Parameter verifier class"
00012 __author__   = "S. Tuvi <STuvi@SLAC.Stanford.edu>"
00013 __date__     = ("$Date: 2005/01/10 19:51:55 $").split(' ')[1]
00014 __version__  = "$Revision: 2.3 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 from rcParamVerifyGUIImpl import rcParamVerifyGUIImpl
00021
00022 class rcParamVerifier(object):
00023   def __init__(self, common, parent = None, name = None, fl = 0):
00024     self.__verifyGUI = rcParamVerifyGUIImpl(common, parent, name, fl)
00025     self.__common = common
00026
00027   def initialize(self, testName):
00028     self.__parNames = []
00029     self.__parValues = []
00030     self.__testName = testName
00031
00032   def add(self, parName, parValue):
00033     """\brief Add parameter and its value to the verify list
00034
00035     \param parName Parameter name or description
00036     \param parValue Parameter value that the operator inputted
00037     """
00038     if parName not in self.__parNames:
00039       self.__parNames.append(parName)
00040       self.__parValues.append(parValue)
00041     else:
00042       raise KeyError, "Parameter with name: %s already added." % parName
00043
00044   def getParameters(self, parName=None):
00045     """\brief Retrive parameters to verify
00046
00047     \param parName Parameter to retrieve from the verify list (optional)
00048
00049     \return A list containing the parameter name and value tuple if \a parName is specified or
00050             A list of parameter name and value tuples if \a parName is None.
00051     """
00052     if parName is not None:
00053       if parName in self.__parNames:
00054         return [(parName, self.__parValues[self.__parNames.index(parName)])]
00055     else:
00056       return map(None, self.__parNames, self.__parValues)
00057
00058   def verify(self):
00059     if len(self.getParameters()) > 0:
00060       self.__verifyGUI.initialize(self.__testName)
00061       for (parName, parValue) in self.getParameters():
00062         self.__verifyGUI.addParameter(parName, parValue)
00063       self.__verifyGUI.show()
00064       return self.__verifyGUI.exec_loop()
00065     else:
00066       return 1
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcParamVerifyGUIImpl.py Source File

runcontrol

rcParamVerifyGUIImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2005
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Parameter verifier dialog"
00012 __author__   = "S. Tuvi <STuvi@SLAC.Stanford.edu>"
00013 __date__     = "2005/01/27 23:00:27"
00014 __updated__  = "$Date: 2006/01/31 17:36:54 $"
00015 __version__  = "$Revision: 2.6 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 from qt import *
00022 from qttable import *
00023 import sys
00024 from rcParamVerifyGUI import rcParamVerifyGUI
00025
00026 class rcParamVerifyGUIImpl(rcParamVerifyGUI):
00027   """!\brief Parameter verifier GUI
00028
00029   """
00030   class ParamCheckTableItem(QTableItem):
00031     """!\brief Checkbox table item for the parameter verifier.
00032
00033     """
00034     RTTI = 1000
00035
00036     def __init__(self, *args):
00037       """!\brief ParamCheckTableItem constructor.
00038
00039       """
00040       QTableItem.__init__(self, *args)
00041       self.__cb = None
00042       self.__checked = 0
00043
00044     #def alignment(self):
00045     #  return Qt.AlignRight
00046
00047     def rtti(self):
00048       """!\brief Return the runtime type information value.
00049
00050       \return RTTI
00051       """
00052       return self.RTTI
00053
00054     def isChecked(self):
00055       """!\brief Find out if the item is checked.
00056
00057       \return 1: Checked, 0: Is not checked
00058       """
00059       return self.__cb.isChecked()
00060
00061 #    def paint(self, p, cg, cr, selected):
00062 #      if selected:
00063 #        br = QColorGroup.Highlight
00064 #      else:
00065 #        br = QColorGroup.Base
00066 #      p.fillRect(0, 0, cr.width(), cr.height(), cg.brush(br))
00067
00068 #      c = QColorGroup(cg);
00069 #      c.setBrush(QColorGroup.Background, c.brush(QColorGroup.Base));
00070 #      flags = QStyle.Style_Default;
00071 #      if self.isEnabled():
00072 #         flags |= QStyle.Style_Enabled
00073 #      if self.isChecked():
00074 #         flags |= QStyle.Style_On
00075 #      else:
00076 #         flags |= QStyle.Style_Off
00077 #      if self.isEnabled() and self.table().isEnabled():
00078 #         flags |= QStyle.Style_Enabled
00079
00080 #      sz = QSize(self.table().style().pixelMetric( QStyle.PM_IndicatorWidth ),
00081 #             self.table().style().pixelMetric( QStyle.PM_IndicatorHeight ) )
00082
00083 ##      self.table().style().drawPrimitive( QStyle.PE_Indicator, p,
00084 ##                  QRect(0, (cr.height() - sz.height()) / 2, sz.width(), sz.height() ), c, flags )
00085
00086 #      intCenterGap = ( self.table().cellGeometry( self.row(), self.col() ).width() - sz.width())/2
00087 #      #self.table().style().drawPrimitive( QStyle.PE_Indicator, p,
00088 #      #  QRect(intCenterGap, ( cr.height() - sz.height() ) / 2,
00089 #      #  sz.width(), sz.height()), c, flags )
00090
00091     def createEditor(self):
00092       """!\brief Create an editor for the checkbox table item.
00093
00094       """
00095       self.__pwdg = QWidget(self.table().viewport(), "wdg_checkparent")
00096       self.__cb = QCheckBox(self.__pwdg, "qt_editor_checkbox" )
00097       #self.__cb = QCheckBox(self.table().viewport(), "qt_editor_checkbox" )
00098       self.__pwdg.setFocusProxy(self.__cb)
00099       self.__cb.setChecked( self.__checked )
00100       self.__cb.adjustSize()
00101       self.__cb.setText(self.text())
00102       self.__cb.move( ( (self.table().cellGeometry( self.row(), self.col() ).width() - self.__cb.size().width() )/2) , ( self.table().cellGeometry( self.row(), self.col() ).height() - self.__cb.size().height() )/2 )
00103       self.__cb.setEraseColor(self.table().viewport().eraseColor())
00104       self.__pwdg.setEraseColor(self.table().viewport().eraseColor())
00105       QObject.connect(self.__cb, SIGNAL("toggled(bool)"), self.doValueChanged)
00106       #return self.__cb
00107       return self.__pwdg
00108
00109     def setContentFromEditor(self, w):
00110       """!\brief Set content from the editor.
00111
00112       \param w Widget
00113       """
00114       if self.__cb:
00115         self.__checked = self.__cb.isChecked()
00116
00117     def doValueChanged(self):
00118       """!\brief Emit a valueChanged signal.
00119
00120       """
00121       self.table().setCurrentCell(self.row(), self.col())
00122       self.table().emit(SIGNAL('valueChanged'), (self.row(), self.col()))
00123
00124   class ParamTextTableItem(QTableItem):
00125     """!\brief Text table item for the parameter verifier.
00126
00127     """
00128     def __init__(self, *args):
00129       """!\brief ParamTextTableItem constructor.
00130
00131       \param *args Parameters
00132       """
00133       QTableItem.__init__(self, *args)
00134       self.__bold = 0
00135
00136     def alignment(self):
00137       """!\brief Set alignment to left and center.
00138
00139       """
00140       return Qt.AlignLeft | Qt.AlignVCenter
00141
00142     def paint(self, p, cg, rect, selected):
00143       """!\brief Paint the table item.
00144
00145       \param p        Painter
00146       \param cg       Color group
00147       \param rect     Rectangle
00148       \param selected Selected
00149       """
00150       f = p.font()
00151       f.setBold(self.__bold)
00152       p.setFont(f)
00153       # Do the standard painting
00154       QTableItem.paint(self,p,cg,rect,selected)
00155
00156     def setBold(self, bold):
00157       """!\brief Set the text item in bold.
00158
00159       \param bold Boolean
00160       """
00161       self.__bold = bold
00162
00163
00164   def __init__(self, common, parent = None, name = None, fl = 0):
00165     """!\brief rcParamVerifyGUIImpl constructor.
00166
00167     \param common ScriptEngineCommon instance.
00168     \param parent Parent GUI
00169     \param name   GUI name
00170     \param fl     GUI flags
00171     """
00172     rcParamVerifyGUI.__init__(self, parent, name, fl)
00173     self.__common = common
00174     self.parTable.setLeftMargin(0)
00175     self.parTable.setNumCols(3)
00176     colLabels = QStringList("Parameter")
00177     colLabels.append("Value")
00178     colLabels.append("")
00179     self.parTable.setColumnLabels(colLabels)
00180     self.parTable.setColumnReadOnly(0, 1)
00181     self.parTable.setColumnReadOnly(1, 1)
00182     self.parTable.setColumnReadOnly(2, 0)
00183     self.parTable.setColumnWidth(0,200)
00184     self.parTable.setColumnWidth(1,50)
00185     self.parTable.setColumnWidth(2,20)
00186     self.parTable.horizontalHeader().setResizeEnabled(0, 2)
00187     self.parTable.setColumnStretchable(0, 1)
00188     self.parTable.setColumnStretchable(1, 1)
00189     #self.parTable.horizontalHeader().setClickEnabled(0, 2)
00190     self.__paramCount = 0
00191     QObject.connect(self.parTable,
00192                 SIGNAL("valueChanged(int,int)"), self.parameterClicked)
00193     QObject.connect(self.buttonCancel,SIGNAL("clicked()"),self.cancel)
00194     QObject.connect(self.buttonConfirm,SIGNAL("clicked()"),self.confirm)
00195     self.__certifyText = str(self.textCertify.text())
00196
00197     # Dummy up some entries
00198     #self.textCertify.setText(str(self.textCertify.text()) % ("Selim Tuvi", "testAppCal"))
00199     #self.__paramCount = 6
00200     #ti = self.addParameter("Layers Selection", "(X0,Y0)")
00201     #ti = self.addParameter("No. of strobes per setting", 1)
00202     #ti = self.addParameter("Thr DAC", 30)
00203     #ti = self.addParameter("Thr Range", 0)
00204     #ti = self.addParameter("Cal DAC", 20)
00205     #ti = self.addParameter("Cal Range", 1)
00206
00207   def initialize(self, testName):
00208     """!\brief Initialize the GUI.
00209
00210     \param testName Name of the test script
00211     """
00212     prefs = self.__common.prefMan().preferences()
00213     user = prefs['operatorobj']
00214     self.textTestName.setText(testName)
00215     self.textUserName.setText(user.getName())
00216     self.textCertify.setText(self.__certifyText % (user.getName(), testName))
00217     self.buttonConfirm.setEnabled(0)
00218     self.txtPassword.setEnabled(0)
00219     self.__paramCount = 0
00220     self.txtPassword.setText("")
00221     self.clearAllRows()
00222
00223   def clearAllRows(self):
00224     """!\brief Clear all rows.
00225
00226     """
00227     for row in range(self.parTable.numRows()):
00228       self.parTable.removeRow(row)
00229
00230   def cancel(self):
00231     """!\brief Cancel button is clicked.
00232
00233     """
00234     QDialog.done(self, QDialog.Rejected)
00235
00236   def confirm(self):
00237     """!\brief Confirm button is clicked.
00238
00239     """
00240     prefs = self.__common.prefMan().preferences()
00241     secMan = self.__common.getSecurityMan()
00242     if secMan is None:
00243       QDialog.done(self, QDialog.Accepted)
00244     else:
00245       user = prefs['operatorobj']
00246       if secMan.authenticateUser(user.getLoginId(), str(self.txtPassword.text())) == 0:
00247         QDialog.done(self, QDialog.Accepted)
00248       else:
00249         QMessageBox.critical( None, "Authentication Error",
00250                                     "Incorrect Password",
00251                                     QMessageBox.Ok + QMessageBox.Default )
00252         self.txtPassword.selectAll()
00253
00254   def addParameter(self, name, value):
00255     """!\brief Add parameter.
00256
00257     \param name  Parameter name
00258     \param value Parameter value
00259     """
00260     self.parTable.setNumRows(self.__paramCount+1)
00261     ti = self.ParamTextTableItem(self.parTable, QTableItem.Never, name)
00262     self.parTable.setItem(self.__paramCount, 0, ti)
00263     ti = self.ParamTextTableItem(self.parTable, QTableItem.Never, str(value))
00264     self.parTable.setItem(self.__paramCount, 1, ti)
00265     ti = self.ParamCheckTableItem(self.parTable, QTableItem.Always, "")
00266     self.parTable.setItem(self.__paramCount, 2, ti)
00267     self.__paramCount+=1
00268     return ti
00269
00270   def parameterClicked(self, row, col):
00271     """!\brief Signal that a table item has been changed.
00272
00273     \param row Table row
00274     \param col Table column
00275     """
00276     if col == 2:
00277       chk = self.parTable.item(row, col)
00278       if chk.isChecked():
00279         self.parTable.item(row, 0).setBold(1)
00280         self.parTable.item(row, 1).setBold(1)
00281         self.parTable.repaintSelections()
00282       else:
00283         self.parTable.item(row, 0).setBold(0)
00284         self.parTable.item(row, 1).setBold(0)
00285         self.parTable.repaintSelections()
00286
00287       if self.allParametersChecked():
00288         self.buttonConfirm.setEnabled(1)
00289         self.txtPassword.setEnabled(1)
00290       else:
00291         self.buttonConfirm.setEnabled(0)
00292         self.txtPassword.setEnabled(0)
00293
00294   def allParametersChecked(self):
00295     """!\brief Check if all parameters have been checked.
00296
00297     \return True:  If all parameters have been checked.
00298             False: Not all parameters have been checked.
00299     """
00300     for row in range(self.__paramCount):
00301       chk = self.parTable.item(row, 2)
00302       if not chk.isChecked():
00303         return False
00304     return True
00305
00306 if __name__ == "__main__":
00307   a = QApplication(sys.argv)
00308   QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00309   w = rcParamVerifyGUIImpl(None)
00310   a.setMainWidget(w)
00311   w.show()
00312   a.exec_loop()
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcPreferencesGUIImpl.py Source File

runcontrol

rcPreferencesGUIImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GUI for setting preferences for the Online Run Control system"
00012 __author__   = """J. Cohen-Tanugi <Cohen@SLAC.Stanford.edu>
00013                                   INFN/Pisa - GLAST LAT TKR"""
00014 __date__     = "2/5/2003"
00015 __version__  = "$Revision: 2.15 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 import os
00022 import sys
00023 import string
00024 from qt               import *
00025 from rcPreferencesGUI import rcPreferencesGUI
00026 from rcUsers          import rcUser
00027
00028 class rcPreferencesGUIImpl(rcPreferencesGUI):
00029   def __init__(self, common, parent=None, name="rcPreferencesGUIImpl", fl=0):
00030     rcPreferencesGUI.__init__(self,parent,name,fl)
00031
00032     self.__prefMan = common.prefMan()
00033     self.__prefs = common.prefMan().preferences()
00034     self.__common = common
00035
00036     self.connect(self.CANCEL,SIGNAL("clicked()"),self.cancel)
00037     self.connect(self.OK,SIGNAL("clicked()"),self.loadAndExit)
00038     self.connect(self.DEFAULT,SIGNAL("clicked()"),self.default)
00039     self.connect(self.SAVE,SIGNAL("clicked()"),self.writeConfig)
00040     self.connect(self.logButton,SIGNAL("clicked()"),self.logBrowser)
00041     self.connect(self.dataButton,SIGNAL("clicked()"),self.dataBrowser)
00042     self.connect(self.scriptButton,SIGNAL("clicked()"),self.appBrowser)
00043     self.connect(self.reposButton,SIGNAL("clicked()"),self.reposBrowser)
00044     self.connect(self.repButton,SIGNAL("clicked()"),self.repBrowser)
00045     self.connect(self.fitsButton,SIGNAL("clicked()"),self.fitsBrowser)
00046     self.connect(self.snapshotButton,SIGNAL("clicked()"),self.snapshotBrowser)
00047     self.connect(self.exportButton,SIGNAL("clicked()"),self.exportBrowser)
00048     self.connect(self.runIdButton,SIGNAL("clicked()"),self.runIdBrowser)
00049     self.connect(self.comboStyle, SIGNAL("activated(const QString&)"), self.selectStyle)
00050     self.connect(self.buttonSelectFont,SIGNAL("clicked()"),self.selectFont)
00051     self.connect(self.buttonSaveUser,SIGNAL("clicked()"),self.saveUser)
00052     self.connect(self.buttonAddPassword,SIGNAL("clicked()"),self.addChangePassword)
00053     self.connect(self.buttonDeleteUser,SIGNAL("clicked()"),self.deleteUser)
00054     self.connect(self.txtUserID,SIGNAL("lostFocus()"),self.updateUserIDText)
00055     self.connect(self.txtUserName,SIGNAL("returnPressed()"),self.saveUser)
00056     self.connect(self.chkServerDisable,SIGNAL("clicked()"),self.handleServerText)
00057     self.connect(self.listviewUsers, SIGNAL("doubleClicked(QListViewItem*)"), self.listUsersDblClick)
00058
00059     for style in QStyleFactory.keys():
00060       self.comboStyle.insertItem(style)
00061
00062     secMan = common.getSecurityMan()
00063     if secMan is None:
00064       self.txtPassword.setEnabled(0)
00065       self.txtPasswordAgain.setEnabled(0)
00066       self.txtOldPassword.setEnabled(0)
00067       self.buttonAddPassword.setEnabled(0)
00068
00069
00070   def applyPermissions(self, operator):
00071     adminOverride = operator.isAdministrator()
00072     for i in range(self.rcPrefsTab.count()):
00073       tabPage = self.rcPrefsTab.page(i)
00074       pageName = tabPage.name()
00075       if 'edit_' + pageName in operator.getPermissions() or adminOverride:
00076         tabPage.setEnabled(1)
00077       else:
00078         tabPage.setEnabled(0)
00079
00080     if 'edit_repository_dir' in operator.getPermissions() or adminOverride:
00081       self.reposEdit.setEnabled(1)
00082       self.reposButton.setEnabled(1)
00083     else:
00084       self.reposEdit.setEnabled(0)
00085       self.reposButton.setEnabled(0)
00086
00087     if 'edit_script_dir' in operator.getPermissions() or adminOverride:
00088       self.scriptEdit.setEnabled(1)
00089       self.scriptButton.setEnabled(1)
00090     else:
00091       self.scriptEdit.setEnabled(0)
00092       self.scriptButton.setEnabled(0)
00093
00094     if 'edit_data_dir' in operator.getPermissions() or adminOverride:
00095       self.dataEdit.setEnabled(1)
00096       self.dataButton.setEnabled(1)
00097     else:
00098       self.dataEdit.setEnabled(0)
00099       self.dataButton.setEnabled(0)
00100
00101     if 'edit_log_dir' in operator.getPermissions() or adminOverride:
00102       self.logEdit.setEnabled(1)
00103       self.logButton.setEnabled(1)
00104     else:
00105       self.logEdit.setEnabled(0)
00106       self.logButton.setEnabled(0)
00107
00108     if 'edit_report_dir' in operator.getPermissions() or adminOverride:
00109       self.repEdit.setEnabled(1)
00110       self.repButton.setEnabled(1)
00111     else:
00112       self.repEdit.setEnabled(0)
00113       self.repButton.setEnabled(0)
00114
00115     if 'edit_fits_dir' in operator.getPermissions() or adminOverride:
00116       self.fitsEdit.setEnabled(1)
00117       self.fitsButton.setEnabled(1)
00118     else:
00119       self.fitsEdit.setEnabled(0)
00120       self.fitsButton.setEnabled(0)
00121
00122     if 'edit_snapshot_dir' in operator.getPermissions() or adminOverride:
00123       self.snapshotEdit.setEnabled(1)
00124       self.snapshotButton.setEnabled(1)
00125     else:
00126       self.snapshotEdit.setEnabled(0)
00127       self.snapshotButton.setEnabled(0)
00128
00129     if 'edit_export_dir' in operator.getPermissions() or adminOverride:
00130       self.exportEdit.setEnabled(1)
00131       self.exportButton.setEnabled(1)
00132     else:
00133       self.exportEdit.setEnabled(0)
00134       self.exportButton.setEnabled(0)
00135
00136     if 'edit_runid_dir' in operator.getPermissions() or adminOverride:
00137       self.runIdEdit.setEnabled(1)
00138       self.runIdButton.setEnabled(1)
00139     else:
00140       self.runIdEdit.setEnabled(0)
00141       self.runIdButton.setEnabled(0)
00142
00143     if 'set_data_archiving_option' in operator.getPermissions() or adminOverride:
00144       self.archiveDataBox.setEnabled(1)
00145     else:
00146       self.archiveDataBox.setEnabled(0)
00147
00148     if 'set_message_logging_option' in operator.getPermissions() or adminOverride:
00149       self.logMsgBox.setEnabled(1)
00150     else:
00151       self.logMsgBox.setEnabled(0)
00152
00153     if 'set_message_logging_filter' in operator.getPermissions() or adminOverride:
00154       self.verbosityLevel.setEnabled(1)
00155     else:
00156       self.verbosityLevel.setEnabled(0)
00157
00158     if 'set_snapshots_option' in operator.getPermissions() or adminOverride:
00159       self.chkSnapshot.setEnabled(1)
00160     else:
00161       self.chkSnapshot.setEnabled(0)
00162
00163     if 'set_data_export_option' in operator.getPermissions() or adminOverride:
00164       self.exportDataBox.setEnabled(1)
00165     else:
00166       self.exportDataBox.setEnabled(0)
00167
00168     if 'set_version_info_option' in operator.getPermissions() or adminOverride:
00169       self.chkVersions.setEnabled(1)
00170     else:
00171       self.chkVersions.setEnabled(0)
00172
00173     if 'set_elog_integration_option' in operator.getPermissions() or adminOverride:
00174       self.chkElogIntegration.setEnabled(1)
00175     else:
00176       self.chkElogIntegration.setEnabled(0)
00177
00178     if 'set_site_run_condition' in operator.getPermissions() or adminOverride:
00179       self.comboSite.setEnabled(1)
00180     else:
00181       self.comboSite.setEnabled(0)
00182
00183     if 'set_instrument_type_run_condition' in operator.getPermissions() or adminOverride:
00184       self.comboInstrumentType.setEnabled(1)
00185     else:
00186       self.comboInstrumentType.setEnabled(0)
00187
00188     if 'set_phase_run_condition' in operator.getPermissions() or adminOverride:
00189       self.comboPhase.setEnabled(1)
00190     else:
00191       self.comboPhase.setEnabled(0)
00192
00193     if 'enable_delete_user' in operator.getPermissions() or adminOverride:
00194       self.buttonDeleteUser.setEnabled(1)
00195     else:
00196       self.buttonDeleteUser.setEnabled(0)
00197
00198     if 'set_python_path_system_pref' in operator.getPermissions() or adminOverride:
00199       self.txtPythonPath.setEnabled(1)
00200     else:
00201       self.txtPythonPath.setEnabled(0)
00202
00203     if 'set_elog_url_system_pref' in operator.getPermissions() or adminOverride:
00204       self.txtElogBookURL.setEnabled(1)
00205     else:
00206       self.txtElogBookURL.setEnabled(0)
00207
00208     if 'set_dds_system_pref' in operator.getPermissions() or adminOverride:
00209       self.txtServer.setEnabled(1)
00210       self.chkServerDisable.setEnabled(1)
00211     else:
00212       self.txtServer.setEnabled(0)
00213       self.chkServerDisable.setEnabled(0)
00214
00215     if 'set_visual_system_pref' in operator.getPermissions() or adminOverride:
00216       self.buttonSelectFont.setEnabled(1)
00217       self.comboStyle.setEnabled(1)
00218     else:
00219       self.buttonSelectFont.setEnabled(0)
00220       self.comboStyle.setEnabled(0)
00221
00222   def selectStyle(self, style):
00223     font = QApplication.font()
00224     if self.__prefs.has_key('fontfamily'):
00225       font.setFamily(self.__prefs['fontfamily'])
00226     if self.__prefs.has_key('fontsize'):
00227       font.setPointSize(int(self.__prefs['fontsize']))
00228     if self.__prefs.has_key('fontweight'):
00229       font.setWeight(int(self.__prefs['fontweight']))
00230     if self.__prefs.has_key('fontitalic'):
00231       font.setItalic(int(self.__prefs['fontitalic']))
00232     QApplication.setFont(font, 1)
00233     QApplication.setStyle(QStyleFactory.create(style))
00234     self.__prefs["style"] = str(style)
00235
00236
00237   def selectFont(self):
00238     ok = 0
00239     oldfont = QApplication.font()
00240     newfont, ok = QFontDialog.getFont(oldfont, self)
00241     if ok:
00242       try:
00243         QApplication.setFont(newfont, 1)
00244         self.__prefs["fontfamily"] = str(newfont.family())
00245         self.__prefs["fontsize"] = newfont.pointSize()
00246         self.__prefs["fontweight"] = newfont.weight()
00247         if newfont.italic():
00248           fontitalic = 1
00249         else:
00250           fontitalic = 0
00251         self.__prefs["fontitalic"] = fontitalic
00252       except:
00253         pass
00254
00255   def updateUserIDText(self):
00256     userId = str(self.txtUserID.text()).strip()
00257     try:
00258       userId = "%03d" % int(userId)
00259       self.txtUserID.setText(userId)
00260       user = self.__prefs["users"].getUser(userId)
00261       if user is not None:
00262         self.showUser(user)
00263       else:
00264         self.txtUserName.setText("")
00265         self.txtLoginId.setText("")
00266     except:
00267       pass
00268
00269   def listUsersDblClick(self, item):
00270     userId = str(item.text(0))
00271     user = self.__prefs["users"].getUser(userId)
00272     self.showUser(user)
00273
00274   def showUser(self, user):
00275     userId = user.getId()
00276     userName = user.getName()
00277     userLoginId = user.getLoginId()
00278     self.txtUserID.setText(userId)
00279     self.txtUserName.setText(userName)
00280     self.txtLoginId.setText(userLoginId)
00281     secMan = self.__common.getSecurityMan()
00282     if secMan is not None:
00283       if secMan.checkPassword(userLoginId) == 0:
00284         self.txtPassword.setText("**********")
00285         self.txtPasswordAgain.setText("**********")
00286         self.buttonAddPassword.setText("Change Password")
00287       else:
00288         self.txtPassword.setText("")
00289         self.txtPasswordAgain.setText("")
00290         self.buttonAddPassword.setText("Add Password")
00291       self.txtOldPassword.setText("")
00292
00293   def checkModifyUserPermission(self, userId):
00294     secMan = self.__common.getSecurityMan()
00295     if secMan is not None:
00296       operator = self.__prefs["operatorobj"]
00297       adminOverride = operator.isAdministrator()
00298       if 'enable_other_user_entry' not in operator.getPermissions() and not adminOverride:
00299         if operator.getId() != userId:
00300           QMessageBox.critical( None, "User Entry Error",
00301                                       "Not enough permissions to modify a user other than self",
00302                                       QMessageBox.Ok + QMessageBox.Default )
00303           return -1
00304     return 0
00305
00306   def saveUser(self):
00307     userId = str(self.txtUserID.text()).strip()
00308     if self.checkModifyUserPermission(userId) != 0: return
00309     try:
00310       userId = "%03d" % int(userId)
00311     except:
00312       QMessageBox.critical( None, "User Entry Error",
00313                                   "Invalid user id. Please enter as three digits",
00314                                   QMessageBox.Ok + QMessageBox.Default )
00315       return
00316     #if userId in self.__prefs["users"].values():
00317     #  QMessageBox.critical( None, "User Entry Error",
00318     #                              "User ID %s already exists" % userId,
00319     #                              QMessageBox.Ok + QMessageBox.Default )
00320     #elif self.__prefs["users"].has_key(user):
00321     #  QMessageBox.critical( None, "User Entry Error",
00322     #                              "User %s already exists" % user,
00323     #                              QMessageBox.Ok + QMessageBox.Default )
00324     #else:
00325     secMan = self.__common.getSecurityMan()
00326     oldLoginId = None
00327     oldUser = self.__prefs["users"].getUser(userId)
00328     if oldUser is not None:
00329       oldLoginId = oldUser.getLoginId()
00330     userLoginId = str(self.txtLoginId.text()).strip()
00331     userName = str(self.txtUserName.text()).strip()
00332     if userLoginId == '':
00333       self.txtLoginId.setText(userName)
00334       userLoginId = userName
00335     user = self.__prefs["users"].getUserByLoginId(userLoginId)
00336     if user is not None and user.getId() != userId:
00337       QMessageBox.critical( None, "User Entry Error",
00338                                   "Duplicate login id, please choose another",
00339                                   QMessageBox.Ok + QMessageBox.Default )
00340       return
00341     user = rcUser(userId, userLoginId, userName)
00342     secMan = self.__common.getSecurityMan()
00343     self.__prefs["users"].addUser(user)
00344     if oldLoginId is not None:
00345       if secMan is not None:
00346         if secMan.checkPassword(oldLoginId) == 0:
00347             secMan.deleteUser(oldLoginId)
00348     if self.__prefs["operatorobj"].getId() == userId:
00349       self.__prefs["operatorobj"] = user
00350       self.__prefs["operator"]= user.getName()
00351     existingItem = self.listviewUsers.findItem(userId, 0)
00352     if existingItem is not None:
00353       self.listviewUsers.takeItem(existingItem)
00354     QListViewItem(self.listviewUsers, userId, user.getName(), user.getLoginId())
00355     self.showUser(user)
00356
00357   def addChangePassword(self):
00358     secMan = self.__common.getSecurityMan()
00359     if secMan is None:
00360       QMessageBox.critical( None, "Security not enabled",
00361                                   "Can not add or change passwords when security is not enabled.",
00362                                   QMessageBox.Ok + QMessageBox.Default )
00363     else:
00364       userId = str(self.txtUserID.text()).strip()
00365       if self.checkModifyUserPermission(userId) != 0: return
00366       loginId = str(self.txtLoginId.text()).strip()
00367       userName = str(self.txtUserName.text()).strip()
00368       password1 = str(self.txtPassword.text()).strip()
00369       password2 = str(self.txtPasswordAgain.text()).strip()
00370       oldPassword = str(self.txtOldPassword.text()).strip()
00371       user = self.__prefs["users"].getUser(userId)
00372       if user.getLoginId() != loginId or user.getName() != userName:
00373         QMessageBox.critical( None, "Entry Error",
00374                                     "Please 'Save User' before adding/changing password.",
00375                                     QMessageBox.Ok + QMessageBox.Default )
00376         return
00377       if password1 == "**********":
00378         QMessageBox.critical( None, "Entry Error",
00379                                     "Please enter a valid new password.",
00380                                     QMessageBox.Ok + QMessageBox.Default )
00381         return
00382       if password1 != password2:
00383         QMessageBox.critical( None, "Entry Error",
00384                                     "Passwords don't match.",
00385                                     QMessageBox.Ok + QMessageBox.Default )
00386         return
00387       if len(password1) < 6:
00388         QMessageBox.critical( None, "Entry Error",
00389                                     "Passwords need to be at least 6 characters in length.",
00390                                     QMessageBox.Ok + QMessageBox.Default )
00391         return
00392       if secMan.checkPassword(loginId) == 0:
00393         # Change password
00394         if oldPassword == "":
00395           QMessageBox.critical( None, "Entry Error",
00396                                       "Please enter the old password.",
00397                                       QMessageBox.Ok + QMessageBox.Default )
00398         else:
00399           changePass = secMan.changePassword(loginId, password1, userName, oldPassword)
00400           if changePass == 0:
00401             QMessageBox.information( None, "Change Password",
00402                                         "User password changed successfully.",
00403                                         QMessageBox.Ok + QMessageBox.Default )
00404             self.showUser(user)
00405           elif changePass == -1:
00406             QMessageBox.critical( None, "Change Password",
00407                                         "Invalid user id or password.",
00408                                         QMessageBox.Ok + QMessageBox.Default )
00409           elif changePass == -2:
00410             QMessageBox.critical( None, "Change Password",
00411                                         "Can not access the password database.",
00412                                         QMessageBox.Ok + QMessageBox.Default )
00413           else:
00414             QMessageBox.critical( None, "Change Password",
00415                                         "Unknown error. Please check the message log.",
00416                                         QMessageBox.Ok + QMessageBox.Default )
00417
00418       else:
00419         # Add password
00420         addPass = secMan.addPassword(loginId, password1, userName)
00421         if addPass == 0:
00422           QMessageBox.information( None, "Add Password",
00423                                       "User password added successfully.",
00424                                       QMessageBox.Ok + QMessageBox.Default )
00425           user = self.__prefs["users"].getUser(userId)
00426           self.showUser(user)
00427         elif addPass == -1:
00428           QMessageBox.critical( None, "Add Password",
00429                                       "Invalid user id or password.",
00430                                       QMessageBox.Ok + QMessageBox.Default )
00431
00432         elif addPass == -2:
00433           QMessageBox.critical( None, "Add Password",
00434                                       "User already exists in the password database.",
00435                                       QMessageBox.Ok + QMessageBox.Default )
00436         elif addPass == -3:
00437           QMessageBox.critical( None, "Add Password",
00438                                       "Error accessing the database. Please check the message log",
00439                                       QMessageBox.Ok + QMessageBox.Default )
00440         else:
00441           QMessageBox.critical( None, "Add Password",
00442                                       "Unknown error. Please check the message log.",
00443                                       QMessageBox.Ok + QMessageBox.Default )
00444
00445   def deleteUser(self):
00446     selItem = self.listviewUsers.selectedItem()
00447     userId = str(selItem.text(0))
00448     secMan = self.__common.getSecurityMan()
00449     user = self.__prefs["users"].getUser(userId)
00450     secMan.deleteUser(user.getLoginId())
00451     self.__prefs["users"].deleteUser(userId)
00452     self.listviewUsers.takeItem(selItem)
00453
00454   def handleServerText(self):
00455     self.txtServer.setEnabled(not self.chkServerDisable.isChecked())
00456
00457   def loadConfig(self):
00458     self.reposEdit.setText(self.__prefs.get("reposdir"))
00459     self.scriptEdit.setText(self.__prefs.get("appdir"))
00460     self.dataEdit.setText(self.__prefs.get("datadir"))
00461     self.logEdit.setText(self.__prefs.get("logdir"))
00462     self.repEdit.setText(self.__prefs.get("reportdir"))
00463     self.fitsEdit.setText(self.__prefs.get("fitsdir"))
00464     self.snapshotEdit.setText(self.__prefs.get("snapshotdir"))
00465     self.exportEdit.setText(self.__prefs.get("exportdir"))
00466     self.runIdEdit.setText(self.__prefs.get("runiddir"))
00467     self.archiveDataBox.setChecked(int(self.__prefs["datasave"]))
00468     self.exportDataBox.setChecked(int(self.__prefs["dataexport"]))
00469     self.logMsgBox.setChecked(int(self.__prefs["lognbl"]))
00470     self.verbosityLevel.setCurrentText(self.__prefs["loglevel"])
00471     self.logHostEdit.setText(self.__prefs["loghost"])
00472     self.logPortEdit.setText(str(self.__prefs["logport"]))
00473     #self.chkFITSoutput.setChecked(int(self.__prefs["fitsnbl"]))
00474     self.chkFITSoutput.setChecked(0)
00475     self.chkFITSoutput.setEnabled(0)
00476     #self.chkFITScompress.setChecked(int(self.__prefs["fitscompress"]))
00477     self.chkFITScompress.setChecked(0)
00478     self.chkFITScompress.setEnabled(0)
00479     self.chkSnapshot.setChecked(int(self.__prefs["snapnbl"]))
00480     self.chkVersions.setChecked(int(self.__prefs["versionnbl"]))
00481     self.chkElogIntegration.setChecked(int(self.__prefs["elognbl"]))
00482     self.txtPythonPath.setText(self.__prefs["pythonpath"])
00483     self.txtElogBookURL.setText(self.__prefs["elogurl"])
00484     self.txtServer.setText(self.__prefs["server"])
00485     self.chkServerDisable.setChecked(not int(self.__prefs["servernbl"]))
00486     self.handleServerText()
00487
00488     self.setupCombo(self.comboSite, 'site', 'lastsite')
00489     self.setupCombo(self.comboInstrumentType, 'instrument type', 'lastinstrumenttype')
00490     self.setupCombo(self.comboPhase, 'phase', 'lastphase')
00491
00492     if self.__prefs.has_key('style'):
00493       style = self.__prefs['style']
00494       if QString(style) in QStyleFactory.keys():
00495         self.comboStyle.setCurrentText(style)
00496
00497     self.listviewUsers.clear()
00498     for (userId, user) in self.__prefs['users'].getUsers().items():
00499       QListViewItem(self.listviewUsers, userId, user.getName(), user.getLoginId())
00500     self.listviewUsers.setAllColumnsShowFocus(1)
00501     #self.listviewUsers.setSortOrder(Qt.Ascending)
00502     self.listviewUsers.setSorting(0, 1)
00503     #self.listviewUsers.setShowSortIndicator(1)
00504     return self.__prefs
00505
00506   def setupCombo(self, combo, group, last):
00507     combo.clear()
00508     undef = 'NOT-DEFINED'
00509     if self.__prefs.has_key(group):
00510       dictPref = self.__prefs[group]
00511       keyList = dictPref.keys()
00512       keyList.sort()
00513       for item in keyList:
00514         if item != "Don't Use":
00515           combo.insertItem(item)
00516       if self.__common.options().securedir is None:
00517         combo.insertItem(undef)
00518
00519       if self.__prefs.has_key(last):
00520         combo.setCurrentText(self.__prefs[last])
00521       else:
00522         self.__prefs[last] = str(combo.currentText())
00523
00524
00525   def loadAndExit(self):
00526     prefs = self.screenToPrefs()
00527     if not self.sanityCheck(prefs): return
00528     self.__prefMan.refreshPrefs(prefs)
00529     QDialog.done(self, QDialog.Accepted)
00530
00531   def writeConfig(self):
00532     prefs = self.screenToPrefs()
00533     if not self.sanityCheck(prefs): return
00534     self.__prefMan.refreshPrefs(prefs)
00535     self.__prefMan.writeConfig()
00536     QDialog.done(self, QDialog.Accepted)
00537
00538   def sanityCheck(self, prefs):
00539     if prefs['exportdir'] == prefs['datadir']:
00540       QMessageBox.critical( None, "Error",
00541                                   "Data Export path should be different than the Data File path",
00542                                   QMessageBox.Ok + QMessageBox.Default )
00543       return False
00544     return True
00545
00546   def screenToPrefs(self):
00547     reposDir       = str(self.reposEdit.text())
00548     appDir         = str(self.scriptEdit.text())
00549     dataDir        = str(self.dataEdit.text())
00550     logDir         = str(self.logEdit.text())
00551     reportDir      = str(self.repEdit.text())
00552     fitsDir        = str(self.fitsEdit.text())
00553     snapshotDir    = str(self.snapshotEdit.text())
00554     exportDir      = str(self.exportEdit.text())
00555     runIdDir       = str(self.runIdEdit.text())
00556     if self.archiveDataBox.isChecked():
00557       dataSave     = 1
00558     else:
00559       dataSave     = 0
00560     if self.exportDataBox.isChecked():
00561       dataExport   = 1
00562     else:
00563       dataExport   = 0
00564     if self.logMsgBox.isChecked():
00565       lognbl       = 1
00566     else:
00567       lognbl       = 0
00568     loglevel       = str(self.verbosityLevel.currentText())
00569     loghost        = str(self.logHostEdit.text())
00570     logport        = int(str(self.logPortEdit.text()))
00571     if self.chkFITSoutput.isChecked():
00572       fitsnbl      = 1
00573     else:
00574       fitsnbl      = 0
00575     if self.chkFITScompress.isChecked():
00576       fitscompress = 1
00577     else:
00578       fitscompress = 0
00579     if self.chkSnapshot.isChecked():
00580       snapnbl      = 1
00581     else:
00582       snapnbl      = 0
00583     if self.chkVersions.isChecked():
00584       versionnbl      = 1
00585     else:
00586       versionnbl      = 0
00587     if self.chkElogIntegration.isChecked():
00588       elognbl      = 1
00589     else:
00590       elognbl      = 0
00591     site           = str(self.comboSite.currentText())
00592     instrumentType = str(self.comboInstrumentType.currentText())
00593     phase          = str(self.comboPhase.currentText())
00594     pythonpath     = str(self.txtPythonPath.text())
00595     if pythonpath.strip() != '':
00596       sys.path =  map(string.strip, os.path.expandvars(pythonpath).split(';'))
00597       sys.path += self.__prefMan._rcPreferencesManager__pythonPath
00598     elogurl        = str(self.txtElogBookURL.text())
00599     server         = str(self.txtServer.text())
00600     if self.chkServerDisable.isChecked():
00601       servernbl    = 0
00602     else:
00603       servernbl    = 1
00604     prefs = {}
00605     prefs['reposdir'] = reposDir
00606     prefs['appdir']   = appDir
00607     prefs['datadir'] = dataDir
00608     prefs['logdir'] = logDir
00609     prefs['reportdir'] = reportDir
00610     prefs['fitsdir'] = fitsDir
00611     prefs['snapshotdir'] = snapshotDir
00612     prefs['exportdir'] = exportDir
00613     prefs['runiddir'] = runIdDir
00614     prefs['datasave'] = dataSave
00615     prefs['dataexport'] = dataExport
00616     prefs['fitsnbl'] = fitsnbl
00617     prefs['fitscompress'] = fitscompress
00618     prefs['snapnbl'] = snapnbl
00619     prefs['versionnbl'] = versionnbl
00620     prefs['elognbl'] = elognbl
00621     prefs['lognbl'] = lognbl
00622     prefs['loglevel'] = loglevel
00623     prefs['loghost'] = loghost
00624     prefs['logport'] = logport
00625     prefs['pythonpath'] = pythonpath
00626     prefs['elogurl'] = elogurl
00627     prefs['server'] = server
00628     prefs['servernbl'] = servernbl
00629     prefs['lastinstrumenttype'] = instrumentType
00630     prefs['lastphase'] = phase
00631     prefs['lastsite'] = site
00632     return prefs
00633
00634   def cancel(self):
00635     QDialog.done(self,QDialog.Rejected)
00636
00637   def default(self):
00638     self.reposEdit.setText(self.__prefMan.defPrefs()["reposdir"])
00639     self.scriptEdit.setText(self.__prefMan.defPrefs()["appdir"])
00640     self.dataEdit.setText(self.__prefMan.defPrefs()["datadir"])
00641     self.logEdit.setText(self.__prefMan.defPrefs()["logdir"])
00642     self.repEdit.setText(self.__prefMan.defPrefs()["reportdir"])
00643     self.fitsEdit.setText(self.__prefMan.defPrefs()["fitsdir"])
00644     self.snapshotEdit.setText(self.__prefMan.defPrefs()["snapshotdir"])
00645     self.exportEdit.setText(self.__prefMan.defPrefs()["exportdir"])
00646     self.runIdEdit.setText(self.__prefMan.defPrefs()["runiddir"])
00647     self.archiveDataBox.setChecked(int(self.__prefMan.defPrefs()["datasave"]))
00648     self.exportDataBox.setChecked(int(self.__prefMan.defPrefs()["dataexport"]))
00649     self.logMsgBox.setChecked(int(self.__prefMan.defPrefs()["lognbl"]))
00650     self.verbosityLevel.setCurrentText(self.__prefMan.defPrefs()["loglevel"])
00651     self.logHostEdit.setText(self.__prefMan.defPrefs()["loghost"])
00652     self.logPortEdit.setText(str(self.__prefMan.defPrefs()["logport"]))
00653     self.chkFITSoutput.setChecked(int(self.__prefMan.defPrefs()["fitsnbl"]))
00654     self.chkFITScompress.setChecked(int(self.__prefMan.defPrefs()["fitscompress"]))
00655     self.chkSnapshot.setChecked(int(self.__prefMan.defPrefs()["snapnbl"]))
00656     self.chkVersions.setChecked(int(self.__prefMan.defPrefs()["versionnbl"]))
00657     self.chkElogIntegration.setChecked(int(self.__prefMan.defPrefs()["elognbl"]))
00658
00659   def choosePath(self, lineEdit, caption):
00660     folder = QFileDialog.getExistingDirectory(self.__prefs.expandVars(str(lineEdit.text())), self, None, caption)
00661     folder = str(folder)
00662     if folder != '':
00663       lineEdit.setText(self.__prefs.composePath(folder))
00664
00665   def reposBrowser(self):
00666     self.choosePath(self.reposEdit, "Select repository path")
00667
00668   def appBrowser(self):
00669     self.choosePath(self.scriptEdit, "Select application path")
00670
00671   def dataBrowser(self):
00672     self.choosePath(self.dataEdit, "Select archive data file path")
00673
00674   def logBrowser(self):
00675     self.choosePath(self.logEdit, "Select log file path")
00676
00677   def repBrowser(self):
00678     self.choosePath(self.repEdit, "Select test report path")
00679
00680   def fitsBrowser(self):
00681     self.choosePath(self.fitsEdit, "Select FITS file path")
00682
00683   def snapshotBrowser(self):
00684     self.choosePath(self.snapshotEdit, "Select snapshot file path")
00685
00686   def exportBrowser(self):
00687     self.choosePath(self.exportEdit, "Select export repository path")
00688
00689   def runIdBrowser(self):
00690     self.choosePath(self.runIdEdit, "Select the runId.cfg path")
00691
00692
00693 if __name__ == "__main__":
00694   from RunControlCommon     import RunControlCommon
00695
00696   rcCommon = RunControlCommon()
00697   rcCommon.initialize()
00698   rcCommon.setLoggingLevel("INFO")
00699
00700   app = QApplication(sys.argv)
00701   QObject.connect(app,SIGNAL("lastWindowClosed()"),app,SLOT("quit()"))
00702
00703   m = rcCommon.prefMan()
00704   m.loadConfig()
00705   prefs = m.preferences()
00706   font = QApplication.font()
00707   if prefs.has_key('fontfamily'):
00708     font.setFamily(prefs['fontfamily'])
00709   if prefs.has_key('fontsize'):
00710     font.setPointSize(int(prefs['fontsize']))
00711   if prefs.has_key('fontweight'):
00712     font.setWeight(int(prefs['fontweight']))
00713   if prefs.has_key('fontitalic'):
00714     font.setItalic(int(prefs['fontitalic']))
00715   app.setFont(font)
00716
00717   if prefs.has_key('style'):
00718     style = prefs['style']
00719     if style in QStyleFactory.keys():
00720       app.setStyle(QStyleFactory.create(style))
00721
00722   prefGUI = rcCommon.prefGUI()
00723   app.setMainWidget(prefGUI)
00724   prefGUI.show()
00725   prefGUI.loadConfig()
00726   prefGUI.exec_loop()
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcPreferencesManager.py Source File

runcontrol

rcPreferencesManager.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Run Control Preferences manager GUI module"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/12/22 03:31:28 $").split(' ')[1]
00014 __version__  = "$Revision: 2.19 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import                sys
00021 import                os
00022 import                types
00023 import                re
00024 import                string
00025 import                logging.handlers
00026 from ConfigParser     import *
00027 from rcUsers          import rcUser, rcUsers
00028
00029 class rcPreferencesManager(object):
00030   def __init__(self, configFile):
00031     self.__prefs = Preferences()
00032     self.__configFile = configFile
00033     self.__pythonPath = sys.path
00034     self.__configFile = os.path.abspath(configFile)
00035     confParser = self.loadDefaults(os.getcwd())
00036     self.__defPrefs = self.parserToPrefs(confParser)
00037
00038   def loadConfig(self):
00039     confParser = ConfigParser()
00040     if os.path.exists(self.__configFile):
00041       confParser.read(self.__configFile)
00042     else:
00043       return None
00044
00045     self.parserToPrefs(confParser, self.__prefs)
00046     self.__prefs['fitsnbl'] = 0
00047     self.__prefs['fitscompress'] = 0
00048
00049     # Do not override the paths with default values anymore since the paths
00050     # may point to disconnected network drives.
00051     #
00052     #for dirname in Preferences.DIR_LIST:
00053     #  if not self.__prefs.has_key(dirname) or not os.path.isdir(self.__prefs[dirname]):
00054     #    self.__prefs[dirname] = self.__defPrefs[dirname]
00055
00056     for choice in (Preferences.CHOICE_LIST +
00057                    Preferences.LOGGING_LIST +
00058                    Preferences.SYSTEM_LIST):
00059       if not self.__prefs.has_key(choice):
00060         self.__prefs[choice] = self.__defPrefs[choice]
00061
00062     return 1
00063
00064   def writeConfig(self):
00065     confParser = self.prefsToParser()
00066     try:
00067       confParser.write(file(self.getConfigFile(), "w+"))
00068     except IOError, (errno, errdetail):
00069       print "*** rcPreferencesGUIImpl cannot save preferences to \'%s\': %s" \
00070             %(self.getConfigFile(), errdetail)
00071
00072   def preferences(self):
00073     return self.__prefs
00074
00075   def defPrefs(self):
00076     return self.__defPrefs
00077
00078   def getConfigFile(self):
00079     return self.__configFile
00080
00081   def refreshPrefs(self, newPrefs):
00082     for (key, val) in newPrefs.items():
00083       self.__prefs[key] = val
00084
00085   def setPref(self, keyword, value):
00086     self.__prefs[keyword] = value
00087
00088   def parserToPrefs(self, confParser, prefs={}):
00089     # don't overwrite existing users when loading prefs
00090     lastuser = None
00091     if 'users' in prefs:
00092       userList = prefs['users']
00093     else:
00094       userList = rcUsers()
00095     sections = confParser.sections()
00096     for section in sections:
00097       if section in ('paths', 'choices', 'logging', 'system'):
00098         options = confParser.options(section)
00099         for option in options:
00100           prefs[option] = confParser.get(section, option)
00101       elif section == 'users':
00102         options = confParser.options(section)
00103         for option in options:
00104           value = confParser.get(section, option).split(',',1)
00105           if len(value) == 2:
00106             # Must be login id and user name separated by comma.
00107             user = rcUser(option, value[0].strip(), value[1].strip())
00108           else:
00109             # No login id, set the login id to be the same as user name.
00110             user = rcUser(option, value[0].strip(), value[0].strip())
00111           if option == 'lastuser':
00112             lastuser = user
00113           else:
00114             userList.addUser(user)
00115       else:
00116         # again don't overwrite existing lists
00117         if section in prefs:
00118           optionList = prefs[section]
00119         else:
00120           optionList = {}
00121         options = confParser.options(section)
00122         for option in options:
00123           if option in Preferences.LAST_ITEMS:
00124             prefs[option] = confParser.get(section, option)
00125           else:
00126             optionList[confParser.get(section, option)] = option
00127         prefs[section] = optionList
00128     prefs['users'] = userList
00129     if lastuser is None:
00130       # Last user hasn't been set yet, use the first id available.
00131       userIds = prefs["users"].getUsers().keys()
00132       userIds.sort()
00133       if len(userIds) > 0:
00134         lastuser = userList.getUser(userIds[0])
00135     if lastuser is not None:
00136       # Get the real user object that contains the id.
00137       lastuser = userList.getUserByName(lastuser.getName())
00138       prefs["operatorobj"] = lastuser
00139       prefs["operator"] = lastuser.getName()
00140       prefs["userid"] = lastuser.getId()
00141
00142     # add _ROOT env vars to path: revisit
00143     if prefs.has_key('pythonpath'):
00144       additionalpaths = os.path.expandvars(prefs['pythonpath']).split(';')
00145       if prefs['pythonpath'].strip() != '':
00146         sys.path = map(string.strip, additionalpaths) + self.__pythonPath
00147     return prefs
00148
00149   def prefsToParser(self):
00150     prefs = self.__prefs
00151     confParser = ConfigParser()
00152     confParser.add_section("paths")
00153     confParser.add_section("choices")
00154     confParser.add_section("logging")
00155     confParser.add_section("users")
00156     confParser.add_section("system")
00157     for (option, value) in prefs.items():
00158       if option in Preferences.DIR_LIST:
00159         confParser.set("paths", option, prefs.get(option))
00160       elif option in Preferences.CHOICE_LIST:
00161         confParser.set("choices", option, str(prefs[option]))
00162       elif option in Preferences.LOGGING_LIST:
00163         confParser.set("logging", option, str(prefs[option]))
00164       elif option in Preferences.SYSTEM_LIST:
00165         confParser.set("system", option, prefs[option])
00166       elif option == 'users':
00167         for (userId, user) in value.getUsers().items():
00168           confParser.set("users", "%03d" % int(userId), "%s,%s" % (user.getLoginId(), user.getName()))
00169       elif option == 'operatorobj':
00170         confParser.set("users", "lastuser", "%s,%s" % (value.getLoginId(), value.getName()))
00171       elif type(value) == types.DictType:
00172         confParser.add_section(option)
00173         for (key, val) in value.items():
00174           confParser.set(option, val, key)
00175         if option == 'instrument type':
00176           self.processLastItem(option, 'lastinstrumenttype', confParser)
00177         elif option == 'phase':
00178           self.processLastItem(option, 'lastphase', confParser)
00179         elif option == 'site':
00180           self.processLastItem(option, 'lastsite', confParser)
00181         elif option == 'orientation':
00182           self.processLastItem(option, 'lastorientation', confParser)
00183         elif option == 'particle type':
00184           self.processLastItem(option, 'lastparticletype', confParser)
00185     return confParser
00186
00187
00188   def processLastItem(self, option, item, confParser):
00189     prefs = self.__prefs
00190     if prefs.has_key(item):
00191       last = prefs[item]
00192       if last == 'NOT-DEFINED':
00193         last = prefs.getLastItem(item)
00194       confParser.set(option, item, last)
00195
00196
00197   def loadDefaults(self, currentDir):
00198     cp = ConfigParser()
00199     cp.add_section("paths")
00200     cp.add_section("choices")
00201     cp.add_section("logging")
00202     cp.add_section("system")
00203     cp.set("paths","reposdir",currentDir)
00204     cp.set("paths","appdir",currentDir)
00205     cp.set("paths","datadir",currentDir)
00206     cp.set("paths","logdir",currentDir)
00207     cp.set("paths","reportdir",currentDir)
00208     cp.set("paths","fitsdir",currentDir)
00209     cp.set("paths","snapshotdir",currentDir)
00210     cp.set("paths","exportdir",currentDir)
00211     cp.set("paths","runiddir",currentDir)
00212     cp.set("choices","datasave","1")
00213     cp.set("choices","dataexport","1")
00214     cp.set("choices","fitsnbl","0")
00215     cp.set("choices","fitscompress","0")
00216     cp.set("choices","snapnbl","1")
00217     cp.set("choices","versionnbl","1")
00218     cp.set("choices","elognbl","0")
00219     cp.set("logging","lognbl","1")
00220     cp.set("logging","loglevel","INFO")
00221     cp.set("logging","loghost","localhost")
00222     cp.set("logging","logport",str(logging.handlers.DEFAULT_TCP_LOGGING_PORT))
00223     cp.set("system","pythonpath","")
00224     cp.set("system","elogurl","")
00225     cp.set("system","server","1")
00226     cp.set("system","servernbl","0")
00227     cp.set("system","dontreload","")
00228     cp.set("system","preload","")
00229     cp.set("system","disablereload","0")
00230     cp.set("system","showunloaded","0")
00231     cp.set("system","disableverification","0")
00232
00233     return cp
00234
00235   def isnumeric(self, str):
00236     return re.match('^[0-9]+$', str) is not None
00237
00238
00239   def setOperator(self, operator):
00240     operator = str(operator).strip()
00241     if operator == 'NOT-DEFINED':
00242       self.setPref("operator", operator)
00243       self.setPref("userid", '000')
00244     else:
00245       user = self.__prefs["users"].getUserByName(operator)
00246       self.setPref("operator", user.getName())
00247       self.setPref("operatorobj", user)
00248       self.setPref("userid", user.getId())
00249       self.writeConfig()
00250
00251   def setParticleType(self, particleType):
00252     self.setPref("lastparticletype", str(particleType))
00253     if particleType != 'NOT-DEFINED':
00254       self.writeConfig()
00255
00256   def setOrientation(self, orientation):
00257     self.setPref("lastorientation", str(orientation))
00258     if orientation != 'NOT-DEFINED':
00259       self.writeConfig()
00260
00261   def setSite(self, site):
00262     self.setPref("lastsite", str(site))
00263     if site != 'NOT-DEFINED':
00264       self.writeConfig()
00265
00266   def setPhase(self, phase):
00267     self.setPref("lastphase", str(phase))
00268     if phase != 'NOT-DEFINED':
00269       self.writeConfig()
00270
00271   def setInstrumentType(self, instrumentType):
00272     self.setPref("lastinstrumenttype", str(instrumentType))
00273     if instrumentType != 'NOT-DEFINED':
00274       self.writeConfig()
00275
00276
00277   def userId(self):
00278     if self.__prefs.has_key("userid"):
00279       return int(self.__prefs["userid"])
00280     else:
00281       return 1234
00282
00283
00284 class Preferences(dict):
00285   """\brief Preferences dictionary
00286   Preferences needs a special dictionary class since the data it stores
00287   may have macros and environment variables in it.
00288
00289   In order to read the values unprocessed use the self.__prefs.get(item)
00290   method. If you need to resolve all the macros and environment variables
00291   then access it like any other dictionary (self.__prefs[item])
00292
00293   """
00294   ROOT_DIR_ENVS = ['ONLINE_ROOT','INT_ROOT','ACD_ROOT','CAL_ROOT','TKR_ROOT','ELX_ROOT','LAT_ROOT','TRG_ROOT']
00295
00296   DIR_LIST = ("reposdir", "appdir", "datadir",
00297                 "logdir", "reportdir", "fitsdir",
00298                 "snapshotdir", "exportdir", "runiddir")
00299
00300   CHOICE_LIST = ("datasave", "dataexport", "fitsnbl", "fitscompress",
00301                  "snapnbl", "versionnbl", "elognbl")
00302
00303   LOGGING_LIST = ("lognbl", "loglevel", "loghost", "logport")
00304
00305   SYSTEM_LIST = ("pythonpath", "elogurl", "server", "servernbl",
00306                  "fontfamily", "fontsize", "fontweight", "fontitalic",
00307                  "style", "preload", "dontreload", "disablereload",
00308                  "showunloaded", "disableverification")
00309
00310   LAST_ITEMS = ("lastuser", "lastsite", "lastorientation", "lastparticletype",
00311                 "lastinstrumenttype", "lastphase")
00312
00313   TREAT_AS_INT = ("datasave", "dataexport", "fitsnbl", "fitscompress",
00314                  "snapnbl", "versionnbl", "elognbl", "lognbl", "servernbl",
00315                  "disablereload", "showunloaded", "logport", "disableverification")
00316
00317   def __init__(self):
00318     dict.__init__(self)
00319     self.__saveLastItem = {}
00320
00321   def __getitem__(self, item):
00322     value = dict.__getitem__(self, item)
00323     if self.isDir(item):
00324       return self.expandVars(value)
00325     elif self.isNumber(item):
00326       return int(value)
00327     else:
00328       return value
00329
00330   def __setitem__(self, item, value):
00331     if self.isLastItem(item) and value != 'NOT-DEFINED':
00332       self.__saveLastItem[item] = value
00333     dict.__setitem__(self, item, value)
00334
00335   def isDir(self, item):
00336     return item in Preferences.DIR_LIST
00337
00338   def isNumber(self, item):
00339     return item in Preferences.TREAT_AS_INT
00340
00341   def isLastItem(self, item):
00342     return item in Preferences.LAST_ITEMS
00343
00344   def expandVars(self, path):
00345     p = os.path.expandvars(path)
00346     dirs = os.path.normpath(p).split(os.sep)
00347     i = 0
00348     for d in dirs:
00349       if d.startswith('@') and d[1:] in dict.keys(self):
00350         dirs[i] = dict.get(self,d[1:])
00351
00352       if d.startswith('@') and d[1:] in dict.keys(self):
00353         if d[1:] == 'lastinstrumenttype':
00354           dirs[i] = dict.get(self,'instrument type')[dict.get(self,d[1:])]
00355         else:
00356           dirs[i] = dict.get(self,d[1:])
00357
00358       i+=1
00359     if not dirs[0].endswith(os.sep):
00360       dirs[0]+=os.sep
00361     return reduce(os.path.join, dirs)
00362
00363   def composePath(self, path):
00364     for env in Preferences.ROOT_DIR_ENVS:
00365       if env in os.environ:
00366         if os.path.normpath(path).lower().startswith(os.path.normpath(os.environ[env]).lower()):
00367           return '$' + env + path[len(os.environ[env]):]
00368     return path
00369
00370   def getLastItem(self, item):
00371     if item in self.__saveLastItem:
00372       return self.__saveLastItem[item]
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcPythonShell.py Source File

runcontrol

rcPythonShell.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Python shell class for RunControl"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2004/08/24 23:16:43 $").split(' ')[1]
00014 __version__  = "$Revision: 2.1 $"
00015 __credits__  = "SLAC"
00016
00017
00018 import LATTE.copyright_SLAC
00019
00020 import os, sys
00021 from code import InteractiveInterpreter as Interpreter
00022 from qt import *
00023
00024 class rcPythonShell(QWidget):
00025   def __init__(self,parent = None,name = None,fl = 0):
00026     QWidget.__init__(self,parent,name,fl)
00027
00028     if not name:
00029       self.setName("rcPythonShell")
00030
00031     self.__parent = parent
00032
00033     Form2Layout = QGridLayout(self,1,1,0,6,"Form2Layout")
00034
00035     self.__teShell = PythonShellWidget(locals=sys.modules['__main__'].__dict__, log='', parent=self)
00036
00037     Form2Layout.addWidget(self.__teShell,0,0)
00038
00039     self.languageChange()
00040
00041     self.resize(QSize(291,219).expandedTo(self.minimumSizeHint()))
00042
00043   def getParent(self):
00044     return self.__parent
00045
00046   def getWidget(self):
00047     return self.__teShell
00048
00049   def languageChange(self):
00050     self.setCaption(self.tr("rcPythonShell"))
00051
00052 class PythonShellWidget(QTextEdit):
00053   def __init__(self, locals=None, log='', parent=None):
00054     """Constructor.
00055
00056     The optional 'locals' argument specifies the dictionary in
00057     which code will be executed; it defaults to a newly created
00058     dictionary with key "__name__" set to "__console__" and key
00059     "__doc__" set to None.
00060
00061     The optional 'log' argument specifies the file in which the
00062     interpreter session is to be logged.
00063
00064     The optional 'parent' argument specifies the parent widget.
00065     If no parent widget has been specified, it is possible to
00066     exit the interpreter by Ctrl-D.
00067     """
00068
00069     QTextEdit.__init__(self, parent)
00070     self.interpreter = Interpreter(locals)
00071
00072     # session log
00073     self.log = log or ''
00074
00075     self.parent = parent
00076
00077     # to exit the main interpreter by a Ctrl-D if PyCute has no parent
00078     if os.name == 'nt' or os.name == 'dos':
00079       self.eofKey = Qt.Key_Z
00080     else:
00081       self.eofKey = Qt.Key_D
00082
00083     # last line + last incomplete lines
00084     self.line    = QString()
00085     self.lines   = []
00086     # the cursor position in the last line
00087     self.point   = 0
00088     # flag: the interpreter needs more input to run the last lines.
00089     self.more    = 0
00090     # flag: readline() is being used for e.g. raw_input() and input()
00091     self.reading = 0
00092     # history
00093     self.history = []
00094     self.pointer = 0
00095     self.xLast   = 0
00096     self.yLast   = 0
00097     self.clip = QApplication.clipboard()
00098
00099
00100     # user interface setup
00101     self.setTextFormat(QTextEdit.PlainText)
00102     self.setWrapPolicy(QTextEdit.Anywhere)
00103     self.setCaption('Python Shell')
00104     # font
00105     if os.name == 'posix':
00106       font = QFont("Fixed", 12)
00107     elif os.name == 'nt' or os.name == 'dos':
00108       font = QFont("Courier New", 8)
00109     else:
00110       raise SystemExit, "FIXME for 'os2', 'mac', 'ce' or 'riscos'"
00111     font.setFixedPitch(1)
00112     self.setFont(font)
00113
00114     # geometry
00115     height = 40*QFontMetrics(font).lineSpacing()
00116     request = QSize(600, height)
00117     if parent is not None:
00118       request = request.boundedTo(parent.size())
00119     self.resize(request)
00120
00121     # interpreter prompt.
00122     try:
00123       sys.ps1
00124     except AttributeError:
00125       sys.ps1 = ">>> "
00126     try:
00127       sys.ps2
00128     except AttributeError:
00129       sys.ps2 = "... "
00130
00131     # interpreter banner
00132     self.write('Python shell running Python %s on %s.\n' %
00133                 (sys.version, sys.platform))
00134     self.write('Type "copyright", "credits" or "license"'
00135                 ' for more information on Python.\n')
00136     self.write(sys.ps1)
00137
00138     self.connect(self, SIGNAL("clicked(int,int)"), self.handleClicked)
00139
00140   def redirectIO(self):
00141     # capture all interactive input/output
00142     sys.stdout   = self
00143     sys.stderr   = self
00144     sys.stdin    = self
00145
00146   def restoreIO(self):
00147     # restore all interactive input/output to their original values
00148     sys.stdout   = sys.__stdout__
00149     sys.stderr   = sys.__stderr__
00150     sys.stdin    = sys.__stdin__
00151
00152   def flush(self):
00153     """
00154     Simulate stdin, stdout, and stderr.
00155     """
00156     pass
00157
00158   def isatty(self):
00159     """
00160     Simulate stdin, stdout, and stderr.
00161     """
00162     return 1
00163
00164   def readline(self):
00165     """
00166     Simulate stdin, stdout, and stderr.
00167     """
00168     self.reading = 1
00169     self.__clearLine()
00170     self.moveCursor(QTextEdit.MoveEnd, 0)
00171     while self.reading:
00172       qApp.processOneEvent()
00173     if self.line.length() == 0:
00174       return '\n'
00175     else:
00176       return str(self.line)
00177
00178   def write(self, text):
00179     """
00180     Simulate stdin, stdout, and stderr.
00181     """
00182     # The output of self.append(text) contains to many newline characters,
00183     # so work around QTextEdit's policy for handling newline characters.
00184     hack = self.text()
00185     hack.append(text)
00186     self.setText(hack)
00187     #self.setText(self.text().append(text)) # segmentation fault
00188     self.moveCursor(QTextEdit.MoveEnd, 0)
00189     self.yLast, self.xLast = self.getCursorPosition()
00190
00191   def writelines(self, text):
00192     """
00193     Simulate stdin, stdout, and stderr.
00194     """
00195     map(self.write, text)
00196     print "DO WE EVER GET HERE? IF YES, OPTIMIZATION POSSIBLE"
00197
00198   def fakeUser(self, lines):
00199     """
00200     Simulate a user: lines is a sequence of strings, (Python statements).
00201     """
00202     for line in lines:
00203       self.line = QString(line.rstrip())
00204       self.write(self.line)
00205       self.write('\n')
00206       self.__run()
00207
00208   def __run(self):
00209     """
00210     Append the last line to the history list, let the interpreter execute
00211     the last line(s), and clean up accounting for the interpreter results:
00212     (1) the interpreter succeeds
00213     (2) the interpreter fails, finds no errors and wants more line(s)
00214     (3) the interpreter fails, finds errors and writes them to sys.stderr
00215     """
00216     self.pointer = 0
00217     self.history.append(QString(self.line))
00218     self.lines.append(str(self.line))
00219     source = '\n'.join(self.lines)
00220     self.redirectIO()
00221     self.more = self.interpreter.runsource(source)
00222     self.restoreIO()
00223     if self.more:
00224       self.write(sys.ps2)
00225     else:
00226       self.write(sys.ps1)
00227       self.lines = []
00228     self.__clearLine()
00229
00230   def __clearLine(self):
00231     """
00232     Clear input line buffer
00233     """
00234     self.line.truncate(0)
00235     self.point = 0
00236
00237   def __insertText(self, text):
00238     """
00239     Insert text at the current cursor position.
00240     """
00241     y, x = self.getCursorPosition()
00242     self.insertAt(text, y, x)
00243     self.line.insert(self.point, text)
00244     self.point += text.length()
00245     self.setCursorPosition(y, x + text.length())
00246
00247   def keyPressEvent(self, e):
00248     """
00249     Handle user input a key at a time.
00250     """
00251     text  = e.text()
00252     key   = e.key()
00253     ascii = e.ascii()
00254
00255     if text.length() and ascii>=32 and ascii<127:
00256       self.__insertText(text)
00257       return
00258
00259     if e.state() & Qt.ControlButton and key == self.eofKey:
00260       if self.parent is None:
00261         try:
00262           file = open(self.log, "w")
00263           file.write(str(self.text()))
00264           file.close()
00265         except:
00266           pass
00267         sys.exit()
00268       else:
00269         self.restoreIO()
00270         self.parent.getParent().hide()
00271       return
00272
00273     if e.state() & Qt.ControlButton or e.state() & Qt.ShiftButton:
00274       e.ignore()
00275       return
00276
00277     if key == Qt.Key_Backspace:
00278       if self.point:
00279         self.doKeyboardAction(QTextEdit.ActionBackspace)
00280         self.point -= 1
00281         self.line.remove(self.point, 1)
00282     elif key == Qt.Key_Delete:
00283       self.doKeyboardAction(QTextEdit.ActionDelete)
00284       self.line.remove(self.point, 1)
00285     elif key == Qt.Key_Return or key == Qt.Key_Enter:
00286       self.write('\n')
00287       if self.reading:
00288         self.reading = 0
00289       else:
00290           self.__run()
00291     elif key == Qt.Key_Tab:
00292       self.__insertText(text)
00293     elif key == Qt.Key_Left:
00294       if self.point:
00295         self.moveCursor(QTextEdit.MoveBackward, 0)
00296         self.point -= 1
00297     elif key == Qt.Key_Right:
00298       if self.point < self.line.length():
00299         self.moveCursor(QTextEdit.MoveForward, 0)
00300         self.point += 1
00301     elif key == Qt.Key_Home:
00302       self.setCursorPosition(self.yLast, self.xLast)
00303       self.point = 0
00304     elif key == Qt.Key_End:
00305       self.moveCursor(QTextEdit.MoveLineEnd, 0)
00306       self.point = self.line.length()
00307     elif key == Qt.Key_Up:
00308       if len(self.history):
00309         if self.pointer == 0:
00310           self.pointer = len(self.history)
00311         self.pointer -= 1
00312         self.__recall()
00313     elif key == Qt.Key_Down:
00314       if len(self.history):
00315         self.pointer += 1
00316         if self.pointer == len(self.history):
00317           self.pointer = 0
00318         self.__recall()
00319     elif key == Qt.Key_Escape:
00320       self.__deleteLine()
00321     else:
00322       e.ignore()
00323
00324   def __deleteLine(self):
00325     self.setCursorPosition(self.yLast, self.xLast)
00326     self.setSelection(self.yLast, self.xLast,
00327                       self.yLast, self.paragraphLength(self.yLast))
00328     self.removeSelectedText()
00329     self.__clearLine()
00330
00331   def __recall(self):
00332     """
00333     Display the current item from the command history.
00334     """
00335     self.__deleteLine()
00336     self.__insertText(self.history[self.pointer])
00337
00338
00339   def focusNextPrevChild(self, next):
00340     """
00341     Suppress tabbing to the next window in multi-line commands.
00342     """
00343     if next and self.more:
00344       return 0
00345     return QTextEdit.focusNextPrevChild(self, next)
00346
00347   def handleClicked(self, para, pos):
00348     """
00349     Keep the cursor after the last prompt.
00350     """
00351     if self.hasSelectedText():
00352       if len(self.selectedText()) > 0:
00353         self.clip.setText(self.selectedText())
00354     self.moveCursor(QTextEdit.MoveEnd, 0)
00355     return
00356
00357   def contentsContextMenuEvent(self,ev):
00358     """
00359     Suppress the right button context menu.
00360     Instead paste the contents of the clipboard.
00361     """
00362     self.__insertText(self.clip.text())
00363     ev.accept()
00364     return
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcReportGen.py Source File

runcontrol

rcReportGen.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Run report generator class for RunControl"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "02/10/2003"
00014 __version__  = "$Revision: 2.13 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import os
00020 import logging as log
00021 import time
00022 import calendar
00023 import cStringIO
00024
00025 from xml.sax.saxutils  import XMLGenerator
00026 from xml.parsers.expat import ParserCreate
00027
00028 from qt    import Qt, QVariant, QDate, QDateTime
00029 from qtsql import QSqlDatabase, QSqlCursor
00030
00031 UNITS_INT    = 0
00032 UNITS_LONG   = 1
00033 UNITS_FLOAT  = 2
00034 UNITS_STRING = 3
00035 UNITS_LIST   = 4
00036 UNITS_DICT   = 5
00037
00038 UNIT_MAP = {
00039             'OperatorId'      : UNITS_LONG,
00040             'EventCount'      : UNITS_LONG,
00041             'BadEventCount'   : UNITS_LONG,
00042             'ErrorEventCount' : UNITS_LONG,
00043             'PauseCount'      : UNITS_INT,
00044             'ElapsedTime'     : UNITS_FLOAT,
00045             'CompletionStatus': UNITS_INT,
00046            }
00047
00048 # Shift Dictionary
00049 SHIFT_DICT =  { 0: ("T00:00:00", "T08:00:00", "Owl"),
00050                 1: ("T08:00:00", "T16:00:00", "Day"),
00051                 2: ("T16:00:00", "T00:00:00", "Swing")
00052               }
00053
00054 class rcReportGen(object):
00055   def __init__(self, fileName="rcReport.out", prefs=None):
00056     self.__fileName  = fileName
00057     self.__prefs     = prefs
00058     if prefs is not None:
00059       self.__elognbl   = int(prefs["elognbl"])
00060     else:
00061       self.__elognbl   = 0
00062
00063
00064   def initialize(self, tstamp=None):
00065     self.__tstamp = tstamp
00066     self.__repFields = []
00067     self.__repData = []
00068     self.__repUnits = []
00069     if self.__elognbl:
00070       self.__sqldriver = 'QMYSQL3'
00071       if 'ELOGBOOK_DB' in os.environ:
00072         dbname = os.environ['ELOGBOOK_DB']
00073       else:
00074         dbname = 'elogbook'
00075       if QSqlDatabase.isDriverAvailable(self.__sqldriver):
00076         self.__db = QSqlDatabase.addDatabase(self.__sqldriver)
00077         if not self.connectDB(dbname):
00078           log.error("Error opening database %s"
00079                     " disabling Elogbook integration" % dbname)
00080           log.error(str(self.__db.lastError().text()))
00081           self.__elognbl = 0
00082         else:
00083           log.debug("Database %s opened successfully" % dbname)
00084       else:
00085         log.error("The SQL driver %s is not available,"
00086                   " disabling Elogbook integration" % self.__sqldriver)
00087         self.__elognbl = 0
00088
00089   def connectDB(self, dbname):
00090     if 'ELOGBOOK_HOST' in os.environ:
00091       host = os.environ['ELOGBOOK_HOST']
00092     else:
00093       host = 'localhost'
00094     self.__db.setHostName(host)
00095     self.__db.setUserName('elogbook')
00096     self.__db.setPassword('elogbook')
00097     self.__db.setDatabaseName(dbname)
00098     return self.__db.open()
00099
00100   def disconnectDB(self):
00101     return self.__db.close()
00102
00103   def addField(self, field, data, units=UNITS_STRING):
00104     if field == 'TimeStamp':
00105       self.__tstamp = data
00106     else:
00107       self.__repFields.append(field)
00108       self.__repData.append(data)
00109       self.__repUnits.append(units)
00110
00111   def writeReportCSV(self):
00112     if not os.path.exists(self.__fileName):
00113       f = file(self.__fileName, 'w+')
00114       i = 0
00115       for header in self.__repFields:
00116         f.write(header)
00117         i = i + 1
00118         if i < len(self.__repFields):
00119           f.write(',')
00120       f.write('\n')
00121
00122     f = file(self.__fileName, 'a+')
00123     i = 0
00124     for data in self.__repData:
00125       f.write('"'+data+'"')
00126       i = i + 1
00127       if i < len(self.__repData):
00128         f.write(',')
00129     f.write('\n')
00130     f.close()
00131
00132   def writeReportXML(self):
00133     if not os.path.exists(self.__fileName):
00134       f = file(self.__fileName, 'w+')
00135       newReportFile = 1
00136     else:
00137       f = file(self.__fileName, 'a+')
00138       newReportFile = 0
00139
00140     result = cStringIO.StringIO()
00141     gen = XMLGenerator(result)
00142     if newReportFile:
00143       gen.startDocument()
00144     if self.__tstamp is None:
00145       self.__tstamp = time.gmtime()
00146     self.__tstamp = str(self.__tstamp)
00147     gen.startElement("testReport", {'timestamp': self.__tstamp})
00148     i = 0
00149     for header in self.__repFields:
00150       gen.startElement(header,{})
00151       gen.characters(self.__repData[i])
00152       gen.endElement(header)
00153       i = i + 1
00154     gen.endElement("testReport")
00155     if newReportFile:
00156       gen.endDocument()
00157     f.write(result.getvalue()+'\n')
00158     f.close()
00159     if self.__elognbl:
00160       if self.writeReportSQL() == 0:
00161         self.addShift(self.__tstamp)
00162       self.disconnectDB()
00163
00164   def writeReportSQL(self):
00165     fieldMap = {'RunId': 'RunID',
00166                 'OperatorId': 'OperatorID'
00167                }
00168
00169     dateFields = ['TimeStamp', 'StartTime', 'EndTime']
00170
00171     self.__repFields.append('TimeStamp')
00172     self.__repData.append(self.__tstamp)
00173     table = "elogreport"
00174     cur = QSqlCursor(table)
00175     fields = [f.name() for f in self.__db.recordInfo(table)]
00176     recBuffer = cur.primeInsert()
00177     additional = ""
00178     for i in range(len(self.__repFields)):
00179       field = self.__repFields[i]
00180       if field in fieldMap:
00181         field = fieldMap[field]
00182       if field in dateFields:
00183         t = eval(self.__repData[i])
00184         value = "%04d-%02d-%02d %02d:%02d:%02d" % (t[0], t[1], t[2], t[3], t[4], t[5])
00185       else:
00186         value = self.__repData[i]
00187       if field in fields:
00188         recBuffer.setValue(field, QVariant(value))
00189       else:
00190         # Tue Mar 15 14:05:15 2005: RiC debug log commented out.
00191         #log.debug("Can not find field %s in table %s. Adding it to the 'Additional Fields' column."
00192         #         % (field, table))
00193         additional = additional + field + "???" + value + "!!!"
00194       if additional != "":
00195         recBuffer.setValue("AdditionFields", QVariant(additional))
00196     if cur.insert() != 1:
00197       log.error("Could not insert elogreport record, dumping field data:")
00198       for i in range(len(self.__repFields)):
00199         log.error("\t%s\t\t\t%s" % (self.__repFields[i], self.__repData[i]))
00200       log.error("SQL Error text: %s", str(cur.lastError().text()))
00201       return -1
00202     return 0
00203
00204   def readReportXML(self):
00205     # 3 handler functions
00206     def start_element(name, attrs):
00207       #print 'Start element:', str(name), attrs
00208       self.__data = ''
00209       if str(name) == 'testReport':
00210         self.__tstamp = str(attrs['timestamp'])
00211         self.__repFields.append('TimeStamp')
00212         self.__repData.append(self.__tstamp)
00213         self.__repUnits.append(UNITS_STRING)
00214       else:
00215         self.__repFields.append(str(name))
00216     def end_element(name):
00217       #print 'End element:', str(name)
00218       name = str(name)
00219       if name != 'testReport':
00220         self.__repData.append(self.__data)
00221         if name in UNIT_MAP:
00222           self.__repUnits.append(UNIT_MAP[name])
00223         else:
00224           self.__repUnits.append(UNITS_STRING)
00225     def char_data(data):
00226       #print 'Character data:', str(data)
00227       if self.__data is not None:
00228         self.__data += str(data)
00229     def external_entity_ref_handler(context,base,systemId,publicId):
00230       subParser = p.ExternalEntityParserCreate(context)
00231       subParser.StartElementHandler = start_element
00232       subParser.EndElementHandler = end_element
00233       subParser.CharacterDataHandler = char_data
00234       subParser.ParseFile(file(systemId))
00235       return 1
00236     self.__data = None
00237     p = ParserCreate()
00238     p.ExternalEntityRefHandler = external_entity_ref_handler
00239     p.Parse("""<!DOCTYPE report [<!ENTITY reportfile SYSTEM \""""+self.__fileName+"""\">
00240             ]><report>&reportfile;</report>""")
00241
00242   def getReportFields(self):
00243     return self.__repFields
00244
00245   def getReportData(self):
00246     return self.__repData
00247
00248   def getReportUnits(self):
00249     return self.__repUnits
00250
00251   def getTimestamp(self):
00252     return self.__tstamp
00253
00254   def addShift(self,tstamp):
00255     (shiftID, startLocal, endLocal, type) = self.getShiftInfo(eval(tstamp))
00256     dateTime    = QDateTime().currentDateTime()
00257     timeStamp   = self.obtainGMTime(dateTime)
00258     # Shift Cursor
00259     shiftFilter = "ShiftID='" + str(shiftID) + "'"
00260     shiftCursor = self.obtainCursor("elogshiftsummary", shiftFilter)
00261     # If there are no records, create a new one
00262     if not shiftCursor.isValid():
00263       cursorBuffer = shiftCursor.primeInsert()
00264       cursorBuffer.setValue("ShiftID",    QVariant(shiftID))
00265       cursorBuffer.setValue("ShiftType",  QVariant(type))
00266       cursorBuffer.setValue("StartTime",  QVariant(startLocal))
00267       cursorBuffer.setValue("EndTime",    QVariant(endLocal))
00268       cursorBuffer.setValue("LastUpdate", QVariant(timeStamp))
00269       count = shiftCursor.insert()
00270       log.debug("rcReportGen: Added new shift id: %s, type: %s, startLocal: %s, endLocal: %s, timestamp: %s for run timestamp: %s"
00271                 % (shiftID, type, startLocal, endLocal, timeStamp, tstamp))
00272       log.debug("rcReportGen: Inserted record count: %d" % count)
00273       log.debug("rcReportGen: Last error: %s" % str(shiftCursor.lastError().text()))
00274       shiftCursor.update()
00275       #print "New Shift Type: ", type
00276       #print "New Shift Start: ", startLocal
00277       #print "New Shift End: ", endLocal
00278       #print "New Shift Last Update: ", timeStamp
00279       return True
00280     else:
00281       #print "Shift for run: ", tstamp, " already exists in the database."
00282       pass
00283
00284
00285   def getShiftInfo(self,t):
00286     #print "Timestamp=", t
00287     timeStampGMT = self.convertTimeTuple(t)
00288     timeStampLocal = self.obtainLocalTime(timeStampGMT)
00289     QTimeStampLocal = QDateTime.fromString(timeStampLocal, Qt.ISODate)
00290     #print "Run timestamp GMT: ", timeStampGMT, "Run timestamp Local: ", timeStampLocal
00291     timeStamp = timeStampLocal.split('T')
00292     date = timeStamp[0]
00293     time = timeStamp[1]
00294     #print "Date:", date, "Time:", time
00295     #Obtain End Date (Local)
00296     startQDate = QDate().fromString(date, Qt.ISODate)
00297     endQDate   = startQDate.addDays(1)
00298     endDate    = str(endQDate.toString(Qt.ISODate))
00299     #print "End Date: ", endDate
00300     # Date tag for ShiftID
00301     dateList = date.split('-')
00302     dateTag = dateList[0] + dateList[1] + dateList[2]
00303     #print "Date Tag: ", dateTag
00304     # If run timeStamp is within shift obtain ShiftID
00305     for shift in SHIFT_DICT:
00306       (startT, endT, type) = SHIFT_DICT[shift]
00307       startLocal = date + startT
00308       if shift == 2:
00309         endLocal = endDate + endT
00310       else:
00311         endLocal = date + endT
00312       startQDateTime = QDateTime.fromString(startLocal, Qt.ISODate)
00313       endQDateTime   = QDateTime.fromString(endLocal,   Qt.ISODate)
00314       # The Core Code:
00315       # secsTo Returns the number of seconds from this datetime1 to (datetime2)
00316       # which is negative if dt is earlier than this datetime).
00317       # Example: datetime1.secsTo(datetime2) > 0 if datetime2 is later than datetime1
00318       secsToStartTime = startQDateTime.secsTo(QTimeStampLocal)
00319       secsToEndTime   = endQDateTime.secsTo(QTimeStampLocal)
00320       #print "Shift: ", shift, "Start: ", startLocal, " End: ", endLocal
00321       #print "Shift: ", shift, "Secs To Start: ", secsToStartTime, "Secs To End: ", secsToEndTime
00322       if secsToStartTime >= 0 and secsToEndTime <= 0:
00323         shiftID    = dateTag + str(shift)
00324         return (shiftID, startLocal, endLocal, type)
00325
00326   def obtainLocalTime(self, dateTime):
00327     dateTime = str(dateTime)
00328     splitTime = dateTime.split('T')
00329     #print dateTime, splitTime
00330     dateTime = splitTime[0] + splitTime[1]
00331     timeStamp = time.strptime(dateTime, "%Y-%m-%d%H:%M:%S")
00332     localTimeTuple = time.localtime(calendar.timegm(timeStamp))
00333     localTime = self.convertTimeTuple(localTimeTuple)
00334     return localTime
00335
00336   def obtainGMTime(self, dateTime):
00337     dateTime = str(dateTime.toString(Qt.ISODate))
00338     splitTime = dateTime.split('T')
00339     dateTime = splitTime[0] + splitTime[1]
00340     timeStamp = time.strptime(dateTime, "%Y-%m-%d%H:%M:%S")
00341     gmTimeTuple = time.gmtime(time.mktime(timeStamp))
00342     gmTime = self.convertTimeTuple(gmTimeTuple)
00343     return gmTime
00344
00345   def convertTimeTuple(self, timeTuple):
00346     timeStamp =  "%04d" % timeTuple[0] + "-" + \
00347                  "%02d" % timeTuple[1] + "-" + \
00348                  "%02d" % timeTuple[2] + "T" + \
00349                  "%02d" % timeTuple[3] + ":" + \
00350                  "%02d" % timeTuple[4] + ":" + \
00351                  "%02d" % timeTuple[5]
00352     return timeStamp
00353
00354   def obtainCursor(self, table, filter):
00355     shiftCursor = QSqlCursor(table, True, self.__db)
00356     shiftCursor.setFilter(filter)
00357     shiftCursor.select()
00358     shiftCursor.next()
00359     return shiftCursor
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcRunIdHelper.py Source File

runcontrol

rcRunIdHelper.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Utility class to set and retrieve run id"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2004/11/05 00:41:27 $").split(' ')[1]
00014 __version__  = "$Revision: 2.2 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 from ConfigParser import *
00020 import os
00021
00022 class rcRunIdHelper(object):
00023   SECTION_M = 'MachineData'
00024   SECTION_R = 'RunIdData'
00025   OPTION_MID = 'machineid'
00026   OPTION_RID = 'runid'
00027
00028   def __init__(self, prefs):
00029     self.__parser = ConfigParser()
00030
00031     if 'runiddir' in prefs:
00032       self.configFile = os.path.join(prefs['runiddir'], 'runId.cfg')
00033     else:
00034       raise RuntimeError, "Preference file doesn't specify runId location"
00035
00036     if os.path.exists(self.configFile):
00037       self.__parser.read(self.configFile)
00038     else:
00039       errorMsg = self.configFile + " not found. "
00040       errorMsg += "Did you forget to copy it from a previous installation or from runId.cfg.sample?"
00041       raise RuntimeError, errorMsg
00042
00043   def currentRunId(self):
00044     rid = -1
00045     mid = -1
00046     try:
00047       mid = int(self.__parser.get(self.SECTION_M, self.OPTION_MID))
00048       rid = int(self.__parser.get(self.SECTION_R, self.OPTION_RID))
00049     except:
00050       pass
00051
00052     if mid == -1 or rid == -1:
00053       return '-1'
00054     else:
00055       return ('%03d%06d' % (mid, rid))
00056
00057   def nextRunId(self):
00058     rid = -1
00059     mid = -1
00060     try:
00061       mid = int(self.__parser.get(self.SECTION_M, self.OPTION_MID))
00062       rid = int(self.__parser.get(self.SECTION_R, self.OPTION_RID))
00063     except:
00064       pass
00065
00066     if mid == -1 or rid == -1:
00067       return '-1'
00068     else:
00069       if mid == 0:
00070         errorMsg = self.configFile + " has an invalid machine id. "
00071         errorMsg += "Please choose a valid and unique id for your subsystem and this teststand "
00072         errorMsg += "and enter it in this file (See runId.cfg.sample file in the same directory for "
00073         errorMsg += "subsystem allocation of machine ids)."
00074         raise RuntimeError, errorMsg
00075       else:
00076         rid +=1
00077         self.__parser.set(self.SECTION_R, self.OPTION_RID, str(rid))
00078         self.__parser.write(file(self.configFile, "w+"))
00079         return ('%03d%06d' % (mid, rid))
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcScmCfgSelector.py Source File

runcontrol

rcScmCfgSelector.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT finite state transistions classes"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2004/08/24 23:16:43 $").split(' ')[1]
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import qt
00021
00022 #  This class puts up a GUI for getting the SchemaConfig file to use.
00023 class rcScmCfgSelector(qt.QFileDialog):
00024   "GUI for getting the SchemaConfig file to use."
00025   def __init__(self, startwithDir, startwithFile, parent = None, name = None, fl = 0):
00026     qt.QFileDialog.__init__(self, parent, name, fl)
00027
00028     self.setMode(qt.QFileDialog.ExistingFile)
00029     self.setFilter("(*.xml)")
00030     if startwithDir is not None:
00031       self.setDir(startwithDir)
00032     self.setCaption("Choose a schema/configuration file")
00033     if startwithFile is not None:
00034       self.setSelection(startwithFile)
00035
00036     if self.exec_loop() == qt.QDialog.Accepted:
00037       self.__value = str(self.selectedFile())
00038     else:
00039       self.__value = None
00040
00041   def getValue(self):
00042     return self.__value
00043
00044 class rcScmCfgSelText(object):
00045   "Text user interface for getting the user to a SchemaConfig file"
00046   def __init__(self, startwith):
00047     self.__startwith = startwith
00048
00049   def getValue(self):
00050     startwith = self.__startwith
00051     if startwith is None:
00052       startwith = ''
00053     answer = raw_input("Choose a schema/configuration file [%s]: " % startwith)
00054     if answer == '':
00055       answer = self.__startwith
00056     return answer
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcSecurityMan.py Source File

runcontrol

rcSecurityMan.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Security Manager for RunControl"
00012 __author__   = "S. Tuvi <STuvi@SLAC.Stanford.edu>"
00013 __date__     = ("$Date: 2005/01/10 21:18:16 $").split(' ')[1]
00014 __version__  = "$Revision: 2.5 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import os
00021 from struct       import calcsize, pack, unpack
00022 #from binascii     import hexlify
00023 #import md5
00024 import sys
00025 import logging as log
00026 from ConfigParser import ConfigParser
00027 import sha, random, base64
00028
00029 class rcSecurityMan(object):
00030   """Security Manager class that contains
00031   user authentication and rights management routines.
00032   """
00033   def __init__(self, secureDir, users):
00034     self.__secureDir = secureDir
00035     self.__users = users
00036     self.__passwords = os.path.join(self.__secureDir, "passwords")
00037     self.__security = os.path.join(self.__secureDir, "security.cfg")
00038     self.__fmt = "40s 256s 32s 40s h"
00039     self.__roles = {}
00040     self.__permissions = {}
00041
00042   def readPermissions(self):
00043     """Read permissions from the security.cfg file
00044     and update user objects.
00045     """
00046     if os.access(self.__passwords,os.O_RDONLY):
00047       permParser = ConfigParser()
00048       permParser.read(self.__security)
00049       pUsers = permParser.options("users")
00050       for loginId in pUsers:
00051         user = self.__users.getUserByLoginId(loginId)
00052         if user is not None:
00053           roles = permParser.get("users", loginId).split(", ")
00054           for role in roles:
00055             user.addRole(role)
00056             if role not in self.__roles:
00057               self.__roles[role] = []
00058             if role == 'administrator': continue
00059             if not permParser.has_option("roles", role):
00060               log.warn("No permissions defined for role %s" % role)
00061             else:
00062               permissions = permParser.get("roles", role).split(", ")
00063               for permission in permissions:
00064                 if not permParser.has_option("permissions", permission):
00065                   log.warn("Permission %s is not in the security database" % permission)
00066                 else:
00067                   permDesc = permParser.get("permissions", permission)
00068                   user.addPermission(permission)
00069                   if permission not in self.__roles[role]:
00070                     self.__roles[role].append(permission)
00071                     if permission not in self.__permissions:
00072                       self.__permissions[permission] = permDesc
00073                     else:
00074                       log.warn("Permission %s has already been defined." % permission)
00075
00076         # Add the roles and permissions which do not belong to any user
00077         for role in permParser.options("roles"):
00078           if role not in self.__roles:
00079             self.__roles[role] = []
00080             permissions = permParser.get("roles", role).split(", ")
00081             for permission in permissions:
00082               if permission in permParser.options("permissions"):
00083                 self.__roles[role].append(permission)
00084         for permission in permParser.options("permissions"):
00085           if permission not in self.__permissions:
00086             self.__permissions[permission] = permParser.get("permissions", permission)
00087
00088
00089   def registerPermission(self, role, permission, permDesc):
00090     """Method available to be called by a user script that
00091     allows the script to register a permission given a role
00092     and update any user permissions who belong in that role
00093
00094     \param role       Role name for the \a permission to be included.
00095     \param permission Permission name.
00096     \param permDesc   Permission description
00097     """
00098     if self.roleHasPermission(role, permission):
00099       log.warn("Permission %s already exists in role %s" % (permission, role))
00100     else:
00101       if permission not in self.__permissions:
00102         self.__permissions[permission] = permDesc
00103       for user in self.__users:
00104         if role in user.getRoles():
00105           if permission not in user.getPermissions():
00106             user.addPermission(permission)
00107
00108   def checkPermission(self, user, permission):
00109     """Checks if the user has been granted the specified permission
00110
00111     \param user       rcUser object instance
00112     \param permission Permission name
00113
00114     \return True:  If the \a user is granted the \a permission
00115             False: Otherwise
00116     """
00117     return (permission in user.getPermissions())
00118
00119   def roleHasPermission(self, role, permission):
00120     """Check if \a permission exists in \a role.
00121
00122     \param role Role name
00123     \param permission Permission name
00124
00125     \return True:  If \a role has \a permission.
00126             False: otherwise.
00127     """
00128     return (permission in self.__roles[role])
00129
00130   def getPermissions(self, role=None):
00131     """Returns the list of all permissions defined.
00132     If \a role has been specified then returns
00133     all permissions defined for that role.
00134
00135     \param role Role name
00136
00137     \return List of sll permissions or permissions for the specified role
00138     """
00139     if role is not None:
00140       return self.__roles[role]
00141     else:
00142       return self.__permissions.keys()
00143
00144   def getPermissionDescription(self, permission):
00145     """Returns the description for the specified permission.
00146     If permission does not exist, returns None.
00147
00148     \param permission Permission name
00149
00150     \return Permission description string
00151     """
00152     if permission in self.__permissions:
00153       return self.__permissions[permission]
00154
00155   def getRoles(self):
00156     """Returns the list of all roles defined.
00157
00158     \return List of all roles.
00159     """
00160     return self.__roles.keys()
00161
00162   def authenticateUser(self, loginId, password):
00163     """Authenticate the user based on the given login id and password.
00164
00165     \param loginId  User's login id
00166     \param password User's password
00167
00168     \return -1: User authentication failed, invalid user id or password
00169             -2: Password database is not accessible
00170              0: Access granted
00171     """
00172     openFlag = os.O_RDONLY
00173     if sys.platform =='win32':
00174       openFlag|=os.O_BINARY
00175     if os.access(self.__passwords,os.O_RDONLY):
00176       fd = os.open(self.__passwords,openFlag)
00177     else:
00178       log.debug("Password database is not accessible.")
00179       return -2
00180
00181     #md5sum = md5.new()
00182     user_name = "Nothing"
00183     user_home = "Nothing"
00184     user_login = loginId
00185     user_password = password
00186     #md5sum.update(user_password)
00187     #user_passhash = hexlify(md5sum.digest())
00188     user_passhash="Nothing"
00189     user_attempts = 0
00190     user_sizeof = calcsize(self.__fmt)
00191     user_data = pack(self.__fmt,user_name,user_home,user_login,user_passhash,user_attempts)
00192     while len(user_data) == user_sizeof:
00193       user_data = os.read(fd,user_sizeof)
00194       if len(user_data) == user_sizeof:
00195         (u_name,u_home,u_login,u_passhash,u_attempts) = unpack(self.__fmt,user_data)
00196         #print "<%s><%s><%s><%s>" % (u_login, user_login, u_passhash, user_passhash)
00197         if u_login.strip('\0 ') == user_login.strip() and self.__check(u_passhash, user_password):
00198           log.debug("Access Granted to user with the login id=%s" % loginId)
00199           os.close(fd)
00200           return 0
00201     log.debug("User authentication failed, loginId=%s" % loginId)
00202     os.close(fd)
00203     return -1
00204
00205
00206   def changePassword(self, loginId, password, userName, oldPassword=""):
00207     """Change an existing user's password.
00208
00209     \param loginId     User's login id
00210     \param password    The new password for the user
00211     \param userName    User's full name
00212     \param oldPassword User's old password (optional).
00213                        If this parameter is not specified the old password
00214                        is not verified. This is useful when the password
00215                        needs to be reset due to a forgotten password.
00216
00217     \return -1: Invalid login or password
00218             -2: Password database is not accessible
00219             -3: Error accessing the password database
00220              0: Password changed successfully
00221     """
00222
00223     try:
00224       # Need to use low-level file I/O here since we are going to use lseek
00225       if os.access(self.__passwords,os.O_RDWR):
00226         fd = os.open(self.__passwords,os.O_BINARY|os.O_RDWR)
00227       else:
00228         log.debug("Password database is not accessible.")
00229         return -2
00230     except:
00231       log.exception("Error accessing the password database")
00232       return -3
00233
00234
00235     #md5sum = md5.new()
00236     user_name = userName
00237     user_home = "Nothing"
00238     user_login = loginId
00239     user_password = oldPassword
00240     #md5sum.update(user_password)
00241     #user_passhash = hexlify(md5sum.digest())
00242     user_passhash = "Nothing"
00243     user_attempts = 0
00244     user_sizeof = calcsize(self.__fmt)
00245     user_data = pack(self.__fmt,user_name,user_home,user_login,user_passhash,user_attempts)
00246     while len(user_data) == user_sizeof:
00247       user_data = os.read(fd, user_sizeof)
00248       if len(user_data) == user_sizeof:
00249         (u_name,u_home,u_login,u_passhash,u_attempts) = unpack(self.__fmt,user_data)
00250         if u_login.strip('\0 ') == user_login.strip() and (oldPassword == "" or self.__check(u_passhash, user_password)):
00251           new_password = password
00252           #newmd5sum = md5.new(new_password)
00253           #new_passhash = hexlify(newmd5sum.digest())
00254           new_passhash = self.__create(new_password)
00255           user_info = pack(self.__fmt,user_name,u_home,u_login,new_passhash,u_attempts)
00256           os.lseek(fd,-user_sizeof,1)
00257           os.write(fd,user_info)
00258           os.close(fd)
00259           log.debug("Password for user %s changed" % loginId)
00260           return 0
00261     os.close(fd)
00262     log.debug("Invalid login or password trying to change the password for user %s" % loginId)
00263     return -1
00264
00265   def addPassword(self, loginId, password, userName):
00266     """Add a new user to the password database
00267
00268     \param loginId  User's login id
00269     \param password The new password for the user
00270     \param userName User's full name
00271
00272     \return -3: Error accessing the password database
00273             -2: User already exists in password database
00274             -1: Invalid login or password
00275              0: Added user to the password database
00276     """
00277     try:
00278       if os.access(self.__passwords,os.O_RDWR):
00279         fd = os.open(self.__passwords,os.O_BINARY|os.O_RDWR)
00280         newfile = 0
00281       else:
00282         fd = os.open(self.__passwords,os.O_BINARY|os.O_RDWR|os.O_CREAT)
00283         newfile = 1
00284     except:
00285       log.exception("Error accessing the password database")
00286       return -3
00287     #md5sum = md5.new()
00288     user_name = userName
00289     user_home = "Nothing"
00290     user_login = loginId
00291     user_password = password
00292     #md5sum.update(user_password)
00293     #user_passhash = hexlify(md5sum.digest())
00294     user_passhash = self.__create(user_password)
00295     user_attempts = 0
00296     user_sizeof = calcsize(self.__fmt)
00297     user_info = pack(self.__fmt,user_name,user_home,user_login,user_passhash,user_attempts)
00298     user_data = user_info
00299     if newfile:
00300       log.debug("Added user %s to the password database" % loginId)
00301       os.write(fd,user_info)
00302       os.close(fd)
00303       return 0
00304     while len(user_data) == user_sizeof:
00305       user_data = os.read(fd,user_sizeof)
00306       if len(user_data) == user_sizeof:
00307         (u_name,u_home,u_login,u_passhash,u_attempts) = unpack(self.__fmt,user_data)
00308         if u_login.strip('\0 ') == user_login.strip():
00309           log.debug("User %s already exists in password database." % loginId)
00310           os.close(fd)
00311           return -2
00312     log.debug("Added user %s to the password database" % loginId)
00313     os.write(fd,user_info)
00314     os.close(fd)
00315     return 0
00316
00317   def checkPassword(self, loginId):
00318     """Checks if a user already has a password
00319
00320     \param loginId  User's login id
00321
00322     \return -1: Password does not exist
00323              0: Password exists
00324     """
00325     if os.access(self.__passwords,os.O_RDONLY):
00326       fd = os.open(self.__passwords,os.O_BINARY|os.O_RDONLY)
00327     else:
00328       return -1
00329     #md5sum = md5.new()
00330     user_name = "Nothing"
00331     user_home = "Nothing"
00332     user_login = loginId
00333     user_password = "Nothing"
00334     user_passhash = "Nothing"
00335     user_attempts = 0
00336     user_sizeof = calcsize(self.__fmt)
00337     user_info = pack(self.__fmt,user_name,user_home,user_login,user_passhash,user_attempts)
00338     user_data = user_info
00339     while len(user_data) == user_sizeof:
00340       user_data = os.read(fd,user_sizeof)
00341       if len(user_data) == user_sizeof:
00342         (u_name,u_home,u_login,u_passhash,u_attempts) = unpack(self.__fmt,user_data)
00343         if u_login.strip('\0 ') == user_login.strip():
00344           os.close(fd)
00345           return 0
00346     os.close(fd)
00347     return -1
00348
00349
00350   def deleteUser(self, loginId):
00351     """Deletes the user based on the given login id and password.
00352
00353     \param loginId  User's login id
00354     \param password User's password
00355
00356     \return -1: User authentication failed, invalid user id or password
00357             -2: Password database is not accessible
00358              0: User deleted
00359     """
00360     if os.access(self.__passwords,os.O_RDWR):
00361       fd = os.open(self.__passwords,os.O_BINARY|os.O_RDWR)
00362     else:
00363       log.debug("Password database is not accessible.")
00364       return -2
00365
00366     #md5sum = md5.new()
00367     (fmode, fino, fdev, fnlink, fuid, fgid, fsize, fatime, fmtime, fctime) = os.fstat(fd)
00368     user_name = "Nothing"
00369     user_home = "Nothing"
00370     user_login = loginId
00371     #user_password = password
00372     #md5sum.update(user_password)
00373     #user_passhash = hexlify(md5sum.digest())
00374     user_passhash="Nothing"
00375     user_attempts = 0
00376     user_sizeof = calcsize(self.__fmt)
00377     user_data = pack(self.__fmt,user_name,user_home,user_login,user_passhash,user_attempts)
00378     while len(user_data) == user_sizeof:
00379       user_data = os.read(fd,user_sizeof)
00380       if len(user_data) == user_sizeof:
00381         (u_name,u_home,u_login,u_passhash,u_attempts) = unpack(self.__fmt,user_data)
00382         #print "<%s><%s><%s><%s>" % (u_login, user_login, u_passhash, user_passhash)
00383         if u_login.strip('\0 ') == user_login.strip(): # and self.__check(u_passhash, user_password):
00384           log.debug("Access Granted to user with the login id=%s" % loginId)
00385           curpos = os.lseek(fd,0,1)
00386           if curpos == fsize:
00387             os.close(fd)
00388             f = open(self.__passwords, "ab+")
00389             f.truncate(fsize - user_sizeof)
00390             f.close()
00391             log.debug("User %s deleted" % loginId)
00392             return 0
00393           buf = os.read(fd,fsize - curpos)
00394           os.lseek(fd,curpos - user_sizeof,0)
00395           os.write(fd,buf)
00396           os.close(fd)
00397           f = open(self.__passwords,"ab+")
00398           f.truncate(fsize - user_sizeof)
00399           f.close()
00400           log.debug("User %s deleted" % loginId)
00401           return 0
00402     log.debug("User authentication failed, loginId=%s" % loginId)
00403     os.close(fd)
00404     return -1
00405
00406
00407   ## private:
00408
00409   # Password encryption/verification routines
00410   def __makesalt(self):
00411       l = [ chr(random.randint(0,255)) for i in range(4) ]
00412       return ''.join(l)
00413
00414   def __create(self, password):
00415       salt = self.__makesalt()
00416       text = salt + password
00417       pwdHash = sha.new(text).digest()
00418       data = salt + pwdHash
00419       return base64.encodestring(data)
00420
00421   def __check(self, data, password):
00422       data = base64.decodestring(data)
00423       salt, pwdHash = data[:4], data[4:]
00424       pwdHash2 = sha.new(salt + password).digest()
00425       return pwdHash2 == pwdHash
00426
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcStatusMonitor.py Source File

runcontrol

rcStatusMonitor.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Status Monitor for Run Control"
00012 __author__   = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST I&T/Online"
00013 __date__     = ("$Date: 2005/10/26 01:57:29 $").split(' ')[1]
00014 __version__  = "$Revision: 2.11 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 from qt import *
00022 import logging as log
00023
00024 class ListViewToolTip(QToolTip):
00025   def __init__(self, view, column, truncatedOnly=0):
00026     QToolTip.__init__(self, view.viewport())
00027     self.__view = view
00028     self.__col  = column
00029
00030   def maybeTip(self, pos):
00031     item = self.__view.itemAt(pos)
00032     if item is not None:
00033       #if self.__view.header().sectionSize(self.__col) >= \
00034       #    item.width(self.__view.fontMetrics(), self.__view, self.__col):
00035       #  return
00036       cp = self.__view.viewportToContents(pos)
00037       tipString = item.text(self.__col)
00038       cr = self.__view.itemRect(item)
00039       headerPos = self.__view.header().sectionPos(self.__col)
00040       cr.setLeft(headerPos)
00041       cr.setRight(headerPos + self.__view.header().sectionSize(self.__col))
00042       self.tip(cr, tipString)
00043
00044 class StatusItem(QListViewItem):
00045   def __init__(self, *args):
00046     QListViewItem.__init__(self, *args)
00047     self.alarmExpr = None
00048
00049   def paintCell(self, p, cg, column, width, align):
00050     g = QColorGroup(cg)
00051     g.setColor( QColorGroup.Base, Qt.white)
00052     g.setColor( QColorGroup.Foreground, Qt.black)
00053     if self.alarmExpr is not None:
00054       # If alarm expr starts with '@' then treat the monitored
00055       # value as a string in the expression.
00056       if self.alarmExpr.startswith("@"):
        expr = "'"+str(self.text(1))+"'" + self.alarmExpr[1:]
00057       else:
00058         expr = str(self.text(1)) + self.alarmExpr
00059       try:
00060         if eval(expr):
00061           g.setColor( QColorGroup.Text, Qt.red)
00062         else:
00063           g.setColor( QColorGroup.Text, Qt.black)
00064       except:
00065         log.exception("Error evaluating expression \"%s\"" % expr)
00066
00067
00068     # Do the standard painting
00069     QListViewItem.paintCell(self,p,g,column,width,align)
00070
00071     p.setPen( QPen( cg.dark(), 1 ) )
00072     p.drawLine( 0, self.height() - 1, width, self.height() - 1 )
00073     p.drawLine( width - 1, 0, width - 1, self.height() )
00074
00075   def setText(self, column, value):
00076     QListViewItem.setText(self, column, value)
00077
00078   def setAlarmExpr(self, alarmExpr):
00079     self.alarmExpr = alarmExpr
00080
00081
00082 class WatchItem(object):
00083   def __init__(self, accessor, key, label, alarmExpr, offBoard):
00084     self.__accessor = accessor
00085     self.__statusItem = None
00086     self.__key = key
00087     self.__label = label
00088     self.__alarmExpr = alarmExpr
00089     self.__inView = 0
00090     self.__offBoard = offBoard
00091
00092   def evaluate(self):
00093     if self.__key is not None:
00094       if self.__accessor.has_key(self.__key):
00095         return self.__accessor[self.__key]
00096       else:
00097         return 'N/A'
00098     else:
00099       val = self.__accessor()
00100       if val is None:
00101         return 'N/A'
00102       else:
00103         return val
00104
00105   def getLabel(self):
00106     return self.__label
00107
00108   def getAlarmExpr(self):
00109     return self.__alarmExpr
00110
00111   def getStatusItem(self):
00112     return self.__statusItem
00113
00114   def setStatusItem(self, si):
00115     self.__statusItem = si
00116
00117   def isInView(self):
00118     return self.__inView
00119
00120   def setInView(self):
00121     self.__inView = 1
00122
00123   def setAccessor(self, accessor, key):
00124     self.__accessor = accessor
00125     self.__key      = key
00126
00127   def isOffBoard(self):
00128     return self.__offBoard
00129
00130 class rcStatusPanel(QWidget):
00131   def __init__(self,parent = None,name = None,fl = 0):
00132     QWidget.__init__(self,parent,name,fl)
00133
00134     self.contextMenu = QPopupMenu( self )
00135     self.contextMenu.insertItem( "&Copy", self.copyToClipboard, Qt.CTRL+Qt.Key_C)
00136
00137     self.clip = QApplication.clipboard()
00138
00139     if not name:
00140       self.setName("rcStatusPanel")
00141
00142
00143     rcStatusPanelLayout = QGridLayout(self,1,1,0,6,"rcStatusPanelLayout")
00144
00145     self.statusView = QListView(self,"statusView")
00146     self.statusView.addColumn(self.tr("Data"))
00147     self.statusView.addColumn(self.tr("Value"))
00148     self.statusView.setAllColumnsShowFocus(1)
00149     self.statusViewTip = ListViewToolTip(view=self.statusView, column=1,
00150                                          truncatedOnly=1)
00151
00152     rcStatusPanelLayout.addWidget(self.statusView,0,0)
00153
00154     QObject.connect(self.statusView,
00155                     SIGNAL("contextMenuRequested(QListViewItem*,const QPoint&,int)"),
00156                     self.contextMenuShow
00157                    )
00158
00159   def contextMenuShow(self, item, point, column):
00160     self.selectedItem = item
00161     self.contextMenu.exec_loop(point)
00162
00163   def copyToClipboard(self):
00164     if self.statusView.selectedItem() is not None:
00165       self.clip.setText(self.statusView.selectedItem().text(1))
00166
00167
00168 class rcStatusMonitor(object):
00169   def __init__(self, interval, gui=None):
00170     self.__interval = interval
00171     self.__gui = gui
00172     self.__watchList = {}
00173     self.__labelSeq = []
00174     self.__timer = QTimer(gui)
00175     self.__lastItem = None
00176     QObject.connect(self.__timer, SIGNAL("timeout()"), self.updateWatchItems)
00177
00178   def startWatch(self):
00179     if not self.__timer.isActive():
00180       self.__timer.start(self.__interval)
00181
00182   def stopWatch(self):
00183     if self.__timer.isActive():
00184       self.__timer.stop()
00185
00186   def addWatchItem(self, label, accessor, key=None, alarmExpr=None, offBoard=False):
00187     if not self.__watchList.has_key(label):
00188       self.__watchList[label] = WatchItem(accessor, key, label, alarmExpr, offBoard)
00189       self.__labelSeq.append(label)
00190     else:
00191       self.__watchList[label].setAccessor(accessor, key)
00192
00193   def updateWatchItems(self):
00194     for label in self.__labelSeq:
00195       wi = self.__watchList[label]
00196       if self.__gui is None:
00197         print label, wi.evaluate()
00198       else:
00199         if not wi.isInView():
00200           if self.__lastItem is None:
00201             si = StatusItem(self.__gui.statusView, label)
00202           else:
00203             si = StatusItem(self.__gui.statusView, self.__lastItem, label)
00204           si.setAlarmExpr(wi.getAlarmExpr())
00205           self.__lastItem = si
00206           wi.setStatusItem(si)
00207           wi.setInView()
00208         else:
00209           si = wi.getStatusItem()
00210         app = self.__gui.getApp()
00211         fsm = self.__gui.getFSM()
00212         evaluateOffBoard = True
00213         if app is not None and fsm is not None:
00214           if fsm.current_state == 'RESET':
00215             evaluateOffBoard = False
00216         if evaluateOffBoard or not wi.isOffBoard():
00217           si.setText(1, str(wi.evaluate()))
00218         else:
00219           si.setAlarmExpr(None)
00220
00221
00222
00223 #~ if __name__ == '__main__':
00224
00225   #~ from random import random
00226   #~ import sys
00227   #~ from RunControlMainGUIImpl import *
00228   #~ from RunControlCommon import *
00229
00230   #~ class Dummy(object):
00231     #~ def __init__(self):
00232       #~ pass
00233
00234     #~ def getValue(self):
00235       #~ return random()
00236
00237   #~ app = QApplication(sys.argv)
00238
00239   #~ rcCommon = RunControlCommon()
00240
00241   #~ gui = RunControlMainGUIImpl(rcCommon)
00242
00243   #~ #statMon = rcStatusMonitor(1000)
00244   #~ statMon = rcStatusMonitor(1000, gui)
00245   #~ dummy = Dummy()
00246   #~ statMon.addWatchItem('TestValue', dummy.getValue)
00247   #~ statMon.startWatch()
00248   #~ app.setMainWidget(gui)
00249   #~ gui.show()
00250   #~ app.exec_loop()
00251
00252
00253
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcSuite.py Source File

runcontrol

rcSuite.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT run control suite execution framework"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/10/26 01:46:50 $").split(' ')[1]
00014 __version__  = "$Revision: 2.22 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import threading
00020 import logging  as log
00021 import types
00022 import copy
00023
00024 import rcUtil
00025 from RunControlCommon import RunControlCommon
00026
00027 class rcSuite(object):
00028
00029   class StopRequestedException(Exception):
00030     def __init__(self,msg,suite,module):
00031       self.args = (msg, suite, module)
00032       self.msg = msg
00033       self.suite = suite
00034       self.module = module
00035
00036   class SuiteCallbacks(object):
00037     def beforeSetupSuite(self, suite):
00038       pass
00039     def afterSetupSuite(self, suite):
00040       pass
00041     def beforeStartSuite(self, suite):
00042       pass
00043     def afterStartSuite(self, suite):
00044       pass
00045     def beforeStopSuite(self, suite):
00046       pass
00047     def afterStopSuite(self, suite):
00048       pass
00049
00050   class StandaloneLauncher(object):
00051     def __init__(self, logLevel="INFO"):
00052       self.__common = RunControlCommon()
00053       self.__common.initialize()
00054       self.__common.setLoggingLevel(logLevel)
00055       self.__common.connect()
00056
00057     def launch(self, suiteClass, user, callbacks=None):
00058       if suiteClass is None:
00059         module = self.__common.options().app
00060         try:
00061           (module, filename) = rcUtil.importModule(module, reload=0)
00062         except Exception, e:
00063           log.exception(e)
00064           return
00065         us = module.userSuite(self, user, self.__common)
00066         if callbacks is None and 'userSuiteCallbacks' in dir(module):
00067           callbacks = module.userSuiteCallbacks()
00068       else:
00069         us = suiteClass(self, user, self.__common)
00070       if callbacks is not None:
00071         callbacks.beforeSetupSuite(us)
00072       us.rcSetupSuite()
00073       if callbacks is not None:
00074         callbacks.afterSetupSuite(us)
00075       if callbacks is not None:
00076         callbacks.beforeStartSuite(us)
00077       us.rcStartSuite(spawn=0)
00078       if callbacks is not None:
00079         callbacks.afterStartSuite(us)
00080       if callbacks is not None:
00081         callbacks.beforeStopSuite(us)
00082       us.rcStopSuite()
00083       if callbacks is not None:
00084         callbacks.afterStopSuite(us)
00085
00086     def doStopRun(self):
00087       pass
00088
00089     def preferences(self):
00090       return self.__common.prefMan().preferences()
00091
00092     def common(self):
00093       return self.__common
00094
00095
00096   def __init__(self, gui, userId, debug):
00097     log.debug("rcSuite.__init__()")
00098
00099     self.__userId      = userId
00100     self.__debug       = debug
00101     self.__cmdCli      = None
00102     self.__evtCli      = None
00103
00104     #self.__modules     = []
00105     #self.__schemas     = []
00106     self.__isOKtoQuitOrPause  = threading.Event()
00107     self.__cmdQuit     = 0
00108     self.__paused      = False
00109     self.__running     = False
00110     self.__app         = None
00111     self.__scriptSeq   = 0
00112     self.__suite       = None
00113     self.__suiteInst   = None
00114     self.__state       = 'RESET'
00115     self.__appState    = 'RESET'
00116     # Flag to indicate that there was an exception in the running script.
00117     self.__reset       = False
00118
00119     # The following data members are meant to be marked "protected"
00120     self.gui           = gui
00121
00122     if self.__debug.__class__.__name__ == 'RunControlCommon':
00123       self.__common = self.__debug
00124       self.__statMon = None
00125     else:
00126       self.__common = self.gui.common()
00127       self.__statMon = self.gui.statusMonitor()
00128
00129     # Expose the schema to the suite
00130     self.lat = self.getSessionVar('_LATSchema')
00131     self.xbrd = self.getSessionVar('_XBRDSchema')
00132
00133 #  def addApplication(self, appName, schema):
00134 #    try:
00135 #      (module, filename) = rcUtil.importModule(appName, reload=0)
00136 #    except Exception:
00137 #      gutil.logException()
00138
00139
00140 #    if 'userApplication' not in dir(module):
00141 #      msg = 'Application %s is missing a userApplication class' % appName
00142 #      log.error(msg)
00143 #      return msg
00144
00145 #    log.info("Application loaded from %s" % filename)
00146 #    self.__modules.append(module)
00147 #    self.__schemas.append(schema)
00148
00149   def setupSuite(self):
00150     """ Override this method to do custom processing before the suite is started and/or
00151     to return a custom schema file
00152     """
00153     return None
00154
00155   def rcPauseSuite(self):
00156     fn = "rcSuite.rcPauseSuite"
00157     log.debug("%s -- %s" % (fn, self.getName()))
00158     if self.__paused:
00159       return -1
00160     if self.pauseSuite() is not None:
00161       return
00162     if self.__app is not None:
00163       if self.__app.__class__.__name__ == 'userApplication':
00164         self.__isOKtoQuitOrPause.wait()
00165         if self.__app is not None and self.__app.rcPause() is None:
00166           self.__paused = True
00167           return None
00168       else:
00169         if self.__app.rcPauseSuite() is None:
00170           self.__paused = True
00171           return None
00172     return -1
00173
00174   def pauseSuite(self):
00175     """ Override this method to do custom processing before the currently running
00176     application is paused. Pause can be rejected by not returning None
00177     """
00178     return None
00179
00180
00181   def rcSetupSuite(self):
00182     """ This method can be called from either RunControlMain or from another suite.
00183     """
00184     fn = "rcSuite.rcSetupSuite"
00185     log.debug("%s -- %s" % (fn, self.getName()))
00186
00187     #askForSchema = 0
00188     #if schema is None:
00189     #  reuseSchema = self.getSessionVar('_reuseSchema')
00190     #  schema = self.getSessionVar("_suiteLATSchemaFile")
00191     #  if not reuseSchema:
00192     #    askForSchema = 1
00193
00194     #if askForSchema:
00195     #  scmCfg = self.gui.createGUI(rcScmCfgSelector.rcScmCfgSelector, self.gui.common().preferences()['reposdir'],
00196     #                              schema, self.gui, 'ScmCfgSelector')
00197     #  scmCfgFile = scmCfg.getValue()
00198     #  # Allow the C++ object to be deleted
00199     #  scmCfg.deleteLater()
00200     #  if scmCfgFile is None or os.path.splitext(scmCfgFile.lower())[1] != '.xml':
00201     #    if scmCfgFile is not None:
00202     #      log.error("%s: Invalid SchemaConfig filename '%s'" % (fn, scmCfgFile))
00203     #    schema = None
00204     #  else:
00205     #    self.setSessionVar("_LATSchemaFile", scmCfgFile)
00206     #    self.setSessionVar("_suiteLATSchemaFile", scmCfgFile)
00207     #    schema = scmCfgFile
00208
00209     #if schema is not None:
00210     #  self.setupSuite()
00211     #else:
00212
00213     #return schema
00214
00215     self.setupSuite()
00216     return 0
00217
00218   def rcStartSuite(self, spawn=1):
00219     fn = "rcSuite.rcStartSuite"
00220     log.debug("%s -- %s" % (fn, self.getName()))
00221     if self.__running and not self.__paused:
00222       return -1
00223     self.__scriptSeq = 0
00224     self.__running = True
00225     self.__state = 'RUNNING'
00226     if self.__paused:
00227       if self.__app.__class__.__name__ == 'userApplication':
00228         if self.__app.rcResume() is None:
00229           self.__paused = False
00230       else:
00231         self.__app.rcStartSuite()
00232     else:
00233       self.__cmdQuit = 0
00234       if spawn:
00235         self.__suiteRun = threading.Thread(group=None, name="SuiteThread", target=self.startSuite)
00236         self.__suiteRun.start()
00237       else:
00238         self.startSuite()
00239
00240   def stopSuite(self):
00241     """ Override this method to do custom processing before the suite is terminated
00242     """
00243     pass
00244
00245   def rcStopSuite(self):
00246     fn = "rcSuite.rcStopSuite"
00247     log.debug("%s -- %s" % (fn, self.getName()))
00248     if self.stopRequested():
00249       self.__running = False
00250       return
00251     if self.__app is not None and self.__app.__class__.__name__ == 'userApplication':
00252       self.__isOKtoQuitOrPause.wait()
00253     self.__cmdQuit = 1
00254     if self.__app is not None:
00255       if self.__app.__class__.__name__ == 'userSuite':
00256         self.__app.rcStopSuite()
00257       else:
00258         if self.__paused:
00259           if self.__app.rcResume() is None:
00260             self.__paused = False
00261             self.__app.rcStopRun()
00262             self.__app.rcTeardown()
00263         else:
00264           self.__app.rcStopRun()
00265           self.__app.rcTeardown()
00266     self.stopSuite()
00267     self.__running = False
00268     self.__state = 'RESET'
00269     #self.__suiteRun.join()
00270
00271   #def __suiteRunThread(self):
00272   #  i = 0
00273   #  for module in self.__modules:
00274   #    self.scriptRun(module, self.__schemas[i])
00275   #    if self.__cmdQuit: break
00276   #    i += 1
00277
00278   def scriptRun(self, module, context={}):
00279     fn = "rcSuite.scriptRun"
00280     log.debug("%s: %s" % (fn, module))
00281     self.__scriptSeq += 1
00282     if self.stopRequested():
00283         raise rcSuite.StopRequestedException("Operator requested stop of execution",
00284                                             self.getName(),
00285                                             ""
00286                                             )
00287     self.__isOKtoQuitOrPause.clear()
00288     for (key, value) in context.items():
00289       self.setSessionVar(key, value)
00290     if type(module) is types.StringType:
00291       if self.__statMon is not None:
00292         self.gui.execGUImethod(self.__statMon.stopWatch)
00293       try:
00294         (module, filename) = rcUtil.importModule(module, reload=0)
00295       except Exception, e:
00296         log.exception(e)
00297         if self.__statMon is not None:
00298           self.gui.execGUImethod(self.__statMon.startWatch)
00299         return None
00300       if self.__statMon is not None:
00301         self.gui.execGUImethod(self.__statMon.startWatch)
00302     self.__reset = False
00303     if 'userApplication' in dir(module):
00304       if self.__debug.__class__.__name__ == 'RunControlCommon':
00305         self.__app = module.userApplication(None, self.__userId,
00306                                             self.__debug )
00307       else:
00308         self.__app = module.userApplication(self.gui, self.__userId,
00309                                             self.__debug )
00310       self.__app.setSuite(self.getName())
00311       self.__app.setSuiteInstance(self)
00312       self.__app.setCmdCli(self.__cmdCli)
00313       if self.__app.getEvtCli() is None:
00314         self.__app.setEvtCli(self.__evtCli)
00315       self.__appState = 'RESET'
00316       if self.__app.rcSetup() is not None:
00317         self.__cmdQuit = 1
00318         raise rcSuite.StopRequestedException("setup() is rejected, stopping suite execution",
00319                                             self.__app.getSuite(),
00320                                             self.__app.getName()
00321                                             )
00322       self.__appState = 'STOPPED'
00323       status = self.__app.rcStartRun()
00324       self.__appState = 'RUNNING'
00325       self.__isOKtoQuitOrPause.set()
00326       if status is not None:
00327         self.__cmdQuit = 1
00328         raise rcSuite.StopRequestedException("startRun() is rejected, stopping suite execution",
00329                                             self.__app.getSuite(),
00330                                             self.__app.getName()
00331                                             )
00332       self.__app.wait()
00333       if self.stopRequested():
00334         raise rcSuite.StopRequestedException("Operator requested stop of execution",
00335                                             self.__app.getSuite(),
00336                                             self.__app.getName()
00337                                             )
00338       self.__isOKtoQuitOrPause.wait()
00339       self.__isOKtoQuitOrPause.clear()
00340       if not self.__reset:
00341         self.__app.rcStopRun()
00342         self.__app.rcTeardown()
00343       self.__appState = 'RESET'
00344       del self.__app
00345       self.__app = None
00346       self.__isOKtoQuitOrPause.set()
00347     elif 'userSuite' in dir(module):
00348       self.__app = module.userSuite( self.gui, self.__userId, self.__debug)
00349       log.info("Suite %s loaded from %s" % (self.__app.getName(), filename))
00350       self.__app.setCmdCli(self.__cmdCli)
00351       self.__app.setEvtCli(self.__evtCli)
00352       #if self.__app.rcSetupSuite(self.getSessionVar("_suiteLATSchemaFile")) is None:
00353       #  log.error("Suite setup failed...Aborting suite %s" % self.__app.getName())
00354       #  return
00355       #else:
00356       self.__app.setSuite(self.getName())
00357       self.__app.setSuiteInstance(self)
00358       self.__app.rcSetupSuite()
00359       self.__app.rcStartSuite(spawn=0)
00360       self.__isOKtoQuitOrPause.set()
00361         #self.__app.rcStopSuite()
00362         #self.__app = None
00363     else:
00364       errorMsg = '%s is not a recognized user script. userApplication or userSuite class missing' % module
00365       log.error(errorMsg)
00366       raise RuntimeError, errorMsg
00367     return self.__copySessionVars()
00368
00369   def resetSuiteScript(self):
00370     if self.__app.__class__.__name__ == 'userApplication' and not self.stopRequested():
00371       self.__isOKtoQuitOrPause.clear()
00372       self.__reset = True
00373       if 'sync' in dir(self.__app):
00374         self.__app.sync()
00375       self.__app.rcStopRun()
00376       self.__app.rcTeardown()
00377       self.__isOKtoQuitOrPause.set()
00378
00379   def setCmdCli(self, cmdCli):
00380     self.__cmdCli = cmdCli
00381
00382   def setEvtCli(self, evtCli):
00383     self.__evtCli = evtCli
00384
00385   def getEvtCli(self):
00386     return self.__evtCli
00387
00388   def isSuiteScriptAborted(self):
00389     return self.__reset
00390
00391   def getScriptSequence(self):
00392     return self.__scriptSeq
00393
00394   def getScriptState(self):
00395     """\brief Return the state of the suite script.
00396
00397     Currently there are two states. 'RESET' or 'RUNNING'.
00398     If rcSetupSuite or rcStopSuite has completed execution then
00399     the state will be 'RESET'. If rcStartSuite started execution
00400     then the state will be 'RUNNING'.
00401
00402     \return 'RESET' or 'RUNNING'
00403     """
00404     return self.__state
00405
00406   def getAppState(self):
00407     """\brief Return the state of the current script.
00408
00409     \return State of the current script
00410     """
00411     return self.__appState
00412
00413   def getApp(self):
00414     """\brief Return the instance of current script.
00415
00416     Returns the instance for the suite script or nested suite
00417     that is currently executing.
00418
00419     \return userApplication or userSuite instance.
00420     """
00421     return self.__app
00422
00423   def getSuite(self):
00424     """\brief Get the parent suite name of this suite
00425
00426     \return Parent suite name or None.
00427     """
00428     return self.__suite
00429
00430   def setSuite(self, name):
00431     """\brief Set the parent suite name of this suite
00432
00433     \param name Parent suite name
00434     """
00435     self.__suite = name
00436
00437   def getSuiteInstance(self):
00438     """\brief Return the parent suite instance that this suite is a part of.
00439
00440     \return Parent suite instance.
00441     """
00442     return self.__suiteInst
00443
00444   def setSuiteInstance(self, suiteInst):
00445     """\brief Set the parent suite instance for this suite.
00446
00447     \param suiteInst Parent suite instance.
00448     """
00449     self.__suiteInst = suiteInst
00450
00451   def setSessionVar(self, key, value):
00452     """\brief Set a session variable.
00453
00454     Do not use variable names beginning
00455     with the underscore ('_') character since these are reserved for RunControl
00456     """
00457     sessionVars = self.__common.getDBN()
00458     if sessionVars is not None:
00459       sessionVars[key] = value
00460     else:
00461       raise RuntimeError, "Database node does not exist"
00462
00463   def getSessionVar(self, key):
00464     """Retrieve the values of the session variable indicated by \a key.
00465
00466     \return Session variable value
00467     """
00468     sessionVars = self.__common.getDBN()
00469     if sessionVars is not None and sessionVars.has_key(key):
00470       return sessionVars[key]
00471     else:
00472       return None
00473
00474   def __copySessionVars(self):
00475     newCopy = {}
00476     vars = self.__common.getDBN()
00477     for varName in vars.keys():
00478       if varName.startswith('_'): continue
00479       try:
00480         newCopy[varName] = copy.deepcopy(vars[varName])
00481       except:
00482         newCopy[varName] = copy.copy(vars[varName])
00483     return newCopy
00484
00485   #def readSchema(self, scmCfgFile):
00486   #  fn = "rcTransitions.readSchema"
00487   #  lat = gSchemaConfig.readSchema(scmCfgFile)
00488   #  if lat is None:
00489   #    log.error("%s: Unable to instatiate a LAT from SchemaConfig file '%s'" % \
00490   #              (fn, scmCfgFile))
00491   #    return None
00492   #  includeFiles = lat._GLAT__includeFiles
00493   #  incFileModTime = {}
00494   #  for f in includeFiles:
00495   #    incFileModTime[f] = os.path.getmtime(f)
00496   #  lat.setCmd(self.__cmdCli)
00497   #  self.setSessionVar('_LATSchema', lat)
00498   #  self.setSessionVar('_LATSchemaFile', scmCfgFile)
00499   #  self.setSessionVar('_LATSchemaFileModTime', os.path.getmtime(scmCfgFile))
00500   #  self.setSessionVar('_LATIncludeFileModTime', incFileModTime)
00501   #  return lat
00502
00503   def readSchema(self, scmCfgFile):
00504     self.__common.readSchema(scmCfgFile)
00505
00506   def applyConfig(self, seq=None, gxbrd=None):
00507     if self.lat is not None:
00508       self.lat.applyConfig(seq, gxbrd)
00509
00510   def stopRequested(self):
00511     return self.__cmdQuit
00512
00513   def clearStopRequested(self):
00514     self.__cmdQuit = 0
00515
00516   def isPaused(self):
00517     return self.__paused
00518
00519   def isRunning(self):
00520     return self.__running
00521
00522   def getName(self):
00523     return self.__class__.__name__
00524
00525   def startSuite(self):
00526     raise RuntimeError, "Suite does not define a startSuite method"
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcTestReport.py Source File

runcontrol

rcTestReport.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Test report generator class for RunControl"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/08/31 20:58:05 $").split(' ')[1]
00014 __version__  = "$Revision: 2.5 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import                         Pyana
00021 from xml.dom             import Node
00022 #from xml.dom            import implementation
00023 #from xml.dom.ext        import PrettyPrint
00024 #from xml.dom.ext.reader import Sax2
00025 #from xml.dom.minidom    import getDOMImplementation, parseString, Node
00026 from Ft.Xml.Domlette     import NonvalidatingReader, PrettyPrint, implementation
00027
00028 from LATTE.database.gSchemaConfig import LAT_NAMESPACE
00029
00030 from cStringIO           import StringIO
00031
00032 class rcTestReport(object):
00033   """\brief Test Report class for RunControl.
00034
00035   This class provides a mechanism to create test reports in a well formed (XML) format using
00036   the provided report building methods and lets the user transform it to HTML format by providing
00037   an XSLT stylesheet template. A third-party tool called Pyana is used to do the transformation.
00038   A sample template (reportStyle.xsl.sample) is provided in the RunControl directory. For more
00039   information on XSLT see the following links:
00040
00041   <p><a href="http://www.w3.org/TR/xslt">XSL Transformations W3C Recommendation</a></p>
00042   <p><a href="http://www.xfront.com/xsl.html">XSLT Tutorial</a></p>
00043
00044   """
00045
00046   def __init__(self):
00047     self.__reports = []
00048
00049   def initReport(self, title):
00050     """ Initializes the report class and provides a title for the report
00051
00052     \param title The title that will show in the window title of the HTML browser
00053     """
00054     #self.__doc = implementation.createDocument(None,None,None)
00055     #self.__doc = getDOMImplementation().createDocument(None,None,None)
00056     self.__doc = implementation.createDocument(None,None,None)
00057     self.__root = self.__doc.createElementNS(LAT_NAMESPACE, "TestReport")
00058     self.__doc.appendChild(self.__root)
00059     titleNode = self.__doc.createElementNS(LAT_NAMESPACE, "Title")
00060     data = self.__doc.createTextNode(title)
00061     titleNode.appendChild(data)
00062     self.__root.appendChild(titleNode)
00063     self.__maxHeadingLine = 0
00064     self.__maxSectionId = 0
00065     self.__maxTableId = 0
00066     self.__sectionNodes = {}
00067     self.__tableNodes = {}
00068
00069   def addHTML(self, htmlString, section=None):
00070     """ Adds an arbitrary HTML fragment to the end of the report or a section
00071
00072     \param htmlString HTML fragment.
00073     \param section    Optional section id that this HTML will be written to.
00074                       If no section is specified then HTML is added to the
00075                       end of the report.
00076     """
00077     htmlDom = self.__createHTMLDom(htmlString)
00078     if section is None:
00079       self.__root.appendChild(htmlDom)
00080     else:
00081       sectionNode = self.__sectionNodes[section]
00082       sectionNode.appendChild(htmlDom)
00083
00084   def addHeading(self, text):
00085     """ Adds a heading to the report
00086
00087     \param text Heading text
00088     """
00089     heading = self.findTag(self.__root, 'Heading')
00090     if heading is None:
00091       heading = self.__doc.createElementNS(LAT_NAMESPACE, 'Heading')
00092       self.__root.appendChild(heading)
00093     self.__maxHeadingLine += 1
00094     line = self.__doc.createElementNS(LAT_NAMESPACE, 'Line')
00095     line.setAttributeNS(LAT_NAMESPACE, 'no', str(self.__maxHeadingLine))
00096     line.appendChild(self.__createHTMLDom(text))
00097     heading.appendChild(line)
00098
00099   def addSection(self, caption, insert=1):
00100     """ Adds a section to the report and returns the section id.
00101
00102     \param  caption Section caption
00103     \param  insert 0 = Do not insert the section into the report
00104                    1 = Insert the section into the report (default)
00105     \return Section id.
00106     """
00107     self.__maxSectionId += 1
00108     sectionNode = self.__doc.createElementNS(LAT_NAMESPACE, 'Section')
00109     sectionNode.setAttributeNS(LAT_NAMESPACE, 'id', str(self.__maxSectionId))
00110     sectionNode.appendChild(self.__createHTMLNode('Caption',caption))
00111
00112     if insert == 1:
00113       self.__root.appendChild(sectionNode)
00114     self.__sectionNodes[self.__maxSectionId] = sectionNode
00115     return self.__maxSectionId
00116
00117   def insertSection(self, sectionId, beforeSectionId=None):
00118     """ Inserts a previously added section (with insert=0)
00119     to the specified position in the report.
00120
00121     \param sectionId       Id of the section to be inserted
00122     \param beforeSectionId Id of the section that will come after the section specified
00123                            by \a sectionId. If it is None then it is appended to the end.
00124                            Defaults to None.
00125     """
00126     if beforeSectionId is not None:
00127       self.__root.insertBefore(self.__sectionNodes[sectionId], self.__sectionNodes[beforeSectionId])
00128     else:
00129       self.__root.appendChild(self.__sectionNodes[sectionId])
00130
00131   def addSectionItem(self, sectionId, label, text, url=''):
00132     """ Adds a section item.
00133     Section items are entries with a label and text and an optional URL.
00134
00135     \param sectionId Id of the section that this item will be inserted in.
00136     \param label     Item label
00137     \param text      Item text
00138     \param url       Item URL
00139     """
00140     sectionNode = self.__sectionNodes[sectionId]
00141     itemNode = self.__doc.createElementNS(LAT_NAMESPACE, 'Item')
00142     itemNode.appendChild(self.__createHTMLNode('Label',label))
00143     itemNode.appendChild(self.__createHTMLNode('Text',text))
00144     if (url != '') & (url != None):
00145       linkNode = self.__doc.createElementNS(LAT_NAMESPACE, 'Link')
00146       data = self.__doc.createTextNode(url)
00147       linkNode.appendChild(data)
00148       itemNode.appendChild(linkNode)
00149     sectionNode.appendChild(itemNode)
00150
00151   def addSectionImage(self, sectionId, caption, url, width='', height=''):
00152     """ Adds an image to a section. Images can have a caption,
00153     and an optional width and height. The url parameter specifies the
00154     location of the image.
00155
00156     \param sectionId Id of the section that this image will be inserted in.
00157     \param caption   Image caption
00158     \param url       Image source URL
00159     \param width     Optional width of the image
00160     \param height    Optional height of the image
00161     """
00162     sectionNode = self.__sectionNodes[sectionId]
00163     imageNode = self.__doc.createElementNS(LAT_NAMESPACE, 'Image')
00164     imageNode.appendChild(self.__createHTMLNode('Caption',caption))
00165     linkNode = self.__doc.createElementNS(LAT_NAMESPACE, 'Link')
00166     data = self.__doc.createTextNode(url)
00167     linkNode.appendChild(data)
00168     imageNode.appendChild(linkNode)
00169     if width != '':
00170       widthNode = self.__doc.createElementNS(LAT_NAMESPACE, 'Width')
00171       data = self.__doc.createTextNode(str(width))
00172       widthNode.appendChild(data)
00173       imageNode.appendChild(widthNode)
00174     if height != '':
00175       heightNode = self.__doc.createElementNS(LAT_NAMESPACE, 'Height')
00176       data = self.__doc.createTextNode(str(height))
00177       heightNode.appendChild(data)
00178       imageNode.appendChild(heightNode)
00179     sectionNode.appendChild(imageNode)
00180
00181
00182   def addSectionTable(self, sectionId, border='1', width=''):
00183     """ Adds a table to a section. Border and width are optional
00184
00185     \param sectionId Id of the section that this image will be inserted in.
00186     \param border    Specifies whether the table will have a border or not. Default value is 1.
00187     \param width     Specifies the width of the border in percentage relative to the width of the page.
00188
00189     \return          Table id.
00190     """
00191     self.__maxTableId += 1
00192     sectionNode = self.__sectionNodes[sectionId]
00193     tableNode = self.__doc.createElementNS(LAT_NAMESPACE, 'Table')
00194     if border != '':
00195       tableNode.setAttributeNS(LAT_NAMESPACE, 'border', border)
00196     if width != '':
00197       tableNode.setAttributeNS(LAT_NAMESPACE, 'width', width)
00198     sectionNode.appendChild(tableNode)
00199     self.__tableNodes[self.__maxTableId] = tableNode
00200     return self.__maxTableId
00201
00202   def addTableHeader(self, tableId, text, align=''):
00203     """ Adds one column header to the table.
00204
00205     \param tableId Id of the table where column headers are being added.
00206     \param text    Column header text.
00207     \param align   Optional text alignment.
00208     """
00209     tableNode = self.__tableNodes[tableId]
00210     tr = self.findTag(tableNode, 'TR')
00211     if tr is None:
00212       tr = self.__doc.createElementNS(LAT_NAMESPACE, 'TR')
00213       tableNode.appendChild(tr)
00214     th = self.__doc.createElementNS(LAT_NAMESPACE, 'TH')
00215     if align != '':
00216       th.setAttributeNS(LAT_NAMESPACE, 'align', align)
00217     #data = self.__doc.createTextNode(text)
00218     #th.appendChild(data)
00219     th.appendChild(self.__createHTMLDom(text))
00220     tr.appendChild(th)
00221
00222   def beginTableRow(self, tableId):
00223     """ Starts a table row.
00224
00225     \param tableId Id of the table where the row is being added.
00226     """
00227     tableNode = self.__tableNodes[tableId]
00228     tr = self.__doc.createElementNS(LAT_NAMESPACE, 'TR')
00229     tableNode.appendChild(tr)
00230     self.__currentTableRow = tr
00231
00232   def addTableData(self, text, url='', align='', width=''):
00233     """ Adds a data column to the table row that was started by the last
00234     beginTableRow() call.
00235
00236     \param text  Text of the data column.
00237     \param url   Optional. If the text refers to a hyperlink provide the URL here.
00238     \param align Optional text alignment.
00239     \param width Optional column width in percentage.
00240     """
00241     tr = self.__currentTableRow
00242     if tr is None:
00243       raise RuntimeError, "No current row"
00244     else:
00245       td = self.__doc.createElementNS(LAT_NAMESPACE, 'TD')
00246       if align != '':
00247         td.setAttributeNS(LAT_NAMESPACE, 'align', align)
00248       if width != '':
00249         td.setAttributeNS(LAT_NAMESPACE, 'width', align)
00250       if url != '':
00251         href = self.__doc.createElementNS(LAT_NAMESPACE, 'A')
00252         href.setAttributeNS(LAT_NAMESPACE, 'href',url)
00253       data = self.__createHTMLDom(str(text))
00254       if url != '':
00255         href.appendChild(data)
00256         data = href
00257       td.appendChild(data)
00258       tr.appendChild(td)
00259
00260
00261   def findTag(self, node, tagName):
00262     tNode = None
00263     for n in self.getChildNodes(node):
00264       if n.tagName == tagName:
00265         tNode = n
00266         break
00267     return tNode
00268
00269   def xmlToString(self):
00270     xmlStr = StringIO()
00271     PrettyPrint(self.__doc, xmlStr)
00272     #self.__doc.writexml(xmlStr)
00273     return xmlStr.getvalue()
00274
00275   def transformToFile(self, xslFileName, htmlFileName):
00276     """ Based on the input template and output filename parameters
00277     creates an HTML report.
00278
00279     \param xslFileName  Input XSLT template file name.
00280     \param htmlFileName Output HTML filename.
00281     """
00282     xslFile = file(xslFileName)
00283     htmlFile = file(htmlFileName, 'w+')
00284     Pyana.transform2Writer(self.xmlToString(), xslFile, htmlFile)
00285     self.__reports.append(htmlFileName)
00286
00287   def getReports(self):
00288     return self.__reports
00289
00290   def getChildNodes(self, node):
00291     childNodes = []
00292     for n in node.childNodes:
00293       if (n.nodeType == Node.TEXT_NODE and \
00294           (n.data[0] == '\n' or n.data[0].strip() == '')) \
00295           or n.nodeType == Node.COMMENT_NODE:
00296         pass
00297       else:
00298         childNodes.append(n)
00299     return childNodes
00300
00301 ##private
00302   def __createHTMLDom(self, text):
00303     return self.__createHTMLNode('cdatanode', text)
00304
00305   def __createHTMLNode(self, nodeName, text):
00306     htmlString = '<'+nodeName+'>' + text + '</'+nodeName+'>'
00307     #htmlDoc = Sax2.FromXml(htmlString).documentElement
00308     htmlDoc = NonvalidatingReader.parseString(htmlString, 'urn:dummy').documentElement
00309     return self.__doc.importNode(htmlDoc,1)
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcTransitions.py Source File

runcontrol

rcTransitions.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT finite state transistions classes"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2006/07/19 20:06:56 $").split(' ')[1]
00014 __version__  = "$Revision: 2.137 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 from   threading import Thread, Event, Lock
00021 import logging   as     log
00022 import os
00023 import time
00024 import sys
00025 import types
00026 import struct
00027
00028 import rcReportGen
00029 import rcRunIdHelper
00030 import rcHouseKeeping
00031 import rcFitsWriter
00032 import rcArchiver
00033 import LATsweep
00034 import rcComplStatus
00035 import rcTestReport
00036 import rcUtil
00037 from   RunControlCommon import RunControlCommon
00038
00039
00040 from   LATTE.tools              import FreeSpace
00041 from   LATTE.tools              import DataExport
00042 from   LATTE.trigger            import rcDefaultTrigger
00043 from   LATTE.client             import gLog, gException
00044 from   LATTE.database           import gGLT
00045 from   LATTE.client.gEvtCli     import EvtCli
00046 from   LATTE.database.gVersions import Gversions, ROOT_DIR_ENVS
00047
00048 class rcTransitions(object):
00049   "Class that handles the state machine transitions issued by Run Control"
00050   __SWEEP_MARKER     = 5               # Arbitrary marker value for recognizing
00051                                        #   when the event pipeline is flushed
00052
00053   COMPL_STATUS_UNDEFINED            = \
00054       rcComplStatus.rcCompletionStatus.getCompletionStatus('UNDEFINED')
00055   COMPL_STATUS_ABORTED              = \
00056       rcComplStatus.rcCompletionStatus.getCompletionStatus('ABORTED')
00057   COMPL_STATUS_ERROR                = \
00058       rcComplStatus.rcCompletionStatus.getCompletionStatus('FAILED')
00059   COMPL_STATUS_SUCCESS              = \
00060       rcComplStatus.rcCompletionStatus.getCompletionStatus('PASSED')
00061   COMPL_STATUS_FAILED               = \
00062       rcComplStatus.rcCompletionStatus.getCompletionStatus('FAILED')
00063   COMPL_STATUS_PASSED               = \
00064       rcComplStatus.rcCompletionStatus.getCompletionStatus('PASSED')
00065   COMPL_STATUS_PASSED_CONDITIONALLY = \
00066       rcComplStatus.rcCompletionStatus.getCompletionStatus('PASSED CONDITIONALLY')
00067   COMPL_STATUS_MARGINAL             = \
00068       rcComplStatus.rcCompletionStatus.getCompletionStatus('MARGINAL')
00069   COMPL_STATUS_OPERATOR_ABORTED = \
00070       rcComplStatus.rcCompletionStatus.getCompletionStatus('OPERATOR ABORTED')
00071   COMPL_STATUS_INCOMPLETE = \
00072       rcComplStatus.rcCompletionStatus.getCompletionStatus('INCOMPLETE')
00073
00074   # Database node for storing session variables
00075   #__dbn      = GDBN()
00076
00077   # Watermark for diskspace warning
00078   DISKSPACE_WARN_LEVEL = (200*1024*1024)
00079
00080   # Deadtime related constants
00081   DEADTIME_RATE_IN_MHZ = 20.0
00082   TIMEBASE_RATE_IN_MHZ = 16.6666667
00083
00084   EVENT_HANDLER_STANDARD      = 0
00085   EVENT_HANDLER_LEAN_AND_MEAN = 1
00086   EVENT_HANDLER_PLAYBACK      = 2
00087   EVENT_HANDLER_CUSTOM        = 3
00088
00089
00090   def __init__(self, rc, userId, debug):
00091     fn = "rcTransitions.__init__"
00092     log.debug("%s -- %s" % (fn, self.getName()))
00093     self.__userId      = userId
00094
00095     # Used in case the script is run in standalone mode
00096     if debug.__class__.__name__ == 'RunControlCommon':
00097       self.__common      = debug
00098       self.__debug       = None
00099     else:
00100       self.__debug       = debug
00101       if rc is not None:
00102         self.__common    = rc.common()
00103       else:
00104         raise RuntimeError, "Please supply a RunControlCommon object"
00105
00106     # The following data members are meant to be marked "protected"
00107     self.rc                    = rc
00108     self.gui                   = rc # For backward compatibility
00109
00110     self.__complStatus         = rcComplStatus.rcCompletionStatus()
00111
00112     self.prefs                 = self.__common.prefMan().preferences()
00113     if self.__common.getLAT() is None:
00114       if rc is not None:
00115         rc.execGUImethod(rc.loadSchema)
00116       else:
00117         msg = "Please select a schema first"
00118         log.error(msg)
00119         raise RuntimeError, msg
00120     self.lat                   = self.__common.getLAT()
00121     self.xbrd                  = self.__common.getXBRD()
00122     self.ocs                   = self.__common.getOCS()
00123     self.evtCli                = self.__common.getEvtCli()
00124     self.__cmdCli              = self.__common.getCmdCli()
00125
00126     self.__trigger             = None
00127     self.__archiver            = None
00128     self.__archiverClass       = None
00129     self.__fits                = None
00130     self.__errArchiver         = None
00131     self.__badArchiver         = None
00132     self.__eventHandlerReady   = Event()
00133     self.__sweepEvent          = Event()
00134     self.__sweepEvent.set()
00135     self.__evtHandlerQuit      = False
00136
00137     self.evtCnt                = 0
00138     self.__SBCevtCnt           = 0
00139     self.__pauseCount          = 0
00140     self.__pausedTime          = 0
00141     self.__pauseTime           = None
00142     self.__startTime           = None
00143     self.__strobeTime          = None
00144     self.__elapsedTime         = 0
00145     self.__endTime             = None
00146     self.__excludedTime        = 0
00147     self.__excludeTime         = 0
00148     self.__excluding           = False
00149     self.__excludeLock         = Lock()
00150     self.__badEvents           = 0
00151     self.__errEvents           = 0
00152     self.__trgParErrorEvt      = 0
00153     self.__pktErrorEvt         = 0
00154     self.__hsk                 = None
00155     self.__tstamp              = None
00156     self.__tstampRaw           = None
00157     self.__deadtimeLock        = Lock()
00158     self.__deadtimeCtrReg      = {}
00159     self.__deadTimeVal         = {}
00160     self.__deadTimeTS          = {}
00161     self.__avgDeadTime         = {}
00162     self.__statMon             = None
00163     self.__dgSize              = 0
00164     self.__dgSumSize           = 0L
00165     self.__lastDgSumSize       = 0
00166     self.__instByteRate        = 0.0
00167     self.__lastEvtCnt          = 0
00168     self.__lastSBCevtCnt       = 0
00169     self.__lastTime            = 0
00170     self.__lastSBCtime         = 0
00171     self.__lastDgSumSize       = 0
00172     self.__instByteRate        = 0.0
00173
00174     # This will contain the parent suite name during execution
00175     self.__suite               = None
00176
00177     # This will contain the parent suite instance during execution
00178     self.__suiteInst           = None
00179
00180     # This will be True if it is the last script in the suite
00181     self.__lastSuiteScript     = False
00182
00183     self.__EBFplayback         = self.__common.options().playback is not None
00184
00185     self.__runIdHelper         = rcRunIdHelper.rcRunIdHelper(self.prefs)
00186     self.runId                 = 'N/A'
00187
00188     self.__customReportData    = {}
00189
00190     if rc is not None:
00191       self.__paramVerifier       = self.rc.parameterVerifier()
00192
00193     self.__verifyStatus        = None
00194
00195     self.__appStatus           = None
00196     self.__completionStatus    = self.COMPL_STATUS_UNDEFINED
00197
00198     self.__dds               = self.__common.getDDS()
00199
00200     # Contains the full path for the run based message log
00201     self.__runMsgLogFile = None
00202
00203     # Contains a dictionary of snapshot results
00204     self.__snapResult = {}
00205
00206     if self.rc is not None and 'statusMonitor' in dir(rc):
00207       statMon = self.rc.statusMonitor()
00208       statMon.addWatchItem('Run Id', self.getRunId)
00209       statMon.addWatchItem('Test Name', self.getName)
00210       statMon.addWatchItem('Suite Name', self.getSuite)
00211       statMon.addWatchItem('Additional Input Files', self.getAddlInputFiles)
00212       statMon.addWatchItem('Completion Status', self.getCompletionStatusStr,
00213                             alarmExpr="@!='" + self.__complStatus.getCompletionStatusStr(rcTransitions.COMPL_STATUS_PASSED)+"'")
00214       statMon.addWatchItem('Event Count', self.getEventCount)
00215       statMon.addWatchItem('TEM Error Events', self.getErrorEvents, alarmExpr='!=0')
00216       statMon.addWatchItem('Trg Parity Error Events', self.getTrgParityErrorEvents, alarmExpr='!=0')
00217       statMon.addWatchItem('Packet Error Events', self.getPacketErrorEvents, alarmExpr='!=0')
00218       statMon.addWatchItem('Bad SBC Events', self.getBadEvents, alarmExpr='!=0')
00219       statMon.addWatchItem('Start Time', self.getStartTime)
00220       statMon.addWatchItem('End Time', self.getEndTime)
00221       statMon.addWatchItem('Elapsed Time', self.getElapsedTime)
00222       statMon.addWatchItem('Average SBC Event Rate', self.getSBCEventRate)
00223       statMon.addWatchItem('Instant SBC Event Rate', self.getInstSBCEventRate)
00224       statMon.addWatchItem('Average Event Rate', self.getEventRate)
00225       statMon.addWatchItem('Instant Event Rate', self.getInstEventRate)
00226       statMon.addWatchItem('Average Datagram Size', self.getAvgDatagramSize)
00227       statMon.addWatchItem('Instant Datagram Size', self.getInstDatagramSize)
00228       #statMon.addWatchItem('Average Byte Rate', self.getAvgByteRate)
00229       statMon.addWatchItem('Instant Byte Rate', self.getInstByteRate)
00230       statMon.addWatchItem('Avg DeadTime', self.getAvgDeadTime, offBoard=True)
00231       statMon.addWatchItem('GEM DeadTime (Avg , Inst)', self.getGemDeadTime, offBoard=True)
00232       statMon.addWatchItem('Pause Count', self.getPauseCount)
00233       statMon.addWatchItem('Paused Time', self.getPausedTime)
00234       statMon.addWatchItem('Run Message Log File', self.getRunMsgLogFile)
00235       statMon.addWatchItem('Archive File', self.getArchiveFile)
00236       #statMon.addWatchItem('FITS File', self.getFITSfile)
00237       #statMon.addWatchItem('HSK File', self.getHSKfile)
00238       #statMon.addWatchItem('Bad SBC Events File', self.getBadEventsFile)
00239       #statMon.addWatchItem('TEM Error Events File', self.getErrorEventsFile)
00240       statMon.addWatchItem('SBC Handled Events', self.getSBCHandledEvents, offBoard=True)
00241       statMon.addWatchItem('Valid Events', self.getValidEvents, offBoard=True)
00242       statMon.addWatchItem('Failed Event TCP Sends', self.getFailedEventSends, alarmExpr='!=0', offBoard=True)
00243       statMon.addWatchItem('Failed Event H/W Xmits', self.getFailedEvents, alarmExpr='!=0', offBoard=True)
00244       statMon.addWatchItem('Discarded Events', self.getDiscardedEvents, alarmExpr='!=0', offBoard=True)
00245       statMon.addWatchItem('Length Mismatched Events', self.getLengthMismatchedEvents, alarmExpr='!=0', offBoard=True)
00246       statMon.addWatchItem('Unsent Events', self.getUnsentEvents, alarmExpr='!=0', offBoard=True)
00247       statMon.addWatchItem('Error Log Count', self.__common.getErrorLogCount, alarmExpr='!=0')
00248       statMon.addWatchItem('Free Disk Space', FreeSpace.FreeSpace,
00249                            alarmExpr='<'+ str(rcTransitions.DISKSPACE_WARN_LEVEL))
00250       self.__statMon = statMon
00251
00252     self.__reportGen = rcReportGen.rcReportGen(os.path.join(self.prefs["reportdir"], 'rcReport.out'), self.prefs)
00253
00254     try:
00255       self.setArchiverClass(rcArchiver.rcArchiver)
00256     except (ImportError, IOError), e:
00257       log.error("%s: Archiver disabled: %s" % (fn, e))
00258
00259     if self.__common.options().noerrfile is not None:
00260       self.handleEventOutput = self.__handleEventOutputStub
00261     else:
00262       self.handleEventOutput = self.__handleEventOutput
00263
00264   def getFailedEvents(self):
00265     """\brief Return failed event count.
00266
00267     OES increments this counter when
00268     there is a packet transmission error.
00269
00270     \return Failed event count.
00271     """
00272     if self.__cmdCli.isConnected():
00273       try:
00274         saveDebug = self.__cmdCli.getDebug()
00275         self.__cmdCli.setDebug(0)
00276         cnt = self.ocs.stats_failed_events
00277         self.__cmdCli.setDebug(saveDebug)
00278         return cnt
00279       except: pass
00280     return 0
00281
00282   def getFailedEventSends(self):
00283     """\brief Return number of failed event sends.
00284
00285     OES increments this counter when there is a TCP
00286     transport problem between the SBC and the teststand.
00287
00288     \return Number of failed event sends.
00289     """
00290     if self.__cmdCli.isConnected():
00291       try:
00292         saveDebug = self.__cmdCli.getDebug()
00293         self.__cmdCli.setDebug(0)
00294         cnt = self.ocs.stats_failed_event_sends
00295         self.__cmdCli.setDebug(saveDebug)
00296         return cnt
00297       except: pass
00298     return 0
00299
00300   def getSBCHandledEvents(self):
00301     """\brief Return number of events handled by the SBC.
00302
00303     OES increments this counter when an event has been
00304     received by the event handler.
00305
00306     \return Number of events handled by the SBC.
00307     """
00308     if self.__cmdCli.isConnected():
00309       try:
00310         saveDebug = self.__cmdCli.getDebug()
00311         self.__cmdCli.setDebug(0)
00312         self.__SBCevtCnt = self.ocs.stats_handled_events
00313         self.__cmdCli.setDebug(saveDebug)
00314         return self.__SBCevtCnt
00315       except: pass
00316     return 0
00317
00318   def getValidEvents(self):
00319     """\brief Return number of events successfully sent.
00320
00321     OES increments this counter when an event has been
00322     successfully transmitted to the teststand.
00323
00324     \return Number of valid events sent.
00325     """
00326     if self.__cmdCli.isConnected():
00327       try:
00328         saveDebug = self.__cmdCli.getDebug()
00329         self.__cmdCli.setDebug(0)
00330         cnt = self.ocs.stats_valid_events
00331         self.__cmdCli.setDebug(saveDebug)
00332         return cnt
00333       except: pass
00334     return 0
00335
00336   def getDiscardedEvents(self):
00337     """\brief Return number of events discarded.
00338
00339     OES increments this counter when an event has been
00340     discarded. Currently this method always returns 0.
00341
00342     \return Number of events discarded.
00343     """
00344     if self.__cmdCli.isConnected():
00345       try:
00346         saveDebug = self.__cmdCli.getDebug()
00347         self.__cmdCli.setDebug(0)
00348         cnt = self.ocs.stats_discarded_event_sends
00349         self.__cmdCli.setDebug(saveDebug)
00350         return cnt
00351       except: pass
00352     return 0
00353
00354   def getLengthMismatchedEvents(self):
00355     """\brief Return number of length mismatched events.
00356
00357     OES increments this counter when an event size doesn't
00358     match the length specified in the event.
00359     Currently this method always returns 0.
00360
00361     \return Number of length mismatched events.
00362     """
00363     if self.__cmdCli.isConnected():
00364       try:
00365         saveDebug = self.__cmdCli.getDebug()
00366         self.__cmdCli.setDebug(0)
00367         cnt = self.ocs.stats_length_mismatch_count
00368         self.__cmdCli.setDebug(saveDebug)
00369         return cnt
00370       except: pass
00371     return 0
00372
00373   def getUnsentEvents(self):
00374     """\brief Return number of events filtered or prescaled.
00375
00376     OES increments this counter when there is a filter
00377     or prescale set that prevents the event from being
00378     transmitted.
00379
00380     \return Number of unsent events.
00381     """
00382     if self.__cmdCli.isConnected():
00383       try:
00384         saveDebug = self.__cmdCli.getDebug()
00385         self.__cmdCli.setDebug(0)
00386         cnt = self.ocs.stats_events_not_sent
00387         self.__cmdCli.setDebug(saveDebug)
00388         return cnt
00389       except: pass
00390     return 0
00391
00392   def getAvgDeadTime(self, temId=None):
00393     """\brief Return the average deadtime.
00394
00395     Returns the average deadtime as a percentage for a TEM specified by \a temId
00396     or all TEMs in the schema as a dictionary.
00397
00398     \return Average deadtime(s)
00399     """
00400     if self.__cmdCli.isConnected():
00401       self.__deadtimeLock.acquire()
00402       avgDeadTimes = self.__calcDeadTime(temId)
00403       self.__deadtimeLock.release()
00404       if temId is not None:
00405         if avgDeadTimes[temId] is not None:
00406           self.__avgDeadTime[temId] = "%3.3f" % avgDeadTimes[temId]
00407         else:
00408           self.__avgDeadTime[temId] = "N/A"
00409         return self.__avgDeadTime[temId]
00410       else:
00411         for (id, dt) in avgDeadTimes.items():
00412           if dt is not None:
00413             self.__avgDeadTime[id] = "%3.3f" % dt
00414           else:
00415             self.__avgDeadTime[id] = "N/A"
00416     return self.__avgDeadTime
00417
00418   def getGemDeadTime(self):
00419     """\brief Return the Average GEM dead time as a percentage
00420     """
00421     if self.__cmdCli.isConnected():
00422       if not self.lat.existsGEM():
00423         return ("N/A", "N/A")
00424       saveDebug = self.__cmdCli.getDebug()
00425       self.__deadtimeLock.acquire()
00426       if 'GEM' not in self.__deadTimeVal.keys() or \
00427          'GEM' not in self.__deadTimeTS.keys()  or \
00428           self.__startTime is None:
00429         self.__deadtimeLock.release()
00430         return ("N/A", "N/A")
00431       gst = self.lat.GEM.GEMST
00432       self.__cmdCli.setDebug(0)
00433       try:
00434         val, ts = gst.extCtrRead(gst.regs['livetime'].id()).payloads()
00435       except gException.LATInterfaceException, e:
00436         if e.errstr()[0] == 'OCS_TMO':
00437           self.__deadtimeLock.release()
00438           return ("TO", "TO")
00439         else:
00440           raise
00441
00442       # need to remove excluded time from both numerator and denominator
00443       excludeTime = (time.time() - self.__startTime - self.__getElapsedTime()) * rcTransitions.DEADTIME_RATE_IN_MHZ * 1000000
00444       dTime = val - self.__deadTimeVal['GEM'] - excludeTime
00445       iDTime = val - self.__deadTimeVal['LASTGEM']
00446       dTS   = (ts - self.__deadTimeTS['GEM']) - excludeTime
00447       iDTS  = (ts - self.__deadTimeTS['LASTGEM'])
00448       self.__deadtimeLock.release()
00449       self.__cmdCli.setDebug(saveDebug)
00450
00451       if dTS != 0:
00452         avgLiveTime =  (float(dTime)/float(dTS)) * 100.0
00453       else:
00454         avgLiveTime = None
00455         return ("N/A", "N/A")
00456
00457       if iDTS != 0:
00458         instLiveTime = (float(iDTime)/float(iDTS)) * 100.0
00459       else:
00460         instLiveTime = 0.0
00461
00462       self.__deadTimeVal['LASTGEM'] = val
00463       self.__deadTimeTS['LASTGEM'] = ts
00464
00465       return ("%3.3f" % (100.0 - avgLiveTime), "%3.3f" % (100.0 - instLiveTime))
00466
00467
00468   def getRunId(self):
00469     """\brief Return the run id
00470
00471     \return Run id
00472     """
00473     return self.runId
00474
00475   def getSchemaConfigFile(self):
00476     """\brief Return the full path of the schema file
00477
00478     \return Schema file path
00479     """
00480     return self.getSessionVar('_LATSchemaFile')
00481
00482   def getAddlInputFiles(self):
00483     """\brief Return a list containing the additional input files.
00484
00485     This list is automatically generated from the XML files included
00486     in the schema using the <include> tag. The list contains only the
00487     filename portion and doesn't include the full path.
00488
00489     \return List of additional input files.
00490     """
00491     if self.lat is not None:
00492       return [f for (p,f) in map(os.path.split, self.lat._GLAT__includeFiles)]
00493
00494   def getRunMsgLogFile(self):
00495     """\brief Return the filename for the message log for the current run.
00496
00497     \return Message log filename.
00498     """
00499     if self.__runMsgLogFile is not None:
00500       return os.path.basename(self.__runMsgLogFile)
00501     else:
00502       return None
00503
00504   def getArchiveFile(self):
00505     """\brief Return the filename for the archive file (LDF file).
00506
00507     \return Archive filename.
00508     """
00509     if self.__archiver is not None:
00510       return self.__archiver.getFileName()
00511     else:
00512       return None
00513
00514   def getBadEventsFile(self):
00515     """\brief Return the filename for the bad events archive.
00516
00517     \return Bad events archive filename.
00518     """
00519     if self.__badArchiver is not None:
00520       return self.__badArchiver.getFileName()
00521     else:
00522       return None
00523
00524   def getErrorEventsFile(self):
00525     """\brief Return the filename for the error events archive.
00526
00527     \return Error events archive filename.
00528     """
00529     if self.__errArchiver is not None:
00530       return self.__errArchiver.getFileName()
00531     else:
00532       return None
00533
00534   def getFITSfile(self):
00535     """\brief Return the filename for the FITS file.
00536
00537     \return FITS filename.
00538     """
00539     if self.__fits is not None:
00540       return self.__fits.getFileName()
00541     else:
00542       return None
00543
00544   def getHSKfile(self):
00545     """\brief Return the filename for the housekeeping FITS file.
00546
00547     \return Housekeeping FITS filename.
00548     """
00549     if self.__hsk is not None:
00550       return self.__hsk.getFileName()
00551     else:
00552       return None
00553
00554
00555   def getPauseCount(self):
00556     """\brief Return number of times the test is paused.
00557
00558     \return Pause count
00559     """
00560     return self.__pauseCount
00561
00562   def getPausedTime(self):
00563     """\brief Return the amount of time spent in pause.
00564
00565     \return Pause time.
00566     """
00567     if self.__pauseTime is not None:
00568       return "%.2f seconds" % (self.__pausedTime + (time.time() - self.__pauseTime))
00569     else:
00570       return "%.2f seconds" % self.__pausedTime
00571
00572   def getEventCount(self):
00573     """\brief Return number of events received.
00574
00575     \return Event count
00576     """
00577     return self.evtCnt
00578
00579   def getElapsedTime(self):
00580     """\brief Return the elapsed time spent during test execution.
00581
00582     \return Elapsed time.
00583     """
00584     return "%.2f seconds"  % self.__getElapsedTime()
00585
00586   def __getElapsedTime(self):
00587     self.__excludeLock.acquire()
00588     if self.__strobeTime is not None and \
00589        self.__pauseTime  is     None and not self.__excluding:
00590       elapsedTime = self.__elapsedTime + (time.time() - self.__strobeTime)
00591     else:
00592       elapsedTime = self.__elapsedTime
00593     self.__excludeLock.release()
00594     return elapsedTime
00595
00596
00597   def getEventRate(self):
00598     """\brief Return the event rate.
00599
00600     \return Event rate.
00601     """
00602     self.__excludeLock.acquire()
00603     if self.__strobeTime is not None and \
00604        self.__pauseTime  is     None and not self.__excluding:
00605       elapsedTime = self.__elapsedTime + (time.time() - self.__strobeTime)
00606       if elapsedTime > 0:
00607         msg = "%.2f events/sec" % (self.evtCnt / elapsedTime)
00608       else:
00609         msg = "N/A"
00610     elif self.__elapsedTime == 0:
00611       msg = "N/A"
00612     else:
00613       msg = "%.2f events/sec" % (self.evtCnt / (self.__elapsedTime))
00614     self.__excludeLock.release()
00615     return msg
00616
00617   def getSBCEventRate(self):
00618     """\brief Return the SBC event handling rate.
00619
00620     \return SBC event handling rate.
00621     """
00622     self.__excludeLock.acquire()
00623     if self.__strobeTime is not None and \
00624        self.__pauseTime  is     None and not self.__excluding:
00625       elapsedTime = self.__elapsedTime + (time.time() - self.__strobeTime)
00626       if elapsedTime > 0:
00627         msg = "%.2f events/sec" % (self.__SBCevtCnt / elapsedTime)
00628       else:
00629         msg = "N/A"
00630     elif self.__elapsedTime == 0:
00631       msg = "N/A"
00632     else:
00633       msg = "%.2f events/sec" % (self.__SBCevtCnt / (self.__elapsedTime))
00634     self.__excludeLock.release()
00635     return msg
00636
00637   def getInstEventRate(self):
00638     """\brief Return the instant event rate.
00639
00640     \return Instant event rate.
00641     """
00642     self.__excludeLock.acquire()
00643     evtCnt               = self.evtCnt
00644     dC                   = evtCnt - self.__lastEvtCnt
00645     self.__lastEvtCnt    = evtCnt
00646
00647     dgSumSize            = self.__dgSumSize
00648     dS                   = dgSumSize - self.__lastDgSumSize
00649     self.__lastDgSumSize = dgSumSize
00650
00651     now                  = time.time()
00652     dT                   = now - self.__lastTime
00653     self.__lastTime      = now
00654
00655     if dT == 0:  dT = .00001
00656     msg = "%.2f events/sec" % (float(dC) / dT)
00657     self.__instByteRate = float(dS) / dT
00658     self.__excludeLock.release()
00659     return msg
00660
00661   def getInstSBCEventRate(self):
00662     """\brief Return the instant SBC event handling rate.
00663
00664     \return Instant SBC event handling rate.
00665     """
00666     self.__excludeLock.acquire()
00667     evtCnt               = self.__SBCevtCnt
00668     dC                   = evtCnt - self.__lastSBCevtCnt
00669     self.__lastSBCevtCnt    = evtCnt
00670
00671     now                  = time.time()
00672     dT                   = now - self.__lastSBCtime
00673     self.__lastSBCtime   = now
00674
00675     if dT == 0:  dT = .00001
00676     msg = "%.2f events/sec" % (float(dC) / dT)
00677     self.__excludeLock.release()
00678     return msg
00679
00680   def getInstDatagramSize(self):
00681     """\brief Return the instant datagram size.
00682
00683     \return Instant datagram size.
00684     """
00685     self.__excludeLock.acquire()
00686     msg = str(self.__dgSize)
00687     self.__excludeLock.release()
00688     return msg
00689
00690   def getAvgDatagramSize(self):
00691     """\brief Return the instant datagram size divided by the number of events.
00692
00693     \return Average datagram size
00694     """
00695     self.__excludeLock.acquire()
00696     if self.evtCnt:
00697       msg = str(float(self.__dgSumSize) / float(self.evtCnt))
00698     else:
00699       msg = "N/A"
00700     self.__excludeLock.release()
00701     return msg
00702
00703   def getInstByteRate(self):
00704     """\brief Return the instant datagram byte rate
00705
00706     \return Average datagram byte rate
00707     """
00708     return "%.2f Kbytes/sec" % (self.__instByteRate / 1024)
00709
00710   def getStartTime(self):
00711     """\brief Return the test start time
00712
00713     \return Test start time in GMT as a tuple
00714     """
00715     if self.__startTime is not None:
00716       return time.asctime(time.gmtime(self.__startTime))
00717     else:
00718       return None
00719
00720   def getEndTime(self):
00721     """\brief Return the test end time
00722
00723     \return Test end time in GMT as a tuple
00724     """
00725     if self.__endTime is not None:
00726       return time.asctime(time.gmtime(self.__endTime))
00727     else:
00728       return None
00729
00730   def getBadEvents(self):
00731     """\brief Return number of events with a bad GGLT status
00732
00733     \return Number of bad events
00734     """
00735     return self.__badEvents
00736
00737   def getErrorEvents(self):
00738     """\brief Return number of error events
00739
00740     \return Number of error events
00741     """
00742     return self.__errEvents
00743
00744   def getTrgParityErrorEvents(self):
00745     """\brief Return number of trigger parity error events
00746
00747     \return Number of trigger parity error events
00748     """
00749     return self.__trgParErrorEvt
00750
00751   def getPacketErrorEvents(self):
00752     """\brief Return number of packet error events
00753
00754     \return Number of packet error events
00755     """
00756     return self.__pktErrorEvt
00757
00758
00759   def setCmdCli(self, cmdCli):
00760     """\brief Set the command client instance (used in suites)
00761
00762     \param A CmdCli instance
00763     """
00764     self.cmdCli = cmdCli
00765
00766   def setEvtCli(self, evtCli):
00767     """\brief Set the event client instance.
00768
00769     Used to set the custom event client.
00770
00771     \param A CmdCli instance
00772     """
00773     log.debug("Event client set to: %s" % evtCli.__class__.__name__)
00774     evtCli.setSocket(self.evtCli.socket())
00775     self.evtCli = evtCli
00776
00777   def getEvtCli(self):
00778     """\brief Return the current event client instance.
00779
00780     \return An EvtCli instance
00781     """
00782     return self.evtCli
00783
00784   def getDataDistributor(self):
00785     """\brief Return the data distribution server instance.
00786
00787     \return Data distribution server instance.
00788     """
00789     return self.__dds
00790
00791   def setSessionVar(self, key, value):
00792     """\brief Set session variable \a key to value \a value.
00793
00794     Session variables are data that is shared between different runs.
00795     They exist as long as the run control session they are defined in.
00796     Typical uses of session variables are to pass data from one suite
00797     script to another or to maintain state during a multiple step
00798     test run.
00799
00800     \param key   Session variable identifier.
00801     \param value Session variable value.
00802     """
00803     sessionVars = self.__common.getDBN()
00804     if sessionVars is not None:
00805       sessionVars[key] = value
00806     else:
00807       raise RuntimeError, "Database node does not exist"
00808
00809   def getSessionVar(self, key):
00810     """\brief Return the session variable identified by \a key.
00811
00812     \param key Session variable identifier.
00813
00814     \return Value of the session variable if it exists,
00815             otherwise None.
00816     """
00817     sessionVars = self.__common.getDBN()
00818     if sessionVars is not None and sessionVars.has_key(key):
00819       return sessionVars[key]
00820     else:
00821       return None
00822
00823   def setPrefs(self, prefs):
00824     """\brief Explicitly set preferences.
00825
00826     When scripts are run in standalone mode it may be
00827     necessary to pass in a script defined set of preferences.
00828
00829     The preferences specified in \a prefs get appended to
00830     the set of preferences read from the configuration file.
00831
00832     \param prefs Preferences as a dictionary.
00833     """
00834     for (key, val) in prefs.items():
00835       self.prefs[key] = val
00836
00837   def setCompletionStatus(self, completionStatus, completionStatusStr=None):
00838     """\brief Sets the completion status of the test.
00839
00840     Please use one of the following:
00841
00842       - COMPL_STATUS_ABORTED              = -2
00843       - COMPL_STATUS_ERROR                = -3
00844       - COMPL_STATUS_FAILED               = -3
00845       - COMPL_STATUS_SUCCESS              =  0
00846       - COMPL_STATUS_PASSED               =  0
00847       - COMPL_STATUS_PASSED_CONDITIONALLY = -4
00848       - COMPL_STATUS_MARGINAL             = -5
00849
00850     Or a user defined completion status in which case
00851     a description needs to be supplied along with the code.
00852
00853     \param completionStatus    Numeric completion status code
00854     \param completionStatusStr Completion status description
00855
00856     """
00857     if not self.__complStatus.isCompletionStatus(completionStatus):
00858       if completionStatusStr is None:
00859         raise RuntimeError, "Need to specify a completion status description " \
00860                             "when specifying a user defined completion status"
00861       else:
00862         addRes = self.__complStatus.addCompletionStatus(completionStatus, completionStatusStr)
00863         if addRes == -2:
00864           raise RuntimeError, "Completion status description '%s' already exists " \
00865                               "under a different status code." % completionStatusStr
00866     self.__completionStatus = completionStatus
00867
00868   def getCompletionStatus(self):
00869     """\brief Return the completion status code.
00870
00871     Returns the code set by the script or
00872     COMPL_STATUS_UNDEFINED if it hasn't been set.
00873
00874     \return Completion status code.
00875     """
00876     if self.__appStatus is None:
00877       return self.__completionStatus
00878     else:
00879       return self.__appStatus
00880
00881   def getCompletionStatusStr(self):
00882     """\brief Return the description of the completion status.
00883
00884     Returns the code as set by the script or
00885     'UNDEFINED' if it hasn't been set.
00886
00887     \return Completion status description.
00888     """
00889     completionStatus = self.getCompletionStatus()
00890     return self.__complStatus.getCompletionStatusStr(completionStatus)
00891     #if completionStatus == rcTransitions.COMPL_STATUS_ABORTED:
00892     #  return("ABORTED")
00893     #elif completionStatus == rcTransitions.COMPL_STATUS_ERROR:
00894     #  return("ERROR")
00895     #elif completionStatus == rcTransitions.COMPL_STATUS_SUCCESS:
00896     #  return("SUCCESS")
00897     #else:
00898     #  return("UNDEFINED")
00899
00900   def getSnapshotStatus(self, snapId=None):
00901     """\brief Return snapshot result(s).
00902
00903     Returns a dictionary of snapshot results or if snapId is specified,
00904     returns the corresponding snapshot status.
00905
00906     \param snapId Optional snapshot id.
00907
00908     \return Snapshot status as a boolean or status dictionary.
00909             None, if a snapshot with an id of \a snapId doesn't exist.
00910     """
00911     if snapId is None:
00912       return self.__snapResult
00913     elif snapId in self.__snapResult:
00914       return self.__snapResult[snapId]
00915     else:
00916       return None
00917
00918   def __isTestComplete(self):
00919     if self.__common.options().securedir is not None:
00920       requiredOptions = ['snapnbl', 'datasave']
00921       complete = True
00922       for option in requiredOptions:
00923         if self.prefs[option] != 1:
00924           complete = False
00925           break
00926       return complete
00927     else:
00928       return True
00929
00930   def getHSK(self):
00931     """
00932     \brief Return the housekeeping class instance.
00933
00934     \return Housekeeping class instance
00935     """
00936     return self.__hsk
00937
00938   def addCustomReportData(self, key, value):
00939     """\brief Add custom report data to the run report.
00940
00941     This method allows the application to add any additional data
00942     that Run Control is not already providing to the run report
00943     (rcReport.out).
00944
00945     When the custom report data gets processed and written to the
00946     database, it will go under the "AdditionFields" column. Please
00947     only provide values that can be converted to a string.
00948
00949     \param key   Custom report data identifier.
00950     \param value Custom report data value.
00951     """
00952     self.__customReportData[key] = value
00953
00954   def getParameterVerifier(self):
00955     """\brief Return the parameter verifier instance
00956
00957     \return Parameter verifier instance
00958     """
00959     return self.__paramVerifier
00960
00961   def addExportedFile(self,file=None,delete=False):
00962     """\brief Add file to the list of files to be exported.
00963
00964     \param file   file to be added
00965     \param delete delete original on export (default False)
00966     """
00967     if file is not None:
00968       (filePath,fileName) = os.path.split(file)
00969       self.__exportedFiles.append( [filePath,fileName,delete] )
00970
00971       # Try to extract the report file from the rcTestReport instance
00972       # that the script may have been using.
00973       if self.__testReport is None:
00974         for objStr in dir(self):
00975           obj = getattr(self, objStr)
00976           if '__class__' in dir(obj):
00977             if rcTestReport.rcTestReport in obj.__class__.__mro__:
00978               self.__testReport = obj
00979               break
00980       if self.__testReport is not None and file in self.__testReport.getReports():
00981         self.__testReportFile = fileName
00982
00983
00984   def getFileTimeStamp(self):
00985     """\brief Return the formatted timestamp used to name output files.
00986
00987     Using this method, applications can request the formatted timestamp
00988     value used in naming archive, snapshot and housekeeping files.
00989     The format is YYMMDDHHMISS.
00990
00991     \return Formatted GMT timestamp
00992     """
00993     return self.__tstamp
00994
00995   def getRawTimeStamp(self):
00996     """\brief Return the raw timestamp as returned from gmtime().
00997
00998     \return Raw GMT timestamp tuple.
00999     """
01000     return self.__tstampRaw
01001
01002   def getSuite(self):
01003     """\brief Return the name of the suite that this script is a part of.
01004
01005     \return Suite name.
01006     """
01007     return self.__suite
01008
01009   def setSuite(self, suite):
01010     """\brief Set name of the suite for this script.
01011
01012     Called from rcSuite.
01013
01014     \param suite Name of the suite
01015     """
01016     self.__suite = suite
01017
01018   def getSuiteInstance(self):
01019     """\brief Return the suite instance that this script is a part of.
01020
01021     \return Suite instance.
01022     """
01023     return self.__suiteInst
01024
01025   def setSuiteInstance(self, suiteInst):
01026     """\brief Set the suite instance for this script.
01027
01028     Called from rcSuite.
01029
01030     \param suiteInst Suite instance.
01031     """
01032     self.__suiteInst = suiteInst
01033
01034   def setLastSuiteScript(self):
01035     """\brief Set the script as the last one in the suite.
01036
01037     Called from rcSuite.
01038     """
01039     self.__lastSuiteScript = True
01040
01041   def isLastSuiteScript(self):
01042     """\brief Check if the script is the last one.
01043
01044     """
01045     return self.__lastSuiteScript
01046
01047   def getState(self):
01048     """\brief Return the state of the running script.
01049
01050     If the script is running as part of a suite then the script
01051     state is simulated.
01052
01053     \return Script state
01054     """
01055     if self.isRunFromSuite():
01056       return self.getSuiteInstance().getAppState()
01057     elif self.rc is not None:
01058       return self.rc.getFSM().current_state
01059
01060
01061   def trigger(self, trg=None, replaceShut=True):
01062     """\brief Return the trigger used in this script or
01063     initialize the trigger.
01064
01065     \param trg         Trigger object.
01066     \param replaceShut Flag to specify whether the trigger's default
01067                        shut logic should be wrapped by Run Control's
01068                        LATsweep shut logic. Default is True.
01069
01070     \return Trigger object.
01071     """
01072     if trg is not None:
01073       self.__trigger = trg
01074       if replaceShut:
01075         # Don't cache the shut call more than once.  Otherwise you get recursion.
01076         if "_shut" not in dir(self.__trigger):
01077           self.__trigger._shut = self.__trigger.shut
01078         latSweep = LATsweep.LATsweep(self.lat, self.__trigger, self.__trigger._shut)
01079         self.__trigger.shut = latSweep.shut
01080     return self.__trigger
01081
01082   def isRunFromSuite(self):
01083     """\brief Check if the script is being run from a suite.
01084
01085     \return True  If the script is being run from a suite,
01086             False otherwise.
01087     """
01088     return self.__suite is not None
01089
01090   def __genReport(self):
01091     log.debug("Generating run report...")
01092     self.__reportGen.initialize(self.__tstampRaw)
01093     self.__reportGen.addField("TestName", self.getName())
01094     if self.__suite is not None:
01095       self.__reportGen.addField("SuiteName", self.__suite)
01096     self.__reportGen.addField("RunId", self.runId)
01097     if self.prefs.has_key("operator"):
01098       self.__reportGen.addField("Operator", self.prefs["operator"])
01099     if self.prefs.has_key("userid"):
01100       self.__reportGen.addField("OperatorId", self.prefs["userid"], rcReportGen.UNITS_LONG)
01101     self.__reportGen.addField("EventCount", str(self.evtCnt), rcReportGen.UNITS_LONG)
01102     self.__reportGen.addField("BadEventCount", str(self.__badEvents), rcReportGen.UNITS_LONG)
01103     self.__reportGen.addField("ErrorEventCount", str(self.__errEvents), rcReportGen.UNITS_LONG)
01104     self.__reportGen.addField("TriggerParityErrorEventCount", str(self.__trgParErrorEvt), rcReportGen.UNITS_LONG)
01105     self.__reportGen.addField("PacketErrorEventCount", str(self.__pktErrorEvt), rcReportGen.UNITS_LONG)
01106     self.__reportGen.addField("PauseCount", str(self.__pauseCount), rcReportGen.UNITS_INT)
01107     self.__reportGen.addField("PausedTime", str(self.__pausedTime), rcReportGen.UNITS_FLOAT)
01108     self.__reportGen.addField("StartTime", str(time.gmtime(self.__startTime)))
01109     self.__reportGen.addField("ElapsedTime", str(self.__elapsedTime), rcReportGen.UNITS_FLOAT)
01110     self.__reportGen.addField("EndTime", str(time.gmtime(self.__endTime)))
01111     self.__reportGen.addField("SBCHandledEvents", str(self.getSBCHandledEvents()), rcReportGen.UNITS_LONG)
01112     self.__reportGen.addField("ValidEvents", str(self.getValidEvents()), rcReportGen.UNITS_LONG)
01113     self.__reportGen.addField("FailedEventTCPSends", str(self.getFailedEventSends()), rcReportGen.UNITS_LONG)
01114     self.__reportGen.addField("FailedEventHWXmits", str(self.getFailedEvents()), rcReportGen.UNITS_LONG)
01115     self.__reportGen.addField("DiscardedEvents", str(self.getDiscardedEvents()), rcReportGen.UNITS_LONG)
01116     self.__reportGen.addField("LengthMismatchedEvents", str(self.getLengthMismatchedEvents()), rcReportGen.UNITS_LONG)
01117     self.__reportGen.addField("UnsentEvents", str(self.getUnsentEvents()), rcReportGen.UNITS_LONG)
01118     self.__reportGen.addField("FreeDiskSpace", str(FreeSpace.FreeSpace()), rcReportGen.UNITS_LONG)
01119     self.__reportGen.addField("SchemaConfigFile", os.path.split(self.__common.getDBN()['_LATSchemaFile'])[1])
01120     self.__reportGen.addField("AdditionalInputFiles", str(self.getAddlInputFiles()))
01121     self.__reportGen.addField("AssociatedFiles", str([exp[1] for exp in self.__exportedFiles]))
01122     self.__reportGen.addField("CallbackParameters", str(self.__common.getOCS().getCallbackParams()))
01123
01124     releases = {}
01125     failed = []
01126     failedNoVersion = []
01127
01128     if int(self.prefs["versionnbl"]) == 1:
01129       try:
01130         self.__waitCursor()
01131         versions = Gversions.getModuleVersions(self.ocs)
01132         for (hwComp, hwVer) in self.__common.getHardwareVersions().items():
01133           if hwComp in versions:
01134             log.warning("Hardware component %s with version %s conflicts with a module of same name" %
01135                         (hwComp, hwVer)
01136                       )
01137           else:
01138             versions[hwComp] = hwVer
01139
01140         for (module, version) in versions.items():
01141           if version.strip() == '':
01142             failedNoVersion.append(module)
01143             failed.append(module)
01144         self.__normalCursor()
01145       except:
01146         log.exception("Error in retrieving version information. Setting VersionData to an empty list.")
01147         versions = {}
01148       self.__reportGen.addField("VersionData", str(versions))
01149
01150     if int(self.prefs["disableverification"]) == 0:
01151       try:
01152         filesToVerify= [self.__common.getDBN()['_LATSchemaFile']] + self.lat._GLAT__includeFiles
01153         if os.environ.has_key("VXW_ROOT"):
01154           filesToVerify.append(os.path.join(os.environ["VXW_ROOT"], "*.vx"))
01155           filesToVerify.append(os.path.join(os.environ["VXW_ROOT"], "lib/mv2304/*.o"))
01156         for env in ROOT_DIR_ENVS:
01157           if os.environ.has_key(env):
01158             release = Gversions.verifyModuleDigests(digestDataFile=None, rootDirEnv=env,
01159                                                     additionalFilesToVerify=filesToVerify)
01160             subsys = env[:env.find("_ROOT")]
01161             releases[subsys] = release[0]
01162             for module in release[1]:
01163               if module not in failed:
01164                 failed.append(module)
01165             noVersionInRelease = False
01166             for module in failedNoVersion:
01167               if module in release[1]:
01168                 noVersionInRelease = True
01169                 break
01170             if len(release[1]) > 0 or noVersionInRelease:
01171               log.error("Some modules failed verification for %s release %s. Check Elogbook for the modules that failed." % (subsys, release[0]))
01172       except:
01173         log.exception("Error in verification. Setting Release and ModulesFailedVerification to empty lists.")
01174         releases = {}
01175         failed = []
01176     self.__reportGen.addField("Release", str(releases))
01177     self.__reportGen.addField("ModulesFailedVerification", str(failed))
01178
01179     if self.__fits is not None:
01180       self.__reportGen.addField("FITSfile", self.__fits.getFileName())
01181     if self.__archiver is not None and self.__archiver.getFileName() is not None:
01182       self.__reportGen.addField("ArchiveFile", self.__archiver.getFileName())
01183     if self.__errArchiver is not None and self.__errArchiver.getFileName() is not None:
01184       self.__reportGen.addField("ErrorArchive", self.__errArchiver.getFileName())
01185     if self.__badArchiver is not None and self.__badArchiver.getFileName() is not None:
01186       self.__reportGen.addField("BadEventArchive", self.__badArchiver.getFileName())
01187     # Change as per LTE-193
01188     #hskOutputEnabled = (int(self.prefs["envmonnbl"]) == 1)
01189     hskOutputEnabled = False
01190     # Change as per LTE-193
01191     #hskReadOnly = (int(self.prefs["envmonreadonly"]) == 1)
01192     hskReadOnly = False
01193     if hskOutputEnabled and self.__hsk is not None and not hskReadOnly:
01194       self.__reportGen.addField("HSKArchive", self.__hsk.getFileName())
01195     if self.prefs.has_key("logfilename"):
01196       self.__reportGen.addField("LogFile", self.prefs["logfilename"])
01197     if self.getRunMsgLogFile() is not None:
01198       self.__reportGen.addField("RunLogFile", self.getRunMsgLogFile())
01199     comments = []
01200     if self.rc is not None:
01201       cw = self.rc.getCommentWidget()
01202       if cw is not None:
01203         hist = cw.getHistory()
01204         tstamp = cw.getTimestamps()
01205         comments += zip(tstamp, hist)
01206       cw = self.rc.getEndRunComments()
01207       if cw is not None:
01208         hist = cw.getHistory()
01209         tstamp = cw.getTimestamps()
01210         comments += zip(tstamp, hist)
01211     self.__reportGen.addField("Comments", str(comments))
01212     for (key, value) in self.__customReportData.items():
01213       self.__reportGen.addField(key, str(value))
01214     if self.prefs is not None:
01215       prefs = self.prefs
01216       if prefs.has_key("lastsite"):
01217         self.__reportGen.addField("Site",           prefs["lastsite"])
01218       if prefs.has_key("lastparticletype"):
01219         self.__reportGen.addField("ParticleType",   prefs["lastparticletype"])
01220       if prefs.has_key("lastinstrumenttype"):
01221         self.__reportGen.addField("InstrumentType", prefs["lastinstrumenttype"])
01222       if prefs.has_key("lastorientation"):
01223         self.__reportGen.addField("Orientation",    prefs["lastorientation"])
01224       if prefs.has_key("lastphase"):
01225         self.__reportGen.addField("Phase",          prefs["lastphase"])
01226     self.__reportGen.addField("AverageDeadTime", str(self.getAvgDeadTime()))
01227     self.__reportGen.addField("GEMDeadTime", str(self.getGemDeadTime()))
01228     if self.__verifyStatus is not None:
01229       self.__reportGen.addField("ParamVerify", str(self.__verifyStatus))
01230     allSerials = self.lat.getAllSerialNos()
01231     repSerials = {}
01232     if allSerials != {}:
01233       for (node, serialnos) in allSerials.items():
01234         strNode = "%s%s" % (node.getName(), node.getIdTuple())
01235         repSerials[strNode] = serialnos
01236       self.__reportGen.addField("SerialNos", str(repSerials))
01237     if self.__testReportFile is not None:
01238       self.__reportGen.addField("ScriptReport", self.__testReportFile)
01239
01240     tc = self.trigger().conditions()
01241     tList = []
01242     if tc.roi():       tList.append("roi")
01243     if tc.calLow():    tList.append("calLow")
01244     if tc.calHigh():   tList.append("calHigh")
01245     if tc.tkr():       tList.append("tkr")
01246     if tc.periodic():  tList.append("periodic")
01247     if tc.solicited(): tList.append("solicited")
01248     if tc.cno():       tList.append("cno")
01249     if tc.external():  tList.append("external")
01250     self.__reportGen.addField("TriggerMask", str(tList))
01251
01252     errorLogCount = self.__common.getErrorLogCount()
01253     self.__reportGen.addField("ErrorLogCount", str(errorLogCount), rcReportGen.UNITS_INT)
01254     # If there are any error logs during the run override the status as FAILED
01255     if self.getCompletionStatus() == self.COMPL_STATUS_PASSED and errorLogCount != 0:
01256       log.warn("Errors were encountered during the run. Overriding the completion status from %s to FAILED." % (self.getCompletionStatusStr()))
01257       self.__appStatus = self.COMPL_STATUS_FAILED
01258     # As per Eduardo's request override the PASSED completion status to be
01259     # INCOMPLETE if any of his criteria (see __isTestComplete) aren't met
01260     elif self.getCompletionStatus() == self.COMPL_STATUS_PASSED and \
01261            not self.__isTestComplete():
01262       log.warn("Test was not complete. Overriding the completion status as INCOMPLETE.")
01263       self.__appStatus = self.COMPL_STATUS_INCOMPLETE
01264
01265     self.__reportGen.addField("CompletionStatus", str(self.getCompletionStatus()), rcReportGen.UNITS_INT)
01266     self.__reportGen.addField("CompletionStatusStr", self.getCompletionStatusStr())
01267
01268     # We're done!
01269     self.__reportGen.writeReportXML()
01270     log.debug("Run report generation complete.")
01271
01272   def takeSnapshot(self, stream=sys.stdout, fileName=None,
01273                    captureGTIC=1, captureGAEQ=1,
01274                    trigger=None,
01275                    configName='', configVersion=''):
01276     """\brief Take a snapshot of the hardware.
01277
01278     If snapshots are enabled in Run Control preferences,
01279     two snapshots will be taken, one before and one after
01280     the test has been run. This method allows the application
01281     to take a snapshot at a specific point of the run.
01282
01283     It is the application's responsibility to add the
01284     resulting file to the list of exported files by calling
01285     the addExportedFile method.
01286
01287     Since snapshots essentially have the same format as
01288     configuration blocks, configName and configVersion parameters
01289     can be used to output a named configuration.
01290
01291     \param stream         Output stream for the snapshot.
01292                           sys.stdout by default.
01293     \param fileName       Full path of the snapshot file.
01294     \param captureGTIC    Capture TEM environmental quantities.
01295                           Enabled by default.
01296     \param captureGAEQ    Capture AEM environmental quantities.
01297                           Enabled by default.
01298     \param trigger        Trigger object. If miniGLT is used as a
01299                           trigger then GLT registers can be snapshot.
01300     \param configName     Configuration name
01301     \param configVersion  Configuration version
01302
01303     \return True  if the snapshot was successful,
01304             False if errors were encountered during snapshot
01305     """
01306
01307     if self.__statMon is not None:
01308       self.rc.execGUImethod(self.__statMon.stopWatch)
01309
01310     result = self.lat.takeSnapshot(stream, fileName,
01311                           captureGTIC, captureGAEQ,
01312                           trigger, configName, configVersion)
01313
01314     if self.__statMon is not None:
01315       self.rc.execGUImethod(self.__statMon.startWatch)
01316
01317     return result
01318
01319   def readConfig(self, cfgFileName):
01320     """\brief Read a configuration XML file.
01321
01322     \param cfgFileName Full path of the configuration file.
01323
01324     \return Sequence number for this configuration. This number
01325             can later be passed to applyConfig.
01326     """
01327     seq = self.lat.readConfig(cfgFileName)
01328     if seq != -1 and cfgFileName not in self.lat._GLAT__includeFiles:
01329       self.lat._GLAT__includeFiles.append(cfgFileName)
01330     return seq
01331
01332   def applyConfig(self, seq=None, gxbrd=None):
01333     """\brief Apply configuration.
01334
01335     \param seq   Sequence number of the configuration.
01336                  If None, then apply all configurations.
01337     \param gxbrd Apply the GXBRD configuration as well.
01338                  Disabled by default.
01339     """
01340     # RESET state check is disabled until CAL scripts are fixed -ST
01341     ## Check if FSM is None in case we are in a suite
01342     #if self.isRunFromSuite():
01343     #  currentState = self.getSuiteInstance().getScriptState()
01344     #else:
01345     #  currentState = self.rc.getFSM().current_state
01346     #if currentState != 'RESET':
01347     #  msg = "Can not apply configuration when the run state is %s" % currentState
01348     #  log.error(msg)
01349     #  raise RuntimeError, msg
01350     #else:
01351     self.lat.applyConfig(seq, gxbrd)
01352
01353   def setArchiverClass(self, archiverClass):
01354     """\brief Set a custom archiver class.
01355
01356     Set a custom archiver class.  This is typically done in the __init__ method
01357     of the userApplication class.
01358
01359     \param The archiver class (not the instance)
01360
01361     """
01362     self.__archiverClass = archiverClass
01363     log.debug("Event archiver set to: %s", self.__archiverClass.__name__)
01364
01365   def getArchiverInstance(self):
01366     """\brief Return the archiver instance.
01367
01368     Returns the archiver instance.  Can be used by the user application.
01369
01370     \return Archiver instance
01371     """
01372     return self.__archiver
01373
01374   def startExcludeTime(self):
01375     """\brief Save the start time for exclusion from the run's elapsed time.
01376
01377     This method allows excluding some amount of time from the run's elapsed
01378     time.  The start time is the time that the method is called.
01379
01380     Note that time spent in the PAUSED state is also excluded from the elapsed
01381     time value.  Overlapping time is excluded from the elapsed time only once.
01382     """
01383     if not self.__excluding:
01384       self.__excludeLock.acquire()
01385       now = time.time()
01386       self.__excluding = True
01387       self.__excludeTime  = now
01388       self.__elapsedTime += now - self.__strobeTime
01389       self.__strobeTime   = now
01390       self.__excludeLock.release()
01391     elif self.__pauseTime is not None:
01392       pass                              # Going into PAUSED started it
01393     else:
01394       assert not self.__excluding, "Error: " + \
01395              "Attempt made to exclude time when it is already being excluded"
01396
01397   def endExcludeTime(self):
01398     """\brief Strobe the end time for exclusion from the run's elapsed time.
01399
01400     This method allows excluding some amount of time from the run's elapsed
01401     time.  The end time is the time that the method is called.  The difference
01402     between the end time and the start time is added to the excluded time.
01403     """
01404
01405     if self.__pauseTime is None:
01406       assert self.__excluding, "Error: startExcludeTime was not called"
01407       self.__excludeLock.acquire()
01408       now = time.time()
01409       dExcludedTime         = now - self.__excludeTime
01410       self.__excludedTime += dExcludedTime
01411       self.__elapsedTime  += now - self.__strobeTime - dExcludedTime
01412       self.__strobeTime    = now
01413       self.__excludeTime   = None
01414       self.__excluding     = False
01415       self.__excludeLock.release()
01416     else:                               # In PAUSED state: nothing to do
01417       pass
01418
01419   def adjustExcludeTime(self, dExcludeTime):
01420     """\brief This method allows adjustment of the amount of time to be
01421     excluded from the run's elapsed time.
01422
01423     The amount of time to be excluded from the run's elapsed time can be
01424     adjusted positivily or negativily with this method.  It does not take
01425     into account any other effects on the excluded time, such as whether
01426     the run was in the PAUSED state.
01427
01428     \param dExcludeTime  The amount of time to be excluded as given by the
01429     difference of two time.time() values.
01430     """
01431     # Ensure this doesn't interrupt another thread diddling excludeTime
01432     self.__excludeLock.acquire()
01433     self.__excludedTime += dExcludeTime
01434     self.__excludeLock.require()
01435
01436   def rcSetup(self):
01437     """\brief Setup transition method.
01438
01439
01440     """
01441     fn = "rcTransitions.rcSetup"
01442     log.debug("%s -- %s" % (fn, self.getName()))
01443
01444     # Set the Global Trigger
01445     if not self.lat.existsGEM():
01446       glt = self.xbrd.GLT
01447       if glt is None: # temporary: eventually will be explicit in schema
01448         glt = self.xbrd._GXBRD__addGLT()
01449       glt.initialize()
01450       self.setSessionVar('_glt', glt)
01451
01452       # Disable triggers
01453       glt.disableMask()        # call this directly.  don't use trigger()
01454
01455     # Apply the configuration to the hardware
01456     self.__waitCursor()
01457     self.applyConfig(gxbrd = self.xbrd)
01458     self.__normalCursor()
01459
01460     # set the event mode to take events normally
01461     self.ocs.evtHandlerSendAll()
01462     self.ocs.synchronize()
01463     self.ocs.verifyVersion()
01464
01465     # Disable all the saturation counters, disable the loop and set the delay to 2Hz
01466     for tem in self.lat.TEM.values():
01467       tic = tem.TIC
01468       tic.satCtrLoopDisable()
01469       tic.satCtrSetLoopDelay(30)
01470       for (regName, regAttr) in tic.regs.items():
01471         if regName.startswith('sat_'):
01472           tic.satCtrDisable(regAttr.id())
01473
01474     self.__deadtimeLock.acquire()
01475     self.__deadtimeCtrReg.clear()
01476     self.__deadTimeVal.clear()
01477     self.__deadTimeTS.clear()
01478     self.__avgDeadTime.clear()
01479     self.__deadtimeLock.release()
01480
01481
01482     # The application may pick a different event handler in the SETUP and
01483     # START_RUN transitions.  If it doesn't make sure there is a default.
01484     self.selectEventHandler(rcTransitions.EVENT_HANDLER_STANDARD)
01485
01486     # Change as per LTE-193
01487     #hskReadOnly = (self.rc is not None) and (int(self.prefs["envmonreadonly"]) == 1)
01488     hskReadOnly = False
01489
01490     if hskReadOnly:
01491       self.__hsk = rcHouseKeeping.rcHouseKeeping(self.lat, None, rcHouseKeeping.MODE_READONLY)
01492     else:
01493       self.__hsk = rcHouseKeeping.rcHouseKeeping(self.lat, os.path.split(self.__common.getDBN()['_LATSchemaFile'])[1])
01494
01495     # As per LTE-395, clear the custom rcReport.out dictionary before user setup
01496     self.__customReportData    = {}
01497
01498     # Call the application back
01499     try:
01500       status = self.setup()
01501       if status is not None:  return status
01502     except:
01503       log.exception("Exception in " + self.getName() + ".setup()")
01504       self.__appStatus = self.COMPL_STATUS_FAILED
01505       return False                      # Stay in RESET state
01506
01507     # finish setting up the trigger, add the GEM or GLT
01508     if self.lat.existsGEM():
01509       if self.trigger() is None:
01510         # there's no trigger defined, define a default
01511         # As there's no "real" trigger, don't replace the shut method
01512         self.trigger( rcDefaultTrigger.rcGEMDefaultTrigger(), replaceShut = False )
01513       self.trigger().GEM(self.lat.downGEM())
01514     else:
01515       if self.trigger() is None:
01516         # there's no trigger defined, define a default
01517         self.trigger( rcDefaultTrigger.rcMiniGLTDefaultTrigger(), replaceShut = False )
01518       self.trigger().GLT(glt)
01519     # commit the trigger.  This class defined in rcTrg{Gem,MiniGLT}.py
01520     self.trigger().commit()
01521
01522
01523   def rcTeardown(self):
01524     fn = "rcTransitions.rcTeardown"
01525     log.debug("%s -- %s" % (fn, self.getName()))
01526
01527     # Just in case this was missed in __stopRun because of an exception...
01528     self.__strobeTime = None
01529
01530     # Call the application back
01531     try:
01532       status = self.teardown()
01533     except:                             # Continue as if nothing had happened
01534       log.exception("Exception in " + self.getName() + ".teardown()")
01535       self.__appStatus = self.COMPL_STATUS_FAILED
01536       status = None                     # Go into RESET state
01537
01538     # reset things defined in rcSetup
01539     self.trigger(None, replaceShut=False)
01540
01541     return status
01542
01543   def rcStartRun(self):
01544     fn = "rcTransitions.rcStartRun"
01545     log.debug("%s -- %s" % (fn, self.getName()))
01546
01547     self.evtCnt             = 0
01548     self.__SBCevtCnt        = 0
01549     self.__lastEvtCnt       = 0
01550     self.__lastSBCevtCnt    = 0
01551     self.__dgSize           = 0
01552     self.__dgSumSize        = 0L
01553     self.__appStatus        = None
01554     self.__completionStatus = self.COMPL_STATUS_UNDEFINED
01555     self.__badEvents        = 0
01556     self.__errEvents        = 0
01557     self.__trgParErrorEvt   = 0
01558     self.__pktErrorEvt      = 0
01559     self.__endTime          = None
01560     self.__startTime        = None
01561     self.__excludeLock.acquire()
01562     self.__elapsedTime      = 0
01563     self.__strobeTime       = None
01564     self.__excluding        = False
01565     self.__excludedTime     = 0
01566     self.__excludeLock.release()
01567     self.__pauseCount       = 0
01568     self.__pausedTime       = 0
01569     self.__snapResult       = {}
01570
01571     # Initialize the event statistics
01572     self.ocs.stats_failed_events         = 0
01573     self.ocs.stats_failed_event_sends    = 0
01574     self.ocs.stats_valid_events          = 0
01575     self.ocs.stats_handled_events        = 0
01576     self.ocs.stats_discarded_event_sends = 0
01577     self.ocs.stats_length_mismatch_count = 0
01578     self.ocs.stats_events_not_sent       = 0
01579     self.ocs.stats_filter_pkt_errors     = 0
01580     self.ocs.stats_filter_src_errors     = 0
01581     self.ocs.stats_filter_passes         = 0
01582     self.ocs.stats_filter_fails          = 0
01583
01584     self.__common.resetErrorLogCount()
01585
01586     self.__clearEventSizeNTuple()
01587
01588     # This while loop makes sure the session log level filename is different
01589     # than the run level filename by waiting 1 second if necessary.
01590     # This condition may happen in standalone scripts and suites.
01591     while True:
01592       # The timestamp is measured here because things below depend on its value.
01593       # Therefore the run time includes the amount of time spent in the parameter verifier
01594       # in addition to the time the user spends entering the parameters.
01595       self.__tstampRaw   = time.gmtime()
01596       self.__tstamp      = time.strftime('%y%m%d%H%M%S', self.__tstampRaw)
01597       if self.prefs.has_key("logfilename"):
01598         logfilename = self.prefs["logfilename"]
01599         if self.__tstamp != logfilename[3:15]:
01600           break
01601       else:
01602         break
01603       time.sleep(1)
01604
01605     self.__exportedFiles      = []
01606
01607     # Contains the rcTestReport instance used by the script if any
01608     self.__testReport = None
01609     # Contains the file name for the test report generated by the script
01610     self.__testReportFile = None
01611
01612     self.runId = self.__runIdHelper.nextRunId()
01613
01614     # Check exported directory, as per LTE-226
01615     if int(self.prefs["dataexport"]) == 1:
01616       exportDir = os.path.abspath(self.prefs["exportdir"])
01617       if not os.path.exists(exportDir):
01618         msg = "Export directory %s does not exist.  Aborting run" % exportDir
01619         log.fatal(msg)
01620         return False    # reject the transition
01621
01622     # Change as per LTE-193
01623     #hskOutputEnabled = (self.rc is not None) and (int(self.prefs["envmonnbl"]) == 1)
01624     hskOutputEnabled = False
01625     if hskOutputEnabled:
01626       hskFileName = rcHouseKeeping.getFileNameFromTS(self.__tstamp)
01627       self.__hsk.initialize(filePath=self.prefs["logdir"],
01628                             fileName=hskFileName,
01629                             compress=(int(self.prefs["envmoncompress"]) == 1))
01630       self.__hsk.start()
01631
01632     # Load the archive file writer, if desired
01633     if self.prefs is not None:
01634       archiveOutputEnabled = (int(self.prefs["datasave"]) == 1)
01635       if archiveOutputEnabled:
01636         archFileName = self.__archiverClass.getFileNameFromTS(self.__tstamp)
01637         self.__archiver = self.__archiverClass(filePath=self.prefs["datadir"],
01638                                                 fileName=archFileName)
01639         self.__archive = self.__archiveIt
01640       else:
01641         self.__archive = self.__archiveDummy
01642
01643     if self.__dds is not None:
01644       self.__publish = self.__publishIt
01645     else:
01646       self.__publish = self.__publishDummy
01647
01648     if self.rc is not None:
01649       self.__paramVerifier.initialize(self.getName())
01650     self.__verifyStatus = None
01651
01652     # publish the startRun on dds
01653     self.publishConsumerDG('startRun='+self.getRunId())
01654
01655     # Set the deadtime LRS Counter Mask here to 'total'
01656     # if not specified in a configuration.
01657     for (gtemId, gtem) in self.lat.TEM.items():
01658       if self.lat.getSysReg(gtem.TIC, 'busy_lrs_mask') is None:
01659         lrsMask = gtem.TIC.busy_lrs_mask
01660         oldLrsMask = lrsMask
01661         if lrsMask & 0x7 != 0x3:
01662           lrsMask |= 0x7
01663           lrsMask &= ~0x4
01664           log.debug("%s: [OVR] TEM[%d].TIC.BUSY_LRS_MASK=0x%08x (0x%08x)" % (fn, gtemId, lrsMask, oldLrsMask))
01665           gtem.TIC.busy_lrs_mask = lrsMask
01666
01667     # Call the application back
01668     try:
01669       status = self.startRun()
01670     except:
01671       log.exception("Exception in " + self.getName() + ".startRun()")
01672       self.__appStatus = self.COMPL_STATUS_FAILED
01673       status = False                    # Stay in STOPPED state
01674     if status is not None:
01675       # startRun rejected, cleanup here.
01676       if hskOutputEnabled:
01677         self.__hsk.stop()
01678       return status
01679
01680     if self.__common.options().securedir is not None or self.__common.options().paramverify is not None:
01681       # Don't prompt the parameter verifier if the script
01682       # is in a suite that is called from another suite or
01683       # if it is not the first script in the suite
01684       scriptSeq = 0
01685       if self.isRunFromSuite():
01686         suiteInst = self.getSuiteInstance()
01687         if suiteInst.getSuite() is None:
01688           scriptSeq = suiteInst.getScriptSequence()
01689         else:
01690           scriptSeq = -1
01691       if scriptSeq == 0 or scriptSeq == 1:
01692         self.__paramVerifier.add("Schema File", os.path.split(self.__common.getDBN()['_LATSchemaFile'])[1])
01693         self.__paramVerifier.add("Particle Type", self.prefs["lastparticletype"])
01694         self.__paramVerifier.add("Orientation", self.prefs["lastorientation"])
01695         self.__paramVerifier.add("Site", self.prefs["lastsite"])
01696         self.__paramVerifier.add("Instrument Type", self.prefs["lastinstrumenttype"])
01697         self.__paramVerifier.add("Phase", self.prefs["lastphase"])
01698       self.__verifyStatus = self.rc.execGUImethod(self.__paramVerifier.verify)
01699       if self.__verifyStatus == 1: # The user successfully signed off on the parameters
01700         pass
01701       elif self.__verifyStatus == 0: # The user cancelled the verification
01702         log.error("Parameter verification failed because the user cancelled verification.")
01703         return self.__verifyStatus
01704       else:
01705         if self.__verifyStatus is None: self.__verifyStatus = -1
01706         log.error("Parameter verification failed due to an unknown reason.")
01707         return self.__verifyStatus
01708
01709     self.__runMsgLogFile = None
01710     if int(self.prefs["lognbl"]) == 1:
01711       self.__runMsgLogFile = os.path.join(self.prefs["logdir"],
01712                                           "msg" + self.__tstamp + ".log")
01713       self.__runMsgLog = self.__common.startRunLog(self.__runMsgLogFile)
01714     log.info("""%s -- Test %s starting run, Operator: %s,"""
01715              """ Run Id: %s, Time Started: %s -- %s"""
01716               % (fn, self.getName(), self.prefs["operator"],
01717                  self.runId, self.__tstamp, time.asctime(self.__tstampRaw)))
01718
01719     # Take snapshot. Note that the triggers must be disabled prior to
01720     # this action, therefore the glt changes are being committed afterwards.
01721
01722     snapshotEnabled = 0
01723     if self.prefs.has_key("snapnbl"):
01724       snapshotEnabled = (int(self.prefs["snapnbl"]) == 1)
01725     if snapshotEnabled:
01726       self.__waitCursor()
01727
01728       snFile = os.path.join(self.prefs["snapshotdir"],
01729                             "rsa" + self.__tstamp + ".xml")
01730       self.__snapResult["rsa"] = self.takeSnapshot(stream=None, fileName=snFile,
01731                             captureGTIC=1, captureGAEQ=1, trigger=self.trigger())
01732       self.addExportedFile(snFile,delete=True)
01733
01734       self.__normalCursor()
01735
01736     self.handleEventOutput()
01737
01738     # Clear the event sequence
01739     self.ocs.evtClearEvtSeqMSW()
01740     if self.lat.existsGEM():
01741       self.lat.GEM.GEMC.sequence = 0
01742     else:
01743       self.trigger().GLT().TAG = 0
01744       self.trigger().GLT().EVENT_NUMBER = 0
01745
01746     # Set up the LCB to deliver events
01747     self.lat.LCB.setEvtEnable(True)
01748
01749     # Purge all event data remaining in socket
01750     purgeSize = self.evtCli.purge()
01751     if purgeSize != 0:
01752       log.warn("Socket purge encountered %d bytes of stale data" % purgeSize)
01753
01754     # Check if the data directories exist and that there's enough space on the disks
01755     if self.rc is not None:
01756       fitsDir = self.prefs["fitsdir"]
01757       archDir = self.prefs["datadir"]
01758       warning = True
01759       for directory in (fitsDir, archDir):
01760         if not os.path.exists(directory):
01761           warning = self.rc.execGUImethod(self.rc.warnDirectoryExist, directory)
01762         elif (FreeSpace.FreeSpace(directory) < rcTransitions.DISKSPACE_WARN_LEVEL):
01763           warning = self.rc.execGUImethod(self.rc.warnFreeSpace,
01764                                           rcTransitions.DISKSPACE_WARN_LEVEL)
01765         if warning:            # OK, continue
01766           pass
01767         else:
01768           return False         # reject the transition
01769
01770       # Spawn a thread to handle events
01771       if self.trigger().sweepOnShut():
01772         self.__eventHandlerReady.clear()               # Clear handler ready state
01773         self.rc.eventHandler.spawn(self.__jacket, self.__eventHandlerFn)
01774         self.__eventHandlerReady.wait()                # Make sure handler ready
01775         # Sweep out stale events.  Status is returned, False = sweep timeout.
01776         swept = self.__sweep()
01777         if not swept:          # sweep event has timed out.
01778           log.critical("Sweep event timed out, aborting run and returning to RESET state")
01779           # As per LTE-363 make sure we create a run report and export the run
01780           self.__initStartRun(time.time())
01781           self.__appStatus = self.COMPL_STATUS_ABORTED
01782           self.__stopRun(fn)
01783           self.rc.doReset()
01784           return False         # reject the transition, sweep timeouts are bad
01785
01786       if 'commandSynch' in dir(self):
01787         self.rc.commandSynch.spawn(self.__jacket, self.commandSynch)
01788     else:
01789       if self.trigger().sweepOnShut():
01790         self.__eventHandlerReady.clear()               # Clear handler ready state
01791         evtHandler = Thread(None, self.__eventHandlerFn, 'EventHandler', ())
01792         evtHandler.start()
01793         self.__eventHandlerReady.wait()                # Make sure handler ready
01794         # Sweep out stale events.  Status is returned, False = sweep timeout.
01795         swept = self.__sweep()
01796         if not swept:          # sweep event has timed out.
01797           log.critical("Sweep event timed out, aborting run and returning to RESET state")
01798           # As per LTE-363 make sure we create a run report and export the run
01799           self.__initStartRun(time.time())
01800           self.__appStatus = self.COMPL_STATUS_ABORTED
01801           self.__stopRun(fn)
01802           self.rc.doReset()
01803           return False         # reject the transition, sweep timeouts are bad
01804
01805       if 'commandSynch' in dir(self):
01806         cmdSynch = Thread(None, self.commandSynch, 'CmdSynch', ())
01807         cmdSynch.start()
01808
01809     # Handle enabling of the triggers
01810     enableTrigger = True                     # Default is to enable triggers
01811     if 'triggerEnableOverride' in dir(self): # Allow application to override
01812       enableTrigger = type(self.triggerEnableOverride) == types.MethodType and \
01813                       not self.triggerEnableOverride()
01814     now = time.time()
01815
01816     if enableTrigger:
01817       # Write the user script's trigger mask settings to the hardware
01818       self.trigger().enable()
01819
01820     self.__initStartRun(now)
01821
01822     return status
01823
01824
01825   def __initStartRun(self, now):
01826     #Initialize timers
01827     self.__endTime     = None
01828     self.__startTime   = now
01829     self.__excludeLock.acquire()
01830     self.__elapsedTime = 0
01831     self.__strobeTime  = now
01832     self.__excludeLock.release()
01833
01834     # Set baselines for dead time
01835     self.__deadtimeLock.acquire()
01836     for temId in self.lat.TEM.keys():
01837       tic = self.lat.TEM[temId].TIC
01838       if tic is not None:
01839         self.__deadtimeCtrReg[temId] = tic.regs['sat_deadtime_lrs_ctr']
01840         regNo = self.__deadtimeCtrReg[temId].id()
01841         resp = tic.read(regNo)
01842         self.__deadTimeVal[temId] = resp.value()
01843         self.__deadTimeTS[temId] = resp.payloads()[1]
01844       else:
01845         self.__deadTimeVal[temId] = 0
01846         self.__deadTimeTS[temId] = 0
01847     if self.lat.existsGEM():   # __deadTimeVal/TS are dicts, so Jim can add GEM to 'em.  :-)
01848       gst = self.lat.GEM.GEMST
01849       value, ts = gst.extCtrRead(gst.regs['livetime'].id()).payloads()
01850       self.__deadTimeVal['GEM'] = value
01851       self.__deadTimeTS['GEM']  = ts
01852       self.__deadTimeVal['LASTGEM'] = value
01853       self.__deadTimeTS['LASTGEM']  = ts
01854     else:
01855       self.__deadTimeVal['GEM'] = 0
01856       self.__deadTimeTS['GEM']  = 0
01857       self.__deadTimeVal['LASTGEM'] = 0
01858       self.__deadTimeTS['LASTGEM']  = 0
01859     self.__deadtimeLock.release()
01860
01861
01862   def __jacket(self, function, *args, **kwargs):
01863     """Jacketting method for catching exceptions and initiating graceful
01864     termination of the user application.
01865     """
01866     try:
01867       function(*args, **kwargs)
01868     except Exception, e:
01869       import logging
01870       logging.exception("%s: %s" % (function.__name__, e))
01871       self.__appStatus = self.COMPL_STATUS_ABORTED
01872       self.rc.doReset()
01873
01874   def __handleEventOutput(self):
01875     # Load the FITS file writer, if desired
01876     fn = "__handleEventOutput"
01877     self.__fits = None
01878     if self.prefs is not None:
01879       fitsOutputEnabled = ("fitsnbl" in self.prefs) and (int(self.prefs["fitsnbl"]) == 1)
01880       if fitsOutputEnabled:
01881         try:
01882           fitsFileName = rcFitsWriter.getFileNameFromTS(self.__tstamp)
01883           self.__fits = rcFitsWriter.rcFitsWriter(filePath=self.prefs["fitsdir"],
01884                                                   fileName=fitsFileName,
01885                                                   format=rcFitsWriter.FORMAT_BYTE,
01886                                                   compress=(int(self.prefs["fitscompress"]) == 1),
01887                                                   flushInterval=100,
01888                                                   reportGen=self.__reportGen)
01889         except (ImportError, IOError), e:
01890           log.error("%s: FITS writer disabled: %s" % (fn, e))
01891       try:
01892         fileName = rcArchiver.rcArchiver.getFileNameFromTS(self.__tstamp)
01893         errFileName = 'err' + fileName.split('.',1)[0] + '.ldf'
01894         self.__errArchiver = rcArchiver.rcArchiver(filePath=self.prefs["datadir"],
01895                                                     fileName=errFileName)
01896         badFileName = 'bad' + fileName.split('.',1)[0] + '.ldf'
01897         self.__badArchiver = rcArchiver.rcArchiver(filePath=self.prefs["datadir"],
01898                                                     fileName=badFileName)
01899       except (ImportError, IOError), e:
01900         log.error("%s: Archiver disabled: %s" % (fn, e))
01901
01902   def __handleEventOutputStub(self):
01903     pass
01904
01905   def rcStopRun(self):
01906     fn = "rcTransitions.rcStopRun"
01907     log.debug("%s -- %s" % (fn, self.getName()))
01908
01909     # Disable triggers
01910     self.trigger().disable()
01911
01912     # Flush out the remaining triggers in the pipeline and exit evtHandler
01913     swept = self.__flushEvents()
01914     if not swept:             # sweep event has timed out.
01915       self.evtCli.abort()     # As sweep has timed out, evtHandler hasn't exited.
01916                               # force the exit with abort()
01917
01918     self.__common.getDBN()['_event_size'] = 0
01919
01920     # Call the application back after events are no longer flowing
01921     try:
01922       self.stopRun()       # RiC: It appears rejecting the transition won't work
01923     except:                             # Go into STOPPED state
01924       log.exception("Exception in " + self.getName() + ".stopRun()")
01925       self.__appStatus = self.COMPL_STATUS_FAILED
01926
01927     # Stop the run - Must be done after the application stopRun()
01928     self.__stopRun(fn)
01929
01930   def rcStop(self):
01931     fn = "rcTransitions.rcStop"
01932     log.debug("%s -- %s" % (fn, self.getName()))
01933
01934     # Disable triggers
01935     self.trigger().disable()
01936
01937     # Flush out the remaining triggers in the pipeline and exit evtHandler
01938     swept = self.__flushEvents()
01939     if not swept:             # sweep event has timed out.
01940       self.evtCli.abort()     # As sweep has timed out, evtHandler hasn't exited.
01941                               # force the exit with abort()
01942
01943     self.__common.getDBN()['_event_size'] = 0
01944
01945     # Mark the resume time
01946     now = time.time()
01947     self.__pausedTime += (now - self.__pauseTime)
01948     self.__pauseTime   = None
01949
01950     if not self.__excluding:
01951       self.__excludeLock.acquire()
01952       dExcludedTime        = now - self.__excludeTime
01953       self.__excludedTime += dExcludedTime
01954       self.__elapsedTime  += now - self.__strobeTime - dExcludedTime
01955       self.__strobeTime    = now
01956       self.__excludeTime   = None
01957       self.__excludeLock.release()
01958     else:                 # Time is still being excluded: nothing to do
01959       pass
01960
01961     # Call the application back after events are no longer flowing
01962     try:
01963       self.stop()         # RiC: It appears rejecting the transition won't work
01964     except:                             # Go into STOPPED state
01965       log.exception("Exception in " + self.getName() + ".stop()")
01966       self.__appStatus = self.COMPL_STATUS_FAILED
01967
01968     # Stop the run
01969     self.__stopRun(fn)
01970
01971   def rcPause(self):
01972     fn = "rcTransitions.rcPause"
01973     log.debug("%s -- %s" % (fn, self.getName()))
01974
01975     # Sweep out any currently buffered triggers
01976     if self.trigger().sweepOnShut():
01977       swept = self.__sweep()
01978       if not swept:
01979         log.critical("Sweep event timed out, aborting run and returning to RESET state")
01980         self.rc.doReset()
01981         return False         # reject the transition, sweep timeouts are bad
01982
01983     # Increment pause count
01984     self.__pauseCount += 1
01985
01986     # Calculate elapsed time so far
01987     now = time.time()
01988     self.__pauseTime = now
01989
01990     if not self.__excluding:
01991       self.__excludeLock.acquire()
01992       self.__excludeTime  = now
01993       self.__elapsedTime += now - self.__strobeTime
01994       self.__strobeTime   = now
01995       self.__excludeLock.release()
01996     else:                 # Time is already being excluded: nothing to do
01997       pass
01998
01999     # Call the application back
02000     try:
02001       status = self.pause()
02002     except:                             # Go into PAUSED state
02003       log.exception("Exception in " + self.getName() + ".pause()")
02004       self.__appStatus = self.COMPL_STATUS_FAILED
02005
02006     # Do a pseudo-resume if the PAUSE transition is rejected
02007     if status is not None:
02008       # Mark the resume time before reenabling triggers
02009       now = time.time()
02010       self.__pausedTime += (now - self.__pauseTime)
02011       self.__pauseTime   = None
02012
02013       if not self.__excluding:
02014         self.__excludeLock.acquire()
02015         dExcludedTime        = now - self.__excludeTime
02016         self.__excludedTime += dExcludedTime
02017         self.__elapsedTime  += now - self.__strobeTime - dExcludedTime
02018         self.__strobeTime    = now
02019         self.__excludeTime   = None
02020         self.__excludeLock.release()
02021       else:                 # Time is still being excluded: nothing to do
02022         pass
02023
02024       # Reenable triggers
02025       self.trigger().enable()
02026
02027     return status
02028
02029   def rcResume(self):
02030     fn = "rcTransitions.rcResume"
02031     log.debug("%s -- %s" % (fn, self.getName()))
02032
02033     # Mark the resume time before reenabling triggers
02034     now = time.time()
02035
02036     # Call the application back
02037     try:
02038       self.trigger().enable()
02039       status = self.resume()
02040     except:                             # Go into RUNNING state
02041       self.trigger().disable()
02042       log.exception("Exception in " + self.getName() + ".resume()")
02043       self.__appStatus = self.COMPL_STATUS_FAILED
02044
02045     # Don't change the situation if the application rejected the transition
02046     if status is None:
02047       self.__pausedTime += (now - self.__pauseTime)
02048       self.__pauseTime   = None
02049
02050       if not self.__excluding:
02051         self.__excludeLock.acquire()
02052         dExcludedTime        = now - self.__excludeTime
02053         self.__excludedTime += dExcludedTime
02054         self.__elapsedTime  += now - self.__strobeTime - dExcludedTime
02055         self.__strobeTime    = now
02056         self.__excludeTime   = None
02057         self.__excludeLock.release()
02058       else:                 # Time is still being excluded: nothing to do
02059         pass
02060
02061       # Reenable triggers
02062       self.trigger().enable()
02063
02064     return status
02065
02066   # Not used anymore - ST
02067   #def extend(self):
02068   #  """Overload this function to provide additional space after the event in
02069   #  the datagram.  This space can be used to add application dependent
02070   #  LATcontributions to the datagram.  This method is evaluated at startRun time
02071   #  and not on a per trigger basis.  It should return a Python string big enough
02072   #  to fit whatever additional space is needed for the user data.  To gain
02073   #  access to this space use the LATdatagram.alloc(size) method.
02074   #  """
02075   #  return ""
02076
02077 # The following methods are meant to be overridden by the application
02078
02079   def getName(self):
02080     return self.__class__.__name__
02081
02082   def setup(self):
02083     "Method that is called on the SETUP transition"
02084     log.debug("rcTransitions.setup()")
02085     # The transition can be rejected by not returning None
02086     return None
02087
02088   def teardown(self):
02089     "Method that is called on the TEARDOWN transition"
02090     log.debug("rcTransitions.teardown()")
02091     # The transition can be rejected by not returning None
02092     return None
02093
02094   def startRun(self):
02095     "Method that is called on the START_RUN transition"
02096     log.debug("rcTransitions.startRun()")
02097     # The transition can be rejected by not returning None
02098     return None
02099
02100   def stopRun(self):
02101     "Method that is called on the STOP_RUN transition"
02102     log.debug("rcTransitions.stopRun()")
02103     # The transition can be rejected by not returning None
02104     return None
02105
02106   def pause(self):
02107     "Method that is called on the PAUSE transition"
02108     log.debug("rcTransitions.pause()")
02109     # The transition can be rejected by not returning None
02110     return None
02111
02112   def resume(self):
02113     "Method that is called on the RESUME transition"
02114     log.debug("rcTransitions.resume()")
02115     # The transition can be rejected by not returning None
02116     return None
02117
02118   def stop(self):
02119     "Method that is called on the STOP transition"
02120     log.debug("rcTransitions.stop()")
02121     # The transition can be rejected by not returning None
02122     return None
02123
02124   def process(self, eventBuffer):
02125     "Method that is called on every data event taken"
02126     log.debug("rcTransitions.process()")
02127
02128
02129 # Private methods appear below
02130
02131 ## private:
02132
02133   def __clearEventSizeNTuple(self):
02134     # Clear the event size plot ntuple
02135     dbn = self.__common.getDBN()
02136     if '_EventSizeNTuple' in dbn:
02137       dbn['_EventSizeNTuple'].clear()
02138
02139   def __normalCursor(self):
02140     if self.rc is not None and 'normalCursor' in dir(self.rc):
02141       self.rc.normalCursor()
02142
02143   def __waitCursor(self):
02144     if self.rc is not None and 'waitCursor' in dir(self.rc):
02145       self.rc.waitCursor()
02146
02147   def __eventProgress(self):
02148     """
02149     Method used by the sweep logic to time out waiting for sweep events.
02150     This function returns the number of events that were handled by the
02151     event handler since the last time it was called.
02152     """
02153     progress = self.evtCnt - self.__lastEvtCnt
02154     self.__lastEvtCnt = self.evtCnt
02155     self.__lastSBCevtCnt = self.__SBCevtCnt
02156     return progress
02157
02158   def __sweep(self):
02159     """
02160     Method used to ensure that the event pipeline is swept of pending events.
02161     When this method returns triggers are disabled but set up as they were upon
02162     entry.
02163     """
02164
02165     # Wait for marked event to show up while pipelined events drain
02166     self.__waitCursor()
02167     # Make sure TEM registers are in a 'good' state for event data taking
02168     # and solicit the sweep trigger.
02169     swept = self.trigger().shut(self.__sweepEvent, self.__eventProgress)
02170     self.__normalCursor()
02171     # Triggers are disabled at this point.
02172
02173     return swept
02174
02175   def __flushEvents(self):
02176     # Cause eventHandler to exit when the sweep marker is seen
02177
02178     # Handle the race condition when event handler
02179     # may exit before the sweep event is received.
02180     self.__sweepEvent.clear()
02181     self.__evtHandlerQuit = True
02182
02183     swept = True
02184     # Sweep any buffered triggers
02185     if self.trigger().sweepOnShut():
02186       swept = self.__sweep()
02187
02188     # Handle the race condition when event handler
02189     # may exit before the sweep event is received.
02190     self.__sweepEvent.set()
02191     return swept
02192
02193
02194   def __stopRun(self, fn='__stopRun'):
02195     # Calculate the final elapsed time
02196     now = time.time()
02197     self.__endTime      = now
02198     self.__excludeLock.acquire()
02199     if self.__strobeTime is not None:
02200       self.__elapsedTime += now - self.__strobeTime
02201     self.__strobeTime   = None
02202     self.__excludeLock.release()
02203
02204     self.__avgDeadTime = self.__calcDeadTime()
02205
02206     # Change as per LTE-193
02207     #hskOutputEnabled = (self.rc is not None) and (int(self.prefs["envmonnbl"]) == 1)
02208     hskOutputEnabled = False
02209     if hskOutputEnabled:
02210       self.__hsk.stop()
02211
02212     # publish the endRun on dds
02213     self.publishConsumerDG('endRun='+self.getRunId())
02214
02215     if self.__completionStatus == self.COMPL_STATUS_UNDEFINED:
02216       log.warn("Script completed with an undefined completion status. "
02217                "Please use the setCompletionStatus method.")
02218
02219     # Close fits file
02220     if self.__fits is not None:
02221       self.__fits.close(self.rc.inShutdown)
02222     if self.__badArchiver is not None:
02223       self.__badArchiver.close()
02224       self.__removeZeroLengthFile(self.__badArchiver.getFilePath(), self.__badArchiver.getFileName())
02225       # need to check if file was removed before adding to export list..
02226       _fnameTmp = os.path.join(self.__badArchiver.getFilePath(), self.__badArchiver.getFileName())
02227       if os.path.exists(_fnameTmp):
02228         self.addExportedFile(_fnameTmp, delete=True)
02229       self.__badArchiver = None
02230     if self.__errArchiver is not None:
02231       self.__errArchiver.close()
02232       self.__removeZeroLengthFile(self.__errArchiver.getFilePath(), self.__errArchiver.getFileName())
02233       # need to check if file was removed before adding to export list..
02234       _fnameTmp = os.path.join(self.__errArchiver.getFilePath(), self.__errArchiver.getFileName())
02235       if os.path.exists(_fnameTmp):
02236         self.addExportedFile(_fnameTmp, delete=True)
02237       self.__errArchiver = None
02238
02239     if self.__archiver is not None:
02240       self.__archiver.close()
02241
02242       # Optional call back to perform processing once the archive file is closed
02243       # and before it gets exported.
02244       self.processArchive(os.path.join(self.__archiver.getFilePath(), self.__archiver.getFileName()))
02245
02246     if self.prefs is not None:
02247       inShutDown = False
02248       if self.rc is not None and self.rc.inShutdown:
02249         inShutDown = True
02250       if not inShutDown:
02251         snapshotEnabled = 0
02252         if self.prefs.has_key("snapnbl"):
02253           snapshotEnabled = (int(self.prefs["snapnbl"]) == 1)
02254         if snapshotEnabled:
02255           self.__waitCursor()
02256
02257           snFile = os.path.join(self.prefs["snapshotdir"],
02258                                 "rsb" + self.__tstamp + ".xml")
02259           self.__snapResult["rsb"] = self.takeSnapshot(stream=None, fileName=snFile,
02260                                                         captureGTIC=1, captureGAEQ=1,
02261                                                         trigger=self.trigger())
02262           self.addExportedFile(snFile, delete=True)
02263
02264           self.__normalCursor()
02265
02266     # Let the operator override the completion status and add comments.
02267     if self.__common.options().securedir is not None or self.__common.options().paramverify is not None:
02268       if self.rc is not None and not self.rc.inShutdown:
02269         if not self.isRunFromSuite() or self.isLastSuiteScript():
02270           self.rc.execGUImethod(self.rc.handleEndRunDlg)
02271
02272     # Create test report
02273     if self.rc is not None:
02274       if not self.rc.inShutdown:
02275         self.rc.execGUImethod(self.__genReport)
02276     else:
02277       self.__genReport()
02278
02279     self.__logEndRun(fn)
02280     curDir = os.getcwd()
02281     self.__exportData()
02282     if os.path.exists(curDir):
02283       os.chdir(curDir)
02284
02285   def __logEndRun(self, fn):
02286     log.info("%s -- Test %s finished, Run Id: %s, Status: %s, Completion Time: %s"
02287              % (fn, self.getName(), self.runId, self.getCompletionStatusStr(),
02288                 time.asctime(time.gmtime(self.__endTime))))
02289
02290     if int(self.prefs["lognbl"]) == 1:
02291       self.__common.stopRunLog(self.__runMsgLog)
02292       self.addExportedFile(self.__runMsgLogFile, delete=True)
02293
02294   def processArchive(self, archivePath):
02295     """\brief Optional call back to perform processing on the archive file.
02296
02297     This method will be called after the archive file is closed and before it is exported.
02298     User applications can override this method to perform custom processing on the file.
02299
02300     \param archivePath Full path of the archive file.
02301
02302     """
02303     pass
02304
02305   def __calcDeadTime(self, temId=None):
02306     avgDeadTimes = {}
02307     if temId is None:
02308       tems = self.lat.TEM.keys()
02309     else:
02310       tems = [temId]
02311     for tId in tems:
02312       if tId in self.__deadtimeCtrReg and self.__startTime is not None:
02313         # Disable command debugging for status panel methods
02314         # which access hardware
02315         saveDebug = self.__cmdCli.getDebug()
02316         self.__cmdCli.setDebug(0)
02317         regNo = self.__deadtimeCtrReg[tId].id()
02318         try:
02319           resp = self.__deadtimeCtrReg[tId].getNode().read(regNo)
02320         except gException.LATInterfaceException, e:
02321           if e.errstr()[0] == 'OCS_TMO':  return {}
02322           else:                           raise
02323         newVal = resp.value()
02324         newTS = resp.payloads()[1]
02325         self.__cmdCli.setDebug(saveDebug)
02326
02327         dTime = newVal - self.__deadTimeVal[tId]
02328         # Compensate for the non-running time.
02329         excludeTime = (time.time() - self.__startTime - self.__getElapsedTime()) * rcTransitions.TIMEBASE_RATE_IN_MHZ * 1000000
02330         dTS = newTS - self.__deadTimeTS[tId] - excludeTime
02331         if dTime < 0:
02332           dTime += (1L << 32)
02333         if dTS < 0:
02334           dTS += (1L << 64)
02335         if dTS != 0:
02336           avgDeadTime =  (float(dTime)/float(dTS))
02337           avgDeadTime *= (rcTransitions.TIMEBASE_RATE_IN_MHZ / rcTransitions.DEADTIME_RATE_IN_MHZ) * 100.0
02338         else:
02339           avgDeadTime = None
02340         avgDeadTimes[tId] = avgDeadTime
02341       else:
02342         avgDeadTimes[tId] = None
02343     return avgDeadTimes
02344
02345   def __removeZeroLengthFile(self, filePath, fileName):
02346     fname = os.path.join(filePath, fileName)
02347     size = os.stat(fname)[6]
02348     if size == 0:
02349       try:
02350         os.remove(fname)
02351       except:
02352         return -1
02353     return 0
02354
02355   def __exportData(self):
02356     """
02357       Routine to export all relevant data from a run to
02358       local storage and possibly to offsite backup.
02359       This routine is designed to execute after the completion of a run,
02360       but before teardown of Run Control.
02361       The name of the export directory is the run ID.  This is
02362       to guarantee against unintentional overwrites between multiple
02363       teststands.
02364     """
02365
02366     # If we aren't exporting, return
02367     exportEnabled = (int(self.prefs["dataexport"]) == 1)
02368     if not exportEnabled: return
02369
02370     # first thing is to create a local directory structure
02371     outDir = self.getRunId()
02372     outDirRoot = self.prefs["datadir"]
02373     outPath = os.path.join(outDirRoot,outDir)
02374
02375     # Define two exporters.
02376     # One which purges the files after export, one which doesn't.
02377     hardExporter    = DataExport.DataExport()
02378     safeExporter    = DataExport.DataExport()
02379     hardExporter.setPurge(True)
02380     safeExporter.setPurge(False)
02381
02382     # append to the list of exported files
02383
02384     # schema configuration:  Don't delete these!
02385     self.addExportedFile(self.getSchemaConfigFile(), delete=False)
02386     if self.lat is not None:                    # additional files from GLAT...
02387       for f in self.lat._GLAT__includeFiles:
02388         self.addExportedFile(f, delete=False)
02389
02390     if os.access(outDirRoot,os.W_OK):             # can we write?
02391       os.mkdir(outPath)
02392
02393       # list of files that get hardExported.
02394       dataSave = (int(self.prefs["datasave"]) == 1)
02395       if dataSave:
02396         moveList = [ self.__archiver,    self.__fits ]
02397         for fileObj in moveList:
02398           if fileObj is not None:
02399             self.addExportedFile(os.path.join(fileObj.getFilePath(), fileObj.getFileName()), delete=True)
02400
02401       # export housekeeping file
02402       # Change as per LTE-193
02403       #hskReadOnly = (int(self.prefs["envmonreadonly"]) == 1)
02404       #if self.__hsk is not None and (int(self.prefs["envmonnbl"]) == 1) and not hskReadOnly:
02405       #  self.addExportedFile(self.__hsk.getFileName(full=1), delete=True)
02406
02407       # make the rcReport.out file
02408       rcLastLine = self.__rcLastLine()    # Grab the info from rcReport.out
02409       rcOutFile = open(os.path.join(outPath,"rcReport.out"), 'w')
02410       rcOutFile.write(rcLastLine)
02411       rcOutFile.close()
02412
02413       for path,name,delete in self.__exportedFiles:
02414         try:
02415           if delete:
02416             hardExporter.export(os.path.join(path,name),os.path.join(outPath,name))
02417           else:
02418             safeExporter.export(os.path.join(path,name),os.path.join(outPath,name))
02419         except Exception, e:
02420           log.error("Exception %s in trying to export file %s" % (e, name))
02421
02422     else: # Can't write to outDirRoot
02423       err = "rcTransitions.__exportData: Local directory ", outDirRoot, " is not writable"
02424       log.error(err)
02425       return         # Can't continue exporting, so return
02426
02427
02428     # if the data dir and the export dir are the same, don't export.
02429     if os.path.abspath(self.prefs["datadir"]) == os.path.abspath(self.prefs["exportdir"]):
02430       msg = "Data source and Export directories are identical\n" + \
02431             "source: %s, export: %s" % ( self.prefs["datadir"] , self.prefs["exportdir"] )
02432       log.warn(msg)
02433       exportEnabled = False
02434
02435     # Export the directory to permanent storage
02436     if exportEnabled:
02437       if not os.path.exists(os.path.abspath(self.prefs["exportdir"])):
02438         log.fatal("Final export directory %s no longer exists.  Something has gone very, very wrong." % self.prefs["exportdir"])
02439         return
02440
02441       destDir    = os.path.join(self.prefs["exportdir"] ,outDir)
02442       dbn = self.__common.getDBN()
02443       dbn['_LastExportPath'] = destDir
02444       sourceDir  = outPath
02445       hardExporter.export(sourceDir, destDir)
02446
02447       # done export.  Create an "I'm done" file in the export area
02448       done = file(destDir+'/zzz.done','w')
02449       done.close()
02450
02451   def __rcLastLine(self):
02452     """Get the last line of the run report file.
02453     """
02454     # Now, we need the info from rcReport.out
02455     # As this routine runs after the writing of the file, just grab
02456     # the last usable line.
02457     filename = ( os.path.join(self.prefs["reportdir"], 'rcReport.out') )
02458
02459     rcFile = open(filename,'r')
02460     charsPerLine = 4096                         # this probably needs tuning.
02461     while 1:
02462       try:                                      # read from the end of the file
02463         rcFile.seek(-1 * charsPerLine ,2)
02464       except IOError:                           # the file's shorter than charsPerLine
02465         rcFile.seek(0)                          # reposition at head
02466       if rcFile.tell() == 0:
02467         atstart=True
02468       else:
02469         atstart=False
02470
02471       rcLines=rcFile.read().split("\n")         # last line of file is blank,
02472       if (len(rcLines) > 2) or atstart:         # so require 2 full lines
02473         break
02474                                                 # The lines are bigger than we thought,
02475       charsPerLine=charsPerLine * 2             # so double the read
02476
02477     rcFile.close()
02478     rcLastLine = rcLines[len(rcLines)-2]        # cache this for later
02479
02480     # extract the run id from rcLastLine, and compare it with what's expected
02481     import re
02482     runId = 0
02483     runIdRE = re.compile(r".*<RunId>(\d+)</RunId>.*")
02484     rList = runIdRE.findall(rcLastLine)
02485     if len(rList) > 0:
02486       runId = rList[0]
02487     else:
02488       log.fatal("Could not parse a run ID out of the last line of rcReport.out.")
02489       log.error("Last line = %s" % rcLastLine)
02490     if runId != self.getRunId():
02491       msg = "Run identifier read from rcReport.out (%s) does not match LATTE internal run ID (%s)" % (runId, self.getRunId())
02492       log.fatal(msg)
02493
02494
02495     return rcLastLine
02496
02497   def selectEventHandler(self, type, customEventHandler = None):
02498     """Use this method to select an event handler to use.
02499     The application can call this method from the SETUP or START_RUN
02500     transitions.  If it doesn't, a default is used.
02501     """
02502     currentState = self.getState()
02503     if currentState is None:
02504       # Standalone mode - disable state check
02505       currentState = 'RESET'
02506     if currentState == 'RESET' or currentState == 'STOPPED':
02507       if type == rcTransitions.EVENT_HANDLER_STANDARD:
02508         self.__eventHandlerFn = self.__eventHandler
02509       elif type == rcTransitions.EVENT_HANDLER_LEAN_AND_MEAN:
02510         self.__eventHandlerFn = self.__datagramHandler
02511       elif type == rcTransitions.EVENT_HANDLER_PLAYBACK:
02512         self.__eventHandlerFn = self.__eventHandlerPlayback
02513       elif type == rcTransitions.EVENT_HANDLER_CUSTOM:
02514         self.__eventHandlerFn = customEventHandler
02515       else:
02516         log.error("Unrecognized eventHandler type")
02517     else:
02518       log.error("The event handler can not be changed in the %s state" % \
02519                 (currentState))
02520
02521 # Private method for calling the application back with event data
02522   def __eventHandler(self):
02523     """Handler for calling the application back with event data
02524     """
02525     evtCli       = self.evtCli
02526     endRunMarker = rcTransitions.__SWEEP_MARKER
02527
02528     # On playback, see if we need to trigger an event
02529     if self.__EBFplayback:
02530       # If application DIDN'T enable the internal trigger,
02531       # enable it and trigger first event
02532       if not self.trigger().conditions().solicited():
02533         playbackTrigger = True
02534         # two cases, GEM/GLT.
02535         # force an enable of the solicit in both cases.
02536         if self.lat.existsGEM():
02537           from LATTE.trigger.TrgGem import TrgGem
02538           self.trigger().enable(TrgGem._TrgGem__SOLICIT_MASK)
02539         else:
02540           from LATTE.trigger.TrgMiniGLT import TrgMiniGLT
02541           self.trigger().enable(TrgMiniGLT._TrgMiniGLT__SOLICIT_MASK)
02542
02543         self.trigger().solicit()
02544       else:     # Application is taking care of triggering the event
02545         playbackTrigger = False
02546
02547     self.__evtHandlerQuit = False
02548
02549     # Indicate that the Event Handler is ready to take events
02550     self.__eventHandlerReady.set()
02551
02552     while True:
02553       try:
02554         # Go wait for an event to show up
02555         status = evtCli.readEvent()
02556         if status == EvtCli.ABORT_ERROR:
02557           break
02558
02559         # Count every event to ensure displayed rate makes sense
02560         self.evtCnt      += 1
02561         self.__dgSize     = evtCli.header[2]
02562         self.__dgSumSize += evtCli.header[2]
02563
02564         # ST - We want to pass the event as is so that we can check what type
02565         #      of error it has in user script's process() method
02566         #parser_status = evtCli.readEvent()
02567         #if evtCli.checkOnlineStatus(parser_status, EvtCli.GGLT_STATUS_ERROR):
02568         #  status = evtCli.getGGLTStatus()
02569         #else:
02570         #  status = parser_status
02571
02572         if (status == 0) or evtCli.checkOnlineStatus(status, EvtCli.PLAYBACK_ERROR):
02573           self.errorEvent = evtCli.isErrorEvent()
02574           self.trgParErrorEvent = evtCli.isTrgParityErrorEvent()
02575           self.packetErrorEvent = evtCli.isPacketErrorEvent()
02576           summaryMarker = evtCli.evt.summary.marker
02577           self.eventMarker = summaryMarker
02578           if summaryMarker == endRunMarker:
02579             self.__sweepEvent.set()     # Signal that the marked event was seen
02580             # Commented out, since we want the sweep marker event to be seen by process()
02581             #if self.__evtHandlerQuit:  break
02582             #continue
02583
02584         # For efficiency first check whether event playback is enabled only once
02585         if self.__EBFplayback:
02586           # Whenever evtSvr detects errors during playback, stop the current run
02587           if evtCli.checkOnlineStatus(status, EvtCli.PLAYBACK_ERROR):
02588             self.rc.doStop()
02589             continue
02590
02591           # Since we know we're in playback mode, trigger the next event if
02592           # the application DIDN'T enable the internal trigger
02593           if playbackTrigger:
02594             self.trigger().solicit()
02595           else:     # Application is taking care of triggering the event
02596             pass
02597
02598         # Allow application to process all kinds of events
02599         #try:
02600           #self.process((status,evtCli.dat))
02601         latContribs = self.__process(status, evtCli.dat)
02602         #except:
02603         #  log.exception("")
02604         #  self.__appStatus = self.COMPL_STATUS_FAILED
02605         #  self.rc.doReset()
02606
02607         # Policy: don't write out unnavigable or empty events
02608         if status != 0:
02609           self.__badEvents+=1
02610           if evtCli.dat is not None:
02611             try:
02612               self.__badArchiver.write(evtCli.dat)
02613             except AttributeError:
02614               # Archiver may be disabled by the --noerrfile option
02615               pass
02616         else:
02617           (l,) = struct.unpack('!L', evtCli.dat[4:8])
02618           if self.__fits is not None:
02619             self.__fits.write(evtCli.dat[:l])
02620           if self.errorEvent or self.packetErrorEvent or self.trgParErrorEvent:
02621             if summaryMarker != endRunMarker:
02622               try:
02623                 self.__errArchiver.write(evtCli.dat[:l])
02624               except AttributeError:
02625                 # Archiver may be disabled by the --noerrfile option
02626                 pass
02627               # increment internal error counters
02628               if self.errorEvent:          self.__errEvents      += 1
02629               if self.trgParErrorEvent:    self.__trgParErrorEvt += 1
02630               if self.packetErrorEvent:    self.__pktErrorEvt    += 1
02631
02632           self.__archive(evtCli.header[1], latContribs)
02633           #if self.__dds is not None:
02634           self.__publish(evtCli.dat)
02635       except IOError:
02636         # Handle the event timeout if enabled
02637         if str(sys.exc_info()[1]) == "Event read timeout":
02638           evtCli.dat = ''
02639           status = EvtCli.READ_TIMEOUT_ERROR
02640         else:
02641           self.trigger().disable()
02642           raise IOError, "Unhandled IOError in rcTransitions::readEvent: %s" % sys.exc_info()[1]
02643
02644       if self.__evtHandlerQuit and self.__sweepEvent.isSet():  break
02645
02646       # HEADS UP: At this point evtCli.dat could be byteswapped
02647
02648     log.debug('rcTransitions.__eventHandler: %s terminating' % (self.getName()))
02649
02650
02651   def __archiveIt(self, datagramId, latContribs):
02652     # Calculate the length of the entire datagram
02653     size = 8                            # Datagram ID and its length
02654     for latContrib in latContribs:
02655       size += len(latContrib)
02656
02657     # Create the datagram header
02658     dgHdr = struct.pack('>2L', datagramId, size)
02659
02660     # Archive the datagram and all its contributions
02661     self.__archiver.writeTuple((dgHdr,) + latContribs)
02662
02663   def __archiveDummy(self, datagramId, latContribs):
02664     pass
02665
02666   def __archiveBad(self, datagram):
02667     archiver = self.__badArchiver
02668     if archiver is not None:
02669       archiver.write(datagram)
02670
02671   def __archiveErr(self, datagram):
02672     archiver = self.__errArchiver
02673     if archiver is not None:
02674       archiver.write(datagram)
02675
02676   def __publishIt(self, datagram):
02677     self.__dds.publish(datagram)
02678
02679   def __publishDummy(self, datagram):
02680     pass
02681
02682   def __process(self, status, datagram):
02683     try:
02684       # Make a copy of the whole event (not just a reference)
02685       # that proccess can byte swap.  - Revisit for efficiency
02686       #dgBuf = str(buffer(datagram))
02687       #import array
02688       #dgBuf = array.array('L', datagram).tostring()
02689       dgBuf = datagram[:1] + datagram[1:]
02690
02691       latContribs = self.process((status, dgBuf))
02692       if latContribs is not None:  return latContribs
02693     except Exception, e:
02694       import logging
02695       logging.exception("Trapped userApplication:process() exception: %s" % e)
02696       self.__appStatus = self.COMPL_STATUS_FAILED
02697       self.rc.doReset()
02698
02699     # RiC: The following may be a better solution to the copy done above
02700     # if datagram[0:4] == LDF.LATdatagram.ID:  datagram.byteswap()
02701
02702     return (datagram[8:],)        # LATcontributions, not LATdatagrams
02703
02704   def __datagramHandler(self):
02705     """Handler for calling the application back with event datagrams
02706     """
02707
02708     sweepEvt  = self.__sweepEvent
02709     evtCli    = self.evtCli
02710     sweepMkr  = rcTransitions.__SWEEP_MARKER
02711     markerMsk = 0x7 << 22
02712     errorMsk  = 0x1 << 21
02713     trgParMsk = 0x1
02714     pktErrMsk = 0x7 << 13  #
02715
02716     self.__evtHandlerQuit = False
02717
02718     # Indicate that the Event Handler is ready to take events
02719     self.__eventHandlerReady.set()
02720
02721     while not (self.__evtHandlerQuit and sweepEvt.isSet()):
02722
02723       # Get the data from the socket
02724       header, datagram = evtCli.readSocket()
02725
02726       # Count every event to ensure displayed rate makes sense
02727       self.evtCnt      += 1
02728       self.__dgSize     = header[2]
02729       self.__dgSumSize += header[2]
02730
02731       # Give application quick access to error bit and marker
02732       self.errorEvent       = (header[6] & errorMsk) != 0
02733       self.trgParErrorEvent = (header[6] & trgParMsk )
02734       self.packetErrorEvent = ( (header[5] & pktErrMsk) != 0 )
02735       self.eventMarker      = (header[6] & markerMsk) >> 22
02736
02737
02738       # Process the datagram
02739       latContribs = self.__process(header[0], datagram)
02740
02741       # Check FSW event delivery to OES status
02742       if header[0] == 0:
02743         # Archive the data
02744         self.__archive(header[1], latContribs)
02745
02746         # Multicast the data
02747         self.__publish(datagram)
02748
02749         # Handle datagrams with TEM contribution errors
02750         if self.eventMarker != sweepMkr and \
02751             (self.errorEvent or self.trgParErrorEvent or self.packetErrorEvent):
02752           self.__archiveErr(datagram)
02753           # increment internal error counters
02754           if self.errorEvent:          self.__errEvents      += 1
02755           if self.trgParErrorEvent:    self.__trgParErrorEvt += 1
02756           if self.packetErrorEvent:    self.__pktErrorEvt    += 1
02757       else:
02758         # Handle datagrams for which FSW choked
02759         self.__badEvents += 1
02760         self.__archiveBad(datagram)
02761
02762       # Make sure the above is done before setting the sweepEvt to prevent
02763       # things from getting out of synch.
02764       if self.eventMarker == sweepMkr:  sweepEvt.set()
02765
02766     log.debug('rcTransitions.__datagramHandler: %s terminating' %
02767               (self.getName()))
02768
02769
02770   def __eventHandlerPlayback(self):
02771     """Handler for calling the application back with played back event data
02772     """
02773     pass # Currently handled by __eventHandler() above
02774
02775   def publishConsumerDG(self, buf):
02776     import LDF
02777     # Pad the contributions with zeros to force it to be an integer number of
02778     # longwords in length
02779     remainder = len(buf) & 0x3
02780     if remainder:  buf += "\x00\x00\x00"[0:4-remainder]
02781     # need to byteswap the raw buffer if little endian
02782     if sys.byteorder == "little":
02783       import array
02784       buf = array.array('L',buf)
02785       buf.byteswap()
02786       buf = buf.tostring()
02787     # get type for this UDF contribution
02788     # pending definition of this contribution, use Scratch
02789     primary   = LDF.LATprimaryId().Base_Scratch
02790     secondary = LDF.LATsecondaryId().Base_Scratch
02791     typeId = LDF.LATtypeId(primary, secondary)
02792     # construct header
02793     dg = LDF.LATdatagram()
02794     # 8's are to accomodate pairs of long words of the UDF heade
02795     # opaque is length of my contribution with header in bytes
02796     dg = struct.pack('>4L',dg.ID,len(buf)+len(dg)+8,typeId.value(),len(buf)+8)
02797     dg = dg+str(buf)
02798     self.__publish(dg)
02799     time.sleep(0.05)
02800
02801   class ApplicationCallbacks(object):
02802     def beforeSetup(self, app):
02803       pass
02804     def afterSetup(self, app):
02805       pass
02806     def beforeStartRun(self, app):
02807       pass
02808     def afterStartRun(self, app):
02809       pass
02810     def beforeStopRun(self, app):
02811       pass
02812     def afterStopRun(self, app):
02813       pass
02814     def beforeTeardown(self, app):
02815       pass
02816     def afterTeardown(self, app):
02817       pass
02818
02819   class StandaloneLauncher(object):
02820     def __init__(self, logLevel="INFO"):
02821       self.__common = RunControlCommon()
02822       self.__common.initialize()
02823       self.__common.setLoggingLevel(logLevel)
02824       self.__common.connect()
02825
02826     def launch(self, appClass, user, callbacks=None):
02827       if appClass is None:
02828         module = self.__common.options().app
02829         try:
02830           (module, filename) = rcUtil.importModule(module, reload=0)
02831         except Exception, e:
02832           log.exception(e)
02833           return
02834         ua = module.userApplication(None, user, self.__common)
02835         if callbacks is None and 'userApplicationCallbacks' in dir(module):
02836           callbacks = module.userApplicationCallbacks()
02837       else:
02838         ua = appClass(None, user, self.__common)
02839
02840       if callbacks is not None:
02841         callbacks.beforeSetup(ua)
02842       ua.rcSetup()
02843       if callbacks is not None:
02844         callbacks.afterSetup(ua)
02845       if callbacks is not None:
02846         callbacks.beforeStartRun(ua)
02847       ua.rcStartRun()
02848       if callbacks is not None:
02849         callbacks.afterStartRun(ua)
02850       ua.wait()
02851       if callbacks is not None:
02852         callbacks.beforeStopRun(ua)
02853       ua.rcStopRun()
02854       if callbacks is not None:
02855         callbacks.afterStopRun(ua)
02856       if callbacks is not None:
02857         callbacks.beforeTeardown(ua)
02858       ua.rcTeardown()
02859       if callbacks is not None:
02860         callbacks.afterTeardown(ua)
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcTransitionsBT.py Source File

rcTransitionsBT.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2006
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Replacement rcTransitions class for event merging"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "6/29/2006"
00014 __updated__  = ("$Date: 2006/07/19 16:26:04 $").split(' ')[1]
00015 __version__  = "$Revision: 1.4 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import struct
00022
00023 from   LATTE.runcontrol.rcTransitions     import rcTransitions
00024 from   LATTE.merger.ancillaryContribution import AncillaryContribution
00025 from   LDF                                import EBFevent
00026 from   support.gEvtCliBT                  import EvtCliBT
00027
00028
00029 class rcTransitionsBT(rcTransitions):
00030   def __init__(self, rc, userId, debug, merge = True):
00031     rcTransitions.__init__(self, rc, userId, debug)
00032     self.__debug       = debug
00033     self.__merge       = merge # Set merge to False to disable merging
00034     self.__autoStopRun = True
00035
00036   def autoStopRun(self, value = None):
00037     if value is not None:  self.__autoStopRun = value
00038     return self.__autoStopRun
00039
00040   def rcSetup(self):
00041     if self.__merge:
00042       self.__ecSave = self.evtCli
00043       self.__ec = EvtCliBT(debug=self.__debug)
00044       self.setEvtCli(self.__ec)
00045     return rcTransitions.rcSetup(self)
00046
00047   def rcTeardown(self):
00048     if self.__merge:
00049       self.__ec.shutdown()
00050       self.setEvtCli(self.__ecSave)
00051     return rcTransitions.rcTeardown(self)
00052
00053   def eventHandler(self):
00054     if not self.__merge:  return self._rcTransitions__datagramHandler()
00055
00056     sweepEvt  = self._rcTransitions__sweepEvent
00057     evtCli    = self.evtCli
00058     sweepMkr  = rcTransitions._rcTransitions__SWEEP_MARKER
00059     markerMsk = 0x7 << 22
00060     errorMsk  = 0x1 << 21
00061     trgParMsk = 0x1
00062     pktErrMsk = 0x7 << 13
00063
00064     self._rcTransitions__evtHandlerQuit = False
00065
00066     # Indicate that the Event Handler is ready to take events
00067     self._rcTransitions__eventHandlerReady.set()
00068
00069     while not (self._rcTransitions__evtHandlerQuit and sweepEvt.isSet()):
00070       statuses, datagram  = evtCli.readEvent()
00071       header = struct.unpack('!6L', datagram[0:24])
00072
00073       status                = 0
00074       self.errorEvent       = False
00075       self.trgParErrorEvent = False
00076       self.packetErrorEvent = False
00077       self.eventMarker      = None
00078       contribId = header[2] & 0x000fffff
00079       if   contribId == AncillaryContribution.HeaderId:
00080         self.eventMarker  = -1
00081       elif contribId == AncillaryContribution.TrailerId:
00082         if self.__autoStopRun:
00083           import logging
00084           logging.info("rcTransitionsBT.eventHandler: Ancillary trailer seen.  Stopping run")
00085           self.rc.doStopRun()
00086         self.eventMarker  = -1
00087       elif contribId == AncillaryContribution.EventId:
00088         # Count every event to ensure displayed rate makes sense
00089         self.evtCnt                    += 1
00090         self._rcTransitions__dgSize     = header[1]
00091         self._rcTransitions__dgSumSize += header[1]
00092
00093         ancSize = header[3]
00094         if self._rcTransitions__dgSize > ancSize + 8:
00095           status    = statuses[1]       #!\todo deal with other statuses
00096           ebfEvent  = datagram[ancSize + 8:]
00097           ebfHeader = struct.unpack('!4L', ebfEvent[0:16])
00098
00099           # Give application quick access to error bit and marker
00100           self.errorEvent       = (ebfHeader[3] & errorMsk)  != 0
00101           self.trgParErrorEvent = (ebfHeader[3] & trgParMsk)
00102           self.packetErrorEvent = (ebfHeader[2] & pktErrMsk) != 0
00103           self.eventMarker      = (ebfHeader[3] & markerMsk) >> 22
00104       elif contribId == EBFevent.ID & 0x000Fffff:
00105         # Count every event to ensure displayed rate makes sense
00106         self.evtCnt                    += 1
00107         self._rcTransitions__dgSize     = header[1]
00108         self._rcTransitions__dgSumSize += header[1]
00109
00110         status = statuses[0]       #!\todo deal with other statuses
00111         # Give application quick access to error bit and marker
00112         self.errorEvent       = (header[5] & errorMsk)  != 0
00113         self.trgParErrorEvent = (header[5] & trgParMsk)
00114         self.packetErrorEvent = (header[4] & pktErrMsk) != 0
00115         self.eventMarker      = (header[5] & markerMsk) >> 22
00116       else:
00117         import logging
00118         logging.error("rcTransitionsBT.eventHandler: Unrecognized contribution encounterd: %08x" % (contribId))
00119
00120       # Process the datagram
00121       latContribs = self._rcTransitions__process(status, datagram)
00122
00123       # Check FSW event delivery to OES status
00124       if status == 0:
00125         # Archive the data
00126         self._rcTransitions__archive(header[0], latContribs)
00127
00128         # Multicast the data
00129         self._rcTransitions__publish(datagram)
00130
00131         # Handle datagrams with TEM contribution errors
00132         if self.eventMarker != sweepMkr and \
00133             (self.errorEvent or self.trgParErrorEvent or self.packetErrorEvent):
00134           self._rcTransitions__archiveErr(datagram)
00135           # increment internal error counters
00136           if self.errorEvent:          self._rcTransitions__errEvents      += 1
00137           if self.trgParErrorEvent:    self._rcTransitions__trgParErrorEvt += 1
00138           if self.packetErrorEvent:    self._rcTransitions__pktErrorEvt    += 1
00139       else:
00140         # Handle datagrams for which FSW choked
00141         self._rcTransitions__badEvents += 1
00142         self._rcTransitions__archiveBad(datagram)
00143
00144       # Make sure the above is done before setting the sweepEvt to prevent
00145       # things from getting out of sync.
00146       if self.eventMarker == sweepMkr:  sweepEvt.set()
00147
00148     # Flush any events left in the systems.  They'll all be incomplete.
00149     evtCli.flushAll()
00150
00151     import logging
00152     logging.debug("rcTransitionsBT.eventHandler: %s terminating" %
00153               (self.getName()))
Generated on Fri Jul 21 13:26:31 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcTrgFunctions.py Source File

trigger

rcTrgFunctions.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Trigger Input Enable Interface classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.3 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 from TrgObject             import TrgObject
00021 from TrgConditionsValue    import TrgConditionsValue
00022 from TrgEngines            import *
00023 from NullObjects           import NullEngine
00024 from TrgInputEnables       import TrgTileEnables
00025 from TrgInputEnables       import TrgTowerBusyEnables
00026 from TrgCoincidences       import TrgCoincidence
00027
00028
00029 """rcTrgFunctions: Run control Interfaces for Trigger modules"""
00030
00031 class rcTrgEngines(TrgEngines):
00032   """\brief rcTrgEngines Class
00033
00034   Setup a LATTE based trigger engine system.
00035   All sixteen (16) engines are defined.  [0..14] are NullEngine, the last
00036   is a reserved engine that transmits the sweep marker on transitions.
00037   """
00038   def __init__(self):
00039     """\brief rcTrgEngines constructor
00040     """
00041     TrgEngines.__init__(self)
00042     self.__engines = []
00043     for i in range(TrgObject.ENGINE_NUMBER_MAX):
00044       self.__engines.append( NullEngine() )
00045     self.__engines.append( SweepMarkerEngine() )
00046
00047   def replaceEngine(self,engineNumber,engine):
00048     """\brief replaceEngine() method
00049
00050     Replace one of the engines.
00051     \param engineNumber: The engine number to replace [0..13]
00052     \param engine:  The replacement engine
00053     """
00054     if engineNumber == 0xf:
00055       raise IndexError, "Sorry, can't replace engine number 15"
00056     if engineNumber == 0xe:
00057       raise IndexError, "Sorry, can't replace engine number 14"
00058     self.__engines[engineNumber] = engine
00059
00060   def engine(self, engineNumber):
00061     """\brief engine() method
00062
00063     Return one of the engines
00064     \param engineNumber: The engine to return
00065     """
00066     if engineNumber < TrgObject.ENGINE_NUMBER_MIN or \
00067        engineNumber > TrgObject.ENGINE_NUMBER_MAX:
00068       raise IndexError, "engineNumber is out of range"
00069     return self.__engines[engineNumber]
00070
00071 class SweepMarkerEngine(TrgEngine):
00072   """\brief SweepMarkerEngine class
00073
00074      This class defines an engine which injects a sweep marker signal.
00075      This engine is not prescaled.
00076   """
00077   SWEEP_MARKER = 5
00078   def __init__(self):
00079     """\brief SweepMarkerEngine constructor
00080     """
00081     TrgEngine.__init__(self)
00082     self.__request = rcTrgInjectMarker(SweepMarkerEngine.SWEEP_MARKER)
00083
00084   def participate(self,conditionsValue):
00085     """\brief participate() method
00086
00087     This function always returns False as this engine never
00088     participates except when RunControl wants it to.
00089     """
00090     return False
00091
00092   def prescale(self):
00093     """\brief prescale() method
00094
00095     Returns 0.  This engine isn't prescaled
00096     """
00097     return 0
00098
00099   def request(self):
00100     """\brief request() method
00101
00102     Returns a TrgInjectMarker object
00103     """
00104     return self.__request
00105
00106 class rcTrgInjectMarker(TrgInjectMarker):
00107   def __init__(self, marker):
00108     TrgInjectMarker.__init__(self, marker)
00109   def zeroSuppress(self):
00110     return True
00111   def sequence(self):
00112     return 1
00113
00114
00115 class rcTrgTileEnables(TrgTileEnables):
00116   """\brief rcTrgTileEnables class
00117
00118   Class to abstract the additions of tiles to the input enable list.
00119   All tiles *not* in the enable list are specifically disabled
00120   """
00121   def __init__(self):
00122     """\brief rcTrgTileEnables constructor
00123     """
00124     TrgTileEnables.__init__(self)
00125     self.__tileA = []
00126     self.__tileB = []
00127
00128   def tile(self, tileNumber):
00129     rc = 0
00130     if tileNumber in self.__tileA :
00131       rc |= 0x1
00132     if tileNumber in self.__tileB :
00133       rc |= 0x2
00134     return rc
00135
00136   def addTile(self, tileNumber, side):
00137     if side & 0x1:
00138       self.__tileA.append(tileNumber)
00139     if side & 0x2:
00140       self.__tileB.append(tileNumber)
00141
00142 class rcTrgCoincidence(TrgCoincidence):
00143   """\brief rcTrgCoincidence class
00144
00145   Class to provide a function to add tiles to coincidence sets.
00146   Also does checking to see if tiles are in the allowed tile set
00147   """
00148   def __init__(self):
00149     TrgCoincidence.__init__(self)
00150     self.__pairList = {}
00151     from TrgGemRegisterGeometry import AcdTileNumbering as TN
00152     self.__badTiles = ( TN['NA0'], TN['NA1'], TN['NA2'], TN['NA3'], TN['NA4'],
00153                         TN['NA5'], TN['NA6'], TN['NA7'], TN['NA8'], TN['NA9'], TN['NA10'] )
00154
00155   def addPair(self, tile1, tile2):
00156     """\brief addPair(tile1, tile2)
00157
00158     \param tile1 an integer
00159     \param tile2 an integer
00160
00161     Add a tile pair, tile1,tile2 to a coincidence list.
00162     Note, the set of tile1 objects must be unique.
00163     """
00164     self.__checkTile(tile1)
00165     self.__checkTile(tile2)
00166     self.__pairList[tile1] = tile2
00167
00168   def inCoincidence(self,tileNumber):
00169     self.__bounds(tileNumber)
00170     if self.__pairList.has_key(tileNumber):
00171       return self.__pairList[tileNumber]
00172     else:
00173       return -1  # Tile not in coincidence List
00174
00175   def __checkTile(self, tile):
00176     self.__bounds(tile)
00177     # self.__badlist(tile)
00178
00179   def __bounds(self,tile):
00180     if tile < TrgObject.TILE_NUMBER_MIN or \
00181        tile > TrgObject.TILE_NUMBER_MAX:
00182       msg = "Tile number %d is out of range" % tile
00183       raise IndexError, msg
00184
00185   def __badlist(self, tile):
00186     if tile in self.__badTiles:
00187       msg = "Tile number %d is a non-assigned tile" % tile
00188       raise IndexError, msg
00189
00190 class rcTrgTowerBusyEnables(TrgTowerBusyEnables):
00191   """\brief rcTrgTowerBusyEnables class
00192
00193   Class to abstract the additions of towers to the tower-busy enable list.
00194   All towers *not* in the enable list are specifically disabled
00195   """
00196   def __init__(self):
00197     """\brief rcTrgTowerBusyEnables constructor
00198     """
00199     TrgTowerBusyEnables.__init__(self)
00200     self.__enab = 0x0
00201
00202   def tower(self, towerNumber):
00203     if self.__enab & ( 1 << towerNumber):
00204       return True
00205     return False
00206
00207   def addTower(self, towerNumber):
00208     self.__enab |= ( 1 << towerNumber);
00209
00210
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcTrgGem.py Source File

trigger

rcTrgGem.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Coincidence based Trigger System Interface classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.11 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 """rcTrgGem: This class implements a 'threaded' model for enabling/disabling the trigger
00022 """
00023
00024 from TrgGem       import TrgGem
00025 from threading    import Event
00026 import logging
00027 import time
00028
00029 class rcTrgGem(TrgGem):
00030   """\brief rcTrgGem class definition
00031   This class implements a 'threaded' model for enabling/disabling the trigger
00032   """
00033   __SWEEP_TMO        = 3.0            # Sweep timeout in floating point seconds
00034
00035   def __init__(self):
00036     """rcTrgGem constructor
00037     """
00038     self.__triggersEnabled = Event()
00039     self.__enableTime      = -99999999999
00040     self.__disableTime     = -99999999999
00041
00042     TrgGem.__init__(self)                    # do this last
00043
00044   def commit(self, gem = None):
00045     """\brief public commit function
00046
00047     This function commits the configuration defined by this
00048     TrgGem object to the hardware.  It does *all* the registers.
00049     This function should never be called by anyone other than Run Control.
00050     """
00051     if gem is not None:
00052       self.GEM(gem)
00053     self._TrgGem__commit()
00054
00055   def waitForMaskEnable(self, tmo = None):
00056     """Waits until the enableMask() method is called.
00057     This is usually needed by non-self-triggering scripts where
00058     the _commandSynch thread needs to wait until RunControl
00059     actually enables the mask before continuing.
00060
00061     \param tmo  Optional parameter giving the wait timeout in seconds
00062     """
00063     self.__triggersEnabled.wait(tmo)
00064
00065   def getEnableTime(self):
00066     """ Returns the VxWorks timestamp at the time the triggers are enabled
00067
00068     \return Trigger enable time
00069     """
00070     return self.__enableTime
00071
00072   def getDisableTime(self):
00073     """ Returns the VxWorks timestamp at the time the triggers are disabled
00074
00075     \return Trigger disable time
00076     """
00077     return self.__disableTime
00078
00079   def getTimeStamp(self):
00080     """ Returns the VxWorks timestamp for the last time a self-trigger
00081         was asserted.
00082     \return Trigger timestamp
00083     """
00084     ts = self.GEM().GEMC.regs['cmd_trigger'].getTimeStamp()
00085     return ts
00086
00087   def sweepOnShut(self):
00088     """ Returns whether or not shut() does a sweep event.  Default true.
00089     \return a boolean
00090     """
00091     return True
00092
00093   ############### Pure virtual function reimplementation
00094
00095   def enable(self, mask=None):
00096     """Re-implementation of the enable() function to take advantage
00097     of threading
00098     """
00099     if mask is not None:
00100       outMask = mask
00101     elif self.conditions() is not None:
00102       outMask = self.conditions().value()
00103     else:
00104       raise AssertionError, "Attempting to enable a TrgConditionsValue of None"
00105
00106     if self.__triggersEnabled.isSet(): return        # triggers already enabled
00107
00108     gemw = self.GEM().GEMW
00109     gemw.WINDOW_OPEN_MASK = outMask
00110     self.__triggersEnabled.set()
00111
00112     self.__enableTime = gemw.regs['window_open_mask'].getTimeStamp()
00113
00114   def disable(self):
00115     """Re-implementation of the disable() function to take advantage
00116     of threading
00117     """
00118     self.__triggersEnabled.clear()
00119     gemw = self.GEM().GEMW
00120     gemw.WINDOW_OPEN_MASK = 0
00121     self.__disableTime = gemw.regs['window_open_mask'].getTimeStamp()
00122
00123   def shut(self, sweepEvent, progress = None):
00124     """Re-implementation of the shut function to take advantage of the
00125     fact that in rcTrgGem, trigger engine 15 is reserved for the marker.
00126
00127     \param sweepEvent: A sweep Event() defined by runControl
00128     \param progress:   An optional function that returns a non-zero value when
00129                        when events are passing through the system.  If omitted
00130                        a fixed timeout is used.
00131     """
00132
00133     gemw = self.GEM().GEMW
00134     gemsc = self.GEM().GEMSC
00135
00136     #0) determine whether we are enabled or not
00137     if gemw.WINDOW_OPEN_MASK != 0:
00138       enabled = True
00139     else:
00140       enabled = False
00141
00142     #1) disable triggers
00143     goodSolicit  = self.solicit
00144     self.solicit = self.__falseSolicit
00145     self.disable()
00146     sweepEvent.clear()
00147
00148     #2) Replace contents of all schedulers with solicited with (Engine) f
00149     #   Doing it by hand
00150     scheduler = ( 0xffffffffL )               # Everything's f!
00151     regList = gemsc.regs.values()
00152     oldSched = {}    # dictionary keyed on register names
00153     for reg in regList:
00154       oldSched[reg.getName()] = reg.get()
00155       reg.set(scheduler)
00156
00157     #2.5) Wait until we don't have progress
00158     if progress is not None:
00159       while True:
00160         if progress() == 0:
00161           break
00162         time.sleep(.5)
00163         # print "waiting for progress"
00164
00165     #3) Change conditions to be solicit only, solicit a trigger
00166     gemw.WINDOW_OPEN_MASK = TrgGem._TrgGem__SOLICIT_MASK
00167     self.GEM().downGEMC().CMD_TRIGGER = 1
00168
00169     #4) Block until the sweep is detected by rcTransitions then disable triggers
00170     tmo = rcTrgGem.__SWEEP_TMO
00171     while (tmo > 0.0):
00172       if sweepEvent.isSet():  break
00173       sweepEvent.wait(0.50)
00174       if progress is not None:
00175         if progress() != 0:
00176           tmo = rcTrgGem.__SWEEP_TMO
00177           continue
00178       tmo -= 0.50
00179     if tmo <= 0:
00180       sweepEvent.set()
00181       logging.fatal("Trigger sweep timed out before all events were drained")
00182       return False
00183
00184     self.disable()
00185
00186     #5) Put the original contents of schedulers back
00187     for reg in regList:
00188       reg.set(oldSched[reg.getName()])
00189
00190     #6) Put the trigger conditions back.
00191     if enabled:
00192       self.enable()
00193     self.solicit = goodSolicit
00194
00195     return True
00196
00197
00198   def __falseSolicit(self):
00199     pass
00200
00201
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcTrgMiniGLT.py Source File

trigger

rcTrgMiniGLT.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Coincidence based Trigger System Interface classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.8 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 """rcTrgMiniGLT:
00021 This class implements a 'threaded' model for enabling/disabling the trigger
00022 """
00023
00024 from TrgMiniGLT   import TrgMiniGLT
00025 from threading    import Event
00026 import logging
00027
00028 class rcTrgMiniGLT(TrgMiniGLT):
00029   """\brief rcTrgMiniGLT class definition
00030   This class implements a 'threaded' model for enabling/disabling the trigger
00031   """
00032   __SWEEP_MARKER     = 5               # Arbitrary marker value for recognizing
00033                                        #   when the event pipeline is flushed
00034   __SWEEP_TMO        = 3.0             # Sweep timeout in floating point seconds
00035   def __init__(self):
00036     """\brief rcTrgGem constructor
00037     """
00038     self.__triggersEnabled = Event()
00039
00040     TrgMiniGLT.__init__(self)                 # do this last
00041     self.__cacheMask       = None
00042
00043   def commit(self):
00044     """\brief public commit function
00045     This function commits the configuration defined by this
00046     TrgGem object to the hardware.  It does *all* the registers.
00047     This function should never be called by anyone other than Run Control.
00048     """
00049     self._TrgMiniGLT__commit()
00050
00051   def waitForMaskEnable(self, tmo = None):
00052     """Waits until the enableMask() method is called.
00053     This is usually needed by non-self-triggering scripts where
00054     the _commandSynch thread needs to wait until RunControl
00055     actually enables the mask before continuing.
00056
00057     \param tmo  Optional parameter giving the wait timeout in seconds
00058     """
00059     self.GLT().waitForMaskEnable(tmo)
00060
00061   def getEnableTime(self):
00062     """ Returns the VxWorks timestamp at the time the triggers are enabled
00063
00064     \return Trigger enable time
00065     """
00066     return self.GLT().getEnableTime()
00067
00068   def getDisableTime(self):
00069     """ Returns the VxWorks timestamp at the time the triggers are disabled
00070
00071     \return Trigger disable time
00072     """
00073     return self.GLT().getDisableTime()
00074
00075   def getTimeStamp(self):
00076     """ Returns the VxWorks timestamp for the last time a self-trigger
00077         was asserted.
00078     \return Trigger timestamp
00079     """
00080     return self.GLT().regs['CMD_SELF_TRIGGER'].getTimeStamp()
00081
00082   def sweepOnShut(self):
00083     """ Returns whether or not shut() does a sweep event.  Default true.
00084     \return a boolean
00085     """
00086     return True
00087
00088   ############### Pure virtual function reimplementation
00089
00090   def enable(self, newMask=None):
00091     """Re-implementation of the enable() function to take advantage
00092     of threading and timestamps
00093
00094     Adds an argument to deal with several weird masking problems
00095     Only rcTransitions should use the above argument
00096     """
00097     if self.conditions() is not None:
00098       outMask = ~self.conditions().value()          # remember the MiniGLT has ~logic
00099     else:
00100       raise AssertionError, "Attempting to enable a TrgConditionsValue of None"
00101
00102     if newMask is not None:
00103       self.__cacheMask = newMask
00104
00105     if self.__cacheMask is not None:
00106       outMask = self.__cacheMask
00107
00108     self.GLT().MASK = outMask
00109     self.GLT().enableMask()
00110
00111   def disable(self):
00112     """Re-implementation of the disable() function to take advantage
00113     of threading and timestamps
00114     """
00115     self.GLT().disableMask()
00116
00117   def shut(self, sweepEvent, progress = None):
00118     """Re-implementation of the shut function to take advantage of the
00119     fact that in rcTrgMiniGLT, trigger engine 0 is reserved for the marker.
00120
00121     \param sweepEvent: A sweep Event() defined by runControl
00122     \param progress:   An optional function that returns a non-zero value when
00123                        when events are passing through the system.  If omitted
00124                        a fixed timeout is used.
00125     """
00126
00127     glt = self.GLT()
00128
00129     #0) disable triggers
00130     if not glt.triggersDisabled():
00131       enabled = True
00132     else:
00133       enabled = False
00134     goodSolicit  = self.solicit
00135     self.solicit = self.__falseSolicit
00136
00137     self.disable()
00138     sweepEvent.clear()
00139
00140     #1) Set up marker logic
00141     mask           = glt.MASK           # Cache Mask, CalStrobe and Tack
00142     calStrobe      = glt.CAL_STROBE
00143     tack           = glt.TACK
00144     zeroSuppress   = glt.ZERO_SUPPRESS
00145     fourRange      = glt.FOUR_RANGE_READOUT
00146     marker         = glt.MARKER
00147
00148     glt.MASK       = TrgMiniGLT._TrgMiniGLT__SOLICIT_MASK # Enable internal trigger only
00149     glt.MARKER     = rcTrgMiniGLT.__SWEEP_MARKER          # Signal that we're sweeping
00150     glt.CAL_STROBE = 0                  # Don't inject charge
00151     glt.TACK       = 1                  # Force a readout
00152     glt.ZERO_SUPPRESS       = 1         # Yes to zero suppression
00153     glt.FOUR_RANGE_READOUT  = 0         # No to four range readout
00154
00155     #2) enable and solicit
00156     glt.enableMask()
00157     self.waitForMaskEnable()
00158     self.GLT().CMD_SELF_TRIGGER = 1     # Solicit a trigger
00159
00160     #3) Block until the sweep is detected by rcTransitions then disable triggers
00161     tmo = rcTrgMiniGLT.__SWEEP_TMO
00162     while (tmo > 0.0):
00163       if sweepEvent.isSet():  break
00164       sweepEvent.wait(0.5)
00165       if progress is not None:
00166         if progress() != 0:
00167           tmo = rcTrgMiniGLT.__SWEEP_TMO
00168           continue
00169       tmo -= 0.5
00170     if tmo <= 0:
00171       sweepEvent.set()
00172       logging.fatal("Trigger sweep timed out before all events were drained")
00173       return False
00174     self.disable()
00175
00176     #4) Put the original contents of scheduler 0x40 back, and put the TAM back
00177     glt.CAL_STROBE         = calStrobe
00178     glt.TACK               = tack
00179     glt.MARKER             = marker
00180     glt.ZERO_SUPPRESS      = zeroSuppress
00181     glt.FOUR_RANGE_READOUT = fourRange
00182     glt.MASK               = mask
00183
00184     #5) Put the trigger conditions back
00185     if enabled:
00186       glt.enableMask()
00187     self.solicit = goodSolicit
00188
00189     return True
00190
00191
00192   def __falseSolicit(self):
00193     pass
00194
00195
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcUsers.py Source File

runcontrol

rcUsers.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "User maintenance classes"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/01/25 03:09:30 $").split(' ')[1]
00014 __version__  = "$Revision: 2.2 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 class rcUser(object):
00020   """Class that stores security and identification information about users
00021   """
00022   def __init__(self, userId, loginId, userName):
00023     self.__userId = userId
00024     self.__loginId = loginId
00025     self.__userName = userName
00026     self.__roles = []
00027     self.__permissions = []
00028
00029   def getId(self):
00030     """Returns the three digit user id
00031
00032     \return User Id
00033     """
00034     return self.__userId
00035
00036   def getLoginId(self):
00037     """Returns the user's login id
00038
00039     \return Login id
00040     """
00041     return self.__loginId
00042
00043   def getName(self):
00044     """Returns the user name
00045
00046     \return User name
00047     """
00048     return self.__userName
00049
00050   def getRoles(self):
00051     """Returns the list of roles that this user belongs in
00052
00053     \return List of roles
00054     """
00055     return self.__roles
00056
00057   def getPermissions(self):
00058     """Returns the list of permissions that this user has
00059
00060     \return List of permissions
00061     """
00062     return self.__permissions
00063
00064   def addRole(self, role):
00065     """Adds \a role to this user's roles
00066
00067     \param role Role name
00068     """
00069     self.__roles.append(role)
00070
00071   def addPermission(self, permission):
00072     """Adds \a permission to this user's permissions
00073
00074     \param permission Permission name
00075     """
00076     self.__permissions.append(permission)
00077
00078   def isAdministrator(self):
00079     """Returns the user's administrator status
00080
00081     \return 1: If this user is an administrator
00082             0: Otherwise
00083     """
00084     return ('administrator' in self.__roles)
00085
00086   def __str__(self):
00087     return self.getName()
00088
00089 class rcUsers(object):
00090   """A dictionary like class that maintains a list of user objects
00091   """
00092   def __init__(self):
00093     self.__users = {}
00094
00095   def addUser(self, user):
00096     """Adds the \a user to the list
00097
00098     \param user An rcUser object instance
00099     """
00100     self.__users[user.getId()] = user
00101
00102   def deleteUser(self, userId):
00103     """Deletes the user from the list based on the \a userId
00104
00105     \param  userId The three digit id of the user
00106
00107     \return  True: If the user was successfully deleted
00108             False: If the user does not exist
00109     """
00110     if userId in self.__users:
00111       self.__users.__delitem__(userId)
00112       return True
00113     else:
00114       return False
00115
00116
00117   def getUserByLoginId(self, loginId):
00118     """Retrieves the user based on the \a loginId
00119
00120     \param loginId Login id of the user
00121
00122     \return rcUser object instance
00123     """
00124     for user in self.__users.values():
00125       if loginId == user.getLoginId():
00126         return user
00127
00128   def getUserByName(self, name):
00129     """Retrieves the user based on the \a name
00130
00131     \param name Name of the user
00132
00133     \return rcUser object instance
00134     """
00135     for user in self.__users.values():
00136       if name == user.getName():
00137         return user
00138
00139   def getUser(self, userId):
00140     """Retrieves the user based on \a userid
00141
00142     \param Three digit of the user
00143
00144     \return rcUser object instance
00145     """
00146     if userId in self.__users:
00147       return self.__users[userId]
00148
00149   def getUsers(self):
00150     """Retrieves all users
00151
00152     \return A dictionary of all users keyed by the user id
00153     """
00154     return self.__users
00155
00156   def getIdNameDict(self):
00157     """Retrieves all users in the form of a dictionary
00158     where values are user names. Provided for backward compatibility
00159     with the old code.
00160
00161     \return A dictionary of user names keyed by the user id
00162     """
00163     # Provided for backward compatibility to mimick the old list
00164     userList = {}
00165     for (userId, user) in self.__users.items():
00166       userList[userId] = user.getName()
00167     return userList
00168
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: rcUtil.py Source File

runcontrol

rcUtil.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT run control related utility methods"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/03/30 05:59:08 $").split(' ')[1]
00014 __version__  = "$Revision: 2.12 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import imp
00020 import os
00021 import sys
00022 import logging as log
00023 import string
00024 from   types import ModuleType
00025
00026 class Reloader:
00027   DONT_RELOAD_LIST = ['scipy', 'weave', 'qwt', 'xml', 'pyexpat', 'win32',
00028                       'ROOT', 'libPyROOT']
00029
00030   def __init__(self):
00031     self.appinit = {}
00032
00033   def getNewModules(self, keepem):
00034     modules = {}
00035     for i, m in sys.modules.items():
00036       if (i not in keepem) and \
00037           (type(m) == ModuleType):
00038           modules[i] = m
00039     return modules
00040
00041   def clearAppModules(self, dontReloadList, showUnloadedModules):
00042     if self.appinit == {}:
00043       appfinish = {}
00044     else:
00045       appfinish = self.getNewModules(self.appinit)
00046     for i in self.filterModules(appfinish, dontReloadList):
00047       if i in sys.modules:
00048         if showUnloadedModules:
00049           log.debug("Unloading module %s %s" % (i, sys.modules[i].__file__))
00050         del sys.modules[i]
00051     self.appinit = sys.modules.copy()
00052
00053   def filterModules(self, modules, dontReloadList):
00054     dontReload = dontReloadList + Reloader.DONT_RELOAD_LIST
00055     mods = []
00056     for (moduleName, module) in modules.items():
00057       for modulePrefix in dontReload:
00058         if moduleName.startswith(modulePrefix):
00059           break
00060         if '__file__' not in dir(module):
00061           break
00062         if os.path.splitext(module.__file__)[1].lower() in ('.pyd','.dll'):
00063           break
00064         if os.path.normpath(os.path.normcase(module.__file__)).startswith(os.path.normpath(os.path.normcase(sys.prefix))):
00065           break
00066       else:
00067         mods.append(moduleName)
00068     return mods
00069
00070 reloadModules = Reloader()
00071
00072 def importModule(appName, reload=1, dontReloadList=[], showUnloadedModules=0):
00073   """Import a RunControl application or suite
00074   \param appName        Name of the module or pathname of the python script
00075   \param reload         1 = Reload all modules that have been loaded since RunControl started (default)
00076                         0 = Do not reload modules (used if a suite is being loaded)
00077   \param dontReloadList Optional parameter which specifies the additional list of module prefixes
00078                         that should not be reloaded. If this parameter is missing then the default list
00079                         (Reloader.DONT_RELOAD_LIST) is used, if it is specified then it gets appended
00080                         to the default list.
00081
00082   \return The name of the module and the resolved pathname
00083
00084   """
00085
00086   # First check if a module name is specified, if so try to resolve its source.
00087   (appPath, appFile) = os.path.split(appName)
00088   (appBase, appExt)  = os.path.splitext(appFile)
00089   if appExt == '':
00090     try:
00091       if appPath == '':
00092         (f, path, desc) = imp.find_module(appBase)
00093       else:
00094         (f, path, desc) = imp.find_module(appBase, [appPath])
00095       (appPath, appFile) = os.path.split(path)
00096       (appBase, appExt)  = os.path.splitext(appFile)
00097     except ImportError, e:
00098       raise e
00099
00100   _suffixes = {}
00101   for ext, mode, typ in imp.get_suffixes():
00102     _suffixes[ext] = (ext, mode, typ)
00103   _infoMap =  {
00104                 '.py' : ('.py','r',1),
00105                 '.pyc': ('.pyc','rb',2),
00106                 '.pyo': ('.pyo','rb',2)
00107               }
00108
00109
00110   # Temporarily change the directory in case the application
00111   # needs to load additional modules from the same directory.
00112   curDir = os.getcwd()
00113   if appPath != '': os.chdir(appPath)
00114
00115   # Handle relative paths, by resolving the path again after current directory is changed.
00116   appPath = os.getcwd()
00117   if appPath not in sys.path:
00118     sys.path.append(appPath)
00119   appName = os.path.join(appPath, appFile)
00120
00121   pycFile = os.path.join(appPath, appBase + '.pyc')
00122   pyoFile = os.path.join(appPath, appBase + '.pyo')
00123   if appExt == '.py':
00124     if os.path.exists(pyoFile) and os.path.getmtime(pyoFile) >= os.path.getmtime(appName):
00125         filename = pyoFile
00126         appExt = '.pyo'
00127     elif _suffixes.has_key('.pyo'):
00128         filename = appName
00129     elif os.path.exists(pycFile) and os.path.getmtime(pycFile) >= os.path.getmtime(appName):
00130       filename = pycFile
00131       appExt = '.pyc'
00132     else:
00133       filename = appName
00134   elif appExt == '.pyc':
00135     if os.path.exists(pyoFile) and os.path.getmtime(pyoFile) >= os.path.getmtime(appName):
00136       filename = pyoFile
00137       appExt = '.pyo'
00138     else:
00139       filename = appName
00140   elif appExt == '.pyo':
00141     filename = appName
00142   else:
00143     msg = 'Invalid module extension: %s' % appName
00144     raise RuntimeError, msg
00145   info = _infoMap[appExt]
00146   f = file(filename, info[1])
00147
00148   try:
00149     # Clear the modules that was imported during the loading and
00150     # execution of the previous script.
00151     if reload: reloadModules.clearAppModules(dontReloadList, showUnloadedModules)
00152     module = imp.load_module(appBase, f, filename, info)
00153   finally:
00154     f.close()
00155     sys.path.remove(appPath)
00156     if os.path.exists(curDir):
00157       os.chdir(curDir)
00158   return (module, filename)
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Receiver.py Source File

monitoring

Receiver.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Housekeeping receiver module"
00012 __author__   = "J. Panetta <panetta@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "7/20/2004"
00014 __version__  = "$Revision: 1.2 $"
00015 __credits__  = "SLAC"
00016
00017
00018 import LATTE.copyright_SLAC
00019
00020 from LATTE.monitoring.Trendable import Trendable
00021 import logging
00022
00023 class Receiver(object):
00024   """\brief Abstract Receiver class
00025
00026   Receiver objects retrieve the trendable data from some location.
00027   """
00028   def __init__(self):
00029     self.log=logging.getLogger('monitoring.Receiver')
00030     self.__loopStop=0
00031     self.__recThread=None
00032
00033   def isReceiving(self):
00034     if self.__monThread: return 1
00035     else: return 0
00036
00037   def setReceiving(self,bool):
00038     if bool: self.__startLoop()
00039     else: self.__stopLoop()
00040
00041   def shutdown(self):
00042     self.setReceiving(0)
00043
00044   def receive(self):
00045     raise NotImplementedError('receive()' \
00046                               +'must be implemented in a subclass.')
00047
00048   def process(self,trendables):
00049     for t in trendables:
00050       self.log.info(t)
00051
00052 ##private
00053   def __startLoop(self):
00054     if not self.__recThread:
00055       from threading import Thread
00056       self.__recThread=Thread(None,self.__recLoop,'ReceiverLoop')
00057       self.__recThread.start()
00058     else:
00059       self.log.warning('Already a ReceiverLoop Running')
00060
00061   def __stopLoop(self):
00062     if self.__recThread:
00063       self.__loopStop=1
00064       self.__recThread.join()
00065       self.loopStop=0
00066       self.__recThread=None
00067
00068   def __recLoop(self):
00069     self.log.info('Starting Receive Loop')
00070     while (not self.__loopStop):
00071       self.receive()
00072     self.log.info('Receive Loop Stopped')
00073
00074 class UDPReceiver(Receiver):
00075   """\brief UDPReceiver class
00076   """
00077   tType = (Trendable('InvalidName', 0))
00078   def __init__(self):
00079     Receiver.__init__(self)
00080     self.__ddc=None
00081     self.log=logging.getLogger('monitoring.UDPReceiver')
00082
00083   def receive(self):
00084     if self.__ddc:
00085       from cPickle import loads
00086       d,s=self.__ddc.receive()
00087       if not d: return
00088       trendables=loads(d)
00089       for t in trendables:
00090         if not isinstance(t,type(self.tType)):
00091           self.log.error('Data received is not a Trendable')
00092           trendables.remove(t)
00093       self.process(trendables)
00094
00095   def setUDPClient(self,name,server):
00096     from LATTE.tools.DataDistributor import DataDistributorClient
00097     self.log.info('Connecting to DataDistributorServer %s on %s',
00098                     name,server)
00099     #self.__ddc=DataDistributorClient(name,length=40960)
00100     self.__ddc=DataDistributorClient(name)
00101     self.__ddc.connect(server)
00102
00103   def shutdown(self):
00104     if self.__ddc:
00105       self.__ddc.returnNone()
00106     self.setReceiving(0)
00107     if self.__ddc:
00108       self.log.info('Disconnecting from DataDistributorServer')
00109       self.__ddc.disconnect()
00110       self.__ddc=None
00111
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Recorder.py Source File

monitoring

Recorder.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Housekeeping server infrastructure"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "07/28/04"
00014 __version__  = "$Revision: 1.3 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019 import logging
00020 import os
00021
00022 class Recorder(object):
00023   """\brief Recorder class
00024
00025   Base class for the Recorder portion of the monitoring system.
00026   Recorders send on the data that the Retriever class acquires.
00027   """
00028   def __init__(self):
00029     self.__cachedValues={}
00030     self.__log=logging.getLogger('monitoring.Recorder')
00031
00032   def updateTrends(self, trendables):
00033     if trendables is None: return
00034     for t in trendables:
00035       self.__cachedValues[t.name]=t
00036     self.processTrends(trendables)
00037
00038   def processTrends(self, trendables):
00039     raise NotImplementedError('processTrends(trendables)'\
00040                               +'must be implemented in a subclass.')
00041
00042   def shutdown(self):
00043     pass
00044
00045 class DummyRecorder(Recorder):
00046   """\brief Example recorder that dumps the trendables to a logger
00047   """
00048   def __init__(self):
00049     Recorder.__init__(self)
00050     self.__log=logging.getLogger('monitoring.Recorder')
00051
00052   def processTrends(self, trendables):
00053     for t in trendables:
00054       self.__log.info(t)
00055
00056 class FlatFileRecorder(Recorder):
00057   def __init__(self, flatFile):
00058     Recorder.__init__(self)
00059     self.__flatFile = open(flatFile, 'a+')
00060
00061     keyList         = self.__flatFile.readline()
00062     if keyList == '':  # No file,
00063       self.processTrends = self.__createFileHeader
00064     else:
00065       # create a list of keys from whitespace separated text blobs
00066       self.__keyList = keyList.split()
00067       self.processTrends = self.__processTrends
00068     self.__flatFile.seek(0,2)
00069     self.__pad = '   '
00070
00071   def shutdown(self):
00072     self.__flatFile.close()
00073
00074   def __processTrends(self, trendables):
00075     trendMap  = {}
00076     # Add the timestamp
00077     timeStamp = trendables[0].time
00078     trendMap['TimeStamp'] =timeStamp
00079     line = ''
00080
00081     for t in trendables:
00082       trendMap[t.name] = t.content['Raw Value']
00083
00084     for k in self.__keyList:
00085       line += str(trendMap[k]) + self.__pad
00086     line += '\n'
00087     self.__flatFile.write(line)
00088     self.__flatFile.flush()
00089
00090   def __createFileHeader(self, trendables):
00091     # 1: reset function pointer to processTrends
00092     self.processTrends = self.__processTrends
00093     # 2: create the sorted key list
00094     self.__keyList     = []
00095     for t in trendables:
00096       self.__keyList.append(t.name)
00097     self.__keyList.sort()
00098     self.__keyList.insert(0, 'TimeStamp')
00099     line = ''
00100     # 3: write the index line of the file:
00101     for k in self.__keyList:
00102       line += (k + self.__pad)
00103     line += '\n'
00104     self.__flatFile.writelines([line])
00105     # 4: Profit!
00106     self.processTrends(trendables)
00107
00108
00109 class UDPRecorder(Recorder):
00110   """\brief Example recorder that UDP broadcasts trendables
00111
00112   Uses LATTE.tools.DataDistributionServer
00113   """
00114   def __init__(self):
00115     Recorder.__init__(self)
00116     self.__dds=None
00117     self.__log=logging.getLogger('monitoring.UDPRecorder')
00118
00119   def startUDPServer(self,name,server):
00120     from LATTE.tools.DataDistributor import DataDistributorServer
00121     self.__log.info("Starting DataDistributorServer %s on %s",name,server)
00122     self.__dds=DataDistributorServer(name)
00123     self.__dds.connect(server)
00124
00125   def stopUDPServer(self):
00126     if self.__dds:
00127       self.__log.info('Disconnecting Broadcast Server')
00128       self.__dds.disconnect()
00129       self.__dds=None
00130
00131   def processTrends(self,trendables):
00132     if self.__dds:
00133       from cPickle import dumps
00134       # Send to receiver as a binary pickled object
00135       self.__dds.publish(dumps(trendables,1))
00136
00137   def shutdown(self):
00138     self.stopUDPServer()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Retriever.py Source File

monitoring

Retriever.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Housekeeping retriever module"
00012 __author__   = "J. Panetta <panetta@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "7/20/2004"
00014 __version__  = "$Revision: 1.3 $"
00015 __credits__  = "SLAC"
00016
00017
00018 import LATTE.copyright_SLAC
00019
00020 from LATTE.monitoring.Trendable import Trendable
00021
00022 class Retriever(object):
00023   def __init__(self):
00024     pass
00025   def startup(self):
00026     pass
00027   def shutdown(self):
00028     pass
00029   def retrievePacket(self):
00030     raise NotImplementedError('retrievePacket()'\
00031                               +'must be implemented in a subclass.')
00032
00033 class DummyRetriever(Retriever):
00034   """ Dummy retriever used for testing.
00035
00036   Creates 24 trendable objects which are simply sin/cos functions.
00037   """
00038   def __init__(self):
00039     self.monitorList={}
00040     for i in range(12):
00041       self.monitorList['cos_'+'%02i'%(i,)]={'lofail':-0.9,'lowarn':-0.7,
00042                                             'hiwarn':0.7,'hifail':0.9}
00043       self.monitorList['sin_'+'%02i'%(i,)]={'lofail':-0.9,'lowarn':-0.7,
00044                                             'hiwarn':0.7,'hifail':0.9}
00045
00046   def retrievePacket(self):
00047     import math, time
00048     t=time.time()  # time() returns seconds since epoch, UTC
00049     data=[]
00050     keys=self.monitorList.keys()
00051     keys.sort()
00052     for k in keys:
00053       if k.startswith('sin'):
00054         v=math.sin(t*math.pi/12)
00055       elif k.startswith('cos'):
00056         v=math.cos(t*math.pi/12)
00057       # print "appending Trendable ", k
00058       data.append(Trendable(k,t,{'Raw Value':v}))
00059     return data
00060
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: robustapply.py Source File

dispatch

robustapply.py

00001 """Robust apply mechanism
00002
00003 Provides a function "call", which can sort out
00004 what arguments a given callable object can take,
00005 and subset the given arguments to match only
00006 those which are acceptable.
00007 """
00008 __version__  = "$Revision: 2.1 $"
00009
00010 def function( receiver ):
00011     """Get function-like callable object for given receiver
00012
00013     returns (function_or_method, codeObject, fromMethod)
00014
00015     If fromMethod is true, then the callable already
00016     has its first argument bound
00017     """
00018     if hasattr(receiver, '__call__'):
00019         # receiver is a class instance; assume it is callable.
00020         # Reassign receiver to the actual method that will be called.
00021         if hasattr( receiver.__call__, 'im_func') or hasattr( receiver.__call__, 'im_code'):
00022             receiver = receiver.__call__
00023     if hasattr( receiver, 'im_func' ):
00024         # an instance-method...
00025         return receiver, receiver.im_func.func_code, 1
00026     elif not hasattr( receiver, 'func_code'):
00027         raise ValueError('unknown reciever type %s %s'%(receiver, type(receiver)))
00028     return receiver, receiver.func_code, 0
00029
00030 def robustApply(receiver, *arguments, **named):
00031     """Call receiver with arguments and an appropriate subset of named
00032     """
00033     receiver, codeObject, startIndex = function( receiver )
00034     acceptable = codeObject.co_varnames[startIndex+len(arguments):codeObject.co_argcount]
00035     for name in codeObject.co_varnames[startIndex:startIndex+len(arguments)]:
00036         if named.has_key( name ):
00037             raise TypeError(
00038                 """Argument %r specified both positionally and as a keyword for calling %r"""% (
00039                     name, receiver,
00040                 )
00041             )
00042     if not (codeObject.co_flags & 8):
00043         # fc does not have a **kwds type parameter, therefore
00044         # remove unacceptable arguments.
00045         for arg in named.keys():
00046             if arg not in acceptable:
00047                 del named[arg]
00048     return receiver(*arguments, **named)
00049
00050
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: RunControl.py Source File

runcontrol

RunControl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT run control class"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "10/11/2002"
00014 __version__  = "$Revision: 2.5 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019
00020 import                          os
00021 import                          sys
00022 import                          atexit
00023 import                          threading
00024 import logging           as     log
00025 from   qt                import *
00026
00027 from   Queue             import Queue
00028 from   RunControlFSM     import RunControlFSM
00029 from   RunControlGUIImpl import RunControlGUIImpl
00030
00031 from   LATTE.database.gVersions import Gversions
00032 from   LATTE.tools.guiBridges   import QtThreadBridge, PyThreadBridge
00033 from   LATTE.client.gLog        import logException
00034 from   LATTE.tools.taskEngine   import TaskEngine
00035
00036
00037 class ConnectState:
00038   Disconnected = 0
00039   Waiting      = 1
00040   Connected    = 2
00041
00042 class RunControl(RunControlGUIImpl):
00043   """Class for providing a run control framework
00044   """
00045
00046   GUI_CMD_INST    = QEvent.Type(QEvent.User + 1)
00047   GUI_CMD_FUNC    = QEvent.Type(QEvent.User + 2)
00048   GUI_CMD_FUNC_NR = QEvent.Type(QEvent.User + 3)
00049
00050   def __init__(self, common, parent = None, name = None, fl = 0):
00051     RunControlGUIImpl.__init__(self, common, parent, name, fl)
00052
00053     self.gui      = self                # For backward compatibility
00054
00055     self.__common       = common
00056     self.__fsm          = None
00057     self.__actionEngine = None
00058     self.__hwVersions   = None
00059     self.__queue        = None
00060     self.__engine       = None
00061
00062     # Set this object to be the client handler
00063     common.getCmdCli().handler(self)
00064     self.__connection_state = ConnectState.Disconnected
00065     #self.StopButton.setEnabled(False)
00066     #self.RunButton.setEnabled(False)
00067     #self.PauseButton.setEnabled(False)
00068
00069     # Set up the GUI bridge
00070     self.initGUIbridges()
00071
00072     self.__actionEngine = TaskEngine("FSMactionEngine")
00073     self.__actionEngine.start()
00074
00075     self.commandSynch = TaskEngine("CommandSynch")
00076     self.commandSynch.start()
00077
00078     self.eventHandler = TaskEngine("EventHandler")
00079     self.eventHandler.start()
00080
00081     # Clean up at exit
00082     self.inShutdown = False
00083     atexit.register(self.__shutdown)
00084
00085   def disconnected(self):
00086     self.__disconnect()
00087
00088   def timedout(self):
00089     self.__disconnect()
00090
00091   def __connection_notthere(self): # GUI thread
00092     #self.StopButton.setEnabled(False)
00093     #self.RunButton.setEnabled(False)
00094     #self.PauseButton.setEnabled(False)
00095     if self.__connection_state == ConnectState.Connected:
00096       log.error("OCS server disconnected, trying to reconnect")
00097       self.__connection_state = ConnectState.Waiting
00098       self.__common.disconnect() # RiC
00099       self.__connect()
00100
00101   def __connection_established(self): # GUI thread
00102     log.info("OCS server is now connected")
00103     #self.StopButton.setEnabled(True)
00104     #self.RunButton.setEnabled(True)
00105     #self.PauseButton.setEnabled(True)
00106     self.__connection_state = ConnectState.Connected
00107
00108   def __connection_failed(self, msg): # GUI thread
00109     if self.__tries == 0:
00110       log.error(msg)
00111     self.__tries += 1
00112     return self.__connection_state
00113
00114   def connectClicked(self): # GUI thread
00115     if self.__connection_state is ConnectState.Disconnected:
00116       self.fileConnectAction.setMenuText("Disconnect")
00117       self.__connection_state = ConnectState.Waiting
00118       self.__tries = 0
00119       self.__connect()
00120     else:
00121       self.fileConnectAction.setMenuText("Connect")
00122       self.__connection_state = ConnectState.Disconnected
00123       self.__disconnect()
00124
00125   def __connect(self):
00126     connecthdlr = threading.Thread(None, self.__connection_handler, 'ConnectHandler',())
00127     connecthdlr.setDaemon(True)
00128     connecthdlr.start()
00129
00130   def __disconnect(self):
00131     self.execGUImethod(self.__connection_notthere)
00132
00133   def __connection_handler(self):
00134     while (True):
00135       try:
00136         self.__common.connect()
00137         self.execGUImethodNR(self.__connection_established)
00138         break
00139       except RuntimeError, msg:
00140         state = self.execGUImethod(self.__connection_failed, msg)
00141         if state == ConnectState.Disconnected: break
00142         time.sleep(3)
00143
00144   def userId(self):
00145     return 43231  #self.preferences()["userid"]
00146
00147   def __statusMsg(self, msg, tmo):
00148     self.statusBar().message(msg, tmo)
00149
00150   def __shutdown(self):
00151     """\brief Clean up and shut down the various threads.
00152     """
00153     # This method expects to be executed from the GUI thread.
00154
00155     self.inShutdown = True
00156
00157     # Bring the system into the RESET state
00158     self.doReset()
00159
00160     # Use the following non-NR call to wait for the reset to finish
00161     self.execGUImethod(self.statusBar().message, "Exiting")
00162
00163     # Shut down the task engines
00164     self.__actionEngine.shutdown()
00165     self.eventHandler.shutdown()
00166     self.commandSynch.shutdown()
00167
00168     # After the FSM Action Engine has shut down we can delete the FSM
00169     if self.__fsm:
00170       del self.__fsm
00171       self.__fsm = None
00172
00173   def __start(self, applName):
00174     ## Import the application
00175     #(appPath, appFile) = os.path.split(applName)
00176     #(appBase, appExt)  = os.path.splitext(appFile)
00177     #appStuff = self.__bml.find_module(appBase, (appPath,))
00178     #if appStuff is None:
00179     #  msg = 'Application %s is invalid' % applName
00180     #  logging.error(msg)
00181     #  return msg
00182     #module = self.__bml.load_module(appBase, appStuff)
00183     #if 'userApplication' not in dir(module):
00184     #  msg = 'Application %s is missing a userApplication class' % applName
00185     #  logging.error(msg)
00186     #  return msg
00187
00188     import rcUtil
00189     try:
00190       dontReloadList = self.__common.options().noreload
00191       (module, filename) = rcUtil.importModule(appName=applName, reload=1, dontReloadList=dontReloadList)
00192     except Exception, e:
00193       logException()
00194       self.execGUImethodNR(self.__statusMsg, e[0], 0)
00195       return
00196
00197     # Instantiate the application
00198     app = module.userApplication(self, self.__common.prefMan().userId(),
00199                                  self.__common.options().evtdebug is not None)
00200     log.info("Application %s loaded" % app.getName())
00201
00202     # Set up the Finite State Machine
00203     self.__fsm = RunControlFSM(app)
00204
00205     self.execGUImethodNR(self.__statusMsg, '%s: Loaded application %s' %
00206                          (self.__fsm.current_state, applName), 0)
00207
00208   def SetupClicked(self):
00209     RunControlGUIImpl.SetupClicked(self)
00210     self.__actionEngine.spawn(self.__setup)
00211
00212   def __setup(self):
00213     if self.__fsm is not None:
00214       self.__fsm.process('SETUP')
00215       self.__statusMsg(self.__fsm.current_state, 0)
00216
00217   def TeardownClicked(self):
00218     RunControlGUIImpl.TeardownClicked(self)
00219     self.__actionEngine.spawn(self.__teardown)
00220
00221   def __teardown(self):
00222     if self.__fsm is not None:
00223       self.__fsm.process('TEARDOWN')
00224       self.__statusMsg(self.__fsm.current_state, 0)
00225
00226   def StartRunClicked(self):
00227     RunControlGUIImpl.StartRunClicked(self)
00228     self.__actionEngine.spawn(self.__run)
00229
00230   def __run(self):
00231     if self.__fsm is not None:
00232       self.__fsm.process('START_RUN')
00233       self.__statusMsg(self.__fsm.current_state, 0)
00234
00235   def StopRunClicked(self):
00236     RunControlGUIImpl.StopRunClicked(self)
00237     self.__actionEngine.spawn(self.__stoprun)
00238
00239   def __stoprun(self):
00240     if self.__fsm is not None:
00241       self.__fsm.process('STOP_RUN')
00242       self.__statusMsg(self.__fsm.current_state, 0)
00243
00244   def PauseClicked(self):
00245     RunControlGUIImpl.PauseClicked(self)
00246     self.__actionEngine.spawn(self.__pause)
00247
00248   def __pause(self):
00249     if self.__fsm is not None:
00250       self.__fsm.process('PAUSE')
00251       self.__statusMsg(self.__fsm.current_state, 0)
00252
00253   def ResumeClicked(self):
00254     RunControlGUIImpl.ResumeClicked(self)
00255     self.__actionEngine.spawn(self.__resume)
00256
00257   def __resume(self):
00258     if self.__fsm is not None:
00259       self.__fsm.process('RESUME')
00260       self.__statusMsg(self.__fsm.current_state, 0)
00261
00262   def StopClicked(self):
00263     RunControlGUIImpl.StopClicked(self)
00264     self.__actionEngine.spawn(self.__stop)
00265
00266   def __stop(self):
00267     if self.__fsm is not None:
00268       self.__fsm.process('STOP')
00269       self.__statusMsg(self.__fsm.current_state, 0)
00270
00271
00272   def load(self):
00273     if self.__fsm is not None and self.__fsm.current_state != 'RESET':
00274       print "Applications are loadable only in the RESET state"
00275       self.__statusMsg('%s: Applications are loadable only in the RESET state' %
00276                        (self.__fsm.current_state), 0)
00277       return
00278
00279     applName = RunControlGUIImpl.load(self)
00280     if applName is None:
00281       if self.__fsm is not None:
00282         self.__statusMsg('%s: Loading aborted' % (self.__fsm.current_state), 0)
00283       else:
00284         self.__statusMsg('Loading aborted', 0)
00285       return
00286
00287     if self.__fsm is not None:
00288       self.__shutdown()
00289
00290     # Start the application in its own thread after the reset from above
00291     # (if any) completes.
00292     self.__actionEngine.spawn(self.__start, str(applName))
00293
00294     #msg = self.__start(str(applName))
00295     #if msg is None:
00296     #  self.__statusMsg('%s: Loaded application %s' %
00297     #                   (self.__fsm.current_state, applName), 0)
00298     #else:
00299     #  self.__statusMsg(msg, 0)
00300
00301   def fileExit(self):
00302     self.close()
00303
00304   def ExitButtonClicked(self):
00305     self.close()
00306
00307   def doReset(self):
00308     """Emit a Reset button click under program control.
00309     Can be done from a subthread."""
00310     self.doEmit(self.ResetButton)
00311
00312   def doStop(self):
00313     """Emit a Stop button click under program control.
00314     Can be done from a subthread."""
00315
00316     # Ignore the doStop for this RunControl GUI
00317     return
00318     self.doEmit(self.StopButton)
00319
00320   def doStopRun(self):
00321     """Depricated version of doStop()."""
00322     self.doStop()
00323
00324   def doRun(self):
00325     """Emit a Run button click under program control.
00326     Can be done from a subthread."""
00327     self.doEmit(self.RunButton)
00328
00329   def doPause(self):
00330     """Emit a Pause button click under program control.
00331     Can be done from a subthread."""
00332     self.doEmit(self.PauseButton)
00333
00334   def doEmit(self, obj, signal = SIGNAL("clicked()"), args = ()):
00335     """Emit a signal, possibly from a subthread.
00336     By default the signal is 'clicked()' with no arguments."""
00337     if self.isGUIthread():
00338       obj.emit(signal, args)
00339     else:
00340       self.execGUImethodNR(obj.emit, signal, args)
00341
00342   def normalCursor(self):
00343     self.execGUImethodNR(self.setCursor, QCursor(QWidget.ArrowCursor))
00344
00345   def waitCursor(self):
00346     self.execGUImethodNR(self.setCursor, QCursor(QWidget.WaitCursor))
00347
00348   def getHardwareVersions(self, lat=None):
00349     if self.__hwVersions is None:
00350       self.__hwVersions = Gversions.getHardwareVersions(lat)
00351     return self.__hwVersions
00352
00353   def clearHardwareVersionsCache(self):
00354     self.__hwVersions = None
00355
00356   def getFSM(self):
00357     return self.__fsm
00358
00359   def setLAT(self, lat):
00360     self.__lat = lat
00361
00362   def initGUIbridges(self):
00363     self.__thread = threading.currentThread()
00364     inQueue  = Queue()
00365     outQueue = Queue()
00366     self.__qtBridge = QtThreadBridge("QtBridge", outQueue, inQueue)
00367     self.__qtBridge.start()
00368     self.__pyBridge = PyThreadBridge("PyBridge", inQueue, outQueue)
00369
00370   def isGUIthread(self):
00371     return threading.currentThread() == self.__thread
00372
00373   def customEvent(self, e):
00374     # This method overrides the QObject base class's
00375     data = e.data()
00376     qtBridge = data[-1]
00377     if e.type() == RunControl.GUI_CMD_INST:
00378       qtBridge.pushResponse(data[0](*data[1:-2], **data[-2]))
00379     elif e.type() == RunControl.GUI_CMD_FUNC:
00380       qtBridge.pushResponse(data[0](*data[1:-2], **data[-2]))
00381     elif e.type() == RunControl.GUI_CMD_FUNC_NR:
00382       data[0](*data[1:-2], **data[-2])
00383
00384   def createGUI(self, obj, *args, **kwargs):
00385     """Method used for instantiating a GUI from a non-GUI subthread"""
00386     self.__pyBridge.pushEvent((RunControl.GUI_CMD_INST, self, (obj,)+args+(kwargs,)))
00387     return self.__pyBridge.pullResponse()
00388
00389   def execGUImethodNR(self, func, *args, **kwargs):
00390     """Method used for executing a GUI function from a non-GUI thread.
00391     Use this method when no (useful) response is expected or
00392     when waiting for one could cause a deadlock.  Any response from the
00393     function is lost."""
00394     if self.inShutdown:  return # Don't try to update the GUI during shutdown
00395     self.__pyBridge.pushEvent((RunControl.GUI_CMD_FUNC_NR, self, (func,)+args+(kwargs,)))
00396
00397   def execGUImethod(self, func, *args, **kwargs):
00398     """Method used for executing a GUI function from a non-GUI thread.
00399     Use this method when a response is expected from the function and
00400     when it is appropriate to wait for it (no deadlock arises)"""
00401     self.__pyBridge.pushEvent((RunControl.GUI_CMD_FUNC, self, (func,)+args+(kwargs,)))
00402     return self.__pyBridge.pullResponse()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: RunControlCommon.py Source File

runcontrol

RunControlCommon.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT run control common class"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "2/5/2003"
00014 __version__  = "$Revision: 2.46 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019
00020 import sys
00021 import os
00022 import time
00023 import types
00024 import atexit
00025 import socket
00026 import logging as log
00027 import logging.handlers
00028 from rcLoginImpl          import rcLoginImpl
00029 from rcSecurityMan        import rcSecurityMan
00030 from rcPreferencesManager import rcPreferencesManager
00031 from rcPreferencesGUIImpl import rcPreferencesGUIImpl
00032
00033 from LATTE.client.gOptions import Options
00034 from LATTE.client.gCmdCli import CmdCli
00035 from LATTE.client.gEvtCli import EvtCli
00036 from LATTE.database.gLAT import GLAT
00037 from LATTE.database.gXBR import GXBRD
00038 from LATTE.database.gOCS import GOCS
00039 from LATTE.logger.MSGLogGUIImpl import MSGLogGUIImpl
00040 from LATTE.database.gVersions import Gversions
00041
00042
00043 class GDBN(dict):
00044   """\brief Database node record.
00045
00046      The database node contains session level variables in addition
00047      to preferences and entries used for diagnostics purposes.
00048   """
00049   def __init__(self):
00050     """\brief Initialize the dictionary.
00051
00052     """
00053     dict.__init__(self)
00054
00055
00056 class RunControlSocketHandler(logging.handlers.SocketHandler):
00057   def __init__(self, *args):
00058     apply(logging.handlers.SocketHandler.__init__, (self,) + args)
00059
00060   def handleError(self, record):
00061     if self.closeOnError and self.sock:
00062       self.sock.shutdown(2)
00063       self.sock.close()
00064       self.sock = None        #try to reconnect next time
00065     else:
00066       raise IOError, sys.exc_info()[1]
00067
00068 class ErrorLogCounterHandler(logging.Handler):
00069   def __init__(self, common):
00070     logging.Handler.__init__(self)
00071     self.__common = common
00072
00073   def emit(self, record):
00074     self.__common.incrementErrorLogCount()
00075
00076 class RunControlFileHandler(log.FileHandler):
00077   """\brief FileHandler class for handling multiple line log entries
00078
00079   If a log entry contains multiple lines, such as the case for
00080   tracebacks or exceptions a begin and end delimiter is added
00081   to the log entry so that it can be parsed by the MessageLogger
00082   """
00083   def __init__(self, filename, mode):
00084     log.FileHandler.__init__(self, filename, mode)
00085
00086   def emit(self, record):
00087     try:
00088       msg = self.format(record)
00089       (msg1, msg2) = msg.split(' - ',1)
00090       if msg2.find('\n') > 0:
00091         msg = msg1 + " - <//" + msg2+"//>"
00092       if not hasattr(types, "UnicodeType"): #if no unicode support...
00093         self.stream.write("%s\n" % msg)
00094       else:
00095         try:
00096           self.stream.write("%s\n" % msg)
00097         except UnicodeError:
00098           self.stream.write("%s\n" % msg.encode("UTF-8"))
00099       self.flush()
00100     except:
00101       self.handleError(record)
00102
00103 class RunControlCommon(object):
00104   """Common class for providing a run control helper functions
00105   """
00106   def __init__(self):
00107     self.MSGLogger = None
00108     self.__startGMT = time.gmtime()
00109     self.__options  = Options(['config', 'server'],
00110                               ['appdir','cmddebug','evtdebug','fswmsglevel',
00111                                'noreload','schema','securedir','app',
00112                                'ocsport'],
00113                               ['initforce','noerrfile','norcoverride',
00114                                'ocsverbose','oesforce',
00115                                'playback','paramverify','noplumbing'])
00116     if len(sys.argv) > 1 and sys.argv[1] == '--help':
00117       self.__options.usage()
00118       print self.__usage()
00119       sys.exit(0)
00120     self.__lat = None
00121     self.__xbrd = None
00122     self.__dds = None
00123     self.__server = None
00124     try:
00125       self.__options.parse()
00126     except Exception, msg:
00127       self.__options.usage(self.__usage())
00128       raise Exception, msg
00129
00130     if self.__options.ocsport is not None:
00131       self.__cmdCli = CmdCli(port=int(self.__options.ocsport))
00132       self.__evtCli = EvtCli(port=int(self.__options.ocsport))
00133     else:
00134       self.__cmdCli = CmdCli()
00135       self.__evtCli = EvtCli()
00136     self.__ocs = GOCS(self.__cmdCli)
00137     self.__securityMan = None
00138     self.__dbn = GDBN()
00139     self.__prefMan = None
00140     self.__prefGUI = None
00141     self.__errLogCnt = 0
00142     self.__hwVersions = None
00143
00144     try:
00145       import qt
00146       self.__qApp = qt.QApplication([])
00147       self.__qApp.addLibraryPath(os.path.join(os.environ['ONLINE_ROOT'],
00148                                                 'LATTE/ext/plugins'))
00149     except ImportError:
00150       self.__qApp = None
00151
00152     # Arrange for logging to be properly shutdown at program exit
00153     atexit.register(log.shutdown)
00154
00155   def initialize(self, startup=False):
00156     self.__prefMan = rcPreferencesManager(self.__options.config)
00157     if (self.__prefMan.loadConfig()):
00158       if self.__options.cmddebug is not None:
00159         self.__cmdCli.setDebug(int(self.__options.cmddebug))
00160
00161       if self.__options.evtdebug is not None:
00162         self.__evtCli.setDebug(int(self.__options.evtdebug))
00163
00164       self.startLogger(startup)
00165
00166       if self.__options.securedir is not None:
00167         self.__securityMan = rcSecurityMan(os.path.abspath(self.__options.securedir),
00168                                            self.__prefMan.preferences()["users"])
00169         self.__securityMan.readPermissions()
00170         self.__dbn['_securityMan'] = self.__securityMan
00171       if self.__options.noreload is not None:
00172         import string
00173         self.__dbn["_dontReload"] = map(string.strip, file(self.__options.noreload).readlines())
00174     else:
00175       raise RuntimeError, "Can not find configuration file: %s" % self.__options.config
00176
00177   def __usage(self):
00178     return """
00179
00180 Detailed explanation:
00181
00182 Mandatory options:
00183 --server to specify the hostname or the IP address of the teststand crate
00184    to connect to.
00185 --config to specify the run control configuration file to use
00186
00187 Optional options:
00188 --app Specify the standalone application or suite to run.
00189    Typically used by test or suite runners.
00190 --appdir Specify the application directory
00191 --cmddebug Specify command client debug mode (defaults to 0).
00192    If this option is specified then all register accesses from the
00193    command client is logged to the logger.
00194 --evtdebug Specify event client debug mode (defaults to 0)
00195    The following debug modes are available and can be added together
00196    for combinations:
00197      0: No Debug
00198      1: Debug All
00199      2: Event Dump
00200      4: Warnings
00201      8: Parser Output
00202     16: Error Output
00203 --fswmsglevel Specify the FSW message level for the OCS manager task.
00204 --initforce Force command-response and event fabrics initialization on the SBC.
00205 --noerrfile Disable error archive file output.
00206 --norcoverride Prevents the run conditions to be overridden with NOT-DEFINED.
00207 --noreload Specify a file that contains prefixes of modules
00208    which should not be reloaded when a user script is selected.
00209    This list gets appended to the default list which currently contains
00210    the following prefixes 'scipy', 'weave', 'qwt', 'xml', 'pyexpat', 'win32'.
00211    The file should contain one prefix per line.
00212 --ocsverbose Enable fabrics initialization messages on the SBC.
00213 --noplumbing Do not automatically plumb the LAT upon connection.
00214 --ocsport Define the port used to connect to OCS
00215 --oesforce Force our OES socket to be the default event server for the SBC.
00216 --paramverify Force the parameter verifier to come up even if running in non-secure mode
00217 --playback Indicate that Run Control should command the
00218    event server to play back the next event from its file. Since
00219    this is done using the GLT's self trigger command, the state of
00220    the internal trigger enable bit deterimines whether the
00221    application or Run Control will issue the self trigger command.
00222    No events will be delivered if the application has the internal
00223    trigger enabled, but doesn't issue CMD_SELF_TRIGGERs.
00224 --schema Specify the schema file to load.
00225 --securedir The full path to the secure directory where the password file
00226    ("passwords") and the user permissions file ("security.cfg") is stored.
00227    If this switch is specified then RunControl is started in secure mode.
00228   """
00229
00230
00231
00232
00233   def connect(self, force=False):
00234     self.__cmdCli.connect(self.__options.server)
00235     self.__evtCli.connect(self.__options.server, force)
00236     self.__evtCli.purge()
00237
00238   def disconnect(self):
00239     self.__cmdCli.disconnect()
00240     self.__evtCli.disconnect()
00241
00242   def readSchema(self, filename):
00243     self.__lat = GLAT(self.__cmdCli)
00244     self.__lat.readSchema(filename)
00245     # Do not load the schema again if the GXBRD node does not exist.
00246     # See LTE-325 for more info.
00247     if self.__lat.xbrdExists():
00248       self.__xbrd = GXBRD(self.__cmdCli)
00249       self.__xbrd = self.__xbrd.readSchema(filename)
00250     else:
00251       self.__xbrd = None
00252     self.__dbn['_LATSchema'] = self.__lat
00253     self.__dbn['_LATSchemaFile'] = filename
00254     self.__dbn['_XBRDSchema'] = self.__xbrd
00255     self.__dbn['_XBRDchemaFile'] = filename
00256
00257   def elogWebsite(self):
00258     import webbrowser
00259     webbrowser.open(url=self.__prefMan.preferences()["elogurl"], new=1)
00260
00261   def EBFdistribution(self):
00262     if int(self.__prefMan.preferences()["servernbl"]) == 0:
00263       if self.__dds is not None:
00264         self.__dds.disconnect()
00265         log.info("Disconnected from the data distribution server since it was disabled in preferences.")
00266         self.__dds = None
00267       return
00268     dataType   = 'LAT_EBFdata'
00269     server     = self.__prefMan.preferences()["server"].strip()
00270     if server != '':
00271       try:
00272         import LATTE.tools.DataDistributor as DD
00273       except:
00274         log.error("Can't find DataDistributor module, is it in PYTHONPATH?")
00275       else:
00276         if self.__server is None:
00277           self.__dds = DD.DataDistributorServer(dataType)
00278           try:
00279             self.__dds.connect(server)
00280             log.info("Connected to the data distribution server at %s." % server)
00281             #atexit.register(self.__dds.disconnect)  # Already done somewhere?
00282           except:
00283             log.warn("Unable to connect to data distribution server %s: serving of %s disabled" % (self.__prefMan.preferences()["server"], dataType))
00284             self.__dds = None
00285         elif server != self.__server:
00286           if self.__dds is not None:
00287             self.__dds.disconnect()
00288             log.info("Disconnected from the data distribution server.")
00289           self.__dds = DD.DataDistributorServer(dataType)
00290           try:
00291             self.__dds.connect(server)
00292             log.info("Reconnected to the data distribution server since the server changed in preferences.")
00293             #atexit.register(self.__dds.disconnect)  # Already done somewhere?
00294           except:
00295             log.warn("Unable to connect to data distribution server %s: serving of %s disabled" % (self.__prefMan.preferences()["server"], dataType))
00296             self.__dds = None
00297       self.__server = self.__prefMan.preferences()["server"].strip()
00298
00299   def setLoggingLevel(self, logLevel=None):
00300     if logLevel is None: logLevel = self.__prefMan.preferences()["loglevel"]
00301     # Set the log levels at the handler level so that
00302     # file based handlers can still record DEBUG logs.
00303     log.getLogger("").setLevel(0)
00304     # First handler is always the default stdout handler
00305     log.getLogger("").handlers[0].setLevel(eval("log."+logLevel))
00306     for hdlr in log.getLogger("").handlers[1:]:
00307       if hdlr.__class__.__name__ == 'RunControlSocketHandler':
00308         hdlr.setLevel(eval("log."+logLevel))
00309       elif hdlr.__class__.__name__ == 'ErrorLogCounterHandler':
00310         hdlr.setLevel(eval("log.ERROR"))
00311
00312   def startLogger(self, startup=True):
00313     # Start up the message logger
00314     log.basicConfig()
00315     loghost = self.__prefMan.preferences()["loghost"]
00316     logport = self.__prefMan.preferences()["logport"]
00317     local = socket.gethostname().lower() == loghost.lower() or socket.gethostbyname(loghost) == '127.0.0.1'
00318     if int(self.__prefMan.preferences()["lognbl"]) == 1:
00319       if local and startup:
00320         if self.MSGLogger is not None:
00321           return
00322         self.MSGLogger = MSGLogGUIImpl(logport)
00323         self.MSGLogger.startListenerThread()
00324       msgPath = self.__prefMan.preferences()["logdir"]
00325       # Note that if the file already exists, it will be appended to
00326       ts   = time.strftime('%y%m%d%H%M%S', self.__startGMT)
00327       fileName = "msg" + ts + ".log"
00328       self.__prefMan.preferences()["logfilename"] = fileName
00329       fmt = log.Formatter("%(asctime)s(UT) %(filename)s:%(lineno)d %(levelname)-5s - %(message)s")
00330       fmt.converter = time.gmtime
00331       self.fileHdlr = RunControlFileHandler(os.path.join(msgPath, fileName), "a")
00332       self.fileHdlr.setFormatter(fmt)
00333       log.getLogger("").addHandler(self.fileHdlr)
00334       self.sockHdlr = RunControlSocketHandler(loghost,
00335                                               logport)
00336       self.sockHdlr.setFormatter(fmt)
00337       log.getLogger("").addHandler(self.sockHdlr)
00338       self.errLogCounter = ErrorLogCounterHandler(self)
00339       log.getLogger("").addHandler(self.errLogCounter)
00340       self.setLoggingLevel()
00341       try:
00342         log.info('Trying to connect to the message logger')
00343       except:
00344         log.getLogger("").removeHandler(self.sockHdlr)
00345         log.exception("Can't connect to the message logger, disabling logging to socket")
00346       else:
00347         log.info('Successfully connected to the message logger')
00348     elif self.MSGLogger is not None:
00349       log.info('Disconnecting from the message logger')
00350       if local:
00351         self.MSGLogger.close()
00352         self.MSGLogger = None
00353       log.getLogger("").removeHandler(self.errLogCounter)
00354       log.getLogger("").removeHandler(self.sockHdlr)
00355       log.getLogger("").removeHandler(self.fileHdlr)
00356       log.shutdown()
00357     else:
00358       # Make sure error log counter handler is added
00359       # even when logs are disabled
00360       self.errLogCounter = ErrorLogCounterHandler(self)
00361       log.getLogger("").addHandler(self.errLogCounter)
00362       self.setLoggingLevel()
00363
00364
00365   def stopRunLog(self, fileHdlr):
00366     fileHdlr.close()
00367     log.getLogger("").removeHandler(fileHdlr)
00368
00369   def startRunLog(self, fileName):
00370     fileHdlr = RunControlFileHandler(fileName, "w")
00371     fmt = log.Formatter("%(asctime)s(UT) %(filename)s:%(lineno)d %(levelname)-5s - %(message)s")
00372     fmt.converter = time.gmtime
00373     fileHdlr.setFormatter(fmt)
00374     log.getLogger("").addHandler(fileHdlr)
00375     return fileHdlr
00376
00377   def options(self):
00378     return self.__options
00379
00380   def prefMan(self):
00381     return self.__prefMan
00382
00383   def prefGUI(self):
00384     if self.__prefGUI is None:
00385       self.__prefGUI = rcPreferencesGUIImpl(self)
00386     return self.__prefGUI
00387
00388   def getMSGLogger(self):
00389     return self.MSGLogger
00390
00391   def getDDS(self):
00392     return self.__dds
00393
00394   def getCmdCli(self):
00395     return self.__cmdCli
00396
00397   def getEvtCli(self):
00398     return self.__evtCli
00399
00400   def getLAT(self):
00401     return self.__lat
00402
00403   def getXBRD(self):
00404     return self.__xbrd
00405
00406   def getOCS(self):
00407     return self.__ocs
00408
00409   def getDBN(self):
00410     return self.__dbn
00411
00412   def getSecurityMan(self):
00413     return self.__securityMan
00414
00415   def getQtApp(self):
00416     return self.__qApp
00417
00418   def getLoginId(self):
00419     """Returns the login id for the last successful login
00420     """
00421     return self.__loginId
00422
00423   def getErrorLogCount(self):
00424     return self.__errLogCnt
00425
00426   def incrementErrorLogCount(self):
00427     self.__errLogCnt += 1
00428
00429   def resetErrorLogCount(self):
00430     self.__errLogCnt = 0
00431
00432   def showLogin(self, parent):
00433     login = rcLoginImpl(parent=parent)
00434     status = login.exec_loop()
00435     if status == login.Accepted:
00436       loginId = str(login.txtLoginId.text()).strip()
00437       password = str(login.txtPassword.text()).strip()
00438       authResult = self.__securityMan.authenticateUser(loginId, password)
00439       if authResult == 0:
00440         self.__loginId = loginId
00441         log.info("User %s successfully logged in" % loginId)
00442         return 1
00443       elif authResult == -1:
00444         log.error("User authentication failed, loginId=%s" % loginId)
00445         return authResult
00446       else:
00447         log.error("Password database is not accessible.")
00448         return authResult
00449     else:
00450       return None
00451
00452   def getHardwareVersions(self, lat=None, xbrd=None):
00453     if self.__hwVersions is None:
00454       if lat is None: lat = self.getLAT()
00455       if xbrd is None: xbrd = self.getXBRD()
00456       self.__hwVersions = Gversions.getHardwareVersions(lat, xbrd)
00457     return self.__hwVersions
00458
00459   def clearHardwareVersionsCache(self):
00460     self.__hwVersions = None
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: RunControlFSM.py Source File

runcontrol

RunControlFSM.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Finite State Machine class for Online Run Control"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "11/13/2002"
00014 __version__  = "$Revision: 2.2 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import logging as     log
00020 from   FSM     import FSM
00021
00022
00023 class RunControlFSM(FSM):
00024   def __init__(self, app):
00025     FSM.__init__(self, 'RESET', None)
00026     self.set_default_transition(                        self.error,    None    )
00027     self.add_transition        ('SETUP',     'RESET',   self.setup,   'STOPPED')
00028     self.add_transition        ('TEARDOWN',  'STOPPED', self.teardown,'RESET'  )
00029     self.add_transition        ('START_RUN', 'STOPPED', self.startRun,'RUNNING')
00030     self.add_transition        ('STOP_RUN',  'RUNNING', self.stopRun, 'STOPPED')
00031     self.add_transition        ('PAUSE',     'RUNNING', self.pause,   'PAUSED' )
00032     self.add_transition        ('RESUME',    'PAUSED',  self.resume,  'RUNNING')
00033     self.add_transition        ('STOP',      'PAUSED',  self.stop,    'STOPPED')
00034     self.__app = app
00035
00036
00037   def error(self):
00038     log.error(self.__class__.__name__ + "Undefined transition: (%s, %s)" % \
00039               (str(self.input_symbol), str(self.current_state)))
00040
00041   def setup(self):
00042     return self.__app.rcSetup()
00043
00044   def teardown(self):
00045     return self.__app.rcTeardown()
00046
00047   def startRun(self):
00048     return self.__app.rcStartRun()
00049
00050   def stopRun(self):
00051     return self.__app.rcStopRun()
00052
00053   def pause(self):
00054     return self.__app.rcPause()
00055
00056   def resume(self):
00057     return self.__app.rcResume()
00058
00059   def stop(self):
00060     return self.__app.rcStop()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: RunControlGUIImpl.py Source File

runcontrol

RunControlGUIImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT GUI for Online Run Control"
00012 __author__   = """A. Kavelaars <AliciaK@SLAC.Stanford.edu>
00013                                SLAC - GLAST LAT I&T/Online"""
00014 __date__     = "11/13/2002"
00015 __version__  = "$Revision: 2.2 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 import sys, os
00022 from qt import *
00023 from RunControlGUI import RunControlGUI
00024 from ConfigParser  import ConfigParser
00025 from rcPreferencesGUIImpl import rcPreferencesGUIImpl
00026
00027
00028 class RunControlGUIImpl(RunControlGUI):
00029
00030   def __init__(self, common, parent = None, name = None, fl = 0):
00031     RunControlGUI.__init__(self, parent, name, fl)
00032
00033     self.connect(self.SetupButton,SIGNAL("clicked()"),self.SetupClicked)
00034     self.connect(self.TeardownButton,SIGNAL("clicked()"),self.TeardownClicked)
00035     self.connect(self.StartRunButton,SIGNAL("clicked()"),self.StartRunClicked)
00036     self.connect(self.StopRunButton,SIGNAL("clicked()"),self.StopRunClicked)
00037     self.connect(self.ResumeButton,SIGNAL("clicked()"),self.ResumeClicked)
00038     self.connect(self.PauseButton,SIGNAL("clicked()"),self.PauseClicked)
00039     self.connect(self.StopButton,SIGNAL("clicked()"),self.StopClicked)
00040
00041     self.connect(self.AppOpenButton,SIGNAL("clicked()"),self.load)
00042     self.connect(self.ExitButton,SIGNAL("clicked()"),self.ExitButtonClicked)
00043
00044     self.connect(self.fileSelect_SchemaAction,SIGNAL("activated()"),self.loadSchema)
00045     self.connect(self.fileConnectAction,SIGNAL("activated()"),self.connectClicked)
00046
00047     defaultDir = ""
00048     self.__prefs = common.prefMan().preferences()
00049     self.__common = common
00050
00051     self._currentSchema = self.__prefs['reposdir']
00052
00053   def common(self):
00054     return self.__common
00055
00056   def preferences(self):
00057     return self.__prefs
00058
00059   def getCommentWidget(self):
00060     return None
00061
00062   def PreferencesActivated(self):
00063     prefGUI = self.__common.prefGUI()
00064     prefGUI.loadConfig()
00065     status = prefGUI.exec_loop()
00066     if status == prefGUI.Accepted:
00067       pass
00068     elif status == prefGUI.Rejected:
00069       # Use "factory" defaults; cfg file not updated
00070       pass
00071
00072   def SetupClicked(self):
00073     print "Button pressed: %s" % 'SETUP'
00074
00075   def TeardownClicked(self):
00076     print "Button pressed: %s" % 'TEARDOWN'
00077
00078   def StartRunClicked(self):
00079     print "Button pressed: %s" % 'START_RUN'
00080
00081   def StopRunClicked(self):
00082     print "Button pressed: %s" % 'STOP_RUN'
00083
00084   def PauseClicked(self):
00085     print "Button pressed: %s" % 'PAUSE'
00086
00087   def ResumeClicked(self):
00088     print "Button pressed: %s" % 'RESUME'
00089
00090   def StopClicked(self):
00091     print "Button pressed: %s" % 'STOP'
00092
00093   def load(self):
00094     applName = QFileDialog.getOpenFileName(self.__prefs["appdir"], "(*.py)",
00095                                            self, "Application file dialog",
00096                                            "Choose an application")
00097     if applName.isEmpty():
00098       return None
00099
00100     self.__prefs["appdir"] = applName
00101
00102     self.OpenAppl.setText(applName)
00103
00104     return applName
00105
00106   def loadSchema(self):
00107     rcSchemaSel = rcFileSelector(self._currentSchema, "(*.xml)", self, "Select a schema")
00108     schemaName = rcSchemaSel.getValue()
00109     # Allow the C++ object to be deleted
00110     rcSchemaSel.deleteLater()
00111     if schemaName is None: return
00112     self._currentSchema = schemaName
00113     self.__common.readSchema(schemaName)
00114
00115   def ExitButtonClicked(self):
00116     self.close()
00117
00118   def fileNew(self):
00119     print "RunControlTempImpl.fileNew(): Not implemented yet"
00120
00121   def fileOpen(self):
00122     print "RunControlTempImpl.fileOpen(): Not implemented yet"
00123
00124   def fileSave(self):
00125     print "RunControlTempImpl.fileSave(): Not implemented yet"
00126
00127   def fileSaveAs(self):
00128     print "RunControlTempImpl.fileSaveAs(): Not implemented yet"
00129
00130   def filePrint(self):
00131     print "RunControlTempImpl.filePrint(): Not implemented yet"
00132
00133   def fileExit(self):
00134     print "RunControlTempImpl.fileExit(): Not implemented yet"
00135
00136   def editUndo(self):
00137     print "RunControlTempImpl.editUndo(): Not implemented yet"
00138
00139   def editRedo(self):
00140     print "RunControlTempImpl.editRedo(): Not implemented yet"
00141
00142   def editCut(self):
00143     print "RunControlTempImpl.editCut(): Not implemented yet"
00144
00145   def editCopy(self):
00146     print "RunControlTempImpl.editCopy(): Not implemented yet"
00147
00148   def editPaste(self):
00149     print "RunControlTempImpl.editPaste(): Not implemented yet"
00150
00151   def editFind(self):
00152     print "RunControlTempImpl.editFind(): Not implemented yet"
00153
00154   def helpIndex(self):
00155     print "RunControlTempImpl.helpIndex(): Not implemented yet"
00156
00157   def helpContents(self):
00158     print "RunControlTempImpl.helpContents(): Not implemented yet"
00159
00160   def helpAbout(self):
00161     print "RunControlTempImpl.helpAbout(): Not implemented yet"
00162
00163
00164 class rcFileSelector(QFileDialog):
00165   def __init__(self, startwith, filter, parent, name):
00166     QFileDialog.__init__(self, parent, name, 0)
00167     self.setMode(QFileDialog.ExistingFile)
00168     self.setFilter(filter)
00169     self.setDir(os.path.dirname(startwith))
00170     self.setCaption(name)
00171     self.setViewMode( QFileDialog.Detail)
00172     self.setSelection(startwith)
00173
00174   def getValue(self):
00175     if self.exec_loop() == QDialog.Accepted:
00176       return str(self.selectedFile())
00177     else:
00178       return None
00179
00180 if __name__ == "__main__":
00181   a = QApplication(sys.argv)
00182   QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00183   w = RunControlGUI()
00184   a.setMainWidget(w)
00185   w.show()
00186   a.exec_loop()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: RunControlMain.py Source File

runcontrol

RunControlMain.py

00001 #!/usr/bin/env python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT main run control class"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2006/05/04 19:48:31 $").split(' ')[1]
00014 __version__  = "$Revision: 2.57 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import                              os
00021 import                              sys
00022 import                              atexit
00023 import                              threading
00024 import logging               as     log
00025 import types
00026 import time
00027 import gc
00028 import string
00029
00030 from   qt                    import *
00031 import sip
00032
00033 from   Queue                 import Queue
00034 from   RunControlFSM         import RunControlFSM
00035 from   RunControlMainGUIImpl import RunControlMainGUIImpl
00036 from   rcEndRunDlgImpl       import rcEndRunDlgImpl
00037
00038 # Modules here are imported to prevent them from being reloaded
00039 # See rcUtil for more info
00040
00041 import Pyana
00042 import LDF
00043
00044 try:
00045   import cfitsio
00046 except ImportError, e:
00047   pass
00048
00049 try:
00050   import Numeric
00051 except ImportError, e:
00052   pass
00053
00054 import rcUtil
00055 import rcReportGen
00056 import rcRunIdHelper
00057 import rcArchiver
00058
00059 from LATTE.tools.taskEngine   import TaskEngine
00060 from LATTE.tools.guiBridges   import GUIbridge, QtThreadBridge, PyThreadBridge
00061 from LATTE.client.gLog        import logException
00062 from LATTE.database.gVersions import Gversions, ROOT_DIR_ENVS
00063 from LATTE.database.gPlumber  import Plumber
00064
00065 class ConnectState:
00066   Disconnected = 0
00067   Waiting      = 1
00068   Connected    = 2
00069
00070 class RunControlMain(RunControlMainGUIImpl):
00071   """Class for providing a run control framework
00072   """
00073
00074   def __init__(self, common, parent = None, name = "RunControl", fl = 0):
00075     RunControlMainGUIImpl.__init__(self, common, parent, name, fl)
00076
00077     self.__common       = common
00078     self.__fsm          = None
00079     self.__actionEngine = None
00080     self.__app          = None
00081     self.__browser      = None
00082     self.__hwVersions   = None
00083     self.__queue        = None
00084     self.__engine       = None
00085     self.__guiThread    = threading.currentThread()
00086     self.__guiBridge    = GUIbridge(self.__guiThread)
00087
00088     # Set this object to be the client handler
00089     common.getCmdCli().handler(self)
00090     self.__connection_state = ConnectState.Disconnected
00091     self.ResetButton.setEnabled(False)
00092     self.StopButton.setEnabled(False)
00093     self.RunButton.setEnabled(False)
00094     self.PauseButton.setEnabled(False)
00095
00096     self.__actionEngine = TaskEngine("FSMactionEngine")
00097     self.__actionEngine.start()
00098
00099     self.commandSynch = TaskEngine("CommandSynch")
00100     self.commandSynch.start()
00101
00102     self.eventHandler = TaskEngine("EventHandler")
00103     self.eventHandler.start()
00104
00105     # Pick an operator
00106     operator = common.prefMan().preferences()["operatorobj"]
00107     self.cmbOperator.setCurrentText(operator.getName())
00108
00109     self.__endRunDlg = rcEndRunDlgImpl(parent=self)
00110
00111     # Clean up at exit
00112     self.inShutdown = False
00113     atexit.register(self.__shutdown)
00114
00115     # Preload modules specified in preferences
00116     preload = common.prefMan().preferences()["preload"]
00117     if preload.strip() != "":
00118       preloadList = map(string.strip, preload.split(','))
00119       for m in preloadList:
00120         exec 'import ' + m
00121
00122   def disconnected(self):
00123     self.__disconnected()
00124
00125   def timedout(self):
00126     self.__disconnected()
00127
00128   def __connection_notthere(self): # GUI thread
00129     if self.__connection_state == ConnectState.Connected:
00130       self.StopButton.setEnabled(False)
00131       self.RunButton.setEnabled(False)
00132       self.PauseButton.setEnabled(False)
00133       log.error("OCS server disconnected, trying to reconnect")
00134       # As per LTE-311, return the run to RESET state
00135       self.__resetStoppedApp()
00136       self.__connection_state = ConnectState.Waiting
00137       self.__common.disconnect()
00138       self.__connect()
00139
00140   def __connection_established(self): # GUI thread
00141     log.info("OCS server is now connected")
00142     if self.__app is not None:
00143       self.StopButton.setEnabled(True)
00144       self.RunButton.setEnabled(True)
00145       self.PauseButton.setEnabled(True)
00146     self.__connection_state = ConnectState.Connected
00147
00148   def __resetStoppedApp(self):
00149     if (self.__app.__class__.__name__ == 'userSuite' \
00150          and not self.__app.isRunning()
00151        ) or (
00152         self.__app.__class__.__name__ == 'userApplication' and \
00153         self.__fsm.current_state == 'STOPPED'
00154        ):
00155       log.warn("Returning the run to RESET state.")
00156       self.doReset()
00157
00158   def __connection_failed(self, msg): # GUI thread
00159     if self.__tries == 0:
00160       log.error(msg)
00161     self.__tries += 1
00162     return self.__connection_state
00163
00164   def connectClicked(self): # GUI thread
00165     if self.__connection_state is ConnectState.Disconnected:
00166       self.fileConnectAction.setMenuText("Disconnect")
00167       self.__connection_state = ConnectState.Waiting
00168       self.__tries = 0
00169       self.__connect()
00170     else:
00171       self.fileConnectAction.setMenuText("Connect")
00172       self.__connection_state = ConnectState.Disconnected
00173       self.__common.disconnect()
00174       self.StopButton.setEnabled(False)
00175       self.RunButton.setEnabled(False)
00176       self.PauseButton.setEnabled(False)
00177       log.info("OCS server is now disconnected")
00178       # As per LTE-311, return the run to RESET state
00179       self.__resetStoppedApp()
00180
00181   def __connect(self):
00182     connecthdlr = threading.Thread(None, self.__connection_handler, 'ConnectHandler',())
00183     connecthdlr.setDaemon(True)
00184     connecthdlr.start()
00185
00186   def __disconnected(self):
00187     self.execGUImethod(self.__connection_notthere)
00188
00189   def __connection_handler(self):
00190     while (True):
00191       try:
00192         force = (self.__common.options().oesforce != None)
00193         self.__common.connect(force)
00194         self.__plumb()
00195         self.execGUImethod(self.__connection_established)
00196         break
00197       except RuntimeError, msg:
00198         state = self.execGUImethod(self.__connection_failed, msg)
00199         if state == ConnectState.Disconnected: break
00200         time.sleep(3)
00201
00202   def __plumb(self):
00203     if self.__common.options().noplumbing is not None:
00204       return
00205     if self.__common.getLAT() is not None:
00206       if self.__common.options().fswmsglevel is not None:
00207         msglevel = int(self.__common.options().fswmsglevel)
00208       else:
00209         msglevel = 3
00210       verbose = (self.__common.options().ocsverbose != None)
00211       force = (self.__common.options().initforce != None)
00212       plumber = Plumber(self.__common.getLAT(), self.__common.getXBRD())
00213       plumber.initialize(msglevel, verbose, force)
00214
00215   def isConnected(self):
00216     """\brief Return the connection state.
00217
00218     Used by the WatchItem class in rcStatusMonitor.
00219
00220     \return Connection state
00221     """
00222     return self.__connection_state == ConnectState.Connected
00223
00224   def schemaChanged(self):
00225     if self.__connection_state is ConnectState.Connected:
00226       self.__plumb()
00227
00228   def applyPermissions(self, operator):
00229     adminOverride = operator.isAdministrator()
00230     if adminOverride:
00231       self.fileExitAction.setEnabled(1)
00232     else:
00233       self.fileExitAction.setEnabled(0)
00234     if 'allow_python_shell' in operator.getPermissions() or adminOverride:
00235       self.viewPythonShell.setEnabled(1)
00236     else:
00237       self.viewPythonShell.setEnabled(0)
00238     if 'set_particle_type' in operator.getPermissions() or adminOverride:
00239       self.comboParticleType.setEnabled(1)
00240     else:
00241       self.comboParticleType.setEnabled(0)
00242     if 'set_orientation' in operator.getPermissions() or adminOverride:
00243       self.comboOrientation.setEnabled(1)
00244     else:
00245       self.comboOrientation.setEnabled(0)
00246
00247     if 'edit_preferences' in operator.getPermissions() or adminOverride:
00248       self.editPreferencesAction.setEnabled(1)
00249     else:
00250       self.editPreferencesAction.setEnabled(0)
00251
00252     for (panelLabel, panel) in self.panels().items():
00253       if 'enable_' + panelLabel.lower() + '_panel' in operator.getPermissions() or adminOverride:
00254         self.setEnabledTabPage(panelLabel, 1)
00255       else:
00256         self.setEnabledTabPage(panelLabel, 0)
00257       if "applyPermissions" in dir(panel):
00258         panel.applyPermissions(operator)
00259
00260     if self.__common.getMSGLogger() is not None:
00261       if adminOverride:
00262         self.__common.getMSGLogger().setSecure(0)
00263       else:
00264         self.__common.getMSGLogger().setSecure(1)
00265       self.__common.getMSGLogger().show()
00266
00267     self.__common.prefGUI().applyPermissions(operator)
00268
00269
00270   def setEnabledTabPage(self, panelLabel, enable):
00271     """Find the tabPage belonging to panel identified by panelLabel
00272     """
00273     for i in range(self.RunControlTab.count()):
00274       tabPage = self.RunControlTab.page(i)
00275       if panelLabel == str(self.RunControlTab.tabLabel(tabPage)):
00276         tabPage.setEnabled(enable)
00277         break
00278
00279   def setOperator(self, operator):
00280     self.cmbOperator.setCurrentText(operator)
00281     self.__common.prefMan().setOperator(operator)
00282
00283   def setParticleType(self, particleType):
00284     self.__common.prefMan().setParticleType(particleType)
00285
00286   def setOrientation(self, orientation):
00287     self.__common.prefMan().setOrientation(orientation)
00288
00289   def getName(self):
00290     return "RunControlMain"
00291
00292   def __statusMsg(self, msg, tmo):
00293     self.execGUImethodNR(self.statusBar().message, msg, tmo)
00294
00295   def __shutdown(self):
00296     """\brief Clean up and shut down the various threads.
00297     """
00298     # This method expects to be executed from the GUI thread.
00299
00300     self.inShutdown = True
00301
00302     # Bring the system into the RESET state
00303     self.doReset()
00304
00305     # Use the following non-NR call to wait for the reset to finish
00306     self.execGUImethod(self.statusBar().message, "Exiting")
00307
00308     # Shut down the task engines
00309     self.__actionEngine.shutdown()
00310     self.eventHandler.shutdown()  # RiC: timeout not needed with above wait
00311     self.commandSynch.shutdown()
00312
00313     # After the FSM Action Engine has shut down we can delete the FSM
00314     if self.__fsm:
00315       del self.__fsm
00316       self.__fsm = None
00317
00318     # Disconnect from the command and event servers
00319     self.__common.disconnect()
00320
00321     # Stop the data distribution server
00322     dds = self.__common.getDDS()
00323     if dds is not None:
00324       dds.disconnect()
00325
00326     # Stop the GUI bridge
00327     #self.__qtBridge.terminate()
00328     self.__guiBridge.shutdown()
00329
00330
00331   def initApp(self):
00332     """\brief Method usually invoked by the GUI to load a new application
00333     """
00334     applName = self.OpenAppl.currentText()
00335     if str(applName) == "":  return     # Operator cancelled
00336     self.loadApp(str(applName))
00337
00338   def loadApp(self, applName):
00339     """\brief Method that can be invoked from code to load a new application
00340
00341     \param applName  Name of an application to load
00342     """
00343     if self.__fsm is not None:
00344       self.ResetClicked()
00345     if applName is None:
00346       self.__statusMsg('Loading aborted', 0)
00347       return
00348
00349     # Start the application in its own thread after the reset from above
00350     # (if any) completes.
00351     self.__actionEngine.spawn(self.__startApp, str(applName))
00352
00353     self.ResetButton.setEnabled(True)
00354     self.StopButton.setEnabled(True)
00355     self.RunButton.setEnabled(True)
00356     self.PauseButton.setEnabled(True)
00357
00358   def loadModule(self, module):
00359     """\brief Method that can be invoked from code to load a new module
00360
00361     \param module  Pointer to module to load
00362     """
00363     if self.__fsm is not None:
00364       self.ResetClicked()
00365     self.__actionEngine.spawn(self.__startModule, module)
00366
00367   def __initAppCommon(self, appType, app, appName, filename):
00368     msg = "%s %s loaded from %s" % (appType, app.getName(), filename)
00369     log.info(msg)
00370
00371     # Update the application history list box.
00372     self.execGUImethod(self.__updateAppListBox, appName)
00373     if self.__common.options().securedir is None and self.__common.options().norcoverride is None:
00374       self.execGUImethod(self.__updateRunConditions, 'NOT-DEFINED')
00375
00376     return msg
00377
00378   def __updateRunConditions(self, undef):
00379     prefMan = self.__common.prefMan()
00380     self.cmbOperator.setCurrentText(undef)
00381     prefMan.setOperator(undef)
00382     self.comboParticleType.setCurrentText(undef)
00383     prefMan.setParticleType(undef)
00384     self.comboOrientation.setCurrentText(undef)
00385     prefMan.setOrientation(undef)
00386     prefMan.setSite(undef)
00387     prefMan.setPhase(undef)
00388     prefMan.setInstrumentType(undef)
00389
00390   def __updateAppListBox(self, appName):
00391     if self.OpenAppl.listBox().findItem(appName) is None:
00392       self.OpenAppl.insertItem(appName)
00393
00394   def __startApp(self, appName):
00395     try:
00396       self.execGUImethod(self.statusMonitor().stopWatch)
00397       if self.__common.options().noreload is not None:
00398         dontReloadList = self.__common.getDBN()["_dontReload"]
00399       else:
00400         dontReloadList = []
00401
00402       prefs = self.__common.prefMan().preferences()
00403       if prefs['dontreload'].strip() != "":
00404         dontReloadPrefs = map(string.strip, prefs['dontreload'].split(','))
00405       else:
00406         dontReloadPrefs = []
00407       dontReloadList += dontReloadPrefs
00408
00409       (module, filename) = rcUtil.importModule(appName=appName,
00410                                                reload=not prefs["disablereload"],
00411                                                dontReloadList=dontReloadList,
00412                                                showUnloadedModules=prefs["showunloaded"] )
00413     except Exception, e:
00414       logException()
00415       if type(e) == types.ListType:
00416         self.__statusMsg(e[0], 0)
00417       else:
00418         self.__statusMsg(str(e), 0)
00419       return
00420     self.__clearPreviousApp()
00421     self.__setupApp(module, appName, filename)
00422
00423   def __startModule(self, module):
00424     self.__clearPreviousApp()
00425     appName = module.userModuleName
00426     filename = module.__file__
00427     self.__setupApp(module, filename, filename)
00428
00429   def __clearPreviousApp(self):
00430     del self.__app
00431     self.__app = None
00432     gc.collect()
00433     if len(gc.garbage) != 0:
00434       log.error("RunControlMain: Found garbage: %s" % gc.garbage)
00435
00436   def __setupApp(self, module, appName, filename):
00437     userid = self.__common.prefMan().userId()
00438     evtdebug = self.__common.options().evtdebug is not None
00439     if 'userApplication' in dir(module):
00440       self.__app = module.userApplication(self, userid, evtdebug)
00441       msg = self.__initAppCommon('Application', self.__app, appName, filename)
00442       self.__fsm = RunControlFSM(self.__app)
00443       self.execGUImethodNR(self.__updateGUI, self.__fsm.current_state, False)
00444       self.execGUImethodNR(self.handleComments, None, self.__fsm.current_state)
00445       self.execGUImethod(self.statusMonitor().startWatch)
00446     elif 'userSuite' in dir(module):
00447       # Set the FSM to None so that we don't check for current state
00448       # in the case of a suite run. Fixes LTE-343
00449       self.__fsm = None
00450       self.__app = module.userSuite(self, userid, evtdebug)
00451       msg = self.__initAppCommon('Suite', self.__app, appName, filename)
00452       if self.__app.rcSetupSuite() is None:
00453         msg = "Suite setup failed...Aborting suite %s" % appName
00454         log.error(msg)
00455       else:
00456         self.execGUImethodNR(self.State.setText, "SUITE SETUP")
00457     else:
00458       msg = '%s is not a recognized user script.  userApplication or userSuite class is missing.' % appName
00459       log.error(msg)
00460     self.__common.getDBN()['_app'] = self.__app
00461     self.__statusMsg(msg, 0)
00462
00463   def __updateGUI(self, state, enabled):
00464     """\brief Method for updating the GUI
00465     """
00466     # This method may complete asynchronously to the application's activities
00467     # since the application doesn't depend on the results.  Should this ever
00468     # change, be sure to change the execGUImethodNR() calls below to
00469     # execGUImethod() calls so that the fsmActionEngine waits for __updateGUI()
00470     # to complete before continuing.
00471     prefGUI = self.__common.prefGUI()
00472     self.State.setText(state)
00473     operator = self.__common.prefMan().preferences()["operatorobj"]
00474     if self.__common.options().securedir is not None and 'administrator' not in operator.getRoles():
00475       permissions = operator.getPermissions()
00476       self.cmbOperator.setEnabled(0)
00477       if 'set_particle_type' in permissions:
00478         self.comboParticleType.setEnabled(enabled)
00479       if 'set_orientation' in permissions:
00480         self.comboOrientation.setEnabled(enabled)
00481       if 'set_site_run_condition' in permissions:
00482         prefGUI.comboSite.setEnabled(enabled)
00483       if 'set_instrument_type_run_condition' in permissions:
00484         prefGUI.comboInstrumentType.setEnabled(enabled)
00485       if 'set_phase_run_condition' in permissions:
00486         prefGUI.comboPhase.setEnabled(enabled)
00487     else:
00488       self.cmbOperator.setEnabled(enabled)
00489       self.comboParticleType.setEnabled(enabled)
00490       self.comboOrientation.setEnabled(enabled)
00491       prefGUI.comboSite.setEnabled(enabled)
00492       prefGUI.comboInstrumentType.setEnabled(enabled)
00493       prefGUI.comboPhase.setEnabled(enabled)
00494
00495   def ResetClicked(self):
00496     RunControlMainGUIImpl.ResetClicked(self)
00497     if self.__app.__class__.__name__ == 'userSuite' and not self.__app.isRunning():
00498       if self.__app.rcSetupSuite() is None:
00499         log.error("Suite setup failed...Aborting suite %s" % self.__app.getName())
00500       else:
00501         self.execGUImethodNR(self.State.setText, "SUITE SETUP")
00502     else:
00503       self.waitCursor()
00504       self.__actionEngine.spawn(self.__reset)
00505       self.normalCursor()
00506
00507   def __reset(self):
00508     if self.__fsm is not None:
00509       curState = self.__fsm.current_state
00510       if curState == "STOPPED":
00511         self.execGUImethodNR(self.State.setText, "TEARING DOWN")
00512         self.__fsm.process('TEARDOWN')
00513         self.execGUImethodNR(self.handleComments, curState, self.__fsm.current_state)
00514
00515       elif curState == "RUNNING":
00516         self.execGUImethodNR(self.State.setText, "STOPPING RUN")
00517         status = self.__fsm.process('STOP_RUN')
00518         if status is None:
00519           self.execGUImethodNR(self.State.setText, "TEARING DOWN")
00520           self.__fsm.process('TEARDOWN')
00521         self.execGUImethodNR(self.handleComments, curState, self.__fsm.current_state)
00522
00523       elif curState == "PAUSED":
00524         self.execGUImethodNR(self.State.setText, "STOPPING RUN")
00525         self.execGUImethodNR(QToolTip.add, self.PauseButton, "Pause")
00526         self.execGUImethodNR(QToolTip.add, self.RunButton, "Run")
00527         status = self.__fsm.process('STOP')
00528         if status is None:
00529           self.execGUImethodNR(self.State.setText, "TEARING DOWN")
00530           self.__fsm.process('TEARDOWN')
00531         self.execGUImethodNR(self.handleComments, curState, self.__fsm.current_state)
00532
00533       self.execGUImethodNR(self.__updateGUI, self.__fsm.current_state, True)
00534
00535   def StopClicked(self):
00536     if self.__app.__class__.__name__ == 'userSuite':
00537       self.execGUImethodNR(self.State.setText, "STOPPING SUITE")
00538       self.__app.rcStopSuite()
00539       self.execGUImethodNR(self.__updateGUI, "SUITE STOPPED", True)
00540     else:
00541       RunControlMainGUIImpl.StopClicked(self)
00542
00543       self.waitCursor()
00544       self.__actionEngine.spawn(self.__stop)
00545       self.normalCursor()
00546
00547 # New code that spawns StopSuite -- not fully tested
00548 #  def StopClicked(self):
00549 #    if self.__app.__class__.__name__ == 'userSuite':
00550 #      self.__actionEngine.spawn(self.__stopSuite)
00551 #    else:
00552 #      RunControlMainGUIImpl.StopClicked(self)
00553 #
00554 #      self.waitCursor()
00555 #      self.__actionEngine.spawn(self.__stop)
00556 #      self.normalCursor()
00557
00558 #  def __stopSuite(self):
00559 #    self.execGUImethodNR(self.State.setText, "STOPPING SUITE")
00560 #    self.__app.rcStopSuite()
00561 #    self.execGUImethodNR(self.__updateGUI, "SUITE STOPPED", True)
00562
00563   def __stop(self):
00564     if self.__fsm is not None:
00565       curState = self.__fsm.current_state
00566       if curState == "PAUSED":
00567         self.execGUImethodNR(self.State.setText, "STOPPING RUN")
00568         self.execGUImethodNR(QToolTip.add, self.PauseButton, "Pause")
00569         self.execGUImethodNR(QToolTip.add, self.RunButton, "Run")
00570         self.__fsm.process('STOP')
00571         self.execGUImethodNR(self.handleComments, curState, self.__fsm.current_state)
00572
00573       elif curState == "RUNNING":
00574         self.execGUImethodNR(self.State.setText, "STOPPING RUN")
00575         self.__fsm.process('STOP_RUN')
00576         self.execGUImethodNR(self.handleComments, curState, self.__fsm.current_state)
00577
00578       elif curState == "RESET":
00579         self.execGUImethodNR(self.State.setText, "SETTING UP")
00580         self.__fsm.process('SETUP')
00581         self.execGUImethodNR(self.handleComments, curState, self.__fsm.current_state)
00582
00583       self.execGUImethodNR(self.__updateGUI, self.__fsm.current_state, True)
00584
00585   def RunClicked(self):
00586     if self.__app.__class__.__name__ == 'userSuite':
00587       if self.__app.isRunning() and not self.__app.isPaused():
00588         return
00589       curText = self.execGUImethod(self.State.text)
00590       if self.__app.isPaused():
00591         text = "RESUMING SUITE"
00592       else:
00593         text = "STARTING SUITE"
00594       self.execGUImethodNR(self.__updateGUI, text, False)
00595       if self.__app.rcStartSuite() is not None:
00596         text = curText
00597       else:
00598         text = "SUITE RUNNING"
00599       self.execGUImethodNR(self.__updateGUI, text, False)
00600     else:
00601       RunControlMainGUIImpl.RunClicked(self)
00602
00603       self.waitCursor()
00604       self.__actionEngine.spawn(self.__run)
00605       self.normalCursor()
00606
00607   def __run(self):
00608     if self.__fsm is not None:
00609       curState = self.__fsm.current_state
00610       if curState == "PAUSED":
00611         self.execGUImethodNR(self.State.setText, "RESUMING RUN")
00612         self.execGUImethodNR(QToolTip.add, self.PauseButton, "Pause")
00613         self.execGUImethodNR(QToolTip.add, self.RunButton, "Run")
00614         self.__fsm.process('RESUME')
00615
00616       elif curState == "STOPPED":
00617         self.execGUImethodNR(self.State.setText, "STARTING RUN")
00618         self.__fsm.process('START_RUN')
00619
00620       elif curState == "RESET":
00621         self.execGUImethodNR(self.State.setText, "SETTING UP")
00622         status = self.__fsm.process('SETUP')
00623         if status is None:
00624           self.execGUImethodNR(self.State.setText, "STARTING RUN")
00625           self.execGUImethodNR(self.State.setText, self.__fsm.current_state)
00626           self.__fsm.process('START_RUN')
00627       self.execGUImethodNR(self.handleComments, curState, self.__fsm.current_state)
00628
00629       self.execGUImethodNR(self.__updateGUI, self.__fsm.current_state, False)
00630
00631   def PauseClicked(self):
00632     if self.__app.__class__.__name__ == 'userSuite':
00633       text = self.execGUImethod(self.State.text)
00634       if self.__app.isPaused():
00635         return
00636       self.execGUImethodNR(self.State.setText, "PAUSING SUITE")
00637       if self.__app.rcPauseSuite() is None:
00638         self.execGUImethodNR(self.State.setText, "SUITE PAUSED")
00639       else:
00640         self.execGUImethodNR(self.State.setText, text)
00641     else:
00642       RunControlMainGUIImpl.PauseClicked(self)
00643
00644       self.waitCursor()
00645       self.__actionEngine.spawn(self.__pause)
00646       self.normalCursor()
00647
00648   def __pause(self):
00649     if self.__fsm is not None:
00650       curState = self.__fsm.current_state
00651       if curState == "RUNNING":
00652         self.execGUImethodNR(self.State.setText, "PAUSING RUN")
00653         self.execGUImethodNR(QToolTip.add, self.PauseButton, "Resume")
00654         self.execGUImethodNR(QToolTip.add, self.RunButton, "Resume")
00655         self.__fsm.process('PAUSE')
00656         self.execGUImethodNR(self.handleComments, curState, self.__fsm.current_state)
00657       elif curState == "PAUSED":
00658         self.execGUImethodNR(self.State.setText, "RESUMING UP")
00659         self.execGUImethodNR(QToolTip.add, self.PauseButton, "Pause")
00660         self.execGUImethodNR(QToolTip.add, self.RunButton, "Run")
00661         self.__fsm.process('RESUME')
00662         self.execGUImethodNR(self.handleComments, curState, self.__fsm.current_state)
00663
00664       self.execGUImethodNR(self.State.setText, self.__fsm.current_state)
00665
00666   def doReset(self):
00667     """Emit a Reset button click under program control.
00668     Can be done from a subthread."""
00669     if self.__app.__class__.__name__ == 'userSuite':
00670       if self.__app.isRunning():
00671         self.doSuiteReset()
00672     self.doEmit(self.ResetButton)
00673
00674   def doSuiteReset(self):
00675     """Notify rcSuite that there was an exception in the suite script
00676     This gives rcSuite a chance to do its own doReset on the running script.
00677     """
00678     app = self.__app
00679     while app.getApp().__class__.__name__ != 'userApplication':
00680       app = app.getApp()
00681     app.resetSuiteScript()
00682
00683   def doStop(self):
00684     """Emit a Stop button click under program control.
00685     Can be done from a subthread."""
00686     self.doEmit(self.StopButton)
00687
00688   def doStopRun(self):
00689     """Depricated version of doStop()."""
00690     self.doStop()
00691
00692   def doRun(self):
00693     """Emit a Run button click under program control.
00694     Can be done from a subthread."""
00695     self.doEmit(self.RunButton)
00696
00697   def doPause(self):
00698     """Emit a Pause button click under program control.
00699     Can be done from a subthread."""
00700     self.doEmit(self.PauseButton)
00701
00702   def doEmit(self, obj, signal = SIGNAL("clicked()"), args = ()):
00703     """Emit a signal, possibly from a subthread.
00704     By default the signal is 'clicked()' with no arguments."""
00705     if self.isGUIthread():
00706       obj.emit(signal, args)
00707     else:
00708       self.execGUImethodNR(obj.emit, signal, args)
00709
00710   def normalCursor(self):
00711     self.execGUImethodNR(self.setCursor, QCursor(QWidget.ArrowCursor))
00712
00713   def waitCursor(self):
00714     self.execGUImethodNR(self.setCursor, QCursor(QWidget.WaitCursor))
00715
00716   def handleEndRunDlg(self):
00717     prefs = self.__common.prefMan().preferences()
00718     secMan = self.getSecurityMan()
00719     loginId = prefs["operatorobj"].getLoginId()
00720     self.__endRunDlg.initialize(secMan, loginId)
00721     if self.__endRunDlg.exec_loop() == QDialog.Accepted:
00722       app = self.__app
00723       while app.__class__.__name__ != 'userApplication':
00724         app = app.getApp()
00725       curComplStatusStr = app.getCompletionStatusStr()
00726       (cv, cs) = self.__endRunDlg.getNewCompletionStatus(curComplStatusStr)
00727       if cv is not None:
00728         app.setCompletionStatus(cv)
00729         msg = ("Completion Status '%s' is overridden with status '%s' by operator %s" %
00730               (curComplStatusStr, cs, prefs["operator"]))
00731         log.info(msg)
00732         self.__endRunDlg.enterComment(msg, addToHistory=1)
00733     else:
00734       self.__endRunDlg.clearHistory()
00735
00736   def getEndRunComments(self):
00737     return self.__endRunDlg.comments.getWidget()
00738
00739   def handleComments(self, fromState, toState):
00740     cw = self.getCommentWidget()
00741     if toState == 'STOPPED' and fromState != 'RESET':
00742       if cw.isReadOnly():
00743         cw.setReadOnly(0)
00744         self.showComments()
00745         cw.enterComment("Comment entry enabled.")
00746       cw.enterComment("Note: Comments entered after this point will apply to the next run",0)
00747       cw.clearHistory()
00748     elif toState == 'RUNNING':
00749       if cw.isReadOnly():
00750         cw.setReadOnly(0)
00751         self.showComments()
00752         cw.enterComment("Comment entry enabled.")
00753       #if fromState != 'PAUSED' and fromState != 'RESET':
00754       #  cw.clearDisplay()
00755     elif toState == 'RESET':
00756       if fromState is None: # Application has been loaded
00757         cw.clearHistory()
00758         cw.setReadOnly(0)
00759         self.showComments()
00760         cw.enterComment("Comment entry enabled.")
00761       else:
00762         if not self.inShutdown:
00763           cw.clearHistory()
00764           cw.setReadOnly(1)
00765           self.hideComments()
00766           cw.enterComment("Comment entry disabled.")
00767
00768   def showHidePythonShell(self):
00769     if self.viewPythonShell.isOn():
00770       self.showPythonShell()
00771       if self.__fsm is None:
00772         self.getPythonShellWidget().redirectIO()
00773       elif self.__fsm.current_state != 'RUNNING':
00774           self.getPythonShellWidget().redirectIO()
00775     else:
00776       self.hidePythonShell()
00777       if self.__fsm is None:
00778         self.getPythonShellWidget().restoreIO()
00779       elif self.__fsm.current_state == 'RUNNING':
00780         self.getPythonShellWidget().restoreIO()
00781
00782   def verifySoftware(self):
00783     for env in ROOT_DIR_ENVS:
00784       if os.environ.has_key(env):
00785         self.waitCursor()
00786         qApp.processEvents()
00787         (release, failedFiles) = Gversions.verifyFileDigests(rootDirEnv=env)
00788         self.normalCursor()
00789         strFailed = ""
00790         i = 0
00791         for filename in failedFiles:
00792           i += 1
00793           if i % 5 == 0:
00794             strFailed += '\n'
00795           strFailed += filename + ' '
00796         subsys = env[:env.find("_ROOT")]
00797         if len(failedFiles) == 0:
00798           mb = QMessageBox.information( None, "Software Verification Results",
00799                                         "%s Release = %s\n\n" % (subsys, release) +
00800                                         "Verification completed successfully",
00801                                         QMessageBox.Ok + QMessageBox.Default,
00802                                         QMessageBox.Cancel)
00803         else:
00804           mb = QMessageBox.warning    ( None, "Software Verification Results",
00805                                         "%s release = %s\n\n" % (subsys, release) +
00806                                         "Verification found the following " +
00807                                         "inconsistent files:\n" + strFailed,
00808                                         QMessageBox.Ok + QMessageBox.Default,
00809                                         QMessageBox.Cancel)
00810         if mb == QMessageBox.Cancel:
00811           break
00812
00813   def elogWebsite(self):
00814     self.__common.elogWebsite()
00815
00816   def warnFreeSpace(self, warn_level):
00817     mess = "Low Disk Space Warning!\n" + \
00818            "The space available for data writing\n" + \
00819            "is below %u Megabytes.  Continue?" % (warn_level / (1024*1024))
00820     mb = QMessageBox.warning(None, '', mess,
00821                              QMessageBox.Yes | QMessageBox.Default,
00822                              QMessageBox.No  | QMessageBox.Escape,
00823                              QMessageBox.NoButton );
00824     return mb is not QMessageBox.No
00825
00826   def warnDirectoryExist(self, directory):
00827     mess = "Directory write error!\n" + \
00828            "The directory chosen for data writing:\n" + \
00829            "%s does not exist.  Continue?" % (directory)
00830     mb = QMessageBox.warning(None, '', mess,
00831                              QMessageBox.Yes | QMessageBox.Default,
00832                              QMessageBox.No  | QMessageBox.Escape,
00833                              QMessageBox.NoButton );
00834     return mb is not QMessageBox.No
00835
00836   def aboutRunControl(self):
00837     release = Gversions.getReleaseFromDigest()
00838     message = "RunControl System\n\nLATTE Release: %s" % release
00839     if sys.modules.has_key('sihippo'):
00840       message = message + "\n\nHippoDraw Release: %s" % sys.modules['sihippo'].__version__
00841     message = message + "\n\nQt Version: %s" % qVersion()
00842     message = message + "\n\nPyQt Version: %s" % PYQT_VERSION_STR
00843     if 'SIP_VERSION' in dir(sip):
00844       message = message + "\n\nSIP Version: %s" % hex(sip.SIP_VERSION)
00845     subsysReleases = {}
00846     for subsysRoot in ROOT_DIR_ENVS:
00847       if subsysRoot != 'LATTE_ROOT' and os.environ.has_key(subsysRoot):
00848         release = Gversions.getReleaseFromDigest(digestDataFile=None, rootDirEnv=subsysRoot)
00849         subsysReleases[subsysRoot[:subsysRoot.find("_ROOT")]] = release
00850     if len(subsysReleases) > 0:
00851       message = message + "\n\nSubsystem Releases:"
00852       subSysList = subsysReleases.keys()
00853       subSysList.sort()
00854       for subSys in subSysList:
00855         message = message + "\n  %s\t%s" % (subSys, subsysReleases[subSys])
00856     QMessageBox.about(self,'LATTE RunControl', message)
00857
00858
00859   def fileLogout(self):
00860    if not self.login():
00861      self.inShutdown = True
00862      self.close()
00863
00864   def closeEvent(self, e):
00865     if self.__common.options().securedir is not None and not self.inShutdown and \
00866        not self.__common.prefMan().preferences()["operatorobj"].isAdministrator():
00867       e.ignore()
00868     else:
00869       RunControlMainGUIImpl.closeEvent(self, e)
00870
00871   def login(self):
00872     # Write the modified preferences to the cfg file
00873     loginResult = -1
00874     while loginResult == -1:
00875       loginResult = self.__common.showLogin(self)
00876       if loginResult == -1:
00877         QMessageBox.critical(self, "Authentication Failed",
00878                                    "Invalid user id or password")
00879       elif loginResult == -2:
00880         QMessageBox.critical(self, "Authentication Failed",
00881                                    "Password database is not available")
00882       if loginResult == -1:
00883         continue
00884       elif loginResult != 1:
00885         return loginResult
00886       # Set the operator based on login
00887       operator = self.__common.prefMan().preferences()["users"].getUserByLoginId(self.__common.getLoginId())
00888       if operator is None:
00889         QMessageBox.critical(self, "Authentication Failed",
00890                                   "Can not find the user under preferences")
00891         log.error("User authentication failed, can not find the user %s under preferences"
00892                   % self.__common.getLoginId())
00893         loginResult = -1
00894         continue
00895       else:
00896         self.cmbOperator.setCurrentText(operator.getName())
00897         self.cmbOperator.setEnabled(0)
00898         self.__common.prefMan().setOperator(operator.getName())
00899         self.applyPermissions(operator)
00900         return 1
00901
00902   def getHardwareVersions(self, lat=None, xbrd=None):
00903     # Deprecated. Use the version in RunControlCommon to be
00904     # compatible with standalone scripts and suites.
00905     if self.__hwVersions is None:
00906       if lat is None: lat = self.__common.getLAT()
00907       if xbrd is None: xbrd = self.__common.getXBRD()
00908       self.__hwVersions = Gversions.getHardwareVersions(lat, xbrd)
00909     return self.__hwVersions
00910
00911   def clearHardwareVersionsCache(self):
00912     # Deprecated. Use the version in RunControlCommon to be
00913     # compatible with standalone scripts and suites.
00914     self.__hwVersions = None
00915
00916   def getFSM(self):
00917     return self.__fsm
00918
00919   def getApp(self):
00920     return self.__app
00921
00922   def isGUIthread(self):
00923     """Returns True if this method is being called from the GUI thread.
00924     """
00925     return threading.currentThread() == self.__guiThread
00926
00927   def customEvent(self, e):
00928     """This method overrides the QObject base class's.  There is generally
00929     no reason to call this method directly.  It is called by the Qt
00930     infrastructure whenever the custom event is posted, e.g. by the following
00931     three methods of this class: createGUI, execGUImethodNR and execGUImethod.
00932     """
00933     self.__guiBridge.handleCustomEvent(e)
00934
00935   def createGUI(self, obj, *args, **kwargs):
00936     """Method used for instantiating a GUI from a non-GUI subthread"""
00937     return self.__guiBridge.createGUI(self, obj, *args, **kwargs)
00938
00939   def execGUImethodNR(self, func, *args, **kwargs):
00940     """Method used for executing a GUI function from a non-GUI thread.
00941     Use this method when no (useful) response is expected or
00942     when waiting for one could cause a deadlock.  Any response from the
00943     function is lost."""
00944     if self.inShutdown:  return # Don't try to update the GUI during shutdown
00945
00946     return self.__guiBridge.execGUImethodNR(self, func, *args, **kwargs)
00947
00948   def execGUImethod(self, func, *args, **kwargs):
00949     """Method used for executing a GUI function from a non-GUI thread.
00950     Use this method when a response is expected from the function and
00951     when it is appropriate to wait for it (no deadlock arises)"""
00952     if self.inShutdown:  return # Don't try to update the GUI during shutdown
00953
00954     return self.__guiBridge.execGUImethod(self, func, *args, **kwargs)
00955
00956   def getSecurityMan(self):
00957     return self.__common.getSecurityMan()
00958
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: RunControlMainGUIImpl.py Source File

runcontrol

RunControlMainGUIImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT GUI for Online Run Control and Systems Main Window"
00012 __author__   = """A. Kavelaars <AliciaK@SLAC.Stanford.edu>
00013                                SLAC - GLAST LAT I&T/Online"""
00014 __date__     = ("$Date: 2005/05/11 02:14:59 $").split(' ')[1]
00015 __version__  = "$Revision: 2.19 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021
00022 import sys
00023 import logging            as log
00024 from qt                   import *
00025
00026 from RunControlMainGUI    import RunControlMainGUI
00027 from rcStatusMonitor      import *
00028 from rcCommentPanel       import *
00029 from rcPythonShell        import *
00030 from rcParamVerifier      import rcParamVerifier
00031
00032 import LATTE.client.gLog as gLog
00033
00034 class RunControlMainGUIImpl(RunControlMainGUI):
00035
00036   class ListBoxToolTip(QToolTip):
00037     def __init__(self, listbox):
00038       QToolTip.__init__(self, listbox.viewport())
00039       self.__listbox = listbox
00040
00041     def maybeTip(self, pos):
00042       item = self.__listbox.itemAt(pos)
00043       tipString = item.text()
00044       cr = self.__listbox.itemRect(item)
00045       cr.moveTopLeft(self.__listbox.contentsToViewport(cr.topLeft()))
00046       QToolTip(self).tip(cr, tipString)
00047
00048   class DockableTab(QDockWindow):
00049     def __init__(self, parent, name, panel, tabPage, flags = 0):
00050       QDockWindow.__init__(self, parent, name, flags)
00051       self.__parent = parent
00052       self.__panel = panel
00053       self.__tabPage = tabPage
00054       self.__name = name
00055       self.setCaption(name)
00056       self.connect(self,SIGNAL("visibilityChanged(bool)"), self.visibilityChanged)
00057
00058     def visibilityChanged(self, visible):
00059       if not visible:
00060         self.__parent.showPage(self.__tabPage)
00061         self.__panel.reparent(self.__tabPage, 0, QPoint(0,0), 1)
00062         self.__tabPage.layout().addWidget(self.__panel,0,1)
00063         self.disconnect(self,SIGNAL("visibilityChanged(bool)"), self.visibilityChanged)
00064
00065   def __init__(self, common, parent = None, name = None, fl = 0):
00066     RunControlMainGUI.__init__(self, parent, name, fl)
00067
00068     self.connect(self.AppOpenButton,SIGNAL("clicked()"),self.loadScript)
00069     self.connect(self.OpenAppl,SIGNAL("activated(const QString &)"),self.initApp)
00070     self.OpenApplTip = RunControlMainGUIImpl.ListBoxToolTip(self.OpenAppl.listBox())
00071
00072     self.connect(self.ResetButton,SIGNAL("clicked()"),self.ResetClicked)
00073     self.connect(self.StopButton,SIGNAL("clicked()"),self.StopClicked)
00074     self.connect(self.RunButton,SIGNAL("clicked()"),self.RunClicked)
00075     self.connect(self.PauseButton,SIGNAL("clicked()"),self.PauseClicked)
00076
00077     self.connect(self.fileOpen_ApplicationAction,SIGNAL("activated()"),self.loadScript)
00078     self.connect(self.fileSelect_SchemaAction,SIGNAL("activated()"),self.loadSchema)
00079     self.connect(self.fileConnectAction,SIGNAL("activated()"),self.connectClicked)
00080     self.connect(self.fileExitAction,SIGNAL("activated()"),self.fileExit)
00081     self.connect(self.fileLogoutAction,SIGNAL("activated()"),self.fileLogout)
00082     self.connect(self.controlResetAction,SIGNAL("activated()"),self.ResetClicked)
00083     self.connect(self.controlStopAction,SIGNAL("activated()"),self.StopClicked)
00084     self.connect(self.controlRunAction,SIGNAL("activated()"),self.RunClicked)
00085     self.connect(self.controlPauseAction,SIGNAL("activated()"),self.PauseClicked)
00086     self.connect(self.editPreferencesAction,SIGNAL("activated()"),self.PreferencesActivated)
00087
00088     self.connect(self.helpVerifyAction,SIGNAL("activated()"),self.verifySoftware)
00089     self.connect(self.helpELogAction,SIGNAL("activated()"),self.elogWebsite)
00090     self.connect(self.helpAboutAction,SIGNAL("activated()"),self.aboutRunControl)
00091     self.connect(self.viewStatusPanel,SIGNAL("activated()"),self.showHideStatusPanel)
00092     self.connect(self.viewComments,SIGNAL("activated()"),self.showHideComments)
00093     #self.connect(self.viewRunCond,SIGNAL("activated()"),self.showHideRunCond)
00094     self.connect(self.viewPythonShell,SIGNAL("activated()"),self.showHidePythonShell)
00095     self.connect(self.cmbOperator,SIGNAL("activated(const QString&)"),self.setOperator)
00096     self.connect(self.comboParticleType, SIGNAL("activated(const QString&)"), self.setParticleType)
00097     self.connect(self.comboOrientation, SIGNAL("activated(const QString&)"), self.setOrientation)
00098     self.connect(self.RunControlTab, SIGNAL("currentChanged(QWidget*)"), self.activateTab)
00099
00100
00101     self.__dwStatusPanel = QDockWindow()
00102     self.__dwStatusPanel.setResizeEnabled(1)
00103     self.__dwStatusPanel.setCloseMode(QDockWindow.Always)
00104     self.__statusPanel = rcStatusPanel(self.__dwStatusPanel)
00105     self.__dwStatusPanel.setWidget(self.__statusPanel)
00106     self.__dwStatusPanel.setCaption('Status Panel')
00107     self.statusView = self.__statusPanel.statusView
00108     self.statusView.setSorting(-1)
00109     self.statusView.setColumnWidth(1, 200)
00110     self.setDockEnabled(self.__dwStatusPanel, Qt.DockTop, 0)
00111     self.setDockEnabled(self.__dwStatusPanel, Qt.DockBottom, 0)
00112     self.setDockEnabled(self.__dwStatusPanel, Qt.DockLeft, 0)
00113     self.addDockWindow(self.__dwStatusPanel, Qt.DockRight)
00114     self.__dwStatusPanel.setFixedExtentWidth(321)
00115     #self.__dwStatusPanel.setFixedExtentHeight(250)
00116     self.connect(self.__dwStatusPanel,SIGNAL("visibilityChanged(bool)"),self.statusPanelVisChanged)
00117
00118     self.__dwComments = QDockWindow()
00119     self.__dwComments.setResizeEnabled(1)
00120     self.__dwComments.setCloseMode(QDockWindow.Always)
00121     self.__comments = rcCommentPanel(self.__dwComments)
00122     self.__dwComments.setWidget(self.__comments)
00123     self.__dwComments.setCaption('Comments')
00124     self.__teComments = self.__comments.getWidget()
00125     self.setDockEnabled(self.__dwComments, Qt.DockTop, 0)
00126     self.setDockEnabled(self.__dwComments, Qt.DockBottom, 1)
00127     self.setDockEnabled(self.__dwComments, Qt.DockLeft, 0)
00128     self.addDockWindow(self.__dwComments, Qt.DockBottom)
00129     self.__dwComments.setFixedExtentWidth(0)
00130     self.__dwComments.setFixedExtentHeight(50)
00131     self.connect(self.__dwComments,SIGNAL("visibilityChanged(bool)"),self.viewComments, SLOT("setOn(bool)"))
00132     self.__dwComments.hide()
00133
00134     #self.__dwRunCond = QDockWindow()
00135     #self.__dwRunCond.setResizeEnabled(1)
00136     #self.__dwRunCond.setVerticallyStretchable(0)
00137     #self.__dwRunCond.setCloseMode(QDockWindow.Always)
00138     #self.__runCond = rcRunConditions(self.__dwRunCond)
00139     #self.__dwRunCond.setWidget(self.__runCond)
00140     #self.__dwRunCond.setCaption('Run Conditions')
00141     #self.setDockEnabled(self.__dwRunCond, Qt.DockTop, 0)
00142     #self.setDockEnabled(self.__dwRunCond, Qt.DockBottom, 1)
00143     #self.setDockEnabled(self.__dwRunCond, Qt.DockLeft, 0)
00144     #self.setDockEnabled(self.__dwRunCond, Qt.DockRight, 1)
00145     #self.addDockWindow(self.__dwRunCond, Qt.DockRight)
00146     #self.__dwRunCond.setFixedExtentWidth(0)
00147     #self.__dwRunCond.setFixedExtentHeight(0)
00148     #self.connect(self.__dwRunCond,SIGNAL("visibilityChanged(bool)"),self.viewRunCond, SLOT("setOn(bool)"))
00149     #self.connect(self.__runCond.comboParticleType, SIGNAL("activated(const QString&)"), self.setParticleType)
00150     #self.connect(self.__runCond.comboInstrumentType, SIGNAL("activated(const QString&)"), self.setInstrumentType)
00151     #self.connect(self.__runCond.comboOrientation, SIGNAL("activated(const QString&)"), self.setOrientation)
00152     #self.connect(self.__runCond.comboPhase, SIGNAL("activated(const QString&)"), self.setPhase)
00153
00154     self.__dwPythonShell = QDockWindow()
00155     self.__dwPythonShell.setResizeEnabled(1)
00156     self.__dwPythonShell.setVerticallyStretchable(0)
00157     self.__dwPythonShell.setCloseMode(QDockWindow.Always)
00158     self.__pythonShell = rcPythonShell(self.__dwPythonShell)
00159     self.__dwPythonShell.setWidget(self.__pythonShell)
00160     self.__dwPythonShell.setCaption('Python Shell')
00161     self.__tePythonShell = self.__pythonShell.getWidget()
00162     self.setDockEnabled(self.__dwPythonShell, Qt.DockTop, 0)
00163     self.setDockEnabled(self.__dwPythonShell, Qt.DockBottom, 1)
00164     self.setDockEnabled(self.__dwPythonShell, Qt.DockLeft, 0)
00165     self.setDockEnabled(self.__dwPythonShell, Qt.DockRight, 1)
00166     self.addDockWindow(self.__dwPythonShell, Qt.DockRight)
00167     self.__dwPythonShell.undock()
00168     #self.__dwPythonShell.setFixedExtentWidth(0)
00169     self.__dwPythonShell.setFixedExtentHeight(50)
00170     self.connect(self.__dwPythonShell,SIGNAL("visibilityChanged(bool)"),self.viewPythonShell, SLOT("setOn(bool)"))
00171     self.hidePythonShell()
00172
00173     self.__common = common
00174     self.__prefs = common.prefMan().preferences()
00175
00176     if self.__prefs.has_key('particle type'):
00177       for (item, val) in self.__prefs['particle type'].items():
00178         self.comboParticleType.insertItem(item)
00179       if self.common().options().securedir is None:
00180         self.comboParticleType.insertItem('NOT-DEFINED')
00181       if self.__prefs.has_key('lastparticletype'):
00182         self.comboParticleType.setCurrentText(self.__prefs['lastparticletype'])
00183       else:
00184         self.__prefs["lastparticletype"]= str(self.comboParticleType.currentText())
00185
00186     #if self.__prefs.has_key('instrument type'):
00187     #  list = self.__prefs['instrument type'].keys()
00188     #  list.sort()
00189     #  for item in list:
00190     #    self.__runCond.comboInstrumentType.insertItem(item)
00191     #  self.__prefs["sel_instrument_type"] = str(self.__runCond.comboInstrumentType.currentText())
00192
00193     if self.__prefs.has_key('orientation'):
00194       keyList = self.__prefs['orientation'].keys()
00195       keyList.sort()
00196       for item in keyList:
00197         self.comboOrientation.insertItem(item)
00198       if self.common().options().securedir is None:
00199         self.comboOrientation.insertItem('NOT-DEFINED')
00200       if self.__prefs.has_key('lastorientation'):
00201         self.comboOrientation.setCurrentText(self.__prefs['lastorientation'])
00202       else:
00203         self.__prefs["lastorientation"] = str(self.comboOrientation.currentText())
00204
00205     #if self.__prefs.has_key('phase'):
00206     #  list = self.__prefs['phase'].keys()
00207     #  list.sort()
00208     #  for item in list:
00209     #    self.__runCond.comboPhase.insertItem(item)
00210     #  self.__prefs["sel_phase"] = str(self.__runCond.comboPhase.currentText())
00211
00212
00213     self.__currentAppDir = self.__prefs['appdir']
00214     self.__currentApp    = ""
00215     self.__currentSchemaDir = self.__prefs['reposdir']
00216     self.__currentSchema = ""
00217     self.__statMon = rcStatusMonitor(1000, self)
00218     self.__statMon.addWatchItem('Operator', self.getOperator)
00219     self.__statMon.addWatchItem('Operator Id', self.__prefs, 'userid')
00220     #self.__statMon.addWatchItem('FITS Enabled', self.__prefs, 'fitsnbl', alarmExpr='==0')
00221     #self.__statMon.addWatchItem('FITS Compressed', self.__prefs, 'fitscompress')
00222     self.__statMon.addWatchItem('Data Dir', self.__prefs, 'datadir')
00223     self.__statMon.addWatchItem('Log Dir', self.__prefs, 'logdir')
00224     self.__statMon.addWatchItem('App Dir', self.__prefs, 'appdir')
00225     self.__statMon.addWatchItem('Repos Dir', self.__prefs, 'reposdir')
00226     self.__statMon.addWatchItem('Report Dir', self.__prefs, 'reportdir')
00227     #self.__statMon.addWatchItem('FITS Dir', self.__prefs, 'fitsdir')
00228     self.__statMon.addWatchItem('Export Dir', self.__prefs, 'exportdir')
00229     self.__statMon.addWatchItem('Snapshot Dir', self.__prefs, 'snapshotdir')
00230     self.__statMon.addWatchItem('Message Log Enabled', self.__prefs, 'lognbl')
00231     self.__statMon.addWatchItem('Message Log Level', self.__prefs, 'loglevel')
00232     self.__statMon.addWatchItem('Message Log File', self.__prefs, 'logfilename')
00233     self.__statMon.addWatchItem('Archive On', self.__prefs, 'datasave',alarmExpr='==0')
00234     self.__statMon.addWatchItem('Export On', self.__prefs, 'dataexport',alarmExpr='==0')
00235     self.__statMon.addWatchItem('Snapshots On', self.__prefs, 'snapnbl', alarmExpr='==0')
00236     self.__statMon.addWatchItem('Schema Config File', self.getSchemaConfigFile)
00237
00238     self.__paramVerifier = rcParamVerifier(self.common(), self)
00239
00240     self.refreshUsers()
00241
00242     self.__panels = {}
00243
00244     self.RunControlTab.mouseDoubleClickEvent = self.mouseDblClick
00245
00246     for i in range(self.RunControlTab.count()):
00247       tabPage = self.RunControlTab.page(i)
00248       label = str(self.RunControlTab.tabLabel(tabPage))
00249       if   label == 'Global':
00250         try:
00251           import GlobalPanelImpl
00252         except:
00253           gLog.logException()
00254         else:
00255           GlobalPanelLayout = QGridLayout(tabPage,1,1,0,6,"GlobalPanelLayout")
00256           panel = GlobalPanelImpl.GlobalPanelImpl(self, self.common(), tabPage)
00257           self.__panels[label] = panel
00258           GlobalPanelLayout.addWidget(panel,0,1)
00259       elif label == 'Power':
00260         try:
00261           import PowerPanelImpl
00262         except:
00263           gLog.logException()
00264         else:
00265           PowerPanelLayout = QGridLayout(tabPage,1,1,0,6,"PowerPanelLayout")
00266           panel = PowerPanelImpl.PowerPanelImpl(self, self.common(), tabPage)
00267           self.__panels[label] = panel
00268           PowerPanelLayout.addWidget(panel,0,1)
00269       elif label == 'ACD':
00270         try:
00271           import AcdPanelImpl
00272         except ImportError:
00273           pass
00274         except:
00275           gLog.logException()
00276           log.warning("*** Unable to load ACD sub-system panel...bypassing ***")
00277         else:
00278           AcdPanelLayout = QGridLayout(tabPage,1,1,0,6,"AcdPanelLayout")
00279           panel = AcdPanelImpl.AcdPanelImpl(self, self.common(), tabPage)
00280           self.__panels[label] = panel
00281           AcdPanelLayout.addWidget(panel,0,1)
00282       elif label == 'CAL':
00283         try:
00284           import CalPanelImpl
00285         except ImportError:
00286           pass
00287         except:
00288           gLog.logException()
00289           log.warning("*** Unable to load CAL sub-system panel...bypassing ***")
00290         else:
00291           CalPanelLayout = QGridLayout(tabPage,1,1,0,6,"CalPanelLayout")
00292           panel = CalPanelImpl.CalPanelImpl(self, self.common(), tabPage)
00293           self.__panels[label] = panel
00294           CalPanelLayout.addWidget(panel,0,1)
00295       elif label == 'TKR':
00296         try:
00297           import TkrPanelImpl
00298         except ImportError:
00299           pass
00300         except:
00301           gLog.logException()
00302           log.warning("*** Unable to load TKR sub-system panel...bypassing ***")
00303         else:
00304           TkrPanelLayout = QGridLayout(tabPage,1,1,0,6,"TkrPanelLayout")
00305           panel = TkrPanelImpl.TkrPanelImpl(self, self.common(), tabPage)
00306           self.__panels[label] = panel
00307           TkrPanelLayout.addWidget(panel,0,1)
00308
00309   def refreshUsers(self, operator=None):
00310     self.cmbOperator.clear()
00311     userList = self.__prefs['users'].getIdNameDict().values()
00312     userList.sort()
00313     for userName in userList:
00314       self.cmbOperator.insertItem(userName)
00315     if self.common().options().securedir is None:
00316       self.cmbOperator.insertItem('NOT-DEFINED')
00317
00318     if operator is not None:
00319       self.cmbOperator.setCurrentText(operator.getName())
00320
00321   def mouseDblClick(self, event):
00322     tabPage = self.RunControlTab.currentPage()
00323     label = str(self.RunControlTab.tabLabel(tabPage))
00324     if label in self.__panels:
00325       panel = self.__panels[label]
00326       dwPanel = self.DockableTab(self.RunControlTab, label, panel, tabPage)
00327       dwPanel.setResizeEnabled(1)
00328       dwPanel.setVerticallyStretchable(0)
00329       dwPanel.setCloseMode(QDockWindow.Always)
00330       panel.reparent(dwPanel, 0, QPoint(0, 0), 1)
00331       dwPanel.setWidget(panel)
00332       dwPanel.undock()
00333       dwPanel.show()
00334
00335   def activateTab(self, tabPage):
00336     label = str(self.RunControlTab.tabLabel(tabPage))
00337     if label in self.__panels:
00338       panel = self.__panels[label]
00339       if "activate" in dir(panel):
00340         panel.activate()
00341
00342   def panels(self):
00343     return self.__panels
00344
00345   def common(self):
00346     return self.__common
00347
00348   def preferences(self):
00349     return self.__prefs
00350
00351   def statusMonitor(self):
00352     return self.__statMon
00353
00354   def parameterVerifier(self):
00355     return self.__paramVerifier
00356
00357   def getSchemaConfigFile(self):
00358     dbn = self.common().getDBN()
00359     if dbn.has_key('_LATSchemaFile'):
00360       return dbn['_LATSchemaFile']
00361
00362   def getOperator(self):
00363     return self.__prefs['operator']
00364
00365   def getCommentWidget(self):
00366     return self.__comments.getWidget()
00367
00368   def getPythonShellWidget(self):
00369     return self.__pythonShell.getWidget()
00370
00371   def statusPanelVisChanged(self, visible):
00372     self.viewStatusPanel.setOn(visible)
00373     if visible:
00374       self.__statMon.startWatch()
00375     else:
00376       self.__statMon.stopWatch()
00377
00378   def showHideStatusPanel(self):
00379     if self.viewStatusPanel.isOn():
00380       self.__dwStatusPanel.show()
00381     else:
00382       self.__dwStatusPanel.hide()
00383
00384   def showHideComments(self):
00385     if self.viewComments.isOn():
00386       self.__dwComments.show()
00387     else:
00388       self.__dwComments.hide()
00389
00390   def showComments(self):
00391     self.__dwComments.show()
00392
00393   def hideComments(self):
00394     self.__dwComments.hide()
00395
00396   #def showHideRunCond(self):
00397   #  if self.viewRunCond.isOn():
00398   #    self.__dwRunCond.show()
00399   #  else:
00400   #    self.__dwRunCond.hide()
00401
00402   def showHidePythonShell(self):
00403     pass
00404
00405   def showPythonShell(self):
00406     self.__dwPythonShell.show()
00407     self.__tePythonShell.setFocus()
00408
00409   def hidePythonShell(self):
00410     self.__dwPythonShell.hide()
00411
00412   def isPythonShellHidden(self):
00413     return not self.viewPythonShell.isOn()
00414
00415   def PreferencesActivated(self):
00416     prefGUI = self.__common.prefGUI()
00417     prefGUI.loadConfig()
00418     status = prefGUI.exec_loop()
00419     if status == prefGUI.Accepted:
00420       prefs = self.__common.prefMan().preferences()
00421       self.__common.EBFdistribution()
00422       self.__common.startLogger(startup=False)
00423       operator = prefs["operatorobj"]
00424       self.refreshUsers(operator)
00425       if self.__currentAppDir != prefs['appdir']:
00426         self.__currentAppDir = prefs['appdir']
00427         self.__currentApp = ""
00428       if self.__currentSchemaDir != prefs['reposdir']:
00429         self.__currentSchemaDir = prefs['reposdir']
00430         self.__currentSchema = ""
00431
00432   def ResetClicked(self):
00433     pass
00434
00435   def StopClicked(self):
00436     pass
00437
00438   def RunClicked(self):
00439     pass
00440
00441   def PauseClicked(self):
00442     pass
00443
00444   def loadScript(self):
00445     currentApp = os.path.join(self.__currentAppDir, self.__currentApp)
00446     rcAppSel = rcFileSelector(currentApp, "(*.py)", self, "Select an application")
00447     applName = rcAppSel.getValue()
00448     # Allow the C++ object to be deleted
00449     rcAppSel.deleteLater()
00450     if applName is None: return
00451     self.__currentAppDir, self.__currentApp = os.path.split(applName)
00452     self.OpenAppl.clearEdit()
00453     self.OpenAppl.setCurrentText(applName)
00454     self.initApp()
00455
00456   def loadSchema(self):
00457     currentSchema = os.path.join(self.__currentSchemaDir, self.__currentSchema)
00458     rcSchemaSel = rcFileSelector(currentSchema, "(*.xml)", self, "Select a schema")
00459     schemaName = rcSchemaSel.getValue()
00460     # Allow the C++ object to be deleted
00461     rcSchemaSel.deleteLater()
00462     if schemaName is None: return
00463     self.__currentSchemaDir, self.__currentSchema = os.path.split(schemaName)
00464     self.__common.readSchema(schemaName)
00465     if self.getApp() is not None:
00466       self.getApp().lat  = self.__common.getLAT()
00467       self.getApp().xbrd = self.__common.getXBRD()
00468     self.ResetClicked()
00469     self.schemaChanged()
00470     self.__panels['Power'].activate()
00471     self.__panels['Global'].checkFabricEnable(self.__common.getLAT().existsGEM())
00472
00473   def schemaChanged(self):
00474     pass
00475
00476   def getApp(self):
00477     # Overridden in RunControlMain
00478     return None
00479
00480   def fileExit(self):
00481     # Write the modified preferences to the cfg file
00482     self.close()
00483
00484   def connectClicked(self):
00485     log.warning("RunControlMainGUIImpl.connectClicked(): Not implemented yet")
00486
00487   def fileLogout(self):
00488     log.warning("RunControlMainGUIImpl.fileLogout(): Not implemented yet")
00489
00490   def closeEvent(self, e):
00491     e.accept()
00492
00493   def filePrint(self):
00494     log.warning("RunControlMainGUIImpl.filePrint(): Not implemented yet")
00495
00496   def setOperator(self, operator):
00497     pass
00498
00499   def setParticleType(self, particleType):
00500     pass
00501
00502   def setInstrumentType(self, instrumentType):
00503     pass
00504
00505   def setOrientation(self, orientation):
00506     pass
00507
00508   def setPhase(self, phase):
00509     pass
00510
00511   def verifySoftware(self):
00512     pass
00513
00514   def elogWebsite(self):
00515     pass
00516
00517   def aboutRunControl(self):
00518     pass
00519
00520 class rcFileSelector(QFileDialog):
00521   def __init__(self, startwith, filter, parent, name):
00522     QFileDialog.__init__(self, parent, name, 0)
00523     self.setMode(QFileDialog.ExistingFile)
00524     self.setFilter(filter)
00525     self.setDir(os.path.dirname(startwith))
00526     self.setCaption(name)
00527     self.setViewMode( QFileDialog.Detail)
00528     self.setSelection(startwith)
00529
00530   def getValue(self):
00531     if self.exec_loop() == QDialog.Accepted:
00532       return str(self.selectedFile())
00533     else:
00534       return None
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: saferef.py Source File

dispatch

saferef.py

00001 """Refactored "safe reference" from dispatcher.py"""
00002
00003 __version__  = "$Revision: 2.1 $"
00004
00005 import weakref, traceback
00006
00007 def safeRef(target, onDelete = None):
00008     """Return a *safe* weak reference to a callable target
00009
00010     target -- the object to be weakly referenced, if it's a
00011         bound method reference, will create a BoundMethodWeakref,
00012         otherwise creates a simple weakref.
00013     onDelete -- if provided, will have a hard reference stored
00014         to the callable to be called after the safe reference
00015         goes out of scope with the reference object, (either a
00016         weakref or a BoundMethodWeakref) as argument.
00017     """
00018     if hasattr(target, 'im_self'):
00019         if target.im_self is not None:
00020             # Turn a bound method into a BoundMethodWeakref instance.
00021             # Keep track of these instances for lookup by disconnect().
00022             assert hasattr(target, 'im_func'), """safeRef target %r has im_self, but no im_func, don't know how to create reference"""%( target,)
00023             reference = BoundMethodWeakref(
00024                 target=target,
00025                 onDelete=onDelete
00026             )
00027             return reference
00028     if callable(onDelete):
00029         return weakref.ref(target, onDelete)
00030     else:
00031         return weakref.ref( target )
00032
00033 class BoundMethodWeakref(object):
00034     """'Safe' and reusable weak references to instance methods
00035
00036     BoundMethodWeakref objects provide a mechanism for
00037     referencing a bound method without requiring that the
00038     method object itself (which is normally a transient
00039     object) is kept alive.  Instead, the BoundMethodWeakref
00040     object keeps weak references to both the object and the
00041     function which together define the instance method.
00042
00043     Attributes:
00044         key -- the identity key for the reference, calculated
00045             by the class's calculateKey method applied to the
00046             target instance method
00047         deletionMethods -- sequence of callable objects taking
00048             single argument, a reference to this object which
00049             will be called when *either* the target object or
00050             target function is garbage collected (i.e. when
00051             this object becomes invalid).  These are specified
00052             as the onDelete parameters of safeRef calls.
00053         weakSelf -- weak reference to the target object
00054         weakFunc -- weak reference to the target function
00055
00056     Class Attributes:
00057         _allInstances -- class attribute pointing to all live
00058             BoundMethodWeakref objects indexed by the class's
00059             calculateKey(target) method applied to the target
00060             objects.  This weak value dictionary is used to
00061             short-circuit creation so that multiple references
00062             to the same (object, function) pair produce the
00063             same BoundMethodWeakref instance.
00064
00065     """
00066     _allInstances = weakref.WeakValueDictionary()
00067     def __new__( cls, target, onDelete=None, *arguments,**named ):
00068         """Create new instance or return current instance
00069
00070         Basically this method of construction allows us to
00071         short-circuit creation of references to already-
00072         referenced instance methods.  The key corresponding
00073         to the target is calculated, and if there is already
00074         an existing reference, that is returned, with its
00075         deletionMethods attribute updated.  Otherwise the
00076         new instance is created and registered in the table
00077         of already-referenced methods.
00078         """
00079         key = cls.calculateKey(target)
00080         current =cls._allInstances.get(key)
00081         if current is not None:
00082             current.deletionMethods.append( onDelete)
00083             return current
00084         else:
00085             base = super( BoundMethodWeakref, cls).__new__( cls )
00086             cls._allInstances[key] = base
00087             base.__init__( target, onDelete, *arguments,**named)
00088             return base
00089     def __init__(self, target, onDelete=None):
00090         """Return a weak-reference-like instance for a bound method
00091
00092         target -- the instance-method target for the weak
00093             reference, must have im_self and im_func attributes
00094             and be reconstructable via:
00095                 target.im_func.__get__( target.im_self )
00096             which is true of built-in instance methods.
00097         onDelete -- optional callback which will be called
00098             when this weak reference ceases to be valid
00099             (i.e. either the object or the function is garbage
00100             collected).  Should take a single argument,
00101             which will be passed a pointer to this object.
00102         """
00103         def remove(weak, self=self):
00104             """Set self.isDead to true when method or instance is destroyed"""
00105             methods = self.deletionMethods[:]
00106             del self.deletionMethods[:]
00107             try:
00108                 del self.__class__._allInstances[ self.key ]
00109             except KeyError:
00110                 pass
00111             for function in methods:
00112                 try:
00113                     if callable( function ):
00114                         function( self )
00115                 except Exception:
00116                     traceback.print_exc()
00117         self.deletionMethods = [onDelete]
00118         self.key = self.calculateKey( target )
00119         self.weakSelf = weakref.ref(target.im_self, remove)
00120         self.weakFunc = weakref.ref(target.im_func, remove)
00121     def calculateKey( cls, target ):
00122         """Calculate the reference key for this reference
00123
00124         Currently this is a two-tuple of the id()'s of the
00125         target object and the target function respectively.
00126         """
00127         return (id(target.im_self),id(target.im_func))
00128     calculateKey = classmethod( calculateKey )
00129     def __str__(self):
00130         """Give a friendly representation of the object"""
00131         return """%s( %s.%s )"""%(
00132             self.__class__.__name__,
00133             self.weakSelf(),
00134             self.weakFunc().__name__,
00135         )
00136     __repr__ = __str__
00137     def __nonzero__( self ):
00138         """Whether we are still a valid reference"""
00139         return self() is not None
00140     def __cmp__( self, other ):
00141         """Compare with another reference"""
00142         if not isinstance (other,self.__class__):
00143             return cmp( self.__class__, type(other) )
00144         return cmp( self.key, other.key)
00145     def __call__(self):
00146         """Return a strong reference to the bound method
00147
00148         If the target cannot be retrieved, then will
00149         return None, otherwise returns a bound instance
00150         method for our object and function.
00151
00152         Note:
00153             You may call this method any number of times,
00154             as it does not invalidate the reference.
00155         """
00156         target = self.weakSelf()
00157         if target is not None:
00158             function = self.weakFunc()
00159             if function is not None:
00160                 return function.__get__(target)
00161         return None
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: ServerPreferencesImpl.py Source File

gosed

ServerPreferencesImpl.py

00001 # -*- coding: utf-8 -*-
00002 #!/usr/local/bin/python
00003 #
00004 #                               Copyright 2003
00005 #                                     by
00006 #                        The Board of Trustees of the
00007 #                     Leland Stanford Junior University.
00008 #                            All rights reserved.
00009 #
00010
00011 __facility__ = "Online"
00012 __abstract__ = "GLAST Online Single Event Display preferences handler"
00013 __author__   = "A. Kavelaars <aliciak@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00014 __date__     = "12/12/2003"
00015 __version__  = "$Revision: 1.10 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import sys
00021 import os
00022 from qt import *
00023 import logging as myLog
00024 from ServerPreferences import ServerPreferences
00025 import ConfigParser
00026
00027
00028
00029 class ServerPreferencesImpl(ServerPreferences):
00030
00031   def __init__(self, confParser, parent = None,name = None,modal = 0,fl = 0):
00032     ServerPreferences.__init__(self,parent,name,modal,fl)
00033
00034     self.connect(self.selectServerBox, SIGNAL('clicked(int)'), self.selectServer)
00035     self.connect(self.buttonOk, SIGNAL('clicked()'), self.saveServer)
00036
00037     self.__confParser = confParser
00038     # Revisit: Should check --config option and use that, if supplied
00039     if os.name == "posix":
00040       configName = ".gosedrc"
00041     else:
00042       configName = "gosed.cfg"
00043
00044     configFile = "./" + configName      # Current directory
00045     if not os.path.exists(configFile):
00046       try:
00047         home = os.environ['HOME']
00048         configFile = os.path.join(home, configName)    # Home directory
00049       except KeyError:
00050         pass
00051       if not os.path.exists(configFile):
00052         configFile = os.path.join(os.environ['ONLINE_ROOT'], # Source directory
00053                                   'LATTE/gosed/' + configName)
00054     self.__configFile = configFile
00055
00056     if os.path.exists(self.__configFile):
00057       self.__confParser.read(self.__configFile)
00058       self.selectedServer.setText(self.__confParser.get("server options", "server"))
00059     else:
00060       self.selectedServer.setText('1')
00061       self.__confParser.add_section("server options")
00062       self.__confParser.set("server options", "server", '1')
00063
00064     self.defaultServerButton.setChecked(1)
00065
00066   def selectServer(self):
00067     if self.customServerButton.isChecked():
00068       self.comboSelectServer.setEnabled(1)
00069       #~ self.comboSelectServerLbl.setEnabled(1)
00070     else:
00071       self.comboSelectServer.setEnabled(0)
00072       #~ self.comboSelectServerLbl.setEnabled(0)
00073
00074   def saveServer(self):
00075     self.__confParser.set("server options", "server", str(self.selectedServer.text()))
00076     try:
00077       self.__confParser.write(file(self.__configFile, "w+"))
00078     except IOError, e:
00079       myLog.warning("Preferences file not saved due to: %s" % e)
00080
00081
00082 if __name__ == "__main__":
00083     a = QApplication(sys.argv)
00084     QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
00085     w = ServerPreferencesImpl()
00086     a.setMainWidget(w)
00087     w.show()
00088     a.exec_loop()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: SimpleGasuExample.py Source File

SimpleGasuExample.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Coincidence based Trigger System Interface classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 1.4 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 # This class uses
00021 from LATTE.trigger.TrgUsingTiles      import TrgUsingTiles
00022 from LATTE.trigger.NullObjects        import NoInputsEnabled
00023 from LATTE.trigger.rcTrgFunctions     import rcTrgEngines
00024 from LATTE.trigger.TrgEngines         import *
00025 from LATTE.trigger.TrgConditionsValue import TrgConditionsValue
00026
00027 """\brief Interface for Coincidence based Trigger System"""
00028
00029 class SimpleGasuExample(TrgUsingTiles):
00030   """\brief SimpleGASU example interface to GEM
00031   """
00032   def __init__(self):
00033     """\brief SimpleGasuExample constructor
00034     """
00035     TrgUsingTiles.__init__(self)
00036     self.__inputEnables             = SGETrgInputEnables()
00037     self.__engines                  = SGETrgEngines()
00038     self.__conditions               = SolicitedCondition()
00039
00040   # Pure Virtual function implementation
00041   def conditions(self):
00042     return self.__conditions
00043
00044   def coincidences(self):
00045     """\brief Implementation of coincdences 'pure virtual' method from TrgUsingTiles
00046     """
00047     # it just so happens that the roi is exactly the same as the coincidences object
00048     return self.roi()
00049
00050   def inputEnables(self):
00051     """\brief Implementation of inputEnables 'pure virtual' method from TrgAbstract
00052     """
00053     return self.__inputEnables
00054
00055   def engines(self):
00056     """\brief Implementation of engines 'pure virtual' method from TrgAbstract
00057     """
00058     return self.__engines
00059
00060   def useAcdAsTrigger(self):
00061     """Use ACD as a trigger source.
00062     """
00063     return True
00064
00065 # implementaions of user-level trigger classes
00066
00067 class SGETrgInputEnables(NoInputsEnabled):
00068   """Class SGETrgInputEnables:
00069      Empty Input enables.
00070   """
00071   def __init__(self):
00072     NoInputsEnabled.__init__(self)
00073   def towerBusy(self):
00074     # Use NotImplementedError exception to force TrgGemRegisters to
00075     # enable all tower_busy signals by default
00076     raise NotImplementedError
00077     pass
00078
00079
00080 # class MiniTowerEnabled(TrgTowerEnables):
00081 #   """ One tower enabled
00082 #   """
00083 #   def __init__(self):
00084 #     TrgTowerEnables.__init__(self)
00085 #     self.__towers = [MiniTower()] + [NullTower()] * 15
00086 #   def tower(self,towerNumber):
00087 #     return self.__towers[towerNumber]
00088 #
00089 # class MiniTower(TrgTower):
00090 #   """ One tower enabled, tracker and calorimeter
00091 #   """
00092 #   def __init__(self):
00093 #     TrgTower.__init__(self)
00094 #     self.__cal = MiniTowerCal()
00095 #     self.__tkr = MiniTowerTkr()
00096 #   def calorimeter(self):
00097 #     return self.__cal
00098 #   def tracker(self):
00099 #     return self.__tkr
00100 #
00101 # class MiniTowerCal(TrgCalorimeter):
00102 #   def __init__(self):
00103 #     TrgCalorimeter.__init__(self)
00104 #   def useHighEnergy(self):
00105 #     return True
00106 #   def useLowEnergy(self):
00107 #     return True
00108 #
00109 # class MiniTowerTkr(TrgTracker):
00110 #   def __init__(self):
00111 #     TrgTracker.__init__(self)
00112 #   def use(self):
00113 #     return True
00114 #
00115
00116 # class AllConditions(TrgConditionsValue):
00117 #   def __init__(self):
00118 #     TrgConditionsValue.__init__(self)
00119 #   def roi(self):
00120 #     return True
00121 #   def calLow(self):
00122 #     return True
00123 #   def calHigh(self):
00124 #     return True
00125 #   def tkr(self):
00126 #     return True
00127 #   def periodic(self):
00128 #     return True
00129 #   def solicited(self):
00130 #     return True
00131 #   def cno(self):
00132 #     return True
00133
00134 class SGETrgEngines(rcTrgEngines):
00135   """Class MyTrgEngines:
00136      Initialize the trigger engines list class.
00137   """
00138   def __init__(self):
00139     rcTrgEngines.__init__(self)
00140     eng1 = SolicitedEngine()
00141     self.replaceEngine(0,eng1)
00142
00143 class SolicitedEngine(TrgEngine):
00144   """This class defines an engine which reads out the detector
00145      whenever there is a solicited trigger.
00146      This engine is not prescaled.
00147   """
00148   def __init__(self):
00149     TrgEngine.__init__(self)
00150     self.__request = TrgReadout()
00151   def participate(self,conditionsValue):
00152     # This function relies on the programmer's knowledge that the
00153     # conditionsValue is a bitfield.
00154     cond = SolicitedCondition()
00155     if conditionsValue & cond.value():
00156       return True
00157     return False
00158   def prescale(self):
00159     return 0
00160   def request(self):
00161     return self.__request
00162
00163 class SolicitedCondition(TrgConditionsValue):
00164   """ Define a condition where only the solicited trigger is asserted
00165   """
00166   def __init__(self):
00167     TrgConditionsValue.__init__(self)
00168   def solicited(self):
00169     return True
00170
00171 class ZsupTrgReadout(TrgReadout):
00172   """\brief ZsupTrgReadout class definition
00173
00174   Directs a module to send to its Front-End Electronics a command sequence
00175   which is composed only of the TACK command. This command will trigger
00176   a readout of the module's Front-End Electronics.
00177   Zero suppression is turned on.
00178   """
00179   def __init__(self):
00180     """\brief TrgReadout constructor
00181     """
00182     TrgReadout.__init__(self)
00183
00184   def zeroSuppress(self):
00185     return True
00186
00187 # class PeriodicEngine(TrgEngine):
00188 #   """This class defines an engine which reads out the detector
00189 #      whenever there is a solicited trigger.
00190 #      This engine is not prescaled.
00191 #   """
00192 #   def __init__(self):
00193 #     TrgEngine.__init__(self)
00194 #     self.__request = TrgReadout()
00195 #   def participate(self,conditionsValue):
00196 #     # This function relies on the programmer's knowledge that the
00197 #     # conditionsValue is a bitfield.
00198 #     cond = PeriodicCondition()
00199 #     if conditionsValue == cond.value():
00200 #       return True
00201 #     return False
00202 #   def prescale(self):
00203 #     return 0
00204 #   def request(self):
00205 #     return self.__request
00206 #
00207 # class PeriodicCondition(TrgConditionsValue):
00208 #   """ Define a condition where only the solicited trigger is asserted
00209 #   """
00210 #   def __init__(self):
00211 #     TrgConditionsValue.__init__(self)
00212 #   def periodic(self):
00213 #     return True
00214 #
00215
00216
00217
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: socketLogging.py Source File

logger

socketLogging.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Alert System GUI"
00012 __author__   = "J. Panetta"
00013 __date__     = "28/01/2005"
00014 __version__  = "$Revision: 1.2 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018 import logging
00019 import logging.handlers
00020 import sys
00021 ALARM_TCP_LOGGING_PORT    = 9099
00022
00023 class MyLogSocketHandler(logging.handlers.SocketHandler):
00024   def __init__(self, *args):
00025     apply(logging.handlers.SocketHandler.__init__, (self,) + args)
00026
00027   def handleError(self, record):
00028     if self.closeOnError and self.sock:
00029       self.sock.shutdown(2)
00030       self.sock.close()
00031       self.sock = None        #try to reconnect next time
00032     else:
00033       raise IOError, sys.exc_info()[1]
00034
00035   def createSocket(self):
00036     """Override base classes createSocket method.
00037        This isn't allowed to fail silently
00038     """
00039     self.sock = self.makeSocket()
00040
00041 def socketLogging(logHost, logLevel, port=ALARM_TCP_LOGGING_PORT):
00042
00043   logging.root.setLevel(logging.__dict__[logLevel])
00044
00045   # set up the socket handler for this logger
00046   sockHdlr   = MyLogSocketHandler(logHost, port)
00047
00048   fmt = logging.Formatter("%(asctime)s %(filename)s:%(lineno)d %(levelname)-5s - %(message)s")
00049   sockHdlr.setFormatter(fmt)
00050   logging.getLogger().addHandler(sockHdlr)
00051
00052   try:
00053     logging.info('Trying to connect to the message logger')
00054   except Exception, e:
00055     logging.getLogger("").removeHandler(sockHdlr)
00056     logging.fatal("Can't connect to the message logger, Aborting job")
00057     raise
00058   else:
00059     logging.info('Successfully connected to the message logger')
00060
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: socketMerge.py Source File

socketMerge.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2006
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Program to merge data from network sockets"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "3/30/2006"
00014 __updated__  = ("$Date: 2006/07/14 22:34:29 $").split(' ')[1]
00015 __version__  = "$Revision: 1.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import logging         as     log
00022 import sys
00023 import time
00024 import struct
00025
00026 import LDF
00027
00028 from   LATTE.merger.geb import Geb
00029
00030 from   ancillarySocket  import AncillaryContributor
00031 from   ldfSocket        import LdfContributor
00032
00033
00034 class Merger(Geb):
00035   def __init__(self, contributors, filename):
00036     Geb.__init__(self, contributors)
00037     self.__file = file(filename, 'wb')
00038
00039   def dispose(self, (statuses, buffer)):
00040     """!\brief Method called by the base class to dispose of an event.
00041     """
00042     self.__file.write(buffer)
00043
00044   def close(self):
00045     """!\brief Method called by the base class to close the output file.
00046     """
00047     self.__file.close()
00048
00049
00050 def getHostPort(option):
00051   opts = option.split(':')
00052   host = opts[0]
00053   if len(opts) == 1:
00054     port = 2345
00055   else:
00056     port = int(opts[1])
00057   return host, port
00058
00059
00060 def main(options):
00061   ancillaryContributor = AncillaryContributor(getHostPort(options.ancillaryHost))
00062   ldfContributor       = LdfContributor(getHostPort(options.ldfHost))
00063   merger = Merger([ancillaryContributor, ldfContributor], options.outFile)
00064   #merger = Merger([ancillaryContributor], options.outFile)
00065   #merger = Merger([ldfContributor], options.outFile)
00066
00067   try:
00068     merger.start()
00069
00070     # Wait until an error occurs or the user kills us
00071     while(True):  time.sleep(24*3600)
00072
00073   except KeyboardInterrupt:
00074     pass
00075   except Exception, e:
00076     log.exception(sys.argv[0] + ":\n" + str(e))
00077
00078   # Shutdown the builder
00079   merger.shutdown()
00080
00081
00082 def usage():
00083   """!\brief Return a program usage message
00084   """
00085   return "\n\n%s merges, or builds, events from sockets\n" % (sys.argv[0])
00086
00087
00088 if __name__ == "__main__":
00089   # Options, first list mandatory, second list optional
00090   from LATTE.tools.gOptions import Options
00091
00092   options = Options(["ancillaryHost", "ldfHost", "outFile"])
00093   try:
00094    options.parse()
00095   except Exception, msg:
00096    options.usage(usage())
00097    raise Exception, msg
00098
00099   main(options)
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: splitOutTem.py Source File

splitOutTem.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example EBF event handling test application"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "2/25/2003"
00014 __version__  = "$Revision: 1.2 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import                      threading
00020 import logging       as     log
00021 from   LATTE.runcontrol.rcTransitions import rcTransitions
00022 from   LATTE.runcontrol.ArgumentImpl  import ArgumentImpl
00023 import                      time
00024 import                      math
00025 import                      sys
00026 from binascii import hexlify
00027
00028 from support.SimpleGasuExample   import *
00029 from support.MiniGLTExample      import *
00030
00031 import LDF
00032
00033 import Numeric
00034
00035
00036 def _unsigned(arg):
00037   """\brief Convert an unsigned int argument to an unsigned long
00038
00039   This funtion exists to help format unsigned ints greater than 0x7fffffff,
00040   which in Python 2.4 and up will be displayed as signed strings.
00041   """
00042   return arg & (2L * sys.maxint + 1)
00043
00044
00045 class myLATcomponentIterator(LDF.LATcomponentIterator):
00046   def __init__(self):
00047     LDF.LATcomponentIterator.__init__(self)
00048     self.parent = None
00049
00050   def TEM(self, event, ebfContribution):
00051     cellHdr = LDF.LATPcellHeader(ebfContribution.header())
00052     tem = cellHdr.source()  # enum maps 1:1 with tower number
00053     self.parent.tem[tem] = self.parseContrib(ebfContribution)
00054
00055     return 0
00056
00057   def GEM(self, event, ebfContribution):
00058     self.parent.gem = self.parseContrib(ebfContribution)
00059     return 0
00060
00061   def AEM(self, event, ebfContribution):
00062     self.parent.aem = self.parseContrib(ebfContribution)
00063     return 0
00064
00065   def OSW(self, event, ebfContribution):
00066     self.parent.osw = self.parseContrib(ebfContribution)
00067     return 0
00068
00069   def headerStr(self, contrib):
00070     header      = long(contrib.header()     )
00071     packetError = long(contrib.packetError())
00072     sequence    = long(contrib.sequence()   )
00073     length      = long(contrib.length()     )
00074
00075     pack = ((packetError&0x7)<<13) | ((sequence&0x1f)<<8) | ((length>>4)&0xff)
00076     hpknum = 0L
00077     hpknum = hpknum | (header<<16|pack);
00078     rst = ""
00079
00080     # print hex(header), packetError, sequence, length, hex(summary)
00081     for i in range(4):
00082       rst = chr(hpknum&0xff) + rst
00083       hpknum = hpknum >> 8
00084     return rst
00085
00086   def summaryStr(self, contrib):
00087     summary = long(contrib.summary())
00088     rst = ""
00089     for i in range(4):
00090       rst = chr(summary&0xff) + rst
00091       summary = summary >> 8
00092     return rst
00093
00094   def payloadStr(self, ebfContribution):
00095     pd = ebfContribution.payload()
00096     return Numeric.fromstring(pd).byteswapped().tostring()
00097
00098   def parseContrib(self, ebfContribution):
00099     str  = self.headerStr(ebfContribution)
00100     str += self.summaryStr(ebfContribution)
00101     str += self.payloadStr(ebfContribution)
00102     return str
00103
00104
00105 class myLATdbIterator(LDF.LATdataBufferIterator):
00106   def __init__(self, lci, temList):
00107     LDF.LATdataBufferIterator.__init__(self, lci)
00108     self.__lci = lci
00109     lci.parent = self
00110
00111     self.ldfFiles = {}
00112     for tem in temList:
00113       fName = "tem_%x.ldf" % tem
00114       self.ldfFiles[tem] = open(fName, mode='wb')
00115
00116
00117   def iterate(self, buffer, size):
00118     hdr = buffer[0:16]
00119     hdrStr = Numeric.fromstring(hdr).byteswapped().tostring()
00120     # print "LDBI: ", hexlify(hdr)
00121
00122     # set up contrib buffers
00123     self.gem = ""
00124     self.aem = ""
00125     self.osw = ""
00126     self.tem = [""] *16
00127
00128     LDF.LATdataBufferIterator.iterate(self, buffer, size)
00129
00130     for tem, ldfFile in self.ldfFiles.items():
00131       bufstr = ""
00132       bufstr += self.osw
00133       bufstr += self.gem
00134       bufstr += self.tem[tem]
00135       bufstr += self.aem
00136
00137       dgLength = len(hdr) + len(bufstr)
00138       evLength = dgLength - 8
00139       tmp = divmod(dgLength, 0x100)
00140       dgLenStr = chr(tmp[0]) + chr(tmp[1])
00141       tmp = divmod(evLength, 0x100)
00142       evLenStr = chr(tmp[0]) + chr(tmp[1])
00143
00144       newHdr = hdr[0:6] + dgLenStr + hdr[8:14] + evLenStr
00145       bufstr = newHdr + bufstr
00146
00147       ldfFile.write(bufstr)
00148
00149
00150   def closeAll(self):
00151     for tem in self.ldfFiles.values():
00152       tem.close()
00153
00154
00155 class userArgument(ArgumentImpl):
00156   "GUI for getting the user to input some sort of value."
00157   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00158     ArgumentImpl.__init__(self, parent, name, modal, fl)
00159     self.__value = 0
00160     self.setCaption("Hello world!")
00161
00162   def OKButtonClicked(self):
00163     self.__value = int(self.ArgumentList.text().latin1())
00164     self.close()
00165
00166   def CancelButtonClicked(self):
00167     self.__value = None
00168     self.close()
00169
00170   def getValue(self, caption):
00171     self.setCaption(caption)
00172     self.show()
00173     self.exec_loop()
00174     return self.__value
00175
00176 class userArgText(object):
00177   "Text user interface for getting the user to input some sort of value"
00178   def __init__(self):
00179     pass
00180
00181   def getValue(self, caption):
00182     return int(raw_input("%s: " % (caption)))
00183
00184
00185 class userApplication(rcTransitions):
00186   "Implmentation class for a user application"
00187   def __init__(self, rc, userId, debug):
00188     rcTransitions.__init__(self, rc, userId, debug)
00189     log.debug("userApplication.__init__()")
00190     self.__eventSem    = threading.Semaphore(0)
00191     self.__cmdSynchSem = threading.Semaphore(0)
00192
00193   def getName(self):
00194     return __name__
00195
00196   def setup(self):
00197     log.debug("userApplication.setup()")
00198
00199     if self.rc is None:
00200       self.__arg = userArgText()
00201     else:
00202       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00203
00204     # Split the run file into N parts, where N is the number of TEMs
00205     if self.lat.existsGEM():
00206       self.trigger( SimpleGasuExample() )
00207     else:
00208       self.trigger( MiniGLTExample() )
00209
00210     return None
00211
00212   def startRun(self):
00213     log.debug("userApplication.startRun()")
00214
00215     caption = "Enter number of triggers to take"
00216     if self.rc is None:
00217       cnt = self.__arg.getValue(caption)
00218     else:
00219       cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00220
00221     # 1) Determine TEMs present in Schema
00222     temList = self.lat.TEM.keys()
00223     if temList == []:
00224       raise RuntimeError("No TEMs in schema, aborting split of LDF file")
00225     if len(temList) == 1:
00226       raise RuntimeError("Only one TEM in schema, aborting split of LDF file")
00227
00228     # 2) pass temList to routines which do the work
00229     self.__lci         = myLATcomponentIterator()
00230     self.__ldbi        = myLATdbIterator(self.__lci,temList)
00231
00232     if cnt is None:  return -1
00233     self.__cnt = cnt
00234
00235     self.__cmdSynchQuit = False
00236
00237     return None
00238
00239   def stopRun(self):
00240     log.debug("userApplication.stopRun()")
00241
00242     self.setCompletionStatus(self.COMPL_STATUS_SUCCESS)
00243     self.__cmdSynchQuit = True
00244     self.__eventSem.release()
00245     # don't forget to close the TEM files
00246     self.__ldbi.closeAll()
00247
00248
00249   def resume(self):
00250     log.debug("userApplication.resume()")
00251     self.trigger().solicit()
00252     return None
00253
00254   def stop(self):
00255     log.debug("userApplication.stop()")
00256     return self.stopRun()
00257
00258   def teardown(self):
00259     log.debug("userApplication.teardown()")
00260     if self.rc is not None and self.__arg is not None:
00261       self.__arg.deleteLater()
00262
00263   def process(self, (status, buffer)):
00264     log.debug("userApplication.process()")
00265
00266     evtCli = self.evtCli
00267     self.__ldbi.iterate(buffer, len(buffer))
00268
00269     if status == 0:
00270       if 0:                              # One _OR_ the other method, not both
00271         pass
00272       else:                              # Old way of doing things
00273         pass
00274     else:
00275       if evtCli.isGGLTStatus():
00276         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00277       elif not evtCli.checkOnlineStatus(status, evtCli.PLAYBACK_ERROR):
00278         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00279       self.__eventSem.release()
00280       return
00281
00282     try:
00283       # In the future this event may contain additional data
00284       if evtCli.isSweepEvent(): return
00285     except:
00286       # Event summary word inaccessible, handle the bad event here
00287       log.exception("")
00288       return
00289
00290
00291     # Get next event triggered
00292     self.__eventSem.release()
00293
00294   #def __commandSynch(self, count):
00295   def commandSynch(self):
00296     "Method called by the command synchronization task"
00297     import time
00298     trigger  = self.trigger()
00299     eventSem = self.__eventSem
00300     while eventSem.acquire(0):  pass
00301
00302     t0  = time.time()
00303
00304     # Compensate for the extra CMD_SELF_TRIGGER below
00305     cnt = 1
00306     count = self.__cnt
00307
00308     # Wait for START_RUN to enable triggers
00309     trigger.waitForMaskEnable()
00310
00311     trigger.solicit()                   # Issue an internal trigger
00312     eventSem.acquire()                  # Wait for the event to be processed
00313
00314     while cnt < count and not self.__cmdSynchQuit:
00315       cnt += 1
00316       trigger.solicit()                 # Issue an internal trigger
00317       time.sleep(.0001)
00318       eventSem.acquire()                # Wait for the event to be processed
00319
00320
00321
00322     # Get out of waiting when in suite or standalone mode
00323     self.sync()
00324
00325     # execute the GUI functions for stopRun, just in case
00326     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00327       if self.rc is not None:
00328         self.rc.doStop()
00329
00330   def wait(self):
00331     self.__cmdSynchSem.acquire()
00332
00333   def sync(self):
00334     if __name__ == "__main__" or self.isRunFromSuite():
00335       self.__cmdSynchSem.release()
00336
00337
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: standardLDF.py Source File

consumer

standardLDF.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "LDF Interface for standardPlotter"
00013 __author__   = "Lester Miller"
00014 __date__     = "11/18/2003"
00015 __version__  = "$Revision: 1.7 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019 import LDF
00020 import Numeric as numarray
00021 import time
00022
00023 class LATcomponentIterator(LDF.LATcomponentIterator):
00024   def __init__(self):
00025     LDF.LATcomponentIterator.__init__(self)
00026     self.eventMarker  = None
00027     self.ntDefinitions = self.declareNtDefinitions()
00028     self.ntDescriptions = self.declareNtDescriptions()
00029     # protect against failure to have dictionaries and pedestals
00030     self.ntDict = {}
00031     self.numarrayDict = {}
00032     self.acdPeds = None
00033     self.calPeds = None
00034     self.sparsify = False
00035     # other needed internal variables
00036     self.nEvtSeen = 0
00037     self.prevPpcTime = 0
00038     self.prevGmTime = 0
00039     self.markerPpcTime = 0
00040     self.markerGmTime = 0
00041     self.ppcTimeInSec = 0.
00042     self.gemTimeInSec = 0.
00043     self.prevGemTime = 0.
00044     self.collectingPedestals = False
00045
00046   def UDFcomponent(self, event, ebfContribution):
00047     return 0
00048
00049   def OSWcomponent(self, event, oswContribution):
00050     oswContribIter = OSWcontributionIterator(event, oswContribution, self)
00051     oswContribIter.iterate()
00052     self.nEvtSeen+=1
00053     return 0
00054
00055   def ACDcomponent(self, event, aemContribution):
00056     acdContrib = AEMcontributionIterator(event, aemContribution, self)
00057     acdContrib.fill()
00058     return 0
00059
00060   def GEMcomponent(self, event, gemContribution):
00061     gemContrib = GEMcontribution(event, gemContribution, self)
00062     gemContrib.fill()
00063     return 0
00064
00065   def CALcomponent(self, event, calContribution):
00066     calContrib = CALcontributionIterator(event, calContribution, self)
00067     calContrib.fill()
00068     return 0
00069
00070   def TKRcomponent(self, event, tkrContribution):
00071     tkrContrib = TKRcontributionIterator(event, tkrContribution, self)
00072     tkrContrib.fill()
00073     return 0
00074
00075   def diagnostic(self, event, contribution):
00076     if not LDF.EventSummary.diagnostic(contribution.summary()):
00077       return
00078     diagContrib = DIAGcontributionIterator(event,contribution,self.TKRend(),self)
00079     diagContrib.iterateCAL()
00080     diagContrib.iterateTKR()
00081     self.diagnosticEnd(self.TKRend() + diagContrib.size())
00082     return 0
00083
00084   def error(self, event, contribution):
00085     if  not LDF.EventSummary.error(contribution.summary()):
00086       return
00087     if self.diagnosticEnd() != 0:
00088       offset=self.diagnosticEnd()
00089     else:
00090       offset=self.TKRend()
00091     errorContrib = LDF.ERRcontributionIterator(event,contribution,offset)
00092     theError = errorContrib.theError()
00093     if 'evt_error' in self.ntDict:
00094       cRow = [0,theError.tmo(),theError.phs(),theError.cal()<<8|theError.tkr(),self.ppcTimeInSec]
00095       cNt = self.ntDict['evt_error']
00096       cNt.addRow(cRow)
00097     self.errorEnd(offset + errorContrib.size())
00098     return 0
00099
00100   def getEventMarker(self):
00101     return self.eventMarker
00102
00103   def declareNtDefinitions(self):
00104     definitions = {}
00105     definitions['osw_time']  = ["eventnum","evtsize","dtppc","gmtime","ppctime"]
00106     definitions['tkr_trig']  = ["tower", "layer", "end","chanindex","ppctime"]
00107     definitions['tkr_hit']   = ["tower", "layer", "fenum", "hit","chanindex","ppctime"]
00108     definitions['tkr_tot']   = ["tower", "layer", "end", "tot","chanindex","ppctime"]
00109     definitions['tkr_layer'] = ["tower", "layer", "nhit","chanindex","ppctime"]
00110     definitions['cal_trig']  = ["tower", "layer", "end", "le", "he","chanindex","ppctime"]
00111     definitions['cal_lac']   = ["tower", "layer", "col", "end","lac","chanindex","ppctime"]
00112     definitions['cal_accept']= ["tower", "layer", "col", "end","adc","chanindex","ppctime"]
00113     definitions['cal_log']   = ["tower", "layer", "col", "adcp", "adcn", "adcmean", "adcdiff","chanindex","ppctime"]
00114     definitions['acd_hit']   = ["arc", "afe", "tile", "side","chanindex","ppctime"]
00115     definitions['acd_accept']= ["arc", "afe", "tile", "side", "pha","chanindex","ppctime"]
00116     definitions['acd_tile']  = ["tile", "pha1", "pha2", "phamean", "phadiff", "hit1", "hit2", "hitor","chanindex","ppctime"]
00117     definitions['gem_event'] = ["dtreg", "dtcalc", "condsum", "ntile", "live", "gtime", "prescale", "discarded", "sent","ppctime"]
00118     definitions['gem_input'] = ["cno","tileXY","tileXZM","tileXZP","tileYZM","tileYZP","tileRBN","tileNA","roi", "tkr", "callo", "calhe","ppctime"]
00119     definitions['evt_error'] = ["tower", "phasing", "timeout","cc","ppctime"]
00120     return definitions
00121
00122   def declareNtDescriptions(self):
00123     descriptions = {}
00124     descriptions['osw_time']  = ["Event Number","Event Size","PPC Delta t","G.M. time","PPC time"]
00125     descriptions['tkr_trig']  = ["Tower", "Layer (0-35)", "End","Channel: Tower, Layer(0-35), End(0-1)","PPC time"]
00126     descriptions['tkr_hit']   = ["Tower", "Layer (0-35)", "TFE number (0-23)", "Strip Number","Channel: Tower, Layer (0-35), TFE (0-23)","PPC time"]
00127     descriptions['tkr_tot']   = ["Tower", "Layer (0-35)", "End", "TOT","Channel: Tower, Layer(0-35), End(0-1)","PPC time"]
00128     descriptions['tkr_layer'] = ["Tower", "Layer (0-35)", "Number Strips Hit","Layer: Tower, Layer(0-35)","PPC time"]
00129     descriptions['cal_trig']  = ["Tower", "Layer", "End", "FLE fired", "FHE fired","Channel: Tower, Layer(0-7), End(0-1)","PPC time"]
00130     descriptions['cal_lac']   = ["Tower", "Layer", "Column", "End","LAC fired","Channel: Tower, Layer(0-7), Column(0-11), End(0-1)","PPC time"]
00131     descriptions['cal_accept']= ["Tower", "Layer", "Column", "End","ADC Value","Channel: Tower, Layer(0-7), Column(0-11), End(0-1)","PPC time"]
00132     descriptions['cal_log']   = ["Tower", "Layer", "Column", "ADC+", "ADC-", "ADC Mean", "ADC Relative Difference","Log: Tower, Layer(0-7), Column(0-11)","PPC time"]
00133     descriptions['acd_hit']   = ["ARC (cable)", "AFE (channel)", "Tile Number", "Tile Side","Channel: Tile (0-107), Side(0-1)","PPC time"]
00134     descriptions['acd_accept']= ["ARC (cable)", "AFE (channel)", "Tile Number", "Tile Side","ADC Value","Channel: Tile Number(0-107), Side(0-1)","PPC time"]
00135     descriptions['acd_tile']  = ["Tile Number", "ADC Side A", "ADC Side B", "ADC Mean", "ADC Relative Difference", "Veto A Fired", "Veto B Fired", "Veto Fired","Channel: Tile (0-107)","PPC time"]
00136     descriptions['gem_event'] = ["Delta T Register", "Delta T Calculated", "Condition Summary", "Number Tiles Fired", "Live Time", "Gem Time", "Prescaled Register", "Discarded Register", "Sent Register","PPC time"]
00137     descriptions['gem_input'] = ["CNO Vector","ACD Tile XY","ACD Tile XZ-","ACD tile XZ+","ACD Tile YZ-","ACD Tile YZ+","ACD Fiber","ACD NA","Roi Vector", "Tkr Vector", "Cal Low Vector", "Cal High Vector","PPC time"]
00138     descriptions['evt_error'] = ["Tower", "Phasing Error bit", "Timeout bit","CC Bit Field","PPC time"]
00139     return descriptions
00140
00141   def getColumnDescription(self,ntName,columnName):
00142     index = 0
00143     result = ''
00144     if ntName not in self.ntDefinitions or ntName not in self.ntDescriptions:
00145       return result
00146     descriptionList = self.ntDescriptions[ntName]
00147     for column in self.ntDefinitions[ntName]:
00148       if column == columnName:
00149         result = descriptionList[index]
00150       index+=1
00151     return result
00152
00153   def getChanIndexDescription(self,ntName,value):
00154     result = 'chanindex'
00155     if ntName == 'cal_accept':
00156       tower  = value/(8*12*2)
00157       value  = value%(8*12*2)
00158       layer  = value/(12*2)
00159       value  = value%(12*2)
00160       column = value/(2)
00161       value  = value%(2)
00162       end    = value
00163       result = 'Tower %d Layer %d Column %d End %d'%(tower,layer,column,end)
00164     if ntName == 'cal_log':
00165       tower  = value/(8*12)
00166       value  = value%(8*12)
00167       layer  = value/(12)
00168       value  = value%(12)
00169       column = value
00170       result = 'Tower %d Layer %d Column %d'%(tower,layer,column)
00171     if ntName == 'cal_lac':
00172       tower  = value/(8*12*2)
00173       value  = value%(8*12*2)
00174       layer  = value/(12*2)
00175       value  = value%(12*2)
00176       column = value/(2)
00177       value  = value%(2)
00178       end    = value
00179       result = 'Tower %d Layer %d Column %d End %d'%(tower,layer,column,end)
00180     if ntName == 'cal_trig':
00181       tower  = value/(8*2)
00182       value  = value%(8*2)
00183       layer  = value/(2)
00184       value  = value%(2)
00185       end    = value
00186       result = 'Tower %d Layer %d End %d'%(tower,layer,end)
00187
00188     if ntName == 'tkr_layer':
00189       tower  = value/(36)
00190       value  = value%(36)
00191       layer  = value
00192       result = 'Tower %d Layer %d'%(tower,layer)
00193     if ntName == 'tkr_hit':
00194       tower  = value/(36*24)
00195       value  = value%(36*24)
00196       layer  = value/(24)
00197       value  = value%(24)
00198       fenum  = value
00199       result = 'Tower %d Layer %d TFE %d'%(tower,layer,fenum)
00200     if ntName == 'tkr_tot':
00201       tower  = value/(36*2)
00202       value  = value%(36*2)
00203       layer  = value/(2)
00204       value  = value%(2)
00205       end    = value
00206       result = 'Tower %d Layer %d End %d'%(tower,layer,end)
00207     if ntName == 'tkr_trig':
00208       tower  = value/(36*2)
00209       value  = value%(36*2)
00210       layer  = value/(2)
00211       value  = value%(2)
00212       end    = value
00213       result = 'Tower %d Layer %d End %d'%(tower,layer,end)
00214
00215     if ntName == 'acd_accept':
00216       tileRemap = value/(2)
00217       value     = value%(2)
00218       side      = value
00219       tile = self.getTileNumber(int(tileRemap))
00220       result = 'Tile %d Side %d'%(tile,side)
00221     if ntName == 'acd_tile':
00222       tileRemap = value
00223       tile = self.getTileNumber(int(tileRemap))
00224       result = 'Tile %d'%(tile)
00225     return result
00226
00227   def getTileNumber(self,remapTileNumber):
00228     # remap: top has 25, sides 16, 8 fibers and last 11 unassigned
00229     # three digits of tilenumber are [side][xcoord][yxoord]
00230     result = None
00231     if remapTileNumber<25:
00232       result = 10*(remapTileNumber/5) + remapTileNumber%5
00233     elif remapTileNumber<(25+4*16):
00234       result = 100+100*((remapTileNumber-25)/16)
00235       remainder = (remapTileNumber-25)%16
00236       result += 10*(remainder/5) + remapTileNumber%5
00237     elif remapTileNumber<(25+4*16+8):
00238       division = (remapTileNumber-25-4*16)/4
00239       remainder = (remapTileNumber-25-4*16)%4
00240       result = 500+100*division+10*remainder
00241     else:
00242       result = 700+(remapTileNumber-25-4*16-8)
00243     return result
00244
00245   def getNtupleDefinition(self,ntName):
00246     # this returns the string of column names if it is known of here
00247     if ntName in self.ntDefinitions:
00248       return self.ntDefinitions[ntName]
00249     else:
00250       return None
00251
00252 class CALcontributionIterator(LDF.CALcontributionIterator):
00253   def __init__(self, event, contribution,lci):
00254     LDF.CALcontributionIterator.__init__(self, event, contribution)
00255     self.lci     = lci
00256
00257   def fill(self):
00258     length = self.contribution().numLogAccepts()
00259     if length == 0:
00260       return
00261     self.iterate()
00262
00263   def log(self, tower, layer, theLog):
00264     column = theLog.column()
00265     positive = theLog.positive()
00266     negative = theLog.negative()
00267     posRange = positive.range()
00268     posValue = positive.value()
00269     negRange = negative.range()
00270     negValue = negative.value()
00271     if self.lci.calPeds is not None:
00272       posValue -= self.lci.calPeds[tower,layer,column,0,posRange,0]
00273       negValue -= self.lci.calPeds[tower,layer,column,1,negRange,0]
00274       # to translate from range to range, lo to hi is 8, with area between diodes of 6
00275       rangeMultiplier = [1.,8.,6.*8.,6.*8.*8.]
00276       posValue *= rangeMultiplier[posRange]
00277       negValue *= rangeMultiplier[negRange]
00278       # until I decide to get four range pedestals, this will kludge
00279       if posRange>0: posValue = 4096.
00280       if negRange>0: negValue = 4096.
00281       negRange = 0
00282       posRange = 0
00283       if self.lci.sparsify:
00284         if negValue < 3.*self.lci.calPeds[tower,layer,column,0,posRange,1]:
00285           negValue = None
00286         if posValue < 3.*self.lci.calPeds[tower,layer,column,1,posRange,1]:
00287           posValue = None
00288     else:
00289       # can't relate ranges without peds so just fill overflow for other ranges
00290       if not self.lci.collectingPedestals:
00291         if posRange>0: posValue = 4096.
00292         if negRange>0: negValue = 4096.
00293     if 'cal_accept' in self.lci.ntDict:
00294       cNt = self.lci.ntDict['cal_accept']
00295       if negValue is not None:
00296         chanIndex = tower*8*12*2 + layer*12*2 + column*2
00297         cRow = [tower,layer,column,0,negValue,chanIndex,self.lci.ppcTimeInSec]
00298         cNt.addRow(cRow)
00299       if posValue is not None:
00300         chanIndex = tower*8*12*2 + layer*12*2 + column*2 + 1
00301         cRow = [tower,layer,column,1,posValue,chanIndex,self.lci.ppcTimeInSec]
00302         cNt.addRow(cRow)
00303     if 'cal_log' in self.lci.numarrayDict:
00304       cNumarray = self.lci.numarrayDict['cal_log']
00305       if negValue is not None:
00306         cNumarray[tower,layer,column,0,negRange] = negValue
00307       if posValue is not None:
00308         cNumarray[tower,layer,column,1,posRange] = posValue
00309     if posValue is None or negValue is None:
00310       return
00311     average = (posValue+negValue)/2.
00312     if average!=0:
00313       difference = (posValue-negValue)/(2.*average)
00314     else:
00315       difference = 0
00316     if 'cal_log' in self.lci.ntDict:
00317       cNt = self.lci.ntDict["cal_log"]
00318       chanIndex = tower*8*12 + layer*12 + column
00319       cRow = [tower,layer,column,posValue,negValue,average,difference,chanIndex,self.lci.ppcTimeInSec]
00320       cNt.addRow(cRow)
00321
00322 class TKRcontributionIterator(LDF.TKRcontributionIterator):
00323   def __init__(self, event, contribution, lci):
00324     LDF.TKRcontributionIterator.__init__(self, event, contribution)
00325     self.lci     = lci
00326     self.__debug      = 0
00327
00328   def fill(self):
00329     length  = self.contribution().numAccepts(self.event())
00330     if length == 0:
00331       return
00332     self.layerHits = [0] * 16 * 36
00333     self.iterateStrips()
00334     self.iterateTOTs()
00335     # fill layer hits ntuple
00336     if 'tkr_layer' in self.lci.ntDict:
00337       cNt = self.lci.ntDict['tkr_layer']
00338       for tower in range(16):
00339         for layer in range(36):
00340           chanIndex = tower*36+layer
00341           if self.layerHits[chanIndex]>0:
00342             cRow = [tower,layer,self.layerHits[layer],chanIndex,self.lci.ppcTimeInSec]
00343             cNt.addRow(cRow)
00344
00345   def strip(self, tower, layerEnd, hit):
00346     layer = layerEnd >> 1
00347     fenum = int(hit/64)
00348     self.layerHits[tower*36+layer]+=1;
00349     if 'tkr_hit' in self.lci.ntDict:
00350       cNt = self.lci.ntDict['tkr_hit']
00351       chanIndex = tower*36*24+layer*24+fenum
00352       cRow = [tower,layer,fenum,hit,chanIndex,self.lci.ppcTimeInSec]
00353       cNt.addRow(cRow)
00354
00355   def TOT(self, tower, layerEnd, tot):
00356     layer = layerEnd>>1
00357     end = layerEnd%2
00358     if 'tkr_tot' in self.lci.ntDict:
00359       cNt = self.lci.ntDict['tkr_tot']
00360       chanIndex = tower*36*2+layer*2+end
00361       cRow = [tower,layer,end,tot,chanIndex,self.lci.ppcTimeInSec]
00362       cNt.addRow(cRow)
00363
00364 class AEMcontributionIterator(LDF.AEMcontributionIterator):
00365   def __init__(self,event,contribution, lci):
00366     LDF.AEMcontributionIterator.__init__(self,event,contribution)
00367     self.lci = lci
00368   def fill(self):
00369     if 'acd_tile' in self.lci.ntDict:
00370       self.acdAdc0 = {}
00371       self.acdAdc1 = {}
00372       self.acdHit0 = {}
00373       self.acdHit1 = {}
00374     self.iterate()
00375     if 'acd_tile' in self.lci.ntDict:
00376       for tileNumber in self.acdAdc0.keys():
00377         pha0 = self.acdAdc0[tileNumber]
00378         pha1 = self.acdAdc1[tileNumber]
00379         hit0=0
00380         hit1=0
00381         if tileNumber in self.acdHit0:
00382           hit0 = self.acdHit0[tileNumber]
00383           if hit0 is None:
00384             hit0 = 0
00385         if tileNumber in self.acdHit1:
00386           hit1 = self.acdHit1[tileNumber]
00387           if hit1 is None:
00388             hit1 = 0
00389         if pha0 is not None and pha1 is not None:
00390           # have both read out so make it a tile...
00391           average = (pha0+pha1)/2.
00392           if average!=0:
00393             difference = (pha0-pha1)/(2.*average)
00394           else:
00395             difference = 0
00396           cNt = self.lci.ntDict['acd_tile']
00397           chanIndex = self.getRemappedTileNumber(tileNumber)
00398           cRow = [tileNumber,pha0,pha1,average,difference,hit0,hit1,hit0|hit1,chanIndex,self.lci.ppcTimeInSec]
00399           cNt.addRow(cRow)
00400
00401   def header(self, cable, hdr):
00402     for channel in range(18):
00403       if (hdr.hitMap()>>channel)&0x1:
00404         tileNumber = self.getMiniAcdTileNumber(cable,channel)
00405         remappedTileNumber = self.getRemappedTileNumber(tileNumber)
00406         side = self.getMiniAcdSide(cable,channel)
00407         if 'acd_hit' in self.lci.ntDict:
00408           cNt = self.lci.ntDict['acd_hit']
00409           chanIndex = remappedTileNumber*2+side
00410           cRow = [cable,channel,tileNumber,side,chanIndex,self.lci.ppcTimeInSec]
00411           cNt.addRow(cRow)
00412         if 'acd_tile' in self.lci.ntDict:
00413           if side==0:
00414             self.acdHit0[tileNumber]=1
00415             if not tileNumber in self.acdHit1:
00416               self.acdHit1[tileNumber]=None
00417           if side==1:
00418             self.acdHit1[tileNumber]=1
00419             if not tileNumber in self.acdHit0:
00420               self.acdHit0[tileNumber]=None
00421
00422   def pha(self, cable, channel, p):
00423     adcValue = p.ADCvalue()
00424     adcRange = p.ADCrange()
00425     if self.lci.acdPeds is not None:
00426       adcValue -= self.lci.acdPeds[cable,channel,p.ADCrange(),0]
00427       rangeMultiplier = [1.,100.]
00428       adcValue*=rangeMultiplier[p.ADCrange()]
00429       # until second range pedestals are available, just overflow the other range
00430       if adcRange>0: adcValue = 4096.
00431       adcRange = 0
00432       if self.lci.sparsify:
00433         if adcValue < 3.*self.lci.acdPeds[cable,channel,adcRange,1]:
00434           return # don't fill if we're sparsifying
00435     else:
00436       # overflow the second range if no pedestals
00437       if not self.lci.collectingPedestals:
00438         if adcRange>0: adcValue = 4096.
00439     tileNumber = self.getMiniAcdTileNumber(cable,channel)
00440     remapTileNumber = self.getRemappedTileNumber(tileNumber)
00441     # side
00442     side = self.getMiniAcdSide(cable,channel)
00443     if 'acd_accept' in self.lci.ntDict:
00444       cNt = self.lci.ntDict["acd_accept"]
00445       chanIndex = remapTileNumber*2+side
00446       cRow = [cable,channel,tileNumber,side,adcValue,chanIndex,self.lci.ppcTimeInSec]
00447       cNt.addRow(cRow)
00448     if 'acd_tile' in self.lci.ntDict:
00449       if side==0:
00450         self.acdAdc0[tileNumber]=adcValue
00451         if not tileNumber in self.acdAdc1:
00452           self.acdAdc1[tileNumber]=None
00453       if side==1:
00454         self.acdAdc1[tileNumber]=adcValue
00455         if not tileNumber in self.acdAdc0:
00456           self.acdAdc0[tileNumber]=None
00457     if 'acd_pha' in self.lci.numarrayDict:
00458       cNumarray = self.lci.numarrayDict["acd_pha"]
00459       cNumarray[cable,channel,adcRange] = adcValue
00460
00461   def getSide(self,cable,channel):
00462     id   = self.event().identity()
00463     tbl  = self.map().lookup(id, cable, channel)
00464     if tbl.a() == 'A':
00465       side = 0
00466     else:
00467       side = 1
00468     return side
00469
00470   def getIntegerTileNumber(self,cable,channel):
00471     id   = self.event().identity()
00472     tbl  = self.map().lookup(id, cable, channel)
00473     tileName  = tbl.name()
00474     if tileName[0:2] == 'NA':
00475       tileNumber = int(tileName[2:])
00476       tileNumber += 700
00477     else:
00478       tileNumber = int(tileName)
00479     return tileNumber
00480
00481   def getMiniAcdSide(self,cable,channel):
00482     # special kludged version for miniAcd
00483     id   = self.event().identity()
00484     tbl  = self.map().lookup(id, cable, channel)
00485     if tbl.a() == 'A':
00486       side = 0
00487     else:
00488       side = 1
00489
00490     # special remaps
00491     if cable==10 and channel==6:
00492       side = 1
00493     if cable==10 and channel==7:
00494       side = 1
00495     if cable==10 and channel==11:
00496       side = 0
00497     if cable==10 and channel==12:
00498       side = 0
00499
00500     return side
00501
00502   def getMiniAcdTileNumber(self,cable,channel):
00503     # special kludged version for miniAcd
00504     id   = self.event().identity()
00505     tbl  = self.map().lookup(id, cable, channel)
00506     tileName  = tbl.name()
00507     if tileName[0:2] == 'NA':
00508       tileNumber = int(tileName[2:])
00509       tileNumber += 700
00510     else:
00511       tileNumber = int(tileName)
00512
00513     # special remaps
00514     if cable==10 and channel==6:
00515       tileNumber = 0
00516     if cable==10 and channel==7:
00517       tileNumber = 1
00518     if cable==10 and channel==11:
00519       tileNumber = 0
00520     if cable==10 and channel==12:
00521       tileNumber = 1
00522
00523     return tileNumber
00524
00525   def getRemappedTileNumber(self,tileNumber):
00526     # remap: top has 25, sides 16, 8 fibers and last 11 unassigned
00527     # three digits of tilenumber are [side][xcoord][yxoord]
00528     remainder = tileNumber%100
00529     division  = tileNumber/100
00530     remapTileNumber = 5*(remainder/10)+remainder%10
00531     if division>=1 and division<5:
00532       remapTileNumber+=25+16*(division-1)
00533     elif division==5 or division==6:
00534       remapTileNumber=25+16*4+(remainder/10)
00535     elif division==7:
00536       remapTileNumber=25+16*4+8+remainder
00537     return remapTileNumber
00538
00539 class OSWcontributionIterator(LDF.OSWcontributionIterator):
00540   def __init__(self, event, contribution, lci):
00541     LDF.OSWcontributionIterator.__init__(self, event, contribution)
00542     self.lci  = lci
00543     # these are for filling ntuple (in OSWtime)
00544     self.eventNumber = LDF.EventSummary.eventNumber(event.summary())*4+LDF.EventSummary.tag(event.summary())
00545     self.eventSize = event.length()
00546     # marker is kept by the lci for access from scripts
00547     self.lci.eventMarker = LDF.EventSummary.marker(event.summary())
00548
00549   def OSWtime(self, timeStamp, timebase):
00550     ts = LDF.OSWtimeSpec(timeStamp)
00551     gmTime = ts.sec()+1.e-9*ts.nsec()
00552     # get around the sign bit problem
00553     lowerTime = long(timebase.lower())
00554     if lowerTime<0: lowerTime += 0x100000000L-1
00555     upperTime = long(timebase.upper())
00556     if upperTime<0: upperTime += 0x100000000L-1
00557     ppcTime = upperTime<<32 | lowerTime
00558     if self.lci.eventMarker==5:
00559       self.lci.markerPpcTime = ppcTime
00560       self.lci.markerGmTime  = gmTime
00561     # convert to seconds since marker for ntuple
00562     # at 64 bits don't have to worry about rolling over...
00563     dtPpc = 0.
00564     if self.lci.prevPpcTime!=0:
00565       dtPpc = ppcTime - self.lci.prevPpcTime
00566     dtPpcInSec = (1.*dtPpc)/20.e6
00567     ppcTimeInSec = 1.*(ppcTime - self.lci.markerPpcTime)/20.e6
00568     gmTimeInSec  = 1.*(gmTime - self.lci.markerGmTime)
00569     self.lci.ppcTimeInSec = ppcTimeInSec
00570     if 'osw_time' in self.lci.ntDict:
00571       cRow = [self.eventNumber,self.eventSize,dtPpcInSec,gmTimeInSec,ppcTimeInSec]
00572       cNt = self.lci.ntDict['osw_time']
00573       cNt.addRow(cRow)
00574     self.lci.prevPpcTime = ppcTime
00575     self.lci.prevGmTime  = gmTime
00576     return 0
00577
00578   def OSW_UDF(self, event, contribution):
00579     return 0
00580
00581 class DIAGcontributionIterator(LDF.DIAGcontributionIterator):
00582   __gtccEndMap    = [0,1,1,0,1,0,0,1]
00583   __gtccLayerStart= [0,0,1,1,3,3,2,2]
00584   def __init__(self,event,contribution,dataStart,lci):
00585     LDF.DIAGcontributionIterator.__init__(self,event,contribution)
00586     self.offset(dataStart)  # Set the start of the diagnostic data
00587     self.lci=lci
00588
00589   def CALdiag(self, tower, layer, diag):
00590     if 'cal_lac' in self.lci.ntDict:
00591       cNt = self.lci.ntDict['cal_lac']
00592       for column in range(12):
00593         for end in range(2):
00594           lac = (diag.logAccepts(end)>>column)&0x1
00595           if lac:
00596             realEnd = (end+1)%2
00597             chanIndex = tower*8*12*2 + layer*12*2 + column*2 + realEnd
00598             cRow = [tower,layer,column,realEnd,lac,chanIndex,self.lci.ppcTimeInSec]
00599             cNt.addRow(cRow)
00600     if 'cal_trig' in self.lci.ntDict:
00601       cNt = self.lci.ntDict['cal_trig']
00602       for end in range(2):
00603         le = diag.low(end)
00604         he = diag.high(end)
00605         if le or he:
00606           realEnd = (end+1)%2
00607           chanIndex = tower*8*2 + layer*2 + realEnd
00608           cRow = [tower,layer,realEnd,le,he,chanIndex,self.lci.ppcTimeInSec]
00609           cNt.addRow(cRow)
00610     return 0
00611
00612   def TKRdiag(self, tower, gtcc, diag):
00613     if 'tkr_trig' in self.lci.ntDict:
00614       cNt = self.lci.ntDict['tkr_trig']
00615       for gtrc in range(9):
00616         if (diag.datum()>>gtrc)&0x1:
00617           layer = self.__gtccLayerStart[gtcc]+4*gtrc
00618           end = self.__gtccEndMap[gtcc]
00619           chanIndex = tower*36*2+layer*2+end
00620           cRow = [tower,layer,end,chanIndex,self.lci.ppcTimeInSec]
00621           cNt.addRow(cRow)
00622     return 0
00623
00624 class GEMcontribution(object):
00625   def __init__(self, event, contribution,lci):
00626     self.lci = lci
00627     self.__event        = event
00628     self.__contribution = contribution
00629
00630   def __getattr__(self, attr):
00631     """This method fakes up inheritance from an LDF.GEMcontribution.
00632     When a called method can not be found to belong to this class, this
00633     method is called.  We use it to redirect the call to the 'base' class.
00634     """
00635     return getattr(self.__contribution, attr)
00636
00637   def fill(self, prefix = ""):
00638     tl  = self.tileList()
00639     dtCalc = self.triggerTime()-self.lci.prevGemTime
00640     if (self.triggerTime()<self.lci.prevGemTime):
00641       # it rolled (happens every 1.7 seconds)
00642       dtCalc += 1<<25
00643     dtCalcInSec = dtCalc/20.e6
00644     gemTimeInSec = dtCalcInSec+self.lci.gemTimeInSec+dtCalcInSec
00645     dtRegInSec = self.deltaEventTime()/20.e6
00646     if 'gem_event' in self.lci.ntDict:
00647       livetimeInSec = self.liveTime()/20.e6
00648       prescale = self.prescaled()
00649       discarded = self.discarded()
00650       send = self.sent()
00651       numberTiles = 0
00652       for tileIndex in range(16):
00653         if (tl.XZM()>>tileIndex)&0x1: numberTiles+=1
00654         if (tl.XZP()>>tileIndex)&0x1: numberTiles+=1
00655         if (tl.YZM()>>tileIndex)&0x1: numberTiles+=1
00656         if (tl.YZP()>>tileIndex)&0x1: numberTiles+=1
00657       for tileIndex in range(25):
00658         if (tl.XY()>>tileIndex)&0x1: numberTiles+=1
00659       for tileIndex in range(8):
00660         if (tl.RBN()>>tileIndex)&0x1: numberTiles+=1
00661       for tileIndex in range(11):
00662         if (tl.NA()>>tileIndex)&0x1: numberTiles+=1
00663       cNt = self.lci.ntDict['gem_event']
00664       cRow = [dtRegInSec,dtCalcInSec,self.conditionSummary(),numberTiles,livetimeInSec,gemTimeInSec,prescale,discarded,send,self.lci.ppcTimeInSec]
00665       cNt.addRow(cRow)
00666     if 'gem_input' in self.lci.ntDict:
00667       cNt = self.lci.ntDict['gem_input']
00668       cRow = [self.cnoVector(),tl.XY(),tl.XZM(),tl.XZP(),tl.YZM(),tl.YZP(),tl.RBN(),tl.NA(),self.roiVector(),self.tkrVector(),self.calLEvector(),self.calHEvector(),self.lci.ppcTimeInSec]
00669       cNt.addRow(cRow)
00670     self.lci.prevGemTime = self.triggerTime()
00671     self.lci.gemTimeInSec = gemTimeInSec
00672
00673 class LATcontributionIterator(LDF.LDBI_LATcontributionIterator):
00674   def __init__(self, eei):
00675     LDF.LDBI_LATcontributionIterator.__init__(self, eei)
00676     self.__udfDict = {}
00677
00678   #def EBF(self, start, end):          # Use the default
00679   #  return status
00680
00681   def UDF(self, start, end):
00682     # the raw data is a string with comma separated key=value pairs
00683     udfString = str(start.rawData())
00684     # strip null characters
00685     import string
00686     udfString = string.strip(udfString,'\000')
00687
00688     # now split and see what you get
00689     udfList = string.split(udfString,',')
00690     for udfItem in udfList:
00691       udfSplitItem = string.split(udfItem,'=')
00692       if len(udfSplitItem) == 2:
00693         udfKey = string.strip(udfSplitItem[0])
00694         string.strip(udfSplitItem[1])
00695         udfValue = udfSplitItem[1]
00696         self.__udfDict[udfKey] = udfValue
00697     return 0
00698
00699   def getUdfDict(self):
00700     return self.__udfDict
00701
00702   def clearUdfDict(self):
00703     self.__udfDict.clear()
00704
00705 class EBFeventIterator(LDF.LDBI_EBFeventIterator):
00706   def __init__(self, lci):
00707     LDF.LDBI_EBFeventIterator.__init__(self, lci)
00708     self.__lci = lci
00709
00710   def process(self, evt):
00711     self.__lci.iterate(evt)
00712     return self.__lci.status()
00713
00714
00715 def hexdump( chars, sep, width ):
00716   while chars:
00717     line = chars[0:width]
00718     chars = chars[width:]
00719     line = line + '\000' * (width - len(line))
00720     print "%s%s%s" % ( sep.join( map( lambda c: "%02x" % ord(c), line )),sep, quotechars( line ))
00721
00722
00723 def quotechars( chars ):
00724   return ''.join( map( lambda c: ['.', c][c.isalnum()], chars ))
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: standardPlotter.py Source File

consumer

standardPlotter.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "LDF Plotter for consumer"
00013 __author__   = "Lester Miller"
00014 __date__     = "11/18/2003"
00015 __version__  = "$Revision: 1.10 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019 import sihippo
00020 import os
00021 import time
00022 import Numeric as numarray
00023 import string
00024 import ConfigParser
00025 import logging       as     myLog
00026 from LATTE.consumer.standardPlotterGuiImpl import standardPlotterGuiImpl
00027 import qt
00028 from   LATTE.runcontrol.rcTestReport           import rcTestReport
00029
00030 class standardPlotter(object):
00031   def __init__(self,lci,gui=None):
00032     self.gui = gui
00033     self.lci = lci
00034
00035   def initializePlotter(self):
00036     # get configuration file from GUI
00037     if self.gui is not None:
00038       self.configGui = self.gui.createGUI(standardPlotterGuiImpl, self.gui, 'test1', 1)
00039       configFile = self.gui.execGUImethod(self.configGui.getConfigFile,self.configFile)
00040     else:
00041       self.configGui = standardPlotterGuiImpl(self, 'test1', 1)
00042       configFile = self.configGui.getConfigFile(self.configFile)
00043     if configFile is None:
00044       raise AssertionError,'User Cancelled: No config file given'
00045     self.setConfigFile(configFile)
00046
00047   def setDataType(self,dataType):
00048     self.dataType = dataType
00049
00050   def setConfigFile(self,configFile):
00051     myLog.info("Configuring with file %s"%(configFile))
00052     self.configFile = os.path.expandvars(configFile)
00053     # lci owns ntuples and numarrays
00054     self.lci.ntDict = {}
00055     self.lci.numarrayDict = {}
00056     # next we find what's been requested from config
00057     self.histDict = {}
00058     self.limits = {}
00059     self.cuts = {}
00060     self.options = {}
00061     self.ntRequests = {}
00062     self.plotRequests = {}
00063     self.limitRequests = {}
00064     self.cutRequests = {}
00065     self.getRequests()
00066     # these are the options fields
00067     self.reportPath = None
00068     if self.gui is not None:
00069       self.reportPath = self.gui.preferences()["reportdir"]
00070       self.reportPath = os.path.expandvars(self.reportPath)
00071     elif 'reportpath' in self.options:
00072       self.reportPath = self.options['reportpath']
00073       self.reportPath = os.path.expandvars(self.reportPath)
00074       if not os.path.isabs(self.reportPath):
00075         self.reportPath = os.path.join(os.getcwd(),self.reportPath)
00076     self.checkInterval = 1000
00077     if 'checkinterval' in self.options:
00078       self.checkInterval = eval(self.options['checkinterval'])
00079     self.plotUpdateRate = 2
00080     if 'plotupdaterate' in self.options:
00081       self.plotUpdateRate = eval(self.options['plotupdaterate'])
00082     self.dataType = 'All'
00083     if 'datatype' in self.options:
00084       self.dataType = self.options['datatype']
00085     pedSubtract = True
00086     self.lci.acdPeds = None
00087     self.lci.calPeds = None
00088     if 'pedsubtract' in self.options:
00089       pedSubtract = eval(self.options['pedsubtract'])
00090     if pedSubtract:
00091       self.readPedestals()
00092     if 'pedsparsify' in self.options:
00093       self.lci.sparsify = eval(self.options['pedsparsify'])
00094     # init hippo as requested
00095     if self.gui is not None:
00096       self.gui.execGUImethod(self.initHippo)
00097     else:
00098       self.initHippo()
00099
00100   def getName(self):
00101     return 'standardPlotter'
00102
00103   def initHippo(self):
00104     self.lci.nEvtSeen=0
00105     # setup with canvas
00106     ntc = sihippo.NTupleController.instance()
00107     wc = sihippo.WindowController.instance()
00108     self.canvas = wc.currentCanvas()
00109     if self.canvas is None:
00110       wc.createInspector()
00111       self.window = sihippo.CanvasWindow()
00112       self.window.show()
00113       self.canvas = wc.currentCanvas()
00114     self.canvas.clear()
00115     self.dc = sihippo.DisplayController.instance()
00116     self.canvas.show()
00117     self.qtTimer = qt.QTime.currentTime()
00118     qt.QTime.start(self.qtTimer)
00119     # book ntuples
00120     for ntuple in self.ntRequests.keys():
00121       ntupleColumns = self.lci.getNtupleDefinition(ntuple)
00122       if ntupleColumns is not None:
00123         if self.ntRequests[ntuple]>0:
00124           cNt = ntc.createCircularBuffer( ntupleColumns )
00125           cNt.reserve ( self.ntRequests[ntuple] )
00126         else:
00127           cNt = ntc.createNTuple( ntupleColumns )
00128         cNt.setName(ntuple)
00129         cNt.setTitle(ntuple)
00130         cNt.setIntervalEnabled ( 1 )
00131         cNt.setIntervalCount ( 1000000 )
00132         self.lci.ntDict[ntuple] = cNt
00133       else:
00134         myLog.warn('StandardPlotter:initHippo: Unknown ntuple \'%s\' in requested ntuples'%(ntuple))
00135     # book plots
00136     # expect that the config comes in form
00137     # Ntuple name, Plot Type, Plot Title, column list [, xbinlow xbinhi xbinwidth, ybinlow ybinhi ybinwidth]
00138     for plot in self.plotRequests.keys():
00139       declarationList = string.split(self.plotRequests[plot],',')
00140       if len(declarationList)>=4:
00141         ntupleName = string.strip(declarationList[0]).lower()
00142         if ntupleName in self.lci.ntDict:
00143           cNt = self.lci.ntDict[ntupleName]
00144           hColumnList = string.split(declarationList[3])
00145           hColumns = []
00146           cNtColumns = self.lci.getNtupleDefinition(ntupleName)
00147           foundColumns = True
00148           for column in hColumnList:
00149             normalColumn = string.strip(column).lower()
00150             if normalColumn in cNtColumns:
00151               hColumns.append(normalColumn)
00152             else:
00153               foundColumns = False
00154               myLog.warn('StandardPlotter:initHippo: Requested plot \'%s\' has column \'%s\' not in ntuple \'%s\' with columns %s'%(plot,normalColumn,ntupleName,cNtColumns))
00155           if foundColumns:
00156             # finally have everything we need to declare the plot
00157             hType = string.strip(declarationList[1])
00158             hTitle = string.strip(declarationList[2])
00159             cHist = self.dc.createDisplay(hType,cNt,hColumns)
00160             cHist.setTitle(hTitle)
00161             # check for binning information
00162             if len(declarationList)>4:
00163               # x
00164               xBinPars = string.split(declarationList[4])
00165               if len(xBinPars)==3:
00166                 xLower = float(xBinPars[0])
00167                 xUpper = float(xBinPars[1])
00168                 xWidth = float(xBinPars[2])
00169                 if xUpper>xLower:
00170                   cHist.setRange('x', xLower , xUpper )
00171                 if xWidth>0:
00172                   cHist.setBinWidth('x', xWidth)
00173                 else:
00174                   myLog.warn('StandardPlotter:initHippo: Requested plot \'%s\' ignoring extra binning parameters for x, saw %s'%(plot,xBinPars))
00175             if len(declarationList)>5:
00176               # y
00177               yBinPars = string.split(declarationList[5])
00178               if len(yBinPars)==3:
00179                 yLower = float(yBinPars[0])
00180                 yUpper = float(yBinPars[1])
00181                 yWidth = float(yBinPars[2])
00182                 if yUpper>yLower:
00183                   cHist.setRange('y', yLower , yUpper )
00184                 if yWidth>0:
00185                   cHist.setBinWidth('y', yWidth)
00186                 else:
00187                   myLog.warn('StandardPlotter:initHippo: Requested plot \'%s\' ignoring extra binning parameters for y, saw %s'%(plot,yBinPars))
00188             self.histDict[plot]=cHist
00189             self.canvas.addDisplay(cHist)
00190         else:
00191           myLog.warn('StandardPlotter:initHippo: Requested plot \'%s\' error in declaration: ntuple \'%s\' unknown or not requested'%\
00192                      (plot,ntupleName))
00193       else:
00194         myLog.warn('StandardPlotter:initHippo: Requested plot \'%s\' error in declaration:\n expect: Ntuple name, Plot Type, Plot Title, column list, [lowerx upperx binwidthx, lowery uppery binwidthy]\n    got: %s'%(plot,declarationList))
00195     # now apply the cuts
00196     for (plot,variable) in self.cuts.keys():
00197       if not plot in self.histDict:
00198         myLog.warn('StandardPlotter:initHippo: Requested cut on plot \'%s\' variable \'%s\' but plot not requested'%(plot,variable))
00199         continue
00200       ntuple = self.getPlotNtuple(plot)
00201       if not ntuple in self.lci.ntDict:
00202         myLog.warn('StandardPlotter:initHippo: Requested cut on plot \'%s\' variable \'%s\' but ntuple not \'%s\' not requested'%(plot,variable,ntuple))
00203         continue
00204       if not variable in self.lci.getNtupleDefinition(ntuple):
00205         myLog.warn('StandardPlotter:initHippo: Requested cut on plot \'%s\' variable \'%s\' but ntuple \'%s\' has variables: %s'%\
00206                    (plot,variable,ntuple,self.lci.getNtupleDefinition(ntuple)))
00207         continue
00208       cc = sihippo.CutController.instance()
00209       (cutLower,cutUpper) = self.cuts[(plot,variable)]
00210       cut = cc.addCut ( self.histDict[plot], variable )
00211       cut.setCutRange ( cutLower,cutUpper )
00212
00213   def clearPlots(self):
00214     for nt in self.lci.ntDict.values():
00215       nt.clear()
00216     self.lci.nEvtSeen=0
00217     self.forceUpdatePlots()
00218
00219   def updatePlots(self):
00220     if qt.QTime.elapsed(self.qtTimer)>int(1000/self.plotUpdateRate):
00221       self.forceUpdatePlots()
00222       qt.QTime.restart(self.qtTimer)
00223
00224   def forceUpdatePlots(self):
00225     for nt in self.lci.ntDict.values():
00226       nt.setIntervalEnabled(0)
00227       nt.setIntervalEnabled(1)
00228
00229   def getPlotColumns(self,plot):
00230     result = []
00231     if plot in self.histDict and plot in self.plotRequests:
00232       declarationList = string.split(self.plotRequests[plot],',')
00233       if len(declarationList)>=4:
00234         hColumnList = string.split(declarationList[3])
00235         for column in hColumnList:
00236           result.append(string.strip(column).lower())
00237     return result
00238   def getPlotNtuple(self,plot):
00239     result = ''
00240     if plot in self.histDict and plot in self.plotRequests:
00241       declarationList = string.split(self.plotRequests[plot],',')
00242       if len(declarationList)>=4:
00243         result = string.strip(declarationList[0]).lower()
00244     return result
00245   def getPlotTitle(self,plot):
00246     result = ''
00247     if plot in self.histDict and plot in self.plotRequests:
00248       declarationList = string.split(self.plotRequests[plot],',')
00249       if len(declarationList)>=4:
00250         result = string.strip(declarationList[2])
00251     return result
00252   def getPlotCuts(self,plot):
00253     result = []
00254     if plot in self.histDict and plot in self.plotRequests:
00255       for (plotCut,variable) in self.cuts.keys():
00256         if plot == plotCut:
00257           (cutLower,cutUpper) = self.cuts[(plot,variable)]
00258           result.append((variable,cutLower,cutUpper))
00259     return result
00260   def getPlotType(self,plot):
00261     result = ''
00262     if plot in self.histDict and plot in self.plotRequests:
00263       declarationList = string.split(self.plotRequests[plot],',')
00264       if len(declarationList)>=4:
00265         result = string.strip(declarationList[1])
00266     return result
00267
00268   def getRequests(self):
00269     # try reading from a config file
00270     if self.configFile is not None:
00271       parser = ConfigParser.ConfigParser()
00272       if os.path.exists(self.configFile):
00273         parser.read(self.configFile)
00274         sections = parser.sections()
00275         for section in sections:
00276           options = parser.options(section)
00277           # don't evaluate plots, cuts or limits, those are parsed
00278           if section == 'plots':
00279             for option in options:
00280               self.plotRequests[option] = parser.get(section,option)
00281           elif section == 'limits':
00282             for option in options:
00283               self.limitRequests[option] = parser.get(section,option)
00284           elif section == 'cuts':
00285             for option in options:
00286               self.cutRequests[option] = parser.get(section,option)
00287           elif section == 'ntuples':
00288             for option in options:
00289               self.ntRequests[option] = eval(parser.get(section,option))
00290           elif section == 'options':
00291             for option in options:
00292               self.options[option] = parser.get(section,option)
00293           else:
00294             myLog.warn("%s.getRequests: unrecognized section \'%s\'\n" %(self.getName(),section))
00295     self.parseLimits()
00296     self.parseCuts()
00297
00298   def parseLimits(self):
00299     for limit in self.limitRequests.values():
00300       # limits are plot name, lower upper sigma
00301       # TKRocc_ped    = TKRocc,    0.0    1.5
00302       declarationList = string.split(limit,',')
00303       if len(declarationList)>=2:
00304         plotName = string.strip(declarationList[0]).lower()
00305         limitPars = string.split(declarationList[1])
00306         if len(limitPars)>=2:
00307           limitLower = float(limitPars[0])
00308           limitUpper = float(limitPars[1])
00309           if len(limitPars)>=3:
00310             limitWidth = float(limitPars[2])
00311           else:
00312             limitWidth = -1.
00313           self.limits[plotName] = (limitLower,limitUpper,limitWidth)
00314         else:
00315           myLog.warn("%s.parseLimits: error in limit parameters for \'%s\' need two or three numbers saw %s\n" %(self.getName(),limit,limitPars))
00316       else:
00317         myLog.warn("%s.parseLimits: error in limit declaration of \'%s\':\n expect: Plot name, lowerLimit upperLimit [rmsLimit]\n    got: %s\n"\
00318                    %(self.getName(),limit,declarationList))
00319
00320   def parseCuts(self):
00321     for cut in self.cutRequests.values():
00322       # cuts are plot name, ntuple variable, cut value low high
00323       # TKRocc_ped    = TKRocc,   tower,    -0.5    0.5
00324       declarationList = string.split(cut,',')
00325       if len(declarationList)>=3:
00326         plotName = string.strip(declarationList[0]).lower()
00327         plotVariable = string.strip(declarationList[1]).lower()
00328         cutPars = string.split(declarationList[2])
00329         if len(cutPars)>=2:
00330           cutLower = float(cutPars[0])
00331           cutUpper = float(cutPars[1])
00332           self.cuts[(plotName,plotVariable)] = (cutLower,cutUpper)
00333         else:
00334           myLog.warn("%s.parseCuts: error in cut parameters for \'%s\' need two numbers saw %s\n" %(self.getName(),cut,cutPars))
00335       else:
00336         myLog.warn("%s.parseCuts: error in cut declaration of \'%s\':\n expect: Plot name, Data Type, lowerCut upperCut\n    got: %s\n"\
00337                    %(self.getName(),cut,declarationList))
00338
00339   def readPedestals(self):
00340     if 'ANCILLARY_ROOT' in os.environ:
00341       ifname = os.path.join(os.environ['ANCILLARY_ROOT'],'Consumer/acdPeds.txt')
00342       try:
00343         infile = open(ifname)
00344       except:
00345         return
00346       self.lci.acdPeds = numarray.zeros((12,18,2,2))
00347       for line in infile.xreadlines():
00348         if line[0]=='!':
00349           continue
00350         # cable channel range mean rms
00351         entries = string.split(line)
00352         if len(entries)==5:
00353           self.lci.acdPeds[int(entries[0]),int(entries[1]),int(entries[2]),0] = float(entries[3])
00354           self.lci.acdPeds[int(entries[0]),int(entries[1]),int(entries[2]),1] = float(entries[4])
00355       infile.close()
00356       myLog.info('StandardPlotter:readPedestals: Read in ACD pedestals from %s'%(ifname))
00357
00358       ifname = os.path.join(os.environ['ANCILLARY_ROOT'],'Consumer/calPeds.txt')
00359       try:
00360         infile = open(ifname)
00361       except:
00362         return
00363       self.lci.calPeds = numarray.zeros((16,8,12,2,4,2))
00364       for line in infile.xreadlines():
00365         if line[0]=='!':
00366           continue
00367         # tower layer column end range mean rms
00368         entries = string.split(line)
00369         if len(entries)==7:
00370           self.lci.calPeds[int(entries[0]),int(entries[1]),int(entries[2]),int(entries[3]),int(entries[4]),0] = float(entries[5])
00371           self.lci.calPeds[int(entries[0]),int(entries[1]),int(entries[2]),int(entries[3]),int(entries[4]),1] = float(entries[6])
00372       infile.close()
00373       myLog.info('StandardPlotter:readPedestals: Read in CAL pedestals from %s'%(ifname))
00374
00375   def checkLimit(self,plot,limit):
00376     # check the given limit against the given plot
00377     # returns a tuple of (limitColumnName,limitLabelList,limitList,errorLabelList,errorList)
00378     limitLabelList = []
00379     limitFailList = []
00380     errorLabelList = []
00381     errorFailList = []
00382     originalLimitColumnName = None
00383     if plot in self.histDict:
00384       # get columns wanted from plot declaration
00385       plotColumns = self.getPlotColumns(plot)
00386       xColumnName = None
00387       yColumnName = None
00388       errorColumnName = None
00389       limitColumnName = plotColumns[len(plotColumns)-1] # limit column is always last or entries/bin
00390       originalLimitColumnName = limitColumnName
00391       if len(plotColumns)>=1:
00392         xColumnName = plotColumns[0]
00393       if len(plotColumns)>=2:
00394         yColumnName = plotColumns[1]
00395       # match these to the plot ntuple columns
00396       xColumn = None
00397       yColumn = None
00398       limitColumn = None
00399       errorColumn = None
00400       cHist = self.histDict[plot]
00401       histNtuple = cHist.createNTuple()
00402       for columnIndex in range(histNtuple.columns()):
00403         columnName = histNtuple.getLabelAt(columnIndex)
00404         if columnName == xColumnName:
00405           xColumn = histNtuple.getColumn(columnName)
00406         if columnName == yColumnName:
00407           yColumn = histNtuple.getColumn(columnName)
00408         if columnName == limitColumnName:
00409           limitColumn = histNtuple.getColumn(columnName)
00410         if columnName == 'Error':
00411           errorColumn = histNtuple.getColumn(columnName)
00412           errorColumnName = columnName
00413         # special case of Histogram or 2Dhist: limit column is entries per bin
00414         if columnName == 'Density' or columnName == 'Entries / bin':
00415           limitColumn = histNtuple.getColumn(columnName)
00416           limitColumnName = columnName
00417       # if the limit is same as one of the dependent variables, remove them
00418       if limitColumnName == yColumnName:
00419         yColumn = None
00420         yColumnName = None
00421       # if the y column doesn't exist, put a dummy column in place
00422       if yColumn is None:
00423         yColumn = numarray.zeros((len(limitColumn)))
00424       # now we have the Label Lists
00425       limitLabelList = [xColumnName,yColumnName,limitColumnName]
00426       (limitLower,limitUpper,limitWidth) = limit
00427       # check this limit
00428       # if we're not ring buffered, assume the limits are rates in histogram bins
00429       if limitColumnName == 'Density' or limitColumnName == 'Entries / bin':
00430         if self.ntRequests[self.getPlotNtuple(plot)]<=0:
00431           limitUpper *= self.lci.nEvtSeen
00432           limitLower *= self.lci.nEvtSeen
00433       for binIndex in range(len(limitColumn)):
00434         if limitColumn[binIndex]<limitLower or limitColumn[binIndex]>limitUpper:
00435           limitFailList.append([xColumn[binIndex],yColumn[binIndex],limitColumn[binIndex]])
00436       # next the width if applicable
00437       if limitWidth>0 and errorColumn is not None:
00438         errorLabelList = [xColumnName,yColumnName,errorColumnName]
00439         for binIndex in range(len(errorColumn)):
00440           if errorColumn[binIndex]>limitWidth:
00441             errorFailList.append([xColumn[binIndex],yColumn[binIndex],errorColumn[binIndex]])
00442     else:
00443       myLog.warn('%s.checkLimit: error in limit \'%s\': plot \'%s\' unknown or not requested. Known plots: %s\n'\
00444                  %(self.getName(),limit,plot,self.histDict.keys()))
00445
00446     return (originalLimitColumnName,limitLabelList,limitFailList,errorLabelList,errorFailList)
00447
00448   def reportResults(self):
00449     if self.reportPath is not None and self.getRunId() != '':
00450       self.startReport()
00451       self.reportLimits()
00452       self.reportPlots()
00453       reportName = self.getName() + "_" + self.getRunId() + ".html"
00454       myLog.info('Creating report %s'%(reportName))
00455       self.writeReport(os.path.join(self.reportPath,reportName))
00456
00457
00458   def startSummary(self):
00459     self.summarySection = self.report.addSection('Summary of Results',insert=0)
00460     configFileName = os.path.basename(self.configFile)
00461     itemString = "<a href = '%s'>%s</a>"%(configFileName,configFileName)
00462     self.report.addSectionItem(self.summarySection,'Plotter Configuration File',itemString)
00463     self.addExportedFile(self.configFile,delete = False)
00464     # a table of results
00465     self.summaryTable = self.report.addSectionTable(self.summarySection)
00466     self.report.beginTableRow(self.summaryTable)
00467     self.report.addTableHeader(self.summaryTable,'Plot Name')
00468     self.report.addTableHeader(self.summaryTable,'Data Type')
00469     self.report.addTableHeader(self.summaryTable,'Limit Type')
00470     self.report.addTableHeader(self.summaryTable,'Status')
00471
00472   def reportLimits(self):
00473     sectionID = None
00474     for plot in self.limits.keys():
00475       if plot in self.histDict:
00476         cLimit = self.limits[plot]
00477         # check ringBuffer for completion
00478         if self.ntRequests[self.getPlotNtuple(plot)]>0 and self.lci.ntDict[self.getPlotNtuple(plot)].rows()<self.ntRequests[self.getPlotNtuple(plot)]:
00479           # append this to the summary table
00480           (limitLower,limitUpper,limitWidth) = cLimit
00481           status = 'INSUFFICIENT'
00482           if limitWidth>0:
00483             limitType = 'range/sigma limit'
00484           else:
00485             limitType = 'range limit'
00486           if self.getCompletionStatusStr()=='PASSED':
00487             self.setCompletionStatus(self.COMPL_STATUS_PASSED_CONDITIONALLY)
00488           self.addSummaryTableRow(plot,limitType,status)
00489           continue
00490         (limitName,limitLabelList,limitFailList,errorLabelList,errorFailList)  = self.checkLimit(plot,cLimit)
00491         if limitName is not None:
00492           # print out a plot section
00493           itemStartString = 'Limit Check for Plot:'
00494           if sectionID is None:
00495             sectionID = self.report.addSection('%s Data Limit Checks'%(self.dataType))
00496             if self.firstBodySection is None:
00497               self.firstBodySection = sectionID
00498           self.reportPlotItem(sectionID,plot,itemStartString)
00499           # get limit descriptor
00500           (limitLower,limitUpper,limitWidth) = cLimit
00501           xName = limitLabelList[0]
00502           yName = limitLabelList[1]
00503           zName = limitLabelList[2]
00504           limitDesc = self.lci.getColumnDescription(self.getPlotNtuple(plot),limitName)
00505           if zName == 'Density' or zName == 'Entries / bin':
00506             if self.ntRequests[self.getPlotNtuple(plot)]>0:
00507               limitDesc = 'Entries per bin'
00508             else:
00509               limitDesc = 'Entries per bin per event'
00510           itemString = '%s between %f and %f'%(limitDesc,limitLower,limitUpper)
00511           self.report.addSectionItem(sectionID,'Limit',itemString)
00512           # check this limit
00513           status = 'PASSED'
00514           if len(limitFailList)>0:
00515             status = 'FAILED'
00516             self.setCompletionStatus(self.COMPL_STATUS_FAILED)
00517           self.report.addSectionItem(sectionID,'Status',self.report.statusString(status))
00518           # append this to the summary table
00519           self.addSummaryTableRow(plot,'range limit',status)
00520           # list out failures
00521           self.listFailed(limitLabelList,limitFailList,plot,limitDesc,sectionID)
00522           # next the error limit if requested
00523           if len(errorLabelList)>0:
00524             itemString = '%s sigma less than %f'%(limitDesc,limitWidth)
00525             self.report.addSectionItem(sectionID,'Limit',itemString)
00526             # check this limit
00527             status = 'PASSED'
00528             if len(errorFailList)>0:
00529               status = 'FAILED'
00530               self.setCompletionStatus(self.COMPL_STATUS_FAILED)
00531             self.report.addSectionItem(sectionID,'Status',self.report.statusString(status))
00532             # append this to the summary table
00533             self.addSummaryTableRow(plot,'sigma limit',status)
00534             # list out failures
00535             self.listFailed(errorLabelList,errorFailList,plot,limitDesc,sectionID)
00536     return sectionID
00537
00538   def addSummaryTableRow(self,plot,limitType,status):
00539     if self.summarySection is None:
00540       self.startSummary()
00541     self.report.beginTableRow(self.summaryTable)
00542     self.report.addTableData(self.getPlotTitle(plot))
00543     self.report.addTableData(self.dataType)
00544     self.report.addTableData(limitType)
00545     self.report.addTableData(self.report.statusString(status))
00546
00547   def reportPlotItem(self,sectionID,plot,itemStartString):
00548     self.reportedPlots.append((plot,self.dataType))
00549     if self.gui is not None:
00550       pngFile = self.gui.execGUImethod(self.capturePlot,plot)
00551     else:
00552       pngFile = self.capturePlot(plot)
00553     axisLabelString = ''
00554     first = True
00555     for label in self.getPlotColumns(plot):
00556       if first:
00557         axisLabelString+=self.lci.getColumnDescription(self.getPlotNtuple(plot),label)
00558         first = False
00559       else:
00560         axisLabelString+=' <b>Vs.</b> '+self.lci.getColumnDescription(self.getPlotNtuple(plot),label)
00561     itemString = '<hr/>%s %s'%(itemStartString,self.getPlotTitle(plot))
00562     self.report.addSectionImage(sectionID,itemString,pngFile)
00563     self.report.addSectionItem(sectionID,'Plot Type',self.getPlotType(plot))
00564     self.report.addSectionItem(sectionID,'Plot Axes',axisLabelString)
00565     if self.ntRequests[self.getPlotNtuple(plot)]>0:
00566       ntEntries = self.lci.ntDict[self.getPlotNtuple(plot)].rows()
00567       bufferSize = self.ntRequests[self.getPlotNtuple(plot)]
00568       if ntEntries < bufferSize:
00569         eventItemString = '%s (Ring Buffer has %d of %d rows filled)'\
00570                           %(str(self.lci.nEvtSeen),ntEntries,bufferSize)
00571       else:
00572         eventItemString = '%s (Ring Buffer of %d is full)'\
00573                           %(str(self.lci.nEvtSeen),bufferSize)
00574     else:
00575       eventItemString = str(self.lci.nEvtSeen)
00576     self.report.addSectionItem(sectionID,'Number of Events',eventItemString)
00577     cutList = self.getPlotCuts(plot)
00578     if len(cutList)>0:
00579       itemString = '<ul>'
00580       for (variable,low,high) in cutList:
00581         itemString+='<li>%s between %f and %f</li>'%(self.lci.getColumnDescription(self.getPlotNtuple(plot),variable),low,high)
00582       itemString += '</ul>'
00583       self.report.addSectionItem(sectionID,'Cuts Applied',itemString)
00584
00585   def listFailed(self,names,failList,plot,limitDesc,sectionID):
00586     xName = names[0]
00587     yName = names[1]
00588     zName = names[2]
00589     if (len(failList)==0): return
00590     # make this a table
00591     tableID = self.report.addSectionTable(sectionID)
00592     self.report.beginTableRow(tableID)
00593     self.report.addTableHeader(tableID,self.lci.getColumnDescription(self.getPlotNtuple(plot),xName))
00594     if yName is not None:
00595       self.report.addTableHeader(tableID,self.lci.getColumnDescription(self.getPlotNtuple(plot),yName))
00596     if zName == 'Error':
00597       self.report.addTableHeader(tableID,limitDesc+' sigma')
00598     else:
00599       self.report.addTableHeader(tableID,limitDesc)
00600     for binIndex in range(len(failList)):
00601       self.report.beginTableRow(tableID)
00602       entry = failList[binIndex]
00603       if xName == 'chanindex':
00604         self.report.addTableData('%s (Channel %d)'%(self.lci.getChanIndexDescription(self.getPlotNtuple(plot),entry[0]),entry[0]))
00605       else:
00606         self.report.addTableData('%0.1f'%(entry[0]))
00607       if yName is not None:
00608         if yName == 'chanindex':
00609           self.report.addTableData('%s (Channel %d)'%(self.lci.getChanIndexDescription(self.getPlotNtuple(plot),entry[1]),entry[1]))
00610         else:
00611           self.report.addTableData('%0.1f'%(entry[1]))
00612       # value compared depends on if its per event or not
00613       limitValueString = '%f'%(entry[2])
00614       if zName == 'Density' or zName == 'Entries / bin':
00615         if self.ntRequests[self.getPlotNtuple(plot)]<=0:
00616           if self.lci.nEvtSeen>0:
00617             limitValueString = '%f'%(entry[2]/self.lci.nEvtSeen)
00618           else:
00619             limitValueString = '0.0'
00620       self.report.addTableData(limitValueString)
00621
00622   def capturePlot(self,plot):
00623     plotFileName = plot+"_"+self.dataType+ "_" + self.getRunId() + ".png"
00624     plotFileFull = os.path.join(self.reportPath,plotFileName)
00625     self.canvas.saveAsImage(self.histDict[plot], plotFileFull)
00626     self.addExportedFile(plotFileFull, delete=True)
00627     return plotFileName
00628
00629   def startReport(self):
00630     self.report = standardTestReport()
00631     self.summarySection = None
00632     self.firstBodySection = None
00633     self.reportedPlots = []
00634
00635   def writeReport(self, reportFileName):
00636     # write out plots and report on noticed anomalies
00637     if self.gui is not None:
00638       testInfoSection = self.report.writeTestInformation(Operator = self.gui.preferences()["operator"],
00639                                                          Site     = self.gui.preferences()["lastsite"],
00640                                                          TestName = self.getName(),
00641                                                          runId    = self.getRunId(),
00642                                                          Device   = self.gui.preferences()["lastinstrumenttype"],
00643                                                          Phase    = self.gui.preferences()["lastphase"],
00644                                                          Status   = self.getCompletionStatusStr() )
00645     else:
00646       testInfoSection = self.report.writeTestInformation(TestName = self.getName(),
00647                                                          runId    = self.getRunId(),
00648                                                          Status   = self.getCompletionStatusStr() )
00649     if self.firstBodySection is not None:
00650       self.report.insertSection(testInfoSection,self.firstBodySection)
00651       if self.summarySection is not None:
00652         self.report.insertSection(self.summarySection,self.firstBodySection)
00653     else:
00654       self.report.insertSection(testInfoSection)
00655       if self.summarySection is not None:
00656         self.report.insertSection(self.summarySection)
00657     import os
00658     self.report.closeTestReport(reportFileName)
00659     self.addExportedFile(reportFileName,delete = True)
00660
00661   def reportPlots(self):
00662     if len(self.reportedPlots)>0:
00663       sectionString = 'Additional %s Data Plots'%(self.dataType)
00664     else:
00665       sectionString = '%s Data Plots'%(self.dataType)
00666     sectionID = self.report.addSection(sectionString)
00667     if self.firstBodySection is None:
00668       self.firstBodySection = sectionID
00669     for plot in self.histDict:
00670       if not (plot,self.dataType) in self.reportedPlots:
00671         itemStartString = 'Plot:'
00672         self.reportPlotItem(sectionID,plot,itemStartString)
00673
00674 class standardTestReport(rcTestReport):
00675   """
00676   This class provide a standard Test Report HTML file
00677   for plotter results.
00678   """
00679   def __init__(self):
00680     "Init the TestReport and Write Heading"
00681     rcTestReport.__init__(self)
00682     rcTestReport.initReport(self,title='Plotter Report')
00683     rcTestReport.addHTML(self,"""
00684     <STYLE TYPE="text/css">
00685     H1 { font-size: x-large; color: blue }
00686     H2 { font-size: large; color: blue }
00687     H3 { font-size: medium; color: blue }
00688     </STYLE>
00689     """)
00690     rcTestReport.addHeading(self,'GLAST LAT Integration and Test')
00691     rcTestReport.addHeading(self,'Test Report')
00692
00693   def writeTestInformation(self, runId, TestName=None, Operator=None, Site=None, Device=None, Phase=None, Status=None):
00694     """Write standard information about test routine.
00695
00696       \param
00697          Operator  : name of the operator who perform the test
00698       \param
00699          Site      : test site
00700       \param
00701          TestName  : test name
00702       \param
00703          runID     : run ID given by RunControl
00704       \param
00705          Device    : device under test (i.e. MCM, tray, stack, tower)
00706     """
00707     infoPage = rcTestReport.addSection(self, 'Test identification',insert=0)
00708     rcTestReport.addSectionItem(self, infoPage, 'Date', time.asctime() )
00709     rcTestReport.addSectionItem(self, infoPage, 'Run ID', runId)
00710     rcTestReport.addSectionItem(self, infoPage, 'Application', TestName )
00711     if Site is not None:
00712       rcTestReport.addSectionItem(self, infoPage, 'Site', Site, )
00713     if Operator is not None:
00714       rcTestReport.addSectionItem(self, infoPage, 'Operator', Operator, )
00715     if Device is not None:
00716       rcTestReport.addSectionItem(self, infoPage, 'Instrument Type', Device )
00717     if Phase is not None:
00718       rcTestReport.addSectionItem(self, infoPage, 'Phase', Phase )
00719     if Status is not None:
00720       rcTestReport.addSectionItem(self, infoPage, 'Status', self.statusString(Status) )
00721     return infoPage
00722
00723   def statusString(self, status):
00724     """Write test status (Passed/Failed or Aborted) in the report
00725       \param
00726          status  : Test status ('Passed', 'Failed' or 'Aborted' if script is stopped before end).
00727     """
00728     if status.upper() == 'PASSED':
00729       string = self.getColorText('Passed', 'green', Bold=True)
00730     elif status.upper() == 'PASSED_CONDITIONALLY':
00731       string = self.getColorText('Passed Conditionally', 'yellow', Bold=True)
00732     elif status.upper() == 'FAILED':
00733       string = self.getColorText('Failed', 'red', Bold=True)
00734     elif status.upper() == 'ABORTED':
00735       string = self.getColorText('Aborted', 'yellow', Bold=True)
00736     elif status.upper() == 'UNDEFINED':
00737       string = self.getColorText('Undefined', 'yellow', Bold=True)
00738     elif status.upper() == 'INSUFFICIENT':
00739       string = self.getColorText('Insufficient Data', 'yellow', Bold=True)
00740     else:
00741       myLog.warn("%s is an invalid status in statusString" % (status))
00742       return
00743     return string
00744
00745   def getColorText(self, Text, Color='black', Bold=False):
00746     ColorTable = { 'red'   : '#FF0000',
00747                    'green' : '#33CC33',
00748                    'yellow': '#FFAA33',
00749                    'black' : '#000000'
00750                   }
00751     if ColorTable.has_key(Color):
00752       Color = ColorTable[Color]
00753     string = '<font color ="' + Color + '">' + Text + '</font>'
00754     if Bold:
00755       string = '<b>' + string + '</b>'
00756     return string
00757
00758   def closeTestReport(self, FileName):
00759     "Close the HTML file and save it"
00760     rcTestReport.transformToFile(self, os.environ.get('ONLINE_ROOT') + "/LATTE/consumer/reportStyle.xsl", FileName)
00761
00762
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: standardPlotterGuiImpl.py Source File

consumer

standardPlotterGuiImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Standard Plotter Gui Implementation"
00012 __author__   = "Lester Miller <lmiller@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "07/13/04"
00014 __version__  = "$Revision: 1.2 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018 from LATTE.consumer.standardPlotterGui import standardPlotterGui
00019 from qt import *
00020 import os
00021
00022 class standardPlotterGuiImpl(standardPlotterGui):
00023
00024   def __init__(self,parent = None,name = None,modal = 0,fl = 0):
00025     standardPlotterGui.__init__(self,parent,name,modal,fl)
00026
00027     self.lat = None
00028     self.params = None
00029     self.connect(self.buttonOk,SIGNAL("clicked()"),self.OKButtonClicked)
00030     self.connect(self.buttonCancel,SIGNAL("clicked()"),self.CancelButtonClicked)
00031     self.connect(self.buttonBrowse,SIGNAL("clicked()"),self.configFileBrowser)
00032
00033   def OKButtonClicked(self):
00034     self.fileName = self.cfgFile.text().latin1()
00035     self.close()
00036
00037   def getConfigFile(self,fileName):
00038     if fileName is not None:
00039       self.cfgFile.setText(QString(fileName))
00040     self.fileName = fileName
00041     self.show()
00042     self.exec_loop()
00043     return self.fileName
00044
00045   def CancelButtonClicked(self):
00046     self.fileName = None
00047     self.close()
00048
00049   def configFileBrowser(self):
00050     try:
00051       (filepath,filename) = os.path.split(self.fileName)
00052     except:
00053       filepath = os.getcwd()
00054       filename = ''
00055     fnPath = QString(filepath)
00056     fn = QFileDialog.getOpenFileName(fnPath, '*.cfg', self,"Configuration File Browser", "Choose configuration file")
00057     if fn.isEmpty():
00058       return
00059     filename = str(fn)
00060     self.cfgFile.setText(QString(filename))
00061
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: startupGUI.py Source File

start

startupGUI.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Online main program"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "11/12/2002"
00014 __version__  = "$Revision: 1.1 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import sys, threading
00020 from qt import *
00021 from sihippo import *
00022
00023 from LATTE.runcontrol.RunControlCommon import RunControlCommon
00024 from LATTE.runcontrol.RunControl       import RunControl
00025
00026 def startup():
00027   # Start up run control
00028
00029   rcCommon = RunControlCommon()
00030
00031   app    = QApplication(sys.argv)
00032   QObject.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
00033
00034   rcCommon.initialize()
00035   rcCommon.EBFdistribution()
00036
00037   runCtl = RunControl(rcCommon)
00038   runCtl.connectClicked()
00039   app.setMainWidget(runCtl)
00040   runCtl.show()
00041
00042   WindowController.instance().createInspector()
00043   canvas = CanvasWindow()
00044   canvas.show()
00045   ntc = NTupleController.instance()
00046   nt  = ntc.createNTuple()
00047   nt.setLabels(['Event Size'])
00048   nt.setTitle('Event Size')
00049   nt.setIntervalCount ( 1000000 )
00050   nt.setIntervalEnabled(1)
00051
00052   DBN = rcCommon.getDBN()
00053   DBN['_canvas']          = canvas
00054   DBN['_event_size']      = 0
00055   DBN['_EventSizeNTuple'] = nt
00056   DBN['_prefs']           = rcCommon.prefMan().preferences()
00057
00058   threading.currentThread().setName("LATTE_GUI")
00059   app.exec_loop()
00060
00061
00062 if __name__ == '__main__':
00063   startup()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: startupMainGUI.py Source File

start

startupMainGUI.py

00001 ## \mainpage LatTE Documentation
00002 ## \image html "glast_galaxie.gif"
00003 ##
00004
00005 #!/usr/local/bin/python
00006 #
00007 #                               Copyright 2004
00008 #                                     by
00009 #                        The Board of Trustees of the
00010 #                     Leland Stanford Junior University.
00011 #                            All rights reserved.
00012 #
00013
00014
00015 __facility__ = "Online"
00016 __abstract__ = "Main GUI startup code"
00017 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00018 __date__     = ("$Date: 2006/04/12 01:01:09 $").split(' ')[1]
00019 __version__  = "$Revision: 2.15 $"
00020 __release__  = "$Name: R04-12-00 $"
00021 __credits__  = "SLAC"
00022
00023
00024 import LATTE.copyright_SLAC
00025
00026 import os, threading
00027 from qt import *
00028 from sihippo import CanvasWindow, NTupleController, WindowController
00029 import logging as log
00030
00031 from LATTE.runcontrol.RunControlCommon import RunControlCommon
00032 from LATTE.runcontrol.RunControlMain   import RunControlMain
00033
00034 def startupMainGui():
00035   """Start up run control."""
00036
00037   #Declare DBN as global so that we can access it from the Python Shell
00038   global DBN
00039
00040   rcCommon = RunControlCommon()
00041
00042   app = rcCommon.getQtApp()
00043   QObject.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
00044
00045   rcCommon.initialize(startup=True)
00046   #rcCommon.startLogger()
00047   rcCommon.EBFdistribution()
00048
00049   initstyle(rcCommon)
00050   runCtl = RunControlMain(rcCommon)
00051
00052   if rcCommon.options().schema is not None:
00053     try:
00054       rcCommon.readSchema(os.path.abspath(rcCommon.options().schema))
00055     except Exception, e:
00056       log.exception("Exception in readSchema:")
00057       raise e
00058
00059   runCtl.connectClicked()
00060   app.setMainWidget(runCtl)
00061   runCtl.show()
00062
00063   if rcCommon.options().securedir is not None:
00064     login = runCtl.login()
00065     if login == None or login == -2:
00066       app.quit()
00067       return
00068   else:
00069     runCtl.fileLogoutAction.setEnabled(0)
00070
00071   if rcCommon.options().schema is None:
00072     try:
00073       runCtl.loadSchema()
00074     except Exception, e:
00075       log.exception("Exception in readSchema:")
00076   else:
00077     runCtl.panels()['Global'].checkFabricEnable(rcCommon.getLAT().existsGEM())
00078
00079   WindowController.instance().createInspector()
00080   canvas = CanvasWindow()
00081   ntc = NTupleController.instance()
00082   nt  = ntc.createNTuple()
00083   nt.setLabels(['Event Size'])
00084   nt.setTitle('Event Size')
00085   nt.setIntervalCount(1000000)
00086   nt.setIntervalEnabled(1)
00087
00088   DBN = rcCommon.getDBN()
00089   DBN['_canvas'] = canvas
00090   DBN['_event_size'] = 0
00091   DBN['_EventSizeNTuple'] = nt
00092   DBN['_prefs'] = rcCommon.prefMan().preferences()
00093
00094   threading.currentThread().setName("LATTE_GUI")
00095   app.exec_loop()
00096
00097 def initstyle(rcCommon):
00098   prefs = rcCommon.prefMan().preferences()
00099   if prefs.has_key('style'):
00100     style = prefs['style']
00101     if style in QStyleFactory.keys():
00102       qApp.setStyle(QStyleFactory.create(style))
00103   font = QApplication.font()
00104   if prefs.has_key('fontfamily'):
00105     font.setFamily(prefs['fontfamily'])
00106   if prefs.has_key('fontsize'):
00107     font.setPointSize(int(prefs['fontsize']))
00108   if prefs.has_key('fontweight'):
00109     font.setWeight(int(prefs['fontweight']))
00110   if prefs.has_key('fontitalic'):
00111     font.setItalic(int(prefs['fontitalic']))
00112   qApp.setFont(font)
00113
00114 if __name__ == '__main__':
00115   # For profiling, uncomment the two lines below
00116   # and comment out the line after them.
00117   # After running, use the following code to
00118   # analyze the profiling data:
00119   #   import pstats
00120   #   p = pstats.Stats('profile')
00121   #   p.strip_dirs().sort_stats(-1).print_stats()
00122
00123   #import profile
00124   #profile.run('startupMainGui()', 'profile')
00125   startupMainGui()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: suiteRunner.py Source File

suiteRunner.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Suite Runner Script"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "11/21/2002"
00014 __version__  = "$Revision: 1.2 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 from   LATTE.runcontrol.rcSuite import rcSuite
00020
00021 # Standalone mode:
00022 if __name__ == "__main__":
00023   usl = rcSuite.StandaloneLauncher(logLevel="INFO")
00024   usl.launch(suiteClass=None, user=321, callbacks=None)
00025
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: sweepRejectTest.py Source File

sweepRejectTest.py

00001 #!/usr/local/bin/python
00002 #
00003 #  sweepRejectTest.py
00004 #      Test code to test what happens when sweeps never appear in RC.
00005 #      Sweeps are disabled by reimplementing the shut() method.
00006 #      DO NOT use this code as a basis for any user code.  --Jim
00007 #
00008 #
00009 #
00010 #                               Copyright 2004
00011 #                                     by
00012 #                        The Board of Trustees of the
00013 #                     Leland Stanford Junior University.
00014 #                            All rights reserved.
00015 #
00016
00017
00018
00019
00020 __facility__ = "Online"
00021 __abstract__ = "Application to test Bad or Timed out SWEEP events."
00022 __author__   = "J. Panetta <panetta@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00023 __date__     = ("$Date: 2005/03/21 17:58:11 $").split(' ')[1]
00024 __version__  = "$Revision: 1.2 $"
00025 __release__  = "$Name: R04-12-00 $"
00026 __credits__  = "SLAC"
00027
00028 import LATTE.copyright_SLAC
00029
00030 import            threading
00031 import logging as log
00032 import            time
00033
00034 from   LATTE.runcontrol.rcTransitions  import rcTransitions
00035 from   LATTE.runcontrol.ArgumentImpl   import ArgumentImpl
00036
00037 from support.SimpleGasuExample   import *
00038 from support.MiniGLTExample      import *
00039
00040
00041 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00042 #  the userApplication example to get the number of self triggers to take.
00043 class userArgument(ArgumentImpl):
00044   "GUI for getting the user to input some sort of value."
00045   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00046     ArgumentImpl.__init__(self, parent, name, modal, fl)
00047     self.__value = 0
00048     self.setCaption("Hello world!")
00049
00050   def OKButtonClicked(self):
00051     self.__value = int(self.ArgumentList.text().latin1())
00052     self.close()
00053
00054   def CancelButtonClicked(self):
00055     self.__value = None
00056     self.close()
00057
00058   def getValue(self, caption):
00059     self.setCaption(caption)
00060     self.show()
00061     self.exec_loop()
00062     return self.__value
00063
00064 class userArgText(object):
00065   "Text user interface for getting the user to input some sort of value"
00066   def __init__(self):
00067     pass
00068
00069   def getValue(self, caption):
00070     return int(raw_input("%s: " % (caption)))
00071
00072
00073 #  Example application implementation.
00074 #  Note that the name of the class must be userApplication.
00075 #  Look at rcTransitions for names of other transition methods that can be used.
00076 class userApplication(rcTransitions):
00077   "Implmentation class for a user application"
00078   def __init__(self, rc, userId, debug):
00079     rcTransitions.__init__(self, rc, userId, debug)
00080     log.debug("userApplication.__init__()")
00081     self.__eventSem    = threading.Semaphore(0)
00082     self.__cmdSynchSem = threading.Semaphore(0)
00083
00084   def getName(self):
00085     return __name__
00086
00087   def setup(self):
00088     log.debug("userApplication.setup()")
00089
00090     if self.rc is None:
00091       self.__arg = userArgText()
00092     else:
00093       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00094
00095     # Get a TEM instance
00096     if self.lat.TEMcnt() == 1:
00097       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00098     elif self.lat.TEMcnt() > 1:
00099       tem = self.lat.TEM.all()
00100     else:
00101       log.fatal("No TEM(s) found in the schema")
00102       return -1
00103
00104     # clear TEM stats reg
00105     tem.COMMAND_RESPONSE = 0
00106
00107     # clear TEM status reg
00108     tem.STATUS = 0
00109
00110     # enable output in our GCCCs
00111     # broadcast load of GCCC_REG_CONFIGURATION
00112
00113     bcast_ccc = tem.allCCC()
00114     bcast_ccc.CONFIGURATION = 0x80000000L
00115
00116     #  disable all GCRCs in all GCCCs via broadcast # GCCC_REG_LAYER_MASK_0, GCCC_REG_LAYER_MASK_1
00117     bcast_ccc.LAYER_MASK_0 = 0xFFFFFFFFL
00118     bcast_ccc.LAYER_MASK_1 = 0xFFFFFFFFL
00119     ccc0 = tem.downCCC(0) # O$GCCC_00
00120     ccc0.LAYER_MASK_0 = 0xFFFF0000L
00121     ccc0.LAYER_MASK_1 = 0xFFFF000FL
00122     ccc2 = tem.downCCC(2) # O$GCCC_02
00123     ccc2.LAYER_MASK_0 = 0xFFFF0000L
00124     ccc2.LAYER_MASK_1 = 0xFFFF0000L
00125
00126     # large timeouts for all GCCCs
00127     # broadcast load of GCCC_REG_EVENT_TIMEOUTS
00128     bcast_ccc.EVENT_TIMEOUTS = 0x0
00129
00130     # Two choices for the trigger, GEM and MiniGLT
00131     if self.lat.existsGEM():
00132       self.trigger( BadGasuExample() )
00133     else:
00134       self.trigger( BadGLTExample() )
00135
00136     # A state transition can be rejected by not returning None
00137     return None
00138
00139   def startRun(self):
00140     log.debug("userApplication.startRun()")
00141
00142     caption = "Enter number of triggers to take"
00143     if self.rc is None:
00144       cnt = self.__arg.getValue(caption)
00145     else:
00146       cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00147
00148     # The user pressed 'Cancel'
00149     if cnt is None:  return -1
00150     self.__cnt = cnt
00151
00152     if self.rc is not None:
00153       self.getParameterVerifier().add(caption, cnt)
00154
00155     # Spawn a thread to synchronize commands with events
00156     self.__cmdSynchQuit = False
00157
00158     # A state transition can be rejected by not returning None
00159     return None
00160
00161   def stopRun(self):
00162     log.debug("userApplication.stopRun()")
00163
00164     if self.getBadEvents() == 0 and self.getErrorEvents() == 0:
00165       self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00166     else:
00167       self.setCompletionStatus(self.COMPL_STATUS_FAILED)
00168
00169     self.__cmdSynchQuit = True
00170     self.__eventSem.release()
00171
00172     # The STOP_RUN transition can not be rejected
00173
00174   def resume(self):
00175     log.debug("userApplication.resume()")
00176
00177     # Issue self trigger to make up for the one that was lost during PAUSE
00178     self.trigger().solicit()
00179
00180     return None
00181
00182   def stop(self):
00183     log.debug("userApplication.stop()")
00184
00185     return self.stopRun()
00186
00187   def teardown(self):
00188     log.debug("userApplication.teardown()")
00189     # Allow the C++ object to be deleted
00190     if self.rc is not None and self.__arg is not None:
00191       self.__arg.deleteLater()
00192
00193   def process(self, (status, buffer)):
00194     "Method called back for each data event taken"
00195     #log.debug("userApplication.process()")
00196
00197     evtCli = self.evtCli
00198
00199     if status != 0:
00200       if evtCli.isGGLTStatus():
00201         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00202       elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00203         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00204       self.__eventSem.release()
00205       return
00206     try:
00207       # In the future this event may contain additional data
00208       if evtCli.isSweepEvent(): return
00209     except:
00210       # Event summary word inaccessible, handle the bad event here
00211       log.exception("")
00212       return
00213
00214
00215     # Get next event triggered
00216     self.__eventSem.release()
00217
00218
00219   def commandSynch(self):
00220     "Method called by the command synchronization task"
00221     import time
00222     trigger  = self.trigger()
00223     eventSem = self.__eventSem
00224
00225     # Drain the semaphore release count
00226     # Handles the case when the stop run release collided with a trigger release
00227     while eventSem.acquire(0):  pass
00228
00229     t0  = time.time()
00230
00231     # Compensate for the extra CMD_SELF_TRIGGER below
00232     cnt   = 1
00233     count = self.__cnt
00234
00235     # Wait for START_RUN to enable triggers
00236     trigger.waitForMaskEnable()
00237
00238     trigger.solicit()                   # Issue an internal trigger
00239     eventSem.acquire()                  # Wait for the event to be processed
00240
00241     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00242     while cnt < count and not self.__cmdSynchQuit:
00243       cnt += 1
00244       trigger.solicit()                 # Issue an internal trigger
00245       time.sleep(.0001)
00246       eventSem.acquire()                # Wait for the event to be processed
00247
00248     t2 = trigger.getTimeStamp()                 # Get the last trigger timestamp
00249
00250     if t1 is None:
00251       t1 = t0
00252     if t2 is None:
00253       t2 = time.time()
00254     dT = t2 - t1
00255     if dT == 0.0:  dT = 0.000001
00256     log.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00257              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00258
00259     # Get out of waiting when in suite or standalone mode
00260     self.sync()
00261
00262     # execute the GUI functions for stopRun, just in case
00263     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00264       if self.rc is not None:
00265         self.rc.doStop()
00266
00267   def wait(self):
00268     self.__cmdSynchSem.acquire()
00269
00270   def sync(self):
00271     if __name__ == "__main__" or self.isRunFromSuite():
00272       self.__cmdSynchSem.release()
00273
00274 from LATTE.trigger.rcTrgGem     import *
00275 from LATTE.trigger.rcTrgMiniGLT import *
00276 class BadGasuExample(SimpleGasuExample):
00277   """\brief BadGasuExample
00278   """
00279   def __init__(self):
00280     """\brief BadGasuExample constructor
00281     """
00282     SimpleGasuExample.__init__(self)
00283   def shut(self, sweepEvent, progress = None):
00284     """Re-implementation of the shut function to NEVER send a sweep
00285
00286     NEVER EVER EVER use this code in a real trigger system.  --Jim Panetta
00287     This code is only to test a particular bug in sweep timeouts.
00288     """
00289
00290     gemw = self.GEM().GEMW
00291     gemsc = self.GEM().GEMSC
00292
00293     #0) determine whether we are enabled or not
00294     if gemw.WINDOW_OPEN_MASK != 0:
00295       enabled = True
00296     else:
00297       enabled = False
00298
00299     #1) disable triggers
00300     goodSolicit  = self.solicit
00301     # self.solicit = self.__falseSolicit
00302     self.disable()
00303     sweepEvent.clear()
00304
00305     #2) Replace contents of all schedulers with solicited with (Engine) f
00306     #   Doing it by hand
00307     oldSched = [ gemsc.CONDITIONS_40_47,
00308                  gemsc.CONDITIONS_48_4F,
00309                  gemsc.CONDITIONS_50_57,
00310                  gemsc.CONDITIONS_58_5F,
00311                  gemsc.CONDITIONS_60_67,
00312                  gemsc.CONDITIONS_68_6F,
00313                  gemsc.CONDITIONS_70_77,
00314                  gemsc.CONDITIONS_78_7F ]
00315     scheduler = ( 0xffffffffL )               # Everything's f!
00316     gemsc.CONDITIONS_40_47 = scheduler
00317     gemsc.CONDITIONS_48_4F = scheduler
00318     gemsc.CONDITIONS_50_57 = scheduler
00319     gemsc.CONDITIONS_58_5F = scheduler
00320     gemsc.CONDITIONS_60_67 = scheduler
00321     gemsc.CONDITIONS_68_6F = scheduler
00322     gemsc.CONDITIONS_70_77 = scheduler
00323     gemsc.CONDITIONS_78_7F = scheduler
00324
00325     #2.5) Wait until we don't have progress
00326     if progress is not None:
00327       while True:
00328         if progress() == 0:
00329           break
00330         time.sleep(.5)
00331         # print "waiting for progress"
00332
00333     #3) Change conditions to be solicit only, solicit a trigger
00334     gemw.WINDOW_OPEN_MASK = TrgGem._TrgGem__SOLICIT_MASK
00335     # self.GEM().downGEMC().CMD_TRIGGER = 1
00336
00337     #4) Block until the sweep is detected by rcTransitions then disable triggers
00338     tmo = self._rcTrgGem__SWEEP_TMO
00339     while (tmo > 0.0):
00340       if sweepEvent.isSet():  break
00341       sweepEvent.wait(0.50)
00342       if progress is not None:
00343         if progress() != 0:
00344           tmo = self._rcTrgGem__SWEEP_TMO
00345           continue
00346       tmo -= 0.50
00347     if tmo <= 0:
00348       sweepEvent.set()
00349       logging.fatal("Trigger sweep timed out before all events were drained")
00350       return False
00351
00352     self.disable()
00353
00354     #5) Put the original contents of schedulers back
00355     gemsc.CONDITIONS_40_47 = oldSched[0]
00356     gemsc.CONDITIONS_48_4F = oldSched[1]
00357     gemsc.CONDITIONS_50_57 = oldSched[2]
00358     gemsc.CONDITIONS_58_5F = oldSched[3]
00359     gemsc.CONDITIONS_60_67 = oldSched[4]
00360     gemsc.CONDITIONS_68_6F = oldSched[5]
00361     gemsc.CONDITIONS_70_77 = oldSched[6]
00362     gemsc.CONDITIONS_78_7F = oldSched[7]
00363
00364     #6) Put the trigger conditions back.
00365     if enabled:
00366       self.enable()
00367     self.solicit = goodSolicit
00368
00369     return True
00370
00371
00372 class BadGLTExample(MiniGLTExample):
00373   """\brief MiniTower example interface to MiniGLT
00374   """
00375   def __init__(self):
00376     """\brief AcdTriggerExample constructor
00377     """
00378     MiniGLTExample.__init__(self)
00379   def shut(self, sweepEvent, progress = None):
00380     """Re-implementation of the shut function to NEVER send a sweep
00381
00382     NEVER EVER EVER use this code in a real trigger system.  --Jim Panetta
00383     This code is only to test a particular bug in sweep timeouts.
00384     """
00385
00386     glt = self.GLT()
00387
00388     #0) disable triggers
00389     if not glt.triggersDisabled():
00390       enabled = True
00391     else:
00392       enabled = False
00393     goodSolicit  = self.solicit
00394     # self.solicit = self.__falseSolicit
00395
00396     self.disable()
00397     sweepEvent.clear()
00398
00399     #1) Set up marker logic
00400     mask           = glt.MASK           # Cache Mask, CalStrobe and Tack
00401     calStrobe      = glt.CAL_STROBE
00402     tack           = glt.TACK
00403     zeroSuppress   = glt.ZERO_SUPPRESS
00404     fourRange      = glt.FOUR_RANGE_READOUT
00405     marker         = glt.MARKER
00406
00407     glt.MASK       = TrgMiniGLT._TrgMiniGLT__SOLICIT_MASK # Enable internal trigger only
00408     glt.MARKER     = rcTrgMiniGLT._rcTrgMiniGLT__SWEEP_MARKER          # Signal that we're sweeping
00409     glt.CAL_STROBE = 0                  # Don't inject charge
00410     glt.TACK       = 1                  # Force a readout
00411     glt.ZERO_SUPPRESS       = 1         # Yes to zero suppression
00412     glt.FOUR_RANGE_READOUT  = 0         # No to four range readout
00413
00414     #2) enable and solicit
00415     glt.enableMask()
00416     self.waitForMaskEnable()
00417     # self.GLT().CMD_SELF_TRIGGER = 1     # Solicit a trigger
00418
00419     #3) Block until the sweep is detected by rcTransitions then disable triggers
00420     tmo = self._rcTrgMiniGLT__SWEEP_TMO
00421     while (tmo > 0.0):
00422       if sweepEvent.isSet():  break
00423       sweepEvent.wait(0.5)
00424       if progress is not None:
00425         if progress() != 0:
00426           tmo = self._rcTrgMiniGLT__SWEEP_TMO
00427           continue
00428       tmo -= 0.5
00429     if tmo <= 0:
00430       sweepEvent.set()
00431       logging.fatal("Trigger sweep timed out before all events were drained")
00432       return False
00433     self.disable()
00434
00435     #4) Put the original contents of scheduler 0x40 back, and put the TAM back
00436     glt.CAL_STROBE         = calStrobe
00437     glt.TACK               = tack
00438     glt.MARKER             = marker
00439     glt.ZERO_SUPPRESS      = zeroSuppress
00440     glt.FOUR_RANGE_READOUT = fourRange
00441     glt.MASK               = mask
00442
00443     #5) Put the trigger conditions back
00444     if enabled:
00445       glt.enableMask()
00446     self.solicit = goodSolicit
00447
00448     return True
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: taskEngine.py Source File

tools

taskEngine.py

00001 #!/usr/bin/env python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Task Engine class"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "1/21/2004"
00014 __version__  = "$Revision: 2.2 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 from   Queue         import Queue
00020 from   threading     import Thread, currentThread
00021 import logging       as     log
00022
00023
00024 class TaskEngine(Thread):
00025   """A class for setting up and queueing tasks to a task engine.
00026
00027   A task engine is a thread that polls a task queue and runs tasks found on
00028   the queue.  Tasks are functions or class methods accompanied with their
00029   arguments and keyword arguments.  Each task must run to completion before
00030   the next task is pulled from the queue.  Returning a return value from the
00031   task to the caller is currently not supported (easy to add, if the need
00032   arises).  The queue is a FIFO queue and there is currently no way to jam
00033   a task to the head of the queue.
00034   """
00035   def __init__(self, name = None):
00036     Thread.__init__(self)
00037
00038     if name is None:
00039       name = self.__class__.__name__
00040     self.__name  = name
00041     self.__queue = Queue()
00042
00043   def name(self):
00044     """\brief Method for querying the task engine's name
00045
00046     \return The task engine's name
00047     """
00048     return self.__name
00049
00050   def spawn(self, task, *args, **kwargs):
00051     """\brief Method used to queue a task to the task engine.
00052
00053     \param task    The task routine to queue
00054     \param args    The arguments for the task routine
00055     \param kwargs  The keyword arguments for the task routine
00056     """
00057     assert self.__queue is not None, (self.name + ".spawn: " + \
00058                                       "TaskEngine.__init__() was not called")
00059     self.__queue.put((task,) + args + (kwargs,))
00060
00061   def run(self):
00062     """\brief The task engine main routine.
00063
00064     This method is invoked by the Thread class and should be considered
00065     'protected'.  Do not call it.
00066     """
00067     self.setName(self.name())
00068
00069     while True:
00070       taskArgsKwargs = self.__queue.get(True) # Blocks
00071       if taskArgsKwargs[0] is None:  break    # Quit signal is None
00072
00073       try:
00074         taskArgsKwargs[0](*taskArgsKwargs[1:-1], **taskArgsKwargs[-1])
00075       except:
00076         import types
00077         if isinstance(taskArgsKwargs[0], types.MethodType):
00078           log.exception(self.name()                               + \
00079                         ": Trapped exception from spawned task "  + \
00080                         taskArgsKwargs[0].im_class.__name__ + '.' + \
00081                         taskArgsKwargs[0].__name__ + '()')
00082         else:
00083           log.exception(self.name()                               + \
00084                         ": Trapped exception from spawned task "  + \
00085                         taskArgsKwargs[0].__name__ + '()')
00086
00087       # Drop references to this object to allow it to be garbage collected
00088       taskArgsKwargs = None
00089
00090     log.info(self.name() + ": terminating")
00091
00092   def shutdown(self, tmo = 2.0):
00093     """\brief Method for shutting down the task engine
00094
00095     This method blocks (with a timeout) until the task engine has exited.
00096     It makes no sense to spawn this method to the task engine since it waits
00097     for the task engine to exit.
00098
00099     \param tmo  The amount of time (seconds) to wait for the task engine to exit
00100     \return  0 for success,
00101            -1 if the task engine didn't exit,
00102            -2 if the task engine exited prematurely
00103     """
00104     # This method can not be called from the taskEngine thread on purpose.
00105     # If it could, there would be no way for the instigator to synchronize.
00106     if currentThread() is self:
00107       raise RuntimeError, "A task engine can't be shut down by its own thread"
00108     if self.isAlive():                  # Thread still there or did it crash?
00109       self.spawn(None)                  # Signal to quit
00110       self.join(tmo)                    # Let engine exit
00111       if self.isAlive():                # Timed out?
00112         log.error(self.name() + ".shutdown: " + \
00113                   "Task engine did not exit when expected")
00114         return -1
00115     else:
00116       log.warn(self.name() + ":.shutdown: " + \
00117                "Task engine unexpectedly disappeared")
00118       return -2
00119
00120     return 0
00121
00122
00123 #-------------------------------------------------------------------------------
00124 # Unit testing follows:
00125
00126 if __debug__ and __name__ == '__main__':
00127   import unittest
00128   import time
00129
00130   results = [None, None, None, None, None, None]
00131   status  = None
00132
00133   class TaskEngineTestCase(unittest.TestCase):
00134     def __init__(self, arg):
00135       unittest.TestCase.__init__(self, arg)
00136
00137     def checkInstantiation(self):
00138       """Test class instantiation"""
00139       engine = None
00140       engine = TaskEngine("TestEngine")
00141       assert engine != None, "Could not instantiate a TaskEngine"
00142
00143     def checkStartup(self):
00144       """Test whether the thread starts up"""
00145       engine = TaskEngine("TestEngine")
00146       engine.start()
00147       time.sleep(0.1)                   # Let it start
00148       assert engine.isAlive(), "Could not start TaskEngine"
00149       engine.shutdown()
00150       time.sleep(.1)
00151
00152     def __task_1(self, a, b, c, x, y, z):
00153       self.__a = a
00154       self.__b = b
00155       self.__c = c
00156       self.__x = x
00157       self.__y = y
00158       self.__z = z
00159
00160     def checkSpawn(self):
00161       """
00162       Test whether we can spawn a class method task to the engine and
00163       have the arguments handled correctly
00164       """
00165       self.__a = None
00166       self.__b = None
00167       self.__c = None
00168       self.__x = None
00169       self.__y = None
00170       self.__z = None
00171
00172       a = "Hello world"
00173       b = 3.1415926
00174       c = 0xabadcafeL
00175       engine = TaskEngine("TestEngine")
00176       engine.start()
00177       time.sleep(0.1)                   # Let it start
00178       engine.spawn(self.__task_1, a, b, c, z = a, x = b, y = c)
00179       time.sleep(0.1)                   # Let it run
00180       assert engine.isAlive(), "TaskEngine prematurely disappeared"
00181       assert self.__a is a, "TaskEngine did not correctly handle args[0]"
00182       assert self.__b is b, "TaskEngine did not correctly handle args[1]"
00183       assert self.__c is c, "TaskEngine did not correctly handle args[2]"
00184       assert self.__x is b, "TaskEngine did not correctly handle kwargs[0]"
00185       assert self.__y is c, "TaskEngine did not correctly handle kwargs[1]"
00186       assert self.__z is a, "TaskEngine did not correctly handle kwargs[2]"
00187       engine.shutdown()
00188       time.sleep(.1)
00189
00190     def checkUnboundSpawn(self):
00191       """
00192       Test whether we can spawn an unbound function task to the engine and
00193       have the arguments handled correctly
00194       """
00195       a = "Test of an unbound function"
00196       b = 2.718281828
00197       c = 0xdeadbeefL
00198
00199       engine = TaskEngine("TestEngine")
00200       engine.start()
00201       time.sleep(0.1)                   # Let it start
00202       engine.spawn(_unbound1, a, b, c, y = a, z = b, x = c)
00203       time.sleep(0.1)                   # Let it run
00204       assert engine.isAlive(), "TaskEngine prematurely disappeared"
00205       assert results[0] is a, "TaskEngine did not correctly handle args[0]"
00206       assert results[1] is b, "TaskEngine did not correctly handle args[1]"
00207       assert results[2] is c, "TaskEngine did not correctly handle args[2]"
00208       assert results[3] is c, "TaskEngine did not correctly handle kwargs[0]"
00209       assert results[4] is a, "TaskEngine did not correctly handle kwargs[1]"
00210       assert results[5] is b, "TaskEngine did not correctly handle kwargs[2]"
00211       engine.shutdown()
00212       time.sleep(.1)
00213
00214     def __doException(self):  # 2nd level to give traceback some depth
00215       raise RuntimeError, "Raising RuntimeError to test exception handling"
00216       return True
00217
00218     def __task_2(self):
00219       self.__status = False
00220       self.__status = self.__doException()
00221
00222     def checkException1(self):
00223       """
00224       Test that the engine doesn't die if a class method task throws an
00225       exception
00226       """
00227       print ""
00228       print "##############################################################################"
00229       print "#                                                                            #"
00230       print "#  This test should cause a 'Trapped exception from spawned task' exception  #"
00231       print "#                                                                            #"
00232       print "##############################################################################"
00233       engine = TaskEngine("TestEngine")
00234       engine.start()
00235       time.sleep(0.1)                   # Let it start
00236       engine.spawn(self.__task_2)
00237       time.sleep(0.1)                   # Let it run
00238       assert engine.isAlive(), "TaskEngine died from exception"
00239       assert self.__status == False, "Exception didn't abort task as expected"
00240       engine.shutdown()
00241       time.sleep(.1)
00242
00243     def checkException2(self):
00244       """
00245       Test that the engine doesn't die if an unbound function task throws an
00246       exception
00247       """
00248       print ""     # Expecting an exception: add space for readability
00249       print "##############################################################################"
00250       print "#                                                                            #"
00251       print "#  This test should cause a 'Trapped exception from spawned task' exception  #"
00252       print "#                                                                            #"
00253       print "##############################################################################"
00254       engine = TaskEngine("TestEngine")
00255       engine.start()
00256       time.sleep(0.1)                   # Let it start
00257       engine.spawn(_unbound2)
00258       time.sleep(0.1)                   # Let it run
00259       assert engine.isAlive(), "TaskEngine died from exception"
00260       assert status == False, "Exception didn't abort task as expected"
00261       engine.shutdown()
00262       time.sleep(.1)
00263
00264     def checkSelfShutdown(self):
00265       """Test that attempts to shut down an engine via a task fails"""
00266       print ""     # Expecting an exception: add space for readability
00267       print "##############################################################################"
00268       print "#                                                                            #"
00269       print "#  This test should cause a 'Trapped exception from spawned task' exception  #"
00270       print "#                                                                            #"
00271       print "##############################################################################"
00272       engine = TaskEngine("TestEngine")
00273       engine.start()
00274       time.sleep(0.1)                   # Let it start
00275       engine.spawn(engine.shutdown)
00276       time.sleep(0.1)                   # Let it run
00277       assert engine.isAlive(), "TaskEngine died from exception"
00278       engine.shutdown()
00279       time.sleep(.1)
00280
00281     def checkShutdown1(self):
00282       """
00283       Test that attempting to shut down an engine from an unrelated thread
00284       succeeds
00285       """
00286       engine = TaskEngine("TestEngine")
00287       engine.start()
00288       time.sleep(0.1)                   # Let it start
00289       status = engine.shutdown()
00290       time.sleep(0.1)                   # Let it shut down
00291       assert not engine.isAlive(), "TaskEngine didn't shut down"
00292       assert status == 0, "Bad status %d returned from shutdown()" % (status)
00293
00294     def checkShutdown2(self):
00295       """Test that attempts to shut down an engine that wasn't started fails"""
00296       print ""
00297       print "#############################################################################"
00298       print "#                                                                           #"
00299       print "#  This test should cause a 'Task engine unexpectedly disappeared' warning  #"
00300       print "#                                                                           #"
00301       print "#############################################################################"
00302       engine = TaskEngine("TestEngine")
00303       status = engine.shutdown()
00304       assert status != 0, "TaskEngine didn't shut down as expected"
00305
00306   def _unbound1(a, b, c, x, y, z):
00307     results[0] = a
00308     results[1] = b
00309     results[2] = c
00310     results[3] = x
00311     results[4] = y
00312     results[5] = z
00313
00314   def _doException():
00315     raise RuntimeError, "Raising RuntimeError to test exception handling"
00316     return True
00317
00318   def _unbound2():
00319     global status
00320     status = False
00321     status = _doException()
00322
00323   def suite():
00324     loader = unittest.TestLoader()
00325     testSuite = loader.loadTestsFromNames(
00326       ["checkInstantiation", "checkStartup", "checkSpawn", "checkUnboundSpawn",
00327        "checkException1", "checkException2", "checkSelfShutdown",
00328        "checkShutdown1", "checkShutdown2"], TaskEngineTestCase)
00329     return testSuite
00330
00331   def test():
00332     print "########################################################"
00333     print "#                                                      #"
00334     print "#  Exceptions are expected from this test.  These can  #"
00335     print "#  be ignored if the test completes with status 'OK'   #"
00336     print "#                                                      #"
00337     print "########################################################"
00338     print ""
00339
00340     # Initialize logging
00341     log.basicConfig()
00342
00343     runner = unittest.TextTestRunner()
00344     runner.run(suite())
00345
00346     # Shut down the logger
00347     log.shutdown()
00348
00349   # Now run the tests
00350   test()
00351
00352
00353 #-------------------------------------------------------------------------------
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: temLrsTest.py Source File

temLrsTest.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2005
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Application to test the TEM's LRS counters"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/03/21 17:58:11 $").split(' ')[1]
00014 __version__  = "$Revision: 1.2 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import            threading
00021 import logging as log
00022 import            time
00023
00024 from   LATTE.runcontrol.rcTransitions  import rcTransitions
00025 from   LATTE.runcontrol.ArgumentImpl   import ArgumentImpl
00026 #from   rcHouseKeeping import rcHouseKeeping
00027
00028 from support.SimpleGasuExample   import *
00029 from support.MiniGLTExample      import *
00030
00031
00032 #  Example application implementation.
00033 #  Note that the name of the class must be userApplication.
00034 #  Look at rcTransitions for names of other transition methods that can be used.
00035 class userApplication(rcTransitions):
00036   "Implmentation class for a user application"
00037   def __init__(self, rc, userId, debug):
00038     rcTransitions.__init__(self, rc, userId, debug)
00039     log.debug("userApplication.__init__()")
00040
00041   def getName(self):
00042     return __name__
00043
00044   def setup(self):
00045     log.debug("userApplication.setup()")
00046
00047     # Get a TEM instance
00048     if self.lat.TEMcnt() == 1:
00049       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00050     elif self.lat.TEMcnt() > 1:
00051       #tem = self.lat.TEM.all()
00052       log.fatal("More than one TEM found in the schema")
00053       return -1
00054     else:
00055       log.fatal("No TEM found in the schema")
00056       return -1
00057
00058     # clear TEM stats reg
00059     tem.COMMAND_RESPONSE = 0
00060
00061     # clear TEM status reg
00062     tem.STATUS = 0
00063
00064     # enable output in our GCCCs
00065     # broadcast load of GCCC_REG_CONFIGURATION
00066
00067     bcast_ccc = tem.allCCC()
00068     bcast_ccc.CONFIGURATION = 0x80000000L
00069
00070     #  disable all GCRCs in all GCCCs via broadcast # GCCC_REG_LAYER_MASK_0, GCCC_REG_LAYER_MASK_1
00071     bcast_ccc.LAYER_MASK_0 = 0xFFFFFFFFL
00072     bcast_ccc.LAYER_MASK_1 = 0xFFFFFFFFL
00073     ccc0 = tem.downCCC(0) # O$GCCC_00
00074     ccc0.LAYER_MASK_0 = 0xFFFF0000L
00075     ccc0.LAYER_MASK_1 = 0xFFFF000FL
00076     ccc2 = tem.downCCC(2) # O$GCCC_02
00077     ccc2.LAYER_MASK_0 = 0xFFFF0000L
00078     ccc2.LAYER_MASK_1 = 0xFFFF0000L
00079
00080     # config GCFE for calibration -- range 0 first
00081     bcast_cfe = tem.allCCC().allCRC().allCFE()
00082     bcast_cfe.CONFIG_0    = 0x00
00083     bcast_cfe.CONFIG_1    = 0x36
00084     bcast_cfe.FLE_DAC     = 0x55
00085     bcast_cfe.FHE_DAC     = 0x55
00086     bcast_cfe.LOG_ACPT    = 0x10
00087     bcast_cfe.RNG_ULD_DAC = 0x7F
00088     bcast_cfe.REF_DAC     = 0x7f
00089
00090     # config GCRC for calibration
00091     bcast_crc = tem.allCCC().allCRC()
00092     bcast_crc.DELAY_1 = 0xFF
00093     bcast_crc.DELAY_2 = 0xFF
00094     bcast_crc.DELAY_3 = 0xFF
00095     bcast_crc.DAC = 0x42FE
00096     bcast_crc.DAC = 0x42FE
00097
00098     # large timeouts for all GCCCs
00099     # broadcast load of GCCC_REG_EVENT_TIMEOUTS
00100     bcast_ccc.EVENT_TIMEOUTS = 0x0
00101     #status = gGCCCread( __GT, temId, 1, GCCC_REG_EVENT_TIMEOUTS, &payload);
00102     #printf("gccc register event timeouts = 0x%08x\n", payload);
00103
00104     # Register environment variables for housekeeping
00105     #hsk = self.getHSK()
00106     #regs = [tem.regs['data_masks'], ccc2.regs['layer_mask_1']]
00107     #hsk.addEnvRegs(regs)
00108     #hsk.setUpdateInterval(1)
00109
00110     # Two choices for the trigger, GEM and MiniGLT
00111     if self.lat.existsGEM():
00112       self.trigger( SimpleGasuExample() )
00113     else:
00114       self.trigger( MiniGLTExample() )
00115
00116     # Override the default event handler
00117     self.selectEventHandler(rcTransitions.EVENT_HANDLER_LEAN_AND_MEAN)
00118
00119     # A state transition can be rejected by not returning None
00120     return None
00121
00122   def startRun(self):
00123     log.debug("userApplication.startRun()")
00124
00125     # Spawn a thread to synchronize commands with events
00126     self.__cmdSynchQuit = False
00127
00128     # A state transition can be rejected by not returning None
00129     return None
00130
00131   def stopRun(self):
00132     log.debug("userApplication.stopRun()")
00133
00134     if self.getBadEvents() == 0 and self.getErrorEvents() == 0:
00135       self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00136     else:
00137       self.setCompletionStatus(self.COMPL_STATUS_FAILED)
00138
00139     self.__cmdSynchQuit = True
00140
00141     # The STOP_RUN transition can not be rejected
00142
00143   def resume(self):
00144     log.debug("userApplication.resume()")
00145
00146     # Issue self trigger to make up for the one that was lost during PAUSE
00147     self.trigger().solicit()
00148
00149     return None
00150
00151   def stop(self):
00152     log.debug("userApplication.stop()")
00153
00154     return self.stopRun()
00155
00156   def teardown(self):
00157     log.debug("userApplication.teardown()")
00158
00159   def process(self, (status, latDatagram)):
00160     "Method called back for each data event taken"
00161     #log.debug("userApplication.process()")
00162
00163     pass
00164
00165
00166   def commandSynch(self):
00167     "Method called by the command synchronization task"
00168     import time
00169     trigger  = self.trigger()
00170
00171     # Wait for START_RUN to enable triggers
00172     trigger.waitForMaskEnable()
00173
00174     # Get a TEM instance
00175     if self.lat.TEMcnt() == 1:
00176       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00177     elif self.lat.TEMcnt() > 1:
00178     #  tem = self.lat.TEM.all()
00179       log.fatal("More than one TEM found in the schema")
00180       return -1
00181     else:
00182       log.fatal("No TEM found in the schema")
00183       return -1
00184
00185     lrsId = tem.TIC.regs ['sat_deadtime_lrs_ctr'].id()
00186     print "Deadtime LRS saturation counter ID =", lrsId
00187     tem.TIC.satCtrDisable(lrsId)
00188     print "Deadtime LRS saturation counters disabled"
00189
00190     tem.TIC.sat_deadtime_lrs_ctr = 0
00191     print "Deadtime LRS saturation counters cleared"
00192
00193     tem.TIC.satCtrEnable(lrsId)
00194     print "Deadtime LRS saturation counters enabled"
00195
00196     t = 0
00197     while not self.__cmdSynchQuit and t < 30:
00198       print "Deadtime LRS saturation counter = ", tem.TIC.sat_deadtime_lrs_ctr
00199       time.sleep(1.0)
00200       t += 1
00201
00202     # execute the GUI functions for stopRun, just in case
00203     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00204       if self.rc is not None:
00205         self.rc.doStop()
00206
00207   def wait(self):
00208     #self.__cmdSynchSem.acquire()
00209     pass
00210
00211   def sync(self):
00212     if __name__ == "__main__" or self.isRunFromSuite():
00213       self.__cmdSynchSem.release()
00214       pass
00215
00216
00217 # Standalone mode:
00218 if __name__ == "__main__":
00219   import os
00220   log.basicConfig()
00221   log.getLogger("").setLevel(log.DEBUG)
00222   ua = userApplication(None, 321, 0)
00223   prefs = {'datasave': 1, 'datadir':os.path.join(os.environ['ONLINE_ROOT'],'temp')}
00224   ua.setPrefs(prefs)
00225   ua.rcSetup(os.path.join(os.environ['ONLINE_ROOT'], 'repos/simpleTemSchema.xml'))
00226   ua.rcStartRun()
00227   ua.wait()
00228   ua.rcStopRun()
00229   ua.rcTeardown()
00230
00231 # History:
00232 #     $Log: temLrsTest.py,v $
00233 #     Revision 1.2  2005/03/21 17:58:11  claus
00234 #     Modified to use the first TEM found in the schema, if only one is there, or
00235 #     broadcast to all TEMs if there are multiple.
00236 #
00237 #     Revision 1.1  2005/02/15 01:38:36  claus
00238 #     Initial stab at a tester for the TEM LRS counters.  It currently checks
00239 #     only whether the deadtime counter functions throw an exception or not.
00240 #
00241 #     Revision 1.2  2004/10/18 01:00:19  claus
00242 #     Provided switch between 2 examples of adding custom LATcontributions.
00243 #
00244 #     Revision 1.4  2004/08/31 03:13:38  stuvi
00245 #     Integrated the parameter verifier with Run Control
00246 #
00247 #     Revision 1.3  2004/08/18 18:00:15  stuvi
00248 #     Updated for LATTE 4.
00249 #     All hippo functions go through the Qt GUI bridge now.
00250 #
00251 #     Revision 1.2  2004/08/13 04:46:22  claus
00252 #     Got rid of obsolete TRUE and FALSE declarations.
00253 #
00254 #     Revision 1.1  2004/07/28 21:24:00  stuvi
00255 #     Added testAppCal and its supporting classes.
00256 #
00257 #     Revision 1.28  2004/07/09 23:14:17  stuvi
00258 #     Added "operatorobj" preference that contains the rcUser object and left the "operator" preference to contain the user name.
00259 #
00260 #     Revision 1.27  2004/05/03 22:49:36  stuvi
00261 #     Added commented out code example that demonstrates how to access the CAL and TKR diagnostics contributions.
00262 #
00263 #     Revision 1.26  2004/05/03 21:19:47  stuvi
00264 #     Moved non-Runcontrol scripts to the support directory and modified imports accordingly.
00265 #
00266 #     Revision 1.25  2004/04/21 21:05:29  stuvi
00267 #     Added an example of how to pass the preferences using the setPrefs method when running in standalone mode.
00268 #
00269 #     Revision 1.24  2004/04/17 02:23:48  stuvi
00270 #     Added teardown() to delete the C++ object for the userArgument
00271 #     Fixed LogData parsing based on the evtCli changes
00272 #
00273 #     Revision 1.23  2004/03/31 01:01:19  stuvi
00274 #     Added commented code on how to parse the error contribution.
00275 #
00276 #     Revision 1.22  2004/03/10 22:24:51  panetta
00277 #     Upgraded trigger interface.
00278 #     Removed dependencies on self.glt.
00279 #
00280 #     Revision 1.21  2004/03/04 23:08:47  stuvi
00281 #     Removed glt.destination assignment
00282 #
00283 #     Revision 1.20  2004/02/20 03:20:23  stuvi
00284 #     Added handling of the sweep events and error checking to the process() method,
00285 #
00286 #     Revision 1.19  2004/02/13 03:13:25  stuvi
00287 #     Sweep events are also sent to user script's process event now, so added code to handle the case.
00288 #
00289 #     Revision 1.18  2004/02/02 23:14:00  stuvi
00290 #     Changes required to make the scripts work with the new FSM engine.
00291 #
00292 #     Revision 1.17  2004/01/30 04:33:44  claus
00293 #     Updated for transitions not running in the GUI thread.
00294 #     New commandSynch handling.
00295 #
00296 #     Revision 1.16  2003/12/19 02:05:26  stuvi
00297 #     Added support for creating and updating GUIs from a suite
00298 #
00299 #     Revision 1.15  2003/12/11 02:22:35  stuvi
00300 #     Suite and standalone mode modifications
00301 #
00302 #     Revision 1.14  2003/12/11 01:53:16  stuvi
00303 #     Modified code to support suites.
00304 #
00305 #     Revision 1.13  2003/11/25 02:16:12  stuvi
00306 #     Modified according to the current test setup to generate some results
00307 #
00308 #     Revision 1.12  2003/11/04 04:25:11  stuvi
00309 #     Changed the commandSynch logic so that the enableMask() call would not pose a threat to snapshot taking.
00310 #
00311 #     Revision 1.11  2003/10/31 01:09:37  panetta
00312 #     1)  Moved register writes from startRun to setup
00313 #     2)  Added GLT enabling logic to __commandSynch
00314 #     3)  Gave example of getting the start/stop time from the hardware/event stream
00315 #
00316 #     Revision 1.10  2003/10/28 03:17:34  stuvi
00317 #     Added support for calculating the event rate correctly using the new GLT behaviour.
00318 #
00319 #     Revision 1.9  2003/08/21 21:13:38  stuvi
00320 #     no message
00321 #
00322 #     Revision 1.8  2003/07/17 00:01:35  stuvi
00323 #     no message
00324 #
00325 #     Revision 1.7  2003/06/13 23:26:24  stuvi
00326 #     Added TEM reset
00327 #
00328 #     Revision 1.6  2003/04/12 02:38:34  stuvi
00329 #     Added Cancel button handler to argument class
00330 #
00331 #     Revision 1.5  2003/04/09 00:45:15  stuvi
00332 #     Commented out references to DATA_MASKS register which should not be touched during script execution.
00333 #
00334 #     Revision 1.4  2003/04/01 21:04:59  stuvi
00335 #     Fixed event count discrepancy when the run is stopped in the middle.
00336 #
00337 #     Revision 1.3  2003/03/31 19:23:44  stuvi
00338 #     Fixed name
00339 #
00340 #     Revision 1.2  2003/03/26 21:59:36  stuvi
00341 #     Fixed standalone mode
00342 #
00343 #     Revision 1.1  2003/03/11 21:20:55  stuvi
00344 #     Moved from RunControl directory
00345 #
00346 #     Revision 1.8  2003/02/06 05:19:38  claus
00347 #     Added resume; StopRun bug fix
00348 #
00349 #     Revision 1.7  2003/02/06 04:14:35  claus
00350 #     Fixed StopRun bug
00351 #
00352 #     Revision 1.6  2002/12/11 21:18:07  stuvi
00353 #     Changed glt register assignments to bit field assignments
00354 #
00355 #     Revision 1.5  2002/12/10 01:09:58  claus
00356 #     Added path and changed schema/config file for stand-alone mode
00357 #
00358 #     Revision 1.4  2002/12/04 01:59:23  claus
00359 #     Added message logging
00360 #
00361 #     Revision 1.3  2002/12/02 17:17:09  claus
00362 #     Added provision to allow application to run stand-alone
00363 #
00364 #     Revision 1.2  2002/11/28 02:02:04  claus
00365 #     Shuffled constructor arguments
00366 #
00367 #     Revision 1.1  2002/11/27 05:02:48  claus
00368 #     Initial version of Run Control
00369 #
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_aem.py Source File

tests

test_aem.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "AEM test"
00013 __author__   = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2005/03/02 00:27:55 $").split(' ')[1]
00015 __version__  = "$Revision: 2.3 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import LATTE.client.gOptions as gOptions
00022 import LATTE.client.gCmdCli as gCmdCli
00023 import LATTE.database.gAEM as gAEM
00024
00025 def test_aem():
00026   options = gOptions.Options(['server'])
00027   try:
00028     options.parse()
00029   except Exception, msg:
00030     options.usage(str(msg))
00031     return
00032   cmdcli = gCmdCli.CmdCli()
00033   aem = gAEM.GAEM(cmdcli, None)
00034
00035   cmdcli.connect(options.server)
00036   passed = True
00037
00038   trgseq = 0x7f          # Choose maximum trgseq.
00039   aem.trgseq = trgseq
00040   rdvalue = aem.trgseq
00041   if rdvalue != trgseq:  # must be equal
00042     passed = False
00043   # print "aem.trgseq returned 0x%x" %(rdvalue)
00044
00045   aem.cmd_reset = 1      # LAT-TD-00639 section 1.2 says reset to zero
00046   # print "aem.trgseq reset done"
00047
00048   rdvalue = aem.trgseq
00049   if rdvalue != 0:       # Check for reset to zero
00050     passed = False
00051   # print "aem.trgseq returned 0x%x" %(rdvalue)
00052
00053   if passed:
00054     print "test_aem:  PASSED"
00055   else:
00056     print "test_aem:  FAILED"
00057
00058   cmdcli.disconnect()
00059
00060 if __name__ == '__main__':
00061   test_aem()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_aeq.py Source File

tests

test_aeq.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "AEM environmental quantity test"
00013 __author__   = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2005/03/26 01:02:17 $").split(' ')[1]
00015 __version__  = "$Revision: 2.4 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import LATTE.client.gOptions as gOptions
00022 import LATTE.client.gCmdCli as gCmdCli
00023 import LATTE.database.gAEM as gAEM
00024
00025 if __name__ == '__main__':
00026   options = gOptions.Options(['server'])
00027   try:
00028     options.parse()
00029   except Exception, msg:
00030     options.usage(str(msg))
00031   else:
00032     cmdcli = gCmdCli.CmdCli()
00033     aeq = gAEM.GAEQ(cmdcli, None)
00034     cmdcli.connect(options.server)
00035     adc_base = 20
00036     for freeid in range(12):
00037       for adc in range(4):
00038         reg = adc_base+freeid*4+adc
00039         rsp = aeq.read(reg)
00040         rdvalue = rsp.value()
00041         status = rsp.status()
00042         print 'freeid %2d adc %d status 0x%08x value is 0x%04x' \
00043               %(freeid, adc, status, rdvalue)
00044     cmdcli.disconnect()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_bcast.py Source File

tests

test_bcast.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 """TEM test
00011 Contents:
00012 Script for testing TEM
00013 """
00014 __facility__ = "Online"
00015 __abstract__ = "Script for testing TEM broadcast functionality"
00016 __author__   = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST I&T/Online"
00017 __date__     = ("$Date: 2005/08/31 20:02:33 $").split(' ')[1]
00018 __version__  = "$Revision: 1.1 $"
00019 __release__  = "$Name: R04-12-00 $"
00020 __credits__  = "SLAC"
00021
00022 import LATTE.copyright_SLAC
00023
00024 from LATTE.client.gOptions import Options
00025 from LATTE.client.gCmdCli  import CmdCli
00026 from LATTE.database.gLAT   import GLAT
00027 from LATTE.database.gGLT   import GGLT
00028 from LATTE.database.gXBR   import GXBRD
00029 from LATTE.database.gPlumber import Plumber
00030
00031
00032 import os
00033 import logging as log
00034
00035 def test(c=None, disconnectOnExit=1):
00036   # This test is meant to be run in simulation mode
00037
00038   log.getLogger("").setLevel(log.DEBUG)
00039
00040   options = Options(['server', 'schema'],
00041                     ['fswmsglevel', 'cmddebug'],
00042                     ['initforce', 'ocsverbose', 'nocommander'])
00043   try:
00044     options.parse()
00045   except Exception, msg:
00046     options.usage(str(msg))
00047     return
00048
00049   if options.fswmsglevel is not None:
00050     msglevel = int(options.fswmsglevel)
00051   else:
00052     msglevel = 3
00053   verbose = (options.ocsverbose != None)
00054   force = (options.initforce != None)
00055   commander = not(options.nocommander != None)
00056
00057   if c == None:
00058     cmd = CmdCli()
00059     cmd.connect(options.server)
00060     if options.cmddebug is not None:
00061       cmd.setDebug(options.cmddebug)
00062   else:
00063     cmd = c
00064
00065   lat = GLAT(cmd)
00066   lat.readSchema(options.schema)
00067
00068   if lat.xbrdExists():
00069     xbrd = GXBRD(cmd)
00070     xbrd = xbrd.readSchema(options.schema)
00071   else:
00072     xbrd = None
00073
00074   plumber = Plumber(lat, xbrd)
00075   plumber.initialize(msglevel, verbose, force, commander)
00076
00077   lat.applyConfig()
00078
00079   # Get a TEM instance
00080   if lat.TEMcnt() > 0:
00081     bCastTem = lat.TEM.all()
00082   else:
00083     log.fatal("No TEM(s) found in the schema")
00084     if disconnectOnExit:
00085       cmd.disconnect()
00086     return -1
00087
00088   if not lat.existsGEM():
00089     glt = GGLT(cmd)
00090     glt.initialize()
00091
00092
00093   # Test TEM block
00094   print "Testing TEM block..."
00095   TEST_PATTERN = 1234
00096   bCastTem.CMD_RESET = 1
00097   bCastTem.STATUS    = TEST_PATTERN
00098   for (temId, tem) in lat.TEM.items():
00099     if tem.STATUS != TEST_PATTERN:
00100       print "Failed verification in TEM block, TEM id=%d, expected %d found %d" % (
00101              temId, TEST_PATTERN, tem.STATUS
00102             )
00103       return -1
00104   print "TEM block test successful"
00105
00106   # Test TIC block
00107   print "Testing TIC block..."
00108   TEST_PATTERN = 1235
00109   bCastTem.TIC.CMD_NOP           = 1
00110   bCastTem.TIC.TKR_LRS_COUNTER_0 = TEST_PATTERN
00111   for (temId, tem) in lat.TEM.items():
00112     if tem.TIC.TKR_LRS_COUNTER_0 != TEST_PATTERN:
00113       print "Failed verification in TIC block, TEM id=%d, expected %d found %d" % (
00114              temId, TEST_PATTERN, tem.TIC.TKR_LRS_COUNTER_0
00115             )
00116       return -1
00117   print "TIC block test successful"
00118
00119   # Test CCC block
00120   print "Testing CCC block..."
00121   TEST_PATTERN = 1236
00122   bCastTem.CCC[0].CMD_RESET   = 1
00123   bCastTem.CCC[0].FIFO_STATUS = TEST_PATTERN
00124   for (temId, tem) in lat.TEM.items():
00125     if tem.CCC[0].FIFO_STATUS != TEST_PATTERN:
00126       print "Failed verification in CCC block, TEM id=%d, expected %d found %d" % (
00127              temId, TEST_PATTERN, tem.CCC[0].FIFO_STATUS
00128             )
00129       return -1
00130   print "CCC block test successful"
00131
00132   # Test CRC block
00133   print "Testing CRC block..."
00134   TEST_PATTERN = 1237
00135   bCastTem.CCC[0].CRC[0].CMD_RESET = 1
00136   bCastTem.CCC[0].CRC[0].DELAY_1   = TEST_PATTERN
00137   for (temId, tem) in lat.TEM.items():
00138     if tem.CCC[0].CRC[0].DELAY_1 != TEST_PATTERN:
00139       print "Failed verification in CRC block, TEM id=%d, expected %d found %d" % (
00140              temId, TEST_PATTERN, tem.CCC[0].CRC[0].DELAY_1
00141             )
00142       return -1
00143   print "CRC block test successful"
00144
00145   # Test CFE block
00146   print "Testing CFE block..."
00147   TEST_PATTERN = 1238
00148   bCastTem.CCC[0].CRC[0].CFE[0].CMD_NOP  = 1
00149   bCastTem.CCC[0].CRC[0].CFE[0].CONFIG_0 = TEST_PATTERN
00150   for (temId, tem) in lat.TEM.items():
00151     if tem.CCC[0].CRC[0].CFE[0].CONFIG_0 != TEST_PATTERN:
00152       print "Failed verification in CFE block, TEM id=%d, expected %d found %d" % (
00153              temId, TEST_PATTERN, tem.CCC[0].CRC[0].CFE[0].CONFIG_0
00154             )
00155       return -1
00156   print "CFE block test successful"
00157
00158   # Test TCC block
00159   print "Testing TCC block..."
00160   TEST_PATTERN = 1239
00161   bCastTem.TCC[0].CMD_RESET   = 1
00162   bCastTem.TCC[0].FIFO_STATUS = TEST_PATTERN
00163   for (temId, tem) in lat.TEM.items():
00164     if tem.TCC[0].FIFO_STATUS != TEST_PATTERN:
00165       print "Failed verification in TCC block, TEM id=%d, expected %d found %d" % (
00166              temId, TEST_PATTERN, tem.TCC[0].FIFO_STATUS
00167             )
00168       return -1
00169   print "TCC block test successful"
00170
00171   # Test TRC block
00172   print "Testing TRC block..."
00173   TEST_PATTERN = 1240
00174   bCastTem.TCC[0].TRC[0].CMD_RESET = 1
00175   bCastTem.TCC[0].TRC[0].SYNC   = TEST_PATTERN
00176   for (temId, tem) in lat.TEM.items():
00177     if tem.TCC[0].TRC[0].SYNC != TEST_PATTERN:
00178       print "Failed verification in TRC block, TEM id=%d, expected %d found %d" % (
00179              temId, TEST_PATTERN, tem.TCC[0].TRC[0].SYNC
00180             )
00181       return -1
00182   print "TRC block test successful"
00183
00184   # Test TFE block
00185   print "Testing TFE block..."
00186   TEST_PATTERN = 1241
00187   bCastTem.TCC[0].TRC[0].TFE[0].CMD_RESET  = 1
00188   bCastTem.TCC[0].TRC[0].TFE[0].TRIG_MASK = TEST_PATTERN
00189   for (temId, tem) in lat.TEM.items():
00190     if tem.TCC[0].TRC[0].TFE[0].TRIG_MASK != TEST_PATTERN:
00191       print "Failed verification in TFE block, TEM id=%d, expected %d found %d" % (
00192              temId, TEST_PATTERN, tem.TCC[0].TRC[0].TFE[0].TRIG_MASK
00193             )
00194       return -1
00195   print "TFE block test successful"
00196
00197   if disconnectOnExit:
00198     cmd.disconnect()
00199
00200 if __name__ == '__main__':
00201   if test(None, 0) is not None:
00202     print "** TEM broadcast test failed **"
00203   else:
00204     print "** TEM broadcast test was successful **"
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_cmd.py Source File

tests

test_cmd.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 """Test script for commanding
00011 Contents:
00012 Sample script for testing write command throughput
00013 """
00014 __facility__ = "Online"
00015 __abstract__ = "Test script for testing write command throughput"
00016 __author__   = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST I&T/Online"
00017 __date__     = ("$Date: 2005/03/21 18:37:28 $").split(' ')[1]
00018 __version__  = "$Revision: 2.3 $"
00019 __release__  = "$Name: R04-12-00 $"
00020 __credits__  = "SLAC"
00021
00022 import LATTE.copyright_SLAC
00023
00024 from LATTE.client.gOptions import Options
00025 from LATTE.client.gCmdCli import CmdCli
00026 from LATTE.database.gLAT import GLAT
00027
00028 import os
00029 import time
00030
00031
00032 def test(cmd=None, disconnectOnExit=True):
00033   global tem, glt
00034
00035   options = Options(['server', 'schema'])
00036   try:
00037     options.parse()
00038   except Exception, msg:
00039     options.usage(str(msg))
00040     return
00041
00042   if cmd == None:
00043     cmd = CmdCli()
00044     cmd.connect(options.server)
00045   passed = True
00046
00047   try:
00048     lat = GLAT(cmd)
00049
00050     lat.readSchema(options.schema)
00051
00052     # Get a TEM instance
00053     if lat.TEMcnt() == 1:
00054       tem = lat.TEM[lat.TEM.keys()[0]]
00055     elif lat.TEMcnt() > 1:
00056       tem = lat.TEM.all()
00057
00058     cnt = 10000
00059     start = time.time()
00060     for i in xrange(cnt):
00061       tem.COMMAND_RESPONSE = 1234            # clear TEM stats reg
00062       #cmd.gTEMload(0, 3, 1234)  # ~18500 writes/second
00063       #if i % 1000 == 0: print i
00064     end = time.time()
00065     et = end-start
00066     if et == 0: et = 0.000001
00067     print "Finished in %f seconds (%.1f write commands/second)" %(et, (cnt/et))
00068
00069   except Exception, e:
00070     print "Exception occurred: ", e
00071     passed = False
00072
00073   if passed:
00074     print "test_cmd:  PASSED"
00075   else:
00076     print "test_cmd:  FAILED"
00077
00078   if disconnectOnExit:
00079     cmd.disconnect()
00080
00081 if __name__ == '__main__':
00082   test()
00083
00084 # RiC 6/16/04: Measured 10298 +/- ~150 writes/sec on D600 laptop (1.7 GHz,
00085 #              600 MHz bus, 1 GB) in local mode with prints commented out,
00086 #              without cmdRelayer.
00087 # RiC 6/17/04: Measured 5841 +- ~50 writes/sec on same setup as above but with
00088 #              SocketServer based cmdRelayer.
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_cmdrsp.py Source File

tests

test_cmdrsp.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Command/Response test"
00013 __author__   = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2005/03/19 23:42:08 $").split(' ')[1]
00015 __version__  = "$Revision: 2.4 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 from LATTE.client.gOptions import Options
00022 from LATTE.client.gCmdCli import CmdCli
00023 from LATTE.client.gNode import Node
00024 from LATTE.database.gDb import Lem
00025
00026 def test_cmdrsp():
00027   options = Options(['server'])
00028   try:
00029     options.parse()
00030   except Exception, msg:
00031     options.usage(str(msg))
00032     return
00033
00034   cmdcli = CmdCli()
00035   node = Node(cmdcli)
00036   passed = True
00037
00038   try:
00039     cmdcli.connect(options.opts['server'])
00040     response = node.cmdrsp('AEM_read', Lem.ADDR_AEM, 0, '!I')
00041     print "status is 0x%x value is 0x%x" \
00042           %(response.status(), response.payloads()[0])
00043     if response.status() != 0:
00044       print "nonzero response from cmdrsp. 0x%x" % response.status()
00045       passed = False
00046   except Exception, e:
00047     print "Exception occurred: ", e
00048     passed = False
00049
00050   if passed:
00051     print "test_cmd:  PASSED"
00052   else:
00053     print "test_cmd:  FAILED"
00054
00055   cmdcli.disconnect()
00056
00057 if __name__ == '__main__':
00058   test_cmdrsp()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_cmxasbuilt.py Source File

tests

test_cmxasbuilt.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Retrieve CMX asBuilt information about FSW packages"
00013 __author__   = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2005/01/21 01:24:01 $").split(' ')[1]
00015 __version__  = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 from LATTE.client.gOptions import Options
00022 from LATTE.client.gCmdCli import CmdCli
00023 from LATTE.database.gOCS import GOCS
00024
00025 def test_cmdrsp():
00026   options = Options(['server'])
00027   try:
00028     options.parse()
00029   except Exception, msg:
00030     options.usage(str(msg))
00031     return
00032
00033   cmdcli = CmdCli()
00034   ocs = GOCS(cmdcli)
00035
00036   cmdcli.connect(options.opts['server'])
00037   asbuilt = ocs.cmxAsBuilt()
00038   keys = asbuilt.keys()
00039   keys.sort()
00040   for name in keys:
00041     data    = asbuilt[name]
00042     package = data[0]
00043     version = data[1]
00044     user    = data[2]
00045     time    = data[3]
00046     print "%-6s %-20s %-8s %-10s %s" %(package, name, version, user, time)
00047
00048   cmdcli.disconnect()
00049   return
00050
00051 if __name__ == '__main__':
00052   test_cmdrsp()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_db.py Source File

tests

test_db.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 """Test script for commanding
00011 Contents:
00012 Sample script for testing commanding throughput
00013 """
00014 __facility__ = "Online"
00015 __abstract__ = "GLAST Test command database"
00016 __author__   = "Ric Claus <claus@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00017 __date__     = "Sun Aug 08 18:14:33 2004"
00018 __version__  = "$Revision: 1.6 $"
00019 __release__  = "$Name: R04-12-00 $"
00020 __credits__  = "SLAC"
00021
00022 import LATTE.copyright_SLAC
00023
00024 import struct
00025 import time
00026 import gc
00027 from   LATTE.client.gOptions   import Options
00028 from   LATTE.client.gCmdCli    import CmdCli
00029 import LATTE.database.gDb      as gDb
00030 import LATTE.database.gAttr    as gAttr
00031 import LATTE.client.gRegister  as gRegister
00032 import LATTE.client.gException as gException
00033
00034 class GTest(gDb.Gdb):
00035   """
00036   """
00037
00038   __attrs = [
00039     gAttr.GattrRaw('raw', 0, 4),
00040     gAttr.GattrReg('reg', 1, 4),
00041     gAttr.GattrDlc('dlc', 2),
00042     gAttr.GattrBF('bf1', 0,  0,  4),
00043     gAttr.GattrBF('bf2', 0,  4,  8),
00044     gAttr.GattrBF('bf3', 0,  8, 12),
00045     gAttr.GattrBF('bf4', 0, 12, 16),
00046     ]
00047
00048   def __init__(self, client):
00049     """
00050     """
00051     gDb.Gdb.__init__(self, client, None, 0, self.__attrs)
00052
00053   def read(self, reg):
00054     return self.cmdrsp('TEM_read', self.addr(), reg, '!I')
00055
00056   def load(self, reg, value):
00057     return self.cmdrsp('TEM_load', self.addr(), reg, value)
00058
00059   def send(self, cmd):
00060     return self.cmdrsp('TEM_cmd', self.addr(), cmd)
00061
00062
00063 def test(cmd=None, disconnectOnExit=True):
00064   global tst, cmdCli
00065
00066   options = Options(['server'])
00067   try:
00068     options.parse()
00069   except Exception, msg:
00070     options.usage(str(msg))
00071     return
00072
00073   if cmd == None:
00074     cmd = CmdCli()
00075     cmd.connect(options.server)
00076
00077   tst = GTest(cmd)
00078
00079   # The following rates were measured on a D600 laptop (1.7 GHz, 600 MHz bus,
00080   # 1 GB memory) in local mode with prints commented out
00081   # 2nd rate column is for optimized set/getattr in which lower is called once
00082   cmdStrs = [                                             #   Hz
00083     "cmd.cmdrsp('TEM_load', 0, 3, 4567L)", # Garbage - Why? GC?
00084     "cmd.cmdrsp('TEM_load', 0, 3, 4567L)", # 11098.8 10858
00085     "tst.cmdrsp('TEM_load', 0, 3, 7654L)", # 10741.1 10515
00086     "tst.dlc = 1",                                        #  9242.1  9606
00087     "tst.dlc",                                            #  9416.2  9506
00088     "tst.raw = 1234",                                     #  9000.9  9416
00089     "tst.raw",                                            #  8605.9  8764
00090     "tst.reg = 4321",                                     #  8841.7  9158
00091     "tst.reg",                                            #  8460.2  8532
00092     "tst.bf4",                                            #  8460.2  8613
00093     "tst.bf4 = 5",                                        #  4560.0  4645
00094     "tst.regs['reg'].set(3145)" ,                         #  9242.1  9328
00095     "tst.regs['reg'].set(9876, 1)",                       #  9425.1  9606
00096     "tst.regs['REG'].set(3145)" ,                         #  9157.5
00097     "tst.regs['REG'].set(9876, 1)",                       #  9425.1
00098     "tst.regs['reg'].get()" ,                             #  8680.6
00099     "tst.regs['reg'].get(1)",                             #  8841.7
00100     "tst.regs['REG'].get()" ,                             #  8605.9
00101     "tst.regs['REG'].get(1)",                             #  8833.9
00102     "tst.regs['reg'].set(3145, 0, tst)" ,                 #  9337.1  9328
00103     "tst.regs['reg'].set(9876, 1, tst)",                  #  9505.7  9606
00104     "tst.regs['REG'].set(3145, 0, tst)" ,                 #  9250.7
00105     "tst.regs['REG'].set(9876, 1, tst)",                  #  9416.2
00106     "tst.regs['reg'].get(0, tst)" ,                       #  8680.6
00107     "tst.regs['reg'].get(1, tst)",                        #  8841.7
00108     "tst.regs['REG'].get(0, tst)" ,                       #  8680.6
00109     "tst.regs['REG'].get(1, tst)",                        #  8833.9
00110     #"cmd.gTEMload(0, 3, 1234)",                           # ~18500 writes/sec
00111     ]
00112
00113   commands = []
00114   for cmdStr in cmdStrs:
00115     commands.append((cmdStr, compile(cmdStr, '', 'exec')))
00116
00117   cnt = 10000
00118   for cmdTuple in commands:
00119     command = cmdTuple[1]
00120     print 23*' ', cmdTuple[0],
00121     gc.collect()
00122     start = time.time()
00123     for i in xrange(cnt):
00124       exec(command)
00125     end = time.time()
00126     et = end-start
00127     if et == 0: et = 0.000001
00128     rate = cnt/et
00129     print "\r%4.2f sec (%7.1f Hz)   %s" % (et, rate, cmdTuple[0])
00130
00131   if disconnectOnExit:
00132     cmd.disconnect()
00133   else:
00134     cmdCli = cmd
00135
00136 if __name__ == '__main__':
00137   test()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_evt_aem.py Source File

tests

test_evt_aem.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 """Test script for taking AEM events
00011 """
00012 __facility__ = "Online"
00013 __abstract__ = "Test script for AEM"
00014 __author__   = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST I&T/Online"
00015 __date__     = ("$Date: 2005/05/17 23:12:40 $").split(' ')[1]
00016 __version__  = "$Revision: 1.4 $"
00017 __release__  = "$Name: R04-12-00 $"
00018 __credits__  = "SLAC"
00019
00020 import LATTE.copyright_SLAC
00021
00022 from LATTE.client.gOptions import Options
00023 from LATTE.client.gCmdCli  import CmdCli
00024 from LATTE.database.gLAT   import GLAT
00025 from LATTE.database.gXBR   import GXBRD
00026 from LATTE.client.gEvtCli  import EvtCli
00027 from LATTE.database.gPlumber import Plumber
00028
00029 from time import sleep
00030 import time
00031 import os
00032 import gc
00033
00034 from LATTE.tests.apps.support.SimpleGasuExample import *
00035
00036
00037 aem = None
00038 glt = None
00039
00040 def test(cmd=None, debug=0, count=10000, disconnectOnExit=1, parse=1, lowlevel=0):
00041   global aem, glt, ec
00042   gc.disable()
00043
00044   options = Options(['server', 'schema'],
00045                     ['fswmsglevel', 'evtdebug'],
00046                     ['initforce', 'ocsverbose', 'nocommander'])
00047   try:
00048     options.parse()
00049   except Exception, msg:
00050     options.usage(str(msg))
00051     return
00052
00053   if options.fswmsglevel is not None:
00054     msglevel = int(options.fswmsglevel)
00055   else:
00056     msglevel = 3
00057   verbose = (options.ocsverbose != None)
00058   force = (options.initforce != None)
00059   commander = not(options.nocommander != None)
00060
00061   if cmd == None:
00062     cmd = CmdCli()
00063     cmd.connect(options.server)
00064
00065   if options.evtdebug is not None:
00066     debug = options.evtdebug
00067   ec = EvtCli(debug)
00068   ec.connect(options.server, force)
00069
00070   lat = GLAT(cmd)
00071   lat.readSchema(options.schema)
00072
00073   xbrd = GXBRD(cmd)
00074   xbrd = xbrd.readSchema(options.schema)
00075
00076   plumber = Plumber(lat, xbrd)
00077   plumber.initialize(msglevel, verbose, force, commander)
00078
00079   lat.applyConfig()
00080
00081   try:
00082     lat.LCB.setEvtEnable(True)
00083   except Exception, e:
00084     log.error(e)
00085     raise
00086
00087   trigger = SimpleGasuExample()
00088   trigger.GEM(lat.GEM)
00089   trigger.commit()
00090
00091   aem = lat.downAEM()
00092
00093   arc0 = aem.downARC(11)
00094   arc0.cmd_reset = 1
00095
00096   # configure the AEM
00097   aem.configuration = 0x208ff
00098
00099   # The FREE-sim simulates 4 ADCs with fixed outputs of 1112, 1113, 1114, 1115 (decimal).
00100   # The FREE-sim simulates 4 ADCs with fixed outputs of 0x458, 0x459, 0x45a, 0x45b (hex).
00101   # adjust the PHA thresholds to turn these on/off.
00102
00103   # config all PHAs on
00104
00105   thresh_on  = 0x20
00106   thresh_off = 0xFFF
00107
00108   arc0.PHA_THRESHOLD_0  = thresh_on
00109   arc0.PHA_THRESHOLD_1  = thresh_on
00110   arc0.PHA_THRESHOLD_2  = thresh_on
00111   arc0.PHA_THRESHOLD_3  = thresh_on
00112   arc0.PHA_THRESHOLD_4  = thresh_on
00113   arc0.PHA_THRESHOLD_5  = thresh_on
00114   arc0.PHA_THRESHOLD_6  = thresh_on
00115   arc0.PHA_THRESHOLD_7  = thresh_on
00116   arc0.PHA_THRESHOLD_8  = thresh_on
00117   arc0.PHA_THRESHOLD_9  = thresh_on
00118   arc0.PHA_THRESHOLD_10 = thresh_on
00119   arc0.PHA_THRESHOLD_11 = thresh_on
00120   arc0.PHA_THRESHOLD_12 = thresh_on
00121   arc0.PHA_THRESHOLD_13 = thresh_on
00122   arc0.PHA_THRESHOLD_14 = thresh_on
00123   arc0.PHA_THRESHOLD_15 = thresh_on
00124   arc0.PHA_THRESHOLD_16 = thresh_on
00125   arc0.PHA_THRESHOLD_17 = thresh_on
00126   arc0.veto_width      = 5
00127
00128   # set MAX_PHA
00129   arc0.MAX_PHA = 18
00130
00131   # set PHA ENABLE bits
00132   arc0.PHA_EN_0 = 0xffff
00133   arc0.PHA_EN_1 = 0x3
00134
00135   # set VETO ENABLE bits
00136   arc0.VETO_EN_0 = 0xffff
00137   arc0.VETO_EN_1 = 0x3
00138
00139   afeb = arc0.allAFE()
00140   afeb.CONFIGURATION = 0x0032
00141   afeb.VETO_DAC = 0x20
00142   afeb.HLD_DAC = 0x30
00143   afeb.TCI_DAC = 0x20
00144   afeb.bias_dac     = 3
00145
00146   aem.TRGSEQ = 0x5f
00147
00148   trigger.enable()
00149
00150   cnt=0
00151   ces=0
00152   start = time.time()
00153   for i in range(count):
00154     cnt+=1
00155     trigger.solicit()
00156
00157     if lowlevel==1:
00158       (header, ec.dat) = ec.read()
00159     else:
00160       ec.readEvent()
00161
00162     if parse:
00163       if ec.setCurrentContribution(ec.AEM) != -1:
00164         ec.evDumpEventAEM()
00165         # print "AEM Veto Hit Vectors:"
00166         # j = 0
00167         # for hitVect in ec.evt.aem.vetoHitVectors:
00168           # print "\tCable %2d Raw Data 0x%05x" % (j, hitVect)
00169           # j+=1
00170         # print "\nAEM Accept Hit Vectors:"
00171         # j = 0
00172         # for hitVect in ec.evt.aem.acceptHitVectors:
00173           # print "\tCable %2d Raw Data 0x%05x" % (j, hitVect)
00174           # j+=1
00175         # print "\nAEM PHA Values:"
00176         # j = 0
00177         # for (cbl, phas) in ec.evt.aem.PHA.items():
00178           # for pha in phas:
00179             # print "\tCable: %02d - PHA Value: 0x%04x" % (cbl, pha.ui)
00180     if cnt % 500 == 0: print cnt
00181     ces = ces + len(ec.dat)
00182   end = time.time()
00183   et = end-start
00184   if et == 0: et = 0.000001
00185   print "Finished in %f seconds (%d events/second), average event size is %d" %(et,(cnt/et),(ces/cnt))
00186
00187   if disconnectOnExit == 1:
00188     cmd.disconnect()
00189
00190   ec.disconnect()
00191
00192 #if __name__ == '__main__':
00193 #  test()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_evt_cal.py Source File

tests

test_evt_cal.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 """Test script for measuring event taking throughput.
00011 """
00012 __facility__ = "Online"
00013 __abstract__ = "Test script for CAL"
00014 __author__   = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST I&T/Online"
00015 __date__     = ("$Date: 2005/05/17 23:37:10 $").split(' ')[1]
00016 __version__  = "$Revision: 2.16 $"
00017 __release__  = "$Name: R04-12-00 $"
00018 __credits__  = "SLAC"
00019
00020 import LATTE.copyright_SLAC
00021
00022 from LATTE.client.gOptions   import Options
00023 from LATTE.client.gCmdCli    import CmdCli
00024 from LATTE.client.gEvtCli    import EvtCli
00025 from LATTE.database.gLAT     import GLAT
00026 from LATTE.database.gXBR     import GXBRD
00027 from LATTE.database.gGLT     import GGLT
00028 from LATTE.database.gPlumber import Plumber
00029
00030
00031 from time import sleep
00032 import gc
00033 import os
00034 import time
00035 import logging as log
00036
00037 from LATTE.trigger.TrgUsingTiles      import TrgUsingTiles
00038 from LATTE.trigger.NullObjects        import NoInputsEnabled
00039 from LATTE.trigger.rcTrgFunctions     import rcTrgEngines
00040 from LATTE.trigger.TrgEngines         import *
00041 from LATTE.trigger.rcTrgMiniGLT       import rcTrgMiniGLT
00042 from LATTE.trigger.TrgMiniGLT         import MiniGLTTrgConditionsValue
00043
00044 from LATTE.tests.apps.support.SimpleGasuExample import *
00045
00046
00047 tem = None
00048
00049
00050 class MiniGLTExample(rcTrgMiniGLT):
00051   """\brief MiniTower example interface to MiniGLT
00052   """
00053   def __init__(self):
00054     """\brief AcdTriggerExample constructor
00055     """
00056     rcTrgMiniGLT.__init__(self)
00057     self.__engines      = MiniGLTTrgEngines()
00058     self.__conditions   = MiniGLTSolicitedCondition()
00059
00060   def engines(self):
00061     """\brief Implementation of engines 'pure virtual' method from TrgAbstract
00062     """
00063     return self.__engines
00064
00065   def conditions(self):
00066     """\brief Implementation of conditions 'pure virtual' method from TrgAbstract
00067     """
00068     return self.__conditions
00069
00070 # implementaions of user-level trigger classes
00071 class MiniGLTTrgEngines(rcTrgEngines):
00072   def __init__(self):
00073     rcTrgEngines.__init__(self)
00074     # There are two engines in the MiniGLT.
00075     # 0) User defined engine
00076     # 15) Marker engine
00077
00078     eng = MiniGLTSolicitedEngine()
00079     self.replaceEngine(0,eng)
00080
00081 class MiniGLTSolicitedEngine(TrgEngine):
00082   """This class defines an engine which reads out the detector
00083      whenever there is a solicited trigger.
00084      This engine is not prescaled.
00085   """
00086   def __init__(self):
00087     TrgEngine.__init__(self)
00088     self.__request = ZsupTrgInjectChargeReadout()
00089   def participate(self,conditionsValue):
00090     # This function relies on the programmer's knowledge that the
00091     # conditionsValue is a bitfield.
00092     cond = MiniGLTSolicitedCondition()
00093     condValue = cond.value()
00094     if conditionsValue & condValue:
00095       return True
00096     return False
00097   def prescale(self):
00098     return 0
00099   def request(self):
00100     return self.__request
00101
00102 class MiniGLTSolicitedCondition(MiniGLTTrgConditionsValue):
00103   """ Define a condition where only the CNO trigger is asserted
00104   """
00105   def __init__(self):
00106     MiniGLTTrgConditionsValue.__init__(self)
00107   def solicited(self):
00108     return True
00109
00110 class ZsupTrgInjectChargeReadout(TrgInjectChargeReadout):
00111   """\brief ZsupTrgReadout class definition
00112
00113   Directs a module to send to its Front-End Electronics a command sequence
00114   which is composed only of the TACK command. This command will trigger
00115   a readout of the module's Front-End Electronics.
00116   Zero suppression is turned on.
00117   """
00118   def __init__(self):
00119     """\brief TrgReadout constructor
00120     """
00121     TrgInjectChargeReadout.__init__(self)
00122
00123   def zeroSuppress(self):
00124     return True
00125
00126 # redefine SolicitedEngine
00127 class ZsupSolicitedEngine(TrgEngine):
00128   """This class defines an engine which reads out the detector
00129      whenever there is a solicited trigger.  Zero suppression is on.
00130      This engine is not prescaled.
00131   """
00132   def __init__(self):
00133     TrgEngine.__init__(self)
00134     self.__request = ZsupTrgReadout()
00135   def participate(self,conditionsValue):
00136     # This function relies on the programmer's knowledge that the
00137     # conditionsValue is a bitfield.
00138     cond = SolicitedCondition()
00139     if conditionsValue & cond.value():
00140       return True
00141     return False
00142   def prescale(self):
00143     return 0
00144   def request(self):
00145     return self.__request
00146
00147
00148
00149 def test(cmd=None, debug=0, count=10000, disconnectOnExit=1, parse=1, lowlevel=0):
00150   global tem , glt
00151   gc.disable()
00152
00153   log.getLogger().setLevel(log.DEBUG)
00154
00155   options = Options(['server', 'schema'],
00156                     ['fswmsglevel', 'evtdebug'],
00157                     ['initforce', 'ocsverbose', 'nocommander'])
00158   try:
00159     options.parse()
00160   except Exception, msg:
00161     options.usage(str(msg))
00162     return
00163
00164   if options.fswmsglevel is not None:
00165     msglevel = int(options.fswmsglevel)
00166   else:
00167     msglevel = 3
00168   verbose = (options.ocsverbose != None)
00169   force = (options.initforce != None)
00170   commander = not(options.nocommander != None)
00171
00172   if cmd == None:
00173     cmd = CmdCli()
00174     cmd.connect(options.server)
00175
00176   if options.evtdebug is not None:
00177     debug = options.evtdebug
00178   ec = EvtCli(debug)
00179   ec.connect(options.server, force)
00180
00181   lat = GLAT(cmd)
00182   lat.readSchema(options.schema)
00183
00184   xbrd = GXBRD(cmd)
00185   xbrd = xbrd.readSchema(options.schema)
00186
00187   plumber = Plumber(lat, xbrd)
00188   plumber.initialize(msglevel, verbose, force, commander)
00189
00190   lat.applyConfig()
00191
00192   # Get a TEM instance
00193   if lat.TEMcnt() == 1:
00194     tem = lat.TEM[lat.TEM.keys()[0]]
00195   elif lat.TEMcnt() > 1:
00196     tem = lat.TEM.all()
00197   else:
00198     log.fatal("No TEM(s) found in the schema")
00199     if disconnectOnExit:
00200       cmd.disconnect()
00201     ec.disconnect()
00202     return -1
00203
00204   try:
00205     lat.LCB.setEvtEnable(True)
00206   except Exception, e:
00207     log.error(e)
00208     raise
00209
00210   # reset the TEM since we are going to modify DATA_MASKS
00211   #tem.CMD_RESET = 1
00212
00213   if lat.GEM is not None:
00214     trigger = SimpleGasuExample()
00215
00216     trigger.engines().replaceEngine(0,ZsupSolicitedEngine())
00217     trigger.GEM(lat.GEM)
00218   else:
00219     glt = GGLT(cmd)
00220     glt.initialize()
00221     trigger = MiniGLTExample()
00222     trigger.GLT(glt)
00223   trigger.commit()
00224
00225   #glt.disableMask()
00226   trigger.disable()
00227
00228   # clear TEM stats reg
00229   tem.COMMAND_RESPONSE = 0
00230
00231   # clear TEM status reg
00232   tem.STATUS = 0
00233
00234   # enable CAL, disable TKR, no diag #  0x10FF for diag
00235   #tem.DATA_MASKS = 0x10FF
00236
00237   # TEM config reg # set TEM timeout
00238   #tem.CONFIGURATION = 0
00239   #tem.CAL_TRGSEQ = 0x40
00240
00241   #status = gTEMread( __GT, temId, TEM_REG_CONFIGURATION, &payload);
00242   #printf("tem config reg = 0x%08x\n", payload);
00243
00244   # enable output in our GCCCs
00245   # broadcast load of GCCC_REG_CONFIGURATION
00246
00247   #bcast_ccc = tem.allCCC()
00248   #bcast_ccc.CONFIGURATION = 0x80000000L
00249
00250   #  disable all GCRCs in all GCCCs via broadcast # GCCC_REG_LAYER_MASK_0, GCCC_REG_LAYER_MASK_1
00251   #bcast_ccc.LAYER_MASK_0 = 0xFFFFFFFFL
00252   #bcast_ccc.LAYER_MASK_1 = 0xFFFFFFFFL
00253   #ccc2 = tem.downCCC(2) # O$GCCC_02
00254   #ccc2.LAYER_MASK_1 = 0x3BFD3FFFL
00255
00256   # large timeouts for all GCCCs
00257   # broadcast load of GCCC_REG_EVENT_TIMEOUTS
00258   #bcast_ccc.EVENT_TIMEOUTS = 0x0
00259   #status = gGCCCread( __GT, temId, 1, GCCC_REG_EVENT_TIMEOUTS, &payload);
00260   #printf("gccc register event timeouts = 0x%08x\n", payload);
00261
00262
00263 #  glt.INTERNAL_TRG = 0
00264
00265 #  glt.DESTINATION = 5
00266 #  glt.MARKER = 0
00267 #  glt.ZERO_SUPPRESS = 1
00268 #  glt.FOUR_RANGE_READOUT = 0
00269 #  glt.TACK = 1
00270 #  glt.CAL_STROBE = 0
00271
00272   trigger.enable()
00273
00274   cnt=0
00275   ces=0
00276   start = time.time()
00277   for i in range(count):
00278     cnt=cnt+1
00279     trigger.solicit()
00280     if lowlevel==1:
00281       (header, ec.dat) = ec.read()
00282     else:
00283       ec.readEvent()
00284     if parse==1:
00285       ec.setCurrentContribution(ec.TEM0)
00286       if ec.getContributionStatus() == 0:
00287         ec.evDumpCAL_LogAccepts()
00288         ec.evDumpCAL_Logs()
00289     #~ #print ""
00290     #~ #ec.evDumpTKR()
00291     #~ ec.evDumpTEM_Error()
00292     #~ ec.evDumpDiagnostic()
00293     #~ sum = ec.evt.summary
00294     #~ ec.evDumpSummary()
00295     if cnt % 100 == 0: print cnt
00296     ces = ces + len(ec.dat)
00297     #sleep(0.000300)
00298   end = time.time()
00299   et = end-start
00300   if et == 0: et = 0.000001
00301   print "Finished in %f seconds (%d events/second), average event size is %d" %(et,(cnt/et),(ces/cnt))
00302   if disconnectOnExit:
00303     cmd.disconnect()
00304   ec.disconnect()
00305
00306 #if __name__ == '__main__':
00307 #  test()
00308
00309 # Benchmark results
00310 # 9/7/04
00311 #   server    : gitot
00312 #   teststand : COLUMBA
00313 #   event size: 80 bytes
00314 #     test():                    1327 events/second
00315 #     test(parse=0):             1491 events/second
00316 #     test(lowlevel=1, parse=0): 1823 events/second
00317 #   server    : localhost
00318 #   teststand : COLUMBA
00319 #   event size: 80 bytes
00320 #     test():                    1272 events/second
00321 #     test(parse=0):             2735 events/second
00322 #     test(lowlevel=1, parse=0): 4384 events/second
00323 # 9/30/04
00324 #   server    : gitot / GASU based with TEM0 attached.
00325 #   teststand : COLUMBA
00326 #   event size: 432 bytes
00327 #     test():                     440 events/second -- Note the slow performance is due to
00328 #                                                   -- increased event size and no zero-suppression
00329 #     test(parse=0):             1221 events/second
00330 #     test(lowlevel=1, parse=0): 1400 events/second
00331 #   server    : gitot / GASU based with TEM0 attached (Zero-Suppression on).
00332 #   teststand : COLUMBA
00333 #   event size: 304 bytes
00334 #     test():                    1035 events/second
00335 #     test(parse=0):             1285 events/second
00336 #     test(lowlevel=1, parse=0): 1485 events/second
00337 # 10/19/04
00338 #   server    : gitot / LCBD / GASU based with TEM0 attached (Zero-Suppression on).
00339 #   teststand : COLUMBA
00340 #   event size: 304 bytes
00341 #     test():                     945 events/second
00342 #     test(parse=0):             1153 events/second
00343 #     test(lowlevel=1, parse=0): 1344 events/second
00344 # 10/22/04
00345 #   server    : gitot / LCBD / XBRD based with TEM0 attached (Zero-Suppression on).
00346 #   teststand : COLUMBA
00347 #   event size: 80 bytes
00348 #     test():                    1084 events/second
00349 #     test(parse=0):             1327 events/second
00350 #     test(lowlevel=1, parse=0): 1576 events/second
00351 # 01/19/05
00352 #   server    : gitot / LCBD / GASU based with TEM0 attached (Zero-Suppression on).
00353 #               phase3 (schema driven configuration)
00354 #   teststand : COLUMBA
00355 #   event size: 304 bytes
00356 #     test():                    1023 events/second
00357 #     test(parse=0):             1301 events/second
00358 #     test(lowlevel=1, parse=0): 1503 events/second
00359 # 05/17/05
00360 #   server    : gitot / LCBD / GASU based with TEM0 attached (Zero-Suppression on).
00361 #               schema: calGasuSchemaPri.xml
00362 #   teststand : COLUMBA
00363 #   event size: 304 bytes
00364 #     test():                    1023 events/second
00365 #     test(parse=0):             1321 events/second
00366 #     test(lowlevel=1, parse=0): 1602 events/second
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_evt_exttrg.py Source File

tests

test_evt_exttrg.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 """Test script for external trigger functionality.
00011 """
00012 __facility__ = "Online"
00013 __abstract__ = "Test script for external trigger"
00014 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T/Online"
00015 __date__     = ("$Date: 2004/11/18 18:31:39 $").split(' ')[1]
00016 __version__  = "$Revision: 1.2 $"
00017 __release__  = "$Name: R04-12-00 $"
00018 __credits__  = "SLAC"
00019
00020 import LATTE.copyright_SLAC
00021
00022 from LATTE.client.gOptions import Options
00023 from LATTE.client.gCmdCli  import CmdCli
00024 from LATTE.client.gEvtCli  import EvtCli
00025 from LATTE.database.gLAT   import GLAT
00026 from LATTE.database.gGLT   import GGLT
00027 from LATTE.database.gOCS   import GOCS
00028
00029 from time import sleep
00030 import gc
00031 import os
00032 import time
00033 import logging as log
00034
00035
00036 from LATTE.tests.apps.support.SimpleGasuExample import *
00037 from LATTE.tests.apps.support.MiniGLTExample    import *
00038
00039 tem = None
00040
00041 # Define a GASU impl of an external trigger engine
00042 class GasuExtTrg(SimpleGasuExample):
00043   def __init__(self):
00044     SimpleGasuExample.__init__(self)
00045     self.__cond = GasuExtTrgCond()
00046     self.engines().replaceEngine(0, GasuExtTrgEngine())
00047   def conditions(self): return self.__cond
00048
00049 class GasuExtTrgCond(TrgConditionsValue):
00050   def __init__(self):
00051     TrgConditionsValue.__init__(self)
00052   def external(self): return True
00053
00054 class GasuExtTrgEngine(TrgEngine):
00055   def __init__(self):
00056     TrgEngine.__init__(self)
00057     self.__request = TrgReadout()
00058     cond = GasuExtTrgCond()
00059     self.__cv = cond.value()
00060   def participate(self,conditionsValue):
00061     if conditionsValue & self.__cv:
00062       return True
00063     return False
00064   def prescale(self):   return 0
00065   def request(self):    return self.__request
00066
00067 # define a MiniGLT impl of an external trigger
00068 class MiniGltExtTrg(MiniGLTExample):
00069   def __init__(self):
00070     MiniGLTExample.__init__(self)
00071     self.__cond = MiniGltExtTrgCond()
00072     self.engines().replaceEngine(0, MiniGltTrgEngine())
00073   def conditions(self): return self.__cond
00074
00075 class MiniGltExtTrgCond(MiniGLTTrgConditionsValue):
00076   def __init__(self):
00077     MiniGLTTrgConditionsValue.__init__(self)
00078   def external(self): return True
00079
00080 class MiniGltTrgEngine(TrgEngine):
00081   def __init__(self):
00082     TrgEngine.__init__(self)
00083     self.__request = TrgReadout()
00084     cond = MiniGltExtTrgCond()
00085     self.__cv = cond.value()
00086   def participate(self,conditionsValue):
00087     if conditionsValue & self.__cv:
00088       return True
00089     return False
00090   def prescale(self):   return 0
00091   def request(self):    return self.__request
00092
00093
00094 def test(cmd=None, debug=0, disconnectOnExit=1, parse=1, lowlevel=0):
00095   global tem , glt
00096   gc.disable()
00097
00098   print "Test of external trigger."
00099   print "External trigger should be triggering at ~100Hz"
00100
00101   log.getLogger().setLevel(log.INFO)
00102
00103   options = Options(['server', 'schema'], ['evtdebug'])
00104   try:
00105     options.parse()
00106   except Exception, msg:
00107     options.usage(str(msg))
00108     return
00109
00110   if cmd == None:
00111     cmd = CmdCli()
00112     cmd.connect(options.server)
00113   lat = GLAT(cmd)
00114   lat.readSchema(options.schema)
00115   lat.applyConfig()
00116
00117   try:
00118     lat.LCB.setEvtEnable(True)
00119   except Exception, e:
00120     log.error(e)
00121     raise
00122
00123   if lat.GEM is not None:
00124     trigger = GasuExtTrg()
00125     trigger.GEM(lat.GEM)
00126   else:
00127     glt = GGLT(cmd)
00128     glt.initialize()
00129     trigger = MiniGltExtTrg()
00130     trigger.GLT(glt)
00131   trigger.commit()
00132
00133   trigger.disable()
00134
00135   if options.evtdebug is not None:
00136     debug = options.evtdebug
00137   ec = EvtCli(debug)
00138   ec.connect(options.server)
00139   ec.socket().settimeout(1)
00140
00141   ocs = GOCS(cmd)
00142   # ocs.evtHandlerSetVerbosity(0xf)
00143   ocs.evtHandlerSendAll()
00144
00145   # Make sure counters are reset
00146   trigger.triggerCounters().reset()
00147
00148   # Take 1 second of events
00149   trigger.enable()
00150   time.sleep(1)
00151   trigger.disable()
00152   time.sleep(1)
00153
00154   # get stats
00155   trgStats = trigger.triggerCounters().stats()
00156   nSent    = trgStats.sent()
00157   nDisc    = trgStats.discarded()
00158   nPre     = trgStats.prescaled()
00159
00160
00161   # loop over "sent"
00162   nSeen = 0
00163   for i in range(nSent):
00164     if lowlevel==1:
00165       (header, ec.dat) = ec.read()
00166     else:
00167       try:
00168         ec.readEvent()
00169       except IOError, e:
00170         pass
00171         print e
00172     if parse==1:
00173       ec.setCurrentContribution(ec.GEM)
00174       if ec.getContributionStatus() == 0:
00175         ec.evDumpGEM()
00176         if (ec.evt.gem.triggerSummary & 0x80):
00177           nSeen += 1
00178
00179   if nSent != nSeen:
00180     print
00181     print "  !!!!FAILED!!!!"
00182     print "  nSent (%d) not equal to nSeen (%d)" % ( nSent, nSeen )
00183     print "  GEM stats: nDiscarded= %d" % (nDisc)
00184     print "             nPrescaled= %d" % (nPre )
00185   else:
00186     print
00187     print "  TEST PASSED"
00188
00189   if disconnectOnExit:
00190     cmd.disconnect()
00191   ec.disconnect()
00192
00193 if __name__ == '__main__':
00194   test()
00195
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_evt_filters.py Source File

tests

test_evt_filters.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 """Test of callbacks in OES
00011 """
00012 __facility__ = "Online"
00013 __abstract__ = "Test script for event taking modes in FSW"
00014 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T/Online"
00015 __date__     = ("$Date: 2005/03/17 22:17:12 $").split(' ')[1]
00016 __created__  = "040908"
00017 __version__  = "$Revision: 1.7 $"
00018 __release__  = "$Name: R04-12-00 $"
00019 __credits__  = "SLAC"
00020
00021 import LATTE.copyright_SLAC
00022
00023 from LATTE.client.gOptions import Options
00024 from LATTE.client.gCmdCli  import CmdCli
00025 from LATTE.database.gLAT   import GLAT
00026 from LATTE.database.gOCS   import GOCS
00027 from LATTE.client.gEvtCli  import EvtCli
00028 from LATTE.database.gXBR   import GXBRD
00029 from LATTE.database.gPlumber import Plumber
00030 from LATTE.tools.taskEngine import TaskEngine
00031
00032 from time import sleep
00033 import time
00034 import os
00035 import gc
00036 import math
00037 import logging as log
00038 import threading
00039
00040 from LATTE.tests.apps.support.SimpleGasuExample import *
00041 from LATTE.trigger.rcTrgFunctions import rcTrgInjectMarker
00042
00043
00044 aem     = None
00045 trigger = None
00046 ocs     = None
00047 task    = None
00048 ec      = None
00049
00050 def test(cmd=None, debug=0, count=10, disconnectOnExit=1):
00051   global aem, trigger, ec, ocs, task
00052   gc.disable()
00053
00054   options = Options(['server', 'schema'],
00055                     ['fswmsglevel', 'evtdebug'],
00056                     ['initforce', 'ocsverbose', 'nocommander'])
00057   try:
00058     options.parse()
00059   except Exception, msg:
00060     options.usage(str(msg))
00061     return
00062
00063   if options.fswmsglevel is not None:
00064     msglevel = int(options.fswmsglevel)
00065   else:
00066     msglevel = 3
00067   verbose = (options.ocsverbose != None)
00068   force = (options.initforce != None)
00069   commander = not(options.nocommander != None)
00070
00071   task = TaskEngine("TestEngine")
00072   task.start()
00073
00074   if cmd == None:
00075     cmd = CmdCli()
00076     cmd.connect(options.server)
00077
00078   if options.evtdebug is not None:
00079     debug = options.evtdebug
00080   ec = EvtCli(debug)
00081   ec.setTimeoutEnabled(True)
00082   ec.connect(options.server, force)
00083   ec.socket().settimeout(1)
00084
00085   lat = GLAT(cmd)
00086   lat.readSchema(options.schema)
00087
00088   xbrd = GXBRD(cmd)
00089   xbrd = xbrd.readSchema(options.schema)
00090
00091   plumber = Plumber(lat, xbrd)
00092   plumber.initialize(msglevel, verbose, force, commander)
00093
00094   lat.applyConfig()
00095
00096   try:
00097     lat.LCB.setEvtEnable(True)
00098   except Exception, e:
00099     log.error(e)
00100     raise
00101
00102   ocs = GOCS(cmd)
00103   ocs.evtHandlerSetVerbosity(0xf)
00104
00105   trigger = SimpleGasuExample()
00106   trigger.GEM(lat.GEM)
00107   trigger.commit()
00108   trigger.enable()
00109
00110   cnt=0
00111   start = time.time()
00112
00113   nTest = 1
00114
00115   testEHSendAll(nTest, count);             nTest += 1
00116   testEHSendErrors(nTest, count);          nTest += 1
00117   testEHSendNothing(nTest, count);         nTest += 1
00118   testEHSendPrescale(nTest, count, 0);     nTest += 1
00119   testEHSendPrescale(nTest, count, 2);     nTest += 1
00120   testEHSendPrescale(nTest, count, 0);     nTest += 1
00121   testEHFilterTkrHits(nTest, count, 0x1);  nTest += 1
00122   testEHSendAcd(nTest, count, 5, 0);       nTest += 1
00123   testEHSendAcd(nTest, count, 5, 2);       nTest += 1
00124   testEHSendAcd(nTest, count, 5, 0);       nTest += 1
00125   testEHSendAll(nTest, count);             nTest += 1
00126
00127   trigger.disable()
00128   ec.disconnect()
00129   task.shutdown()
00130
00131   if disconnectOnExit == 1:
00132     cmd.disconnect()
00133
00134 def countEvents(count, printSize=False):
00135   lastEvt = -1
00136   nSeen = 0
00137   for i in range(count):
00138     trigger.solicit()
00139     try:
00140       ec.readEvent()
00141       summary = ec.evt.summary
00142       # Construct event number
00143       evtNumber = (summary.evNumber << 2) | (summary.tag)
00144       nSeen += 1
00145       lastEvt = evtNumber
00146       if printSize:
00147         print "N: %d, Event number %x size = %X, summary=%x" % \
00148            (nSeen, evtNumber, len(ec.dat), summary.ui)
00149     except IOError, e:
00150       pass
00151       # print e
00152   return nSeen
00153
00154 def testEHSendErrors(test, count):
00155   print "test %d:  Take %d events, using evtHandlerSendErrorsOnly" % (test, count)
00156   trigger.disable()
00157   ocs.evtHandlerSendErrorsOnly()
00158   trigger.commit()
00159   trigger.enable()
00160   cnt = countEvents(count)
00161   print "evtHandlerSendErrorsOnly: Sent %d events, saw %d" % (count, cnt)
00162   if (cnt != 0):
00163     print "      FAILED"
00164   else:
00165     print "      PASSED"
00166
00167 def testEHSendNothing(test, count):
00168   print "test %d:  Take %d events, using evtHandlerSendNothing" % (test, count)
00169   trigger.disable()
00170   ocs.evtHandlerSendNothing()
00171   trigger.commit()
00172   trigger.enable()
00173   cnt = countEvents(count)
00174   print "evtHandlerSendNothing: Sent %d events, saw %d" % (count, cnt)
00175   if (cnt != 0):
00176     print "      FAILED"
00177   else:
00178     print "      PASSED"
00179
00180 def testEHSendPrescale(test, count, prescale):
00181   effPre = prescale+1
00182   print "test %d:  Take %d events, using evtHandlerSendPrescaled(%d)" % (test, count*effPre, prescale)
00183   trigger.disable()
00184   ocs.evtHandlerSendPrescaled(prescale)
00185   trigger.commit()
00186   trigger.enable()
00187   cnt = countEvents(count*effPre)
00188   print "evtHandlerSendPrescaled(%d): Sent %d events, saw %d" % (prescale, count*effPre, cnt)
00189   if (cnt != count):
00190     print "      FAILED, expected %d" % count
00191   else:
00192     print "      PASSED"
00193
00194 def testEHFilterTkrHits(test, count, prescale):
00195   effPre = prescale+1
00196   print "test %d:  Take %d events, using evtHandlerFilterTkrHits(%d)" % (test, count*effPre, prescale)
00197   trigger.disable()
00198   ocs.evtHandlerFilterTkrHits(lowThreshold = 10, highThreshold = 0xffffffffL, prescale=prescale)
00199   trigger.commit()
00200   trigger.enable()
00201   cnt = countEvents(count*effPre)
00202   print "testEHFilterTkrHits(%d): Sent %d events, saw %d" % (prescale, count*effPre, cnt)
00203   if (cnt != count):
00204     print "      FAILED, expected %d" % count
00205   else:
00206     print "      PASSED"
00207
00208 def testEHSendAcd(test, count, marker, prescale):
00209   effPre = prescale+1
00210   print "test %d:  Take %d events, using evtHandlerSendAcdScalers(%d,%d)" % \
00211         (test, count*effPre, marker, prescale)
00212
00213   trigger.disable()
00214   ocs.evtHandlerSendAcdScalers(marker, prescale)
00215   trigger.commit()
00216   trigger.enable()
00217
00218   cnt = countEvents(count*effPre)
00219   evt = threading.Event()
00220   task.spawn(trigger.shut, evt)
00221   time.sleep(0.1)
00222   evt.set()
00223
00224   ec.readEvent()
00225   datalen = len(ec.dat)
00226
00227   print "evtHandlerSendAcdScalers(%d,%d): Sent %d events, saw %d" % \
00228         (marker, prescale,count*effPre, cnt)
00229   if (cnt != count):
00230     print "      FAILED, expected %d" % count
00231   elif (datalen < 0x4000):
00232     print "      FAILED, ASC event size = 0x%X, < 0x4000" % datalen
00233   else:
00234     print "      PASSED"
00235   time.sleep(1)  # let shut() above finish...
00236
00237 def testEHSendAll(test, count):
00238   print "test %d:  Take %d events, using evtHandlerSendAll:" % (test, count)
00239   trigger.disable()
00240   ocs.evtHandlerSendAll()
00241   trigger.commit()
00242   trigger.enable()
00243   cnt = countEvents(count)
00244   print "evtHandlerSendAll: Sent %d events, saw %d" % (count, cnt)
00245   if (cnt != count):
00246     print "      FAILED"
00247   else:
00248     print "      PASSED"
00249
00250
00251 if __name__ == '__main__':
00252   test()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_evt_tkr.py Source File

tests

test_evt_tkr.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 """Test script for taking TKR events
00011 """
00012 __facility__ = "Online"
00013 __abstract__ = "Test script for TKR"
00014 __author__   = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST I&T/Online"
00015 __date__     = ("$Date: 2005/05/17 23:42:18 $").split(' ')[1]
00016 __version__  = "$Revision: 1.8 $"
00017 __release__  = "$Name: R04-12-00 $"
00018 __credits__  = "SLAC"
00019
00020 import LATTE.copyright_SLAC
00021
00022 from LATTE.client.gOptions import Options
00023 from LATTE.client.gCmdCli  import CmdCli
00024 from LATTE.database.gLAT   import GLAT
00025 from LATTE.database.gXBR   import GXBRD
00026 from LATTE.client.gEvtCli  import EvtCli
00027 from LATTE.database.gGLT   import GGLT
00028 from LATTE.database.gPlumber import Plumber
00029
00030 from LATTE.tests.apps.support.MiniGLTExample import *
00031 from LATTE.tests.apps.support.SimpleGasuExample import *
00032
00033 import gc
00034 import os
00035 import time
00036 import logging as log
00037
00038 lat = None
00039 tem = None
00040
00041 # redefine SolicitedEngine
00042 class ZsupSolicitedEngine(TrgEngine):
00043   """This class defines an engine which reads out the detector
00044      whenever there is a solicited trigger.  Zero suppression is on.
00045      This engine is not prescaled.
00046   """
00047   def __init__(self):
00048     TrgEngine.__init__(self)
00049     self.__request = ZsupTrgReadout()
00050   def participate(self,conditionsValue):
00051     # This function relies on the programmer's knowledge that the
00052     # conditionsValue is a bitfield.
00053     cond = SolicitedCondition()
00054     if conditionsValue & cond.value():
00055       return True
00056     return False
00057   def prescale(self):
00058     return 0
00059   def request(self):
00060     return self.__request
00061
00062 def test(cmd=None, debug=0, count=10000, disconnectOnExit=1, parse=1, lowlevel=0):
00063   global tem, glt
00064   gc.disable()
00065
00066   log.getLogger().setLevel(log.DEBUG)
00067
00068   options = Options(['server', 'schema'],
00069                     ['fswmsglevel', 'evtdebug'],
00070                     ['initforce', 'ocsverbose', 'nocommander'])
00071   try:
00072     options.parse()
00073   except Exception, msg:
00074     options.usage(str(msg))
00075     return
00076
00077   if options.fswmsglevel is not None:
00078     msglevel = int(options.fswmsglevel)
00079   else:
00080     msglevel = 3
00081   verbose = (options.ocsverbose != None)
00082   force = (options.initforce != None)
00083   commander = not(options.nocommander != None)
00084
00085   if cmd == None:
00086     cmd = CmdCli()
00087     cmd.connect(options.server)
00088
00089   if options.evtdebug is not None:
00090     debug = options.evtdebug
00091   ec = EvtCli(debug)
00092   ec.connect(options.server, force)
00093
00094   lat = GLAT(cmd)
00095   lat.readSchema(options.schema)
00096
00097   xbrd = GXBRD(cmd)
00098   xbrd = xbrd.readSchema(options.schema)
00099
00100   plumber = Plumber(lat, xbrd)
00101   plumber.initialize(msglevel, verbose, force, commander)
00102
00103   lat.applyConfig()
00104
00105   # Get a TEM instance
00106   if lat.TEMcnt() == 1:
00107     tem = lat.TEM[lat.TEM.keys()[0]]
00108   elif lat.TEMcnt() > 1:
00109     tem = lat.TEM.all()
00110   else:
00111     log.fatal("No TEM(s) found in the schema")
00112     if disconnectOnExit:
00113       cmd.disconnect()
00114     ec.disconnect()
00115     return -1
00116
00117   try:
00118     lat.LCB.setEvtEnable(True)
00119   except Exception, e:
00120     log.error(e)
00121     raise
00122
00123   # TEM needs to be reset before DATA_MASKS can be set
00124   #tem.CMD_RESET = 1
00125
00126   if lat.GEM is not None:
00127     trigger = SimpleGasuExample()
00128
00129     trigger.engines().replaceEngine(0,ZsupSolicitedEngine())
00130     trigger.GEM(lat.GEM)
00131   else:
00132     glt = GGLT(cmd)
00133     glt.initialize()
00134     trigger = MiniGLTExample()
00135     trigger.GLT(glt)
00136   trigger.commit()
00137
00138   trigger.disable()
00139
00140   #
00141   # Configure TEM
00142   #
00143   # TEM config reg # set TEM timeout
00144   #tem.CONFIGURATION = 0
00145
00146   #ccc = tem.allCCC()
00147   # enable output in our GCCCs
00148   # broadcast load of GCCC_REG_CONFIGURATION
00149   #ccc.CONFIGURATION = 0x80000000L
00150
00151   #  disable all GCRCs in all GCCCs via broadcast
00152   #ccc.LAYER_MASK_0 = 0xFFFFFFFFL
00153   #ccc.LAYER_MASK_1 = 0xFFFFFFFFL
00154
00155   # config TEM TKR calstrobe delay for ~ 5usec
00156   #tem.TKR_TRGSEQ = 0x3C
00157
00158   # enable TKR, disable CAL, no diag #  0x1FF3 for diag
00159   # only enable GTCC 3
00160   #tem.DATA_MASKS = 0x0FF3
00161
00162   tcc = tem.allTCC()
00163
00164   # broadcast load of GTCC_REG_CONFIGURATION
00165   # enable controller output and set cable length to 1
00166   # 0xC0000000 is for one layer
00167   # 0x80000000 is for two layers
00168   #tcc.CONFIGURATION = 0xC0000000L
00169   #x_tcc = tem.downTCC(0)
00170   # enable all masks
00171   #tcc.INPUT_MASK = 0x0
00172
00173   # set maximum event timeout
00174   #tcc.EVENT_TIMEOUTS = 0x03F
00175
00176   #
00177   # Configure GTRCs
00178   #
00179
00180   # our board is connected CC = 2, RC = 0 and CC = 3, RC = 0
00181   # reset GTRC # required before all triggers
00182
00183   trc = tcc.allTRC()
00184
00185   trc.CMD_RESET = 1
00186
00187   # number of GTFE to readout left
00188   nGTFEsLeft  = 7
00189   nGTFEsRight = 0
00190
00191   # max hits per GTRC # 31 max
00192   maxHits = 31
00193
00194   enMask  = 0x6
00195
00196   dLO = (enMask << 28) | ((nGTFEsRight << 7)& 0xF80) | (maxHits & 0x7F);
00197   print "dLO=", dLO, hex(dLO)
00198
00199   # cable controller 2, readout controller 0
00200   tcc = tem.downTCC(2)
00201   trc = tcc.downTRC(1)
00202
00203   trc.CSR = dLO
00204
00205   dLO = (enMask << 28) | ((nGTFEsLeft << 7)& 0xF80) | (maxHits & 0x7F);
00206   print "dLO=", dLO, hex(dLO)
00207
00208   # cable controller 3, readout controller 0
00209   tcc = tem.downTCC(3)
00210   trc = tcc.downTRC(1)
00211
00212   trc.CSR = dLO
00213
00214   #
00215   # Configure GTFEs
00216   #
00217
00218   tfe = trc.allTFE()
00219   tfe.TRIG_MASK = 0x0
00220   tfe.DATA_MASK = 0x0
00221   tfe.CALIB_MASK = 0x0
00222   tfe.DAC = 0x00001902
00223   # configure front ends # all listen to left
00224   tfe.MODE = 0
00225   #tfe = trc.downTFE(0)
00226
00227 # configure default DACs for threshold and calibration
00228 # Calibration DAC Range and Resolution
00229 # Low Range (B6=0):  DAC output voltage in mV = 1.57 + 1.53*DAC_Value
00230 # High Range (B6=1): DAC output voltage in mV = 15.0 + 14.6*DAC_Value
00231 # Discriminator Threshold DAC Range and Resolution
00232 # Low Range (B6=0):  DAC output voltage in mV = 4.5 + 4.5*DAC_Value
00233 # High Range (B6=1): DAC output voltage in mV = 12.9 + 12.9*DAC_Value
00234
00235
00236   # calRng = 1
00237   # thrRng = 0
00238   # calDAC = 60
00239   # thrDAC = 10
00240
00241   tfe.DAC = 0x00001952  # based on the above Rng and DAC values
00242
00243   # enable GTFE for data taking # all channels
00244   tfe.TRIG_MASK = 0xffffffffffffffff
00245   tfe.DATA_MASK = 0xffffffffffffffff
00246
00247   # Cal strobe channels 4 and 48 only
00248   tfe.CALIB_MASK = 0x0001000000000010
00249
00250   #~ #Mask of the following Registers
00251   #~ tfe = trc.downTFE(13)
00252   #~ tfe.DATA_MASK = 0x0L
00253   #~ tfe.CALIB_MASK = 0x0L
00254   #~ tfe.TRIG_MASK = 0x0L
00255
00256   #~ tfe = trc.downTFE(14)
00257   #~ tfe.DATA_MASK = 0x0L
00258   #~ tfe.CALIB_MASK = 0x0L
00259   #~ tfe.TRIG_MASK = 0x0L
00260
00261   #~ tfe = trc.downTFE(19)
00262   #~ #tfe.DATA_MASK = 0x0L
00263   #~ tfe.CALIB_MASK = 0x0L
00264   #~ tfe.TRIG_MASK = 0x0L
00265
00266   #~ tfe = trc.downTFE(20)
00267   #~ #tfe.DATA_MASK = 0x0L
00268   #~ tfe.CALIB_MASK = 0x0L
00269   #~ tfe.TRIG_MASK = 0x0L
00270
00271   trigger.enable()
00272
00273   cnt=0
00274   ces=0
00275   start = time.time()
00276   for i in range(count):
00277     cnt=cnt+1
00278     trigger.solicit()
00279     if lowlevel==1:
00280       (header, ec.dat) = ec.read()
00281     else:
00282       ec.readEvent()
00283     if parse:
00284       ec.setCurrentContribution(ec.TEM0)
00285       if ec.getContributionStatus() == 0:
00286         ec.evDumpTKR()
00287     if cnt % 100 == 0: print cnt
00288     ces += len(ec.dat)
00289     #sleep(0.000300)
00290   end = time.time()
00291   et = end-start
00292   if et == 0: et = 0.000001
00293   print "Finished in %f seconds (%d events/second), average event size is %d" %(et,(cnt/et),(ces/cnt))
00294   if disconnectOnExit:
00295     cmd.disconnect()
00296   ec.disconnect()
00297
00298 #if __name__ == '__main__':
00299 #  test()
00300
00301 # 10/22/04
00302 #   server    : gitot / LCBD / XBRD based with TEM0 attached (Zero-Suppression on).
00303 #   teststand : COLUMBA
00304 #   event size: 96 bytes
00305 #     test():                     939 events/second
00306 #     test(parse=0):             1338 events/second
00307 #     test(lowlevel=1, parse=0): 1580 events/second
00308 # 05/17/05
00309 #   server    : gitot / LCBD / GASU based with TEM0 attached (Zero-Suppression on).
00310 #   teststand : COLUMBA
00311 #   event size: 176 bytes
00312 #     test():                     909 events/second
00313 #     test(parse=0):             1366 events/second
00314 #     test(lowlevel=1, parse=0): 1664 events/second
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_gafe.py Source File

tests

test_gafe.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "ACD Front End ASIC test"
00013 __author__   = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2005/03/02 00:28:25 $").split(' ')[1]
00015 __version__  = "$Revision: 2.2 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import LATTE.client.gOptions as gOptions
00022 import LATTE.client.gCmdCli as gCmdCli
00023 import LATTE.database.gAEM as gAEM
00024
00025 def test_gafe():
00026   options = gOptions.Options(['server', 'garcid', 'gafeid'])
00027   try:
00028     options.parse()
00029   except Exception, msg:
00030     options.usage(str(msg))
00031     return
00032   cmdcli = gCmdCli.CmdCli()
00033
00034   cmdcli.connect(options.server)
00035   passed = True
00036
00037   garc = gAEM.GARC(cmdcli, None, int(options.garcid))
00038   garc.look_at_me = 0xeb90
00039   gafe = gAEM.GAFE(cmdcli, garc, int(options.gafeid))
00040
00041   try:
00042     value = gafe.configuration
00043     # print "afe.value is 0x%x" %(value)
00044     value = gafe.veto_dac
00045     # print "afe.value is 0x%x" %(value)
00046     value = gafe.veto_vernier
00047     # print "afe.value is 0x%x" %(value)
00048     value = gafe.hld_dac
00049     # print "afe.value is 0x%x" %(value)
00050     value = gafe.tci_dac
00051     # print "afe.value is 0x%x" %(value)
00052     value = gafe.vers_addr
00053     # print "afe.value is 0x%x" %(value)
00054     value = gafe.write_ctr
00055     # print "afe.value is 0x%x" %(value)
00056     value = gafe.reject_ctr
00057     # print "afe.value is 0x%x" %(value)
00058     value = gafe.loop_ctr
00059     # print "afe.value is 0x%x" %(value)
00060     value = gafe.chip_addr
00061     # print "afe.value is 0x%x" %(value)
00062   except Exception, e:
00063     print "Exception seen:  ", e
00064     passed = False
00065
00066
00067   if passed:
00068     print "test_gafe:  PASSED"
00069   else:
00070     print "test_gafe:  FAILED"
00071
00072   cmdcli.disconnect()
00073
00074 if __name__ == '__main__':
00075   test_gafe()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_garc.py Source File

tests

test_garc.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "ACD Readout Controller ASIC test"
00013 __author__   = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2005/03/02 00:28:25 $").split(' ')[1]
00015 __version__  = "$Revision: 2.2 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import LATTE.client.gOptions as gOptions
00022 import LATTE.client.gCmdCli as gCmdCli
00023 import LATTE.database.gAEM as gAEM
00024
00025 def test_garc():
00026   options = gOptions.Options(['server', 'garcid'])
00027   try:
00028     options.parse()
00029   except Exception, msg:
00030     options.usage(str(msg))
00031     return
00032   cmdcli = gCmdCli.CmdCli()
00033   cmdcli.connect(options.server)
00034   passed = True
00035
00036   garc = gAEM.GARC(cmdcli, None, int(options.garcid))
00037   garc.look_at_me = 0xeb90
00038   veto = 20
00039   garc.veto_delay = veto
00040   rdveto = garc.veto_delay
00041   # print "arc.veto_delay wrote 0x%x returned 0x%x" %(veto, rdveto)
00042   if rdveto != veto:
00043     passed = False
00044   garc.cmd_reset = 1
00045   rdveto = garc.veto_delay
00046   # print "arc.veto_delay returned 0x%x after reset" %(rdveto)
00047   if rdveto != 0:
00048     passed = False
00049
00050   if passed:
00051     print "test_garc:  PASSED"
00052   else:
00053     print "test_garc:  FAILED"
00054
00055   cmdcli.disconnect()
00056
00057 if __name__ == '__main__':
00058   test_garc()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_glt.py Source File

tests

test_glt.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "AEM test"
00013 __author__   = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/08/24 23:20:56 $").split(' ')[1]
00015 __version__  = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import LATTE.client.gOptions as gOptions
00022 import LATTE.client.gCmdCli as gCmdCli
00023 import LATTE.database.gGLT as gGLT
00024
00025 def test_glt():
00026   options = gOptions.Options(['server'])
00027   try:
00028     options.parse()
00029   except Exception, msg:
00030     options.usage(str(msg))
00031     return
00032   cmdcli = gCmdCli.CmdCli()
00033   glt = gGLT.GGLT(cmdcli)
00034
00035   cmdcli.connect(options.server)
00036
00037   rdvalue = glt.counter
00038   print "glt.counter returned 0x%x" %(rdvalue)
00039
00040   value = 100
00041   glt.counter = value
00042   print "glt.counter wrote 0x%x" %(value)
00043
00044   rdvalue = glt.counter
00045   print "glt.counter returned 0x%x" %(rdvalue)
00046
00047   glt.cmd_reset = 1
00048   print "glt.counter reset done"
00049
00050   rdvalue = glt.counter
00051   print "glt.counter returned 0x%x" %(rdvalue)
00052
00053   cmdcli.disconnect()
00054
00055 if __name__ == '__main__':
00056   test_glt()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_initfabrics.py Source File

tests

test_initfabrics.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Plumber class test"
00013 __author__   = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2006/04/05 15:39:50 $").split(' ')[1]
00015 __version__  = "$Revision: 2.2 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 from LATTE.client.gOptions import Options
00022 from LATTE.client.gCmdCli import CmdCli
00023 from LATTE.database.gLAT import GLAT
00024 from LATTE.database.gXBR import GXBRD
00025 from LATTE.database.gPlumber import Plumber
00026
00027 def test_initfabrics():
00028   options = Options(['server', 'schema'],
00029                     ['fswmsglevel'],
00030                     ['initforce', 'ocsverbose', 'nocommander', 'usered'])
00031   try:
00032     options.parse()
00033   except Exception, msg:
00034     options.usage(str(msg))
00035     return
00036
00037   cmdcli = CmdCli()
00038   cmdcli.setDebug(1)
00039   lat = GLAT(cmdcli)
00040   lat.readSchema(options.opts['schema'])
00041
00042   if options.usered is not None:
00043     lat.LCB.setFlag('UseRedundant', 1)
00044
00045   plumber = Plumber(lat, None)
00046   if options.fswmsglevel is not None:
00047     msglevel = int(options.fswmsglevel)
00048   else:
00049     msglevel = 3
00050   verbose = (options.ocsverbose != None)
00051   force = (options.initforce != None)
00052   commander = not(options.nocommander != None)
00053
00054   cmdcli.connect(options.opts['server'])
00055   plumber.initialize(msglevel, verbose, force, commander)
00056   cmdcli.disconnect()
00057
00058 if __name__ == '__main__':
00059   test_initfabrics()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_lat.py Source File

tests

test_lat.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "LAT staticistics node test"
00013 __author__   = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/08/24 23:20:56 $").split(' ')[1]
00015 __version__  = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 from LATTE.client.gOptions import Options
00022 from LATTE.client.gCmdCli import CmdCli
00023 from LATTE.database.gLAT import GLAT
00024
00025 def test_lat():
00026   options = Options(['server'])
00027   try:
00028     options.parse()
00029   except Exception, msg:
00030     options.usage(str(msg))
00031     return
00032   cmdcli = CmdCli()
00033   lat = GLAT(cmdcli)
00034
00035   cmdcli.connect(options.server)
00036
00037   rdvalue = lat.stats_valid_events
00038   print "lat.stats_valid_events returned 0x%x" %(rdvalue)
00039
00040   value = 100
00041   lat.stats_valid_events = value
00042   print "lat.stats_valid_events wrote 0x%x" %(value)
00043
00044   rdvalue = lat.stats_valid_events
00045   print "lat.stats_valid_events returned 0x%x" %(rdvalue)
00046
00047   cmdcli.disconnect()
00048
00049 if __name__ == '__main__':
00050   test_lat()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_loopback.py Source File

tests

test_loopback.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Event loopback test"
00013 __author__   = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/08/24 23:20:56 $").split(' ')[1]
00015 __version__  = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import threading
00022 import select
00023 import LATTE.client.gLoopback as gLoopback
00024
00025 class EvtCli(object):
00026   def __init__(self):
00027     self.__loopback = gLoopback.Loopback()
00028
00029   def read(self):
00030     print "readfunction"
00031     try:
00032       rd, wr, ex = select.select([self.__loopback.socket()], [], [], None)
00033       print "select done"
00034     except Exception, msg:
00035       print msg
00036       return
00037     for fd in rd:
00038       if fd == self.__loopback.socket():
00039         value = self.__loopback.acknowledge()
00040         print "shutdown!", value
00041
00042   def dontread(self):
00043     print "dont read called"
00044     self.__loopback.commit(0xbeef)
00045     print "dont read done"
00046
00047
00048 if __name__ == '__main__':
00049   evtcli = EvtCli()
00050   evtHandler = threading.Thread(None, evtcli.read, 'EventHandler',())
00051   evtHandler.start()
00052   evtcli.dontread()
00053   print "done with threads"
00054
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_mem.py Source File

tests

test_mem.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "vxMemProbe test"
00013 __author__   = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/09/11 00:55:28 $").split(' ')[1]
00015 __version__  = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 from LATTE.client.gOptions import Options
00022 from LATTE.client.gCmdCli import CmdCli
00023 from LATTE.database.gMem import GMem
00024
00025 def test_lat():
00026   options = Options(['server', 'address'])
00027   try:
00028     options.parse()
00029   except Exception, msg:
00030     options.usage(str(msg))
00031     return
00032   cmdcli = CmdCli()
00033   mem = GMem(cmdcli)
00034   address = int(options.address, 0)
00035
00036   cmdcli.connect(options.server)
00037
00038   valuechar = 0x1a
00039   valueshort = 0x1a2b
00040   valueint = 0x1a2b3c4d
00041
00042   mem.gMEMload(address+0x00, valuechar,  1)
00043   mem.gMEMload(address+0x10, valueshort, 2)
00044   mem.gMEMload(address+0x20, valueint,   4)
00045
00046   print "gMem wrote 0x%x, 0x%x, 0x%x" %(valuechar, valueshort, valueint)
00047
00048   rvaluechar  = mem.gMEMread(address+0x00, 1).value()
00049   rvalueshort = mem.gMEMread(address+0x10, 2).value()
00050   rvalueint   = mem.gMEMread(address+0x20, 4).value()
00051
00052   print "gMem read  0x%x, 0x%x, 0x%x" %(rvaluechar, rvalueshort, rvalueint)
00053
00054   cmdcli.disconnect()
00055
00056 if __name__ == '__main__':
00057   test_lat()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_options.py Source File

tests

test_options.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Options class test"
00013 __author__   = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/08/24 23:20:56 $").split(' ')[1]
00015 __version__  = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 from LATTE.client.gOptions import Options
00022
00023 def test_cmdrsp():
00024   options = Options(['server'],['schema'],['reload'])
00025   try:
00026     options.parse()
00027     print 'server name is %s' %(options.server)
00028     if options.schema is not None:
00029       print 'schema name is %s' %(options.schema)
00030     if options.reload is not None:
00031       print 'reaload switch is on'
00032   except Exception, msg:
00033     print msg
00034     options.usage()
00035
00036 if __name__ == '__main__':
00037   test_cmdrsp()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_pduswitch.py Source File

tests

test_pduswitch.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "PDU switch test"
00013 __author__   = "Patrick Young <plsyoung@SLAC.Stanford.edu> SLAC - GLAST LAT Electronics"
00014 __date__     = "16/09/2004"
00015 __version__  = "$Revision: 2.2 $"
00016 __credits__  = "SLAC"
00017
00018 from LATTE.client.gOptions   import Options
00019 from LATTE.client.gCmdCli    import CmdCli
00020 from LATTE.database.gLAT     import GLAT
00021 from LATTE.database.gPlumber import Plumber
00022
00023 from ELX.Common.instruments.ElxSwitch import ElxSwitch
00024 from ELX.Common.instruments.ElxPowerSupply import ElxPowerSupply
00025 from ELX.Common.instruments.ElxFunctionGenerator import ElxFunctionGenerator
00026
00027 import time
00028 import traceback
00029
00030 class PduSwitch:
00031   def __init__(self, lat):
00032     self.lat = lat
00033     self.switch = ElxSwitch('37', 'COM2', [100,200])
00034     self.black0 = ElxPowerSupply('1697', 'COM1', 5)
00035     if not self.switch.allOpen():
00036       raise RuntimeError, 'allOpen failed'
00037     if not self.black0.setVoltage(28.):
00038       raise RuntimeError, 'setVoltage failed'
00039     if not self.black0.switchOn():
00040       raise RuntimeError, 'switchOn failed'
00041
00042   def configureTestHardware(self, pdu, gasu):
00043     status = self.__setRelays(pdu, gasu)
00044     if not status:
00045       message = 'Problem setting relays pdu %d, gasu side %d, please resolve' \
00046                 %(pdu, gasu)
00047       raise RuntimeError, message
00048     self.__plumb(self.lat, pdu, gasu)
00049
00050   def __setRelays(self, pdu=0, gasu=0):
00051     feed = 0
00052     success = self.switch.allOpen()
00053     #time.sleep(1)
00054     pattern0 = 2*pdu + feed + 1
00055     pattern1 = 2*gasu + pdu + 1
00056     success &= self.switch.setValue(100, pattern0)
00057     #time.sleep(1)
00058     success &= self.switch.setValue(200, pattern1)
00059     #time.sleep(1)
00060     return success
00061
00062   def __plumb(self, lat, pdu=0, gasu=0):
00063     onPdu = lat.downPDU(pdu)
00064     offPdu = lat.downPDU(pdu^1)
00065     lcb = lat.downLCB()
00066     offPdu.setFlag('CmdrspFabric','Off')
00067     onPdu.setFlag('CmdrspFabric','On')
00068     lcb.setFlag('UseRedundant',gasu)
00069     plumber = Plumber(lat, None)
00070     plumber.initialize(3, ocsverbose=True, force=True)
00071
00072
00073 if __name__ == '__main__':
00074   options = Options(['server', 'schema'])
00075
00076   try:
00077     options.parse()
00078   except Exception, msg:
00079     options.usage(str(msg))
00080     raise RuntimeError
00081
00082   cmd = CmdCli()
00083   cmd.connect(options.server)
00084   cmd.setDebug(1)
00085
00086   lat = GLAT(cmd)
00087   lat.readSchema(options.schema)
00088
00089   pduswitch = PduSwitch(lat)
00090
00091   i = 0
00092   while True:
00093     print 'set configuration %d' %(i%4)
00094     pduswitch.configureTestHardware(i%2, (i>>1) & 0x1)
00095     print 'test %d completed, iteration %d. %s' %(i%4, i, time.ctime())
00096     i += 2
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_peq.py Source File

tests

test_peq.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "PDU_adc_read"
00013 __author__   = "Patrick Young <plsyoung@SLAC.Stanford.edu> SLAC - GLAST LAT Electronics"
00014 __date__     = "16/09/2004"
00015 __version__  = "$Revision: 2.1 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import LATTE.client.gOptions as gOptions
00021 import LATTE.client.gCmdCli as gCmdCli
00022 import LATTE.database.gPDU as gPDU
00023
00024 import os
00025 from string import lstrip
00026
00027 N_GRPS = 8 # number of (single digitize command) adc groups
00028 N_WRDS = 8 # words per adc reg
00029 N_LOOP = 4 # times one group is repetitively digitized
00030 N_ADCS = 160
00031 N_VARS = 20
00032 ADCS_BASE = 10 # constant offset from gPDU.py
00033
00034 def is_vmon(adc):
00035   return ((adc-ADCS_BASE)%N_VARS==0)or((adc-ADCS_BASE)%N_VARS==1)\
00036   or((adc-ADCS_BASE)%N_VARS==2)
00037
00038 def is_rtd(adc):
00039   return ((adc-ADCS_BASE)%N_VARS==9)or((adc-ADCS_BASE)%N_VARS==10)\
00040   or((adc-ADCS_BASE)%N_VARS==11)or((adc-ADCS_BASE)%N_VARS==12)
00041
00042 if __name__ == '__main__':
00043   options = gOptions.Options(['server', 'logfile'])
00044   try:
00045     options.parse()
00046   except Exception, msg:
00047     options.usage(str(msg))
00048   else:
00049     cmdcli = gCmdCli.CmdCli()
00050     pdu = gPDU.GPDU(cmdcli, None, 0)
00051     peq = gPDU.GPEQ(cmdcli, pdu)
00052     cmdcli.connect(options.server)
00053     print "\nPDU ADC Read\n"
00054     rvrs = range(N_WRDS)
00055     rvrs.reverse()
00056     print "Write log to file %s" %options.logfile
00057     outfile = open(options.logfile, 'w')
00058
00059     for grp in range(N_GRPS):
00060       pdu.monitor = grp
00061       reg0 = peq.adcs_00_07
00062       reg1 = peq.adcs_08_15
00063       reg2 = peq.adcs_16_19
00064       print "0x%024x 0x%024x 0x%024x" %(reg2, reg1, reg0)
00065
00066       for i in rvrs:
00067         outstring = hex(int((reg2 >> i*12) & 0xfff))
00068         outfile.write(lstrip(outstring,'0x').zfill(3))
00069         outfile.write(' ')
00070       outfile.write('  ')
00071       for i in rvrs:
00072         outstring = hex(int((reg1 >> i*12) & 0xfff))
00073         outfile.write(lstrip(outstring,'0x').zfill(3))
00074         outfile.write(' ')
00075       outfile.write('  ')
00076       for i in rvrs:
00077         outstring = hex(int((reg0 >> i*12) & 0xfff))
00078         outfile.write(lstrip(outstring,'0x').zfill(3))
00079         outfile.write(' ')
00080       outfile.write('\n')
00081
00082     outfile.write('\n')
00083     outfile.close()
00084
00085     print "\nChecking ADCs one by one..."
00086     delay = 40
00087     rsp = peq.cmdrsp('setPduAdcWaitTime', delay)
00088     print 'wait was %d now %d' %(rsp.status(), delay)
00089     adcs = range(N_VARS)
00090     adcs.reverse()
00091     for grp in range(N_GRPS):
00092       msg = 'group %d:' %grp
00093       for i in adcs:
00094         adc = 10+i+N_VARS*grp
00095         val = peq.read(adc).value()
00096         msg += ' %03x' %val
00097       print msg
00098       #~ if is_vmon(adc):
00099         #~ if (val<0xa40 or val>0xa60):
00100           #~ print "Vmn[%03d] out of range. Actual: %03x"%(adc-ADCS_BASE,val)
00101       #~ elif is_rtd(adc):
00102         #~ if (val<0x298 or val>0x2b0):
00103           #~ print "RTD[%03d] out of range. Actual: %03x"%(adc-ADCS_BASE,val)
00104       #~ else:
00105         #~ if (val<0xbd0 or val>0xbe8):
00106           #~ print "Tmn[%03d] out of range. Actual: %03x"%(adc-ADCS_BASE,val)
00107     print "Done.\n"
00108     cmdcli.disconnect()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_playback.py Source File

tests

test_playback.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Event file playback test"
00013 __author__   = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2005/02/08 22:20:05 $").split(' ')[1]
00015 __version__  = "$Revision: 2.5 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 from threading import Thread, Lock
00022
00023 import LATTE.client.gOptions as gOptions
00024 import LATTE.client.gCmdCli as gCmdCli
00025 import LATTE.client.gEvtCli as gEvtCli
00026 import LATTE.database.gGLT as gGLT
00027
00028 class Playback:
00029   __Debug = 0xf
00030
00031   def __init__(self, server):
00032     self.__server = server
00033     self.__cmdcli = gCmdCli.CmdCli()
00034     self.__evtcli = gEvtCli.EvtCli(Playback.__Debug)
00035     self.__glt = gGLT.GGLT(self.__cmdcli)
00036     self.__lock = Lock()
00037     self.__lock.acquire()
00038     self.__abort = False
00039
00040   def connect(self):
00041     self.__cmdcli.connect(self.__server)
00042     self.__evtcli.connect(self.__server)
00043
00044   def disconnect(self):
00045     self.__cmdcli.disconnect()
00046     self.__evtcli.disconnect()
00047
00048   def trigger(self, howmany):
00049     self.__glt.marker = 5
00050     self.__glt.cmd_self_trigger = 1
00051     self.__lock.acquire()
00052     for t in range(howmany):
00053       self.__glt.marker = 0
00054       self.__glt.cmd_self_trigger = 1
00055       self.__lock.acquire()
00056     self.__abort = True
00057     self.__glt.marker = 5
00058     self.__glt.cmd_self_trigger = 1
00059     self.__lock.acquire()
00060
00061   def listen(self):
00062     evtHandler = Thread(None, self.__listen)
00063     evtHandler.start()
00064
00065   def __listen(self):
00066     while self.__abort is False:
00067       status = self.__evtcli.readEvent()
00068       if status != 0:
00069         print "*** playback error in event"
00070       self.__lock.release()
00071
00072 def test_playback():
00073   options = gOptions.Options(['server', 'nevents'])
00074   try:
00075     options.parse()
00076   except Exception, msg:
00077     options.usage(str(msg))
00078     return
00079   playback = Playback(options.server)
00080   playback.connect()
00081   playback.listen()
00082   playback.trigger(int(options.nevents))
00083   playback.disconnect()
00084
00085
00086 if __name__ == '__main__':
00087   test_playback()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_power.py Source File

tests

test_power.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Power Panel Debug class"
00013 __author__   = "Gregg Thayer <jgt@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/12/15 02:44:06 $").split(' ')[1]
00015 __version__  = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import qt
00022 import logging
00023
00024 from LATTE.client.gOptions import Options
00025 from LATTE.client.gCmdCli import CmdCli
00026 from LATTE.database.gLAT import GLAT
00027 from LATTE.database.gXBR import GXBRD
00028 from LATTE.power.PorcinePanel import PorcineWindow
00029
00030 def test_power(args):
00031     options=Options(['server','schema'])
00032     try:
00033         options.parse()
00034     except Exception, msg:
00035         options.usage(str(msg))
00036         return
00037
00038     cmdcli=CmdCli()
00039     lat=GLAT(cmdcli)
00040     lat.readSchema(options.opts['schema'])
00041
00042     xbrd=GXBRD(cmdcli)
00043     xbrd.readSchema(options.opts['schema'])
00044
00045     logging.getLogger("").setLevel(logging.DEBUG)
00046
00047     cmdcli.connect(options.opts['server'])
00048
00049     app=qt.QApplication(args)
00050     gui=PorcineWindow(lat,xbrd)
00051
00052     app.connect(app,qt.SIGNAL("lastWindowClosed()"),
00053                 app,qt.SLOT("quit()"))
00054     app.setMainWidget(gui)
00055     gui.show()
00056     app.exec_loop()
00057
00058     cmdcli.disconnect()
00059
00060 if __name__=='__main__':
00061     import sys
00062     test_power(sys.argv)
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_rate.py Source File

tests

test_rate.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Commanding rate measurement test"
00013 __author__   = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/08/24 23:20:56 $").split(' ')[1]
00015 __version__  = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import time
00022
00023 from LATTE.client.gOptions import Options
00024 from LATTE.client.gCmdCli import CmdCli
00025 from LATTE.client.gCommand import Command
00026 from LATTE.database.gLAT import GLAT
00027
00028 def test_rate():
00029   options = Options(['server'])
00030   try:
00031     options.parse()
00032   except Exception, msg:
00033     options.usage(str(msg))
00034     return
00035
00036   cmdcli = CmdCli()
00037   lat = GLAT(cmdcli)
00038   cmdcli.connect(options.server)
00039
00040   start = time.time()
00041   for counter in range(10000):
00042     lat.stats_failed_events = counter
00043   end = time.time()
00044
00045   counter += 1
00046   elapsed = end-start
00047   rate = 1.0/elapsed*counter
00048
00049   print "  elapsed %.4f counter %d rate %.2f [Hz]" %(elapsed, counter, rate)
00050
00051   start = time.time()
00052   for counter in range(10000):
00053     lat.cmdrsp('ggLATread', 8, '!I')
00054   end = time.time()
00055
00056   counter += 1
00057   elapsed = end-start
00058   rate = 1.0/elapsed*counter
00059
00060   print "  elapsed %.4f counter %d rate %.2f [Hz]" %(elapsed, counter, rate)
00061
00062   start = time.time()
00063   command = Command('ggLATread', 8, '!I')
00064   for counter in range(10000):
00065     cmdcli._CmdCli__command_response(command.packet())
00066   end = time.time()
00067
00068   counter += 1
00069   elapsed = end-start
00070   rate = 1.0/elapsed*counter
00071
00072   print "  elapsed %.4f counter %d rate %.2f [Hz]" %(elapsed, counter, rate)
00073
00074   cmdcli.disconnect()
00075
00076 if __name__ == '__main__':
00077   test_rate()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_schema.py Source File

tests

test_schema.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Schema reader test"
00013 __author__   = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/08/24 23:20:56 $").split(' ')[1]
00015 __version__  = "$Revision: 2.2 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 from LATTE.client.gOptions import Options
00022 from LATTE.client.gCmdCli import CmdCli
00023 from LATTE.database.gLAT import GLAT
00024
00025 def test_schema():
00026   options = Options(['server', 'schema'])
00027   try:
00028     options.parse()
00029   except Exception, msg:
00030     options.usage(str(msg))
00031     return
00032   cmdcli = CmdCli()
00033   lat = GLAT(cmdcli)
00034
00035   lat.readSchema(options.opts['schema'])
00036   aem = lat.AEM
00037
00038   cmdcli.connect(options.server)
00039
00040   rdvalue = aem.trgseq
00041   print "aem.trgseq returned 0x%x" %(rdvalue)
00042
00043   aem.cmd_reset = 1
00044   print "aem.trgseq reset done"
00045
00046   rdvalue = aem.trgseq
00047   print "aem.trgseq returned 0x%x" %(rdvalue)
00048
00049   aeq = aem.AEQ
00050   aeq.env_free_1la = 0
00051   print "aeq.env_free_1LA set"
00052   rdvalue = aeq.env_free_1la
00053   print "aeq.env_free_1LA returned 0x%x" %(rdvalue)
00054
00055   garcid = 11
00056   garc = aem.ARC[garcid]
00057   garc.look_at_me = 0xeb90
00058   veto = 20
00059   garc.veto_delay = veto
00060   rdveto = garc.veto_delay
00061   print "arc.veto_delay wrote 0x%x returned 0x%x" %(veto, rdveto)
00062   garc.cmd_reset = 1
00063   rdveto = garc.veto_delay
00064   print "arc.veto_delay returned 0x%x after reset" %(rdveto)
00065
00066   gafeid = 7
00067   gafe = garc.AFE[gafeid]
00068   value = gafe.configuration
00069   print "afe.configuration is 0x%x" %(value)
00070
00071   cmdcli.disconnect()
00072
00073 if __name__ == '__main__':
00074   test_schema()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_tem.py Source File

tests

test_tem.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 """TEM test
00011 Contents:
00012 Script for testing TEM
00013 """
00014 __facility__ = "Online"
00015 __abstract__ = "Script for testing TEM"
00016 __author__   = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST I&T/Online"
00017 __date__     = ("$Date: 2005/08/04 20:43:08 $").split(' ')[1]
00018 __version__  = "$Revision: 2.8 $"
00019 __release__  = "$Name: R04-12-00 $"
00020 __credits__  = "SLAC"
00021
00022 import LATTE.copyright_SLAC
00023
00024 from LATTE.client.gOptions import Options
00025 from LATTE.client.gCmdCli  import CmdCli
00026 from LATTE.database.gLAT   import GLAT
00027 from LATTE.database.gGLT   import GGLT
00028 from LATTE.database.gXBR   import GXBRD
00029 from LATTE.database.gPlumber import Plumber
00030
00031
00032 import os
00033 import logging as log
00034
00035 def test(c=None, disconnectOnExit=1):
00036   global tem, glt, lat, cmd, xbrd
00037
00038   log.getLogger("").setLevel(log.DEBUG)
00039
00040   options = Options(['server', 'schema'],
00041                     ['fswmsglevel', 'cmddebug'],
00042                     ['initforce', 'ocsverbose', 'nocommander'])
00043   try:
00044     options.parse()
00045   except Exception, msg:
00046     options.usage(str(msg))
00047     return
00048
00049   if options.fswmsglevel is not None:
00050     msglevel = int(options.fswmsglevel)
00051   else:
00052     msglevel = 3
00053   verbose = (options.ocsverbose != None)
00054   force = (options.initforce != None)
00055   commander = not(options.nocommander != None)
00056
00057   if c == None:
00058     cmd = CmdCli()
00059     cmd.connect(options.server)
00060     if options.cmddebug is not None:
00061       cmd.setDebug(options.cmddebug)
00062   else:
00063     cmd = c
00064
00065   lat = GLAT(cmd)
00066   lat.readSchema(options.schema)
00067
00068   xbrd = GXBRD(cmd)
00069   xbrd = xbrd.readSchema(options.schema)
00070
00071   plumber = Plumber(lat, xbrd)
00072   plumber.initialize(msglevel, verbose, force, commander)
00073
00074   lat.applyConfig()
00075
00076   # Get a TEM instance
00077   if lat.TEMcnt() == 1:
00078     tem = lat.TEM[lat.TEM.keys()[0]]
00079   elif lat.TEMcnt() > 1:
00080     tem = lat.TEM.all()
00081   else:
00082     log.fatal("No TEM(s) found in the schema")
00083     if disconnectOnExit:
00084       cmd.disconnect()
00085     return -1
00086
00087   glt = GGLT(cmd)
00088   glt.initialize()
00089
00090   if disconnectOnExit:
00091     cmd.disconnect()
00092
00093 if __name__ == '__main__':
00094   test(None, 0)
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_teq.py Source File

tests

test_teq.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "AEM environmental quantity test"
00013 __author__   = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2005/03/26 01:02:17 $").split(' ')[1]
00015 __version__  = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import LATTE.client.gOptions as gOptions
00022 import LATTE.client.gCmdCli as gCmdCli
00023 import LATTE.database.gTEM as gTEM
00024
00025 if __name__ == '__main__':
00026   options = gOptions.Options(['server'])
00027   try:
00028     options.parse()
00029   except Exception, msg:
00030     options.usage(str(msg))
00031   else:
00032     cmdcli = gCmdCli.CmdCli()
00033     tem = gTEM.GTEM(cmdcli, None, 0)
00034     tic = gTEM.GTIC(cmdcli, tem)
00035     cmdcli.connect(options.server)
00036     for reg in range(18, 58):
00037       rsp = tic.read(reg)
00038       rdvalue = rsp.value()
00039       status = rsp.status()
00040       print 'TIC adc %2d status 0x%08x value is 0x%04x' %(reg, status, rdvalue)
00041     cmdcli.disconnect()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: test_twoclients.py Source File

tests

test_twoclients.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Online"
00012 __abstract__ = "Two command client test"
00013 __author__   = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2004/08/24 23:20:56 $").split(' ')[1]
00015 __version__  = "$Revision: 2.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import LATTE.client.gOptions as gOptions
00022 import LATTE.client.gCmdCli as gCmdCli
00023 import LATTE.database.gAEM as gAEM
00024
00025 def test_twoclients():
00026   options = gOptions.Options(['server'])
00027   try:
00028     options.parse()
00029   except Exception, msg:
00030     options.usage(str(msg))
00031     return
00032
00033   clienta = gCmdCli.CmdCli()
00034   aema = gAEM.GAEM(clienta, None)
00035   clienta.connect(options.server)
00036
00037   clientb = gCmdCli.CmdCli()
00038   aemb = gAEM.GAEM(clientb, None)
00039   clientb.connect(options.server)
00040
00041   value = 0xbadbeef
00042   aema.trgseq = value
00043   aemb.trgseq = value
00044   print "aem.trgseq wrote 0x%x" %(value)
00045
00046   rdvaluea = aema.trgseq
00047   print "aem.trgseq returned 0x%x" %(rdvaluea)
00048
00049   clienta.disconnect()
00050
00051   rdvalueb = aemb.trgseq
00052   print "aem.trgseq returned 0x%x" %(rdvalueb)
00053
00054   clientb.disconnect()
00055
00056 if __name__ == '__main__':
00057   test_twoclients()
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testAppAcd.py Source File

testAppAcd.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example ACD test application"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "11/21/2002"
00014 __version__  = "$Revision: 1.4 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import                      threading
00020 import logging       as     log
00021 import                      time
00022
00023 from   LATTE.runcontrol.rcTransitions import rcTransitions
00024 from   LATTE.runcontrol.ArgumentImpl  import ArgumentImpl
00025
00026 from support.SimpleGasuExample   import *
00027
00028 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00029 #  the userApplication example to get the number of self triggers to take.
00030 class userArgument(ArgumentImpl):
00031   "GUI for getting the user to input some sort of value"
00032   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00033     ArgumentImpl.__init__(self, parent, name, modal, fl)
00034     self.__value = 0
00035     self.setCaption("Hello world!")
00036
00037   def OKButtonClicked(self):
00038     self.__value = int(self.ArgumentList.text().latin1())
00039     self.close()
00040
00041   def CancelButtonClicked(self):
00042     self.__value = None
00043     self.close()
00044
00045   def getValue(self, caption):
00046     self.setCaption(caption)
00047     self.show()
00048     self.exec_loop()
00049     return self.__value
00050
00051 class userArgText(object):
00052   "Text user interface for getting the user to input some sort of value"
00053   def __init__(self):
00054     pass
00055
00056   def getValue(self, caption):
00057     return int(raw_input("%s: " % (caption)))
00058
00059
00060 #  Example application implementation.
00061 #  Note that the name of the class must be userApplication.
00062 #  Look at rcTransitions for names of other transition methods that can be used.
00063 class userApplication(rcTransitions):
00064   "Implmentation class for a user application"
00065   def __init__(self, rc, userId, debug):
00066     rcTransitions.__init__(self, rc, userId, debug)
00067     log.debug("userApplication.__init__()")
00068     self.__eventSem    = threading.Semaphore(0)
00069     self.__cmdSynchSem = threading.Semaphore(0)
00070
00071   def getName(self):
00072     return __name__
00073
00074   def setup(self):
00075     log.debug("userApplication.setup()")
00076
00077     if self.rc is None:
00078       self.__arg = userArgText()
00079     else:
00080       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00081
00082     aem = self.lat.downAEM()
00083
00084     arc0 = aem.downARC(11)
00085     arc0.cmd_reset = 1
00086
00087     # configure the AEM
00088     aem.configuration = 0x007ff
00089
00090     # The FREE-sim simulates 4 ADCs with fixed outputs of 1112, 1113, 1114, 1115 (decimal).
00091     # The FREE-sim simulates 4 ADCs with fixed outputs of 0x458, 0x459, 0x45a, 0x45b (hex).
00092     # adjust the PHA thresholds to turn these on/off.
00093
00094     # config all PHAs on
00095
00096     thresh_on  = 0x20
00097     thresh_off = 0xFFF
00098
00099     arc0.PHA_THRESHOLD_0  = thresh_on
00100     arc0.PHA_THRESHOLD_1  = thresh_on
00101     arc0.PHA_THRESHOLD_2  = thresh_on
00102     arc0.PHA_THRESHOLD_3  = thresh_on
00103     arc0.PHA_THRESHOLD_4  = thresh_on
00104     arc0.PHA_THRESHOLD_5  = thresh_on
00105     arc0.PHA_THRESHOLD_6  = thresh_on
00106     arc0.PHA_THRESHOLD_7  = thresh_on
00107     arc0.PHA_THRESHOLD_8  = thresh_on
00108     arc0.PHA_THRESHOLD_9  = thresh_on
00109     arc0.PHA_THRESHOLD_10 = thresh_on
00110     arc0.PHA_THRESHOLD_11 = thresh_on
00111     arc0.PHA_THRESHOLD_12 = thresh_on
00112     arc0.PHA_THRESHOLD_13 = thresh_on
00113     arc0.PHA_THRESHOLD_14 = thresh_on
00114     arc0.PHA_THRESHOLD_15 = thresh_on
00115     arc0.PHA_THRESHOLD_16 = thresh_on
00116     arc0.PHA_THRESHOLD_17 = thresh_on
00117     arc0.veto_width      = 5
00118
00119     # set MAX_PHA
00120     arc0.MAX_PHA = 18
00121
00122     # set PHA ENABLE bits
00123     arc0.PHA_EN_0 = 0xffff
00124     arc0.PHA_EN_1 = 0x3
00125
00126     # set VETO ENABLE bits
00127     arc0.VETO_EN_0 = 0xffff
00128     arc0.VETO_EN_1 = 0x3
00129
00130     afeb = arc0.allAFE()
00131     afeb.CONFIGURATION = 0x0032
00132     afeb.VETO_DAC = 0x20
00133     afeb.HLD_DAC = 0x30
00134     afeb.TCI_DAC = 0x20
00135     afeb.bias_dac     = 3
00136
00137     aem.TRGSEQ = 0x5f
00138
00139     # Two choices for the trigger, GEM and MiniGLT
00140     if self.lat.existsGEM():
00141       self.trigger( SimpleGasuExample() )
00142     else:
00143       raise AssertionError, "ACD cannot take meaningful triggers without a GEM"
00144
00145     # A state transition can be rejected by not returning None
00146     return None
00147
00148   def startRun(self):
00149     log.debug("userApplication.startRun()")
00150
00151     caption = "Enter number of triggers to take"
00152     if self.rc is None:
00153       cnt = self.__arg.getValue(caption)
00154     else:
00155       cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00156
00157     # The user pressed 'Cancel'
00158     if cnt is None:  return -1
00159     self.__cnt = cnt
00160
00161     # Spawn a thread to synchronize commands with events
00162     self.__cmdSynchQuit = False
00163
00164     # A state transition can be rejected by not returning None
00165     return None
00166
00167   def stopRun(self):
00168     log.debug("userApplication.stopRun()")
00169
00170     self.__cmdSynchQuit = True
00171     self.__eventSem.release()
00172
00173    # The STOP_RUN transition can not be rejected
00174
00175   def resume(self):
00176     log.debug("userApplication.resume()")
00177
00178     # Issue self trigger to make up for the one that was lost during PAUSE
00179     self.trigger().solicit()
00180
00181     return None
00182
00183   def stop (self):
00184     log.debug("userApplication.stop()")
00185
00186     return self.stopRun()
00187
00188   def teardown(self):
00189     log.debug("userApplication.teardown()")
00190     # Allow the C++ object to be deleted
00191     if self.gui is not None and self.__arg is not None:
00192       self.__arg.deleteLater()
00193
00194   def process(self, (status, buffer)):
00195     "Method called back for each data event taken"
00196     ###log.debug("userApplication.process()")
00197
00198     evtCli = self.evtCli
00199
00200     if status != 0:
00201       if evtCli.isGGLTStatus():
00202         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00203       elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00204         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00205       self.__eventSem.release()
00206       return
00207     try:
00208       # In the future this event may contain additional data
00209       if evtCli.isSweepEvent(): return
00210     except:
00211       # Event summary word inaccessible, handle the bad event here
00212       log.exception("")
00213       return
00214
00215     if evtCli.setCurrentContribution(evtCli.AEM) != -1:
00216       evtCli.evDumpEventAEM()
00217       print "AEM Veto Hit Vectors:"
00218       j = 0
00219       for hitVect in evtCli.evt.aem.vetoHitVectors:
00220         print "\tCable %2d Raw Data 0x%05x" % (j, hitVect)
00221         j+=1
00222       print "\nAEM Accept Hit Vectors:"
00223       j = 0
00224       for hitVect in evtCli.evt.aem.acceptHitVectors:
00225         print "\tCable %2d Raw Data 0x%05x" % (j, hitVect)
00226         j+=1
00227       print "\nAEM PHA Values:"
00228       j = 0
00229       for (cbl, phas) in evtCli.evt.aem.PHA.items():
00230         for pha in phas:
00231           print "\tCable: %02d - PHA Value: 0x%04x" % (cbl, pha.ui)
00232
00233     # Get next event triggered
00234     self.__eventSem.release()
00235
00236   #def __commandSynch(self, count):
00237   def commandSynch(self):
00238     "Method called by the command synchronization task"
00239     import time
00240     trigger  = self.trigger()
00241     eventSem = self.__eventSem
00242     # Drain the semaphore release count
00243     # Handles the case when the stop run release collided with a trigger release
00244     while eventSem.acquire(0):  pass
00245
00246     t0  = time.time()
00247
00248     # Compensate for the extra CMD_SELF_TRIGGER below
00249     cnt = 1
00250     count = self.__cnt
00251
00252     # Wait for START_RUN to enable triggers
00253     trigger.waitForMaskEnable()
00254
00255     trigger.solicit()                   # Issue an internal trigger
00256     eventSem.acquire()                  # Wait for the event to be processed
00257
00258     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00259
00260     while cnt < count and not self.__cmdSynchQuit:
00261       cnt += 1
00262       trigger.solicit()                 # Issue an internal trigger
00263       time.sleep(.0001)
00264       eventSem.acquire()                # Wait for the event to be processed
00265       #trigger.disable()                # Disable triggers
00266       # Do stuff
00267       #trigger.enable()                 # Enable triggers
00268
00269     t2 = trigger.getTimeStamp()         # Get the last trigger timestamp
00270
00271     if t1 is None:
00272       t1 = t0
00273     if t2 is None:
00274       t2 = time.time()
00275     dT = t2 - t1
00276     if dT == 0.0:  dT = 0.000001
00277     log.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00278              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00279
00280     # Get out of waiting when in suite or standalone mode
00281     self.sync()
00282
00283     # execute the GUI functions for stopRun, just in case
00284     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00285       if self.rc is not None:
00286         self.rc.doStop()
00287
00288   def wait(self):
00289     self.__cmdSynchSem.acquire()
00290
00291   def sync(self):
00292     if __name__ == "__main__" or self.isRunFromSuite():
00293       self.__cmdSynchSem.release()
00294
00295
00296 # Standalone mode:
00297 if __name__ == "__main__":
00298   import os
00299   log.basicConfig()
00300   log.getLogger("").setLevel(log.DEBUG)
00301   ua = userApplication(None, 321, 0)
00302   ua.rcSetup(os.path.join(os.environ['ONLINE_ROOT'], 'repos/simpleAemSchema.xml'))
00303   ua.rcStartRun()
00304   ua.wait()
00305   ua.rcStopRun()
00306   ua.rcTeardown()
00307
00308 # History:
00309 #     $Log: testAppAcd.py,v $
00310 #     Revision 1.4  2005/01/11 22:39:18  stuvi
00311 #     no message
00312 #
00313 #     Revision 1.3  2004/10/22 20:32:48  stuvi
00314 #     Fixed log.exception()
00315 #
00316 #     Revision 1.2  2004/08/18 18:00:15  stuvi
00317 #     Updated for LATTE 4.
00318 #     All hippo functions go through the Qt GUI bridge now.
00319 #
00320 #     Revision 1.1  2004/08/04 22:17:25  stuvi
00321 #     no message
00322 #
00323 #     Revision 1.19  2004/05/13 18:55:09  stuvi
00324 #     HLD_EN_0 and HLD_EN_1 no longer exist.
00325 #
00326 #     Revision 1.18  2004/05/03 21:19:47  stuvi
00327 #     Moved non-Runcontrol scripts to the support directory and modified imports accordingly.
00328 #
00329 #     Revision 1.17  2004/04/20 22:09:34  stuvi
00330 #     Changed ACD to AEM.
00331 #
00332 #     Revision 1.16  2004/04/17 02:22:54  stuvi
00333 #     Added teardown() to delete the C++ object for the userArgument
00334 #
00335 #     Revision 1.15  2004/04/08 01:57:39  panetta
00336 #     make testAppAcd work with GASU
00337 #
00338 #     Revision 1.14  2004/03/20 03:45:26  stuvi
00339 #     Updated code to use the new PHA object.
00340 #
00341 #     Revision 1.13  2004/03/10 22:24:50  panetta
00342 #     Upgraded trigger interface.
00343 #     Removed dependencies on self.glt.
00344 #
00345 #     Revision 1.12  2004/02/20 03:20:23  stuvi
00346 #     Added handling of the sweep events and error checking to the process() method,
00347 #
00348 #     Revision 1.11  2004/02/04 03:42:14  stuvi
00349 #     Changes required to make the scripts work with the new FSM engine.
00350 #
00351 #     Revision 1.10  2003/12/11 19:54:45  stuvi
00352 #     Suite and standalone mode modifications
00353 #
00354 #     Revision 1.9  2003/11/04 18:30:52  panetta
00355 #     Changed the commandSynch logic so that the enableMask() call would not pose a threat to snapshot taking.
00356 #
00357 #     Revision 1.8  2003/10/31 01:09:37  panetta
00358 #     1)  Moved register writes from startRun to setup
00359 #     2)  Added GLT enabling logic to __commandSynch
00360 #     3)  Gave example of getting the start/stop time from the hardware/event stream
00361 #
00362 #     Revision 1.7  2003/08/14 02:36:03  stuvi
00363 #     Fixed aem ui value access
00364 #
00365 #     Revision 1.6  2003/07/17 00:01:35  stuvi
00366 #     no message
00367 #
00368 #     Revision 1.5  2003/04/01 21:04:59  stuvi
00369 #     Fixed event count discrepancy when the run is stopped in the middle.
00370 #
00371 #     Revision 1.4  2003/03/31 19:28:53  stuvi
00372 #     Fixed name
00373 #
00374 #     Revision 1.3  2003/03/26 21:59:36  stuvi
00375 #     Fixed standalone mode
00376 #
00377 #     Revision 1.2  2003/03/25 04:53:52  stuvi
00378 #     Made sure the semaphores are drained
00379 #
00380 #     Revision 1.1  2003/03/11 21:20:55  stuvi
00381 #     Moved from RunControl directory
00382 #
00383 #     Revision 1.10  2003/02/21 04:08:03  stuvi
00384 #     Updated for G2
00385 #
00386 #     Revision 1.9  2003/02/06 05:19:38  claus
00387 #     Added resume; StopRun bug fix
00388 #
00389 #     Revision 1.8  2002/12/11 21:18:07  stuvi
00390 #     Changed glt register assignments to bit field assignments
00391 #
00392 #     Revision 1.7  2002/12/10 01:09:58  claus
00393 #     Added path and changed schema/config file for stand-alone mode
00394 #
00395 #     Revision 1.6  2002/12/04 01:59:23  claus
00396 #     Added message logging
00397 #
00398 #     Revision 1.5  2002/12/02 17:17:09  claus
00399 #     Added provision to allow application to run stand-alone
00400 #
00401 #     Revision 1.4  2002/11/28 02:02:03  claus
00402 #     Shuffled constructor arguments
00403 #
00404 #     Revision 1.3  2002/11/27 23:49:27  claus
00405 #     Initialize semaphore with zero count
00406 #
00407 #     Revision 1.2  2002/11/27 23:37:17  stuvi
00408 #     Added semaphor release
00409 #
00410 #     Revision 1.1  2002/11/27 05:02:47  claus
00411 #     Initial version of Run Control
00412 #
Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testAppAcdScalers.py Source File

testAppAcdScalers.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example CAL test application"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2006/07/20 20:53:34 $").split(' ')[1]
00014 __version__  = "$Revision: 1.7 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import threading
00021 import logging        as     log
00022 from   LATTE.runcontrol.rcTransitions  import rcTransitions
00023 from   LATTE.runcontrol.ArgumentImpl   import ArgumentImpl
00024 import time
00025
00026 from LATTE.trigger.TrgUsingTiles      import TrgUsingTiles
00027 from LATTE.trigger.NullObjects        import NoInputsEnabled
00028 from LATTE.trigger.rcTrgFunctions     import rcTrgEngines
00029 from LATTE.trigger.TrgEngines         import *
00030 from LATTE.trigger.rcTrgMiniGLT       import rcTrgMiniGLT
00031 from LATTE.trigger.TrgMiniGLT         import MiniGLTTrgConditionsValue
00032 from LATTE.trigger.TrgConditionsValue import *
00033
00034 import LDF
00035 import LDFdumper as LD
00036
00037 TRUE  = (0 < 1)
00038 FALSE = not TRUE
00039
00040 ASC_CONTRIBUTION = 0x101f2010
00041
00042 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00043 #  the userApplication example to get the number of self triggers to take.
00044 class userArgument(ArgumentImpl):
00045   "GUI for getting the user to input some sort of value."
00046   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00047     ArgumentImpl.__init__(self, parent, name, modal, fl)
00048     self.__value = 0
00049     self.setCaption("Hello world!")
00050
00051   def OKButtonClicked(self):
00052     self.__value = int(self.ArgumentList.text().latin1())
00053     self.close()
00054
00055   def CancelButtonClicked(self):
00056     self.__value = None
00057     self.close()
00058
00059   def getValue(self, caption):
00060     self.setCaption(caption)
00061     self.show()
00062     self.exec_loop()
00063     return self.__value
00064
00065 class userArgText(object):
00066   "Text user interface for getting the user to input some sort of value"
00067   def __init__(self):
00068     pass
00069
00070   def getValue(self, caption):
00071     return int(raw_input("%s: " % (caption)))
00072
00073
00074 #  Example application implementation.
00075 #  Note that the name of the class must be userApplication.
00076 #  Look at rcTransitions for names of other transition methods that can be used.
00077 class userApplication(rcTransitions):
00078   "Implmentation class for a user application"
00079   def __init__(self, rc, userId, debug):
00080     rcTransitions.__init__(self, rc, userId, debug)
00081     log.debug("userApplication.__init__()")
00082     self.__eventSem    = threading.Semaphore(0)
00083     self.__cmdSynchSem = threading.Semaphore(0)
00084
00085     self.__lci         = LDF.LATcomponentIterator()
00086     self.__lconti      = LDBI_LATcontributionIterator_(self.__lci)
00087     self.__ldbi        = LDF.LATdataBufferIterator(self.__lconti)
00088
00089   def getName(self):
00090     return __name__
00091
00092   def setup(self):
00093     log.debug("userApplication.setup()")
00094
00095     if self.rc is None:
00096       self.__arg = userArgText()
00097     else:
00098       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00099
00100     # Two choices for the trigger, GEM and MiniGLT
00101     if self.lat.existsGEM():
00102       self.trigger( SimpleGasuExample() )
00103     else:
00104       self.trigger( MiniGLTExample() )
00105
00106     self.rc.common().getOCS().evtHandlerSendAcdScalers(1,0)
00107
00108     # A state transition can be rejected by not returning None
00109     return None
00110
00111   def startRun(self):
00112     log.debug("userApplication.startRun()")
00113
00114     caption = "Enter number of triggers to take"
00115     if self.rc is None:
00116       cnt = self.__arg.getValue(caption)
00117     else:
00118       cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00119
00120     # The user pressed 'Cancel'
00121     if cnt is None:  return -1
00122     self.__cnt = cnt
00123
00124     # Spawn a thread to synchronize commands with events
00125     self.__cmdSynchQuit = FALSE
00126
00127     # A state transition can be rejected by not returning None
00128     return None
00129
00130   def stopRun(self):
00131     log.debug("userApplication.stopRun()")
00132
00133     self.setCompletionStatus(rcTransitions.COMPL_STATUS_PASSED)
00134     self.__cmdSynchQuit = TRUE
00135     self.__eventSem.release()
00136
00137     # The STOP_RUN transition can not be rejected
00138
00139   def resume(self):
00140     log.debug("userApplication.resume()")
00141
00142     # Issue self trigger to make up for the one that was lost during PAUSE
00143     self.trigger().solicit()
00144
00145     return None
00146
00147   def stop(self):
00148     log.debug("userApplication.stop()")
00149
00150     return self.stopRun()
00151
00152   def teardown(self):
00153     log.debug("userApplication.teardown()")
00154     # Allow the C++ object to be deleted
00155     if self.gui is not None and self.__arg is not None:
00156       self.__arg.deleteLater()
00157
00158   def process(self, (status, buffer)):
00159     "Method called back for each data event taken"
00160     #log.debug("userApplication.process()")
00161
00162     evtCli = self.evtCli
00163
00164     if status != 0:
00165       if evtCli.isGGLTStatus():
00166         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00167       elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00168         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00169       self.__eventSem.release()
00170       return
00171     try:
00172       # In the future this event may contain additional data
00173       if evtCli.isSweepEvent():
00174         print "SWEEP!!!"
00175         return
00176     except:
00177       # Event summary word inaccessible, handle the bad event here
00178       log.exception("")
00179       return
00180
00181     count = self.__ldbi.iterate(buffer, len(buffer))
00182
00183     self.__eventSem.release()
00184
00185
00186   #def __commandSynch(self, count):
00187   def commandSynch(self):
00188     "Method called by the command synchronization task"
00189     import time
00190     trigger  = self.trigger()
00191     eventSem = self.__eventSem
00192
00193     # Drain the semaphore release count
00194     # Handles the case when the stop run release collided with a trigger release
00195     while eventSem.acquire(0):  pass
00196
00197     t0  = time.time()
00198
00199     # Compensate for the extra CMD_SELF_TRIGGER below
00200     cnt   = 0
00201     count = self.__cnt
00202
00203     # Wait for START_RUN to enable triggers
00204     trigger.waitForMaskEnable()
00205
00206     while cnt < count and not self.__cmdSynchQuit:
00207       cnt += 1
00208       print "solicit"
00209       trigger.solicit()                 # Issue an internal trigger
00210       time.sleep(10)
00211
00212     # Get out of waiting when in suite or standalone mode
00213     self.sync()
00214
00215     # execute the GUI functions for stopRun, just in case
00216     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00217       if self.rc is not None:
00218         self.rc.doStop()
00219
00220   def wait(self):
00221     self.__cmdSynchSem.acquire()
00222
00223   def sync(self):
00224     if __name__ == "__main__" or self.isRunFromSuite():
00225       self.__cmdSynchSem.release()
00226
00227
00228 class MiniGLTExample(rcTrgMiniGLT):
00229   """\brief MiniTower example interface to MiniGLT
00230   """
00231   def __init__(self):
00232     """\brief AcdTriggerExample constructor
00233     """
00234     rcTrgMiniGLT.__init__(self)
00235     self.__engines      = MiniGLTTrgEngines()
00236     self.__conditions   = MiniGLTSolicitedCondition()
00237
00238   def engines(self):
00239     """\brief Implementation of engines 'pure virtual' method from TrgAbstract
00240     """
00241     return self.__engines
00242
00243   def conditions(self):
00244     """\brief Implementation of conditions 'pure virtual' method from TrgAbstract
00245     """
00246     return self.__conditions
00247
00248 # implementaions of user-level trigger classes
00249 class MiniGLTTrgEngines(rcTrgEngines):
00250   def __init__(self):
00251     rcTrgEngines.__init__(self)
00252     # There are two engines in the MiniGLT.
00253     # 0) User defined engine
00254     # 15) Marker engine
00255
00256     eng = MiniGLTSolicitedEngine()
00257     self.replaceEngine(0,eng)
00258
00259 class MiniGLTSolicitedEngine(TrgEngine):
00260   """This class defines an engine which reads out the detector
00261      whenever there is a solicited trigger.
00262      This engine is not prescaled.
00263   """
00264   def __init__(self):
00265     TrgEngine.__init__(self)
00266     self.__request = MarkerTrgReadout()
00267   def participate(self,conditionsValue):
00268     # This function relies on the programmer's knowledge that the
00269     # conditionsValue is a bitfield.
00270     cond = MiniGLTSolicitedCondition()
00271     condValue = cond.value()
00272     if conditionsValue & condValue:
00273       return True
00274     return False
00275   def prescale(self):
00276     return 0
00277   def request(self):
00278     return self.__request
00279
00280 class MiniGLTSolicitedCondition(MiniGLTTrgConditionsValue):
00281   """ Define a condition where only the CNO trigger is asserted
00282   """
00283   def __init__(self):
00284     MiniGLTTrgConditionsValue.__init__(self)
00285   def solicited(self):
00286     return True
00287
00288 class MarkerTrgReadout(TrgReadout):
00289   """\brief MarkerTrgReadout class definition
00290
00291   Directs a module to send to its Front-End Electronics a command sequence
00292   which is composed only of the TACK command. This command will trigger
00293   a readout of the module's Front-End Electronics.
00294   Zero suppression is turned on.
00295   Marker is set to 1
00296   """
00297   def __init__(self):
00298     """\brief TrgReadout constructor
00299     """
00300     TrgReadout.__init__(self)
00301
00302   def zeroSuppress(self):    return True
00303   def marker(self):          return 1
00304
00305
00306 class LDBI_LATcontributionIterator_(LDF.LDBI_LATcontributionIterator):
00307   """\brief LDBI_LATcontributionIterator implementation
00308
00309   Reimplements virtual UDF contribution handler from LATcontributionIterator
00310   This implementation checks if the contribution ID corresponds to a
00311   ACD Software Counter contribution, and parses it out into summary,
00312   cno and tile pieces.  If the contribution ID does not match the
00313   expected ID, an error message is given, and the parser returns -1, an
00314   error.
00315   """
00316   def __init__(self, lci):
00317     LDF.LDBI_LATcontributionIterator.__init__(self, lci)
00318   def UDF(self, contrib, nextContrib):
00319     if contrib.identity().value() == ASC_CONTRIBUTION:
00320       print "Hey!  I saw an ASC_CONTRIBUTION"
00321       import Numeric
00322       buffer = Numeric.fromstring(contrib.rawData(), 'i')
00323
00324       CNOstart = 16
00325       GECstart = CNOstart + 24
00326
00327       JJsummary      = buffer[0:CNOstart]
00328       JJcnoCounts    = buffer[CNOstart:GECstart]
00329       JJascHists     = buffer[GECstart:]
00330       print "JJsummary: ", JJsummary
00331       # Now something needs to be done with these.
00332
00333     else:
00334       msg = "Unexpected LATcontribution id 0x%08x seen in event" % contrib.identity().value()
00335       log.error(msg)
00336       return -1
00337
00338     return 0
00339
00340
00341 class SimpleGasuExample(TrgUsingTiles):
00342   """\brief SimpleGASU example interface to GEM
00343   """
00344   def __init__(self):
00345     """\brief SimpleGasuExample constructor
00346     """
00347     TrgUsingTiles.__init__(self)
00348     self.__inputEnables             = SGETrgInputEnables()
00349     self.__engines                  = SGETrgEngines()
00350     self.__conditions               = FullCondition()
00351
00352   # Pure Virtual function implementation
00353   def conditions(self):
00354     return self.__conditions
00355
00356   def coincidences(self):
00357     """\brief Implementation of coincdences 'pure virtual' method from TrgUsingTiles
00358     """
00359     # it just so happens that the roi is exactly the same as the coincidences object
00360     return self.roi()
00361
00362   def inputEnables(self):
00363     """\brief Implementation of inputEnables 'pure virtual' method from TrgAbstract
00364     """
00365     return self.__inputEnables
00366
00367   def engines(self):
00368     """\brief Implementation of engines 'pure virtual' method from TrgAbstract
00369     """
00370     return self.__engines
00371
00372   def useAcdAsTrigger(self):
00373     """Use ACD as a trigger source.
00374     """
00375     return True
00376
00377 # implementaions of user-level trigger classes
00378
00379 class SGETrgInputEnables(NoInputsEnabled):
00380   """Class SGETrgInputEnables:
00381      Empty Input enables.
00382   """
00383   def __init__(self):
00384     NoInputsEnabled.__init__(self)
00385
00386
00387 class SGETrgEngines(rcTrgEngines):
00388   """Class MyTrgEngines:
00389      Initialize the trigger engines list class.
00390   """
00391   def __init__(self):
00392     rcTrgEngines.__init__(self)
00393     eng1 = SolicitedEngine()
00394     eng2 = FullEngine()
00395     self.replaceEngine(0,eng1)
00396     self.replaceEngine(1,eng2)
00397
00398 class SolicitedEngine(TrgEngine):
00399   """This class defines an engine which reads out the detector
00400      whenever there is a solicited trigger.
00401      This engine is not prescaled.
00402   """
00403   def __init__(self):
00404     TrgEngine.__init__(self)
00405     self.__request = MarkerTrgReadout()
00406   def participate(self,conditionsValue):
00407     # This function relies on the programmer's knowledge that the
00408     # conditionsValue is a bitfield.
00409     cond = SolicitedCondition()
00410     if conditionsValue & cond.value():
00411       return True
00412     return False
00413   def prescale(self):
00414     return 0
00415   def request(self):
00416     return self.__request
00417
00418 class SolicitedCondition(TrgConditionsValue):
00419   """ Define a condition where only the solicited trigger is asserted
00420   """
00421   def __init__(self):
00422     TrgConditionsValue.__init__(self)
00423   def solicited(self):
00424     return True
00425
00426 class FullCondition(TrgConditionsValue):
00427   """ Define a condition where only the solicited trigger is asserted
00428   """
00429   def __init__(self):
00430     TrgConditionsValue.__init__(self)
00431   def solicited(self):   return True
00432   def roi(self):         return True
00433   def calLow(self):      return True
00434   def calHigh(self):     return True
00435   def tkr(self):         return True
00436   def periodic(self):    return True
00437   def cno(self):         return True
00438   def external(self):    return True
00439
00440 class FullEngine(TrgEngine):
00441   def __init__(self):
00442     TrgEngine.__init__(self)
00443     self.__request = TrgReadout()
00444   def participate(self,conditionsValue):
00445     # This function relies on the programmer's knowledge that the
00446     # conditionsValue is a bitfield.
00447     cond = FullCondition()
00448     if conditionsValue & cond.value():
00449       return True
00450     return False
00451   def prescale(self):    return 0
00452   def request(self):     return self.__request
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testAppAlarm.py Source File

testAppAlarm.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example CAL test application that tests rule alarms, use with simpleAlarmSchema.xml"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/03/21 17:58:12 $").split(' ')[1]
00014 __version__  = "$Revision: 1.4 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import threading
00021 import logging        as     log
00022 from   LATTE.runcontrol.rcTransitions  import rcTransitions
00023 from   LATTE.runcontrol.ArgumentImpl   import ArgumentImpl
00024 #from   rcHouseKeeping import rcHouseKeeping
00025 import time
00026
00027 from support.SimpleGasuExample   import *
00028 from support.MiniGLTExample      import *
00029
00030 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00031 #  the userApplication example to get the number of self triggers to take.
00032 class userArgument(ArgumentImpl):
00033   "GUI for getting the user to input some sort of value."
00034   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00035     ArgumentImpl.__init__(self, parent, name, modal, fl)
00036     self.__value = 0
00037     self.setCaption("Hello world!")
00038
00039   def OKButtonClicked(self):
00040     self.__value = int(self.ArgumentList.text().latin1())
00041     self.close()
00042
00043   def CancelButtonClicked(self):
00044     self.__value = None
00045     self.close()
00046
00047   def getValue(self, caption):
00048     self.setCaption(caption)
00049     self.show()
00050     self.exec_loop()
00051     return self.__value
00052
00053 class userArgText(object):
00054   "Text user interface for getting the user to input some sort of value"
00055   def __init__(self):
00056     pass
00057
00058   def getValue(self, caption):
00059     return int(raw_input("%s: " % (caption)))
00060
00061
00062 #  Example application implementation.
00063 #  Note that the name of the class must be userApplication.
00064 #  Look at rcTransitions for names of other transition methods that can be used.
00065 class userApplication(rcTransitions):
00066   "Implmentation class for a user application"
00067   def __init__(self, rc, userId, debug):
00068     rcTransitions.__init__(self, rc, userId, debug)
00069     log.debug("userApplication.__init__()")
00070     self.__eventSem    = threading.Semaphore(0)
00071     self.__cmdSynchSem = threading.Semaphore(0)
00072
00073   def getName(self):
00074     return __name__
00075
00076   def setup(self):
00077     log.debug("userApplication.setup()")
00078
00079     if self.rc is None:
00080       self.__arg = userArgText()
00081     else:
00082       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00083
00084     # Get a TEM instance
00085     if self.lat.TEMcnt() == 1:
00086       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00087     elif self.lat.TEMcnt() > 1:
00088       tem = self.lat.TEM.all()
00089     else:
00090       log.fatal("No TEM(s) found in the schema")
00091       return -1
00092
00093     tic = tem.TIC
00094
00095     # Retrieve the global rule list for this schema
00096     rules = self.lat.getRules()
00097
00098     # Access any of the rule objects and call clearAllActions() to clear actions.
00099     rules.values()[0].clearAllActions()
00100     # For the adc_tem_digital_3_3v register, associate the voltageMonitor rule's
00101     # yellowAction with the yellowAlarm1 method.
00102     rules['voltageMonitor'].registerAction('yellowAction', self.yellowAlarm1,
00103                                             sender=tic.regs['adc_tem_digital_3_3v'])
00104     # For all other registers using the voltageMonitor rule, associate this rule's
00105     # yellowAction with the yellowAlarm2 method.
00106     rules['tempMonitor'].registerAction('yellowAction', self.yellowAlarm2)
00107     # For all registers using the voltageMonitor rule, associate this rule's
00108     # redAction with the redAlarm method.
00109     rules['voltageMonitor'].registerAction('redAction', self.redAlarm)
00110     # The application can unregister any of the actions that it previously
00111     # registered using the following method call.
00112     #rules['voltageMonitor'].unregisterAction('redAction', self.redAlarm)
00113
00114
00115
00116     # reset the TEM since we are going to modify DATA_MASKS
00117     tem.CMD_RESET = 1
00118
00119     # clear TEM stats reg
00120     tem.COMMAND_RESPONSE = 0
00121
00122     # clear TEM status reg
00123     tem.STATUS = 0
00124
00125     # enable CAL, disable TKR, no diag #  0x10FF for diag
00126     tem.DATA_MASKS = 0x00FF
00127
00128     # TEM config reg # set TEM timeout
00129     tem.CONFIGURATION = 0
00130
00131     #status = gTEMread( __GT, temId, TEM_REG_CONFIGURATION, &payload);
00132     #printf("tem config reg = 0x%08x\n", payload);
00133
00134     # enable output in our GCCCs
00135     # broadcast load of GCCC_REG_CONFIGURATION
00136
00137     bcast_ccc = tem.allCCC()
00138     bcast_ccc.CONFIGURATION = 0x80000000L
00139
00140     #  disable all GCRCs in all GCCCs via broadcast # GCCC_REG_LAYER_MASK_0, GCCC_REG_LAYER_MASK_1
00141     bcast_ccc.LAYER_MASK_0 = 0xFFFFFFFFL
00142     bcast_ccc.LAYER_MASK_1 = 0xFFFFFFFFL
00143     ccc0 = tem.downCCC(0) # O$GCCC_00
00144     ccc0.LAYER_MASK_0 = 0xFFFF0000L
00145     ccc0.LAYER_MASK_1 = 0xFFFF000FL
00146     ccc2 = tem.downCCC(2) # O$GCCC_02
00147     ccc2.LAYER_MASK_0 = 0xFFFF0000L
00148     ccc2.LAYER_MASK_1 = 0xFFFF0000L
00149
00150     # config GCFE for calibration -- range 0 first
00151     bcast_cfe = tem.allCCC().allCRC().allCFE()
00152     bcast_cfe.CONFIG_0    = 0x00
00153     bcast_cfe.CONFIG_1    = 0x36
00154     bcast_cfe.FLE_DAC     = 0x55
00155     bcast_cfe.FHE_DAC     = 0x55
00156     bcast_cfe.LOG_ACPT    = 0x10
00157     bcast_cfe.RNG_ULD_DAC = 0x7F
00158     bcast_cfe.REF_DAC     = 0x7f
00159
00160     # config GCRC for calibration
00161     bcast_crc = tem.allCCC().allCRC()
00162     bcast_crc.DELAY_1 = 0xFF
00163     bcast_crc.DELAY_2 = 0xFF
00164     bcast_crc.DELAY_3 = 0xFF
00165     bcast_crc.DAC = 0x42FE
00166     bcast_crc.DAC = 0x42FE
00167
00168     # large timeouts for all GCCCs
00169     # broadcast load of GCCC_REG_EVENT_TIMEOUTS
00170     bcast_ccc.EVENT_TIMEOUTS = 0x0
00171     #status = gGCCCread( __GT, temId, 1, GCCC_REG_EVENT_TIMEOUTS, &payload);
00172     #printf("gccc register event timeouts = 0x%08x\n", payload);
00173
00174     # Register environment variables for housekeeping
00175     #hsk = self.getHSK()
00176     #regs = [tem.regs['data_masks'], ccc2.regs['layer_mask_1']]
00177     #hsk.addEnvRegs(regs)
00178     #hsk.setUpdateInterval(1)
00179
00180     # Two choices for the trigger, GEM and MiniGLT
00181     if self.lat.existsGEM():
00182       self.trigger( SimpleGasuExample() )
00183     else:
00184       self.trigger( MiniGLTExample() )
00185
00186     # A state transition can be rejected by not returning None
00187     return None
00188
00189   def startRun(self):
00190     log.debug("userApplication.startRun()")
00191
00192     caption = "Enter number of triggers to take"
00193     if self.rc is None:
00194       cnt = self.__arg.getValue(caption)
00195     else:
00196       cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00197
00198     # The user pressed 'Cancel'
00199     if cnt is None:  return -1
00200     self.__cnt = cnt
00201
00202     # Spawn a thread to synchronize commands with events
00203     self.__cmdSynchQuit = False
00204
00205     # A state transition can be rejected by not returning None
00206     return None
00207
00208   def stopRun(self):
00209     log.debug("userApplication.stopRun()")
00210
00211     self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00212     self.__cmdSynchQuit = True
00213     self.__eventSem.release()
00214
00215     # The STOP_RUN transition can not be rejected
00216
00217   def resume(self):
00218     log.debug("userApplication.resume()")
00219
00220     # Issue self trigger to make up for the one that was lost during PAUSE
00221     self.trigger().solicit()
00222
00223     return None
00224
00225   def stop(self):
00226     log.debug("userApplication.stop()")
00227     return self.stopRun()
00228
00229   def process(self, (status, buffer)):
00230     "Method called back for each data event taken"
00231     #log.debug("userApplication.process()")
00232
00233     evtCli = self.evtCli
00234
00235     if status != 0:
00236       if evtCli.isGGLTStatus():
00237         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00238       elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00239         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00240       self.__eventSem.release()
00241       return
00242     try:
00243       # In the future this event may contain additional data
00244       if evtCli.isSweepEvent(): return
00245     except:
00246       # Event summary word inaccessible, handle the bad event here
00247       import gutil
00248       gutil.logException()
00249       return
00250
00251     #evtCli.evDumpCAL_LogAccepts();
00252     ###print ""
00253     #evtCli.evDumpCAL_Logs();
00254     #~ #print ""
00255     #~ #evtCli.evDumpTKR()
00256     ###evtCli.evDumpTEM_Error()
00257     ###evtCli.evDumpDiagnostic()
00258     ###for acc in evtCli.evt.CAL_LogAccepts:
00259     ###  print "CAL Log Accept: 0x%08x" % acc.ui
00260
00261     ###for data in evtCli.evt.CAL_LogData:
00262     ###  print "CAL Log Data: 0x%08x" % data.ui
00263     #~ sum = evtCli.evt.summary
00264     ###evtCli.evDumpSummary()
00265
00266     # Get next event triggered
00267     self.__eventSem.release()
00268
00269
00270   #def __commandSynch(self, count):
00271   def commandSynch(self):
00272     "Method called by the command synchronization task"
00273     import time
00274     trigger  = self.trigger()
00275     eventSem = self.__eventSem
00276
00277     # Drain the semaphore release count
00278     # Handles the case when the stop run release collided with a trigger release
00279     while eventSem.acquire(0):  pass
00280
00281     t0  = time.time()
00282
00283     # Compensate for the extra CMD_SELF_TRIGGER below
00284     cnt   = 1
00285     count = self.__cnt
00286
00287     # Wait for START_RUN to enable triggers
00288     trigger.waitForMaskEnable()
00289
00290     trigger.solicit()                   # Issue an internal trigger
00291     eventSem.acquire()                  # Wait for the event to be processed
00292
00293     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00294
00295     while cnt < count and not self.__cmdSynchQuit:
00296       cnt += 1
00297       trigger.solicit()                 # Issue an internal trigger
00298       time.sleep(.0001)
00299       eventSem.acquire()                # Wait for the event to be processed
00300       #trigger.disable()                # Disable triggers
00301       # Do stuff
00302       #trigger.enable()                 # Enable triggers
00303
00304     t2 = trigger.getTimeStamp()                 # Get the last trigger timestamp
00305
00306     if t1 is None:
00307       t1 = t0
00308     if t2 is None:
00309       t2 = time.time()
00310     dT = t2 - t1
00311     if dT == 0.0:  dT = 0.000001
00312     log.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00313              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00314
00315     # Get out of waiting when in suite or standalone mode
00316     self.sync()
00317
00318     # execute the GUI functions for stopRun, just in case
00319     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00320       if self.rc is not None:
00321         self.rc.doStop()
00322
00323   def wait(self):
00324     self.__cmdSynchSem.acquire()
00325
00326   def sync(self):
00327     if __name__ == "__main__" or self.isRunFromSuite():
00328       self.__cmdSynchSem.release()
00329
00330   def yellowAlarm1(self, value, signal, sender, sendNode):
00331     print "Yellow Alarm #1!", value, signal, "from", sender.getName()
00332
00333   def yellowAlarm2(self, value, signal, sender, sendNode):
00334     print sender
00335     print sender.getName()
00336     print sendNode
00337     print "Yellow Alarm #2!", value, signal, "from", sender.getName()
00338
00339   def redAlarm(self, value, signal, sender):
00340     print "Red Alarm!", value, signal, "from", sender.getName()
00341
00342
00343 # Standalone mode:
00344 if __name__ == "__main__":
00345   import os
00346   log.basicConfig()
00347   log.getLogger("").setLevel(log.DEBUG)
00348   ua = userApplication(None, 321, 0)
00349   ua.rcSetup(os.path.join(os.environ['ONLINE_ROOT'], 'repos/simpleTemSchema.xml'))
00350   ua.rcStartRun()
00351   ua.wait()
00352   ua.rcStopRun()
00353   ua.rcTeardown()
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testAppArchiver.py Source File

testAppArchiver.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example script to test custom archiver testArchiver"
00012 __author__   = "S. Tuvi <STuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/03/21 17:58:12 $").split(' ')[1]
00014 __version__  = "$Revision: 1.3 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import threading
00021 import logging        as     log
00022 from   LATTE.runcontrol.rcTransitions  import rcTransitions
00023 from   LATTE.runcontrol.ArgumentImpl   import ArgumentImpl
00024 #from   rcHouseKeeping import rcHouseKeeping
00025 import time
00026 import support.testArchiver as testArchiver
00027
00028 from support.SimpleGasuExample   import *
00029 from support.MiniGLTExample      import *
00030
00031 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00032 #  the userApplication example to get the number of self triggers to take.
00033 class userArgument(ArgumentImpl):
00034   "GUI for getting the user to input some sort of value."
00035   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00036     ArgumentImpl.__init__(self, parent, name, modal, fl)
00037     self.__value = 0
00038     self.setCaption("Hello world!")
00039
00040   def OKButtonClicked(self):
00041     self.__value = int(self.ArgumentList.text().latin1())
00042     self.close()
00043
00044   def CancelButtonClicked(self):
00045     self.__value = None
00046     self.close()
00047
00048   def getValue(self, caption):
00049     self.setCaption(caption)
00050     self.show()
00051     self.exec_loop()
00052     return self.__value
00053
00054 class userArgText(object):
00055   "Text user interface for getting the user to input some sort of value"
00056   def __init__(self):
00057     pass
00058
00059   def getValue(self, caption):
00060     return int(raw_input("%s: " % (caption)))
00061
00062
00063 #  Example application implementation.
00064 #  Note that the name of the class must be userApplication.
00065 #  Look at rcTransitions for names of other transition methods that can be used.
00066 class userApplication(rcTransitions):
00067   "Implmentation class for a user application"
00068   def __init__(self, rc, userId, debug):
00069     rcTransitions.__init__(self, rc, userId, debug)
00070     log.debug("userApplication.__init__()")
00071     self.__eventSem    = threading.Semaphore(0)
00072     self.__cmdSynchSem = threading.Semaphore(0)
00073     self.setArchiverClass(testArchiver.testArchiver)
00074
00075   def getName(self):
00076     return __name__
00077
00078   def setup(self):
00079     log.debug("userApplication.setup()")
00080
00081     if self.rc is None:
00082       self.__arg = userArgText()
00083     else:
00084       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00085
00086     # Get a TEM instance
00087     if self.lat.TEMcnt() == 1:
00088       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00089     elif self.lat.TEMcnt() > 1:
00090       tem = self.lat.TEM.all()
00091     else:
00092       log.fatal("No TEM(s) found in the schema")
00093       return -1
00094
00095     # reset the TEM since we are going to modify DATA_MASKS
00096     tem.CMD_RESET = 1
00097
00098     # clear TEM stats reg
00099     tem.COMMAND_RESPONSE = 0
00100
00101     # clear TEM status reg
00102     tem.STATUS = 0
00103
00104     # enable CAL, disable TKR, no diag #  0x10FF for diag
00105     tem.DATA_MASKS = 0x00FF
00106
00107     # TEM config reg # set TEM timeout
00108     tem.CONFIGURATION = 0
00109
00110     #status = gTEMread( __GT, temId, TEM_REG_CONFIGURATION, &payload);
00111     #printf("tem config reg = 0x%08x\n", payload);
00112
00113     # enable output in our GCCCs
00114     # broadcast load of GCCC_REG_CONFIGURATION
00115
00116     bcast_ccc = tem.allCCC()
00117     bcast_ccc.CONFIGURATION = 0x80000000L
00118
00119     #  disable all GCRCs in all GCCCs via broadcast # GCCC_REG_LAYER_MASK_0, GCCC_REG_LAYER_MASK_1
00120     bcast_ccc.LAYER_MASK_0 = 0xFFFFFFFFL
00121     bcast_ccc.LAYER_MASK_1 = 0xFFFFFFFFL
00122     ccc0 = tem.downCCC(0) # O$GCCC_00
00123     ccc0.LAYER_MASK_0 = 0xFFFF0000L
00124     ccc0.LAYER_MASK_1 = 0xFFFF000FL
00125     ccc2 = tem.downCCC(2) # O$GCCC_02
00126     ccc2.LAYER_MASK_0 = 0xFFFF0000L
00127     ccc2.LAYER_MASK_1 = 0xFFFF0000L
00128
00129     # config GCFE for calibration -- range 0 first
00130     bcast_cfe = tem.allCCC().allCRC().allCFE()
00131     bcast_cfe.CONFIG_0    = 0x00
00132     bcast_cfe.CONFIG_1    = 0x36
00133     bcast_cfe.FLE_DAC     = 0x55
00134     bcast_cfe.FHE_DAC     = 0x55
00135     bcast_cfe.LOG_ACPT    = 0x10
00136     bcast_cfe.RNG_ULD_DAC = 0x7F
00137     bcast_cfe.REF_DAC     = 0x7f
00138
00139     # config GCRC for calibration
00140     bcast_crc = tem.allCCC().allCRC()
00141     bcast_crc.DELAY_1 = 0xFF
00142     bcast_crc.DELAY_2 = 0xFF
00143     bcast_crc.DELAY_3 = 0xFF
00144     bcast_crc.DAC = 0x42FE
00145     bcast_crc.DAC = 0x42FE
00146
00147     # large timeouts for all GCCCs
00148     # broadcast load of GCCC_REG_EVENT_TIMEOUTS
00149     bcast_ccc.EVENT_TIMEOUTS = 0x0
00150     #status = gGCCCread( __GT, temId, 1, GCCC_REG_EVENT_TIMEOUTS, &payload);
00151     #printf("gccc register event timeouts = 0x%08x\n", payload);
00152
00153     # Register environment variables for housekeeping
00154     #hsk = self.getHSK()
00155     #regs = [tem.regs['data_masks'], ccc2.regs['layer_mask_1']]
00156     #hsk.addEnvRegs(regs)
00157     #hsk.setUpdateInterval(1)
00158
00159     # Two choices for the trigger, GEM and MiniGLT
00160     if self.lat.existsGEM():
00161       self.trigger( SimpleGasuExample() )
00162     else:
00163       self.trigger( MiniGLTExample() )
00164
00165     # A state transition can be rejected by not returning None
00166     return None
00167
00168   def startRun(self):
00169     log.debug("userApplication.startRun()")
00170
00171     caption = "Enter number of triggers to take"
00172     if self.rc is None:
00173       cnt = self.__arg.getValue(caption)
00174     else:
00175       cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00176
00177     # The user pressed 'Cancel'
00178     if cnt is None:  return -1
00179     self.__cnt = cnt
00180
00181     # Spawn a thread to synchronize commands with events
00182     self.__cmdSynchQuit = False
00183
00184     # Example of how to use the archiver userMethod()
00185     self.getArchiverInstance().userMethod("test1", "test2")
00186
00187     # A state transition can be rejected by not returning None
00188     return None
00189
00190   def stopRun(self):
00191     log.debug("userApplication.stopRun()")
00192
00193     self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00194     self.__cmdSynchQuit = True
00195     self.__eventSem.release()
00196     #self.__cmdSynch.join(2.0)
00197     #if self.__cmdSynch.isAlive():
00198     #  log.error("%s.%s: cmdSynch thread did not exit when expected" % \
00199     #            (self.getName(), "stopRun"))
00200
00201     # The STOP_RUN transition can not be rejected
00202
00203   def resume(self):
00204     log.debug("userApplication.resume()")
00205
00206     # Issue self trigger to make up for the one that was lost during PAUSE
00207     self.trigger().solicit()
00208
00209     return None
00210
00211   def stop(self):
00212     log.debug("userApplication.stop()")
00213
00214     return self.stopRun()
00215
00216   def process(self, (status, buffer)):
00217     "Method called back for each data event taken"
00218     #log.debug("userApplication.process()")
00219
00220     evtCli = self.evtCli
00221
00222     if status != 0:
00223       if evtCli.isGGLTStatus():
00224         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00225       elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00226         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00227       self.__eventSem.release()
00228       return
00229     try:
00230       # In the future this event may contain additional data
00231       if evtCli.isSweepEvent(): return
00232     except:
00233       # Event summary word inaccessible, handle the bad event here
00234       import gutil
00235       gutil.logException()
00236       return
00237
00238     #evtCli.evDumpCAL_LogAccepts();
00239     ###print ""
00240     #evtCli.evDumpCAL_Logs();
00241     #~ #print ""
00242     #~ #evtCli.evDumpTKR()
00243     ###evtCli.evDumpTEM_Error()
00244     ###evtCli.evDumpDiagnostic()
00245     ###for acc in evtCli.evt.CAL_LogAccepts:
00246     ###  print "CAL Log Accept: 0x%08x" % acc.ui
00247
00248     ###for data in evtCli.evt.CAL_LogData:
00249     ###  print "CAL Log Data: 0x%08x" % data.ui
00250     #~ sum = evtCli.evt.summary
00251     ###evtCli.evDumpSummary()
00252
00253     # Get next event triggered
00254     self.__eventSem.release()
00255
00256
00257   #def __commandSynch(self, count):
00258   def commandSynch(self):
00259     "Method called by the command synchronization task"
00260     import time
00261     trigger  = self.trigger()
00262     eventSem = self.__eventSem
00263
00264     # Drain the semaphore release count
00265     # Handles the case when the stop run release collided with a trigger release
00266     while eventSem.acquire(0):  pass
00267
00268     t0  = time.time()
00269
00270     # Compensate for the extra CMD_SELF_TRIGGER below
00271     cnt   = 1
00272     count = self.__cnt
00273
00274     # Wait for START_RUN to enable triggers
00275     trigger.waitForMaskEnable()
00276
00277     trigger.solicit()                   # Issue an internal trigger
00278     eventSem.acquire()                  # Wait for the event to be processed
00279
00280     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00281
00282     while cnt < count and not self.__cmdSynchQuit:
00283       cnt += 1
00284       trigger.solicit()                 # Issue an internal trigger
00285       time.sleep(.0001)
00286       eventSem.acquire()                # Wait for the event to be processed
00287       #trigger.disable()                # Disable triggers
00288       # Do stuff
00289       #trigger.enable()                 # Enable triggers
00290
00291     t2 = trigger.getTimeStamp()         # Get the last trigger timestamp
00292
00293     if t1 is None:
00294       t1 = t0
00295     if t2 is None:
00296       t2 = time.time()
00297     dT = t2 - t1
00298     if dT == 0.0:  dT = 0.000001
00299     log.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00300              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00301
00302     # Get out of waiting when in suite or standalone mode
00303     self.sync()
00304
00305     # execute the GUI functions for stopRun, just in case
00306     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00307       if self.rc is not None:
00308         self.rc.doStop()
00309
00310   def wait(self):
00311     self.__cmdSynchSem.acquire()
00312
00313   def sync(self):
00314     if __name__ == "__main__" or self.isRunFromSuite():
00315       self.__cmdSynchSem.release()
00316
00317
00318 # Standalone mode:
00319 if __name__ == "__main__":
00320   import os
00321   log.basicConfig()
00322   log.getLogger("").setLevel(log.DEBUG)
00323   ua = userApplication(None, 321, 0)
00324   ua.rcSetup(os.path.join(os.environ['ONLINE_ROOT'], 'repos/simpleTemSchema.xml'))
00325   ua.rcStartRun()
00326   ua.wait()
00327   ua.rcStopRun()
00328   ua.rcTeardown()
00329
00330 # History:
00331 #     $Log: testAppArchiver.py,v $
00332 #     Revision 1.3  2005/03/21 17:58:12  claus
00333 #     Modified to use the first TEM found in the schema, if only one is there, or
00334 #     broadcast to all TEMs if there are multiple.
00335 #
00336 #     Revision 1.2  2004/08/26 22:35:36  stuvi
00337 #     Converted from LATTE 3
00338 #
00339 #     Revision 1.1  2004/08/26 02:01:23  stuvi
00340 #     Fixed for LATTE 4
00341 #
00342 #     Revision 1.4  2004/05/03 21:19:47  stuvi
00343 #     Moved non-Runcontrol scripts to the support directory and modified imports accordingly.
00344 #
00345 #     Revision 1.3  2004/03/10 22:24:50  panetta
00346 #     Upgraded trigger interface.
00347 #     Removed dependencies on self.glt.
00348 #
00349 #     Revision 1.2  2004/03/06 01:18:26  stuvi
00350 #     Added userMethod example
00351 #
00352 #     Revision 1.1  2004/02/20 00:33:44  stuvi
00353 #     Sample testArchiver app and class
00354 #
00355 #
00356
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testAppCal.py Source File

testAppCal.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example CAL test application"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/05/17 01:32:14 $").split(' ')[1]
00014 __version__  = "$Revision: 1.12 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import            threading
00021 import logging as log
00022 import            time
00023
00024 from   LATTE.runcontrol.rcTransitions  import rcTransitions
00025 from   LATTE.runcontrol.ArgumentImpl   import ArgumentImpl
00026 #from   rcHouseKeeping import rcHouseKeeping
00027
00028 from support.SimpleGasuExample   import *
00029 from support.MiniGLTExample      import *
00030
00031
00032 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00033 #  the userApplication example to get the number of self triggers to take.
00034 class userArgument(ArgumentImpl):
00035   "GUI for getting the user to input some sort of value."
00036   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00037     ArgumentImpl.__init__(self, parent, name, modal, fl)
00038     self.__value = 0
00039     self.setCaption("Hello world!")
00040
00041   def OKButtonClicked(self):
00042     self.__value = int(self.ArgumentList.text().latin1())
00043     self.close()
00044
00045   def CancelButtonClicked(self):
00046     self.__value = None
00047     self.close()
00048
00049   def getValue(self, caption):
00050     self.setCaption(caption)
00051     self.show()
00052     self.exec_loop()
00053     return self.__value
00054
00055 class userArgText(object):
00056   "Text user interface for getting the user to input some sort of value"
00057   def __init__(self):
00058     pass
00059
00060   def getValue(self, caption):
00061     return int(raw_input("%s: " % (caption)))
00062
00063
00064 #  Example application implementation.
00065 #  Note that the name of the class must be userApplication.
00066 #  Look at rcTransitions for names of other transition methods that can be used.
00067 class userApplication(rcTransitions):
00068   "Implmentation class for a user application"
00069   def __init__(self, rc, userId, debug):
00070     rcTransitions.__init__(self, rc, userId, debug)
00071     log.debug("userApplication.__init__()")
00072     self.__eventSem    = threading.Semaphore(0)
00073     self.__cmdSynchSem = threading.Semaphore(0)
00074
00075   def getName(self):
00076     return __name__
00077
00078   def setup(self):
00079     log.debug("userApplication.setup()")
00080
00081     if self.rc is None:
00082       self.__arg = userArgText()
00083     else:
00084       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00085
00086     # Get a TEM instance
00087     if self.lat.TEMcnt() == 1:
00088       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00089     elif self.lat.TEMcnt() > 1:
00090       tem = self.lat.TEM.all()
00091     else:
00092       log.fatal("No TEM(s) found in the schema")
00093       return -1
00094
00095     # reset the TEM since we are going to modify DATA_MASKS
00096     #tem.CMD_RESET = 1
00097
00098     # clear TEM stats reg
00099     tem.COMMAND_RESPONSE = 0
00100
00101     # clear TEM status reg
00102     tem.STATUS = 0
00103
00104     # enable CAL, disable TKR, no diag #  0x10FF for diag
00105     #tem.DATA_MASKS = 0x10FF
00106
00107     # TEM config reg # set TEM timeout
00108     #tem.CONFIGURATION = 0x00000000 # Set primary
00109     #tem.CONFIGURATION = 0x03000000 # Set redundant
00110
00111     #status = gTEMread( __GT, temId, TEM_REG_CONFIGURATION, &payload);
00112     #printf("tem config reg = 0x%08x\n", payload);
00113
00114     # enable output in our GCCCs
00115     # broadcast load of GCCC_REG_CONFIGURATION
00116
00117 # Move to schema
00118 #    bcast_ccc = tem.allCCC()
00119 #    bcast_ccc.CONFIGURATION = 0x80000000L
00120
00121 #    #  disable all GCRCs in all GCCCs via broadcast # GCCC_REG_LAYER_MASK_0, GCCC_REG_LAYER_MASK_1
00122 #    bcast_ccc.LAYER_MASK_0 = 0xFFFFFFFFL
00123 #    bcast_ccc.LAYER_MASK_1 = 0xFFFFFFFFL
00124 #    ccc0 = tem.downCCC(0) # O$GCCC_00
00125 #    ccc0.LAYER_MASK_0 = 0xFFFF0000L
00126 #    ccc0.LAYER_MASK_1 = 0xFFFF000FL
00127 #    ccc2 = tem.downCCC(2) # O$GCCC_02
00128 #    ccc2.LAYER_MASK_0 = 0xFFFF0000L
00129 #    ccc2.LAYER_MASK_1 = 0xFFFF0000L
00130
00131     # config GCFE for calibration -- range 0 first
00132     #bcast_cfe = tem.allCCC().allCRC().allCFE()
00133     #bcast_cfe.CONFIG_0    = 0x00
00134     #bcast_cfe.CONFIG_1    = 0x36
00135     #bcast_cfe.FLE_DAC     = 0x55
00136     #bcast_cfe.FHE_DAC     = 0x55
00137     #bcast_cfe.LOG_ACPT    = 0x10
00138     #bcast_cfe.RNG_ULD_DAC = 0x7F
00139     #bcast_cfe.REF_DAC     = 0x7f
00140
00141     # config GCRC for calibration
00142     #bcast_crc = tem.allCCC().allCRC()
00143     #bcast_crc.DELAY_1 = 0xFF
00144     #bcast_crc.DELAY_2 = 0xFF
00145     #bcast_crc.DELAY_3 = 0xFF
00146     #bcast_crc.DAC = 0x42FE
00147     #bcast_crc.DAC = 0x42FE
00148
00149     # large timeouts for all GCCCs
00150     # broadcast load of GCCC_REG_EVENT_TIMEOUTS
00151     # bcast_ccc.EVENT_TIMEOUTS = 0x0
00152     #status = gGCCCread( __GT, temId, 1, GCCC_REG_EVENT_TIMEOUTS, &payload);
00153     #printf("gccc register event timeouts = 0x%08x\n", payload);
00154
00155     # Register environment variables for housekeeping
00156     #hsk = self.getHSK()
00157     #regs = [tem.regs['data_masks'], ccc2.regs['layer_mask_1']]
00158     #hsk.addEnvRegs(regs)
00159     #hsk.setUpdateInterval(1)
00160
00161     # Two choices for the trigger, GEM and MiniGLT
00162     if self.lat.existsGEM():
00163       self.trigger( SimpleGasuExample() )
00164     else:
00165       self.trigger( MiniGLTExample() )
00166
00167     # A state transition can be rejected by not returning None
00168     return None
00169
00170   def startRun(self):
00171     log.debug("userApplication.startRun()")
00172
00173     caption = "Enter number of triggers to take"
00174     if self.rc is None:
00175       cnt = self.__arg.getValue(caption)
00176     else:
00177       cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00178
00179     # The user pressed 'Cancel'
00180     if cnt is None:  return -1
00181     self.__cnt = cnt
00182
00183     if self.rc is not None:
00184       self.getParameterVerifier().add(caption, cnt)
00185
00186     # Spawn a thread to synchronize commands with events
00187     self.__cmdSynchQuit = False
00188
00189     # A state transition can be rejected by not returning None
00190     return None
00191
00192   def stopRun(self):
00193     log.debug("userApplication.stopRun()")
00194
00195     if self.getBadEvents() == 0 and self.getErrorEvents() == 0:
00196       self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00197     else:
00198       self.setCompletionStatus(self.COMPL_STATUS_FAILED)
00199
00200     self.__cmdSynchQuit = True
00201     self.__eventSem.release()
00202
00203     # The STOP_RUN transition can not be rejected
00204
00205   def resume(self):
00206     log.debug("userApplication.resume()")
00207
00208     # Issue self trigger to make up for the one that was lost during PAUSE
00209     self.trigger().solicit()
00210
00211     return None
00212
00213   def stop(self):
00214     log.debug("userApplication.stop()")
00215
00216     return self.stopRun()
00217
00218   def teardown(self):
00219     log.debug("userApplication.teardown()")
00220     # Allow the C++ object to be deleted
00221     if self.rc is not None and self.__arg is not None:
00222       self.__arg.deleteLater()
00223
00224   def process(self, (status, buffer)):
00225     "Method called back for each data event taken"
00226     #log.debug("userApplication.process()")
00227
00228     evtCli = self.evtCli
00229
00230     if status != 0:
00231       if evtCli.isGGLTStatus():
00232         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00233       elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00234         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00235       self.__eventSem.release()
00236       return
00237     try:
00238       # In the future this event may contain additional data
00239       if evtCli.isSweepEvent(): return
00240     except:
00241       # Event summary word inaccessible, handle the bad event here
00242       log.exception("")
00243       return
00244
00245     if self.lat.existsGEM():
00246       if evtCli.setCurrentContribution(evtCli.GEM) != -1:
00247         evtCli.evDumpGEM()
00248       else:
00249         log.error("*******************************************")
00250         log.error("*   NO GEM CONTRIBUTION PRESENT           *")
00251         log.error("*******************************************")
00252
00253     if evtCli.setCurrentContribution(evtCli.TEM0) != -1:
00254       evtCli.evDumpCAL_LogAccepts()
00255       ###print ""
00256       evtCli.evDumpCAL_Logs();
00257       #~ #print ""
00258       evtCli.evDumpTKR()
00259       evtCli.evDumpTEM_Error()
00260       evtCli.evDumpDiagnostic()
00261       #for acc in evtCli.evt.CAL_LogAccepts:
00262       #  print "CAL Log Accept: 0x%08x" % acc.ui
00263
00264       #for layerLogData in evtCli.evt.CAL_LogData:
00265       #  print "CAL Log Data: %s 0x%08x" % layerLogData.layer, layerLogData.data
00266       #  sum = evtCli.evt.summary
00267       ###evtCli.evDumpSummary()
00268
00269       #for errorGCCC in evtCli.evt.errGCCCmsg:
00270       #  errGCCC = errorGCCC.errGCCC
00271       #  print "GCCC", errorGCCC.gccc, "Error:", hex(errGCCC.errParm), hex(errGCCC.sweepNum), hex(errGCCC.errType)
00272
00273       #for calDiag in evtCli.evt.diag.cal:
00274       #  print calDiag.layer, calDiag.gccc, calDiag.negLayerEnd, calDiag.posLayerEnd
00275       #print
00276       #for tkrDiag in evtCli.evt.diag.tkr:
00277       #  print tkrDiag.gtcc, tkrDiag.trgRequests
00278     else:
00279       log.error("*******************************************")
00280       log.error("*   NO TEM 0 CONTRIBUTION PRESENT         *")
00281       log.error("*******************************************")
00282
00283     # Get next event triggered
00284     self.__eventSem.release()
00285
00286
00287   #def __commandSynch(self, count):
00288   def commandSynch(self):
00289     "Method called by the command synchronization task"
00290     import time
00291     trigger  = self.trigger()
00292     eventSem = self.__eventSem
00293
00294     # Drain the semaphore release count
00295     # Handles the case when the stop run release collided with a trigger release
00296     while eventSem.acquire(0):  pass
00297
00298     t0  = time.time()
00299
00300     # Compensate for the extra CMD_SELF_TRIGGER below
00301     cnt   = 1
00302     count = self.__cnt
00303
00304     # Wait for START_RUN to enable triggers
00305     trigger.waitForMaskEnable()
00306
00307     trigger.solicit()                   # Issue an internal trigger
00308     eventSem.acquire()                  # Wait for the event to be processed
00309
00310     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00311     while cnt < count and not self.__cmdSynchQuit:
00312       cnt += 1
00313       trigger.solicit()                 # Issue an internal trigger
00314       time.sleep(.0001)
00315       eventSem.acquire()                # Wait for the event to be processed
00316       #trigger.disable()                # Disable triggers
00317       # Do stuff
00318       #trigger.enable()                 # Enable triggers
00319
00320     t2 = trigger.getTimeStamp()                 # Get the last trigger timestamp
00321
00322     if t1 is None:
00323       t1 = t0
00324     if t2 is None:
00325       t2 = time.time()
00326     dT = t2 - t1
00327     if dT == 0.0:  dT = 0.000001
00328     log.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00329              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00330
00331     # Get out of waiting when in suite or standalone mode
00332     self.sync()
00333
00334     # execute the GUI functions for stopRun, just in case
00335     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00336       if self.rc is not None:
00337         self.rc.doStop()
00338
00339   def wait(self):
00340     self.__cmdSynchSem.acquire()
00341
00342   def sync(self):
00343     if self.rc is None or self.isRunFromSuite():
00344       self.__cmdSynchSem.release()
00345
00346 class userApplicationCallbacks(rcTransitions.ApplicationCallbacks):
00347   def __init__(self):
00348     pass
00349
00350   def beforeSetup(self, app):
00351     log.info("Before setup")
00352
00353   def beforeStartRun(self, app):
00354     log.info("Before startRun")
00355
00356   def afterStopRun(self, app):
00357     log.info("After stopRun")
00358
00359
00360 # Standalone mode:
00361 if __name__ == "__main__":
00362   from LATTE.runcontrol.RunControlCommon import RunControlCommon
00363
00364   rcCommon = RunControlCommon()
00365   rcCommon.initialize()
00366   rcCommon.setLoggingLevel("INFO")
00367   rcCommon.connect()
00368   ua = userApplication(None, 321, rcCommon)
00369   ua.rcSetup()
00370   ua.rcStartRun()
00371   ua.wait()
00372   ua.rcStopRun()
00373   ua.rcTeardown()
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testAppCal_dg.py Source File

testAppCal_dg.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example CAL test application"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/03/21 17:58:12 $").split(' ')[1]
00014 __version__  = "$Revision: 1.7 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import            threading
00021 import logging as log
00022 import            time
00023
00024 from   LATTE.runcontrol.rcTransitions  import rcTransitions
00025 from   LATTE.runcontrol.ArgumentImpl   import ArgumentImpl
00026 #from   rcHouseKeeping import rcHouseKeeping
00027
00028 from support.SimpleGasuExample   import *
00029 from support.MiniGLTExample      import *
00030
00031 import LDF
00032 import Numeric
00033
00034
00035 OneDgContrib = True # Select between two custom LATcontribution methods
00036
00037 class CAL_LATcontribution(object):
00038   def __init__(self, buf):
00039     # For application level contributions, offset the typeID value from the
00040     # subsystem base values defined in LDF/include/LATidentity.h.
00041     #   The primary value identifies the structure of the contribution.
00042     #   The secondary value identifies the version of that structure.
00043     primary   = LDF.LATprimaryId().Base_CAL   + 0
00044     secondary = LDF.LATsecondaryId().Base_CAL + 0
00045
00046     # Pad the contributions with zeros to force it to be an integer number of
00047     # longwords in length
00048     remainder = len(buf) & 0x3
00049     if remainder:  buf += "\x00\x00\x00"[0:4-remainder]
00050
00051     typeId = LDF.LATtypeId(primary, secondary)
00052     length = len(buf)                   # 16 bit contribution length in bytes
00053     opaque = 0                          # User defined 16 bit quantity
00054
00055     assert (length < 0x10000), "LATcontribution length is > 64K: %d" % (length)
00056
00057     # Need to prepend some space for the LATcontribution header items
00058     # I would prefer to hide this in the LDF package, but don't know how, now
00059     buf = (len(LDF.LATcontribution()) * " ") + buf
00060
00061     # The following may byteswap
00062     self.__contrib = LDF.LATcontribution.create(typeId, length, opaque, buf)
00063
00064   def __str__(self):
00065     """Helper python method so that we can take the str() of this object"""
00066     return self.__contrib.string()
00067
00068   def __len__(self):
00069     """Helper python method so that we can take the len() of this object"""
00070     return self.__contrib.length()
00071
00072
00073 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00074 #  the userApplication example to get the number of self triggers to take.
00075 class userArgument(ArgumentImpl):
00076   "GUI for getting the user to input some sort of value."
00077   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00078     ArgumentImpl.__init__(self, parent, name, modal, fl)
00079     self.__value = 0
00080     self.setCaption("Hello world!")
00081
00082   def OKButtonClicked(self):
00083     self.__value = int(self.ArgumentList.text().latin1())
00084     self.close()
00085
00086   def CancelButtonClicked(self):
00087     self.__value = None
00088     self.close()
00089
00090   def getValue(self, caption):
00091     self.setCaption(caption)
00092     self.show()
00093     self.exec_loop()
00094     return self.__value
00095
00096 class userArgText(object):
00097   "Text user interface for getting the user to input some sort of value"
00098   def __init__(self):
00099     pass
00100
00101   def getValue(self, caption):
00102     return int(raw_input("%s: " % (caption)))
00103
00104
00105 #  Example application implementation.
00106 #  Note that the name of the class must be userApplication.
00107 #  Look at rcTransitions for names of other transition methods that can be used.
00108 class userApplication(rcTransitions):
00109   "Implmentation class for a user application"
00110   def __init__(self, rc, userId, debug):
00111     rcTransitions.__init__(self, rc, userId, debug)
00112     log.debug("userApplication.__init__()")
00113     self.__eventSem    = threading.Semaphore(0)
00114     self.__cmdSynchSem = threading.Semaphore(0)
00115
00116   def getName(self):
00117     return __name__
00118
00119   def setup(self):
00120     log.debug("userApplication.setup()")
00121
00122     if self.rc is None:
00123       self.__arg = userArgText()
00124     else:
00125       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00126
00127     # Get a TEM instance
00128     if self.lat.TEMcnt() == 1:
00129       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00130     elif self.lat.TEMcnt() > 1:
00131       tem = self.lat.TEM.all()
00132     else:
00133       log.fatal("No TEM(s) found in the schema")
00134       return -1
00135
00136     #----- The following RESETs and other system register manipulation is
00137     #----- commented out as it is handled by RunControl.  Other register
00138     #----- setup should be taken care of in the schema/configuration file.
00139     # reset the TEM since we are going to modify DATA_MASKS
00140     #tem.CMD_RESET = 1
00141
00142     # clear TEM stats reg
00143     tem.COMMAND_RESPONSE = 0
00144
00145     # clear TEM status reg
00146     tem.STATUS = 0
00147
00148     # enable CAL, disable TKR, no diag #  0x10FF for diag
00149     #tem.DATA_MASKS = 0x10FF
00150
00151     # TEM config reg # set TEM timeout
00152     #tem.CONFIGURATION = 0
00153
00154     #status = gTEMread( __GT, temId, TEM_REG_CONFIGURATION, &payload);
00155     #printf("tem config reg = 0x%08x\n", payload);
00156
00157     # enable output in our GCCCs
00158     # broadcast load of GCCC_REG_CONFIGURATION
00159
00160     #bcast_ccc = tem.allCCC()
00161     #bcast_ccc.CONFIGURATION = 0x80000000L
00162
00163     #  disable all GCRCs in all GCCCs via broadcast # GCCC_REG_LAYER_MASK_0, GCCC_REG_LAYER_MASK_1
00164     #bcast_ccc.LAYER_MASK_0 = 0xFFFFFFFFL
00165     #bcast_ccc.LAYER_MASK_1 = 0xFFFFFFFFL
00166     #ccc0 = tem.downCCC(0) # O$GCCC_00
00167     #ccc0.LAYER_MASK_0 = 0xFFFF0000L
00168     #ccc0.LAYER_MASK_1 = 0xFFFF000FL
00169     #ccc2 = tem.downCCC(2) # O$GCCC_02
00170     #ccc2.LAYER_MASK_0 = 0xFFFF0000L
00171     #ccc2.LAYER_MASK_1 = 0xFFFF0000L
00172
00173     # config GCFE for calibration -- range 0 first
00174     #bcast_cfe = tem.allCCC().allCRC().allCFE()
00175     #bcast_cfe.CONFIG_0    = 0x00
00176     #bcast_cfe.CONFIG_1    = 0x36
00177     #bcast_cfe.FLE_DAC     = 0x55
00178     #bcast_cfe.FHE_DAC     = 0x55
00179     #bcast_cfe.LOG_ACPT    = 0x10
00180     #bcast_cfe.RNG_ULD_DAC = 0x7F
00181     #bcast_cfe.REF_DAC     = 0x7f
00182
00183     # config GCRC for calibration
00184     #bcast_crc = tem.allCCC().allCRC()
00185     #bcast_crc.DELAY_1 = 0xFF
00186     #bcast_crc.DELAY_2 = 0xFF
00187     #bcast_crc.DELAY_3 = 0xFF
00188     #bcast_crc.DAC = 0x42FE
00189     #bcast_crc.DAC = 0x42FE
00190
00191     # large timeouts for all GCCCs
00192     # broadcast load of GCCC_REG_EVENT_TIMEOUTS
00193     #bcast_ccc.EVENT_TIMEOUTS = 0x0
00194     #status = gGCCCread( __GT, temId, 1, GCCC_REG_EVENT_TIMEOUTS, &payload);
00195     #printf("gccc register event timeouts = 0x%08x\n", payload);
00196
00197     # Register environment variables for housekeeping
00198     #hsk = self.getHSK()
00199     #regs = [tem.regs['data_masks'], ccc2.regs['layer_mask_1']]
00200     #hsk.addEnvRegs(regs)
00201     #hsk.setUpdateInterval(1)
00202
00203     # Two choices for the trigger, GEM and MiniGLT
00204     if self.lat.existsGEM():
00205       self.trigger( SimpleGasuExample() )
00206     else:
00207       self.trigger( MiniGLTExample() )
00208
00209     # Override the default event handler
00210     self.selectEventHandler(rcTransitions.EVENT_HANDLER_LEAN_AND_MEAN)
00211
00212     # A state transition can be rejected by not returning None
00213     return None
00214
00215   def startRun(self):
00216     log.debug("userApplication.startRun()")
00217
00218     caption = "Enter number of triggers to take"
00219     if self.rc is None:
00220       cnt = self.__arg.getValue(caption)
00221     else:
00222       cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00223
00224     # The user pressed 'Cancel'
00225     if cnt is None:  return -1
00226     self.__cnt = cnt
00227
00228     self.getParameterVerifier().add(caption, cnt)
00229
00230     calHdr  = "HDR:"
00231     calHdr += "LEN=%d:" % (9999)
00232     calHdr += "VERSION=%2d:" % (6)
00233     calHdr += "USERSEGMENT:"
00234     calHdr += "{'comment':"
00235     calHdr += " 'Comprehensive Functional Test (CPT) on CAL FM101 at 20.0 MHz and 3.3 volts', "
00236     calHdr += "'tackdelay': %d, " % (70)
00237     calHdr += "'leGain': %d, " % (5)
00238     calHdr += "'heGain': %d, " % (0)
00239     calHdr += "'app': '%s', " % (self.getName())  #'calf_mu_optical')
00240     calHdr += "'feconfig_0': %d, " % (517)
00241
00242     array  = Numeric.array_str(2*Numeric.ones((4,4,12)))
00243     calHdr += "'feconfig_1list': array(%s), " % (array)
00244
00245     calHdr += "'fourRngFlag': %s, " % ('True')
00246     calHdr += "'suppression': %s" % ('False')
00247     calHdr += "}"
00248
00249     if OneDgContrib:
00250       # Two methods to add a LATcontribution to the data stream:
00251       # 1)  Build a datagram containing the CAL_LATcontribution
00252       archiver = self.getArchiverInstance()
00253       if archiver is not None and not archiver.isClosed():
00254         import struct
00255         lc = CAL_LATcontribution(calHdr)
00256         dg = LDF.LATdatagram()
00257         dg = struct.pack('>2L', dg.ID, len(dg) + len(lc))
00258         archiver.writeTuple((dg, str(lc)))
00259     else:
00260       # 2) Prebuild the CAL_LATcontribution and prepend it to the first event
00261       #    in process(), below.
00262       self.__latCon = str(CAL_LATcontribution(calHdr))
00263
00264     # Spawn a thread to synchronize commands with events
00265     self.__cmdSynchQuit = False
00266
00267     # A state transition can be rejected by not returning None
00268     return None
00269
00270   def stopRun(self):
00271     log.debug("userApplication.stopRun()")
00272
00273     if self.getBadEvents() == 0 and self.getErrorEvents() == 0:
00274       self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00275     else:
00276       self.setCompletionStatus(self.COMPL_STATUS_FAILED)
00277
00278     self.__cmdSynchQuit = True
00279     self.__eventSem.release()
00280
00281     # The STOP_RUN transition can not be rejected
00282
00283   def resume(self):
00284     log.debug("userApplication.resume()")
00285
00286     # Issue self trigger to make up for the one that was lost during PAUSE
00287     self.trigger().solicit()
00288
00289     return None
00290
00291   def stop(self):
00292     log.debug("userApplication.stop()")
00293
00294     return self.stopRun()
00295
00296   def teardown(self):
00297     log.debug("userApplication.teardown()")
00298     # Allow the C++ object to be deleted
00299     if self.rc is not None and self.__arg is not None:
00300       self.__arg.deleteLater()
00301
00302   def process(self, (status, latDatagram)):
00303     "Method called back for each data event taken"
00304     #log.debug("userApplication.process()")
00305
00306     #evtCli = self.evtCli
00307
00308     if status != 0:
00309       #if evtCli.isGGLTStatus():
00310       log.error("%s.process(): GGLT_STATUS = 0x%08x = %d", self.getName(), status, status)
00311       #log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00312       #elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00313       #  log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00314     #try:
00315     #  # In the future this event may contain additional data
00316     #  if evtCli.isSweepEvent(): return
00317     #except:
00318     #  # Event summary word inaccessible, handle the bad event here
00319     #  log.exception()
00320     #  return
00321
00322     # Get next event triggered
00323     #self.__eventSem.release()
00324
00325     if not OneDgContrib:
00326       if self.__latCon is None:  return
00327
00328       latCon = self.__latCon
00329       self.__latCon = None
00330       return latCon, latDatagram[8:]
00331
00332   def commandSynch(self):
00333     "Method called by the command synchronization task"
00334     import time
00335     trigger  = self.trigger()
00336     eventSem = self.__eventSem
00337
00338     # Drain the semaphore release count
00339     # Handles the case when the stop run release collided with a trigger release
00340     while eventSem.acquire(0):  pass
00341
00342     t0  = time.time()
00343
00344     # Compensate for the extra CMD_SELF_TRIGGER below
00345     cnt   = 1
00346     count = self.__cnt
00347
00348     # Wait for START_RUN to enable triggers
00349     trigger.waitForMaskEnable()
00350
00351     trigger.solicit()                   # Issue an internal trigger
00352     #eventSem.acquire()                  # Wait for the event to be processed
00353
00354     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00355     while cnt < count and not self.__cmdSynchQuit:
00356       cnt += 1
00357       trigger.solicit()                 # Issue an internal trigger
00358       time.sleep(.0001)
00359       #eventSem.acquire()                # Wait for the event to be processed
00360       #trigger.disable()                # Disable triggers
00361       # Do stuff
00362       #trigger.enable()                 # Enable triggers
00363
00364     t2 = trigger.getTimeStamp()                 # Get the last trigger timestamp
00365
00366     if t1 is None:
00367       t1 = t0
00368     if t2 is None:
00369       t2 = time.time()
00370     dT = t2 - t1
00371     if dT == 0.0:  dT = 0.000001
00372     log.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00373              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00374
00375     # Get out of waiting when in suite or standalone mode
00376     self.sync()
00377
00378     # execute the GUI functions for stopRun, just in case
00379     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00380       if self.rc is not None:
00381         self.rc.doStop()
00382
00383   def wait(self):
00384     self.__cmdSynchSem.acquire()
00385
00386   def sync(self):
00387     if __name__ == "__main__" or self.isRunFromSuite():
00388       self.__cmdSynchSem.release()
00389
00390
00391 # Standalone mode:
00392 if __name__ == "__main__":
00393   import os
00394   log.basicConfig()
00395   log.getLogger("").setLevel(log.DEBUG)
00396   ua = userApplication(None, 321, 0)
00397   prefs = {'datasave': 1, 'datadir':os.path.join(os.environ['ONLINE_ROOT'],'temp')}
00398   ua.setPrefs(prefs)
00399   ua.rcSetup(os.path.join(os.environ['ONLINE_ROOT'], 'repos/simpleTemSchema.xml'))
00400   ua.rcStartRun()
00401   ua.wait()
00402   ua.rcStopRun()
00403   ua.rcTeardown()
00404
00405 # History:
00406 #     $Log: testAppCal_dg.py,v $
00407 #     Revision 1.7  2005/03/21 17:58:12  claus
00408 #     Modified to use the first TEM found in the schema, if only one is there, or
00409 #     broadcast to all TEMs if there are multiple.
00410 #
00411 #     Revision 1.6  2004/11/01 23:09:39  claus
00412 #     Added a comment.
00413 #
00414 #     Revision 1.5  2004/10/30 01:52:20  stuvi
00415 #     Check if the archiver is None before accessing it.
00416 #
00417 #     Revision 1.4  2004/10/25 02:44:43  panetta
00418 #     Fixes regarding byteswapping and error contribution
00419 #
00420 #     Revision 1.3  2004/10/23 23:50:33  claus
00421 #     Added completionStatus logic.
00422 #
00423 #     Revision 1.2  2004/10/18 01:00:19  claus
00424 #     Provided switch between 2 examples of adding custom LATcontributions.
00425 #
00426 #     Revision 1.4  2004/08/31 03:13:38  stuvi
00427 #     Integrated the parameter verifier with Run Control
00428 #
00429 #     Revision 1.3  2004/08/18 18:00:15  stuvi
00430 #     Updated for LATTE 4.
00431 #     All hippo functions go through the Qt GUI bridge now.
00432 #
00433 #     Revision 1.2  2004/08/13 04:46:22  claus
00434 #     Got rid of obsolete TRUE and FALSE declarations.
00435 #
00436 #     Revision 1.1  2004/07/28 21:24:00  stuvi
00437 #     Added testAppCal and its supporting classes.
00438 #
00439 #     Revision 1.28  2004/07/09 23:14:17  stuvi
00440 #     Added "operatorobj" preference that contains the rcUser object and left the "operator" preference to contain the user name.
00441 #
00442 #     Revision 1.27  2004/05/03 22:49:36  stuvi
00443 #     Added commented out code example that demonstrates how to access the CAL and TKR diagnostics contributions.
00444 #
00445 #     Revision 1.26  2004/05/03 21:19:47  stuvi
00446 #     Moved non-Runcontrol scripts to the support directory and modified imports accordingly.
00447 #
00448 #     Revision 1.25  2004/04/21 21:05:29  stuvi
00449 #     Added an example of how to pass the preferences using the setPrefs method when running in standalone mode.
00450 #
00451 #     Revision 1.24  2004/04/17 02:23:48  stuvi
00452 #     Added teardown() to delete the C++ object for the userArgument
00453 #     Fixed LogData parsing based on the evtCli changes
00454 #
00455 #     Revision 1.23  2004/03/31 01:01:19  stuvi
00456 #     Added commented code on how to parse the error contribution.
00457 #
00458 #     Revision 1.22  2004/03/10 22:24:51  panetta
00459 #     Upgraded trigger interface.
00460 #     Removed dependencies on self.glt.
00461 #
00462 #     Revision 1.21  2004/03/04 23:08:47  stuvi
00463 #     Removed glt.destination assignment
00464 #
00465 #     Revision 1.20  2004/02/20 03:20:23  stuvi
00466 #     Added handling of the sweep events and error checking to the process() method,
00467 #
00468 #     Revision 1.19  2004/02/13 03:13:25  stuvi
00469 #     Sweep events are also sent to user script's process event now, so added code to handle the case.
00470 #
00471 #     Revision 1.18  2004/02/02 23:14:00  stuvi
00472 #     Changes required to make the scripts work with the new FSM engine.
00473 #
00474 #     Revision 1.17  2004/01/30 04:33:44  claus
00475 #     Updated for transitions not running in the GUI thread.
00476 #     New commandSynch handling.
00477 #
00478 #     Revision 1.16  2003/12/19 02:05:26  stuvi
00479 #     Added support for creating and updating GUIs from a suite
00480 #
00481 #     Revision 1.15  2003/12/11 02:22:35  stuvi
00482 #     Suite and standalone mode modifications
00483 #
00484 #     Revision 1.14  2003/12/11 01:53:16  stuvi
00485 #     Modified code to support suites.
00486 #
00487 #     Revision 1.13  2003/11/25 02:16:12  stuvi
00488 #     Modified according to the current test setup to generate some results
00489 #
00490 #     Revision 1.12  2003/11/04 04:25:11  stuvi
00491 #     Changed the commandSynch logic so that the enableMask() call would not pose a threat to snapshot taking.
00492 #
00493 #     Revision 1.11  2003/10/31 01:09:37  panetta
00494 #     1)  Moved register writes from startRun to setup
00495 #     2)  Added GLT enabling logic to __commandSynch
00496 #     3)  Gave example of getting the start/stop time from the hardware/event stream
00497 #
00498 #     Revision 1.10  2003/10/28 03:17:34  stuvi
00499 #     Added support for calculating the event rate correctly using the new GLT behaviour.
00500 #
00501 #     Revision 1.9  2003/08/21 21:13:38  stuvi
00502 #     no message
00503 #
00504 #     Revision 1.8  2003/07/17 00:01:35  stuvi
00505 #     no message
00506 #
00507 #     Revision 1.7  2003/06/13 23:26:24  stuvi
00508 #     Added TEM reset
00509 #
00510 #     Revision 1.6  2003/04/12 02:38:34  stuvi
00511 #     Added Cancel button handler to argument class
00512 #
00513 #     Revision 1.5  2003/04/09 00:45:15  stuvi
00514 #     Commented out references to DATA_MASKS register which should not be touched during script execution.
00515 #
00516 #     Revision 1.4  2003/04/01 21:04:59  stuvi
00517 #     Fixed event count discrepancy when the run is stopped in the middle.
00518 #
00519 #     Revision 1.3  2003/03/31 19:23:44  stuvi
00520 #     Fixed name
00521 #
00522 #     Revision 1.2  2003/03/26 21:59:36  stuvi
00523 #     Fixed standalone mode
00524 #
00525 #     Revision 1.1  2003/03/11 21:20:55  stuvi
00526 #     Moved from RunControl directory
00527 #
00528 #     Revision 1.8  2003/02/06 05:19:38  claus
00529 #     Added resume; StopRun bug fix
00530 #
00531 #     Revision 1.7  2003/02/06 04:14:35  claus
00532 #     Fixed StopRun bug
00533 #
00534 #     Revision 1.6  2002/12/11 21:18:07  stuvi
00535 #     Changed glt register assignments to bit field assignments
00536 #
00537 #     Revision 1.5  2002/12/10 01:09:58  claus
00538 #     Added path and changed schema/config file for stand-alone mode
00539 #
00540 #     Revision 1.4  2002/12/04 01:59:23  claus
00541 #     Added message logging
00542 #
00543 #     Revision 1.3  2002/12/02 17:17:09  claus
00544 #     Added provision to allow application to run stand-alone
00545 #
00546 #     Revision 1.2  2002/11/28 02:02:04  claus
00547 #     Shuffled constructor arguments
00548 #
00549 #     Revision 1.1  2002/11/27 05:02:48  claus
00550 #     Initial version of Run Control
00551 #
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testAppEvt.py Source File

testAppEvt.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example EBF event handling test application"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "2/25/2003"
00014 __version__  = "$Revision: 1.6 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import                      threading
00020 import logging       as     log
00021 from   LATTE.runcontrol.rcTransitions import rcTransitions
00022 from   LATTE.runcontrol.ArgumentImpl  import ArgumentImpl
00023 import                      time
00024 import                      math
00025 import                      sys
00026
00027 from support.SimpleGasuExample   import *
00028 from support.MiniGLTExample      import *
00029
00030 import LDF
00031
00032 import Numeric as Numeric
00033
00034
00035 def _unsigned(arg):
00036   """\brief Convert an unsigned int argument to an unsigned long
00037
00038   This funtion exists to help format unsigned ints greater than 0x7fffffff,
00039   which in Python 2.4 and up will be displayed as signed strings.
00040   """
00041   return arg & (2L * sys.maxint + 1)
00042
00043
00044 class myLATcomponentIterator(LDF.LATcomponentIterator):
00045   def __init__(self):
00046     LDF.LATcomponentIterator.__init__(self)
00047
00048   def UDFcomponent(self, event, ebfContribution):
00049     print ""
00050     print "Undefined EBF component"
00051     return 0
00052
00053   def GLTcomponent(self, event, gemContribution):
00054     data = Numeric.fromstring(gemContribution.data(), 'i')
00055     print "GEM data: %08x %08x" % (_unsigned(data[0]), _unsigned(data[1]))
00056     print "Time = %f" % (gemContribution.timeFloat())
00057     return 0
00058
00059   def ACDcomponent(self, event, aemContribution):
00060     print "ACD summary word        = 0x%08x" % (aemContribution.summary())
00061     print "ACD contribution length = %d"     % (aemContribution.length())
00062     data = Numeric.fromstring(aemContribution.data(), 'i')
00063     for i in range(aemContribution.payloadSize() >> 2):
00064       print "ACD data[%3d]: 0x%08x" % (i, _unsigned(data[i]))
00065     return 0
00066
00067   def CALcomponent(self, event, calContribution):
00068     print "CAL summary word        = 0x%08x" % (calContribution.summary())
00069     print "CAL contribution length = %d"     % (calContribution.length())
00070     print "CAL accepts             = 0x%08x" % (calContribution.logAccepts())
00071     data = Numeric.fromstring(calContribution.data(), 'i')
00072     for i in range(calContribution.numLogAccepts()):
00073       print "CAL Log Data[%3d]: 0x%08x" % (i, _unsigned(data[i]))
00074
00075     #evt  = data[0:384]
00076     #evt.shape = (4,4,2,12)
00077     #evt = Numeric.swapaxes(evt,0,1)
00078     #evt = Numeric.resize(evt, (4,8,12))
00079     return 0
00080
00081   def TKRcomponent(self, event, tkrContribution):
00082     print "TKR summary word        = 0x%08x" % (tkrContribution.summary())
00083     print "TKR contribution length = %d"     % (tkrContribution.length())
00084     array = 8*4*' '          # 8 longwords of space to receive accepts
00085     accepts = Numeric.fromstring(tkrContribution.acceptsMask(event, array), 'i')
00086     print "TKR accepts             = 0x%03x 0x%03x 0x%03x 0x%03x 0x%03x 0x%03x 0x%03x 0x%03x" % \
00087           (accepts[0], accepts[1], accepts[2], accepts[3],
00088            accepts[4], accepts[5], accepts[6], accepts[7])
00089     data = Numeric.fromstring(tkrContribution.data(event), 'i')
00090     for i in range(tkrContribution.numAccepts(event)):
00091       print "TKR data[%3d]: 0x%08x" % (i, _unsigned(data[i]))
00092     return 0
00093
00094
00095 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00096 #  the userApplication example to get the number of self triggers to take.
00097 class userArgument(ArgumentImpl):
00098   "GUI for getting the user to input some sort of value."
00099   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00100     ArgumentImpl.__init__(self, parent, name, modal, fl)
00101     self.__value = 0
00102     self.setCaption("Hello world!")
00103
00104   def OKButtonClicked(self):
00105     self.__value = int(self.ArgumentList.text().latin1())
00106     self.close()
00107
00108   def CancelButtonClicked(self):
00109     self.__value = None
00110     self.close()
00111
00112   def getValue(self, caption):
00113     self.setCaption(caption)
00114     self.show()
00115     self.exec_loop()
00116     return self.__value
00117
00118 class userArgText(object):
00119   "Text user interface for getting the user to input some sort of value"
00120   def __init__(self):
00121     pass
00122
00123   def getValue(self, caption):
00124     return int(raw_input("%s: " % (caption)))
00125
00126
00127 #  Example application implementation.
00128 #  Note that the name of the class must be userApplication.
00129 #  Look at rcTransitions for names of other transition methods that can be used.
00130 class userApplication(rcTransitions):
00131   "Implmentation class for a user application"
00132   def __init__(self, rc, userId, debug):
00133     rcTransitions.__init__(self, rc, userId, debug)
00134     log.debug("userApplication.__init__()")
00135     self.__eventSem    = threading.Semaphore(0)
00136     self.__cmdSynchSem = threading.Semaphore(0)
00137     self.__lci         = myLATcomponentIterator()
00138     self.__ldbi        = LDF.LATdataBufferIterator(self.__lci)
00139
00140   def getName(self):
00141     return __name__
00142
00143   def setup(self):
00144     log.debug("userApplication.setup()")
00145
00146     if self.rc is None:
00147       self.__arg = userArgText()
00148     else:
00149       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00150
00151     # Get a TEM instance
00152     if self.lat.TEMcnt() == 1:
00153       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00154     elif self.lat.TEMcnt() > 1:
00155       tem = self.lat.TEM.all()
00156     else:
00157       log.fatal("No TEM(s) found in the schema")
00158       return -1
00159
00160     if tem is not None:
00161       # clear TEM stats reg
00162       tem.COMMAND_RESPONSE = 0
00163
00164       # clear TEM status reg
00165       tem.STATUS = 0
00166     else:
00167       log.fatal("No TEM found in the schema: aborting...")
00168       return -1
00169
00170     ccc2 = tem.downCCC(2) # O$GCCC_02
00171     ccc2.LAYER_MASK_1 = 0x3BFD3FFFL
00172
00173     # Two choices for the trigger, GEM and MiniGLT
00174     if self.lat.existsGEM():
00175       self.trigger( SimpleGasuExample() )
00176     else:
00177       self.trigger( MiniGLTExample() )
00178
00179     # A state transition can be rejected by not returning None
00180     return None
00181
00182   def startRun(self):
00183     log.debug("userApplication.startRun()")
00184
00185     caption = "Enter number of triggers to take"
00186     if self.rc is None:
00187       cnt = self.__arg.getValue(caption)
00188     else:
00189       cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00190
00191     if cnt is None:  return -1
00192     self.__cnt = cnt
00193
00194     # Spawn a thread to synchronize commands with events
00195     self.__cmdSynchQuit = False
00196
00197     # A state transition can be rejected by not returning None
00198     return None
00199
00200   def stopRun(self):
00201     log.debug("userApplication.stopRun()")
00202
00203     self.setCompletionStatus(self.COMPL_STATUS_SUCCESS)
00204     self.__cmdSynchQuit = True
00205     self.__eventSem.release()
00206
00207     # The STOP_RUN transition can not be rejected
00208
00209   def resume(self):
00210     log.debug("userApplication.resume()")
00211
00212     # Issue self trigger to make up for the one that was lost during PAUSE
00213     self.trigger().solicit()
00214
00215     return None
00216
00217   def stop(self):
00218     log.debug("userApplication.stop()")
00219
00220     return self.stopRun()
00221
00222   def teardown(self):
00223     log.debug("userApplication.teardown()")
00224     # Allow the C++ object to be deleted
00225     if self.rc is not None and self.__arg is not None:
00226       self.__arg.deleteLater()
00227
00228   def process(self, (status, buffer)):
00229     "Method called back for each data event taken"
00230     ##log.debug("userApplication.process()")
00231
00232     evtCli = self.evtCli
00233
00234     if status == 0:
00235      if 0:                              # One _OR_ the other method, not both
00236       self.__ldbi.iterate(buffer, len(buffer))
00237      else:                              # Old way of doing things
00238        pass
00239     else:
00240       if evtCli.isGGLTStatus():
00241         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00242       elif not evtCli.checkOnlineStatus(status, evtCli.PLAYBACK_ERROR):
00243         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00244       self.__eventSem.release()
00245       return
00246
00247     try:
00248       # In the future this event may contain additional data
00249       if evtCli.isSweepEvent(): return
00250     except:
00251       # Event summary word inaccessible, handle the bad event here
00252       log.exception("")
00253       return
00254
00255     print "Event Size           =", evtCli.getEvtSize()
00256     print "Event Status         =", evtCli.getEvtStatus()
00257     ts = evtCli.evGetTimestamp()
00258     print "Event Timestamp (GMT)=", time.asctime(time.gmtime(ts)), \
00259                                     "and", int(math.modf(ts)[0]*1000), "ms"
00260     contList = evtCli.getContributionList()
00261     for cId in contList:
00262       evtCli.setCurrentContribution(cId)
00263       if cId.startswith('TEM'):
00264         evtCli.evDumpSummary()
00265         evtCli.evDumpCAL_LogAccepts()
00266         evtCli.evDumpCAL_Logs()
00267         evtCli.evDumpTKR()
00268         evtCli.evDumpTEM_Error()
00269         evtCli.evDumpDiagnostic()
00270         for acc in evtCli.evt.CAL_LogAccepts:
00271           print "CAL Log Accept: 0x%08x" % acc.ui
00272
00273         for logData in evtCli.evt.CAL_LogData:
00274           print "CAL Log Data: 0x%08x" % logData.data.ui
00275       elif cId == 'ACD':
00276         evtCli.evDumpSummary()
00277         evtCli.evDumpEventAEM()
00278         print "AEM Veto Hit Vectors:"
00279         j = 0
00280         for hitVect in evtCli.evt.aem.vetoHitVectors:
00281           print "\tCable %2d Raw Data 0x%05x" % (j, hitVect)
00282           j+=1
00283         print "\nAEM Accept Hit Vectors:"
00284         j = 0
00285         for hitVect in evtCli.evt.aem.acceptHitVectors:
00286           print "\tCable %2d Raw Data 0x%05x" % (j, hitVect)
00287           j+=1
00288         print "\nAEM PHA Values:"
00289         j = 0
00290         for pha in evtCli.evt.aem.PHA:
00291           print "\tPHA Value: 0x%04x" % pha
00292
00293     # Get next event triggered
00294     self.__eventSem.release()
00295
00296   #def __commandSynch(self, count):
00297   def commandSynch(self):
00298     "Method called by the command synchronization task"
00299     import time
00300     trigger  = self.trigger()
00301     eventSem = self.__eventSem
00302     # Drain the semaphore release count
00303     # Handles the case when the stop run release collided with a trigger release
00304     while eventSem.acquire(0):  pass
00305
00306     t0  = time.time()
00307
00308     # Compensate for the extra CMD_SELF_TRIGGER below
00309     cnt = 1
00310     count = self.__cnt
00311
00312     # Wait for START_RUN to enable triggers
00313     trigger.waitForMaskEnable()
00314
00315     trigger.solicit()                   # Issue an internal trigger
00316     eventSem.acquire()                  # Wait for the event to be processed
00317
00318     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00319
00320     while cnt < count and not self.__cmdSynchQuit:
00321       cnt += 1
00322       trigger.solicit()                 # Issue an internal trigger
00323       time.sleep(.0001)
00324       eventSem.acquire()                # Wait for the event to be processed
00325       #trigger.disable()                # Disable triggers
00326       # Do stuff
00327       #trigger.enable()                 # Enable triggers
00328
00329     t2 = trigger.getTimeStamp()                 # Get the last trigger timestamp
00330     # When we get here the triggers should still be enabled.
00331     # If the glt.MASK needs to be set through any other means
00332     # then it needs to be restored to its SETUP value here.
00333
00334     if t1 is None:
00335       t1 = t0
00336     if t2 is None:
00337       t2 = time.time()
00338     dT = t2 - t1
00339     if dT == 0.0:  dT = 0.000001
00340     log.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00341              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00342
00343     # Get out of waiting when in suite or standalone mode
00344     self.sync()
00345
00346     # execute the GUI functions for stopRun, just in case
00347     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00348       if self.rc is not None:
00349         self.rc.doStop()
00350
00351   def wait(self):
00352     self.__cmdSynchSem.acquire()
00353
00354   def sync(self):
00355     if __name__ == "__main__" or self.isRunFromSuite():
00356       self.__cmdSynchSem.release()
00357
00358
00359 # Standalone mode:
00360 if __name__ == "__main__":
00361   from LATTE.runcontrol.RunControlCommon import RunControlCommon
00362
00363   rcCommon = RunControlCommon()
00364   rcCommon.initialize()
00365   rcCommon.setLoggingLevel("DEBUG")
00366   rcCommon.connect()
00367   ua = userApplication(None, 321, rcCommon)
00368   ua.rcSetup()
00369   ua.rcStartRun()
00370   ua.wait()
00371   ua.rcStopRun()
00372   ua.rcTeardown()
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testAppEvtCli.py Source File

testAppEvtCli.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example test script which uses the custom event client testEvtCli"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/03/21 17:58:13 $").split(' ')[1]
00014 __version__  = "$Revision: 1.5 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import                                  threading
00021 import logging                   as     log
00022 #from   rcHouseKeeping           import rcHouseKeeping
00023 import                                  time
00024 from   support.testEvtCli        import *
00025
00026 from   support.SimpleGasuExample import *
00027 from   support.MiniGLTExample    import *
00028
00029 from   LATTE.runcontrol.rcTransitions import rcTransitions
00030 from   LATTE.runcontrol.ArgumentImpl  import ArgumentImpl
00031
00032 TRUE  = (0 < 1)
00033 FALSE = not TRUE
00034
00035 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00036 #  the userApplication example to get the number of self triggers to take.
00037 class userArgument(ArgumentImpl):
00038   "GUI for getting the user to input some sort of value."
00039   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00040     ArgumentImpl.__init__(self, parent, name, modal, fl)
00041     self.__value = 0
00042     self.setCaption("Hello world!")
00043
00044   def OKButtonClicked(self):
00045     self.__value = int(self.ArgumentList.text().latin1())
00046     self.close()
00047
00048   def CancelButtonClicked(self):
00049     self.__value = None
00050     self.close()
00051
00052   def getValue(self, caption):
00053     self.setCaption(caption)
00054     self.show()
00055     self.exec_loop()
00056     return self.__value
00057
00058 class userArgText(object):
00059   "Text user interface for getting the user to input some sort of value"
00060   def __init__(self):
00061     pass
00062
00063   def getValue(self, caption):
00064     return int(raw_input("%s: " % (caption)))
00065
00066
00067 #  Example application implementation.
00068 #  Note that the name of the class must be userApplication.
00069 #  Look at rcTransitions for names of other transition methods that can be used.
00070 class userApplication(rcTransitions):
00071   "Implmentation class for a user application"
00072   def __init__(self, rc, userId, debug):
00073     rcTransitions.__init__(self, rc, userId, debug)
00074     log.debug("userApplication.__init__()")
00075     self.__eventSem    = threading.Semaphore(0)
00076     self.__cmdSynchSem = threading.Semaphore(0)
00077     self.__ec = testEvtCli(debug=debug)
00078     self.setEvtCli(self.__ec)
00079
00080   def getName(self):
00081     return __name__
00082
00083   def setup(self):
00084     log.debug("userApplication.setup()")
00085
00086     #self.__ec.open("c:/temp/ebf040218020523.arch")
00087
00088     if self.rc is None:
00089       self.__arg = userArgText()
00090     else:
00091       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00092
00093     # Get a TEM instance
00094     if self.lat.TEMcnt() == 1:
00095       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00096     elif self.lat.TEMcnt() > 1:
00097       tem = self.lat.TEM.all()
00098     else:
00099       log.fatal("No TEM(s) found in the schema")
00100       return -1
00101
00102     # reset the TEM since we are going to modify DATA_MASKS
00103     tem.CMD_RESET = 1
00104
00105     # clear TEM stats reg
00106     tem.COMMAND_RESPONSE = 0
00107
00108     # clear TEM status reg
00109     tem.STATUS = 0
00110
00111     # enable CAL, disable TKR, no diag #  0x10FF for diag
00112     tem.DATA_MASKS = 0x00FF
00113
00114     # TEM config reg # set TEM timeout
00115     tem.CONFIGURATION = 0
00116
00117     #status = gTEMread( __GT, temId, TEM_REG_CONFIGURATION, &payload);
00118     #printf("tem config reg = 0x%08x\n", payload);
00119
00120     # enable output in our GCCCs
00121     # broadcast load of GCCC_REG_CONFIGURATION
00122
00123     bcast_ccc = tem.allCCC()
00124     bcast_ccc.CONFIGURATION = 0x80000000L
00125
00126     #  disable all GCRCs in all GCCCs via broadcast # GCCC_REG_LAYER_MASK_0, GCCC_REG_LAYER_MASK_1
00127     bcast_ccc.LAYER_MASK_0 = 0xFFFFFFFFL
00128     bcast_ccc.LAYER_MASK_1 = 0xFFFFFFFFL
00129     ccc0 = tem.downCCC(0) # O$GCCC_00
00130     ccc0.LAYER_MASK_0 = 0xFFFF0000L
00131     ccc0.LAYER_MASK_1 = 0xFFFF000FL
00132     ccc2 = tem.downCCC(2) # O$GCCC_02
00133     ccc2.LAYER_MASK_0 = 0xFFFF0000L
00134     ccc2.LAYER_MASK_1 = 0xFFFF0000L
00135
00136     # config GCFE for calibration -- range 0 first
00137     bcast_cfe = tem.allCCC().allCRC().allCFE()
00138     bcast_cfe.CONFIG_0    = 0x00
00139     bcast_cfe.CONFIG_1    = 0x36
00140     bcast_cfe.FLE_DAC     = 0x55
00141     bcast_cfe.FHE_DAC     = 0x55
00142     bcast_cfe.LOG_ACPT    = 0x10
00143     bcast_cfe.RNG_ULD_DAC = 0x7F
00144     bcast_cfe.REF_DAC     = 0x7f
00145
00146     # config GCRC for calibration
00147     bcast_crc = tem.allCCC().allCRC()
00148     bcast_crc.DELAY_1 = 0xFF
00149     bcast_crc.DELAY_2 = 0xFF
00150     bcast_crc.DELAY_3 = 0xFF
00151     bcast_crc.DAC = 0x42FE
00152     bcast_crc.DAC = 0x42FE
00153
00154     # large timeouts for all GCCCs
00155     # broadcast load of GCCC_REG_EVENT_TIMEOUTS
00156     bcast_ccc.EVENT_TIMEOUTS = 0x0
00157     #status = gGCCCread( __GT, temId, 1, GCCC_REG_EVENT_TIMEOUTS, &payload);
00158     #printf("gccc register event timeouts = 0x%08x\n", payload);
00159
00160     # Register environment variables for housekeeping
00161     #hsk = self.getHSK()
00162     #regs = [tem.regs['data_masks'], ccc2.regs['layer_mask_1']]
00163     #hsk.addEnvRegs(regs)
00164     #hsk.setUpdateInterval(1)
00165
00166     # Two choices for the trigger, GEM and MiniGLT
00167     if self.lat.existsGEM():
00168       self.trigger( SimpleGasuExample() )
00169     else:
00170       self.trigger( MiniGLTExample() )
00171
00172     # A state transition can be rejected by not returning None
00173     return None
00174
00175   def startRun(self):
00176     log.debug("userApplication.startRun()")
00177
00178     caption = "Enter number of triggers to take"
00179     if self.rc is None:
00180       cnt = self.__arg.getValue(caption)
00181     else:
00182       cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00183
00184     # The user pressed 'Cancel'
00185     if cnt is None:  return -1
00186     self.__cnt = cnt
00187
00188     # Spawn a thread to synchronize commands with events
00189     self.__cmdSynchQuit = FALSE
00190     #cmdSynch = threading.Thread(None, self.__commandSynch, 'CmdSynch',
00191     #                            (cnt, self.__eventSem))
00192     #cmdSynch.start()
00193     #self.__cmdSynch = cmdSynch
00194
00195     # A state transition can be rejected by not returning None
00196     return None
00197
00198   def stopRun(self):
00199     log.debug("userApplication.stopRun()")
00200
00201     self.__cmdSynchQuit = TRUE
00202     self.__eventSem.release()
00203     #self.__cmdSynch.join(2.0)
00204     #if self.__cmdSynch.isAlive():
00205     #  log.error("%s.%s: cmdSynch thread did not exit when expected" % \
00206     #            (self.getName(), "stopRun"))
00207
00208     # The STOP_RUN transition can not be rejected
00209
00210   def resume(self):
00211     log.debug("userApplication.resume()")
00212
00213     # Issue self trigger to make up for the one that was lost during PAUSE
00214     self.trigger().solicit()
00215
00216     return None
00217
00218   def stop(self):
00219     log.debug("userApplication.stop()")
00220
00221     return self.stopRun()
00222
00223   def process(self, (status, buffer)):
00224     "Method called back for each data event taken"
00225     #log.debug("userApplication.process()")
00226
00227     evtCli = self.evtCli
00228
00229     if status != 0:
00230       if evtCli.isGGLTStatus():
00231         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00232       elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00233         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00234       self.__eventSem.release()
00235       return
00236     try:
00237       # In the future this event may contain additional data
00238       if evtCli.isSweepEvent():
00239         log.debug("SWEEP EVENT")
00240         return
00241     except:
00242       # Event summary word inaccessible, handle the bad event here
00243       log.exception("")
00244       return
00245
00246     #evtCli.evDumpCAL_LogAccepts();
00247     ###print ""
00248     #evtCli.evDumpCAL_Logs();
00249     #~ #print ""
00250     #~ #evtCli.evDumpTKR()
00251     ###evtCli.evDumpTEM_Error()
00252     ###evtCli.evDumpDiagnostic()
00253     ###for acc in evtCli.evt.CAL_LogAccepts:
00254     ###  print "CAL Log Accept: 0x%08x" % acc.ui
00255
00256     ###for data in evtCli.evt.CAL_LogData:
00257     ###  print "CAL Log Data: 0x%08x" % data.ui
00258     #~ sum = evtCli.evt.summary
00259     ###evtCli.evDumpSummary()
00260
00261     # Get next event triggered
00262     self.__eventSem.release()
00263
00264
00265   #def __commandSynch(self, count):
00266   def commandSynch(self):
00267     "Method called by the command synchronization task"
00268     import time
00269     trigger  = self.trigger()
00270     eventSem = self.__eventSem
00271
00272     # Drain the semaphore release count
00273     # Handles the case when the stop run release collided with a trigger release
00274     while eventSem.acquire(0):  pass
00275
00276     t0  = time.time()
00277
00278     # Compensate for the extra CMD_SELF_TRIGGER below
00279     cnt   = 1
00280     count = self.__cnt
00281
00282     # Wait for START_RUN to enable triggers
00283     trigger.waitForMaskEnable()
00284
00285     trigger.solicit()                   # Issue an internal trigger
00286     eventSem.acquire()                  # Wait for the event to be processed
00287
00288     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00289
00290     while cnt < count and not self.__cmdSynchQuit:
00291       cnt += 1
00292       trigger.solicit()                 # Issue an internal trigger
00293       time.sleep(.0001)
00294       eventSem.acquire()                # Wait for the event to be processed
00295       #trigger.disable()                # Disable triggers
00296       # Do stuff
00297       #trigger.enable()                 # Enable triggers
00298
00299     t2 = trigger.getTimeStamp()         # Get the last trigger timestamp
00300     # When we get here the triggers should still be enabled.
00301     # If the glt.MASK needs to be set through any other means
00302     # then it needs to be restored to its SETUP value here.
00303
00304     if t1 is None:
00305       t1 = t0
00306     if t2 is None:
00307       t2 = time.time()
00308     dT = t2 - t1
00309     if dT == 0.0:  dT = 0.000001
00310     log.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00311              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00312
00313     # Get out of waiting when in suite or standalone mode
00314     self.sync()
00315
00316     # execute the GUI functions for stopRun, just in case
00317     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00318       if self.rc is not None:
00319         self.rc.doStop()
00320
00321   def wait(self):
00322     self.__cmdSynchSem.acquire()
00323
00324   def sync(self):
00325     if __name__ == "__main__" or self.isRunFromSuite():
00326       self.__cmdSynchSem.release()
00327
00328
00329 # Standalone mode:
00330 if __name__ == "__main__":
00331   import os
00332   log.basicConfig()
00333   log.getLogger("").setLevel(log.DEBUG)
00334   ua = userApplication(None, 321, 0)
00335   ua.rcSetup(os.path.join(os.environ['ONLINE_ROOT'], 'repos/simpleTemSchema.xml'))
00336   ua.rcStartRun()
00337   ua.wait()
00338   ua.rcStopRun()
00339   ua.rcTeardown()
00340
00341 # History:
00342 #     $Log: testAppEvtCli.py,v $
00343 #     Revision 1.5  2005/03/21 17:58:13  claus
00344 #     Modified to use the first TEM found in the schema, if only one is there, or
00345 #     broadcast to all TEMs if there are multiple.
00346 #
00347 #     Revision 1.4  2004/10/22 20:32:48  stuvi
00348 #     Fixed log.exception()
00349 #
00350 #     Revision 1.3  2004/08/18 18:00:15  stuvi
00351 #     Updated for LATTE 4.
00352 #     All hippo functions go through the Qt GUI bridge now.
00353 #
00354 #     Revision 1.2  2004/08/07 02:10:27  stuvi
00355 #     no message
00356 #
00357 #     Revision 1.1  2004/08/06 18:59:26  stuvi
00358 #     Application for testing custom event client functionality
00359 #
00360 #     Revision 1.3  2004/05/03 21:19:47  stuvi
00361 #     Moved non-Runcontrol scripts to the support directory and modified imports accordingly.
00362 #
00363 #     Revision 1.2  2004/03/10 22:24:51  panetta
00364 #     Upgraded trigger interface.
00365 #     Removed dependencies on self.glt.
00366 #
00367 #     Revision 1.1  2004/02/20 00:34:37  stuvi
00368 #     Sample custom event client implementation and test app
00369 #
00370 #
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testAppEvtTO.py Source File

testAppEvtTO.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example CAL test application that tests event timeouts"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "11/21/2002"
00014 __version__  = "$Revision: 1.3 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import threading
00020 import logging        as     log
00021 from   LATTE.runcontrol.rcTransitions  import rcTransitions
00022 from   LATTE.runcontrol.ArgumentImpl   import ArgumentImpl
00023 #from   rcHouseKeeping import rcHouseKeeping
00024
00025 from support.SimpleGasuExample   import *
00026 from support.MiniGLTExample      import *
00027
00028 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00029 #  the userApplication example to get the number of self triggers to take.
00030 class userArgument(ArgumentImpl):
00031   "GUI for getting the user to input some sort of value."
00032   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00033     ArgumentImpl.__init__(self, parent, name, modal, fl)
00034     self.__value = 0
00035     self.setCaption("Hello world!")
00036
00037   def OKButtonClicked(self):
00038     self.__value = int(self.ArgumentList.text().latin1())
00039     self.close()
00040
00041   def CancelButtonClicked(self):
00042     self.__value = None
00043     self.close()
00044
00045   def getValue(self, caption):
00046     self.setCaption(caption)
00047     self.show()
00048     self.exec_loop()
00049     return self.__value
00050
00051 class userArgText(object):
00052   "Text user interface for getting the user to input some sort of value"
00053   def __init__(self):
00054     pass
00055
00056   def getValue(self, caption):
00057     return int(raw_input("%s: " % (caption)))
00058
00059
00060 #  Example application implementation.
00061 #  Note that the name of the class must be userApplication.
00062 #  Look at rcTransitions for names of other transition methods that can be used.
00063 class userApplication(rcTransitions):
00064   "Implmentation class for a user application"
00065   def __init__(self, rc, userId, debug):
00066     rcTransitions.__init__(self, rc, userId, debug)
00067     log.debug("userApplication.__init__()")
00068     self.__eventSem    = threading.Semaphore(0)
00069     self.__cmdSynchSem = threading.Semaphore(0)
00070
00071
00072   def getName(self):
00073     return __name__
00074
00075   def setup(self):
00076     log.debug("userApplication.setup()")
00077
00078     if self.rc is None:
00079       self.__arg = userArgText()
00080     else:
00081       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00082
00083     # Get a TEM instance
00084     if self.lat.TEMcnt() == 1:
00085       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00086     elif self.lat.TEMcnt() > 1:
00087       tem = self.lat.TEM.all()
00088     else:
00089       log.fatal("No TEM(s) found in the schema")
00090       return -1
00091
00092     # reset the TEM since we are going to modify DATA_MASKS
00093     #tem.CMD_RESET = 1
00094
00095     # clear TEM stats reg
00096     tem.COMMAND_RESPONSE = 0
00097
00098     # clear TEM status reg
00099     tem.STATUS = 0
00100
00101     # enable CAL, disable TKR, no diag #  0x10FF for diag
00102     #tem.DATA_MASKS = 0x00FF
00103
00104     # TEM config reg # set TEM timeout
00105     #tem.CONFIGURATION = 0
00106
00107     #status = gTEMread( __GT, temId, TEM_REG_CONFIGURATION, &payload);
00108     #printf("tem config reg = 0x%08x\n", payload);
00109
00110     # enable output in our GCCCs
00111     # broadcast load of GCCC_REG_CONFIGURATION
00112
00113     #bcast_ccc = tem.allCCC()
00114     #bcast_ccc.CONFIGURATION = 0x80000000L
00115
00116     #  disable all GCRCs in all GCCCs via broadcast # GCCC_REG_LAYER_MASK_0, GCCC_REG_LAYER_MASK_1
00117     #bcast_ccc.LAYER_MASK_0 = 0xFFFFFFFFL
00118     #bcast_ccc.LAYER_MASK_1 = 0xFFFFFFFFL
00119     #ccc2 = tem.downCCC(2) # O$GCCC_02
00120     #ccc2.LAYER_MASK_1 = 0x3BFD3FFFL
00121
00122     # large timeouts for all GCCCs
00123     # broadcast load of GCCC_REG_EVENT_TIMEOUTS
00124     #bcast_ccc.EVENT_TIMEOUTS = 0xFFFFFFFFL
00125     #status = gGCCCread( __GT, temId, 1, GCCC_REG_EVENT_TIMEOUTS, &payload);
00126     #printf("gccc register event timeouts = 0x%08x\n", payload);
00127
00128     # Register environment variables for housekeeping
00129     #hsk = self.getHSK()
00130     #regs = [tem.regs['data_masks'], ccc2.regs['layer_mask_1']]
00131     #hsk.addEnvRegs(regs)
00132     #hsk.setUpdateInterval(1)
00133
00134     # Two choices for the trigger, GEM and MiniGLT
00135     if self.lat.existsGEM():
00136       self.trigger( SimpleGasuExample() )
00137     else:
00138       self.trigger( MiniGLTExample() )
00139
00140     self.evtCli.setTimeoutEnabled(1)
00141
00142     # A state transition can be rejected by not returning None
00143     return None
00144
00145   def startRun(self):
00146     log.debug("userApplication.startRun()")
00147
00148     caption = "Enter number of triggers to take"
00149     if self.rc is None:
00150       cnt = self.__arg.getValue(caption)
00151     else:
00152       cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00153
00154     # The user pressed 'Cancel'
00155     if cnt is None:  return -1
00156     self.__cnt = cnt
00157
00158     # Spawn a thread to synchronize commands with events
00159     self.__cmdSynchQuit = False
00160
00161     # A state transition can be rejected by not returning None
00162     return None
00163
00164   def stopRun(self):
00165     log.debug("userApplication.stopRun()")
00166
00167     self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00168     self.__cmdSynchQuit = True
00169     self.__eventSem.release()
00170
00171
00172     # The STOP_RUN transition can not be rejected
00173
00174   def resume(self):
00175     log.debug("userApplication.resume()")
00176
00177     # Issue self trigger to make up for the one that was lost during PAUSE
00178     self.trigger().solicit()
00179
00180     return None
00181
00182   def stop(self):
00183     log.debug("userApplication.stop()")
00184
00185     return self.stopRun()
00186
00187   def teardown(self):
00188     log.debug("userApplication.teardown()")
00189     # Allow the C++ object to be deleted
00190     if self.rc is not None and self.__arg is not None:
00191       self.__arg.deleteLater()
00192
00193   def process(self, (status, buffer)):
00194     "Method called back for each data event taken"
00195     ###log.debug("userApplication.process()")
00196
00197     evtCli = self.evtCli
00198
00199     if status != 0:
00200       if evtCli.isGGLTStatus():
00201         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00202       elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00203         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00204       self.__eventSem.release()
00205       return
00206     try:
00207       # In the future this event may contain additional data
00208       if evtCli.isSweepEvent(): return
00209     except:
00210       # Event summary word inaccessible, handle the bad event here
00211       import gutil
00212       gutil.logException()
00213       return
00214
00215     ###evtCli.evDumpCAL_LogAccepts();
00216     ###print ""
00217     ###evtCli.evDumpCAL_Logs();
00218     #~ #print ""
00219     #~ #evtCli.evDumpTKR()
00220     ###evtCli.evDumpTEM_Error()
00221     ###evtCli.evDumpDiagnostic()
00222     ###for acc in evtCli.evt.CAL_LogAccepts:
00223     ###  print "CAL Log Accept: 0x%08x" % acc.ui
00224
00225     ###for data in evtCli.evt.CAL_LogData:
00226     ###  print "CAL Log Data: 0x%08x" % data.ui
00227     #~ sum = evtCli.evt.summary
00228     ###evtCli.evDumpSummary()
00229
00230     # Get next event triggered
00231     self.__eventSem.release()
00232
00233
00234   #def __commandSynch(self, count):
00235   def commandSynch(self):
00236     "Method called by the command synchronization task"
00237     import time
00238     trigger  = self.trigger()
00239     eventSem = self.__eventSem
00240
00241     # Drain the semaphore release count
00242     # Handles the case when the stop run release collided with a trigger release
00243     while eventSem.acquire(0):  pass
00244
00245     t0  = time.time()
00246
00247     # Compensate for the extra CMD_SELF_TRIGGER below
00248     cnt   = 1
00249     count = self.__cnt
00250
00251     # Wait for START_RUN to enable triggers
00252     trigger.waitForMaskEnable()
00253
00254     trigger.solicit()                   # Issue an internal trigger
00255     eventSem.acquire()                  # Wait for the event to be processed
00256
00257     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00258
00259     while cnt < count and not self.__cmdSynchQuit:
00260       cnt += 1
00261       trigger.solicit()                 # Issue an internal trigger
00262       time.sleep(.0001)
00263       eventSem.acquire()                # Wait for the event to be processed
00264       #trigger.disable()                # Disable triggers
00265       # Do stuff
00266       #trigger.enable()                 # Enable triggers
00267
00268     t2 = trigger.getTimeStamp()         # Get the last trigger timestamp
00269
00270     if t1 is None:
00271       t1 = t0
00272     if t2 is None:
00273       t2 = time.time()
00274     dT = t2 - t1
00275     if dT == 0.0:  dT = 0.000001
00276     log.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00277              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00278
00279     # Get out of waiting when in suite or standalone mode
00280     self.sync()
00281
00282     # execute the GUI functions for stopRun, just in case
00283     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00284       if self.rc is not None:
00285         self.rc.doStop()
00286
00287   def wait(self):
00288     self.__cmdSynchSem.acquire()
00289
00290   def sync(self):
00291     if __name__ == "__main__" or self.isRunFromSuite():
00292       self.__cmdSynchSem.release()
00293
00294
00295 # Standalone mode:
00296 if __name__ == "__main__":
00297   log.basicConfig()
00298   log.getLogger("").setLevel(log.DEBUG)
00299   ua = userApplication(None, 321, 0)
00300   ua.rcSetup('../repos/simpleTemSchema.xml') # Use env var later: kludge for now
00301   ua.rcStartRun()
00302   ua.wait()
00303   ua.rcStopRun()
00304   ua.rcTeardown()
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testAppExclude.py Source File

testAppExclude.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2005
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "V&V test case for the <exclude> tag"
00012 __author__   = "S. Tuvi <Stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2006/07/17 18:47:31 $").split(' ')[1]
00014 __version__  = "$Revision: 1.3 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import            threading
00021 import logging as log
00022 import            time
00023
00024 from   LATTE.runcontrol.rcTransitions  import rcTransitions
00025
00026 class userApplication(rcTransitions):
00027   """V&V test case for the <exclude> tag"""
00028   def __init__(self, rc, userId, debug):
00029     rcTransitions.__init__(self, rc, userId, debug)
00030     log.debug("userApplication.__init__()")
00031     # Initialize the registers to known values
00032     self.__newVal = 0xab
00033     log.info("Initializing TEM[0,1].tkr_trgseq to 0x%x" % self.__newVal)
00034     self.__tem0val = self.lat.TEM[0].tkr_trgseq
00035     self.__tem1val = self.lat.TEM[1].tkr_trgseq
00036     self.lat.TEM[0].tkr_trgseq = self.__newVal
00037     self.lat.TEM[1].tkr_trgseq = self.__newVal
00038     log.info("Global exclude flags: %s"
00039              % self.lat.getAllExcludeFlags())
00040     log.info("Current exclude flags for TEM 1: %s"
00041              % self.lat.TEM[1].getExcludeFlags())
00042
00043   def getName(self):
00044     return __name__
00045
00046   def setup(self):
00047     log.debug("userApplication.setup()")
00048
00049     # A state transition can be rejected by not returning None
00050     return None
00051
00052   def startRun(self):
00053     log.debug("userApplication.startRun()")
00054
00055     if self.rc is not None:
00056       self.rc.doStop()
00057
00058     # A state transition can be rejected by not returning None
00059     return None
00060
00061   def stopRun(self):
00062     log.debug("userApplication.stopRun()")
00063
00064     result1 = True
00065     exp = self.__tem0val
00066     val = self.lat.TEM[0].tkr_trgseq
00067     if val != exp:
00068       log.error("Did not see the expected change in TEM[0].tkr_trgseq:")
00069       log.error("Expecting 0x%x, got 0x%x instead" % (exp, val))
00070       result1 = False
00071     else:
00072       log.info("TEM[0].tkr_trgseq has the expected value of 0x%x" % val)
00073
00074     result2 = True
00075     exp = self.__newVal
00076     val = self.lat.TEM[1].tkr_trgseq
00077     if val != exp:
00078       log.error("Unexpected change in TEM[1].tkr_trgseq:")
00079       log.error("Expecting 0x%x, got 0x%x instead" % (exp, val))
00080       result2 = False
00081     else:
00082       log.info("TEM[1].tkr_trgseq has the expected value of 0x%x" % val)
00083
00084     if result1 and result2:
00085       self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00086     else:
00087       self.setCompletionStatus(self.COMPL_STATUS_FAILED)
00088
00089     # The STOP_RUN transition can not be rejected
00090
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testAppLDFdump.py Source File

testAppLDFdump.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example EBF event handling test application"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "2/25/2003"
00014 __version__  = "$Revision: 1.3 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import threading
00020 import logging       as     log
00021
00022 from   LATTE.runcontrol.rcTransitions import rcTransitions
00023 from   LATTE.runcontrol.ArgumentImpl  import ArgumentImpl
00024
00025 from support.SimpleGasuExample   import *
00026 from support.MiniGLTExample      import *
00027
00028 import LDF
00029 import LDFdumper as LD
00030
00031 class LATcomponentIterator(LD.LATcomponentIterator):
00032   def __init__(self):
00033     LDF.LATcomponentIterator.__init__(self)
00034     self.__calSrc                  = None
00035     self.__tkrContributionIterator = None
00036     print "LATcomponentIterator.__init__"
00037
00038   def UDFcomponent(self, event, ebfContribution):
00039     print ""
00040     print "Undefined EBF component"
00041     LD.EBFcontribution(event, ebfContribution).dumpCommon("  ")
00042     LD.EBFcontribution(event, ebfContribution).dump("  ")
00043     return 0
00044
00045   def OSWcomponent(self, event, oswContribution):
00046     # Assuming this is always the first component seen, dump the event
00047     print ""
00048     LD.EBFevent(event).dump()
00049     print ""
00050     print "OSW:"
00051     LD.EBFcontribution(event, oswContribution).dumpCommon("  ")
00052     oswContribIter = LD.OSWcontributionIterator(event, oswContribution)
00053     print "  OSW:"
00054     oswContribIter.dump("  ")
00055     return 0
00056
00057   def GLTcomponent(self, event, gltContribution):
00058     print ""
00059     print "GLT:"
00060     LD.EBFcontribution(event, gltContribution).dumpCommon("  ")
00061     LD.GLTcontribution(event, gltContribution).dump("  ")
00062     return 0
00063
00064   def GEMcomponent(self, event, gemContribution):
00065     print ""
00066     print "GEM:"
00067     LD.EBFcontribution(event, gemContribution).dumpCommon("  ")
00068     LD.GEMcontribution(event, gemContribution).dump("  ")
00069     return 0
00070
00071   def ACDcomponent(self, event, aemContribution):
00072     print ""
00073     print "AEM:"
00074     LD.EBFcontribution(event, aemContribution).dumpCommon("  ")
00075     aemContribIter = LD.AEMcontributionIterator(event, aemContribution)
00076     print "  ACD:"
00077     aemContribIter.dump("  ")
00078     return 0
00079
00080   def CALcomponent(self, event, calContribution):
00081     self.__calSrc = LD.LATPcellHeader.source(calContribution.header())
00082     print ""
00083     print "TEM %2d:" % (self.__calSrc)
00084     LD.EBFcontribution(event, calContribution).dumpCommon("  ")
00085     calContribIter = LD.CALcontributionIterator(event,calContribution)
00086     calContribIter.dump("  ")
00087     self.CALend(calContribIter.CALend())
00088     return 0
00089
00090   def TKRcomponent(self, event, tkrContribution):
00091     if self.__calSrc != LD.LATPcellHeader.source(tkrContribution.header()):
00092       print ""
00093       print "TEM %2d:" % (LD.LATPcellHeader.source(tkrContribution.header()))
00094       LD.EBFcontribution(event, tkrContribution).dumpCommon("  ")
00095     tkrContribIter = LD.TKRcontributionIterator(event, tkrContribution)
00096     tkrContribIter.dump("  ")
00097     self.__tkrContributionIterator = tkrContribIter
00098     if tkrContribIter.diagnostic() is not None:
00099       self.TKRend(tkrContribIter.diagnostic())
00100     return 0
00101
00102 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00103 #  the userApplication example to get the number of self triggers to take.
00104 class userArgument(ArgumentImpl):
00105   "GUI for getting the user to input some sort of value."
00106   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00107     ArgumentImpl.__init__(self, parent, name, modal, fl)
00108     self.__value = 0
00109     self.setCaption("Hello world!")
00110
00111   def OKButtonClicked(self):
00112     self.__value = int(self.ArgumentList.text().latin1())
00113     self.close()
00114
00115   def getValue(self, caption):
00116     self.setCaption(caption)
00117     self.show()
00118     self.exec_loop()
00119     return self.__value
00120
00121 class userArgText(object):
00122   "Text user interface for getting the user to input some sort of value"
00123   def __init__(self):
00124     pass
00125
00126   def getValue(self, caption):
00127     return int(raw_input("%s: " % (caption)))
00128
00129
00130 #  Example application implementation.
00131 #  Note that the name of the class must be userApplication.
00132 #  Look at rcTransitions for names of other transition methods that can be used.
00133 class userApplication(rcTransitions):
00134   "Implmentation class for a user application"
00135   def __init__(self, gui, userId, debug):
00136     rcTransitions.__init__(self, gui, userId, debug)
00137     log.debug("userApplication.__init__()")
00138     self.__eventSem    = threading.Semaphore(0)
00139     self.__cmdSynchSem = threading.Semaphore(0)
00140     self.__lci         = LATcomponentIterator()
00141     self.__ldbi        = LDF.LATdataBufferIterator(self.__lci)
00142
00143   def getName(self):
00144     return __name__
00145
00146   def setup(self):
00147     log.debug("userApplication.setup()")
00148
00149     if self.rc is None:
00150       self.__arg = userArgText()
00151     else:
00152       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00153
00154     # Get a TEM instance
00155     if self.lat.TEMcnt() == 1:
00156       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00157     elif self.lat.TEMcnt() > 1:
00158       tem = self.lat.TEM.all()
00159     else:
00160       log.fatal("No TEM(s) found in the schema")
00161       return -1
00162
00163     # reset the TEM since we are going to modify DATA_MASKS
00164     tem.CMD_RESET = 1
00165
00166     # clear TEM stats reg
00167     tem.COMMAND_RESPONSE = 0
00168
00169     # clear TEM status reg
00170     tem.STATUS = 0
00171
00172     # enable CAL, disable TKR, no diag #  0x10FF for diag
00173     tem.DATA_MASKS = 0x00FF
00174
00175     # TEM config reg # set TEM timeout
00176     tem.CONFIGURATION = 0
00177
00178     #status = gTEMread( __GT, temId, TEM_REG_CONFIGURATION, &payload);
00179     #printf("tem config reg = 0x%08x\n", payload);
00180
00181     # enable output in our GCCCs
00182     # broadcast load of GCCC_REG_CONFIGURATION
00183
00184     bcast_ccc = tem.allCCC()
00185     bcast_ccc.CONFIGURATION = 0x80000000L
00186
00187     #  disable all GCRCs in all GCCCs via broadcast # GCCC_REG_LAYER_MASK_0, GCCC_REG_LAYER_MASK_1
00188     bcast_ccc.LAYER_MASK_0 = 0xFFFFFFFFL
00189     bcast_ccc.LAYER_MASK_1 = 0xFFFFFFFFL
00190     ccc2 = tem.downCCC(2) # O$GCCC_02
00191     ccc2.LAYER_MASK_1 = 0x3BFD3FFF
00192
00193     # large timeouts for all GCCCs
00194     # broadcast load of GCCC_REG_EVENT_TIMEOUTS
00195     bcast_ccc.EVENT_TIMEOUTS = 0x0
00196     #status = gGCCCread( __GT, temId, 1, GCCC_REG_EVENT_TIMEOUTS, &payload);
00197     #printf("gccc register event timeouts = 0x%08x\n", payload);
00198
00199     # Two choices for the trigger, GEM and MiniGLT
00200     if self.lat.existsGEM():
00201       self.trigger( SimpleGasuExample() )
00202     else:
00203       self.trigger( MiniGLTExample() )
00204
00205     # A state transition can be rejected by not returning None
00206     return None
00207
00208   def startRun(self):
00209     log.debug("userApplication.startRun()")
00210
00211     caption = "Enter number of triggers to take"
00212     if self.rc is None:
00213       cnt = self.__arg.getValue(caption)
00214     else:
00215       cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00216
00217     # The user pressed 'Cancel'
00218     if cnt is None:  return -1
00219     self.__cnt = cnt
00220
00221     # Spawn a thread to synchronize commands with events
00222     # This must happen after triggers are enabled
00223     self.__cmdSynchQuit = False
00224
00225     # A state transition can be rejected by not returning None
00226     return None
00227
00228   def stopRun(self):
00229     self.setCompletionStatus(self.COMPL_STATUS_SUCCESS)
00230     self.__cmdSynchQuit = True
00231     self.__eventSem.release()
00232
00233     # The STOP_RUN transition can not be rejected
00234
00235   def resume(self):
00236     # Issue self trigger to make up for the one that was lost during PAUSE
00237     self.trigger().solicit()
00238
00239     return None
00240
00241   def stop(self):
00242     return self.stopRun()
00243
00244   def process(self, (status, buffer)):
00245     "Method called back for each data event taken"
00246     ###log.debug("userApplication.process()")
00247
00248     evtCli = self.evtCli
00249
00250     if status != 0:
00251       if evtCli.isGGLTStatus():
00252         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00253       elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00254         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00255       self.__eventSem.release()
00256       return
00257
00258     try:
00259       # In the future this event may contain additional data
00260       if evtCli.isSweepEvent(): return
00261     except:
00262       # Event summary word inaccessible, handle the bad event here
00263       import gutil
00264       gutil.logException()
00265       return
00266
00267     self.__ldbi.iterate(buffer, len(buffer))
00268
00269     # Get next event triggered
00270     self.__eventSem.release()
00271
00272   def commandSynch(self):
00273     "Method called by the command synchronization task"
00274     import time
00275     trigger  = self.trigger()
00276     eventSem = self.__eventSem
00277
00278     # Drain the semaphore release count
00279     # Handles the case when the stop run release collided with a trigger release
00280     while eventSem.acquire(0):  pass
00281
00282     t0  = time.time()
00283
00284     # Compensate for the extra CMD_SELF_TRIGGER below
00285     cnt   = 1
00286     count = self.__cnt
00287
00288     # Wait for START_RUN to enable triggers
00289     trigger.waitForMaskEnable()
00290
00291     trigger.solicit()                   # Issue an internal trigger
00292     eventSem.acquire()                  # Wait for the event to be processed
00293
00294     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00295
00296     while cnt < count and not self.__cmdSynchQuit:
00297       cnt += 1
00298       trigger.solicit()                 # Issue an internal trigger
00299       time.sleep(.0001)
00300       eventSem.acquire()                # Wait for the event to be processed
00301       #trigger.disable()                # Disable triggers
00302       # Do stuff
00303       #trigger.enable()                 # Enable triggers
00304
00305     t2 = trigger.getTimeStamp()         # Get the last trigger timestamp
00306
00307     if t1 is None:
00308       t1 = t0
00309     if t2 is None:
00310       t2 = time.time()
00311     dT = t2 - t1
00312     if dT == 0.0:  dT = 0.000001
00313     log.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00314              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00315
00316     # Get out of waiting when in standalone mode
00317     self.sync()
00318
00319     # execute the GUI functions for stopRun, just in case
00320     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00321       if self.gui is not None:
00322         self.gui.doStopRun()
00323
00324   def wait(self):
00325     self.__cmdSynchSem.acquire()
00326
00327   def sync(self):
00328     if __name__ == "__main__" or self.isRunFromSuite():
00329       self.__cmdSynchSem.release()
00330
00331
00332 # Standalone mode:
00333 if __name__ == "__main__":
00334   import os
00335   log.basicConfig()
00336   log.getLogger("").setLevel(log.DEBUG)
00337   ua = userApplication(None, 321, 1)
00338   ua.rcSetup(os.path.join(os.environ['ONLINE_ROOT'], 'repos/simpleTemSchema.xml'))
00339   ua.rcStartRun()
00340   ua.wait()
00341   ua.rcStopRun()
00342   ua.rcTeardown()
00343
00344 # History:
00345 #     $Log: testAppLDFdump.py,v $
00346 #     Revision 1.3  2006/04/05 15:40:30  perazzo
00347 #     LDFdumper is now in PYTHONPATH
00348 #
00349 #     Revision 1.2  2005/03/21 17:58:13  claus
00350 #     Modified to use the first TEM found in the schema, if only one is there, or
00351 #     broadcast to all TEMs if there are multiple.
00352 #
00353 #     Revision 1.1  2004/08/18 18:00:15  stuvi
00354 #     Updated for LATTE 4.
00355 #     All hippo functions go through the Qt GUI bridge now.
00356 #
00357 #     Revision 1.3  2004/05/03 21:19:47  stuvi
00358 #     Moved non-Runcontrol scripts to the support directory and modified imports accordingly.
00359 #
00360 #     Revision 1.2  2004/04/02 23:57:53  claus
00361 #     xxxComponent methods must return a status value.
00362 #
00363 #     Revision 1.1  2004/04/02 22:31:46  claus
00364 #     Event dumper using the LDF library and the new LATdataBufferIterator class.
00365 #
00366 #     Revision 1.8  2004/03/10 22:24:51  panetta
00367 #     Upgraded trigger interface.
00368 #     Removed dependencies on self.glt.
00369 #
00370 #     Revision 1.7  2003/11/04 18:30:53  panetta
00371 #     Changed the commandSynch logic so that the enableMask() call would not pose a threat to snapshot taking.
00372 #
00373 #     Revision 1.6  2003/10/31 01:09:37  panetta
00374 #     1)  Moved register writes from startRun to setup
00375 #     2)  Added GLT enabling logic to __commandSynch
00376 #     3)  Gave example of getting the start/stop time from the hardware/event stream
00377 #
00378 #     Revision 1.5  2003/06/13 23:26:24  stuvi
00379 #     Added TEM reset
00380 #
00381 #     Revision 1.4  2003/04/01 21:04:59  stuvi
00382 #     Fixed event count discrepancy when the run is stopped in the middle.
00383 #
00384 #     Revision 1.3  2003/03/26 21:59:36  stuvi
00385 #     Fixed standalone mode
00386 #
00387 #     Revision 1.2  2003/03/13 00:06:34  claus
00388 #     Interface changes plus diagnostic and error dumps
00389 #
00390 #     Revision 1.1  2003/03/10 21:49:56  claus
00391 #     RunControl example of an event dumper
00392 #
00393 #
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testAppMinimal.py Source File

testAppMinimal.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2005
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Minimal data taking application"
00012 __author__   = "S. Tuvi <Stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/04/14 21:16:01 $").split(' ')[1]
00014 __version__  = "$Revision: 1.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import            threading
00021 import logging as log
00022 import            time
00023
00024 from   LATTE.runcontrol.rcTransitions  import rcTransitions
00025 from   LATTE.runcontrol.ArgumentImpl   import ArgumentImpl
00026
00027 from support.SimpleGasuExample   import *
00028 from support.MiniGLTExample      import *
00029
00030
00031 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00032 #  the userApplication example to get the number of self triggers to take.
00033 class userArgument(ArgumentImpl):
00034   "GUI for getting the user to input some sort of value."
00035   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00036     ArgumentImpl.__init__(self, parent, name, modal, fl)
00037     self.__value = 0
00038     self.setCaption("Hello world!")
00039
00040   def OKButtonClicked(self):
00041     self.__value = int(self.ArgumentList.text().latin1())
00042     self.close()
00043
00044   def CancelButtonClicked(self):
00045     self.__value = None
00046     self.close()
00047
00048   def getValue(self, caption):
00049     self.setCaption(caption)
00050     self.show()
00051     self.exec_loop()
00052     return self.__value
00053
00054 class userArgText(object):
00055   "Text user interface for getting the user to input some sort of value"
00056   def __init__(self):
00057     pass
00058
00059   def getValue(self, caption):
00060     return int(raw_input("%s: " % (caption)))
00061
00062
00063 #  Example application implementation.
00064 #  Note that the name of the class must be userApplication.
00065 #  Look at rcTransitions for names of other transition methods that can be used.
00066 class userApplication(rcTransitions):
00067   "Implmentation class for a user application"
00068   def __init__(self, rc, userId, debug):
00069     rcTransitions.__init__(self, rc, userId, debug)
00070     log.debug("userApplication.__init__()")
00071     self.__eventSem    = threading.Semaphore(0)
00072     self.__cmdSynchSem = threading.Semaphore(0)
00073
00074   def getName(self):
00075     return __name__
00076
00077   def setup(self):
00078     log.debug("userApplication.setup()")
00079
00080     if self.rc is None:
00081       self.__arg = userArgText()
00082     else:
00083       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00084
00085     # Two choices for the trigger, GEM and MiniGLT
00086     if self.lat.existsGEM():
00087       self.trigger( SimpleGasuExample() )
00088     else:
00089       self.trigger( MiniGLTExample() )
00090
00091     # A state transition can be rejected by not returning None
00092     return None
00093
00094   def startRun(self):
00095     log.debug("userApplication.startRun()")
00096
00097     caption = "Enter number of triggers to take"
00098     if self.rc is None:
00099       cnt = self.__arg.getValue(caption)
00100     else:
00101       cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00102
00103     # The user pressed 'Cancel'
00104     if cnt is None:  return -1
00105     self.__cnt = cnt
00106
00107     if self.rc is not None:
00108       self.getParameterVerifier().add(caption, cnt)
00109
00110     # Spawn a thread to synchronize commands with events
00111     self.__cmdSynchQuit = False
00112
00113     # A state transition can be rejected by not returning None
00114     return None
00115
00116   def stopRun(self):
00117     log.debug("userApplication.stopRun()")
00118
00119     if self.getBadEvents() == 0 and self.getErrorEvents() == 0:
00120       self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00121     else:
00122       self.setCompletionStatus(self.COMPL_STATUS_FAILED)
00123
00124     self.__cmdSynchQuit = True
00125     self.__eventSem.release()
00126
00127     # The STOP_RUN transition can not be rejected
00128
00129   def resume(self):
00130     log.debug("userApplication.resume()")
00131
00132     # Issue self trigger to make up for the one that was lost during PAUSE
00133     self.trigger().solicit()
00134
00135     return None
00136
00137   def stop(self):
00138     log.debug("userApplication.stop()")
00139
00140     return self.stopRun()
00141
00142   def teardown(self):
00143     log.debug("userApplication.teardown()")
00144     # Allow the C++ object to be deleted
00145     if self.rc is not None and self.__arg is not None:
00146       self.__arg.deleteLater()
00147
00148   def process(self, (status, buffer)):
00149     "Method called back for each data event taken"
00150     #log.debug("userApplication.process()")
00151
00152     evtCli = self.evtCli
00153
00154     if status != 0:
00155       if evtCli.isGGLTStatus():
00156         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00157       elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00158         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00159       self.__eventSem.release()
00160       return
00161     try:
00162       # In the future this event may contain additional data
00163       if evtCli.isSweepEvent(): return
00164     except:
00165       # Event summary word inaccessible, handle the bad event here
00166       log.exception("")
00167       return
00168
00169     if self.lat.existsGEM():
00170       if evtCli.setCurrentContribution(evtCli.GEM) != -1:
00171         evtCli.evDumpGEM()
00172       else:
00173         log.error("*******************************************")
00174         log.error("*   NO GEM CONTRIBUTION PRESENT           *")
00175         log.error("*******************************************")
00176
00177     if self.lat.TEMcnt() > 0:
00178       temId = self.lat.TEM[self.lat.TEM.keys()[0]].id()
00179       if evtCli.setCurrentContribution(temId) != -1:
00180         evtCli.evDumpCAL_LogAccepts()
00181         ###print ""
00182         evtCli.evDumpCAL_Logs();
00183         #~ #print ""
00184         evtCli.evDumpTKR()
00185         evtCli.evDumpTEM_Error()
00186         evtCli.evDumpDiagnostic()
00187         #for acc in evtCli.evt.CAL_LogAccepts:
00188         #  print "CAL Log Accept: 0x%08x" % acc.ui
00189
00190         #for layerLogData in evtCli.evt.CAL_LogData:
00191         #  print "CAL Log Data: %s 0x%08x" % layerLogData.layer, layerLogData.data
00192         #  sum = evtCli.evt.summary
00193         ###evtCli.evDumpSummary()
00194
00195         #for errorGCCC in evtCli.evt.errGCCCmsg:
00196         #  errGCCC = errorGCCC.errGCCC
00197         #  print "GCCC", errorGCCC.gccc, "Error:", hex(errGCCC.errParm), hex(errGCCC.sweepNum), hex(errGCCC.errType)
00198
00199         #for calDiag in evtCli.evt.diag.cal:
00200         #  print calDiag.layer, calDiag.gccc, calDiag.negLayerEnd, calDiag.posLayerEnd
00201         #print
00202         #for tkrDiag in evtCli.evt.diag.tkr:
00203         #  print tkrDiag.gtcc, tkrDiag.trgRequests
00204       else:
00205         log.error("*******************************************")
00206         log.error("*     TEM CONTRIBUTION NOT PRESENT        *")
00207         log.error("*******************************************")
00208
00209     # Get next event triggered
00210     self.__eventSem.release()
00211
00212
00213   #def __commandSynch(self, count):
00214   def commandSynch(self):
00215     "Method called by the command synchronization task"
00216     import time
00217     trigger  = self.trigger()
00218     eventSem = self.__eventSem
00219
00220     # Drain the semaphore release count
00221     # Handles the case when the stop run release collided with a trigger release
00222     while eventSem.acquire(0):  pass
00223
00224     t0  = time.time()
00225
00226     # Compensate for the extra CMD_SELF_TRIGGER below
00227     cnt   = 1
00228     count = self.__cnt
00229
00230     # Wait for START_RUN to enable triggers
00231     trigger.waitForMaskEnable()
00232
00233     trigger.solicit()                   # Issue an internal trigger
00234     eventSem.acquire()                  # Wait for the event to be processed
00235
00236     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00237     while cnt < count and not self.__cmdSynchQuit:
00238       cnt += 1
00239       trigger.solicit()                 # Issue an internal trigger
00240       time.sleep(.0001)
00241       eventSem.acquire()                # Wait for the event to be processed
00242       #trigger.disable()                # Disable triggers
00243       # Do stuff
00244       #trigger.enable()                 # Enable triggers
00245
00246     t2 = trigger.getTimeStamp()                 # Get the last trigger timestamp
00247
00248     if t1 is None:
00249       t1 = t0
00250     if t2 is None:
00251       t2 = time.time()
00252     dT = t2 - t1
00253     if dT == 0.0:  dT = 0.000001
00254     log.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00255              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00256
00257     # Get out of waiting when in suite or standalone mode
00258     self.sync()
00259
00260     # execute the GUI functions for stopRun, just in case
00261     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00262       if self.rc is not None:
00263         self.rc.doStop()
00264
00265   def wait(self):
00266     self.__cmdSynchSem.acquire()
00267
00268   def sync(self):
00269     if __name__ == "__main__" or self.isRunFromSuite():
00270       self.__cmdSynchSem.release()
00271
00272
00273 # Standalone mode:
00274 if __name__ == "__main__":
00275   from LATTE.runcontrol.RunControlCommon import RunControlCommon
00276
00277   rcCommon = RunControlCommon()
00278   rcCommon.initialize()
00279   rcCommon.setLoggingLevel("INFO")
00280   rcCommon.connect()
00281   ua = userApplication(None, 321, rcCommon)
00282   ua.rcSetup()
00283   ua.rcStartRun()
00284   ua.wait()
00285   ua.rcStopRun()
00286   ua.rcTeardown()
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testAppNoVersion.py Source File

testAppNoVersion.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "V&V test to show that fix to LTE-175 works"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/03/09 01:12:39 $").split(' ')[1]
00014 #Deliberately commented out to provide a test to V&V
00015 #__version__  = "$Revision: 1.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import            threading
00022 import logging as log
00023 import            time
00024
00025 from   LATTE.runcontrol.rcTransitions  import rcTransitions
00026 from   LATTE.runcontrol.ArgumentImpl   import ArgumentImpl
00027
00028 from support.SimpleGasuExample   import *
00029 from support.MiniGLTExample      import *
00030
00031
00032 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00033 #  the userApplication example to get the number of self triggers to take.
00034 class userArgument(ArgumentImpl):
00035   "GUI for getting the user to input some sort of value."
00036   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00037     ArgumentImpl.__init__(self, parent, name, modal, fl)
00038     self.__value = 0
00039     self.setCaption("Hello world!")
00040
00041   def OKButtonClicked(self):
00042     self.__value = int(self.ArgumentList.text().latin1())
00043     self.close()
00044
00045   def CancelButtonClicked(self):
00046     self.__value = None
00047     self.close()
00048
00049   def getValue(self, caption):
00050     self.setCaption(caption)
00051     self.show()
00052     self.exec_loop()
00053     return self.__value
00054
00055 class userArgText(object):
00056   "Text user interface for getting the user to input some sort of value"
00057   def __init__(self):
00058     pass
00059
00060   def getValue(self, caption):
00061     return int(raw_input("%s: " % (caption)))
00062
00063
00064 #  Example application implementation.
00065 #  Note that the name of the class must be userApplication.
00066 #  Look at rcTransitions for names of other transition methods that can be used.
00067 class userApplication(rcTransitions):
00068   "Implmentation class for a user application"
00069   def __init__(self, rc, userId, debug):
00070     rcTransitions.__init__(self, rc, userId, debug)
00071     log.debug("userApplication.__init__()")
00072     self.__eventSem    = threading.Semaphore(0)
00073     self.__cmdSynchSem = threading.Semaphore(0)
00074
00075   def getName(self):
00076     return __name__
00077
00078   def setup(self):
00079     log.debug("userApplication.setup()")
00080
00081     if self.rc is None:
00082       self.__arg = userArgText()
00083     else:
00084       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00085
00086     # Two choices for the trigger, GEM and MiniGLT
00087     if self.lat.existsGEM():
00088       self.trigger( SimpleGasuExample() )
00089     else:
00090       self.trigger( MiniGLTExample() )
00091
00092     # A state transition can be rejected by not returning None
00093     return None
00094
00095   def startRun(self):
00096     log.debug("userApplication.startRun()")
00097
00098     caption = "Enter number of triggers to take"
00099     if self.rc is None:
00100       cnt = self.__arg.getValue(caption)
00101     else:
00102       cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00103
00104     # The user pressed 'Cancel'
00105     if cnt is None:  return -1
00106     self.__cnt = cnt
00107
00108     # Spawn a thread to synchronize commands with events
00109     self.__cmdSynchQuit = False
00110
00111     # A state transition can be rejected by not returning None
00112     return None
00113
00114   def stopRun(self):
00115     log.debug("userApplication.stopRun()")
00116
00117     if self.getBadEvents() == 0 and self.getErrorEvents() == 0:
00118       self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00119     else:
00120       self.setCompletionStatus(self.COMPL_STATUS_FAILED)
00121
00122     self.__cmdSynchQuit = True
00123     self.__eventSem.release()
00124
00125     # The STOP_RUN transition can not be rejected
00126
00127   def resume(self):
00128     log.debug("userApplication.resume()")
00129
00130     # Issue self trigger to make up for the one that was lost during PAUSE
00131     self.trigger().solicit()
00132
00133     return None
00134
00135   def stop(self):
00136     log.debug("userApplication.stop()")
00137
00138     return self.stopRun()
00139
00140   def teardown(self):
00141     log.debug("userApplication.teardown()")
00142     # Allow the C++ object to be deleted
00143     if self.rc is not None and self.__arg is not None:
00144       self.__arg.deleteLater()
00145
00146   def process(self, (status, buffer)):
00147     "Method called back for each data event taken"
00148     #log.debug("userApplication.process()")
00149
00150     evtCli = self.evtCli
00151
00152     if status != 0:
00153       if evtCli.isGGLTStatus():
00154         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00155       elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00156         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00157       self.__eventSem.release()
00158       return
00159     try:
00160       # In the future this event may contain additional data
00161       if evtCli.isSweepEvent(): return
00162     except:
00163       # Event summary word inaccessible, handle the bad event here
00164       log.exception("")
00165       return
00166
00167      # Get next event triggered
00168     self.__eventSem.release()
00169
00170
00171   #def __commandSynch(self, count):
00172   def commandSynch(self):
00173     "Method called by the command synchronization task"
00174     import time
00175     trigger  = self.trigger()
00176     eventSem = self.__eventSem
00177
00178     # Drain the semaphore release count
00179     # Handles the case when the stop run release collided with a trigger release
00180     while eventSem.acquire(0):  pass
00181
00182     t0  = time.time()
00183
00184     # Compensate for the extra CMD_SELF_TRIGGER below
00185     cnt   = 1
00186     count = self.__cnt
00187
00188     # Wait for START_RUN to enable triggers
00189     trigger.waitForMaskEnable()
00190
00191     trigger.solicit()                   # Issue an internal trigger
00192     eventSem.acquire()                  # Wait for the event to be processed
00193
00194     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00195     while cnt < count and not self.__cmdSynchQuit:
00196       cnt += 1
00197       trigger.solicit()                 # Issue an internal trigger
00198       time.sleep(.0001)
00199       eventSem.acquire()                # Wait for the event to be processed
00200       #trigger.disable()                # Disable triggers
00201       # Do stuff
00202       #trigger.enable()                 # Enable triggers
00203
00204     t2 = trigger.getTimeStamp()                 # Get the last trigger timestamp
00205
00206     if t1 is None:
00207       t1 = t0
00208     if t2 is None:
00209       t2 = time.time()
00210     dT = t2 - t1
00211     if dT == 0.0:  dT = 0.000001
00212     log.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00213              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00214
00215     # Get out of waiting when in suite or standalone mode
00216     self.sync()
00217
00218     # execute the GUI functions for stopRun, just in case
00219     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00220       if self.rc is not None:
00221         self.rc.doStop()
00222
00223   def wait(self):
00224     self.__cmdSynchSem.acquire()
00225
00226   def sync(self):
00227     if __name__ == "__main__" or self.isRunFromSuite():
00228       self.__cmdSynchSem.release()
00229
00230
00231 # Standalone mode:
00232 if __name__ == "__main__":
00233   from LATTE.runcontrol.RunControlCommon import RunControlCommon
00234
00235   rcCommon = RunControlCommon()
00236   rcCommon.initialize()
00237   rcCommon.setLoggingLevel("INFO")
00238   rcCommon.connect()
00239   ua = userApplication(None, 321, rcCommon)
00240   ua.rcSetup()
00241   ua.rcStartRun()
00242   ua.wait()
00243   ua.rcStopRun()
00244   ua.rcTeardown()
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testAppReport.py Source File

testAppReport.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "V&V test for rcTestReport class"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "11/21/2002"
00014 __version__  = "$Revision: 1.1 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import logging       as     log
00020 from   LATTE.runcontrol.rcTransitions import rcTransitions
00021 from   LATTE.runcontrol.rcTestReport  import rcTestReport
00022 import time
00023 import os
00024
00025 #  Example application implementation.
00026 #  Note that the name of the class must be userApplication.
00027 #  Look at rcTransitions for names of other transition methods that can be used.
00028 class userApplication(rcTransitions):
00029   "Implementation class for a user application"
00030   def __init__(self, rc, userId, debug):
00031     rcTransitions.__init__(self, rc, userId, debug)
00032     log.debug("userApplication.__init__()")
00033     self.tr = rcTestReport()
00034
00035   def getName(self):
00036     return __name__
00037
00038   def setup(self):
00039     log.debug("userApplication.setup()")
00040     # A state transition can be rejected by not returning None
00041     return None
00042
00043   def startRun(self):
00044     log.debug("userApplication.startRun()")
00045     # A state transition can be rejected by not returning None
00046     self.rc.doStop()
00047     return None
00048
00049   def stopRun(self):
00050     log.debug("userApplication.stopRun()")
00051     self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00052     self.createTestReport()
00053     # The STOP_RUN transition can not be rejected
00054
00055   def createTestReport(self):
00056     tr = self.tr
00057     tr.initReport(title='CAL System Test Procedure')
00058     tr.addHTML("""
00059       <STYLE TYPE="text/css">
00060         H1 { font-size: x-large; color: red }
00061         H2 { font-size: large; color: blue }
00062         H3 { font-size: medium; color: blue }
00063       </STYLE>
00064     """)
00065     tr.addHeading('CALF_SUPP_P02')
00066     tr.addHeading('System Test Procedure Report')
00067     tr.addHeading('Sat May 31, 2003 18:01:46 Eastern Daylight Time')
00068     versions = tr.addSection('Versions')
00069     tr.addSectionItem(versions, 'Release', 'P01-06-00')
00070     verTable = tr.addSectionTable(versions, border='1', width='25%')
00071     tr.addTableHeader(verTable, '<i>Module</i>', 'left')
00072     tr.addTableHeader(verTable, '<i>Version</i>', 'right')
00073     tr.beginTableRow(verTable)
00074     tr.addTableData('GAEM', align='left')
00075     tr.addTableData('2.0.1.0', align='right')
00076     tr.beginTableRow(verTable)
00077     tr.addTableData('GGLT', align='left')
00078     tr.addTableData('1.3.1.0', align='right')
00079     tr.addSectionItem(versions, 'Verification failed on', 'cmdCli, evtCli')
00080     assocFiles = tr.addSection('Associated Files')
00081     tr.addSectionItem(assocFiles,
00082                       'Snapshot File',
00083                       '../snapshots/030531180141_calf_supp_p02.xml',
00084                       'http://archsys/snapshots/030531180141_calf_supp_p02.xml'
00085                     )
00086     tr.addSectionItem(assocFiles,
00087                       'Event File',
00088                       '../Event Collections/030531180141_calf_supp_p02.ced',
00089                       'http://archsys/Event Collections/030531180141_calf_supp_p02.ced'
00090                     )
00091
00092     runp = tr.addSection('Run Parameters')
00093     tr.addSectionItem(runp, 'Number of Charge Injection events per setting', '500')
00094     tr.addSectionItem(runp, 'Charge Injection setting', '100')
00095     tr.addSectionItem(runp, 'Tack Delay Setting(timed readout delay)', '56')
00096     tr.addSectionItem(runp, 'CAL Bias DAC setting', '0x15800')
00097     tr.addSectionItem(runp, 'LE Gain setting', '5')
00098     tr.addSectionItem(runp, 'LE Gain setting', '13')
00099     tr.addSectionImage(runp, 'Test Image', './CALreport.png')
00100     laset = tr.addSection('Log Accept DAC Settings')
00101     dsTable = tr.addSectionTable(laset, border='1', width='100%')
00102     for hdr in ('Row', 'Lg0', 'Lg1', 'Lg2', 'Lg3', 'Lg4', 'Lg5', 'Lg6', 'Lg7', 'Lg8', 'Lg9', 'Lg10', 'Lg11'):
00103       tr.addTableHeader(dsTable, hdr, align='left')
00104     for data in [('X0' ,17,0,0,13,16,20,23,16,2,0,3,18),
00105                 ('X0+',18,28,15,16,8,6,16,7,11,32,0,6)
00106                 ]:
00107       tr.beginTableRow(dsTable)
00108       for d in data:
00109         tr.addTableData(d, align='left', width='7%')
00110     corNrgThr = tr.addSection('Corresponding Energy Thresholds(Mev)')
00111     ntTable = tr.addSectionTable(corNrgThr, border='1', width='100%')
00112     for hdr in ('Row', 'Lg0', 'Lg1', 'Lg2', 'Lg3', 'Lg4', 'Lg5', 'Lg6', 'Lg7', 'Lg8', 'Lg9', 'Lg10', 'Lg11'):
00113       tr.addTableHeader(ntTable, hdr, align='left')
00114     for data in [('X0' ,0.76,1.58,1.71,0.58,0.62,0.57,0.48,0.78,0.58,1.82,0.44,1.01),
00115                 ('X0+',0.75,0.66,1.14,0.65,0.36,0.63,0.62,0.93,0.61,0.58,3.83,0.50)
00116                 ]:
00117       tr.beginTableRow(ntTable)
00118       for d in data:
00119         if d > 1.0:
00120           d = '<b>' + str(d) + '</b>'
00121         else:
00122           d = str(d)
00123         tr.addTableData("<u>"+d+"</u>", align='left', width='7%')
00124     tr.addHTML('<b>BOLD</b> indicates energy thresholds above 1 Mev', section=corNrgThr)
00125     sumPage = tr.addSection('Summary Page', insert=0)
00126     tr.addSectionItem(sumPage, 'Test Description', 'Determine nominal log accept DAC settings')
00127     tr.addSectionItem(sumPage, 'Operator', 'johnson')
00128     tr.addSectionItem(sumPage, 'Schema', 'EM AFEE boards SN# X-001, X-002, Y-001, Y-002')
00129     tr.addSectionItem(sumPage, 'Configuration', 'calf_supp_p02.xml version:0.1')
00130     tr.addSectionItem(sumPage, 'Test Start Time', 'Sat May 31, 2003 18:01:46 Eastern Daylight Time')
00131     tr.addSectionItem(sumPage, 'Test End Time', 'Sat May 31, 2003 18:04:12 Eastern Daylight Time')
00132     tr.addSectionItem(sumPage, 'Test Start AFEEoTo Temp', '25.13C')
00133     tr.addSectionItem(sumPage, 'Test Stop AFEEoTo Temp', '25.17C')
00134     tr.addSectionItem(sumPage, 'Status', 'PASSED')
00135     tr.addSectionItem(sumPage, 'Notes', '')
00136     tr.insertSection(sumPage, versions)
00137     log.debug("Generating test report...")
00138     testReportFile = os.path.join(self.prefs["reportdir"],
00139                                   'testAppReport_%s.html' % self.runId)
00140     tr.transformToFile(os.path.expandvars('$ONLINE_ROOT/LATTE/repos/reportStyle.xsl'),
00141                                           testReportFile)
00142     self.addExportedFile(testReportFile)
00143
00144
00145
00146 # Standalone mode:
00147 if __name__ == "__main__":
00148   from LATTE.runcontrol.RunControlCommon import RunControlCommon
00149
00150   rcCommon = RunControlCommon()
00151   rcCommon.initialize()
00152   rcCommon.setLoggingLevel("INFO")
00153   rcCommon.connect()
00154   ua = userApplication(None, 321, rcCommon)
00155   ua.rcSetup()
00156   ua.rcStartRun()
00157   ua.wait()
00158   ua.rcStopRun()
00159   ua.rcTeardown()
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testAppTkr.py Source File

testAppTkr.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example TKR test application"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "11/21/2002"
00014 __version__  = "$Revision: 1.8 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import                      threading
00020 import logging       as     log
00021
00022 from   LATTE.runcontrol.rcTransitions import rcTransitions
00023 from   LATTE.runcontrol.ArgumentImpl   import ArgumentImpl
00024 import                      time
00025
00026 from support.SimpleGasuExample   import *
00027 from support.MiniGLTExample      import *
00028
00029 TRUE  = (0 < 1)
00030 FALSE = not TRUE
00031
00032 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00033 #  the userApplication example to get the number of self triggers to take.
00034 class userArgument(ArgumentImpl):
00035   "GUI for getting the user to input some sort of value."
00036   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00037     ArgumentImpl.__init__(self, parent, name, modal, fl)
00038     self.__value = 0
00039     self.setCaption("Hello world!")
00040
00041   def OKButtonClicked(self):
00042     self.__value = int(self.ArgumentList.text().latin1())
00043     self.close()
00044
00045   def CancelButtonClicked(self):
00046     self.__value = None
00047     self.close()
00048
00049   def getValue(self, caption):
00050     self.setCaption(caption)
00051     self.show()
00052     self.exec_loop()
00053     return self.__value
00054
00055 class userArgText(object):
00056   "Text user interface for getting the user to input some sort of value"
00057   def __init__(self):
00058     pass
00059
00060   def getValue(self, caption):
00061     return int(raw_input("%s: " % (caption)))
00062
00063
00064 #  Example application implementation.
00065 #  Note that the name of the class must be userApplication.
00066 #  Look at rcTransitions for names of other transition methods that can be used.
00067 class userApplication(rcTransitions):
00068   "Implmentation class for a user application"
00069   def __init__(self, rc, userId, debug):
00070     rcTransitions.__init__(self, rc, userId, debug)
00071     log.debug("userApplication.__init__()")
00072     self.__eventSem    = threading.Semaphore(0)
00073     self.__cmdSynchSem = threading.Semaphore(0)
00074
00075   def getName(self):
00076     return __name__
00077
00078   def setup(self):
00079     log.debug("userApplication.setup()")
00080
00081     if self.rc is None:
00082       self.__arg = userArgText()
00083     else:
00084       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00085
00086     # Get a TEM instance
00087     if self.lat.TEMcnt() == 1:
00088       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00089     elif self.lat.TEMcnt() > 1:
00090       tem = self.lat.TEM.all()
00091     else:
00092       log.fatal("No TEM(s) found in the schema")
00093       return -1
00094
00095 #  Move to schema configuration
00096 #    # reset the TEM since we are going to modify DATA_MASKS
00097 #    tem.CMD_RESET = 1
00098
00099 #    #
00100 #    # Configure TEM
00101
00102 #    # config TEM TKR calstrobe delay for ~ 5usec
00103 #    tem.TKR_TRGSEQ = 0x3C
00104
00105 #    # enable TKR, no diag #  0x1F00 for diag
00106 #    # make sure we also enable CAL CC 1 since it is required for
00107 #    # proper event data taking
00108 #    # enable GTCC 2 and 3
00109 #    tem.DATA_MASKS = 0x0DF3
00110 #    tem.configuration = 0x00010000L # primary
00111 #    #tem.CONFIGURATION = 0x03010000L # redundant
00112
00113 #    ccc = tem.allCCC()
00114 #    # enable output in our GCCCs
00115 #    # broadcast load of GCCC_REG_CONFIGURATION
00116 #    ccc.CONFIGURATION = 0x80000000L
00117
00118 #    #  disable all GCRCs in all GCCCs via broadcast
00119 #    ccc.LAYER_MASK_0 = 0xFFFFFFFFL
00120 #    ccc.LAYER_MASK_1 = 0xFFFFFFFFL
00121
00122     tcc = tem.allTCC()
00123
00124 #  Move to schema configuration
00125     # broadcast load of GTCC_REG_CONFIGURATION
00126     # enable controller output and set cable length to 1
00127     # 0xC0000000 is for one layer
00128     # 0x80000000 is for two layers
00129     #tcc.CONFIGURATION = 0xC0000000L
00130     #x_tcc = tem.downTCC(0)
00131     # enable all masks
00132
00133     tcc.INPUT_MASK = 0x0
00134
00135     # set maximum event timeout
00136     tcc.EVENT_TIMEOUTS = 0x0
00137
00138     #
00139     # Configure GTRCs
00140     #
00141
00142     # our board is connected CC = 2, RC = 0 and CC = 3, RC = 0
00143     # reset GTRC # required before all triggers
00144
00145     trc = tcc.allTRC()
00146
00147     trc.CMD_RESET = 1
00148
00149     # number of GTFE to readout left
00150     nGTFEsLeft  = 7
00151     nGTFEsRight = 0
00152
00153     # max hits per GTRC # 31 max
00154     maxHits = 31
00155
00156     enMask  = 0x6
00157
00158     dLO = (enMask << 28) | ((nGTFEsRight << 7)& 0xF80) | (maxHits & 0x7F);
00159     print "dLO=", dLO, hex(dLO)
00160
00161     # cable controller 2, readout controller 0
00162     tcc = tem.downTCC(2)
00163     trc = tcc.downTRC(1)
00164
00165     trc.CSR = dLO
00166
00167     dLO = (enMask << 28) | ((nGTFEsLeft << 7)& 0xF80) | (maxHits & 0x7F);
00168     print "dLO=", dLO, hex(dLO)
00169
00170     # cable controller 3, readout controller 0
00171     tcc = tem.downTCC(3)
00172     trc = tcc.downTRC(1)
00173
00174     trc.CSR = dLO
00175
00176     #
00177     # Configure GTFEs
00178     #
00179
00180     tfe = trc.allTFE()
00181     tfe.TRIG_MASK = 0x0
00182     tfe.DATA_MASK = 0x0
00183     tfe.CALIB_MASK = 0x0
00184     tfe.DAC = 0x00001902
00185     # configure front ends # all listen to left
00186     tfe.MODE = 0
00187     #tfe = trc.downTFE(0)
00188
00189     # configure default DACs for threshold and calibration
00190     # Calibration DAC Range and Resolution
00191     # Low Range (B6=0):  DAC output voltage in mV = 1.57 + 1.53*DAC_Value
00192     # High Range (B6=1): DAC output voltage in mV = 15.0 + 14.6*DAC_Value
00193     # Discriminator Threshold DAC Range and Resolution
00194     # Low Range (B6=0):  DAC output voltage in mV = 4.5 + 4.5*DAC_Value
00195     # High Range (B6=1): DAC output voltage in mV = 12.9 + 12.9*DAC_Value
00196
00197
00198     # calRng = 1
00199     # thrRng = 0
00200     # calDAC = 60
00201     # thrDAC = 10
00202
00203     tfe.DAC = 0x00001952  # based on the above Rng and DAC values
00204
00205     # enable GTFE for data taking # all channels
00206     tfe.TRIG_MASK = 0xffffffffffffffff
00207     tfe.DATA_MASK = 0xffffffffffffffff
00208
00209     # Cal strobe channels 4 and 48 only
00210     tfe.CALIB_MASK = 0x0001000000000010
00211
00212     #~ #Mask of the following Registers
00213     #~ tfe = trc.downTFE(13)
00214     #~ tfe.DATA_MASK = 0x0L
00215     #~ tfe.CALIB_MASK = 0x0L
00216     #~ tfe.TRIG_MASK = 0x0L
00217
00218     #~ tfe = trc.downTFE(14)
00219     #~ tfe.DATA_MASK = 0x0L
00220     #~ tfe.CALIB_MASK = 0x0L
00221     #~ tfe.TRIG_MASK = 0x0L
00222
00223     #~ tfe = trc.downTFE(19)
00224     #~ #tfe.DATA_MASK = 0x0L
00225     #~ tfe.CALIB_MASK = 0x0L
00226     #~ tfe.TRIG_MASK = 0x0L
00227
00228     #~ tfe = trc.downTFE(20)
00229     #~ #tfe.DATA_MASK = 0x0L
00230     #~ tfe.CALIB_MASK = 0x0L
00231     #~ tfe.TRIG_MASK = 0x0L
00232
00233
00234
00235     # Two choices for the trigger, GEM and MiniGLT
00236     if self.lat.existsGEM():
00237       self.trigger( SimpleGasuExample() )
00238     else:
00239       self.trigger( MiniGLTExample() )
00240
00241
00242     # A state transition can be rejected by not returning None
00243     return None
00244
00245   def startRun(self):
00246     log.debug("userApplication.startRun()")
00247
00248     caption = "Enter number of triggers to take"
00249     if self.rc is None:
00250       cnt = self.__arg.getValue(caption)
00251     else:
00252       cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00253
00254     # The user pressed 'Cancel'
00255     if cnt is None:  return -1
00256     self.__cnt = cnt
00257
00258     if self.rc is not None:
00259       self.getParameterVerifier().add(caption, cnt)
00260
00261     # Spawn a thread to synchronize commands with events
00262     # This must happen after triggers are enabled
00263     self.__cmdSynchQuit = FALSE
00264     #cmdSynch = threading.Thread(None, self.__commandSynch, 'CmdSynch', (cnt,))
00265     #self.__cmdSynch = cmdSynch
00266     #cmdSynch.start()
00267     # A state transition can be rejected by not returning None
00268     return None
00269
00270   def stopRun(self):
00271     log.debug("userApplication.stopRun()")
00272     self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00273     self.__cmdSynchQuit = TRUE
00274     self.__eventSem.release()
00275     #self.__cmdSynch.join()
00276
00277     # The STOP_RUN transition can not be rejected
00278
00279   def resume(self):
00280     log.debug("userApplication.resume()")
00281     # Issue self trigger to make up for the one that was lost during PAUSE
00282     self.trigger().solicit()
00283
00284     return None
00285
00286   def stop(self):
00287     log.debug("userApplication.stop()")
00288
00289     return self.stopRun()
00290
00291   def teardown(self):
00292     log.debug("userApplication.teardown()")
00293     # Allow the C++ object to be deleted
00294     if self.rc is not None and self.__arg is not None:
00295       self.__arg.deleteLater()
00296
00297   def process(self, (status, buffer)):
00298     "Method called back for each data event taken"
00299     ###log.debug("userApplication.process()")
00300
00301     evtCli = self.evtCli
00302
00303     if status != 0:
00304       if evtCli.isGGLTStatus():
00305         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00306       elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00307         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00308       self.__eventSem.release()
00309       return
00310     try:
00311       # In the future this event may contain additional data
00312       if evtCli.isSweepEvent(): return
00313     except:
00314       # Event summary word inaccessible, handle the bad event here
00315       log.exception("")
00316       return
00317
00318     if evtCli.setCurrentContribution(evtCli.TEM0) != -1:
00319       evtCli.evDumpSummary()
00320       evtCli.evDumpTKR()
00321       evtCli.evDumpTEM_Error()
00322       evtCli.evDumpDiagnostic()
00323     else:
00324       log.error("*******************************************")
00325       log.error("*   NO TEM 0 CONTRIBUTION PRESENT         *")
00326       log.error("*******************************************")
00327
00328     #print "TKRSTRIPS: ", len(evtCli.evt.TKRstrips)
00329     #for strip in evtCli.evt.TKRstrips:
00330     #  print strip.ui
00331
00332     # Get next event triggered
00333     self.__eventSem.release()
00334
00335   #def __commandSynch(self, count):
00336   def commandSynch(self):
00337     "Method called by the command synchronization task"
00338     import time
00339     trigger  = self.trigger()
00340     eventSem = self.__eventSem
00341     # Drain the semaphore release count
00342     # Handles the case when the stop run release collided with a trigger release
00343     while eventSem.acquire(0):  pass
00344
00345     t0  = time.time()
00346
00347     # Compensate for the extra CMD_SELF_TRIGGER below
00348     cnt = 1
00349     count = self.__cnt
00350
00351     # Wait for START_RUN to enable triggers
00352     trigger.waitForMaskEnable()
00353
00354     trigger.solicit()                   # Issue an internal trigger
00355     eventSem.acquire()                  # Wait for the event to be processed
00356
00357     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00358
00359     while cnt < count and not self.__cmdSynchQuit:
00360       cnt += 1
00361       trigger.solicit()                 # Issue an internal trigger
00362       time.sleep(.0001)
00363       eventSem.acquire()                # Wait for the event to be processed
00364       #trigger.disable()                # Disable triggers
00365       # Do stuff
00366       #trigger.enable()                 # Enable triggers
00367
00368     t2 = trigger.getTimeStamp()         # Get the last trigger timestamp
00369     # When we get here the triggers should still be enabled.
00370     # If the glt.MASK needs to be set through any other means
00371     # then it needs to be restored to its SETUP value here.
00372
00373     if t1 is None:
00374       t1 = t0
00375     if t2 is None:
00376       t2 = time.time()
00377     dT = t2 - t1
00378     if dT == 0.0:  dT = 0.000001
00379     log.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00380              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00381
00382     # Get out of waiting when in suite or standalone mode
00383     self.sync()
00384
00385     # execute the GUI functions for stopRun, just in case
00386     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00387       if self.rc is not None:
00388         self.rc.doStop()
00389
00390   def wait(self):
00391     self.__cmdSynchSem.acquire()
00392
00393   def sync(self):
00394     if __name__ == "__main__" or self.isRunFromSuite():
00395       self.__cmdSynchSem.release()
00396
00397
00398
00399 # Standalone mode:
00400 if __name__ == "__main__":
00401   from LATTE.runcontrol.RunControlCommon import RunControlCommon
00402
00403   rcCommon = RunControlCommon()
00404   rcCommon.initialize()
00405   rcCommon.setLoggingLevel("INFO")
00406   rcCommon.connect()
00407   ua = userApplication(None, 321, rcCommon)
00408   ua.rcSetup()
00409   ua.rcStartRun()
00410   ua.wait()
00411   ua.rcStopRun()
00412   ua.rcTeardown()
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testArchiver.py Source File

testArchiver.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example custom event archiver class"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2004/08/26 02:01:16 $").split(' ')[1]
00014 __version__  = "$Revision: 1.2 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 # History:
00021 #     $Log: testArchiver.py,v $
00022 #     Revision 1.2  2004/08/26 02:01:16  stuvi
00023 #     Fixed for LATTE 4
00024 #
00025 #     Revision 1.1  2004/07/28 21:24:00  stuvi
00026 #     Added testAppCal and its supporting classes.
00027 #
00028 #     Revision 1.3  2004/03/08 21:40:23  stuvi
00029 #     Added comments  for userMethod.
00030 #
00031 #     Revision 1.2  2004/03/06 01:18:26  stuvi
00032 #     Added userMethod example
00033 #
00034 #     Revision 1.1  2004/02/20 00:33:44  stuvi
00035 #     Sample testArchiver app and class
00036 #
00037 #
00038
00039 from LATTE.runcontrol import rcArchiver
00040 import logging            as     log
00041
00042 class testArchiver(rcArchiver.rcArchiver):
00043
00044   def __init__(self, filePath=None, fileName=None):
00045     rcArchiver.rcArchiver.__init__(self, filePath, fileName)
00046
00047   def write(self, data):
00048     log.info("Writing data using the custom event archiver %s" % self.__class__.__name__)
00049     rcArchiver.rcArchiver.write(self, data)
00050
00051   def getFileNameFromTS(ts):
00052     return "custom" + ts + ".data"
00053   getFileNameFromTS = staticmethod(getFileNameFromTS)
00054
00055   def userMethod(self, data, moreData):
00056     """User defined method for adding custom data to the archive
00057     It should not be called before startRun() method since the
00058     archiver doesn't get instantiated before then.
00059     """
00060     log.info("In userMethod of %s" % self.__class__.__name__)
00061     rcArchiver.rcArchiver.write(self, data)
00062     rcArchiver.rcArchiver.write(self, moreData)
00063
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testErrorPropogation.py Source File

testErrorPropogation.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Test application for inducing and detecting event errors"
00012 __author__   = "J. Panetta <panetta@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "2005/03/22"
00014 __version__  = "$Revision: 1.2 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import threading
00020 import logging       as     log
00021
00022 from   LATTE.runcontrol.rcTransitions import rcTransitions
00023 from   LATTE.runcontrol.ArgumentImpl  import ArgumentImpl
00024
00025 from support.SimpleGasuExample   import *
00026 from support.MiniGLTExample      import *
00027
00028
00029 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00030 #  the userApplication example to get the number of self triggers to take.
00031 class userArgument(ArgumentImpl):
00032   "GUI for getting the user to input some sort of value."
00033   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00034     ArgumentImpl.__init__(self, parent, name, modal, fl)
00035     self.__value = 0
00036     self.setCaption("Hello world!")
00037
00038   def OKButtonClicked(self):
00039     self.__value = int(self.ArgumentList.text().latin1())
00040     self.close()
00041
00042   def CancelButtonClicked(self):
00043     self.__value = None
00044     self.close()
00045
00046   def getValue(self, caption):
00047     self.setCaption(caption)
00048     self.show()
00049     self.exec_loop()
00050     return self.__value
00051
00052 class userArgText(object):
00053   "Text user interface for getting the user to input some sort of value"
00054   def __init__(self):
00055     pass
00056
00057   def getValue(self, caption):
00058     return int(raw_input("%s: " % (caption)))
00059
00060 #  Example application implementation.
00061 #  Note that the name of the class must be userApplication.
00062 #  Look at rcTransitions for names of other transition methods that can be used.
00063 class userApplication(rcTransitions):
00064   "Implmentation class for a user application"
00065   def __init__(self, gui, userId, debug):
00066     rcTransitions.__init__(self, gui, userId, debug)
00067     log.debug("userApplication.__init__()")
00068     self.__eventSem    = threading.Semaphore(0)
00069     self.__cmdSynchSem = threading.Semaphore(0)
00070
00071   def getName(self):
00072     return __name__
00073
00074   def setup(self):
00075     log.debug("userApplication.setup()")
00076
00077     if self.rc is None:
00078       self.__arg = userArgText()
00079     else:
00080       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00081
00082     # Two choices for the trigger, GEM and MiniGLT
00083     if self.lat.existsGEM():
00084       self.trigger( SimpleGasuExample() )
00085     else:
00086       self.trigger( MiniGLTExample() )
00087
00088     # A state transition can be rejected by not returning None
00089     return None
00090
00091   def startRun(self):
00092     log.debug("userApplication.startRun()")
00093
00094     caption = "Enter number of triggers to take"
00095     if self.rc is None:
00096       cnt = self.__arg.getValue(caption)
00097     else:
00098       cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00099
00100     # The user pressed 'Cancel'
00101     if cnt is None:  return -1
00102     self.__cnt = cnt
00103
00104     if self.rc is not None:
00105       self.getParameterVerifier().add(caption, cnt)
00106
00107     # Spawn a thread to synchronize commands with events
00108     # This must happen after triggers are enabled
00109     self.__cmdSynchQuit = False
00110
00111     # turn on the prescaler to infinite:
00112     self.ocs.evtHandlerSendPrescaled(-1)
00113
00114     # A state transition can be rejected by not returning None
00115     return None
00116
00117   def stopRun(self):
00118
00119     # Success is defined if we found one and only one trigger parity error
00120     # and one and only one packet error
00121     if self.getBadEvents() == 0 and self.getErrorEvents() == 0:
00122       self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00123     else:
00124       self.setCompletionStatus(self.COMPL_STATUS_FAILED)
00125
00126     self.__cmdSynchQuit = True
00127     self.__eventSem.release()
00128
00129     # The STOP_RUN transition can not be rejected
00130
00131   def resume(self):
00132     # Issue self trigger to make up for the one that was lost during PAUSE
00133     self.trigger().solicit()
00134
00135     return None
00136
00137   def stop(self):
00138     return self.stopRun()
00139
00140   def process(self, (status, buffer)):
00141     "Method called back for each data event taken"
00142     # log.debug("userApplication.process()")
00143
00144     evtCli = self.evtCli
00145
00146     if status != 0:
00147       print "status = ", status
00148       if evtCli.isGGLTStatus():
00149         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00150       elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00151         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00152       self.__eventSem.release()
00153       return
00154
00155     try:
00156       # In the future this event may contain additional data
00157       if evtCli.isSweepEvent():
00158         return
00159     except:
00160       # Event summary word inaccessible, handle the bad event here
00161       import gutil
00162       gutil.logException()
00163       return
00164
00165     if evtCli.isTrgParityErrorEvent():
00166       log.debug( "Found a trigger parity error")
00167     elif evtCli.isPacketErrorEvent():
00168       log.debug( "Found a packet error")
00169     else:
00170       log.debug( "Found a normal event")
00171     # Get next event triggered
00172     self.__eventSem.release()
00173
00174   def commandSynch(self):
00175     "Method called by the command synchronization task"
00176     import time
00177     trigger  = self.trigger()
00178     eventSem = self.__eventSem
00179
00180     # Drain the semaphore release count
00181     # Handles the case when the stop run release collided with a trigger release
00182     while eventSem.acquire(0):  pass
00183
00184     t0  = time.time()
00185
00186     # Compensate for the extra CMD_SELF_TRIGGER below
00187     cnt   = 1
00188     count = self.__cnt
00189
00190     # bitmask in GEM config to cause trigger parity error
00191     TPE = 0x20
00192     # bitmask in GEM config to cause packet error  (suppress bit)
00193     PKTE = 0x40
00194
00195     log.info(" commandSync")
00196     # Wait for START_RUN to enable triggers
00197     trigger.waitForMaskEnable()
00198
00199     # Cause a trigger parity error for GEM event
00200     log.info( "buggering gem configuration to create trigger parity errors")
00201     trigger.disable()
00202     gemc = trigger.GEM().GEMC
00203     gemcfg = gemc.CONFIGURATION
00204     gemcfg |= TPE
00205     gemc.configuration = gemcfg
00206     trigger.enable()
00207
00208     trigger.solicit()                   # Issue an internal trigger
00209     eventSem.acquire()                  # Wait for the event to be processed
00210
00211
00212     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00213     while cnt < count and not self.__cmdSynchQuit:
00214       cnt += 1
00215       trigger.solicit()                 # Issue an internal trigger
00216       time.sleep(.0001)
00217       eventSem.acquire()                # Wait for the event to be processed
00218       #trigger.disable()                # Disable triggers
00219       # Do stuff
00220       #trigger.enable()                 # Enable triggers
00221
00222     # Reset the GEM to remove the trigger parity error bit.
00223     trigger.disable()
00224     log.info( "unbuggering gem configuration")
00225     gemc = trigger.GEM().GEMC
00226     gemcfg = gemc.CONFIGURATION
00227     gemcfg &= ~TPE
00228     gemc.configuration = gemcfg
00229
00230     t2 = trigger.getTimeStamp()                 # Get the last trigger timestamp
00231
00232
00233     # Get out of waiting when in standalone mode
00234     self.sync()
00235
00236     # execute the GUI functions for stopRun, just in case
00237     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00238       if self.gui is not None:
00239         self.gui.doStopRun()
00240
00241   def wait(self):
00242     self.__cmdSynchSem.acquire()
00243
00244   def sync(self):
00245     if __name__ == "__main__" or self.isRunFromSuite():
00246       self.__cmdSynchSem.release()
00247
00248
00249 # Standalone mode:
00250 if __name__ == "__main__":
00251   import os
00252   log.basicConfig()
00253   log.getLogger("").setLevel(log.DEBUG)
00254   ua = userApplication(None, 321, 1)
00255   ua.rcSetup(os.path.join(os.environ['ONLINE_ROOT'], 'repos/simpleTemSchema.xml'))
00256   ua.rcStartRun()
00257   ua.wait()
00258   ua.rcStopRun()
00259   ua.rcTeardown()
00260
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testEvtBldr_script.py Source File

testEvtBldr_script.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Test application to demonstrate event merging"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "6/29/2006"
00014 __updated__  = ("$Date: 2006/07/19 16:23:25 $").split(' ')[1]
00015 __version__  = "$Revision: 1.3 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import threading
00022 import time
00023
00024 from   LATTE.runcontrol.ArgumentImpl   import ArgumentImpl
00025 from   support.rcTransitionsBT         import rcTransitionsBT
00026
00027 from   LATTE.tests.apps.support.SimpleGasuExample       import *
00028 from   LATTE.tests.apps.support.MiniGLTExample          import *
00029
00030 #from   support.BTdump import testDG
00031
00032
00033 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00034 #  the userApplication example to get the number of self triggers to take.
00035 class userArgument(ArgumentImpl):
00036   "GUI for getting the user to input some sort of value."
00037   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00038     ArgumentImpl.__init__(self, parent, name, modal, fl)
00039     self.__value = 0
00040     self.setCaption("Hello world!")
00041
00042   def OKButtonClicked(self):
00043     self.__value = int(self.ArgumentList.text().latin1())
00044     self.close()
00045
00046   def CancelButtonClicked(self):
00047     self.__value = None
00048     self.close()
00049
00050   def getValue(self, caption):
00051     self.setCaption(caption)
00052     self.show()
00053     self.exec_loop()
00054     return self.__value
00055
00056 class userArgText(object):
00057   "Text user interface for getting the user to input some sort of value"
00058   def __init__(self):
00059     pass
00060
00061   def getValue(self, caption):
00062     return int(raw_input("%s: " % (caption)))
00063
00064
00065 #  Example application implementation.
00066 #  Note that the name of the class must be userApplication.
00067 #  Look at rcTransitions for names of other transition methods that can be used.
00068 class userApplication(rcTransitionsBT):
00069   "Implmentation class for a user application"
00070   def __init__(self, rc, userId, debug):
00071     rcTransitionsBT.__init__(self, rc, userId, debug)
00072     import logging
00073     logging.debug("userApplication.__init__()")
00074     self.__eventSem    = threading.Semaphore(0)
00075     self.__cmdSynchSem = threading.Semaphore(0)
00076
00077   def getName(self):
00078     return __name__
00079
00080   def setup(self):
00081     import logging
00082     logging.debug("userApplication.setup()")
00083
00084     if self.rc is None:
00085       self.__arg = userArgText()
00086     else:
00087       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00088
00089     # Get a TEM instance
00090     if self.lat.TEMcnt() == 1:
00091       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00092     elif self.lat.TEMcnt() > 1:
00093       tem = self.lat.TEM.all()
00094     else:
00095       import logging
00096       logging.fatal("No TEM(s) found in the schema")
00097       return -1
00098
00099     #----- The following RESETs and other system register manipulation is
00100     #----- commented out as it is handled by RunControl.  Other register
00101     #----- setup should be taken care of in the schema/configuration file.
00102     # reset the TEM since we are going to modify DATA_MASKS
00103     #tem.CMD_RESET = 1
00104
00105     # clear TEM stats reg
00106     tem.COMMAND_RESPONSE = 0
00107
00108     # clear TEM status reg
00109     tem.STATUS = 0
00110
00111     # enable CAL, disable TKR, no diag #  0x10FF for diag
00112     #tem.DATA_MASKS = 0x10FF
00113
00114     # TEM config reg # set TEM timeout
00115     #tem.CONFIGURATION = 0
00116
00117     #status = gTEMread( __GT, temId, TEM_REG_CONFIGURATION, &payload);
00118     #printf("tem config reg = 0x%08x\n", payload);
00119
00120     # enable output in our GCCCs
00121     # broadcast load of GCCC_REG_CONFIGURATION
00122
00123     #bcast_ccc = tem.allCCC()
00124     #bcast_ccc.CONFIGURATION = 0x80000000L
00125
00126     #  disable all GCRCs in all GCCCs via broadcast # GCCC_REG_LAYER_MASK_0, GCCC_REG_LAYER_MASK_1
00127     #bcast_ccc.LAYER_MASK_0 = 0xFFFFFFFFL
00128     #bcast_ccc.LAYER_MASK_1 = 0xFFFFFFFFL
00129     #ccc0 = tem.downCCC(0) # O$GCCC_00
00130     #ccc0.LAYER_MASK_0 = 0xFFFF0000L
00131     #ccc0.LAYER_MASK_1 = 0xFFFF000FL
00132     #ccc2 = tem.downCCC(2) # O$GCCC_02
00133     #ccc2.LAYER_MASK_0 = 0xFFFF0000L
00134     #ccc2.LAYER_MASK_1 = 0xFFFF0000L
00135
00136     # config GCFE for calibration -- range 0 first
00137     #bcast_cfe = tem.allCCC().allCRC().allCFE()
00138     #bcast_cfe.CONFIG_0    = 0x00
00139     #bcast_cfe.CONFIG_1    = 0x36
00140     #bcast_cfe.FLE_DAC     = 0x55
00141     #bcast_cfe.FHE_DAC     = 0x55
00142     #bcast_cfe.LOG_ACPT    = 0x10
00143     #bcast_cfe.RNG_ULD_DAC = 0x7F
00144     #bcast_cfe.REF_DAC     = 0x7f
00145
00146     # config GCRC for calibration
00147     #bcast_crc = tem.allCCC().allCRC()
00148     #bcast_crc.DELAY_1 = 0xFF
00149     #bcast_crc.DELAY_2 = 0xFF
00150     #bcast_crc.DELAY_3 = 0xFF
00151     #bcast_crc.DAC = 0x42FE
00152     #bcast_crc.DAC = 0x42FE
00153
00154     # large timeouts for all GCCCs
00155     # broadcast load of GCCC_REG_EVENT_TIMEOUTS
00156     #bcast_ccc.EVENT_TIMEOUTS = 0x0
00157     #status = gGCCCread( __GT, temId, 1, GCCC_REG_EVENT_TIMEOUTS, &payload);
00158     #printf("gccc register event timeouts = 0x%08x\n", payload);
00159
00160     # Register environment variables for housekeeping
00161     #hsk = self.getHSK()
00162     #regs = [tem.regs['data_masks'], ccc2.regs['layer_mask_1']]
00163     #hsk.addEnvRegs(regs)
00164     #hsk.setUpdateInterval(1)
00165
00166     # Two choices for the trigger, GEM and MiniGLT
00167     if self.lat.existsGEM():
00168       self.trigger( SimpleGasuExample() )
00169     else:
00170       self.trigger( MiniGLTExample() )
00171
00172     # Override the default event handler
00173     self.selectEventHandler(rcTransitionsBT.EVENT_HANDLER_CUSTOM, self.eventHandler)
00174
00175     # A state transition can be rejected by not returning None
00176     return None
00177
00178   def startRun(self):
00179     import logging
00180     logging.debug("userApplication.startRun()")
00181
00182     # Don't let the Ancillary Trailer stop the run
00183     #self.autoStopRun(False)
00184
00185     caption = "Enter number of triggers to take"
00186     if self.rc is None:
00187       cnt = self.__arg.getValue(caption)
00188     else:
00189       cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00190
00191     # The user pressed 'Cancel'
00192     if cnt is None:  return -1
00193     self.__cnt = cnt
00194
00195     self.getParameterVerifier().add(caption, cnt)
00196
00197     # Spawn a thread to synchronize commands with events
00198     self.__cmdSynchQuit = False
00199
00200     # A state transition can be rejected by not returning None
00201     return None
00202
00203   def stopRun(self):
00204     import logging
00205     logging.debug("userApplication.stopRun()")
00206
00207     if self.getBadEvents() == 0 and self.getErrorEvents() == 0:
00208       self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00209     else:
00210       self.setCompletionStatus(self.COMPL_STATUS_FAILED)
00211
00212     self.__cmdSynchQuit = True
00213     self.__eventSem.release()
00214
00215     # The STOP_RUN transition can not be rejected
00216
00217   def resume(self):
00218     import logging
00219     logging.debug("userApplication.resume()")
00220
00221     # Issue self trigger to make up for the one that was lost during PAUSE
00222     self.trigger().solicit()
00223
00224     return None
00225
00226   def stop(self):
00227     import logging
00228     logging.debug("userApplication.stop()")
00229
00230     return self.stopRun()
00231
00232   def teardown(self):
00233     import logging
00234     logging.debug("userApplication.teardown()")
00235     # Allow the C++ object to be deleted
00236     if self.rc is not None and self.__arg is not None:
00237       self.__arg.deleteLater()
00238
00239   def process(self, (status, latDatagram)):
00240     "Method called back for each data event taken"
00241     import logging
00242     #logging.debug("userApplication.process()")
00243
00244     #evtCli = self.evtCli
00245
00246     if status != 0:
00247       #if evtCli.isGGLTStatus():
00248       logging.error("%s.process(): GGLT_STATUS = 0x%08x = %d", self.getName(), status, status)
00249       #logging.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00250       #elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00251       #  logging.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00252 #    testDG(latDatagram)
00253
00254     # Get next event triggered
00255     self.__eventSem.release()
00256
00257   def commandSynch(self):
00258     "Method called by the command synchronization task"
00259     import time
00260     trigger  = self.trigger()
00261     eventSem = self.__eventSem
00262
00263     # Drain the semaphore release count
00264     # Handles the case when the stop run release collided with a trigger release
00265     while eventSem.acquire(0):  pass
00266
00267     t0  = time.time()
00268
00269     # Compensate for the extra CMD_SELF_TRIGGER below
00270     cnt   = 1
00271     count = self.__cnt
00272
00273     # Wait for START_RUN to enable triggers
00274     trigger.waitForMaskEnable()
00275
00276     trigger.solicit()                   # Issue an internal trigger
00277     #eventSem.acquire()                  # Wait for the event to be processed
00278
00279     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00280     while cnt < count and not self.__cmdSynchQuit:
00281       cnt += 1
00282       trigger.solicit()                 # Issue an internal trigger
00283       time.sleep(.0001)
00284       eventSem.acquire()                # Wait for the event to be processed
00285       #trigger.disable()                # Disable triggers
00286       # Do stuff
00287       #trigger.enable()                 # Enable triggers
00288
00289     t2 = trigger.getTimeStamp()                 # Get the last trigger timestamp
00290
00291     if t1 is None:
00292       t1 = t0
00293     if t2 is None:
00294       t2 = time.time()
00295     dT = t2 - t1
00296     if dT == 0.0:  dT = 0.000001
00297     import logging
00298     logging.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00299              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00300
00301     # Get out of waiting when in suite or standalone mode
00302     self.sync()
00303
00304     # execute the GUI functions for stopRun, just in case
00305     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00306       if self.rc is not None:
00307         self.rc.doStop()
00308
00309   def wait(self):
00310     self.__cmdSynchSem.acquire()
00311
00312   def sync(self):
00313     if __name__ == "__main__" or self.isRunFromSuite():
00314       self.__cmdSynchSem.release()
00315
00316
00317 # Standalone mode:
00318 if __name__ == "__main__":
00319   import os
00320   import logging
00321   logging.basicConfig()
00322   logging.getLogger("").setLevel(logging.DEBUG)
00323   ua = userApplication(None, 321, 0)
00324   prefs = {'datasave': 1, 'datadir':os.path.join(os.environ['ONLINE_ROOT'],'temp')}
00325   ua.setPrefs(prefs)
00326   ua.rcSetup(os.path.join(os.environ['ONLINE_ROOT'], 'repos/simpleTemSchema.xml'))
00327   ua.rcStartRun()
00328   ua.wait()
00329   ua.rcStopRun()
00330   ua.rcTeardown()
00331
00332 # History:
00333 #     $Log: testEvtBldr_script.py,v $
00334 #     Revision 1.3  2006/07/19 16:23:25  claus
00335 #     AutoStopRun support
00336 #
00337 #     Revision 1.2  2006/07/14 23:25:55  claus
00338 #     Fix import problems
00339 #
00340 #     Revision 1.1  2006/07/14 22:37:29  claus
00341 #     Example socket based LATTE test script application of the event builder.
00342 #
00343 #     Revision 1.1  2006/07/14 22:35:24  claus
00344 #     Example socket based LATTE test script application of the event builder.
00345 #
00346 #     Revision 1.7  2005/03/21 17:58:12  claus
00347 #     Modified to use the first TEM found in the schema, if only one is there, or
00348 #     broadcast to all TEMs if there are multiple.
00349 #
00350 #     Revision 1.6  2004/11/01 23:09:39  claus
00351 #     Added a comment.
00352 #
00353 #     Revision 1.5  2004/10/30 01:52:20  stuvi
00354 #     Check if the archiver is None before accessing it.
00355 #
00356 #     Revision 1.4  2004/10/25 02:44:43  panetta
00357 #     Fixes regarding byteswapping and error contribution
00358 #
00359 #     Revision 1.3  2004/10/23 23:50:33  claus
00360 #     Added completionStatus logic.
00361 #
00362 #     Revision 1.2  2004/10/18 01:00:19  claus
00363 #     Provided switch between 2 examples of adding custom LATcontributions.
00364 #
00365 #     Revision 1.4  2004/08/31 03:13:38  stuvi
00366 #     Integrated the parameter verifier with Run Control
00367 #
00368 #     Revision 1.3  2004/08/18 18:00:15  stuvi
00369 #     Updated for LATTE 4.
00370 #     All hippo functions go through the Qt GUI bridge now.
00371 #
00372 #     Revision 1.2  2004/08/13 04:46:22  claus
00373 #     Got rid of obsolete TRUE and FALSE declarations.
00374 #
00375 #     Revision 1.1  2004/07/28 21:24:00  stuvi
00376 #     Added testAppCal and its supporting classes.
00377 #
00378 #     Revision 1.28  2004/07/09 23:14:17  stuvi
00379 #     Added "operatorobj" preference that contains the rcUser object and left the "operator" preference to contain the user name.
00380 #
00381 #     Revision 1.27  2004/05/03 22:49:36  stuvi
00382 #     Added commented out code example that demonstrates how to access the CAL and TKR diagnostics contributions.
00383 #
00384 #     Revision 1.26  2004/05/03 21:19:47  stuvi
00385 #     Moved non-Runcontrol scripts to the support directory and modified imports accordingly.
00386 #
00387 #     Revision 1.25  2004/04/21 21:05:29  stuvi
00388 #     Added an example of how to pass the preferences using the setPrefs method when running in standalone mode.
00389 #
00390 #     Revision 1.24  2004/04/17 02:23:48  stuvi
00391 #     Added teardown() to delete the C++ object for the userArgument
00392 #     Fixed LogData parsing based on the evtCli changes
00393 #
00394 #     Revision 1.23  2004/03/31 01:01:19  stuvi
00395 #     Added commented code on how to parse the error contribution.
00396 #
00397 #     Revision 1.22  2004/03/10 22:24:51  panetta
00398 #     Upgraded trigger interface.
00399 #     Removed dependencies on self.glt.
00400 #
00401 #     Revision 1.21  2004/03/04 23:08:47  stuvi
00402 #     Removed glt.destination assignment
00403 #
00404 #     Revision 1.20  2004/02/20 03:20:23  stuvi
00405 #     Added handling of the sweep events and error checking to the process() method,
00406 #
00407 #     Revision 1.19  2004/02/13 03:13:25  stuvi
00408 #     Sweep events are also sent to user script's process event now, so added code to handle the case.
00409 #
00410 #     Revision 1.18  2004/02/02 23:14:00  stuvi
00411 #     Changes required to make the scripts work with the new FSM engine.
00412 #
00413 #     Revision 1.17  2004/01/30 04:33:44  claus
00414 #     Updated for transitions not running in the GUI thread.
00415 #     New commandSynch handling.
00416 #
00417 #     Revision 1.16  2003/12/19 02:05:26  stuvi
00418 #     Added support for creating and updating GUIs from a suite
00419 #
00420 #     Revision 1.15  2003/12/11 02:22:35  stuvi
00421 #     Suite and standalone mode modifications
00422 #
00423 #     Revision 1.14  2003/12/11 01:53:16  stuvi
00424 #     Modified code to support suites.
00425 #
00426 #     Revision 1.13  2003/11/25 02:16:12  stuvi
00427 #     Modified according to the current test setup to generate some results
00428 #
00429 #     Revision 1.12  2003/11/04 04:25:11  stuvi
00430 #     Changed the commandSynch logic so that the enableMask() call would not pose a threat to snapshot taking.
00431 #
00432 #     Revision 1.11  2003/10/31 01:09:37  panetta
00433 #     1)  Moved register writes from startRun to setup
00434 #     2)  Added GLT enabling logic to __commandSynch
00435 #     3)  Gave example of getting the start/stop time from the hardware/event stream
00436 #
00437 #     Revision 1.10  2003/10/28 03:17:34  stuvi
00438 #     Added support for calculating the event rate correctly using the new GLT behaviour.
00439 #
00440 #     Revision 1.9  2003/08/21 21:13:38  stuvi
00441 #     no message
00442 #
00443 #     Revision 1.8  2003/07/17 00:01:35  stuvi
00444 #     no message
00445 #
00446 #     Revision 1.7  2003/06/13 23:26:24  stuvi
00447 #     Added TEM reset
00448 #
00449 #     Revision 1.6  2003/04/12 02:38:34  stuvi
00450 #     Added Cancel button handler to argument class
00451 #
00452 #     Revision 1.5  2003/04/09 00:45:15  stuvi
00453 #     Commented out references to DATA_MASKS register which should not be touched during script execution.
00454 #
00455 #     Revision 1.4  2003/04/01 21:04:59  stuvi
00456 #     Fixed event count discrepancy when the run is stopped in the middle.
00457 #
00458 #     Revision 1.3  2003/03/31 19:23:44  stuvi
00459 #     Fixed name
00460 #
00461 #     Revision 1.2  2003/03/26 21:59:36  stuvi
00462 #     Fixed standalone mode
00463 #
00464 #     Revision 1.1  2003/03/11 21:20:55  stuvi
00465 #     Moved from RunControl directory
00466 #
00467 #     Revision 1.8  2003/02/06 05:19:38  claus
00468 #     Added resume; StopRun bug fix
00469 #
00470 #     Revision 1.7  2003/02/06 04:14:35  claus
00471 #     Fixed StopRun bug
00472 #
00473 #     Revision 1.6  2002/12/11 21:18:07  stuvi
00474 #     Changed glt register assignments to bit field assignments
00475 #
00476 #     Revision 1.5  2002/12/10 01:09:58  claus
00477 #     Added path and changed schema/config file for stand-alone mode
00478 #
00479 #     Revision 1.4  2002/12/04 01:59:23  claus
00480 #     Added message logging
00481 #
00482 #     Revision 1.3  2002/12/02 17:17:09  claus
00483 #     Added provision to allow application to run stand-alone
00484 #
00485 #     Revision 1.2  2002/11/28 02:02:04  claus
00486 #     Shuffled constructor arguments
00487 #
00488 #     Revision 1.1  2002/11/27 05:02:48  claus
00489 #     Initial version of Run Control
00490 #
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testEvtCli.py Source File

testEvtCli.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example custom event client class"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2004/09/14 02:14:44 $").split(' ')[1]
00014 __version__  = "$Revision: 1.3 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 # History:
00021 #     $Log: testEvtCli.py,v $
00022 #     Revision 1.3  2004/09/14 02:14:44  stuvi
00023 #     evtCli.read() now returns a 6 word header tuple and the event data as a two item tuple.
00024 #
00025 #     Revision 1.2  2004/08/06 03:33:57  stuvi
00026 #     Added custom event client support.
00027 #
00028 #     Revision 1.1  2004/07/28 21:24:00  stuvi
00029 #     Added testAppCal and its supporting classes.
00030 #
00031 #     Revision 1.1  2004/02/20 00:34:37  stuvi
00032 #     Sample custom event client implementation and test app
00033 #
00034 #
00035
00036 from LATTE.client.gEvtCli import *
00037
00038 class testEvtCli(EvtCli):
00039   def __init__(self, debug=0):
00040     EvtCli.__init__(self, debug)
00041
00042   def readEvent(self, dat=None):
00043     self.evt.clearEvent()
00044     (header, self.dat) = self.read()
00045     self._EvtCli__gglt_status = header[0]
00046     self.__version_info = header[3]
00047     self.__evt_status   = header[4] >> 16
00048     self.__evt_size     = header[4] & 0xFFFF
00049     if self._EvtCli__gglt_status != 0:
00050       self._EvtCli__online_status |= EvtCli.GGLT_STATUS_ERROR
00051       print "GGLT status=", self._EvtCli__gglt_status
00052       return self._EvtCli__online_status
00053     self.evt.cont_offset = EvtCli.FIRST_CONTRIBUTION_OFFSET
00054     # Get the summary word stored in the OSW contribution
00055     # to determine if the event has error.
00056     self.evt.summary = evSummary(self.getDWord(self.evGetSummary()))
00057     self._EvtCli__evt_error = self.evt.summary.error
00058     self.evt.cont_offset += ((header[5] & 0xFFFF) << 2)
00059     #self.evt.cont_cellHeader = evCellHeader(self.getDWord(self.evt.cont_offset) >> 16)
00060     #self.evt.contributor = self.evt.cont_cellHeader.source
00061     self.evt.cont_size   = (self.getDWord(self.evt.cont_offset) & 0xFFFF) << 4
00062     self.evt.cont_end    = (self.evt.cont_offset << 2) + self.evt.cont_size
00063     return self._EvtCli__online_status
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testPreload.py Source File

testPreload.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Test class for LTE-383"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2006/07/19 22:50:13 $").split(' ')[1]
00014 __version__  = "$Revision: 1.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import logging as log
00021 from LATTE.database.gEGU import GEGU
00022
00023 log.debug("Test module %s has been loaded" % __name__)
00024
00025 class GEGU_test(GEGU):
00026   def __init__(self, slope, intercept, units=""):
00027     GEGU.__init__(self, units)
00028     log.debug("Test class %s has been loaded" % self.__class__.__name__)
00029
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testRunner.py Source File

testRunner.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Test Runner Script"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "11/21/2002"
00014 __version__  = "$Revision: 1.2 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 from   LATTE.runcontrol.rcTransitions import rcTransitions
00020
00021 # Standalone mode:
00022 if __name__ == "__main__":
00023   ual = rcTransitions.StandaloneLauncher(logLevel="INFO")
00024   ual.launch(appClass=None, user=321, callbacks=None)
00025
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testSAppCal.py Source File

testSAppCal.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example CAL test application"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "11/21/2002"
00014 __version__  = "$Revision: 1.9 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import threading
00020 import logging       as     log
00021 from   LATTE.runcontrol.rcTransitions import rcTransitions
00022 from   LATTE.runcontrol.ArgumentImpl  import ArgumentImpl
00023 import time
00024
00025 from support.SimpleGasuExample   import *
00026 from support.MiniGLTExample      import *
00027
00028 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00029 #  the userApplication example to get the number of self triggers to take.
00030 class userArgument(ArgumentImpl):
00031   "GUI for getting the user to input some sort of value."
00032   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00033     ArgumentImpl.__init__(self, parent, name, modal, fl)
00034     self.__value = 0
00035     self.setCaption("Hello world!")
00036
00037   def OKButtonClicked(self):
00038     self.__value = int(self.ArgumentList.text().latin1())
00039     self.close()
00040
00041   def CancelButtonClicked(self):
00042     self.__value = None
00043     self.close()
00044
00045   def getValue(self, caption):
00046     self.setCaption(caption)
00047     self.show()
00048     self.exec_loop()
00049     return self.__value
00050
00051 class userArgText(object):
00052   "Text user interface for getting the user to input some sort of value"
00053   def __init__(self):
00054     pass
00055
00056   def getValue(self, caption):
00057     return int(raw_input("%s: " % (caption)))
00058
00059
00060 #  Example application implementation.
00061 #  Note that the name of the class must be userApplication.
00062 #  Look at rcTransitions for names of other transition methods that can be used.
00063 class userApplication(rcTransitions):
00064   "Implmentation class for a user application"
00065   def __init__(self, rc, userId, debug):
00066     rcTransitions.__init__(self, rc, userId, debug)
00067     log.debug("userApplication.__init__()")
00068     self.__eventSem    = threading.Semaphore(0)
00069     self.__cmdSynchSem = threading.Semaphore(0)
00070
00071   def getName(self):
00072     return __name__
00073
00074   def setup(self):
00075     log.debug("userApplication.setup()")
00076
00077     if self.isRunFromSuite():
00078       self.__arg = None
00079     elif self.rc is None:
00080       self.__arg = userArgText()
00081     else:
00082       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00083
00084     # Get a TEM instance
00085     if self.lat.TEMcnt() == 1:
00086       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00087     elif self.lat.TEMcnt() > 1:
00088       tem = self.lat.TEM.all()
00089     else:
00090       log.fatal("No TEM(s) found in the schema")
00091       return -1
00092
00093     # clear TEM stats reg
00094     tem.COMMAND_RESPONSE = 0
00095
00096     # clear TEM status reg
00097     tem.STATUS = 0
00098
00099     ccc2 = tem.downCCC(2) # O$GCCC_02
00100     ccc2.LAYER_MASK_1 = 0x3BFD3FFFL
00101
00102     # Two choices for the trigger, GEM and MiniGLT
00103     if self.lat.existsGEM():
00104       self.trigger( SimpleGasuExample() )
00105     else:
00106       self.trigger( MiniGLTExample() )
00107
00108     # A state transition can be rejected by not returning None
00109     return None
00110
00111   def startRun(self):
00112     log.debug("userApplication.startRun()")
00113
00114     if self.isRunFromSuite():
00115       cnt = self.getSessionVar("eventCount")
00116       if cnt is None:
00117         log.error("Event count is not passed from the suite")
00118         return -1
00119     else:
00120       caption = "Enter number of triggers to take"
00121       if self.rc is None:
00122         cnt = self.__arg.getValue(caption)
00123       else:
00124         cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00125
00126     # The user pressed 'Cancel'
00127     if cnt is None:  return -1
00128     self.__cnt = cnt
00129
00130     # Spawn a thread to synchronize commands with events
00131     self.__cmdSynchQuit = False
00132
00133     # A state transition can be rejected by not returning None
00134     return None
00135
00136   def stopRun(self):
00137     log.debug("userApplication.stopRun()")
00138
00139     if self.getBadEvents() == 0 and self.getErrorEvents() == 0:
00140       self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00141     else:
00142       self.setCompletionStatus(self.COMPL_STATUS_FAILED)
00143
00144     self.setSessionVar("completionStatus", self.getCompletionStatus())
00145
00146     if self.getSessionVar("test") is not None:
00147       self.setSessionVar("test", self.getSessionVar("test") + "d")
00148
00149     self.__cmdSynchQuit = True
00150     self.__eventSem.release()
00151     #self.__cmdSynch.join()
00152
00153     # The STOP_RUN transition can not be rejected
00154
00155   def resume(self):
00156     log.debug("userApplication.resume()")
00157
00158     # Issue self trigger to make up for the one that was lost during PAUSE
00159     self.trigger().solicit()
00160
00161     return None
00162
00163   def stop(self):
00164     log.debug("userApplication.stop()")
00165
00166     return self.stopRun()
00167
00168   def teardown(self):
00169     log.debug("userApplication.teardown()")
00170     # Allow the C++ object to be deleted
00171     if self.rc is not None and self.__arg is not None:
00172       self.__arg.deleteLater()
00173
00174   def process(self, (status, buffer)):
00175     "Method called back for each data event taken"
00176     ##log.debug("userApplication.process()")
00177
00178     evtCli = self.evtCli
00179
00180     if status != 0:
00181       if evtCli.isGGLTStatus():
00182         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00183       elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00184         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00185       self.__eventSem.release()
00186       return
00187     try:
00188       # In the future this event may contain additional data
00189       if evtCli.isSweepEvent(): return
00190     except:
00191       # Event summary word inaccessible, handle the bad event here
00192       log.exception("")
00193       return
00194
00195     ###evtCli.evDumpCAL_LogAccepts();
00196     ###print ""
00197     ###evtCli.evDumpCAL_Logs();
00198     #~ #print ""
00199     #~ #evtCli.evDumpTKR()
00200     ###evtCli.evDumpTEM_Error()
00201     ###evtCli.evDumpDiagnostic()
00202     ###for acc in evtCli.evt.CAL_LogAccepts:
00203     ###  print "CAL Log Accept: 0x%08x" % acc.ui
00204
00205     ###for data in evtCli.evt.CAL_LogData:
00206     ###  print "CAL Log Data: 0x%08x" % data.ui
00207     #~ sum = evtCli.evt.summary
00208     ###evtCli.evDumpSummary()
00209
00210     # Get next event triggered
00211     self.__eventSem.release()
00212
00213   #def __commandSynch(self, count):
00214   def commandSynch(self):
00215     "Method called by the command synchronization task"
00216     import time
00217     trigger  = self.trigger()
00218     eventSem = self.__eventSem
00219     # Drain the semaphore release count
00220     # Handles the case when the stop run release collided with a trigger release
00221     while eventSem.acquire(0):  pass
00222
00223     t0  = time.time()
00224
00225     # Compensate for the extra CMD_SELF_TRIGGER below
00226     cnt = 1
00227     count = self.__cnt
00228
00229     # Wait for START_RUN to enable triggers
00230     trigger.waitForMaskEnable()
00231
00232     trigger.solicit()                   # Issue an internal trigger
00233     eventSem.acquire()                  # Wait for the event to be processed
00234
00235     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00236
00237     while cnt < count and not self.__cmdSynchQuit:
00238       cnt += 1
00239       trigger.solicit()                 # Issue an internal trigger
00240       time.sleep(.0001)
00241       eventSem.acquire()                # Wait for the event to be processed
00242       #trigger.disable()                # Disable triggers
00243       # Do stuff
00244       #trigger.enable()                 # Enable triggers
00245
00246     t2 = trigger.getTimeStamp()         # Get the last trigger timestamp
00247     # When we get here the triggers should still be enabled.
00248     # If the glt.MASK needs to be set through any other means
00249     # then it needs to be restored to its SETUP value here.
00250
00251     if t1 is None:
00252       t1 = t0
00253     if t2 is None:
00254       t2 = time.time()
00255     dT = t2 - t1
00256     if dT == 0.0:  dT = 0.000001
00257     log.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00258              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00259
00260     # Get out of waiting when in batch or standalone mode
00261     self.sync()
00262
00263     # execute the GUI functions for stopRun, just in case
00264     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00265       if self.rc is not None:
00266         self.rc.doStop()
00267
00268   def wait(self):
00269     self.__cmdSynchSem.acquire()
00270
00271   def sync(self):
00272     if __name__ == "__main__" or self.isRunFromSuite():
00273       self.__cmdSynchSem.release()
00274
00275
00276 # Standalone mode:
00277 if __name__ == "__main__":
00278   from LATTE.runcontrol.RunControlCommon import RunControlCommon
00279
00280   rcCommon = RunControlCommon()
00281   rcCommon.initialize()
00282   rcCommon.setLoggingLevel("INFO")
00283   rcCommon.connect()
00284   ua = userApplication(None, 321, rcCommon)
00285   ua.rcSetup()
00286   ua.rcStartRun()
00287   ua.wait()
00288   ua.rcStopRun()
00289   ua.rcTeardown()
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testSAppCal_Lean.py Source File

testSAppCal_Lean.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example CAL test application"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "11/21/2002"
00014 __version__  = "$Revision: 1.1 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import threading
00020 import logging       as     log
00021 from   LATTE.runcontrol.rcTransitions import rcTransitions
00022 from   LATTE.runcontrol.ArgumentImpl  import ArgumentImpl
00023 import time
00024
00025 from support.SimpleGasuExample   import *
00026 from support.MiniGLTExample      import *
00027
00028 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00029 #  the userApplication example to get the number of self triggers to take.
00030 class userArgument(ArgumentImpl):
00031   "GUI for getting the user to input some sort of value."
00032   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00033     ArgumentImpl.__init__(self, parent, name, modal, fl)
00034     self.__value = 0
00035     self.setCaption("Hello world!")
00036
00037   def OKButtonClicked(self):
00038     self.__value = int(self.ArgumentList.text().latin1())
00039     self.close()
00040
00041   def CancelButtonClicked(self):
00042     self.__value = None
00043     self.close()
00044
00045   def getValue(self, caption):
00046     self.setCaption(caption)
00047     self.show()
00048     self.exec_loop()
00049     return self.__value
00050
00051 class userArgText(object):
00052   "Text user interface for getting the user to input some sort of value"
00053   def __init__(self):
00054     pass
00055
00056   def getValue(self, caption):
00057     return int(raw_input("%s: " % (caption)))
00058
00059
00060 #  Example application implementation.
00061 #  Note that the name of the class must be userApplication.
00062 #  Look at rcTransitions for names of other transition methods that can be used.
00063 class userApplication(rcTransitions):
00064   "Implementation class for a user application"
00065   SWEEP_MARKER     = 5
00066
00067   def __init__(self, rc, userId, debug):
00068     rcTransitions.__init__(self, rc, userId, debug)
00069     log.debug("userApplication.__init__()")
00070     self.__eventSem    = threading.Semaphore(0)
00071     self.__cmdSynchSem = threading.Semaphore(0)
00072
00073   def getName(self):
00074     return __name__
00075
00076   def setup(self):
00077     log.debug("userApplication.setup()")
00078
00079     if self.isRunFromSuite():
00080       self.__arg = None
00081     elif self.rc is None:
00082       self.__arg = userArgText()
00083     else:
00084       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00085
00086     # Get a TEM instance
00087     if self.lat.TEMcnt() == 1:
00088       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00089     elif self.lat.TEMcnt() > 1:
00090       tem = self.lat.TEM.all()
00091     else:
00092       log.fatal("No TEM(s) found in the schema")
00093       return -1
00094
00095     # clear TEM stats reg
00096     tem.COMMAND_RESPONSE = 0
00097
00098     # clear TEM status reg
00099     tem.STATUS = 0
00100
00101     ccc2 = tem.downCCC(2) # O$GCCC_02
00102     ccc2.LAYER_MASK_1 = 0x3BFD3FFFL
00103
00104     # Two choices for the trigger, GEM and MiniGLT
00105     if self.lat.existsGEM():
00106       self.trigger( SimpleGasuExample() )
00107     else:
00108       self.trigger( MiniGLTExample() )
00109
00110     self.selectEventHandler(rcTransitions.EVENT_HANDLER_LEAN_AND_MEAN)
00111
00112     # A state transition can be rejected by not returning None
00113     return None
00114
00115   def startRun(self):
00116     log.debug("userApplication.startRun()")
00117
00118     if self.isRunFromSuite():
00119       cnt = self.getSessionVar("eventCount")
00120       if cnt is None:
00121         log.error("Event count is not passed from the suite")
00122         return -1
00123     else:
00124       caption = "Enter number of triggers to take"
00125       if self.rc is None:
00126         cnt = self.__arg.getValue(caption)
00127       else:
00128         cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00129
00130     # The user pressed 'Cancel'
00131     if cnt is None:  return -1
00132     self.__cnt = cnt
00133
00134     # Spawn a thread to synchronize commands with events
00135     self.__cmdSynchQuit = False
00136
00137     # A state transition can be rejected by not returning None
00138     return None
00139
00140   def stopRun(self):
00141     log.debug("userApplication.stopRun()")
00142
00143     if self.getBadEvents() == 0 and self.getErrorEvents() == 0:
00144       self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00145     else:
00146       self.setCompletionStatus(self.COMPL_STATUS_FAILED)
00147
00148     self.setSessionVar("completionStatus", self.getCompletionStatus())
00149
00150     if self.getSessionVar("test") is not None:
00151       self.setSessionVar("test", self.getSessionVar("test") + "d")
00152
00153     self.__cmdSynchQuit = True
00154     self.__eventSem.release()
00155     #self.__cmdSynch.join()
00156
00157     # The STOP_RUN transition can not be rejected
00158
00159   def resume(self):
00160     log.debug("userApplication.resume()")
00161
00162     # Issue self trigger to make up for the one that was lost during PAUSE
00163     self.trigger().solicit()
00164
00165     return None
00166
00167   def stop(self):
00168     log.debug("userApplication.stop()")
00169
00170     return self.stopRun()
00171
00172   def teardown(self):
00173     log.debug("userApplication.teardown()")
00174     # Allow the C++ object to be deleted
00175     if self.rc is not None and self.__arg is not None:
00176       self.__arg.deleteLater()
00177
00178   def process(self, (status, buffer)):
00179     "Method called back for each data event taken"
00180     ##log.debug("userApplication.process()")
00181
00182     evtCli = self.evtCli
00183
00184     if status != 0:
00185       self.__eventSem.release()
00186       return
00187     try:
00188       # In the future this event may contain additional data
00189       if self.eventMarker == self.SWEEP_MARKER: return
00190     except:
00191       # Event summary word inaccessible, handle the bad event here
00192       log.exception("")
00193       return
00194
00195     # Get next event triggered
00196     self.__eventSem.release()
00197
00198   #def __commandSynch(self, count):
00199   def commandSynch(self):
00200     "Method called by the command synchronization task"
00201     import time
00202     trigger  = self.trigger()
00203     eventSem = self.__eventSem
00204     # Drain the semaphore release count
00205     # Handles the case when the stop run release collided with a trigger release
00206     while eventSem.acquire(0):  pass
00207
00208     t0  = time.time()
00209
00210     # Compensate for the extra CMD_SELF_TRIGGER below
00211     cnt = 1
00212     count = self.__cnt
00213
00214     # Wait for START_RUN to enable triggers
00215     trigger.waitForMaskEnable()
00216
00217     trigger.solicit()                   # Issue an internal trigger
00218     eventSem.acquire()                  # Wait for the event to be processed
00219
00220     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00221
00222     while cnt < count and not self.__cmdSynchQuit:
00223       cnt += 1
00224       trigger.solicit()                 # Issue an internal trigger
00225       time.sleep(.0001)
00226       eventSem.acquire()                # Wait for the event to be processed
00227       #trigger.disable()                # Disable triggers
00228       # Do stuff
00229       #trigger.enable()                 # Enable triggers
00230
00231     t2 = trigger.getTimeStamp()         # Get the last trigger timestamp
00232     # When we get here the triggers should still be enabled.
00233     # If the glt.MASK needs to be set through any other means
00234     # then it needs to be restored to its SETUP value here.
00235
00236     if t1 is None:
00237       t1 = t0
00238     if t2 is None:
00239       t2 = time.time()
00240     dT = t2 - t1
00241     if dT == 0.0:  dT = 0.000001
00242     log.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00243              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00244
00245     # Get out of waiting when in batch or standalone mode
00246     self.sync()
00247
00248     # execute the GUI functions for stopRun, just in case
00249     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00250       if self.rc is not None:
00251         self.rc.doStop()
00252
00253   def wait(self):
00254     self.__cmdSynchSem.acquire()
00255
00256   def sync(self):
00257     if __name__ == "__main__" or self.isRunFromSuite():
00258       self.__cmdSynchSem.release()
00259
00260
00261 # Standalone mode:
00262 if __name__ == "__main__":
00263   from LATTE.runcontrol.RunControlCommon import RunControlCommon
00264
00265   rcCommon = RunControlCommon()
00266   rcCommon.initialize()
00267   rcCommon.setLoggingLevel("INFO")
00268   rcCommon.connect()
00269   ua = userApplication(None, 321, rcCommon)
00270   ua.rcSetup()
00271   ua.rcStartRun()
00272   ua.wait()
00273   ua.rcStopRun()
00274   ua.rcTeardown()
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testSAppEvt.py Source File

testSAppEvt.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example EBF event handling test application"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "2/25/2003"
00014 __version__  = "$Revision: 1.8 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import threading
00020 import logging       as     log
00021 from   LATTE.runcontrol.rcTransitions import rcTransitions
00022 from   LATTE.runcontrol.ArgumentImpl  import ArgumentImpl
00023 import                      time
00024 import                      math
00025 import                      sys
00026
00027 from support.SimpleGasuExample   import *
00028 from support.MiniGLTExample      import *
00029
00030 import LDF
00031
00032 import Numeric as Numeric
00033
00034
00035 def _unsigned(arg):
00036   """\brief Convert an unsigned int argument to an unsigned long
00037
00038   This funtion exists to help format unsigned ints greater than 0x7fffffff,
00039   which in Python 2.4 and up will be displayed as signed strings.
00040   """
00041   return arg & (2L * sys.maxint + 1)
00042
00043
00044 class myLATcomponentIterator(LDF.LATcomponentIterator):
00045   def __init__(self):
00046     LDF.LATcomponentIterator.__init__(self)
00047
00048   def UDFcomponent(self, event, ebfContribution):
00049     print ""
00050     print "Undefined EBF component"
00051     return 0
00052
00053   def GLTcomponent(self, event, gemContribution):
00054     data = Numeric.fromstring(gemContribution.data(), 'i')
00055     print "GEM data: %08x %08x" % (_unsigned(data[0]), _unsigned(data[1]))
00056     print "Time = %f" % (gemContribution.timeFloat())
00057     return 0
00058
00059   def ACDcomponent(self, event, aemContribution):
00060     print "ACD summary word        = 0x%08x" % (aemContribution.summary())
00061     print "ACD contribution length = %d"     % (aemContribution.length())
00062     data = Numeric.fromstring(aemContribution.data(), 'i')
00063     for i in range(aemContribution.payloadSize() >> 2):
00064       print "ACD data[%3d]: 0x%08x" % (i, _unsigned(data[i]))
00065     return 0
00066
00067   def CALcomponent(self, event, calContribution):
00068     print "CAL summary word        = 0x%08x" % (calContribution.summary())
00069     print "CAL contribution length = %d"     % (calContribution.length())
00070     print "CAL accepts             = 0x%08x" % (calContribution.logAccepts())
00071     data = Numeric.fromstring(calContribution.data(), 'i')
00072     for i in range(calContribution.numLogAccepts()):
00073       print "CAL Log Data[%3d]: 0x%08x" % (i, _unsigned(data[i]))
00074
00075     #evt  = data[0:384]
00076     #evt.shape = (4,4,2,12)
00077     #evt = Numeric.swapaxes(evt,0,1)
00078     #evt = Numeric.resize(evt, (4,8,12))
00079     return 0
00080
00081   def TKRcomponent(self, event, tkrContribution):
00082     print "TKR summary word        = 0x%08x" % (tkrContribution.summary())
00083     print "TKR contribution length = %d"     % (tkrContribution.length())
00084     array = 8*4*' '          # 8 longwords of space to receive accepts
00085     accepts = Numeric.fromstring(tkrContribution.acceptsMask(event, array), 'i')
00086     print "TKR accepts             = 0x%03x 0x%03x 0x%03x 0x%03x 0x%03x 0x%03x 0x%03x 0x%03x" % \
00087           (accepts[0], accepts[1], accepts[2], accepts[3],
00088            accepts[4], accepts[5], accepts[6], accepts[7])
00089     data = Numeric.fromstring(tkrContribution.data(event), 'i')
00090     for i in range(tkrContribution.numAccepts(event)):
00091       print "TKR data[%3d]: 0x%08x" % (i, _unsigned(data[i]))
00092     return 0
00093
00094 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00095 #  the userApplication example to get the number of self triggers to take.
00096 class userArgument(ArgumentImpl):
00097   "GUI for getting the user to input some sort of value."
00098   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00099     ArgumentImpl.__init__(self, parent, name, modal, fl)
00100     self.__value = 0
00101     self.setCaption("Hello world!")
00102
00103   def OKButtonClicked(self):
00104     self.__value = int(self.ArgumentList.text().latin1())
00105     self.close()
00106
00107   def CancelButtonClicked(self):
00108     self.__value = None
00109     self.close()
00110
00111   def getValue(self, caption):
00112     self.setCaption(caption)
00113     self.show()
00114     self.exec_loop()
00115     return self.__value
00116
00117 class userArgText(object):
00118   "Text user interface for getting the user to input some sort of value"
00119   def __init__(self):
00120     pass
00121
00122   def getValue(self, caption):
00123     return int(raw_input("%s: " % (caption)))
00124
00125
00126 #  Example application implementation.
00127 #  Note that the name of the class must be userApplication.
00128 #  Look at rcTransitions for names of other transition methods that can be used.
00129 class userApplication(rcTransitions):
00130   "Implmentation class for a user application"
00131   def __init__(self, rc, userId, debug):
00132     rcTransitions.__init__(self, rc, userId, debug)
00133     log.debug("userApplication.__init__()")
00134     self.__eventSem    = threading.Semaphore(0)
00135     self.__cmdSynchSem = threading.Semaphore(0)
00136     self.__lci         = myLATcomponentIterator()
00137     self.__ldbi        = LDF.LATdataBufferIterator(self.__lci)
00138
00139   def getName(self):
00140     return __name__
00141
00142   def setup(self):
00143     log.debug("userApplication.setup()")
00144
00145     if self.isRunFromSuite():
00146       self.setLastSuiteScript()
00147       self.__arg = None
00148     elif self.rc is None:
00149       self.__arg = userArgText()
00150     else:
00151       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00152
00153     # Get a TEM instance
00154     if self.lat.TEMcnt() == 1:
00155       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00156     elif self.lat.TEMcnt() > 1:
00157       tem = self.lat.TEM.all()
00158     else:
00159       log.fatal("No TEM(s) found in the schema")
00160       return -1
00161
00162     if tem is not None:
00163       # clear TEM stats reg
00164       tem.COMMAND_RESPONSE = 0
00165
00166       # clear TEM status reg
00167       tem.STATUS = 0
00168     else:
00169       log.fatal("No TEM found in the schema: aborting...")
00170       return -1
00171
00172     ccc2 = tem.downCCC(2) # O$GCCC_02
00173     ccc2.LAYER_MASK_1 = 0x3BFD3FFFL
00174
00175     # Two choices for the trigger, GEM and MiniGLT
00176     if self.lat.existsGEM():
00177       self.trigger( SimpleGasuExample() )
00178     else:
00179       self.trigger( MiniGLTExample() )
00180
00181     # A state transition can be rejected by not returning None
00182     return None
00183
00184   def startRun(self):
00185     log.debug("userApplication.startRun()")
00186
00187     if self.isRunFromSuite():
00188       cnt = 3
00189     else:
00190       caption = "Enter number of triggers to take"
00191       if self.rc is None:
00192         cnt = self.__arg.getValue(caption)
00193       else:
00194         cnt = self.rc.execGUImethod(self.__arg.getValue, caption)
00195
00196       if cnt is None:  return -1
00197     self.__cnt = cnt
00198
00199     # Spawn a thread to synchronize commands with events
00200     self.__cmdSynchQuit = False
00201
00202     # A state transition can be rejected by not returning None
00203     return None
00204
00205   def stopRun(self):
00206     log.debug("userApplication.stopRun()")
00207
00208     self.setCompletionStatus(self.COMPL_STATUS_SUCCESS)
00209     log.info("In %s: SESSION VAR=%s" % (self.getName(), self.getSessionVar("test")))
00210     test = "e"
00211     self.setSessionVar("test", test)
00212     self.__cmdSynchQuit = True
00213     self.__eventSem.release()
00214
00215     # The STOP_RUN transition can not be rejected
00216
00217   def resume(self):
00218     log.debug("userApplication.resume()")
00219
00220     # Issue self trigger to make up for the one that was lost during PAUSE
00221     self.trigger().solicit()
00222
00223     return None
00224
00225   def stop(self):
00226     log.debug("userApplication.stop()")
00227
00228     return self.stopRun()
00229
00230   def teardown(self):
00231     log.debug("userApplication.teardown()")
00232     # Allow the C++ object to be deleted
00233     if self.rc is not None and self.__arg is not None:
00234       self.__arg.deleteLater()
00235
00236   def process(self, (status, buffer)):
00237     "Method called back for each data event taken"
00238     ###log.debug("userApplication.process()")
00239
00240     evtCli = self.evtCli
00241
00242     if status == 0:
00243      if 1:                              # One _OR_ the other method, not both
00244       self.__ldbi.iterate(buffer, len(buffer))
00245      else:                              # Old way of doing things
00246        pass
00247     else:
00248       if evtCli.isGGLTStatus():
00249         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00250       elif not evtCli.checkOnlineStatus(status, evtCli.PLAYBACK_ERROR):
00251         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00252       self.__eventSem.release()
00253       return
00254
00255     try:
00256       # In the future this event may contain additional data
00257       if evtCli.isSweepEvent(): return
00258     except:
00259       # Event summary word inaccessible, handle the bad event here
00260       log.exception("")
00261       return
00262
00263     print "Event Size           =", evtCli.getEvtSize()
00264     print "Event Status         =", evtCli.getEvtStatus()
00265     ts = evtCli.evGetTimestamp()
00266     print "Event Timestamp (GMT)=", time.asctime(time.gmtime(ts)), \
00267                                     "and", int(math.modf(ts)[0]*1000), "ms"
00268     contList = evtCli.getContributionList()
00269     for cId in contList:
00270       evtCli.setCurrentContribution(cId)
00271       if cId.startswith('TEM'):
00272         evtCli.evDumpSummary()
00273         evtCli.evDumpCAL_LogAccepts()
00274         evtCli.evDumpCAL_Logs()
00275         evtCli.evDumpTKR()
00276         evtCli.evDumpTEM_Error()
00277         evtCli.evDumpDiagnostic()
00278         for acc in evtCli.evt.CAL_LogAccepts:
00279           print "CAL Log Accept: 0x%08x" % acc.ui
00280
00281         for logData in evtCli.evt.CAL_LogData:
00282           print "CAL Log Data: 0x%08x" % logData.data.ui
00283       elif cId == 'ACD':
00284         evtCli.evDumpSummary()
00285         evtCli.evDumpEventAEM()
00286         print "AEM Veto Hit Vectors:"
00287         j = 0
00288         for hitVect in evtCli.evt.aem.vetoHitVectors:
00289           print "\tCable %2d Raw Data 0x%05x" % (j, hitVect)
00290           j+=1
00291         print "\nAEM Accept Hit Vectors:"
00292         j = 0
00293         for hitVect in evtCli.evt.aem.acceptHitVectors:
00294           print "\tCable %2d Raw Data 0x%05x" % (j, hitVect)
00295           j+=1
00296         print "\nAEM PHA Values:"
00297         j = 0
00298         for pha in evtCli.evt.aem.PHA:
00299           print "\tPHA Value: 0x%04x" % pha
00300
00301     # Get next event triggered
00302     self.__eventSem.release()
00303
00304   #def __commandSynch(self, count):
00305   def commandSynch(self):
00306     "Method called by the command synchronization task"
00307     import time
00308     trigger  = self.trigger()
00309     eventSem = self.__eventSem
00310     # Drain the semaphore release count
00311     # Handles the case when the stop run release collided with a trigger release
00312     while eventSem.acquire(0):  pass
00313
00314     t0  = time.time()
00315
00316     # Compensate for the extra CMD_SELF_TRIGGER below
00317     cnt = 1
00318     count = self.__cnt
00319
00320     # Wait for START_RUN to enable triggers
00321     trigger.waitForMaskEnable()
00322
00323     trigger.solicit()                   # Issue an internal trigger
00324     eventSem.acquire()                  # Wait for the event to be processed
00325
00326     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00327
00328     while cnt < count and not self.__cmdSynchQuit:
00329       cnt += 1
00330       trigger.solicit()                 # Issue an internal trigger
00331       time.sleep(.0001)
00332       eventSem.acquire()                # Wait for the event to be processed
00333       #trigger.disable()                # Disable triggers
00334       # Do stuff
00335       #trigger.enable()                 # Enable triggers
00336
00337     t2 = trigger.getTimeStamp()         # Get the last trigger timestamp
00338     # When we get here the triggers should still be enabled.
00339     # If the glt.MASK needs to be set through any other means
00340     # then it needs to be restored to its SETUP value here.
00341
00342     if t1 is None:
00343       t1 = t0
00344     if t2 is None:
00345       t2 = time.time()
00346     dT = t2 - t1
00347     if dT == 0.0:  dT = 0.000001
00348     log.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00349              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00350
00351     # Get out of waiting when in standalone mode
00352     self.sync()
00353
00354     # execute the GUI functions for stopRun, just in case
00355     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00356       if self.rc is not None:
00357         self.rc.doStop()
00358
00359   def wait(self):
00360     self.__cmdSynchSem.acquire()
00361
00362   def sync(self):
00363     if __name__ == "__main__" or self.isRunFromSuite():
00364       self.__cmdSynchSem.release()
00365
00366
00367 # Standalone mode:
00368 if __name__ == "__main__":
00369   from LATTE.runcontrol.RunControlCommon import RunControlCommon
00370
00371   rcCommon = RunControlCommon()
00372   rcCommon.initialize()
00373   rcCommon.setLoggingLevel("INFO")
00374   rcCommon.connect()
00375   ua = userApplication(None, 321, rcCommon)
00376   ua.rcSetup()
00377   ua.rcStartRun()
00378   ua.wait()
00379   ua.rcStopRun()
00380   ua.rcTeardown()
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testSuite2.py Source File

testSuite2.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example test suite"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/03/25 00:50:19 $").split(' ')[1]
00014 __version__  = "$Revision: 1.5 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 # History:
00020 #     $Log: testSuite2.py,v $
00021 #     Revision 1.5  2005/03/25 00:50:19  stuvi
00022 #     no message
00023 #
00024 #     Revision 1.4  2005/03/25 00:39:59  stuvi
00025 #     Pass event count as a parameter to testSAppCal
00026 #
00027 #     Revision 1.3  2005/01/27 23:07:54  stuvi
00028 #     Allow the nested suite to be run by itself by checking StopRequestedException.
00029 #     Call doStopRun if not run as nested suite.
00030 #
00031 #     Revision 1.2  2004/08/18 18:00:15  stuvi
00032 #     Updated for LATTE 4.
00033 #     All hippo functions go through the Qt GUI bridge now.
00034 #
00035 #     Revision 1.1  2004/08/07 02:10:42  stuvi
00036 #     Test suite examples.
00037 #
00038 #     Revision 1.2  2004/01/24 00:27:17  stuvi
00039 #     Modified to use the appdir from preferences
00040 #
00041 #     Revision 1.1  2003/12/11 01:22:34  stuvi
00042 #     A sample test suite that is called as a sub suite from the testSuite sample.
00043 #
00044 #     Revision 1.2  2003/07/26 04:15:30  stuvi
00045 #     Fixed schema path
00046 #
00047 #     Revision 1.1  2003/03/28 03:21:41  stuvi
00048 #     Fixed FITS file status display
00049 #     Added test suite capability
00050 #
00051
00052 from   LATTE.runcontrol.rcSuite import rcSuite
00053 import logging as     log
00054 import                os
00055
00056
00057 class userSuite(rcSuite):
00058   "Implmentation class for a user application"
00059   def __init__(self, gui, userId, debug):
00060     rcSuite.__init__(self, gui, userId, debug)
00061     log.debug("userSuite.__init__()")
00062
00063   def getName(self):
00064     return __name__
00065
00066   def setupSuite(self):
00067     pass
00068
00069   def startSuite(self):
00070     try:
00071       sessionContext = {"test":"abc", "eventCount":3}
00072       # The following script will change the value of session var "test"
00073       appDir = self.gui.preferences()['appdir']
00074       sessionStateAfterTest1 = self.scriptRun(module=os.path.join(appDir,'testSAppCal'),
00075                                               context=sessionContext)
00076       log.info("In %s: SESSION VAR=%s" % (self.getName(), self.getSessionVar("test")))
00077       # The following script will print the value of session var "test" and modify it
00078       sessionStateAfterTest2 = self.scriptRun(module=os.path.join(appDir,'testSAppEvt'))
00079       # Finally let's print the value of the session var "test" here
00080       print sessionStateAfterTest1
00081       print sessionStateAfterTest2
00082       log.info("In %s: SESSION VAR=%s" % (self.getName(), self.getSessionVar("test")))
00083     except rcSuite.StopRequestedException, e:
00084       log.info("%s, suite: %s, module: %s" % (e.msg, e.suite, e.module))
00085       if self.getSuite() is not None:
00086         raise e
00087
00088     if self.gui is not None and self.getSuite() is None:
00089       # Stop the suite if it wasn't called from a parent suite
00090       self.gui.doStopRun()
00091
00092
00093   def stopSuite(self):
00094     log.info("End of suite 2")
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testSuite.py Source File

testSuite.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example test suite"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/05/17 01:33:03 $").split(' ')[1]
00014 __version__  = "$Revision: 1.5 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 # History:
00020 #     $Log: testSuite.py,v $
00021 #     Revision 1.5  2005/05/17 01:33:03  stuvi
00022 #     As per LTE-264, added support for standalone suites and scripts.
00023 #
00024 #     Revision 1.4  2005/01/27 23:06:48  stuvi
00025 #     Removed the lastScript parameter from the second scriptRun
00026 #     We don't  have to check if the script was stopped in order to call doStopRun method.
00027 #
00028 #     Revision 1.3  2005/01/11 22:39:55  stuvi
00029 #     no message
00030 #
00031 #     Revision 1.2  2004/10/20 03:44:55  stuvi
00032 #     Commented out the selection of another schema since we want to use the one selected by RunControl.
00033 #
00034 #     Revision 1.1  2004/08/07 02:10:42  stuvi
00035 #     Test suite examples.
00036 #
00037 #     Revision 1.5  2004/01/24 00:27:17  stuvi
00038 #     Modified to use the appdir from preferences
00039 #
00040 #     Revision 1.4  2003/12/11 01:53:00  stuvi
00041 #     Now calling the regular test applications to show that there is no need to change the tests to run them in suites.
00042 #
00043 #     Revision 1.3  2003/12/11 01:23:27  stuvi
00044 #     Modified and documented the code according to the new rcSuite implementation.
00045 #
00046 #     Revision 1.2  2003/07/26 04:15:30  stuvi
00047 #     Fixed schema path
00048 #
00049 #     Revision 1.1  2003/03/28 03:21:41  stuvi
00050 #     Fixed FITS file status display
00051 #     Added test suite capability
00052 #
00053
00054 from   LATTE.runcontrol.rcSuite import rcSuite
00055 import logging as     log
00056 import                os
00057
00058
00059 class userSuite(rcSuite):
00060   "Implmentation class for a user application"
00061   def __init__(self, gui, userId, debug):
00062     rcSuite.__init__(self, gui, userId, debug)
00063     log.debug("userSuite.__init__()")
00064
00065   def getName(self):
00066     return __name__
00067
00068   def setupSuite(self):
00069     # This method is executed after rcStartSuite successfully loads a schema (either
00070     # through the RunControl GUI or by reusing a previously loaded schema)
00071     #self.__schema = os.path.join(os.environ['ONLINE_ROOT'], 'LATTE/repos/simpleTemSchema.xml')
00072     pass
00073
00074   def pauseSuite(self):
00075     # This method is executed before the currently running application is paused.
00076     # Note that there is currently no way to pause a suite, meaning if there is some
00077     # lengthy code that executes between scriptRun calls, that can not be paused.
00078     # Pause can be rejected by not returning None
00079     log.debug("userSuite.pauseSuite")
00080     return None
00081
00082   def startSuite(self):
00083     try:
00084
00085       # We pass the sesssion variables using a dictionary.
00086       # The set/getSessionVar methods can also be used.
00087       # Please do not use session variables which start with the "_" (underscore)
00088       # character as these are reserved for RunControl use
00089       sessionContext = {"test":"abc"}
00090
00091       # The module name can either be a python file name or a module name
00092       # If a full path is specified then the module at that location is used
00093       # otherwise the PYTHONPATH is searched
00094
00095       # The following script will change the value of session var "test"
00096       appDir = self.gui.preferences()['appdir']
00097       sessionStateAfterTest1 = self.scriptRun(module=os.path.join(appDir,'testAppCal'),
00098                                               context=sessionContext)
00099
00100       # The following script will print the value of session var "test" and modify it
00101       sessionStateAfterTest2 = self.scriptRun(module=os.path.join(appDir,'testAppEvt'))
00102
00103       print sessionStateAfterTest1
00104       print sessionStateAfterTest2
00105
00106       # The schema for subsequent tests or suites can be changed using the following methods.
00107       # The schema chosen when the top level suite was selected in RunControl is still saved
00108       # in case the operator checked the "Reuse schema" checkbox on the load application dialog
00109       #self.readSchema(self.__schema)
00110       #self.applyConfig()
00111
00112       # When the stop button is clicked a StopRequestedException is thrown after which
00113       # the current executing application is interrupted and rcStoprun and rcTeardown
00114       # is called. The suite calling the application should trap the exception using
00115       # a try block as demonstrated below and take the appropriate action.
00116       #
00117       # StopRequestedException class has three members. "msg" contains a generic message,
00118       # "suite" contains the name of the suite that was executing when the stop button was
00119       # clicked. Note that currently only the immediate parent suite name is recorded in
00120       # the exception. The third member is the "module" which contains the name of the
00121       # application that was executing at the time.
00122       self.scriptRun(module=os.path.join(appDir,'testSuite2'))
00123     except rcSuite.StopRequestedException, e:
00124       log.info("%s, suite: %s, module: %s" % (e.msg, e.suite, e.module))
00125
00126     # Normally the suite appears to be running even after all the tests have been completed.
00127     # In order to stop the suite the operator must click on the stop button. Alternatively
00128     # the suite can issue the stop by calling self.gui.doStopRun similar to the way it is
00129     # done with applications. Note that a flag is being used to make sure that rcStopSuite
00130     # hasn't already been called (ie. the suite was interrupted before it completed).
00131     if self.gui is not None:
00132       self.gui.doStopRun()
00133
00134   # stopSuite is called after rcStopSuite has been executed. If a sub-suite within the suite
00135   # is currently executing then the sub-suite's rcStopSuite is called and then this method
00136   # is called.
00137   def stopSuite(self):
00138     log.info("End of suite 1")
00139
00140 class userSuiteCallbacks(rcSuite.SuiteCallbacks):
00141   def __init__(self):
00142     pass
00143
00144   def beforeSetupSuite(self, suite):
00145     log.info("Before setupSuite")
00146
00147   def beforeStartSuite(self, suite):
00148     log.info("Before startSuite")
00149
00150   def afterStopSuite(self, suite):
00151     log.info("After stopSuite")
00152
00153 # Standalone mode:
00154 if __name__ == "__main__":
00155
00156   mycb = userSuiteCallbacks()
00157   usl = rcSuite.StandaloneLauncher(logLevel="INFO")
00158   usl.launch(suiteClass=userSuite, user=321, callbacks=mycb)
00159
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testSuite_Lean.py Source File

testSuite_Lean.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example test suite"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/10/26 01:40:22 $").split(' ')[1]
00014 __version__  = "$Revision: 1.1 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 from   LATTE.runcontrol.rcSuite import rcSuite
00020 import logging as     log
00021 import                os
00022
00023
00024 class userSuite(rcSuite):
00025   "Implmentation class for a user application"
00026   def __init__(self, gui, userId, debug):
00027     rcSuite.__init__(self, gui, userId, debug)
00028     log.debug("userSuite.__init__()")
00029
00030   def getName(self):
00031     return __name__
00032
00033   def setupSuite(self):
00034     pass
00035
00036   def startSuite(self):
00037     try:
00038       sessionContext = {"test":"abc", "eventCount":3}
00039       # The following script will change the value of session var "test"
00040       appDir = self.gui.preferences()['appdir']
00041       sessionStateAfterTest1 = self.scriptRun(module=os.path.join(appDir,'testSAppCal_Lean'),
00042                                               context=sessionContext)
00043       log.info("In %s: SESSION VAR=%s" % (self.getName(), self.getSessionVar("test")))
00044       # The following script will print the value of session var "test" and modify it
00045       sessionStateAfterTest2 = self.scriptRun(module=os.path.join(appDir,'testSAppEvt'))
00046       # Finally let's print the value of the session var "test" here
00047       print sessionStateAfterTest1
00048       print sessionStateAfterTest2
00049       log.info("In %s: SESSION VAR=%s" % (self.getName(), self.getSessionVar("test")))
00050     except rcSuite.StopRequestedException, e:
00051       log.info("%s, suite: %s, module: %s" % (e.msg, e.suite, e.module))
00052       if self.getSuite() is not None:
00053         raise e
00054
00055     if self.gui is not None and self.getSuite() is None:
00056       # Stop the suite if it wasn't called from a parent suite
00057       self.gui.doStopRun()
00058
00059
00060   def stopSuite(self):
00061     log.info("End of suite 2")
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testSuiteLong.py Source File

testSuiteLong.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example test suite"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/03/25 00:36:44 $").split(' ')[1]
00014 __version__  = "$Revision: 1.4 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 # History:
00020 #     $Log: testSuiteLong.py,v $
00021 #     Revision 1.4  2005/03/25 00:36:44  stuvi
00022 #     Test of running a suite summary after a StopRequestedException.
00023 #
00024 #     Revision 1.3  2005/03/24 03:37:36  stuvi
00025 #     Removed obsolete code.
00026 #
00027 #     Revision 1.2  2004/08/16 23:00:20  stuvi
00028 #     no message
00029 #
00030 #     Revision 1.1  2004/08/16 22:30:44  stuvi
00031 #     no message
00032 #
00033 #     Revision 1.1  2004/08/07 02:10:42  stuvi
00034 #     Test suite examples.
00035 #
00036 #     Revision 1.2  2004/01/24 00:27:17  stuvi
00037 #     Modified to use the appdir from preferences
00038 #
00039 #     Revision 1.1  2003/12/11 01:22:34  stuvi
00040 #     A sample test suite that is called as a sub suite from the testSuite sample.
00041 #
00042 #     Revision 1.2  2003/07/26 04:15:30  stuvi
00043 #     Fixed schema path
00044 #
00045 #     Revision 1.1  2003/03/28 03:21:41  stuvi
00046 #     Fixed FITS file status display
00047 #     Added test suite capability
00048 #
00049
00050 from   LATTE.runcontrol.rcSuite import rcSuite
00051 import logging as     log
00052 import                os
00053 import time
00054
00055
00056 class userSuite(rcSuite):
00057   "Implmentation class for a user application"
00058   def __init__(self, gui, userId, debug):
00059     rcSuite.__init__(self, gui, userId, debug)
00060     log.debug("userSuite.__init__()")
00061
00062   def getName(self):
00063     return __name__
00064
00065   def setupSuite(self):
00066     pass
00067     #self.addApplication('./applications/testSAppCal.py', schema)
00068     #self.addApplication('./applications/testSAppEvt.py', schema)
00069
00070   def startSuite(self):
00071     sessionContext = {"test":"abc", "eventCount":5}
00072     # The following script will change the value of session var "test"
00073     appDir = self.gui.preferences()['appdir']
00074     for i in xrange(1000000):
00075       if i % 1000 == 0:
00076         print("Test Run #%d" %i)
00077       # The following script will print the value of session var "test" and modify it
00078       try:
00079         sessionStateAfterTest2 = self.scriptRun(module=os.path.join(appDir,'testSAppCal'), context=sessionContext)
00080       except rcSuite.StopRequestedException, e:
00081         log.info("%s, suite: %s, module: %s" % (e.msg, e.suite, e.module))
00082         break
00083     if self.gui is not None:
00084       self.gui.doStopRun()
00085
00086   def stopSuite(self):
00087     log.info("End of long suite")
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testSuiteSummary.py Source File

testSuiteSummary.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Example test suite"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = ("$Date: 2005/03/25 00:38:09 $").split(' ')[1]
00014 __version__  = "$Revision: 1.1 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 # History:
00020 #     $Log: testSuiteSummary.py,v $
00021 #     Revision 1.1  2005/03/25 00:38:09  stuvi
00022 #     Test of running a suite summary after a StopRequestedException.
00023 #
00024 #     Revision 1.3  2005/03/24 03:37:36  stuvi
00025 #     Removed obsolete code.
00026 #
00027 #     Revision 1.2  2004/08/16 23:00:20  stuvi
00028 #     no message
00029 #
00030 #     Revision 1.1  2004/08/16 22:30:44  stuvi
00031 #     no message
00032 #
00033 #     Revision 1.1  2004/08/07 02:10:42  stuvi
00034 #     Test suite examples.
00035 #
00036 #     Revision 1.2  2004/01/24 00:27:17  stuvi
00037 #     Modified to use the appdir from preferences
00038 #
00039 #     Revision 1.1  2003/12/11 01:22:34  stuvi
00040 #     A sample test suite that is called as a sub suite from the testSuite sample.
00041 #
00042 #     Revision 1.2  2003/07/26 04:15:30  stuvi
00043 #     Fixed schema path
00044 #
00045 #     Revision 1.1  2003/03/28 03:21:41  stuvi
00046 #     Fixed FITS file status display
00047 #     Added test suite capability
00048 #
00049
00050 from   LATTE.runcontrol.rcSuite import rcSuite
00051 import logging as     log
00052 import                os
00053 import time
00054
00055
00056 class userSuite(rcSuite):
00057   "Implmentation class for a user application"
00058   def __init__(self, gui, userId, debug):
00059     rcSuite.__init__(self, gui, userId, debug)
00060     log.debug("userSuite.__init__()")
00061
00062   def getName(self):
00063     return __name__
00064
00065   def setupSuite(self):
00066     pass
00067
00068   def startSuite(self):
00069     sessionContext = {"test":"abc", "eventCount":10000}
00070     # The following script will change the value of session var "test"
00071     appDir = self.gui.preferences()['appdir']
00072     try:
00073       sessionContext = self.scriptRun(module=os.path.join(appDir,'testSAppCal'), context=sessionContext)
00074       sessionContext = self.scriptRun(module=os.path.join(appDir,'testSummary'), context=sessionContext)
00075     except rcSuite.StopRequestedException, e:
00076       log.info("%s, suite: %s, module: %s" % (e.msg, e.suite, e.module))
00077       self.clearStopRequested()
00078       sessionContext = self.scriptRun(module=os.path.join(appDir,'testSummary'), context=sessionContext)
00079     if self.gui is not None:
00080       self.gui.doStopRun()
00081
00082   def stopSuite(self):
00083     log.info("End of long suite")
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testSummary.py Source File

testSummary.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2002
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Test for suite summary"
00012 __author__   = "S. Tuvi <stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "11/21/2002"
00014 __version__  = "$Revision: 1.1 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import threading
00020 import logging       as     log
00021 from   LATTE.runcontrol.rcTransitions import rcTransitions
00022 from   LATTE.runcontrol.ArgumentImpl  import ArgumentImpl
00023 from   LATTE.runcontrol.rcComplStatus import rcCompletionStatus
00024 import time
00025
00026 from support.SimpleGasuExample   import *
00027 from support.MiniGLTExample      import *
00028
00029 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00030 #  the userApplication example to get the number of self triggers to take.
00031 class userArgument(ArgumentImpl):
00032   "GUI for getting the user to input some sort of value."
00033   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00034     ArgumentImpl.__init__(self, parent, name, modal, fl)
00035     self.__value = 0
00036     self.setCaption("Hello world!")
00037
00038   def OKButtonClicked(self):
00039     self.__value = int(self.ArgumentList.text().latin1())
00040     self.close()
00041
00042   def CancelButtonClicked(self):
00043     self.__value = None
00044     self.close()
00045
00046   def getValue(self, caption):
00047     self.setCaption(caption)
00048     self.show()
00049     self.exec_loop()
00050     return self.__value
00051
00052 class userArgText(object):
00053   "Text user interface for getting the user to input some sort of value"
00054   def __init__(self):
00055     pass
00056
00057   def getValue(self, caption):
00058     return int(raw_input("%s: " % (caption)))
00059
00060
00061 #  Example application implementation.
00062 #  Note that the name of the class must be userApplication.
00063 #  Look at rcTransitions for names of other transition methods that can be used.
00064 class userApplication(rcTransitions):
00065   "Implmentation class for a user application"
00066   def __init__(self, rc, userId, debug):
00067     rcTransitions.__init__(self, rc, userId, debug)
00068     log.debug("userApplication.__init__()")
00069     self.__cmdSynchSem = threading.Semaphore(0)
00070
00071   def getName(self):
00072     return __name__
00073
00074   def setup(self):
00075     log.debug("userApplication.setup()")
00076
00077     # A state transition can be rejected by not returning None
00078     return None
00079
00080   def startRun(self):
00081     log.debug("userApplication.startRun()")
00082
00083     # A state transition can be rejected by not returning None
00084     return None
00085
00086   def stopRun(self):
00087     log.debug("userApplication.stopRun()")
00088
00089     cStatus = self.getSessionVar("completionStatus")
00090     log.info("Setting suite summary completion status to : %s"
00091              % rcCompletionStatus().getCompletionStatusStr(cStatus))
00092     self.setCompletionStatus(cStatus)
00093
00094     # The STOP_RUN transition can not be rejected
00095
00096   def resume(self):
00097     log.debug("userApplication.resume()")
00098
00099     # Issue self trigger to make up for the one that was lost during PAUSE
00100     self.trigger().solicit()
00101
00102     return None
00103
00104   def stop(self):
00105     log.debug("userApplication.stop()")
00106     return self.stopRun()
00107
00108   def commandSynch(self):
00109     "Method called by the command synchronization task"
00110
00111     # Get out of waiting when in batch or standalone mode
00112     self.sync()
00113
00114     # execute the GUI functions for stopRun, just in case
00115     if not self.isRunFromSuite():
00116       if self.rc is not None:
00117         self.rc.doStop()
00118
00119   def wait(self):
00120     self.__cmdSynchSem.acquire()
00121
00122   def sync(self):
00123     if __name__ == "__main__" or self.isRunFromSuite():
00124       self.__cmdSynchSem.release()
00125
00126
00127 # Standalone mode:
00128 if __name__ == "__main__":
00129   log.basicConfig()
00130   log.getLogger("").setLevel(log.DEBUG)
00131   ua = userApplication(None, 321, 0)
00132   ua.rcSetup('../repos/simpleTemSchema.xml') # Use env var later: kludge for now
00133   ua.rcStartRun()
00134   ua.wait()
00135   ua.rcStopRun()
00136   ua.rcTeardown()
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testTkrHitFilter.py Source File

testTkrHitFilter.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2005
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Test application to test the TKR hit filter"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "1/28/2005"
00014 __version__  = "$Revision: 1.4 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import                      threading
00020 import logging       as     log
00021
00022 from   LATTE.runcontrol.rcTransitions import rcTransitions
00023 from   LATTE.runcontrol.ArgumentImpl   import ArgumentImpl
00024 import                      time
00025
00026 from support.SimpleGasuExample   import *
00027 from support.MiniGLTExample      import *
00028
00029 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00030 #  the userApplication example to get the number of self triggers to take.
00031 class userArgument(ArgumentImpl):
00032   "GUI for getting the user to input some sort of value."
00033   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00034     ArgumentImpl.__init__(self, parent, name, modal, fl)
00035     self.__value = 0
00036     self.setCaption("Enter value:")
00037
00038   def CancelButtonClicked(self):
00039     self.__value = None
00040     self.close()
00041
00042
00043 class userArgText(object):
00044   "Text user interface for getting the user to input some sort of value"
00045   def __init__(self):
00046     pass
00047
00048   def getValue(self, caption, value = None):
00049     if value is None:
00050       ans = raw_input("%s: " % (caption))
00051       if ans == '':  return None
00052       return int(ans)
00053     else:
00054       ans = raw_input("%s[%s]: " % (caption, str(value)))
00055       if ans == '':  return value
00056       return int(ans)
00057
00058 #  Example application implementation.
00059 #  Note that the name of the class must be userApplication.
00060 #  Look at rcTransitions for names of other transition methods that can be used.
00061 class userApplication(rcTransitions):
00062   "Implmentation class for a user application"
00063   def __init__(self, rc, userId, debug):
00064     rcTransitions.__init__(self, rc, userId, debug)
00065     log.debug("userApplication.__init__()")
00066     self.__cmdSynchSem = threading.Semaphore(0)
00067     self.__cnt         = 1
00068     self.__lowThresh   = 10
00069     self.__highThresh  = 100
00070     self.__towerMask   = 0x0000ffff
00071     self.__prescale    = 0xffffffffL
00072
00073   def getName(self):
00074     return __name__
00075
00076   def setup(self):
00077     if self.rc is None:
00078       self.__arg = userArgText()
00079     else:
00080       self.__arg = self.rc.createGUI(userArgument, self.rc, 'test1', 1)
00081
00082     # Get a TEM instance
00083     if self.lat.TEMcnt() == 1:
00084       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00085     elif self.lat.TEMcnt() > 1:
00086       tem = self.lat.TEM.all()
00087     else:
00088       log.fatal("No TEM(s) found in the schema")
00089       return -1
00090
00091 #  Move to schema configuration
00092 #    # reset the TEM since we are going to modify DATA_MASKS
00093 #    tem.CMD_RESET = 1
00094
00095 #    #
00096 #    # Configure TEM
00097
00098 #    # config TEM TKR calstrobe delay for ~ 5usec
00099 #    tem.TKR_TRGSEQ = 0x3C
00100
00101 #    # enable TKR, no diag #  0x1F00 for diag
00102 #    # make sure we also enable CAL CC 1 since it is required for
00103 #    # proper event data taking
00104 #    # enable GTCC 2 and 3
00105 #    tem.DATA_MASKS = 0x0DF3
00106 #    tem.configuration = 0x00010000L # primary
00107 #    #tem.CONFIGURATION = 0x03010000L # redundant
00108
00109 #    ccc = tem.allCCC()
00110 #    # enable output in our GCCCs
00111 #    # broadcast load of GCCC_REG_CONFIGURATION
00112 #    ccc.CONFIGURATION = 0x80000000L
00113
00114 #    #  disable all GCRCs in all GCCCs via broadcast
00115 #    ccc.LAYER_MASK_0 = 0xFFFFFFFFL
00116 #    ccc.LAYER_MASK_1 = 0xFFFFFFFFL
00117
00118     tcc = tem.allTCC()
00119
00120     # broadcast load of GTCC_REG_CONFIGURATION
00121     # enable controller output and set cable length to 1
00122     # 0xC0000000 is for one layer
00123     # 0x80000000 is for two layers
00124     tcc.CONFIGURATION = 0xC0000000L
00125     x_tcc = tem.downTCC(0)
00126     # enable all masks
00127     tcc.INPUT_MASK = 0x0
00128
00129     # set maximum event timeout
00130     tcc.EVENT_TIMEOUTS = 0x0
00131
00132     #
00133     # Configure GTRCs
00134     #
00135
00136     # our board is connected CC = 2, RC = 0 and CC = 3, RC = 0
00137     # reset GTRC # required before all triggers
00138
00139     trc = tcc.allTRC()
00140
00141     trc.CMD_RESET = 1
00142
00143     # number of GTFE to readout left
00144     nGTFEsLeft  = 7
00145     nGTFEsRight = 0
00146
00147     # max hits per GTRC # 31 max
00148     maxHits = 31
00149
00150     enMask  = 0x6
00151
00152     dLO = (enMask << 28) | ((nGTFEsRight << 7)& 0xF80) | (maxHits & 0x7F);
00153     #print "dLO=", dLO, hex(dLO)
00154
00155     # cable controller 2, readout controller 0
00156     tcc = tem.downTCC(2)
00157     trc = tcc.downTRC(1)
00158
00159     trc.CSR = dLO
00160
00161     dLO = (enMask << 28) | ((nGTFEsLeft << 7)& 0xF80) | (maxHits & 0x7F);
00162     #print "dLO=", dLO, hex(dLO)
00163
00164     # cable controller 3, readout controller 0
00165     tcc = tem.downTCC(3)
00166     trc = tcc.downTRC(1)
00167
00168     trc.CSR = dLO
00169
00170     #
00171     # Configure GTFEs
00172     #
00173
00174     tfe = trc.allTFE()
00175     tfe.TRIG_MASK = 0x0
00176     tfe.DATA_MASK = 0x0
00177     tfe.CALIB_MASK = 0x0
00178     tfe.DAC = 0x00001902
00179     # configure front ends # all listen to left
00180     tfe.MODE = 0
00181     #tfe = trc.downTFE(0)
00182
00183     # configure default DACs for threshold and calibration
00184     # Calibration DAC Range and Resolution
00185     # Low Range (B6=0):  DAC output voltage in mV = 1.57 + 1.53*DAC_Value
00186     # High Range (B6=1): DAC output voltage in mV = 15.0 + 14.6*DAC_Value
00187     # Discriminator Threshold DAC Range and Resolution
00188     # Low Range (B6=0):  DAC output voltage in mV = 4.5 + 4.5*DAC_Value
00189     # High Range (B6=1): DAC output voltage in mV = 12.9 + 12.9*DAC_Value
00190
00191
00192     # calRng = 1
00193     # thrRng = 0
00194     # calDAC = 60
00195     # thrDAC = 10
00196
00197     tfe.DAC = 0x00001952  # based on the above Rng and DAC values
00198
00199     # enable GTFE for data taking # all channels
00200     tfe.TRIG_MASK = 0xffffffffffffffff
00201     tfe.DATA_MASK = 0xffffffffffffffff
00202
00203     # Cal strobe channels 4 and 48 only
00204     tfe.CALIB_MASK = 0x0001000000000010
00205
00206     #~ #Mask of the following Registers
00207     #~ tfe = trc.downTFE(13)
00208     #~ tfe.DATA_MASK = 0x0L
00209     #~ tfe.CALIB_MASK = 0x0L
00210     #~ tfe.TRIG_MASK = 0x0L
00211
00212     #~ tfe = trc.downTFE(14)
00213     #~ tfe.DATA_MASK = 0x0L
00214     #~ tfe.CALIB_MASK = 0x0L
00215     #~ tfe.TRIG_MASK = 0x0L
00216
00217     #~ tfe = trc.downTFE(19)
00218     #~ #tfe.DATA_MASK = 0x0L
00219     #~ tfe.CALIB_MASK = 0x0L
00220     #~ tfe.TRIG_MASK = 0x0L
00221
00222     #~ tfe = trc.downTFE(20)
00223     #~ #tfe.DATA_MASK = 0x0L
00224     #~ tfe.CALIB_MASK = 0x0L
00225     #~ tfe.TRIG_MASK = 0x0L
00226
00227
00228
00229     # Two choices for the trigger, GEM and MiniGLT
00230     if self.lat.existsGEM():
00231       self.trigger( SimpleGasuExample() )
00232     else:
00233       self.trigger( MiniGLTExample() )
00234
00235
00236     # A state transition can be rejected by not returning None
00237     return None
00238
00239   def startRun(self):
00240     caption = "Enter number of triggers to take"
00241     if self.rc is None:
00242       cnt = self.__arg.getValue(caption, self.__cnt)
00243     else:
00244       cnt = self.rc.execGUImethod(self.__arg.getValue, caption, self.__cnt)
00245
00246     # The user pressed 'Cancel'
00247     if cnt is None:  return -1
00248     self.__cnt = cnt
00249
00250     caption = "Enter the tracker hit low threshold"
00251     if self.rc is None:
00252       lowThresh = self.__arg.getValue(caption, self.__lowThresh)
00253     else:
00254       lowThresh = self.rc.execGUImethod(self.__arg.getValue, caption, self.__lowThresh)
00255     if lowThresh is None:  return -1    # The user pressed 'Cancel'
00256     self.__lowThresh = lowThresh
00257
00258     caption = "Enter the tracker hit high threshold"
00259     if self.rc is None:
00260       highThresh = self.__arg.getValue(caption, self.__highThresh)
00261     else:
00262       highThresh = self.rc.execGUImethod(self.__arg.getValue, caption, self.__highThresh)
00263     if highThresh is None:  return -1   # The user pressed 'Cancel'
00264     self.__highThresh = highThresh
00265
00266     caption = "Enter the tower mask"
00267     if self.rc is None:
00268       towerMask = self.__arg.getValue(caption, self.__towerMask)
00269     else:
00270       towerMask = self.rc.execGUImethod(self.__arg.getValue, caption, self.__towerMask)
00271     if towerMask is None:  return -1    # The user pressed 'Cancel'
00272     self.__towerMask = towerMask
00273
00274     caption = "Enter the prescale value"
00275     if self.rc is None:
00276       prescale = self.__arg.getValue(caption, self.__prescale)
00277     else:
00278       prescale = self.rc.execGUImethod(self.__arg.getValue, caption, self.__prescale)
00279     if prescale is None:  return -1     # The user pressed 'Cancel'
00280     self.__prescale = prescale
00281
00282     self.rc.common().getOCS().evtHandlerSetVerbosity(1)
00283     self.rc.common().getOCS().evtHandlerFilterTkrHits(lowThresh, towerMask, highThresh, prescale)
00284
00285     # Spawn a thread to synchronize commands with events
00286     # This must happen after triggers are enabled
00287     self.__cmdSynchQuit = False
00288
00289     # A state transition can be rejected by not returning None
00290     return None
00291
00292   def stopRun(self):
00293     self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00294     self.__cmdSynchQuit = True
00295
00296     # The STOP_RUN transition can not be rejected
00297
00298   def resume(self):
00299     # Issue self trigger to make up for the one that was lost during PAUSE
00300     self.trigger().solicit()
00301
00302     return None
00303
00304   def stop(self):
00305     return self.stopRun()
00306
00307   def teardown(self):
00308     # Allow the C++ object to be deleted
00309     if self.rc is not None and self.__arg is not None:
00310       self.__arg.deleteLater()
00311
00312   def process(self, (status, buffer)):
00313     "Method called back for each data event taken"
00314
00315     evtCli = self.evtCli
00316
00317     if status != 0:
00318       if evtCli.isGGLTStatus():
00319         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00320       elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00321         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00322       return
00323     try:
00324       # In the future this event may contain additional data
00325       if evtCli.isSweepEvent(): return
00326     except:
00327       # Event summary word inaccessible, handle the bad event here
00328       log.exception("")
00329       return
00330
00331     hits = 0
00332     for contributor in range(16):       # TEM ids
00333       if evtCli.setCurrentContribution(contributor) != -1:
00334         #evtCli.evDumpSummary()
00335         evtCli.evDumpTKR()
00336         #evtCli.evDumpTEM_Error()
00337         #evtCli.evDumpDiagnostic()
00338
00339         hits += len(evtCli.evt.TKRstrips)
00340         #for strip in evtCli.evt.TKRstrips:
00341         #  print strip.ui
00342         print "TEM %d TKRSTRIPS: %d" % (contributor, len(evtCli.evt.TKRstrips))
00343       else:
00344         if False:
00345           print "*******************************************"
00346           print "*   NO TEM %2d CONTRIBUTION PRESENT        *" % (contributor)
00347           print "*******************************************"
00348
00349     print "Total TKR strip hits =", hits
00350
00351   #def __commandSynch(self, count):
00352   def commandSynch(self):
00353     "Method called by the command synchronization task"
00354     import time
00355     trigger  = self.trigger()
00356
00357     t0  = time.time()
00358
00359     # Compensate for the extra CMD_SELF_TRIGGER below
00360     cnt = 1
00361     count = self.__cnt
00362
00363     # Wait for START_RUN to enable triggers
00364     trigger.waitForMaskEnable()
00365
00366     trigger.solicit()                   # Issue an internal trigger
00367
00368     t1 = trigger.getEnableTime()        # get the last trigger enable time from GLT
00369
00370     while cnt < count and not self.__cmdSynchQuit:
00371       cnt += 1
00372       trigger.solicit()                 # Issue an internal trigger
00373       time.sleep(.1)
00374
00375     t2 = trigger.getTimeStamp()         # Get the last trigger timestamp
00376     # When we get here the triggers should still be enabled.
00377     # If the glt.MASK needs to be set through any other means
00378     # then it needs to be restored to its SETUP value here.
00379
00380     if t1 is None:
00381       t1 = t0
00382     if t2 is None:
00383       t2 = time.time()
00384     dT = t2 - t1
00385     if dT == 0.0:  dT = 0.000001
00386     log.info("%s processed %d events in %.3f seconds = %.1f events/second" % \
00387              (self.getName(), self.evtCnt, dT, self.evtCnt/dT))
00388
00389     # Get out of waiting when in suite or standalone mode
00390     self.sync()
00391
00392     # execute the GUI functions for stopRun, just in case
00393     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00394       if self.rc is not None:
00395         self.rc.doStop()
00396
00397   def wait(self):
00398     self.__cmdSynchSem.acquire()
00399
00400   def sync(self):
00401     if __name__ == "__main__" or self.isRunFromSuite():
00402       self.__cmdSynchSem.release()
00403
00404
00405
00406 # Standalone mode:
00407 if __name__ == "__main__":
00408   from LATTE.runcontrol.RunControlCommon import RunControlCommon
00409
00410   rcCommon = RunControlCommon()
00411   rcCommon.initialize()
00412   rcCommon.setLoggingLevel("INFO")
00413   rcCommon.connect()
00414   ua = userApplication(None, 321, rcCommon)
00415   ua.rcSetup()
00416   ua.rcStartRun()
00417   ua.wait()
00418   ua.rcStopRun()
00419   ua.rcTeardown()
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testTrending.py Source File

monitoring

testTrending.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Housekeeping trending tester module"
00012 __author__   = "J. Panetta <panetta@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "7/20/2004"
00014 __version__  = "$Revision: 1.3 $"
00015 __credits__  = "SLAC"
00016
00017
00018 import LATTE.copyright_SLAC
00019
00020 from LATTE.monitoring.Receiver import *
00021 import logging
00022 import qt
00023
00024
00025 class QtReceiver(qt.QObject,UDPReceiver):
00026     class TrendUpdateEvent(qt.QCustomEvent):
00027         def __init__(self,trendables):
00028             qt.QCustomEvent.__init__(self,qt.QEvent.MaxUser-20)
00029             self.trendables=trendables
00030     def __init__(self,*args):
00031         qt.QObject.__init__(self,*args)
00032         Receiver.__init__(self)
00033     def process(self,trendables):
00034         qt.QApplication.postEvent(self,QtReceiver.TrendUpdateEvent(trendables))
00035     def customEvent(self,event):
00036         self.emit(qt.PYSIGNAL('TrendUpdate(trendables)'),(event.trendables,))
00037
00038 class TrendTestGUI(qt.QTextEdit):
00039     def __init__(self,*args):
00040         qt.QTextEdit.__init__(self,*args)
00041         self.setTextFormat(qt.Qt.LogText)
00042         self.setMaxLogLines(1000)
00043     def update(self,trendables):
00044         for t in trendables:
00045             self.append(str(t))
00046
00047 class TrendTree(qt.QListView):
00048     def __init__(self,*args):
00049         qt.QListView.__init__(self,*args)
00050         self.columns=['Name','Time']
00051         self.addColumn('Name')
00052         self.addColumn('Time')
00053         self.setRootIsDecorated(1)
00054         self.setResizeMode(qt.QListView.AllColumns)
00055         self.setAllColumnsShowFocus(1)
00056         self.setShowSortIndicator(1)
00057         self.setSelectionMode(qt.QListView.Extended)
00058         self.__dynamic=1
00059
00060     def isDynamic(self):
00061         return self.__dynamic
00062
00063     def setDynamic(self,bool):
00064         self.__dynamic=bool
00065
00066     def addLeaf(self,name):
00067         if not self.findItem(name,0):
00068             bname=self.getBranchName(name)
00069             branch=self.findItem(bname,0)
00070             if not branch:
00071                 branch=qt.QListViewItem(self,bname)
00072             leaf=qt.QListViewItem(branch,name)
00073             return leaf
00074
00075     def update(self,trendables):
00076         for t in trendables:
00077             leaf=self.findItem(t.name,0)
00078             if not leaf and self.__dynamic:
00079                 leaf=self.addLeaf(t.name)
00080             if leaf:
00081                 from time import ctime
00082                 leaf.setText(1,ctime(t.time))
00083                 for k in t.content.keys():
00084                     try:
00085                         c=self.columns.index(k)
00086                     except ValueError, e:
00087                         self.addColumn(k)
00088                         self.columns.append(k)
00089                         c=self.columns.index(k)
00090                     leaf.setText(c,str(t.content[k]))
00091
00092     def getBranchName(self,name):
00093         return name.split('_')[0]
00094
00095
00096 class TrendPlotter(qt.QWidget):
00097     def __init__(self,*args):
00098         qt.QWidget.__init__(self,*args)
00099
00100         self.__ntuples={}
00101         self.__plots={}
00102         self.__views={}
00103         self.__defaultDepth=150
00104         self.__defaultLabels=['Time','Counts']
00105
00106         self.__dynamic=1
00107
00108         self.grid=qt.QGridLayout(self,1,4)
00109         self.grid.setAutoAdd(1)
00110
00111     def isDynamic(self):
00112         return self.__dynamic
00113     def setDynamic(self,bool):
00114         self.__dynamic=bool
00115
00116     def addPlot(self,trendable):
00117         name=trendable.name
00118         labels=self.__defaultLabels
00119         depth=self.__defaultDepth
00120         import sihippo
00121         # Create the Circular buffer to store the data
00122         ntc=sihippo.NTupleController.instance()
00123         nt=ntc.createCircularBuffer(labels)
00124         nt.reserve(depth)
00125         nt.setTitle(name)
00126         nt.setName(name)
00127         # Create the Plot
00128         dc=sihippo.DisplayController.instance()
00129         # plot=dc.createDisplay('XY Plot',nt,labels)
00130         plot=dc.createDisplay('Strip Chart',nt,labels)
00131         view=sihippo.QtViewWidget(self)
00132         view.setPlotter(plot)
00133         view.setDoubleBuffering(1)
00134         view.resize(200,100)
00135         view.setMinimumSize(qt.QSize(100,50))
00136         #self.grid.addWidget(view)
00137         view.show()
00138
00139         self.__ntuples[name]=nt
00140         self.__plots[name]=plot
00141         self.__views[name]=view
00142
00143     def update(self,trendables):
00144         for t in trendables:
00145             if t.name not in self.__views.keys() and self.__dynamic:
00146                 self.addPlot(t)
00147             if t.name not in self.__views.keys():
00148                 return
00149             x=t.time
00150             y=t.content['Raw Value']
00151             self.__ntuples[t.name].addRow([x,y])
00152
00153
00154 # This is just a dumb way to control the TrendTree
00155 class FancyTrendTree(qt.QVBox):
00156     def __init__(self,*args):
00157         qt.QVBox.__init__(self,*args)
00158
00159         self.tree=TrendTree(self)
00160
00161         self.menu=qt.QPopupMenu(self)
00162         self.menu.insertItem('Remove Selected',self.removeSelected)
00163         self.menu.insertItem('New Leaf',self.newTrend)
00164         self.menu.insertItem('Toggle Dynamic',self.toggleDynamic)
00165
00166         self.connect(self.tree,
00167                      qt.SIGNAL('contextMenuRequested'\
00168                                +'(QListViewItem*,const QPoint&,int)')
00169                      ,self.contextMenu)
00170
00171     def toggleDynamic(self):
00172         self.tree.setDynamic(not self.tree.isDynamic())
00173
00174     def update(self,trendables):
00175         self.tree.update(trendables)
00176
00177     def newTrend(self):
00178         name,ok=qt.QInputDialog.getText('New Leaf',
00179                                         'Name of new leaf',
00180                                         qt.QLineEdit.Normal,
00181                                         '',self)
00182         if ok:
00183             self.tree.addLeaf(str(name))
00184
00185
00186     def removeSelected(self):
00187         it=qt.QListViewItemIterator(self.tree,
00188                                     qt.QListViewItemIterator.Selected)
00189         while it.current():
00190             item=it.current()
00191             if item.parent():
00192                 item.parent().takeItem(item)
00193             else:
00194                 self.tree.takeItem(item)
00195             it+=1
00196
00197     def contextMenu(self,item,point,pos):
00198         self.menu.popup(point)
00199
00200 ###############################################################
00201 def testQtReceiver(args):
00202     app=qt.QApplication(args)
00203
00204     logging.basicConfig()
00205     logging.root.setLevel(logging.DEBUG)
00206
00207     r=QtReceiver()
00208     udpServerName='testTrendingServer'
00209     udpServerAddr='54320@239.255.1.14'
00210     r.setUDPClient(udpServerName,udpServerAddr)
00211
00212     # gui=TrendTestGUI()
00213     # gui=TrendTree()
00214     # gui=FancyTrendTree()
00215     gui=TrendPlotter()
00216     gui.connect(r,qt.PYSIGNAL('TrendUpdate(trendables)'),gui.update)
00217
00218     app.connect(app,qt.SIGNAL("lastWindowClosed()"),
00219                 app,qt.SLOT("quit()"))
00220
00221     app.setMainWidget(gui)
00222     gui.show()
00223
00224     r.setReceiving(1)
00225     app.exec_loop()
00226     r.shutdown()
00227
00228 def testReceiver():
00229     logging.basicConfig()
00230     logging.root.setLevel(logging.DEBUG)
00231
00232     udpServerName='testTrendingServer'
00233     udpServerAddr='54320@239.255.1.14'
00234
00235     r=UDPReceiver()
00236     r.setUDPClient(udpServerName,udpServerAddr)
00237     r.setReceiving(1)
00238     from time import sleep
00239     try:
00240         while 1:
00241             sleep(.1)
00242     except Exception, e:
00243         r.shutdown()
00244
00245 if __name__ == '__main__':
00246     import sys
00247     testQtReceiver(sys.argv)
00248     #testReceiver()
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: testTrgParityError.py Source File

testTrgParityError.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Test application for inducing and detecting event errors"
00012 __author__   = "J. Panetta <panetta@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "2005/03/22"
00014 __version__  = "$Revision: 1.1 $"
00015 __credits__  = "SLAC"
00016
00017 import LATTE.copyright_SLAC
00018
00019 import threading
00020 import logging       as     log
00021
00022 from   LATTE.runcontrol.rcTransitions import rcTransitions
00023 from   LATTE.runcontrol.ArgumentImpl  import ArgumentImpl
00024
00025 from support.SimpleGasuExample   import *
00026 from support.MiniGLTExample      import *
00027
00028
00029 #  Example application implementation.
00030 #  Note that the name of the class must be userApplication.
00031 #  Look at rcTransitions for names of other transition methods that can be used.
00032 class userApplication(rcTransitions):
00033   "Implmentation class for a user application"
00034   def __init__(self, gui, userId, debug):
00035     rcTransitions.__init__(self, gui, userId, debug)
00036     log.debug("userApplication.__init__()")
00037     self.__eventSem    = threading.Semaphore(0)
00038     self.__cmdSynchSem = threading.Semaphore(0)
00039     self.__tpe = 0
00040     self.__pkte = 0
00041
00042   def getName(self):
00043     return __name__
00044
00045   def setup(self):
00046     log.debug("userApplication.setup()")
00047
00048     # Get a TEM instance
00049     if self.lat.TEMcnt() == 1:
00050       tem = self.lat.TEM[self.lat.TEM.keys()[0]]
00051     elif self.lat.TEMcnt() > 1:
00052       tem = self.lat.TEM.all()
00053     else:
00054       log.fatal("No TEM(s) found in the schema")
00055       return -1
00056
00057     # reset the TEM since we are going to modify DATA_MASKS
00058     tem.CMD_RESET = 1
00059
00060     # clear TEM stats reg
00061     tem.COMMAND_RESPONSE = 0
00062
00063     # clear TEM status reg
00064     tem.STATUS = 0
00065
00066     # enable CAL, disable TKR, no diag #  0x10FF for diag
00067     tem.DATA_MASKS = 0x00FF
00068
00069     # TEM config reg # set TEM timeout
00070     tem.CONFIGURATION = 0
00071
00072     #status = gTEMread( __GT, temId, TEM_REG_CONFIGURATION, &payload);
00073     #printf("tem config reg = 0x%08x\n", payload);
00074
00075     # enable output in our GCCCs
00076     # broadcast load of GCCC_REG_CONFIGURATION
00077
00078     bcast_ccc = tem.allCCC()
00079     bcast_ccc.CONFIGURATION = 0x80000000L
00080
00081     #  disable all GCRCs in all GCCCs via broadcast # GCCC_REG_LAYER_MASK_0, GCCC_REG_LAYER_MASK_1
00082     bcast_ccc.LAYER_MASK_0 = 0xFFFFFFFFL
00083     bcast_ccc.LAYER_MASK_1 = 0xFFFFFFFFL
00084     ccc2 = tem.downCCC(2) # O$GCCC_02
00085     ccc2.LAYER_MASK_1 = 0x3BFD3FFF
00086
00087     # large timeouts for all GCCCs
00088     # broadcast load of GCCC_REG_EVENT_TIMEOUTS
00089     bcast_ccc.EVENT_TIMEOUTS = 0x0
00090     #status = gGCCCread( __GT, temId, 1, GCCC_REG_EVENT_TIMEOUTS, &payload);
00091     #printf("gccc register event timeouts = 0x%08x\n", payload);
00092
00093     # Two choices for the trigger, GEM and MiniGLT
00094     if self.lat.existsGEM():
00095       self.trigger( SimpleGasuExample() )
00096     else:
00097       self.trigger( MiniGLTExample() )
00098
00099     # A state transition can be rejected by not returning None
00100     return None
00101
00102   def startRun(self):
00103     log.debug("userApplication.startRun()")
00104
00105     self.__cnt = 5
00106
00107     # Spawn a thread to synchronize commands with events
00108     # This must happen after triggers are enabled
00109     self.__cmdSynchQuit = False
00110
00111     # reset internal variables
00112     self.__tpe = 0
00113     self.__pkte = 0
00114
00115     # A state transition can be rejected by not returning None
00116     return None
00117
00118   def stopRun(self):
00119
00120     # Success is defined if we found one and only one trigger parity error
00121     # and one and only one packet error
00122     if self.__tpe == 1 & self.__pkte == 1:
00123       log.info("Setting completion status = SUCCESS")
00124       self.setCompletionStatus(self.COMPL_STATUS_SUCCESS)
00125     else:
00126       log.info("Setting completion status = FAILED")
00127       self.setCompletionStatus(self.COMPL_STATUS_FAILED)
00128     self.__cmdSynchQuit = True
00129     self.__eventSem.release()
00130
00131     # The STOP_RUN transition can not be rejected
00132
00133   def resume(self):
00134     # Issue self trigger to make up for the one that was lost during PAUSE
00135     self.trigger().solicit()
00136
00137     return None
00138
00139   def stop(self):
00140     return self.stopRun()
00141
00142   def process(self, (status, buffer)):
00143     "Method called back for each data event taken"
00144     ###log.debug("userApplication.process()")
00145
00146     evtCli = self.evtCli
00147
00148     if status != 0:
00149       if evtCli.isGGLTStatus():
00150         log.error("GGLT_STATUS=%d %s" % (evtCli.getGGLTStatus(), evtCli.getGGLTStatusStr()))
00151       elif not evtCli.checkOnlineStatus(status, self.evtCli.PLAYBACK_ERROR):
00152         log.error("EVENT ERROR= 0x%x %s" % (status, evtCli.getOnlineStatusStr()))
00153       self.__eventSem.release()
00154       return
00155
00156     try:
00157       # In the future this event may contain additional data
00158       if evtCli.isSweepEvent(): return
00159     except:
00160       # Event summary word inaccessible, handle the bad event here
00161       import gutil
00162       gutil.logException()
00163       return
00164
00165     if evtCli.isTrgParityErrorEvent():
00166       log.debug( "Found a trigger parity error")
00167       self.__tpe += 1
00168     elif evtCli.isPacketErrorEvent():
00169       log.debug( "Found a packet error")
00170       self.__pkte += 1
00171     else:
00172       log.debug( "Found a normal event")
00173     # Get next event triggered
00174     self.__eventSem.release()
00175
00176   def commandSynch(self):
00177     "Method called by the command synchronization task"
00178     import time
00179     trigger  = self.trigger()
00180     eventSem = self.__eventSem
00181
00182     # Drain the semaphore release count
00183     # Handles the case when the stop run release collided with a trigger release
00184     while eventSem.acquire(0):  pass
00185
00186     t0  = time.time()
00187
00188     # Compensate for the extra CMD_SELF_TRIGGER below
00189     cnt   = 1
00190     count = self.__cnt
00191
00192     # bitmask in GEM config to cause trigger parity error
00193     TPE = 0x20
00194     # bitmask in GEM config to cause packet error  (suppress bit)
00195     PKTE = 0x40
00196
00197     # Wait for START_RUN to enable triggers
00198     trigger.waitForMaskEnable()
00199
00200     # take one normal event
00201     trigger.solicit()                   # Issue an internal trigger
00202     eventSem.acquire()                  # Wait for the event to be processed
00203
00204     # Cause a trigger parity error for GEM event
00205     trigger.disable()
00206     gemc = trigger.GEM().GEMC
00207     gemcfg = gemc.CONFIGURATION
00208     gemcfg |= TPE
00209     gemc.configuration = gemcfg
00210     trigger.enable()
00211
00212     trigger.solicit()                   # Issue an internal trigger
00213     eventSem.acquire()                  # Wait for the event to be processed
00214
00215     # Reset the GEM to remove the trigger parity error bit.
00216     trigger.disable()
00217     gemc = trigger.GEM().GEMC
00218     gemcfg = gemc.CONFIGURATION
00219     gemcfg &= ~TPE
00220     gemc.configuration = gemcfg
00221     trigger.enable()
00222
00223     # Cause a packet error for GEM event
00224     trigger.disable()
00225     gemc = trigger.GEM().GEMC
00226     gemcfg = gemc.CONFIGURATION
00227     gemcfg |= PKTE
00228     gemc.configuration = gemcfg
00229     trigger.enable()
00230
00231     trigger.solicit()                   # Issue an internal trigger
00232     eventSem.acquire()                  # Wait for the event to be processed
00233
00234     # Reset the GEM to remove the suppression bit.
00235     trigger.disable()
00236     gemc = trigger.GEM().GEMC
00237     gemcfg = gemc.CONFIGURATION
00238     gemcfg &= ~PKTE
00239     gemc.configuration = gemcfg
00240     trigger.enable()
00241
00242     # take one normal event
00243     trigger.solicit()                   # Issue an internal trigger
00244     eventSem.acquire()                  # Wait for the event to be processed
00245
00246     # Get out of waiting when in standalone mode
00247     self.sync()
00248
00249     # execute the GUI functions for stopRun, just in case
00250     if not self.__cmdSynchQuit and not self.isRunFromSuite():
00251       if self.gui is not None:
00252         self.gui.doStopRun()
00253
00254   def wait(self):
00255     self.__cmdSynchSem.acquire()
00256
00257   def sync(self):
00258     if __name__ == "__main__" or self.isRunFromSuite():
00259       self.__cmdSynchSem.release()
00260
00261
00262 # Standalone mode:
00263 if __name__ == "__main__":
00264   import os
00265   log.basicConfig()
00266   log.getLogger("").setLevel(log.DEBUG)
00267   ua = userApplication(None, 321, 1)
00268   ua.rcSetup(os.path.join(os.environ['ONLINE_ROOT'], 'repos/simpleTemSchema.xml'))
00269   ua.rcStartRun()
00270   ua.wait()
00271   ua.rcStopRun()
00272   ua.rcTeardown()
00273
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: towerwidgetImpl.py Source File

browser

towerwidgetImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Trigger"
00012 __abstract__ = "Tower widget implementation for trigger display"
00013 __author__   = "Martin Kocian, SLAC"
00014 __date__     = ("$Date: 2005/06/15 23:42:30 $").split(' ')[1]
00015 __version__  = "$Revision: 2.2 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018 from qt import *
00019 from towerwidget import towerwidget
00020 import time
00021 from listmean import listmean
00022 from imagedata import *
00023 CLOCKTICK=50.e-9
00024
00025 class towerwidgetImpl(towerwidget):
00026     def __init__(self,lat,temid,parent=None,name=None,fl=0):
00027         towerwidget.__init__(self,parent,name,fl)
00028         self.__numsamples=10
00029         self.__parent=parent
00030         self.__temid=temid
00031         self.__tic=lat.downTEM(temid).TIC
00032         self.__oldcounter=self.__tic.busy_lrs_counter
00033         self.barw.bar.setMajor(110)
00034 #        if self.__oldcounter==16777215:
00035 #            self.__tic.busy_lrs_counter=0
00036 #            self.__oldcounter=0
00037         self.__valuelist=[]
00038         self.__mask=0x3
00039         self.__mask=-1
00040         self.image0=QPixmap(image0_data)
00041         self.image1=QPixmap(image1_data)
00042         self.__oldtime=time.time()
00043         if not name:
00044             self.setName("towerwidgetImpl")
00045         #QObject.connect(self.encal,SIGNAL("toggled(bool)"),self.calmask)
00046         #QObject.connect(self.entkr,SIGNAL("toggled(bool)"),self.tkrmask)
00047         QObject.connect(self.resetb,SIGNAL("clicked()"),self.resetpressed)
00048     def changeSampling(self,sampling):
00049       sample=[100,50,20,10,5,2,1]
00050       self.__numsamples=sample[sampling]
00051     def resetpressed(self):
00052        self.__tic.busy_lrs_counter=0
00053        self.__oldcounter=0
00054
00055     def calmask(self,onoff):
00056        if onoff==False:
00057            if self.__mask==0x3:
00058                self.__mask=0x6
00059            else:
00060                self.__mask=0x7
00061        else:
00062            if self.__mask==0x6:
00063                self.__mask=0x3
00064            else:
00065                self.__mask=0x5
00066        self.__tic.busy_lrs_mask=self.__mask
00067        self.valuelist=[]
00068
00069     def tkrmask(self,onoff):
00070        if onoff==False:
00071            if self.__mask==0x3:
00072                self.__mask=0x5
00073            else:
00074                self.__mask=0x7
00075        else:
00076            if self.__mask==0x5:
00077                self.__mask=0x3
00078            else:
00079                self.__mask=0x6
00080        self.__tic.busy_lrs_mask=self.__mask
00081        self.valuelist=[]
00082
00083
00084     def update(self):
00085         newtime=time.time()
00086         timediff=newtime-self.__oldtime
00087         self.__oldtime=newtime
00088         counter=self.__tic.busy_lrs_counter
00089         if self.__mask!=self.__tic.busy_lrs_mask:
00090             self.__mask=self.__tic.busy_lrs_mask
00091             if not self.__mask&1 or not self.__mask&4:
00092                 self.entkr.setPixmap(self.image0)
00093             else:
00094                 self.entkr.setPixmap(self.image1)
00095             if not self.__mask&2 or not self.__mask&4:
00096                 self.encal.setPixmap(self.image0)
00097             else:
00098                 self.encal.setPixmap(self.image1)
00099 #        if counter==16777215:
00100 #            self.__tic.busy_lrs_counter=0
00101 #            self.__oldcounter=0
00102 #        else:
00103         newval=0.
00104         if timediff>0:
00105             newval=100*float(counter-self.__oldcounter)*CLOCKTICK/timediff
00106         average=listmean(self.__valuelist,newval,self.__numsamples)
00107         if counter==16777215:
00108             self.barw.setTitle("Full")
00109             self.barw.bar.displayValue(150)
00110         else:
00111             self.barw.setTitle("%0.1f"%average+"%")
00112             self.barw.bar.displayValue(average)
00113             self.__oldcounter=counter
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: transitionRejectTest.py Source File

transitionRejectTest.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2005
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Application for testing rejecting of transitions"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "February 1, 2005"       # Created
00014 __version__  = "$Revision: 1.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 from qt import qApp
00021
00022 import            threading
00023 import logging as log
00024
00025 from   LATTE.runcontrol.rcTransitions  import rcTransitions
00026 from   LATTE.runcontrol.ArgumentImpl   import ArgumentImpl
00027
00028 from support.SimpleGasuExample   import *
00029 from support.MiniGLTExample      import *
00030
00031
00032 #  This class puts up a GUI for inputting a value of some sort.  It is used by
00033 #  the userApplication example to get the number of self triggers to take.
00034 class userArgument(ArgumentImpl):
00035   "GUI for getting the user to input some sort of value."
00036   def __init__(self, parent = None, name = None, modal = 0, fl = 0):
00037     ArgumentImpl.__init__(self, parent, name, modal, fl)
00038     self.__value = 0
00039     self.setCaption("Enter value:")
00040
00041   def CancelButtonClicked(self):
00042     self.__value = None
00043     self.close()
00044
00045
00046 class userArgText(object):
00047   "Text user interface for getting the user to input some sort of value"
00048   def __init__(self):
00049     pass
00050
00051   def getValue(self, caption, value = None):
00052     if value is None:
00053       ans = raw_input("%s: " % (caption))
00054       if ans == '':  return None
00055       return int(ans)
00056     else:
00057       ans = raw_input("%s[%s]: " % (caption, str(value)))
00058       if ans == '':  return value
00059       return int(ans)
00060
00061
00062 #  Null application implementation.
00063 class userApplication(rcTransitions):
00064   "Implmentation class for Null application"
00065   def __init__(self, rc, userId, debug):
00066     rcTransitions.__init__(self, rc, userId, debug)
00067     self.__state    = 1
00068     self.__doneOnce = False
00069
00070   def getName(self):
00071     return __name__
00072
00073   def setup(self):
00074     log.debug("userApplication.setup()")
00075
00076     self.__doneOnce = False
00077
00078     if self.rc is None:
00079       self.__arg = userArgText()
00080     else:
00081       self.__arg = self.rc.createGUI(userArgument, self.rc, self.getName(), 1)
00082
00083     caption = "Select when to reject the transition:\n  1 = Setup\n  2 = StartRun\n  3 = StopRun\n  4 = Teardown\n  5 = Pause\n  6 = Resume\n  7 = Stop\n\n"
00084     if self.rc is None:
00085       self.__state = self.__arg.getValue(caption, self.__state)
00086     else:
00087       self.__state = self.rc.execGUImethod(self.__arg.getValue, caption, self.__state)
00088
00089     if not self.__doneOnce and self.__state == 1:
00090       self.__doneOnce = True
00091       print
00092       print "Rejecting the SETUP transition - Should end up in RESET state"
00093       print
00094       return self.__state
00095
00096     # Two choices for the trigger, GEM and MiniGLT
00097     if self.lat.existsGEM():
00098       self.trigger( SimpleGasuExample() )
00099     else:
00100       self.trigger( MiniGLTExample() )
00101
00102     # A state transition can be rejected by not returning None
00103     return None
00104
00105   def startRun(self):
00106     log.debug("userApplication.startRun()")
00107
00108     if not self.__doneOnce and self.__state == 2:
00109       self.__doneOnce = True
00110       print
00111       print "Rejecting the START_RUN transition - Should end up in STOPPED state"
00112       print
00113       return self.__state
00114
00115     # A state transition can be rejected by not returning None
00116     return None
00117
00118   def stopRun(self):
00119     log.debug("userApplication.stopRun()")
00120
00121     # Set the test completion status value
00122     self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00123
00124     if not self.__doneOnce and self.__state == 3:
00125       self.__doneOnce = True
00126       print
00127       print "Can't reject the STOP_RUN transition - Should end up in STOPPED state"
00128       print
00129       return self.__state
00130
00131     # The STOP_RUN transition can not be rejected
00132
00133   def teardown(self):
00134     log.debug("userApplication.teardown()")
00135
00136     if not self.__doneOnce and self.__state == 4:
00137       self.__doneOnce = True
00138       print
00139       print "Rejecting the TEARDOWN transition - Should end up in STOPPED state"
00140       print
00141       return self.__state
00142
00143   def pause(self):
00144     log.debug("userApplication.pause()")
00145
00146     if not self.__doneOnce and self.__state == 5:
00147       self.__doneOnce = True
00148       print
00149       print "Rejecting the PAUSE transition - Should end up in RUNNING state"
00150       print
00151       return self.__state
00152
00153   def resume(self):
00154     log.debug("userApplication.resume()")
00155
00156     if not self.__doneOnce and self.__state == 6:
00157       self.__doneOnce = True
00158       print
00159       print "Rejecting the RESUME transition - Should end up in PAUSED state"
00160       print
00161       return self.__state
00162
00163     # Issue self trigger to make up for the one that was lost during PAUSE
00164     self.trigger().solicit()
00165
00166   def stop(self):
00167     log.debug("userApplication.stop()")
00168
00169     if not self.__doneOnce and self.__state == 7:
00170       self.__doneOnce = True
00171       print
00172       print "Can't reject the STOP transition - Should end up in STOPPED state"
00173       print
00174       return self.__state
00175
00176     return self.stopRun()
00177
00178
00179 # Standalone mode:
00180 if __name__ == "__main__":
00181   import os
00182   import logging as log
00183   log.basicConfig()
00184   log.getLogger("").setLevel(log.DEBUG)
00185   ua = userApplication(None, 321, 0)
00186   prefs = {'datasave': 1, 'datadir':os.path.join(os.environ['ONLINE_ROOT'],'temp')}
00187   ua.setPrefs(prefs)
00188   ua.rcSetup(os.path.join(os.environ['ONLINE_ROOT'], 'repos/simpleTemSchema.xml'))
00189   ua.rcStartRun()
00190   ua.rcStopRun()
00191   ua.rcTeardown()
00192
00193 # History:
00194 #     $Log: transitionRejectTest.py,v $
00195 #     Revision 1.1  2005/02/02 00:39:28  claus
00196 #     Test rejecting of state transition requests.
00197 #
00198 #     Revision 1.1  2004/08/23 21:04:24  claus
00199 #     Test exception handling.
00200 #
00201 #
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: Trendable.py Source File

monitoring

Trendable.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Housekeeping server infrastructure"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "07/28/04"
00014 __version__  = "$Revision: 1.2 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 class Trendable(object):
00021   def __init__(self,name,time,content={}):
00022     self.name    = name
00023     self.time    = time
00024     self.content = content
00025
00026   def __str__(self):
00027     fstring = '%s | %s' + len(self.content.keys()) * ' | %s'
00028     data    = (self.name, self.time) + tuple(self.content.values())
00029     return fstring % data
00030
00031
00032 class TrendLimit(object):
00033   def __init__(self,name,compare,limit):
00034     self.name  =name
00035     self.limit =limit
00036     if compare is 'lt':
00037       self.add = 1
00038     elif compare is 'gt':
00039       self.add = -1
00040     else:
00041       raise TypeError("Comparison should be \'lt\' or \'gt\'")
00042
00043   def check(self, value):
00044     if cmp(value, self.limit) + self.add:
00045       return 'ok'
00046     else:
00047       return self.name
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrendMaps.py Source File

monitoring

TrendMaps.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Housekeeping server infrastructure"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "07/28/04"
00014 __version__  = "$Revision: 1.9 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019 #from LATTE.monitoring.Trendable import Trendable
00020 from LATTE.database.gHSK import GHSK
00021 from LATTE.database.gLAT import GLAT
00022 from copy import deepcopy
00023
00024 class TrendMapBase(object):
00025   def __init__(self):
00026     # set up basic definition of a the LATTE housekeeping map.  Pretty much just define keys
00027     self.__map = {}
00028
00029     self.__map['LHKSPARE08']         = None      #8 bit spare tag
00030     self.__map['LHKSPARE01']         = None      #8 bit spare tag
00031     # Add direct TEM quantities
00032     for i in range(16):
00033       self.__map['LHKT%XCAL33IA'%i ] = None      # CAL 3.3 analog I
00034       self.__map['LHKT%XCAL33ID'%i ] = None      # CAL 3.3 digital I
00035       self.__map['LHKT%XCAL33VA'%i ] = None      # CAL 3.3 analog V
00036       self.__map['LHKT%XCAL33VD'%i ] = None      # CAL 3.3 digital V
00037       self.__map['LHKT%XCALBIASI'%i] = None      # CAL bias I
00038       self.__map['LHKT%XCALBIASV'%i] = None      # CAL bias V
00039       self.__map['LHKT%XTEM33I'%i  ] = None      # TEM digital 3.3 I
00040       self.__map['LHKT%XTEM33V'%i  ] = None      # TEM digital 3.3 V
00041       self.__map['LHKT%XTKR25ID'%i ] = None      # TKR digital 2.5 I
00042       self.__map['LHKT%XTKR25VD'%i ] = None      # TKR digital 2.5 V
00043       self.__map['LHKT%XTKR15IAA'%i] = None      # TKR analog A 1.5 I
00044       self.__map['LHKT%XTKR15VAA'%i] = None      # TKR analog A 1.5 V
00045       self.__map['LHKT%XTKR25IAB'%i] = None      # TKR analog B 2.5 I
00046       self.__map['LHKT%XTKR25VAB'%i] = None      # TKR analog B 2.5 V
00047       self.__map['LHKT%XTKRBIASI'%i] = None      # TKR Bias I
00048       self.__map['LHKT%XTKRBIASV'%i] = None      # TKR Bias V
00049       for j in range(4):
00050         self.__map['LHKT%XCALAF%XT0'%(i,j)] = None     # CAL AFEE T0
00051         self.__map['LHKT%XCALAF%XT1'%(i,j)] = None     # CAL AFEE T1
00052       for j in range(8):
00053         self.__map['LHKT%XTKRC%XT0'%(i,j) ] = None     # TKR CC T0
00054         self.__map['LHKT%XTKRC%XT1'%(i,j) ] = None     # TKR CC T1
00055
00056     # Add ACD FREE values to map.  12*4 + 4 = 52 values
00057     self.__map['LHKAFR33ISUM'  ] = None         # AEM DAQ board FreeI
00058     self.__map['LHKADABTEMP'   ] = None         # AEM DAQ board Temperature
00059     self.__map['LHKAFR28ISUM'  ] = None         # AEM DAQ board HVI
00060     self.__map['LHKADAB33V'    ] = None         # AEM DAQ board DAQV
00061     # self.__map['?????????????' ] = None         # AEM Common status
00062     # self.__map['?????????????' ] = None         # AEM Cable status
00063     for i in range(12):
00064       self.__map['LHKAEMFR%dT'%i ] = None       # Temperature Free board i
00065       self.__map['LHKAEMFR%dV1'%i] = None       # HV1 Free board i
00066       self.__map['LHKAEMFR%dV2'%i] = None       # HV2 Free board i
00067       self.__map['LHKAEMFR%dVD'%i] = None       # VDD Free board i
00068
00069     # Add PDU values to map.  2 pdus
00070     for p in range(2):
00071       self.__map['LHKP%dACDBGT0'%(p)] = None           # PDU ACD BEA GRID temp 0
00072       self.__map['LHKP%dACDBGT1'%(p)] = None           # PDU ACD BEA GRID temp 0
00073       self.__map['LHKP%dACDCNVT'%(p)  ] = None         # PDU ACD Power converter source
00074       self.__map['LHKP%dACDPM'%(p)    ] = None         # PDU ACD power state
00075       self.__map['LHKP%dACDPRT0'%(p)  ] = None         # PDU ACD PMT rail temp 0
00076       self.__map['LHKP%dACDPRT1'%(p)  ] = None         # PDU ACD PMT rail temp 1
00077       self.__map['LHKP%dACDPRT2'%(p)  ] = None         # PDU ACD PMT rail temp 2
00078       self.__map['LHKP%dACDPRT3'%(p)  ] = None         # PDU ACD PMT rail temp 3
00079       self.__map['LHKP%dACDPSP'%(p)   ] = None         # PDU ACD power supply source
00080       self.__map['LHKP%dACDSHT0'%(p)  ] = None         # PDU ACD Shell Temp 0
00081       self.__map['LHKP%dACDSHT1'%(p)  ] = None         # PDU ACD Shell Temp 1
00082
00083       # Add PDU Tem quants to map
00084       for i in range(16):
00085         self.__map['LHKP%dCAL%XBPT'%(p,i)] = None      # PDU CAL Baseplate temp
00086         self.__map['LHKP%dTEM%X33V'%(p,i)] = None      # PDU TEM digital 3.3v
00087         self.__map['LHKP%dTEM%XPCT'%(p,i)] = None      # PDU TEM PCB temp
00088         self.__map['LHKP%dTEM%XPM'%(p,i) ] = None      # PDU TEM power state
00089         self.__map['LHKP%dTEM%XPST'%(p,i) ] = None     # PDU TEM power supply temp
00090
00091       # PDU EPU quants
00092       for i in range(3):
00093         self.__map['LHKP%dEPU%d33V'%(p,i) ] = None     # PDU EPU digital 3.3v
00094         self.__map['LHKP%dEPU%dCNVT'%(p,i)] = None     # PDU EPU Crate power state
00095         self.__map['LHKP%dEPU%dPM'%(p,i)  ] = None     # PDU EPU Converter state
00096         self.__map['LHKP%dEPU%dT'%(p,i)   ] = None     # PDU EPU Temp
00097
00098       for i in range(12):
00099         self.__map['LHKP%dGRID%dT'%(p,i) ] = None      # PDU grid temp
00100         self.__map['LHKP%dRAD%dT'%(p,i)  ] = None      # PDU radiators temp
00101
00102       self.__map['LHKP%dRADAFHT0'%(p)] = None          # PDU Radiator afrz temp0
00103       self.__map['LHKP%dRADAFHT1'%(p)] = None          # PDU Radiator afrz temp1
00104       for i in range(4):
00105         self.__map['LHKP%dGRAD%dIFT'%(p,i)] = None     # PDU Grid-Rad Iface Temp
00106
00107       for i in range(6):
00108         self.__map['LHKP%dMHP%dDSIT'%(p,i)] = None     # PDU VCHP-DSHP interface temps
00109         self.__map['LHKP%dMHP%dRVHT'%(p,i)] = None     # PDU VCHP Reservoir temps
00110         self.__map['LHKP%dMHP%dXLIT'%(p,i)] = None     # PDU VCHP-XLHP interface temps
00111         self.__map['LHKP%dPHP%dDSIT'%(p,i)] = None     # PDU VCHP-DSHP interface temps
00112         self.__map['LHKP%dPHP%dRVHT'%(p,i)] = None     # PDU VCHP Reservoir temps
00113         self.__map['LHKP%dPHP%dXLIT'%(p,i)] = None     # PDU VCHP-XLHP interface temps
00114
00115 #     # Add EBM values to map
00116 #     self.__map['LHKEEVT']         = None               # EBM Events
00117 #     self.__map['LHKEGEMRS']       = None               # EBM GEM Receive stat
00118 #     self.__map['LHKEAEMRS']       = None               # EBM AEM Receive stat
00119 #     self.__map['LHKESIU0RS']      = None               # EBM SIU Receive stat
00120 #     self.__map['LHKESIU1RS']      = None               # EBM SIU Receive stat
00121 #     for i in range(16):
00122 #       self.__map['LHKETEM%XRS'%i] = None               # EBM TEM Receive stat
00123 #     for i in range(3):
00124 #       self.__map['LHKEEPU%XRS'%i] = None               # EBM EPU Receive stat
00125 #       self.__map['LHKEEPU%XTS'%i] = None               # EBM EPU Transmit stat
00126 #     self.__map['LHKESIU0TS']      = None               # EBM SIU Transmit stat
00127 #     self.__map['LHKESIU1TS']      = None               # EBM SIU Transmit stat
00128 #     self.__map['LHKESSRTS']       = None               # EBM SSR Transmit stat
00129
00130     # Still need HCOM, HCPU, LRS quantities
00131
00132     # Create all the "ST" status tags.
00133     kList = self.mapKeys()
00134     for key in kList:
00135       self.__map[key + 'ST'] = None
00136
00137   def mapSet(self, key, value):
00138     if self.__map.has_key(key):
00139       self.__map[key] = value
00140     else:
00141       raise KeyError("TrendMap does not contain key %s.", key)
00142
00143   def mapGet(self, key):
00144     if self.__map.has_key(key):
00145       return self.__map[key]
00146     else:
00147       raise KeyError("TrendMap does not contain key %s.", key)
00148
00149   def mapKeys(self):
00150     return self.__map.keys()
00151
00152 class GHSKTrendMap(TrendMapBase):
00153   def __init__(self, ghsk):
00154     TrendMapBase.__init__(self)
00155
00156     # Hack for null quantities
00157     hnul = ghsk.downHNUL()
00158     self.mapSet('LHKSPARE08',         (hnul, 'EMPTY')         )# Spare bits in hsk packet
00159     self.mapSet('LHKSPARE01',         (hnul, 'EMPTY')         )# Spare bits in hsk packet
00160
00161 # Add direct TEM quantities
00162     for i in range(16):
00163       htem = ghsk.downHTEM(i)
00164       if htem is None: continue
00165       # self.mapSet('LHKT%XCAL33IA'%i , (htem, 'CAL_ANALOG_I')  )# CAL 3.3 analog I
00166       # self.mapSet('LHKT%XCAL33ID'%i , (htem, 'CAL_DIGITAL_I') )# CAL 3.3 digital I
00167       self.mapSet('LHKT%XCAL33VA'%i , (htem, 'CAL_ANALOG_V')  )# CAL 3.3 analog V
00168       self.mapSet('LHKT%XCAL33VD'%i , (htem, 'CAL_DIGITAL_V') )# CAL 3.3 digital V
00169       self.mapSet('LHKT%XCALBIASI'%i, (htem, 'CAL_BIAS_I')    )# CAL bias I
00170       self.mapSet('LHKT%XCALBIASV'%i, (htem, 'CAL_BIAS_V')    )# CAL bias V
00171       self.mapSet('LHKT%XTEM33I'%i  , (htem, 'TEM_DIGITAL_I') )# TEM digital 3.3 I
00172       self.mapSet('LHKT%XTEM33V'%i  , (htem, 'TEM_DIGITAL_V') )# TEM digital 3.3 V
00173       # self.mapSet('LHKT%XTKR25ID'%i , (htem, 'TKR_DIGITAL_I') )# TKR digital 2.5 I
00174       self.mapSet('LHKT%XTKR25VD'%i , (htem, 'TKR_DIGITAL_V') )# TKR digital 2.5 V
00175       # self.mapSet('LHKT%XTKR15IAA'%i, (htem, 'TKR_ANALOGA_I') )# TKR analog A 1.5 I
00176       self.mapSet('LHKT%XTKR15VAA'%i, (htem, 'TKR_ANALOGA_V') )# TKR analog A 1.5 V
00177       # self.mapSet('LHKT%XTKR25IAB'%i, (htem, 'TKR_ANALOGB_I') )# TKR analog B 2.5 I
00178       self.mapSet('LHKT%XTKR25VAB'%i, (htem, 'TKR_ANALOGB_V') )# TKR analog B 2.5 V
00179       self.mapSet('LHKT%XTKRBIASI'%i, (htem, 'TKR_BIAS_I')    )# TKR Bias I
00180       self.mapSet('LHKT%XTKRBIASV'%i, (htem, 'TKR_BIAS_V')    )# TKR Bias V
00181       for j in range(4):
00182         self.mapSet('LHKT%XCALAF%XT0'%(i,j), (htem, 'AFEE_%d_T0'%j) )     # CAL AFEE T0
00183         self.mapSet('LHKT%XCALAF%XT1'%(i,j), (htem, 'AFEE_%d_T1'%j) )     # CAL AFEE T1
00184       for j in range(8):
00185         self.mapSet('LHKT%XTKRC%XT0'%(i,j) , (htem, 'TKR_C%d_T0'%j) )     # TKR CC T0
00186         self.mapSet('LHKT%XTKRC%XT1'%(i,j) , (htem, 'TKR_C%d_T1'%j) )     # TKR CC T1
00187
00188     # Add ACD FREE values to map.  12*4 + 4 = 52 values
00189     haem = ghsk.downHAEM()
00190     if haem is not None:
00191       self.mapSet('LHKAFR33ISUM'  , (haem, 'FreeI'       ) )         # AEM DAQ board FreeI
00192       self.mapSet('LHKADABTEMP'   , (haem, 'Temperature' ) )         # AEM DAQ board Temperature
00193       self.mapSet('LHKAFR28ISUM'  , (haem, 'HVI'         ) )         # AEM DAQ board HVI
00194       self.mapSet('LHKADAB33V'    , (haem, 'DAQV'        ) )         # AEM DAQ board DAQV
00195       # self.mapSet('?????????????' , (haem, 'CommonStatus') )       # AEM Common status
00196       # self.mapSet('?????????????' , (haem, 'CableStatus' ) )       # AEM Cable status
00197       for i in range(12):
00198         harc = haem.downHARC(i)
00199         if harc is None: continue
00200         self.mapSet('LHKAEMFR%dT'%i , (harc, 'Temperature') )       # Temperature Free board i
00201         self.mapSet('LHKAEMFR%dVD'%i, (harc, 'Vdd'        ) )       # VDD Free board i
00202         self.mapSet('LHKAEMFR%dV1'%i, (harc, 'HV1'        ) )       # HV1 Free board i
00203         self.mapSet('LHKAEMFR%dV2'%i, (harc, 'HV2'        ) )       # HV2 Free board i
00204
00205     # Add PDU values to map.  2 pdus
00206     for p in range(2):
00207       hpdu = ghsk.downHPDU(p)
00208       if hpdu is None: continue
00209       self.mapSet('LHKP%dACDBGT0'%(p), (hpdu, 'ACDBEAgridTemp0') )           # PDU ACD BEA GRID temp 0
00210       self.mapSet('LHKP%dACDBGT1'%(p), (hpdu, 'ACDBEAgridTemp1') )           # PDU ACD BEA GRID temp 0
00211       self.mapSet('LHKP%dACDCNVT'%(p)  , (hpdu, 'ACDconvTemp') )             # PDU ACD Power converter source
00212       self.mapSet('LHKP%dACDPM'%(p)    , (hpdu, 'ACDpowerState') )           # PDU ACD power state
00213       self.mapSet('LHKP%dACDPRT0'%(p)  , (hpdu, 'ACDpmtRailTemp0') )         # PDU ACD PMT rail temp 0
00214       self.mapSet('LHKP%dACDPRT1'%(p)  , (hpdu, 'ACDpmtRailTemp1') )         # PDU ACD PMT rail temp 1
00215       self.mapSet('LHKP%dACDPRT2'%(p)  , (hpdu, 'ACDpmtRailTemp2') )         # PDU ACD PMT rail temp 2
00216       self.mapSet('LHKP%dACDPRT3'%(p)  , (hpdu, 'ACDpmtRailTemp3') )         # PDU ACD PMT rail temp 3
00217       self.mapSet('LHKP%dACDPSP'%(p)   , (hpdu, 'ACDpowerSupply') )          # PDU ACD power supply source
00218       self.mapSet('LHKP%dACDSHT0'%(p)  , (hpdu, 'ACDShellTemp0') )           # PDU ACD Shell Temp 0
00219       self.mapSet('LHKP%dACDSHT1'%(p)  , (hpdu, 'ACDShellTemp1') )           # PDU ACD Shell Temp 1
00220
00221       # Add PDU Tem quants to map
00222       for i in range(16):
00223         self.mapSet('LHKP%dCAL%XBPT'%(p,i), (hpdu, 'CalBaseplateTemp%d'%i) )      # PDU CAL Baseplate temp
00224         self.mapSet('LHKP%dTEM%X33V'%(p,i), (hpdu, 'TEM%d_digital33V'%i)   )      # PDU TEM digital 3.3v
00225         self.mapSet('LHKP%dTEM%XPCT'%(p,i), (hpdu, 'TEM%d_PCBTemp'%i)      )      # PDU TEM PCB temp
00226         self.mapSet('LHKP%dTEM%XPST'%(p,i), (hpdu, 'TEM%d_PSTemp'%i)    )         # PDU TEM power supply
00227         self.mapSet('LHKP%dTEM%XPM'%(p,i) , (hpdu, 'TEM%d_powerState'%i)    )     # PDU TEM power supply
00228
00229       # PDU EPU quants
00230       for i in range(3):
00231         self.mapSet('LHKP%dEPU%d33V'%(p,i) , (hpdu, 'EPUdigitalVoltage%d'%i) )     # PDU EPU digital 3.3v
00232         self.mapSet('LHKP%dEPU%dCNVT'%(p,i), (hpdu, 'EPUCratePowerStat%d'%i) )     # PDU EPU Crate power state
00233         self.mapSet('LHKP%dEPU%dPM'%(p,i)  , (hpdu, 'EPUConverterStat%d')    )     # PDU EPU Converter state
00234         self.mapSet('LHKP%dEPU%dT'%(p,i)   , (hpdu, 'EPUTemp%d'%i)           )     # PDU EPU Temp
00235
00236       for i in range(12):
00237         self.mapSet('LHKP%dGRID%dT'%(p,i) , (hpdu, 'GridTemp%d'%i) )              # PDU grid temp
00238         self.mapSet('LHKP%dRAD%dT'%(p,i)  , (hpdu, 'RadiatorTemp%d'%i) )          # PDU radiators temp
00239
00240       self.mapSet('LHKP%dRADAFHT0'%(p), (hpdu, 'RadiatorAfrzTemp0') )             # PDU Radiator afrz temp0
00241       self.mapSet('LHKP%dRADAFHT1'%(p), (hpdu, 'RadiatorAfrzTemp1') )             # PDU Radiator afrz temp1
00242       for i in range(4):
00243         self.mapSet('LHKP%dGRAD%dIFT'%(p,i), (hpdu, 'GridRadiatorTemp%d'%i) )     # PDU Grid-Rad Iface Temp
00244
00245       for i in range(6):
00246         self.mapSet('LHKP%dMHP%dDSIT'%(p,i), (hpdu, 'VHCP_DSHP_M_Temp%d'%i) )     # PDU VCHP-DSHP interface temps
00247         self.mapSet('LHKP%dMHP%dRVHT'%(p,i), (hpdu, 'VHCPRes_M_Temp%d'%i)   )     # PDU VCHP Reservoir temps
00248         self.mapSet('LHKP%dMHP%dXLIT'%(p,i), (hpdu, 'VHCP_XLHP_M_Temp%d'%i) )     # PDU VCHP-XLHP interface temps
00249         self.mapSet('LHKP%dPHP%dDSIT'%(p,i), (hpdu, 'VHCP_DSHP_P_Temp%d'%i) )     # PDU VCHP-DSHP interface temps
00250         self.mapSet('LHKP%dPHP%dRVHT'%(p,i), (hpdu, 'VHCPRes_P_Temp%d'%i)   )     # PDU VCHP Reservoir temps
00251         self.mapSet('LHKP%dPHP%dXLIT'%(p,i), (hpdu, 'VHCP_XLHP_P_Temp%d'%i) )     # PDU VCHP-XLHP interface temps
00252
00253 #     # Add EBM values to map
00254 #     hebm = ghsk.downHEBM()
00255 #     if hebm is not None:
00256 #       self.mapSet('LHKEEVT'         , (hebm, 'Events') )               # EBM Events
00257 #       self.mapSet('LHKEGEMRS'       , (hebm, 'GEMreceive') )           # EBM GEM Receive stat
00258 #       self.mapSet('LHKEAEMRS'       , (hebm, 'AEMreceive') )           # EBM AEM Receive stat
00259 #       self.mapSet('LHKESIU0RS'      , (hebm, 'SIU0receive') )          # EBM SIU Receive stat
00260 #       self.mapSet('LHKESIU1RS'      , (hebm, 'SIU1receive') )          # EBM SIU Receive stat
00261 #       for i in range(16):
00262 #         self.mapSet('LHKETEM%XRS'%i , (hebm, 'TEM%dreceive'%i) )       # EBM TEM Receive stat
00263 #       for i in range(3):
00264 #         self.mapSet('LHKEEPU%XRS'%i , (hebm, 'EPU%dreceive'%i) )       # EBM EPU Receive stat
00265 #         self.mapSet('LHKEEPU%XTS'%i , (hebm, 'EPU%dtransmit'%i) )      # EBM EPU Transmit stat
00266 #       self.mapSet('LHKESIU0TS'      , (hebm, 'SIU0transmit') )         # EBM SIU Transmit stat
00267 #       self.mapSet('LHKESIU1TS'      , (hebm, 'SIU1transmit') )         # EBM SIU Transmit stat
00268 #       self.mapSet('LHKESSRTS'       , (hebm, 'SSRtransmit') )          # EBM SSR Transmit stat
00269
00270     # Still need HCOM, HCPU, LRS quantities
00271
00272     # Create all the "ST" status tags.
00273     kList = self.mapKeys()
00274     for key in kList:
00275       # Check the last two chars:
00276       if key[len(key)-2:] == 'ST':
00277         self.mapSet(key,            (hnul, 'EMPTY')         )# Don't put status into GHSK
00278
00279
00280 class GLATTrendMap(TrendMapBase):
00281   def __init__(self, glat):
00282     TrendMapBase.__init__(self)
00283
00284     # Add direct TEM quantities
00285     for i in range(16):
00286       gtem = glat.downTEM(i)
00287       if gtem is None: continue
00288       gtic = gtem.downTIC()
00289       # self.mapSet('LHKT%XCAL33IA'%i , (gtic, 'adc_cal_analog_3_3i')  )# CAL 3.3 analog I
00290       # self.mapSet('LHKT%XCAL33ID'%i , (gtic, 'adc_cal_digital_3_3i') )# CAL 3.3 digital I
00291       self.mapSet('LHKT%XCAL33VA'%i , (gtic, 'adc_cal_analog_3_3v')  )# CAL 3.3 analog V
00292       self.mapSet('LHKT%XCAL33VD'%i , (gtic, 'adc_cal_digital_3_3v') )# CAL 3.3 digital V
00293       self.mapSet('LHKT%XCALBIASI'%i, (gtic, 'psd_cal_bias_i')    )# CAL bias I
00294       self.mapSet('LHKT%XCALBIASV'%i, (gtic, 'adc_cal_bias_v')    )# CAL bias V
00295       self.mapSet('LHKT%XTEM33I'%i  , (gtic, 'psd_tem_i')         )# TEM digital 3.3 I
00296       self.mapSet('LHKT%XTEM33V'%i  , (gtic, 'adc_tem_digital_3_3v') )# TEM digital 3.3 V
00297       # self.mapSet('LHKT%XTKR25ID'%i , (gtic, 'adc_tkr_digital_2_5i') )# TKR digital 2.5 I
00298       self.mapSet('LHKT%XTKR25VD'%i , (gtic, 'adc_tkr_digital_2_5v') )# TKR digital 2.5 V
00299       # self.mapSet('LHKT%XTKR15IAA'%i, (gtic, 'adc_tkr_analog_a_1_5i') )# TKR analog A 1.5 I
00300       self.mapSet('LHKT%XTKR15VAA'%i, (gtic, 'adc_tkr_analog_a_1_5v') )# TKR analog A 1.5 V
00301       # self.mapSet('LHKT%XTKR25IAB'%i, (gtic, 'adc_tkr_analog_b_2_5i') )# TKR analog B 2.5 I
00302       self.mapSet('LHKT%XTKR25VAB'%i, (gtic, 'adc_tkr_analog_b_2_5v') )# TKR analog B 2.5 V
00303       self.mapSet('LHKT%XTKRBIASI'%i, (gtic, 'psd_tkr_bias_i')    )# TKR Bias I
00304       self.mapSet('LHKT%XTKRBIASV'%i, (gtic, 'adc_tkr_bias_v')    )# TKR Bias V
00305       for j in range(4):
00306         self.mapSet('LHKT%XCALAF%XT0'%(i,j), (gtic, 'adc_afee%d_t0'%j) )     # CAL AFEE T0
00307         self.mapSet('LHKT%XCALAF%XT1'%(i,j), (gtic, 'adc_afee%d_t1'%j) )     # CAL AFEE T1
00308       for j in range(8):
00309         self.mapSet('LHKT%XTKRC%XT0'%(i,j) , (gtic, 'adc_tkr_c%d_t0'%j) )     # TKR CC T0
00310         self.mapSet('LHKT%XTKRC%XT1'%(i,j) , (gtic, 'adc_tkr_c%d_t1'%j) )     # TKR CC T1
00311
00312     # Add ACD FREE values to map.  12*4 + 4 = 52 values
00313     gaem = glat.downAEM()
00314     if gaem is not None:
00315       gaeq = glat.downAEM().downAEQ()
00316       self.mapSet('LHKAFR33ISUM'  , (gaeq, 'env_dac_digital_3_3i') )         # AEM DAQ board FreeI
00317       self.mapSet('LHKADABTEMP'   , (gaeq, 'env_dac_temp'        ) )         # AEM DAQ board Temperature
00318       self.mapSet('LHKAFR28ISUM'  , (gaeq, 'env_dac_hv_i'        ) )         # AEM DAQ board HVI
00319       self.mapSet('LHKADAB33V'    , (gaeq, 'env_dac_v'           ) )         # AEM DAQ board DAQV
00320       # self.mapSet('?????????????' , (gaem, 'common_status') )       # AEM Common status
00321       # self.mapSet('?????????????' , (gaem, 'power_status' ) )       # AEM Cable status
00322       garcs = ['1la', '1rb', '2la', '2lb', '2ra', '2rb',
00323                '3la', '3rb', '4la', '4lb', '4ra', '4rb']
00324       for i in range(12):
00325         garc = gaem.downARC(i)
00326         if garc is None: continue
00327         g = garcs[i]
00328         self.mapSet('LHKAEMFR%dT'%i , (gaeq, 'env_temp_%s'%g) )       # Temperature Free board i
00329         self.mapSet('LHKAEMFR%dVD'%i, (gaeq, 'env_vdd_%s'%g ) )       # VDD Free board i
00330         self.mapSet('LHKAEMFR%dV1'%i, (gaeq, 'env_hv1_%s'%g ) )       # HV1 Free board i
00331         self.mapSet('LHKAEMFR%dV2'%i, (gaeq, 'env_hv2_%s'%g ) )       # HV2 Free board i
00332
00333     # Add GEM values to map.
00334     ggem = glat.downGEM()
00335     if ggem is not None:
00336       pass
00337
00338     # Add PDU values to map.  2 pdus
00339     for p in range(2):
00340       gpdu = glat.downPDU(p)
00341       if gpdu is None: continue
00342       gpeq = gpdu.PEQ
00343       if gpeq is None: continue
00344       self.mapSet('LHKP%dACDBGT0'%(p), (gpeq, 'acd_bea_grid_intf_t_0') )      # PDU ACD BEA GRID temp 0
00345       self.mapSet('LHKP%dACDBGT1'%(p), (gpeq, 'acd_bea_grid_intf_t_1') )      # PDU ACD BEA GRID temp 0
00346 #       self.mapSet('LHKP%dACDCNVT'%(p)  , (gpeq, 'ACDconvTemp') )            # PDU ACD Power converter source
00347 #       self.mapSet('LHKP%dACDPM'%(p)    , (gpeq, 'ACDpowerState') )          # PDU ACD power state
00348       self.mapSet('LHKP%dACDPRT0'%(p)  , (gpeq, 'acd_pmt_rail_t_0') )         # PDU ACD PMT rail temp 0
00349       self.mapSet('LHKP%dACDPRT1'%(p)  , (gpeq, 'acd_pmt_rail_t_1') )         # PDU ACD PMT rail temp 1
00350       self.mapSet('LHKP%dACDPRT2'%(p)  , (gpeq, 'acd_pmt_rail_t_2') )         # PDU ACD PMT rail temp 2
00351       self.mapSet('LHKP%dACDPRT3'%(p)  , (gpeq, 'acd_pmt_rail_t_3') )         # PDU ACD PMT rail temp 3
00352 #       self.mapSet('LHKP%dACDPSP'%(p)   , (gpeq, 'ACDpowerSupply') )         # PDU ACD power supply source
00353       self.mapSet('LHKP%dACDSHT0'%(p)  , (gpeq, 'acd_shell_t_0') )            # PDU ACD Shell Temp 0
00354       self.mapSet('LHKP%dACDSHT1'%(p)  , (gpeq, 'acd_shell_t_1') )            # PDU ACD Shell Temp 1
00355 #
00356       # Add PDU Tem quants to map
00357       for i in range(16):
00358         self.mapSet('LHKP%dCAL%XBPT'%(p,i), (gpeq, 'cal_baseplate_t_%02d'%i) ) # PDU CAL Baseplate temp
00359         self.mapSet('LHKP%dTEM%X33V'%(p,i), (gpeq, 'tem_v_%02d'%i)   )         # PDU TEM digital 3.3v
00360         self.mapSet('LHKP%dTEM%XPCT'%(p,i), (gpeq, 'tem_t_%02d'%i)      )      # PDU TEM PCB temp
00361         self.mapSet('LHKP%dTEM%XPM'%(p,i) , (gpeq, 'tem_ps_t_%02d'%i)    )     # PDU TEM power supply
00362 #
00363       # PDU EPU quants
00364       for i in range(3):
00365         self.mapSet('LHKP%dEPU%d33V'%(p,i) , (gpeq, 'epu_v_%d'%i) )             # PDU EPU digital 3.3v
00366 #         self.mapSet('LHKP%dEPU%dCNVT'%(p,i), (gpeq, 'EPUCratePowerStat%d'%i) )     # PDU EPU Crate power state
00367 #         self.mapSet('LHKP%dEPU%dPM'%(p,i)  , (gpeq, 'EPUConverterStat%d')    )     # PDU EPU Converter state
00368         self.mapSet('LHKP%dEPU%dT'%(p,i)   , (gpeq, 'epu_t_%d'%i)           )   # PDU EPU Temp
00369 #
00370       for i in range(12):
00371         self.mapSet('LHKP%dGRID%dT'%(p,i) , (gpeq, 'grid_t_%02d'%i) )          # PDU grid temp
00372 #         self.mapSet('LHKP%dRAD%dT'%(p,i)  , (gpeq, 'RadiatorTemp%d'%i) )      # PDU radiators temp
00373 #
00374 #       self.mapSet('LHKP%dRADAFHT0'%(p), (gpeq, 'RadiatorAfrzTemp0') )         # PDU Radiator afrz temp0
00375 #       self.mapSet('LHKP%dRADAFHT1'%(p), (gpeq, 'RadiatorAfrzTemp1') )         # PDU Radiator afrz temp1
00376 #      for i in range(4):
00377 #         self.mapSet('LHKP%dGRAD%dIFT'%(p,i), (gpeq, 'GridRadiatorTemp%d'%i) )     # PDU Grid-Rad Iface Temp
00378 #
00379       for i in range(6):
00380         self.mapSet('LHKP%dMHP%dDSIT'%(p,i), (gpeq, 'my_vchp_dshp_intf_t_%d'%i))     # PDU VCHP-DSHP interface temps
00381         self.mapSet('LHKP%dMHP%dRVHT'%(p,i), (gpeq, 'py_vchp_rsvr_htr_t_%d'%i) )     # PDU VCHP Reservoir temps
00382         self.mapSet('LHKP%dMHP%dXLIT'%(p,i), (gpeq, 'py_vchp_xlhp_intf_t_%d'%i))     # PDU VCHP-XLHP interface temps
00383         self.mapSet('LHKP%dPHP%dDSIT'%(p,i), (gpeq, 'py_vchp_dshp_intf_t_%d'%i))     # PDU VCHP-DSHP interface temps
00384         self.mapSet('LHKP%dPHP%dRVHT'%(p,i), (gpeq, 'py_vchp_rsvr_htr_t_%d'%i) )     # PDU VCHP Reservoir temps
00385         self.mapSet('LHKP%dPHP%dXLIT'%(p,i), (gpeq, 'py_vchp_xlhp_intf_t_%d'%i))     # PDU VCHP-XLHP interface temps
00386
00387 #     # Add EBM values to map
00388 #     gebm = glat.downEBM()
00389 #     if gebm is not None:
00390 #       gebmst = gebm.downEBMST()
00391 #       gebmc  = gebm.downEBMC()
00392 #       # self.mapSet('LHKEEVT'         , (gebmst, 'Events') )               # EBM Events
00393 #       self.mapSet('LHKEGEMRS'       , (gebmst, 'receive_gem') )               # EBM GEM Receive stat
00394 #       self.mapSet('LHKEAEMRS'       , (gebmst, 'receive_aem') )               # EBM AEM Receive stat
00395 #       self.mapSet('LHKESIU0RS'      , (gebmst, 'receive_siu0') )               # EBM SIU Receive stat
00396 #       self.mapSet('LHKESIU1RS'      , (gebmst, 'receive_siu1') )               # EBM SIU Receive stat
00397 #       for i in range(16):
00398 #         # deal with muxes in other code...
00399 #         self.mapSet('LHKETEM%XRS'%i , (gebm, 'receive_tem_mux0') )               # EBM TEM Receive stat
00400 #       for i in range(3):
00401 #         self.mapSet('LHKEEPU%XRS'%i , (gebmst, 'receive_epu%d'%i) )               # EBM EPU Receive stat
00402 #         self.mapSet('LHKEEPU%XTS'%i , (gebmst, 'transmit_epu%d'%i) )               # EBM EPU Transmit stat
00403 #       self.mapSet('LHKESIU0TS'      , (gebmst, 'transmit_siu0') )               # EBM SIU Transmit stat
00404 #       self.mapSet('LHKESIU1TS'      , (gebmst, 'transmit_siu1') )               # EBM SIU Transmit stat
00405 #       self.mapSet('LHKESSRTS'       , (gebmst, 'transmit_ssr') )               # EBM SSR Transmit stat
00406
00407
00408     # Still need HCOM, HCPU, LRS quantities
00409
00410
00411
00412 class ReverseTrendMap(TrendMapBase):
00413   """Class to create a reverse map from a TrendMap using
00414      gnodes as function ptrs such as GHSKTrendMap and GLATTrendMap
00415   """
00416   def __init__(self, startMap):
00417     TrendMapBase.__init__(self)
00418     self.__map = {}
00419     for key in startMap.mapKeys():
00420       try:
00421         node,attr = startMap.mapGet(key)
00422         nodeStr   = self.__nodeString(node)
00423         newKey    = nodeStr.upper()+attr.upper()
00424         self.__map[newKey] = key
00425       except TypeError:
00426         pass
00427
00428   def mapSet(self, key, value):
00429     if self.__map.has_key(key):
00430       self.__map[key] = value
00431     else:
00432       raise KeyError("TrendMap does not contain key %s.", key)
00433
00434   def mapGet(self, key):
00435     if self.__map.has_key(key):
00436       return self.__map[key]
00437     else:
00438       raise KeyError("TrendMap does not contain key %s.", key)
00439
00440   def mapKeys(self):
00441     return self.__map.keys()
00442
00443   def __nodeString(self, node):
00444     """Useful little recursive function to generate a string representation
00445     of a gDb-like object.
00446
00447     \param node  Any gDb-like object.  (i.e. GLAT, GHSK)
00448     Object must support getName(), up() and id() methods.
00449     """
00450     string = ''
00451     if node is not None:
00452       string += self.__nodeString(node.up())
00453       string += node.getName()
00454       if node.id() is not None:
00455         string += '[' + str(node.id()) + ']'
00456       string += '.'
00457     return string
00458
00459 def makeSimpleMap( trendables, trendMap):
00460   returnMap = {}
00461   # Add the timestamp
00462   returnMap['TimeStamp'] = trendables[0].time
00463
00464   for t in trendables:
00465     key     = t.name
00466     atuple  = trendMap.mapGet(key)
00467     # print key, atuple
00468     if atuple is not None:
00469       node, attr = atuple
00470       if node is not None:
00471         if  attr != '' and attr is not None:
00472           returnMap[t.name] = node.regs[attr.lower()].get(bypass=False)
00473           # raw = node.regs[attr.lower()].get(bypass=True)
00474         elif isinstance(node, str):
00475           returnMap[t.name] = t.content['Raw Value']
00476   return returnMap
00477
00478 if __name__ == '__main__':
00479   print "Regression test of TrendMaps"
00480   try:
00481     ghsk = GHSK(None)
00482     print "  GHSK instantiation passed"
00483   except:
00484     print "  Could not instantiate ghsk.  aborting"
00485     exit
00486
00487   try:
00488     glat = GLAT(None)
00489     print "  GLAT instantiation passed"
00490   except:
00491     print "  Could not instantiate glat.  aborting"
00492     exit
00493
00494   try:
00495     ghsk.readSchema("c:/panetta/LATTE/repos/hskTestSchema.xml")
00496     print "  GHSK readSchema passed"
00497   except Exception, e:
00498     print "  could not apply schema. Reason: %s" % e
00499
00500   try:
00501     glat.readSchema("c:/panetta/LATTE/repos/hskTestSchema.xml")
00502     print "  GLAT readSchema passed"
00503   except Exception, e:
00504     print "  could not apply schema. Reason: %s" % e
00505
00506   try:
00507     a = TrendMapBase()
00508     print "  TrendMapBase instantiation passed"
00509   except Exception, e:
00510     print "  Could not instantiate TrendMapBase.  Reason: %s" % e
00511
00512   try:
00513     b = GHSKTrendMap(ghsk)
00514     print "  GHSKTrendMap instantiation passed"
00515   except Exception, e:
00516     print "  Could not instantiate GHSKTrendMap.  Reason: %s" % e
00517
00518   try:
00519     c = GLATTrendMap(glat)
00520     print "  GLATTrendMap instantiation passed"
00521   except Exception, e:
00522     print "  Could not instantiate GLATTrendMap.  Reason: %s" % e
00523
00524   try:
00525     d = ReverseTrendMap(b)
00526     print "  ReverseTrendMap(GHSKTrendMap) instantiation passed"
00527   except Exception, e:
00528     print "  Could not instantiate   ReverseTrendMap(GHSKTrendMap).  Reason: %s" % e
00529
00530   try:
00531     e = ReverseTrendMap(c)
00532     print "  ReverseTrendMap(GLATTrendMap) instantiation passed"
00533   except Exception, e:
00534     print "  Could not instantiate ReverseTrendMap(GLATTrendMap).  Reason: %s" % e
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgAbstract.py Source File

trigger

TrgAbstract.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Coincidence based Trigger System Abstract classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 from TrgObject import TrgObject
00022
00023
00024 """TrgAbstract: Interface for Coincidence based Trigger System"""
00025
00026
00027 class TrgAbstract(TrgObject):
00028   """\brief Abstract trigger interface class definition
00029   """
00030   def __init__(self):
00031     """\brief TrgAbstract constructor
00032     """
00033     pass
00034
00035   def conditions(self):
00036     """\brief conditions 'pure virtual' method
00037
00038     \return A TrgConditionsValue object
00039     This object specifies the set of conditions to be enabled when
00040     the enable() member function is called
00041     """
00042     raise NotImplementedError
00043     pass
00044
00045   def engines(self):
00046     """\brief Engines 'pure virtual' method
00047
00048     \return A TrgEngines object
00049     This object specifies the set of engines used by the trigger
00050     """
00051     raise NotImplementedError
00052     pass
00053
00054   def sequence(self):
00055     """\brief Sequence 'pure virtual' method
00056
00057     \return A TrgSequence object
00058     This object specifies the initial sequence number definitions for the trigger
00059     """
00060     raise NotImplementedError
00061     pass
00062
00063   def inputEnables(self):
00064     """\brief Enables 'pure virtual' method
00065
00066     \return A TrgInputEnables object
00067     This object specifies the input masking definitions for the trigger
00068     """
00069     raise NotImplementedError
00070     pass
00071
00072   def version(self):
00073     """\brief Version 'pure virtual' method
00074
00075     \return An integer
00076     This value specifies (in a hardware dependent representation) the
00077     generation and revision numbers of the Trigger System.
00078     """
00079     raise NotImplementedError
00080     pass
00081
00082   def maxEngines(self):
00083     """\brief maxEngines 'pure virtual' method
00084
00085     \return An integer
00086     This value determines the maximum number of Trigger Engines
00087     supported by the Trigger System.
00088     """
00089     raise NotImplementedError
00090     pass
00091
00092   def maxConditions(self):
00093     """\brief maxConditions 'pure virtual' method
00094
00095     \return An integer
00096     This value specifies the type and number of conditions
00097     supported by the Trigger System.
00098     """
00099     raise NotImplementedError
00100     pass
00101
00102   def solicit(self):
00103     """\brief Solicit 'pure virtual' method
00104
00105     Allows the application to assert the solicited condition.
00106     Depending on the engine (or engines) associated with this
00107     condition, asserting this condition will most likely cause
00108     a readout of the detector. This function returns no value.
00109     """
00110     raise NotImplementedError
00111     pass
00112
00113   def enable(self):
00114     """\brief Enable 'pure virtual' method
00115
00116     This function returns no value.
00117
00118     Enables the trigger conditions returned by the conditions() member function.
00119     Once a condition is enabled and the
00120     condition occurs in the LAT, the Trigger Engines corresponding to
00121     the condition will fire and most likely cause a Trigger Message to
00122     be emitted by the Trigger System.
00123     """
00124     raise NotImplementedError
00125     pass
00126
00127   def disable(self):
00128     """\brief disable 'pure virtual' method
00129
00130     This function returns no value.
00131
00132     Disables the conditions returned by the conditions() member function.
00133     Once a condition is disabled, the
00134     condition will not activate the Trigger System, independent of its
00135     presence in the LAT.
00136     """
00137     raise NotImplementedError
00138     pass
00139
00140   def shut(self, marker):
00141     """\brief shut 'pure virtual' method
00142
00143     \param marker an integer representing a marker value
00144
00145     This function returns no value.
00146
00147     This function returns performs two functions:
00148     a) it disables any enabled conditions
00149     b) it solicits a trigger with a marker of the value of the input value
00150     """
00151     raise NotImplementedError
00152     pass
00153
00154
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgCmdCounters.py Source File

trigger

TrgCmdCounters.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Coincidence based Trigger System Trigger Counter classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 from TrgObject import TrgObject
00021
00022 """TrgCmdCounters: Interface for Command Response system"""
00023
00024 class TrgCmdCounters(TrgObject):
00025   """\brief TrgCmdCounters class
00026
00027      This class controls the counters associated with the commands
00028      received and the responses sent by the GEM.
00029   """
00030   def __init__(self):
00031     """\brief TrgCmdCounters constructor
00032     """
00033     TrgObject.__init__(self)
00034     pass
00035
00036   def stats(self):
00037     """\brief stats() method
00038
00039        Get the command statistics object.
00040        \return a TrgCmdStats object
00041     """
00042     raise NotImplementedError
00043     pass
00044
00045   def reset(self):
00046     """\brief reset() method
00047
00048        Reset the command counters
00049     """
00050     raise NotImplementedError
00051     pass # returns void...
00052
00053 class TrgCmdStats(TrgObject):
00054   """\brief TrgCmdStats class
00055
00056      This class specifies the statistics returned by the command counters.
00057      cf: LAT-TD-01545 section 2.3
00058   """
00059   def __init__(self):
00060     """\brief TrgCmdStats constructor
00061     """
00062     TrgObject.__init__(self)
00063     pass
00064
00065   def command(self):
00066     """\brief command() method
00067        \return an integer
00068     """
00069     raise NotImplementedError
00070     pass
00071
00072   def response(self):
00073     """\brief response() method
00074        \return an integer
00075     """
00076     raise NotImplementedError
00077     pass
00078
00079
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgCnoCounters.py Source File

trigger

TrgCnoCounters.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Coincidence based Trigger System Abstract classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 1.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 from TrgObject import TrgObject
00022
00023
00024 """TrgCnoCounters: Trigger GEM Cno counter abstract class"""
00025
00026 class TrgCnoCounters(TrgObject):
00027   """\brief TrgCnoCounters class definition
00028   This class controls the counters used to count ACD Cno transitions.
00029   """
00030   def __init__(self): # constructor...
00031     pass
00032
00033   def stats(self):
00034     """\brief stats() member function
00035     Returns the statistics object for the Cno counters
00036     \return A TrgCnoStats object
00037     """
00038     raise NotImplementedError
00039     pass # returns a TrgCnoStats object...
00040
00041   def reset(self):
00042     """\brief reset() member function
00043     Reset the Cno statistics
00044     """
00045     raise NotImplementedError
00046     pass # returns void...
00047
00048   def assignA(self, a):
00049     """\brief assignA() member function
00050     Assign the 'A' Cno counter to watch a particular Cno
00051     Immediately after counter assignment, both counters are reset.
00052     """
00053     raise NotImplementedError
00054     pass # returns void...
00055
00056   def assignB(self, B):
00057     """\brief assignB() member function
00058     Assign the 'B' Cno counter to watch a particular Cno
00059     Immediately after counter assignment, both counters are reset.
00060     """
00061     raise NotImplementedError
00062     pass # returns void...
00063
00064   def assignAB(self, a, b):
00065     """\brief assignAB() member function
00066     Assign both the 'A' and the'B' Cno counters to watch two Cnos
00067     Immediately after counter assignment, both counters are reset.
00068     """
00069     raise NotImplementedError
00070     pass # returns void...
00071
00072
00073 class TrgCnoStats(TrgObject):
00074   """\brief TrgCnoStats class definition
00075   This class specifies the statistics returned by the counters
00076   described by TrgCnoCounters.
00077   """
00078   def __init__(self): # constructor...
00079     pass
00080
00081   def A(self):
00082     """
00083     Return the statistics for the 'A' Cno counter
00084     \return an integer
00085     """
00086     raise NotImplementedError
00087     pass # returns an integer...
00088
00089   def B(self):
00090     """
00091     Return the statistics for the 'B' Cno counter
00092     \return an integer
00093     """
00094     raise NotImplementedError
00095     pass
00096
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgCoincidences.py Source File

trigger

TrgCoincidences.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Trigger Coincidence Interface: Coincidence definition classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 from TrgObject import TrgObject
00022
00023
00024 """TrgCoincidences: Interface for Trigger Coincidence classes"""
00025
00026 class TrgRois(TrgObject):
00027   """\brief Trigger ROI (Region of Interest) list class definition
00028   """
00029   def __init__(self):
00030     """\brief TrgRois constructor
00031     """
00032     pass
00033
00034   def roi(self, regionNumber):
00035     """\brief roi 'pure virtual' method
00036     Reference into the list of ROIs
00037     \param regionNumber  A region number
00038     \return A TrgRoi objece
00039     """
00040     raise NotImplementedError
00041     pass
00042
00043
00044 class TrgRoi(TrgObject):
00045   """\brief Trigger ROI (Region of Interest) class definition
00046   """
00047   def __init__(self):
00048     """\brief TrgRoi constructor
00049     """
00050     pass
00051
00052   def tile(self, tileNumber):
00053     """\brief tile 'pure virtual' method
00054
00055     \param tileNumber  A tile number
00056     \return A boolean
00057     """
00058     raise NotImplementedError
00059     pass
00060
00061
00062 class TrgCoincidences(TrgRois):
00063   """\brief Trigger Coincidences class definition
00064   """
00065   def __init__(self):
00066     """\brief TrgCoincidences constructor
00067     """
00068     TrgRois.__init__(self)
00069
00070   def coincidence(self, coincidenceNumber):
00071     """\brief coincidence 'pure virtual' method
00072     Reference into the list of coincidences.
00073     \param coincidenceNumber  A coincidence number
00074     \return A TrgCoincidence object
00075     """
00076     raise NotImplementedError
00077     pass
00078
00079
00080 class TrgCoincidence(TrgObject):
00081   """\brief Trigger Coincidence class definition
00082   This class defines the set of tiles which will constitute any one coincidence.
00083   """
00084   def __init__(self):
00085     """\brief TrgCoincidence constructor
00086     """
00087     pass
00088
00089   def inCoincidence(self, tileNumber):
00090     """\brief InCoincidence 'pure virtual' method
00091     To be satisfied by the user.
00092     \param tileNumber  A tile number [0..107]
00093     \return An integer
00094     """
00095     raise NotImplementedError
00096     pass
00097
00098
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgConditions.py Source File

trigger

TrgConditions.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Trigger Conditions Interface classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.2 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 from TrgObject import TrgObject
00022
00023 """TrgConditions: Interface for Trigger Conditions"""
00024
00025 class TrgConditions(TrgObject):
00026   """\brief Trigger Conditions Value class definition
00027   This class is used to define one combinatoric of the 128 possible conditions.
00028   """
00029   def __init__(self):
00030     """\brief TrgConditions constructor
00031     """
00032     pass
00033
00034   def roi(self):
00035     """\brief roi() 'pure virtual' method
00036
00037     Condition corresponding to a ROI trigger
00038     \return A boolean
00039     """
00040     raise NotImplementedError
00041     pass
00042
00043   def calLow(self):
00044     """\brief calLow() 'pure virtual' method
00045
00046     Condition corresponding to a calorimeter low-energy trigger
00047     \return A boolean
00048     """
00049     raise NotImplementedError
00050     pass
00051
00052   def calHigh(self):
00053     """\brief calHigh() 'pure virtual' method
00054
00055     Condition corresponding to a calorimeter high-energy trigger
00056     \return A boolean
00057     """
00058     raise NotImplementedError
00059     pass
00060
00061   def tkr(self):
00062     """\brief tkr() 'pure virtual' method
00063
00064     Condition corresponding to a tracker 'three in a row' trigger
00065     \return A boolean
00066     """
00067     raise NotImplementedError
00068     pass
00069
00070   def periodic(self):
00071     """\brief periodic() 'pure virtual' method
00072
00073     Condition corresponding to a periodic trigger
00074     \return A boolean
00075     """
00076     raise NotImplementedError
00077     pass
00078
00079   def solicited(self):
00080     """\brief solicited() 'pure virtual' method
00081
00082     Condition corresponding to a solicited trigger
00083     \return A boolean
00084     """
00085     raise NotImplementedError
00086     pass
00087
00088   def cno(self):
00089     """\brief cno() 'pure virtual' method
00090
00091     Condition corresponding to a CNO trigger
00092     \return A boolean
00093     """
00094     raise NotImplementedError
00095     pass
00096
00097   def external(self):
00098     """\brief external() 'pure virtual' method
00099
00100     Condition corresponding to an external trigger source
00101     \return A boolean
00102     """
00103     raise NotImplementedError
00104     pass
00105
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgConditionsValue.py Source File

trigger

TrgConditionsValue.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Trigger Conditions Interface classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.2 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 from TrgConditions import TrgConditions
00022
00023
00024
00025 class TrgConditionsValue(TrgConditions):
00026   """\brief Trigger Conditions Value  class definition
00027   """
00028   def __init__(self):
00029     """\brief TrgConditionsValue constructor
00030     """
00031     pass
00032
00033   def value(self):
00034     """\brief Value method
00035
00036     \return integer
00037
00038     Returns an integer corresponding to the conditionValue integer
00039             corresponding to the WINDOW_OPEN mask register of the GEM
00040             Ref: LAT-TD-01545, S 2.9.2
00041     """
00042     val = 0
00043     val |= ( self.roi()       & 0x1  )  << 0
00044     val |= ( self.tkr()       & 0x1  )  << 1
00045     val |= ( self.calLow()    & 0x1  )  << 2
00046     val |= ( self.calHigh()   & 0x1  )  << 3
00047     val |= ( self.cno()       & 0x1  )  << 4
00048     val |= ( self.periodic()  & 0x1  )  << 5
00049     val |= ( self.solicited() & 0x1  )  << 6
00050     val |= ( self.external()  & 0x1  )  << 7
00051     return val
00052
00053   ########### implementation of pure virtual methods from TrgConditions
00054   # All triggers are off by default.
00055   def roi(self):
00056     return False
00057
00058   def calLow(self):
00059     return False
00060
00061   def calHigh(self):
00062     return False
00063
00064   def tkr(self):
00065     return False
00066
00067   def periodic(self):
00068     return False
00069
00070   def solicited(self):
00071     return False
00072
00073   def cno(self):
00074     return False
00075
00076   def external(self):
00077     return False
00078
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: trgConsumer.py Source File

browser

trgConsumer.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2003
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Trigger"
00011 __abstract__ = "GLAST Trigger consumer"
00012 __author__   = "Martin Kocian"
00013 __date__     = "5/13/2005"
00014 __version__  = "$Revision: 2.7 $"
00015 __credits__  = "SLAC"
00016 import LATTE.copyright_SLAC
00017 import LDF
00018 import LATTE.consumer.standardLDF as standardLDF
00019 from LATTE.tools.DataDistributor import DataDistributorClient
00020 import struct
00021 import time
00022 import sys
00023 import getopt
00024 import array
00025 import logging as myLog
00026
00027 class trgLATcomponentIterator(LDF.LATcomponentIterator):
00028     def __init__(self):
00029         LDF.LATcomponentIterator.__init__(self)
00030         self.condsummary=None
00031         self.deltatime=None
00032         self.deltawtime=None
00033         self.condtime=None
00034         self.tkrvector=0
00035         self.roivector=0
00036         self.cnovector=0
00037         self.callowvector=0
00038         self.calhighvector=0
00039         self.triggertime=0
00040         self.ppstimebase=0
00041         self.ppsseconds=0
00042
00043     def GEMcomponent(self,event,gemContribution):
00044         self.condsummary=gemContribution.conditionSummary()&0xff
00045         #print "condsummary %x" % self.condsummary
00046         self.deltatime=gemContribution.deltaEventTime()
00047         #print "delta event time %d"% self.deltatime
00048         self.deltawtime=gemContribution.deltaWindowOpenTime()
00049         self.condtime=[31,31,31,31,31,31]
00050         self.condtime[0]=gemContribution.condArrTime().roi()
00051         self.condtime[1]=gemContribution.condArrTime().tkr()
00052         self.condtime[2]=gemContribution.condArrTime().calLE()
00053         self.condtime[3]=gemContribution.condArrTime().calHE()
00054         self.condtime[4]=gemContribution.condArrTime().cno()
00055         self.condtime[5]=gemContribution.condArrTime().external()
00056         self.roivector=gemContribution.roiVector()
00057         self.cnovector=gemContribution.cnoVector()
00058         self.tkrvector=gemContribution.tkrVector()
00059         self.callowvector=gemContribution.calLEvector()
00060         self.calhighvector=gemContribution.calHEvector()
00061         self.triggertime=gemContribution.triggerTime()
00062         self.ppstimebase=gemContribution.onePPStime().timebase()
00063         self.ppsseconds=gemContribution.onePPStime().seconds()
00064         return 0
00065
00066 class trgConsumer:
00067     def __init__(self,server,infile):
00068         self.lci       = trgLATcomponentIterator()
00069         self.eei       = standardLDF.EBFeventIterator(self.lci)
00070         self.lcti      = standardLDF.LATcontributionIterator(self.eei)
00071         self.ldbi      = LDF.LATdataBufferIterator(self.lcti)
00072         self.__ds          = None
00073         self.__file        = None
00074         self.__debug       = 0
00075         self.eventData     = None
00076         self.__inFileName  = infile
00077         self.__nEvents     = 0
00078         self.__server      = server
00079         self.__runId       = ''
00080         self.startRun      = False
00081         self.runhasstarted = False
00082         self.readlut       = True
00083         self.endRun        = False
00084         self.exit = False
00085         self.winwidth=0
00086
00087         self.conf=1
00088         self.resethistos=False
00089         self.solicited=0
00090         self.tkr=0
00091         self.callow=0
00092         self.calhigh=0
00093         self.cno=0
00094         self.roi=0
00095         self.periodic=0
00096         self.ext=0
00097         self.tkrvector=[]
00098         self.roivector=[]
00099         self.cnovector=[]
00100         self.callowvector=[]
00101         self.calhighvector=[]
00102         self.orvector=[]
00103         for i in range(16):
00104           self.tkrvector.append(0)
00105           self.roivector.append(0)
00106           self.cnovector.append(0)
00107           self.callowvector.append(0)
00108           self.calhighvector.append(0)
00109           self.orvector.append(0)
00110         self.deltatime=[]
00111         self.deltawtime=[]
00112         self.events=0
00113         self.ref=5
00114         self.roitime=[]
00115         self.tkrtime=[]
00116         self.callowtime=[]
00117         self.calhightime=[]
00118         self.cnotime=[]
00119         self.timematrix=None
00120         self.timehisto=None
00121         self.exttime=[]
00122         self.condsum=[]
00123         self.timestamp=0
00124
00125     def checkUDF(self):
00126       udfDict = self.lcti.getUdfDict()
00127       self.startRun = False
00128       if 'startRun' in udfDict:
00129         self.setRunId(udfDict['startRun'])
00130         self.startRun = True
00131       self.endRun = False
00132       if 'endRun' in udfDict:
00133         self.endRun = True
00134       self.lcti.clearUdfDict()
00135
00136     def getRunId(self):
00137       return self.__runId
00138     def setRunId(self,runId):
00139       self.__runId = runId
00140     def resetWindowData(self):
00141         self.deltatime=[]
00142         self.deltawtime=[]
00143         self.roitime=[]
00144         self.tkrtime=[]
00145         self.callowtime=[]
00146         self.calhightime=[]
00147         self.cnotime=[]
00148         self.exttime=[]
00149         self.condsum=[]
00150     def getNextEvent(self):
00151       """get Next Event into data buffer
00152       """
00153       if self.__file is not None:
00154         evtPtr = self.__file.tell()
00155         # get datagram
00156         self.eventData = self.__file.read(8)
00157         # check for file end
00158         if len(self.eventData) < 8:
00159           myLog.info("Consumer.getNextEvent: End of File")
00160           return 0
00161         # unpack pair of big-endian 4 byte words
00162         # this is presumably broken for Sun hardware
00163         (identity, length) = struct.unpack('!LL', self.eventData)
00164         self.eventData        += self.__file.read(length - 8)
00165         if self.__debug:
00166           myLog.info("got data %d length from file" % (length))
00167         return length
00168       if self.__ds is not None:
00169         self.eventData, sender = self.__ds.receive()
00170         if self.eventData is None:
00171           #print "No data from server"
00172           return 1
00173         if self.__debug:
00174           print("got data %d length from file" % len(self.eventData))
00175         return 1
00176       myLog.warn("Consumer.getNextEvent: No data source")
00177       return 0
00178     def serverOpen(self, server="1"):
00179       """  Connect to network server
00180       """
00181       myLog.info("Consumer.serverOpen: Connecting to data server %s"%(server))
00182       # Close previous data sources
00183       if self.__file is not None:
00184         self.__fileClose()
00185       if self.__ds is not None:
00186         self.serverClose()
00187       dsName = 'LAT_EBFdata'
00188       self.__ds = DataDistributorClient(dsName)
00189       if self.__ds is not None:
00190         self.__ds.connect(server)
00191         #self.__ds.start()
00192       else:
00193         myLog.warn("Consumer.serverOpen: Unable to connect to Data Distribution server %s"%(server))
00194         sys.exit(2)
00195
00196     def serverClose(self):
00197       """  Close network server
00198       """
00199       if self.__ds is not None:
00200         self.__ds.disconnect()
00201         self.__ds = None
00202     def fileOpen(self,fn):
00203       """ Load input data from a file
00204       """
00205       # Close previous data sources
00206       if self.__ds is not None:
00207         self.serverClose()
00208       if self.__file is not None:
00209         self.__fileClose()
00210       try:
00211         self.__file = open(fn, 'rb')
00212       except:
00213         myLog.warn("Consumer.fileOpen: Fatal: failed to open file %s"%(fn))
00214         sys.exit(2)
00215       myLog.info("Consumer.fileOpen: opening file %s"%(fn))
00216
00217     def fileClose(self):
00218       """ Close input data file
00219       """
00220       if self.__file is not None:
00221         self.__file.close()
00222         self.__file = None
00223       return
00224
00225     def dataSize(self):
00226       """Return current event data size
00227       """
00228       if self.eventData is not None:
00229         return len(self.eventData)
00230       else:
00231         return 0
00232
00233     def exitConsumer(self):
00234         self.exit=True
00235         self.__ds.returnNone()
00236
00237     def parseEvent(self):
00238         self.ldbi.iterate(self.eventData, len(self.eventData))
00239         self.checkUDF()
00240         if self.runhasstarted==True:
00241             self.readlut=True
00242             self.runhasstarted=False
00243         if self.startRun==True:
00244             self.resethistos=True
00245             self.resetWindowData()
00246             self.timematrix=None
00247             self.runhasstarted=True
00248         if self.lci.condsummary!=None and self.lci.deltatime!=None and self.lci.deltawtime!=None:
00249             self.events+=1
00250             self.solicited+=bool(self.lci.condsummary&0x40)
00251             self.tkr+=bool(self.lci.condsummary&0x2)
00252             self.callow+=bool(self.lci.condsummary&0x4)
00253             self.calhigh+=bool(self.lci.condsummary&0x8)
00254             self.cno+=bool(self.lci.condsummary&0x10)
00255             self.roi+=bool(self.lci.condsummary&0x1)
00256             self.ext+=bool(self.lci.condsummary&0x80)
00257             self.periodic+=bool(self.lci.condsummary&0x20)
00258             self.deltatime.append(self.lci.deltatime)
00259             self.deltawtime.append(self.lci.deltawtime)
00260             self.condsum.append(self.lci.condsummary)
00261             reftime=31
00262             reftime=self.lci.condtime[self.ref]
00263             if reftime!=31:
00264                 if self.lci.condtime[0]!=31 and self.ref!=0: self.timehisto.fill("ROI",self.lci.condtime[0]-reftime)
00265                 if self.lci.condtime[1]!=31 and self.ref!=1: self.timehisto.fill("TKR",self.lci.condtime[1]-reftime)
00266                 if self.lci.condtime[2]!=31 and self.ref!=2: self.timehisto.fill("CALlow",self.lci.condtime[2]-reftime)
00267                 if self.lci.condtime[3]!=31 and self.ref!=3: self.timehisto.fill("CALhigh",self.lci.condtime[3]-reftime)
00268                 if self.lci.condtime[4]!=31 and self.ref!=4: self.timehisto.fill("CNO",self.lci.condtime[4]-reftime)
00269                 if self.lci.condtime[5]!=31 and self.ref!=5: self.timehisto.fill("EXT",self.lci.condtime[5]-reftime)
00270             if self.timematrix==None:
00271                 self.timematrix=[]
00272                 for i in range(6):
00273                     self.timematrix.append([])
00274                     for j in range(6):
00275                         self.timematrix[i].append([])
00276                         for k in range(2*self.winwidth+1):
00277                             self.timematrix[i][j].append(0)
00278             for i in range(6):
00279                 for j in range(i+1,6):
00280                     if self.lci.condtime[i]!=31 and self.lci.condtime[j]!=31:
00281                         self.timematrix[i][j][self.winwidth+self.lci.condtime[j]-self.lci.condtime[i]]+=1
00282         orv=self.lci.callowvector|self.lci.calhighvector
00283
00284         if self.conf:
00285           orv|=self.lci.tkrvector
00286         else:
00287           orv|=(self.lci.tkrvector&~self.lci.roivector)
00288         for i in range (16):
00289           self.tkrvector[i]+=bool(self.lci.tkrvector&(1<<i))
00290           self.roivector[i]+=bool(self.lci.roivector&(1<<i))
00291           self.cnovector[i]+=bool(self.lci.cnovector&(1<<i))
00292           self.callowvector[i]+=bool(self.lci.callowvector&(1<<i))
00293           self.calhighvector[i]+=bool(self.lci.calhighvector&(1<<i))
00294           self.orvector[i]+=bool(orv&(1<<i))
00295         if self.lci.triggertime>self.lci.ppstimebase:
00296           self.timestamp=self.lci.ppsseconds+50.e-9*(self.lci.triggertime-self.lci.ppstimebase)
00297         else:
00298           self.timestamp=self.lci.ppsseconds+50.e-9*(self.lci.triggertime+33554432-self.lci.ppstimebase)
00299     def loop(self):
00300       if self.__inFileName is not None:
00301         self.fileOpen(self.__inFileName)
00302       else:
00303         self.serverOpen(self.__server)
00304       eventCount=0
00305       archivedEventCount=0
00306       sayWaiting = 0
00307       timeLastEvent = 0
00308       # self.exit is set by another thread (trgDisplayImpl)
00309       while (not self.exit):
00310         self.getNextEvent()
00311         if self.eventData is not None and self.dataSize()>0:
00312           timeLastEvent = time.time()
00313           eventCount+=1
00314           self.parseEvent()
00315           if sayWaiting==1:
00316             sayWaiting=0
00317             #print "resumed acquisition... (eventCount is ",eventCount,")"
00318         else:
00319           deltaTime = time.time() - timeLastEvent
00320           if sayWaiting==0 and deltaTime>1:
00321             sayWaiting=1
00322             #print "Waiting for data..."
00323
00324       myLog.info("Consumer: Read in %d events" % (eventCount))
00325       self.serverClose()
00326       self.fileClose()
00327     def reloadData(self):
00328         if self.timematrix==None:return
00329         for j in range(6):
00330             if j>self.ref:
00331                for k in range (2*self.winwidth+1):
00332                    if j==0:self.timehisto.setBinContent("ROI",k,self.timematrix[self.ref][j][k])
00333                    if j==1:self.timehisto.setBinContent("TKR",k,self.timematrix[self.ref][j][k])
00334                    if j==2:self.timehisto.setBinContent("CALlow",k,self.timematrix[self.ref][j][k])
00335                    if j==3:self.timehisto.setBinContent("CALhigh",k,self.timematrix[self.ref][j][k])
00336                    if j==4:self.timehisto.setBinContent("CNO",k,self.timematrix[self.ref][j][k])
00337                    if j==5:self.timehisto.setBinContent("EXT",k,self.timematrix[self.ref][j][k])
00338             elif j<self.ref:
00339                 for k in range(2*self.winwidth+1):
00340                     if j==0:self.timehisto.setBinContent("ROI",2*self.winwidth-k,self.timematrix[j][self.ref][k]),
00341                     if j==1:self.timehisto.setBinContent("TKR",2*self.winwidth-k,self.timematrix[j][self.ref][k]),
00342                     if j==2:self.timehisto.setBinContent("CALlow",2*self.winwidth-k,self.timematrix[j][self.ref][k]),
00343                     if j==3:self.timehisto.setBinContent("CALhigh",2*self.winwidth-k,self.timematrix[j][self.ref][k]),
00344                     if j==4:self.timehisto.setBinContent("CNO",2*self.winwidth-k,self.timematrix[j][self.ref][k]),
00345                     if j==5:self.timehisto.setBinContent("EXT",2*self.winwidth-k,self.timematrix[j][self.ref][k]),
00346 if __name__ == '__main__':
00347   cons = trgConsumer(sys.argv[1:])
00348   cons.loop()
00349
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: trgDisplayImpl.py Source File

browser

trgDisplayImpl.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010
00011 __facility__ = "Trigger"
00012 __abstract__ = "Trigger display implementation"
00013 __author__   = "Martin Kocian, SLAC"
00014 __date__     = ("$Date: 2005/06/15 23:42:31 $").split(' ')[1]
00015 __version__  = "$Revision: 2.17 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018
00019 import LATTE.copyright_SLAC
00020
00021 import sys
00022 from qt import *
00023 from trgDisplay import trgDisplay
00024 from towerwidgetImpl import towerwidgetImpl
00025 import time
00026 from listmean import *
00027 import logging as myLog
00028 from trgConsumer import *
00029 from imagedata import *
00030
00031 CLOCKTICK=50.e-9
00032 TIMEOUT=10.
00033 class eventThread(QThread):
00034   def __init__(self,cons):
00035     QThread.__init__(self)
00036     self.cons=cons
00037   def run(self):
00038     self.cons.loop()
00039
00040 class trgDisplayImpl(trgDisplay):
00041
00042   def __init__(self,lat,ocs,server,infile,parent = None,name = None,modal=0,fl = 0):
00043     trgDisplay.__init__(self,parent,name,modal,fl)
00044     self.cons=trgConsumer(server,infile)
00045     self.__firstresize=False
00046     self.__thewidth=0
00047     self.__theheight=0
00048     self.__solicited=0
00049     self.__tkr=0
00050     self.__callow=0
00051     self.__calhigh=0
00052     self.__cno=0
00053     self.__roi=0
00054     self.__periodic=0
00055     self.__ext=0
00056     self.timestamp=0
00057     self.timeout=0
00058     self.tkrvecold=[]
00059     self.tkrveclist=[]
00060     self.roivecold=[]
00061     self.roiveclist=[]
00062     self.cnovecold=[]
00063     self.cnoveclist=[]
00064     self.callowvecold=[]
00065     self.callowveclist=[]
00066     self.calhighvecold=[]
00067     self.calhighveclist=[]
00068     self.orvecold=[]
00069     self.orveclist=[]
00070     self.lut=[]
00071     self.englist=[]
00072     self.engnew=[]
00073     self.engold=[]
00074     for i in range(16):
00075       self.tkrvecold.append(0)
00076       self.tkrveclist.append([])
00077       self.roivecold.append(0)
00078       self.roiveclist.append([])
00079       self.cnovecold.append(0)
00080       self.cnoveclist.append([])
00081       self.callowvecold.append(0)
00082       self.callowveclist.append([])
00083       self.calhighvecold.append(0)
00084       self.calhighveclist.append([])
00085       self.orvecold.append(0)
00086       self.orveclist.append([])
00087       self.engold.append(0)
00088       self.engnew.append(0)
00089       self.englist.append([])
00090     self.__samplingrate=1000
00091     self.__ratehaschanged=False
00092     self.__numsamples=10
00093     self.__tkrlist=[]
00094     self.__callowlist=[]
00095     self.__calhighlist=[]
00096     self.__cnolist=[]
00097     self.__roilist=[]
00098     self.__periodiclist=[]
00099     self.__solicitedlist=[]
00100     self.__extlist=[]
00101     self.__consevents=0
00102     self.ref=5
00103     self.roion=False
00104     self.tkron=False
00105     self.callowon=False
00106     self.calhighon=False
00107     self.cnoon=False
00108     self.exton=False
00109     self.__lat = lat
00110     self.__ocs = ocs
00111     self.towerlist=[]
00112     for temid in range(16):
00113       tem=self.__lat.downTEM(temid)
00114       if tem==None: continue
00115       self.towerlist.append(temid)
00116     self.__oldtime=time.time()
00117     self.__timebase=lat.GEM.GEMST.timebase
00118     self.__livetime=lat.GEM.GEMST.livetime
00119     self.__discarded=lat.GEM.GEMST.discarded
00120     self.__deadzone=lat.GEM.GEMST.deadzone
00121     self.__prescaled=lat.GEM.GEMST.prescaled
00122     self.__sent=lat.GEM.GEMST.sent
00123     self.__validev=ocs.stats_valid_events
00124     self.__window=lat.GEM.GEMW.window_width
00125     self.cons.winwidth=self.__window
00126     self.cons.conf=lat.GEM.GEMC.configuration&1
00127     self.__livelist=[]
00128     self.__sentlist=[]
00129     self.__discardedlist=[]
00130     self.__prescaledlist=[]
00131     self.__deadzonelist=[]
00132     self.rate.setText("")
00133     #self.number.setProperty("value",QVariant(self.step))
00134     QObject.connect(self.samplingrate,SIGNAL("clicked(int)"),self.changeRate)
00135     QObject.connect(self.avrate,SIGNAL("clicked(int)"),self.changeSampling)
00136
00137     self.rate1.setHigh("10")
00138     self.rate10.setHigh("100")
00139     self.rate100.setHigh("1000")
00140     self.rate1.setLow("0")
00141     self.rate10.setLow("0")
00142     self.rate100.setLow("0")
00143     self.rate1.bar.setScale(10)
00144     self.rate10.bar.setScale(100)
00145     self.rate100.bar.setScale(1000)
00146     self.rate1.setTitle("")
00147     self.rate10.setTitle("")
00148     self.rate100.setTitle("")
00149     self.rate1.bar.setMinor(500)
00150     self.rate1.bar.setMajor(1000)
00151     self.rate10.bar.setMinor(500)
00152     self.rate10.bar.setMajor(1000)
00153     self.rate100.bar.setMinor(500)
00154     self.rate100.bar.setMajor(1000)
00155     self.instrate1.setHigh("10")
00156     self.instrate10.setHigh("100")
00157     self.instrate100.setHigh("1000")
00158     self.instrate1.setLow("0")
00159     self.instrate10.setLow("0")
00160     self.instrate100.setLow("0")
00161     self.instrate1.bar.setScale(10)
00162     self.instrate10.bar.setScale(100)
00163     self.instrate100.bar.setScale(1000)
00164     self.instrate1.setTitle("")
00165     self.instrate10.setTitle("")
00166     self.instrate100.setTitle("")
00167     self.instrate1.bar.setMinor(500)
00168     self.instrate1.bar.setMajor(1000)
00169     self.instrate10.bar.setMinor(500)
00170     self.instrate10.bar.setMajor(1000)
00171     self.instrate100.bar.setMinor(500)
00172     self.instrate100.bar.setMajor(1000)
00173     self.deadtime1.setHigh("1")
00174     self.deadtime10.setHigh("10")
00175     self.deadtime100.setHigh("100")
00176     self.deadtime1.setLow("0")
00177     self.deadtime10.setLow("0")
00178     self.deadtime100.setLow("0")
00179     self.deadtime1.bar.setScale(1)
00180     self.deadtime10.bar.setScale(10)
00181     self.deadtime100.bar.setScale(100)
00182     self.deadtime1.setTitle("")
00183     self.deadtime10.setTitle("")
00184     self.deadtime100.setTitle("")
00185     self.deadtime1.bar.setMinor(.5)
00186     self.deadtime1.bar.setMajor(5)
00187     self.deadtime10.bar.setMinor(.5)
00188     self.deadtime10.bar.setMajor(5)
00189     self.deadtime100.bar.setMinor(.5)
00190     self.deadtime100.bar.setMajor(5)
00191     self.deadtime.setText("")
00192     self.prescaledb.setTitle("Prescaled")
00193     self.prescaledb.setSlidingScale(1)
00194     self.discardedb.setTitle("Discarded")
00195     self.discardedb.setSlidingScale(1)
00196     self.deadzoneb.setTitle("Dead zone")
00197     self.deadzoneb.setSlidingScale(1)
00198     self.histo.setup(100,1,65536,True,True)
00199     self.histo.boxwidth=.35
00200     self.histo.addHisto("deltaetime","black",0,1)
00201     self.histo.addHisto("deltawtime","orange",1,1)
00202     self.histo.xaxislabel.setText("clock ticks (50 ns)")
00203     self.histo.histolabel[0].setText("Delta Event Time")
00204     self.histo.histolabel[1].setText("Delta Window Time")
00205     self.multibar1.setup(8)
00206     self.multibar1.setSlidingScale(1)
00207     self.multibar1.setTitle("Conditions Rates (Aver.)" )
00208     self.multibar2.setup(16,2)
00209     self.multibar2.setTitle("Tower Rates (Average)")
00210     self.multibar2.setSlidingScale(1)
00211     self.multibartower.setup(16,2)
00212     self.multibartower.setTitle("Tower Rates (Average)")
00213     self.multibartower.setSlidingScale(1)
00214     self.multibartkr.setup(16,2)
00215     self.multibartkr.setTitle("Tracker Rates (Average)")
00216     self.multibartkr.setSlidingScale(1)
00217     self.multibarcallow.setup(16,2)
00218     self.multibarcallow.setTitle("Cal low Rates (Average)")
00219     self.multibarcallow.setSlidingScale(1)
00220     self.multibarcalhigh.setup(16,2)
00221     self.multibarcalhigh.setTitle("Cal high Rates (Average)")
00222     self.multibarcalhigh.setSlidingScale(1)
00223     self.multibarroi.setup(16,2)
00224     self.multibarroi.setTitle("ROI Rates (Average)")
00225     self.multibarroi.setSlidingScale(1)
00226     self.multibarcno.setup(12,0)
00227     self.multibarcno.setTitle("CNO Rates (Average)")
00228     self.multibarcno.setSlidingScale(1)
00229     cnotitles=["1LA","1RB","2LA","2LB","2RA","2RB","3LA","3RB","4LA","4LB","4RA","4RB"]
00230     for i in range (16):
00231       self.multibar2.setBarTitle(i,str(i))
00232       self.multibartower.setBarTitle(i,str(i))
00233       self.multibartkr.setBarTitle(i,str(i))
00234       self.multibarcallow.setBarTitle(i,str(i))
00235       self.multibarcalhigh.setBarTitle(i,str(i))
00236       self.multibarroi.setBarTitle(i,str(i))
00237       if i<12:
00238         self.multibarcno.setBarTitle(i,cnotitles[i])
00239
00240     self.multibareng.setup(16,0)
00241     self.multibareng.setSlidingScale(1)
00242     self.multibareng.setTitle("")
00243     for i in range (16):
00244       self.multibareng.setBarTitle(i,str(i))
00245     self.engmeters=[]
00246     for i in range(16):
00247       self.engmeters.append(QLabel(self.tab_5,""))
00248       self.engmeters[i].setText("")
00249       self.engmeters[i].setAlignment(QLabel.AlignCenter)
00250       self.engmeters[i].setGeometry(163+i*31,250,30,12)
00251     self.prescalelabels=[]
00252     for i in range(16):
00253       self.prescalelabels.append(QLabel(self.tab_5,""))
00254       self.prescalelabels[i].setText("")
00255       self.prescalelabels[i].setAlignment(QLabel.AlignCenter)
00256       self.prescalelabels[i].setGeometry(163+i*31,120,30,12)
00257     plabel=QLabel(self.tab_5,"")
00258     plabel.setText("Prescale:")
00259     plabel.setGeometry(60,117,85,16)
00260
00261
00262     self.image0 = QPixmap(image0_data)
00263     self.image1 = QPixmap(image1_data)
00264     self.calstrobe=[]
00265     for i in range(16):
00266       self.calstrobe.append(QLabel(self.tab_5,""))
00267       self.calstrobe[i].setGeometry(168+i*31,217,14,14)
00268     cslabel=QLabel(self.tab_5,"")
00269     cslabel.setText("Calstrobe:")
00270     cslabel.setGeometry(60,217,65,16)
00271     self.tack=[]
00272     for i in range(16):
00273       self.tack.append(QLabel(self.tab_5,""))
00274       self.tack[i].setGeometry(168+i*31,197,14,14)
00275     tacklabel=QLabel(self.tab_5,"")
00276     tacklabel.setText("TACK:")
00277     tacklabel.setGeometry(60,197,65,16)
00278     self.fourrange=[]
00279     for i in range(16):
00280       self.fourrange.append(QLabel(self.tab_5,""))
00281       self.fourrange[i].setGeometry(168+i*31,177,14,14)
00282     frlabel=QLabel(self.tab_5,"")
00283     frlabel.setText("Four-range:")
00284     frlabel.setGeometry(60,177,65,16)
00285     self.zerosup=[]
00286     for i in range(16):
00287       self.zerosup.append(QLabel(self.tab_5,""))
00288       self.zerosup[i].setGeometry(168+i*31,157,14,14)
00289     zslabel=QLabel(self.tab_5,"")
00290     zslabel.setText("0 suppression:")
00291     zslabel.setGeometry(60,157,85,16)
00292     self.inhib=[]
00293     for i in range(16):
00294       self.inhib.append(QLabel(self.tab_5,""))
00295       self.inhib[i].setGeometry(168+i*31,137,14,14)
00296     illabel=QLabel(self.tab_5,"")
00297     illabel.setText("Inhibited:")
00298     illabel.setGeometry(60,137,85,16)
00299
00300     if len(self.towerlist)>0:
00301       self.radiomask1.setup(len(self.towerlist))
00302       self.radiomask2.setup(len(self.towerlist))
00303       self.radiomask1.setTitle("Display Data from Tower:")
00304       self.radiomask2.setTitle("Display Data from Tower:")
00305     for i in range(len(self.towerlist)):
00306       self.radiomask1.setLabel(i,str(self.towerlist[i]))
00307       self.radiomask2.setLabel(i,str(self.towerlist[i]))
00308     self.tower1=None
00309     self.tower2=None
00310     if len(self.towerlist)>0:
00311       self.tower1=0
00312       self.radiomask1.click(0)
00313       if len(self.towerlist)>1:
00314         self.tower2=1
00315         self.radiomask2.click(1)
00316       else:
00317         self.tower2=0
00318         self.radiomask2.click(0)
00319
00320
00321     self.maskcal11.setup(8)
00322     self.maskcalh11.setup(8)
00323     self.maskcal12.setup(8)
00324     self.maskcalh12.setup(8)
00325     self.maskcal21.setup(8)
00326     self.maskcalh21.setup(8)
00327     self.maskcal22.setup(8)
00328     self.maskcalh22.setup(8)
00329     for i in range(8):
00330       if i<4:
00331         a="x%d"%i
00332       else:
00333         a="y%d"%(i-4)
00334       self.maskcal11.setLabel(i,a)
00335       self.maskcalh11.setLabel(i,a)
00336       self.maskcal12.setLabel(i,a)
00337       self.maskcalh12.setLabel(i,a)
00338       self.maskcal21.setLabel(i,a)
00339       self.maskcalh21.setLabel(i,a)
00340       self.maskcal22.setLabel(i,a)
00341       self.maskcalh22.setLabel(i,a)
00342     self.maskcal11.setTitle("FLE")
00343     self.maskcalh11.setTitle("FHE")
00344     self.maskcal12.setTitle("FLE")
00345     self.maskcalh12.setTitle("FHE")
00346     self.barwcal11.setSlidingScale(1)
00347     self.barwcal11.bar.setMajor(100000)
00348     self.barwcal12.setSlidingScale(1)
00349     self.barwcal12.bar.setMajor(100000)
00350     self.maskcal21.setTitle("FLE")
00351     self.maskcalh21.setTitle("FHE")
00352     self.maskcal22.setTitle("FLE")
00353     self.maskcalh22.setTitle("FHE")
00354     self.barwcal21.setSlidingScale(1)
00355     self.barwcal21.bar.setMajor(100000)
00356     self.barwcal22.setSlidingScale(1)
00357     self.barwcal22.bar.setMajor(100000)
00358     self.masktkr11.setup(4)
00359     self.masktkr12.setup(4)
00360     self.masktkr13.setup(4)
00361     self.masktkr14.setup(4)
00362     for i in range(4):
00363       self.masktkr11.setLabel(i,"C%d"%i)
00364       self.masktkr12.setLabel(i,"C%d"%(i+4))
00365       self.masktkr13.setLabel(i,"C%d"%(i+8))
00366       self.masktkr14.setLabel(i,"C%d"%(i+12))
00367     self.masktkr11.setTitle("Comb")
00368     self.masktkr12.setTitle("Comb")
00369     self.masktkr13.setTitle("Comb")
00370     self.masktkr14.setTitle("Comb")
00371     self.barwtkr11.setSlidingScale(1)
00372     self.barwtkr11.bar.setMajor(100000)
00373     self.barwtkr12.setSlidingScale(1)
00374     self.barwtkr12.bar.setMajor(100000)
00375     self.barwtkr13.setSlidingScale(1)
00376     self.barwtkr13.bar.setMajor(100000)
00377     self.barwtkr14.setSlidingScale(1)
00378     self.barwtkr14.bar.setMajor(100000)
00379     self.masktkr21.setup(4)
00380     self.masktkr22.setup(4)
00381     self.masktkr23.setup(4)
00382     self.masktkr24.setup(4)
00383     for i in range(4):
00384       self.masktkr21.setLabel(i,"C%d"%i)
00385       self.masktkr22.setLabel(i,"C%d"%(i+4))
00386       self.masktkr23.setLabel(i,"C%d"%(i+8))
00387       self.masktkr24.setLabel(i,"C%d"%(i+12))
00388     self.masktkr21.setTitle("Comb")
00389     self.masktkr22.setTitle("Comb")
00390     self.masktkr23.setTitle("Comb")
00391     self.masktkr24.setTitle("Comb")
00392     self.barwtkr21.setSlidingScale(1)
00393     self.barwtkr21.bar.setMajor(100000)
00394     self.barwtkr22.setSlidingScale(1)
00395     self.barwtkr22.bar.setMajor(100000)
00396     self.barwtkr23.setSlidingScale(1)
00397     self.barwtkr23.bar.setMajor(100000)
00398     self.barwtkr24.setSlidingScale(1)
00399     self.barwtkr24.bar.setMajor(100000)
00400     self.barwtile1.setSlidingScale(1)
00401     self.barwtile1.bar.setMajor(100000)
00402     self.barwtile2.setSlidingScale(1)
00403     self.barwtile2.bar.setMajor(100000)
00404     self.barwcno1.setSlidingScale(1)
00405     self.barwcno1.bar.setMajor(100000)
00406     self.barwcno2.setSlidingScale(1)
00407     self.barwcno2.bar.setMajor(100000)
00408
00409
00410     self.calcounterlist11=[]
00411     self.calcounterlist12=[]
00412     self.calcounterlist21=[]
00413     self.calcounterlist22=[]
00414     self.tkrcounterlist11=[]
00415     self.tkrcounterlist12=[]
00416     self.tkrcounterlist13=[]
00417     self.tkrcounterlist14=[]
00418     self.tkrcounterlist21=[]
00419     self.tkrcounterlist22=[]
00420     self.tkrcounterlist23=[]
00421     self.tkrcounterlist24=[]
00422     self.tile0list=[]
00423     self.tile1list=[]
00424     self.cno0list=[]
00425     self.cno1list=[]
00426     if self.tower1 is not None:
00427       calmask=self.__lat.downTEM(self.towerlist[self.tower1]).TIC.cal_lrs_mask
00428       calmask=(~calmask)&0xffffffffL
00429       self.maskcal11.setMask(calmask&0xff)
00430       self.maskcalh11.setMask((calmask>>8)&0xff)
00431       self.maskcal12.setMask((calmask>>16)&0xff)
00432       self.maskcalh12.setMask((calmask>>24)&0xff)
00433       calcounter=self.__lat.downTEM(self.towerlist[self.tower1]).TIC.cal_lrs_counters
00434       self.calcounter11=calcounter&0xffff
00435       self.calcounter12=(calcounter>>16)&0xffff
00436       tkrmask= self.__lat.downTEM(self.towerlist[self.tower1]).TIC.tkr_out_lrs_mask
00437       tkrmask=(~tkrmask)&0xffff
00438       self.masktkr11.setMask(tkrmask&0xf)
00439       self.masktkr12.setMask((tkrmask>>4)&0xf)
00440       self.masktkr13.setMask((tkrmask>>8)&0xf)
00441       self.masktkr14.setMask((tkrmask>>12)&0xf)
00442       tkrcounter0=self.__lat.downTEM(self.towerlist[self.tower1]).TIC.tkr_lrs_counter_0
00443       tkrcounter1=self.__lat.downTEM(self.towerlist[self.tower1]).TIC.tkr_lrs_counter_1
00444       self.tkrcounter12=tkrcounter0&0xffff
00445       self.tkrcounter11=(tkrcounter0>>16)&0xffff
00446       self.tkrcounter14=tkrcounter1&0xffff
00447       self.tkrcounter13=(tkrcounter1>>16)&0xffff
00448
00449     if self.tower2 is not None:
00450       calmask=self.__lat.downTEM(self.towerlist[self.tower2]).TIC.cal_lrs_mask
00451       calmask=(~calmask)&0xffffffffL
00452       self.maskcal21.setMask(calmask&0xff)
00453       self.maskcalh21.setMask((calmask>>8)&0xff)
00454       self.maskcal22.setMask((calmask>>16)&0xff)
00455       self.maskcalh22.setMask((calmask>>24)&0xff)
00456       calcounter=self.__lat.downTEM(self.towerlist[self.tower2]).TIC.cal_lrs_counters
00457       self.calcounter21=calcounter&0xffff
00458       self.calcounter22=(calcounter>>16)&0xffff
00459       tkrmask= self.__lat.downTEM(self.towerlist[self.tower2]).TIC.tkr_out_lrs_mask
00460       tkrmask=(~tkrmask)&0xffff
00461       self.masktkr21.setMask(tkrmask&0xf)
00462       self.masktkr22.setMask((tkrmask>>4)&0xf)
00463       self.masktkr23.setMask((tkrmask>>8)&0xf)
00464       self.masktkr24.setMask((tkrmask>>12)&0xf)
00465       tkrcounter0=self.__lat.downTEM(self.towerlist[self.tower2]).TIC.tkr_lrs_counter_0
00466       tkrcounter1=self.__lat.downTEM(self.towerlist[self.tower2]).TIC.tkr_lrs_counter_1
00467       self.tkrcounter22=tkrcounter0&0xffff
00468       self.tkrcounter21=(tkrcounter0>>16)&0xffff
00469       self.tkrcounter24=tkrcounter1&0xffff
00470       self.tkrcounter23=(tkrcounter1>>16)&0xffff
00471     tile_0=self.__lat.GEM.GEMST.tile_0
00472     tile_1=self.__lat.GEM.GEMST.tile_1
00473     self.tile1.setValue(tile_0)
00474     self.tile2.setValue(tile_1)
00475     acdcounters=self.__lat.GEM.GEMST.tile_counters
00476     self.tile_0=acdcounters&0xffff
00477     self.tile_1=(acdcounters>>16)&0xffff
00478     cno_0=self.__lat.GEM.GEMST.cno_0
00479     cno_1=self.__lat.GEM.GEMST.cno_1
00480     self.cno1.setValue(cno_0)
00481     self.cno2.setValue(cno_1)
00482     acdcounters=self.__lat.GEM.GEMST.cno_counters
00483     self.cno_0=acdcounters&0xffff
00484     self.cno_1=(acdcounters>>16)&0xffff
00485     #counters saturated? reset and ignore reading
00486     self.ignoretile=False
00487     self.ignorecno=False
00488     self.ignorecal1=False
00489     self.ignoretkr11=False
00490     self.ignoretkr12=False
00491     self.ignorecal2=False
00492     self.ignoretkr21=False
00493     self.ignoretkr22=False
00494
00495     QObject.connect(self.maskcal11,PYSIGNAL("update"),self.changecalmask11)
00496     QObject.connect(self.maskcal12,PYSIGNAL("update"),self.changecalmask12)
00497     QObject.connect(self.maskcalh11,PYSIGNAL("update"),self.changecalmaskh11)
00498     QObject.connect(self.maskcalh12,PYSIGNAL("update"),self.changecalmaskh12)
00499     QObject.connect(self.maskcal21,PYSIGNAL("update"),self.changecalmask21)
00500     QObject.connect(self.maskcal22,PYSIGNAL("update"),self.changecalmask22)
00501     QObject.connect(self.maskcalh21,PYSIGNAL("update"),self.changecalmaskh21)
00502     QObject.connect(self.maskcalh22,PYSIGNAL("update"),self.changecalmaskh22)
00503     QObject.connect(self.masktkr11,PYSIGNAL("update"),self.changetkrmask11)
00504     QObject.connect(self.masktkr12,PYSIGNAL("update"),self.changetkrmask12)
00505     QObject.connect(self.masktkr13,PYSIGNAL("update"),self.changetkrmask13)
00506     QObject.connect(self.masktkr14,PYSIGNAL("update"),self.changetkrmask14)
00507     QObject.connect(self.masktkr21,PYSIGNAL("update"),self.changetkrmask21)
00508     QObject.connect(self.masktkr22,PYSIGNAL("update"),self.changetkrmask22)
00509     QObject.connect(self.masktkr23,PYSIGNAL("update"),self.changetkrmask23)
00510     QObject.connect(self.masktkr24,PYSIGNAL("update"),self.changetkrmask24)
00511     QObject.connect(self.tile1,SIGNAL("valueChanged(int)"),self.changetile1)
00512     QObject.connect(self.tile2,SIGNAL("valueChanged(int)"),self.changetile2)
00513     QObject.connect(self.cno1,SIGNAL("valueChanged(int)"),self.changecno1)
00514     QObject.connect(self.cno2,SIGNAL("valueChanged(int)"),self.changecno2)
00515     QObject.connect(self.radiomask1,PYSIGNAL("update"),self.changetower1)
00516     QObject.connect(self.radiomask2,PYSIGNAL("update"),self.changetower2)
00517     QObject.connect(self.resetcal1,SIGNAL("clicked()"),self.doresetcal1)
00518     QObject.connect(self.resetcal2,SIGNAL("clicked()"),self.doresetcal2)
00519     QObject.connect(self.resettkr11,SIGNAL("clicked()"),self.doresettkr11)
00520     QObject.connect(self.resettkr12,SIGNAL("clicked()"),self.doresettkr12)
00521     QObject.connect(self.resettkr21,SIGNAL("clicked()"),self.doresettkr21)
00522     QObject.connect(self.resettkr22,SIGNAL("clicked()"),self.doresettkr22)
00523     QObject.connect(self.resettile,SIGNAL("clicked()"),self.doresettile)
00524     QObject.connect(self.resetcno,SIGNAL("clicked()"),self.doresetcno)
00525
00526
00527     #self.multibar1.setBarTitle(0,"ROI\n ")
00528     ##self.multibar1.setBarTitle(1,"TKR\n ")
00529     #self.multibar1.setBarTitle(2,"CAL\nlow")
00530     ##self.multibar1.setBarTitle(3,"CAL\nhigh")
00531     #self.multibar1.setBarTitle(4,"CNO\n ")
00532     #self.multibar1.setBarTitle(5,"Per.\n ")
00533     #self.multibar1.setBarTitle(6,"Sol.\n ")
00534     #self.multibar1.setBarTitle(7,"EXT\n ")
00535     QObject.connect(self.logy,SIGNAL("toggled(bool)"),self.histo.setLogy)
00536     QObject.connect(self.resetlin,SIGNAL("clicked()"),self.histo.resetlin)
00537     QObject.connect(self.resetlog,SIGNAL("clicked()"),self.histo.resetlog)
00538
00539     self.timehisto.setup(2*self.__window+1,-self.__window-.5,self.__window+.5,False,False)
00540     self.cons.timehisto=self.timehisto
00541     self.timehisto.bds=10
00542     self.timehisto.boxwidth=.25
00543     self.timehisto.xaxislabel.setText("clock ticks (50 ns)")
00544     self.timehisto.addHisto("ROI","black",0,1,0)
00545     self.timehisto.setHistoLabel("ROI","ROI")
00546     self.timehisto.addHisto("TKR","blue",0,1,0)
00547     self.timehisto.setHistoLabel("TKR","TKR")
00548     self.timehisto.addHisto("CALlow","red",0,1,0)
00549     self.timehisto.setHistoLabel("CALlow","CAL low")
00550     self.timehisto.addHisto("CALhigh","orange",0,1,0)
00551     self.timehisto.setHistoLabel("CALhigh","CAL high")
00552     self.timehisto.addHisto("CNO","magenta",0,1,0)
00553     self.timehisto.setHistoLabel("CNO","CNO")
00554     self.timehisto.addHisto("EXT","green",0,1,0)
00555     self.timehisto.setHistoLabel("EXT","External")
00556     QObject.connect(self.logytime,SIGNAL("toggled(bool)"),self.timehisto.setLogy)
00557     QObject.connect(self.resettime,SIGNAL("clicked()"),self.resettimehisto)
00558     QObject.connect(self.reference,SIGNAL("clicked(int)"),self.setReference)
00559     QObject.connect(self.roitime,SIGNAL("toggled(bool)"),self.setROI)
00560     QObject.connect(self.tkrtime,SIGNAL("toggled(bool)"),self.setTKR)
00561     QObject.connect(self.callowtime,SIGNAL("toggled(bool)"),self.setCALlow)
00562     QObject.connect(self.calhightime,SIGNAL("toggled(bool)"),self.setCALhigh)
00563     QObject.connect(self.cnotime,SIGNAL("toggled(bool)"),self.setCNO)
00564     QObject.connect(self.exttime,SIGNAL("toggled(bool)"),self.setEXT)
00565
00566     self.__timer=QTimer(self)
00567     QObject.connect(self.__timer,SIGNAL("timeout()"),self.update)
00568     self.__timer.start(self.__samplingrate,False)
00569     self.consthread=eventThread(self.cons)
00570     self.consthread.start()
00571
00572     #tower tab
00573     self.towers=[]
00574     for i in self.towerlist:
00575       xcoord=i%4
00576       ycoord=i/4
00577       self.towers.append(towerwidgetImpl(self.__lat,i,self.tab_2,"tower_%d"%i))
00578       self.towers[-1].frame.setTitle("TEM %d"%i)
00579       self.towers[-1].setGeometry(10+180*xcoord,10+155*ycoord,130,150)
00580       self.towers[-1].barw.setHigh("100 %")
00581       self.towers[-1].barw.setLow("0")
00582       self.towers[-1].barw.bar.setScale(100)
00583       QObject.connect(self.__timer,SIGNAL("timeout()"),self.towers[-1].update)
00584       QObject.connect(self.avrate,SIGNAL("clicked(int)"),self.towers[-1].changeSampling)
00585
00586   def resettimehisto(self):
00587     self.timehisto.resetlin()
00588     self.cons.timematrix=None
00589   def changecalmask11(self,mask):
00590     if self.tower1 is not None:
00591       calmask=self.__lat.downTEM(self.towerlist[self.tower1]).TIC.cal_lrs_mask
00592       calmask=~calmask&0xffffffffl
00593       calmask&=0xffffff00L
00594       calmask|=mask
00595       calmask=~calmask&0xffffffffl
00596       self.__lat.downTEM(self.towerlist[self.tower1]).TIC.cal_lrs_mask=calmask
00597   def changecalmask12(self,mask):
00598     if self.tower1 is not None:
00599       calmask=self.__lat.downTEM(self.towerlist[self.tower1]).TIC.cal_lrs_mask
00600       calmask=~calmask&0xffffffffl
00601       calmask&=0xff00ffffL
00602       calmask|=mask<<16
00603       calmask=~calmask&0xffffffffl
00604       self.__lat.downTEM(self.towerlist[self.tower1]).TIC.cal_lrs_mask=calmask
00605   def changecalmaskh11(self,mask):
00606     if self.tower1 is not None:
00607       calmask=self.__lat.downTEM(self.towerlist[self.tower1]).TIC.cal_lrs_mask
00608       calmask=~calmask&0xffffffffl
00609       calmask&=0xffff00ffL
00610       calmask|=mask<<8
00611       calmask=~calmask&0xffffffffl
00612       self.__lat.downTEM(self.towerlist[self.tower1]).TIC.cal_lrs_mask=calmask
00613   def changecalmaskh12(self,mask):
00614     if self.tower1 is not None:
00615       calmask=self.__lat.downTEM(self.towerlist[self.tower1]).TIC.cal_lrs_mask
00616       calmask=~calmask&0xffffffffl
00617       calmask&=0xffffffL
00618       calmask|=mask<<24
00619       calmask=~calmask&0xffffffffl
00620       self.__lat.downTEM(self.towerlist[self.tower1]).TIC.cal_lrs_mask=calmask
00621   def changecalmask21(self,mask):
00622     if self.tower2 is not None:
00623       calmask=self.__lat.downTEM(self.towerlist[self.tower2]).TIC.cal_lrs_mask
00624       calmask=~calmask&0xffffffffl
00625       calmask&=0xffffff00L
00626       calmask|=mask
00627       calmask=~calmask&0xffffffffl
00628       self.__lat.downTEM(self.towerlist[self.tower2]).TIC.cal_lrs_mask=calmask
00629   def changecalmaskh21(self,mask):
00630     if self.tower2 is not None:
00631       calmask=self.__lat.downTEM(self.towerlist[self.tower2]).TIC.cal_lrs_mask
00632       calmask=~calmask&0xffffffffl
00633       calmask&=0xffff00ffL
00634       calmask|=mask<<8
00635       calmask=~calmask&0xffffffffl
00636       self.__lat.downTEM(self.towerlist[self.tower2]).TIC.cal_lrs_mask=calmask
00637   def changecalmask22(self,mask):
00638     if self.tower2 is not None:
00639       calmask=self.__lat.downTEM(self.towerlist[self.tower2]).TIC.cal_lrs_mask
00640       calmask=~calmask&0xffffffffl
00641       calmask&=0xff00ffffL
00642       calmask|=mask<<16
00643       calmask=~calmask&0xffffffffl
00644       self.__lat.downTEM(self.towerlist[self.tower2]).TIC.cal_lrs_mask=calmask
00645   def changecalmaskh22(self,mask):
00646     if self.tower2 is not None:
00647       calmask=self.__lat.downTEM(self.towerlist[self.tower2]).TIC.cal_lrs_mask
00648       calmask=~calmask&0xffffffffl
00649       calmask&=0xffffffL
00650       calmask|=mask<<24
00651       calmask=~calmask&0xffffffffl
00652       self.__lat.downTEM(self.towerlist[self.tower2]).TIC.cal_lrs_mask=calmask
00653   def changetkrmask11(self,mask):
00654     if self.tower1 is not None:
00655       tkrmask= self.__lat.downTEM(self.towerlist[self.tower1]).TIC.tkr_out_lrs_mask
00656       tkrmask=~tkrmask&0xffff
00657       tkrmask&=0xfff0
00658       tkrmask|=mask
00659       tkrmask=~tkrmask&0xffff
00660       self.__lat.downTEM(self.towerlist[self.tower1]).TIC.tkr_out_lrs_mask=tkrmask
00661   def changetkrmask12(self,mask):
00662     if self.tower1 is not None:
00663       tkrmask= self.__lat.downTEM(self.towerlist[self.tower1]).TIC.tkr_out_lrs_mask
00664       tkrmask=~tkrmask&0xffff
00665       tkrmask&=0xff0f
00666       tkrmask|=mask<<4
00667       tkrmask=~tkrmask&0xffff
00668       self.__lat.downTEM(self.towerlist[self.tower1]).TIC.tkr_out_lrs_mask=tkrmask
00669   def changetkrmask13(self,mask):
00670     if self.tower1 is not None:
00671       tkrmask= self.__lat.downTEM(self.towerlist[self.tower1]).TIC.tkr_out_lrs_mask
00672       tkrmask=~tkrmask&0xffff
00673       tkrmask&=0xf0ff
00674       tkrmask|=mask<<8
00675       tkrmask=~tkrmask&0xffff
00676       self.__lat.downTEM(self.towerlist[self.tower1]).TIC.tkr_out_lrs_mask=tkrmask
00677   def changetkrmask14(self,mask):
00678     if self.tower1 is not None:
00679       tkrmask= self.__lat.downTEM(self.towerlist[self.tower1]).TIC.tkr_out_lrs_mask
00680       tkrmask=~tkrmask&0xffff
00681       tkrmask&=0xfff
00682       tkrmask|=mask<<12
00683       tkrmask=~tkrmask&0xffff
00684       self.__lat.downTEM(self.towerlist[self.tower1]).TIC.tkr_out_lrs_mask=tkrmask
00685   def changetkrmask21(self,mask):
00686     if self.tower2 is not None:
00687       tkrmask= self.__lat.downTEM(self.towerlist[self.tower2]).TIC.tkr_out_lrs_mask
00688       tkrmask=~tkrmask&0xffff
00689       tkrmask&=0xfff0
00690       tkrmask|=mask
00691       tkrmask=~tkrmask&0xffff
00692       self.__lat.downTEM(self.towerlist[self.tower2]).TIC.tkr_out_lrs_mask=tkrmask
00693   def changetkrmask22(self,mask):
00694     if self.tower2 is not None:
00695       tkrmask= self.__lat.downTEM(self.towerlist[self.tower2]).TIC.tkr_out_lrs_mask
00696       tkrmask=~tkrmask&0xffff
00697       tkrmask&=0xff0f
00698       tkrmask|=mask<<4
00699       tkrmask=~tkrmask&0xffff
00700       self.__lat.downTEM(self.towerlist[self.tower2]).TIC.tkr_out_lrs_mask=tkrmask
00701   def changetkrmask23(self,mask):
00702     if self.tower2 is not None:
00703       tkrmask= self.__lat.downTEM(self.towerlist[self.tower2]).TIC.tkr_out_lrs_mask
00704       tkrmask=~tkrmask&0xffff
00705       tkrmask&=0xf0ff
00706       tkrmask|=mask<<8
00707       tkrmask=~tkrmask&0xffff
00708       self.__lat.downTEM(self.towerlist[self.tower2]).TIC.tkr_out_lrs_mask=tkrmask
00709   def changetkrmask24(self,mask):
00710     if self.tower2 is not None:
00711       tkrmask= self.__lat.downTEM(self.towerlist[self.tower2]).TIC.tkr_out_lrs_mask
00712       tkrmask=~tkrmask&0xffff
00713       tkrmask&=0xfff
00714       tkrmask|=mask<<12
00715       tkrmask=~tkrmask&0xffff
00716       self.__lat.downTEM(self.towerlist[self.tower2]).TIC.tkr_out_lrs_mask=tkrmask
00717   def changetile1(self,tile):
00718     self.__lat.GEM.GEMST.tile_0 = tile
00719
00720   def changetile2(self,tile):
00721     self.__lat.GEM.GEMST.tile_1 = tile
00722
00723   def changecno1(self,tile):
00724     self.__lat.GEM.GEMST.cno_0 = tile
00725
00726   def changecno2(self,tile):
00727     self.__lat.GEM.GEMST.cno_1 = tile
00728
00729   def changetower1(self,id):
00730     self.tower1=id
00731
00732   def changetower2(self,id):
00733     self.tower2=id
00734
00735   def doresetcal1(self):
00736     self.__lat.downTEM(self.towerlist[self.tower1]).TIC.cal_lrs_counters=0
00737     self.calcounter11=0
00738     self.calcounter12=0
00739     self.ignorecal1=True
00740     if self.tower1==self.tower2:
00741       self.__lat.downTEM(self.towerlist[self.tower2]).TIC.cal_lrs_counters=0
00742       self.calcounter21=0
00743       self.calcounter22=0
00744       self.ignorecal2=True
00745   def doresetcal2(self):
00746     self.__lat.downTEM(self.towerlist[self.tower2]).TIC.cal_lrs_counters=0
00747     self.calcounter21=0
00748     self.calcounter22=0
00749     self.ignorecal2=True
00750     if self.tower1==self.tower2:
00751       self.__lat.downTEM(self.towerlist[self.tower1]).TIC.cal_lrs_counters=0
00752       self.calcounter11=0
00753       self.calcounter12=0
00754       self.ignorecal1=True
00755   def doresettkr11(self):
00756     self.__lat.downTEM(self.towerlist[self.tower1]).TIC.tkr_lrs_counter_0=0
00757     self.tkrcounter11=0
00758     self.tkrcounter12=0
00759     self.ignoretkr11==True
00760     if self.tower1==self.tower2:
00761       self.__lat.downTEM(self.towerlist[self.tower2]).TIC.tkr_lrs_counter_0=0
00762       self.tkrcounter21=0
00763       self.tkrcounter22=0
00764       self.ignoretkr21==True
00765   def doresettkr12(self):
00766     self.__lat.downTEM(self.towerlist[self.tower1]).TIC.tkr_lrs_counter_1=0
00767     self.tkrcounter13=0
00768     self.tkrcounter14=0
00769     self.ignoretkr12==True
00770     if self.tower1==self.tower2:
00771       self.__lat.downTEM(self.towerlist[self.tower2]).TIC.tkr_lrs_counter_1=0
00772       self.tkrcounter23=0
00773       self.tkrcounter24=0
00774       self.ignoretkr22==True
00775   def doresettkr21(self):
00776     self.__lat.downTEM(self.towerlist[self.tower2]).TIC.tkr_lrs_counter_0=0
00777     self.tkrcounter21=0
00778     self.tkrcounter22=0
00779     self.ignoretkr21==True
00780     if self.tower1==self.tower2:
00781       self.__lat.downTEM(self.towerlist[self.tower1]).TIC.tkr_lrs_counter_0=0
00782       self.tkrcounter11=0
00783       self.tkrcounter12=0
00784       self.ignoretkr11==True
00785   def doresettkr22(self):
00786     self.__lat.downTEM(self.towerlist[self.tower2]).TIC.tkr_lrs_counter_1=0
00787     self.tkrcounter23=0
00788     self.tkrcounter24=0
00789     self.ignoretkr22==True
00790     if self.tower1==self.tower2:
00791       self.__lat.downTEM(self.towerlist[self.tower1]).TIC.tkr_lrs_counter_1=0
00792       self.tkrcounter13=0
00793       self.tkrcounter14=0
00794       self.ignoretkr12==True
00795   def doresettile(self):
00796     self.__lat.GEM.GEMST.tile_counters=0
00797     self.tile_0=0
00798     self.tile_1=0
00799     self.ignoretile=True
00800   def doresetcno(self):
00801     self.__lat.GEM.GEMST.cno_counters=0
00802     self.cno_0=0
00803     self.cno_1=0
00804     self.ignorecno=True
00805   def update(self):
00806     ignoreevent=False
00807
00808     # read livetime first to sample counters
00809     if self.__ratehaschanged:
00810       self.__timer.changeInterval(self.__samplingrate)
00811       self.__ratehaschanged=False
00812     newtime=time.time()
00813     timebase=self.__lat.GEM.GEMST.timebase
00814     livetime=self.__lat.GEM.GEMST.livetime
00815     sent=self.__lat.GEM.GEMST.sent
00816     validev=self.__ocs.stats_valid_events
00817     discarded=self.__lat.GEM.GEMST.discarded
00818     deadzone=self.__lat.GEM.GEMST.deadzone
00819     prescaled=self.__lat.GEM.GEMST.prescaled
00820     self.cons.conf=self.__lat.GEM.GEMC.configuration&1
00821     timestamp=self.cons.timestamp
00822     newtowerlist=[]
00823     for temid in range(16):
00824       tem=self.__lat.downTEM(temid)
00825       if tem==None: continue
00826       newtowerlist.append(temid)
00827     if newtowerlist!=self.towerlist:
00828       print "configuration has changed"
00829     tile_0=self.__lat.GEM.GEMST.tile_0
00830     tile_1=self.__lat.GEM.GEMST.tile_1
00831     if tile_0!=self.tile1.value():
00832       self.tile1.setValue(tile_0)
00833       self.tile0list=[]
00834     if tile_1!=self.tile2.value():
00835       self.tile2.setValue(tile_1)
00836       self.tile1list=[]
00837     acdcounters=self.__lat.GEM.GEMST.tile_counters
00838     tile_0=acdcounters&0xffff
00839     tile_1=(acdcounters>>16)&0xffff
00840     difftile0=tile_0-self.tile_0
00841     difftile1=tile_1-self.tile_1
00842     self.tile_0=tile_0
00843     self.tile_1=tile_1
00844     cno_0=self.__lat.GEM.GEMST.cno_0
00845     cno_1=self.__lat.GEM.GEMST.cno_1
00846     if cno_0!=self.cno1.value():
00847       self.cno1.setValue(cno_0)
00848       self.cno0list=[]
00849     if cno_1!=self.cno2.value():
00850       self.cno2.setValue(cno_1)
00851       self.cno1list=[]
00852     acdcounters=self.__lat.GEM.GEMST.cno_counters
00853     cno_0=acdcounters&0xffff
00854     cno_1=(acdcounters>>16)&0xffff
00855     diffcno0=cno_0-self.cno_0
00856     diffcno1=cno_1-self.cno_1
00857     self.cno_0=cno_0
00858     self.cno_1=cno_1
00859
00860     if self.tower1 is not None:
00861       calmask=self.__lat.downTEM(self.towerlist[self.tower1]).TIC.cal_lrs_mask
00862       calmask=(~calmask)&0xffffffffL
00863       if self.maskcal11.getMask()!=calmask&0xff:
00864         self.maskcal11.setMask(calmask&0xff)
00865         self.calcounterlist11=[]
00866       if self.maskcalh11.getMask()!=(calmask>>8)&0xff:
00867         self.maskcalh11.setMask((calmask>>8)&0xff)
00868         self.calcounterlist11=[]
00869       if self.maskcal12.getMask()!=(calmask>>16)&0xff:
00870         self.maskcal12.setMask((calmask>>16)&0xff)
00871         self.calcounterlist12=[]
00872       if self.maskcalh12.getMask()!=(calmask>>24)&0xff:
00873         self.maskcalh12.setMask((calmask>>24)&0xff)
00874         self.calcounterlist12=[]
00875       tkrmask= self.__lat.downTEM(self.towerlist[self.tower1]).TIC.tkr_out_lrs_mask
00876       tkrmask=(~tkrmask)&0xffff
00877       if self.masktkr11.getMask()!=tkrmask&0xf:
00878         self.masktkr11.setMask(tkrmask&0xf)
00879         self.tkrcounterlist11=[]
00880       if self.masktkr12.getMask()!=(tkrmask>>4)&0xf:
00881         self.masktkr12.setMask((tkrmask>>4)&0xf)
00882         self.tkrcounterlist12=[]
00883       if self.masktkr13.getMask()!=(tkrmask>>8)&0xf:
00884         self.masktkr13.setMask((tkrmask>>8)&0xf)
00885         self.tkrcounterlist13=[]
00886       if self.masktkr14.getMask()!=(tkrmask>>12)&0xf:
00887         self.masktkr14.setMask((tkrmask>>12)&0xf)
00888         self.tkrcounterlist14=[]
00889       calcounter=self.__lat.downTEM(self.towerlist[self.tower1]).TIC.cal_lrs_counters
00890       calcounter11=calcounter&0xffff
00891       calcounter12=(calcounter>>16)&0xffff
00892       tkrcounter0=self.__lat.downTEM(self.towerlist[self.tower1]).TIC.tkr_lrs_counter_0
00893       tkrcounter1=self.__lat.downTEM(self.towerlist[self.tower1]).TIC.tkr_lrs_counter_1
00894       tkrcounter12=tkrcounter0&0xffff
00895       tkrcounter11=(tkrcounter0>>16)&0xffff
00896       tkrcounter14=tkrcounter1&0xffff
00897       tkrcounter13=(tkrcounter1>>16)&0xffff
00898       diffcalcounter11=calcounter11-self.calcounter11
00899       diffcalcounter12=calcounter12-self.calcounter12
00900       self.calcounter11=calcounter11
00901       self.calcounter12=calcounter12
00902       difftkrcounter11=tkrcounter11-self.tkrcounter11
00903       difftkrcounter12=tkrcounter12-self.tkrcounter12
00904       self.tkrcounter11=tkrcounter11
00905       self.tkrcounter12=tkrcounter12
00906       difftkrcounter13=tkrcounter13-self.tkrcounter13
00907       difftkrcounter14=tkrcounter14-self.tkrcounter14
00908       self.tkrcounter13=tkrcounter13
00909       self.tkrcounter14=tkrcounter14
00910     if self.tower2 is not None:
00911       calmask=self.__lat.downTEM(self.towerlist[self.tower2]).TIC.cal_lrs_mask
00912       calmask=(~calmask)&0xffffffffL
00913       if self.maskcal21.getMask()!=calmask&0xff:
00914         self.maskcal21.setMask(calmask&0xff)
00915         self.calcounterlist21=[]
00916       if self.maskcalh21.getMask()!=(calmask>>8)&0xff:
00917         self.maskcalh21.setMask((calmask>>8)&0xff)
00918         self.calcounterlist21=[]
00919       if self.maskcal22.getMask()!=(calmask>>16)&0xff:
00920         self.maskcal22.setMask((calmask>>16)&0xff)
00921         self.calcounterlist22=[]
00922       if self.maskcalh22.getMask()!=(calmask>>24)&0xff:
00923         self.maskcalh22.setMask((calmask>>24)&0xff)
00924         self.calcounterlist22=[]
00925       tkrmask= self.__lat.downTEM(self.towerlist[self.tower2]).TIC.tkr_out_lrs_mask
00926       tkrmask=(~tkrmask)&0xffff
00927       if self.masktkr21.getMask()!=tkrmask&0xf:
00928         self.masktkr21.setMask(tkrmask&0xf)
00929         self.tkrcounterlist21=[]
00930       if self.masktkr22.getMask()!=(tkrmask>>4)&0xf:
00931         self.masktkr22.setMask((tkrmask>>4)&0xf)
00932         self.tkrcounterlist22=[]
00933       if self.masktkr23.getMask()!=(tkrmask>>8)&0xf:
00934         self.masktkr23.setMask((tkrmask>>8)&0xf)
00935         self.tkrcounterlist23=[]
00936       if self.masktkr24.getMask()!=(tkrmask>>12)&0xf:
00937         self.masktkr24.setMask((tkrmask>>12)&0xf)
00938         self.tkrcounterlist24=[]
00939       calcounter=self.__lat.downTEM(self.towerlist[self.tower2]).TIC.cal_lrs_counters
00940       calcounter21=calcounter&0xffff
00941       calcounter22=(calcounter>>16)&0xffff
00942       tkrcounter0=self.__lat.downTEM(self.towerlist[self.tower2]).TIC.tkr_lrs_counter_0
00943       tkrcounter1=self.__lat.downTEM(self.towerlist[self.tower2]).TIC.tkr_lrs_counter_1
00944       tkrcounter22=tkrcounter0&0xffff
00945       tkrcounter21=(tkrcounter0>>16)&0xffff
00946       tkrcounter24=tkrcounter1&0xffff
00947       tkrcounter23=(tkrcounter1>>16)&0xffff
00948       diffcalcounter21=calcounter21-self.calcounter21
00949       diffcalcounter22=calcounter22-self.calcounter22
00950       self.calcounter21=calcounter21
00951       self.calcounter22=calcounter22
00952       difftkrcounter21=tkrcounter21-self.tkrcounter21
00953       difftkrcounter22=tkrcounter22-self.tkrcounter22
00954       self.tkrcounter21=tkrcounter21
00955       self.tkrcounter22=tkrcounter22
00956       difftkrcounter23=tkrcounter23-self.tkrcounter23
00957       difftkrcounter24=tkrcounter24-self.tkrcounter24
00958       self.tkrcounter23=tkrcounter23
00959       self.tkrcounter24=tkrcounter24
00960
00961     if self.cons.readlut:
00962       gemsc=self.__lat.GEM.GEMSC
00963       gemmg=self.__lat.GEM.GEMMG
00964       self.cons.readlut=False
00965       self.lut=self.readlut(gemsc)
00966       validengines={}
00967       for it in self.lut.values():
00968         validengines[it]=1
00969       engines=self.getEngines(gemmg,validengines)
00970       for key in engines:
00971         if engines[key]&1<<15:self.inhib[key].setPixmap(self.image0)
00972         else:self.inhib[key].setPixmap(self.image1)
00973         if engines[key]&1<<16:self.calstrobe[key].setPixmap(self.image0)
00974         else: self.calstrobe[key].setPixmap(self.image1)
00975         if engines[key]&1<<19:self.tack[key].setPixmap(self.image0)
00976         else: self.tack[key].setPixmap(self.image1)
00977         if engines[key]&1<<20: self.fourrange[key].setPixmap(self.image0)
00978         else: self.fourrange[key].setPixmap(self.image1)
00979         if engines[key]&1<<21: self.zerosup[key].setPixmap(self.image0)
00980         else: self.zerosup[key].setPixmap(self.image1)
00981         self.prescalelabels[key].setText("%d"%(engines[key]&0xff))
00982     utimediff=newtime-self.__oldtime
00983     self.__oldtime=newtime
00984     if utimediff>1.62:
00985       ignoreevent=True
00986       myLog.debug("No update - Time between samples too long")
00987     if timebase>=self.__timebase:
00988       timediff=timebase-self.__timebase
00989     else:
00990       timediff=timebase+33554432-self.__timebase
00991     self.__timebase=timebase
00992     #if abs(timediff*CLOCKTICK/utimediff-1.) > 0.001:
00993     #  myLog.debug( "Warning! Timebase out of spec")
00994     #  myLog.debug (str(timediff/utimediff*CLOCKTICK))
00995     #  myLog.debug (str(timediff/CLOCKTICK,utimediff))
00996     if self.timestamp==0 and timestamp!=0:
00997       ignoreevent=True
00998     else:
00999       if self.timestamp<timestamp:
01000         evtimediff=timestamp-self.timestamp
01001         self.timeout=newtime
01002       elif self.timestamp==timestamp:
01003         evtimediff=0
01004       else:
01005         evtimediff=timestamp+128-self.timestamp
01006         self.timeout=newtime
01007     self.timestamp=timestamp
01008     tkr=self.cons.tkr
01009     deltatkr=tkr-self.__tkr
01010     self.__tkr=tkr
01011     callow=self.cons.callow
01012     deltacallow=callow-self.__callow
01013     self.__callow=callow
01014     calhigh=self.cons.calhigh
01015     deltacalhigh=calhigh-self.__calhigh
01016     self.__calhigh=calhigh
01017     cno=self.cons.cno
01018     deltacno=cno-self.__cno
01019     self.__cno=cno
01020     roi=self.cons.roi
01021     deltaroi=roi-self.__roi
01022     self.__roi=roi
01023     ext=self.cons.ext
01024     deltaext=ext-self.__ext
01025     self.__ext=ext
01026     periodic=self.cons.periodic
01027     deltaperiodic=periodic-self.__periodic
01028     self.__periodic=periodic
01029     solicited=self.cons.solicited
01030     deltasolicited=solicited-self.__solicited
01031     self.__solicited=solicited
01032     consevents=self.cons.events
01033     eventdiff=consevents-self.__consevents
01034     deltatkrvec=[]
01035     deltaroivec=[]
01036     deltacnovec=[]
01037     deltacallowvec=[]
01038     deltacalhighvec=[]
01039     deltaorvec=[]
01040     deltaeng=[]
01041     for i in self.cons.condsum:
01042       self.engnew[self.lut[i]]+=1
01043     for i in range (16):
01044       deltatkrvec.append(self.cons.tkrvector[i]-self.tkrvecold[i])
01045       deltaroivec.append(self.cons.roivector[i]-self.roivecold[i])
01046       deltacnovec.append(self.cons.cnovector[i]-self.cnovecold[i])
01047       deltacallowvec.append(self.cons.callowvector[i]-self.callowvecold[i])
01048       deltacalhighvec.append(self.cons.calhighvector[i]-self.calhighvecold[i])
01049       deltaorvec.append(self.cons.orvector[i]-self.orvecold[i])
01050       deltaeng.append(self.engnew[i]-self.engold[i])
01051     self.tkrvecold=list(self.cons.tkrvector)
01052     self.callowvecold=list(self.cons.callowvector)
01053     self.calhighvecold=list(self.cons.calhighvector)
01054     self.roivecold=list(self.cons.roivector)
01055     self.cnovecold=list(self.cons.cnovector)
01056     self.orvecold=list(self.cons.orvector)
01057     self.engold=list(self.engnew)
01058     self.__consevents=consevents
01059
01060     if sent>=self.__sent:
01061       sentdiff=sent-self.__sent
01062     else:
01063       sentdiff=sent+65536-self.__sent
01064       ignoreevent=True
01065     self.__sent=sent
01066     validevdiff=validev-self.__validev
01067     self.__validev=validev
01068
01069     if livetime>=self.__livetime:
01070       livediff=livetime-self.__livetime
01071     else:
01072       livediff=livetime+33554432-self.__livetime
01073     self.__livetime=livetime
01074
01075     if discarded >=self.__discarded:
01076       discdiff=discarded-self.__discarded
01077     else:
01078       discdiff=discarded+16777216-self.__discarded
01079     self.__discarded=discarded
01080
01081     if prescaled>=self.__prescaled:
01082       prescalediff=prescaled-self.__prescaled
01083     else:
01084       prescalediff=prescaled+16777216-self.__prescaled
01085     self.__prescaled=prescaled
01086
01087     if deadzone>=self.__deadzone:
01088       deadzonediff=deadzone-self.__deadzone
01089     else:
01090       deadzonediff=deadzone+65536-self.__deadzone
01091     self.__deadzone=deadzone
01092
01093     if ignoreevent==False:
01094       diff=0.
01095       #rate
01096       instdiff=0.
01097       if utimediff>0:
01098         diff=listmean(self.__sentlist,float(sentdiff)/utimediff,self.__numsamples)
01099         instdiff=float(sentdiff)/utimediff
01100       self.rate.setText("%.1f Hz"%diff)
01101       self.rate1.bar.displayValue(diff)
01102       self.rate10.bar.displayValue(diff)
01103       self.rate100.bar.displayValue(diff)
01104       self.instrate.setText("%.0f Hz"%instdiff)
01105       self.instrate1.bar.displayValue(instdiff)
01106       self.instrate10.bar.displayValue(instdiff)
01107       self.instrate100.bar.displayValue(instdiff)
01108       # Dead time
01109       deadtime=0.
01110       if utimediff>0:
01111         deadtime=100.*(utimediff/CLOCKTICK-livediff)/utimediff*CLOCKTICK
01112       diff=listmean(self.__livelist,deadtime,self.__numsamples)
01113       if diff<0:diff=0.
01114       self.deadtime.setText("%.2f" % diff+" %")
01115       self.deadtime1.bar.displayValue(diff)
01116       self.deadtime10.bar.displayValue(diff)
01117       self.deadtime100.bar.displayValue(diff)
01118       # Discarded
01119       diff=0.
01120       if utimediff>0.:
01121         diff=listmean(self.__discardedlist,float(discdiff)/utimediff,self.__numsamples)
01122       self.discarded.setText("%.1f Hz"%diff)
01123       self.discardedb.displaySlidingScaleValue(diff)
01124       #Dead zone
01125       diff=0.
01126       if utimediff>0:
01127         diff=listmean(self.__deadzonelist,float(deadzonediff)/utimediff,self.__numsamples)
01128       self.deadzone.setText("%.1f Hz"%diff)
01129       self.deadzoneb.displaySlidingScaleValue(diff)
01130       # Prescaled
01131       diff=0.
01132       if utimediff>0:
01133         diff=listmean(self.__prescaledlist,float(prescalediff)/utimediff,self.__numsamples)
01134       self.prescaled.setText("%.1f Hz"%diff)
01135       self.prescaledb.displaySlidingScaleValue(diff)
01136       #counters
01137       diff=0.
01138       if tile_0==0xffff:
01139         self.barwtile1.setTitle("Full")
01140         self.barwtile1.bar.displayValue(100001)
01141       elif utimediff>0 and not self.ignoretile:
01142         diff=listmean(self.tile0list,float(difftile0)/utimediff,self.__numsamples)
01143       self.barwtile1.setTitle("%d"%(diff+.5))
01144       self.barwtile2.displaySlidingScaleValue(diff)
01145       diff=0.
01146       if tile_1==0xffff:
01147         self.barwtile2.setTitle("Full")
01148         self.barwtile2.bar.displayValue(100001)
01149       elif utimediff>0 and not self.ignoretile:
01150         diff=listmean(self.tile1list,float(difftile1)/utimediff,self.__numsamples)
01151       self.barwtile2.setTitle("%d"%(diff+.5))
01152       self.barwtile2.displaySlidingScaleValue(diff)
01153       diff=0.
01154       if cno_0==0xffff:
01155         self.barwcno1.setTitle("Full")
01156         self.barwcno1.bar.displayValue(100001)
01157       elif utimediff>0 and not self.ignorecno:
01158         diff=listmean(self.cno0list,float(diffcno0)/utimediff,self.__numsamples)
01159       self.barwcno1.setTitle("%d"%(diff+.5))
01160       self.barwcno2.displaySlidingScaleValue(diff)
01161       diff=0.
01162       if cno_1==0xffff:
01163         self.barwcno2.setTitle("Full")
01164         self.barwcno2.bar.displayValue(100001)
01165       elif utimediff>0 and not self.ignorecno:
01166         diff=listmean(self.cno1list,float(diffcno1)/utimediff,self.__numsamples)
01167       self.barwcno2.setTitle("%d"%(diff+.5))
01168       self.barwcno2.displaySlidingScaleValue(diff)
01169       if self.tower1 is not None:
01170         diff=0.
01171         if calcounter11==0xffff:
01172           self.barwcal11.setTitle("Full")
01173           self.barwcal11.bar.displayValue(100001)
01174         elif utimediff>0 and not self.ignorecal1:
01175           diff=listmean(self.calcounterlist11,float(diffcalcounter11)/utimediff,self.__numsamples)
01176           self.barwcal11.setTitle("%d"%(diff+.5))
01177           self.barwcal11.displaySlidingScaleValue(diff)
01178         diff=0.
01179         if calcounter12==0xffff:
01180           self.barwcal12.setTitle("Full")
01181           self.barwcal12.bar.displayValue(100001)
01182         elif utimediff>0 and not self.ignorecal1:
01183           diff=listmean(self.calcounterlist12,float(diffcalcounter12)/utimediff,self.__numsamples)
01184           self.barwcal12.setTitle("%d"%(diff+.5))
01185           self.barwcal12.displaySlidingScaleValue(diff)
01186         diff=0.
01187         if tkrcounter11==0xffff:
01188           self.barwtkr11.setTitle("Full")
01189           self.barwtkr11.bar.displayValue(100001)
01190         elif utimediff>0 and not self.ignoretkr11:
01191           diff=listmean(self.tkrcounterlist11,float(difftkrcounter11)/utimediff,self.__numsamples)
01192           self.barwtkr11.setTitle("%d"%(diff+.5))
01193           self.barwtkr11.displaySlidingScaleValue(diff)
01194         diff=0.
01195         if tkrcounter12==0xffff:
01196           self.barwtkr12.setTitle("Full")
01197           self.barwtkr12.bar.displayValue(100001)
01198         elif utimediff>0 and not self.ignoretkr11:
01199           diff=listmean(self.tkrcounterlist12,float(difftkrcounter12)/utimediff,self.__numsamples)
01200           self.barwtkr12.setTitle("%d"%(diff+.5))
01201           self.barwtkr12.displaySlidingScaleValue(diff)
01202         diff=0.
01203         if tkrcounter13==0xffff:
01204           self.barwtkr13.setTitle("Full")
01205           self.barwtkr13.bar.displayValue(100001)
01206         elif utimediff>0 and not self.ignoretkr12:
01207           diff=listmean(self.tkrcounterlist13,float(difftkrcounter13)/utimediff,self.__numsamples)
01208           self.barwtkr13.setTitle("%d"%(diff+.5))
01209           self.barwtkr13.displaySlidingScaleValue(diff)
01210         diff=0.
01211         if tkrcounter14==0xffff:
01212           self.barwtkr14.setTitle("Full")
01213           self.barwtkr14.bar.displayValue(100001)
01214         elif utimediff>0 and not self.ignoretkr12:
01215           diff=listmean(self.tkrcounterlist14,float(difftkrcounter14)/utimediff,self.__numsamples)
01216           self.barwtkr14.setTitle("%d"%(diff+.5))
01217           self.barwtkr14.displaySlidingScaleValue(diff)
01218       if self.tower2 is not None:
01219         diff=0.
01220         if calcounter21==0xffff:
01221           self.barwcal21.setTitle("Full")
01222           self.barwcal21.bar.displayValue(100001)
01223         elif utimediff>0 and not self.ignorecal2:
01224           diff=listmean(self.calcounterlist21,float(diffcalcounter21)/utimediff,self.__numsamples)
01225           self.barwcal21.setTitle("%d"%(diff+.5))
01226           self.barwcal21.displaySlidingScaleValue(diff)
01227         diff=0.
01228         if calcounter22==0xffff:
01229           self.barwcal22.setTitle("Full")
01230           self.barwcal22.bar.displayValue(100001)
01231         elif utimediff>0 and not self.ignorecal2:
01232           diff=listmean(self.calcounterlist22,float(diffcalcounter22)/utimediff,self.__numsamples)
01233           self.barwcal22.setTitle("%d"%(diff+.5))
01234           self.barwcal22.displaySlidingScaleValue(diff)
01235         diff=0.
01236         if tkrcounter21==0xffff:
01237           self.barwtkr21.setTitle("Full")
01238           self.barwtkr21.bar.displayValue(100001)
01239         elif utimediff>0 and not self.ignoretkr21:
01240           diff=listmean(self.tkrcounterlist21,float(difftkrcounter21)/utimediff,self.__numsamples)
01241           self.barwtkr21.setTitle("%d"%(diff+.5))
01242           self.barwtkr21.displaySlidingScaleValue(diff)
01243         diff=0.
01244         if tkrcounter22==0xffff:
01245           self.barwtkr22.setTitle("Full")
01246           self.barwtkr22.bar.displayValue(100001)
01247         elif utimediff>0 and not self.ignoretkr21:
01248           diff=listmean(self.tkrcounterlist22,float(difftkrcounter22)/utimediff,self.__numsamples)
01249           self.barwtkr22.setTitle("%d"%(diff+.5))
01250           self.barwtkr22.displaySlidingScaleValue(diff)
01251         diff=0.
01252         if tkrcounter23==0xffff:
01253           self.barwtkr23.setTitle("Full")
01254           self.barwtkr23.bar.displayValue(100001)
01255         elif utimediff>0 and not self.ignoretkr22:
01256           diff=listmean(self.tkrcounterlist23,float(difftkrcounter23)/utimediff,self.__numsamples)
01257           self.barwtkr23.setTitle("%d"%(diff+.5))
01258           self.barwtkr23.displaySlidingScaleValue(diff)
01259         diff=0.
01260         if tkrcounter24==0xffff:
01261           self.barwtkr24.setTitle("Full")
01262           self.barwtkr24.bar.displayValue(100001)
01263         elif utimediff>0 and not self.ignoretkr22:
01264           diff=listmean(self.tkrcounterlist24,float(difftkrcounter24)/utimediff,self.__numsamples)
01265           self.barwtkr24.setTitle("%d"%(diff+.5))
01266           self.barwtkr24.displaySlidingScaleValue(diff)
01267
01268       self.ignoretile=False
01269       self.ignorecno=False
01270       self.ignorecal1=False
01271       self.ignoretkr11=False
01272       self.ignoretkr12=False
01273       self.ignorecal2=False
01274       self.ignoretkr21=False
01275       self.ignoretkr22=False
01276
01277       if eventdiff>0:
01278         factor2=float(sentdiff)/float(eventdiff)
01279       factor=0.
01280       if eventdiff>0:
01281         factor=float(validevdiff)/float(eventdiff)
01282         diff=0.
01283       factor=1.
01284       if evtimediff>0:
01285         diff=listmean(self.__tkrlist,float(deltatkr)/evtimediff*factor,self.__numsamples)
01286         self.multibar1.displaySlidingScaleValue(1,diff)
01287         self.multibar1.setBarTitle(1,"%d"%(diff+.5))
01288         diff=listmean(self.__callowlist,float(deltacallow)/evtimediff*factor,self.__numsamples)
01289         self.multibar1.displaySlidingScaleValue(2,diff)
01290         self.multibar1.setBarTitle(2,"%d"%(diff+.5))
01291         diff=listmean(self.__calhighlist,float(deltacalhigh)/evtimediff*factor,self.__numsamples)
01292         self.multibar1.displaySlidingScaleValue(3,diff)
01293         self.multibar1.setBarTitle(3,"%d"%(diff+.5))
01294         diff=listmean(self.__roilist,float(deltaroi)/evtimediff*factor,self.__numsamples)
01295         self.multibar1.displaySlidingScaleValue(0,diff)
01296         self.multibar1.setBarTitle(0,"%d"%(diff+.5))
01297         diff=listmean(self.__cnolist,float(deltacno)/evtimediff*factor,self.__numsamples)
01298         self.multibar1.displaySlidingScaleValue(4,diff)
01299         self.multibar1.setBarTitle(4,"%d"%(diff+.5))
01300         diff=listmean(self.__periodiclist,float(deltaperiodic)/evtimediff*factor,self.__numsamples)
01301         self.multibar1.displaySlidingScaleValue(5,diff)
01302         self.multibar1.setBarTitle(5,"%d"%(diff+.5))
01303         diff=listmean(self.__solicitedlist,float(deltasolicited)/evtimediff*factor,self.__numsamples)
01304         self.multibar1.displaySlidingScaleValue(6,diff)
01305         self.multibar1.setBarTitle(6,"%d"%(diff+.5))
01306         diff=listmean(self.__extlist,float(deltaext)/evtimediff*factor,self.__numsamples)
01307         self.multibar1.displaySlidingScaleValue(7,diff)
01308         self.multibar1.setBarTitle(7,"%d"%(diff+.5))
01309         diff0=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
01310         diff1=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
01311         diff2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
01312         diff3=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
01313         diff4=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
01314         diff5=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
01315         diff6=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
01316         for i in range(16):
01317           diff0[i]=listmean(self.tkrveclist[i],float(deltatkrvec[i])/evtimediff*factor,self.__numsamples)
01318           diff1[i]=listmean(self.roiveclist[i],float(deltaroivec[i])/evtimediff*factor,self.__numsamples)
01319           diff5[i]=listmean(self.cnoveclist[i],float(deltacnovec[i])/evtimediff*factor,self.__numsamples)
01320           diff2[i]=listmean(self.callowveclist[i],float(deltacallowvec[i])/evtimediff*factor,self.__numsamples)
01321           diff3[i]=listmean(self.calhighveclist[i],float(deltacalhighvec[i])/evtimediff*factor,self.__numsamples)
01322           diff4[i]=listmean(self.orveclist[i],float(deltaorvec[i])/evtimediff*factor,self.__numsamples)
01323           diff6[i]=listmean(self.englist[i],float(deltaeng[i])/evtimediff*factor,self.__numsamples)
01324           self.multibar2.displaySlidingScaleValue(i,diff4[i])
01325           self.multibartower.displaySlidingScaleValue(i,diff4[i])
01326           self.multibartkr.displaySlidingScaleValue(i,diff0[i])
01327           self.multibarcallow.displaySlidingScaleValue(i,diff2[i])
01328           self.multibarcalhigh.displaySlidingScaleValue(i,diff3[i])
01329           self.multibarroi.displaySlidingScaleValue(i,diff1[i])
01330           if i < 12:
01331             self.multibarcno.displaySlidingScaleValue(i,diff5[i])
01332           self.multibareng.displaySlidingScaleValue(i,diff6[i])
01333           self.engmeters[i].setText("%d"%(diff6[i]+.5))
01334       elif newtime-self.timeout>TIMEOUT:
01335         self.timestamp=0
01336         self.__tkrlist=[]
01337         self.multibar1.bars[1].displayValue(0)
01338         self.multibar1.setBarTitle(1,"%d"%0)
01339         self.__callowlist=[]
01340         self.multibar1.bars[2].displayValue(0)
01341         self.multibar1.setBarTitle(2,"%d"%0)
01342         self.__calhighlist=[]
01343         self.multibar1.bars[3].displayValue(0)
01344         self.multibar1.setBarTitle(3,"%d"%0)
01345         self.__roilist=[]
01346         self.multibar1.bars[0].displayValue(0)
01347         self.multibar1.setBarTitle(0,"%d"%0)
01348         self.__cnolist=[]
01349         self.multibar1.bars[4].displayValue(0)
01350         self.multibar1.setBarTitle(4,"%d"%0)
01351         self.__periodiclist=[]
01352         self.multibar1.bars[5].displayValue(0)
01353         self.multibar1.setBarTitle(5,"%d"%0)
01354         self.__solicitedlist=[]
01355         self.multibar1.bars[6].displayValue(0)
01356         self.multibar1.setBarTitle(6,"%d"%0)
01357         self.__extlist=[]
01358         self.multibar1.bars[7].displayValue(0)
01359         self.multibar1.setBarTitle(7,"%d"%0)
01360         for i in range(16):
01361           self.tkrveclist[i]=[]
01362           self.roiveclist[i]=[]
01363           self.cnoveclist[i]=[]
01364           self.callowveclist[i]=[]
01365           self.calhighveclist[i]=[]
01366           self.orveclist[i]=[]
01367           self.englist[i]=[]
01368           self.multibar2.bars[i].displayValue(0)
01369           self.multibartower.bars[i].displayValue(0)
01370           self.multibartkr.bars[i].displayValue(0)
01371           self.multibarcallow.bars[i].displayValue(0)
01372           self.multibarcalhigh.bars[i].displayValue(0)
01373           self.multibarroi.bars[i].displayValue(0)
01374           if i < 12:
01375             self.multibarcno.bars[i].displayValue(0)
01376           self.multibareng.bars[i].displayValue(0)
01377           self.engmeters[i].setText("%d"%(0))
01378
01379       #use the results of the consumer
01380       win=self.__lat.GEM.GEMW.window_width
01381       if win !=self.__window:
01382         self.__window=win
01383         self.cons.timematrix=None
01384         self.cons.winwidth=win
01385         self.timehisto.removeAllHistos()
01386         self.timehisto.setup(2*self.__window+1,-self.__window-.5,self.__window+.5,False,False)
01387         self.timehisto.bds=10
01388         self.timehisto.boxwidth=.25
01389         self.timehisto.xaxislabel.setText("timing in clock ticks of 50 ns")
01390         self.timehisto.addHisto("ROI","black",0,1,self.roion)
01391         self.timehisto.setHistoLabel("ROI","ROI")
01392         self.timehisto.addHisto("TKR","blue",0,1,self.tkron)
01393         self.timehisto.setHistoLabel("TKR","TKR")
01394         self.timehisto.addHisto("CALlow","red",0,1,self.callowon)
01395         self.timehisto.setHistoLabel("CALlow","CAL low")
01396         self.timehisto.addHisto("CALhigh","orange",0,1,self.calhighon)
01397         self.timehisto.setHistoLabel("CALhigh","CAL high")
01398         self.timehisto.addHisto("CNO","magenta",0,1,self.cnoon)
01399         self.timehisto.setHistoLabel("CNO","CNO")
01400         self.timehisto.addHisto("EXT","green",0,1,self.exton)
01401         self.timehisto.setHistoLabel("EXT","External")
01402         self.timehisto.update()
01403         self.timehisto.drawLabels()
01404       if self.cons.resethistos==True:
01405         self.cons.resethistos=False
01406         self.histo.resetAllHistos()
01407         self.timehisto.resetAllHistos()
01408       for ti in self.cons.deltawtime:
01409         self.histo.fill("deltawtime",ti)
01410       for ti in self.cons.deltatime:
01411         self.histo.fill("deltaetime",ti)
01412       self.histo.updateHisto()
01413       #consumer fills histo
01414       self.timehisto.updateHisto()
01415       self.cons.resetWindowData()
01416
01417   def changeRate(self,rate):
01418     rates=[1.5,1.,0.5,0.2,0.1]
01419     self.__samplingrate=rates[rate]*1000
01420     self.__ratehaschanged=True
01421
01422   def changeSampling(self,sampling):
01423     sample=[100,50,20,10,5,2,1]
01424     self.__numsamples=sample[sampling]
01425
01426   def setReference(self,ref):
01427     self.ref=ref
01428     self.cons.ref=ref
01429     self.timehisto.resetAllHistos()
01430     self.timehisto.resetlin()
01431     self.cons.resetWindowData()
01432     self.roitime.setChecked(0)
01433     self.tkrtime.setChecked(0)
01434     self.callowtime.setChecked(0)
01435     self.calhightime.setChecked(0)
01436     self.cnotime.setChecked(0)
01437     self.exttime.setChecked(0)
01438     self.cons.reloadData()
01439
01440   def setROI(self,onoff):
01441     if onoff == True:
01442       if self.ref==0:
01443         self.roitime.setChecked(0)
01444       else:
01445         self.timehisto.showHisto("ROI")
01446         self.roion=True
01447         self.timehisto.update()
01448     else:
01449       self.timehisto.hideHisto("ROI")
01450       self.roion=False
01451       self.timehisto.update()
01452   def setTKR(self,onoff):
01453     if onoff == True:
01454       if self.ref==1:
01455         self.tkrtime.setChecked(0)
01456       else:
01457         self.timehisto.showHisto("TKR")
01458         self.tkron=True
01459         self.timehisto.update()
01460     else:
01461       self.timehisto.hideHisto("TKR")
01462       self.tkron=False
01463       self.timehisto.update()
01464   def setCALlow(self,onoff):
01465     if onoff == True:
01466       if self.ref==2:
01467         self.callowtime.setChecked(0)
01468       else:
01469         self.timehisto.showHisto("CALlow")
01470         self.callowon=True
01471         self.timehisto.update()
01472     else:
01473       self.timehisto.hideHisto("CALlow")
01474       self.callowon=False
01475       self.timehisto.update()
01476     pass
01477   def setCALhigh(self,onoff):
01478     if onoff == True:
01479       if self.ref==3:
01480         self.calhightime.setChecked(0)
01481       else:
01482         self.timehisto.showHisto("CALhigh")
01483         self.calhighon=True
01484         self.timehisto.update()
01485     else:
01486       self.timehisto.hideHisto("CALhigh")
01487       self.calhighon=False
01488       self.timehisto.update()
01489     pass
01490   def setCNO(self,onoff):
01491     if onoff == True:
01492       if self.ref==4:
01493         self.cnotime.setChecked(0)
01494       else:
01495         self.timehisto.showHisto("CNO")
01496         self.cnoon=True
01497         self.timehisto.update()
01498     else:
01499       self.timehisto.hideHisto("CNO")
01500       self.cnoon=False
01501       self.timehisto.update()
01502     pass
01503   def setEXT(self,onoff):
01504     if onoff == True:
01505       if self.ref==5:
01506         self.exttime.setChecked(0)
01507       else:
01508         self.timehisto.showHisto("EXT")
01509         self.exton=True
01510         self.timehisto.update()
01511     else:
01512       self.timehisto.hideHisto("EXT")
01513       self.exton=False
01514       self.timehisto.update()
01515     pass
01516   def closeEvent(self,e):
01517     self.stopthethread()
01518     e.accept()
01519   def stopthethread(self):
01520     myLog.debug( "terminating consumer")
01521     self.cons.exitConsumer()
01522     self.consthread.wait()
01523   def resizeEvent(self,rev):
01524     if self.__firstresize==False:
01525       self.__theheight=rev.oldSize().height()
01526       self.__thewidth=rev.oldSize().width()
01527       self.__firstresize=True
01528   def readlut(self,gemsc):
01529     cond=[]
01530     cond.append(gemsc.conditions_00_07)
01531     cond.append(gemsc.conditions_08_0f)
01532     cond.append(gemsc.conditions_10_17)
01533     cond.append(gemsc.conditions_18_1f)
01534     cond.append(gemsc.conditions_20_27)
01535     cond.append(gemsc.conditions_28_2f)
01536     cond.append(gemsc.conditions_30_37)
01537     cond.append(gemsc.conditions_38_3f)
01538     cond.append(gemsc.conditions_40_47)
01539     cond.append(gemsc.conditions_48_4f)
01540     cond.append(gemsc.conditions_50_57)
01541     cond.append(gemsc.conditions_58_5f)
01542     cond.append(gemsc.conditions_60_67)
01543     cond.append(gemsc.conditions_68_6f)
01544     cond.append(gemsc.conditions_70_77)
01545     cond.append(gemsc.conditions_78_7f)
01546     cond.append(gemsc.conditions_80_87)
01547     cond.append(gemsc.conditions_88_8f)
01548     cond.append(gemsc.conditions_90_97)
01549     cond.append(gemsc.conditions_98_9f)
01550     cond.append(gemsc.conditions_a0_a7)
01551     cond.append(gemsc.conditions_a8_af)
01552     cond.append(gemsc.conditions_b0_b7)
01553     cond.append(gemsc.conditions_b8_bf)
01554     cond.append(gemsc.conditions_c0_c7)
01555     cond.append(gemsc.conditions_c8_cf)
01556     cond.append(gemsc.conditions_d0_d7)
01557     cond.append(gemsc.conditions_d8_df)
01558     cond.append(gemsc.conditions_e0_e7)
01559     cond.append(gemsc.conditions_e8_ef)
01560     cond.append(gemsc.conditions_f0_f7)
01561     cond.append(gemsc.conditions_f8_ff)
01562     lut={}
01563     j=0
01564     for co in cond:
01565       for i in range(8):
01566         lut[j]=(co>>(i*4))&0xf
01567         j+=1
01568     return lut
01569
01570   def getEngines(self,gemmg,val):
01571     engall=[]
01572     engall.append(gemmg.engine_0)
01573     engall.append(gemmg.engine_1)
01574     engall.append(gemmg.engine_2)
01575     engall.append(gemmg.engine_3)
01576     engall.append(gemmg.engine_4)
01577     engall.append(gemmg.engine_5)
01578     engall.append(gemmg.engine_6)
01579     engall.append(gemmg.engine_7)
01580     engall.append(gemmg.engine_8)
01581     engall.append(gemmg.engine_9)
01582     engall.append(gemmg.engine_a)
01583     engall.append(gemmg.engine_b)
01584     engall.append(gemmg.engine_c)
01585     engall.append(gemmg.engine_d)
01586     engall.append(gemmg.engine_e)
01587     engall.append(gemmg.engine_f)
01588     res={}
01589     for a in val.keys():
01590       res[a]=engall[a]
01591     return res
01592
01593 def disconnectcmdcli():
01594   myLog.debug( "Disconnecting command client" )
01595   cmd.disconnect()
01596
01597 if __name__ == "__main__":
01598   from LATTE.client.gOptions import Options
01599   from LATTE.client.gCmdCli  import CmdCli
01600   from LATTE.database.gLAT   import GLAT
01601   from LATTE.database.gOCS   import GOCS
01602
01603   options = Options(['cmdserver', 'schema'],['nevents','server','infile','rate'])
01604   try:
01605     options.parse()
01606   except Exception, msg:
01607     options.usage(str(msg))
01608     sys.exit(1)
01609   if options.infile==None and options.server==None:
01610     sys.exit(1)
01611   cmd = CmdCli()
01612   cmd.connect(options.cmdserver)
01613
01614   lat = GLAT(cmd)
01615   ocs = GOCS(cmd)
01616   lat.readSchema(options.schema)
01617
01618
01619
01620
01621   a = QApplication(sys.argv)
01622   QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
01623   QObject.connect(a,SIGNAL("aboutToQuit()"),disconnectcmdcli)
01624   w = trgDisplayImpl(lat,ocs,options.server,options.infile)
01625   a.setMainWidget(w,)
01626   #QObject.connect(a,SIGNAL("aboutToQuit()"),w.stopthethread)
01627   w.show()
01628   a.exec_loop()
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgEngines.py Source File

trigger

TrgEngines.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Trigger Engine interface classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 from TrgObject import TrgObject
00022
00023
00024 """TrgEngines: Interface for the Trigger Engine classes"""
00025
00026
00027 class TrgEngines(TrgObject):
00028   """\brief Trigger Engines class definition
00029   A Trigger Engine defines what the Trigger System does when it
00030   detects a triggerable condition within the LAT
00031   """
00032   def __init__(self):
00033     """\brief TrgEngines constructor
00034     """
00035     pass
00036
00037   def engine(self, engineNumber):
00038     """\brief Engine 'pure virtual' method
00039     Reference into a list of engines.
00040     \param engineNumber  An integer
00041     \return A TrgEngine object
00042     """
00043     raise NotImplementedError
00044     pass
00045
00046
00047 class TrgEngine(TrgObject):
00048   """\brief Trigger Engine class definition
00049   The user inherits from this class to customize their own Trigger Engines.
00050   The user must satisfy the member function 'request', which returns an
00051   object of type TrgEngineRequest.
00052   The user must satisfy the member function 'prescale', which returns an
00053   integer.
00054   """
00055   def __init__(self):
00056     """\brief TrgEngine constructor
00057     """
00058     pass
00059
00060   def prescale(self):
00061     """\brief prescale 'pure virtual' method
00062
00063     \return An integer
00064     """
00065     raise NotImplementedError
00066     pass
00067
00068   def request(self):
00069     """\brief request 'pure virtual' method
00070     Return the TrgEngineRequest object corresponding to this engine.
00071     \return A TrgEngineRequest object
00072     """
00073     raise NotImplementedError
00074     pass
00075
00076   def participate(self,conditionsValue):
00077     """\brief participate 'pure virtual' method
00078     Determines whether or not this engine participates when a particular
00079     conditionsValue is satisfied in the GEM.
00080     \param conditionsValue  An integer
00081     \return A boolean
00082     """
00083     raise NotImplementedError
00084     pass
00085
00086
00087 class TrgEngineRequest(TrgObject):
00088   """\brief Trigger Engine Request class definition
00089   The TrgEngineRequest class is used to specify the parameterization
00090   of the Trigger Message associated with a given engine.
00091
00092   See below for concrete examples.
00093   """
00094   def __init__(self):
00095     """\brief TrgEngineRequest constructor
00096     """
00097     pass
00098
00099
00100   def fourRange(self):
00101     """\brief fourRange 'virtual' method
00102     Return TRUE if the four-range-readout is enabled, else FALSE.
00103     \return A boolean
00104     """
00105     return False
00106
00107   def zeroSuppress(self):
00108     """\brief zeroSuppress 'virtual' method
00109     Return TRUE if the zero-suppression is enabled, else FALSE.
00110     \return A boolean
00111     """
00112     return False
00113
00114   def destination(self):
00115     """\brief destination method
00116
00117     \return An integer
00118     """
00119     raise NotImplementedError
00120     pass
00121
00122   def marker(self, markerValue = 0):
00123     """\brief marker  method
00124
00125     \param markerValue  A marker value
00126     \return An integer
00127     """
00128     return 0
00129
00130   def sequence(self):
00131     """\brief sequence 'pure virtual' method
00132
00133     \return An integer
00134     """
00135     raise NotImplementedError
00136     pass
00137
00138 class TrgInjectCharge(TrgEngineRequest):
00139   """\brief TrgInjectCharge class definition
00140
00141   Directs a module to send to its Front-End Electronics a command sequence
00142   which is composed only of the CALSTROBE command. This command will not
00143   trigger a readout of the module's Front-End Electronics.
00144   """
00145   def __init__(self):
00146     """\brief TrgInjectCharge constructor
00147     """
00148     TrgEngineRequest.__init__(self)
00149
00150   def sequence(self):
00151     """\brief sequence() method
00152     See TrgEngineRequest base class
00153     """
00154     return 2
00155
00156 class TrgReadout(TrgEngineRequest):
00157   """\brief TrgReadout class definition
00158
00159   Directs a module to send to its Front-End Electronics a command sequence
00160   which is composed only of the TACK command. This command will trigger
00161   a readout of the module's Front-End Electronics.
00162   """
00163   def __init__(self):
00164     """\brief TrgReadout constructor
00165     """
00166     TrgEngineRequest.__init__(self)
00167
00168   def sequence(self):
00169     """\brief sequence() method
00170     See TrgEngineRequest base class
00171     """
00172     return 1
00173
00174 class TrgInjectChargeReadout(TrgEngineRequest):
00175   """\brief Trigger Inject Charge Readout class definition
00176
00177   Directs a module to send to its Front-End Electronics a command sequence
00178   which is composed of a CALSTROBE followed by a TACK command.
00179   This sequence will trigger a readout of the module's Front-End Electronics.
00180   """
00181   def __init__(self):
00182     """\brief TrgInjectChargeReadout constructor
00183     """
00184     TrgEngineRequest.__init__(self)
00185
00186   def sequence(self):
00187     """\brief sequence() method
00188     See TrgEngineRequest base class
00189     """
00190     return 3
00191
00192 class TrgInjectMarker(TrgEngineRequest):
00193   """\brief Trigger Inject Marker class definition
00194   Directs a module to send to its Front-End Electronics a command sequence
00195   which is composed of only a TACK command. This sequence will trigger
00196   a readout of the module's Front-End Electronics.
00197   """
00198   def __init__(self, marker):
00199     """\brief TrgInjectMarker constructor
00200     """
00201     TrgEngineRequest.__init__(self)
00202     self.__marker = marker
00203
00204   def sequence(self):
00205     """\brief sequence() method
00206     See TrgEngineRequest base class
00207     """
00208     return 1
00209
00210   def marker(self):
00211     """\brief marker() method
00212     See TrgEngineRequest base class
00213     """
00214     return self.__marker
00215
00216
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgEventCounter.py Source File

trigger

TrgEventCounter.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Coincidence based Trigger System Abstract classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 from TrgObject import TrgObject
00021
00022 """TrgEventCounter: Interface for event counters. """
00023
00024 class TrgEventCounter(TrgObject):
00025   """\brief TrgEventCounter class
00026
00027      This class controls the counters associated with the event stream
00028      received and the responses sent by the GEM.
00029
00030      These functions to be implemented at the hardware abstraction level.
00031   """
00032   def __init__(self):
00033     """\brief TrgEventCounter contructor
00034     """
00035     TrgObject.__init__(self)
00036     pass
00037
00038   def stats(self):
00039     """\brief stats() method
00040
00041        Return the number of events seen by the counter
00042        \return an integer
00043     """
00044     raise NotImplementedError
00045     pass
00046
00047   def reset(self):
00048     """\brief reset() method
00049
00050        Reset the event counters
00051     """
00052     raise NotImplementedError
00053     pass
00054
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGem.py Source File

trigger

TrgGem.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Coincidence based Trigger System Interface classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.9 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 """TrgGem: This file implements the hardware register access to the GEM"""
00021
00022 from TrgGemRegisters      import TrgGemRegisters
00023 from TrgGemCounters       import *
00024 from LATTE.database.gGEM  import GGEM
00025
00026 class TrgGem(TrgGemRegisters):
00027   """\brief Trigger Global Trigger Electronics Module Interface class definition
00028   This class implements the hardware register access to the GEM
00029   """
00030   __SOLICIT_MASK = 0x40
00031
00032   def __init__(self):
00033     """\brief TrgGem constructor
00034     """
00035     TrgGemRegisters.__init__(self)
00036
00037     self.__condValue = None
00038     self.__glt       = None
00039
00040   def GEM(self, glt = None):
00041     """\brief GEM function
00042     \param glt:  a GGEM object
00043     \return a GGEM object
00044
00045     This function sets and/or the GGEM hardware implementation used by
00046     TrgGem.
00047     """
00048     if ( glt is not None ):
00049       if ( not isinstance(glt,GGEM) ):
00050         raise AssertionError, "the glt object passed is not a GGEM"
00051       self.__glt = glt
00052       self.__epuaddr = glt.getEPUaddr()
00053     return self.__glt
00054
00055   def __commit(self):
00056     """\brief Private commit function
00057
00058     This function commits the configuration defined by this
00059     TrgGem object to the hardware.  It does *all* the registers.
00060     """
00061     gem = self.GEM()
00062
00063     # set up the counter accesses and reset them
00064     self.__triggerCounters = TrgGemTriggerCounters(gem)
00065     self.__tileCounters    = TrgGemTileCounters(gem)
00066     self.__cnoCounters     = TrgGemCnoCounters(gem)
00067     self.__cmdCounters     = TrgGemCmdCounters(gem)
00068     self.__eventCounter    = TrgGemEventCounter(gem)
00069     self.__ppsTimer        = TrgGemPPSTimer(gem)
00070     self.__triggerCounters.reset()
00071     self.__tileCounters.reset()
00072     self.__cnoCounters.reset()
00073     self.__cmdCounters.reset()
00074     self.__eventCounter.reset()
00075
00076     # Pass the GEM to TrgGemSequence and TrgGemPeriodicCondition objects
00077     self.sequence()._TrgGemSequence__setGEM(gem)
00078     self.periodicCondition()._TrgGemPeriodicCondition__setGEM(gem)
00079
00080     # set all engine destination addresses.
00081     # Because engines can't have a real HW dependence, this is done by cheating:
00082     #   replace each instance of the TrgEngineRequest.destination function
00083     #   with a local private function.
00084     for engineNo in range(TrgObject.ENGINE_NUMBER_MAX + 1):
00085       self.engines().engine(engineNo).request().destination = self.__getDestinationFromEPU
00086
00087     gemw = gem.downGEMW()
00088     gemw.WINDOW_OPEN_MASK = 0               # all disabled at startup by default
00089
00090     # print "setting command registers"
00091     # Command registers (GEMC)
00092     gemc = gem.downGEMC()
00093     gemc.CONFIGURATION         = self.configurationRegister()
00094     # NEVER EVER touch the ADDRESS register.  Ever.  Really.
00095     gemc.PERIODIC_MODE         = self.periodicModeRegister()
00096     gemc.PERIODIC_LIMITS       = self.periodicLimitRegister()
00097     gemc.PERIODIC_RATE         = self.periodicRateRegister()
00098     # gemc.SEQUENCE              = self.sequenceRegister()   # commented out to set sequence in rcStartRun
00099     gemc.CR_STATISTICS         = 0    # Always reset statistics
00100     gemc.EVENT_STATISTICS      = 0    # Always reset statistics
00101
00102     # print "setting TAM"
00103     # TAM generator (GEMMG)
00104     gemmg = gem.downGEMMG()
00105     if gemmg is None:
00106       raise RuntimeError, "GEM has no GEMMG"
00107     regList = gemmg.regs.values()           # get the list of registers
00108     for reg in regList:
00109       if reg.size() > 0 and not reg.isDeprecated():
00110         reg.set(self.templateRegister(reg.id()))
00111
00112     # print "setting statistics"
00113     # Statistics registers (GEMST)
00114     gemst = gem.downGEMST()
00115     if gemst is None:
00116       raise RuntimeError, "GEM has no GEMST"
00117     regList = gemst.regs.values()           # get the list of registers
00118     for reg in regList:
00119       if reg.size() > 0 and not reg.isDeprecated():
00120         reg.set(0)                            # Reset all to zero
00121
00122     # print "setting scheduler"
00123     # Scheduler Registers (GEMSC)
00124     gemsc = gem.downGEMSC()
00125     if gemsc is None:
00126       raise RuntimeError, "GEM has no GEMSC"
00127     regList = gemsc.regs.values()           # get the list of registers
00128     for reg in regList:
00129       if reg.size() > 0 and not reg.isDeprecated():
00130         reg.set(self.lookupTableRegister(reg.id()))
00131
00132     # print "setting roi"
00133     # ROI Registers (GEMVG)
00134     gemvg = gem.downGEMVG()
00135     if gemvg is None:
00136       raise RuntimeError, "GEM has no GEMVG"
00137     regList = gemvg.regs.values()           # get the list of registers
00138     for reg in regList:
00139       if reg.size() > 0 and not reg.isDeprecated():
00140         reg.set(self.roiRegister(reg.id()))
00141
00142     # print "setting input enables"
00143     # Input Enable Registers (GEMIE)
00144     gemie = gem.downGEMIE()
00145     if gemie is None:
00146       raise RuntimeError, "GEM has no GEMIE"
00147     #ST 6/14/05
00148     #regList = gemie.regs.values()           # get the list of registers
00149     #for reg in regList:
00150
00151     # The above two lines have been replaced by the following line to support
00152     # the older GASUs. This is outlined in JIRA OACD-3 which dictates that to
00153     # avoid overwriting the TILES_000_013 register, the EXTERNAL register has to
00154     # be written first. In order for this to happen, a new method attrIter has
00155     # been added to the Gdb class which allows iterating the attributes in the
00156     # same order as they are declared in the node's __attrs member. The EXTERNAL
00157     # register has now been specified as the first register in this list so it
00158     # is guaranteed to be modified first.
00159     for reg in gemie.attrIter():
00160       if reg.size() > 0 and not reg.isDeprecated():
00161         setting = self.__ieRegister(reg.id())  # private function below
00162         if setting is not None:
00163           reg.set(setting)
00164
00165     # print "setting windowing"
00166     # Window Registers (GEMW)
00167     gemw = gem.downGEMW()
00168     if gemw is None:
00169       raise RuntimeError, "GEM has no GEMW"
00170     gemw.WINDOW_WIDTH = self.width()
00171     gemw.WINDOW_OPEN_MASK = 0               # all disabled at startup by default
00172
00173   def __getDestinationFromEPU(self):
00174     return self.__epuaddr
00175
00176   def __ieRegister(self, registerNumber):
00177     # routine that maps the input-enable registers to the register functions
00178     # 18 input enable registers.
00179     # 0-3 Tower Inputs
00180     # 4 acdCNO
00181     # 5-16 ACD veto enables
00182     # 17 Tower_busy enable
00183     if 0 <= registerNumber <= 3:
00184       return self.towerEnableRegister(registerNumber)
00185     if 4 == registerNumber:
00186       return self.cnoEnableRegister()
00187     if 5 <= registerNumber <= 16:
00188       return self.tileEnableRegister(registerNumber - 5)
00189     if 17 == registerNumber:
00190       try:  # special try block to allow Run Control to override register
00191         return self.towerBusyEnableRegister()
00192       except NotImplementedError:
00193         return None
00194     if 18 == registerNumber:
00195       return self.externalEnableRegister()
00196     # shouldn't get here
00197     raise IndexError, "registerNumber out of range 0..18"
00198
00199   ############### Pure virtual function implementation
00200   def version(self):
00201     cfg = self.GEM().GEMC.CONFIGURATION
00202     return ( ( cfg >> 16 ) & 0xffff )
00203
00204   def solicit(self):
00205     # transmit the GEM's TRIGGER dataless command
00206     self.GEM().downGEMC().CMD_TRIGGER = 1
00207
00208   def enable(self, mask=None):
00209     if mask is not None:
00210       outMask = mask
00211     elif self.conditions() is not None:
00212       outMask = self.conditions().value()
00213     else:
00214       raise AssertionError, "Attempting to enable a TrgConditionsValue of None"
00215     self.GEM().downGEMW().WINDOW_OPEN_MASK = outMask
00216
00217   def disable(self):
00218     self.GEM().downGEMW().WINDOW_OPEN_MASK = 0
00219
00220   def triggerCounters(self):
00221     return self.__triggerCounters
00222
00223   def tileCounters(self):
00224     return self.__tileCounters
00225
00226   def cnoCounters(self):
00227     return self.__cnoCounters
00228
00229   def cmdCounters(self):
00230     return self.__cmdCounters
00231
00232   def eventCounter(self):
00233     return self.__eventCounter
00234
00235   def ppsTimer(self):
00236     return self.__ppsTimer
00237
00238   def shut(self, marker):
00239     """Implementation of the shut function.
00240     """
00241     gemw  = self.GEM().GEMW
00242     gemmg = self.GEM().GEMMG
00243     gemsc = self.GEM().GEMSC
00244
00245     #0) disable triggers
00246     self.disable()
00247
00248     #1) Replace engine 0 with a marker engine
00249     from TrgEngine import TrgInjectMarker
00250     newEngine = TrgInjectMarker(marker)
00251     newTAM = self._TrgGemRegisters__parseEngine(newEngine)
00252     oldTAM = gemmg.ENGINE_0
00253     gemmg.ENGINE_0 = newTAM
00254
00255     #2) replace contents of all schedulers with solicited with (Engine) 0
00256     scheduler = ( 0x00000000L )               # Everything's 0!
00257     regList = gemsc.regs.values()
00258     oldSched = {}    # dictionary keyed on register names
00259     for reg in regList:
00260       oldSched[reg.getName()] = reg.get()
00261       reg.set(scheduler)
00262
00263     #3) Change conditions to be solicit only, solicit a trigger and disable
00264     gemw.WINDOW_OPEN_MASK = TrgGem.__SOLICIT_MASK
00265     self.solicit()
00266     self.disable()
00267
00268     #4) Put the original contents of scheduler 0x40 back, and put the TAM back
00269     for reg in regList:
00270       reg.set(oldSched[reg.getName()])
00271
00272     gemmg.ENGINE_0 = oldTAM
00273
00274     #5) Put the trigger conditions back
00275     self.enable()
00276
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemAbstract.py Source File

trigger

TrgGemAbstract.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Coincidence based Trigger System Interface classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.3 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 """TrgGemAbstract: Abstract interface for GEM based systems. """
00021
00022 from TrgObject   import TrgObject
00023 from TrgAbstract import TrgAbstract
00024 from TrgPeriodic import TrgPeriodicCondition
00025
00026 class TrgGemAbstract(TrgAbstract):
00027   """\brief Trigger Global trigger Electronics Module Interface class definition
00028   """
00029   def __init__(self):
00030     """\brief TrgGemAbstract constructor
00031     """
00032     TrgAbstract.__init__(self)
00033
00034
00035   #############  Pure Virtual functions
00036   def width(self):
00037     """\brief width 'pure virtual' method
00038
00039     \return An int.
00040
00041     This value specifies the window of the GEM's trigger window
00042     (see [4]). The width is specified in units of system clock, where one
00043     system clock is 50 nanoseconds.
00044     """
00045     raise NotImplementedError
00046     pass
00047
00048   def useAcdAsTrigger(self):
00049     """\brief UseAcdAsTrigger 'pure virtual' method
00050
00051     \return A boolean
00052
00053     This value specifies whether or not the the ROI generator and its ACD
00054     tile signals are be used as a trigger or as a veto.
00055     If the value returned is TRUE, the ROI generator is used as a trigger.
00056     If the value returned is FALSE, the ROI generator is used as a veto.
00057     """
00058     raise NotImplementedError
00059     pass
00060
00061   def redundantPPS(self):
00062     """\brief RedundantPPS 'pure virtual' method
00063
00064     \return A boolean
00065
00066     This value specifies whether or not the GEM should use the redundant
00067     1-PPS signal. If the value returned is TRUE, the redundant 1-PPS signal
00068     will be used. If the value returned is FALSE, the primary
00069     1-PPS signal will not be used.
00070     """
00071     raise NotImplementedError
00072     pass
00073
00074   def responseHeaderParityEven(self):
00075     """\brief responseHeaderParityEven 'pure virtual' method
00076
00077     \return A boolean
00078
00079     This value specifies whether or not the parity associated with a command
00080     responsepacket header should be sent with odd or even parity. If the value returned is
00081     TRUE, response headers will have even parity. If the value returned is FALSE,
00082     responses will have odd parity.
00083     """
00084     raise NotImplementedError
00085     pass
00086
00087   def responseDataParityEven(self):
00088     """\brief responseDataParityEven 'pure virtual' method
00089
00090     \return A boolean
00091
00092     This value specifies whether or not the parity associated with a command
00093     response packet body should be sent with odd or even parity. If the value returned is
00094     TRUE, response bodies will have even parity. If the value returned is FALSE,
00095     responses will have odd parity.
00096     """
00097     raise NotImplementedError
00098     pass
00099
00100   def eventHeaderParityEven(self):
00101     """\brief eventHeaderParityEven 'pure virtual' method
00102
00103     \return A boolean
00104
00105     This value specifies whether or not the parity associated with a trigger
00106     message header initiated by the GEM should be sent with odd or even parity.
00107     If the value returned is TRUE, trigger message headers will have even parity.
00108     If the value returned is FALSE, trigger message headers will have odd parity.
00109     """
00110     raise NotImplementedError
00111     pass
00112
00113   def eventDataParityEven(self):
00114     """\brief eventDataParityEven 'pure virtual' method
00115
00116     \return A boolean
00117
00118     This value specifies whether or not the parity associated with a trigger
00119     message body initiated by the GEM should be sent with odd or even parity.
00120     If the value returned is TRUE, trigger message bodies will have even parity.
00121     If the value returned is FALSE, trigger message bodies will have odd parity.
00122     """
00123     raise NotImplementedError
00124     pass
00125
00126   def triggerParityEven(self):
00127     """\brief TriggerParityEven 'pure virtual' method
00128
00129     \return A boolean
00130
00131     This value specifies whether or not the parity associated with a trigger
00132     message initiated by the GEM should be sent with odd or even parity.
00133     If the value returned is TRUE, trigger messages will have even parity.
00134     If the value returned is FALSE, trigger messages will have odd parity.
00135     """
00136     raise NotImplementedError
00137     pass
00138
00139   def inhibitContribution(self):
00140     """\brief inhibitContribution 'pure virtual' method
00141
00142     \return A boolean
00143
00144     This value specifies whether or not the GEM transmits a contribution
00145     to the event.
00146     If the value returned is TRUE, GEM contributions are inhibited.
00147     If the value returned is FALSE, GEM contributions are sent with the event.
00148     """
00149     raise NotImplementedError
00150     pass
00151
00152   def periodicCondition(self):
00153     """\brief PeriodicCondition 'pure virtual' method
00154
00155     \return A TrgPeriodicCondition object
00156
00157     This object specifies the initial and current definition of
00158     the periodic condition
00159     """
00160     raise NotImplementedError
00161     pass
00162
00163   def roi(self):
00164     """\brief Roi 'pure virtual' method
00165
00166     \return A TrgRoi object
00167
00168     This object specifies the definition of the GEM's ROI generator
00169     """
00170     raise NotImplementedError
00171     pass
00172
00173   def triggerCounters(self):
00174     """\brief triggerCounters 'pure virtual' method
00175
00176     \return A TrgTriggerCounters object
00177
00178     This object specifies an implementation of the GEM's trigger counters
00179     """
00180     raise NotImplementedError
00181     pass
00182
00183   def cnoCounters(self):
00184     """\brief cnoCounters 'pure virtual' method
00185
00186     \return A TrgCnoCounters object
00187
00188     This object specifies an implementation of the GEM's cno counters
00189     """
00190     raise NotImplementedError
00191     pass
00192
00193   def tileCounters(self):
00194     """\brief tileCounters 'pure virtual' method
00195
00196     \return A TrgTileCounters object
00197
00198     This object specifies an implementation of the GEM's tile counters
00199     """
00200     raise NotImplementedError
00201     pass
00202
00203   def cmdCounters(self):
00204     """\brief cmdCounters 'pure virtual' method
00205
00206     \return A TrgCmdCounters object
00207
00208     This object specifies an implementation of the GEM's Command/Response counters
00209     """
00210     raise NotImplementedError
00211     pass
00212
00213   def eventCounter(self):
00214     """\brief eventCounter 'pure virtual' method
00215
00216     \return A TrgEventCounter object
00217
00218     This object specifies an implementation of the GEM's events sent counter
00219     """
00220     raise NotImplementedError
00221     pass
00222
00223   def ppsTimer(self):
00224     """\brief ppsTimer 'pure virtual' method
00225
00226     \return A TrgPPSTimer object
00227
00228     This object specifies an implementation of the GEM's 1-PPS timer
00229     """
00230     raise NotImplementedError
00231     pass
00232
00233
00234   ############### Pure virtual function implementation
00235   def maxEngines(self):
00236     return (TrgObject.ENGINE_NUMBER_MAX + 1)
00237
00238   def maxConditions(self):
00239     return (TrgObject.CONDITIONS_NUMBER_MAX + 1)
00240
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemCounters.py Source File

trigger

TrgGemCounters.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Trigger Object class"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.2 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 from TrgObject          import TrgObject
00021 from TrgTriggerCounters import TrgTriggerCounters
00022 from TrgTriggerCounters import TrgTriggerStats
00023
00024 from TrgTileCounters    import TrgTileCounters
00025 from TrgTileCounters    import TrgTileStats
00026
00027 from TrgCnoCounters     import TrgCnoCounters
00028 from TrgCnoCounters     import TrgCnoStats
00029
00030 from TrgCmdCounters     import TrgCmdCounters
00031 from TrgCmdCounters     import TrgCmdStats
00032
00033 from TrgEventCounter    import TrgEventCounter
00034
00035 from TrgPPSTimer        import TrgPPSTimer
00036
00037 """TrgGemCounters: Trigger GEM counter hardware implementation class"""
00038
00039
00040 class TrgGemTriggerCounters(TrgTriggerCounters):
00041   """\brief TrgGemTriggerCounters class
00042
00043   This class implements the HW abstraction corresponding to
00044   figure 66-69 of the GEM document: LAT-01545 Section 2.6.1 and 2.6.2
00045
00046   """
00047   def __init__(self,glt):
00048     """\brief TrgGemTriggerCounters constructor
00049     """
00050     TrgTriggerCounters.__init__(self)
00051     self.__stats = TrgGemTriggerStats(glt)
00052     if glt is not None:
00053       self.__cmd = glt.downGEMST()
00054     else:
00055       self.__cmd = None
00056
00057   def stats(self):
00058     """\brief stats() member function
00059     Returns an object that accesses the trigger statistics
00060     \return a TrgGemTriggerStats object
00061     """
00062     return self.__stats
00063
00064   def reset(self):
00065     """\brief reset() member function
00066     Reset the statistics registers
00067     """
00068     # writing to the register resets it.
00069     self.__cmd.LIVETIME      = 0
00070     self.__cmd.PRESCALED = 0
00071     self.__cmd.DISCARDED = 0
00072     self.__cmd.SENT      = 0
00073
00074 class TrgGemTriggerStats(TrgTriggerStats):
00075   """\brief TrgGemTriggerStats
00076   This class implements the HW abstraction corresponding to
00077   figure 66-69 of the GEM document: LAT-01545 Section 2.6.1 and 2.6.2
00078
00079   Note:  Reading the livetime register latches all 4 registers.
00080          Rereading the livetime register unlatches the registers.
00081   """
00082   def __init__(self,glt):
00083     """\brief TrgGemTriggerStats constructor
00084     """
00085     TrgTriggerStats.__init__(self)
00086     if glt is not None:
00087       self.__cmd = glt.downGEMST()
00088     else:
00089       self.__cmd = None
00090
00091   def livetime(self):
00092     return self.__cmd.LIVETIME & 0x0fff
00093
00094   def prescaled(self):
00095     return self.__cmd.PRESCALED & 0x0fff
00096
00097   def discarded(self):
00098     return self.__cmd.DISCARDED & 0x0fff
00099
00100   def sent(self):
00101     return self.__cmd.SENT & 0x0fff
00102
00103 # ###########
00104
00105 class TrgGemTileCounters(TrgTileCounters):
00106   """ \brief TrgGemTileCounters
00107
00108   This class implements the HW abstraction corresponding to
00109   the tile counter detailed in the GEM document:
00110   LAT-01545 Section 2.6
00111   """
00112   def __init__(self,glt):
00113     """\brief TrgGemTileCounters constructor
00114     """
00115     TrgTileCounters.__init__(self)
00116     self.__stats = TrgGemTileStats(glt)
00117     if glt is not None:
00118       self.__cmd = glt.downGEMST()
00119     else:
00120       self.__cmd = None
00121
00122   def stats(self):
00123     return self.__stats
00124
00125   def reset(self):
00126     """\brief reset() member function
00127
00128     Reset the tile counter register
00129     """
00130     self.__cmd.TILE_COUNTERS = 0
00131
00132   def assignA(self,tileNumber):
00133     """\brief assignA() member function
00134
00135     Assign the 'A' tile counter to watch a particular tile
00136     Immediately after counter assignment, both counters are reset.
00137     """
00138     if tileNumber < TrgObject.TILE_NUMBER_MIN or \
00139        tileNumber > TrgObject.TILE_NUMBER_MAX:
00140       raise IndexError, "tileNumber is out of range"
00141
00142     self.__cmd.TILE_0 = ( tileNumber )
00143     self.reset()
00144
00145   def assignB(self, tileNumber):
00146     """\brief assignB() member function
00147
00148     Assign the 'B' tile counter to watch a particular tile
00149     Immediately after counter assignment, both counters are reset.
00150     """
00151     if tileNumber < TrgObject.TILE_NUMBER_MIN or \
00152        tileNumber > TrgObject.TILE_NUMBER_MAX:
00153       raise IndexError, "tileNumber is out of range"
00154
00155     self.__cmd.TILE_1 = ( tileNumber )
00156     self.reset()
00157
00158   def assignAB(self, a, b):
00159     """\brief assignAB() member function
00160
00161     Assign both the 'A' and the'B' tile counters to watch two tiles
00162     Immediately after counter assignment, both counters are reset.
00163     """
00164     if a < TrgObject.TILE_NUMBER_MIN or \
00165        a > TrgObject.TILE_NUMBER_MAX:
00166       raise IndexError, "tileNumber is out of range"
00167     if b < TrgObject.TILE_NUMBER_MIN or \
00168        b > TrgObject.TILE_NUMBER_MAX:
00169       raise IndexError, "tileNumber is out of range"
00170
00171     self.__cmd.TILE_0 = ( a & 0x7f )
00172     self.__cmd.TILE_1 = ( b & 0x7f )
00173     self.reset()
00174
00175 class TrgGemTileStats(TrgTileStats):
00176   """\brief TrgGemTileStats
00177
00178   This class implements the HW abstraction corresponding to
00179   figure 64 of the GEM document: LAT-01545 Section 2.5
00180   """
00181   def __init__(self,glt):
00182     """\brief TrgGemTileStats constructor
00183     """
00184     TrgTileStats.__init__(self)
00185     if glt is not None:
00186       self.__cmd = glt.downGEMST()
00187     else:
00188       self.__cmd = None
00189
00190   def A(self):
00191     return self.__cmd.TILE_COUNTERS & 0xffff
00192
00193   def B(self):
00194     return ( self.__cmd.TILE_COUNTERS >> 16 ) & 0xffff
00195
00196 # ###########
00197
00198 class TrgGemCnoCounters(TrgCnoCounters):
00199   """ \brief TrgGemCnoCounters
00200
00201   This class implements the HW abstraction corresponding to
00202   the Cno counter detailed in the GEM document:
00203   LAT-01545 Section 2.6
00204   """
00205   def __init__(self,glt):
00206     """\brief TrgGemCnoCounters constructor
00207     """
00208     TrgCnoCounters.__init__(self)
00209     self.__stats = TrgGemCnoStats(glt)
00210     if glt is not None:
00211       self.__cmd = glt.downGEMST()
00212     else:
00213       self.__cmd = None
00214
00215   def stats(self):
00216     return self.__stats
00217
00218   def reset(self):
00219     """\brief reset() member function
00220
00221     Reset the Cno counter register
00222     """
00223     self.__cmd.CNO_COUNTERS = 0
00224
00225   def assignA(self,CnoNumber):
00226     """\brief assignA() member function
00227
00228     Assign the 'A' Cno counter to watch a particular Cno
00229     Immediately after counter assignment, both counters are reset.
00230     """
00231     if CnoNumber < TrgObject.CNO_NUMBER_MIN or \
00232        CnoNumber > TrgObject.CNO_NUMBER_MAX:
00233       raise IndexError, "CnoNumber is out of range"
00234
00235     self.__cmd.CNO_0 = ( CnoNumber )
00236     self.reset()
00237
00238   def assignB(self, CnoNumber):
00239     """\brief assignB() member function
00240
00241     Assign the 'B' Cno counter to watch a particular Cno
00242     Immediately after counter assignment, both counters are reset.
00243     """
00244     if CnoNumber < TrgObject.CNO_NUMBER_MIN or \
00245        CnoNumber > TrgObject.CNO_NUMBER_MAX:
00246       raise IndexError, "CnoNumber is out of range"
00247
00248     self.__cmd.CNO_1 = ( CnoNumber )
00249     self.reset()
00250
00251   def assignAB(self, a, b):
00252     """\brief assignAB() member function
00253
00254     Assign both the 'A' and the'B' Cno counters to watch two Cnos
00255     Immediately after counter assignment, both counters are reset.
00256     """
00257     if a < TrgObject.CNO_NUMBER_MIN or \
00258        a > TrgObject.CNO_NUMBER_MAX:
00259       raise IndexError, "CnoNumber is out of range"
00260     if b < TrgObject.CNO_NUMBER_MIN or \
00261        b > TrgObject.CNO_NUMBER_MAX:
00262       raise IndexError, "CnoNumber is out of range"
00263
00264     self.__cmd.CNO_0 = ( a & 0xf )
00265     self.__cmd.CNO_1 = ( b & 0xf )
00266     self.reset()
00267
00268 class TrgGemCnoStats(TrgCnoStats):
00269   """\brief TrgGemCnoStats
00270
00271   This class implements the HW abstraction corresponding to
00272   figure 64 of the GEM document: LAT-01545 Section 2.5
00273   """
00274   def __init__(self,glt):
00275     """\brief TrgGemCnoStats constructor
00276     """
00277     TrgCnoStats.__init__(self)
00278     if glt is not None:
00279       self.__cmd = glt.downGEMST()
00280     else:
00281       self.__cmd = None
00282
00283   def A(self):
00284     return self.__cmd.CNO_COUNTERS & 0xffff
00285
00286   def B(self):
00287     return ( self.__cmd.CNO_COUNTERS >> 16 ) & 0xffff
00288
00289 # ###########
00290
00291 class TrgGemCmdCounters(TrgCmdCounters):
00292   """\brief TrgGemCmdCounters
00293
00294   This class implements the HW abstraction corresponding to
00295   figure 62 of the GEM document: LAT-01545 Section 2.3.4
00296   """
00297   def __init__(self,glt):
00298     """\brief TrgGemCmdCounters constructor
00299     """
00300     TrgCmdCounters.__init__(self)
00301     self.__stats = TrgGemCmdStats(glt)
00302     if glt is not None:
00303       self.__cmd = glt.downGEMC()
00304     else:
00305       self.__cmd = None
00306
00307   def stats(self):
00308     return self.__stats
00309
00310   def reset(self):
00311     """\brief reset() member function
00312
00313     Reset the command/response statistics register
00314     """
00315     self.__cmd.CR_STATISTICS = 0
00316
00317 class TrgGemCmdStats(TrgCmdStats):
00318   """\brief TrgGemCmdStats
00319
00320   This class implements the HW abstraction corresponding to
00321   figure 62 of the GEM document: LAT-01545 Section 2.3.4
00322   """
00323   def __init__(self,glt):
00324     """\brief TrgGemCmdStats constructor
00325     """
00326     TrgCmdStats.__init__(self)
00327     if glt is not None:
00328       self.__cmd = glt.downGEMC()
00329     else:
00330       self.__cmd = None
00331
00332   def command(self):
00333     return ( self.__cmd.CR_STATISTICS >> 16 ) & 0xffff
00334
00335   def response(self):
00336     return ( self.__cmd.CR_STATISTICS       ) & 0xffff
00337
00338 # ###########
00339
00340 class TrgGemEventCounter(TrgEventCounter):
00341   """\brief TrgGemEventCounter
00342
00343   This class implements the HW abstraction corresponding to
00344   figure 63 of the GEM document: LAT-01545 Section 2.3.6
00345   """
00346   def __init__(self,glt):
00347     """\brief TrgGemEventCounter constructor
00348     """
00349     TrgEventCounter.__init__(self)
00350     if glt is not None:
00351       self.__cmd = glt.downGEMC()
00352     else:
00353       self.__cmd = None
00354
00355   def stats(self):
00356     return ( self.__cmd.EVENT_STATISTICS ) & 0xffff
00357
00358   def reset(self):
00359     """\brief reset() member function
00360
00361     Reset the event statistics register
00362     """
00363     self.__cmd.EVENT_STATISTICS = 0
00364
00365 class TrgGemPPSTimer(TrgPPSTimer):
00366   """\brief TrgGemPPSTimer class definition
00367   This class HW abstraction corresponding to
00368   figure 75 of the GEM document: LAT-01545 Section 2.6.4
00369   """
00370   def __init__(self,glt):
00371     """\brief TrgGemPPSTimer constructor
00372     """
00373     TrgPPSTimer.__init__(self)
00374     if glt is not None:
00375       self.__cmd = glt.downGEMST()
00376     else:
00377       self.__cmd = None
00378
00379   def seconds(self):
00380     return ( self.__cmd.ONE_PPS >> 25 ) & 0x7f
00381
00382   def timebase(self):
00383     return ( self.__cmd.ONE_PPS       ) & 0x1ffffff
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemPeriodicCondition.py Source File

trigger

TrgGemPeriodicCondition.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Trigger Object class"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 """TrgGemPeriodicCondition: Hardware implementation of TrgPeriodicCondition"""
00021
00022 from TrgPeriodic import TrgPeriodicCondition
00023
00024 class TrgGemPeriodicCondition(TrgPeriodicCondition):
00025   """\brief Trigger Periodic Condition class definition
00026   """
00027
00028   def __init__(self): # constructor...
00029     TrgPeriodicCondition.__init__(self)
00030     self.__gem = None
00031
00032   def __setGEM(self, gem):
00033     self.__gem = gem
00034
00035   def remaining(self):
00036     """\brief remaining() method
00037     See base class
00038     """
00039     return self.__gem.GEMC.PERIODIC_LIMITS
00040
00041   def reset(self):
00042     """\brief reset() method
00043     See base class
00044     """
00045     self.__gem.GEMC.PERIODIC_LIMITS = 0
00046     self.__gem.GEMC.PERIODIC_LIMITS = self.limit()
00047
00048   def abort(self):
00049     """\brief abort() method
00050     See base class
00051     """
00052     self.__gem.GEMC.PERIODIC_LIMITS = 0
00053
00054
00055   def source(self):
00056     """\brief source() method
00057     See base class
00058     """
00059     return self.definition().source()
00060
00061   def prescale(self):
00062     """\brief prescale() method
00063     See base class
00064     """
00065     return self.definition().prescale()
00066
00067   def limit(self):
00068     """\brief limit() method
00069     See base class
00070     """
00071     return self.definition().limit()
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemRegisterGeometry.py Source File

trigger

TrgGemRegisterGeometry.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Trigger Object class"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.2 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 import LDF
00021
00022 """TrgGemRegisterGeometry: Define the mapping between tile number and tile name"""
00023
00024
00025 class ACDmap(LDF.ACDmap):
00026   """An implementation of LDF.ACDmap that forces a particular LATtypeId()
00027   """
00028   def __init__(self, gemVersion = None):
00029     LDF.ACDmap.__init__(self)
00030     self.__setLatId(gemVersion)
00031
00032   def __setLatId(self, gemVersion):
00033     if gemVersion is None:   # Take the most recent one
00034       self.__latId = LDF.LATtypeId(LDF.EBFevent.ID)
00035     else:                    # have a gemVersion, parse it.
00036       (type, board) = self.__parseGemVersion(gemVersion)
00037       if board == 0:         # Original, screwy board.
00038         self.__latId = LDF.LATtypeId(LDF.EBFevent.ID_3)
00039       else:
00040         self.__latId = LDF.LATtypeId(LDF.EBFevent.ID)
00041     return
00042
00043   def __parseGemVersion(self, gemVersion):
00044     board = ( gemVersion >> (16 + 12) ) & 0x3
00045     type  = ( gemVersion >> (16 + 14) ) & 0x3
00046     return (type, board)
00047
00048   def lookup(self, cable, channel):
00049     return LDF.ACDmap.lookup(self, self.__latId, cable, channel)
00050
00051   def freeName(self, cable):
00052     return LDF.ACDmap.freeName(self, self.__latId, cable)
00053
00054
00055
00056
00057
00058 AcdTileNumbering = {# "TileName" : TileNumber(hex)
00059   "000" : 0x00, "001" : 0x01, "002" : 0x02, "003" : 0x03,
00060   "004" : 0x04, "010" : 0x05, "011" : 0x06, "012" : 0x07,
00061   "013" : 0x08, "014" : 0x09, "020" : 0x0A, "021" : 0x0B,
00062   "022" : 0x0C, "023" : 0x0D, "024" : 0x0E, "030" : 0x0F,
00063   "031" : 0x10, "032" : 0x11, "033" : 0x12, "034" : 0x13,
00064   "040" : 0x14, "041" : 0x15, "042" : 0x16, "043" : 0x17,
00065   "044" : 0x18, "NA2" : 0x19, "NA3" : 0x1A, "100" : 0x1B,
00066   "101" : 0x1C, "102" : 0x1D, "103" : 0x1E, "104" : 0x1F,
00067   "110" : 0x20, "111" : 0x21, "112" : 0x22, "113" : 0x23,
00068   "114" : 0x24, "120" : 0x25, "121" : 0x26, "122" : 0x27,
00069   "123" : 0x28, "124" : 0x29, "130" : 0x2A, "NA4" : 0x2B,
00070   "NA5" : 0x2C, "200" : 0x2D, "201" : 0x2E, "202" : 0x2F,
00071   "203" : 0x30, "204" : 0x31, "210" : 0x32, "211" : 0x33,
00072   "212" : 0x34, "213" : 0x35, "214" : 0x36, "220" : 0x37,
00073   "221" : 0x38, "222" : 0x39, "223" : 0x3A, "224" : 0x3B,
00074   "230" : 0x3C, "NA6" : 0x3D, "NA7" : 0x3E, "300" : 0x3F,
00075   "301" : 0x40, "302" : 0x41, "303" : 0x42, "304" : 0x43,
00076   "310" : 0x44, "311" : 0x45, "312" : 0x46, "313" : 0x47,
00077   "314" : 0x48, "320" : 0x49, "321" : 0x4A, "322" : 0x4B,
00078   "323" : 0x4C, "324" : 0x4D, "330" : 0x4E, "NA8" : 0x4F,
00079   "NA9" : 0x50, "400" : 0x51, "401" : 0x52, "402" : 0x53,
00080   "403" : 0x54, "404" : 0x55, "410" : 0x56, "411" : 0x57,
00081   "412" : 0x58, "413" : 0x59, "414" : 0x5A, "420" : 0x5B,
00082   "421" : 0x5C, "422" : 0x5D, "423" : 0x5E, "424" : 0x5F,
00083   "430" : 0x60, "NA0" : 0x61, "NA1" : 0x62, "500" : 0x63,
00084   "501" : 0x64, "502" : 0x65, "503" : 0x66, "600" : 0x67,
00085   "601" : 0x68, "602" : 0x69, "603" : 0x6A, "NA10" : 0x6B
00086   }
00087
00088 RoiRegisterMap = { # address : [ "tileName0", "tileName1" ]
00089    0 : [ "000", "001" ],  1 : [ "002", "003" ],
00090    2 : [ "004", "010" ],  3 : [ "011", "012" ],
00091    4 : [ "013", "014" ],  5 : [ "020", "021" ],
00092    6 : [ "022", "023" ],  7 : [ "024", "030" ],
00093    8 : [ "031", "032" ],  9 : [ "033", "034" ],
00094   10 : [ "040", "041" ], 11 : [ "042", "043" ],
00095   12 : [ "044", "NA2" ], 13 : [ "NA3", "100" ],
00096   14 : [ "101", "102" ], 15 : [ "103", "104" ],
00097   16 : [ "110", "111" ], 17 : [ "112", "113" ],
00098   18 : [ "114", "120" ], 19 : [ "121", "122" ],
00099   20 : [ "123", "124" ], 21 : [ "130", "NA4" ],
00100   22 : [ "NA5", "200" ], 23 : [ "201", "202" ],
00101   24 : [ "203", "204" ], 25 : [ "210", "211" ],
00102   26 : [ "212", "213" ], 27 : [ "214", "220" ],
00103   28 : [ "221", "222" ], 29 : [ "223", "224" ],
00104   30 : [ "230", "NA6" ], 31 : [ "NA7", "300" ],
00105   32 : [ "301", "302" ], 33 : [ "303", "304" ],
00106   34 : [ "310", "311" ], 35 : [ "312", "313" ],
00107   36 : [ "314", "320" ], 37 : [ "321", "322" ],
00108   38 : [ "323", "324" ], 39 : [ "330", "NA8" ],
00109   40 : [ "NA9", "400" ], 41 : [ "401", "402" ],
00110   42 : [ "403", "404" ], 43 : [ "410", "411" ],
00111   44 : [ "412", "413" ], 45 : [ "414", "420" ],
00112   46 : [ "421", "422" ], 47 : [ "423", "424" ],
00113   48 : [ "430", "NA0" ], 49 : [ "NA1", "500" ],
00114   50 : [ "501", "502" ], 51 : [ "503", "600" ],
00115   52 : [ "601", "602" ], 53 : [ "603", "NA10"]
00116   }
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemRegisters.py Source File

trigger

TrgGemRegisters.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Coincidence based Trigger System Interface classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.10 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 from TrgObject              import TrgObject
00022 from TrgGemAbstract         import TrgGemAbstract
00023 from TrgGemRegisterGeometry import AcdTileNumbering
00024 from TrgGemRegisterGeometry import RoiRegisterMap
00025
00026 """TrgGemRegisters: Register shape defintions for a GASU trigger system"""
00027
00028
00029 class TrgGemRegisters(TrgGemAbstract):
00030   """\brief TrgGemRegisters class definition
00031
00032   Implements the register shape definitions for a GASU trigger system
00033   """
00034   ROI_REGISTER_MIN   =  0
00035   ROI_REGISTER_MAX   = 53
00036   TILE_REGISTER_MIN  =  0
00037   TILE_REGISTER_MAX  = 11
00038   TILE_REGISTER_SIZE =  9
00039   NULLENGINE         = 0xe
00040
00041   def __init__(self):
00042     """\brief TrgGem constructor
00043     """
00044     TrgGemAbstract.__init__(self)
00045
00046   # protected:
00047   def configurationRegister(self):
00048     """\brief configurationRegister() method
00049
00050     Method to construct the value of the GEM configuration register
00051     \return An integer
00052     """
00053     # Configuration register format defined in LAT-01545-03: Sec 2.3.1
00054     conf = 0x0
00055     conf |= ( self.useAcdAsTrigger()          )  << 0
00056     conf |= ( self.responseHeaderParityEven() )  << 1
00057     conf |= ( self.responseDataParityEven()   )  << 2
00058     conf |= ( self.eventHeaderParityEven()    )  << 3
00059     conf |= ( self.eventDataParityEven()      )  << 4
00060     conf |= ( self.triggerParityEven()        )  << 5
00061     conf |= ( self.inhibitContribution()      )  << 6
00062     conf |= ( self.version() & 0xffffL        )  << 16  # meaningless.  Field is RO
00063
00064     return conf
00065
00066   def widthRegister(self):
00067     """\brief widthRegister method
00068
00069     \return integer
00070
00071     Returns a 32 bit integer corresponding to the WINDOW_WIDTH register
00072     of the GEM. Ref: LAT-TD-01545, S 2.9.1
00073     """
00074     return (self.width() & 0x1f)
00075
00076   def periodicRateRegister(self):
00077     """\brief periodicRateRegister method
00078
00079     \return integer
00080
00081     Returns a 32 bit integer corresponding to the PERIODIC_RATE register
00082     of the GEM. Ref: LAT-TD-01545, S 2.3.3.1
00083     """
00084     # prescale is 24 bits.
00085     rate = 0
00086     rate |= ( self.periodicCondition().definition().prescale() & 0xffffff  )
00087     rate |= ( self.periodicCondition().definition().source()   & 0x1       ) << 31
00088     return rate
00089
00090   def periodicModeRegister(self):
00091     """\brief periodicModeRegister method
00092
00093     \return integer
00094
00095     Returns a 32 bit integer corresponding to the PERIODIC_MODE register
00096     of the GEM. Ref: LAT-TD-01545, S 2.3.3.2
00097     """
00098     mode = 1
00099     if self.periodicCondition().definition().limit() != 0:
00100       mode = 0
00101     return mode
00102
00103   def periodicLimitRegister(self):
00104     """\brief periodicLimitRegister method
00105
00106     \return integer
00107
00108     Returns a 32 bit integer corresponding to the PERIODIC_LIMITS register
00109     of the GEM. Ref: LAT-TD-01545, S 2.3.3.3
00110     """
00111     limit = 0
00112     limit |= ( self.periodicCondition().definition().limit() & 0xffffL )
00113     return limit
00114
00115   def sequenceRegister(self):
00116     """\brief sequenceRegister method
00117
00118     \return integer
00119
00120     Returns a 32 bit integer corresponding to the SEQUENCE register
00121     of the GEM. Ref: LAT-TD-01545, S 2.3.4
00122     """
00123     # yes, this is 17 bits...
00124     seq = 0
00125     seq |= ( self.sequence().definition().eventTag()    & 0x3    )
00126     seq |= ( self.sequence().definition().eventNumber() & 0x7fffL ) << 2
00127     return seq
00128
00129   def templateRegister(self, registerNumber):
00130     """\brief templateRegister method
00131
00132     \param registerNumber  An registerNumber value
00133     \return integer
00134
00135     Returns a 32 bit integer corresponding to the message engine
00136     template register of the TAM.  Ref: LAT-TD-01545, S 2.5
00137     Context portion is defined in 1.8.6.1
00138     """
00139     # note:  There is an exact correspondence between the engineNumber
00140     #        and the registerNumber
00141
00142     if registerNumber < TrgObject.ENGINE_NUMBER_MIN or \
00143        registerNumber > TrgObject.ENGINE_NUMBER_MAX:
00144       raise IndexError, "Register index out of bounds"
00145     eng = self.engines().engine(registerNumber)
00146     return self.__parseEngine(eng)
00147
00148   def __parseEngine(self, eng):
00149     presc = eng.prescale()
00150     if presc < 0:
00151       inhibit = 1
00152       presc = 0
00153     else:
00154       inhibit = 0
00155
00156     reg      = 0
00157     reg     |= ( presc                     & 0xff )
00158     reg     |= ( inhibit                   & 0x1  ) << 15
00159
00160     engReq   = eng.request()
00161     calstr   = ( engReq.sequence()     & 0x2  ) >> 1
00162     tack     = ( engReq.sequence()     & 0x1  )
00163     context  = 0
00164     context |= ( calstr                & 0x1  )
00165     # 2 bits for tag
00166     context |= ( tack                  & 0x1  ) << 3
00167     context |= ( engReq.fourRange()    & 0x1  ) << 4
00168     context |= ( engReq.zeroSuppress() & 0x1  ) << 5
00169     context |= ( engReq.marker()       & 0x7  ) << 6
00170     context |= ( engReq.destination()  & 0x3f ) << 9
00171
00172     reg |= ( context                & 0xffffL ) << 16
00173
00174     return reg
00175
00176   def lookupTableRegister(self, registerNumber):
00177     """\brief lookupTableRegister method
00178
00179     \param registerNumber  A reference into the Scheduler register set
00180     \return integer
00181
00182     Returns a 32 bit integer referencing the TAM generator used for a
00183     particular trigger summary
00184     Ref: LAT-TD-01545, S 2.7
00185     """
00186     nReg = ( TrgObject.CONDITIONS_NUMBER_MAX + 1 ) / 8
00187     if registerNumber < 0 or registerNumber > nReg:
00188       raise IndexError, "Register index out of bounds"
00189
00190     reg = 0
00191     for contrib in range(8):
00192       reg |= ( self.__lutEntry(contrib + (registerNumber << 3)) << (contrib << 2L) )
00193     return reg
00194
00195   def __lutEntry(self, conditionValue):
00196     engineSet = self.engines()
00197     for engineNumber in range(TrgObject.ENGINE_NUMBER_MAX+1):
00198       if engineSet.engine(engineNumber).participate(conditionValue):
00199         return engineNumber
00200
00201     return TrgGemRegisters.NULLENGINE  # Condition value has no engine.  Disable it.
00202
00203   def roiRegister(self, registerNumber):
00204     """\brief roiRegister method
00205
00206     \param registerNumber  A reference into the ROI generator registers
00207     \return integer
00208
00209     Returns a 32 bit integer referencing the 54 ROI registers defined in
00210     Ref: LAT-TD-01545, S 2.8
00211     """
00212     # two ways to define this register.  1)  ACD is trigger  (coincidence mode)
00213     #                                    2)  ACD is veto     (shadow mode)
00214     # The code is the same regardless of intent.  :-)
00215     if registerNumber < TrgGemRegisters.ROI_REGISTER_MIN or \
00216        registerNumber > TrgGemRegisters.ROI_REGISTER_MAX:
00217       raise IndexError, "Register index out of bounds"
00218
00219     reg = 0
00220     roiSet = self.roi()
00221     # RoiRegisterMap[n] returns ("name0","name1")
00222     # AcdTileNumbering["name"] returns tile number
00223     tile0 = AcdTileNumbering[ RoiRegisterMap[registerNumber][0] ]
00224     tile1 = AcdTileNumbering[ RoiRegisterMap[registerNumber][1] ]
00225     reg |= ( self.__roiValue(roiSet, tile0) & 0xffffL )
00226     reg |= ( self.__roiValue(roiSet, tile1) & 0xffffL ) << 16
00227     return reg
00228
00229   def __roiValue(self, roiSet, tileNumber):
00230     """ constructs either:
00231         a) the set of 8 region pairs that define the 16 bits of coincidence info
00232         b) the tower mask information
00233         The code is the same regardless of intent.  :-)
00234
00235         \param roiSet is passed to save function overhead.
00236         \param tileNumber As elsewhere
00237         c.f. figure 75, 76, 77, LAT-TD-01545
00238     """
00239     pairSet = 0
00240     for region in range(TrgObject.ROI_NUMBER_MAX + 1):
00241       bit = roiSet.roi(region).tile(tileNumber)  # tile returns 1 or 0
00242       pairSet |= (bit << region)
00243     return pairSet
00244
00245   def towerEnableRegister(self, registerNumber):
00246     """\brief towerEnableRegister method
00247
00248     \param registerNumber A reference into the tower enable registers
00249     \return integer
00250
00251     Returns a 32 bit object corresponding to figures 78/79 of the GEM
00252     documentation.  This is used to construct the registers
00253     TOWERS_0_3, etc.
00254     Ref: LAT-TD-01545, 2.9.1
00255     """
00256     # 4 towers/register
00257     nReg = ( TrgObject.TOWER_NUMBER_MAX + 1 ) / 4
00258     if registerNumber < 0 or registerNumber > nReg:
00259       raise IndexError, "Register index out of bounds"
00260
00261     reg = 0
00262     for twr in range(4):
00263       reg |= ( self.__tower3bit(twr + (registerNumber << 2)) << twr*3 )
00264     return reg
00265
00266   def __tower3bit(self, towerIndex):
00267     if towerIndex < TrgObject.TOWER_NUMBER_MIN or \
00268        towerIndex > TrgObject.TOWER_NUMBER_MAX:
00269       raise IndexError, "towerIndex out of bounds"
00270
00271     tower = self.inputEnables().towers().tower(towerIndex)
00272     twr = 0
00273     if tower is not None:
00274       twr |= ( tower.calorimeter().useLowEnergy()  & 0x1 )
00275       twr |= ( tower.calorimeter().useHighEnergy() & 0x1 ) << 1
00276       twr |= ( tower.tracker().use()               & 0x1 ) << 2
00277
00278     return twr
00279
00280   def towerBusyEnableRegister(self):
00281     """\brief towerBusyEnableRegister method
00282
00283     \return integer
00284
00285     Returns a 32 bit integer corresponding to the Tower Busy enable register
00286     """
00287     twrBusy = 0
00288     towerBusy = self.inputEnables().towerBusy()
00289     for tower in range(TrgObject.TOWER_NUMBER_MAX +1):
00290       # # Tower is ON if one or more of the inputs is enabled
00291       # if self.__tower3bit(tower) != 0:
00292         # twrBusy |= ( 1 << tower )
00293       if towerBusy.tower(tower):
00294         twrBusy |= ( 1 << tower )
00295
00296     return twrBusy
00297
00298   def externalEnableRegister(self):
00299     """\brief externalEnableRegister method
00300
00301     \return integer
00302
00303     Returns a 32 bit integer corresponding to the external enable register
00304     """
00305     ext = 0
00306     if self.inputEnables().external().external():
00307       ext = 0x1
00308     return ext
00309
00310   def cnoEnableRegister(self):
00311     """\brief cnoEnableRegister method
00312
00313     \return integer
00314
00315     Returns a 32 bit integer corresponding to the ACD CNO enable register
00316     Ref: LAT-TD-01545, 2.9.2
00317     """
00318
00319     enab = self.inputEnables().cno()
00320     cno = 0
00321     cno |= ( enab.LA1() & 0x1 )
00322     cno |= ( enab.RB1() & 0x1 ) << 1
00323     cno |= ( enab.LA2() & 0x1 ) << 2
00324     cno |= ( enab.LB2() & 0x1 ) << 3
00325     cno |= ( enab.RA2() & 0x1 ) << 4
00326     cno |= ( enab.RB2() & 0x1 ) << 5
00327     cno |= ( enab.LA3() & 0x1 ) << 6
00328     cno |= ( enab.RB3() & 0x1 ) << 7
00329     cno |= ( enab.LA4() & 0x1 ) << 8
00330     cno |= ( enab.LB4() & 0x1 ) << 9
00331     cno |= ( enab.RA4() & 0x1 ) << 10
00332     cno |= ( enab.RB4() & 0x1 ) << 11
00333
00334     return cno
00335
00336   def tileEnableRegister(self, registerNumber):
00337     """\brief tileEnableRegister method
00338
00339     \param registerNumber
00340     \return integer
00341
00342     Returns a 32 bit integer corresponding to the ACD tile enable register.
00343     Ref: LAT-TD-01545, 2.9.3
00344     """
00345     # 108 'real' tiles, 9 tiles/register --> 12 registers
00346     if registerNumber < TrgGemRegisters.TILE_REGISTER_MIN or \
00347        registerNumber > TrgGemRegisters.TILE_REGISTER_MAX:
00348       raise IndexError, "registerNumber out of bounds"
00349
00350     reg = 0
00351
00352     tto = self.inputEnables().tiles()
00353     for t in range(TrgGemRegisters.TILE_REGISTER_SIZE):
00354       tile = t + (TrgGemRegisters.TILE_REGISTER_SIZE) * registerNumber
00355       reg |= ( tto.tile(tile) & 0x1 ) << t
00356       reg |= ( tto.tile(tile) & 0x2 ) << (t+8)  # using 1 bit offset here
00357     return reg
00358
00359
00360   # Pure virtual function implementation
00361   # Defaults from ACD Roadmap document
00362   def width(self):
00363     return 0x5
00364
00365   def responseHeaderParityEven(self):
00366     return False
00367
00368   def responseDataParityEven(self):
00369     return False
00370
00371   def eventHeaderParityEven(self):
00372     return False
00373
00374   def eventDataParityEven(self):
00375     return False
00376
00377   def triggerParityEven(self):
00378     return False
00379
00380   def inhibitContribution(self):
00381     return False
00382
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgGemSequence.py Source File

trigger

TrgGemSequence.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Trigger Sequence Interface classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 """TrgGemSequence: Hardware implementation of TrgSequence"""
00021
00022 from TrgSequence import TrgSequence
00023 from TrgSequence import TrgDefaultSequence
00024
00025
00026 class TrgGemSequence(TrgSequence):
00027   """\brief TrgGemSequence
00028   Hardware abstraction for TrgSequence
00029   """
00030   def __init__(self): # constructor...
00031     """\brief TrgGemSequence constructor
00032     """
00033     TrgSequence.__init__(self)
00034     self.__gem = None
00035
00036   def __setGEM(self, gem):
00037     self.__gem = gem
00038
00039
00040   def eventNumber(self):
00041     """\brief eventNumber() method
00042     Returns 0
00043     """
00044     return ( self.__gem.GEMC.SEQUENCE & 0x1fffc ) >> 2
00045
00046   def eventTag(self):
00047     """brief eventTag() method
00048     Returns 0
00049     """
00050     return ( self.__gem.GEMC.SEQUENCE & 0x3 )
00051
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgInputEnables.py Source File

trigger

TrgInputEnables.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Trigger Input Enable Interface classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.2 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 from TrgObject import TrgObject
00022
00023
00024 """TrgInputEnables: Interface for Trigger Input Enables"""
00025
00026
00027 class TrgInputEnables(TrgObject):
00028   """\brief Trigger Input Enables class definition
00029   """
00030   def __init__(self):
00031     """\brief TrgInputEnables constructor
00032     """
00033     pass
00034
00035   def towers(self):
00036     """\brief Towers 'pure virtual' method
00037
00038     \return A TrgTowerEnables object
00039     """
00040     raise NotImplementedError
00041     pass
00042
00043   def cno(self):
00044     """\brief Cno 'pure virtual' method
00045
00046     \return A TrgCnoEnables object
00047     """
00048     raise NotImplementedError
00049     pass
00050
00051   def tiles(self):
00052     """\brief Tiles 'pure virtual' method
00053
00054     \return A TrgTileEnables object
00055     """
00056     raise NotImplementedError
00057     pass
00058
00059   def towerBusy(self):
00060     """\brief Tiles 'pure virtual' method
00061
00062     \return A TrgTowerBusyEnables object
00063     """
00064     raise NotImplementedError
00065     pass
00066
00067   def external(self):
00068     """\brief Tiles 'pure virtual' method
00069
00070     \return A TrgExtEnables object
00071     """
00072     raise NotImplementedError
00073     pass
00074
00075
00076 class TrgTowerEnables(TrgObject):
00077   """\brief Trigger Tower Enables class definition
00078   """
00079   def __init__(self):
00080     """\brief TrgTowerEnables constructor
00081     """
00082     pass
00083
00084   def towers(self):
00085     """\brief towers() 'pure virtual' method
00086
00087     \return a TrgTowers object
00088     """
00089     pass
00090
00091 class TrgCnoEnables(TrgObject):
00092   """\brief Trigger CNO Enables class definition
00093   """
00094   def __init__(self):
00095     """\brief TrgCnoEnables constructor
00096     """
00097     pass
00098
00099   def LA1(self):
00100     """\brief LA1 'virtual' method
00101
00102     \return A boolean
00103     """
00104     return False
00105
00106   def RB1(self):
00107     """\brief RB1 'virtual' method
00108
00109     \return A boolean
00110     """
00111     return False
00112
00113   def LA2(self):
00114     """\brief LA2 'virtual' method
00115
00116     \return A boolean
00117     """
00118     return False
00119
00120   def LB2(self):
00121     """\brief LB2 'virtual' method
00122
00123     \return A boolean
00124     """
00125     return False
00126
00127   def RA2(self):
00128     """\brief RA2 'virtual' method
00129
00130     \return A boolean
00131     """
00132     return False
00133
00134   def RB2(self):
00135     """\brief RB2 'virtual' method
00136
00137     \return A boolean
00138     """
00139     return False
00140
00141   def LA3(self):
00142     """\brief LA3 'virtual' method
00143
00144     \return A boolean
00145     """
00146     return False
00147
00148   def RB3(self):
00149     """\brief RB3 'virtual' method
00150
00151     \return A boolean
00152     """
00153     return False
00154
00155   def LA4(self):
00156     """\brief LA4 'virtual' method
00157
00158     \return A boolean
00159     """
00160     return False
00161
00162   def LB4(self):
00163     """\brief LB4 'virtual' method
00164
00165     \return A boolean
00166     """
00167     return False
00168
00169   def RA4(self):
00170     """\brief RA4 'virtual' method
00171
00172     \return A boolean
00173     """
00174     return False
00175
00176   def RB4(self):
00177     """\brief RB4 'virtual' method
00178
00179     \return A boolean
00180     """
00181     return False
00182
00183
00184 class TrgTileEnables(TrgObject):
00185   """\brief Trigger Tile Enables class definition
00186   """
00187   def __init__(self):
00188     """\brief TrgTileEnables constructor
00189     """
00190     pass
00191
00192   def tile(self, tileNumber):
00193     """\brief Tile 'pure virtual' method
00194
00195     \param tileNumber A tile number
00196     \return An integer
00197     """
00198     raise NotImplementedError
00199     pass
00200
00201 class TrgTowerBusyEnables(TrgObject):
00202   """\brief Trigger Tower Busy Enables class definition
00203   """
00204   def __init__(self):
00205     """\brief TrgTowerBusyEnables constructor
00206     """
00207     pass
00208
00209   def tower(self, towerNumber):
00210     """\brief tower 'pure virtual' method
00211
00212     \param towerNumber A tower number
00213     \return A boolean
00214     """
00215     raise NotImplementedError
00216     pass
00217
00218 class TrgExtEnables(TrgObject):
00219   """\brief Trigger External Enables class definition
00220   """
00221   def __init__(self):
00222     """\brief TrgExtEnables constructor
00223     """
00224     pass
00225
00226   def external(self):
00227     """\brief tower 'pure virtual' method
00228
00229     \return A boolean
00230     """
00231     raise NotImplementedError
00232     pass
00233
Generated on Fri Jul 21 13:26:33 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgMiniGLT.py Source File

trigger

TrgMiniGLT.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Coincidence based Trigger System Interface classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.4 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 from TrgMiniGLTRegisters import TrgMiniGLTRegisters
00021 from TrgConditionsValue  import TrgConditionsValue
00022 from TrgObject           import TrgObject
00023
00024 """TrgMiniGLT: This file implements the hardware register access to the MiniGLT"""
00025
00026 class TrgMiniGLT(TrgMiniGLTRegisters):
00027   """\brief Mini GLT Hardware abstraction implementation
00028   """
00029
00030   __SWEEP_MARKER = 5
00031   __SOLICIT_MASK = ~0x01
00032
00033   def __init__(self):
00034     """\brief TrgMiniGLT constructor
00035     """
00036     TrgMiniGLTRegisters.__init__(self)
00037     self.__glt       = None
00038
00039   def __commit(self):
00040     """\brief commit function
00041     This function commits the configuration defined by this
00042     TrgMiniGLT object to the hardware.  It does *all* the registers.
00043     """
00044     glt = self.GLT()
00045
00046     # set all engine destination addresses.
00047     # Because engines can't have a real HW dependence, this is done by cheating:
00048     #   replace each instance of the TrgEngineRequest.destination function
00049     #   with a local private function.
00050     for engineNo in range(TrgObject.ENGINE_NUMBER_MAX + 1):
00051       self.engines().engine(engineNo).request().destination = self.__getDestinationFromEPU
00052
00053     glt.PARITY               = self.parity()
00054     glt.TAG                  = self.tag()
00055     glt.EVENT_NUMBER         = self.eventNumber()
00056     glt.DESTINATION          = self.destination()
00057     glt.MARKER               = self.marker()
00058     glt.TACK                 = self.tack()
00059     glt.ZERO_SUPPRESS        = self.zeroSuppress()
00060     glt.FOUR_RANGE_READOUT   = self.fourRangeReadout()
00061     glt.CAL_STROBE           = self.calStrobe()
00062
00063     glt.MASK                 = ~0              # everything disabled by default
00064
00065   def GLT(self, glt = None):
00066     """\brief GLT function
00067     \params glt:  a GGLT object
00068     This function sets the GLT hardware implementation used by
00069     TrgGem.
00070     """
00071     if glt is not None:
00072       self.__glt = glt
00073       self.__epuaddr = glt.getEPUaddr()
00074     return self.__glt
00075
00076   def __getDestinationFromEPU(self):
00077     return self.__epuaddr
00078
00079   ############### Pure virtual function implementation
00080   def solicit(self):
00081     # transmit the GEM's TRIGGER dataless command
00082     self.GLT().CMD_SELF_TRIGGER = 1
00083
00084   def enable(self, mask=None):
00085     if mask is not None:
00086       outMask = mask
00087     elif self.__condValue is not None:
00088       outMask = ~self.conditions().value()          # remember the MiniGLT has ~logic
00089     else:
00090       raise AssertionError, "Attempting to enable a TrgConditionsValue of None"
00091
00092     self.GLT().MASK = outMask
00093     self.GLT().enableMask()
00094
00095   def disable(self):
00096     self.GLT().disableMask()
00097
00098   def shut(self, marker):
00099     """Implementation of the shut function.
00100     """
00101
00102     #0) disable triggers
00103     self.disable()
00104
00105     #1) Set up marker logic
00106     glt = self.GLT()
00107
00108     mask           = glt.MASK           # Cache Mask, CalStrobe and Tack
00109     calStrobe      = glt.CAL_STROBE
00110     tack           = glt.TACK
00111
00112     glt.MASK       = TrgMiniGLT.__SOLICIT_MASK # Enable internal trigger only
00113     glt.MARKER     = marker             # Signal that we're sweeping
00114     glt.CAL_STROBE = 0                  # Don't inject charge
00115     glt.TACK       = 0                  # Don't force a readout
00116     glt.enableMask()
00117     self.solicit()                      # Solicit a trigger
00118     glt.disableMask()
00119
00120     #4) Put the original contents of scheduler 0x40 back, and put the TAM back
00121     glt.CAL_STROBE = calStrobe
00122     glt.TACK       = tack
00123     glt.MARKER     = 0
00124     glt.MASK       = mask
00125
00126     #5) Put the trigger conditions back
00127     glt.enableMask()
00128
00129
00130 class MiniGLTTrgConditionsValue(TrgConditionsValue):
00131   """This class overrides the value() method of TrgConditionsValue
00132      as the MiniGLT has a different bitmap for the MASK register.
00133      It also provides the external() function.
00134
00135      Use this class instead of TrgConditionsValue for MiniGLT operations.
00136   """
00137   def __init__(self):
00138     TrgConditionsValue.__init__(self)
00139
00140   def value(self):
00141     val = 0
00142     val |= ( self.solicited()   & 0x1 )  << 0
00143     val |= ( self.external()    & 0x1 )  << 1
00144     val |= ( self.calLow()      & 0x1 )  << 2
00145     val |= ( self.calHigh()     & 0x1 )  << 3
00146     val |= ( self.tkr()         & 0x1 )  << 4
00147     return val
00148
00149   def external(self):
00150     return False
00151
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgMiniGLTAbstract.py Source File

trigger

TrgMiniGLTAbstract.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Coincidence based Trigger System Interface classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 """TrgMiniGLTAbstract: Abstract interface for MiniGLT based systems. """
00021
00022 from TrgAbstract import TrgAbstract
00023
00024 class TrgMiniGLTAbstract(TrgAbstract):
00025   """\brief TrgMiniGLTAbstract Interface class definition
00026   This class inherits from TrgAbstract to define the structure of
00027   a MiniGLT trigger.
00028   """
00029   def __init__(self):
00030     """\brief TrgMiniGLTAbstract constructor
00031     """
00032     TrgAbstract.__init__(self)
00033
00034   #############  Pure Virtual functions
00035   def parity(self):
00036     """\brief parity() member function
00037     Returns a boolean indicating the state of the parity bitfield
00038     in the configuration register of the MiniGLT
00039     \return a boolean
00040     """
00041     raise NotImplementedError
00042     pass
00043
00044   def tag(self):
00045     """\brief tag() member function
00046     Returns an integer indicating the state of the tag bitfield in
00047     the configuration register of the MiniGLT
00048     \return an integer
00049     """
00050     raise NotImplementedError
00051     pass
00052
00053   def eventNumber(self):
00054     """\brief eventNumber() member function
00055     Returns an integer indicating the starting event number
00056     of the MiniGLT
00057     \return an integer
00058     """
00059     raise NotImplementedError
00060     pass
00061
00062   def destination(self):
00063     """\brief destination() member function
00064     Returns an integer indicating the state of the destination bitfield in
00065     the configuration register of the MiniGLT
00066     \return an integer
00067     """
00068     raise NotImplementedError
00069     pass
00070
00071   def marker(self):
00072     """\brief marker() member function
00073     Returns an integer indicating the state of the marker bitfield in
00074     the configuration register of the MiniGLT
00075     \return an integer
00076     """
00077     raise NotImplementedError
00078     pass
00079
00080   def tack(self):
00081     """\brief tack() member function
00082     Returns a boolean indicating the state of the tack bitfield
00083     in the configuration register of the MiniGLT
00084     \return a boolean
00085     """
00086     raise NotImplementedError
00087     pass
00088
00089   def zeroSuppress(self):
00090     """\brief zeroSuppress() member function
00091     Returns a boolean indicating the state of the zeroSuppress bitfield
00092     in the configuration register of the MiniGLT
00093     \return a boolean
00094     """
00095     raise NotImplementedError
00096     pass
00097
00098   def fourRangeReadout(self):
00099     """\brief fourRangeReadout() member function
00100     Returns a boolean indicating the state of the fourRangeReadout bitfield
00101     in the configuration register of the MiniGLT
00102     \return a boolean
00103     """
00104     raise NotImplementedError
00105     pass
00106
00107   def calStrobe(self):
00108     """\brief calStrobe() member function
00109     Returns a boolean indicating the state of the calStrobe bitfield
00110     in the configuration register of the MiniGLT
00111     \return a boolean
00112     """
00113     raise NotImplementedError
00114     pass
00115
00116
00117
00118
00119
00120
00121
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgMiniGLTRegisters.py Source File

trigger

TrgMiniGLTRegisters.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Coincidence based Trigger System Interface classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 """TrgMiniGLTRegisters: Register shape definitions for a  MiniGLT based trigger system
00021 """
00022
00023 from TrgMiniGLTAbstract import TrgMiniGLTAbstract
00024
00025 class TrgMiniGLTRegisters(TrgMiniGLTAbstract):
00026   """\brief Register shape definition class for the MiniGLT
00027   This class defines the shapes of the registers and bitfields used
00028   in the MiniGLT
00029   """
00030   def __init__(self):
00031     TrgMiniGLTAbstract.__init__(self)
00032
00033   #############  Pure Virtual function implementation from parents
00034   def parity(self):
00035     return 0x0 & 0x1
00036
00037   def tag(self):
00038     return 0x0 & 0x3
00039
00040   def eventNumber(self):
00041     return 0x0 & 0x7fff
00042
00043   def destination(self):
00044     # There are exactly two engines in the MiniGLT.
00045     # 0) User defined engine
00046     # 15) Sweep Marker engine
00047     # Use the user-defined engine for everything.
00048     eng = self.engines().engine(0).request()
00049     return eng.destination()
00050
00051   def marker(self):
00052     eng = self.engines().engine(0).request()
00053     return eng.marker()
00054
00055   def tack(self):
00056     eng = self.engines().engine(0).request()
00057     return ( eng.sequence()     & 0x1  )
00058
00059   def zeroSuppress(self):
00060     eng = self.engines().engine(0).request()
00061     return eng.zeroSuppress()
00062
00063   def fourRangeReadout(self):
00064     eng = self.engines().engine(0).request()
00065     return eng.fourRange()
00066
00067   def calStrobe(self):
00068     eng = self.engines().engine(0).request()
00069     return (( eng.sequence()     & 0x2  ) >> 1)
00070
00071
00072
00073
00074
00075
00076
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgObject.py Source File

trigger

TrgObject.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Trigger Object class"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.3 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 """TrgObject: Base class for the trigger.  Defines useful quantities"""
00022
00023
00024 class TrgObject(object):
00025   """\brief Trigger Object class definition
00026   """
00027   TILE_NUMBER_MIN        = 0
00028   TILE_NUMBER_MAX        = 107
00029   CNO_NUMBER_MIN         = 0
00030   CNO_NUMBER_MAX         = 11
00031   COINCIDENCE_NUMBER_MIN = 0
00032   COINCIDENCE_NUMBER_MAX = 7
00033   ENGINE_NUMBER_MIN      = 0
00034   ENGINE_NUMBER_MAX      = 15
00035   TOWER_NUMBER_MIN       = 0
00036   TOWER_NUMBER_MAX       = 15
00037   CONDITIONS_NUMBER_MIN  = 0
00038   CONDITIONS_NUMBER_MAX  = 0xff
00039   ROI_NUMBER_MIN         = 0
00040   ROI_NUMBER_MAX         = 15
00041
00042   # This unfortunately also impacts derived objects.
00043   # Can we FIX THIS?
00044   def __setattr__(self, name, value):
00045     """Reject attempts to modify TrgObject's constants.
00046     """
00047     assert name not in dir(TrgObject), \
00048            "Attempt made to modify the constant " + \
00049            self.__class__.__name__ + "." + name
00050     object.__setattr__(self, name, value)
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgPeriodic.py Source File

trigger

TrgPeriodic.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Trigger Periodic Interface classes"
00012 __author__   = "M. Huffer <mehsys@slac.stanford.edu> SLAC - GLAST LAT Electronics"
00013 __date__     = "1/14/04"
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 from TrgObject import TrgObject
00022
00023
00024 """TrgPeriodic: Interface for the Periodic Trigger"""
00025
00026 class TrgPeriodicConditionAbstract(TrgObject):
00027   """\brief TrgPeriodicConditionAbstract class definition
00028   """
00029   def __init__(self):
00030     """\brief TrgPeriodicConditionAbstract constructor
00031     """
00032     pass
00033
00034   def source(self):
00035     """\brief source() 'virtual' method
00036     If the returned value is FALSE, the system clock is used as the
00037     source of the periodic condition. If the returned value is TRUE, the 1-PPS signal is
00038     used as the source of the condition.
00039     \return A boolean
00040     """
00041     raise NotImplementedError
00042     pass
00043
00044   def prescale(self):
00045     """\brief prescale() 'virtual' method
00046     Determines how the source signal is prescaled to form the periodic condition.
00047     That is, it sets the rate of the periodic condition. A value of zero does not prescale
00048     the periodic condition. This would, for example, assuming the system clock is
00049     used as source, create a periodic condition which operates at 20 MHZ.
00050     Range: [0 .. 0xffffff]
00051     \return An integer
00052     """
00053     raise NotImplementedError
00054     pass
00055
00056   def limit(self):
00057     """\brief limit() 'virtual' method
00058     Returns the number of iterations of the periodic condition before
00059     the condition stops. A value of zero (0) will cause the periodic condition to
00060     'free-run', or never stop.
00061     \return An integer
00062     """
00063     raise NotImplementedError
00064     pass
00065
00066 class TrgPeriodicCondition(TrgPeriodicConditionAbstract):
00067   """\brief Trigger Periodic Condition class definition
00068   """
00069
00070   def __init__(self): # constructor...
00071     TrgPeriodicConditionAbstract.__init__(self)
00072
00073   def definition(self):
00074     """\brief definition() method
00075     Returns an object of type TrgPeriodicConditionDefinition.
00076     This object will be used to both define the initial values for the
00077     periodic condition and is used by the reset() function to re-establish
00078     the initial limit value.
00079     """
00080     raise NotImplementedError
00081     pass # returns an object of type TrgPeriodicConditionDefinition
00082
00083   def remaining(self):
00084     """\brief remaining() method
00085     Returns the number of iterations remaining before the periodic condition stops.
00086     """
00087     raise NotImplementedError
00088     pass # returns an integer...
00089
00090   def reset(self):
00091     """\brief reset() method
00092     Will cause the periodic condition to stop, regardless of how many iterations are
00093     remaining. It will re-initialize the limit function with the value returned by the
00094     limit function of. If the periodic condition is free running, this function has no
00095     effect.
00096     """
00097     raise NotImplementedError
00098     pass # returns void...
00099
00100   def abort(self):
00101     """\brief abort() method
00102     Will cause the periodic condition to stop, regardless of how many iterations are
00103     remaining. If the periodic condition is free running, this function has no effect.
00104     """
00105     raise NotImplementedError
00106     pass # returns void...
00107
00108 class TrgPeriodicConditionDefinition(TrgPeriodicConditionAbstract):
00109   """\brief TrgPeriodicConditionDefinition class definition
00110   """
00111   def __init__(self):
00112     TrgPeriodicConditionAbstract.__init__(self)
00113
00114
00115 class TrgDefaultPeriodicCondition(TrgPeriodicConditionDefinition):
00116   """\brief TrgDefaultPeriodicCondition class definition
00117   """
00118   def __init__(self):
00119     TrgPeriodicConditionDefinition.__init__(self)
00120
00121   def source(self):
00122     """\brief source() method
00123     Default is FALSE, do not use 1-PPS clock
00124     """
00125     return False
00126
00127   def prescale(self):
00128     """\brief prescale() method
00129     Default is 0x1fffff, 10 hz periodic function
00130     """
00131     # Generate a 10 hz periodic function
00132     # 20 Megahertz clock, 1fffff = 2e6
00133     return 0x1fffff
00134
00135   def limit(self):
00136     """\brief limit() method
00137     Default is 0, free-run the condition.
00138     """
00139     return 0x0
00140
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgPPSTimer.py Source File

trigger

TrgPPSTimer.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Coincidence based Trigger System Abstract classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 1.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 from TrgObject import TrgObject
00022
00023
00024 """TrgPPSTimer: Abstract interface to 1-PPS timer"""
00025
00026
00027 class TrgPPSTimer(TrgObject):
00028   """\brief TrgPPSTimer class definition
00029   This class controls the GEM's 1-PPS timer.
00030   """
00031   def __init__(self):
00032     """\brief TrgPPSTimer constructor
00033     """
00034     pass
00035
00036   def seconds(self):
00037     """ \brief seconds() method
00038     Return the counts the number of arrived 1-PPS signals since the GEM was reset
00039     \return an integer
00040     """
00041     raise NotImplementedError
00042     pass # returns an integer...
00043
00044   def timebase(self):
00045     """ \brief timebase() method
00046     Return the contains the time, in system clock ticks
00047     (50 nano-seconds), of the last arrived 1-PPS signal.
00048     \return an integer    """
00049     raise NotImplementedError
00050     pass # returns an integer...
00051
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgRoiAsTiles.py Source File

trigger

TrgRoiAsTiles.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Trigger Object class"
00012 __author__   = "M. Huffer <mehsys@slac.stanford.edu> SLAC - GLAST LAT Electronics"
00013 __date__     = "1/14/04"
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 """TrgRoiAsTiles: Map coincidences to Regions of Interest
00021 """
00022
00023 from TrgCoincidences import *
00024 from NullObjects     import NullCoincidence
00025
00026 class TrgRoiAsTiles(TrgCoincidences):
00027   """\brief Class TrgRoiAsTiles
00028   LATTE provided class to map coincidences to ROIs
00029   """
00030   def __init__(self):
00031     TrgCoincidences.__init__(self)
00032     self.__coincidenceList = []
00033     for i in range(TrgObject.COINCIDENCE_NUMBER_MAX + 1):
00034       self.__coincidenceList.append(NullCoincidence())
00035     self.__roiList = []
00036     for i in range(TrgObject.ROI_NUMBER_MAX+1):
00037       self.__roiList.append(AddableRoi())
00038
00039   def coincidence(self, coincidenceNumber):
00040     if coincidenceNumber < TrgObject.COINCIDENCE_NUMBER_MIN or \
00041        coincidenceNumber > TrgObject.COINCIDENCE_NUMBER_MAX:
00042       raise IndexError, "coincidenceNumber is out of range"
00043     return self.__coincidenceList[coincidenceNumber]
00044
00045   def roi(self, roiNumber):
00046     if roiNumber < TrgObject.ROI_NUMBER_MIN or \
00047        roiNumber > TrgObject.ROI_NUMBER_MAX:
00048       raise IndexError, "roiNumber is out of range"
00049     return self.__roiList[roiNumber]
00050
00051   def addCoincidence(self, cNumber, coinc):
00052     self.__coincidenceList[cNumber] = coinc
00053     self.__fillRoiList(cNumber)
00054
00055   def __fillRoiList(self, cNumber):
00056     """This function fills the list of ROIs by using the defined
00057        list of coincident tiles.  Each coincidence pair defines
00058        tiles in two ROIs.  Coincidence pair 0 maps to ROI 0 and 1,
00059        and so on.
00060     """
00061     rList = self.__roiList
00062     coin = self.coincidence(cNumber)
00063     for tileA in range(TrgObject.TILE_NUMBER_MAX+1):
00064       tileB = coin.inCoincidence(tileA)
00065       if tileB >= 0:
00066         c2 = cNumber * 2
00067         rList[c2].addTile(tileA)
00068         rList[c2+1].addTile(tileB)
00069
00070 class AddableRoi(TrgRoi):
00071   """The main purpose of this class is to add the member function
00072      addTile(tile).
00073      This function appends a tile to the list of tiles in the ROI
00074   """
00075   def __init__(self):
00076     TrgRoi.__init__(self)
00077     self.__tileList = []
00078
00079   def addTile(self,tile):
00080     if tile not in self.__tileList:
00081       if tile >= TrgObject.TILE_NUMBER_MIN and tile <= TrgObject.TILE_NUMBER_MAX:
00082         self.__tileList.append(tile)
00083
00084   def tile(self, tileNumber):
00085     if tileNumber < TrgObject.TILE_NUMBER_MIN or tileNumber > TrgObject.TILE_NUMBER_MAX:
00086       raise IndexError, "tileNumber is out of range"
00087     if tileNumber in self.__tileList:
00088       return True
00089     return False
00090
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgRoiAsVeto.py Source File

trigger

TrgRoiAsVeto.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Trigger Object class"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020 """TrgRoiAsVeto: Implement an ROI based veto system.
00021 """
00022
00023 from TrgCoincidences import *
00024
00025 #JHP: Finish me.
00026
00027
00028 class TrgRoiAsVeto(TrgRois):
00029   def __init__(self):
00030     TrgRois.__init__(self)
00031     self.__roiList = []
00032     for i in range(TrgObject.ROI_NUMBER_MAX+1):
00033       self.__roiList.append(MyRoi())
00034
00035   def roi(self, roiNumber):
00036     if roiNumber < TrgObject.ROI_NUMBER_MIN or roiNumber > TrgObject.ROI_NUMBER_MAX:
00037       raise IndexError, "roiNumber is out of range"
00038     return self.__roiList[roiNumber]
00039
00040 class MyRoi(TrgRoi):
00041   """
00042   """
00043   def __init__(self):
00044     TrgRoi.__init__(self)
00045     # tiles 0..5 shadow this tower
00046     self.__tileList = [ 0, 1, 2, 3, 4, 5]
00047
00048   def tile(self, tileNumber):
00049     if tileNumber < TrgObject.TILE_NUMBER_MIN or tileNumber > TrgObject.TILE_NUMBER_MAX:
00050       raise IndexError, "tileNumber is out of range"
00051     if tile in self.__tileList:
00052       return True
00053     return False
00054
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgSequence.py Source File

trigger

TrgSequence.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Trigger Sequence Interface classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 from TrgObject import TrgObject
00022
00023
00024 """TrgSequence: Interface for Trigger Sequences"""
00025
00026
00027 class TrgSequenceAbstract(TrgObject):
00028   """\brief Abstract Trigger Sequence class definition
00029   """
00030   def __init__(self):
00031     """\brief TrgSequenceAbstract constructor
00032     """
00033     pass
00034
00035   def eventNumber(self):
00036     """\brief EventNumber 'pure virtual' method
00037
00038     \return An integer containing the current event number
00039     """
00040     raise NotImplementedError
00041     pass
00042
00043   def eventTag(self):
00044     """\brief EventTag 'pure virtual' method
00045
00046     \return An integer containing the current event tag value
00047     """
00048     raise NotImplementedError
00049     pass
00050
00051 class TrgSequenceDefinition(TrgSequenceAbstract):
00052   """\brief Trigger Sequence Definition class definition
00053   """
00054   def __init__(self): # constructor...
00055     """\brief TrgSequenceDefinition constructor
00056     """
00057     TrgSequenceAbstract.__init__(self)
00058
00059
00060 class TrgSequence(TrgSequenceAbstract):
00061   """\brief Trigger Sequence class definition
00062   """
00063   def __init__(self): # constructor...
00064     """\brief TrgSequence constructor
00065     """
00066     TrgSequenceAbstract.__init__(self)
00067
00068   def definition(self) :
00069     """\brief definition() member
00070     \return an object of type TrgSequenceDefinition
00071     """
00072     pass # returns an object of type TrgSequenceDefinition
00073
00074
00075 class TrgDefaultSequence(TrgSequenceDefinition):
00076   """The class defines 'sensible' values for the initial Event and Tag numbers.
00077   """
00078   def __init__(self):
00079     """\brief TrgDefaultSequence constructor
00080     """
00081     TrgSequenceAbstract.__init__(self)
00082
00083   def eventNumber(self):
00084     """\brief eventNumber() method
00085     Returns 0
00086     """
00087     return 0x0
00088
00089   def eventTag(self):
00090     """brief eventTag() method
00091     Returns 0
00092     """
00093     return 0x0
00094
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgTileCounters.py Source File

trigger

TrgTileCounters.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Coincidence based Trigger System Abstract classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 from TrgObject import TrgObject
00022
00023
00024 """TrgTileCounters: Trigger GEM tile counter abstract class"""
00025
00026 class TrgTileCounters(TrgObject):
00027   """\brief TrgTileCounters class definition
00028   This class controls the counters used to count ACD tile transitions.
00029   """
00030   def __init__(self): # constructor...
00031     pass
00032
00033   def stats(self):
00034     """\brief stats() member function
00035     Returns the statistics object for the tile counters
00036     \return A TrgTileStats object
00037     """
00038     raise NotImplementedError
00039     pass # returns a TrgTileStats object...
00040
00041   def reset(self):
00042     """\brief reset() member function
00043     Reset the tile statistics
00044     """
00045     raise NotImplementedError
00046     pass # returns void...
00047
00048   def assignA(self, a):
00049     """\brief assignA() member function
00050     Assign the 'A' tile counter to watch a particular tile
00051     Immediately after counter assignment, both counters are reset.
00052     """
00053     raise NotImplementedError
00054     pass # returns void...
00055
00056   def assignB(self, B):
00057     """\brief assignB() member function
00058     Assign the 'B' tile counter to watch a particular tile
00059     Immediately after counter assignment, both counters are reset.
00060     """
00061     raise NotImplementedError
00062     pass # returns void...
00063
00064   def assignAB(self, a, b):
00065     """\brief assignAB() member function
00066     Assign both the 'A' and the'B' tile counters to watch two tiles
00067     Immediately after counter assignment, both counters are reset.
00068     """
00069     raise NotImplementedError
00070     pass # returns void...
00071
00072
00073 class TrgTileStats(TrgObject):
00074   """\brief TrgTileStats class definition
00075   This class specifies the statistics returned by the counters
00076   described by TrgTileCounters.
00077   """
00078   def __init__(self): # constructor...
00079     pass
00080
00081   def A(self):
00082     """
00083     Return the statistics for the 'A' tile counter
00084     \return an integer
00085     """
00086     raise NotImplementedError
00087     pass # returns an integer...
00088
00089   def B(self):
00090     """
00091     Return the statistics for the 'B' tile counter
00092     \return an integer
00093     """
00094     raise NotImplementedError
00095     pass
00096
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgTower.py Source File

trigger

TrgTower.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Trigger Tower Interface classes"
00012 __author__   = "M. Huffer <mehsys@slac.stanford.edu> SLAC - GLAST LAT Electronics"
00013 __date__     = "1/14/04"
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019 from TrgObject import TrgObject
00020
00021 """TrgTower: Abstract interfaces for Trigger Tower classes"""
00022
00023
00024 class TrgTowers(TrgObject):
00025   """\brief Trigger Towers class definition
00026   """
00027   def __init__(self):
00028     """\brief TrgTowers constructor
00029     """
00030     pass
00031
00032   def tower(self, towerNumber):
00033     """\brief Tower 'pure virtual' method
00034
00035     \param towerNumber  A tower number
00036     \return A TrgTower object
00037     """
00038     raise NotImplementedError
00039     pass
00040
00041
00042 class TrgTower(TrgObject):
00043   """\brief Trigger Tower class definition
00044   """
00045   def __init__(self):
00046     """\brief TrgTower constructor
00047     """
00048     pass
00049
00050   def calorimeter(self):
00051     """\brief Calorimeter 'pure virtual' method
00052
00053     \return A TrgCalorimeter object
00054     """
00055     raise NotImplementedError
00056     pass
00057
00058   def tracker(self):
00059     """\brief Tracker 'pure virtual' method
00060
00061     \return A TrgTracker object
00062     """
00063     raise NotImplementedError
00064     pass
00065
00066
00067 class TrgCalorimeter(TrgObject):
00068   """\brief Trigger Calorimeter class definition
00069   """
00070   def __init__(self):
00071     """\brief TrgCalorimeter constructor
00072     """
00073     pass
00074
00075   def useHighEnergy(self):
00076     """\brief UseHighEnergy 'virtual' method
00077
00078     \return A boolean
00079     """
00080     return False
00081
00082   def useLowEnergy(self):
00083     """\brief UseLowEnergy 'virtual' method
00084
00085     \return A boolean
00086     """
00087     return False
00088
00089
00090 class TrgTracker(TrgObject):
00091   """\brief Trigger Tracker class definition
00092   """
00093   def __init__(self):
00094     """\brief TrgTracker constructor
00095     """
00096     pass
00097
00098   def use(self):
00099     """\brief Use 'virtual' method
00100
00101     \return A boolean
00102     """
00103     return False
00104
00105
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgTriggerCounters.py Source File

trigger

TrgTriggerCounters.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Coincidence based Trigger System Abstract classes"
00012 __author__   = "Jim Panetta <panetta@slac.stanford.edu> SLAC - GLAST I&T"
00013 __date__     = "2/14/04"
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 from TrgObject import TrgObject
00022
00023
00024 """TrgTriggerCounters: Abstract interface to trigger counters"""
00025
00026
00027 class TrgTriggerCounters(TrgObject):
00028   """\brief TrgTriggerCounters class definition
00029   This class controls the counters associated with the performance of
00030   the LAT with respect to the Trigger System.
00031   """
00032   def __init__(self):
00033     """\brief TrgTriggerCounters constructor
00034     """
00035     pass
00036
00037   def stats(self):
00038     """ \brief stats() method
00039     Returns the Trigger Counter Statistics object.
00040     \return A TrgTriggerStats object
00041     """
00042     raise NotImplementedError
00043     pass
00044
00045   def reset(self):
00046     """\brief reset() method
00047     Reset the trigger counters.
00048     """
00049     raise NotImplementedError
00050     pass
00051
00052 class TrgTriggerStats(TrgObject):
00053   """\brief TrgTriggerStats
00054   This class specifies the statistics returned by the counters defined in TrgTriggerCounters.
00055   """
00056   def __init__(self): # constructor...
00057     """\brief TrgTriggerStats constructor
00058     """
00059     pass
00060   def livetime(self):
00061     """ \brief livetime() method
00062     Return the system livetime
00063     \return an integer
00064     """
00065     raise NotImplementedError
00066     pass # returns an integer...
00067
00068   def prescaled(self):
00069     """ \brief prescaled() method
00070     Return the number of events that have been prescaled
00071     \return an integer    """
00072     raise NotImplementedError
00073     pass # returns an integer...
00074
00075   def discarded(self):
00076     """\brief discarded() method
00077     Return the number of events discarded
00078     \return an integer
00079     """
00080     raise NotImplementedError
00081     pass # returns an integer...
00082
00083   def sent(self):
00084     """\brief sent() method
00085     Return the number of events sent on
00086     \return an integer
00087     """
00088     raise NotImplementedError
00089     pass # returns an integer...
00090
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: TrgUsingTiles.py Source File

trigger

TrgUsingTiles.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009
00010 __facility__ = "Online"
00011 __abstract__ = "GLAST LAT Coincidence based Trigger System Interface classes"
00012 __author__   = "M. Huffer <mehsys@slac.stanford.edu> SLAC - GLAST LAT Electronics"
00013 __date__     = "1/14/04"
00014 __version__  = "$Revision: 2.1 $"
00015 __release__  = "$Name: R04-12-00 $"
00016 __credits__  = "SLAC"
00017
00018 import LATTE.copyright_SLAC
00019
00020
00021 from rcTrgGem                import rcTrgGem
00022 from TrgSequence             import TrgDefaultSequence
00023 from TrgGemSequence          import TrgGemSequence
00024 from TrgRoiAsTiles           import TrgRoiAsTiles
00025 from TrgGemPeriodicCondition import TrgGemPeriodicCondition
00026 from TrgPeriodic             import TrgDefaultPeriodicCondition
00027
00028 """TrgUsingTiles: Implementation of a tile-based trigger system"""
00029
00030 class TrgUsingTiles(rcTrgGem):
00031   """\brief Trigger Using Tiles class definition
00032   """
00033   def __init__(self):
00034     """\brief TrgUsingTiles constructor
00035     """
00036     self.__pCondition = DefaultPeriodicCondition()
00037     self.__sequence   = DefaultSequence()
00038     self.__roi        = TrgRoiAsTiles()
00039     rcTrgGem.__init__(self)
00040
00041   def coincidences(self):
00042     """\brief Coincdences 'pure virtual' method
00043
00044     \return A TrgCoincidences object
00045     """
00046     raise NotImplementedError
00047
00048   # Pure Virtual function implementation
00049   def useAcdAsTrigger(self):
00050     return True
00051
00052   def periodicCondition(self):
00053     return self.__pCondition
00054
00055   def sequence(self):
00056     return self.__sequence
00057
00058   def roi(self):
00059     return self.__roi
00060
00061 class DefaultPeriodicCondition(TrgGemPeriodicCondition):
00062   """\brief DefaultPeriodicCondition class
00063   """
00064   def __init__(self):
00065     """\brief DefaultPeriodicCondition constructor
00066     """
00067     TrgGemPeriodicCondition.__init__(self)
00068     self.__cond = TrgDefaultPeriodicCondition()
00069
00070   def definition(self):
00071     """\brief definition() method
00072     See TrgPeriodicCondition base class
00073     """
00074     return self.__cond
00075
00076 class DefaultSequence(TrgGemSequence):
00077   def __init__(self):
00078     """\brief DefaultSequence constructor
00079     """
00080     TrgGemSequence.__init__(self)
00081     self.__cond = TrgDefaultSequence()
00082
00083   def definition(self):
00084     """\brief definition() method
00085     See TrgSequence base class
00086     """
00087     return self.__cond
00088
00089
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userAppBrowser.py Source File

browser

userAppBrowser.py

00001 __version__  = "$Revision: 2.10 $"
00002
00003 import os
00004 import sys
00005 import imp
00006 import fnmatch
00007 import logging
00008 import traceback
00009 from types import ModuleType
00010
00011 from qt import QScrollView, QVBox, QApplication, QString, SIGNAL, SLOT, QObject
00012
00013 from userAppBrowserGui import userAppBrowserGui
00014 from userAppTree import userAppTree
00015
00016 class userModule(object):
00017   Param = ('.py', 'r', imp.PY_SOURCE)
00018   SysModules = sys.modules.keys()
00019
00020   def __init__(self, root, packagename, groupname, appname):
00021     self.module = None
00022     self.__deps = []
00023     self.__root = root
00024     self.__packagename = packagename
00025     self.__groupname = groupname
00026     self.__appname  = appname
00027     self.__import()
00028
00029   def __import(self):
00030     root = self.__root
00031     packagename = self.__packagename
00032     groupname = self.__groupname
00033     appname = self.__appname
00034     appfile = os.path.join(root, packagename, groupname, appname+'.py')
00035     fp = file(appfile, 'r')
00036     try:
00037       previous = sys.modules.keys()
00038       module = imp.load_module(appname, fp, appfile, userModule.Param)
00039       fp.close()
00040       s = dir(module)
00041       if 'userModuleName' in s and 'userGui' in s:
00042         self.module = module
00043         self.__deps = []
00044         if 'userApplication' in s:
00045           for (dep, module) in sys.modules.items():
00046             if (dep not in previous) and type(module) == ModuleType:
00047               dep_path = dep.split('.')
00048               if len(dep_path) == 4:
00049                 if dep_path[0] == packagename and dep_path[1] == groupname:
00050                   self.__deps.append(dep)
00051       else:
00052         self.module = None
00053         del module
00054     except Exception, msg:
00055       fp.close()
00056       traceback.print_exc()
00057
00058   def reload(self):
00059     del self.module
00060     for dep in self.__deps:
00061       if dep in sys.modules:
00062         del sys.modules[dep]
00063     self.__import()
00064
00065
00066 def import_initfile(root, packagename, groupname):
00067   initfile = os.path.join(root, packagename, groupname, '__init__.py')
00068   fp = file(initfile, 'r')
00069   modname = packagename+groupname+'__init'
00070   userapps = []
00071   try:
00072     module = imp.load_module(modname, fp, initfile, userModule.Param)
00073     fp.close()
00074     if 'UserApps' in dir(module):
00075       for app in module.UserApps:
00076         userapps.append(app)
00077     del module
00078   except Exception, msg:
00079     fp.close()
00080     traceback.print_exc()
00081   return userapps
00082
00083 class userAppBrowser(userAppBrowserGui):
00084   Debug = 0
00085   Info  = 1
00086   Warn  = 2
00087   Error = 3
00088   Fatal = 4
00089
00090   LevelNames = {
00091     Debug: 'DEBUG',
00092     Info:  'INFO',
00093     Warn:  'WARN',
00094     Error: 'ERROR',
00095     Fatal: 'FATAL'
00096     }
00097
00098   Color = {Debug : 'green',
00099            Info :  'black',
00100            Warn :  'blue',
00101            Error : 'red',
00102            Fatal : 'red'
00103            }
00104
00105   MaxLines = 500
00106   SaveLines = 250
00107
00108   def __init__(self, rc, appdir):
00109     userAppBrowserGui.__init__(self)
00110     self.setCaption("User Applications Browser")
00111     self.__rc = rc
00112     self.__appdir = appdir
00113     self.guis = {}
00114     self.guisOrder = []
00115     self.__tab_frames = []
00116     for (verlevel, vername) in userAppBrowser.LevelNames.items():
00117       self.VerbosityBox.insertItem(QString(vername), verlevel)
00118     self.VerbosityBox.setCurrentItem(1)
00119     self.__playButtons = [self.ResetButton,
00120                           self.StopButton,
00121                           self.PauseButton,
00122                           self.RunButton]
00123     self.__setPlayButtons(enabled=False)
00124     self.__tree = userAppTree(self.userAppTreeGui)
00125     self.__loaddir()
00126     self.__logtext = []
00127     self.userAppTextBrowser.setTextFormat(QObject.LogText)
00128
00129   def __setPlayButtons(self, enabled):
00130     for button in self.__playButtons:
00131       button.setEnabled(enabled)
00132
00133   def verbosity(self):
00134     return userAppBrowser.LevelNames[self.VerbosityBox.currentItem()]
00135
00136   def updateSchema(self):
00137     self.__tree.loadNodes(self.__rc.common().getLAT())
00138     for usergui in self.guis.values():
00139       usergui.updateSchema()
00140
00141   def updateSuites(self):
00142     for usergui in self.guis.values():
00143       if 'updateSuite' in dir(usergui):
00144         usergui.updateSuite()
00145
00146   def getGui(self, appname):
00147     return self.guis[appname]
00148
00149   def getTree(self):
00150     return self.__tree
00151
00152   def loaded(self, appgui):
00153     if not self.RunButton.isEnabled():
00154       self.__setPlayButtons(enabled=True)
00155     for usergui in self.guis.values():
00156       if usergui == appgui:
00157         self.userAppLabel.setText(appgui.usrmodule.module.userModuleName)
00158         usergui.loaded()
00159       else:
00160         usergui.unloaded()
00161
00162   def __loadApps(self, root, packagename, groupname):
00163     usrmodules = []
00164     appnames = import_initfile(root, packagename, groupname)
00165     for appname in appnames:
00166       usrmodule = userModule(root, packagename, groupname, appname)
00167       if usrmodule.module is not None:
00168         usrmodules.append(usrmodule)
00169         logging.debug('userAppBrowser: loading %s.%s' %(groupname, appname))
00170       else:
00171         logging.debug('userAppBrowser: skipping %s.%s'%(groupname, appname))
00172     return usrmodules
00173
00174   def __loaddir(self):
00175     (root, packagename) = os.path.split(self.__appdir)
00176     if packagename == '': (root, packagename) = os.path.split(root)
00177     sys.path.insert(0, root)
00178     groupnames = import_initfile(root, packagename, '')
00179     self.guisOrder = []
00180     for groupname in groupnames:
00181       usrmodules = self.__loadApps(root, packagename, groupname)
00182       if len(usrmodules):
00183         self.guisOrder.append([groupname, []])
00184         newtab = QScrollView(self.userAppTabs)
00185         frame = QVBox(newtab.viewport())
00186         newtab.addChild(frame)
00187         self.userAppTabs.addTab(newtab, groupname)
00188         self.__tab_frames.append(newtab)
00189         for usrmodule in usrmodules:
00190           module = usrmodule.module
00191           usergui = module.userGui(frame, self.__rc, usrmodule)
00192           self.guis[module.userModuleName] = usergui
00193           self.guisOrder[-1][1].append(module.userModuleName)
00194
00195     sys.path.remove(root)
00196
00197   def ResetClicked(self):
00198     self.__rc.ResetClicked()
00199
00200   def StopClicked(self):
00201     self.__rc.StopClicked()
00202
00203   def PauseClicked(self):
00204     self.__rc.PauseClicked()
00205
00206   def RunClicked(self):
00207     self.__rc.RunClicked()
00208
00209   def purge(self):
00210     self.__rc.execGUImethod(self.__purge)
00211
00212   def __purge(self):
00213     lines = len(self.__logtext)
00214     if lines > userAppBrowser.MaxLines:
00215       self.__logtext = self.__logtext[lines-userAppBrowser.SaveLines:]
00216       self.userAppTextBrowser.clear()
00217       for line in self.__logtext:
00218         self.userAppTextBrowser.append(line)
00219
00220   def append(self, message, level):
00221     self.__rc.execGUImethodNR(self.__append, message, level)
00222
00223   def __append(self, message, level):
00224     color = userAppBrowser.Color[level]
00225     message = '<font color=%s>%s</font>'%(color, message)
00226     self.__logtext.append(message)
00227     self.userAppTextBrowser.append(message)
00228
00229
00230 if __name__ == '__main__':
00231   from LATTE.client.gOptions import Options
00232
00233   class panelsTest(object):
00234     def __init__(self, browser):
00235       self.__browser = browser
00236
00237     def getUserApp(self):
00238       return self.__browser
00239
00240   class rcTest(object):
00241     def __init__(self):
00242       self.__panels = {}
00243       self.__prefs = {'logdir': '/tmp'}
00244
00245     def addPanel(self, name, browser):
00246       panel = panelsTest(browser)
00247       self.__panels[name] = panel
00248
00249     def panels(self):
00250       return self.__panels
00251
00252     def preferences(self):
00253       return self.__prefs
00254
00255   options = Options(['appdir'])
00256   try:
00257     options.parse()
00258   except Exception, msg:
00259     options.usage()
00260     raise Exception, msg
00261
00262   app = QApplication(sys.argv)
00263   app.connect(app, SIGNAL("lastWindowClosed()"),app, SLOT("quit()"))
00264   rc = rcTest()
00265   win = userAppBrowser(rc, appdir=options.appdir)
00266   rc.addPanel('Global', win)
00267   win.updateSuites()
00268   win.show()
00269   app.exec_loop()
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userAppLeaf.py Source File

browser

userAppLeaf.py

00001 __version__  = "$Revision: 2.4 $"
00002
00003 from qt import *
00004
00005 class userAppLeaf(QListViewItem):
00006   """\brief userApp Gui Leaf
00007   This is the class of a leaf in the userApp Gui Tree
00008   It contains both basic functionality as a leaf (mainly input selection functions)
00009   and functionality as a manager of application windows
00010   """
00011
00012   whitebox_pix = None
00013   greybox_pix = None
00014   whitecheckedbox_pix = None
00015
00016   objects = {}
00017   def __init__(self, lat, node, parent):
00018     """ Init Function for the leaf
00019         \param lat_node pointer to the LAT structure
00020         \param self_node pointer to the "Gnode" device related to this leaf
00021         \param parent object to use as the QCheckListItem parent
00022     """
00023     userAppLeaf.objects[id(self)] = 1
00024     self.node = node
00025     self.lat = lat
00026     self.inputNodes = []
00027
00028     QListViewItem.__init__(self, parent,self.name())
00029     self.setText(0, self.name())
00030     self.setOn(0)
00031
00032     self.setEnabled(1)
00033     self.window = None
00034     self.subw_list = []
00035     self.window_scroller = None
00036     self.warning = 0
00037     self.pwarning = 0
00038 #    self.AppWindowFiles = []
00039     self.guiClasses = []
00040     self.__generateCheckBoxDrawing()
00041     self.setPixmap(0, self.whitebox_pix)
00042
00043
00044
00045   def __generateCheckBoxDrawing(self):
00046     if userAppLeaf.whitebox_pix is None:
00047       checkbox = QCheckBox(None,'')
00048       checkbox.setMaximumSize(checkbox.sizeHint())
00049       checkbox.setTristate(1)
00050       checkbox.setState(QCheckBox.Off)
00051       userAppLeaf.whitebox_pix = QPixmap.grabWidget(checkbox)
00052       checkbox.setState(QCheckBox.NoChange)
00053       userAppLeaf.greybox_pix = QPixmap.grabWidget(checkbox)
00054       checkbox.setState(QCheckBox.On)
00055       userAppLeaf.whitecheckedbox_pix = QPixmap.grabWidget(checkbox)
00056 ##      checkbox.hide()
00057
00058   def rect(self):
00059     tree = self.getTree()
00060     rect = tree.itemRect(self)
00061     a = tree.treeStepSize()*(self.depth()+tree.rootIsDecorated())+tree.itemMargin() + self.pixmap(0).width()
00062     rect.setLeft(a)
00063     return rect
00064
00065   def pressedEvent(self,pos, column):
00066     tree = self.getTree()
00067     pos = tree.mapFromGlobal(pos)
00068     a = tree.treeStepSize()*(self.depth()+tree.rootIsDecorated())+tree.itemMargin()
00069     ##b = a + 20
00070     b = a + self.pixmap(0).width()
00071     #~ print "%d, %d" %(a,b)
00072     if pos.x() > a and pos.x() < b:
00073       self.stateChangeClicked()
00074
00075   def setOn(self, value):
00076     self.On = value
00077
00078   def isOn(self):
00079     return self.On
00080
00081   def __del__(self):
00082     del userAppLeaf.objects[id(self)]
00083
00084   ## Leaf functionality
00085   def getTree(self):
00086     return self.listView()
00087
00088   def stateChangeClicked(self):
00089     self.setOn(not self.isOn())
00090     self.__propagateTriggerInputsUpdate()
00091     self.getTree().emit(PYSIGNAL("leafStateChanged (userAppLeaf * )"), (self, ))
00092
00093   def __propagateTriggerInputsUpdate(self,childrenToo = 0, parentToo = 1):
00094     if childrenToo:
00095       child = self.firstChild()
00096       while child is not None:
00097         child.__propagateTriggerInputsUpdate(childrenToo,0)
00098         child = child.nextSibling()
00099     self.triggerInputsUpdate()
00100     if parentToo and self.parent() is not None:
00101       self.parent().__propagateTriggerInputsUpdate(0, parentToo)
00102
00103   def name(self):
00104     """ Function which returns the name of the leaf
00105         A parent of this leaf should not possibly have two leaves with the same name
00106         The leaf could have cousins with the same name
00107         \return name of node/leaf
00108     """
00109     name_with_id = "%s %2d" %(self.node.getName(), self.node.id())
00110     return name_with_id
00111
00112   def module(self):
00113     """ Function which returns the name of the Gnode
00114         The parent might have more than one child with the same module name
00115         \return name of module type
00116     """
00117     return str(self.node.getName())
00118
00119   def getLeaf(self,leaf):
00120     """ Function that finds the leaf in the hierarchical structure of leaves starting at this leaf
00121         A match only occur if there exist a leaf at depth k under self with all of its parents name up to self matching with the reference leaf kth first parents.
00122         Ex: ref_leaf = a->b->self->d->e->ref_leaf will match with self->d->e->ref_leaf
00123         This function is mostly use to port information between leaves of different implementation of the same ELX Tree
00124         \param leaf leaf object to find in the structure
00125         \return the leaf that matches with the searched leaf, None with no match
00126     """
00127     #Is it self?
00128     if leaf.name() == self.name():
00129       return self
00130
00131     #Is self a parent?
00132     leaf_parent = leaf
00133     leaf_parent_parent = leaf.parent()
00134     while 1:
00135       if leaf_parent_parent.name() == self.name():
00136         break
00137       elif leaf_parent_parent == leaf.getTree():
00138         return None
00139       leaf_parent = leaf_parent_parent
00140       leaf_parent_parent = leaf_parent_parent.parent()
00141
00142     # Can we get it from any of our child?
00143     us_child = self.firstChild()
00144     while us_child is not None:
00145       if us_child.name() == leaf_parent.name():
00146         return us_child.getLeaf(leaf)
00147       us_child = us_child.nextSibling()
00148     return None
00149
00150   def __copyCheckedNodes(self, from_leaf):
00151     """ Function which copies all the checked information from the from_leaf structure to the self leaf structure
00152         The functions does not do anything if from_leaf and self do not match
00153         \from_leaf leaf to use as a reference to set the checked structure of this leaf
00154     """
00155     if self.name() == from_leaf.name():
00156       self.setOn(from_leaf.isOn())
00157       #~ self.setOnNoSignal(from_leaf.isOn())
00158       from_child = from_leaf.firstChild()
00159
00160       ##assuming the same ordering of children
00161       to_child = self.firstChild()
00162       while from_child is not None:
00163         while to_child is not None:
00164           if to_child.name() == from_child.name():
00165             to_child.__copyCheckedNodes(from_child)
00166             to_child = to_child.nextSibling()
00167             break
00168           to_child = to_child.nextSibling()
00169         from_child = from_child.nextSibling()
00170
00171       ## No prior assumption
00172       #~ while from_child is not None:
00173         #~ to_child = self.firstChild()
00174         #~ while to_child is not None:
00175           #~ to_child.copyCheckedNodes(from_child)
00176           #~ to_child = to_child.nextSibling()
00177         #~ from_child = from_child.nextSibling()
00178
00179   def copyCheckedNodes(self, from_leaf):
00180     self.__copyCheckedNodes(from_leaf)
00181     self.__propagateTriggerInputsUpdate(True, True)
00182     self.__emitLeavesStateChanged()
00183
00184   def select_family(self, value = 1):
00185     """ Function that checks/unchecks this leaf and all its children leaves and all their children...
00186         \value checks all leaves if 1, unchecks all if 0
00187     """
00188     self.setOn(value)
00189     child = self.firstChild()
00190     while child is not None:
00191       child.select_family(value)
00192       child = child.nextSibling()
00193
00194   def unselect_family(self):
00195     """ Function that unchecks this leaf and all its children leaves and all their children...
00196     """
00197     self.select_family(0)
00198
00199   def expand_family(self, value = 1):
00200     """ Function that expands/collapse the leaf node in the tree and all its children and their children...
00201         \value expands all leaves if 1, collapse if 0
00202     """
00203     self.setOpen(value)
00204     child = self.firstChild()
00205     while child is not None:
00206       child.expand_family(value)
00207       child = child.nextSibling()
00208
00209   def collapse_family(self):
00210     """ Function that expands/collapse the leaf node in the tree and all its children and their children...
00211     """
00212     self.expand_family(0)
00213
00214   def selectFamilyClicked(self, value = 1):
00215     self.select_family(value)
00216     self.__propagateTriggerInputsUpdate(1,1)
00217     self.__emitLeavesStateChanged()
00218
00219   def __emitLeavesStateChanged(self):
00220     self.getTree().emit(PYSIGNAL("leavesStateChanged ( QListViewItem * )"), (self, ))
00221
00222   def unselectFamilyClicked(self):
00223     self.selectFamilyClicked(0)
00224
00225   def leafActionsTuples(self):
00226     """ Function which returns the possible actions that can be included in this leafs menu
00227         \return a list of tuples (name,method) where name is the name of the action and method is the method implements the action
00228     """
00229     actions = [('Select All',self.selectFamilyClicked),
00230                   ('Unselect All',self.unselectFamilyClicked),
00231                   ('Expand',self.expand_family),
00232                   ('Collapse',self.collapse_family)]
00233     return actions
00234
00235   ## Application manager
00236
00237   def loadAppWindows(self,leaf_window_list):
00238     """ Function which loads the list of application windows related to the leaf
00239         \param appfiles_list list of module names to use as application window (these module need to contain a class 'MainWindow')
00240     """
00241     if self.window is not None:
00242       self.window.close()
00243       self.window = None
00244       del(self.subw_list)
00245       del(self.app_list)
00246       self.subw_list = []
00247     self.guiClasses = leaf_window_list
00248
00249   def createWindow(self,parent):
00250     """ Function that creates the window containing the applications managed by the leaf
00251         If the window exists already, the function returns the pointer to this window
00252         \parent pointer to the parent to use to create the window
00253         \return pointer to the window
00254     """
00255     if self.window is None:
00256       self.window = QVBox(parent)
00257       for guiclass in self.guiClasses:
00258         #look for gui, userId, debug
00259         subw = guiclass(self.lat, self.node, self.window, self)
00260         self.subw_list.append(subw)
00261     return self.window
00262
00263
00264   def getInputNodes(self, of_class_type = None):
00265     """ Function which extracts from all its child leaves the ones that are checked
00266         Builds a list of Gnodes for the application to use as inputs
00267         \return list of Gnodes
00268     """
00269     if of_class_type is None:
00270       return self.inputNodes
00271
00272     inputs = []
00273     for node in self.inputNodes:
00274       if isinstance(node, of_class_type):
00275         inputs.append(node)
00276     return inputs
00277
00278   def getLogDir(self):
00279     """ Function which returns the current log directory for the application
00280         \return a string containing the name of the directory to log in
00281     """
00282     return self.getTree().sys_comm.getLogDir()
00283
00284   def getRC(self):
00285     return self.getTree().sys_comm.getRC()
00286
00287   def setStatus(self, status_descr):
00288     if status_descr[0] == 'warning':
00289       self.setWarning(1)
00290     else:
00291       self.setWarning(0)
00292     self.getTree().setStatus(self, status_descr)
00293
00294   def triggerPolling(self):
00295     if self.window is not None:
00296       for subw in self.subw_list:
00297         subw.triggerPolling()
00298
00299   def triggerCmdCliUpdate(self):
00300     if self.window is not None:
00301       for subw in self.subw_list:
00302         subw.triggerCmdCliUpdate()
00303
00304   def triggerInputsUpdate(self):
00305     ##This method assumes that all children of this leaf have been previously triggered
00306     in_nodes = []
00307     if self.isOn():
00308       in_nodes = [self.node]
00309     child = self.firstChild()
00310     while child is not None:
00311       in_nodes = in_nodes + child.getInputNodes()
00312       child = child.nextSibling()
00313     self.inputNodes = in_nodes
00314     if not self.isOn():
00315       if in_nodes != []:
00316        self.setPixmap(0,self.greybox_pix)
00317       else:
00318        self.setPixmap(0,self.whitebox_pix)
00319     else:
00320        self.setPixmap(0,self.whitecheckedbox_pix)
00321
00322     if self.window is not None:
00323       for subw in self.subw_list:
00324         subw.triggerInputsUpdate()
00325
00326   def close(self):
00327     if self.window is not None:
00328       for subw in self.subw_list:
00329         subw.close()
00330       self.window.close()
00331
00332
00333   ## Triggering Alerts section
00334
00335   def paintCell(self, p, cg, column, width, align):
00336     """ Function that reimplements QCheckListItem.paintCell to show that warning is active
00337     """
00338     new_cg = QColorGroup(cg)
00339     if self.pwarning == 1:
00340       new_cg.setColor(QColorGroup.Text , QColor(200,0,0))
00341     QListViewItem.paintCell(self, p, new_cg, column, width, align)
00342
00343   def paintFocus(self, p, cg, r):
00344     ## Removes the misaligned flashy rectangle around the selected item
00345     pass
00346
00347   def paintWarning(self, value):
00348     """ Function that sets the Paint warning value for the leaf
00349         A paint warning means either the leaf or one of the leaf's child is in warning mode
00350         \param value warning is painted if 1, not painted if 0
00351     """
00352     self.pwarning = value
00353     self.repaint()
00354
00355   def updatePWarning(self):
00356     """ Function which updates the paint warning for this leaf and triggers an update for this leaf's parent
00357     """
00358     warning = self.warning
00359     child = self.firstChild()
00360     while child is not None:
00361       warning |= child.pwarning
00362       child = child.nextSibling()
00363     if warning != self.pwarning:
00364       self.paintWarning(warning)
00365       if self.parent() is not None:
00366         self.parent().updatePWarning()
00367
00368   def setWarning(self,value):
00369     """ Function that sets/clear the leaf in warning mode
00370         It also updates the paint warning information
00371         \param value sets if 1, clears if 0
00372     """
00373     if self.warning != value:
00374       self.warning = value
00375       self.paintWarning(value)
00376       self.updatePWarning()
00377
00378
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userAppLoader.py Source File

browser

userAppLoader.py

00001 __version__  = "$Revision: 2.6 $"
00002
00003 from re import match
00004 from qt import QObject,SIGNAL,Qt,QColor,QColorGroup,QPalette
00005
00006 class userAppLoader(QObject):
00007   def __init__(self, importbutton, loadbutton, rc, usrmodule):
00008     QObject.__init__(self)
00009     self.__importbutton = importbutton
00010     self.__loadbutton = loadbutton
00011     self.rc = rc
00012     self.usrmodule = usrmodule
00013     self.palettes = palettes()
00014     if importbutton is not None:
00015       self.connect(importbutton,SIGNAL("clicked()"),self.reimport)
00016     if loadbutton is not None:
00017       self.connect(loadbutton,SIGNAL("clicked()"),self.load)
00018     for key in self.__dict__.keys():
00019       if match('.+_state', key) is not None:
00020         state = self.__dict__[key]
00021         state.setEnabled(False)
00022         state.setChecked(True)
00023         state.setPalette(self.palettes.white)
00024
00025   def reimport(self):
00026     self.usrmodule.reload()
00027     if self.usrmodule.module is not None: self.load()
00028
00029   def load(self):
00030     self.rc.loadModule(self.usrmodule.module)
00031     self.rc.panels()['Global'].getUserApp().loaded(self)
00032
00033   def loaded(self):
00034     self.__loadbutton.setDown(True)
00035
00036   def unloaded(self):
00037     self.__loadbutton.setDown(False)
00038
00039   def isChecked(self, module):
00040     selname = '%s_sel' %module
00041     sel = self.__dict__[selname]
00042     return self.rc.execGUImethod(sel.isChecked)
00043
00044   def setState(self, module, failed):
00045     statename = '%s_state' %module
00046     state  = self.__dict__[statename]
00047     if failed:
00048       self.rc.execGUImethodNR(state.setPalette, self.palettes.red)
00049     else:
00050       self.rc.execGUImethodNR(state.setPalette, self.palettes.green)
00051
00052   def clearState(self, module):
00053     statename = '%s_state' %module
00054     state  = self.__dict__[statename]
00055     self.rc.execGUImethodNR(state.setPalette, self.palettes.white)
00056
00057   def updateSchema(self):
00058     pass
00059
00060
00061 class palettes(object):
00062   def __init__(self):
00063     cg = QColorGroup()
00064     cg.setColor(QColorGroup.Foreground,Qt.black)
00065     cg.setColor(QColorGroup.Button,Qt.white)
00066     cg.setColor(QColorGroup.Light,Qt.white)
00067     cg.setColor(QColorGroup.Midlight,Qt.white)
00068     cg.setColor(QColorGroup.Dark,Qt.white)
00069     cg.setColor(QColorGroup.Mid,Qt.white)
00070     cg.setColor(QColorGroup.Text,Qt.white)
00071     cg.setColor(QColorGroup.BrightText,Qt.white)
00072     cg.setColor(QColorGroup.ButtonText,Qt.black)
00073     cg.setColor(QColorGroup.Base,Qt.white)
00074     cg.setColor(QColorGroup.Background,QColor(212,208,200))
00075     cg.setColor(QColorGroup.Shadow,Qt.black)
00076     cg.setColor(QColorGroup.Highlight,QColor(0,0,128))
00077     cg.setColor(QColorGroup.HighlightedText,Qt.white)
00078
00079     self.white = QPalette(cg, cg, cg)
00080     self.red   = QPalette.copy(self.white)
00081     self.green = QPalette.copy(self.white)
00082
00083     self.red.active().setColor(QColorGroup.Text,Qt.red)
00084     self.red.active().setColor(QColorGroup.Button,Qt.red)
00085     self.red.inactive().setColor(QColorGroup.Text,Qt.red)
00086     self.red.inactive().setColor(QColorGroup.Button,Qt.red)
00087     self.red.disabled().setColor(QColorGroup.Text,Qt.red)
00088     self.red.disabled().setColor(QColorGroup.Button,Qt.red)
00089
00090     self.green.active().setColor(QColorGroup.Text,Qt.green)
00091     self.green.active().setColor(QColorGroup.Button,Qt.green)
00092     self.green.inactive().setColor(QColorGroup.Text,Qt.green)
00093     self.green.inactive().setColor(QColorGroup.Button,Qt.green)
00094     self.green.disabled().setColor(QColorGroup.Text,Qt.green)
00095     self.green.disabled().setColor(QColorGroup.Button,Qt.green)
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3


LATTE: userAppTree.py Source File

browser

userAppTree.py

00001 __version__  = "$Revision: 2.4 $"
00002
00003 from qt import QListView, QPoint, QPopupMenu, QCursor, SIGNAL
00004
00005 from userAppLeaf import userAppLeaf
00006
00007 class userAppTree(object):
00008   def __init__(self, view):
00009     self.view = view
00010     self.clearLeaves()
00011     self.leaf_type_module_dict = {}
00012     self.oldItem = None
00013     self.copyFromMenu = None
00014
00015     self.view.connect(self.view, SIGNAL('rightButtonClicked ( QListViewItem *, const QPoint &, int)'), self.rightMouseClicked)
00016     self.view.connect(self.view, SIGNAL("pressed ( QListViewItem *, const QPoint &, int )"), self.pressedEvent)
00017
00018 #    self.view.setSelectionMode(QListView.NoSelection)
00019
00020   def pressedEvent(self, leaf, pos, column):
00021     if leaf is not None:
00022       leaf.pressedEvent(pos, column)
00023
00024   def rightMouseClicked(self, leaf):
00025     """ Function that is triggered by a right click of the mouse over the tree
00026         This lauches a pop-up menu with actions that can be taken on the
00027         leaf where the cursor is
00028         \param leaf leaf that the mouse is pointing at
00029     """
00030     if leaf is not None:
00031       popup = QPopupMenu(self.view,'Options')
00032       if self.copyFromMenu is not None:
00033         popup.insertItem('Copy selection from', self.copyFromMenu)
00034       actions = leaf.leafActionsTuples()
00035       for (name,method) in actions:
00036         popup.insertItem(name, method)
00037       popup.popup(QCursor.pos())
00038
00039   def setCopyFromMenu(self, from_list, method):
00040     """ Function that creates the popup menu that is launched when
00041         'Copy from' is highlighted
00042         based on a list describing the names that describes the origins
00043         and on a method that will execute the copying given the origin's index
00044         \param from_list list of name for the possible origins
00045         \param method that execute the copying from the specified origin to this leaf
00046     """
00047     if self.copyFromMenu is None:
00048       self.copyFromMenu = QPopupMenu(self.view, 'Copy from')
00049     else:
00050        self.copyFromMenu.clear()
00051     for k in range(len(from_list)):
00052       name = from_list[k]
00053       id = self.copyFromMenu.insertItem(name, method)
00054       self.copyFromMenu.setItemParameter(id,k)
00055
00056   def AddLeaf(self,leaf):
00057     """ Function that adds the leaf to a local list of the leafs in this tree
00058         Locally the list is organized according to module types
00059         \param leaf leaf to add to the tree leaves list
00060     """
00061     self.leaf_list.append(leaf)
00062     if leaf.module() in self.leaf_dict.keys():
00063       self.leaf_dict[leaf.module()].append(leaf)
00064     else:
00065       self.leaf_dict[leaf.module()] = [leaf]
00066
00067   def clearLeaves(self):
00068     self.leaf_list = []
00069     self.leaf_dict = {}
00070     self.view.clear()
00071
00072   def getAllLeaves(self):
00073     return self.leaf_list
00074
00075   def getInputNodes(self, of_class_type = None):
00076     """ Function which extracts from all the tree the leafs that are checked,
00077         it builds a list of Gnodes that are considered checked
00078         \return list of Gnodes
00079     """
00080     inputs = []
00081     child = self.view.firstChild()
00082     while child is not None:
00083       if child.isOn() and isinstance(child.node, of_class_type):
00084         inputs.append(child.node)
00085       inputs += child.getInputNodes(of_class_type)
00086       child = child.nextSibling()
00087     return inputs
00088
00089   def getLeaf(self,leaf):
00090     """ Function that retrieves a leaf in the tree structure
00091         \param leaf leaf to search for
00092         \return leaf matching leaf found in the tree
00093     """
00094     # The tree is designed with only one first generation child
00095     return self.view.firstChild().getLeaf(leaf)
00096
00097   def copyCheckedNodes(self, from_tree):
00098     """ Function that copies all the checked status of nodes in the from_tree to the nodes in this tree
00099         \param from_tree tree object from which to copy the checked information for the leaves
00100     """
00101     # The tree is designed with only one first generation child
00102     if (self.view.firstChild() is not None) and (from_tree.firstChild() is not None):
00103       self.view.firstChild().copyCheckedNodes(from_tree.firstChild())
00104
00105
00106   def loadNodes(self, lat, leaf_class = None):
00107     """ Function that populate the tree by converting nodes in the LAT structure into leaves of leaf_class
00108         \param lat LAT pointer
00109         \param leaf_class class object which will be used to populate the tree
00110     """
00111     ## Clear the hierarchy first
00112     if leaf_class == None:
00113       leaf_class = userAppLeaf
00114
00115     for leaf in self.leaf_list:
00116       leaf.close()
00117       del(leaf)
00118     self.clearLeaves()
00119     if lat == None:
00120       return
00121
00122     self.view.setEnabled(1)
00123
00124     lat_leaf = leaf_class(lat, lat, self.view)
00125     lat_leaf.setOpen(1)
00126     self.AddLeaf(lat_leaf)
00127
00128     if lat.existsAEM():
00129       aem = lat.AEM
00130       aem_leaf = leaf_class(lat, aem, lat_leaf)
00131       self.AddLeaf(aem_leaf)
00132       for arc in aem.ARC.values():
00133         arc_leaf = leaf_class(lat, arc, aem_leaf)
00134         self.AddLeaf(arc_leaf)
00135         for afe in arc.AFE.values():
00136           self.AddLeaf(leaf_class(lat, afe, arc_leaf))
00137
00138       if aem.existsAEQ():
00139         self.AddLeaf(leaf_class(lat, aem.AEQ, aem_leaf))
00140
00141     for pdu in lat.PDU.values():
00142       pdu_leaf = leaf_class(lat, pdu, lat_leaf)
00143       self.AddLeaf(pdu_leaf)
00144       if pdu.existsPEQ():
00145         self.AddLeaf(leaf_class(lat, pdu.PEQ, pdu_leaf))
00146
00147     if lat.existsCRU():
00148       self.AddLeaf(leaf_class(lat, lat.CRU, lat_leaf))
00149
00150     if lat.existsEBM():
00151       ebm = lat.EBM
00152       ebm_leaf = leaf_class(lat, ebm, lat_leaf)
00153       self.AddLeaf(ebm_leaf)
00154       if ebm.existsEBMC():
00155         self.AddLeaf(leaf_class(lat, ebm.EBMC, ebm_leaf))
00156       if ebm.existsEBMST():
00157         self.AddLeaf(leaf_class(lat, ebm.EBMST, ebm_leaf))
00158
00159     if lat.existsGEM():
00160       gem = lat.GEM
00161       gem_leaf = leaf_class(lat, gem, lat_leaf)
00162       self.AddLeaf(gem_leaf)
00163       if gem.existsGEMC():
00164         self.AddLeaf(leaf_class(lat, gem.GEMC, gem_leaf))
00165       if gem.existsGEMMG():
00166         self.AddLeaf(leaf_class(lat, gem.GEMMG, gem_leaf))
00167       if gem.existsGEMST():
00168         self.AddLeaf(leaf_class(lat, gem.GEMST, gem_leaf))
00169       if gem.existsGEMSC():
00170         self.AddLeaf(leaf_class(lat, gem.GEMSC, gem_leaf))
00171       if gem.existsGEMVG():
00172         self.AddLeaf(leaf_class(lat, gem.GEMVG, gem_leaf))
00173       if gem.existsGEMIE():
00174         self.AddLeaf(leaf_class(lat, gem.GEMIE, gem_leaf))
00175       if gem.existsGEMW():
00176         self.AddLeaf(leaf_class(lat, gem.GEMW, gem_leaf))
00177
00178     for tem in lat.TEM.values():
00179       tem_leaf = leaf_class(lat, tem, lat_leaf)
00180       self.AddLeaf(tem_leaf)
00181       if tem.existsTIC():
00182         self.AddLeaf(leaf_class(lat, tem.TIC, tem_leaf))
00183
00184       for ccc in tem.CCC.values():
00185         ccc_leaf = leaf_class(lat, ccc, tem_leaf)
00186         self.AddLeaf(ccc_leaf)
00187         for crc in ccc.CRC.values():
00188           crc_leaf = leaf_class(lat, crc, ccc_leaf)
00189           self.AddLeaf(crc_leaf)
00190           for cfe in crc.CFE.values():
00191             self.AddLeaf(leaf_class(lat, cfe, crc_leaf))
00192
00193       for tcc in tem.TCC.values():
00194         tcc_leaf = leaf_class(lat, tcc, tem_leaf)
00195         self.AddLeaf(tcc_leaf)
00196         for trc in tcc.TRC.values():
00197           trc_leaf = leaf_class(lat, trc, tcc_leaf)
00198           self.AddLeaf(trc_leaf)
00199           for tfe in trc.TFE.values():
00200             self.AddLeaf(leaf_class(lat, tfe, trc_leaf))
00201
00202   def setStatus(self, leaf, descr):
00203     leaf.setText(self.columns_dict['Status'], descr[1])
00204
00205   def close(self):
00206     for leaf in self.leaf_list:
00207       leaf.close()
Generated on Fri Jul 21 13:26:34 2006 for LATTE R04-12-00 by doxygen 1.4.3