class rcPartition : public rcFsm

Central object of the run control corba server

Inheritance:


Public Methods

static rcPartition* create( const char *name, const char *owner, const char *identifier, const char *pcTMHardware )
Static create member function
int deallocate_granule( const char *gr_name )
Deallocates the granule
inline static rcPartition* get()
Returns the partition object
~rcPartition()
Destructor

Public

Initialise function
Accessor member functions
inline const char* getUserIdentifier()
Returns the user id
inline const char* getPartitionName()
REturns the name of the partition
const char* getIdentifier()
Returns the identifier
const char* getOwner()
Returns the owner
int getNbStages()
Returns the number of stages in the run control server
int getNbStagesOutstanding()
Returns the number of stages that are still outstanding
pstring getGranules()
Returns a string of the form Gr1+Gr2+Gr3, where Gri is the ith granule belonging to this partition
pstring getGl1Configuration()
Returns the string with the gl1 mode
bool isAutoRunMode()
Returns true if we are in autorun mode
void setAutoRunMode( bool bMode )
Sets the autorun mode
rcPartitionConfiguration getConfiguration()
Returns a copy of the partition configuration object
bool isRunning()
True if we are taking data
bool isPaused()
True if we are in a paused state
bool isReady()
True if we are in the ready state
bool isinErrorState()
True if we are in the error state
void setDebug( bool aBool )
Sets the debug flag
bool getDebug()
Returns the debug flag
const rcRun* getRun()
Returns a pointer to the current run
void show_status( ostream &os = cout )
Prints a status summary to os
void enableTimers()
Enables the timers
void disableTimers()
Disables all the timers
inline void setTimeout( int iMillisec )
Sets the timeout
inline int getTimeout()
Returns the current value of the timeout
bool isPartitionServerRunning()
Returns true if the PartitionServer is running
FSM for the partition object.
int setCurrentState( const char *pcNewState )
Sets the current state of the partition object
int create()
Create State
int configure( const char *pcCmd, int nbParameters, const char *pcArgs[] )
Configure state
int download(int iScope, int iCheckReadinessLevel = eNormal )
Download state
int waiting_for_download( const char *pcStageName, int iStatus )
State in which the partition waits for all the process stages to report that they have arrived in the Ready state
int ready()
Ready state action
int starting( struct run_parameters *pRunParams )
start run state
int waiting_for_start( const char *pcStageName, int iStatus )
wait for start run state
int running()
Running state
int ending( const char *pSource )
Run ending state
int waiting_for_end( const char *pcStageName, int iStatus )
Waiting for the end of a run
int ended()
Run has ended state
int check_prst()
Check the status of all process stages
int error( const char *msg )
Error state
int delete_state()
Entered when the run control shuts down
int pause()
Pausing means simply raising the GTM busy
int resume()
Resume means simply lowering the GTM busy
bool checkReady( int iCheckingFlag = eNormal )
Calls checkReady on all PRST
Misc member functions

Private

enum download_mode
enum for the download modes
enum eCheckReadinessLevel
Various levels of checking the readiness
Private data members
char* pcPartitionName
Name of the partition which maps into the GL1 and PartitionServer name
char* pcOwner
Owner of the partition
char* pcIdentifier
Identifier of the partition
list <char *> listGranules
List of allocated granule names
int nStagesOutstanding
Number of stages that haven't reported successful completion at at initialisation/download/start/stop sequence
int iCurrentScope
Current scope of the download command
int iCurrentCheckReadinessLevel
Current checkReadinessLevel
bool bInitialised
True if we did perform an initialise
bool bStartAsap
True if we start a run as soon as we reached the Ready state
rcRun* pMyRun
Pointer to the current run object or NULL
static const char* pcStates[eNStates]
Name of all the states of the partition object
smTimer* pMyTimer
Pointer to current timer
bool bDebug
True if we want debug info to cout
bool bFirstDownload
True if this is the first time we are downloading
bool bPaused
True if the run is paused
static rcPartition* thePartition
Static pointer to the partition
Partition_i* pMyImplObj
Pointer to the Partition_i proxy
Private member functions
int determinePrstTransition( int *theNextState )
Determines the next global transition sequence

Inherited from rcFsm:

Public Methods

const char* getcCurrentState()
int getCurrentState()
bool getEventTrace()
char* getFsmName()
virtual void setCurrentState(int iNewState )
void setEventTrace( bool bTrace )
virtual int TakeEvent( rcEvent *Event )

Protected Fields

bool bEventTrace
bool bNoTimersAccepted
int iCurrentState
const char* pcCurrentState
char* pcFsmName

Protected Methods

virtual int canthappenEvent( rcEvent *pEvent )
virtual int ignoreEvent( rcEvent *pEvent )

Documentation

Central object of the run control corba server. The partition object coordinates the operation of the run control server. Thre is only one instance per run control server which is implemented through the Singelton pattern (private constructor). It does that through the process stages by bringing them through the initialise, download, start_run and end_run sequence. In addition it has the configuring state in which the user can configure the components of the allocated hardware and software process units. Every configuration command brings the partition object automatically into the configuring state, which means that a download has to be done in order to start a new run.

The partition object inherits the state model from the rcFsm object (like every active object in the run control server.

enum download_mode
enum for the download modes

enum eCheckReadinessLevel
Various levels of checking the readiness. eNone does nothing, eMinimal only checks that the run control objets are in the desired state. eNormal currently only checks the GLink locked at the DCM, eDetailed is not yet implemented.

static rcPartition* create( const char *name, const char *owner, const char *identifier, const char *pcTMHardware )
Static create member function.
Returns:
pointer to the partition object.
Parameters:
name - : name of the partition object. Given by the user at daq_start time. Normally this is the initials of the person running the system prefixed by the string partition.
owner - : the owner if it is specified by the user at startup time as an argument to the executable run_control with option -o.
identifier - : the initials of the person running the daq.

~rcPartition()
Destructor

inline static rcPartition* get()
Returns the partition object. This is required due to the Singleton character of the partition object.

int deallocate_granule( const char *gr_name )
Deallocates the granule. Currently we do not really do that but assume that the granules are allocated at startup time and are kept until the run control server ends.

Initialise function

Accessor member functions

inline const char* getUserIdentifier()
Returns the user id. This is used to create a unique token, e.g. for the frame receivers.

inline const char* getPartitionName()
REturns the name of the partition. this is the name which resides in the partition server and maps to the GL1 name. It corresponds to the allocated TM hardware.

const char* getIdentifier()
Returns the identifier

const char* getOwner()
Returns the owner

int getNbStages()
Returns the number of stages in the run control server

int getNbStagesOutstanding()
Returns the number of stages that are still outstanding. E.g. during the download phase it is the number of stages that are not yet downloaded. Ditto for initialise and startRun endRun.

pstring getGranules()
Returns a string of the form Gr1+Gr2+Gr3, where Gri is the ith granule belonging to this partition

pstring getGl1Configuration()
Returns the string with the gl1 mode

bool isAutoRunMode()
Returns true if we are in autorun mode

void setAutoRunMode( bool bMode )
Sets the autorun mode

rcPartitionConfiguration getConfiguration()
Returns a copy of the partition configuration object

bool isRunning()
True if we are taking data

bool isPaused()
True if we are in a paused state. The paused state is simply the data taking state with the GTM busy raised.

bool isReady()
True if we are in the ready state

bool isinErrorState()
True if we are in the error state

void setDebug( bool aBool )
Sets the debug flag

bool getDebug()
Returns the debug flag

const rcRun* getRun()
Returns a pointer to the current run. If we are taking data right now. Otherwise NULL.

void show_status( ostream &os = cout )
Prints a status summary to os

void enableTimers()
Enables the timers. This is the default.

void disableTimers()
Disables all the timers

inline void setTimeout( int iMillisec )
Sets the timeout. See getTimeout for explanation.

inline int getTimeout()
Returns the current value of the timeout. This is the number of milliseconds that the partition object waits during the initialise/download sequence before it drops into the error state if not all stages report success.

bool isPartitionServerRunning()
Returns true if the PartitionServer is running. In that case we do not allocate the granules from the command line, but as the partition server for the list of granules that belong to that partition. This is done in the Partition_i proxy object.

FSM for the partition object.

int setCurrentState( const char *pcNewState )
Sets the current state of the partition object

int create()
Create State. Not used.

int configure( const char *pcCmd, int nbParameters, const char *pcArgs[] )
Configure state

int download(int iScope, int iCheckReadinessLevel = eNormal )
Download state. This is the main steering routine that controls the download process. See the partition.cc file for details of the various steps involved.
Parameters:
iScope - : 0,1 or 2 depending whether we want to initialise, download all or conditional download.
iCheckReadinessLevel - : parameter that determines to what level we check the readiness once we arrive in the Ready state.

int waiting_for_download( const char *pcStageName, int iStatus )
State in which the partition waits for all the process stages to report that they have arrived in the Ready state

int ready()
Ready state action

int starting( struct run_parameters *pRunParams )
start run state

int waiting_for_start( const char *pcStageName, int iStatus )
wait for start run state

int running()
Running state

int ending( const char *pSource )
Run ending state

int waiting_for_end( const char *pcStageName, int iStatus )
Waiting for the end of a run

int ended()
Run has ended state

int check_prst()
Check the status of all process stages. This state is entered when a process stage reports a state change and the partition is not really expecting this. Eg a process stage finishes its download function after the partition object has already time out.

int error( const char *msg )
Error state. Currently an error is only generated by a timeout during a state transition of the run control.

int delete_state()
Entered when the run control shuts down

int pause()
Pausing means simply raising the GTM busy

int resume()
Resume means simply lowering the GTM busy

bool checkReady( int iCheckingFlag = eNormal )
Calls checkReady on all PRST

Misc member functions

Private member functions

int determinePrstTransition( int *theNextState )
Determines the next global transition sequence. Given the iCurrentScope of the download, find out whether we first have to initialise or whether we can directly proceed with the download.

Private data members

char* pcPartitionName
Name of the partition which maps into the GL1 and PartitionServer name

char* pcOwner
Owner of the partition. Same as identifier unless specifically requested at the startup of the run control with the option -o

char* pcIdentifier
Identifier of the partition

list <char *> listGranules
List of allocated granule names. Note granules that exist but are not allocated are not seen here.

int nStagesOutstanding
Number of stages that haven't reported successful completion at at initialisation/download/start/stop sequence

int iCurrentScope
Current scope of the download command

int iCurrentCheckReadinessLevel
Current checkReadinessLevel. The allowed values are an enumeration. If eNone, then we do not perform any checking at the end of download. If eNormal, then we do the standard check (make sure all glink locks are locked. Other values are currently not implemented.

bool bInitialised
True if we did perform an initialise

bool bStartAsap
True if we start a run as soon as we reached the Ready state

rcRun* pMyRun
Pointer to the current run object or NULL

static const char* pcStates[eNStates]
Name of all the states of the partition object

smTimer* pMyTimer
Pointer to current timer

bool bDebug
True if we want debug info to cout

bool bFirstDownload
True if this is the first time we are downloading

bool bPaused
True if the run is paused

static rcPartition* thePartition
Static pointer to the partition. Used to implement the singleton.

Partition_i* pMyImplObj
Pointer to the Partition_i proxy


This class has no child classes.
Author:
C.Witzig
Date: Jan 25, 2000
Version:
Last update Jan 25, 2000

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de