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

acsexmplFilterWheelImpl.h

Go to the documentation of this file.
00001 #ifndef acsexmplFilterWheelImpl_h
00002 #define acsexmplFilterWheelImpl_h
00003 /*******************************************************************************
00004 *    ALMA - Atacama Large Millimiter Array
00005 *    (c) European Southern Observatory, 2002
00006 *    Copyright by ESO (in the framework of the ALMA collaboration)
00007 *    and Cosylab 2002, All rights reserved
00008 *
00009 *    This library is free software; you can redistribute it and/or
00010 *    modify it under the terms of the GNU Lesser General Public
00011 *    License as published by the Free Software Foundation; either
00012 *    version 2.1 of the License, or (at your option) any later version.
00013 *
00014 *    This library is distributed in the hope that it will be useful,
00015 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 *    Lesser General Public License for more details.
00018 *
00019 *    You should have received a copy of the GNU Lesser General Public
00020 *    License along with this library; if not, write to the Free Software
00021 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00022 *
00023 * "@(#) $Id: acsexmplFilterWheelImpl.h,v 1.3 2006/04/20 08:47:59 bjeram Exp $"
00024 *
00025 * who       when      what
00026 * --------  --------  ----------------------------------------------
00027 * acaproni 20041124   Created
00028 */
00029 
00030 #ifndef __cplusplus
00031 #error This is a C++ include file and cannot be used from plain C
00032 #endif
00033 
00034 #include <baciCharacteristicComponentImpl.h>
00035 #include <acsexmplExport.h>
00036 #include <acsexmplFilterWheelS.h>
00037 
00038 #include <baciROdouble.h>
00039 #include <baciROlong.h>
00040 #include <baciROstring.h>
00041 
00043 #include <baciSmartPropertyPointer.h>
00044 
00045 using namespace baci;
00046 
00053 typedef struct {
00054         // The step to move the wheel to in such a way the slot
00055         // is centered in the beam
00056         int step;
00057         // The name/type of the filter mounted in the slot
00058     char filterName[128]; 
00059     // The steps adjust the position for a perfect 
00060     // alignement for this filter
00061     int delta; 
00062 } Descriptor;
00063 
00132 class acsexmpl_EXPORT FilterWheel: public CharacteristicComponentImpl,//Standard component superclass
00133             public virtual POA_acsexmplFilterWheel::FilterWheel,//CORBA servant stub
00134             public ActionImplementator //Asynchronous method helper class
00135 {
00136   public:
00144     FilterWheel(const ACE_CString& name,maci::ContainerServices * containerServices);
00145     
00149     virtual ~FilterWheel();
00150 
00151     /* --------------------- [ Life cycle methods ] -------------------- */
00152 
00179     virtual void initialize()
00180       throw (ACSErr::ACSbaseExImpl);
00181 
00204     virtual void execute()
00205       throw (ACSErr::ACSbaseExImpl);
00206 
00231     virtual void cleanUp();
00232 
00256     virtual void aboutToAbort();
00257    
00258     /* --------------- [ Action implementator interface ] -------------- */    
00282     virtual ActionRequest
00283     invokeAction (int function,
00284                   BACIComponent *cob_p, 
00285                   const int &callbackID,
00286                   const CBDescIn &descIn,
00287                   BACIValue *value_p,
00288                   Completion &completion,
00289                   CBDescOut &descOut);
00290 
00315     virtual ActionRequest 
00316     moveFilterAction (BACIComponent *cob_p, 
00317                const int &callbackID,
00318                const CBDescIn &descIn, 
00319                BACIValue *value_p,
00320                Completion &completion, 
00321                CBDescOut &descOut);
00322           
00345     virtual ActionRequest 
00346     moveSlotAction (BACIComponent *cob_p, 
00347          const int &callbackID,
00348          const CBDescIn &descIn, 
00349            BACIValue *value_p,
00350         Completion &completion, 
00351            CBDescOut &descOut);
00352     
00375     virtual ActionRequest 
00376     adjustAction (BACIComponent *cob_p, 
00377                const int &callbackID,
00378                const CBDescIn &descIn, 
00379                BACIValue *value_p,
00380                Completion &completion, 
00381                CBDescOut &descOut);
00382     /* --------------------- [ CORBA interface ] ----------------------*/
00383     
00391         virtual void moveFilterInBeam(const char* , ACS::CBvoid_ptr,
00392                 const ACS::CBDescIn&) throw (CORBA::SystemException);
00393     
00401     virtual void moveSlotInBeam(int, ACS::CBvoid_ptr, const ACS::CBDescIn&)
00402    throw (CORBA::SystemException);
00403 
00409     virtual void adjust(int, ACS::CBvoid_ptr, const ACS::CBDescIn&)
00410         throw (CORBA::SystemException);
00411 
00420     virtual CORBA::Long calibrateFilter(const char* name) throw (CORBA::SystemException);
00421     
00429     virtual CORBA::Long calibrateWheel(int slot) throw (CORBA::SystemException);
00430 
00431 
00439     virtual ACS::ROdouble_ptr position ()
00440         throw (CORBA::SystemException); 
00441     
00449     virtual ACS::ROstring_ptr desc ()
00450         throw (CORBA::SystemException);
00451 
00459     virtual ACS::ROlong_ptr slots ()
00460         throw (CORBA::SystemException);
00461 
00462   private:
00463 
00464     // The name of the component with the alma/ prefix
00465     // We need the name to access the CDB
00466     ACE_CString m_fullName;
00467 
00468     
00472      SmartPropertyPointer<ROdouble> m_position_sp;
00473 
00477      SmartPropertyPointer<ROstring> m_desc_sp;
00478 
00483     SmartPropertyPointer<ROlong>m_slots_sp;
00484 
00491     Descriptor* m_wheelConfiguration;
00492 
00499     void readConfiguration(Descriptor* descr);
00500 
00507      void updateFilter(ACE_CString name, int delta);
00508      
00515      void updateWheel(int slot, int step);
00516 
00520     void operator=(const FilterWheel&);
00521 
00522 };
00523 
00524 #endif   /* acsexmplLampWheelImpl_h */
00525 

Generated on Sun Oct 29 02:26:25 2006 for ACS C++ API by doxygen 1.3.6