bugs fix on channelSetting.cpp and settignsSummary
This commit is contained in:
parent
34a90be3d3
commit
9e11e8f613
|
@ -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(" 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(" Enable trace capture (bit: 8) : %s \n", CSRA & CSRA_BIT::ENABLE_TRACE ? "enable" : "disable");
|
||||
printf(" Enable QDC sum capture (bit: 9) : %s \n", CSRA & CSRA_BIT::ENABLE_QDC ? "enable" : "disable");
|
||||
printf(" Enable CFD trigger mode (bit: 10) : %s \n", CSRA & CSRA_BIT::ENABLE_CFD ? "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 ? "\033[1;33menable\033[m" : "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(" 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");
|
||||
|
|
|
@ -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()");
|
||||
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));
|
||||
}
|
||||
|
||||
|
|
|
@ -20,189 +20,203 @@ SettingsSummary::SettingsSummary(const TGWindow *p, UInt_t w, UInt_t h, Pixie16
|
|||
fMain = new TGMainFrame(p,w,h);
|
||||
fMain->SetWindowName("Pixie16 Settings Summary");
|
||||
fMain->Connect("CloseWindow()", "SettingsSummary", this, "CloseWindow()");
|
||||
fMain->SetMWMHints(1,4, 0);
|
||||
//fMain->SetMWMHints(1,4, 0);
|
||||
|
||||
gClient->GetColorByName("red", red);
|
||||
gClient->GetColorByName("black", black);
|
||||
|
||||
///Module choose
|
||||
TGHorizontalFrame *hframe = new TGHorizontalFrame(fMain, w, 50 );
|
||||
fMain->AddFrame(hframe, new TGLayoutHints(kLHintsCenterX, 2,2,2,2));
|
||||
{///======================= Module choose and settings file
|
||||
TGHorizontalFrame *hframe = new TGHorizontalFrame(fMain, w, 50 );
|
||||
fMain->AddFrame(hframe, new TGLayoutHints(kLHintsCenterX, 2,2,2,2));
|
||||
|
||||
TGLabel * lb1 = new TGLabel(hframe, "Module ID :");
|
||||
hframe->AddFrame(lb1, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
|
||||
TGLabel * lb1 = new TGLabel(hframe, "Module ID :");
|
||||
hframe->AddFrame(lb1, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
|
||||
|
||||
modIDEntry = new TGNumberEntry(hframe, 0, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative);
|
||||
modIDEntry->SetWidth(50);
|
||||
modIDEntry->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, pixie->GetNumModule()-1);
|
||||
modIDEntry->Connect("Modified()", "SettingsSummary", this, "ChangeMod()");
|
||||
if( pixie->GetNumModule() == 1 ) modIDEntry->SetState(false);
|
||||
hframe->AddFrame(modIDEntry, new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
|
||||
modIDEntry = new TGNumberEntry(hframe, 0, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative);
|
||||
modIDEntry->SetWidth(50);
|
||||
modIDEntry->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, pixie->GetNumModule()-1);
|
||||
modIDEntry->Connect("Modified()", "SettingsSummary", this, "ChangeMod()");
|
||||
if( pixie->GetNumModule() == 1 ) modIDEntry->SetState(false);
|
||||
hframe->AddFrame(modIDEntry, new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
|
||||
|
||||
TGLabel * lb2 = new TGLabel(hframe, "Setting File :");
|
||||
hframe->AddFrame(lb2, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
|
||||
TGLabel * lb2 = new TGLabel(hframe, "Setting File :");
|
||||
hframe->AddFrame(lb2, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
|
||||
|
||||
teFileName = new TGTextEntry(hframe, new TGTextBuffer(50));
|
||||
teFileName->SetEnabled(false);
|
||||
teFileName->SetText( settingFileName );
|
||||
hframe->AddFrame(teFileName, new TGLayoutHints(kLHintsCenterX, 5,5,3,4));
|
||||
teFileName = new TGTextEntry(hframe, new TGTextBuffer(50));
|
||||
teFileName->SetEnabled(false);
|
||||
teFileName->SetText( settingFileName );
|
||||
hframe->AddFrame(teFileName, new TGLayoutHints(kLHintsCenterX, 5,5,3,4));
|
||||
|
||||
TGTextButton * bOpen = new TGTextButton(hframe,"&Open");
|
||||
bOpen->Connect("Clicked()","SettingsSummary",this, "OpenFile()");
|
||||
hframe->AddFrame(bOpen, new TGLayoutHints(kLHintsCenterX, 5,5,3,4));
|
||||
TGTextButton * bOpen = new TGTextButton(hframe,"&Open");
|
||||
bOpen->Connect("Clicked()","SettingsSummary",this, "OpenFile()");
|
||||
hframe->AddFrame(bOpen, new TGLayoutHints(kLHintsCenterX, 5,5,3,4));
|
||||
|
||||
TGTextButton * bSave = new TGTextButton(hframe,"&Save");
|
||||
bSave->Connect("Clicked()","SettingsSummary",this, "SaveSetting()");
|
||||
hframe->AddFrame(bSave, new TGLayoutHints(kLHintsCenterX, 5,5,3,4));
|
||||
TGTextButton * bSave = new TGTextButton(hframe,"&Save");
|
||||
bSave->Connect("Clicked()","SettingsSummary",this, "SaveSetting()");
|
||||
hframe->AddFrame(bSave, new TGLayoutHints(kLHintsCenterX, 5,5,3,4));
|
||||
|
||||
/// Setting
|
||||
int modID = modIDEntry->GetNumber();
|
||||
TGTextButton * bGetSettingsFromDigitizer = new TGTextButton(hframe,"&Refresh from digitizer");
|
||||
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();
|
||||
|
||||
TGHorizontalFrame * hframeCh[MAXCH];
|
||||
for( int i = 0; i < MAXCH ; i ++){
|
||||
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};
|
||||
|
||||
//printf("-----------------------%d\n", i);
|
||||
hframeCh[i] = new TGHorizontalFrame(hframeSettings, w, 600 );
|
||||
hframeSettings->AddFrame(hframeCh[i], new TGLayoutHints(kLHintsCenterX, 2,2,0,0));
|
||||
TGVerticalFrame *hframeSettings = new TGVerticalFrame(fMain, w, 600 );
|
||||
fMain->AddFrame(hframeSettings, new TGLayoutHints(kLHintsCenterX, 2,2,2,2));
|
||||
|
||||
int col = 0;
|
||||
lbCh[i] = new TGLabel(hframeCh[i] , Form("%02d", i));
|
||||
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);
|
||||
///---------- 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));
|
||||
}
|
||||
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++;
|
||||
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));
|
||||
TGHorizontalFrame * hframeCh[MAXCH];
|
||||
for( int i = 0; i < MAXCH ; i ++){
|
||||
|
||||
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));
|
||||
//printf("-----------------------%d\n", i);
|
||||
hframeCh[i] = new TGHorizontalFrame(hframeSettings, w, 600 );
|
||||
hframeSettings->AddFrame(hframeCh[i], new TGLayoutHints(kLHintsCenterX, 2,2,0,0));
|
||||
|
||||
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));
|
||||
int col = 0;
|
||||
lbCh[i] = new TGLabel(hframeCh[i] , Form("%02d", i));
|
||||
lbCh[i]->SetWidth(width[col]);
|
||||
lbCh[i]->SetTextColor(red);
|
||||
hframeCh[i]->AddFrame(lbCh[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 2, 2));
|
||||
|
||||
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++;
|
||||
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++;
|
||||
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++;
|
||||
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++;
|
||||
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++;
|
||||
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++;
|
||||
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++;
|
||||
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++;
|
||||
cbTraceOnOff[i] = new TGComboBox(hframeCh[i], i);
|
||||
cbTraceOnOff[i]->AddEntry("On", 1);
|
||||
cbTraceOnOff[i]->AddEntry("off", 0);
|
||||
cbTraceOnOff[i]->Resize(width[col], 20);
|
||||
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));
|
||||
hframeCh[i]->AddFrame(cbTraceOnOff[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 2, 2));
|
||||
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++;
|
||||
neTraceLength[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTraceLength(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative);
|
||||
neTraceLength[i]->SetWidth(width[col]);
|
||||
neTraceLength[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 20.0);
|
||||
neTraceLength[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeTraceLenght(=%d)", i));
|
||||
hframeCh[i]->AddFrame(neTraceLength[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++;
|
||||
neTraceDelay[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTraceDelay(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative);
|
||||
neTraceDelay[i]->SetWidth(width[col]);
|
||||
neTraceDelay[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 20.0);
|
||||
neTraceDelay[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeTraceDelay(=%d)", i));
|
||||
hframeCh[i]->AddFrame(neTraceDelay[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
|
||||
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++;
|
||||
neVoff[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelVOffset(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEAAnyNumber);
|
||||
neVoff[i]->SetWidth(width[col]);
|
||||
neVoff[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, -2, 2);
|
||||
neVoff[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeVoff(=%d)", i));
|
||||
hframeCh[i]->AddFrame(neVoff[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++;
|
||||
neBL[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelBaseLinePrecent(modID, i), 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative);
|
||||
neBL[i]->SetWidth(width[col]);
|
||||
neBL[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 100);
|
||||
neBL[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeBL(=%d)", i));
|
||||
hframeCh[i]->AddFrame(neBL[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++;
|
||||
cbTraceOnOff[i] = new TGComboBox(hframeCh[i], i);
|
||||
cbTraceOnOff[i]->AddEntry("On", 1);
|
||||
cbTraceOnOff[i]->AddEntry("off", 0);
|
||||
cbTraceOnOff[i]->Resize(width[col], 20);
|
||||
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));
|
||||
hframeCh[i]->AddFrame(cbTraceOnOff[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 2, 2));
|
||||
|
||||
col++;
|
||||
neTraceLength[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTraceLength(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative);
|
||||
neTraceLength[i]->SetWidth(width[col]);
|
||||
neTraceLength[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 20.0);
|
||||
neTraceLength[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeTraceLenght(=%d)", i));
|
||||
hframeCh[i]->AddFrame(neTraceLength[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
|
||||
|
||||
col++;
|
||||
neTraceDelay[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTraceDelay(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative);
|
||||
neTraceDelay[i]->SetWidth(width[col]);
|
||||
neTraceDelay[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 20.0);
|
||||
neTraceDelay[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeTraceDelay(=%d)", i));
|
||||
hframeCh[i]->AddFrame(neTraceDelay[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
|
||||
|
||||
col++;
|
||||
neVoff[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelVOffset(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEAAnyNumber);
|
||||
neVoff[i]->SetWidth(width[col]);
|
||||
neVoff[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, -2, 2);
|
||||
neVoff[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeVoff(=%d)", i));
|
||||
hframeCh[i]->AddFrame(neVoff[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
|
||||
|
||||
col++;
|
||||
neBL[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelBaseLinePrecent(modID, i), 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative);
|
||||
neBL[i]->SetWidth(width[col]);
|
||||
neBL[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 100);
|
||||
neBL[i]->Connect("Modified()", "SettingsSummary", this, Form("ChangeBL(=%d)", i));
|
||||
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->Resize(fMain->GetDefaultSize());
|
||||
fMain->MapWindow();
|
||||
|
@ -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){
|
||||
short modID = modIDEntry->GetNumber();
|
||||
int val = cbOnOff[ch]->GetSelected();
|
||||
|
|
|
@ -56,6 +56,8 @@ public:
|
|||
|
||||
void CloseWindow() { printf("close SettingsSummary window\n"); delete this; }
|
||||
|
||||
void GetSettingsFromDigitizer();
|
||||
|
||||
void ChangeOnOff(unsigned short ch);
|
||||
void ChangeGain(unsigned short ch);
|
||||
void ChangePol(unsigned short ch);
|
||||
|
|
Loading…
Reference in New Issue
Block a user