From 9e16a53075f744a11a0b211f89c1da761e766394 Mon Sep 17 00:00:00 2001 From: "Ryan@Debain10" Date: Mon, 7 Mar 2022 16:20:50 -0500 Subject: [PATCH] added ch2ns, remove Pixie16Msg.log at begin of test.cpp --- Pixie16Class.cpp | 6 +++++- Pixie16Class.h | 4 ++++ test.cpp | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Pixie16Class.cpp b/Pixie16Class.cpp index 07f849c..8a59d23 100644 --- a/Pixie16Class.cpp +++ b/Pixie16Class.cpp @@ -62,7 +62,7 @@ Pixie16::~Pixie16(){ CheckError("Pixie16ExitSystem"); delete PXISlotMap; - + delete ch2ns; delete ComFPGAConfigFile; delete SPFPGAConfigFile; delete TrigFPGAConfigFile; @@ -85,6 +85,8 @@ bool Pixie16::LoadConfigFile(std::string fileName){ OfflineMode = 0; PXISlotMap = new unsigned short[NumModules]; + ch2ns = new unsigned short[NumModules]; + ComFPGAConfigFile = new char* [NumModules]; SPFPGAConfigFile = 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 sampling rate : %d \n", ModADCMSPS); + ch2ns[modID] = 1000/ModADCMSPS; + } diff --git a/Pixie16Class.h b/Pixie16Class.h index aa3a39a..e41b13d 100644 --- a/Pixie16Class.h +++ b/Pixie16Class.h @@ -48,6 +48,8 @@ private: unsigned short NumModules; unsigned short * PXISlotMap; unsigned short OfflineMode; + + unsigned short * ch2ns; char ** ComFPGAConfigFile; char ** SPFPGAConfigFile; @@ -92,6 +94,8 @@ public: void GetDigitizerInfo(unsigned short modID); void BootDigitizers(); + + unsigned short GetCh2ns(unsigned short modID) {return ch2ns[modID];} void AdjustOffset(); void CaptureBaseLine(unsigned short modID, unsigned short ch); diff --git a/test.cpp b/test.cpp index b9feef0..82d20b0 100644 --- a/test.cpp +++ b/test.cpp @@ -60,6 +60,9 @@ void PrintCommands(){ ///################################################## int main(int argc, char *argv[]){ + + printf("Removing Pixie16Msg.log \n"); + remove( "Pixie16Msg.log"); Pixie16 * pixie = new Pixie16(); if ( pixie->GetStatus() < 0 ) {