rb9603_monochromator.h

00001 /*
00002  * rb9603_monochromator.h -   (RB9603).
00003  *
00004  * This file is part of the Rulbus Device Class Library (RDCL).
00005  *
00006  * Copyright (C) 2003-2004, Leiden University.
00007  *
00008  * This library is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * The library is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with mngdriver; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  *
00022  * $Id: rb9603_monochromator.h 2 2004-10-12 11:54:15Z moene $
00023  */
00024 
00025 #ifndef __RB9603_MONOCHROMATOR_H
00026 #define __RB9603_MONOCHROMATOR_H
00027 
00028 #ifndef __RULBUSDEVICE_H
00029 #include "RulbusDevice.h"       // for class RulbusDevice
00030 #endif
00031 
00032 namespace Rulbus
00033 {
00034    DECLARE_CLASS( RB9603_monochromator );  //
00035 
00036    /* *
00037     * \example name.cpp
00038     * This is an example that shows ... .
00039     */
00040 
00260    class RB9603_monochromator : public RulbusDevice
00261    {
00262    public:                              // public methods
00263       typedef Int Value;                
00264 
00267 
00268       RB9603_monochromator(
00269          NameCref aName,
00270          Addr     aAddr = DEF_ADDR,
00271          Rack     aRack = DEF_RACK
00272       );
00273 
00274       ~RB9603_monochromator();
00275 
00279 
00280       bool  isReady() const;
00281       void  wait   () const;
00282 
00286 
00287       Length adcWavelength() const;
00288       Length adcMeanWavelength() const;
00289       Length currentWavelength() const;
00290       Length targetWavelength() const;
00291 
00292       Length minWavelength() const;
00293       Length maxWavelength() const;
00294 
00298 
00299       void  calibrate( bool and_wait = true ) const;
00300 
00301       void  setWavelength( Length aWavelength, bool and_wait = true ) const;
00302 
00304 
00305    protected:                                   // protected methods
00308 
00309       RB9603_monochromator();                                     
00310       RB9603_monochromator( RB9603_monochromatorCref rhs );               
00311       RB9603_monochromatorRef operator= ( RB9603_monochromatorCref rhs ); 
00312 
00316 
00317       void checkWavelength( Length aWavelength ) const;
00318 
00322 
00323       Value  read ( CharCptr aName, CharCptr aCmd ) const;
00324       void   write( CharCptr aName, CharCptr aCmd, Value aPos = -1 ) const;
00325 
00326       String getString   (                    ) const;
00327       void   putString   ( StringCref aString ) const;
00328 
00329       char   getCharacter(         ) const;
00330       void   putCharacter( char ch ) const;
00331 
00333 
00338       enum ComCodes
00339       {
00340          COM_RDY = 0,                           
00341          COM_GET = 1,                           
00342          COM_EOT = 2,                           
00343          COM_LEN = 15,                          
00344          COM_CNT = 500,                         
00345          COM_SLPMS = 1,                         
00346       };
00347 
00348    public:                                      // public data
00351 
00352       static const Addr DEF_ADDR = 0xCE;        
00353 
00355 
00356    private:                                     // private data
00359 
00360       mutable Length theMinWL;                  
00361       mutable Length theMaxWL;                  
00362 
00366 
00367       static const int   OFF_CMD = 0;           
00368       static const int   OFF_STS = 0;           
00369       static const int ADR_WIDTH = OFF_STS + 1; 
00370 
00374 
00375       static const Length CON_MPS;              
00376 
00378 
00379    };
00380 
00382 
00387    inline RB9603_monochromatorRef to_rb9603( RulbusDevicePtr p )
00388    {
00389       return PROXY_CAST<RB9603_monochromatorRef>( *p );
00390    }
00391 
00396    inline RB9603_monochromatorPtr to_rb9603_ptr( RulbusDevicePtr p )
00397    {
00398       return PROXY_CAST<RB9603_monochromatorPtr>( p );
00399    }
00400 
00401 } // namespace Rulbus
00402 
00403 #endif  // __RB9603_MONOCHROMATOR_H
00404 
00405 /*
00406  * end of file
00407  */
00408 

Generated on Tue Oct 12 14:11:58 2004 for Rulbus Device Class Library for Microsoft Windows by doxygen 1.3.4