2022-08-23 13:43:05 -04:00
# include <TApplication.h>
# include <TGClient.h>
# include <TCanvas.h>
# include <TF1.h>
# include <TRandom.h>
# include <TRootEmbeddedCanvas.h>
# include <TGTableContainer.h>
# include <TGFileDialog.h>
2022-08-24 17:50:21 -04:00
2022-08-23 13:43:05 -04:00
# include "boardSetting.h"
2022-08-24 17:50:21 -04:00
TString boardSettingName [ NUM_BOARD_INFO ] = { " Model " ,
2022-09-16 17:53:57 -04:00
" DPP Type " ,
" Link Type " ,
" Serial Number " ,
" Number of channels " ,
" Sampling rate " ,
" ADC bit " ,
" ROC version " ,
" AMC version "
} ;
2022-09-20 15:15:52 -04:00
2022-08-23 13:43:05 -04:00
BoardSetting : : BoardSetting ( const TGWindow * p , UInt_t w , UInt_t h , Digitizer * * digi , int nBoard ) {
2022-09-16 17:53:57 -04:00
this - > nDigi = nBoard ;
2022-08-23 13:43:05 -04:00
this - > digi = digi ;
2022-09-16 17:53:57 -04:00
gClient - > GetColorByName ( " red " , red ) ;
gClient - > GetColorByName ( " blue " , blue ) ;
2022-08-23 13:43:05 -04:00
fMain = new TGMainFrame ( p , w , h ) ;
2022-09-20 15:15:52 -04:00
fMain - > SetWindowName ( " Board Settings & Status " ) ;
2022-08-23 13:43:05 -04:00
fMain - > Connect ( " CloseWindow() " , " BoardSetting " , this , " CloseWindow() " ) ;
2022-08-25 15:27:27 -04:00
TGLayoutHints * layoutHints = new TGLayoutHints ( kLHintsCenterX | kLHintsCenterY , 5 , 5 , 3 , 3 ) ; /// left, right, top, bottom
TGVerticalFrame * vframe = new TGVerticalFrame ( fMain ) ; fMain - > AddFrame ( vframe , layoutHints ) ;
2022-08-23 13:43:05 -04:00
///==========Module choose
2022-08-25 15:27:27 -04:00
TGHorizontalFrame * hframe0 = new TGHorizontalFrame ( vframe , w , 50 ) ; vframe - > AddFrame ( hframe0 , layoutHints ) ;
2022-08-24 17:50:21 -04:00
2022-08-25 15:27:27 -04:00
TGLabel * lb0 = new TGLabel ( hframe0 , " Board ID : " ) ; hframe0 - > AddFrame ( lb0 , layoutHints ) ;
2022-09-16 17:53:57 -04:00
boardIDEntry = new TGNumberEntry ( hframe0 , 0 , 0 , 0 , TGNumberFormat : : kNESInteger , TGNumberFormat : : kNEANonNegative ) ; hframe0 - > AddFrame ( boardIDEntry , new TGLayoutHints ( kLHintsCenterX , 5 , 5 , 3 , 4 ) ) ;
2022-08-23 13:43:05 -04:00
boardIDEntry - > SetWidth ( 50 ) ;
2022-09-16 17:53:57 -04:00
boardIDEntry - > SetLimits ( TGNumberFormat : : kNELLimitMinMax , 0 , nBoard - 1 ) ;
2022-08-23 13:43:05 -04:00
boardIDEntry - > Connect ( " Modified() " , " BoardSetting " , this , " ChangeBoard() " ) ;
if ( nBoard < = 1 ) boardIDEntry - > SetState ( false ) ;
2022-08-24 17:50:21 -04:00
int boardID = boardIDEntry - > GetNumber ( ) ;
2022-08-23 13:43:05 -04:00
2022-09-20 15:15:52 -04:00
/// Board Failure status
2022-09-16 17:53:57 -04:00
TGLabel * lbPLLStatus = new TGLabel ( hframe0 , " PLL status : " ) ; hframe0 - > AddFrame ( lbPLLStatus , layoutHints ) ;
enPLLStatus = new TGTextEntry ( hframe0 , " " ) ; hframe0 - > AddFrame ( enPLLStatus , layoutHints ) ;
enPLLStatus - > SetEnabled ( false ) ;
enPLLStatus - > Resize ( 50 , 20 ) ;
TGLabel * lbTempStatus = new TGLabel ( hframe0 , " Temp status : " ) ; hframe0 - > AddFrame ( lbTempStatus , layoutHints ) ;
enTempStatus = new TGTextEntry ( hframe0 , " " ) ; hframe0 - > AddFrame ( enTempStatus , layoutHints ) ;
enTempStatus - > SetEnabled ( false ) ;
enTempStatus - > Resize ( 50 , 20 ) ;
TGLabel * lbADCPwrStatus = new TGLabel ( hframe0 , " ADC Power : " ) ; hframe0 - > AddFrame ( lbADCPwrStatus , layoutHints ) ;
enADCPwrStatus = new TGTextEntry ( hframe0 , " " ) ; hframe0 - > AddFrame ( enADCPwrStatus , layoutHints ) ;
enADCPwrStatus - > SetEnabled ( false ) ;
enADCPwrStatus - > Resize ( 50 , 20 ) ;
2022-09-21 16:05:51 -04:00
TGTextButton * bSoftwareReset = new TGTextButton ( hframe0 , " Reset Settings to default " ) ; hframe0 - > AddFrame ( bSoftwareReset , layoutHints ) ;
bSoftwareReset - > Connect ( " Clicked() " , " BoardSetting " , this , " ResetSettingToDefault() " ) ;
2022-09-16 17:53:57 -04:00
TGTextButton * bSoftwareClear = new TGTextButton ( hframe0 , " Clear Buffer " ) ; hframe0 - > AddFrame ( bSoftwareClear , layoutHints ) ;
2022-09-21 16:05:51 -04:00
bSoftwareClear - > Connect ( " Clicked() " , " BoardSetting " , this , " ClearBuffer() " ) ;
2022-08-23 13:43:05 -04:00
2022-09-20 15:15:52 -04:00
{ ///============ fixed info
TGHorizontalFrame * hframeInfo = new TGHorizontalFrame ( vframe ) ; vframe - > AddFrame ( hframeInfo , new TGLayoutHints ( kLHintsExpandX ) ) ;
2022-08-24 17:50:21 -04:00
2022-09-20 15:15:52 -04:00
int numCol = 3 ;
TGVerticalFrame * vframeInfo [ numCol ] ;
for ( int i = 0 ; i < numCol ; i + + ) {
vframeInfo [ i ] = new TGVerticalFrame ( hframeInfo ) ; hframeInfo - > AddFrame ( vframeInfo [ i ] , new TGLayoutHints ( kLHintsExpandX ) ) ;
}
TGHorizontalFrame * hframe [ NUM_BOARD_INFO ] ;
TGLabel * lb [ NUM_BOARD_INFO ] ;
for ( int i = 0 ; i < NUM_BOARD_INFO ; i + + ) {
hframe [ i ] = new TGHorizontalFrame ( vframeInfo [ i % 3 ] , 50 , 50 ) ; vframeInfo [ i % 3 ] - > AddFrame ( hframe [ i ] , new TGLayoutHints ( kLHintsRight , 2 , 2 , 0 , 0 ) ) ;
lb [ i ] = new TGLabel ( hframe [ i ] , boardSettingName [ i ] ) ; hframe [ i ] - > AddFrame ( lb [ i ] , new TGLayoutHints ( kLHintsLeft | kLHintsCenterY , 5 , 5 , 0 , 0 ) ) ;
entry [ i ] = new TGTextEntry ( hframe [ i ] , new TGTextBuffer ( 1 ) ) ; hframe [ i ] - > AddFrame ( entry [ i ] , new TGLayoutHints ( kLHintsRight , 5 , 5 , 0 , 0 ) ) ;
entry [ i ] - > SetEnabled ( false ) ;
}
2022-08-24 17:50:21 -04:00
}
2022-09-23 17:43:30 -04:00
TGHorizontalFrame * hRow3 = new TGHorizontalFrame ( vframe ) ; vframe - > AddFrame ( hRow3 , new TGLayoutHints ( kLHintsExpandX ) ) ;
2022-09-20 15:15:52 -04:00
{ ///========= ACD Status
2022-09-23 17:43:30 -04:00
TGGroupFrame * gAcqStatus = new TGGroupFrame ( hRow3 , " ACQ Status " , kHorizontalFrame ) ; hRow3 - > AddFrame ( gAcqStatus , new TGLayoutHints ( kLHintsExpandX , 5 , 5 , 0 , 0 ) ) ;
2022-09-21 16:05:51 -04:00
TGHorizontalFrame * hfAcqStatus = new TGHorizontalFrame ( gAcqStatus ) ; gAcqStatus - > AddFrame ( hfAcqStatus , new TGLayoutHints ( kLHintsExpandX ) ) ;
2022-09-20 15:15:52 -04:00
TGVerticalFrame * vAcqStatus1 = new TGVerticalFrame ( hfAcqStatus ) ; hfAcqStatus - > AddFrame ( vAcqStatus1 ) ;
2022-08-23 13:43:05 -04:00
2022-09-20 15:15:52 -04:00
txtACQStatus = new TGTextEntry ( vAcqStatus1 , new TGTextBuffer ( 1 ) ) ; vAcqStatus1 - > AddFrame ( txtACQStatus , new TGLayoutHints ( kLHintsRight , 5 , 5 , 0 , 0 ) ) ;
txtACQStatus - > SetEnabled ( false ) ;
txtACQStatus - > SetText ( " ACQ is stopped " ) ;
txtACQEventReady = new TGTextEntry ( vAcqStatus1 , new TGTextBuffer ( 1 ) ) ; vAcqStatus1 - > AddFrame ( txtACQEventReady , new TGLayoutHints ( kLHintsRight , 5 , 5 , 0 , 0 ) ) ;
txtACQEventReady - > SetEnabled ( false ) ;
txtACQEventReady - > SetText ( " no Event " ) ;
txtACQEventFull = new TGTextEntry ( vAcqStatus1 , new TGTextBuffer ( 1 ) ) ; vAcqStatus1 - > AddFrame ( txtACQEventFull , new TGLayoutHints ( kLHintsRight , 5 , 5 , 0 , 0 ) ) ;
txtACQEventFull - > SetEnabled ( false ) ;
txtACQEventFull - > SetText ( " no channel FULL " ) ;
2022-08-25 15:27:27 -04:00
2022-09-21 16:05:51 -04:00
txtACQClockSource = new TGTextEntry ( vAcqStatus1 , new TGTextBuffer ( 1 ) ) ; vAcqStatus1 - > AddFrame ( txtACQClockSource , new TGLayoutHints ( kLHintsRight , 5 , 5 , 0 , 0 ) ) ;
2022-09-20 15:15:52 -04:00
txtACQClockSource - > SetEnabled ( false ) ;
txtACQClockSource - > SetText ( " Internal Clock " ) ;
2022-09-21 16:05:51 -04:00
TGVerticalFrame * vAcqStatus2 = new TGVerticalFrame ( hfAcqStatus ) ; hfAcqStatus - > AddFrame ( vAcqStatus2 ) ;
2022-09-20 15:15:52 -04:00
txtACQPLLLock = new TGTextEntry ( vAcqStatus2 , new TGTextBuffer ( 1 ) ) ; vAcqStatus2 - > AddFrame ( txtACQPLLLock , new TGLayoutHints ( kLHintsRight , 5 , 5 , 0 , 0 ) ) ;
txtACQPLLLock - > SetEnabled ( false ) ;
txtACQPLLLock - > SetText ( " PLL unlock " ) ;
2022-09-21 16:05:51 -04:00
2022-09-20 15:15:52 -04:00
txtACQChDown = new TGTextEntry ( vAcqStatus2 , new TGTextBuffer ( 1 ) ) ; vAcqStatus2 - > AddFrame ( txtACQChDown , new TGLayoutHints ( kLHintsRight , 5 , 5 , 0 , 0 ) ) ;
txtACQChDown - > SetEnabled ( false ) ;
txtACQChDown - > SetText ( " Channels are ON " ) ;
2022-09-21 16:05:51 -04:00
txtACQSIN = new TGTextEntry ( vAcqStatus2 , new TGTextBuffer ( 1 ) ) ; vAcqStatus2 - > AddFrame ( txtACQSIN , new TGLayoutHints ( kLHintsRight , 5 , 5 , 0 , 0 ) ) ;
2022-09-20 15:15:52 -04:00
txtACQSIN - > SetEnabled ( false ) ;
txtACQSIN - > SetText ( " S-IN = 0 " ) ;
2022-09-21 16:05:51 -04:00
txtACQTRIGIN = new TGTextEntry ( vAcqStatus2 , new TGTextBuffer ( 1 ) ) ; vAcqStatus2 - > AddFrame ( txtACQTRIGIN , new TGLayoutHints ( kLHintsRight , 5 , 5 , 0 , 0 ) ) ;
2022-09-20 15:15:52 -04:00
txtACQTRIGIN - > SetEnabled ( false ) ;
txtACQTRIGIN - > SetText ( " TRG-IN = 0 " ) ;
TGVerticalFrame * vAcqStatus4 = new TGVerticalFrame ( hfAcqStatus ) ; hfAcqStatus - > AddFrame ( vAcqStatus4 ) ;
txtACQBoardReady = new TGTextEntry ( vAcqStatus4 , new TGTextBuffer ( 1 ) ) ; vAcqStatus4 - > AddFrame ( txtACQBoardReady , new TGLayoutHints ( kLHintsLeft , 5 , 5 , 0 , 0 ) ) ;
txtACQBoardReady - > SetEnabled ( false ) ;
txtACQBoardReady - > SetText ( " Board NOT Ready (PLL & ADCs are NOT sync) " ) ;
txtACQBoardReady - > Resize ( 280 , 20 ) ;
TGHorizontalFrame * hfAcqTemp = new TGHorizontalFrame ( vAcqStatus4 ) ; vAcqStatus4 - > AddFrame ( hfAcqTemp , new TGLayoutHints ( kLHintsExpandY , 5 , 5 , 3 , 0 ) ) ;
TGVerticalFrame * vAcqTemp1 = new TGVerticalFrame ( hfAcqTemp ) ; hfAcqTemp - > AddFrame ( vAcqTemp1 ) ;
TGLabel * lbdummy0 = new TGLabel ( vAcqTemp1 , " ch : " ) ; vAcqTemp1 - > AddFrame ( lbdummy0 , new TGLayoutHints ( kLHintsLeft | kLHintsCenterY , 5 , 5 , 0 , 2 ) ) ;
lbdummy0 - > Resize ( 60 , 20 ) ;
TGLabel * lbACQTemp = new TGLabel ( vAcqTemp1 , " Temp. Stat.: " ) ; vAcqTemp1 - > AddFrame ( lbACQTemp , new TGLayoutHints ( kLHintsLeft | kLHintsCenterY , 5 , 5 , 2 , 2 ) ) ;
lbACQTemp - > Resize ( 60 , 20 ) ;
TGVerticalFrame * vAcqTemp2 = new TGVerticalFrame ( hfAcqTemp ) ; hfAcqTemp - > AddFrame ( vAcqTemp2 ) ;
TGLabel * lbch0 = new TGLabel ( vAcqTemp2 , " 0-3 " ) ; vAcqTemp2 - > AddFrame ( lbch0 , new TGLayoutHints ( kLHintsLeft | kLHintsCenterY , 5 , 5 , 0 , 0 ) ) ;
lbch0 - > Resize ( 40 , 20 ) ;
txtACQTemp0 = new TGTextEntry ( vAcqTemp2 , new TGTextBuffer ( 1 ) ) ; vAcqTemp2 - > AddFrame ( txtACQTemp0 , new TGLayoutHints ( kLHintsRight , 5 , 5 , 0 , 0 ) ) ;
txtACQTemp0 - > SetEnabled ( false ) ;
txtACQTemp0 - > SetText ( " <70 " ) ;
txtACQTemp0 - > Resize ( 40 , 20 ) ;
TGVerticalFrame * vAcqTemp3 = new TGVerticalFrame ( hfAcqTemp ) ; hfAcqTemp - > AddFrame ( vAcqTemp3 ) ;
TGLabel * lbch1 = new TGLabel ( vAcqTemp3 , " 4-7 " ) ; vAcqTemp3 - > AddFrame ( lbch1 , new TGLayoutHints ( kLHintsLeft | kLHintsCenterY , 5 , 5 , 0 , 0 ) ) ;
lbch1 - > Resize ( 40 , 20 ) ;
txtACQTemp1 = new TGTextEntry ( vAcqTemp3 , new TGTextBuffer ( 1 ) ) ; vAcqTemp3 - > AddFrame ( txtACQTemp1 , new TGLayoutHints ( kLHintsRight , 5 , 5 , 0 , 0 ) ) ;
txtACQTemp1 - > SetEnabled ( false ) ;
txtACQTemp1 - > SetText ( " <70 " ) ;
txtACQTemp1 - > Resize ( 40 , 20 ) ;
TGVerticalFrame * vAcqTemp4 = new TGVerticalFrame ( hfAcqTemp ) ; hfAcqTemp - > AddFrame ( vAcqTemp4 ) ;
TGLabel * lbch2 = new TGLabel ( vAcqTemp4 , " 8-11 " ) ; vAcqTemp4 - > AddFrame ( lbch2 , new TGLayoutHints ( kLHintsLeft | kLHintsCenterY , 5 , 5 , 0 , 0 ) ) ;
lbch2 - > Resize ( 40 , 20 ) ;
txtACQTemp2 = new TGTextEntry ( vAcqTemp4 , new TGTextBuffer ( 1 ) ) ; vAcqTemp4 - > AddFrame ( txtACQTemp2 , new TGLayoutHints ( kLHintsRight , 5 , 5 , 0 , 0 ) ) ;
txtACQTemp2 - > SetEnabled ( false ) ;
txtACQTemp2 - > SetText ( " <70 " ) ;
txtACQTemp2 - > Resize ( 40 , 20 ) ;
TGVerticalFrame * vAcqTemp5 = new TGVerticalFrame ( hfAcqTemp ) ; hfAcqTemp - > AddFrame ( vAcqTemp5 ) ;
TGLabel * lbch3 = new TGLabel ( vAcqTemp5 , " 12-15 " ) ; vAcqTemp5 - > AddFrame ( lbch3 , new TGLayoutHints ( kLHintsLeft | kLHintsCenterY , 5 , 5 , 0 , 0 ) ) ;
lbch3 - > Resize ( 40 , 20 ) ;
txtACQTemp3 = new TGTextEntry ( vAcqTemp5 , new TGTextBuffer ( 1 ) ) ; vAcqTemp5 - > AddFrame ( txtACQTemp3 , new TGLayoutHints ( kLHintsRight , 5 , 5 , 0 , 0 ) ) ;
txtACQTemp3 - > SetEnabled ( false ) ;
txtACQTemp3 - > SetText ( " <70 " ) ;
txtACQTemp3 - > Resize ( 40 , 20 ) ;
2022-09-21 16:05:51 -04:00
}
{ ///==========="Readout Status"
2022-09-23 17:43:30 -04:00
TGGroupFrame * gReadoutStatus = new TGGroupFrame ( hRow3 , " Readout Status " , kHorizontalFrame ) ; hRow3 - > AddFrame ( gReadoutStatus , new TGLayoutHints ( kLHintsExpandY , 0 , 0 , 0 , 0 ) ) ;
2022-09-21 16:05:51 -04:00
TGVerticalFrame * vReadoutStatus = new TGVerticalFrame ( gReadoutStatus ) ; gReadoutStatus - > AddFrame ( vReadoutStatus , new TGLayoutHints ( kLHintsCenterY | kLHintsExpandY , 5 , 5 , 10 , 0 ) ) ;
txtEventReady = new TGTextEntry ( vReadoutStatus , new TGTextBuffer ( 1 ) ) ; vReadoutStatus - > AddFrame ( txtEventReady , new TGLayoutHints ( kLHintsRight , 5 , 5 , 0 , 0 ) ) ;
txtEventReady - > SetEnabled ( false ) ;
txtEventReady - > SetText ( " Event Ready " ) ;
2022-09-27 17:58:14 -04:00
txtEventReady - > Resize ( 150 , 20 ) ;
2022-09-21 16:05:51 -04:00
txtEventReady - > SetTextColor ( blue ) ;
txtBusError = new TGTextEntry ( vReadoutStatus , new TGTextBuffer ( 1 ) ) ; vReadoutStatus - > AddFrame ( txtBusError , new TGLayoutHints ( kLHintsRight , 5 , 5 , 0 , 0 ) ) ;
txtBusError - > SetEnabled ( false ) ;
txtBusError - > SetText ( " no Bus Error " ) ;
2022-09-27 17:58:14 -04:00
txtBusError - > Resize ( 150 , 20 ) ;
2022-09-21 16:05:51 -04:00
txtBusError - > SetTextColor ( blue ) ;
txtVMEFIFO = new TGTextEntry ( vReadoutStatus , new TGTextBuffer ( 1 ) ) ; vReadoutStatus - > AddFrame ( txtVMEFIFO , new TGLayoutHints ( kLHintsRight , 5 , 5 , 0 , 0 ) ) ;
txtVMEFIFO - > SetEnabled ( false ) ;
txtVMEFIFO - > SetText ( " VME FIFO EMPTY " ) ;
2022-09-27 17:58:14 -04:00
txtVMEFIFO - > Resize ( 150 , 20 ) ;
2022-09-21 16:05:51 -04:00
txtVMEFIFO - > SetTextColor ( blue ) ;
}
2022-09-23 17:43:30 -04:00
TGHorizontalFrame * hRow0 = new TGHorizontalFrame ( vframe ) ; vframe - > AddFrame ( hRow0 , new TGLayoutHints ( kLHintsExpandX ) ) ;
//hRow0->ChangeOptions((hRow0->GetOptions() | kFixedHeight));
//hRow0->
2022-09-27 17:58:14 -04:00
TGTextButton * bProgramDefaultBoard = new TGTextButton ( hRow0 , " Program Default Board " ) ; hRow0 - > AddFrame ( bProgramDefaultBoard , new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY , 5 , 0 , 5 , 0 ) ) ;
bProgramDefaultBoard - > Connect ( " Clicked() " , " BoardSetting " , this , " ProgramBoard() " ) ;
2022-09-23 17:43:30 -04:00
2022-09-27 17:58:14 -04:00
TGTextButton * bUpdateStatus = new TGTextButton ( hRow0 , " Update Status and Settings " ) ; hRow0 - > AddFrame ( bUpdateStatus , new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY , 5 , 0 , 5 , 0 ) ) ;
2022-09-26 18:00:36 -04:00
bUpdateStatus - > Connect ( " Clicked() " , " BoardSetting " , this , " ChangeBoard() " ) ;
2022-09-26 16:47:20 -04:00
2022-09-27 17:58:14 -04:00
TGTextButton * bOpenChannelSetting = new TGTextButton ( hRow0 , " Open Channel Setting " ) ; hRow0 - > AddFrame ( bOpenChannelSetting , new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY , 5 , 0 , 5 , 0 ) ) ;
bOpenChannelSetting - > Connect ( " Clicked() " , " BoardSetting " , this , " OpenChannelSetting() " ) ;
TGTextButton * bReadData = new TGTextButton ( hRow0 , " Read Data " ) ; hRow0 - > AddFrame ( bReadData , new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY , 5 , 0 , 5 , 0 ) ) ;
bReadData - > Connect ( " Clicked() " , " BoardSetting " , this , " ReadData() " ) ;
2022-09-26 16:47:20 -04:00
2022-09-21 16:05:51 -04:00
TGHorizontalFrame * hRow1 = new TGHorizontalFrame ( vframe ) ; vframe - > AddFrame ( hRow1 , new TGLayoutHints ( kLHintsExpandX ) ) ;
{ ///========= Board Configure
TGGroupFrame * gBdCfg = new TGGroupFrame ( hRow1 , " Board Configure " , kHorizontalFrame ) ; hRow1 - > AddFrame ( gBdCfg , new TGLayoutHints ( kLHintsLeft , 5 , 5 , 0 , 0 ) ) ;
TGVerticalFrame * vBdCfg0 = new TGVerticalFrame ( gBdCfg ) ; gBdCfg - > AddFrame ( vBdCfg0 ) ;
TGHorizontalFrame * hBdCfg = new TGHorizontalFrame ( vBdCfg0 ) ; vBdCfg0 - > AddFrame ( hBdCfg , new TGLayoutHints ( kLHintsLeft ) ) ;
TGVerticalFrame * vBdCfg1 = new TGVerticalFrame ( hBdCfg ) ; hBdCfg - > AddFrame ( vBdCfg1 , new TGLayoutHints ( kLHintsLeft , 5 , 5 , 10 , 0 ) ) ;
TGLayoutHints * haha = new TGLayoutHints ( kLHintsLeft , 5 , 5 , 3 , 0 ) ;
bAutoDataFlush = new TGCheckButton ( vBdCfg1 , " Auto Data Flush " , 1 ) ; vBdCfg1 - > AddFrame ( bAutoDataFlush , haha ) ;
bAutoDataFlush - > SetState ( kButtonUp ) ;
bAutoDataFlush - > Connect ( " Clicked() " , " BoardSetting " , this , " SetBoardConfiguration() " ) ;
bDecimateWF = new TGCheckButton ( vBdCfg1 , " Decimate WaveForm " , 1 ) ; vBdCfg1 - > AddFrame ( bDecimateWF , haha ) ;
bDecimateWF - > SetState ( kButtonUp ) ;
bDecimateWF - > Connect ( " Clicked() " , " BoardSetting " , this , " SetBoardConfiguration() " ) ;
2022-09-23 16:40:59 -04:00
2022-09-21 16:05:51 -04:00
bWFRecord = new TGCheckButton ( vBdCfg1 , " Record WaveFrom " , 1 ) ; vBdCfg1 - > AddFrame ( bWFRecord , haha ) ;
bWFRecord - > SetState ( kButtonUp ) ;
bWFRecord - > Connect ( " Clicked() " , " BoardSetting " , this , " SetBoardConfiguration() " ) ;
bTrigPropa = new TGCheckButton ( vBdCfg1 , " Trigger Propagation (coincidence) " , 1 ) ; vBdCfg1 - > AddFrame ( bTrigPropa , haha ) ;
bTrigPropa - > SetState ( kButtonUp ) ;
bTrigPropa - > Connect ( " Clicked() " , " BoardSetting " , this , " SetBoardConfiguration() " ) ;
bExtrac2 = new TGCheckButton ( vBdCfg1 , " Enable Extra2 word " , 1 ) ; vBdCfg1 - > AddFrame ( bExtrac2 , haha ) ;
bExtrac2 - > SetState ( kButtonUp ) ;
bExtrac2 - > Connect ( " Clicked() " , " BoardSetting " , this , " SetBoardConfiguration() " ) ;
TGVerticalFrame * vBdCfg2 = new TGVerticalFrame ( hBdCfg ) ; hBdCfg - > AddFrame ( vBdCfg2 , new TGLayoutHints ( kLHintsLeft , 5 , 5 , 10 , 0 ) ) ;
bDualTrace = new TGCheckButton ( vBdCfg2 , " Dual Trace " , 1 ) ; vBdCfg2 - > AddFrame ( bDualTrace ) ;
bDualTrace - > SetState ( kButtonUp ) ;
bDualTrace - > Connect ( " Clicked() " , " BoardSetting " , this , " SetBoardConfiguration() " ) ;
TGHorizontalFrame * hBdCfg_Probe = new TGHorizontalFrame ( vBdCfg2 ) ; vBdCfg2 - > AddFrame ( hBdCfg_Probe ) ;
TGVerticalFrame * vBdCfg_Probe_Label = new TGVerticalFrame ( hBdCfg_Probe ) ; hBdCfg_Probe - > AddFrame ( vBdCfg_Probe_Label ) ;
TGVerticalFrame * vBdCfg_Probe_CBox = new TGVerticalFrame ( hBdCfg_Probe ) ; hBdCfg_Probe - > AddFrame ( vBdCfg_Probe_CBox ) ;
TGLayoutHints * kaka = new TGLayoutHints ( kLHintsRight , 5 , 5 , 3 , 2 ) ;
TGLabel * lbAP1 = new TGLabel ( vBdCfg_Probe_Label , " Ana. Prb. 1 " ) ; vBdCfg_Probe_Label - > AddFrame ( lbAP1 , kaka ) ;
cbAP1 = new TGComboBox ( vBdCfg_Probe_CBox , " Ana. Pb. 1 " , 1 ) ; vBdCfg_Probe_CBox - > AddFrame ( cbAP1 ) ;
cbAP1 - > EnableTextInput ( false ) ;
cbAP1 - > AddEntry ( " Input " , 0 ) ;
cbAP1 - > AddEntry ( " RC-CR (1st derivative) " , 1 ) ;
cbAP1 - > AddEntry ( " RC-CR2 (2st derivative) " , 2 ) ;
cbAP1 - > AddEntry ( " Trapezoid " , 3 ) ;
cbAP1 - > Resize ( 150 , 20 ) ;
cbAP1 - > Connect ( " Changed() " , " BoardSetting " , this , " SetBoardConfiguration() " ) ;
TGLabel * lbAP2 = new TGLabel ( vBdCfg_Probe_Label , " Ana. Prb. 2 " ) ; vBdCfg_Probe_Label - > AddFrame ( lbAP2 , kaka ) ;
cbAP2 = new TGComboBox ( vBdCfg_Probe_CBox , " Ana. Pb. 2 " , 1 ) ; vBdCfg_Probe_CBox - > AddFrame ( cbAP2 ) ;
cbAP2 - > EnableTextInput ( false ) ;
2022-09-27 17:58:14 -04:00
cbAP2 - > AddEntry ( " N/A " , - 3 ) ;
2022-09-21 16:05:51 -04:00
cbAP2 - > AddEntry ( " Input " , 0 ) ;
cbAP2 - > AddEntry ( " Threshold " , 1 ) ;
cbAP2 - > AddEntry ( " Trapezoid - Baseline " , 2 ) ;
cbAP2 - > AddEntry ( " Baseline " , 3 ) ;
cbAP2 - > Resize ( 150 , 20 ) ;
cbAP2 - > SetEnabled ( false ) ;
cbAP2 - > Connect ( " Changed() " , " BoardSetting " , this , " SetBoardConfiguration() " ) ;
TGLabel * lbDP1 = new TGLabel ( vBdCfg_Probe_Label , " Digi. Prb. 1 " ) ; vBdCfg_Probe_Label - > AddFrame ( lbDP1 , kaka ) ;
cbDP1 = new TGComboBox ( vBdCfg_Probe_CBox , " Digital. Pb. " , 1 ) ; vBdCfg_Probe_CBox - > AddFrame ( cbDP1 ) ;
cbDP1 - > EnableTextInput ( false ) ;
cbDP1 - > AddEntry ( " Peaking " , 0 ) ;
cbDP1 - > AddEntry ( " Armed (Triggered) " , 1 ) ;
cbDP1 - > AddEntry ( " Peak Run " , 2 ) ;
cbDP1 - > AddEntry ( " Pile-Up " , 3 ) ;
cbDP1 - > AddEntry ( " Peaking " , 4 ) ;
cbDP1 - > AddEntry ( " TRG Validation Win. " , 5 ) ;
cbDP1 - > AddEntry ( " Baseline freeze " , 6 ) ;
cbDP1 - > AddEntry ( " TRG holdoff " , 7 ) ;
cbDP1 - > AddEntry ( " TRG Validation " , 8 ) ;
cbDP1 - > AddEntry ( " ACQ busy " , 9 ) ;
cbDP1 - > AddEntry ( " Zero Cross " , 10 ) ;
cbDP1 - > AddEntry ( " Ext. TRG " , 11 ) ;
cbDP1 - > AddEntry ( " Memory full " , 12 ) ;
cbDP1 - > Resize ( 150 , 20 ) ;
cbDP1 - > Connect ( " Changed() " , " BoardSetting " , this , " SetBoardConfiguration() " ) ;
TGLabel * lbDP2 = new TGLabel ( vBdCfg_Probe_Label , " Digi. Prb. 2 " ) ; vBdCfg_Probe_Label - > AddFrame ( lbDP2 , kaka ) ;
cbDP2 = new TGComboBox ( vBdCfg_Probe_CBox , " Digital. Pb. " , 1 ) ; vBdCfg_Probe_CBox - > AddFrame ( cbDP2 ) ;
cbDP2 - > EnableTextInput ( false ) ;
2022-09-27 17:58:14 -04:00
cbDP2 - > AddEntry ( " N/A " , - 3 ) ;
2022-09-23 16:40:59 -04:00
cbDP2 - > AddEntry ( " Trigger " , 0 ) ;
2022-09-21 16:05:51 -04:00
cbDP2 - > Resize ( 150 , 20 ) ;
cbDP2 - > Connect ( " Changed() " , " BoardSetting " , this , " SetBoardConfiguration() " ) ;
TGHorizontalFrame * hframeBdCfg3 = new TGHorizontalFrame ( vBdCfg0 ) ; vBdCfg0 - > AddFrame ( hframeBdCfg3 , new TGLayoutHints ( kLHintsCenterX , 5 , 5 , 5 , 5 ) ) ;
TGVerticalFrame * vBdCfga_label = new TGVerticalFrame ( hframeBdCfg3 ) ; hframeBdCfg3 - > AddFrame ( vBdCfga_label , new TGLayoutHints ( kLHintsLeft , 5 , 5 , 10 , 0 ) ) ;
TGVerticalFrame * vBdCfga_CBox = new TGVerticalFrame ( hframeBdCfg3 ) ; hframeBdCfg3 - > AddFrame ( vBdCfga_CBox , new TGLayoutHints ( kLHintsLeft , 5 , 5 , 10 , 0 ) ) ;
TGLabel * lbAggOrg = new TGLabel ( vBdCfga_label , " Aggregate Organization " ) ; vBdCfga_label - > AddFrame ( lbAggOrg , kaka ) ;
cbAggOrg = new TGComboBox ( vBdCfga_CBox , " Aggregate Organization " , 1 ) ; vBdCfga_CBox - > AddFrame ( cbAggOrg ) ;
cbAggOrg - > EnableTextInput ( false ) ;
cbAggOrg - > AddEntry ( " Not used " , 0 ) ;
cbAggOrg - > AddEntry ( " 4 " , 2 ) ;
cbAggOrg - > AddEntry ( " 8 " , 3 ) ;
cbAggOrg - > AddEntry ( " 16 " , 4 ) ;
cbAggOrg - > AddEntry ( " 32 " , 5 ) ;
cbAggOrg - > AddEntry ( " 64 " , 6 ) ;
cbAggOrg - > AddEntry ( " 128 " , 7 ) ;
cbAggOrg - > AddEntry ( " 256 " , 8 ) ;
cbAggOrg - > AddEntry ( " 512 " , 9 ) ;
cbAggOrg - > AddEntry ( " 1024 " , 10 ) ;
cbAggOrg - > Resize ( 100 , 20 ) ;
cbAggOrg - > Connect ( " Changed() " , " BoardSetting " , this , " SetAggregateOrganization() " ) ;
TGLabel * lbAggBLT = new TGLabel ( vBdCfga_label , " MAx. Aggregate pre Readout " ) ; vBdCfga_label - > AddFrame ( lbAggBLT , kaka ) ;
2022-09-27 17:58:14 -04:00
numAggBLT = new TGNumberEntry ( vBdCfga_CBox , 50 , 0 , 0 , TGNumberFormat : : kNESInteger , TGNumberFormat : : kNEANonNegative ) ; vBdCfga_CBox - > AddFrame ( numAggBLT ) ;
2022-09-21 16:05:51 -04:00
numAggBLT - > SetWidth ( 100 ) ;
numAggBLT - > SetLimits ( TGNumberFormat : : kNELLimitMinMax , 0 , 0x3FF ) ;
numAggBLT - > Connect ( " Modified() " , " BoardSetting " , this , " SetReadOutAggregate() " ) ;
///"FanSpeed Control",
TGLabel * lbFanCtrl = new TGLabel ( vBdCfga_label , " Fan Speed Control " , kHorizontalFrame ) ; vBdCfga_label - > AddFrame ( lbFanCtrl , kaka ) ;
cbFanCtrl = new TGComboBox ( vBdCfga_CBox , " " , 1 ) ; vBdCfga_CBox - > AddFrame ( cbFanCtrl ) ;
cbFanCtrl - > EnableTextInput ( false ) ;
2022-09-26 18:00:36 -04:00
cbFanCtrl - > AddEntry ( " N/A " , 0 ) ;
2022-09-21 16:05:51 -04:00
cbFanCtrl - > AddEntry ( " Slow/Auto " , 0x30 ) ;
cbFanCtrl - > AddEntry ( " Fast " , 0x38 ) ;
cbFanCtrl - > Resize ( 100 , 20 ) ;
cbFanCtrl - > Connect ( " Changed() " , " BoardSetting " , this , " SetFanSpeedControl() " ) ;
}
{ ///========== ACQ control
TGGroupFrame * gAcqCtrl = new TGGroupFrame ( hRow1 , " ACQ Control " , kHorizontalFrame ) ; hRow1 - > AddFrame ( gAcqCtrl , new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY ) ) ;
TGVerticalFrame * vAcqCtrl1 = new TGVerticalFrame ( gAcqCtrl ) ; gAcqCtrl - > AddFrame ( vAcqCtrl1 , new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY , 5 , 5 , 10 , 10 ) ) ;
TGHorizontalFrame * hAcqCtrl_a = new TGHorizontalFrame ( vAcqCtrl1 ) ; vAcqCtrl1 - > AddFrame ( hAcqCtrl_a ) ;
TGVerticalFrame * vAcqCtrl_label = new TGVerticalFrame ( hAcqCtrl_a ) ; hAcqCtrl_a - > AddFrame ( vAcqCtrl_label ) ;
TGVerticalFrame * vAcqCtrl_CBox = new TGVerticalFrame ( hAcqCtrl_a ) ; hAcqCtrl_a - > AddFrame ( vAcqCtrl_CBox ) ;
TGLayoutHints * haha = new TGLayoutHints ( kLHintsRight , 5 , 5 , 6 , 5 ) ;
TGLayoutHints * kaka = new TGLayoutHints ( kLHintsLeft , 5 , 5 , 3 , 2 ) ;
TGLabel * lbAcqMode = new TGLabel ( vAcqCtrl_label , " ACQ Mode " ) ; vAcqCtrl_label - > AddFrame ( lbAcqMode , haha ) ;
cbAcqMode = new TGComboBox ( vAcqCtrl_CBox , " ACQ Mode " , 1 ) ; vAcqCtrl_CBox - > AddFrame ( cbAcqMode , kaka ) ;
cbAcqMode - > EnableTextInput ( false ) ;
cbAcqMode - > AddEntry ( " Software " , 0 ) ;
cbAcqMode - > AddEntry ( " S-IN / GPI " , 1 ) ;
cbAcqMode - > AddEntry ( " 1st Trig. Ctrl. " , 2 ) ;
cbAcqMode - > AddEntry ( " LVSD Ctrl. " , 3 ) ;
cbAcqMode - > Resize ( 100 , 20 ) ;
cbAcqMode - > Connect ( " Changed() " , " BoardSetting " , this , " SetACQControl() " ) ;
TGLabel * lbPLLref = new TGLabel ( vAcqCtrl_label , " PLL Ref. " ) ; vAcqCtrl_label - > AddFrame ( lbPLLref , haha ) ;
cbPLLref = new TGComboBox ( vAcqCtrl_CBox , " PLL Ref. " , 1 ) ; vAcqCtrl_CBox - > AddFrame ( cbPLLref , kaka ) ;
cbPLLref - > EnableTextInput ( false ) ;
cbPLLref - > AddEntry ( " internal " , 0 ) ;
cbPLLref - > AddEntry ( " external " , 1 ) ;
cbPLLref - > Resize ( 100 , 20 ) ;
cbPLLref - > Connect ( " Changed() " , " BoardSetting " , this , " SetACQControl() " ) ;
TGLabel * lbRunStartStopDelay = new TGLabel ( vAcqCtrl_label , " Run/Start/Stop Delay [ns] " ) ; vAcqCtrl_label - > AddFrame ( lbRunStartStopDelay , haha ) ;
numRunStartStopDelay = new TGNumberEntry ( vAcqCtrl_CBox , 0 , 0 , 0 , TGNumberFormat : : kNESInteger , TGNumberFormat : : kNEANonNegative ) ; vAcqCtrl_CBox - > AddFrame ( numRunStartStopDelay , kaka ) ;
numRunStartStopDelay - > SetWidth ( 100 ) ;
numRunStartStopDelay - > SetLimits ( TGNumberFormat : : kNELLimitMinMax , 0 , 0x0FF ) ;
numRunStartStopDelay - > Connect ( " Modified() " , " BoardSetting " , this , " SetRunStartStopDelay() " ) ;
bAcqArm = new TGCheckButton ( vAcqCtrl_CBox , " ACQ Start/Arm " , 1 ) ; vAcqCtrl_CBox - > AddFrame ( bAcqArm , kaka ) ;
bAcqArm - > SetState ( kButtonUp ) ;
bAcqArm - > Connect ( " Clicked() " , " BoardSetting " , this , " SetACQControl() " ) ;
TGHorizontalFrame * hAcqCtrl_b = new TGHorizontalFrame ( vAcqCtrl1 ) ; vAcqCtrl1 - > AddFrame ( hAcqCtrl_b , new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY , 0 , 0 , 10 , 0 ) ) ;
bSWTrigger = new TGTextButton ( hAcqCtrl_b , " Send Software Trigger Signal " ) ; hAcqCtrl_b - > AddFrame ( bSWTrigger , new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY ) ) ;
bSWTrigger - > Connect ( " Clicked() " , " BoardSetting " , this , " SendSoftwareTriggerSignal() " ) ;
bSWTrigger - > SetWidth ( 250 ) ;
TGHorizontalFrame * hAcqCtrl_c = new TGHorizontalFrame ( vAcqCtrl1 ) ; vAcqCtrl1 - > AddFrame ( hAcqCtrl_c , new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY , 0 , 0 , 10 , 0 ) ) ;
bSWClockSync = new TGTextButton ( hAcqCtrl_c , " Send Software Clock Sync Signal " ) ; hAcqCtrl_c - > AddFrame ( bSWClockSync , new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY ) ) ;
bSWClockSync - > Connect ( " Clicked() " , " BoardSetting " , this , " SendSoftwareClockSyncSignal() " ) ;
bSWClockSync - > Resize ( 250 , 20 ) ;
2022-09-26 16:47:20 -04:00
2022-09-20 15:15:52 -04:00
}
2022-08-25 15:27:27 -04:00
2022-09-20 15:15:52 -04:00
{ ///========= Trigger Configure
TGGroupFrame * gTRGCfg = new TGGroupFrame ( vframe , " Trigger Configure " , kHorizontalFrame ) ; vframe - > AddFrame ( gTRGCfg , new TGLayoutHints ( kLHintsExpandX ) ) ;
TGVerticalFrame * vTRGCfg = new TGVerticalFrame ( gTRGCfg ) ; gTRGCfg - > AddFrame ( vTRGCfg , new TGLayoutHints ( kLHintsExpandX ) ) ;
///--- various type of triggers
TGHorizontalFrame * hframeTRGCfg = new TGHorizontalFrame ( vTRGCfg ) ; vTRGCfg - > AddFrame ( hframeTRGCfg , new TGLayoutHints ( kLHintsCenterY , 2 , 2 , 2 , 2 ) ) ;
TGVerticalFrame * vTRGType = new TGVerticalFrame ( hframeTRGCfg ) ; hframeTRGCfg - > AddFrame ( vTRGType , new TGLayoutHints ( kLHintsCenterX , 5 , 5 , 3 , 4 ) ) ;
2022-08-25 15:27:27 -04:00
2022-09-26 18:00:36 -04:00
///"Disable External Trigger",
bEnableExtTRG = new TGCheckButton ( vTRGType , " Enable Ext. Trigger " , 1 ) ; vTRGType - > AddFrame ( bEnableExtTRG ) ;
bEnableExtTRG - > Connect ( " Clicked() " , " BoardSetting " , this , " SetEnableExternalTrigger() " ) ;
2022-09-20 15:15:52 -04:00
TGLabel * lbdummy0 = new TGLabel ( vTRGType , " " ) ;
vTRGType - > AddFrame ( lbdummy0 , new TGLayoutHints ( kLHintsLeft | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
2022-09-26 18:00:36 -04:00
//vTRGType->AddFrame(lbdummy0, new TGLayoutHints(kLHintsLeft | kLHintsCenterY , 5, 5, 3, 4));
2022-08-25 15:27:27 -04:00
2022-09-21 16:05:51 -04:00
TGLayoutHints * haha = new TGLayoutHints ( kLHintsCenterX , 2 , 2 , 3 , 3 ) ;
2022-09-20 15:15:52 -04:00
TGVerticalFrame * vTRGMsk [ 8 ] ;
TGLabel * lbTRGMskCh0 [ 8 ] ;
TGLabel * lbTRGMskCh1 [ 8 ] ;
for ( int i = 0 ; i < 8 ; i + + ) {
2022-09-21 16:05:51 -04:00
vTRGMsk [ i ] = new TGVerticalFrame ( hframeTRGCfg ) ; hframeTRGCfg - > AddFrame ( vTRGMsk [ i ] , haha ) ;
lbTRGMskCh0 [ i ] = new TGLabel ( vTRGMsk [ i ] , Form ( " %d " , 2 * i ) ) ; vTRGMsk [ i ] - > AddFrame ( lbTRGMskCh0 [ i ] , haha ) ;
lbTRGMskCh1 [ i ] = new TGLabel ( vTRGMsk [ i ] , Form ( " %d " , 2 * i + 1 ) ) ; vTRGMsk [ i ] - > AddFrame ( lbTRGMskCh1 [ i ] , haha ) ;
2022-09-20 15:15:52 -04:00
}
2022-09-16 17:53:57 -04:00
2022-09-20 15:15:52 -04:00
///"Global Trigger Mask",
TGLabel * lbGbTRGMsk = new TGLabel ( vTRGType , " Global Trigger Mask " ) ; vTRGType - > AddFrame ( lbGbTRGMsk , new TGLayoutHints ( kLHintsRight | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
for ( int i = 0 ; i < 8 ; i + + ) {
2022-09-21 16:05:51 -04:00
cbGbTRGMskCh [ i ] = new TGCheckButton ( vTRGMsk [ i ] , " " ) ; vTRGMsk [ i ] - > AddFrame ( cbGbTRGMskCh [ i ] , haha ) ;
cbGbTRGMskCh [ i ] - > Connect ( " Clicked() " , " BoardSetting " , this , " SetGlobalTriggerMask() " ) ;
2022-09-20 15:15:52 -04:00
}
2022-09-16 17:53:57 -04:00
2022-09-20 15:15:52 -04:00
///"Trigger Validation Mask",
TGLabel * lbTRGValMsk = new TGLabel ( vTRGType , " Trigger Validation Mask " ) ; vTRGType - > AddFrame ( lbTRGValMsk , new TGLayoutHints ( kLHintsRight | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
for ( int i = 0 ; i < 8 ; i + + ) {
2022-09-21 16:05:51 -04:00
cbTRGValMskCh [ i ] = new TGCheckButton ( vTRGMsk [ i ] , " " ) ; vTRGMsk [ i ] - > AddFrame ( cbTRGValMskCh [ i ] , haha ) ;
cbTRGValMskCh [ i ] - > Connect ( " Clicked() " , " BoardSetting " , this , " SetTriggerValidMask() " ) ;
2022-09-20 15:15:52 -04:00
}
///"Front Panel TRG-OUT Enable Mask",
TGLabel * lbTRGOUTMsk = new TGLabel ( vTRGType , " TRG-OUT Mask " ) ; vTRGType - > AddFrame ( lbTRGOUTMsk , new TGLayoutHints ( kLHintsRight | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
for ( int i = 0 ; i < 8 ; i + + ) {
2022-09-21 16:05:51 -04:00
cbTRGOUTMskCh [ i ] = new TGCheckButton ( vTRGMsk [ i ] , " " ) ; vTRGMsk [ i ] - > AddFrame ( cbTRGOUTMskCh [ i ] , haha ) ;
cbTRGOUTMskCh [ i ] - > Connect ( " Clicked() " , " BoardSetting " , this , " SetTRGOUTMask() " ) ;
2022-09-20 15:15:52 -04:00
}
2022-09-21 16:05:51 -04:00
TGVerticalFrame * vTRGMsk1 = new TGVerticalFrame ( hframeTRGCfg ) ; hframeTRGCfg - > AddFrame ( vTRGMsk1 , haha ) ;
2022-09-20 15:15:52 -04:00
vTRGMsk1 - > AddFrame ( lbdummy0 , new TGLayoutHints ( kLHintsLeft | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
vTRGMsk1 - > AddFrame ( lbdummy0 , new TGLayoutHints ( kLHintsLeft | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
TGLabel * lbMajorCoinWin = new TGLabel ( vTRGMsk1 , " Maj. Coin. Win. " ) ; vTRGMsk1 - > AddFrame ( lbMajorCoinWin , new TGLayoutHints ( kLHintsRight | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
2022-09-21 16:05:51 -04:00
TGLabel * lbTRGMODE = new TGLabel ( vTRGMsk1 , " TRG Vali. MODE " ) ; vTRGMsk1 - > AddFrame ( lbTRGMODE , new TGLayoutHints ( kLHintsRight | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
2022-09-20 15:15:52 -04:00
TGLabel * lbTRGOUTMODE = new TGLabel ( vTRGMsk1 , " TRG-OUT MODE " ) ; vTRGMsk1 - > AddFrame ( lbTRGOUTMODE , new TGLayoutHints ( kLHintsRight | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
2022-09-21 16:05:51 -04:00
TGVerticalFrame * vTRGMsk2 = new TGVerticalFrame ( hframeTRGCfg ) ; hframeTRGCfg - > AddFrame ( vTRGMsk2 , haha ) ;
2022-09-20 15:15:52 -04:00
vTRGMsk2 - > AddFrame ( lbdummy0 , new TGLayoutHints ( kLHintsLeft | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
vTRGMsk2 - > AddFrame ( lbdummy0 , new TGLayoutHints ( kLHintsLeft | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
numMajorCoinWin = new TGNumberEntry ( vTRGMsk2 , 0 , 0 , 0 , TGNumberFormat : : kNESInteger , TGNumberFormat : : kNEANonNegative ) ; vTRGMsk2 - > AddFrame ( numMajorCoinWin ) ;
numMajorCoinWin - > Resize ( 70 , 20 ) ;
2022-09-21 16:05:51 -04:00
numMajorCoinWin - > Connect ( " Modified() " , " BoardSetting " , this , " SetGlobalTriggerMask() " ) ;
2022-09-20 15:15:52 -04:00
2022-09-21 16:05:51 -04:00
cbTRGMODE = new TGComboBox ( vTRGMsk2 , " TRG Val. MODE " , 1 ) ; vTRGMsk2 - > AddFrame ( cbTRGMODE ) ;
2022-09-20 15:15:52 -04:00
cbTRGMODE - > EnableTextInput ( false ) ;
cbTRGMODE - > AddEntry ( " OR " , 0 ) ;
cbTRGMODE - > AddEntry ( " AND " , 1 ) ;
cbTRGMODE - > AddEntry ( " Majority " , 2 ) ;
cbTRGMODE - > Resize ( 70 , 20 ) ;
2022-09-21 16:05:51 -04:00
cbTRGMODE - > Connect ( " Changed() " , " BoardSetting " , this , " SetTriggerValidMask() " ) ;
cbTRGOUTMODE = new TGComboBox ( vTRGMsk2 , " TRG-OUT MODE " , 1 ) ; vTRGMsk2 - > AddFrame ( cbTRGOUTMODE ) ;
2022-09-20 15:15:52 -04:00
cbTRGOUTMODE - > EnableTextInput ( false ) ;
cbTRGOUTMODE - > AddEntry ( " OR " , 0 ) ;
cbTRGOUTMODE - > AddEntry ( " AND " , 1 ) ;
cbTRGOUTMODE - > AddEntry ( " Majority " , 2 ) ;
cbTRGOUTMODE - > Resize ( 70 , 20 ) ;
2022-09-21 16:05:51 -04:00
cbTRGOUTMODE - > Connect ( " Changed() " , " BoardSetting " , this , " SetTRGOUTMask() " ) ;
2022-09-20 15:15:52 -04:00
2022-09-21 16:05:51 -04:00
TGVerticalFrame * vTRGMsk3 = new TGVerticalFrame ( hframeTRGCfg ) ; hframeTRGCfg - > AddFrame ( vTRGMsk3 , haha ) ;
2022-09-20 15:15:52 -04:00
vTRGMsk3 - > AddFrame ( lbdummy0 , new TGLayoutHints ( kLHintsLeft | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
TGLabel * lbMajorLevel = new TGLabel ( vTRGMsk3 , " Majority Level " ) ; vTRGMsk3 - > AddFrame ( lbMajorLevel , layoutHints ) ;
GlbMajorLevel = new TGNumberEntry ( vTRGMsk3 , 0 , 0 , 0 , TGNumberFormat : : kNESInteger , TGNumberFormat : : kNEANonNegative ) ; vTRGMsk3 - > AddFrame ( GlbMajorLevel , new TGLayoutHints ( kLHintsCenterY , 2 , 2 , 2 , 2 ) ) ;
GlbMajorLevel - > Resize ( 70 , 17 ) ;
2022-09-21 16:05:51 -04:00
GlbMajorLevel - > Connect ( " Modified() " , " BoardSetting " , this , " SetGlobalTriggerMask() " ) ;
2022-09-20 15:15:52 -04:00
TRGMajorLevel = new TGNumberEntry ( vTRGMsk3 , 0 , 0 , 0 , TGNumberFormat : : kNESInteger , TGNumberFormat : : kNEANonNegative ) ; vTRGMsk3 - > AddFrame ( TRGMajorLevel , new TGLayoutHints ( kLHintsCenterY , 2 , 2 , 2 , 2 ) ) ;
TRGMajorLevel - > Resize ( 70 , 17 ) ;
2022-09-21 16:05:51 -04:00
TRGMajorLevel - > Connect ( " Modified() " , " BoardSetting " , this , " SetTriggerValidMask() " ) ;
2022-09-20 15:15:52 -04:00
TRGOUTMajorLevel = new TGNumberEntry ( vTRGMsk3 , 0 , 0 , 0 , TGNumberFormat : : kNESInteger , TGNumberFormat : : kNEANonNegative ) ; vTRGMsk3 - > AddFrame ( TRGOUTMajorLevel , new TGLayoutHints ( kLHintsCenterY , 2 , 2 , 2 , 2 ) ) ;
TRGOUTMajorLevel - > Resize ( 70 , 17 ) ;
2022-09-21 16:05:51 -04:00
TRGOUTMajorLevel - > Connect ( " Modified() " , " BoardSetting " , this , " SetTRGOUTMask() " ) ;
TGVerticalFrame * vTRGMsk5 = new TGVerticalFrame ( hframeTRGCfg ) ; hframeTRGCfg - > AddFrame ( vTRGMsk5 , haha ) ;
2022-09-20 15:15:52 -04:00
TGLabel * lbExtTrigger = new TGLabel ( vTRGMsk5 , " Ext. " ) ; vTRGMsk5 - > AddFrame ( lbExtTrigger , layoutHints ) ;
TGLabel * lbdummy2 = new TGLabel ( vTRGMsk5 , " Trg. " ) ; vTRGMsk5 - > AddFrame ( lbdummy2 , layoutHints ) ;
bGLBExtTrigger = new TGCheckButton ( vTRGMsk5 , " " , 1 ) ; vTRGMsk5 - > AddFrame ( bGLBExtTrigger , layoutHints ) ;
bGLBExtTrigger - > SetState ( kButtonUp ) ;
2022-09-21 16:05:51 -04:00
bGLBExtTrigger - > Connect ( " Clicked() " , " BoardSetting " , this , " SetGlobalTriggerMask() " ) ;
2022-09-20 15:15:52 -04:00
bTRGExtTrigger = new TGCheckButton ( vTRGMsk5 , " " , 1 ) ; vTRGMsk5 - > AddFrame ( bTRGExtTrigger , layoutHints ) ;
bTRGExtTrigger - > SetState ( kButtonUp ) ;
2022-09-21 16:05:51 -04:00
bTRGExtTrigger - > Connect ( " Clicked() " , " BoardSetting " , this , " SetTriggerValidMask() " ) ;
2022-09-20 15:15:52 -04:00
bTRGOUTExtTrigger = new TGCheckButton ( vTRGMsk5 , " " , 1 ) ; vTRGMsk5 - > AddFrame ( bTRGOUTExtTrigger , layoutHints ) ;
bTRGOUTExtTrigger - > SetState ( kButtonUp ) ;
2022-09-21 16:05:51 -04:00
bTRGOUTExtTrigger - > Connect ( " Clicked() " , " BoardSetting " , this , " SetTRGOUTMask() " ) ;
2022-09-20 15:15:52 -04:00
2022-09-21 16:05:51 -04:00
TGVerticalFrame * vTRGMsk6 = new TGVerticalFrame ( hframeTRGCfg ) ; hframeTRGCfg - > AddFrame ( vTRGMsk6 , haha ) ;
TGLabel * lbSWTrigger = new TGLabel ( vTRGMsk6 , " SW " ) ; vTRGMsk6 - > AddFrame ( lbSWTrigger , layoutHints ) ;
2022-09-20 15:15:52 -04:00
TGLabel * lbdummy3 = new TGLabel ( vTRGMsk6 , " Trg. " ) ; vTRGMsk6 - > AddFrame ( lbdummy3 , layoutHints ) ;
bGLBSoftwareTrigger = new TGCheckButton ( vTRGMsk6 , " " , 1 ) ; vTRGMsk6 - > AddFrame ( bGLBSoftwareTrigger , layoutHints ) ;
bGLBSoftwareTrigger - > SetState ( kButtonDown ) ;
2022-09-21 16:05:51 -04:00
bGLBSoftwareTrigger - > Connect ( " Clicked() " , " BoardSetting " , this , " SetGlobalTriggerMask() " ) ;
2022-09-20 15:15:52 -04:00
bTRGSoftwareTrigger = new TGCheckButton ( vTRGMsk6 , " " , 1 ) ; vTRGMsk6 - > AddFrame ( bTRGSoftwareTrigger , layoutHints ) ;
bTRGSoftwareTrigger - > SetState ( kButtonDown ) ;
2022-09-21 16:05:51 -04:00
bTRGSoftwareTrigger - > Connect ( " Clicked() " , " BoardSetting " , this , " SetTriggerValidMask() " ) ;
2022-09-20 15:15:52 -04:00
bTRGOUTSoftwareTrigger = new TGCheckButton ( vTRGMsk6 , " " , 1 ) ; vTRGMsk6 - > AddFrame ( bTRGOUTSoftwareTrigger , layoutHints ) ;
bTRGOUTSoftwareTrigger - > SetState ( kButtonDown ) ;
2022-09-21 16:05:51 -04:00
bTRGOUTSoftwareTrigger - > Connect ( " Clicked() " , " BoardSetting " , this , " SetTRGOUTMask() " ) ;
TGHorizontalFrame * hframeTRGCfg2 = new TGHorizontalFrame ( vTRGCfg ) ; vTRGCfg - > AddFrame ( hframeTRGCfg2 , new TGLayoutHints ( kLHintsCenterY | kLHintsLeft , 2 , 2 , 2 , 2 ) ) ;
2022-09-20 15:15:52 -04:00
2022-09-26 18:00:36 -04:00
///"Extended Veto Delay", only when bit[9] of 0x8100 = 1
///TGLabel * lbExtendVetoDelay = new TGLabel(hframeTRGCfg2, "Extended Veto Delay"); hframeTRGCfg2->AddFrame(lbExtendVetoDelay, new TGLayoutHints(kLHintsCenterY , 5, 5, 3, 4));
///numExtendVetoDelay = new TGNumberEntry(hframeTRGCfg2, 0, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); hframeTRGCfg2->AddFrame(numExtendVetoDelay, new TGLayoutHints(kLHintsCenterY , 5, 5, 3, 4));
///numExtendVetoDelay->Resize(70, 17);
///numExtendVetoDelay->Connect("Modified()", "BoardSetting", this, "SetExtendedVetoDelay()");
2022-09-20 15:15:52 -04:00
}
2022-08-25 15:27:27 -04:00
2022-09-21 16:05:51 -04:00
TGHorizontalFrame * hRow2 = new TGHorizontalFrame ( vframe ) ; vframe - > AddFrame ( hRow2 , new TGLayoutHints ( kLHintsExpandX ) ) ;
2022-09-20 15:15:52 -04:00
{ ///=================="Front Panel IO Control",
2022-09-21 16:05:51 -04:00
TGGroupFrame * gFrontIOCtrl = new TGGroupFrame ( hRow2 , " Front Panel IO Control " , kHorizontalFrame ) ; hRow2 - > AddFrame ( gFrontIOCtrl , new TGLayoutHints ( kLHintsExpandX , 5 , 5 , 0 , 0 ) ) ;
2022-09-20 15:15:52 -04:00
2022-09-21 16:05:51 -04:00
TGHorizontalFrame * hFrontIOCtrl = new TGHorizontalFrame ( gFrontIOCtrl ) ; gFrontIOCtrl - > AddFrame ( hFrontIOCtrl ) ;
TGVerticalFrame * vFrontIOCtrl_label = new TGVerticalFrame ( hFrontIOCtrl ) ; hFrontIOCtrl - > AddFrame ( vFrontIOCtrl_label ) ;
TGVerticalFrame * vFrontIOCtrl_CBox = new TGVerticalFrame ( hFrontIOCtrl ) ; hFrontIOCtrl - > AddFrame ( vFrontIOCtrl_CBox ) ;
TGLayoutHints * haha = new TGLayoutHints ( kLHintsRight , 5 , 5 , 3 , 2 ) ;
TGLabel * lbLEMOIO = new TGLabel ( vFrontIOCtrl_label , " LEMO I/O " ) ; vFrontIOCtrl_label - > AddFrame ( lbLEMOIO , haha ) ;
cbLEMOIO = new TGComboBox ( vFrontIOCtrl_CBox , " " , 1 ) ; vFrontIOCtrl_CBox - > AddFrame ( cbLEMOIO ) ;
2022-09-20 15:15:52 -04:00
cbLEMOIO - > EnableTextInput ( false ) ;
cbLEMOIO - > AddEntry ( " NIM " , 0 ) ;
cbLEMOIO - > AddEntry ( " TTL " , 1 ) ;
cbLEMOIO - > Resize ( 50 , 20 ) ;
2022-09-21 16:05:51 -04:00
cbLEMOIO - > Connect ( " Changed() " , " BoardSetting " , this , " SetFrontPanelIO() " ) ;
2022-09-20 15:15:52 -04:00
///use 0x811C, bit:[14:19], 6bits
2022-09-21 16:05:51 -04:00
TGLabel * lbTRGOUTMODE2 = new TGLabel ( vFrontIOCtrl_label , " TRG-OUT Mode " ) ; vFrontIOCtrl_label - > AddFrame ( lbTRGOUTMODE2 , haha ) ;
cbTRGOUTmode = new TGComboBox ( vFrontIOCtrl_CBox , " " , 1 ) ; vFrontIOCtrl_CBox - > AddFrame ( cbTRGOUTmode ) ;
2022-09-20 15:15:52 -04:00
cbTRGOUTmode - > EnableTextInput ( false ) ;
2022-09-26 18:00:36 -04:00
cbTRGOUTmode - > AddEntry ( " Disable " , 0x00002 ) ; /// this is TRG_OUT high imped. 0x811C bit[1]
2022-09-20 15:15:52 -04:00
cbTRGOUTmode - > AddEntry ( " force TRG-OUT is 0 " , 0x08000 ) ;
cbTRGOUTmode - > AddEntry ( " force TRG-OUT is 1 " , 0x0C000 ) ;
cbTRGOUTmode - > AddEntry ( " Trigger " , 0x00000 ) ;
cbTRGOUTmode - > AddEntry ( " Channel Probe " , 0x20000 ) ;
cbTRGOUTmode - > AddEntry ( " S-IN " , 0x30000 ) ;
cbTRGOUTmode - > AddEntry ( " RUN " , 0x10000 ) ;
cbTRGOUTmode - > AddEntry ( " Sync Clock " , 0x50000 ) ;
cbTRGOUTmode - > AddEntry ( " Clock Phase " , 0x90000 ) ;
cbTRGOUTmode - > AddEntry ( " BUSY/UNLOCK " , 0xD0000 ) ;
cbTRGOUTmode - > Resize ( 160 , 20 ) ;
2022-09-21 16:05:51 -04:00
cbTRGOUTmode - > Connect ( " Changed() " , " BoardSetting " , this , " SetFrontPanelIO() " ) ;
2022-09-20 15:15:52 -04:00
2022-09-21 16:05:51 -04:00
TGLabel * lbTRGINCtrl = new TGLabel ( vFrontIOCtrl_label , " TRG-IN control " ) ; vFrontIOCtrl_label - > AddFrame ( lbTRGINCtrl , haha ) ;
cbTRGINCtrl = new TGComboBox ( vFrontIOCtrl_CBox , " " , 1 ) ; vFrontIOCtrl_CBox - > AddFrame ( cbTRGINCtrl ) ;
2022-09-20 15:15:52 -04:00
cbTRGINCtrl - > EnableTextInput ( false ) ;
2022-09-21 16:05:51 -04:00
cbTRGINCtrl - > AddEntry ( " Trigger sync with the edge of the TRIG-IN " , 0 ) ;
cbTRGINCtrl - > AddEntry ( " Trigger sync with the whole TRIG-IN " , 1 ) ;
2022-09-20 15:15:52 -04:00
cbTRGINCtrl - > Resize ( 250 , 20 ) ;
2022-09-21 16:05:51 -04:00
cbTRGINCtrl - > Connect ( " Changed() " , " BoardSetting " , this , " SetFrontPanelIO() " ) ;
2022-09-20 15:15:52 -04:00
2022-09-21 16:05:51 -04:00
TGLabel * lbTRGINMezzanines = new TGLabel ( vFrontIOCtrl_label , " TRG-IN to Mezzanines " ) ; vFrontIOCtrl_label - > AddFrame ( lbTRGINMezzanines , haha ) ;
cbTRGINMezzanines = new TGComboBox ( vFrontIOCtrl_CBox , " " , 1 ) ; vFrontIOCtrl_CBox - > AddFrame ( cbTRGINMezzanines ) ;
2022-09-20 15:15:52 -04:00
cbTRGINMezzanines - > EnableTextInput ( false ) ;
cbTRGINMezzanines - > AddEntry ( " Trigger local is sync with TRG-IN " , 0 ) ;
cbTRGINMezzanines - > AddEntry ( " TRG-IN send to mezzanines (no delay) " , 1 ) ;
cbTRGINMezzanines - > Resize ( 200 , 20 ) ;
2022-09-21 16:05:51 -04:00
cbTRGINMezzanines - > Connect ( " Changed() " , " BoardSetting " , this , " SetFrontPanelIO() " ) ;
2022-09-20 15:15:52 -04:00
///"Front Panel LVDS IO New Features",
///"LVDS IO Data",
///"Analog Monitor Mode
2022-09-21 16:05:51 -04:00
TGLabel * lbAnaMonitor = new TGLabel ( vFrontIOCtrl_label , " Analog Monitor Mode (MON/Sigma) " ) ; vFrontIOCtrl_label - > AddFrame ( lbAnaMonitor , haha ) ;
cbAnaMonitor = new TGComboBox ( vFrontIOCtrl_CBox , " " , 1 ) ; vFrontIOCtrl_CBox - > AddFrame ( cbAnaMonitor ) ;
2022-09-20 15:15:52 -04:00
cbAnaMonitor - > EnableTextInput ( false ) ;
cbAnaMonitor - > AddEntry ( " Trigger Majority " , 0 ) ;
cbAnaMonitor - > AddEntry ( " Test " , 1 ) ;
cbAnaMonitor - > AddEntry ( " Buffer Occupancy " , 3 ) ;
cbAnaMonitor - > AddEntry ( " Voltage Level " , 4 ) ;
cbAnaMonitor - > Resize ( 150 , 20 ) ;
cbAnaMonitor - > Connect ( " Changed() " , " BoardSetting " , this , " SetAnalogMonitorMode() " ) ;
2022-09-23 17:43:30 -04:00
//cbAnaMonitor->Connect("Changed()", "ChannelSettingPHA", this, "ChangePolarity()"); //Example to call other class
2022-09-20 15:15:52 -04:00
///"Buffer Occupancy Gain
2022-09-21 16:05:51 -04:00
TGLabel * lbBufferOccpGain = new TGLabel ( vFrontIOCtrl_label , " Buffer Occupancy Gain " ) ; vFrontIOCtrl_label - > AddFrame ( lbBufferOccpGain , haha ) ;
numBufferOccpGain = new TGNumberEntry ( vFrontIOCtrl_CBox , 0 , 0 , 0 , TGNumberFormat : : kNESInteger , TGNumberFormat : : kNEANonNegative ) ; vFrontIOCtrl_CBox - > AddFrame ( numBufferOccpGain ) ;
2022-09-20 15:15:52 -04:00
numBufferOccpGain - > SetState ( false ) ;
numBufferOccpGain - > Resize ( 70 , 17 ) ;
2022-09-21 16:05:51 -04:00
numBufferOccpGain - > Connect ( " Modified() " , " BoardSetting " , this , " SetAnalogMonitorMode() " ) ;
2022-09-20 15:15:52 -04:00
}
2022-08-25 15:27:27 -04:00
2022-09-20 15:15:52 -04:00
//TODO check is VME model
{ ///"Readout Control",
2022-09-21 16:05:51 -04:00
TGGroupFrame * gReadoutCtrl = new TGGroupFrame ( hRow2 , " ReadOut Control " , kHorizontalFrame ) ; hRow2 - > AddFrame ( gReadoutCtrl , new TGLayoutHints ( kLHintsExpandY ) ) ;
2022-09-20 15:15:52 -04:00
TGVerticalFrame * vReadoutCtrl = new TGVerticalFrame ( gReadoutCtrl ) ; gReadoutCtrl - > AddFrame ( vReadoutCtrl ) ;
2022-09-21 16:05:51 -04:00
TGHorizontalFrame * hReadoutCtrl = new TGHorizontalFrame ( vReadoutCtrl ) ; vReadoutCtrl - > AddFrame ( hReadoutCtrl , new TGLayoutHints ( kLHintsLeft , 5 , 5 , 5 , 5 ) ) ;
2022-09-20 15:15:52 -04:00
2022-09-21 16:05:51 -04:00
TGLabel * lbVMEInterruptLevel = new TGLabel ( hReadoutCtrl , " VME Interrupt Level " ) ; hReadoutCtrl - > AddFrame ( lbVMEInterruptLevel , new TGLayoutHints ( kLHintsLeft , 5 , 5 , 3 , 3 ) ) ;
cbVMEInterrupLevel = new TGComboBox ( hReadoutCtrl , " " , 1 ) ; hReadoutCtrl - > AddFrame ( cbVMEInterrupLevel ) ;
2022-09-20 15:15:52 -04:00
cbVMEInterrupLevel - > EnableTextInput ( false ) ;
cbVMEInterrupLevel - > AddEntry ( " Disabled " , 0 ) ;
cbVMEInterrupLevel - > AddEntry ( " 1 " , 1 ) ;
cbVMEInterrupLevel - > AddEntry ( " 2 " , 2 ) ;
cbVMEInterrupLevel - > AddEntry ( " 3 " , 3 ) ;
cbVMEInterrupLevel - > AddEntry ( " 4 " , 4 ) ;
cbVMEInterrupLevel - > AddEntry ( " 5 " , 5 ) ;
cbVMEInterrupLevel - > AddEntry ( " 6 " , 6 ) ;
cbVMEInterrupLevel - > AddEntry ( " 7 " , 7 ) ;
2022-09-21 16:05:51 -04:00
cbVMEInterrupLevel - > Resize ( 80 , 20 ) ;
cbVMEInterrupLevel - > Connect ( " Changed() " , " BoardSetting " , this , " SetReadOutControl() " ) ;
2022-09-20 15:15:52 -04:00
2022-09-21 16:05:51 -04:00
bOpticalLinkInterrupt = new TGCheckButton ( vReadoutCtrl , " Optical Link Interrupt " , 1 ) ; vReadoutCtrl - > AddFrame ( bOpticalLinkInterrupt ) ;
2022-09-20 15:15:52 -04:00
bOpticalLinkInterrupt - > SetState ( kButtonUp ) ;
2022-09-21 16:05:51 -04:00
bOpticalLinkInterrupt - > Connect ( " Clicked() " , " BoardSetting " , this , " SetReadOutControl() " ) ;
2022-09-20 15:15:52 -04:00
2022-09-21 16:05:51 -04:00
bEventAligned = new TGCheckButton ( vReadoutCtrl , " Event Aligned Enabled " , 1 ) ; vReadoutCtrl - > AddFrame ( bEventAligned ) ;
2022-09-20 15:15:52 -04:00
bEventAligned - > SetState ( kButtonUp ) ;
2022-09-21 16:05:51 -04:00
bEventAligned - > Connect ( " Clicked() " , " BoardSetting " , this , " SetReadOutControl() " ) ;
2022-09-20 15:15:52 -04:00
2022-09-21 16:05:51 -04:00
bVMEAlogn64Mode = new TGCheckButton ( vReadoutCtrl , " 64-bit aligned " , 1 ) ; vReadoutCtrl - > AddFrame ( bVMEAlogn64Mode ) ;
2022-09-20 15:15:52 -04:00
bVMEAlogn64Mode - > SetState ( kButtonUp ) ;
2022-09-21 16:05:51 -04:00
bVMEAlogn64Mode - > Connect ( " Clicked() " , " BoardSetting " , this , " SetReadOutControl() " ) ;
2022-09-20 15:15:52 -04:00
2022-09-21 16:05:51 -04:00
bInteruptReleaseMode = new TGCheckButton ( vReadoutCtrl , " Interrupt Release on Acknowldge " , 1 ) ; vReadoutCtrl - > AddFrame ( bInteruptReleaseMode ) ;
2022-09-20 15:15:52 -04:00
bInteruptReleaseMode - > SetState ( kButtonUp ) ;
2022-09-21 16:05:51 -04:00
bInteruptReleaseMode - > Connect ( " Clicked() " , " BoardSetting " , this , " SetReadOutControl() " ) ;
2022-09-20 15:15:52 -04:00
2022-09-21 16:05:51 -04:00
bEnableExtendedBlockTransfer = new TGCheckButton ( vReadoutCtrl , " Enable Extended Block Transfer " , 1 ) ; vReadoutCtrl - > AddFrame ( bEnableExtendedBlockTransfer ) ;
2022-09-20 15:15:52 -04:00
bEnableExtendedBlockTransfer - > SetState ( kButtonUp ) ;
2022-09-21 16:05:51 -04:00
bEnableExtendedBlockTransfer - > Connect ( " Clicked() " , " BoardSetting " , this , " SetReadOutControl() " ) ;
2022-09-20 15:15:52 -04:00
}
2022-09-21 16:05:51 -04:00
2022-08-25 15:27:27 -04:00
2022-08-29 18:06:12 -04:00
///===== LVSD
TGHorizontalFrame * hframeLVSD = new TGHorizontalFrame ( vframe ) ; vframe - > AddFrame ( hframeLVSD , new TGLayoutHints ( kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
TGLabel * lbLVSD = new TGLabel ( hframeLVSD , " LVSD Control is not impletmented. " ) ; hframeLVSD - > AddFrame ( lbLVSD , new TGLayoutHints ( kLHintsCenterY | kLHintsLeft , 5 , 5 , 3 , 2 ) ) ;
2022-09-16 17:53:57 -04:00
///==================== Read digitizer Setting
ChangeBoard ( ) ;
2022-08-24 17:50:21 -04:00
2022-08-23 13:43:05 -04:00
fMain - > MapSubwindows ( ) ;
fMain - > Resize ( fMain - > GetDefaultSize ( ) ) ;
fMain - > MapWindow ( ) ;
2022-09-21 16:05:51 -04:00
isOpened = true ;
2022-09-20 15:15:52 -04:00
///Setup thread
2022-09-26 16:47:20 -04:00
///readStatusThread = new TThread("readStatus", ReadStatus, (void *) 1);
///if( digi != NULL ) readStatusThread->Run();
2022-08-23 13:43:05 -04:00
}
2022-09-21 16:05:51 -04:00
2022-08-23 13:43:05 -04:00
BoardSetting : : ~ BoardSetting ( ) {
isOpened = false ;
2022-09-20 15:15:52 -04:00
2022-09-21 16:05:51 -04:00
printf ( " close BoardSetting window \n " ) ;
2022-09-26 16:47:20 -04:00
//for( int i = 0; i < nDigi; i++) digi[i] = 0;
2022-09-23 16:40:59 -04:00
//pha = 0;
//psd = 0;
2022-09-26 16:47:20 -04:00
//delete readStatusThread;
2022-09-20 15:15:52 -04:00
2022-08-23 13:43:05 -04:00
fMain - > Cleanup ( ) ;
delete fMain ;
2022-08-25 15:27:27 -04:00
}
2022-09-23 12:36:31 -04:00
void BoardSetting : : LogMsg ( TString msg ) {
Emit ( " LogMsg(char*) " , msg . Data ( ) ) ;
2022-09-22 17:53:29 -04:00
}
2022-09-26 16:47:20 -04:00
void BoardSetting : : ReadStatus ( ) {
if ( digi = = NULL ) return ;
2022-09-20 15:15:52 -04:00
2022-09-21 16:05:51 -04:00
int boardID = boardIDEntry - > GetNumber ( ) ;
2022-09-26 16:47:20 -04:00
/// ACQ Status
2022-09-26 18:00:36 -04:00
///digi[boardID]->PrintRegister(Register::DPP::AcquisitionStatus, "ACQ Status");
2022-09-26 16:47:20 -04:00
uint32_t temp = digi [ boardID ] - > ReadRegister ( Register : : DPP : : AcquisitionStatus ) ;
txtACQStatus - > SetText ( ( ( temp > > 2 ) & 0x1 ) = = 0 ? " ACQ is stopped " : " ACQ is Running " , false ) ; txtACQStatus - > SetTextColor ( ( ( temp > > 2 ) & 0x1 ) = = 0 ? 1 : blue ) ;
txtACQEventReady - > SetText ( ( ( temp > > 3 ) & 0x1 ) = = 0 ? " no Event " : " Has Events " , false ) ; txtACQEventReady - > SetTextColor ( ( ( temp > > 3 ) & 0x1 ) = = 0 ? 1 : blue ) ;
txtACQEventFull - > SetText ( ( ( temp > > 4 ) & 0x1 ) = = 0 ? " no channel FULL " : " a channel FULL " , false ) ; txtACQEventFull - > SetTextColor ( ( ( temp > > 4 ) & 0x1 ) = = 0 ? 1 : red ) ;
txtACQClockSource - > SetText ( ( ( temp > > 5 ) & 0x1 ) = = 0 ? " Internal Clock " : " External Clock " , false ) ; txtACQClockSource - > SetTextColor ( ( ( temp > > 5 ) & 0x1 ) = = 0 ? 1 : blue ) ;
txtACQPLLLock - > SetText ( ( ( temp > > 7 ) & 0x1 ) = = 0 ? " PLL no lock " : " PLL locked " , false ) ; txtACQPLLLock - > SetTextColor ( ( ( temp > > 7 ) & 0x1 ) = = 0 ? 1 : blue ) ;
txtACQBoardReady - > SetText ( ( ( temp > > 8 ) & 0x1 ) = = 0 ? " Board NOT Ready (PLL & ADCs are NOT sync) " : " Board Ready (PLL & ADCs are sync) " , false ) ;
txtACQBoardReady - > SetTextColor ( ( ( temp > > 8 ) & 0x1 ) = = 0 ? red : 1 ) ;
txtACQChDown - > SetText ( ( ( temp > > 19 ) & 0x1 ) = = 0 ? " Channels are ON " : " Channels ShutDown " , false ) ;
txtACQChDown - > SetTextColor ( ( ( temp > > 19 ) & 0x1 ) = = 0 ? 1 : red ) ;
txtACQSIN - > SetText ( ( ( temp > > 15 ) & 0x1 ) = = 0 ? " S-IN = 0 " : " S-IN = 1 " , false ) ; txtACQSIN - > SetTextColor ( ( ( temp > > 15 ) & 0x1 ) = = 0 ? 1 : blue ) ;
txtACQTRIGIN - > SetText ( ( ( temp > > 16 ) & 0x1 ) = = 0 ? " TRG-IN = 0 " : " TRG-IN = 1 " , false ) ; txtACQTRIGIN - > SetTextColor ( ( ( temp > > 16 ) & 0x1 ) = = 0 ? 1 : blue ) ;
txtACQTemp0 - > SetText ( ( ( temp > > 20 ) & 0x1 ) = = 0 ? " < 70 " : " > 70 " , false ) ; txtACQTemp0 - > SetTextColor ( ( ( temp > > 20 ) & 0x1 ) = = 0 ? 1 : red ) ;
txtACQTemp1 - > SetText ( ( ( temp > > 21 ) & 0x1 ) = = 0 ? " < 70 " : " > 70 " , false ) ; txtACQTemp1 - > SetTextColor ( ( ( temp > > 21 ) & 0x1 ) = = 0 ? 1 : red ) ;
txtACQTemp2 - > SetText ( ( ( temp > > 22 ) & 0x1 ) = = 0 ? " < 70 " : " > 70 " , false ) ; txtACQTemp2 - > SetTextColor ( ( ( temp > > 22 ) & 0x1 ) = = 0 ? 1 : red ) ;
txtACQTemp3 - > SetText ( ( ( temp > > 23 ) & 0x1 ) = = 0 ? " < 70 " : " > 70 " , false ) ; txtACQTemp3 - > SetTextColor ( ( ( temp > > 23 ) & 0x1 ) = = 0 ? 1 : red ) ;
/// Redaout Status
2022-09-26 18:00:36 -04:00
///digi[boardID]->PrintRegister(Register::DPP::ReadoutStatus, "Readout Status");
2022-09-26 16:47:20 -04:00
temp = digi [ boardID ] - > ReadRegister ( Register : : DPP : : ReadoutStatus ) ;
if ( ( temp & 0x1 ) = = 1 ) {
txtEventReady - > SetText ( " Event Ready " , false ) ; txtEventReady - > SetTextColor ( blue ) ;
} else {
txtEventReady - > SetText ( " No Data Ready " , false ) ; txtEventReady - > SetTextColor ( red ) ;
}
2022-09-20 15:15:52 -04:00
2022-09-26 16:47:20 -04:00
if ( ( ( temp > > 2 ) & 0x1 ) = = 0 ) {
txtBusError - > SetText ( " no Bus Error " , false ) ; txtBusError - > SetTextColor ( blue ) ;
} else {
txtBusError - > SetText ( " Bus Error " , false ) ; txtBusError - > SetTextColor ( red ) ;
}
2022-09-20 15:15:52 -04:00
2022-09-26 16:47:20 -04:00
if ( ( ( temp > > 3 ) & 0x1 ) = = 0 ) {
2022-09-27 17:58:14 -04:00
txtVMEFIFO - > SetText ( " VME FIFO NOT EMPTY " , false ) ; txtVMEFIFO - > SetTextColor ( blue ) ;
2022-09-26 16:47:20 -04:00
} else {
txtVMEFIFO - > SetText ( " VME FIFO EMPTY " , false ) ; txtVMEFIFO - > SetTextColor ( red ) ;
}
///================ Board Failure Status
2022-09-26 18:00:36 -04:00
///digi[boardID]->PrintRegister(Register::DPP::BoardFailureStatus, "Board Fail");
temp = digi [ boardID ] - > ReadRegister ( Register : : DPP : : BoardFailureStatus ) ;
2022-09-26 16:47:20 -04:00
if ( ( ( temp > > 4 ) & 0x1 ) = = 0 ) {
enPLLStatus - > SetText ( " OK " , false ) ; enPLLStatus - > SetTextColor ( 1 ) ;
} else {
enPLLStatus - > SetText ( " Lost Lock " , false ) ; enPLLStatus - > SetTextColor ( red ) ;
2022-09-20 15:15:52 -04:00
}
2022-09-26 16:47:20 -04:00
if ( ( ( temp > > 5 ) & 0x1 ) = = 0 ) {
enTempStatus - > SetText ( " OK " , false ) ; enTempStatus - > SetTextColor ( 1 ) ;
} else {
enTempStatus - > SetText ( " Failure " , false ) ; enTempStatus - > SetTextColor ( red ) ;
}
if ( ( ( temp > > 6 ) & 0x1 ) = = 0 ) {
enADCPwrStatus - > SetText ( " OK " , false ) ; enADCPwrStatus - > SetTextColor ( 1 ) ;
} else {
enADCPwrStatus - > SetText ( " Failure " , false ) ; enADCPwrStatus - > SetTextColor ( red ) ;
}
2022-09-20 15:15:52 -04:00
}
2022-08-23 13:43:05 -04:00
void BoardSetting : : ChangeBoard ( ) {
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-16 17:53:57 -04:00
if ( digi = = NULL ) {
printf ( " no didgitizers \n " ) ;
2022-09-20 15:15:52 -04:00
return ;
2022-09-16 17:53:57 -04:00
}
2022-09-21 16:05:51 -04:00
int boardID = boardIDEntry - > GetNumber ( ) ;
2022-09-16 17:53:57 -04:00
for ( int i = 0 ; i < NUM_BOARD_INFO ; i + + ) {
switch ( i ) {
case 0 : entry [ i ] - > SetText ( Form ( " %s " , ( digi [ boardID ] - > GetModelName ( ) ) . c_str ( ) ) ) ; break ;
case 1 :
switch ( digi [ boardID ] - > GetDPPType ( ) ) {
2022-09-22 16:26:33 -04:00
case V1724_DPP_PHA_CODE : entry [ i ] - > SetText ( " DPP-PHA " , false ) ; break ;
case V1720_DPP_CI_CODE : entry [ i ] - > SetText ( " DPP-CI " , false ) ; break ;
case V1720_DPP_PSD_CODE : entry [ i ] - > SetText ( " DPP-PSD " , false ) ; break ;
case V1751_DPP_PSD_CODE : entry [ i ] - > SetText ( " DPP-PSD " , false ) ; break ;
case V1751_DPP_ZLE_CODE : entry [ i ] - > SetText ( " DPP-ZLE " , false ) ; break ;
case V1743_DPP_CI_CODE : entry [ i ] - > SetText ( " DPP-PSD " , false ) ; break ;
case V1740_DPP_QDC_CODE : entry [ i ] - > SetText ( " DPP-QDC " , false ) ; break ;
case V1730_DPP_PSD_CODE : entry [ i ] - > SetText ( " DPP-PSD " , false ) ; break ;
case V1730_DPP_PHA_CODE : entry [ i ] - > SetText ( " DPP-PHA " , false ) ; break ;
case V1730_DPP_ZLE_CODE : entry [ i ] - > SetText ( " DPP-ZLE " , false ) ; break ;
case V1730_DPP_DAW_CODE : entry [ i ] - > SetText ( " DPP-DAW " , false ) ; break ;
2022-09-16 17:53:57 -04:00
}
break ;
2022-09-22 16:26:33 -04:00
case 2 : entry [ i ] - > SetText ( Form ( " %s " , digi [ boardID ] - > GetLinkType ( ) = = CAEN_DGTZ_USB ? " USB " : " Optical Link " ) , false ) ; break ;
case 3 : entry [ i ] - > SetText ( Form ( " %d " , digi [ boardID ] - > GetSerialNumber ( ) ) , false ) ; break ;
case 4 : entry [ i ] - > SetText ( Form ( " %d " , digi [ boardID ] - > GetNChannel ( ) ) , false ) ; break ;
case 5 : entry [ i ] - > SetText ( Form ( " %0.f MHz = %.1f ns " , 1000 / digi [ boardID ] - > GetCh2ns ( ) , digi [ boardID ] - > GetCh2ns ( ) ) , false ) ; break ;
case 6 : entry [ i ] - > SetText ( Form ( " %d " , digi [ boardID ] - > GetADCBits ( ) ) , false ) ; break ;
case 7 : entry [ i ] - > SetText ( Form ( " %s " , ( digi [ boardID ] - > GetROCVersion ( ) ) . c_str ( ) ) , false ) ; break ;
case 8 : entry [ i ] - > SetText ( Form ( " %s " , ( digi [ boardID ] - > GetAMCVersion ( ) ) . c_str ( ) ) , false ) ; break ;
2022-09-16 17:53:57 -04:00
}
}
2022-09-23 16:40:59 -04:00
cbAggOrg - > Select ( digi [ boardID ] - > ReadRegister ( Register : : DPP : : AggregateOrganization ) , false ) ;
numAggBLT - > SetNumber ( digi [ boardID ] - > ReadRegister ( Register : : DPP : : MaxAggregatePerBlockTransfer ) , false ) ;
2022-09-26 18:00:36 -04:00
if ( digi [ boardID ] - > GetNChannel ( ) = = 8 ) {
///FAN Speed control only for desktop version
cbFanCtrl - > SetEnabled ( true ) ;
cbFanCtrl - > Select ( digi [ boardID ] - > ReadRegister ( Register : : DPP : : FanSpeedControl ) , false ) ;
} else {
cbFanCtrl - > SetEnabled ( false ) ;
cbFanCtrl - > Select ( 0 , false ) ;
}
2022-09-23 16:40:59 -04:00
numRunStartStopDelay - > SetNumber ( digi [ boardID ] - > ReadRegister ( Register : : DPP : : RunStartStopDelay ) , false ) ;
bEnableExtTRG - > SetState ( ( digi [ boardID ] - > ReadRegister ( Register : : DPP : : DisableExternalTrigger ) & 0x1 ) ? kButtonDown : kButtonUp , false ) ;
2022-09-26 18:00:36 -04:00
///numExtendVetoDelay->SetNumber( digi[boardID]->ReadRegister(Register::DPP::ExtendedVetoDelay) , false);
2022-09-23 16:40:59 -04:00
cbAnaMonitor - > Select ( digi [ boardID ] - > ReadRegister ( Register : : DPP : : AnalogMonitorMode ) & 0x7 , false ) ;
numBufferOccpGain - > SetNumber ( digi [ boardID ] - > ReadRegister ( Register : : DPP : : BufferOccupancyGain ) & 0xf , false ) ;
2022-09-26 16:47:20 -04:00
ReadStatus ( ) ;
2022-09-23 16:40:59 -04:00
/// ACQ Control
//digi[boardID]->PrintRegister(Register::DPP::AcquisitionControl, "AcquisitionControl");
2022-09-26 16:47:20 -04:00
uint32_t tempBits = digi [ boardID ] - > ReadRegister ( Register : : DPP : : AcquisitionControl ) ;
2022-09-23 16:40:59 -04:00
cbAcqMode - > Select ( tempBits & 0x3 , false ) ;
bAcqArm - > SetState ( ( ( tempBits > > 2 ) & 0x1 ) ? kButtonDown : kButtonUp , false ) ;
cbPLLref - > Select ( ( ( tempBits > > 6 ) & 0x1 ) , false ) ;
/// Global Trigger Mask
tempBits = digi [ boardID ] - > ReadRegister ( Register : : DPP : : GlobalTriggerMask ) ;
for ( int i = 0 ; i < 8 ; i + + ) {
cbGbTRGMskCh [ i ] - > SetState ( ( ( tempBits > > i ) & 0x1 ) = = 0 ? kButtonUp : kButtonDown , false ) ;
}
numMajorCoinWin - > SetNumber ( ( tempBits > > 20 ) & 0x7 , false ) ;
GlbMajorLevel - > SetNumber ( ( tempBits > > 24 ) & 0x7 , false ) ;
bGLBExtTrigger - > SetState ( ( ( tempBits > > 30 ) & 0x1 ) = = 0 ? kButtonUp : kButtonDown , false ) ;
bGLBSoftwareTrigger - > SetState ( ( ( tempBits > > 31 ) & 0x1 ) = = 0 ? kButtonUp : kButtonDown , false ) ;
/// Trigger Validation Mask
tempBits = digi [ boardID ] - > ReadRegister ( Register : : DPP : : TriggerValidationMask ) ;
for ( int i = 0 ; i < 8 ; i + + ) {
cbTRGValMskCh [ i ] - > SetState ( ( ( tempBits > > i ) & 0x1 ) = = 0 ? kButtonUp : kButtonDown , false ) ;
}
cbTRGMODE - > Select ( ( tempBits > > 8 ) & 0x3 , false ) ;
TRGMajorLevel - > SetNumber ( ( tempBits > > 10 ) & 0x3 , false ) ;
bTRGExtTrigger - > SetState ( ( ( tempBits > > 30 ) & 0x1 ) = = 0 ? kButtonUp : kButtonDown , false ) ;
bTRGSoftwareTrigger - > SetState ( ( ( tempBits > > 31 ) & 0x1 ) = = 0 ? kButtonUp : kButtonDown , false ) ;
/// Front Panel TRG-OUT Enable Mask , PHA = PSD only for bit[19:0]
tempBits = digi [ boardID ] - > ReadRegister ( Register : : DPP : : FrontPanelTRGOUTEnableMask ) ;
for ( int i = 0 ; i < 8 ; i + + ) {
cbTRGOUTMskCh [ i ] - > SetState ( ( ( tempBits > > i ) & 0x1 ) = = 0 ? kButtonUp : kButtonDown , false ) ;
}
cbTRGOUTMODE - > Select ( ( tempBits > > 8 ) & 0x3 , false ) ;
TRGOUTMajorLevel - > SetNumber ( ( tempBits > > 10 ) & 0x7 , false ) ;
bTRGOUTExtTrigger - > SetState ( ( ( tempBits > > 30 ) & 0x1 ) = = 0 ? kButtonUp : kButtonDown , false ) ;
bTRGOUTSoftwareTrigger - > SetState ( ( ( tempBits > > 30 ) & 0x1 ) = = 0 ? kButtonUp : kButtonDown , false ) ;
/// Front Panel I/O Control, PHA = PSD only for bit[19:0]
tempBits = digi [ boardID ] - > ReadRegister ( Register : : DPP : : FrontPanelIOControl ) ;
cbLEMOIO - > Select ( tempBits & 0x1 , false ) ;
if ( ( ( tempBits > > 1 ) & 0x1 ) = = 0 ) {
2022-09-27 17:58:14 -04:00
cbTRGOUTmode - > Select ( 2 , false ) ;
2022-09-23 16:40:59 -04:00
} else {
2022-09-27 17:58:14 -04:00
cbTRGOUTmode - > Select ( ( tempBits ) & 0x3F000 , false ) ;
2022-09-23 16:40:59 -04:00
}
cbTRGINCtrl - > Select ( ( tempBits > > 10 ) & 0x1 , false ) ;
cbTRGINMezzanines - > Select ( ( tempBits > > 11 ) & 0x1 , false ) ;
/// Readout Control
tempBits = digi [ boardID ] - > ReadRegister ( Register : : DPP : : ReadoutControl ) ;
cbVMEInterrupLevel - > Select ( tempBits & 0x3 , false ) ;
bOpticalLinkInterrupt - > SetState ( ( ( tempBits > > 3 ) & 0x1 ) = = 0 ? kButtonUp : kButtonDown , false ) ;
bEventAligned - > SetState ( ( ( tempBits > > 4 ) & 0x1 ) = = 0 ? kButtonUp : kButtonDown , false ) ;
bVMEAlogn64Mode - > SetState ( ( ( tempBits > > 5 ) & 0x1 ) = = 0 ? kButtonUp : kButtonDown , false ) ;
bInteruptReleaseMode - > SetState ( ( ( tempBits > > 7 ) & 0x1 ) = = 0 ? kButtonUp : kButtonDown , false ) ;
bEnableExtendedBlockTransfer - > SetState ( ( ( tempBits > > 8 ) & 0x1 ) = = 0 ? kButtonUp : kButtonDown , false ) ;
2022-09-16 17:53:57 -04:00
if ( digi [ boardID ] - > GetDPPType ( ) = = V1730_DPP_PHA_CODE ) {
2022-09-23 16:40:59 -04:00
bDecimateWF - > SetEnabled ( true ) ;
2022-09-16 17:53:57 -04:00
2022-09-23 16:40:59 -04:00
cbAP1 - > RemoveAll ( ) ;
cbAP1 - > AddEntry ( " Input " , 0 ) ;
cbAP1 - > AddEntry ( " RC-CR (1st derivative) " , 1 ) ;
cbAP1 - > AddEntry ( " RC-CR2 (2st derivative) " , 2 ) ;
cbAP1 - > AddEntry ( " Trapezoid " , 3 ) ;
2022-09-16 17:53:57 -04:00
2022-09-23 16:40:59 -04:00
cbAP2 - > SetEnabled ( true ) ;
cbAP2 - > RemoveAll ( ) ;
2022-09-27 17:58:14 -04:00
cbAP2 - > AddEntry ( " N/A " , - 3 ) ;
2022-09-23 16:40:59 -04:00
cbAP2 - > AddEntry ( " Input " , 0 ) ;
cbAP2 - > AddEntry ( " Threshold " , 1 ) ;
cbAP2 - > AddEntry ( " Trapezoid - Baseline " , 2 ) ;
cbAP2 - > AddEntry ( " Baseline " , 3 ) ;
2022-09-19 12:46:27 -04:00
2022-09-23 16:40:59 -04:00
cbDP1 - > RemoveAll ( ) ;
cbDP1 - > AddEntry ( " Peaking " , 0 ) ;
cbDP1 - > AddEntry ( " Armed (Triggered) " , 1 ) ;
cbDP1 - > AddEntry ( " Peak Run " , 2 ) ;
cbDP1 - > AddEntry ( " Pile-Up " , 3 ) ;
2022-09-29 15:26:40 -04:00
cbDP1 - > AddEntry ( " Peaking " , 4 ) ; ///Duplicated?
2022-09-23 16:40:59 -04:00
cbDP1 - > AddEntry ( " TRG Validation Win. " , 5 ) ;
cbDP1 - > AddEntry ( " Baseline freeze " , 6 ) ;
cbDP1 - > AddEntry ( " TRG holdoff " , 7 ) ;
cbDP1 - > AddEntry ( " TRG Validation " , 8 ) ;
cbDP1 - > AddEntry ( " ACQ busy " , 9 ) ;
cbDP1 - > AddEntry ( " Zero Cross " , 10 ) ;
cbDP1 - > AddEntry ( " Ext. TRG " , 11 ) ;
cbDP1 - > AddEntry ( " Memory full " , 12 ) ;
2022-09-19 12:46:27 -04:00
2022-09-23 16:40:59 -04:00
cbDP2 - > RemoveAll ( ) ;
2022-09-27 17:58:14 -04:00
cbDP2 - > AddEntry ( " N/A " , - 3 ) ;
2022-09-23 16:40:59 -04:00
cbDP2 - > AddEntry ( " Trigger " , 0 ) ;
cbDP2 - > SetEnabled ( false ) ;
2022-09-27 17:58:14 -04:00
cbDP2 - > Select ( - 3 , false ) ;
2022-09-23 16:40:59 -04:00
/// Board Configuration
//digi[boardID]->PrintRegister(Register::DPP::BoardConfiguration, "BoardConfiguration");
tempBits = digi [ boardID ] - > ReadRegister ( Register : : DPP : : BoardConfiguration ) ;
bAutoDataFlush - > SetState ( ( tempBits & 0x1 ) ? kButtonDown : kButtonUp , false ) ;
bDecimateWF - > SetState ( ( ( tempBits > > 1 ) & 0x1 ) ? kButtonDown : kButtonUp , false ) ;
bWFRecord - > SetState ( ( ( tempBits > > 16 ) & 0x1 ) ? kButtonDown : kButtonUp , false ) ;
bTrigPropa - > SetState ( ( ( tempBits > > 2 ) & 0x1 ) ? kButtonDown : kButtonUp , false ) ;
bExtrac2 - > SetState ( ( ( tempBits > > 17 ) & 0x1 ) ? kButtonDown : kButtonUp , false ) ;
2022-09-26 18:00:36 -04:00
2022-09-27 17:58:14 -04:00
//TODO remove bDualTrace, when cbAP2 is not -1, DualTrace is on
2022-09-26 18:00:36 -04:00
if ( ( tempBits > > 11 ) & 0x1 ) {
bDualTrace - > SetState ( kButtonDown , false ) ;
cbAP2 - > SetEnabled ( true ) ;
2022-09-27 17:58:14 -04:00
cbAP2 - > Select ( ( ( tempBits > > 14 ) & 0x3 ) , false ) ;
2022-09-26 18:00:36 -04:00
} else {
bDualTrace - > SetState ( kButtonUp , false ) ;
cbAP2 - > SetEnabled ( false ) ;
2022-09-27 17:58:14 -04:00
cbAP2 - > Select ( - 3 , false ) ;
2022-09-26 18:00:36 -04:00
}
2022-09-23 16:40:59 -04:00
cbAP1 - > Select ( ( ( tempBits > > 12 ) & 0x3 ) , false ) ;
cbDP1 - > Select ( ( ( tempBits > > 20 ) & 0x7 ) , false ) ;
2022-09-19 12:46:27 -04:00
2022-09-23 16:40:59 -04:00
} else if ( digi [ boardID ] - > GetDPPType ( ) = = V1730_DPP_PSD_CODE ) {
2022-09-19 12:46:27 -04:00
2022-09-23 16:40:59 -04:00
bDecimateWF - > SetEnabled ( false ) ;
cbDP2 - > SetEnabled ( true ) ;
2022-09-19 12:46:27 -04:00
2022-09-23 16:40:59 -04:00
cbAP1 - > RemoveAll ( ) ;
cbAP1 - > AddEntry ( " Input " , 0 ) ;
cbAP1 - > AddEntry ( " CFD " , 1 ) ;
cbAP1 - > AddEntry ( " Input " , 2 ) ;
2022-09-19 16:01:03 -04:00
2022-09-23 16:40:59 -04:00
cbAP2 - > SetEnabled ( false ) ;
cbAP2 - > RemoveAll ( ) ;
2022-09-27 17:58:14 -04:00
cbAP2 - > AddEntry ( " N/A " , - 3 ) ;
2022-09-23 16:40:59 -04:00
cbAP2 - > AddEntry ( " Baseline " , 0 ) ;
cbAP2 - > AddEntry ( " CFD " , 1 ) ;
cbDP1 - > RemoveAll ( ) ;
cbDP1 - > AddEntry ( " Long Gate " , 0 ) ;
cbDP1 - > AddEntry ( " Over Threshold " , 1 ) ;
cbDP1 - > AddEntry ( " Shaped TRG " , 2 ) ;
cbDP1 - > AddEntry ( " TRG Val. Accep. Win. " , 3 ) ;
cbDP1 - > AddEntry ( " Pile Up " , 4 ) ;
cbDP1 - > AddEntry ( " Coincidence " , 5 ) ;
cbDP1 - > AddEntry ( " Trigger " , 7 ) ;
cbDP2 - > RemoveAll ( ) ;
cbDP2 - > AddEntry ( " Short Gate " , 0 ) ;
cbDP2 - > AddEntry ( " Over Threshold " , 1 ) ;
cbDP2 - > AddEntry ( " TRG Validation " , 2 ) ;
cbDP2 - > AddEntry ( " TRG Holdoff " , 3 ) ;
cbDP2 - > AddEntry ( " PileUp Trigger " , 4 ) ;
cbDP2 - > AddEntry ( " PSD Cut hight " , 5 ) ;
cbDP2 - > AddEntry ( " Baseline freeze " , 6 ) ;
cbDP2 - > AddEntry ( " Trigger " , 7 ) ;
2022-09-19 16:01:03 -04:00
2022-09-23 16:40:59 -04:00
tempBits = digi [ boardID ] - > ReadRegister ( Register : : DPP : : BoardConfiguration ) ;
2022-09-19 12:46:27 -04:00
2022-09-23 16:40:59 -04:00
bAutoDataFlush - > SetState ( ( tempBits & 0x1 ) ? kButtonDown : kButtonUp , false ) ;
bTrigPropa - > SetState ( ( ( tempBits > > 2 ) & 0x1 ) ? kButtonDown : kButtonUp , false ) ;
2022-09-21 16:05:51 -04:00
2022-09-23 16:40:59 -04:00
if ( ( ( tempBits > > 11 ) & 0x1 ) = = 1 ) { /// Dual Trace
bDualTrace - > SetState ( kButtonDown , false ) ;
switch ( ( tempBits > > 12 ) & 0x3 ) {
case 0 : {
cbAP1 - > Select ( 0 , false ) ;
cbAP2 - > Select ( 0 , false ) ;
} ; break ;
case 1 : {
cbAP1 - > Select ( 1 , false ) ;
cbAP2 - > Select ( 0 , false ) ;
} ; break ;
case 2 : {
cbAP1 - > Select ( 2 , false ) ;
cbAP2 - > Select ( 1 , false ) ;
} ; break ;
}
2022-09-21 16:05:51 -04:00
} else {
2022-09-23 16:40:59 -04:00
bDualTrace - > SetState ( kButtonUp , false ) ;
cbAP1 - > Select ( ( ( tempBits > > 12 ) & 0x3 ) , false ) ;
cbAP2 - > Select ( - 1 , false ) ;
2022-09-21 16:05:51 -04:00
}
2022-09-19 12:46:27 -04:00
2022-09-23 16:40:59 -04:00
bWFRecord - > SetState ( ( ( tempBits > > 16 ) & 0x1 ) ? kButtonDown : kButtonUp , false ) ;
bExtrac2 - > SetState ( ( ( tempBits > > 17 ) & 0x1 ) ? kButtonDown : kButtonUp , false ) ;
2022-09-19 12:46:27 -04:00
2022-09-23 16:40:59 -04:00
cbDP1 - > Select ( ( ( tempBits > > 23 ) & 0x7 ) , false ) ;
cbDP2 - > Select ( ( ( tempBits > > 26 ) & 0x7 ) , false ) ;
2022-09-19 12:46:27 -04:00
2022-09-21 16:05:51 -04:00
}
return ;
}
//################################################ Change Settings
2022-09-23 17:43:30 -04:00
void BoardSetting : : OpenChannelSetting ( ) {
printf ( " === %s \n " , __func__ ) ;
Int_t boardID = boardIDEntry - > GetNumber ( ) ;
Haha ( boardID ) ;
}
void BoardSetting : : Haha ( Int_t boardID ) { /// this is for sending signal to mainwindow to open channel setting for the board
printf ( " === %s \n " , __func__ ) ;
Emit ( " Haha(Int_t) " , boardID ) ;
}
2022-09-21 16:05:51 -04:00
void BoardSetting : : ResetSettingToDefault ( ) { /// same for PHA and PSD
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-21 16:05:51 -04:00
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
2022-09-27 17:58:14 -04:00
digi [ boardID ] - > Reset ( ) ;
2022-09-21 16:05:51 -04:00
digi [ boardID ] - > WriteRegister ( Register : : DPP : : SoftwareReset , 1 ) ;
2022-09-27 17:58:14 -04:00
ChangeBoard ( ) ;
2022-09-21 16:05:51 -04:00
}
void BoardSetting : : ClearBuffer ( ) { /// same for PHA and PSD
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-21 16:05:51 -04:00
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
digi [ boardID ] - > WriteRegister ( Register : : DPP : : SoftwareClear , 1 ) ;
2022-09-27 17:58:14 -04:00
ReadStatus ( ) ;
2022-09-21 16:05:51 -04:00
}
void BoardSetting : : SetBoardConfiguration ( ) {
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-21 16:05:51 -04:00
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
2022-09-26 18:00:36 -04:00
uint32_t bit = ( 3 < < 18 ) ; /// timestamp and energy recording
2022-09-21 16:05:51 -04:00
if ( digi [ boardID ] - > GetDPPType ( ) = = V1730_DPP_PHA_CODE ) {
2022-09-19 12:46:27 -04:00
2022-09-28 16:45:59 -04:00
bit + = ( 34 < < 3 ) ; /// Reserved must be 0010010 for bit[10:3]
2022-09-27 17:58:14 -04:00
if ( bAutoDataFlush - > GetState ( ) = = kButtonDown ) { bit + = 1 ; } ;
2022-09-21 16:05:51 -04:00
if ( bDecimateWF - > GetState ( ) = = kButtonDown ) bit + = ( 1 < < 1 ) ;
if ( bWFRecord - > GetState ( ) = = kButtonDown ) bit + = ( 1 < < 16 ) ;
if ( bTrigPropa - > GetState ( ) = = kButtonDown ) bit + = ( 1 < < 2 ) ;
if ( bExtrac2 - > GetState ( ) = = kButtonDown ) bit + = ( 1 < < 17 ) ;
2022-09-23 16:40:59 -04:00
if ( bDualTrace - > GetState ( ) = = kButtonDown ) {
bit + = ( 1 < < 11 ) ;
cbAP2 - > SetEnabled ( true ) ;
} else {
cbAP2 - > SetEnabled ( false ) ;
2022-09-27 17:58:14 -04:00
cbAP2 - > Select ( - 3 , false ) ;
2022-09-23 16:40:59 -04:00
}
2022-09-27 17:58:14 -04:00
if ( cbAP2 - > GetSelected ( ) > 0 ) bit + = ( cbAP2 - > GetSelected ( ) < < 14 ) ;
2022-09-21 16:05:51 -04:00
bit + = ( cbAP1 - > GetSelected ( ) < < 12 ) ;
bit + = ( cbDP1 - > GetSelected ( ) < < 20 ) ;
}
if ( digi [ boardID ] - > GetDPPType ( ) = = V1730_DPP_PSD_CODE ) {
2022-09-23 16:40:59 -04:00
bit + = ( 18 < < 3 ) ; /// Reserved must be 0010010 for bit[10:3]
if ( bAutoDataFlush - > GetState ( ) = = kButtonDown ) bit + = 1 ;
if ( bDecimateWF - > GetState ( ) = = kButtonDown ) bit + = ( 1 < < 1 ) ;
if ( bWFRecord - > GetState ( ) = = kButtonDown ) bit + = ( 1 < < 16 ) ;
if ( bTrigPropa - > GetState ( ) = = kButtonDown ) bit + = ( 1 < < 2 ) ;
if ( bExtrac2 - > GetState ( ) = = kButtonDown ) bit + = ( 1 < < 17 ) ;
if ( bDualTrace - > GetState ( ) = = kButtonDown ) bit + = ( 1 < < 11 ) ;
bit + = ( cbAP1 - > GetSelected ( ) < < 12 ) ;
bit + = ( cbDP1 - > GetSelected ( ) < < 23 ) ;
bit + = ( cbDP2 - > GetSelected ( ) < < 26 ) ;
2022-09-19 12:46:27 -04:00
2022-09-16 17:53:57 -04:00
}
2022-09-21 16:05:51 -04:00
printf ( " bit : 0x%x \n " , bit ) ;
digi [ boardID ] - > WriteRegister ( Register : : DPP : : BoardConfiguration , bit ) ;
}
void BoardSetting : : SetAggregateOrganization ( ) { /// same for PHA and PSD
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-21 16:05:51 -04:00
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
digi [ boardID ] - > WriteRegister ( Register : : DPP : : AggregateOrganization , cbAggOrg - > GetSelected ( ) ) ;
2022-09-19 12:46:27 -04:00
2022-09-21 16:05:51 -04:00
}
2022-08-23 13:43:05 -04:00
2022-09-21 16:05:51 -04:00
void BoardSetting : : SetReadOutAggregate ( ) { /// same for PHA and PSD
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-21 16:05:51 -04:00
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
digi [ boardID ] - > WriteRegister ( Register : : DPP : : MaxAggregatePerBlockTransfer , ( unsigned int ) numAggBLT - > GetNumber ( ) ) ;
2022-08-23 13:43:05 -04:00
}
2022-08-24 17:50:21 -04:00
2022-09-21 16:05:51 -04:00
void BoardSetting : : SetFanSpeedControl ( ) { /// same for PHA and PSD
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-21 16:05:51 -04:00
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
digi [ boardID ] - > WriteRegister ( Register : : DPP : : FanSpeedControl , cbFanCtrl - > GetSelected ( ) ) ;
2022-08-24 17:50:21 -04:00
}
2022-09-21 16:05:51 -04:00
void BoardSetting : : SetACQControl ( ) { /// same for PHA and PSD
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-21 16:05:51 -04:00
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
uint32_t bit = 0 ;
bit + = ( cbAcqMode - > GetSelected ( ) ) ;
bit + = ( bAcqArm - > GetState ( ) = = kButtonDown ? ( 1 < < 2 ) : 0 ) ;
bit + = ( cbPLLref - > GetSelected ( ) < < 6 ) ;
printf ( " bit : 0x%x \n " , bit ) ;
digi [ boardID ] - > WriteRegister ( Register : : DPP : : AcquisitionControl , bit ) ;
2022-09-27 17:58:14 -04:00
ReadStatus ( ) ;
2022-08-24 17:50:21 -04:00
}
2022-09-21 16:05:51 -04:00
void BoardSetting : : SendSoftwareTriggerSignal ( ) { /// same for PHA and PSD
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-21 16:05:51 -04:00
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
digi [ boardID ] - > WriteRegister ( Register : : DPP : : SoftwareTrigger , 1 ) ;
2022-09-27 17:58:14 -04:00
ReadStatus ( ) ;
2022-08-24 17:50:21 -04:00
}
2022-09-21 16:05:51 -04:00
void BoardSetting : : SendSoftwareClockSyncSignal ( ) { /// same for PHA and PSD
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-21 16:05:51 -04:00
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
digi [ boardID ] - > WriteRegister ( Register : : DPP : : SoftwareClockSync , 1 ) ;
2022-08-24 17:50:21 -04:00
}
2022-09-21 16:05:51 -04:00
void BoardSetting : : SetRunStartStopDelay ( ) { /// same for PHA and PSD
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-21 16:05:51 -04:00
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
digi [ boardID ] - > WriteRegister ( Register : : DPP : : RunStartStopDelay , ( unsigned int ) numRunStartStopDelay - > GetNumber ( ) ) ;
2022-08-24 17:50:21 -04:00
}
2022-09-21 16:05:51 -04:00
void BoardSetting : : SetGlobalTriggerMask ( ) { /// same for PHA and PSD
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-21 16:05:51 -04:00
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
uint32_t bit = 0 ;
for ( int i = 0 ; i < 8 ; i + + ) bit + = ( ( cbGbTRGMskCh [ i ] - > GetState ( ) = = kButtonDown ) ? ( 1 < < i ) : 0 ) ;
bit + = ( ( ( unsigned int ) numMajorCoinWin - > GetNumber ( ) ) < < 20 ) ;
bit + = ( ( ( unsigned int ) GlbMajorLevel - > GetNumber ( ) ) < < 24 ) ;
bit + = ( ( bGLBExtTrigger - > GetState ( ) = = kButtonDown ) ? ( 1 < < 30 ) : 0 ) ;
bit + = ( ( bGLBSoftwareTrigger - > GetState ( ) = = kButtonDown ) ? ( 1 < < 31 ) : 0 ) ;
printf ( " bit : 0x%x \n " , bit ) ;
digi [ boardID ] - > WriteRegister ( Register : : DPP : : GlobalTriggerMask , bit ) ;
2022-08-24 17:50:21 -04:00
}
2022-09-21 16:05:51 -04:00
void BoardSetting : : SetTriggerValidMask ( ) { /// same for PHA and PSD
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-21 16:05:51 -04:00
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
uint32_t bit = 0 ;
for ( int i = 0 ; i < 8 ; i + + ) bit + = ( ( cbTRGValMskCh [ i ] - > GetState ( ) = = kButtonDown ) ? ( 1 < < i ) : 0 ) ;
bit + = ( ( cbTRGMODE - > GetSelected ( ) < < 8 ) ) ;
bit + = ( ( ( unsigned int ) TRGMajorLevel - > GetNumber ( ) ) < < 24 ) ;
bit + = ( ( bTRGExtTrigger - > GetState ( ) = = kButtonDown ) ? ( 1 < < 30 ) : 0 ) ;
bit + = ( ( bTRGSoftwareTrigger - > GetState ( ) = = kButtonDown ) ? ( 1 < < 31 ) : 0 ) ;
printf ( " bit : 0x%x \n " , bit ) ;
2022-08-24 17:50:21 -04:00
2022-09-21 16:05:51 -04:00
digi [ boardID ] - > WriteRegister ( Register : : DPP : : TriggerValidationMask , bit ) ;
2022-08-24 17:50:21 -04:00
}
2022-09-21 16:05:51 -04:00
void BoardSetting : : SetTRGOUTMask ( ) { /// same for PHA and PSD
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-21 16:05:51 -04:00
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
uint32_t bit = 0 ;
for ( int i = 0 ; i < 8 ; i + + ) bit + = ( ( cbTRGOUTMskCh [ i ] - > GetState ( ) = = kButtonDown ) ? ( 1 < < i ) : 0 ) ;
bit + = ( ( cbTRGOUTMODE - > GetSelected ( ) < < 8 ) ) ;
bit + = ( ( ( unsigned int ) TRGOUTMajorLevel - > GetNumber ( ) ) < < 24 ) ;
bit + = ( ( bTRGOUTExtTrigger - > GetState ( ) = = kButtonDown ) ? ( 1 < < 30 ) : 0 ) ;
bit + = ( ( bTRGOUTSoftwareTrigger - > GetState ( ) = = kButtonDown ) ? ( 1 < < 31 ) : 0 ) ;
printf ( " bit : 0x%x \n " , bit ) ;
digi [ boardID ] - > WriteRegister ( Register : : DPP : : FrontPanelTRGOUTEnableMask , bit ) ;
2022-08-24 17:50:21 -04:00
}
2022-09-21 16:05:51 -04:00
void BoardSetting : : SetEnableExternalTrigger ( ) { /// same for PHA and PSD
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-21 16:05:51 -04:00
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
2022-08-24 17:50:21 -04:00
2022-09-21 16:05:51 -04:00
if ( bEnableExtTRG - > GetState ( ) = = kButtonDown ) {
digi [ boardID ] - > WriteRegister ( Register : : DPP : : DisableExternalTrigger , 0x1 ) ;
}
2022-08-24 17:50:21 -04:00
}
2022-09-21 16:05:51 -04:00
void BoardSetting : : SetExtendedVetoDelay ( ) { /// same for PHA and PSD
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-21 16:05:51 -04:00
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
2022-09-26 18:00:36 -04:00
///digi[boardID]->WriteRegister(Register::DPP::ExtendedVetoDelay, (unsigned int) numExtendVetoDelay->GetNumber() );
2022-08-24 17:50:21 -04:00
}
2022-09-21 16:05:51 -04:00
void BoardSetting : : SetFrontPanelIO ( ) { /// bit[20] different, bit[20] (PSD) not impletemented, PHA, bit[20] not use
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-21 16:05:51 -04:00
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
uint32_t bit = 0 ;
bit + = ( cbLEMOIO - > GetSelected ( ) ) ;
2022-09-26 18:00:36 -04:00
bit + = cbTRGOUTmode - > GetSelected ( ) ;
//if( cbTRGOUTmode->GetSelected() != 2 ) { /// has TRG-OUT
// bit += cbTRGOUTmode->GetSelected() ;
//}else{
// bit += 0x2; /// TRG-OUT (high0impedance) or off
//}
2022-09-21 16:05:51 -04:00
bit + = ( cbTRGINCtrl - > GetSelected ( ) < < 10 ) ;
bit + = ( cbTRGINMezzanines - > GetSelected ( ) < < 11 ) ;
///bit[20] = 0 by default.
printf ( " bit : 0x%x \n " , bit ) ;
digi [ boardID ] - > WriteRegister ( Register : : DPP : : FrontPanelIOControl , bit ) ;
2022-08-24 17:50:21 -04:00
}
2022-09-16 17:53:57 -04:00
2022-09-21 16:05:51 -04:00
void BoardSetting : : SetAnalogMonitorMode ( ) { /// same for PHA and PSD
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-21 16:05:51 -04:00
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
digi [ boardID ] - > WriteRegister ( Register : : DPP : : AnalogMonitorMode , cbAnaMonitor - > GetSelected ( ) ) ;
2022-09-16 17:53:57 -04:00
if ( cbAnaMonitor - > GetSelected ( ) = = 3 ) {
numBufferOccpGain - > SetState ( true ) ;
2022-09-21 16:05:51 -04:00
digi [ boardID ] - > WriteRegister ( Register : : DPP : : BufferOccupancyGain , ( int ) numBufferOccpGain - > GetNumber ( ) ) ;
2022-09-16 17:53:57 -04:00
} else {
numBufferOccpGain - > SetState ( false ) ;
}
}
2022-09-21 16:05:51 -04:00
void BoardSetting : : SetReadOutControl ( ) { /// same for PHA and PSD
2022-09-23 16:40:59 -04:00
printf ( " === %s \n " , __func__ ) ;
2022-09-21 16:05:51 -04:00
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
uint32_t bit = 0 ;
2022-09-16 17:53:57 -04:00
2022-09-21 16:05:51 -04:00
bit + = cbVMEInterrupLevel - > GetSelected ( ) ;
bit + = ( ( bOpticalLinkInterrupt - > GetState ( ) = = kButtonDown ) ? ( 1 < < 3 ) : 0 ) ;
bit + = ( ( bEventAligned - > GetState ( ) = = kButtonDown ) ? ( 1 < < 4 ) : 0 ) ;
bit + = ( ( bVMEAlogn64Mode - > GetState ( ) = = kButtonDown ) ? ( 1 < < 5 ) : 0 ) ;
bit + = ( ( bInteruptReleaseMode - > GetState ( ) = = kButtonDown ) ? ( 1 < < 7 ) : 0 ) ;
bit + = ( ( bEnableExtendedBlockTransfer - > GetState ( ) = = kButtonDown ) ? ( 1 < < 8 ) : 0 ) ;
printf ( " bit : 0x%x \n " , bit ) ;
digi [ boardID ] - > WriteRegister ( Register : : DPP : : ReadoutControl , bit ) ;
2022-09-16 17:53:57 -04:00
}
2022-09-27 17:58:14 -04:00
void BoardSetting : : ReadData ( ) {
printf ( " === %s \n " , __func__ ) ;
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
uint32_t temp = digi [ boardID ] - > ReadRegister ( Register : : DPP : : ReadoutStatus ) ;
if ( ( temp & 0x1 ) = = 0 ) {
printf ( " No data. \n " ) ;
return ;
}
Data * data = digi [ boardID ] - > GetData ( ) ;
data - > AllocateMemory ( ) ;
data - > DPPType = digi [ boardID ] - > GetDPPType ( ) ;
digi [ boardID ] - > ReadData ( ) ;
//data->PrintBuffer();
data - > DecodeBuffer ( 2 ) ;
data - > PrintStat ( ) ;
//Fill Histogram
data - > ClearData ( ) ;
ReadStatus ( ) ;
}
void BoardSetting : : ProgramBoard ( ) {
printf ( " === %s \n " , __func__ ) ;
if ( digi = = NULL ) return ;
int boardID = boardIDEntry - > GetNumber ( ) ;
if ( digi [ boardID ] - > GetDPPType ( ) = = V1730_DPP_PSD_CODE ) {
digi [ boardID ] - > ProgramBoard ( ) ;
}
if ( digi [ boardID ] - > GetDPPType ( ) = = V1730_DPP_PHA_CODE ) {
digi [ boardID ] - > ProgramPHABoard ( ) ;
}
ChangeBoard ( ) ;
}