Changeset 951


Ignore:
Timestamp:
09/27/01 12:06:22 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r949 r951  
    11                                                                  -*-*- END -*-*-
     2
     3 2001/09/27: Thomas Bretz
     4
     5   * mmain/MBrowser.cc:
     6     - added comments
     7
     8   * mmain/MAnalysis.[h,cc]:
     9     - added entry field for cleaning levels
     10
     11
    212
    313 2001/09/26: Thomas Bretz
     
    3545   * mmc/McLinkDef.h:
    3646     - removed nonsens define statement
    37      
    3847
    3948
  • trunk/MagicSoft/Mars/mmain/MAnalysis.cc

    r950 r951  
    2525#include "MAnalysis.h"
    2626
    27 #include <TGButton.h>  // TGTextButton
     27#include <stdlib.h>        // atof
     28#include <iostream.h>
     29
     30#include <TGLabel.h>       // TGlabel
     31#include <TGButton.h>      // TGTextButton
     32#include <TGTextEntry.h>   // TGNumberEntry
    2833
    2934ClassImp(MAnalysis)
    3035
    3136enum {
    32     M_BUTTON_HILLAS,
    33     M_CHECK_DISPLHIL
     37    M_BUTTON_HILLAS
    3438};
    3539
     
    5054void MAnalysis::AddSetupTab()
    5155{
     56    //
     57    // Create Setup Tab
     58    //
    5259    TGCompositeFrame *frame = CreateNewTab("Setup");
    5360
    54     TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5);
    55     fList->Add(laybut);
    56 
    57     fCheckButton1 = new TGCheckButton(frame, "Display Hillas Histograms when finished", M_CHECK_DISPLHIL);
    58     fCheckButton2 = new TGCheckButton(frame, "Display Star Map Histogram when finished", M_CHECK_DISPLHIL);
     61    //
     62    // Align the lines:
     63    //  - top, left
     64    //  - padding: top=20, bottom=0, left=20, right=0
     65    //
     66    TGLayoutHints *layline = new TGLayoutHints(kLHintsNormal, 20, 0, 20);
     67    fList->Add(layline);
     68
     69    //
     70    // Create check buttons for the first two lines
     71    //
     72    fCheckButton1 = new TGCheckButton(frame, "Display Hillas Histograms when finished");  //, M_CHECK_DISPLHIL);
     73    fCheckButton2 = new TGCheckButton(frame, "Display Star Map Histogram when finished"); //, M_CHECK_DISPLHIL);
    5974
    6075    fList->Add(fCheckButton1);
    6176    fList->Add(fCheckButton2);
    6277
    63     frame->AddFrame(fCheckButton1, laybut);
    64     frame->AddFrame(fCheckButton2, laybut);
     78    //
     79    // Create first two lines with the checkbuttons
     80    //
     81    frame->AddFrame(fCheckButton1, layline);
     82    frame->AddFrame(fCheckButton2, layline);
     83
     84    //
     85    // Create entry fields and labels for line 3 and 4
     86    //
     87
     88    /*
     89     * --> use with root >=3.02 <--
     90     *
     91
     92     TGNumberEntry *fNumEntry1 = new TGNumberEntry(frame, 3.0, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative);
     93     TGNumberEntry *fNumEntry2 = new TGNumberEntry(frame, 2.5, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative);
     94
     95     */
     96
     97    //
     98    // Create a frame for line 3 and 4 to be able
     99    // to align entry field and label in one line
     100    //
     101    TGHorizontalFrame *f1 = new TGHorizontalFrame(frame, 0, 0);
     102    TGHorizontalFrame *f2 = new TGHorizontalFrame(frame, 0, 0);
     103
     104    fNumEntry1 = new TGTextEntry(f1, "****");
     105    fNumEntry2 = new TGTextEntry(f2, "****");
     106
     107    // --- doesn't work like expected --- fNumEntry1->SetAlignment(kTextRight);
     108    // --- doesn't work like expected --- fNumEntry2->SetAlignment(kTextRight);
     109
     110    fNumEntry1->SetText("3.0");
     111    fNumEntry2->SetText("2.5");
     112 
     113    fList->Add(fNumEntry1);
     114    fList->Add(fNumEntry2);
     115
     116    TGLabel *l1 = new TGLabel(f1, "Cleaning Level 1 for standard image cleaning.");
     117    TGLabel *l2 = new TGLabel(f2, "Cleaning Level 2 for standard image cleaning.");
     118
     119    l1->SetTextJustify(kTextLeft);
     120    l2->SetTextJustify(kTextLeft);
     121
     122    fList->Add(l1);
     123    fList->Add(l2);
     124
     125    //
     126    // Align the text of the label centered, left in the row
     127    // with a left padding of 10
     128    //
     129    TGLayoutHints *laylabel = new TGLayoutHints(kLHintsCenterY|kLHintsLeft, 10); //, 10); //, 5, 5);
     130    fList->Add(laylabel);
     131
     132    //
     133    // Add one entry field and the corresponding label to each line
     134    //
     135    f1->AddFrame(fNumEntry1);
     136    f2->AddFrame(fNumEntry2);
     137
     138    f1->AddFrame(l1, laylabel);
     139    f2->AddFrame(l2, laylabel);
     140
     141    //
     142    // Add line 3 and 4 to tab
     143    //
     144    frame->AddFrame(f1, layline);
     145    frame->AddFrame(f2, layline);
    65146}
    66147
     
    107188    const Bool_t displstarmap = fCheckButton2->GetState();
    108189
     190    Float_t cleanlvl1 = atof(fNumEntry1->GetText());
     191    Float_t cleanlvl2 = atof(fNumEntry2->GetText());
     192
     193    if (cleanlvl1<0)
     194    {
     195        cleanlvl1=0;
     196        fNumEntry1->SetText("0");
     197    }
     198
     199    if (cleanlvl2<0)
     200    {
     201        cleanlvl2=0;
     202        fNumEntry2->SetText("0");
     203    }
     204
    109205    //
    110206    // Create a empty Parameter List and an empty Task List
     
    160256    MReadTree      read("Events", fInputFile);
    161257    MCerPhotCalc   ncalc;
    162     MImgCleanStd   clean;
     258    MImgCleanStd   clean(cleanlvl1, cleanlvl2);
    163259    MHillasCalc    hcalc;
    164260    MFillH         hfill(&hillas, hists);
     
    193289    if (displstarmap)
    194290        smap->Draw();
     291
     292    cout << "Calculation of Hillas Parameters finished without error!" << endl;
    195293}
    196294
  • trunk/MagicSoft/Mars/mmain/MAnalysis.h

    r950 r951  
    1010#endif
    1111
     12class TGTextEntry;
    1213class TGCheckButton;
    1314
     
    1718    TGCheckButton *fCheckButton1;
    1819    TGCheckButton *fCheckButton2;
     20
     21    TGTextEntry   *fNumEntry1;
     22    TGTextEntry   *fNumEntry2;
    1923
    2024    void CalculateHillas() const;
  • trunk/MagicSoft/Mars/mmain/MBrowser.cc

    r950 r951  
    105105    fDir->Resize(350, 20);
    106106
     107    //
     108    // Get the three picturs from the system (must be deleted by FreePicture)
     109    //
    107110    fPic1 = fClient->GetPicture("tb_uplevel.xpm");
    108111    fPic2 = fClient->GetPicture("tb_list.xpm");
    109112    fPic3 = fClient->GetPicture("tb_details.xpm");
    110113
     114    //
     115    // Create the corresponding picture buttons
     116    //
    111117    fCdup     = new TGPictureButton(frame, fPic1, M_PBUTTON_CDIR_UP);
    112118    fListMode = new TGPictureButton(frame, fPic2, M_PBUTTON_LIST_MODE);
    113119    fDetail   = new TGPictureButton(frame, fPic3, M_PBUTTON_DETAIL_MODE);
    114120
     121    //
     122    // setup the buttons
     123    //
    115124    fCdup    ->SetToolTipText("One Level up!");
    116125    fListMode->SetToolTipText("List Mode");
     
    123132    fDetail  ->AllowStayDown(kTRUE);
    124133
     134    //
     135    // send messages to 'this' object
     136    //
    125137    fDir     ->Associate(this);
    126138    fCdup    ->Associate(this);
     
    128140    fListMode->Associate(this);
    129141
     142    //
     143    // Add to list for 'automatic' deletion
     144    //
    130145    fList->Add(fDir);
    131146    fList->Add(fCdup);
     
    134149
    135150    //
    136     // Layout Dir-Listbox and buttons
    137     //
    138     TGLayoutHints *laydir = new TGLayoutHints(kLHintsTop|kLHintsLeft|kLHintsExpandX, 5, 5, 5, 5);
    139     TGLayoutHints *laybut = new TGLayoutHints(kLHintsLeft|kLHintsTop, 5, 5, 5, 5);
    140 
    141     fList->Add(laydir);
    142     fList->Add(laybut);
    143 
    144     frame->AddFrame(fDir,      laydir);
    145     frame->AddFrame(fCdup,     laybut);
    146     frame->AddFrame(fListMode, laybut);
    147     frame->AddFrame(fDetail,   laybut);
     151    // Layout Dir-Listbox and buttons in one row (frame)
     152    //
     153    //  - layout:
     154    //    alignment: top, left
     155    //    padding:   5, 5, 5, 5
     156    //
     157    TGLayoutHints *layout = new TGLayoutHints(kLHintsNormal, 5, 5, 5, 5);
     158    fList->Add(layout);
     159
     160    frame->AddFrame(fDir,      layout);
     161    frame->AddFrame(fCdup,     layout);
     162    frame->AddFrame(fListMode, layout);
     163    frame->AddFrame(fDetail,   layout);
    148164}
    149165
     
    239255    fInputFile[0] = '\0';
    240256
    241     fList = new TList;
    242257    fList->SetOwner();
    243258
     
    293308    fClient->FreePicture(fPic2);
    294309    fClient->FreePicture(fPic3);
    295 
    296     delete fList;
    297310}
    298311
  • trunk/MagicSoft/Mars/mmain/MBrowser.h

    r950 r951  
    4343
    4444protected:
    45     TList  *fList;
     45    TList  *fList; 
    4646    Char_t  fInputFile[256];
    4747
Note: See TracChangeset for help on using the changeset viewer.