#include <acsexmplFilterWheelImpl.h>
Inheritance diagram for FilterWheel:
Public Member Functions | |
FilterWheel (const ACE_CString &name, maci::ContainerServices *containerServices) | |
virtual | ~FilterWheel () |
virtual void | initialize () |
virtual void | execute () |
virtual void | cleanUp () |
virtual void | aboutToAbort () |
virtual baci::ActionRequest | invokeAction (int function, baci::BACIComponent *cob_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut) |
virtual baci::ActionRequest | moveFilterAction (baci::BACIComponent *cob_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut) |
virtual baci::ActionRequest | moveSlotAction (baci::BACIComponent *cob_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut) |
virtual baci::ActionRequest | adjustAction (baci::BACIComponent *cob_p, const int &callbackID, const CBDescIn &descIn, baci::BACIValue *value_p, Completion &completion, CBDescOut &descOut) |
virtual void | moveFilterInBeam (const char *, ACS::CBvoid_ptr, const ACS::CBDescIn &) |
virtual void | moveSlotInBeam (int, ACS::CBvoid_ptr, const ACS::CBDescIn &) |
virtual void | adjust (int, ACS::CBvoid_ptr, const ACS::CBDescIn &) |
virtual CORBA::Long | calibrateFilter (const char *name) |
virtual CORBA::Long | calibrateWheel (int slot) |
virtual ACS::ROdouble_ptr | position () |
virtual ACS::ROstring_ptr | desc () |
virtual ACS::ROlong_ptr | slots () |
Private Member Functions | |
void | readConfiguration (Descriptor *descr) |
void | updateFilter (ACE_CString name, int delta) |
void | updateWheel (int slot, int step) |
void | operator= (const FilterWheel &) |
Private Attributes | |
ACE_CString | m_fullName |
baci::SmartPropertyPointer< baci::ROdouble > | m_position_sp |
baci::SmartPropertyPointer< baci::ROstring > | m_desc_sp |
baci::SmartPropertyPointer< baci::ROlong > | m_slots_sp |
Descriptor * | m_wheelConfiguration |
The configuration of the wheel is on the CDB. First of all the number of available slots of the wheel. This is read at startup. In the CDB there is a list of position of the slots. This is the step to rotate the wheel to have the center of the slot in the beam. The adjust method allows the user to move the wheel of some step in order to center the slot in the beam. When the center has been found, the calibrateWheel method store the position as the center for the selected slot.
In the CDB there is also the definition for each possible filter. For each filter there is its name, the slot where it is inserted in and the delta i.e. the deviation of the center of the filter in respect of the center of the slot (it could be a problem in building the filter for example, storing this number we could mount the filter in every slot) To found the center of the filter the operator uses again the adjust method. When the center is found the delta can be stored in the filter definition in the CDB using the calibrateFilter method.
The component reads the configuration of the wheel from the CDB at startup and stores number of the slots in the wheel, the position of the slots and the definition of each filter are together in the same array of structs (the number of the slot is represented by its position in the array). When one of the two calibrate methods is executed the internal data as well as the CDB values are updated.
|
Constructor
|
|
Destructor |
|
Called when due to some error condition the component is about to be forcefully removed some unknown amount of time later (usually not very much...). The component should make an effort to die as neatly as possible. Because of its urgency, this method will be called asynchronously to the execution of any other method of the component. If this method is overwritten in a chain of subclasses, the developer might need to make sure that all activities performed by the implementation of the base class take place. Check the documentation of direct parent class to know if this is necessary (and do not forget to document each class for the need to chain lifecycle methods in subclasses). The best way to do this is to call the implementation of the base itself explicitly, as would be done implicitly in a constructor chain. In this class the default implementation only sets the state of the component to acscomponent::ACS::ACS::COMPSTATE_ABORTING
Reimplemented from acscomponent::ACSComponentImpl.
|
|
Move the wheel of the specified number of step
|
|
Implementation of asynchrnous adjust() method This is the function that moves the wheel of some steps and, when completed, invokes the callback installed by the client when it requested the action.
|
|
Calibrate the delta of the filter by reading the actual position and the step of the slot where the filter is mounted (it also updates the value in the CDB)
|
|
Calibrate the step for the slot by reading the actual position (it also updates the value in the CDB)
|
|
Called after the last functional call to the component has finished. The component should then orderly release resources etc. If this method is overwritten in a subclass, the developer has to make sure that all cleanup performed by the implementation of the base class take place. The best way to do this is to call the implementation of the base itself explicitly, as would be done implicitly in a destructor chain. If this method is overwritten in a chain of subclasses, the developer might need to make sure that all activities performed by the implementation of the base class take place. Check the documentation of direct parent class to know if this is necessary (and do not forget to document each class for the need to chain lifecycle methods in subclasses). The best way to do this is to call the implementation of the base itself explicitly, as would be done implicitly in a destructor chain. In this class the default implementation only sets the state of the component to acscomponent::ACS::COMPSTATE_DESTROYING
Reimplemented from acscomponent::ACSComponentImpl.
|
|
Returns a reference to the desc property Implementation of IDL interface for the property.
|
|
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). If this method is overwritten in a chain of subclasses, the developer might need to make sure that all activities performed by the implementation of the base class take place. Check the documentation of direct parent class to know if this is necessary (and do not forget to document each class for the need to chain lifecycle methods in subclasses). The best way to do this is to call the implementation of the base itself explicitly, as would be done implicitly in a constructor chain. In this class the default implementation only sets the state of the component to acscomponent::ACS::COMPSTATE_OPERATIONAL
Reimplemented from acscomponent::ACSComponentImpl.
|
|
Called to give the component time to initialize itself. For instance, the component could retrieve connections, read in configuration files/parameters, build up in-memory tables, ... Called before execute. In fact, this method might be called quite some time before functional requests can be sent to the component. Must be implemented as a synchronous (blocking) call. If this method is overwritten in a chain of subclasses, the developer has to make sure that all initialisations performed by the implementation of the base class take place. Check the documentation of direct parent class to know if this is necessary (and do not forget to document each class for the need to chain lifecycle methods in subclasses). If necessary, the best way to do this is to call the implementation of the base itself explicitly, as would be done implicitly in a constructor chain. In this class the default implementation only sets the state of the component first to acscomponent::ACS::COMPSTATE_INITIALIZING and then to acscomponent::ACS::COMPSTATE_INITIALIZED.
Reimplemented from acscomponent::ACSComponentImpl.
|
|
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.
Implements baci::ActionImplementator.
|
|
Implementation of asynchrnous moveFilterInBeam method This is the function that actually rotate the wheel to the slot of the selected filter (it also take in account the per-filter adjustament represented by the delta filed in the description of the filter in the CDB) When completed, invokes the callback installed by the client when it requested the action.
|
|
Move the filter wheel to a specification slot. Implementation of IDL moveFilterInBeam(...) interface. The actual action will be invoked asyncronously by the asynchonous call manager by calling LampWhell::moveAction The given callback is used to inform the caller when the action is performed. |
|
Implementation of asynchrnous moveSlotInBeam method This is the function that actually rotate the wheel to the selected slot When completed, invokes the callback installed by the client when it requested the action.
|
|
Move the filter wheel to a specific slot. Implementation of IDL moveSlotInBeam(...) interface. The actual action will be invoked asyncronously by the asynchonous call manager by calling LampWhell::moveAction The given callback is used to inform the caller when the action is performed. |
|
ALMA C++ coding standards state copy operators should be disabled. |
|
Returns a reference to the position property Implementation of IDL interface for the property.
|
|
Read the CDB to build the actual configuration of the wheel
|
|
Returns a reference to the descavailableSlots property Implementation of IDL interface for the property.
|
|
Permanently write the new delta for the given filter in the CDB
|
|
Permanently write the new position for the given slot in the CDB
|
|
m_desc_sp is the description of the wheel. |
|
|
|
m_position_sp is the position of the wheel. |
|
m_slots_sp is the number of available slots in the wheel |
|
The array describing the actual configuration of the wheel: It is built by reading the CDB The number of item in the array is given by the number of available slots defined in the CDB |