• Classes
  • Modules
  • Namespaces
  • Files
  • Related Pages
  • File List
  • File Members

acsexmplLampWheelImpl.h

Go to the documentation of this file.
00001 #ifndef acsexmplLampWheelImpl_h
00002 #define acsexmplLampWheelImpl_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: acsexmplLampWheelImpl.h,v 1.16 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 <acsexmplLampWheelS.h>
00037 
00038 #include <baciROdouble.h>
00039 #include <baciROlong.h>
00040 #include <baciROstring.h>
00041 
00043 #include <baciSmartPropertyPointer.h>
00044 
00045 #include <expat.h>
00046 #include <list>
00047 
00049 typedef struct {
00050     unsigned int num; // The number of the slot
00051     char lampName[128]; // The name of the lamp in the slot
00052     unsigned int warmUpTime; // The warm-up time
00053     unsigned int watt; // The watt of the lamp 
00054     unsigned int pos; // The position in the lamp (step)
00055 } SlotDescriptor;
00056 
00062 
00067 
00121 class acsexmpl_EXPORT LampWheel: public baci::CharacteristicComponentImpl,//Standard component superclass
00122             public virtual POA_acsexmplLampWheel::LampWheel,//CORBA servant stub
00123             public baci::ActionImplementator //Asynchronous method helper class
00124 {
00125   public:
00132     LampWheel(
00133               const ACE_CString& name,
00134               maci::ContainerServices * containerServices);
00135     
00139     virtual ~LampWheel();
00140 
00141     /* --------------------- [ Life cycle methods ] -------------------- */
00142 
00169     virtual void initialize();
00170 
00194     virtual void execute();
00195 
00220     virtual void cleanUp();
00221 
00245     virtual void aboutToAbort();
00246    
00247     /* --------------- [ Action implementator interface ] -------------- */    
00271     virtual baci::ActionRequest
00272     invokeAction (int function,
00273                   baci::BACIComponent *cob_p, 
00274                   const int &callbackID,
00275                   const CBDescIn &descIn,
00276                   baci::BACIValue *value_p,
00277                   Completion &completion,
00278                   CBDescOut &descOut);
00279 
00302     virtual baci::ActionRequest 
00303     moveAction (baci::BACIComponent *cob_p, 
00304                const int &callbackID,
00305                const CBDescIn &descIn, 
00306                baci::BACIValue *value_p,
00307                Completion &completion, 
00308                CBDescOut &descOut);    
00309     /* --------------------- [ CORBA interface ] ----------------------*/
00310     
00325         virtual void move(CORBA::Short, ACS::CBvoid_ptr,
00326                 const ACS::CBDescIn&); 
00327 
00335     virtual ACS::ROdouble_ptr position ();
00336     
00344     virtual ACS::ROstring_ptr desc ();
00345 
00353     virtual ACS::ROlong_ptr slots ();
00354 
00355   private:
00356 
00357     // The name of the component with the alma/ prefix
00358     // We need the name to access the CDB
00359     ACE_CString m_fullName;
00360 
00361     
00365      baci::SmartPropertyPointer<baci::ROdouble> m_position_sp;
00366 
00370      baci::SmartPropertyPointer<baci::ROstring> m_desc_sp;
00371 
00376     baci::SmartPropertyPointer<baci::ROlong>m_slots_sp;
00377 
00383     std::list<SlotDescriptor> m_lampWheelConfiguration;
00384 
00388     void operator=(const LampWheel&);
00389 
00397     int retrieveConfigurationFromCDB(std::list<SlotDescriptor>& config);
00398 
00404     static void start_hndl(void *data, const XML_Char *el, const XML_Char **attr);
00405 
00411     static void end_hndl(void *data, const XML_Char *el);
00412     
00418     static void char_hndl(void *data, const XML_Char *s, int len);
00419 
00420 };
00421 /*\@}*/
00422 /*\@}*/
00423 
00424 #endif   /* acsexmplLampWheelImpl_h */
00425 
00426 
00427 

Generated on Thu Jan 12 2012 23:13:50 for ACS-10.0 C++ API by  doxygen 1.7.0