Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

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:
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3