2022-08-04 17:27:33 -04:00
|
|
|
#include "DigitizerPHA.h"
|
|
|
|
//#include "DigitizerPSD.h"
|
2022-08-03 19:00:41 -04:00
|
|
|
|
|
|
|
int main(int argc, char* argv[]){
|
|
|
|
|
2022-08-10 18:35:13 -04:00
|
|
|
const int nBoard = 1;
|
|
|
|
DigitizerPHA *dig = new DigitizerPHA[nBoard];
|
2022-08-04 17:27:33 -04:00
|
|
|
//DigitizerPSD * psd = new DigitizerPSD();
|
2022-08-03 19:00:41 -04:00
|
|
|
|
2022-08-10 18:35:13 -04:00
|
|
|
for( int i = 0 ; i < nBoard; i++){
|
|
|
|
int board = i % 3;
|
|
|
|
int port = i/3;
|
|
|
|
dig[i].OpenDigitizer(board, port, true);
|
|
|
|
dig[i].OpenSettingBinary("setting_" + to_string(dig[i].GetSerialNumber()) + ".bin");
|
|
|
|
dig[i].SetAcqMode("list");
|
2022-08-12 18:13:54 -04:00
|
|
|
dig[i].PrintACQStatue();
|
2022-08-10 18:35:13 -04:00
|
|
|
}
|
|
|
|
|
2022-08-12 18:13:54 -04:00
|
|
|
//dig[0].WriteRegister(Register::DPP::FrontPanelTRGOUTEnableMask, 0xFF, -1);
|
|
|
|
//dig[0].WriteRegister(Register::DPP::FrontPanelIOControl, 0x100, -1);
|
|
|
|
//dig[0].WriteRegister(Register::DPP::TriggerValidationMask, 0, -1);
|
|
|
|
|
|
|
|
//dig[0].SetTriggerThreshold(100);
|
|
|
|
|
|
|
|
//dig[0].SetBits(Register::DPP::BoardConfiguration, 0x0101, 4, 20); // TRG validation window
|
|
|
|
dig[0].PrintBoardConfiguration(); //[20:23] vitural probe
|
|
|
|
dig[0].PrintChannelSettingFromDigitizer(15);
|
|
|
|
//dig[0].ReadRegister(Register::DPP::PHA::DPPAlgorithmControl2_G, 13, "DPP Control 2");
|
|
|
|
//dig[0].ReadRegister(Register::DPP::AcquisitionControl, -1, "Acq control"); // [0:1]
|
|
|
|
//dig[0].ReadRegister(Register::DPP::GlobalTriggerMask, -1, "GlobalTrigger mask");
|
|
|
|
//dig[0].ReadRegister(Register::DPP::FrontPanelTRGOUTEnableMask, -1, "Front Planel Trig-OUT mask"); /// should be 0xFF
|
|
|
|
//dig[0].ReadRegister(Register::DPP::FrontPanelIOControl, -1, "Front Planel I/O control");
|
|
|
|
//dig[0].ReadRegister(Register::DPP::DisableExternalTrigger, -1, "Disable External Trigger");
|
|
|
|
//dig[0].ReadRegister(Register::DPP::TriggerValidationMask, -1, "Trigger validation Mask");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-10 18:35:13 -04:00
|
|
|
//dig[0].PrintChannelSettingFromDigitizer(15);
|
2022-08-03 19:00:41 -04:00
|
|
|
|
2022-08-10 18:35:13 -04:00
|
|
|
//Data * data = dig[0].data;
|
2022-08-03 19:00:41 -04:00
|
|
|
|
2022-08-05 16:32:46 -04:00
|
|
|
|
2022-08-10 18:35:13 -04:00
|
|
|
//data->AllocateMemory(dig[0].GetHandle());
|
2022-08-12 18:13:54 -04:00
|
|
|
|
2022-08-10 18:35:13 -04:00
|
|
|
dig[0].StartACQ();
|
2022-08-04 17:27:33 -04:00
|
|
|
|
2022-08-12 18:13:54 -04:00
|
|
|
sleep(5);
|
2022-08-03 19:00:41 -04:00
|
|
|
|
2022-08-10 18:35:13 -04:00
|
|
|
dig[0].ReadData();
|
2022-08-05 18:15:50 -04:00
|
|
|
|
2022-08-10 18:35:13 -04:00
|
|
|
//printf("|%s|\n", data->buffer);
|
2022-08-05 18:15:50 -04:00
|
|
|
|
2022-08-10 18:35:13 -04:00
|
|
|
dig[0].StopACQ();
|
2022-08-03 19:00:41 -04:00
|
|
|
|
2022-08-05 18:15:50 -04:00
|
|
|
|
2022-08-03 19:00:41 -04:00
|
|
|
|
|
|
|
delete [] dig;
|
2022-08-04 17:27:33 -04:00
|
|
|
//delete psd;
|
2022-08-03 19:00:41 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|