add more board setting readout, not tested
This commit is contained in:
parent
db7814b193
commit
bd5cd4e1f5
|
@ -95,23 +95,12 @@ int Digitizer::OpenDigitizer(int boardID, int portID, bool program, bool verbose
|
|||
ADCbits = BoardInfo.ADC_NBits;
|
||||
ADCFullSize = (unsigned int)( pow(2, ADCbits) -1 );
|
||||
|
||||
if( verbose) {
|
||||
printf("Connected to Model %s with handle %d using %s\n", BoardInfo.ModelName, handle, LinkType == CAEN_DGTZ_USB ? "USB" : "Optical Link");
|
||||
printf("Sampling rate : %.0f MHz = %.1f ns \n", 1000/ch2ns, ch2ns);
|
||||
printf("Number of Channels : %d = 0x%X\n", NChannel, channelMask);
|
||||
printf("SerialNumber :\e[1m\e[33m %d\e[0m\n", BoardInfo.SerialNumber);
|
||||
printf("ADC bit is \e[33m%d\e[0m, %d = 0x%x\n", ADCbits, ADCFullSize, ADCFullSize);
|
||||
printf("ROC FPGA Release is %s\n", BoardInfo.ROC_FirmwareRel);
|
||||
printf("AMC FPGA Release is %s\n", BoardInfo.AMC_FirmwareRel);
|
||||
}
|
||||
int DPPType;
|
||||
if( verbose) PrintBoard();
|
||||
sscanf(BoardInfo.AMC_FirmwareRel, "%d", &DPPType);
|
||||
if (DPPType < 128) {
|
||||
if( verbose) printf("This digitizer does not have DPP-PHA firmware\n");
|
||||
}
|
||||
data->DPPType = DPPType;
|
||||
if (DPPType < 128 && verbose) printf("This digitizer does not have DPP-PHA firmware\n");
|
||||
|
||||
//SetBoardID(BoardInfo.SerialNumber);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -538,6 +527,24 @@ int Digitizer::GetChTemperature(int ch){
|
|||
return temp[0];
|
||||
}
|
||||
|
||||
uint32_t Digitizer::PrintRegister(uint32_t address, std::string msg){
|
||||
if( !isConnected ) return 0 ;
|
||||
printf("\e[33m----------------------------------------------------\n");
|
||||
printf("------------ %s = 0x%x \n", msg.c_str(), address);
|
||||
printf("----------------------------------------------------\e[0m\n");
|
||||
|
||||
uint32_t * value = new uint32_t[1];
|
||||
CAEN_DGTZ_ReadRegister(handle, (uint32_t) Register::BoardConfiguration, value);
|
||||
printf(" %*s 32 28 24 20 16 12 8 4 0\n", msg.length(), "");
|
||||
printf(" %*s | | | | | | | | |\n", msg.length(), "");
|
||||
printf(" %*s", msg.length(), "");
|
||||
cout << " : 0b" << bitset<32>(value[0]) << endl;
|
||||
printf(" %*s : 0x%x\n", msg.length(), msg.c_str(), value[0]);
|
||||
|
||||
return value[0];
|
||||
|
||||
}
|
||||
|
||||
void Digitizer::PrintACQStatue(){
|
||||
if( !isConnected ) return;
|
||||
unsigned int status = ReadRegister(Register::DPP::AcquisitionStatus);
|
||||
|
|
|
@ -90,6 +90,8 @@ class Digitizer{
|
|||
unsigned int ReadBits(uint32_t address, unsigned int bitLength, unsigned int bitSmallestPos, int ch = -1 );
|
||||
unsigned int GetDPPAlgorithmControl(int ch = -1) {return ReadRegister(Register::DPP::DPPAlgorithmControl, ch);}
|
||||
|
||||
uint32_t PrintRegister(uint32_t address, std::string msg);
|
||||
|
||||
void PrintBoard();
|
||||
void PrintACQStatue();
|
||||
|
||||
|
|
144
DigitizerPHA.cpp
144
DigitizerPHA.cpp
|
@ -107,6 +107,15 @@ void DigitizerPHA::SetSetting(Setting::PHA settingName, float value, int ch){
|
|||
case Setting::PHA::PLLClockSource_bool: input = value; SetBits(Register::DPP::AcquisitionControl, input, 1, 6); break;
|
||||
case Setting::PHA::VetoInForTRGOUT_bool: input = value; SetBits(Register::DPP::AcquisitionControl, input, 1, 12); break;
|
||||
|
||||
/// Trigger Validation Mask
|
||||
case Setting::PHA::TriggerValidationMask_8bit: input = value; SetBits(Register::DPP::TriggerValidationMask, input, 8, 0); break;
|
||||
case Setting::PHA::TriggerValidationOperation_2bit: input = value; SetBits(Register::DPP::TriggerValidationMask, input, 2, 8); break;
|
||||
case Setting::PHA::TriggerValidationMajority_3bit: input = value; SetBits(Register::DPP::TriggerValidationMask, input, 3, 10); break;
|
||||
case Setting::PHA::ExternalTrigger_bool: input = value; SetBits(Register::DPP::TriggerValidationMask, input, 1, 30); break;
|
||||
case Setting::PHA::SoftwareTrigger_bool: input = value; SetBits(Register::DPP::TriggerValidationMask, input, 1, 31); break;
|
||||
|
||||
case Setting::PHA::RunStartStopDelay_8bit: input = value; WriteRegister(Register::DPP::RunStartStopDelay, input); break;
|
||||
|
||||
/// Registers
|
||||
case Setting::PHA::RecordLength_G_ns: input = value / 8 / ch2ns; WriteRegister(Register::DPP::RecordLength_G, input, ch) ; break;
|
||||
case Setting::PHA::PreTriggerLength_ns: input = value / 4 / ch2ns; WriteRegister(Register::DPP::PreTrigger, input, ch) ; break;
|
||||
|
@ -148,6 +157,9 @@ void DigitizerPHA::SetSetting(Setting::PHA settingName, float value, int ch){
|
|||
|
||||
case Setting::PHA::RiseTimeValidationWindow_ns: input = value / ch2ns; WriteRegister(Register::DPP::PHA::RiseTimeValidationWindow, input, ch); break;
|
||||
|
||||
/// Others
|
||||
//case Setting::PHA::FanSpeedControl_bool: input = value; WriteRegister(Register::DPP::PHA::FanSpeedControl, input); break;
|
||||
|
||||
}
|
||||
|
||||
ErrorMsg("PHA-" + std::to_string(settingName) );
|
||||
|
@ -204,6 +216,15 @@ double DigitizerPHA::GetSetting(Setting::PHA settingName, int ch){
|
|||
case Setting::PHA::PLLClockSource_bool: temp = ReadBits(Register::DPP::AcquisitionControl, 1, 6); value = temp; break;
|
||||
case Setting::PHA::VetoInForTRGOUT_bool: temp = ReadBits(Register::DPP::AcquisitionControl, 1, 12); value = temp; break;
|
||||
|
||||
/// Trigger Validation Mask
|
||||
case Setting::PHA::TriggerValidationMask_8bit: temp = ReadBits(Register::DPP::TriggerValidationMask, 8, 0); value = temp; break;
|
||||
case Setting::PHA::TriggerValidationOperation_2bit: temp = ReadBits(Register::DPP::TriggerValidationMask, 2, 8); value = temp; break;
|
||||
case Setting::PHA::TriggerValidationMajority_3bit: temp = ReadBits(Register::DPP::TriggerValidationMask, 3, 10); value = temp; break;
|
||||
case Setting::PHA::ExternalTrigger_bool: temp = ReadBits(Register::DPP::TriggerValidationMask, 1, 30); value = temp; break;
|
||||
case Setting::PHA::SoftwareTrigger_bool: temp = ReadBits(Register::DPP::TriggerValidationMask, 1, 31); value = temp; break;
|
||||
|
||||
case Setting::PHA::RunStartStopDelay_8bit: temp = ReadRegister(Register::DPP::RunStartStopDelay); value = temp & 0xFF; break;
|
||||
|
||||
/// Registers
|
||||
case Setting::PHA::RecordLength_G_ns: temp = ReadRegister(Register::DPP::RecordLength_G , ch); value = temp * 8 * ch2ns;break;
|
||||
case Setting::PHA::PreTriggerLength_ns: temp = ReadRegister(Register::DPP::PreTrigger , ch); value = temp * 4 * ch2ns;break;
|
||||
|
@ -243,6 +264,9 @@ double DigitizerPHA::GetSetting(Setting::PHA settingName, int ch){
|
|||
case Setting::PHA::EnergyFineGain_16bit: temp = ReadRegister(Register::DPP::PHA::FineGain , ch); value = temp; break;
|
||||
case Setting::PHA::RiseTimeValidationWindow_ns: temp = ReadRegister(Register::DPP::PHA::RiseTimeValidationWindow , ch); value = temp * ch2ns; break;
|
||||
|
||||
/// Others
|
||||
case Setting::PHA::FanSpeedControl_bool: temp = ReadRegister(Register::DPP::FanSpeedControl); value = temp & 0x8; break;
|
||||
|
||||
}
|
||||
|
||||
return value;
|
||||
|
@ -274,44 +298,35 @@ void DigitizerPHA::AutoSetTrapezoidRescalingAndFindGate(double gain, int ch){
|
|||
ErrorMsg("PHA-AutoSetTrapezoidRescalingAndFindGate");
|
||||
}
|
||||
|
||||
|
||||
void DigitizerPHA::PrintBoardConfiguration(){
|
||||
if( !isConnected ) return;
|
||||
printf("\e[33m================================================\n");
|
||||
printf("================ Setting for Board \n");
|
||||
printf("================================================\e[0m\n");
|
||||
uint32_t * value = new uint32_t[1];
|
||||
CAEN_DGTZ_ReadRegister(handle, (uint32_t) Register::BoardConfiguration, value);
|
||||
printf(" 32 28 24 20 16 12 8 4 0\n");
|
||||
printf(" | | | | | | | | |\n");
|
||||
cout <<" Board Configuration : 0b" << bitset<32>(value[0]) << endl;
|
||||
printf(" : 0x%x\n", value[0]);
|
||||
uint32_t value = PrintRegister(Register::DPP::BoardConfiguration, "Board Configuration");
|
||||
|
||||
printf(" Bit[ 0] = %d = Auto Data Flush \n", value[0] & 0x1);
|
||||
printf(" Bit[ 1] = %d = Decimated waveform \n", (value[0] >> 1) & 0x1 );
|
||||
printf(" Bit[ 2] = %d = Trigger propagation \n", (value[0] >> 2) & 0x1 );
|
||||
printf(" Bit[ 3:10] = %d = must be 001 0001 0 = 22 \n", (value[0] >> 3) & 0xFF );
|
||||
printf(" Bit[ 11] = %d = Dual Trace \n", (value[0] >> 11) & 0x1 );
|
||||
printf(" Bit[12:13] = %d = Analog probe 1 : ",((value[0] >> 12) & 0x3 ));
|
||||
switch ( ((value[0] >> 12) & 0x3 ) ){
|
||||
printf(" Bit[ 0] = %d = Auto Data Flush \n", value & 0x1);
|
||||
printf(" Bit[ 1] = %d = Decimated waveform \n", (value >> 1) & 0x1 );
|
||||
printf(" Bit[ 2] = %d = Trigger propagation \n", (value >> 2) & 0x1 );
|
||||
printf(" Bit[ 3:10] = %d = must be 001 0001 0 = 22 \n", (value >> 3) & 0xFF );
|
||||
printf(" Bit[ 11] = %d = Dual Trace \n", (value >> 11) & 0x1 );
|
||||
printf(" Bit[12:13] = %d = Analog probe 1 : ",((value >> 12) & 0x3 ));
|
||||
switch ( ((value >> 12) & 0x3 ) ){
|
||||
case 0 : printf("input\n"); break;
|
||||
case 1 : printf("RC-CR (1st derivative)\n");break;
|
||||
case 2 : printf("RC-CR2 (2nd derivative)\n"); break;
|
||||
case 3 : printf("Trapezoid \n"); break;
|
||||
}
|
||||
printf(" Bit[14:15] = %d = Analog probe 2 : ", ((value[0] >> 14) & 0x3 ));
|
||||
switch ( ((value[0] >> 14) & 0x3 ) ){
|
||||
printf(" Bit[14:15] = %d = Analog probe 2 : ", ((value >> 14) & 0x3 ));
|
||||
switch ( ((value >> 14) & 0x3 ) ){
|
||||
case 0 : printf("input\n"); break;
|
||||
case 1 : printf("Threshold\n"); break;
|
||||
case 2 : printf("Trapezoid - Baseline\n"); break;
|
||||
case 3 : printf("baseline.\n"); break;
|
||||
}
|
||||
printf(" Bit[ 16] = %d = WaveForm Recording \n",((value[0] >> 16) & 0x1 ) );
|
||||
printf(" Bit[ 17] = %d = Extras 2 word enable \n", ((value[0] >> 17) & 0x1 ));
|
||||
printf(" Bit[ 18] = %d = Record Time Stamp \n", ((value[0] >> 18) & 0x1 ));
|
||||
printf(" Bit[ 19] = %d = Record Energy \n", ((value[0] >> 19) & 0x1 ));
|
||||
printf(" Bit[20:23] = %d = Digital Virtual probe 1 : ", ((value[0] >> 20) & 0x7 ));
|
||||
switch (((value[0] >> 20) & 0xF )) {
|
||||
printf(" Bit[ 16] = %d = WaveForm Recording \n",((value >> 16) & 0x1 ) );
|
||||
printf(" Bit[ 17] = %d = Extras 2 word enable \n", ((value >> 17) & 0x1 ));
|
||||
printf(" Bit[ 18] = %d = Record Time Stamp \n", ((value >> 18) & 0x1 ));
|
||||
printf(" Bit[ 19] = %d = Record Energy \n", ((value >> 19) & 0x1 ));
|
||||
printf(" Bit[20:23] = %d = Digital Virtual probe 1 : ", ((value >> 20) & 0x7 ));
|
||||
switch (((value >> 20) & 0xF )) {
|
||||
case 0: printf("Peaking, shows where the energy is calculated; \n"); break;
|
||||
case 1: printf("”Armed”, digital input showing where the RC‐CR2 crosses the Threshold\n"); break;
|
||||
case 2: printf("”Peak Run”, starts with the trigger and last for the whole event\n");break;
|
||||
|
@ -326,14 +341,89 @@ void DigitizerPHA::PrintBoardConfiguration(){
|
|||
case 11: printf("”Ext TRG”, shows the external trigger, when available\n");break;
|
||||
case 12: printf("”Busy”, shows when the memory board is full.\n");break;
|
||||
}
|
||||
printf(" Bit[26:28] = %d = Digital Virtual probe 2 : ", ((value[0] >> 26) & 0x7 ));
|
||||
if( ((value[0] >> 26) & 0x7 ) == 0 ) {
|
||||
printf(" Bit[26:28] = %d = Digital Virtual probe 2 : ", ((value >> 26) & 0x7 ));
|
||||
if( ((value >> 26) & 0x7 ) == 0 ) {
|
||||
printf("Trigger\n");
|
||||
}else{
|
||||
printf("Reserved\n");
|
||||
}
|
||||
}
|
||||
|
||||
void DigitizerPHA::PrintACQControl(){
|
||||
if( !isConnected ) return;
|
||||
|
||||
uint32_t value = PrintRegister(Register::AcquisitionControl, "ACQ COntrol");
|
||||
|
||||
///==== Start Stop Mode
|
||||
printf(" Bit[1:0] = %d = Start/Stop Mode (", value & 0x3);
|
||||
switch (value & 0x3){
|
||||
case 0 : printf("Software controlled)\n"); break;
|
||||
case 1 : printf("S-IN controlled)\n"); break;
|
||||
case 2 : printf("1st trigger controlled)\n"); break;
|
||||
case 3 : printf("LVDS controlled)\n"); break;
|
||||
}
|
||||
|
||||
///==== ACQ Start/Arm
|
||||
printf(" Bit[ 2] = %d = Start/Arm (%s)", value & 0x4, (value & 0x4) == 0 ? "STOP" : "RUN" );
|
||||
printf(" Bit[ 6] = %d = PLL Ref. Clock (%s)", value & 0x40, (value & 0x40) == 0 ? "Internal" : "External" );
|
||||
printf(" Bit[ 8] = %d = LVDS I/O Busy Enable (%s)", value & 0x100, (value & 0x100) == 0 ? "Disabled" : "Enabled" );
|
||||
printf(" Bit[ 8] = %d = LVDS I/O Veto Enable (%s)", value & 0x200, (value & 0x200) == 0 ? "Disabled" : "Enabled" );
|
||||
printf(" Bit[ 12] = %d = Veto-in as veto for TRG-OUT (%s)", value & 0x1000, (value & 0x1000) == 0 ? "not used" : "used" );
|
||||
|
||||
}
|
||||
|
||||
|
||||
void DigitizerPHA::PrintGlobalTriggerMask(){
|
||||
if( !isConnected ) return;
|
||||
uint32_t value = PrintRegister(Register::DPP::GlobalTriggerMask, "Global Trigger Mask");
|
||||
|
||||
printf(" Bit[ 7:0] = 0x%x = Enabled Paired Channel", value & 0xff );
|
||||
printf(" Bit[23:20] = %.0f ns = Majority Coincidence Window", (( value >> 20 ) & 0xf) * 4 * ch2ns );
|
||||
printf(" Bit[26:24] = %d = Majority Level", (( value >> 24 ) & 0x7) );
|
||||
printf(" Bit[ 29] = %d = LVDS Trigger(%s)", (( value >> 29 ) & 0x1), (( value >> 29 ) & 0x1) == 0 ? "disabled" : "enabled" );
|
||||
printf(" Bit[ 30] = %d = External Trigger(%s)", (( value >> 30 ) & 0x1), (( value >> 30 ) & 0x1) == 0 ? "disabled" : "enabled" );
|
||||
printf(" Bit[ 31] = %d = Software Trigger(%s)", (( value >> 31 ) & 0x1), (( value >> 31 ) & 0x1) == 0 ? "disabled" : "enabled" );
|
||||
|
||||
}
|
||||
|
||||
void DigitizerPHA::PrintFrontPanelTRIGOUTEnableMask(){
|
||||
if( !isConnected ) return;
|
||||
uint32_t value = PrintRegister(Register::DPP::FrontPanelTRGOUTEnableMask, "Front Panel TRG-OUT Mask");
|
||||
|
||||
}
|
||||
|
||||
void DigitizerPHA::PrintFrontPanelIOControl(){
|
||||
if( !isConnected ) return;
|
||||
uint32_t value = PrintRegister(Register::DPP::FrontPanelIOControl, "Front Panel I/O Control");
|
||||
|
||||
}
|
||||
|
||||
void DigitizerPHA::PrintTriggerValidationMask(){
|
||||
if( !isConnected ) return;
|
||||
uint32_t value = PrintRegister(Register::DPP::TriggerValidationMask, "Trigger Validation Mask");
|
||||
|
||||
}
|
||||
|
||||
void DigitizerPHA::PrintBoardInfoRegister(){
|
||||
if( !isConnected ) return;
|
||||
uint32_t value = PrintRegister(Register::DPP::BoardInfo, "Board Info");
|
||||
}
|
||||
|
||||
void DigitizerPHA::PrintBoardFailureState(){
|
||||
if( !isConnected ) return;
|
||||
uint32_t value = PrintRegister(Register::DPP::BoardFailureStatus, "Board Failure State");
|
||||
}
|
||||
|
||||
void DigitizerPHA::PrintReadoutControl(){
|
||||
if( !isConnected ) return;
|
||||
uint32_t value = PrintRegister(Register::DPP::ReadoutControl, "Readout Control");
|
||||
}
|
||||
|
||||
void DigitizerPHA::PrintReadoutStatu(){
|
||||
if( !isConnected ) return;
|
||||
uint32_t value = PrintRegister(Register::DPP::ReadoutStatus, "Readout Status");
|
||||
}
|
||||
|
||||
void DigitizerPHA::PrintChannelSettingFromDigitizer(int ch){
|
||||
if( !isConnected ) return;
|
||||
printf("\e[33m================================================\n");
|
||||
|
|
|
@ -77,10 +77,17 @@ class DigitizerPHA : public Digitizer {
|
|||
|
||||
unsigned int GetTriggerThreshold(unsigned int ch) {return ReadRegister(Register::DPP::PHA::TriggerThreshold, ch);}
|
||||
|
||||
|
||||
|
||||
void PrintBoardConfiguration();
|
||||
void PrintChannelSettingFromDigitizer(int ch);
|
||||
void PrintACQControl();
|
||||
void PrintGlobalTriggerMask();
|
||||
void PrintFrontPanelTRIGOUTEnableMask();
|
||||
void PrintFrontPanelIOControl();
|
||||
void PrintTriggerValidationMask();
|
||||
void PrintBoardInfoRegister();
|
||||
void PrintBoardFailureState();
|
||||
void PrintReadoutControl();
|
||||
void PrintReadoutStatu();
|
||||
void PrintChannelSettingFromDigitizer(int ch); ///inlcluded DPP Algorithm Control 1, 2
|
||||
|
||||
};
|
||||
|
||||
|
|
52
FSUDAQ.cpp
52
FSUDAQ.cpp
|
@ -69,6 +69,10 @@ MainWindow::MainWindow(const TGWindow *p,UInt_t w,UInt_t h) {
|
|||
fMenuDigitizers->Connect("Activated(Int_t)", "MainWindow", this, "HandleMenu(Int_t)");
|
||||
fMenuBar->AddPopup("&Digitizers", fMenuDigitizers, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
|
||||
|
||||
fMenuDigitizers->DisableEntry( M_TRIGGER_SUMMARY);
|
||||
fMenuDigitizers->DisableEntry( M_BOARD_SETTINGS);
|
||||
fMenuDigitizers->DisableEntry( M_CH_SETTING);
|
||||
|
||||
fMenuUtility = new TGPopupMenu(gClient->GetRoot());
|
||||
fMenuUtility->AddEntry("Plot Channels Rate", M_SHOW_CHANNELS_RATE);
|
||||
fMenuDigitizers->AddSeparator();
|
||||
|
@ -130,9 +134,9 @@ MainWindow::MainWindow(const TGWindow *p,UInt_t w,UInt_t h) {
|
|||
|
||||
LogMsg("Ready to run.");
|
||||
|
||||
HandleMenu(M_DIGITIZER_SCAN);
|
||||
|
||||
HandleMenu(M_BOARD_SETTINGS);
|
||||
//HandleMenu(M_DIGITIZER_SCAN);
|
||||
//
|
||||
//HandleMenu(M_BOARD_SETTINGS);
|
||||
//HandleMenu(M_CH_SETTING);
|
||||
|
||||
}
|
||||
|
@ -170,7 +174,7 @@ void MainWindow::HandleMenu(Int_t id){
|
|||
///========================= Scan digitizers
|
||||
case M_DIGITIZER_SCAN:{
|
||||
|
||||
printf("============= detect digitizers \n");
|
||||
LogMsg("============= detect digitizers \n");
|
||||
DetectDigitizer();
|
||||
printf("============= Connect %d digitizers...\n", nDigi);
|
||||
|
||||
|
@ -197,6 +201,11 @@ void MainWindow::HandleMenu(Int_t id){
|
|||
printf("Open as Ordinary Digitizer\n");
|
||||
}
|
||||
}
|
||||
|
||||
//fMenuDigitizers->EnableEntry( M_TRIGGER_SUMMARY);
|
||||
fMenuDigitizers->EnableEntry( M_BOARD_SETTINGS);
|
||||
fMenuDigitizers->EnableEntry( M_CH_SETTING);
|
||||
|
||||
}
|
||||
|
||||
}break;
|
||||
|
@ -215,27 +224,16 @@ void MainWindow::HandleMenu(Int_t id){
|
|||
|
||||
}break;
|
||||
|
||||
case M_CH_SETTING:{
|
||||
if( channelSetting == NULL ) {
|
||||
///========================= Channel setting
|
||||
case M_CH_SETTING:
|
||||
channelSetting = new ChannelSetting(gClient->GetRoot(), 600, 600, digi, nDigi);
|
||||
}else{
|
||||
//if( !channelSetting->isOpened ) {
|
||||
channelSetting = new ChannelSetting(gClient->GetRoot(), 600, 600, digi, nDigi);
|
||||
//}
|
||||
}
|
||||
}break;
|
||||
break;
|
||||
|
||||
///========================= Board setting
|
||||
case M_BOARD_SETTINGS:{
|
||||
if( boardSetting == NULL ) {
|
||||
case M_BOARD_SETTINGS:
|
||||
boardSetting = new BoardSetting(gClient->GetRoot(), 600, 600, digi, nDigi);
|
||||
}else{
|
||||
//if( !boardSetting->isOpened ) {
|
||||
boardSetting = new BoardSetting(gClient->GetRoot(), 600, 600, digi, nDigi);
|
||||
//}
|
||||
}
|
||||
break;
|
||||
|
||||
}break;
|
||||
///========================= Program setting
|
||||
case M_PROGRAM_SETTINGS:{
|
||||
LogMsg("[Program settings] Not impelmented");
|
||||
|
@ -283,12 +281,12 @@ void MainWindow::DetectDigitizer(){
|
|||
}
|
||||
}
|
||||
|
||||
printf("========== found %d digitizer \n", nDigi);
|
||||
LogMsg(Form("========== found %d digitizer \n", nDigi));
|
||||
for( int i = 0 ; i < nDigi ; i++){
|
||||
printf("port: %d, board: %d, DPP Type : %d \n", portID[i], boardID[i], DPPType[i]);
|
||||
LogMsg(Form("port: %d, board: %d, DPP Type : %d \n", portID[i], boardID[i], DPPType[i]));
|
||||
}
|
||||
printf("Number of PHA : %d \n", nPHA);
|
||||
printf("Number of PSD : %d \n", nPSD);
|
||||
LogMsg(Form("Number of PHA : %d \n", nPHA));
|
||||
LogMsg(Form("Number of PSD : %d \n", nPSD));
|
||||
|
||||
}
|
||||
|
||||
|
@ -328,9 +326,13 @@ void MainWindow::LogMsg(TString msg){
|
|||
int minute = ltm->tm_min;
|
||||
int secound = ltm->tm_sec;
|
||||
|
||||
teLog->AddLine(Form("[%4d-%02d-%02d %02d:%02d:%02d] ", year, month, day, hour, minute, secound) + msg);
|
||||
TString outMsg = Form("[%4d-%02d-%02d %02d:%02d:%02d] ", year, month, day, hour, minute, secound) + msg;
|
||||
|
||||
teLog->AddLine(outMsg);
|
||||
printf("%s", outMsg.Data());
|
||||
teLog->LineDown();
|
||||
teLog->ShowBottom();
|
||||
|
||||
}
|
||||
|
||||
//############################################
|
||||
|
|
|
@ -226,12 +226,21 @@ namespace Setting{
|
|||
TagCorrelatedEvents_bool,
|
||||
BaselineRestoreOptimization_bool,
|
||||
|
||||
///ACQ control
|
||||
/// ACQ control
|
||||
StartStopMode_2bit,
|
||||
StartStopACQ_bool,
|
||||
PLLClockSource_bool,
|
||||
VetoInForTRGOUT_bool,
|
||||
|
||||
/// Trigger Validation Mask
|
||||
TriggerValidationMask_8bit,
|
||||
TriggerValidationOperation_2bit,
|
||||
TriggerValidationMajority_3bit,
|
||||
ExternalTrigger_bool,
|
||||
SoftwareTrigger_bool,
|
||||
|
||||
RunStartStopDelay_8bit,
|
||||
|
||||
/// Registers
|
||||
RecordLength_G_ns,
|
||||
PreTriggerLength_ns,
|
||||
|
@ -254,7 +263,10 @@ namespace Setting{
|
|||
PeakingTime_ns,
|
||||
PeakingHoldOff_ns,
|
||||
EnergyFineGain_16bit,
|
||||
RiseTimeValidationWindow_ns
|
||||
RiseTimeValidationWindow_ns,
|
||||
|
||||
/// Others
|
||||
FanSpeedControl_bool
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -180,7 +180,7 @@ BoardSetting::BoardSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer ** d
|
|||
cbAggOrg->Select(0);
|
||||
cbAggOrg->Connect("Changed()", "BoardSetting", this, "SetAggregateOrganization()");
|
||||
|
||||
TGLabel * lbAggBLT = new TGLabel(hframeBdCfg3, "Aggregate pre Readout"); hframeBdCfg3->AddFrame(lbAggBLT, layoutHints);
|
||||
TGLabel * lbAggBLT = new TGLabel(hframeBdCfg3, "MAx. Aggregate pre Readout"); hframeBdCfg3->AddFrame(lbAggBLT, layoutHints);
|
||||
numAggBLT = new TGNumberEntry(hframeBdCfg3, 0, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); hframeBdCfg3->AddFrame(numAggBLT, layoutHints);
|
||||
numAggBLT->SetWidth(60);
|
||||
numAggBLT->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 0x3FF);
|
||||
|
@ -225,14 +225,14 @@ BoardSetting::BoardSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer ** d
|
|||
|
||||
TGHorizontalFrame * hfAcqCtrl2 = new TGHorizontalFrame(vAcqCtrl); vAcqCtrl->AddFrame(hfAcqCtrl2, layoutHints);
|
||||
|
||||
TGCheckButton * bSWTrigger = new TGCheckButton(hfAcqCtrl2, "Software Trigger", 1); hfAcqCtrl2->AddFrame(bSWTrigger, layoutHints);
|
||||
bSWTrigger->SetState(kButtonUp);
|
||||
bSWTrigger = new TGTextButton(hfAcqCtrl2, "Send Software Trigger"); hfAcqCtrl2->AddFrame(bSWTrigger, layoutHints);
|
||||
//bSWTrigger->Connect("Clicked()", "BoardSetting", this, "SetAutoDataFlush()");
|
||||
|
||||
TGCheckButton * bSWClockSync = new TGCheckButton(hfAcqCtrl2, "Software Clock Sync", 1); hfAcqCtrl2->AddFrame(bSWClockSync, layoutHints);
|
||||
bSWClockSync->SetState(kButtonUp);
|
||||
bSWClockSync = new TGTextButton(hfAcqCtrl2, "Send Software Clock Sync"); hfAcqCtrl2->AddFrame(bSWClockSync, layoutHints);
|
||||
//bSWClockSync->Connect("Clicked()", "BoardSetting", this, "SetAutoDataFlush()");
|
||||
|
||||
TGLabel * lbRunStartStopDelay = new TGLabel(hfAcqCtrl2, "Run/Start/Stop Delay [ns]"); hfAcqCtrl2->AddFrame(lbRunStartStopDelay, layoutHints);
|
||||
TGNumberEntry * numRunStartStopDelay = new TGNumberEntry(hfAcqCtrl2, 0, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); hfAcqCtrl2->AddFrame(numRunStartStopDelay, layoutHints);
|
||||
numRunStartStopDelay = new TGNumberEntry(hfAcqCtrl2, 0, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); hfAcqCtrl2->AddFrame(numRunStartStopDelay, layoutHints);
|
||||
numRunStartStopDelay->SetWidth(60);
|
||||
numRunStartStopDelay->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 0x0FF);
|
||||
|
||||
|
@ -658,9 +658,42 @@ void BoardSetting::ChangeBoard(){
|
|||
bExtrac2->SetState( pha->GetSetting(Setting::PHA::EnableExtra2Word_board_bool) == 1.0? kButtonDown : kButtonUp);
|
||||
bDualTrace->SetState( pha->GetSetting(Setting::PHA::DualTrace_board_bool) == 1.0? kButtonDown : kButtonUp);
|
||||
|
||||
cbAP1->Select( pha->GetSetting(Setting::PHA::AnalogProbe1_board_2bit) );
|
||||
cbAP2->Select( pha->GetSetting(Setting::PHA::AnalogProbe2_board_2bit) );
|
||||
cbDP->Select( pha->GetSetting(Setting::PHA::VirtualProbe_board_4bit) );
|
||||
|
||||
cbAggOrg->Select( pha->GetSetting(Setting::PHA::AggregateOrganization_board_3bit) );
|
||||
numAggBLT->SetNumber( pha->GetSetting(Setting::PHA::MaxAggregatePreBlockTransfer_board_10bit) );
|
||||
|
||||
cbFanCtrl->Select( pha->GetSetting(Setting::PHA::FanSpeedControl_bool) );
|
||||
|
||||
pha->PrintACQControl();
|
||||
|
||||
cbAcqMode->Select( pha->GetSetting(Setting::PHA::StartStopMode_2bit));
|
||||
bAcqArm->SetState( pha->GetSetting(Setting::PHA::StartStopACQ_bool) == 1.0 ? kButtonDown : kButtonUp);
|
||||
cbPLLref->Select( pha->GetSetting(Setting::PHA::PLLClockSource_bool));
|
||||
|
||||
numRunStartStopDelay->SetNumber( pha->GetSetting(Setting::PHA::RunStartStopDelay_8bit));
|
||||
|
||||
/// Global Trigger Mask
|
||||
|
||||
|
||||
|
||||
|
||||
pha = NULL; ///unlink the pointer
|
||||
}else if( digi[boardID]->GetDPPType() == V1730_DPP_PSD_CODE ) {
|
||||
|
||||
|
||||
}else{ ///========== disable all others
|
||||
bAutoDataFlush->SetEditable(false);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ class BoardSetting{
|
|||
int nDigi;
|
||||
Digitizer ** digi;
|
||||
DigitizerPHA * pha;
|
||||
DigitizerPSD * psd;
|
||||
|
||||
/// board failure status
|
||||
TGTextEntry * enPLLStatus;
|
||||
|
@ -52,6 +53,10 @@ class BoardSetting{
|
|||
TGCheckButton * bAcqArm;
|
||||
TGComboBox * cbPLLref;
|
||||
|
||||
TGTextButton * bSWTrigger;
|
||||
TGTextButton * bSWClockSync;
|
||||
TGNumberEntry * numRunStartStopDelay;
|
||||
|
||||
/// Trigger control
|
||||
TGCheckButton * cbGbTRGMskCh[8];
|
||||
TGCheckButton * cbTRGValMskCh[8];
|
||||
|
|
Loading…
Reference in New Issue
Block a user