European
Southern
Observatory

ESO — Reaching New Heights in Astronomy

Countries taking part in the ESO

VLT Software Documentation

mswCONTROL_MAIN Class Reference

See man page mswCONTROL_MAIN(4)
More...

#include <mswCONTROL_MAIN.h>

Inheritance diagram for mswCONTROL_MAIN:
Inheritance graph
[legend]
Collaboration diagram for mswCONTROL_MAIN:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 mswCONTROL_MAIN (mswMOD_LIST_MANAGER &listManager, mswINS_CONFIG_TABLE &insTable, mswEVAL_STATE &eval, mswCHANGE_FOCUS &changeFoc)
 mswCONTROL_MAIN (const dbSYMADDRESS dbPoint, mswMOD_LIST_MANAGER &listManager, mswINS_CONFIG_TABLE &insTable, mswEVAL_STATE &eval, mswCHANGE_FOCUS &changeFoc)
virtual ~mswCONTROL_MAIN ()
virtual ccsCOMPL_STAT Init ()

Protected Member Functions

virtual evhCB_COMPL_STAT GetInsCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT GetInsDataCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT SetInsDataCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT TcsChangeFocusCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT EndTcsChangeFocusCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT TcsPermForceSetCB (msgMESSAGE &msg, void *udata)
virtual evhCB_COMPL_STAT TcsRelForceSetCB (msgMESSAGE &msg, void *udata)
vltLOGICAL IsSelectIntrument (msgMESSAGE &msg)
vltLOGICAL ForceSetting ()
mswCONTROLForceSetting (const vltLOGICAL)

Private Member Functions

ccsCOMPL_STAT ConstructorInit ()

Private Attributes

mswINS_CONFIG_TABLEinsTable
mswCHANGE_FOCUSchangeFocus
logical forceSetting = 0
mswCHANGE_FOCUS foc
mswINS_CONFIG_DATA insData

Detailed Description

See man page mswCONTROL_MAIN(4)
Manpage of mswCONTROL_MAIN

mswCONTROL_MAIN

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

NAME

mswCONTROL_MAIN - Main object's class for the TCS Mode Switching process.
                  Receives and handles all the commands not implemented
                  in a standard way.

 

SYNOPSIS


#include "mswCONTROL_MAIN.h"

class mswCONTROL_MAIN : public evhDB_TASK
{
  public:
    mswCONTROL_MAIN(mswMOD_LIST_MANAGER &listManager,
                    mswINS_CONFIG_TABLE &insTable,
                    mswEVAL_STATE       &eval,
                    mswCHANGE_FOCUS     &changeFoc);
    mswCONTROL_MAIN(const dbSYMADDRESS  dbPoint,
                    mswMOD_LIST_MANAGER &listManager,
                    mswEVAL_STATE       &evalState
                    mswCHANGE_FOCUS     &changeFocus);
   ~mswCONTROL_MAIN();



    virtual ccsCOMPL_STAT    Init();

  protected:
    virtual evhCB_COMPL_STAT TcsChangeFocusCB   (msgMESSAGE &msg, void *udata);
    virtual evhCB_COMPL_STAT EndTcsChangeFocusCB(msgMESSAGE &msg, void *udata);
    virtual evhCB_COMPL_STAT GetInsCB            (msgMESSAGE &msg, void *udata);
    virtual evhCB_COMPL_STAT GetInsDataCB        (msgMESSAGE &msg, void *udata);
    virtual evhCB_COMPL_STAT SetInsDataCB        (msgMESSAGE &msg, void *udata);

  private:

    ccsCOMPL_STAT ConstructorInit();

    mswINS_CONFIG_TABLE &insTable;
    mswCHANGE_FOCUS     &changeFocus;

}

 

PARENT CLASS


evhDB_TASK

 

DESCRIPTION


An instance of this class is the core of the mswControl program and
is used to receive and handle Mode Switching commands and to perform all
the "administrative work".

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.

Many of the callbacks for mode switching commands have the same structure.

 

PUBLIC METHODS


mswCONTROL_MAIN(mswMOD_LIST_MANAGER &listManager,
                mswINS_CONFIG_TABLE &insTable,
                mswEVAL_STATE       &eval,
                mswCHANGE_FOCUS     &changeFoc);
mswCONTROL_MAIN(const dbSYMADDRESS  dbPoint,
                mswMOD_LIST_MANAGER &listManager,
                mswEVAL_STATE       &evalState
                mswCHANGE_FOCUS     &changeFocus);

  Two constructors are provided.
  The second one 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.
  The first one defines the online database support point calling
  the standard tcsDbRoot(4) function and appenting the
  default relative path from the TCS database root point,
  assuming a complete default TCS database structure.
  It prepares all the internal structures, install the callbacks
  and call Init() to read and initialize all configuration parms.
  It receives also pointers to cooperating objects, that must heve
  been already created.


~mswCONTROL_MAIN()

  Deregisters al the callbacks.


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.



 

PROTECTED METHODS


evhCB_COMPL_STAT TcsChangeFocusCB(msgMESSAGE &msg, void *udata);
  This function is called whenever the CHFOCUS or SELINS command
  are received.
  The two commands are handled by the same callback, since selecting
  a new active instrument (SELINS) usually involves also changing
  focus.
  First it checks if the command can be accepted, i.e. if:
     - The object is not performing a mode switching
     - The requested transition is compatible with the current state.
     - In case of SELINS the requested instrument is configured in the
       instrument data table.
     - The telescope is at Zenith
  If not, send a proper error reply to the sender.

  If the command can be accepted, store the received message for later use.
  In case of SELINS retrieves from the instrument config table the focus
  to be selected and writes in the database the new selected instrument.
  It then changes the substate to indicate the transition.
  It also disables state evaluation during the transition.

  At this point calls the changeFocus object to perform the focus change.
  The focus change sequence is always performed, even is the telescope
  is already configured for this focus (this allows to clean up wrong
  conditions and does not have negative effects, since changing focus
  is an operation performed seldom).

evhCB_COMPL_STAT EndTcsChangeFocusCB(msgMESSAGE &msg, void *udata);
  This function is called whenever the CHFOCUS command has been completely
  handled by the change focus object with no errors.
  It sends the STANDBY command to all required modules.
  This function is registered during the constructor method into the
  change focus object which saves it in a pointer.


evhCB_COMPL_STAT GetInsCB(msgMESSAGE &msg, void *udata);
  This function is called whenever the GETINS command is received.
  It is allowed in any state.
  It directly send back a reply with the current instrument id.
evhCB_COMPL_STAT GetInsDataCB(msgMESSAGE &msg, void *udata);
  This function is called whenever the GETINSD command is received.
  It is allowed in any state.
  It directly send back a reply with the data for the selected instrument,
  or the curent one if not specific instrument has been requested.
evhCB_COMPL_STAT SetInsDataCB(msgMESSAGE &msg, void *udata);
  This function is called whenever the SETINSD command is received.
  It is allowed only in (STANDBY,IDLE) state.
  The data received in the message buffer are written in the instrument
  configuration table replacing the current data for the given instrument
  or adding a new record if the given instrument is not yet in the table.
  It directly send back a reply if everything is OK.
  If the istrument is a new one, an intermediate reply is also sent
  to notify the user that a new record has been added to the table.


 

PRIVATE METHODS


ccsCOMPL_STAT ConstructorInit();
    Support method called by the constructors to grup in a single
    place code that would have been otherwise copied in all constructors

 

PRIVATE DATA MEMBERS


mswINS_CONFIG_TABLE   &insTable;
  instrument configuration table handling object


mswCHANGE_FOCUS       &changeFocus;
  changeFocus object


 

ON LINE DATABASE


The following database branch in the msw structure pertains
to the instance of mswCONTROL_MAIN:

   CLASS evhDB_TASK mswCONTROL_MAIN                                  //
 

BEGIN //


     ATTRIBUTE int32               substate   mswSUB_STATE_IDLE      //
     ATTRIBUTE int32               busy       0                      //

     ATTRIBUTE logical             forceSetting 0                    //

     ATTRIBUTE int32               readyTimeout 10                   //
     ATTRIBUTE int32               stopTimeout  10                   //

     ATTRIBUTE mswMOD_LIST_MANAGER list                              //

     ATTRIBUTE mswCHANGE_FOCUS     foc                               //

     ATTRIBUTE mswINS_CONFIG_DATA  insData                           //
 

CAUTIONS


Some functionality is not yet implemented, like the PAUSE command

 

SEE ALSO


evhDB_TASK(4),
mswMOD_LIST_MANAGER(4), mswCHANGE_FOCUS(4),
mswINS_CONFIG_DATA(4)



 

Index

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

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

Definition at line 40 of file mswCONTROL_MAIN.h.


Constructor & Destructor Documentation

mswCONTROL_MAIN::mswCONTROL_MAIN ( mswMOD_LIST_MANAGER listManager,
mswINS_CONFIG_TABLE insTable,
mswEVAL_STATE eval,
mswCHANGE_FOCUS changeFoc 
)
mswCONTROL_MAIN::mswCONTROL_MAIN ( const dbSYMADDRESS  dbPoint,
mswMOD_LIST_MANAGER listManager,
mswINS_CONFIG_TABLE insTable,
mswEVAL_STATE eval,
mswCHANGE_FOCUS changeFoc 
)

Definition at line 323 of file mswCONTROL_MAIN.C.

References ConstructorInit().

mswCONTROL_MAIN::~mswCONTROL_MAIN (  )  [virtual]

Member Function Documentation

ccsCOMPL_STAT mswCONTROL_MAIN::ConstructorInit (  )  [private]
evhCB_COMPL_STAT mswCONTROL_MAIN::EndTcsChangeFocusCB ( msgMESSAGE &  msg,
void *  udata 
) [protected, virtual]
mswCONTROL & mswCONTROL_MAIN::ForceSetting ( const vltLOGICAL  flag  )  [protected]

Definition at line 1178 of file mswCONTROL_MAIN.C.

References forceSetting, mswDB_FORCE_SETTING, mswERR_DB_WRITE, and mswMOD.

vltLOGICAL mswCONTROL_MAIN::ForceSetting (  )  [protected]

Definition at line 1161 of file mswCONTROL_MAIN.C.

References forceSetting, mswDB_FORCE_SETTING, mswERR_DB_READ, and mswMOD.

Referenced by TcsPermForceSetCB(), and TcsRelForceSetCB().

evhCB_COMPL_STAT mswCONTROL_MAIN::GetInsCB ( msgMESSAGE &  msg,
void *  udata 
) [protected, virtual]
evhCB_COMPL_STAT mswCONTROL_MAIN::GetInsDataCB ( msgMESSAGE &  msg,
void *  udata 
) [protected, virtual]
ccsCOMPL_STAT mswCONTROL_MAIN::Init (  )  [virtual]
vltLOGICAL mswCONTROL_MAIN::IsSelectIntrument ( msgMESSAGE &  msg  )  [inline, protected]

Definition at line 21 of file mswCONTROL_MAIN.icc.

References mswSELINS_CMD.

Referenced by TcsChangeFocusCB().

evhCB_COMPL_STAT mswCONTROL_MAIN::SetInsDataCB ( msgMESSAGE &  msg,
void *  udata 
) [protected, virtual]
evhCB_COMPL_STAT mswCONTROL_MAIN::TcsChangeFocusCB ( msgMESSAGE &  msg,
void *  udata 
) [protected, virtual]
evhCB_COMPL_STAT mswCONTROL_MAIN::TcsPermForceSetCB ( msgMESSAGE &  msg,
void *  udata 
) [protected, virtual]
evhCB_COMPL_STAT mswCONTROL_MAIN::TcsRelForceSetCB ( msgMESSAGE &  msg,
void *  udata 
) [protected, virtual]

Member Data Documentation

Definition at line 73 of file mswCONTROL_MAIN.h.

Referenced by Init(), and TcsChangeFocusCB().

Reimplemented in mswDB_SIM.

Definition at line 63 of file mswCONTROL_MAIN.class.

logical mswCONTROL_MAIN::forceSetting = 0 [private]

Definition at line 56 of file mswCONTROL_MAIN.class.

Referenced by ForceSetting().

Reimplemented in mswDB_SIM.

Definition at line 66 of file mswCONTROL_MAIN.class.

Referenced by GetInsDataCB(), and TcsChangeFocusCB().

Definition at line 72 of file mswCONTROL_MAIN.h.

Referenced by GetInsCB(), GetInsDataCB(), SetInsDataCB(), and TcsChangeFocusCB().


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