trkwsCON_STD_COMMANDS
Section: Devices and Network Interfaces (4)
Updated: 2012-04-23 10:11
Index
Return to man pages list
NAME
trkwsCON_STD_COMMANDS - Class to handle standard commands in the
trkwsControl process.
SYNOPSIS
#include "trkwsCON_STD_COMMANDS.h"
class trkwsCON_STD_COMMANDS : public evhSTD_COMMANDS
{
public:
trkwsCON_STD_COMMANDS(const dbSYMADDRESS dbPoint);
~trkwsCON_STD_COMMANDS();
virtual evhCB_COMPL_STAT StateCB(msgMESSAGE &msg, void *udata);
virtual evhCB_COMPL_STAT StatusCB(msgMESSAGE &msg, void *udata);
virtual evhCB_COMPL_STAT StandByCB(msgMESSAGE &msg, void *udata);
virtual evhCB_COMPL_STAT OnlineCB(msgMESSAGE &msg, void *udata);
virtual evhCB_COMPL_STAT OffCB(msgMESSAGE &msg, void *udata);
virtual evhCB_COMPL_STAT SelfTestCB(msgMESSAGE &msg, void *udata);
virtual evhCB_COMPL_STAT TestCB(msgMESSAGE &msg, void *udata);
virtual evhCB_COMPL_STAT SimulatCB(msgMESSAGE &msg, void *udata);
virtual evhCB_COMPL_STAT StopSimCB(msgMESSAGE &msg, void *udata);
virtual evhCB_COMPL_STAT VerboseCB(msgMESSAGE &msg, void *udata);
vltINT32 GlobalState();
const char* GlobalStateName();
vltINT32 GlobalSubState();
const char* GlobalSubStateName();
protected:
trkwsFOCUS_DATA &trkwsFocusData;
virtual evhCB_COMPL_STAT MirrorToSetup(msgMESSAGE &msg, void *udata);
private:
const dbSYMADDRESS dbBasePoint;
};
PARENT CLASS
evhSTD_COMMANDS
DESCRIPTION
This class overload the default behaviour for some standard commands
implemented by the base class evhSTD_COMMANDS, in order to meet
the specific requirements of the trkwsControl process. Also, some of the
standard commands are implemented here, in exactly the same way as the
default behaviour (taken from evhSTD_COMMMANDS), to allow for easier
addition of special behaviour, should this be necessary!
PUBLIC METHODS
trkwsCON_STD_COMMANDS(const dbSYMADDRESS dbPoint,
const char *version);
Initialize the name state table using trkwsStateNameMap and
load the symbolic address of its parent point, where it is assumed
that the "state" and "substate" attributes are.
evhCB_COMPL_STAT StateCB(msgMESSAGE &msg, void *udata);
evhCB_COMPL_STAT StatusCB(msgMESSAGE &msg, void *udata);
These two callbacks are used for the STATE and STATUS commands.
They read the value of the "state" and "substate" attributes in the
paren database point and format the reply to be sent
evhCB_COMPL_STAT StandByCB(msgMESSAGE &msg, void *udata);
evhCB_COMPL_STAT OnlineCB(msgMESSAGE &msg, void *udata);
evhCB_COMPL_STAT OffCB(msgMESSAGE &msg, void *udata);
In this simple first implementation the commands just set the local
state of trkwsControl to the requested value. In case of Online, the
process state is set to IDLE, which is one of the online 'substates'.
This forces the global state (that is calculated with a calculation
engine formula), to change state as well.
Perhaps it would be better to add some checks to verify if it is possible
to switch to the new state!!
evhCB_COMPL_STAT SelfTestCB(msgMESSAGE &msg, void *udata);
evhCB_COMPL_STAT TestCB(msgMESSAGE &msg, void *udata);
In this simple implementation the commands just send an OK message
to the originator, like in the base class.
They have been overloaded here just to make easier to implement later
a real behaviour, performing really some test.
evhCB_COMPL_STAT SimulatCB(msgMESSAGE &msg, void *udata);
evhCB_COMPL_STAT StopSimCB(msgMESSAGE &msg, void *udata);
evhCB_COMPL_STAT VerboseCB(msgMESSAGE &msg, void *udata);
This commands work locally as the base class, setting the database
corresponding variable to the requested value, but they also mirror
the command to the trkwsSetup task
vltINT32 GlobalState();
const char* GlobalStateName();
vltINT32 GlobalSubState();
const char* GlobalSubStateName();
These methods return the index value or the string corresponding to the
global state and substate of the module.
They read these value from the attributes that must be in the
parent point
PROTECTED METHODS
evhCB_COMPL_STAT MirrorToSetup(msgMESSAGE &msg, void *udata);
This methods receive a message structure and use it to mirror a
command also to trkwsSetup.
No wait is done to receive replies of any kind from trkwsSetup.
PRIVATE DATA MEMBERS
const dbSYMADDRESS dbBasePoint;
Symbolic address of the database parent point, that is assumed to
contain module's global state and substate.
It is set in the constructor.
ON LINE DATABASE
The class shares with trkwsCON_MAIN_TASK an instance of the trkwsCONTROL
class.
From this class it uses the attributes inherited from the base class
evhSTD_COMMANDS and the setup attribute, for sending 'mirrored' command
to the trkwsSetup process.
ASS evhSTD_COMMANDS trkwsCONTROL
EGIN
ATTRIBUTE INT32 probeStepTimeout 10
ATTRIBUTE INT32 setupTimeout 5
ATTRIBUTE evhDB_COMMAND setup
ATTRIBUTE trkwsTRANSFER transpres
ATTRIBUTE trkwsTRANSFER transoffs
ATTRIBUTE trkwsTRANSFER transrest
ATTRIBUTE trkwsTRANSFER_ASM transasm
D
It is also asumed that the parent point of the instance or prsCONTROL
contains a "state" and a "substate" attributes, that are used as global
state and substate for the whole module.
CAUTIONS
Some of the standard commands are implemented in a trivial way:
to make more safe the application should be improved.
Index
- NAME
-
- SYNOPSIS
-
- PARENT CLASS
-
- DESCRIPTION
-
- PUBLIC METHODS
-
- PROTECTED METHODS
-
- PRIVATE DATA MEMBERS
-
- ON LINE DATABASE
-
- EGIN
-
- D
-
- CAUTIONS
-
This document was created by
man2html,
using the manual pages.
Time: 10:11:26 GMT, April 23, 2012