ALMA Computing Group

RampedPowerSupply Class Reference
[ACS Components Examples]

Simulates the behavior of a ramped power supply by inheriting from Power Supply's IDL interface and C++ implementation. More...

#include <acsexmplRampedPowerSupplyImpl.h>

Inheritance diagram for RampedPowerSupply:

Inheritance graph
[legend]
Collaboration diagram for RampedPowerSupply:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RampedPowerSupply (const ACE_CString &name, maci::ContainerServices *containerServices)
 Constructor.
 ~RampedPowerSupply ()
 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 startRampingAction (baci::BACIComponent *component_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut)
 Implementation of async.
virtual baci::ActionRequest stopRampingAction (baci::BACIComponent *component_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut)
 Implementation of async.
virtual void startRamping (CORBA::Long rampingSteps, ACS::CBvoid_ptr cb, const ACS::CBDescIn &desc)
 Starts ramping the power supply.
virtual void stopRamping (ACS::CBvoid_ptr cb, const ACS::CBDescIn &desc)
 Stops ramping the power supply.
virtual ACS::RWstring_ptr rampingStatus ()
 Returns a reference to the rampingStatus property (status).
virtual ACS::ROlong_ptr rampingStep ()
 Returns a reference to the rampingStep property.

Static Public Attributes

const int START_RAMPING = 3
 One of these function IDs will be passed to invokeAction().
const int STOP_RAMPING = 4

Private Member Functions

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

Private Attributes

baci::SmartPropertyPointer<
baci::ROlong > 
m_rampingStep_sp
 m_rampingStep_p is the RampedPowerSupply's present step in the ramping process.
DevIO< CORBA::Long > * m_rampingStep_devio_p
 m_rampingStep_devio_p is the DevIO subclass passed to the RampingStep property when it is created.
baci::SmartPropertyPointer<
baci::RWstring > 
m_rampingStatus_sp
 m_rampingStatus_p is the RampedPowerSupply's status in the ramping process.

Detailed Description

Simulates the behavior of a ramped power supply by inheriting from Power Supply's IDL interface and C++ implementation.

The class RampedPowerSupply simulates the behaviour of a ramped power supply and is derived from the PowerSupply IDL interface. This class shows how to utilize inheritance in both the C++ and IDL class/interface.

Asynchronous calls are implemented using the ...... pattern and the ..... support classes. For each xxx action defined in the IDL interface two methods are provided:

Class RampedPowerSupply also provides the properties rampingStatus and rampingSteps in addition to anything inherited from PowerSupply.

Author:
Matej Sekoranja, Jozef Stefan Institute, Slovenia
Version:
"@(#) $Id: acsexmplRampedPowerSupplyImpl.h,v 1.101 2008/10/01 04:30:47 cparedes Exp $"

Definition at line 129 of file acsexmplRampedPowerSupplyImpl.h.


Constructor & Destructor Documentation

RampedPowerSupply::RampedPowerSupply const ACE_CString &  name,
maci::ContainerServices *  containerServices
 

Constructor.

Parameters:
poa poa which will activate this and also all other components
name component name
Definition at line 44 of file acsexmplRampedPowerSupplyImpl.cpp.

RampedPowerSupply::~RampedPowerSupply  ) 
 

Destructor.

Definition at line 64 of file acsexmplRampedPowerSupplyImpl.cpp.

References m_rampingStep_devio_p.


Member Function Documentation

ActionRequest RampedPowerSupply::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 has been called already by function)

Reimplemented from PowerSupply.

Definition at line 81 of file acsexmplRampedPowerSupplyImpl.cpp.

References OFF_ACTION, PowerSupply::offAction(), ON_ACTION, PowerSupply::onAction(), RESET_ACTION, PowerSupply::resetAction(), START_RAMPING, startRampingAction(), STOP_RAMPING, and stopRampingAction().

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

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

ACS::RWstring_ptr RampedPowerSupply::rampingStatus  )  [virtual]
 

Returns a reference to the rampingStatus property (status).

Implementation of IDL interface for the property.

Returns:
a pointer to the BACI property

Definition at line 218 of file acsexmplRampedPowerSupplyImpl.cpp.

References m_rampingStatus_sp.

ACS::ROlong_ptr RampedPowerSupply::rampingStep  )  [virtual]
 

Returns a reference to the rampingStep property.

Implementation of IDL interface for the property.

Returns:
a pointer to the BACI property

Definition at line 230 of file acsexmplRampedPowerSupplyImpl.cpp.

References m_rampingStep_sp.

void RampedPowerSupply::startRamping CORBA::Long  rampingSteps,
ACS::CBvoid_ptr  cb,
const ACS::CBDescIn &  desc
[virtual]
 

Starts ramping the power supply.

Implementation of IDL startRamping() 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 RampedPowerSupply::startRampingAction 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

Definition at line 201 of file acsexmplRampedPowerSupplyImpl.cpp.

References START_RAMPING.

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

Implementation of async.

startRamping() method This is the function that actually starts ramping 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 124 of file acsexmplRampedPowerSupplyImpl.cpp.

Referenced by invokeAction().

void RampedPowerSupply::stopRamping ACS::CBvoid_ptr  cb,
const ACS::CBDescIn &  desc
[virtual]
 

Stops ramping the power supply.

Implementation of IDL stopRamping() 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 RampedPowerSupply::stopAction 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

Definition at line 210 of file acsexmplRampedPowerSupplyImpl.cpp.

References STOP_RAMPING.

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

Implementation of async.

stopRamping() method This is the function that actually stops ramping 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 161 of file acsexmplRampedPowerSupplyImpl.cpp.

Referenced by invokeAction().


Member Data Documentation

baci::SmartPropertyPointer<baci::RWstring> RampedPowerSupply::m_rampingStatus_sp [private]
 

m_rampingStatus_p is the RampedPowerSupply's status in the ramping process.

Definition at line 317 of file acsexmplRampedPowerSupplyImpl.h.

Referenced by rampingStatus().

DevIO<CORBA::Long>* RampedPowerSupply::m_rampingStep_devio_p [private]
 

m_rampingStep_devio_p is the DevIO subclass passed to the RampingStep property when it is created.

Essentially the DevIO is used to interact with hardware directly without tying ACS to any specific hardware drivers resulting in added flexibility. Please see acsexmplLongDevIO.h to understand exactly how this is accomplished. Definition at line 312 of file acsexmplRampedPowerSupplyImpl.h.

Referenced by ~RampedPowerSupply().

baci::SmartPropertyPointer<baci::ROlong> RampedPowerSupply::m_rampingStep_sp [private]
 

m_rampingStep_p is the RampedPowerSupply's present step in the ramping process.

Definition at line 304 of file acsexmplRampedPowerSupplyImpl.h.

Referenced by rampingStep().

const int RampedPowerSupply::START_RAMPING = 3 [static]
 

One of these function IDs will be passed to invokeAction().

Definition at line 150 of file acsexmplRampedPowerSupplyImpl.h.

Referenced by invokeAction(), and startRamping().

const int RampedPowerSupply::STOP_RAMPING = 4 [static]
 

Definition at line 151 of file acsexmplRampedPowerSupplyImpl.h.

Referenced by invokeAction(), and stopRamping().


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