/[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.10 by mocchiut, Mon Jun 15 14:17:21 2009 UTC revision 1.13 by mocchiut, Fri Apr 13 08:07:31 2012 UTC
# Line 104  PAMevcontrol::PAMevcontrol(const TGWindo Line 104  PAMevcontrol::PAMevcontrol(const TGWindo
104    cvar = &var;    cvar = &var;
105    thefigure = &figure;    thefigure = &figure;
106    //    //
107    cframe1 = new TGCompositeFrame(this, 280, 40, kVerticalFrame);    cframe1 = new TGCompositeFrame(this, 280, 60, 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);
# Line 115  PAMevcontrol::PAMevcontrol(const TGWindo Line 115  PAMevcontrol::PAMevcontrol(const TGWindo
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");
117    //    //
118    TGHorizontalFrame *htexts = new TGHorizontalFrame(savef,400,800);    TGHorizontalFrame *htexts = new TGHorizontalFrame(savef,300,800);
119    TGHorizontalFrame *htextsl = new TGHorizontalFrame(cframe4,400,800);    TGHorizontalFrame *htextsl = new TGHorizontalFrame(cframe4,300,800);
120    TGHorizontalFrame *htext = new TGHorizontalFrame(inputf,400,800);    TGHorizontalFrame *htext = new TGHorizontalFrame(inputf,300,800);
121    TGHorizontalFrame *htext2 = new TGHorizontalFrame(inputf,400,800);    TGHorizontalFrame *htext2 = new TGHorizontalFrame(inputf,300,800);
122    TGHorizontalFrame *htext3 = new TGHorizontalFrame(jumpf,400,800);    TGHorizontalFrame *htext3 = new TGHorizontalFrame(jumpf,300,800);
123    TGHorizontalFrame *htext4 = new TGHorizontalFrame(jumpf,400,80);    TGHorizontalFrame *htext4 = new TGHorizontalFrame(jumpf,300,80);
124    TGHorizontalFrame *hframe = new TGHorizontalFrame(this,400,800);    TGHorizontalFrame *hframe = new TGHorizontalFrame(this,300,800);
125    for (Int_t fr=0; fr<12; fr++) hframedec[fr] = new TGHorizontalFrame(gf, 7, 7);    for (Int_t fr=0; fr<12; fr++) hframedec[fr] = new TGHorizontalFrame(gf, 7, 7);
126    TGHorizontalFrame *hframe3 = new TGHorizontalFrame(gf2, 280, 40);    TGHorizontalFrame *hframe3 = new TGHorizontalFrame(gf2, 280, 60);
127    TGHorizontalFrame *hframe4 = new TGHorizontalFrame(gf2,280,10);    TGHorizontalFrame *hframe4 = new TGHorizontalFrame(gf2,280,10);
128    TGVerticalFrame *hframe5 = new TGVerticalFrame(hframe4, 280, 40);    TGVerticalFrame *hframe5 = new TGVerticalFrame(hframe4, 280, 60);
129    TGHorizontalFrame *hfrprog = new TGHorizontalFrame(this,400,800);    TGHorizontalFrame *hfrprog = new TGHorizontalFrame(this,300,800);
130    //    //
131    TGTextEntry *fText = new TGTextEntry(htext, new TGTextBuffer(20),-1);    TGTextEntry *fText = new TGTextEntry(htext, new TGTextBuffer(20),-1);
132    fText->SetText(cvar->thefilename.Data());    fText->SetText(cvar->thefilename.Data());
# Line 288  PAMevcontrol::PAMevcontrol(const TGWindo Line 288  PAMevcontrol::PAMevcontrol(const TGWindo
288    fchkinfo = new TGCheckButton(hframe3, "Infos");      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|kLHintsExpandX,0,5,5,5));    hframe3->AddFrame(fchkinfo, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,0,1,5,5));
292    //    //
293    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|kLHintsExpandX,5,5,5,5));    hframe3->AddFrame(fchknames, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,0,1,5,5));
297    
298    fchkpalette = new TGCheckButton(hframe3, "Palette");      fchkpalette = new TGCheckButton(hframe3, "Palette");  
299    fchkpalette->Connect("Clicked()","PAMevcontrol",this,"chkpalette()");      fchkpalette->Connect("Clicked()","PAMevcontrol",this,"chkpalette()");  
300    if ( cvar->PALETTE) fchkpalette->SetState(kButtonDown);    if ( cvar->PALETTE) fchkpalette->SetState(kButtonDown);
301    hframe3->AddFrame(fchkpalette, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,10,5,5,5));    hframe3->AddFrame(fchkpalette, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,0,2,5,5));
302    
303      fchktrigger = new TGCheckButton(hframe3, "Trigger");  
304      fchktrigger->Connect("Clicked()","PAMevcontrol",this,"chktrigger()");  
305      if ( cvar->PATTRIG) fchktrigger->SetState(kButtonDown);
306      hframe3->AddFrame(fchktrigger, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,1,2,5,5));
307    
308    gf2->AddFrame(hframe3, new TGLayoutHints(kLHintsExpandX));    gf2->AddFrame(hframe3, new TGLayoutHints(kLHintsExpandX));
309    //    //
310    TGVButtonGroup *group = new TGVButtonGroup(hframe4);    TGVButtonGroup *group = new TGVButtonGroup(hframe4);
# Line 441  PAMevcontrol::PAMevcontrol(const TGWindo Line 448  PAMevcontrol::PAMevcontrol(const TGWindo
448    //    //
449  }  }
450    
451    void PAMevcontrol::Refresh(){
452      // bah
453      return;
454      this->Clear();
455      MapSubwindows();
456      // Initialize the layout algorithm
457      Resize(GetDefaultSize());
458      // Map main frame
459      MapWindow();  
460    }
461    
462  void PAMevcontrol::DIALOG(Int_t ty, TString warn){      void PAMevcontrol::DIALOG(Int_t ty, TString warn){    
463      //      //
464      // ty = 0 -> INFO, ty = 1 -> WARNING, ty = 2 -> ERROR      // ty = 0 -> INFO, ty = 1 -> WARNING, ty = 2 -> ERROR
# Line 448  void PAMevcontrol::DIALOG(Int_t ty, TStr Line 466  void PAMevcontrol::DIALOG(Int_t ty, TStr
466      Int_t retval;      Int_t retval;
467      TString title;      TString title;
468      EMsgBoxIcon mb_icon = kMBIconStop;      EMsgBoxIcon mb_icon = kMBIconStop;
469      if ( ty == 2 ){      if ( ty == 2 || ty == 3 ){
470          if ( ty == 2 ){
471          title="ERROR!!";          title="ERROR!!";
472          mb_icon = kMBIconStop;          mb_icon = kMBIconStop;
473          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);
474          } else {
475            title="HELP";
476            mb_icon = kMBIconQuestion;
477            new TGMsgBox(gClient->GetRoot(), this, title.Data(), warn.Data(), mb_icon, kMBOk, &retval);
478          };
479      } else {      } else {
480        if ( ty == 0 ){        if ( ty == 0 ){
481          title="INFO";          title="INFO";
# Line 461  void PAMevcontrol::DIALOG(Int_t ty, TStr Line 485  void PAMevcontrol::DIALOG(Int_t ty, TStr
485          title="WARNING!";          title="WARNING!";
486          mb_icon = kMBIconExclamation;          mb_icon = kMBIconExclamation;
487        };              };      
488          if ( ty == 4 ){
489            title="DATA";
490            mb_icon = kMBIconExclamation;
491          };
492        const TGPicture *icon_pic;        const TGPicture *icon_pic;
493        switch (mb_icon) {        switch (mb_icon) {
494        case kMBIconStop:        case kMBIconStop:
# Line 488  void PAMevcontrol::DIALOG(Int_t ty, TStr Line 516  void PAMevcontrol::DIALOG(Int_t ty, TStr
516          break;          break;
517        }        }
518        //        //
519          if ( ty == 4 ){// non funziona il recupero dei puntatori a questi oggetti come e` possibile?
520            //      gObjectTable->Print();
521            TGLabel *la=dynamic_cast<TGLabel*>(gDirectory->FindObject("la"));
522            TGHorizontalFrame *fLabelFrame=dynamic_cast<TGHorizontalFrame*>(gDirectory->FindObject("fLabelFrame"));
523            TGTransientFrame *compofra=dynamic_cast<TGTransientFrame*>(gDirectory->FindObject("compofra"));
524            if ( la ) la->Delete();
525            if ( fLabelFrame ) fLabelFrame->Delete();
526            if ( compofra ){
527              compofra->DestroyWindow();
528              compofra->Delete();  
529            };
530          };
531        TGTransientFrame *compofra = new TGTransientFrame(gClient->GetRoot(), 0, 200, 80, kHorizontalFrame);              TGTransientFrame *compofra = new TGTransientFrame(gClient->GetRoot(), 0, 200, 80, kHorizontalFrame);      
532        TGHorizontalFrame *fIconFrame = new TGHorizontalFrame(compofra, 98, 78);        TGHorizontalFrame *fIconFrame = NULL;
533        TGIcon *fIcon = new TGIcon(fIconFrame, icon_pic, icon_pic->GetWidth(), icon_pic->GetHeight());        TGIcon *fIcon = NULL;
534        fIconFrame->AddFrame(fIcon, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1));        if ( ty != 4 ){
535        compofra->AddFrame(fIconFrame, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1));          compofra->DontCallClose();      
536            fIconFrame = new TGHorizontalFrame(compofra, 98, 78);
537            fIcon = new TGIcon(fIconFrame, icon_pic, icon_pic->GetWidth(), icon_pic->GetHeight());
538            fIconFrame->AddFrame(fIcon, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1));
539            compofra->AddFrame(fIconFrame, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1));
540          };
541        //        //
542        TGHorizontalFrame *fLabelFrame = new TGHorizontalFrame(compofra, 98, 78);        TGHorizontalFrame *fLabelFrame = new TGHorizontalFrame(compofra, 98, 78);
543        TGLabel *la=new TGLabel(fLabelFrame,warn.Data());        TGLabel *la=new TGLabel(fLabelFrame,warn.Data());
# Line 502  void PAMevcontrol::DIALOG(Int_t ty, TStr Line 547  void PAMevcontrol::DIALOG(Int_t ty, TStr
547        //                        //                
548        compofra->SetWindowName(title.Data());        compofra->SetWindowName(title.Data());
549        compofra->MapSubwindows();        compofra->MapSubwindows();
550        compofra->Resize(compofra->GetDefaultWidth(),80);        if ( ty != 4 ){
551            compofra->Resize(compofra->GetDefaultWidth(),80);
552          } else {
553            compofra->Resize(compofra->GetDefaultSize());
554          };
555        compofra->CenterOnParent();        compofra->CenterOnParent();
556        compofra->MapWindow();        compofra->MapWindow();
557        //        //
558        Int_t kkk = 0;        if ( ty != 4 ){
559        while ( kkk < 200 ){          Int_t kkk = 0;
560          gSystem->ProcessEvents();          while ( kkk < 200 ){
561          gSystem->Sleep(10);            gSystem->ProcessEvents();
562          kkk++;            gSystem->Sleep(10);
563              kkk++;
564            };
565        };        };
566        if ( compofra ){        if ( compofra && ty != 4 ){
567          la->Delete();          la->Delete();
568          fLabelFrame->Delete();          fLabelFrame->Delete();
569          fIcon->Delete();          if ( fIcon ) fIcon->Delete();
570          fIconFrame->Delete();          if ( fIconFrame ) fIconFrame->Delete();
571          compofra->DestroyWindow();          compofra->DestroyWindow();
572          compofra->Delete();              compofra->Delete();    
573        };        };
# Line 839  void PAMevcontrol::RefreshButtons() { Line 890  void PAMevcontrol::RefreshButtons() {
890      bwc0->SetState(kButtonDown);      bwc0->SetState(kButtonDown);
891      bwc1->SetState(kButtonUp);      bwc1->SetState(kButtonUp);
892    };    };
893      if ( cvar->PATTRIG) fchktrigger->SetState(kButtonDown); else fchktrigger->SetState(kButtonUp);
894    if ( cvar->PALETTE) fchkpalette->SetState(kButtonDown); else fchkpalette->SetState(kButtonUp);    if ( cvar->PALETTE) fchkpalette->SetState(kButtonDown); else fchkpalette->SetState(kButtonUp);
895    if ( cvar->VINFOS ) fchknames->SetState(kButtonDown); else fchknames->SetState(kButtonUp);    if ( cvar->VINFOS ) fchknames->SetState(kButtonDown); else fchknames->SetState(kButtonUp);
896    if ( cvar->INFOS ) fchkinfo->SetState(kButtonDown); else fchkinfo->SetState(kButtonUp);    if ( cvar->INFOS ) fchkinfo->SetState(kButtonDown); else fchkinfo->SetState(kButtonUp);
# Line 1291  void PAMevcontrol::chkpalette() { Line 1343  void PAMevcontrol::chkpalette() {
1343    cvar->goon = true;    cvar->goon = true;
1344  }  }
1345    
1346    void PAMevcontrol::chktrigger() {
1347      if ( cvar->PATTRIG ) {
1348        cvar->PATTRIG = 0;
1349      } else {
1350        cvar->PATTRIG = 1;
1351      };
1352      cvar->i--;
1353      cvar->goon = true;
1354    }
1355    
1356  void PAMevcontrol::next() {  void PAMevcontrol::next() {
1357    SetSearching();    SetSearching();
1358    if ( cvar->i == cvar->nevents-1  ) {    if ( cvar->i == cvar->nevents-1  ) {

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.23