Changeset 951
- Timestamp:
- 09/27/01 12:06:22 (23 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r949 r951 1 1 -*-*- 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 2 12 3 13 2001/09/26: Thomas Bretz … … 35 45 * mmc/McLinkDef.h: 36 46 - removed nonsens define statement 37 38 47 39 48 -
trunk/MagicSoft/Mars/mmain/MAnalysis.cc
r950 r951 25 25 #include "MAnalysis.h" 26 26 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 28 33 29 34 ClassImp(MAnalysis) 30 35 31 36 enum { 32 M_BUTTON_HILLAS, 33 M_CHECK_DISPLHIL 37 M_BUTTON_HILLAS 34 38 }; 35 39 … … 50 54 void MAnalysis::AddSetupTab() 51 55 { 56 // 57 // Create Setup Tab 58 // 52 59 TGCompositeFrame *frame = CreateNewTab("Setup"); 53 60 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); 59 74 60 75 fList->Add(fCheckButton1); 61 76 fList->Add(fCheckButton2); 62 77 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); 65 146 } 66 147 … … 107 188 const Bool_t displstarmap = fCheckButton2->GetState(); 108 189 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 109 205 // 110 206 // Create a empty Parameter List and an empty Task List … … 160 256 MReadTree read("Events", fInputFile); 161 257 MCerPhotCalc ncalc; 162 MImgCleanStd clean ;258 MImgCleanStd clean(cleanlvl1, cleanlvl2); 163 259 MHillasCalc hcalc; 164 260 MFillH hfill(&hillas, hists); … … 193 289 if (displstarmap) 194 290 smap->Draw(); 291 292 cout << "Calculation of Hillas Parameters finished without error!" << endl; 195 293 } 196 294 -
trunk/MagicSoft/Mars/mmain/MAnalysis.h
r950 r951 10 10 #endif 11 11 12 class TGTextEntry; 12 13 class TGCheckButton; 13 14 … … 17 18 TGCheckButton *fCheckButton1; 18 19 TGCheckButton *fCheckButton2; 20 21 TGTextEntry *fNumEntry1; 22 TGTextEntry *fNumEntry2; 19 23 20 24 void CalculateHillas() const; -
trunk/MagicSoft/Mars/mmain/MBrowser.cc
r950 r951 105 105 fDir->Resize(350, 20); 106 106 107 // 108 // Get the three picturs from the system (must be deleted by FreePicture) 109 // 107 110 fPic1 = fClient->GetPicture("tb_uplevel.xpm"); 108 111 fPic2 = fClient->GetPicture("tb_list.xpm"); 109 112 fPic3 = fClient->GetPicture("tb_details.xpm"); 110 113 114 // 115 // Create the corresponding picture buttons 116 // 111 117 fCdup = new TGPictureButton(frame, fPic1, M_PBUTTON_CDIR_UP); 112 118 fListMode = new TGPictureButton(frame, fPic2, M_PBUTTON_LIST_MODE); 113 119 fDetail = new TGPictureButton(frame, fPic3, M_PBUTTON_DETAIL_MODE); 114 120 121 // 122 // setup the buttons 123 // 115 124 fCdup ->SetToolTipText("One Level up!"); 116 125 fListMode->SetToolTipText("List Mode"); … … 123 132 fDetail ->AllowStayDown(kTRUE); 124 133 134 // 135 // send messages to 'this' object 136 // 125 137 fDir ->Associate(this); 126 138 fCdup ->Associate(this); … … 128 140 fListMode->Associate(this); 129 141 142 // 143 // Add to list for 'automatic' deletion 144 // 130 145 fList->Add(fDir); 131 146 fList->Add(fCdup); … … 134 149 135 150 // 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); 148 164 } 149 165 … … 239 255 fInputFile[0] = '\0'; 240 256 241 fList = new TList;242 257 fList->SetOwner(); 243 258 … … 293 308 fClient->FreePicture(fPic2); 294 309 fClient->FreePicture(fPic3); 295 296 delete fList;297 310 } 298 311 -
trunk/MagicSoft/Mars/mmain/MBrowser.h
r950 r951 43 43 44 44 protected: 45 TList *fList; 45 TList *fList; 46 46 Char_t fInputFile[256]; 47 47
Note:
See TracChangeset
for help on using the changeset viewer.