class ROobject : genNamedObj<ROobject*>, public Pu

Proxy for the Readout object in VxWorks

Inheritance:


Public Methods

ROobject* castToROobject()
Poor man's RTTI
bool checkReady( int iLevel )
Returns true if the object is ready for data taking
int configure( const char *cmd, const char *value, const char *aux_param )
Generic configuration file
void dump( ostream &os = cout )
Dumps information about the object to ostream os
static void dump_all( ostream &os = cout )
Iterates over all objects and calls dump
static ROobject* getByCrate( const char *pcCrateName )
Given the name of the crate, return a pointer to the readout object
int getRunInfo( int &RunNb, int &iEventNb, int &iVolume, int &iBufferNb )
Makes a RMI to the object in Vxworks and returns information about the run in progress
void identify( ostream &os = cout )
Prints a one-line summary about the object
static void listAll( ostream &os = cout )
Iterates over all objects and calls identify
static char* makeUniqueName( const char *pcOriginalName )
Transform the "normal" name of the object into a partition specific name
ROobject(const char *name, const char *design, const char *pcCrate)
Creator with the name, type and name of the crate

Public

Accessors
static ROobject* getRoForPu( Pu* thePu )
Return the readout object for a given procss unit
inline const char* getCrateName()
Return the name of the crate where the readout object is located
inline void setHostToSendData( const char* pcHost )
Sets the host where the readout objects sends the data to
inline void setSocket( int iNewSocket )
Sets the socket where the ddEventServer will pick up the events
inline int getSocket()
Returns the name of the socket
void setProtocolType( int iType )
Sets the type of protocol
pstring getHostToSendData()
Returns the name of the host
inline bool isSocketOpen()
Returns true if the socket between the readout object and the ddEventServer has been opened
inline void setDspLoaded( bool aBool )
Returns true if the DSP code has been loaded in VxWorks
void setInitFile( const char *file )
To set the DCM initialisation file
void addInitFile( const char *file )
To add a DCM initialisation file to the list
int setDevices( int nDev, const char **pDevices )
To set the list of devices
int addDevices( int nDev, const char **pDevices )
To append a list of devices to the readout object
int addDevice( const char *device_name )
To add one device to the readout object
int addDevice( Pu *pPu )
To add one device to the readout object
int getDevices( list<Pu*> &theList )
Returns a list of devices
void clearDeviceList()
To clear the list of devices that the readout object controls
Standard state transition functions.
int connect()
Connect - see above for details
int initialise()
Initialise - see above for details
int download()
Download - see above for details
int start_run()
StartRun - see above for details
int end_run()
EndRun - see above for details
bool updatePu( int iStatus, int eState_on_success )
Standard updatePu to steer through the state transitions

Private Fields

bool bCreatedInVxWorks
True if the object was created in VxWorks when calling connect
bool bDownloadDeviceList
True if we have to download the name of the devices that the readout object reads out in VxWorks
bool bDspLoaded
True if we called LoadDSP once in VxWorks
bool bSocketCloseRequested
True if we are supposed to close the socket at the next download
bool bSocketOpen
True if the socket connection between VxWorks and phoncs0 has been established
int iLastCmdSent
Remembers the last corba command that was sent
int iProtocolType
Type of the protocol
int iSocket
Socket number, where the VxWorks object sends its data to
list <Pu*> listDevices
List with the names of the devices that are read out
list <pstring> listInitFiles
List with the initialisation files that have to be passed to VxWorks at initialisation time
pstring psCrate
Name of the crate, where the object resides
pstring psHostToSendData
Name of the host, wehre the VxWorks object sends its data to
RoObject_var varRoObject
Corba VAR to the readout object in VxWorks

Private Methods

int createInVxWorks()
Creates the object in VxWorks by calling newComponent on the objmanager
int deleteInVxWorks()
Deletes the object in VxWorks by calling deleteComponent on the objmanager
int sendInitialisationEventToPar()
Starts the initialisation sequence for the DCMs by sending PAR_RESET to all partition modules that have been allocated by this partition
int sendROEvent( int iEventId )
Constructs the corba event for the event iEventId and sends it to the event notifier

Inherited from genNamedObj:

Public Methods

static void add( const char *name, X x )
inline static X begin()
inline static X end()
static bool exists( const char *name )
static X get( const char *name )
int getLocation()
inline static int getNbElements()
static X getObject( const char *name )
static int getObjects( const char *name, list<X> &theList )
inline const char* getObjName()
inline static X next()
static void remove( const char *name )

Private Fields

static map < const char*, X, cstring_ordering_t > ::iterator m_It
static map < const char*, X, cstring_ordering_t > m_Map
char* m_Name

Inherited from Pu:

Public

Accessors common to all PU

const char* getPudName()
Returns the name of the Process Unit Design
const char* getPrstName()
Return the name of the process stage, which controls this PU
Prst* getPrst()
Return a pointer to the process stage, which controls this PU
inline void enable()
To set the enable flag of the PU to true
inline void disable()
To set the disable flag of the PU to false
virtual bool isEnabled( const char* pccTransition = NULL )
To find out whether a process unit is enabled
void setSimulate( bool bValue )
To set the simulate mode
void setDebug( bool aBool )
To set the debug mode
bool getDebug()
Returns true if we are in debug mode

Architectural common member functions for all PU

Pu(const char *name, const char *pud_name )
constructor with the name and design as input
virtual ~Pu()
virtual destructor for handling dtor of subtypes
static mapPu_t mapPu
The PUs are organized in a global STL map
static bool exists( const char *name )
Returns true if a PU of this name exists
static mapPu_t::iterator locate( const char *name )
given the name of the PU return an STL map iterator to it
static Pu* get( char *name )
given the name return a pointer to the object itself
static int getPuByTag( const char* pcTag, list<Pu*> &theList )
To get a whole bunch of Pu that start with a given name
virtual void identify( ostream &os = cout )
To print out a one-line identifing message to the ostream os
virtual void dump( ostream &os = cout )
To print out a detailed summary of the Pu to ostream os
static void dump_all( ostream &os = cout )
To print out a detailed summary for all PU to ostream os
static void listAll( ostream &os = cout )
To print out a one-line summary for all PU to ostream os

Simple implementation of RTTI (see note above)

virtual Rdev* castToRdev()
virtual casts to Rdev
virtual Rout* castToRout()
virtual casts to Rout
virtual EvPool* castToEvPool()
virtual casts to EvPool
virtual Swpu* castToSwpu()
virtual casts to Swpu
virtual rcGTM* castToGTM()
virtual casts to GTM
virtual FEM* castToFEM()
virtual casts to FEM
virtual DCM* castToDCM()
virtual casts to DCM
virtual DDsocket* castToDDsocket()
virtual casts to DDsocket
virtual ROobject* castToROobject()
virtual casts to ROobject
virtual ddEventServer* castToddEventServer()
virtual casts to ddEventServer
virtual DataLogger* castToDataLogger()
virtual casts to DataLogger
virtual rcDataLogger* castToRcDataLogger()
virtual casts to rcDataLogger
virtual DummyDevice* castToDummyDevice()
virtual casts to Dummy device
virtual Par* castToPar()
virtual casts to Par
virtual EvbComponent* castToEvbComponent()
virtual casts to EvbComponent

State transitions

enum states
enum with the different possible states - these are common to all PU!!!
static const char* pcStates[]
the names of the state transitions as static const char*
int setState(int state )
Sets the state to the new state given by the enum int
int setState( const char *pcState )
Sets the state to the new state given by the name of the state
int getState()
Returns the state to the new state as enum int
const char* getcState()
Returns the state to the new state as a string
static int setStateAndUpdateStage( const char *pcPuGroup, const char *pcNewState )
Function that searches for a named PU (or group of PUs), sets its STT to the pcNewState and updates the ProcessStage at the same time

virtual functions for generic configuring, starting/updating/continuing a state transition

virtual int configure( const char* config_req, const char* value, const char *param = NULL )
To configure a PU
virtual int connect()
Connect is called once at initialisation time
virtual int initialise()
To initialise the PU
virtual int download()
To download the PU
virtual int start_run()
To start a new run
virtual int end_run()
To stop a run in progress
virtual bool updatePu( int iStatus, int eState_on_success )
Whenever a PU reports to the prst that is has done a state transition, the prst calls this virtual function
virtual bool checkReady( int iLevel )
Returns true if the process unit is in a ready state

Protected Fields

bool bDebug
bool bEnabled
bool bIgnoreErrorOnTransition[ eNStates ]
bool bSimulate
int eState
char* pcName
char* pcPud_name
const char* pcState

Protected Methods

int sendEventPuDone( int eState_on_success )
int updateStateAfterConfigReq( int eNewState = eInitialised )

Private Methods

int setIgnoreErrorOnTransition( const char* pcTransition, bool bValue )

Documentation

Proxy for the Readout object in VxWorks. Every partition has one readout object in those DCM crates where DCMs of its allocated granules are located. Eg the DC.W and PC.W are in the same DCM crate. If there these two granules are allocated to two different partitions, then there are two readout objects in that DCM crate.

The readout object has two functions: 1. it controls the DCMs on a partition basis, 2. it is able to read out the DCMs either through VME, DSP5 or through the VME readout of the PartitionModule.

The following things happen during the state transitions:

Last update: Feb 1, 2000, CW

ROobject(const char *name, const char *design, const char *pcCrate)
Creator with the name, type and name of the crate

static ROobject* getByCrate( const char *pcCrateName )
Given the name of the crate, return a pointer to the readout object

static char* makeUniqueName( const char *pcOriginalName )
Transform the "normal" name of the object into a partition specific name. Upon instantiating the object from the ascii config file we get a generic name. However the name must be partition specific as there may be more than one ROobject in VxWorks that each belong to a partition. We achieve this by simply adding the postfix "-thePartitionId" to the object name. Note that the allocated char* must be deleted by the user when it is no longer needed.

static void listAll( ostream &os = cout )
Iterates over all objects and calls identify

static void dump_all( ostream &os = cout )
Iterates over all objects and calls dump

void identify( ostream &os = cout )
Prints a one-line summary about the object

void dump( ostream &os = cout )
Dumps information about the object to ostream os

Accessors

static ROobject* getRoForPu( Pu* thePu )
Return the readout object for a given procss unit

inline const char* getCrateName()
Return the name of the crate where the readout object is located

inline void setHostToSendData( const char* pcHost )
Sets the host where the readout objects sends the data to

inline void setSocket( int iNewSocket )
Sets the socket where the ddEventServer will pick up the events

inline int getSocket()
Returns the name of the socket

void setProtocolType( int iType )
Sets the type of protocol. Currently we have only TCP/IP.

pstring getHostToSendData()
Returns the name of the host

inline bool isSocketOpen()
Returns true if the socket between the readout object and the ddEventServer has been opened

inline void setDspLoaded( bool aBool )
Returns true if the DSP code has been loaded in VxWorks

void setInitFile( const char *file )
To set the DCM initialisation file. All previous declared files are erased.

void addInitFile( const char *file )
To add a DCM initialisation file to the list

int setDevices( int nDev, const char **pDevices )
To set the list of devices
Returns:
rcSuccess
Parameters:
nDev - number of devices
- **pDevices Pointer to a pointer of devices

int addDevices( int nDev, const char **pDevices )
To append a list of devices to the readout object

int addDevice( const char *device_name )
To add one device to the readout object

int addDevice( Pu *pPu )
To add one device to the readout object

int getDevices( list<Pu*> &theList )
Returns a list of devices

void clearDeviceList()
To clear the list of devices that the readout object controls

bool checkReady( int iLevel )
Returns true if the object is ready for data taking. Overloads the checkReady from pu.

int configure( const char *cmd, const char *value, const char *aux_param )
Generic configuration file

ROobject* castToROobject()
Poor man's RTTI

int getRunInfo( int &RunNb, int &iEventNb, int &iVolume, int &iBufferNb )
Makes a RMI to the object in Vxworks and returns information about the run in progress.
Parameters:
RunNb - the current run number
iEventNb - the current event number
iVolume - the number of MByte acquired so far
iBufferNb - the current buffer number

Standard state transition functions.

int connect()
Connect - see above for details

int initialise()
Initialise - see above for details

int download()
Download - see above for details

int start_run()
StartRun - see above for details

int end_run()
EndRun - see above for details

bool updatePu( int iStatus, int eState_on_success )
Standard updatePu to steer through the state transitions

int createInVxWorks()
Creates the object in VxWorks by calling newComponent on the objmanager.

int deleteInVxWorks()
Deletes the object in VxWorks by calling deleteComponent on the objmanager

int sendROEvent( int iEventId )
Constructs the corba event for the event iEventId and sends it to the event notifier

int sendInitialisationEventToPar()
Starts the initialisation sequence for the DCMs by sending PAR_RESET to all partition modules that have been allocated by this partition. This routine is called after the DCMreadConfig have been called in VxWorks by the ReadoutObject.

bool bCreatedInVxWorks
True if the object was created in VxWorks when calling connect

int iLastCmdSent
Remembers the last corba command that was sent

pstring psCrate
Name of the crate, where the object resides

pstring psHostToSendData
Name of the host, wehre the VxWorks object sends its data to

int iSocket
Socket number, where the VxWorks object sends its data to

int iProtocolType
Type of the protocol. Currently only TCP/IP.

bool bSocketOpen
True if the socket connection between VxWorks and phoncs0 has been established

bool bSocketCloseRequested
True if we are supposed to close the socket at the next download

bool bDspLoaded
True if we called LoadDSP once in VxWorks

bool bDownloadDeviceList
True if we have to download the name of the devices that the readout object reads out in VxWorks

list <Pu*> listDevices
List with the names of the devices that are read out

list <pstring> listInitFiles
List with the initialisation files that have to be passed to VxWorks at initialisation time. Typically there is one file per granule per crate (as generated by the process_pcf_command).

RoObject_var varRoObject
Corba VAR to the readout object in VxWorks.


This class has no child classes.

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