Ignore:
Timestamp:
10/02/01 14:46:56 (24 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mmain
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mmain/MDataCheck.cc

    r947 r959  
    2828#include <TGButton.h>  // TGTextButton
    2929
     30// ---
     31
     32#include "MParList.h"
     33#include "MTaskList.h"
     34#include "MEvtLoop.h"
     35#include "MReadTree.h"
     36#include "MFillH.h"
     37#include "MGDisplayAdc.h"
     38
     39// ---
     40
    3041ClassImp(MDataCheck)
    3142
     
    3748};
    3849
     50// --------------------------------------------------------------------------
     51//
     52//  Create the 'Data Check' GUI Controls (Window) on the screen. To use it
     53//  from within the interpreter you can call a Standard Version with
     54//  'new MDataCheck()'
     55//
    3956MDataCheck::MDataCheck(const TGWindow *main, const TGWindow *p,
    40                                  const UInt_t w, const UInt_t h)
     57                       const UInt_t w, const UInt_t h)
    4158: MBrowser(main, p, w, h)
    4259{
     
    7592}
    7693
    77 // ======================================================================
     94// --------------------------------------------------------------------------
     95//
     96//  Create the 'View Adc' GUI Controls (Window) on the screen.
     97//  Therefor we have to process all data in a file and fill the corresponding
     98//  histograms.
     99//
     100void MDataCheck::ViewAdcSpectra(Char_t *inputfile, Char_t *treeName)
     101{
     102    //
     103    // create a (empty) list of parameters which can be used by the tasks
     104    // and an (empty) list of tasks which should be executed
     105    // connect them in the required way.
     106    //
    78107
     108    //
     109    //   create the data containers for the raw data
     110    //
     111    MParList plist;
     112
     113    //
     114    // set up the tasks for this job
     115    //
     116    MTaskList tasks;
     117    plist.AddToList(&tasks);
     118
     119    MReadTree readin(treeName, inputfile);
     120    tasks.AddToList(&readin);
     121
     122    MFillH fillspect("MRawEvtData", "MHFadcCam");
     123    tasks.AddToList(&fillspect);
     124
     125    //
     126    // set up the loop for the processing
     127    //
     128    MEvtLoop magic;
     129    magic.SetParList(&plist);
     130
     131    //
     132    // start the loop running
     133    //
     134    if (!magic.Eventloop())
     135        return;
     136
     137    new MGDisplayAdc((MHFadcCam*)plist.FindObject("MHFadcCam"));
     138}
     139
     140// --------------------------------------------------------------------------
     141//
     142//  Process the GUI control events (here: mainly button clicks)
     143//
    79144Bool_t MDataCheck::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
    80145{
     
    99164        {
    100165        case M_BUTTON_PEDADC:
    101             fViewAdc.AdcSpectra(fInputFile, "PedEvents");
     166            ViewAdcSpectra(fInputFile, "PedEvents");
    102167            return kTRUE;
    103168
    104169        case M_BUTTON_CRADC:
    105             fViewAdc.AdcSpectra(fInputFile, "Events");
     170            ViewAdcSpectra(fInputFile, "Events");
    106171            return kTRUE;
    107172
  • trunk/MagicSoft/Mars/mmain/MDataCheck.h

    r947 r959  
    1010#endif
    1111
    12 #ifndef MVIEWADCSPECTRA_H
    13 #include "MViewAdcSpectra.h"
    14 #endif
    15 
    1612class MDataCheck : public MBrowser
    1713{
    1814private:
    19     MViewAdcSpectra fViewAdc;
     15    void ViewAdcSpectra(Char_t *inputfile, Char_t *treeName);
    2016
    2117public:
  • trunk/MagicSoft/Mars/mmain/MMars.cc

    r949 r959  
    3434#include <TG3DLine.h>      // TGHorizontal3DLine
    3535                           // use TGSplitter.h for root<3.00
    36 
    3736#include "MEvtDisp.h"
    3837#include "MAnalysis.h"
    3938#include "MDataCheck.h"
    4039#include "MMonteCarlo.h"
    41 
    42 #include "MGPrototyp.h"
     40#include "MCameraDisplay.h"
    4341
    4442ClassImp(MMars)
    4543
    4644enum {
    47   M_FILE_EXIT,
    48   M_FILE_ABOUT,
    49 
    50   M_PICTURE_MAGIC,
    51   M_PICTURE_MARS,
    52 
    53   M_BUTTON_EVTDISP,
    54   M_BUTTON_DATACHECK,
    55   M_BUTTON_ANALYSE,
    56   M_BUTTON_MONTECARLO
     45    M_FILE_EXIT,
     46    M_FILE_ABOUT,
     47
     48    M_PICTURE_MAGIC,
     49    M_PICTURE_MARS,
     50
     51    M_BUTTON_EVTDISP,
     52    M_BUTTON_DATACHECK,
     53    M_BUTTON_ANALYSE,
     54    M_BUTTON_MONTECARLO,
     55    M_BUTTON_CAMDISPLAY
    5756};
    5857
     
    9796    mars->Associate(this);
    9897
    99     TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft, 10., 10., 20., 10.);
    100     TGLayoutHints *lay2 = new TGLayoutHints(kLHintsLeft, 10., 10., 10., 10.);
     98    TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft,  10., 10., 20., 10.);
     99    TGLayoutHints *lay2 = new TGLayoutHints(kLHintsRight, 10., 10., 10., 10.);
    101100
    102101    fList->Add(lay1);
     
    105104    top->AddFrame(magic, lay1);
    106105    top->AddFrame(mars,  lay2);
     106}
     107
     108void MMars::CreateTextButton(TGVerticalFrame *tab, const char *text,
     109                             const UInt_t id, TGLayoutHints *hints) const
     110{
     111    //
     112    // Create the button
     113    //
     114    TGTextButton *button = new TGTextButton(tab, text, id);
     115
     116    //
     117    // Add button for 'auto-delete'
     118    //
     119    fList->Add(button);
     120
     121    //
     122    // Send button events (meesages) to this object (s. ProcessMessage)
     123    //
     124    button->Associate(this);
     125
     126    //
     127    // Add button with corresponding layout to containing frame
     128    //
     129    tab->AddFrame(button, hints);
    107130}
    108131
     
    136159    tf->AddFrame(tab2, laytabx);
    137160
    138     TGTextButton *evtdisp    = new TGTextButton(tab2, "EventDisplay", M_BUTTON_EVTDISP);
    139     TGTextButton *datacheck  = new TGTextButton(tab2, "Data Check",   M_BUTTON_DATACHECK);
    140     TGTextButton *analysis   = new TGTextButton(tab2, "Analysis",     M_BUTTON_ANALYSE);
    141     TGTextButton *montecarlo = new TGTextButton(tab2, "MonteCarlo",   M_BUTTON_MONTECARLO);
    142 
    143     fList->Add(evtdisp);
    144     fList->Add(datacheck);
    145     fList->Add(analysis);
    146     fList->Add(montecarlo);
    147 
    148     evtdisp   ->Associate(this);
    149     datacheck ->Associate(this);
    150     analysis  ->Associate(this);
    151     montecarlo->Associate(this);
    152 
    153     TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsCenterX , 10, 10, 10, 10);
     161    TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsCenterX, 10, 10, 10, 10);
    154162    fList->Add(laybut);
    155163
    156     tab2->AddFrame(evtdisp,    laybut);
    157     tab2->AddFrame(datacheck,  laybut);
    158     tab2->AddFrame(analysis,   laybut);
    159     tab2->AddFrame(montecarlo, laybut);
     164    CreateTextButton(tab2, "Event Display",  M_BUTTON_EVTDISP,    laybut);
     165    CreateTextButton(tab2, "Data Check",     M_BUTTON_DATACHECK,  laybut);
     166    CreateTextButton(tab2, "Analysis",       M_BUTTON_ANALYSE,    laybut);
     167    CreateTextButton(tab2, "Monte Carlo",    M_BUTTON_MONTECARLO, laybut);
     168    CreateTextButton(tab2, "Camera Display", M_BUTTON_CAMDISPLAY, laybut);
    160169}
    161170
    162171MMars::MMars(/*const TGWindow *p,*/ UInt_t w, UInt_t h)
    163   : TGMainFrame(gClient->GetRoot(), w, h)
     172: TGMainFrame(gClient->GetRoot(), w, h)
     173//: MBrowser (gClient->GetRoot(), gClient->GetRoot(), w, h)
    164174{
    165175    //
     
    196206    AddFrame(low,     layout);
    197207
     208    //    CreateTopFrame(fTop2);
     209    //    CreateBottomFrame(fTop3);
     210
    198211    //
    199212    //   Map the window, set up the layout, etc.
    200213    //
    201     SetWMSizeHints(400, 380, 400, 380, 10, 10);  // set the smallest and biggest size of the Main frame
     214    SetWMSizeHints(400, 410, 400, 410, 10, 10);  // set the smallest and biggest size of the Main frame
    202215
    203216    MapSubwindows();
     
    271284                return kTRUE;
    272285
     286            case M_BUTTON_CAMDISPLAY:
     287                new MCameraDisplay(this);
     288                return kTRUE;
     289
    273290            case M_PICTURE_MAGIC:
    274                 DisplWarning("Please open a Netscape to the MAGIC homepage");
     291                DisplWarning("Please open a Netscape to the MAGIC homepage\n"
     292                             "http://hegra1.mppmu.mpg.de/MAGICWeb/");
    275293                return kTRUE;
    276294
    277295            case M_PICTURE_MARS:
    278                 DisplWarning("Please open a Netscape to the MARS homepage");
    279                 return kTRUE;
    280 
     296                DisplWarning("Please open a Netscape to the MARS homepage\n"
     297                             "http://magic.uni-sw.gwdg.de/mars/");
     298                return kTRUE;
    281299            }
    282300
  • trunk/MagicSoft/Mars/mmain/MMars.h

    r946 r959  
    1010#endif
    1111
     12/*
     13 #ifndef MBROWSER_H
     14 #include <MBrowser.h>
     15 #endif
     16 */
     17
    1218class TList;
     19class TGVerticalFrame;
     20class TGLayoutHints;
    1321
    1422class MMars : public TGMainFrame
     
    2028    const TGPicture *fPic1;
    2129    const TGPicture *fPic2;
     30
     31    void CreateTextButton(TGVerticalFrame *tab, const char *text,
     32                          const UInt_t id, TGLayoutHints *hints) const;
    2233
    2334    void CreateMenuBar();
  • trunk/MagicSoft/Mars/mmain/MainLinkDef.h

    r949 r959  
    1212#pragma link C++ class MDataCheck;
    1313#pragma link C++ class MMonteCarlo;
     14#pragma link C++ class MCameraDisplay;
    1415
    1516#endif
  • trunk/MagicSoft/Mars/mmain/Makefile

    r954 r959  
    3434           MAnalysis.cc \
    3535           MMonteCarlo.cc \
     36           MCameraDisplay.cc \
    3637           MBrowser.cc
    3738
Note: See TracChangeset for help on using the changeset viewer.