European
Southern
Observatory

ESO — Reaching New Heights in Astronomy

Countries taking part in the ESO

VLT Software Documentation

prsSEQ_MAIN_TASK Class Reference

See man page prsSEQ_MAIN_TASK(4)
More...

#include <prsSEQ_MAIN_TASK.h>

List of all members.

Public Member Functions

 prsSEQ_MAIN_TASK (const dbSYMADDRESS dbPoint)
 ~prsSEQ_MAIN_TASK ()
virtual evhCB_COMPL_STAT CenterObjCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT ClearReadySetupCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT PrsAltAzCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT PrsCoordCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT PrsNamedPosCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT SetupCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT StopCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT SaveCurrSetupCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT SaveReadySetupCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT ExitCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT InitCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT OnlineCB (msgMESSAGE &msg, void *udata)
ccsCOMPL_STAT Init ()
ccsCOMPL_STAT Recover ()

Protected Member Functions

virtual evhCB_COMPL_STAT Execute (msgMESSAGE &msg, vltLOGICAL moveFlag=prsMOVE)
virtual evhCB_COMPL_STAT ExeReadyCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT ExeErrorCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT StopOKCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT StopErrorCB (msgMESSAGE &msg, void *udata)
ccsCOMPL_STAT RejectIfNotOnline (msgMESSAGE &msg, vltLOGICAL *rejected)

Protected Attributes

oslxSETUP * readySetupFile
oslxSETUP * checkSetupFile
evhDB_COMMAND stopCmd
evhDB_COMMAND presetCmd

Private Attributes

msgMESSAGE stopMsg
msgMESSAGE setupMsg
vltBYTES64 readySetup
vltBYTES64 defaultSetup
vltBYTES64 currentSetup
vltBYTES64 setupDictionary
vltBYTES64 setupAliasTable
vltINT32 readyTimeout
vltINT32 stopTimeout
char myName [32]

Detailed Description

See man page prsSEQ_MAIN_TASK(4)
Manpage of prsSEQ_MAIN_TASK

prsSEQ_MAIN_TASK

Section: Devices and Network Interfaces (4)
Updated: 2012-04-23 10:10
Index Return to man pages list
 

NAME

prsSEQ_MAIN_TASK - Main class for the prsSeqncr program

 

SYNOPSIS


class prsSEQ_MAIN_TASK : public evhDB_TASK
{
  public:
    prsSEQ_MAIN_TASK(const dbSYMADDRESS  dbPoint);
   ~prsSEQ_MAIN_TASK();

    // Callbacks for public commands
     evhCB_COMPL_STAT ClearReadySetupCB(msgMESSAGE &msg, void *udata);
     evhCB_COMPL_STAT CenterObjCB(msgMESSAGE &msg, void *udata);
     evhCB_COMPL_STAT PrsAltAzCB(msgMESSAGE &msg, void *udata);
     evhCB_COMPL_STAT PrsCoordCB(msgMESSAGE &msg, void *udata);
     evhCB_COMPL_STAT PrsNamedPosCB(msgMESSAGE &msg, void *udata);
     evhCB_COMPL_STAT SetupCB(msgMESSAGE &msg, void *udata);
     evhCB_COMPL_STAT StopCB(msgMESSAGE &msg, void *udata);
     evhCB_COMPL_STAT SaveCurrSetupCB(msgMESSAGE &msg, void *udata);
     evhCB_COMPL_STAT SaveReadySetupCB(msgMESSAGE &msg, void *udata);

     virtual evhCB_COMPL_STAT ExitCB(msgMESSAGE &msg, void *udata);
     virtual evhCB_COMPL_STAT InitCB(msgMESSAGE &msg, void *udata);
     virtual evhCB_COMPL_STAT OnlineCB(msgMESSAGE &msg, void *udata);

     ccsCOMPL_STAT    Init();
     ccsCOMPL_STAT    Recover();

  protected:
     evhCB_COMPL_STAT Execute(msgMESSAGE &msg,vltLOGICAL moveFlag=prsMOVE);
     evhCB_COMPL_STAT ExeReadyCB(msgMESSAGE &msg, void *udata);
     evhCB_COMPL_STAT ExeErrorCB(msgMESSAGE &msg, void *udata);

     evhCB_COMPL_STAT StopOKCB(msgMESSAGE &msg, void *udata);
     evhCB_COMPL_STAT StopErrorCB(msgMESSAGE &msg, void *udata);

     ccsCOMPL_STAT RejectIfNotOnline(msgMESSAGE &msg, vltLOGICAL *rejected);

     oslxSETUP      *readySetupFile;
     oslxSETUP      *checkSetupFile;
     evhDB_COMMAND   stopCmd;
     evhDB_COMMAND   presetCmd;

  private:
     msgMESSAGE      stopMsg;
     msgMESSAGE      setupMsg;

     // Configuration parameters (read from DB) in Init():
     vltBYTES64   readySetup;
     vltBYTES64   defaultSetup;
     vltBYTES64   currentSetup;
     vltBYTES64   setupDictionary;
     vltBYTES64   setupAliasTable;
     vltINT32     readyTimeout;
     vltINT32     stopTimeout;
};

 

PARENT CLASS


evhDB_TASK

 

DESCRIPTION


An instance of this class is the core of the prsSeqncr program and
is used receive and handle Preset commands and to perform all the
"administrative work" to check and handle setup files and configuration.

When it is created it registers the callbacks for the supported
commands and reads from the online database the configuration parameters.
Whenever one of these commands is received, the corresponding action is
issued.

 

PUBLIC METHODS


prsSEQ_MAIN_TASK(const dbSYMADDRESS  dbPoint)
  The constructor receives as parameter the symbolic address of
  online database support point for the object, i.e. the point
  where the object can find configuration and run time values.
  It prepares all the internal structures, install the callbacks
  and call Init() to read and initialize all configuration parms.

~prsAH_MAIN_TASK()

evhCB_COMPL_STAT ClearReadySetupCB(msgMESSAGE &msg, void *udata)
    The ready to run setup file is replaced with the reference setup
    file, where all the entries have default values.
    The Execute() method is called with "NOMOVE"

evhCB_COMPL_STAT CenterObjCB(msgMESSAGE &msg, void *udata);
    Sets to YES the corresponding entry in the ready to run setup file.
    The Execute() method is called with "MOVE"

evhCB_COMPL_STAT PrsAltAzCB(msgMESSAGE &msg, void *udata);
evhCB_COMPL_STAT PrsCoordCB(msgMESSAGE &msg, void *udata);
evhCB_COMPL_STAT PrsNamedPosCB(msgMESSAGE &msg, void *udata);
    Preset to give coordinates ( Real coordinate, Alt/Az
    or predefined position)
    Converts the parameters in setup file entries and generates a new
    ready to run setup file merging the given information with
    the ready to run setup file.
    Sets also the type of coordinates in the setup file
    All the optional parameters will keep the current value in the
    ready to run setup file, if not specified.
    The Execute() method is called with "MOVE"

evhCB_COMPL_STAT SetupCB(msgMESSAGE &msg, void *udata);
    Generates a new ready to run setup file merging the given setup files
    and individual parameters settings with the actual ready to
    run setup file.
    The incoming setup information is checked for syntax errors.
    The Execute() method is called.

evhCB_COMPL_STAT StopCB(msgMESSAGE &msg, void *udata);
    Send the stop command to the Preset Action Handling and
    installs callbacks for the reply and the error reply.

evhCB_COMPL_STAT SaveCurrSetupCB(msgMESSAGE &msg, void *udata);
evhCB_COMPL_STAT SaveReadySetupCB(msgMESSAGE &msg, void *udata);
    Saves the current setup file or the ready setup file with the given
    name.

evhCB_COMPL_STAT InitCB(msgMESSAGE &msg, void *udata);
  This is called when the INIT or ONLINE command is received.
  If the message buffer contains the  prsMGS_BUFF_ALL string value,
  the command is first propagated to prsAction.
  Anyway the system does not wait for replies and does not handle
  error conditions due to failure in INIT for prsAction

virtual evhCB_COMPL_STAT OnlineCB(msgMESSAGE &msg, void *udata);

  This callback is called when the ONLINE command is received.
  If the module is already ONLINE, sends back a reply and returns,
  otherwise it behaves like InitCB.

ccsCOMPL_STAT Init()
  Overwrite of the Init method inherited from the base class.
  Reads from the database all the configuration parameters.
  This method is called also by the inherited InitCB whenever an Init()
  command is received. If a setup is on course it is aborted.

ccsCOMPL_STAT Recover();
  Try to recover from a severe error.
  It can be used for example (like in prsControl) when a callback
  generates a severe error e make the main loop to return. The main
  can then try to recover using this method and to go back in the
  main-loop. It calls Init() to reinitialize the objects.
  Is a setup is on course it is aborted.

evhCB_COMPL_STAT ExitCB(msgMESSAGE &msg, void *udata);
  Overload the inherited callback.
  It first propagate the command to prsAction, without waiting for
  any reply

 

PROTECTED METHODS


evhCB_COMPL_STAT Execute(msgMESSAGE &msg, vltLOGICAL moveFlag = prsMOVE);
  This method starts the actual setup.
  It receives as first parameter the incoming message with the command
  requesting for the setup and as second parameter a flag to specify
  if the setup must be executed (prsMOVE) or only stored in the
  setup file (prsNOMOVE).
  It also saves on file the new ready to run setup file.
  If it is a preset with prsMOVE, it sends the PRESET command to the
  Preset Action Handling and installs callbacks for the reply and
  the error reply.
  It sets the state to PRESETTING.

evhCB_COMPL_STAT ExeReadyCB(msgMESSAGE &msg, void *udata);
  Receive the replies from prsAction to PRESET commands.
  When it receives the last reply, send back the final reply
  to the originator and set the state to prsATATE_READY

evhCB_COMPL_STAT ExeErrorCB(msgMESSAGE &msg, void *udata);
  This callback is called when a PRESET command to prsAction
  timeouts or gets an error reply. It sends an error reply
  to the originator and sets back the state to prsSTATE_READY

evhCB_COMPL_STAT StopOKCB(msgMESSAGE &msg, void *udata);
  This callback is executed when the tracking has been stopped.
  It sends back the READY reply to the originator.

evhCB_COMPL_STAT StopErrorCB(msgMESSAGE &msg, void *udata);
  This callback is executed when the STOP/STOPTRK request has failed,
  both for a timeout or because an error reply has been received.
  It sends back the READY error reply to the originator.

ccsCOMPL_STAT RejectIfNotOnline(msgMESSAGE &msg, vltLOGICAL *rejected);
  Gets a message containing a received command.
  If current state is not ONLINE, the command is rejected, and an error
  reply is returned.
  In this case the returned value in "rejected" == TRUE, otherwise it is
 

PRIVATE DATA MEMBERS


  oslxSETUP      *readySetup;   object to handle the ready setup file
  oslxSETUP      *checkSetup;   object to handle checking of SETUP commands
  evhCOMMAND      stopCmd;      to handle the sending of STOP command
  evhCOMMAND      presetCmd;    to handle the sending of PRESET command

  msgMESSAGE      stopMsg;      local copy of the received STOP message
  msgMESSAGE      setupMsg;     local copy or the setup message

Configuration parameters:
  char   *defaultSetup       name of the default setup file
  double  readyTimeout       timeout for setup ready
  double  stopTimeout        timeout for stop completed

 

DEFINES


State values:


Defines for the MOVE/NOMOVE flag in Execute()

#define  prsNOMOVE   0
#define  prsMOVE     1


 

ON LINE DATABASE


The class shares with prsSEQ_STD_COMMANDS an instance of the
prsCONTROL class.

  CLASS evhSTD_COMMANDS prsCONTROL
 

BEGIN //


      ATTRIBUTE BYTES64 readySetup   "prsReadySetup.targ"
      ATTRIBUTE BYTES64 defaultSetup "prsDefaultSetup.targ"
      ATTRIBUTE BYTES64 currentSetup "prsCurrentSetup.targ"

      ATTRIBUTE BYTES64 setupDic     "ESO-VLT-DIC.TCS"
      ATTRIBUTE BYTES64 setupAlias   "prs.alias"

      ATTRIBUTE INT32           readyTimeout 0
      ATTRIBUTE INT32           stopTimeout  0

      ATTRIBUTE evhDB_COMMAND  presetDbCmd
 

BEGIN //


            ATTRIBUTE BYTES32   destination  "prsAction"
 

END //


      ATTRIBUTE evhDB_COMMAND  stopDbCmd
 

BEGIN //


            ATTRIBUTE BYTES32   destination  "prsAction"
 

END //


      ATTRIBUTE evhDB_COMMAND  actionStdDbCmd
 

BEGIN //


            ATTRIBUTE BYTES32   destination  "prsAction"
 

CAUTIONS


Here it is not considered a fatal error not to be able to send back a reply
to the originator of a command: an error is logged, but it is recoved
since it has no effect on the behaviour of the task itself.

 

SEE ALSO


evhDB_TASK(4)



 

Index

NAME
SYNOPSIS
PARENT CLASS
DESCRIPTION
PUBLIC METHODS
PROTECTED METHODS
PRIVATE DATA MEMBERS
DEFINES
ON LINE DATABASE
BEGIN //
BEGIN //
END //
BEGIN //
END //
BEGIN //
CAUTIONS
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 10:10:48 GMT, April 23, 2012

Definition at line 38 of file prsSEQ_MAIN_TASK.h.


Constructor & Destructor Documentation

prsSEQ_MAIN_TASK::prsSEQ_MAIN_TASK ( const dbSYMADDRESS  dbPoint  ) 
prsSEQ_MAIN_TASK::~prsSEQ_MAIN_TASK (  ) 

Member Function Documentation

evhCB_COMPL_STAT prsSEQ_MAIN_TASK::CenterObjCB ( msgMESSAGE &  msg,
void *  udata 
) [virtual]
evhCB_COMPL_STAT prsSEQ_MAIN_TASK::ClearReadySetupCB ( msgMESSAGE &  msg,
void *  udata 
) [virtual]
evhCB_COMPL_STAT prsSEQ_MAIN_TASK::Execute ( msgMESSAGE &  msg,
vltLOGICAL  moveFlag = prsMOVE 
) [protected, virtual]
evhCB_COMPL_STAT prsSEQ_MAIN_TASK::ExeErrorCB ( msgMESSAGE &  msg,
void *  udata 
) [protected, virtual]
evhCB_COMPL_STAT prsSEQ_MAIN_TASK::ExeReadyCB ( msgMESSAGE &  msg,
void *  udata 
) [protected, virtual]

Definition at line 2310 of file prsSEQ_MAIN_TASK.C.

References prsERR_ACCESS_DATABASE, prsERR_SEND_OK_REPLY, prsMOD, prsOK_MSG, prsSTATE_READY, and setupMsg.

Referenced by Init().

evhCB_COMPL_STAT prsSEQ_MAIN_TASK::ExitCB ( msgMESSAGE &  msg,
void *  udata 
) [virtual]

Definition at line 540 of file prsSEQ_MAIN_TASK.C.

References presetCmd, prsMOD, and prsMSG_BUFF_ALL.

ccsCOMPL_STAT prsSEQ_MAIN_TASK::Init (  ) 
evhCB_COMPL_STAT prsSEQ_MAIN_TASK::InitCB ( msgMESSAGE &  msg,
void *  udata 
) [virtual]
evhCB_COMPL_STAT prsSEQ_MAIN_TASK::OnlineCB ( msgMESSAGE &  msg,
void *  udata 
) [virtual]
evhCB_COMPL_STAT prsSEQ_MAIN_TASK::PrsAltAzCB ( msgMESSAGE &  msg,
void *  udata 
) [virtual]
evhCB_COMPL_STAT prsSEQ_MAIN_TASK::PrsCoordCB ( msgMESSAGE &  msg,
void *  udata 
) [virtual]
evhCB_COMPL_STAT prsSEQ_MAIN_TASK::PrsNamedPosCB ( msgMESSAGE &  msg,
void *  udata 
) [virtual]
ccsCOMPL_STAT prsSEQ_MAIN_TASK::Recover (  ) 
ccsCOMPL_STAT prsSEQ_MAIN_TASK::RejectIfNotOnline ( msgMESSAGE &  msg,
vltLOGICAL *  rejected 
) [protected]
evhCB_COMPL_STAT prsSEQ_MAIN_TASK::SaveCurrSetupCB ( msgMESSAGE &  msg,
void *  udata 
) [virtual]
evhCB_COMPL_STAT prsSEQ_MAIN_TASK::SaveReadySetupCB ( msgMESSAGE &  msg,
void *  udata 
) [virtual]
evhCB_COMPL_STAT prsSEQ_MAIN_TASK::SetupCB ( msgMESSAGE &  msg,
void *  udata 
) [virtual]
evhCB_COMPL_STAT prsSEQ_MAIN_TASK::StopCB ( msgMESSAGE &  msg,
void *  udata 
) [virtual]
evhCB_COMPL_STAT prsSEQ_MAIN_TASK::StopErrorCB ( msgMESSAGE &  msg,
void *  udata 
) [protected, virtual]
evhCB_COMPL_STAT prsSEQ_MAIN_TASK::StopOKCB ( msgMESSAGE &  msg,
void *  udata 
) [protected, virtual]

Definition at line 2416 of file prsSEQ_MAIN_TASK.C.

References prsERR_ACCESS_DATABASE, prsERR_SEND_OK_REPLY, prsMOD, prsOK_MSG, prsSTATE_READY, and stopMsg.

Referenced by Init().


Member Data Documentation

oslxSETUP* prsSEQ_MAIN_TASK::checkSetupFile [protected]

Definition at line 76 of file prsSEQ_MAIN_TASK.h.

Referenced by Init(), SetupCB(), and ~prsSEQ_MAIN_TASK().

vltBYTES64 prsSEQ_MAIN_TASK::currentSetup [private]

Definition at line 87 of file prsSEQ_MAIN_TASK.h.

Referenced by Init(), and SaveCurrSetupCB().

vltBYTES64 prsSEQ_MAIN_TASK::defaultSetup [private]

Definition at line 86 of file prsSEQ_MAIN_TASK.h.

Referenced by ClearReadySetupCB(), and Init().

char prsSEQ_MAIN_TASK::myName[32] [private]

Definition at line 92 of file prsSEQ_MAIN_TASK.h.

evhDB_COMMAND prsSEQ_MAIN_TASK::presetCmd [protected]

Definition at line 78 of file prsSEQ_MAIN_TASK.h.

Referenced by Execute(), ExitCB(), Init(), InitCB(), Recover(), and ~prsSEQ_MAIN_TASK().

vltBYTES64 prsSEQ_MAIN_TASK::readySetup [private]

Definition at line 85 of file prsSEQ_MAIN_TASK.h.

Referenced by Execute(), and Init().

oslxSETUP* prsSEQ_MAIN_TASK::readySetupFile [protected]
vltINT32 prsSEQ_MAIN_TASK::readyTimeout [private]

Definition at line 90 of file prsSEQ_MAIN_TASK.h.

Referenced by Init().

vltBYTES64 prsSEQ_MAIN_TASK::setupAliasTable [private]

Definition at line 89 of file prsSEQ_MAIN_TASK.h.

Referenced by Init().

vltBYTES64 prsSEQ_MAIN_TASK::setupDictionary [private]

Definition at line 88 of file prsSEQ_MAIN_TASK.h.

Referenced by Init().

msgMESSAGE prsSEQ_MAIN_TASK::setupMsg [private]

Definition at line 82 of file prsSEQ_MAIN_TASK.h.

Referenced by Execute(), ExeErrorCB(), ExeReadyCB(), InitCB(), Recover(), and ~prsSEQ_MAIN_TASK().

evhDB_COMMAND prsSEQ_MAIN_TASK::stopCmd [protected]

Definition at line 77 of file prsSEQ_MAIN_TASK.h.

Referenced by Init(), and StopCB().

msgMESSAGE prsSEQ_MAIN_TASK::stopMsg [private]

Definition at line 81 of file prsSEQ_MAIN_TASK.h.

Referenced by Execute(), StopCB(), StopErrorCB(), and StopOKCB().

vltINT32 prsSEQ_MAIN_TASK::stopTimeout [private]

Definition at line 91 of file prsSEQ_MAIN_TASK.h.

Referenced by Init().


The documentation for this class was generated from the following files:
Generated on Mon Apr 23 10:12:43 2012 for INTROOT API by doxygen 1.6.3