00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __RB9603_MONOCHROMATOR_H
00026 #define __RB9603_MONOCHROMATOR_H
00027
00028 #ifndef __RULBUSDEVICE_H
00029 #include "RulbusDevice.h"
00030 #endif
00031
00032 namespace Rulbus
00033 {
00034 DECLARE_CLASS( RB9603_monochromator );
00035
00036
00037
00038
00039
00040
00260 class RB9603_monochromator : public RulbusDevice
00261 {
00262 public:
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:
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:
00351
00352 static const Addr DEF_ADDR = 0xCE;
00353
00355
00356 private:
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 }
00402
00403 #endif // __RB9603_MONOCHROMATOR_H
00404
00405
00406
00407
00408