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

TCamacModule.hh

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

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