/[PAMELA software]/eventviewer/flight/src/FEVpamevcontrol.cpp
ViewVC logotype

Diff of /eventviewer/flight/src/FEVpamevcontrol.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by mocchiut, Fri Jul 14 14:18:05 2006 UTC revision 1.5 by mocchiut, Thu Nov 8 11:05:35 2007 UTC
# Line 46  char* operator+( std::streampos&, char* Line 46  char* operator+( std::streampos&, char*
46  #include <TArrow.h>  #include <TArrow.h>
47  #include <TStyle.h>  #include <TStyle.h>
48  //  //
49    #include <PamLevel2.h>
50    //
51  #include <FEVpamevcontrol.h>  #include <FEVpamevcontrol.h>
52  //  //
53  ClassImp(PAMevcontrol);  ClassImp(PAMevcontrol);
# Line 102  PAMevcontrol::PAMevcontrol(const TGWindo Line 104  PAMevcontrol::PAMevcontrol(const TGWindo
104    cvar = &var;    cvar = &var;
105    thefigure = &figure;    thefigure = &figure;
106    //    //
107    TGCompositeFrame *cframe1 = new TGCompositeFrame(this, 280, 60, kVerticalFrame);    cframe1 = new TGCompositeFrame(this, 280, 40, kVerticalFrame);
108    TGCompositeFrame *cframe2 = new TGCompositeFrame(this, 280, 60, kVerticalFrame);    TGCompositeFrame *cframe2 = new TGCompositeFrame(this, 280, 60, kVerticalFrame);
109    TGCompositeFrame *cframe3 = new TGCompositeFrame(this, 280, 60, kVerticalFrame);    TGCompositeFrame *cframe3 = new TGCompositeFrame(this, 280, 60, kVerticalFrame);
110    TGCompositeFrame *cframe4 = new TGCompositeFrame(this, 280, 60, kVerticalFrame);    TGCompositeFrame *cframe4 = new TGCompositeFrame(this, 280, 60, kVerticalFrame);
111    TGGroupFrame *gf = new TGGroupFrame(cframe1, "Appearance");    TGCompositeFrame *cframe5 = new TGCompositeFrame(this, 280, 60, kVerticalFrame);
112      gf = new TGGroupFrame(cframe1, "Detectors");
113      TGGroupFrame *gf2 = new TGGroupFrame(cframe5, "Appearance");
114    TGGroupFrame *inputf = new TGGroupFrame(cframe2, "Input");    TGGroupFrame *inputf = new TGGroupFrame(cframe2, "Input");
115    TGGroupFrame *jumpf = new TGGroupFrame(cframe3, "Jump to");    TGGroupFrame *jumpf = new TGGroupFrame(cframe3, "Jump to");
116    TGGroupFrame *savef = new TGGroupFrame(cframe4, "Save figure as");    TGGroupFrame *savef = new TGGroupFrame(cframe4, "Save figure as");
# Line 118  PAMevcontrol::PAMevcontrol(const TGWindo Line 122  PAMevcontrol::PAMevcontrol(const TGWindo
122    TGHorizontalFrame *htext3 = new TGHorizontalFrame(jumpf,400,800);    TGHorizontalFrame *htext3 = new TGHorizontalFrame(jumpf,400,800);
123    TGHorizontalFrame *htext4 = new TGHorizontalFrame(jumpf,400,80);    TGHorizontalFrame *htext4 = new TGHorizontalFrame(jumpf,400,80);
124    TGHorizontalFrame *hframe = new TGHorizontalFrame(this,400,800);    TGHorizontalFrame *hframe = new TGHorizontalFrame(this,400,800);
125    TGHorizontalFrame *hframe1 = new TGHorizontalFrame(gf, 280, 50);    for (Int_t fr=0; fr<12; fr++) hframedec[fr] = new TGHorizontalFrame(gf, 7, 7);
126    TGHorizontalFrame *hframe2 = new TGHorizontalFrame(gf, 280, 40);    TGHorizontalFrame *hframe3 = new TGHorizontalFrame(gf2, 280, 40);
127    TGHorizontalFrame *hframe3 = new TGHorizontalFrame(gf, 280, 40);    TGHorizontalFrame *hframe4 = new TGHorizontalFrame(gf2,280,10);
   TGHorizontalFrame *hframe4 = new TGHorizontalFrame(gf,280,10);  
128    TGVerticalFrame *hframe5 = new TGVerticalFrame(hframe4, 280, 40);    TGVerticalFrame *hframe5 = new TGVerticalFrame(hframe4, 280, 40);
129    TGHorizontalFrame *hfrprog = new TGHorizontalFrame(this,400,800);    TGHorizontalFrame *hfrprog = new TGHorizontalFrame(this,400,800);
130    //    //
# Line 132  PAMevcontrol::PAMevcontrol(const TGWindo Line 135  PAMevcontrol::PAMevcontrol(const TGWindo
135    fText->Connect("ReturnPressed()", "PAMevcontrol", this,"SetFilename()");    fText->Connect("ReturnPressed()", "PAMevcontrol", this,"SetFilename()");
136    fText->Connect("TabPressed()", "PAMevcontrol", this,"CompleteText()");    fText->Connect("TabPressed()", "PAMevcontrol", this,"CompleteText()");
137    htext->AddFrame(fText, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY, 0, 5, 5, 5));    htext->AddFrame(fText, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY, 0, 5, 5, 5));
138    htext->AddFrame(Load, new TGLayoutHints(kLHintsCenterX | kLHintsExpandX,0,5,5,5));    htext->AddFrame(Load, new TGLayoutHints(kLHintsCenterX,0,5,5,5));
139    inputf->AddFrame(new TGLabel(inputf, new TGHotString("Filename:")));    inputf->AddFrame(new TGLabel(inputf, new TGHotString("Filename:")));
140    inputf->AddFrame(htext, new TGLayoutHints(kLHintsExpandX));    inputf->AddFrame(htext, new TGLayoutHints(kLHintsExpandX));
141    //    //
# Line 140  PAMevcontrol::PAMevcontrol(const TGWindo Line 143  PAMevcontrol::PAMevcontrol(const TGWindo
143    fText2->SetText(cvar->thefilter.Data());    fText2->SetText(cvar->thefilter.Data());
144    TGTextButton *Load2 = new TGTextButton(htext2,"Load");    TGTextButton *Load2 = new TGTextButton(htext2,"Load");
145    Load2->Connect("Clicked()","TGTextEntry",fText2,"ReturnPressed()");    Load2->Connect("Clicked()","TGTextEntry",fText2,"ReturnPressed()");
146      Load2->SetToolTipText("Clear box and click to unload file");
147    fText2->Connect("ReturnPressed()", "PAMevcontrol", this,"SetFilter()");    fText2->Connect("ReturnPressed()", "PAMevcontrol", this,"SetFilter()");
148    fText2->Connect("TabPressed()", "PAMevcontrol", this,"CompleteText()");    fText2->Connect("TabPressed()", "PAMevcontrol", this,"CompleteText()");
149    htext2->AddFrame(fText2, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY, 0, 5, 5, 5));    htext2->AddFrame(fText2, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY, 0, 5, 5, 5));
150    htext2->AddFrame(Load2, new TGLayoutHints(kLHintsCenterX | kLHintsExpandX,0,5,5,5));    htext2->AddFrame(Load2, new TGLayoutHints(kLHintsCenterX,0,5,5,5));
151    inputf->AddFrame(new TGLabel(inputf, new TGHotString("Selection file:")));    inputf->AddFrame(new TGLabel(inputf, new TGHotString("Selection file:")));
152    inputf->AddFrame(htext2, new TGLayoutHints(kLHintsExpandX));    inputf->AddFrame(htext2, new TGLayoutHints(kLHintsExpandX));
153    //    //
154    cframe2->AddFrame(inputf,new TGLayoutHints(kLHintsExpandX,5,5,5,5));    cframe2->AddFrame(inputf,new TGLayoutHints(kLHintsExpandX,5,5,5,5));
155    //    //
156    TGCheckButton *fchktof = new TGCheckButton(hframe1, "TOF");      //
157      //
158      fComboDec = new TGComboBox(gf, 98);
159      fComboDec->AddEntry(" - Select Detector -", 11);
160      fComboDec->AddEntry("PSCU - ORB", 0);
161      fComboDec->AddEntry("Run", 1);
162      fComboDec->AddEntry("Trigger", 2);
163      fComboDec->AddEntry("ToF", 3);
164      fComboDec->AddEntry("Tracker", 4);
165      fComboDec->AddEntry("Anticounter", 5);
166      fComboDec->AddEntry("Calorimeter", 6);
167      fComboDec->AddEntry("S4", 7);
168      fComboDec->AddEntry("ND", 8);
169      fComboDec->AddEntry("Software info", 9);
170      fComboDec->AddEntry("ALL", 10);
171      fComboDec->Select(11);
172      fComboDec->Resize(150,23);
173      gf->AddFrame(fComboDec, new TGLayoutHints(kLHintsCenterY | kLHintsExpandX| kLHintsLeft, 5, 7, 7, 7));
174      fComboDec->Connect("Selected(Int_t)","PAMevcontrol",this,"refreshdec(Int_t)");
175      //
176      // PSCU/Orbital
177      //
178      fshoworb = new TGTextButton(hframedec[0], "Show Data");  
179      fshoworb->Connect("Clicked()","PAMevcontrol", this,"showorbdata()");
180      if ( !cvar->ORB ) fshoworb->SetState(kButtonDisabled);
181      hframedec[0]->AddFrame(fshoworb, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,5,5,5));
182      //
183      // RUN
184      //
185      fshowrun = new TGTextButton(hframedec[1], "Show Data");  
186      fshowrun->Connect("Clicked()","PAMevcontrol", this,"showrundata()");
187      if ( !cvar->RUN ) fshoworb->SetState(kButtonDisabled);
188      hframedec[1]->AddFrame(fshowrun, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,5,5,5));
189      //
190      // Trigger
191      //
192      fshowtrg = new TGTextButton(hframedec[2], "Show Data");  
193      fshowtrg->Connect("Clicked()","PAMevcontrol", this,"showtrgdata()");
194      if ( !cvar->TRG ) fshowtrg->SetState(kButtonDisabled);
195      hframedec[2]->AddFrame(fshowtrg, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,5,5,5));
196      //
197      // TOF
198      //
199      fchktof = new TGCheckButton(hframedec[3], "Show");  
200    fchktof->Connect("Clicked()","PAMevcontrol", this,"chktof()");    fchktof->Connect("Clicked()","PAMevcontrol", this,"chktof()");
201    if ( cvar->TOF ) fchktof->SetState(kButtonDown);    if ( cvar->TOF ) fchktof->SetState(kButtonDown);
202    hframe1->AddFrame(fchktof, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,0,5,5,5));    hframedec[3]->AddFrame(fchktof, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5));
203      fshowtof = new TGTextButton(hframedec[3], "Show Data");  
204      fshowtof->Connect("Clicked()","PAMevcontrol", this,"showtofdata()");
205      if ( !cvar->TOF ) fshowtof->SetState(kButtonDisabled);
206      hframedec[3]->AddFrame(fshowtof, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,2,5,5,5));
207    //    //
208    TGCheckButton *fchkac = new TGCheckButton(hframe1, "AC");      // Tracker
   fchkac->Connect("Clicked()","PAMevcontrol", this,"chkac()");    
   if ( cvar->AC ) fchkac->SetState(kButtonDown);  
   hframe1->AddFrame(fchkac, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,5,25,5,5));  
209    //    //
210    TGCheckButton *fchktrk = new TGCheckButton(hframe1, "Tracker");      fchktrk = new TGCheckButton(hframedec[4], "Show");  
211    fchktrk->Connect("Clicked()","PAMevcontrol",this,"chktrk()");      fchktrk->Connect("Clicked()","PAMevcontrol",this,"chktrk()");  
212    if ( cvar->TRK ) fchktrk->SetState(kButtonDown);    if ( cvar->TRK ) fchktrk->SetState(kButtonDown);
213    hframe1->AddFrame(fchktrk, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,10,5,5,5));    hframedec[4]->AddFrame(fchktrk, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5));
214      fshowtrk = new TGTextButton(hframedec[4], "Show Data");  
215      fshowtrk->Connect("Clicked()","PAMevcontrol", this,"showtrkdata()");
216      if ( !cvar->TRK ) fshowtrk->SetState(kButtonDisabled);
217      hframedec[4]->AddFrame(fshowtrk, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,2,5,5,5));
218      //
219      // AC
220    //    //
221    gf->AddFrame(hframe1, new TGLayoutHints(kLHintsExpandX));    fchkac = new TGCheckButton(hframedec[5], "Show");  
222      fchkac->Connect("Clicked()","PAMevcontrol", this,"chkac()");  
223      if ( cvar->AC ) fchkac->SetState(kButtonDown);
224      hframedec[5]->AddFrame(fchkac, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5));
225      fshowac = new TGTextButton(hframedec[5], "Show Data");  
226      fshowac->Connect("Clicked()","PAMevcontrol", this,"showacdata()");
227      if ( !cvar->AC ) fshowac->SetState(kButtonDisabled);
228      hframedec[5]->AddFrame(fshowac, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,2,5,5,5));
229      //
230      // Calorimeter
231      //
232      fchkcalo = new TGCheckButton(hframedec[6], "Show");  
233      fchkcalo->Connect("Clicked()","PAMevcontrol",this,"chkcalo()");  
234      if ( cvar->CALO ) fchkcalo->SetState(kButtonDown);
235      hframedec[6]->AddFrame(fchkcalo, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5));
236      fchkcalost = new TGCheckButton(hframedec[6], "Track");  
237      fchkcalost->Connect("Clicked()","PAMevcontrol",this,"chkcalost()");  
238      if ( cvar->CALO ) fchkcalost->SetState(kButtonUp);
239      hframedec[6]->AddFrame(fchkcalost, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,2,2,5,5));
240      fshowcal = new TGTextButton(hframedec[6], "Show Data");  
241      fshowcal->Connect("Clicked()","PAMevcontrol", this,"showcaldata()");
242      if ( !cvar->CALO ) fshowcal->SetState(kButtonDisabled);
243      hframedec[6]->AddFrame(fshowcal, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,2,5,5,5));
244    //    //
245    TGCheckButton *fchks4 = new TGCheckButton(hframe2, "S4");      // S4
246      //
247      fchks4 = new TGCheckButton(hframedec[7], "Show");  
248    fchks4->Connect("Clicked()","PAMevcontrol",this,"chks4()");      fchks4->Connect("Clicked()","PAMevcontrol",this,"chks4()");  
249    if ( cvar->S4 ) fchks4->SetState(kButtonDown);    if ( cvar->S4 ) fchks4->SetState(kButtonDown);
250    hframe2->AddFrame(fchks4, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,0,15,5,5));    hframedec[7]->AddFrame(fchks4, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5));
251      fshows4 = new TGTextButton(hframedec[7], "Show Data");  
252      fshows4->Connect("Clicked()","PAMevcontrol", this,"shows4data()");
253      if ( !cvar->S4 ) fshows4->SetState(kButtonDisabled);
254      hframedec[7]->AddFrame(fshows4, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,2,5,5,5));
255      //
256      // ND
257    //    //
258    TGCheckButton *fchknd = new TGCheckButton(hframe2, "ND");      fchknd = new TGCheckButton(hframedec[8], "Show");  
259    fchknd->Connect("Clicked()","PAMevcontrol",this,"chknd()");      fchknd->Connect("Clicked()","PAMevcontrol",this,"chknd()");  
260    if ( cvar->ND ) fchknd->SetState(kButtonDown);    if ( cvar->ND ) fchknd->SetState(kButtonDown);
261    hframe2->AddFrame(fchknd, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,5,25,5,5));    hframedec[8]->AddFrame(fchknd, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5));
262      fshownd = new TGTextButton(hframedec[8], "Show Data");  
263      fshownd->Connect("Clicked()","PAMevcontrol", this,"shownddata()");
264      if ( !cvar->ND ) fshownd->SetState(kButtonDisabled);
265      hframedec[8]->AddFrame(fshownd, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,2,5,5,5));
266    //    //
267    TGCheckButton *fchkcalo = new TGCheckButton(hframe2, "Calorimeter");      // Software infos
268    fchkcalo->Connect("Clicked()","PAMevcontrol",this,"chkcalo()");      //
269    if ( cvar->CALO ) fchkcalo->SetState(kButtonDown);    fshowsi = new TGTextButton(hframedec[9], "Show Data");  
270    hframe2->AddFrame(fchkcalo, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,10,2,5,5));    fshowsi->Connect("Clicked()","PAMevcontrol", this,"showsidata()");
271      if ( !cvar->RUN ) fshoworb->SetState(kButtonDisabled);
272      hframedec[9]->AddFrame(fshoworb, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5));
273      //
274      // All data
275    //    //
276    gf->AddFrame(hframe2, new TGLayoutHints(kLHintsExpandX));    fshowall = new TGTextButton(hframedec[10], "Show Data");  
277      fshowall->Connect("Clicked()","PAMevcontrol", this,"showalldata()");
278      hframedec[10]->AddFrame(fshowall, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,5,5,5));
279    //    //
280    TGCheckButton *fchkinfo = new TGCheckButton(hframe3, "Infos");      //  for (Int_t fr=0; fr<11; fr++) gf->AddFrame(hframedec[fr], new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,1,1,1,1));
281      //
282      gf->AddFrame(hframedec[11], new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,5,17,17));  
283      //
284      //  for (Int_t fr=0; fr<11; fr++) gf->AddFrame(hframedec[fr],new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,0,5,5,5));
285      //  gf->GetLayoutManager()->SetPadBottom(5);
286      //  gf->MapSubwindows();
287      //
288      fchkinfo = new TGCheckButton(hframe3, "Infos");  
289    fchkinfo->Connect("Clicked()","PAMevcontrol",this,"chkinfo()");      fchkinfo->Connect("Clicked()","PAMevcontrol",this,"chkinfo()");  
290    if ( cvar->INFOS ) fchkinfo->SetState(kButtonDown);    if ( cvar->INFOS ) fchkinfo->SetState(kButtonDown);
291    hframe3->AddFrame(fchkinfo, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,0,5,5,5));    hframe3->AddFrame(fchkinfo, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,0,5,5,5));
292    //    //
293    TGCheckButton *fchknames = new TGCheckButton(hframe3, "Names");      fchknames = new TGCheckButton(hframe3, "Names");  
294    fchknames->Connect("Clicked()","PAMevcontrol",this,"chknames()");      fchknames->Connect("Clicked()","PAMevcontrol",this,"chknames()");  
295    if ( cvar->VINFOS ) fchknames->SetState(kButtonDown);    if ( cvar->VINFOS ) fchknames->SetState(kButtonDown);
296    hframe3->AddFrame(fchknames, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,5,5,5,5));    hframe3->AddFrame(fchknames, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,5,5,5));
297    TGCheckButton *fchkpalette = new TGCheckButton(hframe3, "Palette");      fchkpalette = new TGCheckButton(hframe3, "Palette");  
298    fchkpalette->Connect("Clicked()","PAMevcontrol",this,"chkpalette()");      fchkpalette->Connect("Clicked()","PAMevcontrol",this,"chkpalette()");  
299    if ( cvar->PALETTE) fchkpalette->SetState(kButtonDown);    if ( cvar->PALETTE) fchkpalette->SetState(kButtonDown);
300    hframe3->AddFrame(fchkpalette, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,10,5,5,5));    hframe3->AddFrame(fchkpalette, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,10,5,5,5));
301    gf->AddFrame(hframe3, new TGLayoutHints(kLHintsExpandX));    gf2->AddFrame(hframe3, new TGLayoutHints(kLHintsExpandX));
302    //    //
303    TGVButtonGroup *group = new TGVButtonGroup(hframe4);    TGVButtonGroup *group = new TGVButtonGroup(hframe4);
   TGRadioButton *bwc0;  
   TGRadioButton *bwc1;  
304    bwc0 = new TGRadioButton(group, "Colour");    bwc0 = new TGRadioButton(group, "Colour");
305    bwc1 = new TGRadioButton(group, "B/W");    bwc1 = new TGRadioButton(group, "B/W");
306    if ( cvar->bw ){    if ( cvar->bw ){
# Line 210  PAMevcontrol::PAMevcontrol(const TGWindo Line 310  PAMevcontrol::PAMevcontrol(const TGWindo
310    };    };
311    bwc0->Connect("Pressed()", "PAMevcontrol",this,"radiocolor()");    bwc0->Connect("Pressed()", "PAMevcontrol",this,"radiocolor()");
312    bwc1->Connect("Pressed()", "PAMevcontrol",this,"radiobw()");    bwc1->Connect("Pressed()", "PAMevcontrol",this,"radiobw()");
313    hframe4->AddFrame(group,new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,1,5,5,5));    hframe4->AddFrame(group,new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5));
314    //    //
315    //    //
316    ftrks4 = new TGCheckButton(hframe5, "Track in S4/ND");      //  ftrks4 = new TGCheckButton(hframe5, "Track in S4/ND");  
317    ftrks4->Connect("Clicked()","PAMevcontrol",this,"radiotrack()");      //  ftrks4->Connect("Clicked()","PAMevcontrol",this,"radiotrack()");  
318    if ( cvar->tracknds4) ftrks4->SetState(kButtonDown);    //  if ( cvar->tracknds4) ftrks4->SetState(kButtonDown);
319    hframe5->AddFrame(ftrks4, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,5,2,5,5));    //  hframe5->AddFrame(ftrks4, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5));
320    ffl0 = new TGCheckButton(hframe5, "Force LEVEL0");  
321      fgetl0 = new TGTextButton(hframe5, "Get L0 file");  
322      fgetl0->Connect("Clicked()","PAMevcontrol", this,"getl0file()");
323      hframe5->AddFrame(fgetl0, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,5,5,5));
324    
325      ffl0 = new TGCheckButton(hframe5, "Force RAW");
326    ffl0->Connect("Clicked()","PAMevcontrol",this,"forcel0()");    ffl0->Connect("Clicked()","PAMevcontrol",this,"forcel0()");
327    if ( cvar->fl0 ) ffl0->SetState(kButtonDown);    if ( cvar->fl0 ) ffl0->SetState(kButtonDown);
328    if ( !cvar->fl0 ) ffl0->SetState(kButtonUp);    if ( !cvar->fl0 ) ffl0->SetState(kButtonUp);
329    hframe5->AddFrame(ffl0, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,5,2,5,5));    hframe5->AddFrame(ffl0, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,2,5,5,5));
330      //
331      hframe4->AddFrame(hframe5, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,10,5,5,5));
332      gf2->AddFrame(hframe4, new TGLayoutHints(kLHintsExpandX));
333    //    //
334    hframe4->AddFrame(hframe5, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY,10,5,5,5));    cframe1->AddFrame(gf, new TGLayoutHints(kLHintsExpandX,5,5,5,5));
335    gf->AddFrame(hframe4, new TGLayoutHints(kLHintsExpandX));    //  cframe1->Resize(280,10);
336      //  cframe1->GetLayoutManager()->SetDefaultHeight(5);
337      //  MapWindow();
338    //    //
339    cframe1->AddFrame(gf, new TGLayoutHints(kLHintsExpandX));    cframe5->AddFrame(gf2, new TGLayoutHints(kLHintsExpandX,5,5,5,5));
340    //    //
341    TGHButtonGroup *jgroup = new TGHButtonGroup(htext4);    TGHButtonGroup *jgroup = new TGHButtonGroup(htext4);
   TGRadioButton *jbwc0;  
   TGRadioButton *jbwc1;  
342    jbwc0 = new TGRadioButton(jgroup, "packet     ");    jbwc0 = new TGRadioButton(jgroup, "packet     ");
343    jbwc1 = new TGRadioButton(jgroup, "progressive");    jbwc1 = new TGRadioButton(jgroup, "progressive");
344    jbwc1->SetState(kButtonDown);    jbwc1->SetState(kButtonDown);
# Line 273  PAMevcontrol::PAMevcontrol(const TGWindo Line 381  PAMevcontrol::PAMevcontrol(const TGWindo
381    fCombo->Select(0);    fCombo->Select(0);
382    fCombo->Resize(50,23);    fCombo->Resize(50,23);
383    //  htexts->AddFrame(fCombo, new TGLayoutHints(kLHintsCenterX | kLHintsTop | kLHintsLeft | kLHintsCenterY | kLHintsExpandX, 0, 8, 1, 1));    //  htexts->AddFrame(fCombo, new TGLayoutHints(kLHintsCenterX | kLHintsTop | kLHintsLeft | kLHintsCenterY | kLHintsExpandX, 0, 8, 1, 1));
384    htexts->AddFrame(fCombo, new TGLayoutHints(kLHintsExpandY | kLHintsRight, 2, 2, 2, 1));    htexts->AddFrame(fCombo, new TGLayoutHints(kLHintsExpandY | kLHintsExpandY| kLHintsRight, 2, 2, 2, 1));
385    //    //
386    htextsl->AddFrame(save, new TGLayoutHints(kLHintsExpandX,0,0,2,1));    htextsl->AddFrame(save, new TGLayoutHints(kLHintsExpandX,0,0,2,1));
387    savef->AddFrame(htexts, new TGLayoutHints(kLHintsExpandX,0,0,2,5));    savef->AddFrame(htexts, new TGLayoutHints(kLHintsExpandX,0,0,2,5));
# Line 310  PAMevcontrol::PAMevcontrol(const TGWindo Line 418  PAMevcontrol::PAMevcontrol(const TGWindo
418    //  AddFrame(htext, new TGLayoutHints(kLHintsExpandX,2,2,15,1));    //  AddFrame(htext, new TGLayoutHints(kLHintsExpandX,2,2,15,1));
419    AddFrame(cframe2, new TGLayoutHints(kLHintsExpandX,1,1,1,1));    AddFrame(cframe2, new TGLayoutHints(kLHintsExpandX,1,1,1,1));
420    AddFrame(cframe1, new TGLayoutHints(kLHintsExpandX,1,1,1,1));    AddFrame(cframe1, new TGLayoutHints(kLHintsExpandX,1,1,1,1));
421      AddFrame(cframe5, new TGLayoutHints(kLHintsExpandX,1,1,1,1));
422    AddFrame(cframe3, new TGLayoutHints(kLHintsExpandX,1,1,1,1));    AddFrame(cframe3, new TGLayoutHints(kLHintsExpandX,1,1,1,1));
423    AddFrame(cframe4, new TGLayoutHints(kLHintsExpandX,1,1,1,1));    AddFrame(cframe4, new TGLayoutHints(kLHintsExpandX,1,1,1,1));
424    AddFrame(hfrprog, new TGLayoutHints(kLHintsExpandX,1,1,1,1));    AddFrame(hfrprog, new TGLayoutHints(kLHintsExpandX,1,1,1,1));
425    AddFrame(hframe, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,1,1,1,1));    AddFrame(hframe, new TGLayoutHints(kLHintsExpandX,1,1,1,1));
426    // Set a name to the main frame    // Set a name to the main frame
427    SetWindowName("PAMELA Event Viewer control panel");    SetWindowName("PAMELA Event Viewer control panel");
428    // Map all subwindows of main frame    // Map all subwindows of main frame
# Line 322  PAMevcontrol::PAMevcontrol(const TGWindo Line 431  PAMevcontrol::PAMevcontrol(const TGWindo
431    Resize(GetDefaultSize());    Resize(GetDefaultSize());
432    // Map main frame    // Map main frame
433    MapWindow();    MapWindow();
434      //
435      gf->HideFrame(hframedec[11]);
436      for (Int_t fr=0; fr<11; fr++){
437        gf->AddFrame(hframedec[fr],new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,0,5,5,5));
438        gf->HideFrame(hframedec[fr]);
439      };
440      gf->MapSubwindows();
441      //
442  }  }
443    
444  void PAMevcontrol::DIALOG(Int_t ty, TString warn){      void PAMevcontrol::DIALOG(Int_t ty, TString warn){    
# Line 346  void PAMevcontrol::DIALOG(Int_t ty, TStr Line 463  void PAMevcontrol::DIALOG(Int_t ty, TStr
463      new TGMsgBox(gClient->GetRoot(), this, title.Data(), warn.Data(), mb_icon, kMBOk, &retval);      new TGMsgBox(gClient->GetRoot(), this, title.Data(), warn.Data(), mb_icon, kMBOk, &retval);
464  }  }
465    
466    void PAMevcontrol::refreshdec(Int_t n){
467      //
468      for (Int_t i=0; i<11; i++){
469        gf->HideFrame(hframedec[i]);
470      };
471      //
472      if ( n < 11 ){
473        gf->ShowFrame(hframedec[n]);
474      };
475    };
476    
477    
478    void PAMevcontrol::showorbdata(){
479      cvar->showorb = !cvar->showorb;
480      if ( !cvar->showorb ) fshoworb->SetText("Show Data");
481      if ( cvar->showorb ) fshoworb->SetText("Hide Data");
482      //  printf("orb \n");
483    };
484    
485    void PAMevcontrol::showtrgdata(){
486      cvar->showtrg = !cvar->showtrg;
487      if ( !cvar->showtrg ) fshowtrg->SetText("Show Data");
488      if ( cvar->showtrg ) fshowtrg->SetText("Hide Data");
489      //  printf("trg \n");
490    };
491    
492    void PAMevcontrol::showrundata(){
493      cvar->showrun = !cvar->showrun;
494      if ( !cvar->showrun ) fshowrun->SetText("Show Data");
495      if ( cvar->showrun ) fshowrun->SetText("Hide Data");
496      //  printf("run \n");
497    };
498    
499    void PAMevcontrol::showcaldata(){
500      cvar->showcal = !cvar->showcal;
501      if ( !cvar->showcal ) fshowcal->SetText("Show Data");
502      if ( cvar->showcal ) fshowcal->SetText("Hide Data");
503      //  printf("cal \n");
504    };
505    
506    void PAMevcontrol::chkcalost(){
507      if ( cvar->CALOT ) {
508        cvar->CALOT = 0;
509      } else {
510        cvar->CALOT = 1;
511      };
512      cvar->i--;
513      cvar->nevents = 0;
514      cvar->firstevno = 0;
515      cvar->lastevno = 0;
516      cvar->refresh = true;
517    };
518    
519    void PAMevcontrol::showtrkdata(){
520      cvar->showtrk = !cvar->showtrk;
521      if ( !cvar->showtrk ) fshowtrk->SetText("Show Data");
522      if ( cvar->showtrk ) fshowtrk->SetText("Hide Data");
523      //  printf("trk \n");
524    };
525    
526    void PAMevcontrol::showtofdata(){
527      cvar->showtof = !cvar->showtof;
528      if ( !cvar->showtof ) fshowtof->SetText("Show Data");
529      if ( cvar->showtof ) fshowtof->SetText("Hide Data");
530      //  printf("tof \n");
531    };
532    
533    void PAMevcontrol::showacdata(){
534      cvar->showac = !cvar->showac;
535      if ( !cvar->showac ) fshowac->SetText("Show Data");
536      if ( cvar->showac ) fshowac->SetText("Hide Data");
537      //  printf("ac \n");
538    };
539    
540    void PAMevcontrol::shownddata(){
541      cvar->shownd = !cvar->shownd;
542      if ( !cvar->shownd ) fshownd->SetText("Show Data");
543      if ( cvar->shownd ) fshownd->SetText("Hide Data");
544      //  printf("nd \n");
545    };
546    
547    void PAMevcontrol::shows4data(){
548      cvar->shows4 = !cvar->shows4;
549      if ( !cvar->shows4 ) fshows4->SetText("Show Data");
550      if ( cvar->shows4 ) fshows4->SetText("Hide Data");
551      //  printf("s4 \n");
552    };
553    
554    void PAMevcontrol::showsidata(){
555      cvar->showsi = !cvar->showsi;
556      if ( !cvar->showsi ) fshowsi->SetText("Show Data");
557      if ( cvar->showsi ) fshowsi->SetText("Hide Data");
558      //  printf("si \n");
559    };
560    
561    void PAMevcontrol::showalldata(){
562      cvar->showall = !cvar->showall;
563      if ( !cvar->showall ) fshowall->SetText("Show Data");
564      if ( cvar->showall ) fshowall->SetText("Hide Data");
565      //  printf("all \n");
566    };
567    
568  void PAMevcontrol::SetFilename() {  void PAMevcontrol::SetFilename() {
569      TGTextEntry *entry = (TGTextEntry*)gTQSender;      TGTextEntry *entry = (TGTextEntry*)gTQSender;
# Line 362  void PAMevcontrol::SetFilename() { Line 580  void PAMevcontrol::SetFilename() {
580      cvar->waitforever = false;      cvar->waitforever = false;
581  }  }
582    
583    void PAMevcontrol::getl0file() {
584      //
585      TString host = "mysql://localhost/pamelaprod";
586      TString user = "anonymous";
587      TString psw = "";
588      const char *pamdbhost=gSystem->Getenv("PAM_DBHOST");
589      const char *pamdbuser=gSystem->Getenv("PAM_DBUSER");
590      const char *pamdbpsw=gSystem->Getenv("PAM_DBPSW");
591      if ( !pamdbhost ) pamdbhost = "";
592      if ( !pamdbuser ) pamdbuser = "";
593      if ( !pamdbpsw ) pamdbpsw = "";
594      if ( strcmp(pamdbhost,"") ) host = pamdbhost;
595      if ( strcmp(pamdbuser,"") ) user = pamdbuser;
596      if ( strcmp(pamdbpsw,"") ) psw = pamdbpsw;
597      cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
598      cout<<"Connecting to DB"<<endl;
599      cout<<"HOST "<<host<<endl;
600      cout<<"USER "<<user<<endl;
601      cout<<"PSW  "<<psw<<endl;
602      cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
603      TSQLServer *dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data());
604      if( dbc && dbc->IsConnected() ){
605        //
606        // Starting from level2
607        //
608        if ( clev->file == 2 ){
609          GL_ROOT glroot = GL_ROOT();
610          if( !glroot.Query_GL_ROOT(cvar->idroot,dbc) ){
611            //
612            cvar->thefilename= glroot.PATH + glroot.NAME;
613            cvar->nevents = 0;
614            cvar->firstevno = 0;
615            cvar->lastevno = 0;
616            if ( cvar->fl0 ) {
617              cvar->fl0 = false;
618              ffl0->SetState(kButtonUp);
619            };
620            cvar->restart = true;
621            cvar->waitforever = false;
622            //
623            if ( cvar->thefilter != "" ){
624              cvar->thefilter="";
625              cvar->selex = true;
626            };
627            cvar->i = -(cvar->EVF + cvar->i -1);
628            //cvar->refresh = true;
629            //      cvar->file = 0;
630            //
631          } else {
632            stringstream warning;
633            warning.str("");
634            warning << " Problems getting Level0 file ";
635            DIALOG(2,warning.str().c_str());
636          };
637        } else {
638          //
639          // starting from L0
640          //
641          stringstream warning;
642          warning.str("");
643          warning << " Not yet implemented ";
644          DIALOG(2,warning.str().c_str());
645        };
646        //
647      } else {
648        stringstream warning;
649        warning.str("");
650        warning << " Problems connectiong to DB! ";
651        DIALOG(2,warning.str().c_str());
652      };
653      dbc->Close();
654    };
655    
656  void PAMevcontrol::CheckLevel() {  void PAMevcontrol::CheckLevel() {
657    if ( clev->file == 2 ){    if ( clev->file == 2 ){
658      ffl0->SetState(kButtonDisabled);      ffl0->SetState(kButtonDisabled);
659      if ( !cvar->tracknds4 ) {  //     if ( !cvar->tracknds4 ) {
660        ftrks4->SetState(kButtonUp);  //       ftrks4->SetState(kButtonUp);
661      } else {  //     } else {
662        ftrks4->SetState(kButtonDown);  //       ftrks4->SetState(kButtonDown);
663      };  //     };
664    } else {        } else {    
665      ftrks4->SetState(kButtonDisabled);      //ftrks4->SetState(kButtonDisabled);
666      if ( !cvar->fl0 ) {      if ( !cvar->fl0 ) {
667        ffl0->SetState(kButtonUp);        ffl0->SetState(kButtonUp);
668      } else {      } else {
669        ffl0->SetState(kButtonDown);            ffl0->SetState(kButtonDown);    
670      };      };
671    };    };
672      if ( clev->file == 2 ){
673        fgetl0->SetText("Get L0 file");
674      } else {
675        fgetl0->SetText("Get L2 file");
676      };
677  }  }
678    
679  void PAMevcontrol::SetSearching() {  void PAMevcontrol::SetSearching() {
# Line 388  void PAMevcontrol::StopSearching() { Line 684  void PAMevcontrol::StopSearching() {
684    bstop->SetState(kButtonDisabled);    bstop->SetState(kButtonDisabled);
685  };  };
686    
687    void PAMevcontrol::RefreshButtons() {
688      if ( cvar->jumprog ){
689        jbwc1->SetState(kButtonDown);
690      } else {
691        jbwc0->SetState(kButtonDown);
692      };
693      if ( cvar->fl0 ){
694        ffl0->SetState(kButtonDown);
695      } else {
696        ffl0->SetState(kButtonUp);
697      };
698      //  if ( cvar->tracknds4) ftrks4->SetState(kButtonDown);
699      if ( cvar->bw ){
700        bwc1->SetState(kButtonDown);
701      } else {
702        bwc0->SetState(kButtonDown);
703      };
704      if ( cvar->PALETTE) fchkpalette->SetState(kButtonDown); else fchkpalette->SetState(kButtonUp);
705      if ( cvar->VINFOS ) fchknames->SetState(kButtonDown); else fchknames->SetState(kButtonUp);
706      if ( cvar->INFOS ) fchkinfo->SetState(kButtonDown); else fchkinfo->SetState(kButtonUp);
707      //
708      if ( cvar->CALOT ) fchkcalost->SetState(kButtonDown); else fchkcalost->SetState(kButtonUp);
709      if ( cvar->CALO ){
710        fchkcalo->SetState(kButtonDown);
711        fshowcal->SetState(kButtonUp);    
712      } else {
713        fchkcalo->SetState(kButtonUp);
714        fchkcalost->SetState(kButtonDisabled);
715        fshowcal->SetState(kButtonDisabled);    
716      };
717      //
718      if ( cvar->ND ){
719        fchknd->SetState(kButtonDown);
720        fshownd->SetState(kButtonUp);
721      } else {
722        fchknd->SetState(kButtonUp);
723        fshownd->SetState(kButtonDisabled);
724      };
725      //
726      if ( cvar->S4 ){
727        fchks4->SetState(kButtonDown);
728        fshows4->SetState(kButtonUp);
729      } else {
730        fchks4->SetState(kButtonUp);
731        fshows4->SetState(kButtonDisabled);
732      };
733      //
734      if ( cvar->TRK ){
735        fchktrk->SetState(kButtonDown);
736        fshowtrk->SetState(kButtonUp);
737      } else {
738        fchktrk->SetState(kButtonUp);
739        fshowtrk->SetState(kButtonDisabled);
740      }
741      //
742      if ( cvar->AC ){
743        fchkac->SetState(kButtonDown);
744        fshowac->SetState(kButtonUp);
745      } else {
746        fchkac->SetState(kButtonUp);
747        fshowac->SetState(kButtonDisabled);
748      };
749      //
750      if ( cvar->TOF ){
751        fchktof->SetState(kButtonDown);
752        fshowtof->SetState(kButtonUp);
753      } else {
754        fchktof->SetState(kButtonUp);
755        fshowtof->SetState(kButtonDisabled);
756      };
757      //
758      CheckLevel();
759      //
760    };
761    
762  void PAMevcontrol::SetFilter() {  void PAMevcontrol::SetFilter() {
763      TGTextEntry *entry = (TGTextEntry*)gTQSender;      TGTextEntry *entry = (TGTextEntry*)gTQSender;
764      TString text = entry->GetText();      TString text = entry->GetText();
# Line 568  void PAMevcontrol::increment(float val) Line 939  void PAMevcontrol::increment(float val)
939  }  }
940    
941  void PAMevcontrol::forcel0() {  void PAMevcontrol::forcel0() {
942      if ( cvar->fl0 ) {    cvar->fl0 = !cvar->fl0;
943          cvar->fl0 = false;    cvar->alrforc = false;
944      } else {    cvar->i--;
945          cvar->fl0 = true;    cvar->nevents = 0;
946      };    cvar->firstevno = 0;
947      cvar->alrforc = false;    cvar->lastevno = 0;
948      cvar->i--;    cvar->refresh = true;
     cvar->nevents = 0;  
     cvar->firstevno = 0;  
     cvar->lastevno = 0;  
     cvar->refresh = true;  
949  }  }
950    
951  void PAMevcontrol::clearselfi(){  void PAMevcontrol::clearselfi(){

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.23