FSUDAQ/test.cpp

73 lines
2.4 KiB
C++

#include "DigitizerPHA.h"
//#include "DigitizerPSD.h"
int main(int argc, char* argv[]){
const int nBoard = 1;
DigitizerPHA *dig = new DigitizerPHA[nBoard];
//DigitizerPSD * psd = new DigitizerPSD();
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");
dig[i].PrintACQStatue();
}
//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].SetDPPAlgorithmControl(0x830200E);
dig[0].SetInputDynamicRange(2);
dig[0].SetTriggerThreshold(20);
//dig[0].SetChannelMask(0x8000); /// only channel 15
//dig[0].SetChannelMask(0xffff); /// all channels
dig[0].SetWaveFormRecording(false);
//dig[0].SetPileUpFlag(false);
//dig[0].SetBits(Register::DPP::BoardConfiguration, 0x0101, 4, 20); // TRG validation window
//dig[0].PrintBoardConfiguration(); //[20:23] vitural probe
//dig[0].PrintChannelSettingFromDigitizer(7);
//dig[0].PrintChannelSettingFromDigitizer(8);
//dig[0].PrintChannelSettingFromDigitizer(9);
//dig[0].PrintChannelSettingFromDigitizer(10);
dig[0].PrintChannelSettingFromDigitizer(4);
//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");
//dig[0].PrintChannelSettingFromDigitizer(15);
//Data * data = dig[0].data;
//data->AllocateMemory(dig[0].GetHandle());
dig[0].StartACQ();
sleep(1);
dig[0].ReadData();
//printf("|%s|\n", data->buffer);
dig[0].StopACQ();
delete [] dig;
//delete psd;
return 0;
}