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

TSoftwareFlashAdcModule.cc

解説を見る。
00001 // =====================================================================
00002 //  $Id: TSoftwareFlashAdcModule.cc,v 1.4 2004/03/07 10:30:31 goiwai Exp $
00003 //  $Name: CLDAQ-1-14-03 $
00004 //  $Log: TSoftwareFlashAdcModule.cc,v $
00005 //  Revision 1.4  2004/03/07 10:30:31  goiwai
00006 //  ROOTに組みこむためのおまじないマクロを埋めこみました。
00007 //  全てにおいて完全に動作するわけではありません。
00008 //
00009 //  Revision 1.3  2003/10/06 17:02:40  goiwai
00010 //  *** empty log message ***
00011 //
00012 //  Revision 1.2  2003/07/30 16:19:11  goiwai
00013 //  ファイルにコミットログをつけることにしました.
00014 //
00015 // =====================================================================
00016 #include "TSoftwareFlashAdcModule.hh"
00017 #include "TDataSegment.hh"
00018 #include "TDataElement.hh"
00019 #include "TRandomFlat.hh"
00020 #include "TRandomEngine.hh"
00021 
00022 static TRandomEngine _engine( (Tlong)time( 0 ) );
00023 static TRandomFlat _register( _engine );
00024 
00025 TSoftwareFlashAdcModule::TSoftwareFlashAdcModule( Tint nchannel, Tint nsampling )
00026   : TSoftwareModule( nchannel ), theNumberOfSampling( nsampling )
00027 {
00028   setParameters();
00029   Update();
00030 }
00031 
00032 TSoftwareFlashAdcModule::TSoftwareFlashAdcModule( const TSoftwareFlashAdcModule& right )
00033   : TSoftwareModule( right ), theNumberOfSampling( right.theNumberOfSampling )
00034 {;}
00035 
00036 TSoftwareFlashAdcModule::~TSoftwareFlashAdcModule()
00037 {;}
00038 
00039 Tint TSoftwareFlashAdcModule::Clear()
00040 {
00041   return theStatus = tStatusSuccess;
00042 }
00043 
00044 Tint TSoftwareFlashAdcModule::Update()
00045 {
00046   fillValue();
00047   return theStatus;
00048 }
00049 
00050 Tint TSoftwareFlashAdcModule::Initialize()
00051 {
00052   Clear();
00053   setParameters();
00054   return theStatus = tStatusSuccess;
00055 }
00056 
00057 Tvoid TSoftwareFlashAdcModule::FillData( TDataElement& element, Tint channel )
00058 {
00059   TUshort* data = new TUshort[ theNumberOfSampling ];
00060 
00061   for ( Tint i = 0; i < theNumberOfSampling; i ++ ) {
00062     data[ i ] = (TUshort)_register.fireInt( 4096 );  //dummy data
00063   }
00064 
00065   if ( channel < 0 || channel >= theNumberOfChannels ) {
00066     Tcerr << "TSoftwareFlashAdcModule::FillData: invalid ID" << Tendl;
00067     theStatus = -EFAULT;
00068     element.FillData( &theStatus, tTypeInt, 1 );
00069   } else {
00070     element.FillData( data, tTypeUnsignedShort, theNumberOfSampling );
00071   }
00072 
00073   delete [] data;
00074 
00075   return;
00076 }
00077 
00078 const TSoftwareFlashAdcModule& TSoftwareFlashAdcModule::operator=( const TSoftwareFlashAdcModule& right )
00079 {
00080   *( (TSoftwareModule*)this ) = *( (TSoftwareModule*)(&right) );
00081   theNumberOfSampling = right.theNumberOfSampling;
00082   return *this;
00083 }
00084 
00085 Tbool TSoftwareFlashAdcModule::operator==( const TSoftwareFlashAdcModule& right ) const
00086 {
00087   Tbool ret = Ttrue;
00088   ret &= ( *( (TSoftwareModule*)this ) == *( (TSoftwareModule*)(&right) ) );
00089   ret &= ( theNumberOfSampling == right.theNumberOfSampling );
00090   return ret;
00091 }
00092 
00093 Tbool TSoftwareFlashAdcModule::operator!=( const TSoftwareFlashAdcModule& right ) const
00094 {
00095   Tbool ret = Tfalse;
00096   ret |= ( *( (TSoftwareModule*)this ) != *( (TSoftwareModule*)(&right) ) );
00097   ret |= ( theNumberOfSampling != right.theNumberOfSampling );
00098   return ret;
00099 }
00100 
00101 Tvoid TSoftwareFlashAdcModule::setParameters()
00102 {
00103   // under construction.
00104   return;
00105 }
00106 
00107 Tvoid TSoftwareFlashAdcModule::fillValue()
00108 {
00109   // under construction.
00110   return;
00111 }
00112 
00113 #ifdef __CLDAQ_ROOT_DLL
00114     ClassImp(TSoftwareFlashAdcModule)
00115 #endif


CLDAQ - a Class Library for DataAcQuisition (Version 1.14.3)
Go IWAI -- goiwai at users.sourceforge.jp