Example #1
0
namespace Decoder {

Module::TypeIter_t Lecroy1881Module::fgThisType =
  DoRegister( ModuleType( "Decoder::Lecroy1881Module" , 1881));

Lecroy1881Module::Lecroy1881Module(Int_t crate, Int_t slot) : FastbusModule(crate, slot) {
  Init();
}

void Lecroy1881Module::Init() {
  fChanMask = 0x7e0000;
  fDataMask = 0x3fff;
  fWdcntMask = 0x7f;
  fOptMask = 0x3000000;
  fChanShift = 17;
  fOptShift = 24;
  fHasHeader = kTRUE;
  fHeader = 0;
  fModelNum = 1881;
  FastbusModule::Init();
}

Lecroy1881Module::~Lecroy1881Module() {
}

}
Example #2
0
namespace Decoder {

Module::TypeIter_t Scaler3800::fgThisType =
  DoRegister( ModuleType( "Decoder::Scaler3800" , 3800 ));

Scaler3800::Scaler3800(Int_t crate, Int_t slot) : GenScaler(crate, slot) {
  Init();
}

Scaler3800::~Scaler3800() {
}

void Scaler3800::Init() {
  fNumChan = 32;
  fWordsExpect = 32;
  GenScaler::GenInit();
}

}
Example #3
0
int	CALMAPI::CALMReadSpecs( char* filename )
{
	ifstream	infile;
	char		dummy[32];
	char		mdlname[32];
	int			mdltype, mdlsize, mdlidx, mdlconn, link, delay;
	int			i, j;
	
	// open the file
	infile.open( filename );
	if ( infile.fail() ) 
	{
		FileOpenError( filename );
		return kCALMFileError;
	}
	
	// read in number of CALM modules
	SkipComments( &infile );		// ignore any strings starting with #
	infile >> mNumModules;
	// read in number of input modules
	SkipComments( &infile );
	infile >> mNumInputs;

	// set up the module array
	mNetwork->SetNumModules( mNumModules, mNumInputs );
	
	// read in each module. Pattern modules should be specified first, 
	// before all other module types.
	for ( i = 0; i < mNumModules+mNumInputs; i++ )
	{
		// read name of module
		SkipComments( &infile );
		infile >> mdlname;
		// read module type
		SkipComments( &infile );
		infile >> dummy;
		mdltype = ModuleType( dummy );
		// read number of nodes
		SkipComments( &infile );
		infile >> mdlsize;
		// initialize the module
		mNetwork->InitializeModule( i, mdltype, mdlsize, mdlname );
	}
	// read in connections
	for ( int i = 0; i < mNumModules; i++ )
	{
		// read name of to-module
		SkipComments( &infile );
		infile >> mdlname;
		// get idx for to-module
		mdlidx = mNetwork->GetModuleIndex( mdlname );
		// read number of connections
		SkipComments( &infile );
		infile >> mdlconn;
		// set connections array for module
		mNetwork->SetNumConnections( mdlidx, mdlconn );
		// set up each single connection
		for ( j = 0; j < mdlconn; j++ )
		{	
			// read from-module
			SkipComments( &infile );
			infile >> mdlname;
			// get connection type
			SkipComments( &infile );
			infile >> dummy;
			link = ConnectionType( dummy );
			// with time delay connections, the time constant should be provided
			if ( link == kDelayLink )
			{
				SkipComments( &infile );
				infile >> delay;
			}
			else delay = 0;
			// connect the modules
			mNetwork->ConnectModules( j, mdlidx, mNetwork->GetModuleIndex( mdlname ), link, delay );
		}