bugs fix on channelSetting.cpp and settignsSummary

This commit is contained in:
tandem 2022-12-07 16:26:49 -05:00
parent 34a90be3d3
commit 9e11e8f613
4 changed files with 209 additions and 159 deletions

View File

@ -611,9 +611,9 @@ double Pixie16::GetChannelSetting(std::string parName, unsigned short modID, uns
printf("Block data acquisition if trace or header DPMs are full (bit: 4) : %s \n", CSRA & CSRA_BIT::BLOCK_DAQ_DPM_FULL ? "Yes" : "No"); printf("Block data acquisition if trace or header DPMs are full (bit: 4) : %s \n", CSRA & CSRA_BIT::BLOCK_DAQ_DPM_FULL ? "Yes" : "No");
printf(" signal polarity (bit: 5) : %s \n", CSRA & CSRA_BIT::POLARITY ? "\033[1;33mPositive\033[m" : "\033[1;31mNegative\033[m"); printf(" signal polarity (bit: 5) : %s \n", CSRA & CSRA_BIT::POLARITY ? "\033[1;33mPositive\033[m" : "\033[1;31mNegative\033[m");
printf(" veto channel trigger (bit: 6) : %s \n", CSRA & CSRA_BIT::VETO_TRIGGER ? "enable" : "disable"); printf(" veto channel trigger (bit: 6) : %s \n", CSRA & CSRA_BIT::VETO_TRIGGER ? "enable" : "disable");
printf(" Enable trace capture (bit: 8) : %s \n", CSRA & CSRA_BIT::ENABLE_TRACE ? "enable" : "disable"); printf(" Enable trace capture (bit: 8) : %s \n", CSRA & CSRA_BIT::ENABLE_TRACE ? "\033[1;33menable\033[m" : "disable");
printf(" Enable QDC sum capture (bit: 9) : %s \n", CSRA & CSRA_BIT::ENABLE_QDC ? "enable" : "disable"); printf(" Enable QDC sum capture (bit: 9) : %s \n", CSRA & CSRA_BIT::ENABLE_QDC ? "\033[1;33menable\033[m" : "disable");
printf(" Enable CFD trigger mode (bit: 10) : %s \n", CSRA & CSRA_BIT::ENABLE_CFD ? "enable" : "disable"); printf(" Enable CFD trigger mode (bit: 10) : %s \n", CSRA & CSRA_BIT::ENABLE_CFD ? "\033[1;33menable\033[m" : "disable");
printf(" required module validation trigger (bit: 11) : %s \n", CSRA & CSRA_BIT::REQ_M_VALIDATION ? "required" : "not required"); printf(" required module validation trigger (bit: 11) : %s \n", CSRA & CSRA_BIT::REQ_M_VALIDATION ? "required" : "not required");
printf(" Enable capture raw energy sums and baselines (bit: 12) : %s \n", CSRA & CSRA_BIT::CAPTURE_ESUMS_BASELINE ? "enable" : "disable"); printf(" Enable capture raw energy sums and baselines (bit: 12) : %s \n", CSRA & CSRA_BIT::CAPTURE_ESUMS_BASELINE ? "enable" : "disable");
printf(" required cahnnel validation trigger (bit: 13) : %s \n", CSRA & CSRA_BIT::REQ_C_VALIDATION ? "required" : "not required"); printf(" required cahnnel validation trigger (bit: 13) : %s \n", CSRA & CSRA_BIT::REQ_C_VALIDATION ? "required" : "not required");

View File

@ -164,7 +164,7 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Pixie16 *
cbQDCsumOnOff->Connect("Selected(Int_t, Int_t)", "ChannelSetting", this, "ChangeQDCsumOnOff()"); cbQDCsumOnOff->Connect("Selected(Int_t, Int_t)", "ChannelSetting", this, "ChangeQDCsumOnOff()");
hframeQDCsumOnOff->AddFrame(cbQDCsumOnOff, new TGLayoutHints(kLHintsRight, 5,5,3,4)); hframeQDCsumOnOff->AddFrame(cbQDCsumOnOff, new TGLayoutHints(kLHintsRight, 5,5,3,4));
TGLabel * lbQDCsumOnOff = new TGLabel(hframeQDCsumOnOff, "Trace On/Off"); TGLabel * lbQDCsumOnOff = new TGLabel(hframeQDCsumOnOff, "QDC sum On/Off");
hframeQDCsumOnOff->AddFrame(lbQDCsumOnOff, new TGLayoutHints(kLHintsRight | kLHintsCenterY, 5, 5, 3, 4)); hframeQDCsumOnOff->AddFrame(lbQDCsumOnOff, new TGLayoutHints(kLHintsRight | kLHintsCenterY, 5, 5, 3, 4));
} }

View File

@ -20,188 +20,202 @@ SettingsSummary::SettingsSummary(const TGWindow *p, UInt_t w, UInt_t h, Pixie16
fMain = new TGMainFrame(p,w,h); fMain = new TGMainFrame(p,w,h);
fMain->SetWindowName("Pixie16 Settings Summary"); fMain->SetWindowName("Pixie16 Settings Summary");
fMain->Connect("CloseWindow()", "SettingsSummary", this, "CloseWindow()"); fMain->Connect("CloseWindow()", "SettingsSummary", this, "CloseWindow()");
fMain->SetMWMHints(1,4, 0); //fMain->SetMWMHints(1,4, 0);
gClient->GetColorByName("red", red); gClient->GetColorByName("red", red);
gClient->GetColorByName("black", black); gClient->GetColorByName("black", black);
///Module choose {///======================= Module choose and settings file
TGHorizontalFrame *hframe = new TGHorizontalFrame(fMain, w, 50 ); TGHorizontalFrame *hframe = new TGHorizontalFrame(fMain, w, 50 );
fMain->AddFrame(hframe, new TGLayoutHints(kLHintsCenterX, 2,2,2,2)); fMain->AddFrame(hframe, new TGLayoutHints(kLHintsCenterX, 2,2,2,2));
TGLabel * lb1 = new TGLabel(hframe, "Module ID :"); TGLabel * lb1 = new TGLabel(hframe, "Module ID :");
hframe->AddFrame(lb1, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4)); hframe->AddFrame(lb1, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
modIDEntry = new TGNumberEntry(hframe, 0, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); modIDEntry = new TGNumberEntry(hframe, 0, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative);
modIDEntry->SetWidth(50); modIDEntry->SetWidth(50);
modIDEntry->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, pixie->GetNumModule()-1); modIDEntry->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, pixie->GetNumModule()-1);
modIDEntry->Connect("Modified()", "SettingsSummary", this, "ChangeMod()"); modIDEntry->Connect("Modified()", "SettingsSummary", this, "ChangeMod()");
if( pixie->GetNumModule() == 1 ) modIDEntry->SetState(false); if( pixie->GetNumModule() == 1 ) modIDEntry->SetState(false);
hframe->AddFrame(modIDEntry, new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4)); hframe->AddFrame(modIDEntry, new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
TGLabel * lb2 = new TGLabel(hframe, "Setting File :"); TGLabel * lb2 = new TGLabel(hframe, "Setting File :");
hframe->AddFrame(lb2, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4)); hframe->AddFrame(lb2, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
teFileName = new TGTextEntry(hframe, new TGTextBuffer(50)); teFileName = new TGTextEntry(hframe, new TGTextBuffer(50));
teFileName->SetEnabled(false); teFileName->SetEnabled(false);
teFileName->SetText( settingFileName ); teFileName->SetText( settingFileName );
hframe->AddFrame(teFileName, new TGLayoutHints(kLHintsCenterX, 5,5,3,4)); hframe->AddFrame(teFileName, new TGLayoutHints(kLHintsCenterX, 5,5,3,4));
TGTextButton * bOpen = new TGTextButton(hframe,"&Open"); TGTextButton * bOpen = new TGTextButton(hframe,"&Open");
bOpen->Connect("Clicked()","SettingsSummary",this, "OpenFile()"); bOpen->Connect("Clicked()","SettingsSummary",this, "OpenFile()");
hframe->AddFrame(bOpen, new TGLayoutHints(kLHintsCenterX, 5,5,3,4)); hframe->AddFrame(bOpen, new TGLayoutHints(kLHintsCenterX, 5,5,3,4));
TGTextButton * bSave = new TGTextButton(hframe,"&Save"); TGTextButton * bSave = new TGTextButton(hframe,"&Save");
bSave->Connect("Clicked()","SettingsSummary",this, "SaveSetting()"); bSave->Connect("Clicked()","SettingsSummary",this, "SaveSetting()");
hframe->AddFrame(bSave, new TGLayoutHints(kLHintsCenterX, 5,5,3,4)); hframe->AddFrame(bSave, new TGLayoutHints(kLHintsCenterX, 5,5,3,4));
/// Setting TGTextButton * bGetSettingsFromDigitizer = new TGTextButton(hframe,"&Refresh from digitizer");
int modID = modIDEntry->GetNumber(); bGetSettingsFromDigitizer->Connect("Clicked()","SettingsSummary",this, "GetSettingsFromDigitizer()");
hframe->AddFrame(bGetSettingsFromDigitizer, new TGLayoutHints(kLHintsCenterX, 5,5,3,4));
int numItems = 15;
TString labelText[numItems] = {"CH", "ON/off", "Gain", "Trig L", "Trig G", "Threshold", "Polarity", "Energy L", "Energy G", "Tau", "Trace I/O", "Trace Len", "Trace delay", "V offset", "BaseLine"};
double width[numItems] = { 50, 50, 50, 60, 60, 80, 60, 60, 60, 60, 50, 80, 80, 70, 80};
TGVerticalFrame *hframeSettings = new TGVerticalFrame(fMain, w, 600 );
fMain->AddFrame(hframeSettings, new TGLayoutHints(kLHintsCenterX, 2,2,2,2));
///---------- label row
TGHorizontalFrame * hframeLabel = new TGHorizontalFrame(hframeSettings, w, 50);
hframeSettings->AddFrame(hframeLabel, new TGLayoutHints(kLHintsExpandX, 2,2,0,0));
TGLabel * labelItems[numItems];
for(int i = 0; i < numItems; i++){
labelItems[i] = new TGLabel(hframeLabel, Form("%s", labelText[i].Data()));
labelItems[i]->Resize(width[i], 20);
labelItems[i]->SetMargins(0, (i == 0 ? 0 : 10) , 0, 0);
hframeLabel->AddFrame(labelItems[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 2, 2));
} }
{///======================= Setting
int modID = modIDEntry->GetNumber();
int numItems = 15;
TString labelText[numItems] = {"CH", "ON/off", "Gain", "Trig L", "Trig G", "Threshold", "Polarity", "Energy L", "Energy G", "Tau", "Trace I/O", "Trace Len", "Trace delay", "V offset", "BaseLine"};
double width[numItems] = { 50, 50, 50, 60, 60, 80, 60, 60, 60, 60, 50, 80, 80, 70, 80};
TGVerticalFrame *hframeSettings = new TGVerticalFrame(fMain, w, 600 );
fMain->AddFrame(hframeSettings, new TGLayoutHints(kLHintsCenterX, 2,2,2,2));
TGHorizontalFrame * hframeCh[MAXCH]; ///---------- label row
for( int i = 0; i < MAXCH ; i ++){ TGHorizontalFrame * hframeLabel = new TGHorizontalFrame(hframeSettings, w, 50);
hframeSettings->AddFrame(hframeLabel, new TGLayoutHints(kLHintsExpandX, 2,2,0,0));
//printf("-----------------------%d\n", i); TGLabel * labelItems[numItems];
hframeCh[i] = new TGHorizontalFrame(hframeSettings, w, 600 ); for(int i = 0; i < numItems; i++){
hframeSettings->AddFrame(hframeCh[i], new TGLayoutHints(kLHintsCenterX, 2,2,0,0)); labelItems[i] = new TGLabel(hframeLabel, Form("%s", labelText[i].Data()));
labelItems[i]->Resize(width[i], 20);
int col = 0; labelItems[i]->SetMargins(0, (i == 0 ? 0 : 10) , 0, 0);
lbCh[i] = new TGLabel(hframeCh[i] , Form("%02d", i)); hframeLabel->AddFrame(labelItems[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 2, 2));
lbCh[i]->SetWidth(width[col]);
lbCh[i]->SetTextColor(red);
hframeCh[i]->AddFrame(lbCh[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 2, 2));
col++;
cbOnOff[i] = new TGComboBox(hframeCh[i], i);
cbOnOff[i]->AddEntry("ON", 1);
cbOnOff[i]->AddEntry("off", 0);
cbOnOff[i]->Resize(width[col], 20);
if( pixie->GetChannelOnOff(modID, i) ){
cbOnOff[i]->Select(1);
lbCh[i]->SetTextColor(red);
}else{
cbOnOff[i]->Select(0);
lbCh[i]->SetTextColor(black);
} }
cbOnOff[i]->Connect("Selected(Int_t, Int_t)", "SettingsSummary", this, Form("ChangeOnOff(=%d)", i));
hframeCh[i]->AddFrame(cbOnOff[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 2, 2));
col++;
cbGain[i] = new TGComboBox(hframeCh[i], i);
cbGain[i]->AddEntry("x1", 1);
cbGain[i]->AddEntry("x1/4", 0);
cbGain[i]->Resize(width[col], 20);
pixie->GetChannelGain(modID, i) ? cbGain[i]->Select(1) : cbGain[i]->Select(0);
cbGain[i]->Connect("Selected(Int_t, Int_t)", "SettingsSummary", this, Form("ChangeGain(=%d)", i));
hframeCh[i]->AddFrame(cbGain[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 2, 2));
col++; TGHorizontalFrame * hframeCh[MAXCH];
neTrigL[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTriggerRiseTime(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative); for( int i = 0; i < MAXCH ; i ++){
neTrigL[i]->SetWidth(width[col]);
neTrigL[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 2.0);
neTrigL[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeTrigL(=%d)", i));
hframeCh[i]->AddFrame(neTrigL[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++; //printf("-----------------------%d\n", i);
neTrigG[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTriggerFlatTop(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative); hframeCh[i] = new TGHorizontalFrame(hframeSettings, w, 600 );
neTrigG[i]->SetWidth(width[col]); hframeSettings->AddFrame(hframeCh[i], new TGLayoutHints(kLHintsCenterX, 2,2,0,0));
neTrigG[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 2.0);
neTrigG[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeTrigG(=%d)", i));
hframeCh[i]->AddFrame(neTrigG[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++; int col = 0;
neThreshold[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTriggerThreshold(modID, i), 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); lbCh[i] = new TGLabel(hframeCh[i] , Form("%02d", i));
neThreshold[i]->SetWidth(width[col]); lbCh[i]->SetWidth(width[col]);
neThreshold[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 4000); lbCh[i]->SetTextColor(red);
neThreshold[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeThreshold(=%d)", i)); hframeCh[i]->AddFrame(lbCh[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 2, 2));
hframeCh[i]->AddFrame(neThreshold[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++; col++;
cbPol[i] = new TGComboBox(hframeCh[i], i); cbOnOff[i] = new TGComboBox(hframeCh[i], i);
cbPol[i]->AddEntry("Pos +", 1); cbOnOff[i]->AddEntry("ON", 1);
cbPol[i]->AddEntry("Neg -", 0); cbOnOff[i]->AddEntry("off", 0);
cbPol[i]->Resize(width[col], 20); cbOnOff[i]->Resize(width[col], 20);
pixie->GetChannelPolarity(modID, i) ? cbPol[i]->Select(1) : cbPol[i]->Select(0); if( pixie->GetChannelOnOff(modID, i) ){
cbPol[i]->Connect("Selected(Int_t, Int_t)", "SettingsSummary", this, Form("ChangePol(=%d)", i)); cbOnOff[i]->Select(1);
hframeCh[i]->AddFrame(cbPol[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 2, 2)); lbCh[i]->SetTextColor(red);
}else{
col++; cbOnOff[i]->Select(0);
neEngL[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelEnergyRiseTime(modID, i), 0, 0, TGNumberFormat::kNESRealOne, TGNumberFormat::kNEANonNegative); lbCh[i]->SetTextColor(black);
neEngL[i]->SetWidth(width[col]); }
neEngL[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 10.0); cbOnOff[i]->Connect("Selected(Int_t, Int_t)", "SettingsSummary", this, Form("ChangeOnOff(=%d)", i));
neEngL[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeEngL(=%d)", i)); hframeCh[i]->AddFrame(cbOnOff[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 2, 2));
hframeCh[i]->AddFrame(neEngL[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++;
neEngG[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelEnergyFlatTop(modID, i), 0, 0, TGNumberFormat::kNESRealOne, TGNumberFormat::kNEANonNegative);
neEngG[i]->SetWidth(width[col]);
neEngG[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 10.0);
neEngG[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeEngG(=%d)", i));
hframeCh[i]->AddFrame(neEngG[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++; col++;
neTau[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelEnergyTau(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative); cbGain[i] = new TGComboBox(hframeCh[i], i);
neTau[i]->SetWidth(width[col]); cbGain[i]->AddEntry("x1", 1);
neTau[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 300.0); cbGain[i]->AddEntry("x1/4", 0);
neTau[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeTau(=%d)", i)); cbGain[i]->Resize(width[col], 20);
hframeCh[i]->AddFrame(neTau[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4)); pixie->GetChannelGain(modID, i) ? cbGain[i]->Select(1) : cbGain[i]->Select(0);
cbGain[i]->Connect("Selected(Int_t, Int_t)", "SettingsSummary", this, Form("ChangeGain(=%d)", i));
hframeCh[i]->AddFrame(cbGain[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 2, 2));
col++;
neTrigL[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTriggerRiseTime(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative);
neTrigL[i]->SetWidth(width[col]);
neTrigL[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 2.0);
neTrigL[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeTrigL(=%d)", i));
hframeCh[i]->AddFrame(neTrigL[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++;
neTrigG[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTriggerFlatTop(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative);
neTrigG[i]->SetWidth(width[col]);
neTrigG[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 2.0);
neTrigG[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeTrigG(=%d)", i));
hframeCh[i]->AddFrame(neTrigG[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++;
neThreshold[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTriggerThreshold(modID, i), 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative);
neThreshold[i]->SetWidth(width[col]);
neThreshold[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 4000);
neThreshold[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeThreshold(=%d)", i));
hframeCh[i]->AddFrame(neThreshold[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++;
cbPol[i] = new TGComboBox(hframeCh[i], i);
cbPol[i]->AddEntry("Pos +", 1);
cbPol[i]->AddEntry("Neg -", 0);
cbPol[i]->Resize(width[col], 20);
pixie->GetChannelPolarity(modID, i) ? cbPol[i]->Select(1) : cbPol[i]->Select(0);
cbPol[i]->Connect("Selected(Int_t, Int_t)", "SettingsSummary", this, Form("ChangePol(=%d)", i));
hframeCh[i]->AddFrame(cbPol[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 2, 2));
col++;
neEngL[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelEnergyRiseTime(modID, i), 0, 0, TGNumberFormat::kNESRealOne, TGNumberFormat::kNEANonNegative);
neEngL[i]->SetWidth(width[col]);
neEngL[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 10.0);
neEngL[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeEngL(=%d)", i));
hframeCh[i]->AddFrame(neEngL[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++;
neEngG[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelEnergyFlatTop(modID, i), 0, 0, TGNumberFormat::kNESRealOne, TGNumberFormat::kNEANonNegative);
neEngG[i]->SetWidth(width[col]);
neEngG[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 10.0);
neEngG[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeEngG(=%d)", i));
hframeCh[i]->AddFrame(neEngG[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++;
neTau[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelEnergyTau(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative);
neTau[i]->SetWidth(width[col]);
neTau[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 300.0);
neTau[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeTau(=%d)", i));
hframeCh[i]->AddFrame(neTau[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++; col++;
cbTraceOnOff[i] = new TGComboBox(hframeCh[i], i); cbTraceOnOff[i] = new TGComboBox(hframeCh[i], i);
cbTraceOnOff[i]->AddEntry("On", 1); cbTraceOnOff[i]->AddEntry("On", 1);
cbTraceOnOff[i]->AddEntry("off", 0); cbTraceOnOff[i]->AddEntry("off", 0);
cbTraceOnOff[i]->Resize(width[col], 20); cbTraceOnOff[i]->Resize(width[col], 20);
pixie->GetChannelTraceOnOff(modID, i) ? cbTraceOnOff[i]->Select(1) : cbTraceOnOff[i]->Select(0); pixie->GetChannelTraceOnOff(modID, i) ? cbTraceOnOff[i]->Select(1) : cbTraceOnOff[i]->Select(0);
cbTraceOnOff[i]->Connect("Selected(Int_t, Int_t)", "SettingsSummary", this, Form("ChangeTraceOnOff(=%d)", i)); cbTraceOnOff[i]->Connect("Selected(Int_t, Int_t)", "SettingsSummary", this, Form("ChangeTraceOnOff(=%d)", i));
hframeCh[i]->AddFrame(cbTraceOnOff[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 2, 2)); hframeCh[i]->AddFrame(cbTraceOnOff[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 2, 2));
col++; col++;
neTraceLength[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTraceLength(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative); neTraceLength[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTraceLength(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative);
neTraceLength[i]->SetWidth(width[col]); neTraceLength[i]->SetWidth(width[col]);
neTraceLength[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 20.0); neTraceLength[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 20.0);
neTraceLength[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeTraceLenght(=%d)", i)); neTraceLength[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeTraceLenght(=%d)", i));
hframeCh[i]->AddFrame(neTraceLength[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4)); hframeCh[i]->AddFrame(neTraceLength[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++; col++;
neTraceDelay[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTraceDelay(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative); neTraceDelay[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTraceDelay(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative);
neTraceDelay[i]->SetWidth(width[col]); neTraceDelay[i]->SetWidth(width[col]);
neTraceDelay[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 20.0); neTraceDelay[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 20.0);
neTraceDelay[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeTraceDelay(=%d)", i)); neTraceDelay[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeTraceDelay(=%d)", i));
hframeCh[i]->AddFrame(neTraceDelay[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4)); hframeCh[i]->AddFrame(neTraceDelay[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++; col++;
neVoff[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelVOffset(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEAAnyNumber); neVoff[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelVOffset(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEAAnyNumber);
neVoff[i]->SetWidth(width[col]); neVoff[i]->SetWidth(width[col]);
neVoff[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, -2, 2); neVoff[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, -2, 2);
neVoff[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeVoff(=%d)", i)); neVoff[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeVoff(=%d)", i));
hframeCh[i]->AddFrame(neVoff[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4)); hframeCh[i]->AddFrame(neVoff[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++; col++;
neBL[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelBaseLinePrecent(modID, i), 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); neBL[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelBaseLinePrecent(modID, i), 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative);
neBL[i]->SetWidth(width[col]); neBL[i]->SetWidth(width[col]);
neBL[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 100); neBL[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 100);
neBL[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeBL(=%d)", i)); neBL[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeBL(=%d)", i));
hframeCh[i]->AddFrame(neBL[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4)); hframeCh[i]->AddFrame(neBL[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
}
} }
TGHorizontalFrame * hframeLabel2 = new TGHorizontalFrame(fMain, w, 50);
fMain->AddFrame(hframeLabel2, new TGLayoutHints(kLHintsExpandX, 2,2,0,0));
TGLabel * lb999 = new TGLabel(hframeLabel2, "When this panel open, it read all settings from the digitizer.");
hframeLabel2->AddFrame(lb999, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 5, 5, 3, 4));
fMain->MapSubwindows(); fMain->MapSubwindows();
fMain->Resize(fMain->GetDefaultSize()); fMain->Resize(fMain->GetDefaultSize());
@ -242,7 +256,41 @@ SettingsSummary::~SettingsSummary(){
} }
void SettingsSummary::GetSettingsFromDigitizer(){
printf("===== %s \n", __func__);
short modID = modIDEntry->GetNumber();
for( int i=0; i < MAXCH; i++){
if( pixie->GetChannelOnOff(modID, i) ){
cbOnOff[i]->Select(1);
lbCh[i]->SetTextColor(red);
}else{
cbOnOff[i]->Select(0);
lbCh[i]->SetTextColor(black);
}
pixie->GetChannelGain(modID, i) ? cbGain[i]->Select(1) : cbGain[i]->Select(0);
neTrigL[i]->SetNumber(pixie->GetChannelTriggerRiseTime(modID, i));
neTrigG[i]->SetNumber(pixie->GetChannelTriggerFlatTop(modID, i));
neThreshold[i]->SetNumber(pixie->GetChannelTriggerThreshold(modID, i));
pixie->GetChannelPolarity(modID, i) ? cbPol[i]->Select(1) : cbPol[i]->Select(0);
neEngL[i]->SetNumber(pixie->GetChannelEnergyRiseTime(modID, i));
neEngG[i]->SetNumber(pixie->GetChannelEnergyFlatTop(modID, i));
neTau[i]->SetNumber(pixie->GetChannelEnergyTau(modID, i));
pixie->GetChannelTraceOnOff(modID, i) ? cbTraceOnOff[i]->Select(1) : cbTraceOnOff[i]->Select(0);
neTraceLength[i]->SetNumber(pixie->GetChannelTraceLength(modID, i));
neTraceDelay[i]->SetNumber(pixie->GetChannelTraceDelay(modID, i));
neVoff[i]->SetNumber(pixie->GetChannelVOffset(modID, i));
neBL[i]->SetNumber(pixie->GetChannelBaseLinePrecent(modID, i));
}
}
void SettingsSummary::ChangeOnOff(unsigned short ch){ void SettingsSummary::ChangeOnOff(unsigned short ch){
short modID = modIDEntry->GetNumber(); short modID = modIDEntry->GetNumber();
int val = cbOnOff[ch]->GetSelected(); int val = cbOnOff[ch]->GetSelected();

View File

@ -55,6 +55,8 @@ public:
void CloseWindow() { printf("close SettingsSummary window\n"); delete this; } void CloseWindow() { printf("close SettingsSummary window\n"); delete this; }
void GetSettingsFromDigitizer();
void ChangeOnOff(unsigned short ch); void ChangeOnOff(unsigned short ch);
void ChangeGain(unsigned short ch); void ChangeGain(unsigned short ch);