added ch2ns, remove Pixie16Msg.log at begin of test.cpp

This commit is contained in:
Ryan Tang 2022-03-07 16:20:50 -05:00
parent 2f640d6e51
commit 9e16a53075
3 changed files with 12 additions and 1 deletions

View File

@ -62,7 +62,7 @@ Pixie16::~Pixie16(){
CheckError("Pixie16ExitSystem"); CheckError("Pixie16ExitSystem");
delete PXISlotMap; delete PXISlotMap;
delete ch2ns;
delete ComFPGAConfigFile; delete ComFPGAConfigFile;
delete SPFPGAConfigFile; delete SPFPGAConfigFile;
delete TrigFPGAConfigFile; delete TrigFPGAConfigFile;
@ -85,6 +85,8 @@ bool Pixie16::LoadConfigFile(std::string fileName){
OfflineMode = 0; OfflineMode = 0;
PXISlotMap = new unsigned short[NumModules]; PXISlotMap = new unsigned short[NumModules];
ch2ns = new unsigned short[NumModules];
ComFPGAConfigFile = new char* [NumModules]; ComFPGAConfigFile = new char* [NumModules];
SPFPGAConfigFile = new char* [NumModules]; SPFPGAConfigFile = new char* [NumModules];
TrigFPGAConfigFile = new char* [NumModules]; TrigFPGAConfigFile = new char* [NumModules];
@ -185,6 +187,8 @@ void Pixie16::GetDigitizerInfo(unsigned short modID){
printf(" ADC Bits : %d \n", ModADCBits); printf(" ADC Bits : %d \n", ModADCBits);
printf("ADC sampling rate : %d \n", ModADCMSPS); printf("ADC sampling rate : %d \n", ModADCMSPS);
ch2ns[modID] = 1000/ModADCMSPS;
} }

View File

@ -48,6 +48,8 @@ private:
unsigned short NumModules; unsigned short NumModules;
unsigned short * PXISlotMap; unsigned short * PXISlotMap;
unsigned short OfflineMode; unsigned short OfflineMode;
unsigned short * ch2ns;
char ** ComFPGAConfigFile; char ** ComFPGAConfigFile;
char ** SPFPGAConfigFile; char ** SPFPGAConfigFile;
@ -92,6 +94,8 @@ public:
void GetDigitizerInfo(unsigned short modID); void GetDigitizerInfo(unsigned short modID);
void BootDigitizers(); void BootDigitizers();
unsigned short GetCh2ns(unsigned short modID) {return ch2ns[modID];}
void AdjustOffset(); void AdjustOffset();
void CaptureBaseLine(unsigned short modID, unsigned short ch); void CaptureBaseLine(unsigned short modID, unsigned short ch);

View File

@ -60,6 +60,9 @@ void PrintCommands(){
///################################################## ///##################################################
int main(int argc, char *argv[]){ int main(int argc, char *argv[]){
printf("Removing Pixie16Msg.log \n");
remove( "Pixie16Msg.log");
Pixie16 * pixie = new Pixie16(); Pixie16 * pixie = new Pixie16();
if ( pixie->GetStatus() < 0 ) { if ( pixie->GetStatus() < 0 ) {