ALMA Computing Group

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.8 2008/10/09 08:41:11 cparedes 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 00051 typedef struct { 00052 // The step to move the wheel to in such a way the slot 00053 // is centered in the beam 00054 int step; 00055 // The name/type of the filter mounted in the slot 00056 char filterName[128]; 00057 // The steps adjust the position for a perfect 00058 // alignement for this filter 00059 int delta; 00060 } Descriptor; 00061 00066 00071 00139 class acsexmpl_EXPORT FilterWheel: public baci::CharacteristicComponentImpl,//Standard component superclass 00140 public virtual POA_acsexmplFilterWheel::FilterWheel,//CORBA servant stub 00141 public baci::ActionImplementator //Asynchronous method helper class 00142 { 00143 public: 00151 FilterWheel(const ACE_CString& name,maci::ContainerServices * containerServices); 00152 00156 virtual ~FilterWheel(); 00157 00158 /* --------------------- [ Life cycle methods ] -------------------- */ 00159 00187 virtual void initialize(); 00188 00212 virtual void execute(); 00213 00238 virtual void cleanUp(); 00239 00263 virtual void aboutToAbort(); 00264 00265 /* --------------- [ Action implementator interface ] -------------- */ 00289 virtual baci::ActionRequest 00290 invokeAction (int function, 00291 baci::BACIComponent *cob_p, 00292 const int &callbackID, 00293 const CBDescIn &descIn, 00294 baci::BACIValue *value_p, 00295 Completion &completion, 00296 CBDescOut &descOut); 00297 00322 virtual baci::ActionRequest 00323 moveFilterAction (baci::BACIComponent *cob_p, 00324 const int &callbackID, 00325 const CBDescIn &descIn, 00326 baci::BACIValue *value_p, 00327 Completion &completion, 00328 CBDescOut &descOut); 00329 00352 virtual baci::ActionRequest 00353 moveSlotAction (baci::BACIComponent *cob_p, 00354 const int &callbackID, 00355 const CBDescIn &descIn, 00356 baci::BACIValue *value_p, 00357 Completion &completion, 00358 CBDescOut &descOut); 00359 00382 virtual baci::ActionRequest 00383 adjustAction (baci::BACIComponent *cob_p, 00384 const int &callbackID, 00385 const CBDescIn &descIn, 00386 baci::BACIValue *value_p, 00387 Completion &completion, 00388 CBDescOut &descOut); 00389 /* --------------------- [ CORBA interface ] ----------------------*/ 00390 00398 virtual void moveFilterInBeam(const char* , ACS::CBvoid_ptr, 00399 const ACS::CBDescIn&); 00400 00408 virtual void moveSlotInBeam(int, ACS::CBvoid_ptr, const ACS::CBDescIn&); 00409 00415 virtual void adjust(int, ACS::CBvoid_ptr, const ACS::CBDescIn&); 00416 00425 virtual CORBA::Long calibrateFilter(const char* name); 00426 00434 virtual CORBA::Long calibrateWheel(int slot); 00435 00436 00444 virtual ACS::ROdouble_ptr position (); 00445 00453 virtual ACS::ROstring_ptr desc (); 00454 00462 virtual ACS::ROlong_ptr slots (); 00463 00464 private: 00465 00466 // The name of the component with the alma/ prefix 00467 // We need the name to access the CDB 00468 ACE_CString m_fullName; 00469 00470 00474 baci::SmartPropertyPointer<baci::ROdouble> m_position_sp; 00475 00479 baci::SmartPropertyPointer<baci::ROstring> m_desc_sp; 00480 00485 baci::SmartPropertyPointer<baci::ROlong>m_slots_sp; 00486 00493 Descriptor* m_wheelConfiguration; 00494 00501 void readConfiguration(Descriptor* descr); 00502 00509 void updateFilter(ACE_CString name, int delta); 00510 00517 void updateWheel(int slot, int step); 00518 00522 void operator=(const FilterWheel&); 00523 00524 }; 00525 /*\@}*/ 00526 /*\@}*/ 00527 00528 #endif /* acsexmplLampWheelImpl_h */ 00529