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-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 ) ;
fMain - > SetWindowName ( " Board Settings " ) ;
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-16 17:53:57 -04:00
///- Board Failure status
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 ) ;
TGTextButton * bSoftwareReset = new TGTextButton ( hframe0 , " Reset default Settings " ) ; hframe0 - > AddFrame ( bSoftwareReset , layoutHints ) ;
TGTextButton * bSoftwareClear = new TGTextButton ( hframe0 , " Clear Buffer " ) ; hframe0 - > AddFrame ( bSoftwareClear , layoutHints ) ;
2022-08-23 13:43:05 -04:00
2022-08-24 17:50:21 -04:00
///============ fixed info
2022-08-25 15:27:27 -04:00
TGHorizontalFrame * hframeInfo = new TGHorizontalFrame ( vframe ) ; vframe - > AddFrame ( hframeInfo , new TGLayoutHints ( kLHintsExpandX ) ) ;
2022-08-23 13:43:05 -04:00
2022-08-24 17:50:21 -04:00
int numCol = 3 ;
TGVerticalFrame * vframeInfo [ numCol ] ;
for ( int i = 0 ; i < numCol ; i + + ) {
2022-08-25 15:27:27 -04:00
vframeInfo [ i ] = new TGVerticalFrame ( hframeInfo ) ; hframeInfo - > AddFrame ( vframeInfo [ i ] , new TGLayoutHints ( kLHintsExpandX ) ) ;
2022-08-24 17:50:21 -04:00
}
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 , 2 , 2 ) ) ;
2022-08-23 13:43:05 -04:00
2022-08-25 15:27:27 -04:00
lb [ i ] = new TGLabel ( hframe [ i ] , boardSettingName [ i ] ) ; hframe [ i ] - > AddFrame ( lb [ i ] , new TGLayoutHints ( kLHintsLeft | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
2022-08-23 13:43:05 -04:00
2022-08-25 15:27:27 -04:00
entry [ i ] = new TGTextEntry ( hframe [ i ] , new TGTextBuffer ( 1 ) ) ; hframe [ i ] - > AddFrame ( entry [ i ] , new TGLayoutHints ( kLHintsRight , 5 , 5 , 3 , 4 ) ) ;
2022-08-23 13:43:05 -04:00
entry [ i ] - > SetEnabled ( false ) ;
2022-08-24 17:50:21 -04:00
}
///========= Board Configure
2022-08-25 15:27:27 -04:00
TGGroupFrame * gBdCfg = new TGGroupFrame ( vframe , " Board Configure " , kHorizontalFrame ) ; vframe - > AddFrame ( gBdCfg , new TGLayoutHints ( kLHintsExpandX ) ) ;
2022-08-24 17:50:21 -04:00
TGVerticalFrame * vBdCfg = new TGVerticalFrame ( gBdCfg ) ; gBdCfg - > AddFrame ( vBdCfg ) ;
2022-08-25 15:27:27 -04:00
TGHorizontalFrame * hframeBdCfg1 = new TGHorizontalFrame ( vBdCfg ) ; vBdCfg - > AddFrame ( hframeBdCfg1 , layoutHints ) ;
2022-08-24 17:50:21 -04:00
2022-09-16 17:53:57 -04:00
bAutoDataFlush = new TGCheckButton ( hframeBdCfg1 , " Auto Data Flush " , 1 ) ; hframeBdCfg1 - > AddFrame ( bAutoDataFlush , layoutHints ) ;
bAutoDataFlush - > SetState ( kButtonUp ) ;
2022-08-24 17:50:21 -04:00
bAutoDataFlush - > Connect ( " Clicked() " , " BoardSetting " , this , " SetAutoDataFlush() " ) ;
2022-09-16 17:53:57 -04:00
bDecimateWF = new TGCheckButton ( hframeBdCfg1 , " Decimate WaveForm " , 1 ) ; hframeBdCfg1 - > AddFrame ( bDecimateWF , layoutHints ) ;
2022-08-24 17:50:21 -04:00
bDecimateWF - > SetState ( kButtonUp ) ;
bDecimateWF - > Connect ( " Clicked() " , " BoardSetting " , this , " SetDecimateWF() " ) ;
2022-09-16 17:53:57 -04:00
bWFRecord = new TGCheckButton ( hframeBdCfg1 , " Record WaveFrom " , 1 ) ; hframeBdCfg1 - > AddFrame ( bWFRecord , layoutHints ) ;
bWFRecord - > SetState ( kButtonUp ) ;
2022-08-24 17:50:21 -04:00
bWFRecord - > Connect ( " Clicked() " , " BoardSetting " , this , " SetWaveFormRecord() " ) ;
2022-09-16 17:53:57 -04:00
bTrigPropa = new TGCheckButton ( hframeBdCfg1 , " Trigger Propagation (coincidence) " , 1 ) ; hframeBdCfg1 - > AddFrame ( bTrigPropa , layoutHints ) ;
2022-08-24 17:50:21 -04:00
bTrigPropa - > SetState ( kButtonUp ) ;
bTrigPropa - > Connect ( " Clicked() " , " BoardSetting " , this , " SetTriggerPropagation() " ) ;
2022-09-16 17:53:57 -04:00
bExtrac2 = new TGCheckButton ( hframeBdCfg1 , " Enable Extra2 word " , 1 ) ; hframeBdCfg1 - > AddFrame ( bExtrac2 , layoutHints ) ;
bExtrac2 - > SetState ( kButtonUp ) ;
2022-08-24 17:50:21 -04:00
bExtrac2 - > Connect ( " Clicked() " , " BoardSetting " , this , " SetEnableExtra2() " ) ;
2022-08-25 15:27:27 -04:00
TGHorizontalFrame * hframeBdCfg2 = new TGHorizontalFrame ( vBdCfg ) ; vBdCfg - > AddFrame ( hframeBdCfg2 , layoutHints ) ;
bDualTrace = new TGCheckButton ( hframeBdCfg2 , " Dual Trace " , 1 ) ; hframeBdCfg2 - > AddFrame ( bDualTrace , layoutHints ) ;
2022-08-24 17:50:21 -04:00
bDualTrace - > SetState ( kButtonUp ) ;
bDualTrace - > Connect ( " Clicked() " , " BoardSetting " , this , " SetDualTrace() " ) ;
2022-08-25 15:27:27 -04:00
TGLabel * lbAP1 = new TGLabel ( hframeBdCfg2 , " Ana. Prb. 1 " ) ; hframeBdCfg2 - > AddFrame ( lbAP1 , layoutHints ) ;
cbAP1 = new TGComboBox ( hframeBdCfg2 , " Ana. Pb. 1 " , 1 ) ; hframeBdCfg2 - > AddFrame ( cbAP1 , layoutHints ) ;
2022-08-24 17:50:21 -04:00
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 - > Select ( 0 ) ;
cbAP1 - > Connect ( " Changed() " , " BoardSetting " , this , " SetAnalogProbe1() " ) ;
2022-08-25 15:27:27 -04:00
TGLabel * lbAP2 = new TGLabel ( hframeBdCfg2 , " Ana. Prb. 2 " ) ; hframeBdCfg2 - > AddFrame ( lbAP2 , layoutHints ) ;
cbAP2 = new TGComboBox ( hframeBdCfg2 , " Ana. Pb. 2 " , 1 ) ; hframeBdCfg2 - > AddFrame ( cbAP2 , layoutHints ) ;
2022-08-24 17:50:21 -04:00
cbAP2 - > EnableTextInput ( false ) ;
cbAP2 - > AddEntry ( " Input " , 0 ) ;
cbAP2 - > AddEntry ( " Threshold " , 1 ) ;
cbAP2 - > AddEntry ( " Trapezoid - Baseline " , 2 ) ;
cbAP2 - > AddEntry ( " Baseline " , 3 ) ;
cbAP2 - > Resize ( 150 , 20 ) ;
cbAP2 - > Select ( 0 ) ;
cbAP2 - > SetEnabled ( false ) ;
cbAP2 - > Connect ( " Changed() " , " BoardSetting " , this , " SetAnalogProbe2() " ) ;
2022-08-23 13:43:05 -04:00
2022-08-25 15:27:27 -04:00
TGLabel * lbDP = new TGLabel ( hframeBdCfg2 , " Digi. Prb. " ) ; hframeBdCfg2 - > AddFrame ( lbDP , layoutHints ) ;
cbDP = new TGComboBox ( hframeBdCfg2 , " Digital. Pb. " , 1 ) ; hframeBdCfg2 - > AddFrame ( cbDP , layoutHints ) ;
2022-08-24 17:50:21 -04:00
cbDP - > EnableTextInput ( false ) ;
cbDP - > AddEntry ( " Peaking " , 0 ) ;
cbDP - > AddEntry ( " Armed (Triggered) " , 1 ) ;
cbDP - > AddEntry ( " Peak Run " , 2 ) ;
cbDP - > AddEntry ( " Pile-Up " , 3 ) ;
cbDP - > AddEntry ( " Peaking " , 4 ) ;
cbDP - > AddEntry ( " TRG Validation Win. " , 5 ) ;
cbDP - > AddEntry ( " Baseline freeze " , 6 ) ;
cbDP - > AddEntry ( " TRG holdoff " , 7 ) ;
cbDP - > AddEntry ( " TRG Validation " , 8 ) ;
cbDP - > AddEntry ( " ACQ busy " , 9 ) ;
cbDP - > AddEntry ( " Zero Cross " , 10 ) ;
cbDP - > AddEntry ( " Ext. TRG " , 11 ) ;
cbDP - > AddEntry ( " Memory full " , 12 ) ;
cbDP - > Resize ( 150 , 20 ) ;
cbDP - > Select ( 0 ) ;
cbDP - > Connect ( " Changed() " , " BoardSetting " , this , " SetDigitalProbe() " ) ;
2022-08-25 15:27:27 -04:00
TGHorizontalFrame * hframeBdCfg3 = new TGHorizontalFrame ( vBdCfg ) ; vBdCfg - > AddFrame ( hframeBdCfg3 , layoutHints ) ;
TGLabel * lbAggOrg = new TGLabel ( hframeBdCfg3 , " Aggregate Organization " ) ; hframeBdCfg3 - > AddFrame ( lbAggOrg , layoutHints ) ;
cbAggOrg = new TGComboBox ( hframeBdCfg3 , " Aggregate Organization " , 1 ) ; hframeBdCfg3 - > AddFrame ( cbAggOrg , layoutHints ) ;
2022-08-24 17:50:21 -04:00
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 ( 150 , 20 ) ;
cbAggOrg - > Select ( 0 ) ;
cbAggOrg - > Connect ( " Changed() " , " BoardSetting " , this , " SetAggregateOrganization() " ) ;
2022-09-19 12:46:27 -04:00
TGLabel * lbAggBLT = new TGLabel ( hframeBdCfg3 , " MAx. Aggregate pre Readout " ) ; hframeBdCfg3 - > AddFrame ( lbAggBLT , layoutHints ) ;
2022-08-25 15:27:27 -04:00
numAggBLT = new TGNumberEntry ( hframeBdCfg3 , 0 , 0 , 0 , TGNumberFormat : : kNESInteger , TGNumberFormat : : kNEANonNegative ) ; hframeBdCfg3 - > AddFrame ( numAggBLT , layoutHints ) ;
2022-08-24 17:50:21 -04:00
numAggBLT - > SetWidth ( 60 ) ;
numAggBLT - > SetLimits ( TGNumberFormat : : kNELLimitMinMax , 0 , 0x3FF ) ;
numAggBLT - > Connect ( " Modified() " , " BoardSetting " , this , " SetReadOutAggregate() " ) ;
2022-08-25 15:27:27 -04:00
///"FanSpeed Control",
TGLabel * lbFanCtrl = new TGLabel ( hframeBdCfg3 , " Fan Speed Control " , kHorizontalFrame ) ; hframeBdCfg3 - > AddFrame ( lbFanCtrl , layoutHints ) ;
2022-09-16 17:53:57 -04:00
cbFanCtrl = new TGComboBox ( hframeBdCfg3 , " " , 1 ) ; hframeBdCfg3 - > AddFrame ( cbFanCtrl , layoutHints ) ;
2022-08-25 15:27:27 -04:00
cbFanCtrl - > EnableTextInput ( false ) ;
cbFanCtrl - > AddEntry ( " Slow/Auto " , 0x30 ) ;
cbFanCtrl - > AddEntry ( " Fast " , 0x38 ) ;
cbFanCtrl - > Select ( 0x30 ) ;
cbFanCtrl - > Resize ( 100 , 20 ) ;
2022-08-29 18:06:12 -04:00
///========== ACQ control
TGGroupFrame * gAcqCtrl = new TGGroupFrame ( vframe , " ACQ Control " , kHorizontalFrame ) ; vframe - > AddFrame ( gAcqCtrl , new TGLayoutHints ( kLHintsExpandX ) ) ;
TGVerticalFrame * vAcqCtrl = new TGVerticalFrame ( gAcqCtrl ) ; gAcqCtrl - > AddFrame ( vAcqCtrl ) ;
2022-09-16 17:53:57 -04:00
2022-08-29 18:06:12 -04:00
TGHorizontalFrame * hfAcqCtrl = new TGHorizontalFrame ( vAcqCtrl ) ; vAcqCtrl - > AddFrame ( hfAcqCtrl , layoutHints ) ;
TGLabel * lbAcqMode = new TGLabel ( hfAcqCtrl , " ACQ Mode " ) ; hfAcqCtrl - > AddFrame ( lbAcqMode , layoutHints ) ;
2022-09-16 17:53:57 -04:00
cbAcqMode = new TGComboBox ( hfAcqCtrl , " ACQ Mode " , 1 ) ; hfAcqCtrl - > AddFrame ( cbAcqMode , layoutHints ) ;
2022-08-29 18:06:12 -04:00
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 - > Select ( 0 ) ;
cbAcqMode - > Resize ( 100 , 20 ) ;
2022-09-16 17:53:57 -04:00
bAcqArm = new TGCheckButton ( hfAcqCtrl , " ACQ Start/Arm " , 1 ) ; hfAcqCtrl - > AddFrame ( bAcqArm , layoutHints ) ;
2022-08-29 18:06:12 -04:00
bAcqArm - > SetState ( kButtonUp ) ;
//bAcqArm->Connect("Clicked()", "BoardSetting", this, "SetAutoDataFlush()");
TGLabel * lbPLLref = new TGLabel ( hfAcqCtrl , " PLL Ref. " ) ; hfAcqCtrl - > AddFrame ( lbPLLref , layoutHints ) ;
2022-09-16 17:53:57 -04:00
cbPLLref = new TGComboBox ( hfAcqCtrl , " PLL Ref. " , 1 ) ; hfAcqCtrl - > AddFrame ( cbPLLref , layoutHints ) ;
2022-08-29 18:06:12 -04:00
cbPLLref - > EnableTextInput ( false ) ;
cbPLLref - > AddEntry ( " internal " , 0 ) ;
cbPLLref - > AddEntry ( " external " , 1 ) ;
cbPLLref - > Select ( 0 ) ;
cbPLLref - > Resize ( 100 , 20 ) ;
2022-08-25 15:27:27 -04:00
2022-09-16 17:53:57 -04:00
TGHorizontalFrame * hfAcqCtrl2 = new TGHorizontalFrame ( vAcqCtrl ) ; vAcqCtrl - > AddFrame ( hfAcqCtrl2 , layoutHints ) ;
2022-09-19 12:46:27 -04:00
bSWTrigger = new TGTextButton ( hfAcqCtrl2 , " Send Software Trigger " ) ; hfAcqCtrl2 - > AddFrame ( bSWTrigger , layoutHints ) ;
//bSWTrigger->Connect("Clicked()", "BoardSetting", this, "SetAutoDataFlush()");
bSWClockSync = new TGTextButton ( hfAcqCtrl2 , " Send Software Clock Sync " ) ; hfAcqCtrl2 - > AddFrame ( bSWClockSync , layoutHints ) ;
//bSWClockSync->Connect("Clicked()", "BoardSetting", this, "SetAutoDataFlush()");
2022-09-16 17:53:57 -04:00
TGLabel * lbRunStartStopDelay = new TGLabel ( hfAcqCtrl2 , " Run/Start/Stop Delay [ns] " ) ; hfAcqCtrl2 - > AddFrame ( lbRunStartStopDelay , layoutHints ) ;
2022-09-19 12:46:27 -04:00
numRunStartStopDelay = new TGNumberEntry ( hfAcqCtrl2 , 0 , 0 , 0 , TGNumberFormat : : kNESInteger , TGNumberFormat : : kNEANonNegative ) ; hfAcqCtrl2 - > AddFrame ( numRunStartStopDelay , layoutHints ) ;
2022-09-16 17:53:57 -04:00
numRunStartStopDelay - > SetWidth ( 60 ) ;
numRunStartStopDelay - > SetLimits ( TGNumberFormat : : kNELLimitMinMax , 0 , 0x0FF ) ;
2022-08-24 17:50:21 -04:00
///========= Trigger Configure
2022-08-25 15:27:27 -04:00
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 ) ) ;
2022-08-24 17:50:21 -04:00
2022-09-16 17:53:57 -04:00
///--- various type of triggers
2022-08-25 15:27:27 -04:00
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-24 17:50:21 -04:00
2022-08-25 15:27:27 -04:00
TGLabel * lbdummy0 = new TGLabel ( vTRGType , " " ) ;
vTRGType - > AddFrame ( lbdummy0 , new TGLayoutHints ( kLHintsLeft | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
vTRGType - > AddFrame ( lbdummy0 , new TGLayoutHints ( kLHintsLeft | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
2022-08-24 17:50:21 -04:00
2022-08-25 15:27:27 -04:00
TGVerticalFrame * vTRGMsk [ 8 ] ;
TGLabel * lbTRGMskCh0 [ 8 ] ;
TGLabel * lbTRGMskCh1 [ 8 ] ;
for ( int i = 0 ; i < 8 ; i + + ) {
vTRGMsk [ i ] = new TGVerticalFrame ( hframeTRGCfg ) ; hframeTRGCfg - > AddFrame ( vTRGMsk [ i ] , new TGLayoutHints ( kLHintsCenterX , 5 , 5 , 3 , 4 ) ) ;
lbTRGMskCh0 [ i ] = new TGLabel ( vTRGMsk [ i ] , Form ( " %d " , 2 * i ) ) ; vTRGMsk [ i ] - > AddFrame ( lbTRGMskCh0 [ i ] , new TGLayoutHints ( kLHintsCenterX , 5 , 5 , 3 , 4 ) ) ;
lbTRGMskCh1 [ i ] = new TGLabel ( vTRGMsk [ i ] , Form ( " %d " , 2 * i + 1 ) ) ; vTRGMsk [ i ] - > AddFrame ( lbTRGMskCh1 [ i ] , new TGLayoutHints ( kLHintsCenterX , 5 , 5 , 3 , 4 ) ) ;
}
2022-08-24 17:50:21 -04:00
2022-08-25 15:27:27 -04:00
///"Global Trigger Mask",
TGLabel * lbGbTRGMsk = new TGLabel ( vTRGType , " Global Trigger Mask " ) ; vTRGType - > AddFrame ( lbGbTRGMsk , new TGLayoutHints ( kLHintsRight | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
2022-08-24 17:50:21 -04:00
for ( int i = 0 ; i < 8 ; i + + ) {
2022-08-25 15:27:27 -04:00
cbGbTRGMskCh [ i ] = new TGCheckButton ( vTRGMsk [ i ] , " " ) ; vTRGMsk [ i ] - > AddFrame ( cbGbTRGMskCh [ i ] , new TGLayoutHints ( kLHintsCenterX , 5 , 5 , 3 , 4 ) ) ;
2022-08-24 17:50:21 -04:00
}
///"Trigger Validation Mask",
2022-08-25 15:27:27 -04:00
TGLabel * lbTRGValMsk = new TGLabel ( vTRGType , " Trigger Validation Mask " ) ; vTRGType - > AddFrame ( lbTRGValMsk , new TGLayoutHints ( kLHintsRight | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
2022-08-24 17:50:21 -04:00
for ( int i = 0 ; i < 8 ; i + + ) {
2022-08-25 15:27:27 -04:00
cbTRGValMskCh [ i ] = new TGCheckButton ( vTRGMsk [ i ] , " " ) ; vTRGMsk [ i ] - > AddFrame ( cbTRGValMskCh [ i ] , new TGLayoutHints ( kLHintsCenterX , 5 , 5 , 3 , 4 ) ) ;
2022-08-24 17:50:21 -04:00
}
///"Front Panel TRG-OUT Enable Mask",
2022-08-25 15:27:27 -04:00
TGLabel * lbTRGOUTMsk = new TGLabel ( vTRGType , " TRG-OUT Mask " ) ; vTRGType - > AddFrame ( lbTRGOUTMsk , new TGLayoutHints ( kLHintsRight | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
2022-08-24 17:50:21 -04:00
for ( int i = 0 ; i < 8 ; i + + ) {
2022-08-25 15:27:27 -04:00
cbTRGOUTMskCh [ i ] = new TGCheckButton ( vTRGMsk [ i ] , " " ) ; vTRGMsk [ i ] - > AddFrame ( cbTRGOUTMskCh [ i ] , new TGLayoutHints ( kLHintsCenterX , 5 , 5 , 3 , 4 ) ) ;
2022-08-23 13:43:05 -04:00
}
2022-08-25 15:27:27 -04:00
TGVerticalFrame * vTRGMsk1 = new TGVerticalFrame ( hframeTRGCfg ) ; hframeTRGCfg - > AddFrame ( vTRGMsk1 , new TGLayoutHints ( kLHintsCenterX , 5 , 5 , 3 , 4 ) ) ;
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 ) ) ;
TGLabel * lbTRGMODE = new TGLabel ( vTRGMsk1 , " TRG MODE " ) ; vTRGMsk1 - > AddFrame ( lbTRGMODE , new TGLayoutHints ( kLHintsRight | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
TGLabel * lbTRGOUTMODE = new TGLabel ( vTRGMsk1 , " TRG-OUT MODE " ) ; vTRGMsk1 - > AddFrame ( lbTRGOUTMODE , new TGLayoutHints ( kLHintsRight | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
2022-08-24 17:50:21 -04:00
2022-08-25 15:27:27 -04:00
TGVerticalFrame * vTRGMsk2 = new TGVerticalFrame ( hframeTRGCfg ) ; hframeTRGCfg - > AddFrame ( vTRGMsk2 , new TGLayoutHints ( kLHintsCenterX , 5 , 5 , 3 , 4 ) ) ;
vTRGMsk2 - > AddFrame ( lbdummy0 , new TGLayoutHints ( kLHintsLeft | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
vTRGMsk2 - > AddFrame ( lbdummy0 , new TGLayoutHints ( kLHintsLeft | kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
2022-08-24 17:50:21 -04:00
2022-08-25 15:27:27 -04:00
numMajorCoinWin = new TGNumberEntry ( vTRGMsk2 , 0 , 0 , 0 , TGNumberFormat : : kNESInteger , TGNumberFormat : : kNEANonNegative ) ; vTRGMsk2 - > AddFrame ( numMajorCoinWin ) ;
2022-08-24 17:50:21 -04:00
numMajorCoinWin - > Resize ( 70 , 20 ) ;
2022-09-16 17:53:57 -04:00
cbTRGMODE = new TGComboBox ( vTRGMsk2 , " TRG MODE " , 1 ) ; vTRGMsk2 - > AddFrame ( cbTRGMODE ) ;
2022-08-24 17:50:21 -04:00
cbTRGMODE - > EnableTextInput ( false ) ;
cbTRGMODE - > AddEntry ( " OR " , 0 ) ;
cbTRGMODE - > AddEntry ( " AND " , 1 ) ;
cbTRGMODE - > AddEntry ( " Majority " , 2 ) ;
cbTRGMODE - > Resize ( 70 , 20 ) ;
cbTRGMODE - > Select ( 0 ) ;
2022-09-16 17:53:57 -04:00
cbTRGOUTMODE = new TGComboBox ( vTRGMsk2 , " TRG MODE " , 1 ) ; vTRGMsk2 - > AddFrame ( cbTRGOUTMODE ) ;
2022-08-24 17:50:21 -04:00
cbTRGOUTMODE - > EnableTextInput ( false ) ;
cbTRGOUTMODE - > AddEntry ( " OR " , 0 ) ;
cbTRGOUTMODE - > AddEntry ( " AND " , 1 ) ;
cbTRGOUTMODE - > AddEntry ( " Majority " , 2 ) ;
cbTRGOUTMODE - > Resize ( 70 , 20 ) ;
cbTRGOUTMODE - > Select ( 0 ) ;
2022-08-25 15:27:27 -04:00
TGVerticalFrame * vTRGMsk3 = new TGVerticalFrame ( hframeTRGCfg ) ; hframeTRGCfg - > AddFrame ( vTRGMsk3 , new TGLayoutHints ( kLHintsCenterX , 5 , 5 , 3 , 4 ) ) ;
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 ) ) ;
2022-08-24 17:50:21 -04:00
GlbMajorLevel - > Resize ( 70 , 17 ) ;
2022-08-25 15:27:27 -04:00
TRGMajorLevel = new TGNumberEntry ( vTRGMsk3 , 0 , 0 , 0 , TGNumberFormat : : kNESInteger , TGNumberFormat : : kNEANonNegative ) ; vTRGMsk3 - > AddFrame ( TRGMajorLevel , new TGLayoutHints ( kLHintsCenterY , 2 , 2 , 2 , 2 ) ) ;
2022-08-24 17:50:21 -04:00
TRGMajorLevel - > Resize ( 70 , 17 ) ;
2022-08-25 15:27:27 -04:00
TRGOUTMajorLevel = new TGNumberEntry ( vTRGMsk3 , 0 , 0 , 0 , TGNumberFormat : : kNESInteger , TGNumberFormat : : kNEANonNegative ) ; vTRGMsk3 - > AddFrame ( TRGOUTMajorLevel , new TGLayoutHints ( kLHintsCenterY , 2 , 2 , 2 , 2 ) ) ;
2022-08-24 17:50:21 -04:00
TRGOUTMajorLevel - > Resize ( 70 , 17 ) ;
2022-08-25 15:27:27 -04:00
TGVerticalFrame * vTRGMsk4 = new TGVerticalFrame ( hframeTRGCfg ) ; hframeTRGCfg - > AddFrame ( vTRGMsk4 , new TGLayoutHints ( kLHintsCenterX , 5 , 5 , 3 , 4 ) ) ;
TGLabel * lbLVDSTrigger = new TGLabel ( vTRGMsk4 , " LVDS " ) ; vTRGMsk4 - > AddFrame ( lbLVDSTrigger , layoutHints ) ;
TGLabel * lbdummy1 = new TGLabel ( vTRGMsk4 , " Trg. " ) ; vTRGMsk4 - > AddFrame ( lbdummy1 , layoutHints ) ;
2022-08-24 17:50:21 -04:00
2022-09-16 17:53:57 -04:00
bGLBLVDSTrigger = new TGCheckButton ( vTRGMsk4 , " " , 1 ) ; vTRGMsk4 - > AddFrame ( bGLBLVDSTrigger , layoutHints ) ;
2022-08-24 17:50:21 -04:00
bGLBLVDSTrigger - > SetState ( kButtonUp ) ;
2022-08-25 15:27:27 -04:00
vTRGMsk4 - > AddFrame ( lbdummy0 , layoutHints ) ;
2022-08-24 17:50:21 -04:00
2022-09-16 17:53:57 -04:00
bTRGOUTLVDSTrigger = new TGCheckButton ( vTRGMsk4 , " " , 1 ) ; vTRGMsk4 - > AddFrame ( bTRGOUTLVDSTrigger , layoutHints ) ;
2022-08-24 17:50:21 -04:00
bTRGOUTLVDSTrigger - > SetState ( kButtonUp ) ;
2022-08-25 15:27:27 -04:00
TGVerticalFrame * vTRGMsk5 = new TGVerticalFrame ( hframeTRGCfg ) ; hframeTRGCfg - > AddFrame ( vTRGMsk5 , new TGLayoutHints ( kLHintsCenterX , 5 , 5 , 3 , 4 ) ) ;
TGLabel * lbExtTrigger = new TGLabel ( vTRGMsk5 , " Ext. " ) ; vTRGMsk5 - > AddFrame ( lbExtTrigger , layoutHints ) ;
TGLabel * lbdummy2 = new TGLabel ( vTRGMsk5 , " Trg. " ) ; vTRGMsk5 - > AddFrame ( lbdummy2 , layoutHints ) ;
2022-08-24 17:50:21 -04:00
2022-09-16 17:53:57 -04:00
bGLBExtTrigger = new TGCheckButton ( vTRGMsk5 , " " , 1 ) ; vTRGMsk5 - > AddFrame ( bGLBExtTrigger , layoutHints ) ;
2022-08-24 17:50:21 -04:00
bGLBExtTrigger - > SetState ( kButtonUp ) ;
2022-09-16 17:53:57 -04:00
bTRGExtTrigger = new TGCheckButton ( vTRGMsk5 , " " , 1 ) ; vTRGMsk5 - > AddFrame ( bTRGExtTrigger , layoutHints ) ;
2022-08-24 17:50:21 -04:00
bTRGExtTrigger - > SetState ( kButtonUp ) ;
2022-09-16 17:53:57 -04:00
bTRGOUTExtTrigger = new TGCheckButton ( vTRGMsk5 , " " , 1 ) ; vTRGMsk5 - > AddFrame ( bTRGOUTExtTrigger , layoutHints ) ;
2022-08-24 17:50:21 -04:00
bTRGExtTrigger - > SetState ( kButtonUp ) ;
2022-08-25 15:27:27 -04:00
TGVerticalFrame * vTRGMsk6 = new TGVerticalFrame ( hframeTRGCfg ) ; hframeTRGCfg - > AddFrame ( vTRGMsk6 , new TGLayoutHints ( kLHintsCenterX , 5 , 5 , 3 , 4 ) ) ;
TGLabel * lbSWTrigger = new TGLabel ( vTRGMsk6 , " Software " ) ; vTRGMsk6 - > AddFrame ( lbSWTrigger , layoutHints ) ;
TGLabel * lbdummy3 = new TGLabel ( vTRGMsk6 , " Trg. " ) ; vTRGMsk6 - > AddFrame ( lbdummy3 , layoutHints ) ;
2022-08-24 17:50:21 -04:00
2022-09-16 17:53:57 -04:00
bGLBSoftwareTrigger = new TGCheckButton ( vTRGMsk6 , " " , 1 ) ; vTRGMsk6 - > AddFrame ( bGLBSoftwareTrigger , layoutHints ) ;
2022-08-24 17:50:21 -04:00
bGLBSoftwareTrigger - > SetState ( kButtonDown ) ;
2022-09-16 17:53:57 -04:00
bTRGSoftwareTrigger = new TGCheckButton ( vTRGMsk6 , " " , 1 ) ; vTRGMsk6 - > AddFrame ( bTRGSoftwareTrigger , layoutHints ) ;
2022-08-24 17:50:21 -04:00
bTRGSoftwareTrigger - > SetState ( kButtonDown ) ;
2022-09-16 17:53:57 -04:00
bTRGOUTSoftwareTrigger = new TGCheckButton ( vTRGMsk6 , " " , 1 ) ; vTRGMsk6 - > AddFrame ( bTRGOUTSoftwareTrigger , layoutHints ) ;
2022-08-24 17:50:21 -04:00
bTRGOUTSoftwareTrigger - > SetState ( kButtonDown ) ;
2022-08-25 15:27:27 -04:00
TGHorizontalFrame * hframeTRGCfg2 = new TGHorizontalFrame ( vTRGCfg ) ; vTRGCfg - > AddFrame ( hframeTRGCfg2 , new TGLayoutHints ( kLHintsCenterY | kLHintsRight , 2 , 2 , 2 , 2 ) ) ;
2022-09-16 17:53:57 -04:00
bTRGValMskLVSDGLB = new TGCheckButton ( hframeTRGCfg2 , " LVSD Global Trg. Valid " , 1 ) ; hframeTRGCfg2 - > AddFrame ( bTRGValMskLVSDGLB , new TGLayoutHints ( kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
bTRGValMskLVSDLCL = new TGCheckButton ( hframeTRGCfg2 , " LVSD Local Trg. Valid " , 1 ) ; hframeTRGCfg2 - > AddFrame ( bTRGValMskLVSDLCL , new TGLayoutHints ( kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
2022-08-24 17:50:21 -04:00
///"Disable External Trigger",
2022-09-16 17:53:57 -04:00
bEnableExtTRG = new TGCheckButton ( hframeTRGCfg2 , " Enable Ext. Trigger " , 1 ) ; hframeTRGCfg2 - > AddFrame ( bEnableExtTRG , new TGLayoutHints ( kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
2022-08-24 17:50:21 -04:00
///"Extended Veto Delay",
2022-08-25 15:27:27 -04:00
TGLabel * lbExtendVetoDelay = new TGLabel ( hframeTRGCfg2 , " Extended Veto Delay " ) ; hframeTRGCfg2 - > AddFrame ( lbExtendVetoDelay , new TGLayoutHints ( kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
2022-09-16 17:53:57 -04:00
numExtendVetoDelay = new TGNumberEntry ( hframeTRGCfg2 , 0 , 0 , 0 , TGNumberFormat : : kNESInteger , TGNumberFormat : : kNEANonNegative ) ; hframeTRGCfg2 - > AddFrame ( numExtendVetoDelay , new TGLayoutHints ( kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
2022-08-25 15:27:27 -04:00
numExtendVetoDelay - > Resize ( 70 , 17 ) ;
2022-08-24 17:50:21 -04:00
2022-08-25 15:27:27 -04:00
TGHorizontalFrame * hRow = new TGHorizontalFrame ( vframe ) ; vframe - > AddFrame ( hRow , new TGLayoutHints ( kLHintsExpandX ) ) ;
2022-08-24 17:50:21 -04:00
///=================="Front Panel IO Control",
2022-08-25 15:27:27 -04:00
TGGroupFrame * gFrontIOCtrl = new TGGroupFrame ( hRow , " Front Panel IO Control " , kHorizontalFrame ) ; hRow - > AddFrame ( gFrontIOCtrl ) ;
TGVerticalFrame * vFrontIOCtrl = new TGVerticalFrame ( gFrontIOCtrl ) ; gFrontIOCtrl - > AddFrame ( vFrontIOCtrl , new TGLayoutHints ( kLHintsCenterX , 5 , 5 , 3 , 4 ) ) ;
TGHorizontalFrame * hframeFrontIOCtrl = new TGHorizontalFrame ( vFrontIOCtrl ) ; vFrontIOCtrl - > AddFrame ( hframeFrontIOCtrl , new TGLayoutHints ( kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
TGLabel * lbLEMOIO = new TGLabel ( hframeFrontIOCtrl , " LEMO I/O " ) ; hframeFrontIOCtrl - > AddFrame ( lbLEMOIO , new TGLayoutHints ( kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
2022-09-16 17:53:57 -04:00
cbLEMOIO = new TGComboBox ( hframeFrontIOCtrl , " " , 1 ) ; hframeFrontIOCtrl - > AddFrame ( cbLEMOIO , new TGLayoutHints ( kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
2022-08-25 15:27:27 -04:00
cbLEMOIO - > EnableTextInput ( false ) ;
cbLEMOIO - > AddEntry ( " NIM " , 0 ) ;
cbLEMOIO - > AddEntry ( " TTL " , 1 ) ;
cbLEMOIO - > Select ( 0 ) ;
cbLEMOIO - > Resize ( 50 , 20 ) ;
2022-09-16 17:53:57 -04:00
///use 0x811C, bit:[14:19], 6bits
TGLabel * lbTRGOUTMODE2 = new TGLabel ( hframeFrontIOCtrl , " TRG-OUT Mode " ) ; hframeFrontIOCtrl - > AddFrame ( lbTRGOUTMODE2 , new TGLayoutHints ( kLHintsCenterY | kLHintsLeft , 5 , 5 , 3 , 4 ) ) ;
cbTRGOUTmode = new TGComboBox ( hframeFrontIOCtrl , " " , 1 ) ; hframeFrontIOCtrl - > AddFrame ( cbTRGOUTmode , new TGLayoutHints ( kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
cbTRGOUTmode - > EnableTextInput ( false ) ;
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 - > Select ( 0 ) ;
cbTRGOUTmode - > Resize ( 160 , 20 ) ;
bTRGOUTImp = new TGCheckButton ( hframeFrontIOCtrl , " TRG-OUT high impe. " , 1 ) ; hframeFrontIOCtrl - > AddFrame ( bTRGOUTImp , layoutHints ) ;
2022-08-25 15:27:27 -04:00
bTRGOUTImp - > SetState ( kButtonUp ) ;
TGHorizontalFrame * hframeFrontIOCtrl1 = new TGHorizontalFrame ( vFrontIOCtrl ) ; vFrontIOCtrl - > AddFrame ( hframeFrontIOCtrl1 , new TGLayoutHints ( kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
TGLabel * lbTRGINCtrl = new TGLabel ( hframeFrontIOCtrl1 , " TRG-IN control " ) ; hframeFrontIOCtrl1 - > AddFrame ( lbTRGINCtrl , new TGLayoutHints ( kLHintsCenterY | kLHintsLeft , 5 , 5 , 3 , 4 ) ) ;
2022-09-16 17:53:57 -04:00
cbTRGINCtrl = new TGComboBox ( hframeFrontIOCtrl1 , " " , 1 ) ; hframeFrontIOCtrl1 - > AddFrame ( cbTRGINCtrl , new TGLayoutHints ( kLHintsCenterY | kLHintsCenterX , 5 , 5 , 3 , 4 ) ) ;
2022-08-25 15:27:27 -04:00
cbTRGINCtrl - > EnableTextInput ( false ) ;
cbTRGINCtrl - > AddEntry ( " trigger sync with the edge of the TRIG-IN " , 0 ) ;
cbTRGINCtrl - > AddEntry ( " trigger sync with the whole TRIG-IN " , 1 ) ;
cbTRGINCtrl - > Select ( 0 ) ;
cbTRGINCtrl - > Resize ( 250 , 20 ) ;
TGLabel * lbTRGINMezzanines = new TGLabel ( hframeFrontIOCtrl1 , " TRG-IN to Mezzanines " ) ; hframeFrontIOCtrl1 - > AddFrame ( lbTRGINMezzanines , new TGLayoutHints ( kLHintsCenterY | kLHintsLeft , 5 , 5 , 3 , 4 ) ) ;
2022-09-16 17:53:57 -04:00
cbTRGINMezzanines = new TGComboBox ( hframeFrontIOCtrl1 , " " , 1 ) ; hframeFrontIOCtrl1 - > AddFrame ( cbTRGINMezzanines , new TGLayoutHints ( kLHintsCenterY | kLHintsCenterX , 5 , 5 , 3 , 4 ) ) ;
2022-08-25 15:27:27 -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 - > Select ( 0 ) ;
cbTRGINMezzanines - > Resize ( 200 , 20 ) ;
2022-08-24 17:50:21 -04:00
///"Front Panel LVDS IO New Features",
///"LVDS IO Data",
2022-08-25 15:27:27 -04:00
///"Analog Monitor Mode
2022-09-16 17:53:57 -04:00
TGHorizontalFrame * hframeFrontIOCtrl2 = new TGHorizontalFrame ( vFrontIOCtrl ) ; vFrontIOCtrl - > AddFrame ( hframeFrontIOCtrl2 , new TGLayoutHints ( kLHintsCenterY , 5 , 5 , 3 , 2 ) ) ;
TGLabel * lbAnaMonitor = new TGLabel ( hframeFrontIOCtrl2 , " Analog Monitor Mode (MON/Sigma) " ) ; hframeFrontIOCtrl2 - > AddFrame ( lbAnaMonitor , new TGLayoutHints ( kLHintsCenterY | kLHintsLeft , 5 , 5 , 3 , 2 ) ) ;
cbAnaMonitor = new TGComboBox ( hframeFrontIOCtrl2 , " " , 1 ) ; hframeFrontIOCtrl2 - > AddFrame ( cbAnaMonitor , new TGLayoutHints ( kLHintsCenterY , 5 , 5 , 3 , 2 ) ) ;
2022-08-25 15:27:27 -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 - > Select ( 0 ) ;
cbAnaMonitor - > Resize ( 150 , 20 ) ;
2022-09-16 17:53:57 -04:00
cbAnaMonitor - > Connect ( " Changed() " , " BoardSetting " , this , " SetAnalogMonitorMode() " ) ;
cbAnaMonitor - > Connect ( " Changed() " , " ChannelSetting " , this , " ChangePolarity() " ) ; //Example to call other class
2022-08-25 15:27:27 -04:00
///"Buffer Occupancy Gain
2022-09-16 17:53:57 -04:00
TGLabel * lbBufferOccpGain = new TGLabel ( hframeFrontIOCtrl2 , " Buffer Occupancy Gain " ) ; hframeFrontIOCtrl2 - > AddFrame ( lbBufferOccpGain , new TGLayoutHints ( kLHintsCenterY | kLHintsLeft , 5 , 5 , 3 , 2 ) ) ;
numBufferOccpGain = new TGNumberEntry ( hframeFrontIOCtrl2 , 0 , 0 , 0 , TGNumberFormat : : kNESInteger , TGNumberFormat : : kNEANonNegative ) ; hframeFrontIOCtrl2 - > AddFrame ( numBufferOccpGain , new TGLayoutHints ( kLHintsCenterY , 5 , 5 , 3 , 2 ) ) ;
numBufferOccpGain - > SetState ( false ) ;
2022-08-25 15:27:27 -04:00
numBufferOccpGain - > Resize ( 70 , 17 ) ;
2022-09-16 17:53:57 -04:00
//TODO check is VME model
2022-08-24 17:50:21 -04:00
///"Readout Control",
2022-09-16 17:53:57 -04:00
TGGroupFrame * gReadoutCtrl = new TGGroupFrame ( vframe , " ReadOut Control " , kHorizontalFrame ) ; vframe - > AddFrame ( gReadoutCtrl , new TGLayoutHints ( kLHintsExpandX ) ) ;
TGVerticalFrame * vReadoutCtrl = new TGVerticalFrame ( gReadoutCtrl ) ; gReadoutCtrl - > AddFrame ( vReadoutCtrl ) ;
2022-08-25 15:27:27 -04:00
TGHorizontalFrame * hReadoutCtrl = new TGHorizontalFrame ( vReadoutCtrl ) ; vReadoutCtrl - > AddFrame ( hReadoutCtrl , new TGLayoutHints ( kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
TGLabel * lbVMEInterruptLevel = new TGLabel ( hReadoutCtrl , " VME Interrupt Level " ) ; hReadoutCtrl - > AddFrame ( lbVMEInterruptLevel , new TGLayoutHints ( kLHintsCenterY | kLHintsLeft , 5 , 5 , 3 , 4 ) ) ;
TGNumberEntry * numVMEInterruptLeveln = new TGNumberEntry ( hReadoutCtrl , 0 , 0 , 0 , TGNumberFormat : : kNESInteger , TGNumberFormat : : kNEANonNegative ) ; hReadoutCtrl - > AddFrame ( numVMEInterruptLeveln , new TGLayoutHints ( kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
numVMEInterruptLeveln - > SetLimits ( TGNumberFormat : : kNELLimitMinMax , 0 , 7 ) ;
numVMEInterruptLeveln - > Resize ( 70 , 17 ) ;
TGCheckButton * bOpticalLinkInterrupt = new TGCheckButton ( hReadoutCtrl , " Optical Link Interrupt " , 1 ) ; hReadoutCtrl - > AddFrame ( bOpticalLinkInterrupt , layoutHints ) ;
bOpticalLinkInterrupt - > SetState ( kButtonUp ) ;
TGCheckButton * bEventAligned = new TGCheckButton ( hReadoutCtrl , " Event Aligned Enabled " , 1 ) ; hReadoutCtrl - > AddFrame ( bEventAligned , layoutHints ) ;
bEventAligned - > SetState ( kButtonUp ) ;
TGCheckButton * bVMEAlogn64Mode = new TGCheckButton ( hReadoutCtrl , " 64-bit aligned " , 1 ) ; hReadoutCtrl - > AddFrame ( bVMEAlogn64Mode , layoutHints ) ;
bVMEAlogn64Mode - > SetState ( kButtonUp ) ;
2022-09-16 17:53:57 -04:00
TGHorizontalFrame * hReadoutCtrl2 = new TGHorizontalFrame ( vReadoutCtrl ) ; vReadoutCtrl - > AddFrame ( hReadoutCtrl2 , new TGLayoutHints ( kLHintsCenterY , 5 , 5 , 3 , 4 ) ) ;
//TGCheckButton * bVMEBaseAddRelocation= new TGCheckButton(hReadoutCtrl, "VME baase addr. relocation", 1); hReadoutCtrl->AddFrame(bVMEBaseAddRelocation, layoutHints);
//bVMEBaseAddRelocation->SetState(kButtonUp);
//Need Relocation address
2022-08-25 15:27:27 -04:00
2022-09-16 17:53:57 -04:00
TGCheckButton * bInteruptReleaseMode = new TGCheckButton ( hReadoutCtrl2 , " Interrupt Release on Acknowldge " , 1 ) ; hReadoutCtrl2 - > AddFrame ( bInteruptReleaseMode , layoutHints ) ;
bInteruptReleaseMode - > SetState ( kButtonUp ) ;
TGCheckButton * bEnableExtendedBlockTransfer = new TGCheckButton ( hReadoutCtrl2 , " Enable Extended Block Transfer " , 1 ) ; hReadoutCtrl2 - > AddFrame ( bEnableExtendedBlockTransfer , layoutHints ) ;
bEnableExtendedBlockTransfer - > SetState ( kButtonUp ) ;
///==========="Readout Status"
2022-08-25 15:27:27 -04:00
TGGroupFrame * gReadoutStatus = new TGGroupFrame ( hRow , " Readout Status " , kHorizontalFrame ) ; hRow - > AddFrame ( gReadoutStatus , new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY , 5 ) ) ;
TGVerticalFrame * vReadoutStatus = new TGVerticalFrame ( gReadoutStatus ) ; gReadoutStatus - > AddFrame ( vReadoutStatus , new TGLayoutHints ( kLHintsExpandY , 5 , 5 , 3 , 2 ) ) ;
2022-09-16 17:53:57 -04:00
TGTextEntry * txtEventReady = new TGTextEntry ( vReadoutStatus , new TGTextBuffer ( 1 ) ) ; vReadoutStatus - > AddFrame ( txtEventReady , new TGLayoutHints ( kLHintsRight , 5 , 5 , 6 , 6 ) ) ;
2022-08-25 15:27:27 -04:00
txtEventReady - > SetEnabled ( false ) ;
txtEventReady - > SetText ( " Event Ready " ) ;
2022-09-16 17:53:57 -04:00
txtEventReady - > SetTextColor ( blue ) ;
2022-08-25 15:27:27 -04:00
2022-09-16 17:53:57 -04:00
TGTextEntry * txtBusError = new TGTextEntry ( vReadoutStatus , new TGTextBuffer ( 1 ) ) ; vReadoutStatus - > AddFrame ( txtBusError , new TGLayoutHints ( kLHintsRight , 5 , 5 , 6 , 6 ) ) ;
2022-08-25 15:27:27 -04:00
txtBusError - > SetEnabled ( false ) ;
txtBusError - > SetText ( " no Bus Error " ) ;
2022-09-16 17:53:57 -04:00
txtBusError - > SetTextColor ( blue ) ;
2022-08-25 15:27:27 -04:00
2022-09-16 17:53:57 -04:00
TGTextEntry * txtVMEFIFO = new TGTextEntry ( vReadoutStatus , new TGTextBuffer ( 1 ) ) ; vReadoutStatus - > AddFrame ( txtVMEFIFO , new TGLayoutHints ( kLHintsRight , 5 , 5 , 6 , 6 ) ) ;
2022-08-25 15:27:27 -04:00
txtVMEFIFO - > SetEnabled ( false ) ;
txtVMEFIFO - > SetText ( " VME FIFO EMPTY " ) ;
2022-09-16 17:53:57 -04:00
txtVMEFIFO - > SetTextColor ( blue ) ;
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-08-25 15:27:27 -04:00
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 ( ) ;
isOpened = true ;
}
BoardSetting : : ~ BoardSetting ( ) {
isOpened = false ;
2022-09-16 17:53:57 -04:00
//delete boardIDEntry;
//for( int i = 0; i < NUM_BOARD_INFO; i++) delete entry[i];
//
//for( int i = 0; i < nDigi; i++) digi[i] = NULL;
/*
delete enPLLStatus ;
delete enTempStatus ;
delete enADCPwrStatus ;
/// board settings
delete bAutoDataFlush ;
delete bDecimateWF ;
delete bWFRecord ;
delete bTrigPropa ;
delete bExtrac2 ;
2022-08-24 17:50:21 -04:00
delete bDualTrace ;
delete cbAP1 ;
2022-09-16 17:53:57 -04:00
delete cbAP2 ; /// for ComboBox for analog probe 2
2022-08-24 17:50:21 -04:00
delete cbDP ;
2022-09-16 17:53:57 -04:00
delete cbAggOrg ;
delete numAggBLT ; /// number of Agg pre Block transfer
delete cbFanCtrl ;
/// ACQ control
delete cbAcqMode ;
delete bAcqArm ;
delete cbPLLref ;
/// Trigger control
delete cbGbTRGMskCh [ 8 ] ;
delete cbTRGValMskCh [ 8 ] ;
delete cbTRGOUTMskCh [ 8 ] ;
delete numMajorCoinWin ;
delete cbTRGMODE ;
delete cbTRGOUTMODE ;
delete GlbMajorLevel ;
delete TRGMajorLevel ;
delete TRGOUTMajorLevel ;
delete bGLBLVDSTrigger ;
delete bTRGOUTLVDSTrigger ;
delete bGLBExtTrigger ;
delete bTRGExtTrigger ;
delete bTRGOUTExtTrigger ;
delete bGLBSoftwareTrigger ;
delete bTRGSoftwareTrigger ;
delete bTRGOUTSoftwareTrigger ;
delete bTRGValMskLVSDGLB ;
delete bTRGValMskLVSDLCL ;
delete bEnableExtTRG ;
delete numExtendVetoDelay ;
/// Front Panel IO Control
delete cbLEMOIO ;
delete cbTRGOUTmode ;
delete bTRGOUTImp ;
delete cbTRGINCtrl ;
delete cbTRGINMezzanines ;
delete cbAnaMonitor ;
delete numBufferOccpGain ;
*/
2022-08-23 13:43:05 -04:00
/// fMain must be delete last;
fMain - > Cleanup ( ) ;
delete fMain ;
2022-08-25 15:27:27 -04:00
}
2022-08-23 13:43:05 -04:00
void BoardSetting : : ChangeBoard ( ) {
int boardID = boardIDEntry - > GetNumber ( ) ;
2022-09-16 17:53:57 -04:00
if ( digi = = NULL ) {
printf ( " no didgitizers \n " ) ;
} else {
digi [ boardID ] - > PrintBoard ( ) ;
}
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 ( ) ) {
case V1724_DPP_PHA_CODE : entry [ i ] - > SetText ( " DPP-PHA " ) ; break ;
case V1720_DPP_CI_CODE : entry [ i ] - > SetText ( " DPP-CI " ) ; break ;
case V1720_DPP_PSD_CODE : entry [ i ] - > SetText ( " DPP-PSD " ) ; break ;
case V1751_DPP_PSD_CODE : entry [ i ] - > SetText ( " DPP-PSD " ) ; break ;
case V1751_DPP_ZLE_CODE : entry [ i ] - > SetText ( " DPP-ZLE " ) ; break ;
case V1743_DPP_CI_CODE : entry [ i ] - > SetText ( " DPP-PSD " ) ; break ;
case V1740_DPP_QDC_CODE : entry [ i ] - > SetText ( " DPP-QDC " ) ; break ;
case V1730_DPP_PSD_CODE : entry [ i ] - > SetText ( " DPP-PSD " ) ; break ;
case V1730_DPP_PHA_CODE : entry [ i ] - > SetText ( " DPP-PHA " ) ; break ;
case V1730_DPP_ZLE_CODE : entry [ i ] - > SetText ( " DPP-ZLE " ) ; break ;
case V1730_DPP_DAW_CODE : entry [ i ] - > SetText ( " DPP-DAW " ) ; break ;
}
break ;
case 2 : entry [ i ] - > SetText ( Form ( " %s " , digi [ boardID ] - > GetLinkType ( ) = = CAEN_DGTZ_USB ? " USB " : " Optical Link " ) ) ; break ;
case 3 : entry [ i ] - > SetText ( Form ( " %d " , digi [ boardID ] - > GetSerialNumber ( ) ) ) ; break ;
case 4 : entry [ i ] - > SetText ( Form ( " %d " , digi [ boardID ] - > GetNChannel ( ) ) ) ; break ;
case 5 : entry [ i ] - > SetText ( Form ( " %0.f MHz = %.1f ns " , 1000 / digi [ boardID ] - > GetCh2ns ( ) , digi [ boardID ] - > GetCh2ns ( ) ) ) ; break ;
case 6 : entry [ i ] - > SetText ( Form ( " %d " , digi [ boardID ] - > GetADCBits ( ) ) ) ; break ;
case 7 : entry [ i ] - > SetText ( Form ( " %s " , ( digi [ boardID ] - > GetROCVersion ( ) ) . c_str ( ) ) ) ; break ;
case 8 : entry [ i ] - > SetText ( Form ( " %s " , ( digi [ boardID ] - > GetAMCVersion ( ) ) . c_str ( ) ) ) ; break ;
}
}
///================ Board Failure Status
if ( digi [ boardID ] - > GetDPPType ( ) = = V1730_DPP_PHA_CODE ) {
pha = dynamic_cast < DigitizerPHA * > ( digi [ boardID ] ) ;
unsigned int temp = pha - > ReadRegister ( Register : : BoardFailureStatus ) ;
if ( ( temp & 0x10 ) = = 0 ) {
enPLLStatus - > SetText ( " OK " ) ; enPLLStatus - > SetTextColor ( 1 ) ;
} else {
enPLLStatus - > SetText ( " Lost Lock " ) ; enPLLStatus - > SetTextColor ( red ) ;
}
if ( ( temp & 0x20 ) = = 0 ) {
enTempStatus - > SetText ( " OK " ) ; enTempStatus - > SetTextColor ( 1 ) ;
} else {
enTempStatus - > SetText ( " Failure " ) ; enTempStatus - > SetTextColor ( red ) ;
}
if ( ( temp & 0x40 ) = = 0 ) {
enADCPwrStatus - > SetText ( " OK " ) ; enADCPwrStatus - > SetTextColor ( 1 ) ;
} else {
enADCPwrStatus - > SetText ( " Failure " ) ; enADCPwrStatus - > SetTextColor ( red ) ;
}
pha - > PrintBoardConfiguration ( ) ;
bAutoDataFlush - > SetState ( pha - > GetSetting ( Setting : : PHA : : AutoDataFlush_board_bool ) = = 1.0 ? kButtonDown : kButtonUp ) ;
bDecimateWF - > SetState ( pha - > GetSetting ( Setting : : PHA : : DecimateWaveForm_board_bool ) = = 1.0 ? kButtonDown : kButtonUp ) ;
bWFRecord - > SetState ( pha - > GetSetting ( Setting : : PHA : : WavefromRecording_board_bool ) = = 1.0 ? kButtonDown : kButtonUp ) ;
bTrigPropa - > SetState ( pha - > GetSetting ( Setting : : PHA : : TriggerPropapation_board_bool ) = = 1.0 ? kButtonDown : kButtonUp ) ;
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 ) ;
2022-09-19 12:46:27 -04:00
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 ) ;
2022-09-16 17:53:57 -04:00
}
2022-09-19 12:46:27 -04:00
2022-08-23 13:43:05 -04:00
return ;
}
2022-08-24 17:50:21 -04:00
void BoardSetting : : SetAutoDataFlush ( ) {
printf ( " ========== Auto Data Flush \n " ) ;
}
void BoardSetting : : SetDecimateWF ( ) {
printf ( " ========== Decimate WF \n " ) ;
}
void BoardSetting : : SetWaveFormRecord ( ) {
printf ( " ========== WF Record \n " ) ;
}
void BoardSetting : : SetDualTrace ( ) {
printf ( " ========== Dual trace \n " ) ;
cbAP2 - > SetEnabled ( bDualTrace - > IsDown ( ) ) ;
}
void BoardSetting : : SetTriggerPropagation ( ) {
printf ( " ========== Trigger Propagation \n " ) ;
}
void BoardSetting : : SetEnableExtra2 ( ) {
printf ( " ========== SetEnableExtra2 \n " ) ;
}
void BoardSetting : : SetAnalogProbe1 ( ) {
printf ( " ========== SetAnalogProbe1, %d \n " , cbAP1 - > GetSelected ( ) ) ;
}
void BoardSetting : : SetAnalogProbe2 ( ) {
printf ( " ========== SetAnalogProbe2, %d \n " , cbAP2 - > GetSelected ( ) ) ;
}
void BoardSetting : : SetDigitalProbe ( ) {
printf ( " ========== SetDigitalProbe, %d \n " , cbDP - > GetSelected ( ) ) ;
}
void BoardSetting : : SetAggregateOrganization ( ) {
printf ( " ========== SetAggregateOrganization, %d \n " , cbAggOrg - > GetSelected ( ) ) ;
}
void BoardSetting : : SetReadOutAggregate ( ) {
printf ( " ========== SetReadOutAggregate, %d \n " , ( int ) numAggBLT - > GetNumber ( ) ) ;
}
2022-09-16 17:53:57 -04:00
void BoardSetting : : SetAnalogMonitorMode ( ) {
printf ( " ========== SetAnalogMonitorMode, %d \n " , cbAnaMonitor - > GetSelected ( ) ) ;
if ( cbAnaMonitor - > GetSelected ( ) = = 3 ) {
numBufferOccpGain - > SetState ( true ) ;
} else {
numBufferOccpGain - > SetState ( false ) ;
}
}
void BoardSetting : : SoftwareReset ( ) {
}