Changeset 452


Ignore:
Timestamp:
11/16/00 10:57:58 (24 years ago)
Author:
harald
Message:
Further improvements in the layout of some guiclasses.

Know the fundament for calculating the pedestals is created with
the first implementation of the classes MPixPedest and MPedest.
A first task for calculating the pedestals is set up (MCalcPed1).
Location:
trunk/MagicSoft/MarsOctober
Files:
6 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/MarsOctober/mars.cc

    r448 r452  
    3939  TApplication theApp("App", &argc, argv);
    4040
    41   MGOctMain mainWin(gClient->GetRoot(), 500, 600);     
     41  MGOctMain mainWin(gClient->GetRoot(), 1, 1);     
    4242 
    4343  theApp.Run();
  • trunk/MagicSoft/MarsOctober/mbase/BaseLinkDef.h

    r447 r452  
    2121#pragma link C++ class MInputStreamID;
    2222
     23#pragma link C++ class MEvtLoop;
     24
    2325#endif
  • trunk/MagicSoft/MarsOctober/mocttest/BaseLinkDef.h

    r450 r452  
    1212#pragma link C++ class MTdcSpect ;
    1313#pragma link C++ class MShowSpect ;
     14#pragma link C++ class MCalcPed1 ;
    1415
    1516#endif
  • trunk/MagicSoft/MarsOctober/mocttest/MGDisplayAdc.cc

    r447 r452  
    1 #include "MGDisplayAdc.h"
     1
     2#include "MGDisplayAdc.h"
    23
    34MGDisplayAdc::MGDisplayAdc ( MHistosAdc *Histos,
    4                              const TGWindow *p, const TGWindow *main,
    5                              UInt_t w, UInt_t h,
    6                              UInt_t options)
    7   : TGTransientFrame(p, main, w, h, options )
     5                            const TGWindow *p, const TGWindow *main,
     6                            UInt_t w, UInt_t h,
     7                            UInt_t options)
     8        : TGTransientFrame(p, main, w, h, options )
    89{
    910  //   default constructor
    10 
     11  //
    1112  fHists = Histos ;
    12 
     13 
    1314  //   the top frame for the list and some buttons and the Canvas
    14 
     15 
    1516  fFrameTop = new TGHorizontalFrame (this, 60,20,  kFitWidth ) ;
    16 
     17 
     18 
    1719  //    left part of top frame
    1820  fFT1 =  new TGVerticalFrame (fFrameTop, 80,300,  kFitWidth ) ;
    19 
     21 
    2022  fHistoList = new TGListBox ( fFT1, M_LIST_HISTO ) ;
    2123  fHistoList->Associate( this ) ;
    22   fFT1->AddFrame ( fHistoList, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 10, 10 ) )  ;
     24  fFT1->AddFrame ( fHistoList, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 10, 10 ) )  ;
     25 
    2326  fHistoList->Resize(80, 300 ) ;
    24 
     27 
    2528  fFrameTop->AddFrame (fFT1, new TGLayoutHints ( kLHintsTop , 10, 10, 10, 10 ) ) ;
    26 
    27 
     29 
    2830  //    middle part of top frame
    29  
     31  //
     32 
    3033  fFT2 =  new TGVerticalFrame (fFrameTop, 80,20,  kFitWidth ) ; 
    31 
     34 
    3235  fButtonPrev = new TGTextButton ( fFT2, "Prev Histo", M_BUTTON_PREV ) ;
    3336  fButtonPrev->Associate (this) ;
    34   fFT2->AddFrame ( fButtonPrev, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 50, 10 ) )  ;
    35 
    36   fButtonNext = new TGTextButton ( fFT2, "Next Histo", M_BUTTON_NEXT ) ;
    37   fButtonNext->Associate (this) ;
    38   fFT2->AddFrame ( fButtonNext, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 10, 5 ) )  ;
    39 
    40   fFrameTop->AddFrame (fFT2, new TGLayoutHints ( kLHintsTop , 10, 10, 10, 10 ) ) ;
    41 
     37  fFT2->AddFrame ( fButtonPrev, new TGLayoutHints (kLHintsLeft | kLHintsTop,10, 10, 0, 10 ) )  ;
     38 
     39 
     40  fVslider1 = new TGVSlider (fFT2, 250, kSlider1 | kScaleBoth, VSId1);
     41 
     42  fVslider1->Associate(this);
     43  fVslider1->SetRange(0, 576);
     44  fFT2->AddFrame(fVslider1);   
     45 
     46  fButtonNext = new TGTextButton ( fFT2, "Next Histo", M_BUTTON_NEXT ) ;
     47  fButtonNext->Associate (this) ;
     48  fFT2->AddFrame ( fButtonNext, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 10, 5 ) )  ;               
     49       
     50  fFrameTop->AddFrame (fFT2, new TGLayoutHints ( kLHintsTop , 10, 10, 10, 10 ) ) ;     
     51 
     52 
    4253  //    right part of top frame
    43  
     54  //
    4455  fFT3 =  new TGVerticalFrame (fFrameTop, 60, 60,  kFitWidth ) ;
    45 
     56 
    4657  fECanv = new TRootEmbeddedCanvas("fECanv", fFT3, 400, 400 ) ;
    47   fFT3->AddFrame( fECanv, new TGLayoutHints ( kLHintsCenterX | kLHintsCenterY | kLHintsExpandX | kLHintsExpandY , 10, 10, 10, 10 ) ) ; 
    48 
     58  fFT3->AddFrame( fECanv, new TGLayoutHints ( kLHintsCenterX | kLHintsCenterY | kLHintsExpandX | kLHintsExpandY , 10, 10, 10, 10 ) ) ;
     59 
    4960  fCanv = fECanv->GetCanvas() ;
    50 
     61       
    5162  fFrameTop->AddFrame (fFT3, new TGLayoutHints ( kLHintsCenterX | kLHintsCenterY | kLHintsExpandX | kLHintsExpandY , 10, 10, 10, 10 ) ) ;
    5263 
    5364  AddFrame ( fFrameTop, new TGLayoutHints ( kLHintsTop | kLHintsExpandX , 10, 10, 10, 10 ) ) ;
    54 
     65 
    5566  //
    5667  //   the low frame for the control buttons
    5768  //
    5869  fFrameLow = new TGHorizontalFrame (this, 60,20, kFixedWidth ) ;
    59    
     70 
    6071  fButtonSave = new TGTextButton ( fFrameLow, "Save", M_BUTTON_SAVE ) ;
    6172  fButtonSave->Associate (this) ;
    62   fFrameLow->AddFrame ( fButtonSave, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) )  ; 
    63 
     73  fFrameLow->AddFrame ( fButtonSave, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) )  ;
     74 
    6475  fButtonPrint = new TGTextButton ( fFrameLow, "Print", M_BUTTON_PRINT ) ;
    6576  fButtonPrint->Associate (this) ;
    6677  fFrameLow->AddFrame ( fButtonPrint, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) )  ;
    67 
     78 
    6879  fButtonPrintAll = new TGTextButton ( fFrameLow, "PrintAll", M_BUTTON_PRINTALL ) ;
    6980  fButtonPrintAll->Associate (this) ;
    70   fFrameLow->AddFrame ( fButtonPrintAll, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) )  ;
    71 
     81  fFrameLow->AddFrame ( fButtonPrintAll, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) )  ;
     82 
     83 
     84 
    7285  fButtonClose = new TGTextButton ( fFrameLow, "Close", M_BUTTON_CLOSE ) ;
    7386  fButtonClose->Associate (this) ;
    7487  fFrameLow->AddFrame ( fButtonClose, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) )  ;
    7588  AddFrame ( fFrameLow, new TGLayoutHints ( kLHintsBottom | kLHintsExpandX , 10, 10, 10, 10 ) ) ;
    76 
     89 
    7790  //
    7891  //
    7992  //
    8093  BuildHistoList() ;
    81 
     94 
    8295  MapSubwindows();
    8396 
     
    87100  SetIconName("ADC Spectra");
    88101 
    89   MapWindow();
     102  MapWindow();
     103 
     104  SetWMSizeHints(400, 470, 1000, 1000, 10, 10);
    90105
    91  
    92 // ======================================================================
    93 // ======================================================================
    94 
    95 
     106
     107// ======================================================================
     108// ======================================================================
     109//
     110//
    96111
    97112MGDisplayAdc::~MGDisplayAdc ()
     
    101116  delete fButtonPrintAll ;
    102117  delete fButtonClose ;
    103  
     118  
    104119  delete fButtonPrev;
    105120  delete fButtonNext ;
     
    120135void MGDisplayAdc::CloseWindow()
    121136{
    122    // Got close message for this MainFrame. Calls parent CloseWindow()
    123    // (which destroys the window) and terminate the application.
    124    // The close message is generated by the window manager when its close
    125    // window menu item is selected.
    126 
     137  // Got close message for this MainFrame. Calls parent CloseWindow()
     138  // (which destroys the window) and terminate the application.
     139  // The close message is generated by the window manager when its close
     140  // window menu item is selected.
     141  //
    127142  delete this ;
    128143  //  TGTransientFrame::CloseWindow();
     
    137152Bool_t MGDisplayAdc::BuildHistoList()
    138153{
    139   //   looks in the container of the AdcSpectra and reads in the
    140   //   Histogramms in there.
    141   //
    142   //   In the class MHistosAdc are in fact two lists. One for the high and
    143   //   one for the low gain. Here we will use only the high gain list!!!
    144   //   With some special options (settings in the gui) we will also be able
    145   //   to plot the low gain
    146  
    147   for ( Int_t i=0 ; i < fHists->GetHighEntries(); i++ ) {
     154        //   looks in the container of the AdcSpectra and reads in the
     155        //   Histogramms in there.
     156        //
     157        //   In the class MHistosAdc are in fact two lists. One for the high and
     158        //   one for the low gain. Here we will use only the high gain list!!!
     159        //   With some special options (settings in the gui) we will also be able
     160        //   to plot the low gain
     161        //
     162        for ( Int_t i=0 ; i < fHists->GetHighEntries(); i++ ) {
     163               
     164                fHistoList->AddEntry(fHists->GetHighList()->At(i)->GetName(), i+1) ;
     165        }
     166       
     167        fHistoList->MapSubwindows() ;
     168        fHistoList->Layout() ;
     169
     170        return (kTRUE) ;
     171}
     172
     173// ======================================================================
     174// ======================================================================
     175
     176Bool_t MGDisplayAdc::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
     177{     
     178       
     179//      cout <<"Entering process method." << endl;
     180        // Process events generated by the buttons in the frame.
     181        //
     182        Int_t   buttons = 4, retval = 0 ;
     183        Char_t  wort[100] ;
     184        Char_t  extens[5] ;
     185        Char_t  command[110] ;
     186       
     187        TGFileItem *item ;     // to process items in the file view container
     188        void *np = NULL ;      // null pointer
     189       
     190        switch (GET_MSG(msg))
     191        {
     192            case kC_COMMAND:
     193                switch (GET_SUBMSG(msg))
     194                {
     195                    case kCM_BUTTON:
     196                       
     197                        switch (parm1)
     198                        { 
     199                               
     200                            case M_BUTTON_SAVE:
     201                                new TGMsgBox(fClient->GetRoot(), this,
     202                                             "WARNING!",
     203                                             "Not implemented yet.",
     204                                             kMBIconExclamation, buttons, &retval);
     205                               
     206                                break ;
     207                               
     208                            case M_BUTTON_PRINT:
     209                                break;
     210                               
     211                            case M_BUTTON_CLOSE:
     212                                CloseWindow() ;
     213                                break ;
     214                            case M_BUTTON_PREV:
     215                                fCanv->cd() ;
    148216 
    149     fHistoList->AddEntry(fHists->GetHighList()->At(i)->GetName(), i+1) ;
    150   }
    151  
    152   fHistoList->MapSubwindows() ;
    153   fHistoList->Layout() ;
    154 
    155   return (kTRUE) ;
    156 }
    157 
    158 // ======================================================================
    159 // ======================================================================
    160 
    161 Bool_t MGDisplayAdc::ProcessMessage(Long_t msg, Long_t parm1, Long_t)
    162 {     
    163   // Process events generated by the buttons in the frame.
    164  
    165   Int_t   buttons = 4, retval = 0 ;
    166   Char_t  wort[100] ;
    167   Char_t  extens[5] ;
    168   Char_t  command[110] ;
    169  
    170   TGFileItem *item ;     // to process items in the file view container
    171   void *np = NULL ;      // null pointer
    172 
    173   switch (GET_MSG(msg))
    174     {
    175     case kC_COMMAND:
    176       switch (GET_SUBMSG(msg))
    177         {
    178         case kCM_BUTTON:
    179          
    180           switch (parm1)
    181             { 
    182 
    183             case M_BUTTON_SAVE:
    184               break ;
     217                                fHists->GetHighList()->At( fHistoList->GetSelected()-1-1)->Draw() ;
     218                               
     219                                fCanv->Modified() ;
     220                                fCanv->Update() ;
     221                                fVslider1->SetPosition( fHistoList->GetSelected()-1);
     222                               
     223
     224                               
     225                                break;
     226                               
     227                            default:
     228                                break ;
     229                        }
     230                       
     231                    case kCM_MENU:
     232                        switch (parm1)
     233                        {
     234                        }
     235                        break ;
     236                       
     237                    default:
     238                        break ;
     239                       
     240                }
     241               
     242            case kCM_LISTBOX:
     243              switch  (GET_SUBMSG(msg))
     244                {
     245                case M_LIST_HISTO:
     246                  fCanv->cd() ;
     247                 
     248                  fHists->GetHighList()->At( fHistoList->GetSelected()-1)->Draw() ;
     249                 
     250                  fCanv->Modified() ;
     251                  fCanv->Update() ;
     252                  fVslider1->SetPosition( fHistoList->GetSelected()-1);
     253                 
     254                 
     255                 
     256                default:
     257                  break ;
     258                }
    185259             
    186             case M_BUTTON_CLOSE:
    187               CloseWindow() ;
    188               break ;
     260               
     261        case kC_CONTAINER:
     262          switch (GET_SUBMSG(msg))
     263            {
    189264             
     265            case kCT_ITEMDBLCLICK:
     266             
     267              break;
     268                       
    190269            default:
    191270              break ;
    192             }
    193 
    194         case kCM_MENU:
    195           switch (parm1) {
    196           }
    197           break ;
     271            }
     272         
     273         
    198274         
    199275        default:
    200           break ;
     276          break;
     277         
     278        case kC_VSLIDER:
     279          switch(GET_SUBMSG(msg))
     280            {
     281            case kSL_POS:
     282              {
     283                switch(parm1)
     284                  {
     285                  case VSId1:
     286                    fCanv->cd() ;
     287                   
     288                    fHists->GetHighList()->At(parm2)->Draw() ;
     289                                       
     290                    fCanv->Modified() ;
     291                    fCanv->Update() ;
     292                   
     293                    break;
     294                  }
     295                break;                         
     296              }                                 
     297              break;
     298            }
     299          break;
    201300         
    202301        }
    203 
    204     case kCM_LISTBOX:
    205       switch  (GET_SUBMSG(msg))
    206         {
    207         case M_LIST_HISTO:
    208           fCanv->cd() ;
    209          
    210           fHists->GetHighList()->At( fHistoList->GetSelected()-1)->Draw() ;
    211 
    212           fCanv->Modified() ;
    213           fCanv->Update() ;
    214          
    215           break;
    216          
    217         default:
    218           break ;
    219         }
    220 
    221     case kC_CONTAINER:
    222       switch (GET_SUBMSG(msg)) {
    223              
    224       case kCT_ITEMDBLCLICK:
    225        
    226         break;
    227        
    228       default:
    229         break ;
    230       }
    231      
    232      
    233      
    234     default:
    235       break;
    236     }
    237   return kTRUE;
     302        return kTRUE;
    238303}
  • trunk/MagicSoft/MarsOctober/mocttest/MGDisplayAdc.h

    r447 r452  
    1616#include <TGFSContainer.h>
    1717#include <TGMsgBox.h>
     18#include <TVirtualX.h>
     19#include <TGFrame.h>
     20#include <TGTextEntry.h>
     21#include <TGSlider.h>
     22#include <TGDoubleSlider.h>
     23#include <TGScrollBar.h>
     24#include <TSlider.h>
     25
     26
     27
     28
     29////#include <TGPrintDialog>
    1830
    1931#include <TVirtualX.h>
     
    2335
    2436class MHistosAdc;
     37
     38enum ETestCommandIdentifiers {
     39                VSId1
     40};
     41
    2542
    2643enum ComIdentDisplayAdc {
     
    5673  TGTextButton   *fButtonSave, *fButtonPrint, *fButtonPrintAll, *fButtonClose ;
    5774 
    58   TCanvas            *fCanv ;
    59 
     75  TCanvas            *fCanv ;
     76       
     77  //for sliders
     78 
     79  TGVSlider       *fVslider1;
     80 
    6081 public:
    6182 
  • trunk/MagicSoft/MarsOctober/mocttest/MGOctMain.cc

    r450 r452  
    4747  fTop1->AddFrame (fButEvtDisp, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
    4848 
    49   fFrameTop->AddFrame (fTop1, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
    50 
     49  fFrameTop->AddFrame (fTop1, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) );
    5150
    5251  fTop2 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ;
     
    6059  fTop2->AddFrame (fButCrADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
    6160
    62   fFrameTop->AddFrame (fTop2, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
    63 
     61  fFrameTop->AddFrame (fTop2, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) );
    6462
    6563  fTop3 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ;
     
    7371  fTop3->AddFrame (fButCrTDC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
    7472
    75   fFrameTop->AddFrame (fTop3, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
    76 
    77 
    78  
    79   AddFrame(fFrameTop, new TGLayoutHints (kLHintsExpandX ) ) ;   
     73  fFrameTop->AddFrame (fTop3, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) );
     74
     75  AddFrame(fFrameTop, new TGLayoutHints (kLHintsTop ) ) ;   
     76
    8077
    8178  //
     
    8582  fFrameLow = new TGCompositeFrame (this, 300,100, kHorizontalFrame ) ;
    8683 
    87   fLayTab = new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX  , 5, 5, 5, 5 ) ;
     84  fLayTab = new TGLayoutHints ( kLHintsExpandX   , 5, 5, 5, 5 ) ;
    8885
    8986  //    create the first tab
     
    9491 
    9592  fTabF1 = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ;
    96   tf->AddFrame(fTabF1, fLayTab ) ;
     93  //  tf->AddFrame(fTabF1, fLayTab ) ;
    9794
    9895 
     
    152149  fTabF1b->AddFrame(fFileView, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5) ) ;
    153150
    154    
    155   tf->AddFrame(fTabF1, fLayTab) ;
     151  tf->AddFrame(fTabF1, fLayTab) ;
     152 
    156153  fFrameLow->AddFrame ( fTab, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) );
    157154
     
    161158  //   Map the window, set up the layout, etc.
    162159  //
     160
     161  SetWMSizeHints(400, 650, 1000, 1000, 10, 10 ) ;      // set the smallest and biggest size of the Main frame
    163162
    164163  MapSubwindows();
  • trunk/MagicSoft/MarsOctober/mocttest/MHistosAdc.h

    r447 r452  
    2727      {
    2828        return ( fHistHigh ) ;
     29      }   
     30
     31    TObjArray* GetLowList()
     32      {
     33        return ( fHistLow ) ;
    2934      }
    3035   
  • trunk/MagicSoft/MarsOctober/mocttest/Makefile

    r450 r452  
    5959           MTdcSpect.cc \
    6060           MShowSpect.cc \
    61            MGDisplayAdc.cc
     61           MGDisplayAdc.cc \
     62           MCalcPed1.cc
    6263
    6364SRCS    = $(SRCFILES)
  • trunk/MagicSoft/MarsOctober/mrootformat/BaseLinkDef.h

    r447 r452  
    77#pragma link C++ class MRawPixel;
    88
     9#pragma link C++ class MPixPedest;
     10#pragma link C++ class MPedest;
     11
    912
    1013#endif
  • trunk/MagicSoft/MarsOctober/mrootformat/Makefile

    r447 r452  
    5454
    5555SRCFILES = MRawPixel.cc \
    56            MRawEvt.cc
     56           MRawEvt.cc \
     57           MPixPedest.cc \
     58           MPedest.cc
    5759
    5860SRCS    = $(SRCFILES)
Note: See TracChangeset for help on using the changeset viewer.