メインページ   モジュール   クラス階層   アルファベット順一覧   構成   ファイル一覧   構成メンバ   ファイルメンバ   関連ページ    

TCamacModule.hh

解説を見る。
00001 // =====================================================================
00028 // =====================================================================
00029 #ifndef __TCAMACMODULE_HH
00030 #define __TCAMACMODULE_HH
00031 
00032 #include "Tglobals.h"
00033 #include "TModule.hh"
00034 
00035 class TCamacCrateController;
00036 
00056 class TCamacModule
00057   : public TModule
00058 {
00059 
00060   protected:
00061     enum Tdata_t { 
00062       t16bitModule = 16, 
00063       t24bitModule = 24, 
00064       tNumberOfDataType
00065     };
00066 
00067   public:
00069 
00074     typedef struct TCamacDriverInterface {
00075       TUint _naf;
00076       Tshort _q;
00077       Tshort _x;
00078       union {
00079         TUshort _d16;
00080         TUint _d24;
00081       } _data;
00082     };
00083 
00084   protected:
00085     enum {
00086       tCamacRead = 0,
00087       tCamacWrite = 16,
00088       tCamacClear = 9,
00089       tCamacTestInterrupt = 8,
00090       tCamacClearInterrupt = 10,
00091       tCamacEnableInterrupt = 26,
00092       tCamacDisableInterrupt = 24
00093     };
00094 
00095   protected:
00096     TCamacCrateController* theCrateController;
00097     Tdata_t theDataLength;
00098     Tint theSlotNumber;
00099     Tint theQ;
00100     Tint theX;
00101     TUint theCamacData;
00102 
00103   public:
00104     TCamacModule( TCamacCrateController* cc7x00, Tint slot, Tint nch, Tdata_t datalen );
00105     TCamacModule( const TCamacModule& right );
00106 
00107   protected:
00108     virtual ~TCamacModule();
00109 
00110   public:
00111     virtual const TCamacModule& operator=( const TCamacModule& right );
00112     virtual Tbool operator==( const TCamacModule& right ) const;
00113     virtual Tbool operator!=( const TCamacModule& right ) const;
00114 
00115   public:
00116     virtual Tint WaitInterrupt( Tint msec );
00117     virtual Tint ReadInterrupt();
00118     virtual Tint Clear();
00119     virtual Tint Update();
00120     virtual Tint Initialize();
00121 
00122   public:
00123     // generic CAMAC functions
00124     virtual Tint TestInterrupt();
00125     virtual Tint ClearInterrupt();
00126     virtual Tint EnableInterrupt();
00127     virtual Tint DisableInterrupt();
00128     virtual Tint Read();
00129     virtual Tint Read( Tint subaddress );
00130     virtual Tint Write( Tint data );
00131 
00132   public:
00133     TCamacCrateController* GetCrateController() const;
00134     Tdata_t GetDataLength() const;
00135     Tint GetSlotNumber() const;
00136     Tint GetQ() const;
00137     Tint GetX() const;
00138     TUint GetCamacData() const;
00139     Tvoid SetDataLength( Tdata_t datalen );
00140     Tvoid SetSlotNumber( Tint slot );
00141     Tvoid SetQ( Tint q );
00142     Tvoid SetX( Tint x );
00143     Tvoid SetCamacData( TUint data );
00144 
00145   protected:
00146     Tint execute( Tint subaddress, Tint function );
00147 
00148   private:
00149     TUint generateNAF( Tint n, Tint a, Tint f );
00150     Tint execute16bit( TUint naf );
00151     Tint execute24bit( TUint naf );
00152 
00153 };
00154 
00155 inline TCamacCrateController* TCamacModule::GetCrateController() const
00156 {
00157   return theCrateController;
00158 }
00159 
00160 inline TCamacModule::Tdata_t TCamacModule::GetDataLength() const
00161 {
00162   return theDataLength;
00163 }
00164 
00165 inline Tint TCamacModule::GetSlotNumber() const
00166 {
00167   return theSlotNumber;
00168 }
00169 
00170 inline Tint TCamacModule::GetQ() const
00171 {
00172   return theQ;
00173 }
00174 
00175 inline Tint TCamacModule::GetX() const
00176 {
00177   return theX;
00178 }
00179 
00180 inline TUint TCamacModule::GetCamacData() const
00181 {
00182   return theCamacData;
00183 }
00184 
00185 inline Tvoid TCamacModule::SetDataLength( Tdata_t datalen )
00186 {
00187   theDataLength = datalen;
00188   return;
00189 }
00190 
00191 inline Tvoid TCamacModule::SetSlotNumber( Tint slot )
00192 {
00193   theSlotNumber = slot;
00194   return;
00195 }
00196 
00197 inline Tvoid TCamacModule::SetQ( Tint q )
00198 {
00199   theQ = q;
00200   return;
00201 }
00202 
00203 inline Tvoid TCamacModule::SetX( Tint x )
00204 {
00205   theX = x;
00206   return;
00207 }
00208 
00209 inline Tvoid TCamacModule::SetCamacData( TUint data )
00210 {
00211   theCamacData = data;
00212   return;
00213 }
00214 
00215 #endif

CLDAQ - a Class Library for Data AcQuisition (Version 1.11.0)
Go IWAI <goiwai@users.sourceforge.jp>