Ignore:
Timestamp:
11/14/01 10:03:20 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mmain
Files:
2 edited

Legend:

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

    r1030 r1076  
    2525#include "MAnalysis.h"
    2626
    27 #include <stdlib.h>        // atof
    2827#include <iostream.h>
    2928
     
    3231#include <TGTextEntry.h>   // TGNumberEntry
    3332
     33#include "MImgCleanStd.h"  // MImgCleanStd
     34
    3435ClassImp(MAnalysis)
    3536
     
    5960    TGCompositeFrame *frame = CreateNewTab("Setup");
    6061
     62    TGGroupFrame *grp = new TGGroupFrame(frame, "Setup Display");
     63    fList->Add(grp);
     64
    6165    //
    6266    // Align the lines:
     
    6468    //  - padding: top=20, bottom=0, left=20, right=0
    6569    //
    66     TGLayoutHints *layline = new TGLayoutHints(kLHintsNormal, 20, 0, 20);
    67     fList->Add(layline);
     70    TGLayoutHints *laybut = new TGLayoutHints(kLHintsNormal, 10, 10, 10);
     71    fList->Add(laybut);
    6872
    6973    //
    7074    // Create check buttons for the first two lines
    7175    //
    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);
     76    fCheckButton1 = new TGCheckButton(grp, "Display Hillas Histograms when finished");  //, M_CHECK_DISPLHIL);
     77    fCheckButton2 = new TGCheckButton(grp, "Display Star Map Histogram when finished"); //, M_CHECK_DISPLHIL);
     78
     79    fList->AddFirst(fCheckButton1);
     80    fList->AddFirst(fCheckButton2);
     81
     82    //
     83    // Create first two lines with the checkbuttons
     84    //
     85    grp->AddFrame(fCheckButton1, laybut);
     86    grp->AddFrame(fCheckButton2, laybut);
     87
     88    TGLayoutHints *laygrp = new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 20, 20, 20);
     89    fList->Add(laygrp);
     90
     91    frame->AddFrame(grp, laygrp);
    7492
    7593    /*
    76      FIXME...
    77 
    78      fList->Add(fCheckButton1);
    79      fList->Add(fCheckButton2);
     94     * Create GUI for image cleaning
    8095     */
    81 
    82     //
    83     // Create first two lines with the checkbuttons
    84     //
    85     frame->AddFrame(fCheckButton1, layline);
    86     frame->AddFrame(fCheckButton2, layline);
    87 
    88     //
    89     // Create entry fields and labels for line 3 and 4
    90     //
    91 
    92     /*
    93      * --> use with root >=3.02 <--
    94      *
    95 
    96      TGNumberEntry *fNumEntry1 = new TGNumberEntry(frame, 3.0, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative);
    97      TGNumberEntry *fNumEntry2 = new TGNumberEntry(frame, 2.5, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative);
    98 
    99      */
    100 
    101     //
    102     // Create a frame for line 3 and 4 to be able
    103     // to align entry field and label in one line
    104     //
    105     TGHorizontalFrame *f1 = new TGHorizontalFrame(frame, 0, 0);
    106     TGHorizontalFrame *f2 = new TGHorizontalFrame(frame, 0, 0);
    107 
    108     fNumEntry1 = new TGTextEntry(f1, "****");
    109     fNumEntry2 = new TGTextEntry(f2, "****");
    110 
    111     // --- doesn't work like expected --- fNumEntry1->SetAlignment(kTextRight);
    112     // --- doesn't work like expected --- fNumEntry2->SetAlignment(kTextRight);
    113 
    114     fNumEntry1->SetText("3.0");
    115     fNumEntry2->SetText("2.5");
    116  
    117     fList->Add(fNumEntry1);
    118     fList->Add(fNumEntry2);
    119 
    120     TGLabel *l1 = new TGLabel(f1, "Cleaning Level 1 for standard image cleaning.");
    121     TGLabel *l2 = new TGLabel(f2, "Cleaning Level 2 for standard image cleaning.");
    122 
    123     l1->SetTextJustify(kTextLeft);
    124     l2->SetTextJustify(kTextLeft);
    125 
    126     fList->Add(l1);
    127     fList->Add(l2);
    128 
    129     //
    130     // Align the text of the label centered, left in the row
    131     // with a left padding of 10
    132     //
    133     TGLayoutHints *laylabel = new TGLayoutHints(kLHintsCenterY|kLHintsLeft, 10); //, 10); //, 5, 5);
    134     fList->Add(laylabel);
    135 
    136     //
    137     // Add one entry field and the corresponding label to each line
    138     //
    139     f1->AddFrame(fNumEntry1);
    140     f2->AddFrame(fNumEntry2);
    141 
    142     f1->AddFrame(l1, laylabel);
    143     f2->AddFrame(l2, laylabel);
    144 
    145     //
    146     // Add line 3 and 4 to tab
    147     //
    148     frame->AddFrame(f1, layline);
    149     frame->AddFrame(f2, layline);
     96    fImgClean = new MImgCleanStd;
     97    fImgClean->CreateGui(frame, laygrp);
     98    fList->Add(fImgClean);
    15099}
    151100
     
    192141    const Bool_t displstarmap = fCheckButton2->GetState();
    193142
    194     Float_t cleanlvl1 = atof(fNumEntry1->GetText());
    195     Float_t cleanlvl2 = atof(fNumEntry2->GetText());
    196 
    197     if (cleanlvl1<0)
    198     {
    199         cleanlvl1=0;
    200         fNumEntry1->SetText("0");
    201     }
    202 
    203     if (cleanlvl2<0)
    204     {
    205         cleanlvl2=0;
    206         fNumEntry2->SetText("0");
    207     }
    208 
    209143    //
    210144    // Create a empty Parameter List and an empty Task List
     
    245179
    246180    MCerPhotCalc ncalc;
    247     MImgCleanStd clean(cleanlvl1, cleanlvl2);
    248181    MHillasCalc  hcalc;
    249182
    250183    tlist.AddToList(&read);
    251184    tlist.AddToList(&ncalc);
    252     tlist.AddToList(&clean);
     185    tlist.AddToList(fImgClean);
    253186    tlist.AddToList(&hcalc);
    254187
  • trunk/MagicSoft/Mars/mmain/MAnalysis.h

    r1021 r1076  
    99class TGCheckButton;
    1010
     11class MImgCleanStd;
     12
    1113class MAnalysis : public MBrowser
    1214{
     
    1517    TGCheckButton *fCheckButton2;
    1618
    17     TGTextEntry   *fNumEntry1;
    18     TGTextEntry   *fNumEntry2;
     19//    TGTextEntry   *fNumEntry1;
     20//    TGTextEntry   *fNumEntry2;
     21
     22    MImgCleanStd  *fImgClean;
    1923
    2024    void CalculateHillas();
Note: See TracChangeset for help on using the changeset viewer.