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

TCamacModule.hh

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

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