mainSetting plannel is done.

This commit is contained in:
Ryan Tang 2022-03-16 18:46:14 -04:00
parent 757464f2b7
commit 7005979ec9
8 changed files with 279 additions and 82 deletions

View File

@ -44,6 +44,7 @@ Pixie16Class.o : Pixie16Class.h Pixie16Class.cpp DataBlock.h
pixieDict.cxx : pixieDAQ.h pixieDAQLinkDef.h pixieDict.cxx : pixieDAQ.h pixieDAQLinkDef.h
@echo "--------- creating pcm and cxx " @echo "--------- creating pcm and cxx "
@rootcling -f pixieDict.cxx -c pixieDAQ.h -p $(PIXIE_LIB_PATH) pixieDAQLinkDef.h @rootcling -f pixieDict.cxx -c pixieDAQ.h -p $(PIXIE_LIB_PATH) pixieDAQLinkDef.h
# @rootcling -f pixieDict.cxx -c pixieDAQ.h mainSettings.h -p $(PIXIE_LIB_PATH) pixieDAQLinkDef.h
pixieDAQ.o : pixieDict.cxx pixieDAQ.cpp pixieDAQ.h pixieDAQ.o : pixieDict.cxx pixieDAQ.cpp pixieDAQ.h
@echo "--------- creating pixieDAQ.o" @echo "--------- creating pixieDAQ.o"
@ -51,7 +52,9 @@ pixieDAQ.o : pixieDict.cxx pixieDAQ.cpp pixieDAQ.h
mainSettings.o : mainSettings.cpp mainSettings.h mainSettings.o : mainSettings.cpp mainSettings.h
@echo "--------- creating mainSettings.o" @echo "--------- creating mainSettings.o"
$(CC) $(CFLAGS) $(PIXIE_LIB_PATH) Pixie16Class.o mainSettings.cpp $(ROOT_FLAG) $(CC) $(CFLAGS) $(PIXIE_LIB_PATH) mainSettings.cpp $(ROOT_FLAG)
# $(CC) $(CFLAGS) $(PIXIE_LIB_PATH) Pixie16Class.o mainSettings.cpp $(ROOT_FLAG)
# $(CC) $(CFLAGS) $(PIXIE_LIB_PATH) Pixie16Class.o mainSettings.cpp pixieDict.cxx $(ROOT_FLAG)
#-------------------------- #--------------------------

View File

@ -72,6 +72,13 @@ Pixie16::~Pixie16(){
delete DSPCodeFile; delete DSPCodeFile;
delete DSPParFile; delete DSPParFile;
delete DSPVarFile; delete DSPVarFile;
delete ModRev;
delete ModSerNum;
delete ModADCBits;
delete ModADCMSPS;
delete numChannels;
delete ch2ns;
delete ExtFIFO_Data; delete ExtFIFO_Data;
delete Statistics; delete Statistics;

View File

@ -122,6 +122,7 @@ public:
unsigned short GetDigitizerRev(unsigned short modID) { return ModRev[modID];} unsigned short GetDigitizerRev(unsigned short modID) { return ModRev[modID];}
unsigned short GetDigitizerADCBits(unsigned short modID) { return ModADCBits[modID];} unsigned short GetDigitizerADCBits(unsigned short modID) { return ModADCBits[modID];}
unsigned short GetDigitizerNumChannel(unsigned short modID) { return numChannels[modID];} unsigned short GetDigitizerNumChannel(unsigned short modID) { return numChannels[modID];}
std::string GetSettingFile(unsigned modID) {return DSPParFile[modID];}
unsigned int GetDigitizerSetting(std::string parName, unsigned short modID, bool verbose = false); unsigned int GetDigitizerSetting(std::string parName, unsigned short modID, bool verbose = false);

View File

@ -6,10 +6,8 @@
#include <TGButton.h> #include <TGButton.h>
#include <TRootEmbeddedCanvas.h> #include <TRootEmbeddedCanvas.h>
#include <TGLabel.h> #include <TGLabel.h>
#include <TGNumberEntry.h>
#include <TGComboBox.h>
#include <TGComboBox.h>
#include <TGTableContainer.h> #include <TGTableContainer.h>
#include <TGFileDialog.h>
#include "mainSettings.h" #include "mainSettings.h"
@ -18,31 +16,43 @@ MainSettings::MainSettings(const TGWindow *p, UInt_t w, UInt_t h, Pixie16 * pixi
this->pixie = pixie; this->pixie = pixie;
settingFileName = pixie->GetSettingFile(0);
fMain = new TGMainFrame(p,w,h); fMain = new TGMainFrame(p,w,h);
fMain->SetWindowName("Pixie16 Channel Settings "); fMain->SetWindowName("Pixie16 Channel Settings ");
fMain->Connect("CloseWindow()", "MainSettings", this, "CloseWindow()"); fMain->Connect("CloseWindow()", "MainSettings", this, "CloseWindow()");
///Module choose ///Module choose
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));
TGNumberEntry * 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()", "MainSettings", this, "ChangeMod()");
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 :");
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));
TGTextButton * bOpen = new TGTextButton(hframe,"&Open");
bOpen->Connect("Clicked()","MainSettings",this, "OpenFile()");
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()","MainSettings",this, "kaka()"); bSave->Connect("Clicked()","MainSettings",this, "SaveSetting()");
hframe->AddFrame(bSave, new TGLayoutHints(kLHintsCenterX, 5,5,3,4)); hframe->AddFrame(bSave, new TGLayoutHints(kLHintsCenterX, 5,5,3,4));
/// Setting /// Setting
int modID = modIDEntry->GetNumber(); int modID = modIDEntry->GetNumber();
int maxCh = pixie->GetDigitizerNumChannel(modID);
int numItems = 14; int numItems = 14;
TString labelText[numItems] = {"CH", "ON/off", "Gain", "Trig L", "Trig G", "Threshold", "Polarity", "Energy L", "Energy G", "Tau", "Trace Len", "Trace delay", "V offset", "BaseLine"}; TString labelText[numItems] = {"CH", "ON/off", "Gain", "Trig L", "Trig G", "Threshold", "Polarity", "Energy L", "Energy G", "Tau", "Trace Len", "Trace delay", "V offset", "BaseLine"};
@ -63,23 +73,12 @@ MainSettings::MainSettings(const TGWindow *p, UInt_t w, UInt_t h, Pixie16 * pixi
hframeLabel->AddFrame(labelItems[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4)); hframeLabel->AddFrame(labelItems[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
} }
TGHorizontalFrame ** hframeCh = new TGHorizontalFrame * [maxCh]; TGHorizontalFrame ** hframeCh = new TGHorizontalFrame * [MAXCH];
TGLabel ** lbCh = new TGLabel * [maxCh]; TGLabel ** lbCh = new TGLabel * [MAXCH];
TGComboBox ** cbOnOff = new TGComboBox * [maxCh];
TGComboBox ** cbGain = new TGComboBox * [maxCh];
TGNumberEntry ** neTrigL = new TGNumberEntry * [maxCh];
TGNumberEntry ** neTrigG = new TGNumberEntry * [maxCh];
TGNumberEntry ** neThreshold = new TGNumberEntry * [maxCh];
TGComboBox ** cbPol = new TGComboBox * [maxCh];
TGNumberEntry ** neEngL = new TGNumberEntry * [maxCh];
TGNumberEntry ** neEngG = new TGNumberEntry * [maxCh];
TGNumberEntry ** neTau = new TGNumberEntry * [maxCh];
TGNumberEntry ** neTraceLength = new TGNumberEntry * [maxCh];
TGNumberEntry ** neTraceDelay = new TGNumberEntry * [maxCh];
TGNumberEntry ** neVoff = new TGNumberEntry * [maxCh];
TGNumberEntry ** neBL = new TGNumberEntry * [maxCh];
for( int i = 0; i < maxCh ; i ++){ for( int i = 0; i < MAXCH ; i ++){
//printf("-----------------------%d\n", i);
hframeCh[i] = new TGHorizontalFrame(hframeSettings, w, 600 ); hframeCh[i] = new TGHorizontalFrame(hframeSettings, w, 600 );
hframeSettings->AddFrame(hframeCh[i], new TGLayoutHints(kLHintsCenterX, 2,2,2,2)); hframeSettings->AddFrame(hframeCh[i], new TGLayoutHints(kLHintsCenterX, 2,2,2,2));
@ -91,61 +90,70 @@ MainSettings::MainSettings(const TGWindow *p, UInt_t w, UInt_t h, Pixie16 * pixi
col++; col++;
cbOnOff[i] = new TGComboBox(hframeCh[i], i); cbOnOff[i] = new TGComboBox(hframeCh[i], i);
cbOnOff[i]->AddEntry("ON", 1); cbOnOff[i]->AddEntry("ON", 1);
cbOnOff[i]->AddEntry("off", 2); cbOnOff[i]->AddEntry("off", 0);
cbOnOff[i]->Resize(width[col], 20); cbOnOff[i]->Resize(width[col], 20);
pixie->GetChannelOnOff(modID, i) ? cbOnOff[i]->Select(1) : cbOnOff[i]->Select(2); pixie->GetChannelOnOff(modID, i) ? cbOnOff[i]->Select(1) : cbOnOff[i]->Select(0);
cbOnOff[i]->Connect("Selected(Int_t, Int_t)", "MainSettings", this, Form("ChangeOnOff(=%d)", i));
hframeCh[i]->AddFrame(cbOnOff[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4)); hframeCh[i]->AddFrame(cbOnOff[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
col++; col++;
cbGain[i] = new TGComboBox(hframeCh[i], i); cbGain[i] = new TGComboBox(hframeCh[i], i);
cbGain[i]->AddEntry("x1", 1); cbGain[i]->AddEntry("x1", 1);
cbGain[i]->AddEntry("x1/4", 2); cbGain[i]->AddEntry("x1/4", 0);
cbGain[i]->Resize(width[col], 20); cbGain[i]->Resize(width[col], 20);
pixie->GetChannelGain(modID, i) ? cbGain[i]->Select(1) : cbGain[i]->Select(2); pixie->GetChannelGain(modID, i) ? cbGain[i]->Select(1) : cbGain[i]->Select(0);
cbGain[i]->Connect("Selected(Int_t, Int_t)", "MainSettings", this, Form("ChangeGain(=%d)", i));
hframeCh[i]->AddFrame(cbGain[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4)); hframeCh[i]->AddFrame(cbGain[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
col++; col++;
neTrigL[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTriggerRiseTime(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative); neTrigL[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTriggerRiseTime(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative);
neTrigL[i]->SetWidth(width[col]); neTrigL[i]->SetWidth(width[col]);
neTrigL[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 2.0); neTrigL[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 2.0);
neTrigL[i]->Connect("Modified()", "MainSettings", this, Form("ChangeTrigL(=%d)", i));
hframeCh[i]->AddFrame(neTrigL[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4)); hframeCh[i]->AddFrame(neTrigL[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++; col++;
neTrigG[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTriggerFlatTop(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative); neTrigG[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTriggerFlatTop(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative);
neTrigG[i]->SetWidth(width[col]); neTrigG[i]->SetWidth(width[col]);
neTrigG[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 2.0); neTrigG[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 2.0);
neTrigG[i]->Connect("Modified()", "MainSettings", this, Form("ChangeTrigG(=%d)", i));
hframeCh[i]->AddFrame(neTrigG[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4)); hframeCh[i]->AddFrame(neTrigG[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++; col++;
neThreshold[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTriggerThreshold(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative); neThreshold[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelTriggerThreshold(modID, i), 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative);
neThreshold[i]->SetWidth(width[col]); neThreshold[i]->SetWidth(width[col]);
neThreshold[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 4000); neThreshold[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 4000);
neThreshold[i]->Connect("Modified()", "MainSettings", this, Form("ChangeThreshold(=%d)", i));
hframeCh[i]->AddFrame(neThreshold[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4)); hframeCh[i]->AddFrame(neThreshold[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++; col++;
cbPol[i] = new TGComboBox(hframeCh[i], i); cbPol[i] = new TGComboBox(hframeCh[i], i);
cbPol[i]->AddEntry("Pos +", 1); cbPol[i]->AddEntry("Pos +", 1);
cbPol[i]->AddEntry("Neg -", 2); cbPol[i]->AddEntry("Neg -", 0);
cbPol[i]->Resize(width[col], 20); cbPol[i]->Resize(width[col], 20);
pixie->GetChannelPolarity(modID, i) ? cbPol[i]->Select(1) : cbPol[i]->Select(2); pixie->GetChannelPolarity(modID, i) ? cbPol[i]->Select(1) : cbPol[i]->Select(0);
cbPol[i]->Connect("Selected(Int_t, Int_t)", "MainSettings", this, Form("ChangePol(=%d)", i));
hframeCh[i]->AddFrame(cbPol[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4)); hframeCh[i]->AddFrame(cbPol[i], new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
col++; col++;
neEngL[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelEnergyRiseTime(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative); neEngL[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelEnergyRiseTime(modID, i), 0, 0, TGNumberFormat::kNESRealOne, TGNumberFormat::kNEANonNegative);
neEngL[i]->SetWidth(width[col]); neEngL[i]->SetWidth(width[col]);
neEngL[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 10.0); neEngL[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 10.0);
neEngL[i]->Connect("Modified()", "MainSettings", this, Form("ChangeEngL(=%d)", i));
hframeCh[i]->AddFrame(neEngL[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4)); hframeCh[i]->AddFrame(neEngL[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++; col++;
neEngG[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelEnergyFlatTop(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative); neEngG[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelEnergyFlatTop(modID, i), 0, 0, TGNumberFormat::kNESRealOne, TGNumberFormat::kNEANonNegative);
neEngG[i]->SetWidth(width[col]); neEngG[i]->SetWidth(width[col]);
neEngG[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 10.0); neEngG[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 10.0);
neEngG[i]->Connect("Modified()", "MainSettings", this, Form("ChangeEngG(=%d)", i));
hframeCh[i]->AddFrame(neEngG[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4)); 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); neTau[i] = new TGNumberEntry(hframeCh[i], pixie->GetChannelEnergyTau(modID, i), 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative);
neTau[i]->SetWidth(width[col]); neTau[i]->SetWidth(width[col]);
neTau[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 300.0); neTau[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 300.0);
neTau[i]->Connect("Modified()", "MainSettings", this, Form("ChangeTau(=%d)", i));
hframeCh[i]->AddFrame(neTau[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4)); hframeCh[i]->AddFrame(neTau[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
col++; col++;
@ -154,6 +162,7 @@ MainSettings::MainSettings(const TGWindow *p, UInt_t w, UInt_t h, Pixie16 * pixi
neTraceLength[i] = new TGNumberEntry(hframeCh[i], tracelen, 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEAAnyNumber); neTraceLength[i] = new TGNumberEntry(hframeCh[i], tracelen, 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEAAnyNumber);
neTraceLength[i]->SetWidth(width[col]); neTraceLength[i]->SetWidth(width[col]);
neTraceLength[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, -1, 20.0); neTraceLength[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, -1, 20.0);
neTraceLength[i]->Connect("Modified()", "MainSettings", 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++;
@ -162,26 +171,24 @@ MainSettings::MainSettings(const TGWindow *p, UInt_t w, UInt_t h, Pixie16 * pixi
neTraceDelay[i] = new TGNumberEntry(hframeCh[i], tracedel, 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEAAnyNumber); neTraceDelay[i] = new TGNumberEntry(hframeCh[i], tracedel, 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEAAnyNumber);
neTraceDelay[i]->SetWidth(width[col]); neTraceDelay[i]->SetWidth(width[col]);
neTraceDelay[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, -1, 20.0); neTraceDelay[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, -1, 20.0);
neTraceDelay[i]->Connect("Modified()", "MainSettings", 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()", "MainSettings", 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::kNESRealTwo, 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.0); neBL[i]->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, 100);
//neBL[i]->Connect("Modified()", "MainSettings", this, Form("ChangeBL(==%d, =%d)",modID, i)); neBL[i]->Connect("Modified()", "MainSettings", this, Form("ChangeBL(=%d)", i));
//neBL[i]->Connect("Modified()", "MainSettings", this, "ChangeBL(0,1)");
//neBL[i]->Connect("Modified()", "MainSettings", this, "kaka()");
hframeCh[i]->AddFrame(neBL[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4)); hframeCh[i]->AddFrame(neBL[i], new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
} }
fMain->MapSubwindows(); fMain->MapSubwindows();
fMain->Resize(fMain->GetDefaultSize()); fMain->Resize(fMain->GetDefaultSize());
fMain->MapWindow(); fMain->MapWindow();
@ -190,17 +197,150 @@ MainSettings::MainSettings(const TGWindow *p, UInt_t w, UInt_t h, Pixie16 * pixi
MainSettings::~MainSettings(){ MainSettings::~MainSettings(){
for (int i = 0; i< MAXCH; i++) {
delete cbOnOff[i] ;
delete cbGain[i] ;
delete cbPol[i] ;
delete neTrigL[i] ;
delete neTrigG[i] ;
delete neThreshold[i] ;
delete neEngL[i] ;
delete neEngG[i] ;
delete neTau[i] ;
delete neTraceLength[i] ;
delete neTraceDelay[i] ;
delete neVoff[i] ;
delete neBL[i];
}
delete modIDEntry;
delete teFileName;
/// fMain must be delete last;
fMain->Cleanup(); fMain->Cleanup();
delete fMain; delete fMain;
} }
void MainSettings::ChangeBL(unsigned short mod, unsigned short ch){
printf("mod : %d , ch : %d\n", mod, ch); void MainSettings::ChangeOnOff(unsigned short ch){
short modID = modIDEntry->GetNumber();
int val = cbOnOff[ch]->GetSelected();
pixie->SetChannelOnOff(val, modID, ch);
teFileName->SetText(settingFileName + " (not saved)");
}
void MainSettings::ChangeGain(unsigned short ch){
short modID = modIDEntry->GetNumber();
int val = cbGain[ch]->GetSelected();
pixie->SetChannelGain(val, modID, ch);
teFileName->SetText(settingFileName + " (not saved)");
}
void MainSettings::ChangePol(unsigned short ch){
short modID = modIDEntry->GetNumber();
int val = cbPol[ch]->GetSelected();
pixie->SetChannelPositivePolarity(val, modID, ch);
teFileName->SetText(settingFileName + " (not saved)");
}
void MainSettings::ChangeTrigL(unsigned short ch){
short modID = modIDEntry->GetNumber();
double val = neTrigL[ch]->GetNumber();
pixie->SetChannelTriggerRiseTime(val, modID, ch);
teFileName->SetText(settingFileName + " (not saved)");
}
void MainSettings::ChangeTrigG(unsigned short ch){
short modID = modIDEntry->GetNumber();
double val = neTrigG[ch]->GetNumber();
pixie->SetChannelTriggerFlatTop(val, modID, ch);
teFileName->SetText(settingFileName + " (not saved)");
}
void MainSettings::ChangeThreshold(unsigned short ch){
short modID = modIDEntry->GetNumber();
double val = neThreshold[ch]->GetNumber();
pixie->SetChannelTriggerThreshold(val, modID, ch);
teFileName->SetText(settingFileName + " (not saved)");
}
void MainSettings::ChangeEngL(unsigned short ch){
short modID = modIDEntry->GetNumber();
double val = neEngL[ch]->GetNumber();
pixie->SetChannelEnergyRiseTime(val, modID, ch);
teFileName->SetText(settingFileName + " (not saved)");
}
void MainSettings::ChangeEngG(unsigned short ch){
short modID = modIDEntry->GetNumber();
double val = neEngG[ch]->GetNumber();
pixie->SetChannelEnergyFlatTop(val, modID, ch);
teFileName->SetText(settingFileName + " (not saved)");
}
void MainSettings::ChangeTau(unsigned short ch){
short modID = modIDEntry->GetNumber();
double val = neTau[ch]->GetNumber();
pixie->SetChannelEnergyTau(val, modID, ch);
teFileName->SetText(settingFileName + " (not saved)");
}
void MainSettings::ChangeTraceLenght(unsigned short ch){
//TODO need to set On Off
short modID = modIDEntry->GetNumber();
double val = neTraceLength[ch]->GetNumber();
pixie->SetChannelTraceLenght(val, modID, ch);
teFileName->SetText(settingFileName + " (not saved)");
}
void MainSettings::ChangeTraceDelay(unsigned short ch){
//TODO need to set On Off
short modID = modIDEntry->GetNumber();
double val = neTraceDelay[ch]->GetNumber();
pixie->SetChannelTraceDelay(val, modID, ch);
teFileName->SetText(settingFileName + " (not saved)");
}
void MainSettings::ChangeVoff(unsigned short ch){
short modID = modIDEntry->GetNumber();
double val = neVoff[ch]->GetNumber();
pixie->SetChannelVOffset(val, modID, ch);
teFileName->SetText(settingFileName + " (not saved)");
}
void MainSettings::ChangeBL(unsigned short ch){
short modID = modIDEntry->GetNumber();
double val = neBL[ch]->GetNumber();
pixie->SetChannelBaseLinePrecent(val, modID, ch);
teFileName->SetText(settingFileName + " (not saved)");
} }
void MainSettings::kaka(){ void MainSettings::ChangeMod(){
short modID = modIDEntry->GetNumber();
settingFileName = pixie->GetSettingFile(modID);
teFileName->SetText(settingFileName);
}
void MainSettings::OpenFile(){
printf("save button is pressed.\n"); static TString dir(".");
TGFileInfo fi;
const char *filetypes[] = { "Setting file", "*.set",};
fi.fFileTypes = filetypes;
fi.SetIniDir(dir);
printf("fIniDir = %s\n", fi.fIniDir);
new TGFileDialog(gClient->GetRoot(), fMain, kFDOpen, &fi);
printf("Open file: |%s| (dir: %s)\n", fi.fFilename, fi.fIniDir);
if( fi.fFilename != NULL ) {
settingFileName = fi.fFilename;
teFileName->SetText(settingFileName + " (not saved)");
}
dir = fi.fIniDir;
}
void MainSettings::SaveSetting(){
printf("save button is pressed.\n");
pixie->SaveSettings(settingFileName.Data());
teFileName->SetText(settingFileName + " (saved)");
} }

View File

@ -2,27 +2,72 @@
#define MAIN_SETTING_H #define MAIN_SETTING_H
#include <TQObject.h> #include <TQObject.h>
///#include <RQ_OBJECT.h>
#include <TGNumberEntry.h>
#include <TGComboBox.h>
#include "Pixie16Class.h" #include "Pixie16Class.h"
class TGWindow; class TGWindow;
class TGMainFrame; class TGMainFrame;
#define MAXCH 16
class MainSettings{ class MainSettings{
/// RQ_OBJECT("MainSettings")
private: private:
TGMainFrame * fMain; TGMainFrame * fMain;
TGNumberEntry * modIDEntry;
TGTextEntry * teFileName;
TString settingFileName;
TGComboBox * cbOnOff[MAXCH] ;
TGComboBox * cbGain[MAXCH] ;
TGComboBox * cbPol[MAXCH] ;
TGNumberEntry * neTrigL[MAXCH] ;
TGNumberEntry * neTrigG[MAXCH] ;
TGNumberEntry * neThreshold[MAXCH] ;
TGNumberEntry * neEngL[MAXCH] ;
TGNumberEntry * neEngG[MAXCH] ;
TGNumberEntry * neTau[MAXCH] ;
TGNumberEntry * neTraceLength[MAXCH] ;
TGNumberEntry * neTraceDelay[MAXCH] ;
TGNumberEntry * neVoff[MAXCH] ;
TGNumberEntry * neBL[MAXCH];
Pixie16 * pixie; Pixie16 * pixie;
int maxCh;
public: public:
MainSettings(const TGWindow *p, UInt_t w, UInt_t h, Pixie16 * pixie); MainSettings(const TGWindow *p, UInt_t w, UInt_t h, Pixie16 * pixie);
virtual ~MainSettings(); virtual ~MainSettings();
void CloseWindow() { printf("close window\n"); delete this; } void CloseWindow() { printf("close window\n"); delete this; }
void ChangeBL(unsigned short mod, unsigned short ch); void ChangeOnOff(unsigned short ch);
void ChangeGain(unsigned short ch);
void ChangePol(unsigned short ch);
void ChangeTrigL(unsigned short ch);
void ChangeTrigG(unsigned short ch);
void ChangeThreshold(unsigned short ch);
void ChangeEngL(unsigned short ch);
void ChangeEngG(unsigned short ch);
void ChangeTau(unsigned short ch);
void ChangeTraceLenght(unsigned short ch);
void ChangeTraceDelay(unsigned short ch);
void ChangeVoff(unsigned short ch);
void ChangeBL(unsigned short ch);
void kaka(); void ChangeMod();
void OpenFile();
void SaveSetting();
}; };

View File

@ -102,7 +102,7 @@ MainWindow::MainWindow(const TGWindow *p,UInt_t w,UInt_t h) {
fMain->MapWindow(); fMain->MapWindow();
HandleMenu(M_MAIN_CH_SETTINGS); //HandleMenu(M_MAIN_CH_SETTINGS);
///================ pixie ///================ pixie
///printf("Removing Pixie16Msg.log \n"); ///printf("Removing Pixie16Msg.log \n");

View File

@ -1 +1,2 @@
#pragma link C++ class MainWindow; #pragma link C++ class MainWindow;
//#pragma link C++ class MainSettings;

View File

@ -3,17 +3,17 @@
"channel": { "channel": {
"input": { "input": {
"BLcut": [ "BLcut": [
32, 1,
1, 1,
1, 1,
31, 31,
31, 31,
1, 1,
32, 8,
32, 32,
1, 1,
1, 1,
1, 0,
1, 1,
1, 1,
1, 1,
@ -21,9 +21,9 @@
2 2
], ],
"BaselinePercent": [ "BaselinePercent": [
7,
10, 10,
10, 2,
10,
10, 10,
10, 10,
10, 10,
@ -93,7 +93,7 @@
120 120
], ],
"ChanCSRa": [ "ChanCSRa": [
18592, 2212,
16544, 16544,
16544, 16544,
16544, 16544,
@ -219,7 +219,7 @@
20 20
], ],
"FastGap": [ "FastGap": [
10, 14,
10, 10,
10, 10,
10, 10,
@ -237,7 +237,7 @@
10 10
], ],
"FastLength": [ "FastLength": [
10, 14,
10, 10,
10, 10,
10, 10,
@ -261,7 +261,7 @@
65535, 65535,
65535, 65535,
65535, 65535,
6000, 4000,
65535, 65535,
65535, 65535,
65535, 65535,
@ -435,17 +435,17 @@
32768 32768
], ],
"PAFlength": [ "PAFlength": [
1096,
1768, 1768,
1768, 1768,
1768, 1768,
1768, 1768,
1768, 1768,
1768, 666,
642,
1768,
1768, 1768,
1768, 1768,
1768, 1768,
1792,
1768, 1768,
1768, 1768,
1768, 1768,
@ -489,17 +489,17 @@
0 0
], ],
"PeakSample": [ "PeakSample": [
106,
95, 95,
95, 95,
95, 95,
95, 95,
95, 95,
95, 51,
48,
95,
95, 95,
95, 95,
95, 95,
98,
95, 95,
95, 95,
95, 95,
@ -507,17 +507,17 @@
95 95
], ],
"PeakSep": [ "PeakSep": [
108,
97, 97,
97, 97,
97, 97,
97, 97,
97, 97,
97, 53,
50,
97,
97, 97,
97, 97,
97, 97,
100,
97, 97,
97, 97,
97, 97,
@ -531,11 +531,11 @@
1100456650, 1100456650,
1100456650, 1100456650,
1100456650, 1100456650,
1112014848, 1112012226,
1100456650,
1100456650, 1100456650,
1100456650, 1100456650,
1100456650, 1100456650,
1100428083,
1100456650, 1100456650,
1100456650, 1100456650,
1100456650, 1100456650,
@ -705,6 +705,7 @@
0 0
], ],
"SlowGap": [ "SlowGap": [
25,
19, 19,
19, 19,
19, 19,
@ -714,8 +715,7 @@
19, 19,
19, 19,
19, 19,
19, 22,
19,
19, 19,
19, 19,
19, 19,
@ -723,13 +723,13 @@
19 19
], ],
"SlowLength": [ "SlowLength": [
83,
78, 78,
78, 78,
78, 78,
78, 78,
78, 78,
78, 34,
31,
78, 78,
78, 78,
78, 78,
@ -759,13 +759,13 @@
0 0
], ],
"TraceLength": [ "TraceLength": [
2484,
5000, 5000,
5000, 5000,
5000, 5000,
5000, 5000,
5000, 5000,
5000, 2504,
2500,
5000, 5000,
5000, 5000,
5000, 5000,
@ -795,17 +795,17 @@
0 0
], ],
"TriggerDelay": [ "TriggerDelay": [
856,
768, 768,
768, 768,
768, 768,
768, 768,
768, 768,
768, 416,
392,
768,
768, 768,
768, 768,
768, 768,
792,
768, 768,
768, 768,
768, 768,
@ -977,9 +977,9 @@
}, },
"fifo": { "fifo": {
"buffers": 100, "buffers": 100,
"hold": 50000, "hold": 10000,
"idle-wait": 150000, "idle-wait": 150000,
"run-wait": 2000 "run-wait": 5000
}, },
"fippi": { "fippi": {
"adc_bits": 16, "adc_bits": 16,
@ -1016,7 +1016,7 @@
"ChanNum": 0, "ChanNum": 0,
"CoincPattern": 0, "CoincPattern": 0,
"CoincWait": 0, "CoincWait": 0,
"ControlTask": 0, "ControlTask": 23,
"CrateID": 0, "CrateID": 0,
"FIFOLength": 8188, "FIFOLength": 8188,
"FastFilterRange": 0, "FastFilterRange": 0,