From 8fa455925b73d06f76d9ba52e2cc05c92c71238e Mon Sep 17 00:00:00 2001 From: "carina@hades" Date: Thu, 6 Oct 2022 13:06:11 -0400 Subject: [PATCH] small change --- ClassDigitizer.cpp | 2 ++ test.cpp | 32 ++++++++++++++++++++------------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/ClassDigitizer.cpp b/ClassDigitizer.cpp index 4ad4b32..222692b 100644 --- a/ClassDigitizer.cpp +++ b/ClassDigitizer.cpp @@ -191,6 +191,8 @@ int Digitizer::OpenDigitizer(int boardID, int portID, bool program, bool verbose ProgramBoard(); } + if( isConnected ) FillAllSettings(); + return ret; } diff --git a/test.cpp b/test.cpp index ad6bf4a..20901b9 100644 --- a/test.cpp +++ b/test.cpp @@ -81,7 +81,7 @@ long get_time(){ int main(int argc, char* argv[]){ - const int nBoard = 1; + const int nBoard = 2; Digitizer **dig = new Digitizer *[nBoard]; for( int i = 0 ; i < nBoard; i++){ @@ -89,7 +89,7 @@ int main(int argc, char* argv[]){ int port = i/3; dig[i] = new Digitizer(board, port, false, true); //dig[i]->CreateAndSaveSettingBinary("setting_" + to_string(dig[i]->GetSerialNumber()) + ".bin"); - dig[i]->OpenSettingBinary("setting_" + to_string(dig[i]->GetSerialNumber()) + ".bin"); + //dig[i]->OpenSettingBinary("setting_" + to_string(dig[i]->GetSerialNumber()) + ".bin"); } dig[0]->Reset(); @@ -106,13 +106,13 @@ int main(int argc, char* argv[]){ //dig[0]->WriteRegister(Register::DPP::TriggerValidationMask_G, 0x600, 3); //dig[0]->WriteRegister(Register::DPP::Scratch, 0x12345678); - dig[0]->ReadRegister(Register::DPP::RecordLength_G, 0, "A0"); - dig[0]->ReadRegister(Register::DPP::RecordLength_G, 3, "A0"); - dig[0]->ReadRegister(Register::DPP::DPPAlgorithmControl, 0, "A1"); - dig[0]->ReadRegister(Register::DPP::DPPAlgorithmControl, -1, "A1"); - dig[0]->ReadRegister(Register::DPP::TriggerValidationMask_G, 1, "A3"); - dig[0]->ReadRegister(Register::DPP::TriggerValidationMask_G, 3, "A3"); - dig[0]->ReadRegister(Register::DPP::Scratch); + //dig[0]->ReadRegister(Register::DPP::RecordLength_G, 0, "A0"); + //dig[0]->ReadRegister(Register::DPP::RecordLength_G, 3, "A0"); + //dig[0]->ReadRegister(Register::DPP::DPPAlgorithmControl, 0, "A1"); + //dig[0]->ReadRegister(Register::DPP::DPPAlgorithmControl, -1, "A1"); + //dig[0]->ReadRegister(Register::DPP::TriggerValidationMask_G, 1, "A3"); + //dig[0]->ReadRegister(Register::DPP::TriggerValidationMask_G, 3, "A3"); + //dig[0]->ReadRegister(Register::DPP::Scratch); printf(" ======== %u \n", dig[0]->GetSettingFromMemory(Register::DPP::RecordLength_G, 0)); printf(" ======== %u \n", dig[0]->GetSettingFromMemory(Register::DPP::RecordLength_G, 3)); @@ -122,8 +122,8 @@ int main(int argc, char* argv[]){ //printf(" ======== %u \n", dig[0]->GetSettingFromMemory(Register::DPP::TriggerValidationMask_G, 3)); //printf(" ======== %u \n", dig[0]->GetSettingFromMemory(Register::DPP::Scratch)); - dig[0]->ReadSettingFromFile(Register::DPP::RecordLength_G, 0); - dig[0]->ReadSettingFromFile(Register::DPP::RecordLength_G, 3); + printf("////// %u \n", dig[0]->ReadSettingFromFile(Register::DPP::RecordLength_G, 0)); + printf("////// %u \n", dig[0]->ReadSettingFromFile(Register::DPP::RecordLength_G, 3)); //dig[0]->ReadSettingFromFile(Register::DPP::DPPAlgorithmControl, 0); //dig[0]->ReadSettingFromFile(Register::DPP::TriggerValidationMask_G, 1); //dig[0]->ReadSettingFromFile(Register::DPP::TriggerValidationMask_G, 2); @@ -131,7 +131,15 @@ int main(int argc, char* argv[]){ //dig[0]->ReadSettingFromFile(Register::DPP::Scratch); //dig[0]->PrintSettingFromMemory(); - + + + dig[1]->LoadSettingBinary("setting_323.bin"); + + printf(" ======== %u \n", dig[1]->GetSettingFromMemory(Register::DPP::RecordLength_G, 0)); + printf(" ======== %u \n", dig[1]->GetSettingFromMemory(Register::DPP::RecordLength_G, 3)); + + printf("////// %u \n", dig[1]->ReadSettingFromFile(Register::DPP::RecordLength_G, 0)); + printf("////// %u \n", dig[1]->ReadSettingFromFile(Register::DPP::RecordLength_G, 3)); /** ///============================ Get Data TApplication * app = new TApplication("app", &argc, argv);