Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

PowerSupply Class Reference
[ACS Components Examples]

#include <acsexmplPowerSupplyImpl.h>

Inheritance diagram for PowerSupply:

Inheritance graph
[legend]
Collaboration diagram for PowerSupply:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PowerSupply (const ACE_CString &name, maci::ContainerServices *containerServices)
virtual ~PowerSupply ()
virtual baci::ActionRequest invokeAction (int function, baci::BACIComponent *component_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut)
virtual baci::ActionRequest onAction (baci::BACIComponent *component_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut)
virtual baci::ActionRequest offAction (baci::BACIComponent *component_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut)
virtual baci::ActionRequest resetAction (baci::BACIComponent *component_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut)
virtual void on (ACS::CBvoid_ptr cb, const ACS::CBDescIn &desc)
virtual void off (ACS::CBvoid_ptr cb, const ACS::CBDescIn &desc)
virtual void reset (ACS::CBvoid_ptr cb, const ACS::CBDescIn &desc)
virtual ACS::RWdouble_ptr current ()
virtual ACS::ROdouble_ptr readback ()
virtual ACS::ROpattern_ptr status ()
virtual void execute ()

Protected Attributes

baci::SmartPropertyPointer<
baci::ROpattern
m_status_sp

Private Member Functions

void operator= (const PowerSupply &)

Private Attributes

baci::SmartPropertyPointer<
baci::ROdouble
m_readback_sp
baci::SmartPropertyPointer<
PowerSupplyCurrent
m_current_sp

Detailed Description

Simulates the behavior of a power supply and overwrites an ACS property. The class PowerSupply simulates the behaviour of a power supply. It provides three methods: on, off and reset. It also provides the properties current, readback and status. Asynchronous calls are implemented using the ...... pattern and the ..... support classes. For each xxx action defined in the IDL interface two methods are provided:

Author:
Matej Sekoranja, Jozef Stefan Institute, Slovenia
Version:
"@(#) $Id: acsexmplPowerSupplyImpl.h,v 1.106 2008/10/09 08:41:11 cparedes Exp $"


Constructor & Destructor Documentation

PowerSupply::PowerSupply const ACE_CString &  name,
maci::ContainerServices containerServices
 

Constructor

Parameters:
name component name
containerService A pointer to the container services

virtual PowerSupply::~PowerSupply  )  [virtual]
 

Destructor


Member Function Documentation

virtual ACS::RWdouble_ptr PowerSupply::current  )  [virtual]
 

Returns a reference to the current_p property (commanded current). Implementation of IDL interface for the property.

Returns:
a pointer to the property

virtual void PowerSupply::execute  )  [virtual]
 

Called after initialize to tell the component that it has to be ready to accept incoming functional calls any time. Must be implemented as a synchronous (blocking) call (can spawn threads though).

Returns:
void
Exceptions:
ACSErr::ACSbaseExImpl 

Reimplemented from acscomponent::ACSComponentImpl.

virtual baci::ActionRequest PowerSupply::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::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)

Implements baci::ActionImplementator.

Reimplemented in RampedPowerSupply.

virtual void PowerSupply::off ACS::CBvoid_ptr  cb,
const ACS::CBDescIn desc
[virtual]
 

Switches off the power supply. Implementation of IDL off() interface. 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 PowerSupply::offAction The given callback is used to inform the caller when the action is performed.

Parameters:
cb Callback when action has finished.
desc Callback used for holding information on timeout periods

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

Implementation of async. off() method This is the function that actually switches off the PowerSupply 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::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).


virtual void PowerSupply::on ACS::CBvoid_ptr  cb,
const ACS::CBDescIn desc
[virtual]
 

Switches on the power supply. Implementation of IDL on() interface. 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 PowerSupply::onAction The given callback is used to inform the caller when the action is performed.

Parameters:
cb Callback when action has finished.
desc Callback used for holding information on timeout periods

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

Implementation of async. on() method This is the function that actually switches on the PowerSupply 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::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).


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

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

virtual ACS::ROdouble_ptr PowerSupply::readback  )  [virtual]
 

Returns a reference to the readback_p property (actual current). Implementation of IDL interface for the property.

Returns:
a pointer to the property

virtual void PowerSupply::reset ACS::CBvoid_ptr  cb,
const ACS::CBDescIn desc
[virtual]
 

Resets the power supply. Implementation of IDL reset() interface. 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 PowerSupply::resetAction The given callback is used to inform the caller when the action is performed.

Parameters:
cb Callback when action has finished.
desc Callback used for holding information on timeout periods

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

Implementation of async. reset() method This is the function that actually resets the PowerSupply 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).


virtual ACS::ROpattern_ptr PowerSupply::status  )  [virtual]
 

Returns a reference to the status_p property (see acsexmplPowerSupplyImpl.cpp). Implementation of IDL interface for the property.

Returns:
a pointer to the property


Member Data Documentation

baci::SmartPropertyPointer<PowerSupplyCurrent> PowerSupply::m_current_sp [private]
 

m_current_sp is the commanded current.

baci::SmartPropertyPointer<baci::ROdouble> PowerSupply::m_readback_sp [private]
 

m_readback_sp is the actual value of PowerSupply's current.

baci::SmartPropertyPointer<baci::ROpattern> PowerSupply::m_status_sp [protected]
 

m_status_sp is the PowerSupply's state (values are in CDB).


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:36:45 2009 for ACS C++ API by doxygen 1.3.8