Changeset 587


Ignore:
Timestamp:
01/23/01 10:43:18 (24 years ago)
Author:
harald
Message:
The integration of the class MGFadcDisp in the mars code. Now
one is able to see at least the high gain samples with this gui.
I hope that also Razmik is now able to look to the data.
Location:
trunk/MagicSoft/Mars
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r586 r587  
    11                                                                  -*-*- END -*-*-
     2 
     3 2000/01/23: Harald Kornmayer
     4
     5   *  the integration of the class FadcDisp in the mars enviroment
     6      and further developments in the display
     7
     8      changed:
     9        meventdisp/MGFadcDisp.h
     10        meventdisp/MGFadcDisp.cc
     11        mgui/GuiIncl.h
     12        mgui/GuiLinkDef.h
     13        mgui/MGMarsMain.cc
     14        mgui/MGPrototyp.cc
     15        mgui/MGPrototyp.h
     16        mgui/Makefile
     17
     18      added:
     19        mgui/MGEventDispMain.h
     20        mgui/MGEventDispMain.cc
     21
     22
    223 2000/01/22: Harald Kornmayer
    324
  • trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc

    r586 r587  
    8383  fTop2->AddFrame( fLabelEvtNr, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ;
    8484
    85   fTxtEvtNr = new TGTextEntry(fTop2, fTxtBufEvtNr = new TGTextBuffer(100), 9999 );
     85  fTxtEvtNr = new TGTextEntry(fTop2, fTxtBufEvtNr = new TGTextBuffer(100), M_EVTNUMBER);
    8686  fTxtEvtNr->Resize(60, fTxtEvtNr->GetDefaultHeight());
     87  fTxtEvtNr->Associate(this) ;
    8788  fTop2->AddFrame(fTxtEvtNr, new TGLayoutHints(kLHintsTop | kLHintsLeft,
    8889                                                       5, 5, 5, 5));
     
    171172 
    172173 
    173   fButtonPrint = new TGTextButton(fFrameLow, "Print", 9999) ;
     174  fButtonPrint = new TGTextButton(fFrameLow, "Print", M_PRINT) ;
     175  fButtonPrint->Associate(this) ;
    174176  fFrameLow->AddFrame( fButtonPrint, new TGLayoutHints(kLHintsLeft , 10, 10, 10, 10 ) )  ;
    175177
    176   fButtonClose = new TGTextButton(fFrameLow, "Close", 9999) ;
     178  fButtonClose = new TGTextButton(fFrameLow, "Close", M_CLOSE) ;
     179  fButtonClose->Associate(this) ;
    177180  fFrameLow->AddFrame( fButtonClose, new TGLayoutHints(kLHintsLeft, 10, 10, 10, 10 ) )  ;
    178181
     
    210213MGFadcDisp::~MGFadcDisp()
    211214{
     215  // close the file
     216
     217  readin->PostProcess() ;
     218
     219  delete  runheader ;
     220  delete  evtheader ;
     221  delete  evttime   ;
     222  delete  evtdata ;
     223  delete  evtcrate  ;
     224
     225  delete  plist ;
     226
     227  delete  readin ;
     228
     229  //   destruct the graphical members 
    212230
    213231  delete  fButtonPrint ;
    214232  delete  fButtonClose ;
    215 
    216   delete  fCan ;
     233 
     234  //  delete  fCan ;
    217235  delete  fECanDigScope ;
    218236  delete  fTabDisplay ;
    219 
     237 
    220238  delete  fPixSlider ;
    221239  delete  fButtonPrevPix ;
     
    224242  delete  fPixelList;
    225243  delete  fTabControl  ;
    226 
     244 
    227245  delete  fLabelEvtNr ;
    228246  delete  fLabelTotNr ;
     247  //delete  fTxtBufEvtNr ;
    229248  delete  fTxtEvtNr ;
    230   delete  fTxtBufEvtNr ;
    231249  delete  fButtonNextEvt ;
    232250  delete  fButtonPrevEvt ;
     
    237255  delete  fTop2 ;
    238256  delete  fTop1 ;
    239 
     257 
    240258  delete  fFrameLow ;
    241259  delete  fLineSep2 ;
     
    246264
    247265
     266void MGFadcDisp::CloseWindow()
     267{
     268   // Got close message for this MainFrame. Calls parent CloseWindow()
     269   // (which destroys the window) and terminate the application.
     270   // The close message is generated by the window manager when its close
     271   // window menu item is selected.
     272
     273  delete this ;
     274}
     275       
     276
    248277void MGFadcDisp::CreatePixelList() {
    249278  //
     
    260289  redraw = fPixelList->GetSelected() ;
    261290 
    262   cout << "redraw: " << redraw << endl ;
    263 
    264291  fPixelList->RemoveEntries(0, fPixelsinList) ;
    265292  fPixelsinList = 0 ;
     
    338365                 "The event number is out of range!!!",
    339366                 kMBIconExclamation, buttons, &retval);
     367    UpdateEventCounter() ;
    340368    return ;
    341369  }
     
    364392  //------------------------------------------------------------------
    365393  char wortdummy[256] ;
     394  Int_t   buttons = 4, retval = 0 ;
    366395
    367396  switch(GET_MSG(msg))
     
    387416
    388417              break;
     418
     419
     420            case M_PRINT:
     421              new TGMsgBox(fClient->GetRoot(), this,
     422                           "INFORMATION!",
     423                           "Your are invited to program that!!",
     424                           kMBIconExclamation, buttons, &retval);
    389425             
     426              break ;
     427            case M_CLOSE:
     428
     429              CloseWindow() ;
     430              break;
     431
    390432            }
    391433         
     
    410452         
    411453        }
     454   
     455    case kC_TEXTENTRY:
     456     
     457      switch(GET_SUBMSG(msg))
     458        {
     459        case kTE_TEXTCHANGED:
     460         
     461          break ;
     462        case kTE_ENTER:
     463         
     464          sprintf(wortdummy, "%s",  fTxtEvtNr->GetText()) ;
     465          cout << wortdummy<< endl  ;
     466         
     467          cout << atoi(wortdummy) << endl ;
     468         
     469         
     470          ReadinEvent( atoi(wortdummy) ) ;
     471
     472          break;
     473        }
     474     
     475      break;
     476     
    412477    default:
    413478      break;     
  • trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.h

    r586 r587  
    3434  M_PIXELLIST = 4201 ,
    3535  M_PREVEVT,
    36   M_NEXTEVT
     36  M_NEXTEVT,
     37  M_EVTNUMBER,
     38
     39  M_PREVPIXEL,
     40  M_NEXTPIXEL,
     41
     42  M_PRINT,
     43  M_CLOSE
    3744 
    3845
     
    104111  ~MGFadcDisp()  ;
    105112
     113  void CloseWindow() ;
     114
    106115  void CreatePixelList() ;
    107116  void UpdateEventCounter() ;
  • trunk/MagicSoft/Mars/mgui/GuiIncl.h

    r461 r587  
    99#include <TGSplitter.h>     // TGHorizontal3DLine
    1010#include <TGFSContainer.h>  // TGFileContainer
     11#include <TGLabel.h>       // TGLabel
     12#include <TGTextEntry.h> 
     13
    1114
    1215#endif // __CINT__
  • trunk/MagicSoft/Mars/mgui/GuiLinkDef.h

    r571 r587  
    66
    77#pragma link C++ class MGMarsMain;
     8#pragma link C++ class MGEventDispMain;
    89#pragma link C++ class MGDataCheckMain;
    910#pragma link C++ class MGMonteCarloMain;
  • trunk/MagicSoft/Mars/mgui/MGMarsMain.cc

    r571 r587  
    99#include <TGSplitter.h>    // TGHorizontal3DLine
    1010
     11#include "MGEventDispMain.h"
    1112#include "MGDataCheckMain.h"
    1213#include "MGMonteCarloMain.h"
     
    193194
    194195            case M_BUTTON_EVTDISP:
    195 
    196               new TGMsgBox(fClient->GetRoot(), this,
    197                            "WARNING!",
    198                            "EventDisplay not yet implemented!",
    199                            kMBIconExclamation, buttons, &retval);
     196             
     197              new MGEventDispMain (fClient->GetRoot(), this, 400, 650 ) ;
    200198              break ;
    201199             
     
    205203
    206204            case M_BUTTON_ANALYSE:
    207               new TGMsgBox(fClient->GetRoot(), this,
     205              //new MGPrototyp(fClient->GetRoot(), this, 400, 650 ) ;
     206
     207               new TGMsgBox(fClient->GetRoot(), this,
    208208                           "WARNING!",
    209209                           "Analysis not yet implemented!",
  • trunk/MagicSoft/Mars/mgui/MGPrototyp.cc

    r571 r587  
    99#include <TGListBox.h>      // TGListBox
    1010#include <TGFSContainer.h>  // TGFileContainer
     11#include <TGSplitter.h>    // TGHorizontal3DLine
     12#include <TGTextEntry.h>
     13#include <TGLabel.h>       // TGLabel
     14
    1115
    1216// FIXME: Move to MAGIC.h
     
    1519ClassImp(MGPrototyp)
    1620
    17 enum CommandDataChecker {
     21enum CommandPrototyp {
    1822  M_FILE_CLOSE ,
    1923  M_BUTTON_ACTION,
    2024
     25  M_FILERESET,
    2126  M_PBUTTON_CDIR_UP,
    2227  M_PBUTTON_LIST_MODE,
     
    5863  AddFrame(fMenuBar, fLayMenuBar ) ;
    5964 
     65  fLineSep1 = new TGHorizontal3DLine(this) ;
     66  AddFrame(fLineSep1, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
     67
     68 
    6069  //
    6170  //    Create the top window with a lot of buttons
     
    7483  AddFrame(fFrameTop, new TGLayoutHints (kLHintsTop ) ) ;   
    7584
     85  //   a line between top and low frame
     86 
     87  fLineSep2 = new TGHorizontal3DLine(this) ;
     88  AddFrame(fLineSep2, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
    7689
    7790  //
     
    92105  //  tf->AddFrame(fTabF1, fLayTab ) ;
    93106
    94  
    95107  fTabF1a = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ;
    96108  tf->AddFrame(fTabF1a,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ;
    97109
    98   fTabF1b = new TGCompositeFrame (tf, 100, 100, kVerticalFrame) ;
    99   //  tf->AddFrame(fTabF1b,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ;
    100   tf->AddFrame(fTabF1b,  new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ;
    101 
    102  
    103   fDir = new TGListBox(fTabF1a, -1) ;
     110  fTabF1b = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ;
     111  tf->AddFrame(fTabF1b,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ;
     112
     113  fTabF1c = new TGCompositeFrame (tf, 100, 100, kVerticalFrame) ;
     114  //  tf->AddFrame(fTabF1c,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ;
     115  tf->AddFrame(fTabF1c,  new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ;
     116 
     117  //   the items in the first subframe
     118
     119  fLabFileName = new TGLabel(fTabF1a, new TGString("selected File:") );
     120  fTabF1a->AddFrame( fLabFileName, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ;
     121
     122  fTxtFileName = new TGTextEntry(fTabF1a, fTxtBufFileName = new TGTextBuffer(256) );
     123  fTxtFileName->Resize(60, fTxtFileName->GetDefaultHeight());
     124  fTabF1a->AddFrame(fTxtFileName, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));
     125
     126  fButFileReset = new TGTextButton (fTabF1a, "Reset", M_FILERESET ) ;
     127  fButFileReset->Associate(this) ;
     128  fTabF1a->AddFrame (fButFileReset, new TGLayoutHints (kLHintsRight, 10, 10, 10, 10  ) ) ;
     129 
     130 
     131 
     132  //   the items in the second subfraem
     133
     134  fLabDir = new TGLabel(fTabF1b, new TGString("Directory:") );
     135  fTabF1b->AddFrame( fLabDir, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ;
     136
     137  fDir = new TGListBox(fTabF1b, -1) ;
    104138  fDir->Resize(350,20) ;
    105139  char temp[100] ;
     
    107141  sprintf ( temp, "%s", gSystem->WorkingDirectory()  ) ;
    108142  fDir->AddEntry(temp, 1) ;
    109   fTabF1a->AddFrame( fDir, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ;
     143  fTabF1b->AddFrame( fDir, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ;
    110144
    111145
    112146  fPicCdup = fClient->GetPicture("tb_uplevel.xpm") ;
    113   fCdup = new TGPictureButton(fTabF1a, fPicCdup, M_PBUTTON_CDIR_UP ) ;
     147  fCdup = new TGPictureButton(fTabF1b, fPicCdup, M_PBUTTON_CDIR_UP ) ;
    114148  fCdup->SetToolTipText("One Level up!") ;
    115149  fCdup->Associate(this) ;
    116   fTabF1a->AddFrame (fCdup, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ;
     150  fTabF1b->AddFrame (fCdup, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ;
    117151
    118152  fPicList = fClient->GetPicture("tb_list.xpm") ;
    119   fListMode = new TGPictureButton(fTabF1a, fPicList, M_PBUTTON_LIST_MODE ) ;
     153  fListMode = new TGPictureButton(fTabF1b, fPicList, M_PBUTTON_LIST_MODE ) ;
    120154  fListMode->SetToolTipText("List Mode") ;
    121155  fListMode->Associate(this) ;
    122156  fListMode->SetState(kButtonUp) ;
    123157  fListMode->AllowStayDown(kTRUE) ;
    124   fListMode->AllowStayDown(kTRUE) ;  fTabF1a->AddFrame (fListMode, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ;
     158  fListMode->AllowStayDown(kTRUE) ;  fTabF1b->AddFrame (fListMode, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ;
    125159
    126160  fPicDetail = fClient->GetPicture("tb_details.xpm") ;
    127   fDetail = new TGPictureButton(fTabF1a, fPicDetail, M_PBUTTON_DETAIL_MODE ) ;
     161  fDetail = new TGPictureButton(fTabF1b, fPicDetail, M_PBUTTON_DETAIL_MODE ) ;
    128162  fDetail->SetToolTipText("Details Mode") ;
    129163  fDetail->Associate(this) ;
    130164  fDetail->SetState(kButtonEngaged) ;
    131165  fDetail->AllowStayDown(kTRUE) ;
    132   fTabF1a->AddFrame (fDetail, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ;
    133 
    134    
    135   fFileView = new TGListView(fTabF1b, 540, 380 ) ;
     166  fTabF1b->AddFrame (fDetail, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ;
     167
     168  // the items in the third subframe
     169
     170  fFileView = new TGListView(fTabF1c, 540, 380 ) ;
    136171  fFileCont = new TGFileContainer(fFileView->GetViewPort(), 100, 100,
    137172                                  kVerticalFrame, fgWhitePixel) ;
     
    146181  fFileCont->Sort(kSortByName) ;
    147182 
    148   fTabF1b->AddFrame(fFileView, new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ) ;
     183  fTabF1c->AddFrame(fFileView, new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ) ;
    149184
    150185  tf->AddFrame(fTabF1, fLayTab) ;
     
    187222    delete fDetail;
    188223    delete fDir ;
     224    delete fLabDir ;
     225
     226    delete fButFileReset ;
     227    delete fTxtFileName  ;
     228    delete fLabFileName  ;
     229   
     230    delete fTabF1c;
    189231    delete fTabF1b;
    190232    delete fTabF1a;
     
    193235    delete fTop1;
    194236    delete fTab;
     237
    195238    delete fFrameTop;
    196239    delete fFrameLow;
     240    delete fLineSep2 ;
     241    delete fLineSep1 ;
     242
    197243    delete fFileMenu;
    198244    delete fMenuBar;
     
    269315
    270316              break ;
    271                  
     317               
     318
     319            case M_FILERESET:
     320             
     321              sprintf ( fInputFile, "\n" ) ;
     322              fTxtFileName->SetText( fInputFile ) ;
     323             
     324              break;
    272325            case M_PBUTTON_CDIR_UP :
    273326
     
    375428                else if  ( ! strcmp(extens, "root") ) {      //     root file
    376429                  sprintf ( fInputFile, "%s/%s" , gSystem->WorkingDirectory(), wort ) ; 
    377 
    378                   printf (" %s \n", fInputFile ) ;
     430                  fTxtFileName->SetText( fInputFile ) ;
     431
    379432                  break ;
    380433                }
  • trunk/MagicSoft/Mars/mgui/MGPrototyp.h

    r571 r587  
    1919class TGFileContainer;
    2020class TGListView;
     21class TGHorizontal3DLine;
     22class TGLabel ;
     23class TGTextEntry ;
     24class TGTextBuffer;
    2125
    2226class MGPrototyp : public TGTransientFrame {
     
    3539  TGMenuBar         *fMenuBar ;
    3640  TGPopupMenu       *fFileMenu ;
     41  TGHorizontal3DLine *fLineSep1, *fLineSep2 ;
     42
    3743
    3844  //   divide the Window in two different parts
     
    5359
    5460  TGCompositeFrame  *fTabF1 ;                       // first tab of low part
    55   TGCompositeFrame  *fTabF1a, *fTabF1b ;            // subpart of the file selector in low window
     61  TGCompositeFrame  *fTabF1a, *fTabF1b, *fTabF1c ;  // subpart of the file selector in low window
     62
     63  TGLabel           *fLabFileName ;
     64  TGTextEntry       *fTxtFileName ;
     65  TGTextBuffer      *fTxtBufFileName ; //!
     66  TGTextButton      *fButFileReset ;
     67 
     68  TGLabel           *fLabDir ;
    5669  TGListBox         *fDir ;
    5770  TGPictureButton   *fCdup, *fListMode, *fDetail ;
  • trunk/MagicSoft/Mars/mgui/Makefile

    r571 r587  
    2727#  connect the include files defined in the config.mk file
    2828#
    29 INCLUDES = -I. -I../mbase -I../mraw -I../mdatacheck
     29INCLUDES = -I. -I../mbase -I../mraw -I../mdatacheck -I../meventdisp
    3030
    3131#
     
    5353
    5454SRCFILES = MGMarsMain.cc \
     55           MGEventDispMain.cc \
    5556           MGDataCheckMain.cc \
    5657           MGMonteCarloMain.cc \
Note: See TracChangeset for help on using the changeset viewer.