ALMA Computing Group

Mount Class Reference
[ACS Components Examples]

Simulates the behavior of an antenna interface. More...

#include <acsexmplMountImpl.h>

List of all members.

Public Member Functions

 Mount (ACE_CString name, maci::ContainerServices *containerServices)
 Constructor.
virtual ~Mount ()
 Destructor.
virtual baci::ActionRequest invokeAction (int function, baci::BACIComponent *component_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut)
 Action dispatcher function This function is called whenever an asynchronous request has to be handled.
virtual baci::ActionRequest obstarAction (baci::BACIComponent *component_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut)
 Implementation of asynchronous MOUNT_ACS::Mount::obstar() method This is the function that actually runs obstar(...) and, when completed, invokes the callback installed by the client when it requested the action.
virtual baci::ActionRequest objfixAction (baci::BACIComponent *component_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut)
 Implementation of asynchronous MOUNT_ACS::Mount::objfix() method This is the function that actually runs objfix(...) and, when completed, invokes the callback installed by the client when it requested the action.
virtual void obstar (CORBA::Double ra, CORBA::Double dec, CORBA::Double pmRa, CORBA::Double pmDec, CORBA::Double radVel, CORBA::Double par, MOUNT_ACS::Mount::coordType type, ACS::CBvoid_ptr callBack, const ACS::CBDescIn &desc)
 (Pre)sets a new equatorial source for the antenna to track.
virtual void objfix (CORBA::Double az, CORBA::Double elev, ACS::CBvoid_ptr callBack, const ACS::CBDescIn &desc)
 (Pre)sets a new non-moving position for the antenna.
virtual ACS::ROdouble_ptr cmdAz ()
 Returns a reference to the cmdAz property Implementation of IDL interface for the property.
virtual ACS::ROdouble_ptr cmdEl ()
 Returns a reference to the cmdEl property Implementation of IDL interface for the property.
virtual ACS::ROdouble_ptr actAz ()
 Returns a reference to the actAz property Implementation of IDL interface for the property.
virtual ACS::ROdouble_ptr actEl ()
 Returns a reference to the actEl property Implementation of IDL interface for the property.

Private Types

typedef baci::ActionRequest(Mount::* ActionFunction )(baci::BACIComponent *component_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut)
 Definition of ActionFunction (member function of Mount class) ActionFunction is used to run the asynchronous methods from within invokeAction(...) without actually having to specify calls to each ...Action(...) method.

Private Member Functions

void operator= (const Mount &)
 ALMA C++ coding standards state copy operators should be disabled.

Private Attributes

ActionFunction m_actions [2]
 Please see ActionFunction.
baci::SmartPropertyPointer<
baci::ROdouble > 
m_cmdAz_sp
 m_cmdAz_sp is the antenna's commanded azimuth
baci::SmartPropertyPointer<
baci::ROdouble > 
m_cmdEl_sp
 m_cmdEl_sp is the antenna's commanded elevation
baci::SmartPropertyPointer<
baci::ROdouble > 
m_actAz_sp
 m_actAz_sp is the antenna's actual azimuth
baci::SmartPropertyPointer<
baci::ROdouble > 
m_actEl_sp
 m_actEl_sp is the antenna's actual elevation


Detailed Description

Simulates the behavior of an antenna interface.

The class Mount is a good example of a component and simulates the behaviour of an antenna interface. It provides two asynchronous methods: objstar and objfix. The methods only write the data into virtual properties instead of hardware. Asynchronous calls are implemented using the ...... pattern and the ..... support classes. For each xxx action defined in the IDL interface two methods are provided:

Definition at line 121 of file acsexmplMountImpl.h.


Member Typedef Documentation

typedef baci::ActionRequest(Mount::* Mount::ActionFunction)(baci::BACIComponent *component_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut) [private]
 

Definition of ActionFunction (member function of Mount class) ActionFunction is used to run the asynchronous methods from within invokeAction(...) without actually having to specify calls to each ...Action(...) method.

This is easily accomplished since all ...Action(...) methods return an baci::ActionRequest.

Parameters:
component_p Owner of the action.
callbackID ID of the callback to be notified.
descIn Callback descriptor (passed by client).
value_p Action data (e.g. value to be set).
completion Error handing structure.
descOut Callback descriptor which will be passed to client.
Returns:
Request to be performed by BACI.
  • reqNone - Do nothing (action will be kept in queue).
  • reqInvokeWorking - Invoke <type>Callback::working.
  • reqInvokeDone - Invoke <type>Callback::done and destroy callback.
  • reqDestroy - Destroy callback (callback should has been called already by function).


Definition at line 364 of file acsexmplMountImpl.h.


Constructor & Destructor Documentation

Mount::Mount ACE_CString  name,
maci::ContainerServices *  containerServices
 

Constructor.

Parameters:
name component's name. This is also the name that will be used to find the configuration data for the component in the Configuration Database.
containerService The pointer to the container services
Definition at line 72 of file acsexmplMountImpl.cpp.

References m_actions, objfixAction(), and obstarAction().

Mount::~Mount  )  [virtual]
 

Destructor.

Definition at line 90 of file acsexmplMountImpl.cpp.


Member Function Documentation

ACS::ROdouble_ptr Mount::actAz  )  [virtual]
 

Returns a reference to the actAz property Implementation of IDL interface for the property.

Returns:
pointer to read-only double property actAz

Definition at line 267 of file acsexmplMountImpl.cpp.

References m_actAz_sp.

ACS::ROdouble_ptr Mount::actEl  )  [virtual]
 

Returns a reference to the actEl property Implementation of IDL interface for the property.

Returns:
pointer to read-only double property actEl

Definition at line 279 of file acsexmplMountImpl.cpp.

References m_actEl_sp.

ACS::ROdouble_ptr Mount::cmdAz  )  [virtual]
 

Returns a reference to the cmdAz property Implementation of IDL interface for the property.

Returns:
pointer to read-only double property cmdAz

Definition at line 243 of file acsexmplMountImpl.cpp.

References m_cmdAz_sp.

ACS::ROdouble_ptr Mount::cmdEl  )  [virtual]
 

Returns a reference to the cmdEl property Implementation of IDL interface for the property.

Returns:
pointer to read-only double property cmdEl

Definition at line 255 of file acsexmplMountImpl.cpp.

References m_cmdEl_sp.

ActionRequest Mount::invokeAction int  function,
baci::BACIComponent *  component_p,
const int &  callbackID,
const CBDescIn &  descIn,
baci::BACIValue *  value_p,
Completion &  completion,
CBDescOut &  descOut
[virtual]
 

Action dispatcher function This function is called whenever an asynchronous request has to be handled.

It receives (as parameters) the description of the function and selects the proper implementation to call.

Parameters:
function Action funtion to be invoked.
component_p Owner of the action.
callbackID ID of the callback to be notified.
descIn Callback descriptor (passed by client).
value_p Action data (e.g. value to be set).
completion Error handing structure.
descOut Callback descriptor which will be passed to client.
Returns:
Request to be performed by BACI
  • reqNone - Do nothing (action will be kept in queue).
  • reqInvokeWorking - Invoke <type>Callback::working.
  • reqInvokeDone - Invoke <type>Callback::done and destroy callback.
  • reqDestroy - Destroy callback (callback should have been called already by function).


Definition at line 97 of file acsexmplMountImpl.cpp.

References m_actions.

void Mount::objfix CORBA::Double  az,
CORBA::Double  elev,
ACS::CBvoid_ptr  callBack,
const ACS::CBDescIn &  desc
[virtual]
 

(Pre)sets a new non-moving position for the antenna.

The position coordinates are given in azimuth and elevation. The actual az and elev values are written to the properties cmdAz, cmdEl, actAz and actEl.

This method just registers the request in the asyncronous queue, together with the associated callback and returns control immediatly. The actual action will be invoked asyncronously by the asynchonous call manager by calling Mount::objfixAction(...). The given callback is used to inform the caller when the action is performed.

Parameters:
az position azimuth (degree)
elev position elevation (degree)
callBack Callback when action has finished.
desc Callback used for holding information on timeout periods
Returns:
void

Definition at line 317 of file acsexmplMountImpl.cpp.

References __objfix_action::az, and __objfix_action::elev.

ActionRequest Mount::objfixAction baci::BACIComponent *  component_p,
const int &  callbackID,
const CBDescIn &  descIn,
baci::BACIValue *  value_p,
Completion &  completion,
CBDescOut &  descOut
[virtual]
 

Implementation of asynchronous MOUNT_ACS::Mount::objfix() method This is the function that actually runs objfix(...) and, when completed, invokes the callback installed by the client when it requested the action.

Parameters:
component_p Owner of the action.
callbackID ID of the callback to be notified.
descIn Callback descriptor (passed by client).
value_p Action data (e.g. value to be set).
completion Error handing structure.
descOut Callback descriptor which will be passed to client.
Returns:
Request to be performed by BACI.
  • reqNone - Do nothing (action will be kept in queue).
  • reqInvokeWorking - Invoke <type>Callback::working.
  • reqInvokeDone - Invoke <type>Callback::done and destroy callback.
  • reqDestroy - Destroy callback (callback should has been called already by function).


Definition at line 188 of file acsexmplMountImpl.cpp.

References __objfix_action::az, __objfix_action::elev, m_actAz_sp, m_actEl_sp, m_cmdAz_sp, and m_cmdEl_sp.

Referenced by Mount().

void Mount::obstar CORBA::Double  ra,
CORBA::Double  dec,
CORBA::Double  pmRa,
CORBA::Double  pmDec,
CORBA::Double  radVel,
CORBA::Double  par,
MOUNT_ACS::Mount::coordType  type,
ACS::CBvoid_ptr  callBack,
const ACS::CBDescIn &  desc
[virtual]
 

(Pre)sets a new equatorial source for the antenna to track.

The source position is given in geocentric equatorial J2000 coordinates. The actual ra and dec coordinates are written to the properties cmdAz, cmdEl, actAz and actEl.

This method just registers the request in the asyncronous queue, together with the associated callback and returns control immediatly. The actual action will be invoked asyncronously by the asynchonous call manager by calling Mount::obstarAction(...). The given callback is used to inform the caller when the action is performed.

Parameters:
ra source right ascension (hour)
dec source declination (hour)
pmRa source sky proper motion in right ascension (arc-sec/year)
pmDec source sky proper motion in declination (arc-sec/year)
radVel source radial velocity (kilometer/sec)
par source parallax correction (arc-sec)
type Apparent or Mean
callBack Callback when action has finished.
desc Callback used for holding information on timeout periods
Returns:
void

Definition at line 291 of file acsexmplMountImpl.cpp.

References __obstar_action::dec, __obstar_action::par, __obstar_action::pmDec, __obstar_action::pmRa, __obstar_action::ra, __obstar_action::radVel, and __obstar_action::type.

ActionRequest Mount::obstarAction baci::BACIComponent *  component_p,
const int &  callbackID,
const CBDescIn &  descIn,
baci::BACIValue *  value_p,
Completion &  completion,
CBDescOut &  descOut
[virtual]
 

Implementation of asynchronous MOUNT_ACS::Mount::obstar() method This is the function that actually runs obstar(...) and, when completed, invokes the callback installed by the client when it requested the action.

Parameters:
component_p Owner of the action.
callbackID ID of the callback to be notified.
descIn Callback descriptor (passed by client).
value_p Action data (e.g. value to be set).
completion Error handing structure.
descOut Callback descriptor which will be passed to client.
Returns:
Request to be performed by BACI.
  • reqNone - Do nothing (action will be kept in queue).
  • reqInvokeWorking - Invoke <type>Callback::working.
  • reqInvokeDone - Invoke <type>Callback::done and destroy callback.
  • reqDestroy - Destroy callback (callback should has been called already by function).


Definition at line 120 of file acsexmplMountImpl.cpp.

References __obstar_action::dec, m_actAz_sp, m_actEl_sp, m_cmdAz_sp, m_cmdEl_sp, and __obstar_action::ra.

Referenced by Mount().

void Mount::operator= const Mount  )  [private]
 

ALMA C++ coding standards state copy operators should be disabled.


Member Data Documentation

baci::SmartPropertyPointer<baci::ROdouble> Mount::m_actAz_sp [private]
 

m_actAz_sp is the antenna's actual azimuth

Definition at line 391 of file acsexmplMountImpl.h.

Referenced by actAz(), objfixAction(), and obstarAction().

baci::SmartPropertyPointer<baci::ROdouble> Mount::m_actEl_sp [private]
 

m_actEl_sp is the antenna's actual elevation

Definition at line 396 of file acsexmplMountImpl.h.

Referenced by actEl(), objfixAction(), and obstarAction().

ActionFunction Mount::m_actions[2] [private]
 

Please see ActionFunction.

m_actions[0] = obstarAction(...) m_actions[1] = objfixAction(...) Definition at line 376 of file acsexmplMountImpl.h.

Referenced by invokeAction(), and Mount().

baci::SmartPropertyPointer<baci::ROdouble> Mount::m_cmdAz_sp [private]
 

m_cmdAz_sp is the antenna's commanded azimuth

Definition at line 381 of file acsexmplMountImpl.h.

Referenced by cmdAz(), objfixAction(), and obstarAction().

baci::SmartPropertyPointer<baci::ROdouble> Mount::m_cmdEl_sp [private]
 

m_cmdEl_sp is the antenna's commanded elevation

Definition at line 386 of file acsexmplMountImpl.h.

Referenced by cmdEl(), objfixAction(), and obstarAction().


The documentation for this class was generated from the following files: