void control() { int ButtWidth = 150; int ButtHeight = 22; // main frame // TGMainFrame *fMainFrame = new TGMainFrame(gClient->GetRoot(),10,10,kMainFrame | kVerticalFrame); fMainFrame->SetName("fMainFrame"); fMainFrame->SetLayoutBroken(kTRUE); // vertical frame TGVerticalFrame *fVerFr_StaSto = new TGVerticalFrame(fMainFrame,486,96,kVerticalFrame); fVerFr_StaSto->SetName("fVerFr_StaSto"); // "fGroupFrame671" group frame TGGroupFrame *topGroupFrame = new TGGroupFrame(fVerFr_StaSto,"Start Stop Control"); TGTextButton *Start = new TGTextButton(topGroupFrame,"Start/Stop"); Start->SetTextJustify(36); Start->SetMargins(0,0,0,0); Start->SetWrapLength(-1); Start->Resize(ButtWidth,ButtHeight); topGroupFrame->AddFrame(Start, new TGLayoutHints(kLHintsLeft | kLHintsTop,10,0,10,0)); // TGTextButton *Stop = new TGTextButton(topGroupFrame,"Stop"); // Stop->SetTextJustify(36); // Stop->SetMargins(0,0,0,0); // Stop->SetWrapLength(-1); // Stop->Resize(ButtWidth,ButtHeight); // topGroupFrame->AddFrame(Stop, new TGLayoutHints(kLHintsLeft | kLHintsTop ,2,2,2,2)); topGroupFrame->SetLayoutManager(new TGVerticalLayout(topGroupFrame)); topGroupFrame->Resize(482,92); fVerFr_StaSto->AddFrame(topGroupFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsExpandX | kLHintsExpandY,2,2,2,2)); fMainFrame->AddFrame(fVerFr_StaSto, new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsExpandX,2,2,2,2)); // fVerFr_StaSto->MoveResize(2,2,486,96); fMainFrame->SetMWMHints(kMWMDecorAll, kMWMFuncAll, kMWMInputModeless); fMainFrame->MapSubwindows(); fMainFrame->Resize(fMainFrame->GetDefaultSize()); fMainFrame->MapWindow(); fMainFrame->MoveResize(1000, 700, 600,400); }
Int_t THaScalerGui::InitPlots() { // Initialize plots (xscaler style) if (!scaler) { cout << "THaScalerGui::ERROR: no scaler defined... cannot init."<<endl; return -1; } InitPages(); yboxsize = new Int_t[SCAL_NUMBANK]; occupied = new Int_t[SCAL_NUMBANK]; memset(occupied, 0, SCAL_NUMBANK*sizeof(Int_t)); fDataBuff = new TGTextBuffer[SCAL_NUMBANK*SCAL_NUMCHAN]; pair<Int_t, TGTextEntry *> txtpair; pair<Int_t, TNtuple *> ntupair; char string_ntup[]="UpdateNum:Count:Rate:RateI"; iloop = 0; lastsize = YBOXSMALL; showselect = SHOWRATE; TGTab *fTab = new TGTab(this, 600, 800); TGLayoutHints *fLayout = new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 10, 10, 10, 10); TGLayoutHints *fLayout2 = new TGLayoutHints(kLHintsNormal ,10, 10, 10, 10); if (!scaler->GetDataBase()) { cout << "THaScalerGui::WARNING: no database. Will use defaults..."<<endl; } Int_t crate = scaler->GetCrate(); std::string sdirect; for (Int_t ipage = 0; ipage < npages; ipage++) { Int_t slot = slotmap[ipage]; char cpage[100]; sprintf(cpage,"%d",ipage); std::string spage = cpage; sdirect = "none"; if (scaler->GetDataBase()) sdirect = scaler->GetDataBase()->GetStringDirectives(crate, "xscaler-tabs", spage.c_str()); if (sdirect != "none") spage = sdirect; TGCompositeFrame *tgcf = fTab->AddTab(spage.c_str()); std::string slayout = "none"; if (scaler->GetDataBase()) slayout = scaler->GetDataBase()->GetStringDirectives(crate, "xscaler-layout", (std::string)cpage); UInt_t pos = slayout.find("x"); int nrow = 8; int ncol = 4; // defaults if (pos != std::string::npos) { nrow = atoi(slayout.substr(0,pos).c_str()); ncol = atoi(slayout.substr(pos+1,slayout.length()).c_str()); } yboxsize[ipage] = YBOXSMALL; if (nrow * ncol > 16) yboxsize[ipage] = YBOXBIG; GCValues_t gval; gval.fMask = kGCForeground; gClient->GetColorByName("black", gval.fForeground); GContext_t labelgc = gVirtualX->CreateGC(gClient->GetRoot()->GetId(), &gval); TGLabel *fLpage; std::string pagename = "none"; if (scaler->GetDataBase()) pagename = scaler->GetDataBase()->GetStringDirectives(crate, "xscaler-pagename", (std::string)cpage); if (pagename == "none") pagename = spage; fLpage = new TGLabel(tgcf, new TGString(pagename.c_str()),labelgc); tgcf->AddFrame(fLpage,fLayout); occupied[ipage] = nrow; Int_t chan = 0; for (int row = 0; row < nrow; row++) { // rows TGCompositeFrame *fr; fr = new TGCompositeFrame(tgcf, 50, 0, kHorizontalFrame); TGHorizontalLayout *fLhorz; fLhorz = new TGHorizontalLayout(fr); fr->SetLayoutManager(fLhorz); for (int col = 0; col < ncol; col++) { // columns int index = ipage*SCAL_NUMCHAN + ncol*row+col; ntupair.first = index; char nname[10]; sprintf(nname,"%d",index); ntupair.second = new TNtuple(nname,"scaler",string_ntup); fDataHistory.insert(ntupair); TGTextButton *fButton1; char cbutton[100]; std::string buttonname = "none"; if (scaler->GetDataBase()) { std::vector<std::string> strb = scaler->GetDataBase()->GetShortNames(crate,slot,chan); buttonname = strb[0]; } if (buttonname == "none") { sprintf(cbutton,"%d ==>",ncol*row+col+1); } else { sprintf(cbutton,buttonname.c_str()); } fButton1 = new TGTextButton(fr,new TGHotString(cbutton), SCAL_NUMBANK*SCAL_NUMCHAN + OFFSET_HIST + index); fr->AddFrame(fButton1, fLayout); fButton1->Associate(this); txtpair.first = index; txtpair.second = new TGTextEntry(fr,&fDataBuff[index]); fDataEntry.insert(txtpair); fr->AddFrame(fDataEntry[index],fLayout); chan++; } tgcf->AddFrame(fr,fLayout); } } AddFrame(fTab,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,0,0,0,0)); TGGroupFrame *fGb = new TGGroupFrame(this, new TGString("Click channel button for history plot. Click ``Show Rates'' or ``Show Counts, etc''")); TGCompositeFrame *fGCb = new TGCompositeFrame(fGb, 10, 0, kHorizontalFrame); TGHorizontalLayout *fLhorzb = new TGHorizontalLayout(fGCb); fGCb->SetLayoutManager(fLhorzb); TGHotString *fLabel = new TGHotString("HELP"); TGTextButton *fHelp = new TGTextButton(fGCb,fLabel,SCAL_NUMBANK*SCAL_NUMCHAN+OFFSET_HELP); fGCb->AddFrame(fHelp, fLayout2); fHelp->Associate(this); fLabel = new TGHotString("QUIT"); TGTextButton *fQuit = new TGTextButton(fGCb,fLabel,SCAL_NUMBANK*SCAL_NUMCHAN+OFFSET_QUIT); fGCb->AddFrame(fQuit, fLayout2); fQuit->Associate(this); TGLabel *fGlabel2 = new TGLabel(fGCb, new TGString(" ")); fGCb->AddFrame(fGlabel2, fLayout); TGHotString *fHString1 = new TGHotString("Show Rates"); fRateSelect = new TGCheckButton(fGCb,fHString1,SCAL_NUMBANK*SCAL_NUMCHAN+OFFSET_RATE); fGCb->AddFrame(fRateSelect, fLayout); fRateSelect->Associate(this); fRateSelect->SetState(kButtonDown); TGHotString *fHString2 = new TGHotString("Show Counts"); fCountSelect = new TGCheckButton(fGCb, fHString2,SCAL_NUMBANK*SCAL_NUMCHAN+OFFSET_COUNT); fGCb->AddFrame(fCountSelect, fLayout); fCountSelect->Associate(this); fCountSelect->SetState(kButtonUp); TGHotString *fHString3 = new TGHotString("Norm-by-Current"); fNormISelect = new TGCheckButton(fGCb,fHString3,SCAL_NUMBANK*SCAL_NUMCHAN+OFFSET_NORMI); fGCb->AddFrame(fNormISelect, fLayout); fNormISelect->Associate(this); fNormISelect->SetState(kButtonUp); fGb->AddFrame(fGCb,fLayout2); TGLayoutHints *fL1 = new TGLayoutHints(kLHintsNormal | kLHintsExpandX , 10, 10, 10, 10); AddFrame(fGb, fL1); MapSubwindows(); Layout(); SetWindowName("HALL A SCALER DATA"); SetIconName("Scalers"); MapWindow(); Resize(900,yboxsize[0]); lastsize = yboxsize[0]; return 0; };
void gossipGUI::BuildSiPMFrame( TGFrame *parentFrame ) { if(getenv("GOSSIP_DEBUG")!=0 && strncmp(getenv("GOSSIP_DEBUG"),"1",1)==0) cout << "gossipGUI::BuildSiPMFrame( TGFrame *parentFrame )" << endl; sipmFrame = new TGCompositeFrame(parentFrame, 60, 20, kHorizontalFrame); ///Parameters TGGroupFrame *parameterGroupFrame = new TGGroupFrame(sipmFrame, "Parameters", kHorizontalFrame); sipmFrame->AddFrame(parameterGroupFrame, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2)); TGCompositeFrame *parametersEntriesFrame = new TGCompositeFrame(parameterGroupFrame, 400, 400); //Entries parameterGroupFrame->AddFrame(parametersEntriesFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 0, 8, 0)); TGCompositeFrame *parametersLabelsFrame = new TGCompositeFrame(parameterGroupFrame, 400, 400); //Labels parameterGroupFrame->AddFrame(parametersLabelsFrame, new TGLayoutHints(kLHintsRight | kLHintsTop, 5, 0, 8, 0)); entryPDE = new TGNumberEntry(parametersEntriesFrame,20,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELLimitMinMax,0,100); parametersEntriesFrame->AddFrame(entryPDE, layout1); labelPDE = new TGLabel(parametersLabelsFrame,"PDE [%]"); parametersLabelsFrame->AddFrame(labelPDE, layout2); entryGain = new TGNumberEntry(parametersEntriesFrame,20,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryGain, layout1); labelGain = new TGLabel(parametersLabelsFrame,"Gain [1E4]"); parametersLabelsFrame->AddFrame(labelGain, layout2); entryENF = new TGNumberEntry(parametersEntriesFrame,2,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryENF, layout1); labelENF = new TGLabel(parametersLabelsFrame,"Gain fluct. [1E4]"); parametersLabelsFrame->AddFrame(labelENF, layout2); entryTau_dr = new TGNumberEntry(parametersEntriesFrame,2000,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryTau_dr, layout1); labelTau_dr = new TGLabel(parametersLabelsFrame,"DR time-const. [ns]"); parametersLabelsFrame->AddFrame(labelTau_dr, layout2); entryPap1 = new TGNumberEntry(parametersEntriesFrame,10,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELLimitMinMax,0,100); parametersEntriesFrame->AddFrame(entryPap1, layout1); labelPap1 = new TGLabel(parametersLabelsFrame,"AP prob. (slow) [%]"); parametersLabelsFrame->AddFrame(labelPap1, layout2); entryTau_ap1 = new TGNumberEntry(parametersEntriesFrame,200,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryTau_ap1, layout1); labelTau_ap1 = new TGLabel(parametersLabelsFrame,"AP time-const. (slow) [ns]"); parametersLabelsFrame->AddFrame(labelTau_ap1, layout2); entryPap2 = new TGNumberEntry(parametersEntriesFrame,10,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELLimitMinMax,0,100); parametersEntriesFrame->AddFrame(entryPap2, layout1); labelPap2 = new TGLabel(parametersLabelsFrame,"AP prob. (fast) [%]"); parametersLabelsFrame->AddFrame(labelPap2, layout2); entryTau_ap2 = new TGNumberEntry(parametersEntriesFrame,50,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryTau_ap2, layout1); labelTau_ap2 = new TGLabel(parametersLabelsFrame,"AP time-const. (fast) [ns]"); parametersLabelsFrame->AddFrame(labelTau_ap2, layout2); entryPx = new TGNumberEntry(parametersEntriesFrame,10,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELLimitMinMax,0,100); parametersEntriesFrame->AddFrame(entryPx, layout1); labelPx = new TGLabel(parametersLabelsFrame,"CT prob. [%]"); parametersLabelsFrame->AddFrame(labelPx, layout2); entryEN = new TGNumberEntry(parametersEntriesFrame,2,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryEN, layout1); labelEN = new TGLabel(parametersLabelsFrame,"Pedestal noise"); parametersLabelsFrame->AddFrame(labelEN, layout2); entryTau_rec = new TGNumberEntry(parametersEntriesFrame,10,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryTau_rec, layout1); labelTau_rec = new TGLabel(parametersLabelsFrame,"Recovery time [ns]"); parametersLabelsFrame->AddFrame(labelTau_rec, layout2); ///Single pixel waveform TGGroupFrame *waveformGroupFrame = new TGGroupFrame(sipmFrame, "Single Pixel Waveform", kHorizontalFrame); sipmFrame->AddFrame(waveformGroupFrame, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2)); TGCompositeFrame *waveformEntriesFrame = new TGCompositeFrame(waveformGroupFrame, 400, 400); //Entries waveformGroupFrame->AddFrame(waveformEntriesFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 0, 8, 0)); TGCompositeFrame *waveformLabelsFrame = new TGCompositeFrame(waveformGroupFrame, 400, 400); //Labels waveformGroupFrame->AddFrame(waveformLabelsFrame, new TGLayoutHints(kLHintsRight | kLHintsTop, 5, 0, 8, 0)); entryTau_le = new TGNumberEntry(waveformEntriesFrame,1,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); waveformEntriesFrame->AddFrame(entryTau_le, layout1); labelTau_le = new TGLabel(waveformLabelsFrame,"Rise time [ns]"); waveformLabelsFrame->AddFrame(labelTau_le, layout2); entryTau_te = new TGNumberEntry(waveformEntriesFrame,40,6, -1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); waveformEntriesFrame->AddFrame(entryTau_te, layout1); labelTau_te = new TGLabel(waveformLabelsFrame,"Decay time [ns]"); waveformLabelsFrame->AddFrame(labelTau_te, layout2); entryJitter = new TGNumberEntry(waveformEntriesFrame,200,6, -1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); waveformEntriesFrame->AddFrame(entryJitter, layout1); labelJitter = new TGLabel(waveformLabelsFrame,"Jitter [ps]"); waveformLabelsFrame->AddFrame(labelJitter, layout2); entrySignalAmp = new TGNumberEntry(waveformEntriesFrame,20,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); waveformEntriesFrame->AddFrame(entrySignalAmp, layout1); labelSignalAmp = new TGLabel(waveformLabelsFrame,"Amplitude [mV]"); waveformLabelsFrame->AddFrame(labelSignalAmp, layout2); entryRMS = new TGNumberEntry(waveformEntriesFrame,1.5,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); waveformEntriesFrame->AddFrame(entryRMS, layout1); labelRMS = new TGLabel(waveformLabelsFrame,"Electronic Noise [mV]"); waveformLabelsFrame->AddFrame(labelRMS, layout2); entrySampling = new TGNumberEntry(waveformEntriesFrame,0.1,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); waveformEntriesFrame->AddFrame(entrySampling, layout1); labelSampling = new TGLabel(waveformLabelsFrame,"Sampling [ns]"); waveformLabelsFrame->AddFrame(labelSampling, layout2); entryCutoff = new TGNumberEntry(waveformEntriesFrame,0.01,6,-1,TGNumberFormat::kNESRealThree,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); waveformEntriesFrame->AddFrame(entryCutoff, layout1); labelCutoff = new TGLabel(waveformLabelsFrame,"Cutoff [%]"); waveformLabelsFrame->AddFrame(labelCutoff, layout2); ///Geometry TGGroupFrame *geometryGroupFrame = new TGGroupFrame(sipmFrame, "Geometry", kHorizontalFrame); sipmFrame->AddFrame(geometryGroupFrame, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2)); TGCompositeFrame *geometryEntriesFrame = new TGCompositeFrame(geometryGroupFrame, 400, 400); //Entries geometryGroupFrame->AddFrame(geometryEntriesFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 0, 8, 0)); TGCompositeFrame *geometryLabelsFrame = new TGCompositeFrame(geometryGroupFrame, 400, 400); //Labels geometryGroupFrame->AddFrame(geometryLabelsFrame, new TGLayoutHints(kLHintsRight | kLHintsTop, 5, 0, 8, 0)); entryNpx = new TGNumberEntry(geometryEntriesFrame,10,6,-1, TGNumberFormat::kNESInteger,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); geometryEntriesFrame->AddFrame(entryNpx, layout1); labelNpx = new TGLabel(geometryLabelsFrame,"nPixels x"); geometryLabelsFrame->AddFrame(labelNpx, layout2); entryNpy = new TGNumberEntry(geometryEntriesFrame,10,6,-1,TGNumberFormat::kNESInteger,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); geometryEntriesFrame->AddFrame(entryNpy, layout1); labelNpy = new TGLabel(geometryLabelsFrame,"nPixels y"); geometryLabelsFrame->AddFrame(labelNpy, layout2); entrySizeX = new TGNumberEntry(geometryEntriesFrame,1,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); geometryEntriesFrame->AddFrame(entrySizeX, layout1); labelSizeX = new TGLabel(geometryLabelsFrame,"Size x [mm]"); geometryLabelsFrame->AddFrame(labelSizeX, layout2); entrySizeY = new TGNumberEntry(geometryEntriesFrame,1,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); geometryEntriesFrame->AddFrame(entrySizeY, layout1); labelSizeY = new TGLabel(geometryLabelsFrame,"Size y [mm]"); geometryLabelsFrame->AddFrame(labelSizeY, layout2); }
void gossipGUI::BuildDAQFrame( TGFrame *parentFrame ) { if(getenv("GOSSIP_DEBUG")!=0 && strncmp(getenv("GOSSIP_DEBUG"),"1",1)==0) cout << "gossipGUI::BuildDAQFrame( TGFrame *parentFrame )" << endl; daqFrame = new TGCompositeFrame(parentFrame, 60, 20, kHorizontalFrame); TGButtonGroup *buttonGroupMeasurement = new TGButtonGroup(daqFrame,"Select Measurement"); new TGRadioButton(buttonGroupMeasurement, "Waveform"); new TGRadioButton(buttonGroupMeasurement, "Charge Spectrum"); new TGRadioButton(buttonGroupMeasurement, "Time Spectrum"); new TGRadioButton(buttonGroupMeasurement, "Threshold Scan"); new TGRadioButton(buttonGroupMeasurement, "Statistic"); new TGRadioButton(buttonGroupMeasurement, "Response Curve"); buttonGroupMeasurement->SetButton(kTextLeft); buttonGroupMeasurement->Connect("Pressed(Int_t)", "gossipGUI", this, "SelectMeasurement(int)"); daqFrame->AddFrame(buttonGroupMeasurement,new TGLayoutHints(kLHintsLeft, 0, 0, 5, 0)); TGGroupFrame *parameterGroupFrame = new TGGroupFrame(daqFrame, "Parameters", kHorizontalFrame); daqFrame->AddFrame(parameterGroupFrame, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2)); TGCompositeFrame *parametersEntriesFrame = new TGCompositeFrame(parameterGroupFrame, 400, 400); //Entries parameterGroupFrame->AddFrame(parametersEntriesFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 0, 8, 0)); TGCompositeFrame *parametersLabelsFrame = new TGCompositeFrame(parameterGroupFrame, 400, 400); //Labels parameterGroupFrame->AddFrame(parametersLabelsFrame, new TGLayoutHints(kLHintsRight | kLHintsTop, 5, 0, 8, 0)); entryNentries = new TGNumberEntry(parametersEntriesFrame,1000,8,-1,TGNumberFormat::kNESInteger,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryNentries, layout1); labelNentries = new TGLabel(parametersLabelsFrame,"nEntries"); parametersLabelsFrame->AddFrame(labelNentries, layout2); entryGate = new TGNumberEntry(parametersEntriesFrame,300,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryGate, layout1); labelGate = new TGLabel(parametersLabelsFrame,"Gate [ns] "); parametersLabelsFrame->AddFrame(labelGate, layout2); entryPreGate = new TGNumberEntry(parametersEntriesFrame,0,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryPreGate, layout1); labelPreGate = new TGLabel(parametersLabelsFrame,"Pregate [ns] "); parametersLabelsFrame->AddFrame(labelPreGate, layout2); entryPedestal = new TGNumberEntry(parametersEntriesFrame,50,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryPedestal, layout1); labelPedestal = new TGLabel(parametersLabelsFrame,"Pedestal"); parametersLabelsFrame->AddFrame(labelPedestal, layout2); entryThreshStart = new TGNumberEntry(parametersEntriesFrame,15,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryThreshStart, layout1); labelThreshStart = new TGLabel(parametersLabelsFrame,"Threshold start"); parametersLabelsFrame->AddFrame(labelThreshStart, layout2); entryThreshStop = new TGNumberEntry(parametersEntriesFrame,60,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryThreshStop, layout1); labelThreshStop = new TGLabel(parametersLabelsFrame,"Threshold stop"); parametersLabelsFrame->AddFrame(labelThreshStop, layout2); entryThreshStep = new TGNumberEntry(parametersEntriesFrame,1,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryThreshStep, layout1); labelThreshStep = new TGLabel(parametersLabelsFrame,"Threshold step"); parametersLabelsFrame->AddFrame(labelThreshStep, layout2); entryDiscriMinTime = new TGNumberEntry(parametersEntriesFrame,3,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryDiscriMinTime, layout1); labelDiscriMinTime = new TGLabel(parametersLabelsFrame,"Discri. mintime"); parametersLabelsFrame->AddFrame(labelDiscriMinTime, layout2); entryDiscriWidth = new TGNumberEntry(parametersEntriesFrame,10,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryDiscriWidth, layout1); labelDiscriWidth = new TGLabel(parametersLabelsFrame,"Discri. width"); parametersLabelsFrame->AddFrame(labelDiscriWidth, layout2); entryNgammaMax = new TGNumberEntry(parametersEntriesFrame,1000,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryNgammaMax, layout1); labelNgammaMax = new TGLabel(parametersLabelsFrame,"nPhotons max."); parametersLabelsFrame->AddFrame(labelNgammaMax, layout2); entryNgammaStep = new TGNumberEntry(parametersEntriesFrame,50,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryNgammaStep, layout1); labelNgammaStep = new TGLabel(parametersLabelsFrame,"nPhotons step"); parametersLabelsFrame->AddFrame(labelNgammaStep, layout2); }
void gossipGUI::BuildLightSourceFrame( TGFrame *parentFrame ) { if(getenv("GOSSIP_DEBUG")!=0 && strncmp(getenv("GOSSIP_DEBUG"),"1",1)==0) cout << "gossipGUI::BuildLightSourceFrame( TGFrame *parentFrame )" << endl; lightSourceFrame = new TGCompositeFrame(parentFrame, 60, 20, kVerticalFrame); TGGroupFrame *parameterGroupFrame = new TGGroupFrame(lightSourceFrame, "Parameters", kHorizontalFrame); lightSourceFrame->AddFrame(parameterGroupFrame, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2)); TGCompositeFrame *parametersEntriesFrame = new TGCompositeFrame(parameterGroupFrame, 400, 400); //Entries parameterGroupFrame->AddFrame(parametersEntriesFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 0, 8, 0)); TGCompositeFrame *parametersLabelsFrame = new TGCompositeFrame(parameterGroupFrame, 400, 400); //Labels parameterGroupFrame->AddFrame(parametersLabelsFrame, new TGLayoutHints(kLHintsRight | kLHintsTop, 5, 0, 8, 0)); entryNgamma = new TGNumberEntry(parametersEntriesFrame,10,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryNgamma, layout1); labelNgamma = new TGLabel(parametersLabelsFrame,"nPhotons"); parametersLabelsFrame->AddFrame(labelNgamma, layout2); checkButtonPhotonFluct = new TGCheckButton(parametersEntriesFrame,""); parametersEntriesFrame->AddFrame(checkButtonPhotonFluct, new TGLayoutHints(kLHintsRight | kLHintsTop, 0, 0, 6, 0)); labelNgammaFluct = new TGLabel(parametersLabelsFrame,"Fluctuations"); parametersLabelsFrame->AddFrame(labelNgammaFluct, layout2); checkButtonPhotonFluct->SetOn(); comboBoxLEDpulse = new TGComboBox(parametersEntriesFrame,-1, kHorizontalFrame | kSunkenFrame | kDoubleBorder | kOwnBackground); parametersEntriesFrame->AddFrame(comboBoxLEDpulse, layout1); labelLEDpulse = new TGLabel(parametersLabelsFrame,"Pulse"); parametersLabelsFrame->AddFrame(labelLEDpulse, layout2); comboBoxLEDpulse->AddEntry("flat",1); comboBoxLEDpulse->AddEntry("gaus",2); comboBoxLEDpulse->AddEntry("exp",3); comboBoxLEDpulse->AddEntry("exp2",4); comboBoxLEDpulse->Resize(80,22); comboBoxLEDpulse->Select(1); entryLEDtime = new TGNumberEntry(parametersEntriesFrame,5,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAAnyNumber,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryLEDtime, layout1); labelLEDtime = new TGLabel(parametersLabelsFrame,"Initial time [ns]"); parametersLabelsFrame->AddFrame(labelLEDtime, layout2); entryLEDduration = new TGNumberEntry(parametersEntriesFrame,5,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryLEDduration, layout1); labelLEDduration = new TGLabel(parametersLabelsFrame,"Duration [ns]"); parametersLabelsFrame->AddFrame(labelLEDduration, layout2); entryLEDriseTime = new TGNumberEntry(parametersEntriesFrame,5,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryLEDriseTime, layout1); labelLEDriseTime = new TGLabel(parametersLabelsFrame,"Rise time [ns]"); parametersLabelsFrame->AddFrame(labelLEDriseTime, layout2); comboBoxLEDgeometry = new TGComboBox(parametersEntriesFrame,-1, kHorizontalFrame | kSunkenFrame | kDoubleBorder | kOwnBackground); parametersEntriesFrame->AddFrame(comboBoxLEDgeometry, layout1); labelLEDgeometry = new TGLabel(parametersLabelsFrame,"Geometry"); parametersLabelsFrame->AddFrame(labelLEDgeometry, layout2); comboBoxLEDgeometry->AddEntry("square",1); comboBoxLEDgeometry->AddEntry("elliptic",2); comboBoxLEDgeometry->Resize(80,22); comboBoxLEDgeometry->Select(1); entryLEDxPos = new TGNumberEntry(parametersEntriesFrame,0,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAAnyNumber,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryLEDxPos, layout1); labelLEDxPos = new TGLabel(parametersLabelsFrame,"Position x [mm]"); parametersLabelsFrame->AddFrame(labelLEDxPos, layout2); entryLEDyPos = new TGNumberEntry(parametersEntriesFrame,0,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAAnyNumber,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryLEDyPos, layout1); labelLEDyPos = new TGLabel(parametersLabelsFrame,"Position y [mm]"); parametersLabelsFrame->AddFrame(labelLEDyPos, layout2); entryLEDxWidth = new TGNumberEntry(parametersEntriesFrame,1,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryLEDxWidth, layout1); labelLEDxWidth = new TGLabel(parametersLabelsFrame,"Width x [mm]"); parametersLabelsFrame->AddFrame(labelLEDxWidth, layout2); entryLEDyWidth = new TGNumberEntry(parametersEntriesFrame,1,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryLEDyWidth, layout1); labelLEDyWidth = new TGLabel(parametersLabelsFrame,"Width y [mm]"); parametersLabelsFrame->AddFrame(labelLEDyWidth, layout2); }