class DCM : public genNamedObj< DCM* >, public Pu

Proxy class for the DCMs

Inheritance:


Public Methods

DCM* castToDCM()
Poor man's RTTI
static DCM* createDCM( const char *type, const char *name, const char *pud_name, const char *server_name )
Static member that creates the DCM subtype of the right flavor depending on the type of DCM (i
DCM( const char *name, const char *pud_name, const char *server_name )
Creator with the name, name of PUD and the objmanager name
virtual 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
DCM* getDsp5()
Returns a pointer to the 5th DSP that controls the data flow out to VME of the DCM
inline void identify( ostream &os = cout )
Prints a one-line summary about the object
virtual bool isDsp5()
Returns true if the DCM is the 5th DSP
bool isEnabled( const char* pccTransition = NULL )
Returns true if the DCM must do the state transition pccTransition
static void listAll( ostream &os = cout )
Iterates over all objects and calls identify
int resetBoard()
Sends the reset command
int startInitialiseAfterGtmOk()
Starts the reset-loadDsp-loadFpga sequence after the GTM has been reset
int startInitialiseFromPar()
Starts the reset-loadDsp-loadFpga sequence after the Partitioner has been initialised

Public

Accessor member functions
virtual int configure( const char *cmd, const char *value, const char* aux_param)
Generic configuration command
void setDspCode( const char* dsp_code )
To set the DSP file
void setFpgaCode( const char* fpga_code )
To set the FPGA file
void setFakeData( const char* fake_data_file )
To set the fake data file
pstring getDspCode()
Returns the DSP file
pstring getFpgaCode()
Returns the FPGA code
pstring getFakeData()
Returns the fake data file
void setReadoutMode( const char* pDest )
Sets the destination mode
inline pstring getReadoutMode()
Returns the mode with which we read out the DCMs
Relation to DCBs and FEMs
int install( DCB *pDcb, long iUnit )
To install a DCM in a DCB - returns error if already installed
inline const DCB* getDcb()
To return the DCB
inline long getUnitNb()
Returns which unit we are on the board (1-4)
void addFem( FEM *pFem )
To relate the DCM to the FEM (can be more than 1!)
void setPar( Par *pPar )
To relate to the partition module
state transition functions - to be invoked by the PRST
virtual int connect()
Makes sure that the object is created in VxWorks
virtual int initialise()
Resets the board, loads the DSP and FPGA code
virtual int download()
FE1 does nothing at download time
virtual int start_run()
Checks the GLink lock at SOR
virtual int end_run()
To end the run - does nothing
virtual bool updatePu( int iStatus, int eState_on_success )
Redefined upatePu to steer the object trough the state transition leading to the state eState_on_success

Protected Classes

enum eDcmReadoutModes
Enum for the different readout modes of the DCMs - none, vme, dsp5, token
enum eToSimulateDcms
Flag to set the Vxworks simulation

Protected Fields

bool bCheckGlinkLockedAtSOR
If true, check the GLink locked at SOR
int iLastCmdSent
Remembers the last event sent
long iUnitOnBoard
Which unit we are on the board (1-4)
DCB* myDcb
1:M relationship to DCB
Par* myPar
Pointer to the partition module that reads out this board
static const char* pcDcmReadoutModes[]
DCM readout mode as static strings to make it more readable
pstring psReadoutMode
String which says how we read out the DCMs based on the enum eDcmREadouModes

Protected Methods

int createInVxWorks()
Creates the object in Vxworks if it doesn't exist yet
virtual int sendDcmEvent( int iEventId )
Send event to corba

Protected

enum eDcmReadoutModes
Enum for the different readout modes of the DCMs - none, vme, dsp5, token
enum eToSimulateDcms
Flag to set the Vxworks simulation

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 class for the DCMs. It comes in several flavors: 1. generic DCM (of type FE1), 2. DCM of type FE2 (slightly different hardware and a few more configuration options), 3. dcm_dsp5 for the fifth dsp on the DCB board.

The following things happen at the state transitions

DCM( const char *name, const char *pud_name, const char *server_name )
Creator with the name, name of PUD and the objmanager name. Is private to enforce creating the object through the static member createDCM.

static DCM* createDCM( const char *type, const char *name, const char *pud_name, const char *server_name )
Static member that creates the DCM subtype of the right flavor depending on the type of DCM (i.e. the process unit design).

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

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

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

DCM* castToDCM()
Poor man's RTTI

Relation to DCBs and FEMs

int install( DCB *pDcb, long iUnit )
To install a DCM in a DCB - returns error if already installed

inline const DCB* getDcb()
To return the DCB

inline long getUnitNb()
Returns which unit we are on the board (1-4)

void addFem( FEM *pFem )
To relate the DCM to the FEM (can be more than 1!)

void setPar( Par *pPar )
To relate to the partition module

Accessor member functions

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

void setDspCode( const char* dsp_code )
To set the DSP file

void setFpgaCode( const char* fpga_code )
To set the FPGA file

void setFakeData( const char* fake_data_file )
To set the fake data file

pstring getDspCode()
Returns the DSP file

pstring getFpgaCode()
Returns the FPGA code

pstring getFakeData()
Returns the fake data file

void setReadoutMode( const char* pDest )
Sets the destination mode. This can be vme or token or none

inline pstring getReadoutMode()
Returns the mode with which we read out the DCMs

bool isEnabled( const char* pccTransition = NULL )
Returns true if the DCM must do the state transition pccTransition. For the DCM this is a bit trick, see the source code file for details.

state transition functions - to be invoked by the PRST

virtual int connect()
Makes sure that the object is created in VxWorks

virtual int initialise()
Resets the board, loads the DSP and FPGA code

virtual int download()
FE1 does nothing at download time

virtual int start_run()
Checks the GLink lock at SOR

virtual int end_run()
To end the run - does nothing

virtual bool updatePu( int iStatus, int eState_on_success )
Redefined upatePu to steer the object trough the state transition leading to the state eState_on_success

int startInitialiseFromPar()
Starts the reset-loadDsp-loadFpga sequence after the Partitioner has been initialised. This function is only used by the Par, to make sure we start to configure the Dcms AFTER the partition module is done.

int startInitialiseAfterGtmOk()
Starts the reset-loadDsp-loadFpga sequence after the GTM has been reset. Normally the DCM initialise sequence is started by the GTMs. However the DAQ system may be in the state in which the FEMs and GTMs are already ready but the DCMs are not. The partition object detects this situation at download time and then calls this routine.

int resetBoard()
Sends the reset command

DCM* getDsp5()
Returns a pointer to the 5th DSP that controls the data flow out to VME of the DCM. Used when reading the module out through the PM. Returns NULL if there is none.

virtual bool isDsp5()
Returns true if the DCM is the 5th DSP

int createInVxWorks()
Creates the object in Vxworks if it doesn't exist yet

virtual int sendDcmEvent( int iEventId )
Send event to corba

int iLastCmdSent
Remembers the last event sent

DCB* myDcb
1:M relationship to DCB

long iUnitOnBoard
Which unit we are on the board (1-4)

enum eToSimulateDcms
Flag to set the Vxworks simulation. In this mode we send the events to VxWorks, but do not access the DCMs. This can be used for testing without the hardware. Ed Desmond know everything about this.

enum eDcmReadoutModes
Enum for the different readout modes of the DCMs - none, vme, dsp5, token

static const char* pcDcmReadoutModes[]
DCM readout mode as static strings to make it more readable

pstring psReadoutMode
String which says how we read out the DCMs based on the enum eDcmREadouModes

Par* myPar
Pointer to the partition module that reads out this board

bool bCheckGlinkLockedAtSOR
If true, check the GLink locked at SOR


Direct child classes:
DCM_FE2
DCM_FE1
DCM_DSP5
Author:
C.Witzig
Date: Jan 31, 2000
Version:
Last update Jan 31, 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