Changeset 1086
- Timestamp:
- 11/16/01 15:59:05 (23 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1077 r1086 1 1 -*-*- END -*-*- 2 3 2001/11/16: Thomas Bretz 4 5 * mbase/MEvtLoop.cc: 6 - removed clock.Print() 7 8 * mbase/MGList.[cc,h]: 9 - added support for TGPictures 10 11 * mbase/MReadTree.[h,cc]: 12 - set ReadyToSave-bit only if reading was successfull 13 - made SetReadyToSave private 14 15 * mbase/MTaskList.cc: 16 - corrected a small bug in the output 17 18 * mbase/MWriteRootFile.cc: 19 - added a workaround in Print (don't know why it fails for me) 20 - removed fTrees.SetOwner() 21 22 * mbase/MTask.cc: 23 - removed include of TOrdCollection, TMethod 24 - some changes to the output 25 26 * mbase/MParContainer.h: 27 - removed old comments 28 29 * mmain/MAnalysis.cc, mmain/MCameraDisplay.cc, mmain/MDataCheck.cc, 30 mmain/MEvtDisp.cc, mmain/MMonteCarlo.cc: 31 - changed Widget IDs to root style enums 32 - moved enumerations in the range below 0x100 33 34 * mmain/MBrowser.[h,cc]: 35 - removed some of the member variables, accessed via MGList now 36 - changed TList to MGList 37 - added a file-filter combo-box 38 39 * mars.cc: 40 - changed output 41 42 43 44 2001/11/15: Thomas Bretz 45 46 * mbase/MArray.cc, mbase/MArrayB.cc,mbase/MArrayS.cc, 47 mbase/MClone.cc, mbase/MEvtLoop.cc, mbase/MFilter.cc, 48 mbase/MFilterList.cc, mbase/MGGroupFrame.cc, mbase/MGList.cc, 49 mbase/MGTask.cc, mbase/MInputStreamID.cc, mbase/MLog.cc, 50 mbase/MLogManip.cc, mbase/MParContainer.cc, mbase/MParList.cc, 51 mbase/MPrint.cc, mbase/MReadMarsFile.cc, mbase/MReadTree.cc, 52 mbase/MTime.cc, mbase/MWriteAsciiFile.cc, mbase/MWriteFile.cc, 53 mbase/MWriteRootFile.cc, manalysis/MCT1ReadAscii.cc, 54 manalysis/MCerPhotCalc.cc, manalysis/MHillas.cc, 55 manalysis/MHillasCalc.cc, manalysis/MMcPedestalCopy.cc, 56 manalysis/MPedCalcPedRun.cc, manalysis/MPedestalCam.cc, 57 manalysis/MPedestalPix.cc, manalysis/MCerPhotEvt.cc, 58 manalysis/MCerPhotPix.cc, manalysis/MImgCleanStd.cc, 59 manalysis/MImgCleanStd.cc, mdatacheck/MDumlEvtHeader.cc, 60 mdatacheck/MGDisplayAdc.cc, meventdisp/MGCamDisplay.cc, 61 meventdisp/MGEvtDisplay.cc, meventdisp/MGFadcDisp.cc, 62 mfilter/MFTriggerLvl1.cc, mgui/MGeomCam.cc, mgui/MGeomCamMagic.cc, 63 mgui/MGeomCamCT1.cc, mgui/MgeomPix.cc, mgui/Mhexagon.cc, 64 hist/MFillH.cc, mhist/MH.cc, mhist/MHFadcCam.cc, mhist/MHFadcPix.cc, 65 hist/MHHillas.cc, mhist/MHMcCollectionArea.cc, mhist/MHMcEnergy.cc, 66 mhist/MHMcRate.cc, mhist/MHStarMap.cc, mmain/MAnalysis.cc, 67 mmain/MBrowser.cc, mmain/MCameraDisplay.cc, mmain/MDataCheck.cc, 68 mmain/MEvtDisp.cc, mmain/MMars.cc, mmain/MMonteCarlo.cc, 69 mmontcarlo/MMcCollectionAreaCalc.cc, mmontecarlo/MMcThresholdCalc.cc, 70 mmontecarlo/MMcTriggerRateCalc.cc, mraw/MrawCrateArray.cc, 71 mraw/MRawCrateData.cc, mraw/MRawEvtData.cc, mraw/MRawEvtHeader.cc 72 mraw/MRawEvtPixelIter.cc, mraw/MRawEvtFileRead.cc, 73 mraw/MRawEvtFileWrite.cc, mraw/MRawEvtRunHeader.cc 74 - changed mailing address of author according to THtml of root 3.02 75 76 * mbase/MClone.cc, mbase/MEvtLoop.cc, mbase/MFilterList.cc, 77 mbase/MGTask.cc, mbase/MParContainer.cc, mbase/MParList.cc, 78 mbase/MPrint.cc, mbase/MReadMarsFile.cc, mbase/MReadTree.cc, 79 mbase/MWriteAsciiFile.cc, mbase/MWriteFile.cc, 80 mbase/MWriteRootFile.cc, manalysis/MCerPhotEvt.cc, 81 manalysis/MCerPhotPix.cc, manalysis/MImgCleanStd.cc, 82 mgui/MGeomCam.cc, mgui/MGeomCamMagic.cc, mgui/MGeomCamCT1.cc, 83 mgui/MgeomPix.cc, mgui/Mhexagon.cc, hist/MFillH.cc, mhist/MHMcEnergy.cc, 84 mhist/MHMcRate.cc, mmontcarlo/MMcCollectionAreaCalc.cc, 85 mmontecarlo/MMcThresholdCalc.cc, mmontecarlo/MMcTriggerRateCalc.cc 86 mraw/MRawCrateData.cc, mraw/MRawEvtData.cc, mraw/MRawEvtHeader.cc 87 mraw/MRawEvtPixelIter.cc, mraw/MRawEvtFileRead.cc, 88 mraw/MRawEvtFileWrite.cc, mraw/MRawEvtRunHeader.cc 89 - changed output to new style logging (verbosity level introduced) 90 91 * mbase/MGTask.h: 92 - added default to CreateGui 93 94 * mbase/MLog.cc 95 - chnaged comparision between output and debug level from >= to > 96 97 * mbase/MLogManip.h: 98 - added defintions for debug levels 99 100 * mbase/MReadTree.[h,cc]: 101 - added support for filters 102 - SetReadyToSave added 103 - Print added 104 105 * mbase/MTaskList.[h,cc], MTask.[h,cc]: 106 - changed TOrCollection to TList, because TList can be stored in a 107 root file. 108 109 * mbase/MTask.[h,cc]: 110 - added GetFilter function (used in MReadTree) 111 112 * manalysis/MImgCleanStd.cc: 113 - same changed to the GUI layout 114 - added Print member function 115 116 * meventdisp/MGCamDisplay.cc: 117 - added group frame around some gui elements 118 119 * mfilter/MFTriggerLvl1.cc: 120 - fixed missing Init call 121 - added missing AddToBranchList call 122 123 * mars.cc: 124 - added command line option to set the verbosity level 125 126 * merpp.cc: 127 - added setup for highest verbosity level 128 129 130 2 131 2001/11/14: Thomas Bretz 3 132 -
trunk/MagicSoft/Mars/NEWS
r1033 r1086 1 1 -*-*- END -*-*- 2 2 3 *** Version 0.5 3 *** Version 0.6 4 5 - Introduced verbosity levels 6 7 - Introduced a task (MReadMarsFile) which reads the RunHeader tree, too. 8 9 - Fixed several bugs in MFTriggerLvl1 which caused to filter not to 10 work correctly (thanks to Abelardo) 11 12 13 14 *** Version 0.5 (2001/11/06) 4 15 5 16 - Added new GUI functionality (Analysis) -
trunk/MagicSoft/Mars/mars.cc
r1082 r1086 32 32 int main(int argc, char **argv ) 33 33 { 34 gLog << all ;34 gLog << all << endl; 35 35 36 36 // 1 2 3 4 5 37 37 // 12345678901234567890123456789012345678901234567890 38 38 gLog << "==================================================" << endl; 39 gLog << " MARS v0.5" << endl;39 gLog << " MARS V0.6 " << endl; 40 40 gLog << " Magic Analysis and Reconstruction Software " << endl; 41 41 gLog << " Compiled on <" << __DATE__ << ">" << endl; … … 106 106 app.Run(); 107 107 108 gLog << all << endl; 109 108 110 return 0; 109 111 } -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r1080 r1086 221 221 *fLog << all << "Ready!" << endl << endl; 222 222 223 clock.Print();224 225 223 *fLog << dec << endl << "CPU - " 226 224 << "Time: " << clock.CpuTime() << "s" -
trunk/MagicSoft/Mars/mbase/MGList.cc
r1080 r1086 38 38 39 39 #include <TClass.h> 40 #include <TGClient.h> 40 41 #include <TGWidget.h> 42 #include <TGPicture.h> 41 43 42 44 43 45 ClassImp(MGList); 46 47 // -------------------------------------------------------------------------- 48 // 49 // Before destroying the list with all its contents free all TGPicture 50 // objects in the list. 51 // 52 #include <TRefCnt.h> 53 54 MGList::~MGList() 55 { 56 TObject *obj; 57 TIter Next(this); 58 while ((obj=Next())) 59 { 60 if (!obj->InheritsFrom(TGPicture::Class())) 61 continue; 62 63 // 64 // Remove the object first. Otherwise we would remove 65 // a non existing object... 66 // 67 Remove(obj); 68 gClient->FreePicture((TGPicture*)obj); 69 } 70 } 44 71 45 72 // -------------------------------------------------------------------------- … … 137 164 // -------------------------------------------------------------------------- 138 165 // 166 // Adds the picture physically to the list. The list takes care of that 167 // - The picture is freed as often as it was retrieved from gClient 168 // 169 void MGList::AddPicture(const TGPicture *pic) 170 { 171 // 172 // Check whether the picture exists 173 // 174 if (!pic) 175 { 176 cout << "Warning: Requested picture not found... ignored." << endl; 177 return; 178 } 179 180 // 181 // Add the picture to the list 182 // 183 TList::Add(const_cast<TGPicture*>(pic)); 184 } 185 186 // -------------------------------------------------------------------------- 187 // 188 // This gets a picture from the picture pool of the TGClient-object. 189 // The pictures are freed automatically in the dstructor of the list. 190 // The picture counts itself how often it got used, so that only 191 // the first call to GetPicture will craete it and the last call to 192 // FreePicture will destroy it. If you access the picture only via 193 // MGList::GetPicture you don't have to care about. 194 // 195 // Don't try to call FreePicture by yourself for a picture gotten by 196 // GetPicture. This is independant of the kIsOwner bit. 197 // 198 const TGPicture *MGList::GetPicture(const char *name) 199 { 200 const TGPicture *pic = gClient->GetPicture(name); 201 AddPicture(pic); 202 return pic; 203 } 204 205 // -------------------------------------------------------------------------- 206 // 207 // This gets a picture from the picture pool of the TGClient-object. 208 // The pictures are freed automatically in the dstructor of the list. 209 // The picture counts itself how often it got used, so that only 210 // the first call to GetPicture will craete it and the last call to 211 // FreePicture will destroy it. If you access the picture only via 212 // MGList::GetPicture you don't have to care about. 213 // 214 // Don't try to call FreePicture by yourself for a picture gotten by 215 // GetPicture. This is independant of the kIsOwner bit. 216 // 217 const TGPicture *MGList::GetPicture(const char *name, Int_t width, Int_t height) 218 { 219 const TGPicture *pic = gClient->GetPicture(name, width, height); 220 AddPicture(pic); 221 return pic; 222 } 223 // -------------------------------------------------------------------------- 224 // 139 225 // Search the list for a object derived from TGidget which has the given 140 226 // widget id. Returns a pointer to this object otherwise NULL. -
trunk/MagicSoft/Mars/mbase/MGList.h
r1076 r1086 7 7 8 8 class TGWidget; 9 class TGPicture; 9 10 10 11 class MGList : public TList … … 14 15 Bool_t IsExisting(TObject *obj) const; 15 16 17 void AddPicture(const TGPicture *pic); 18 16 19 public: 17 20 MGList() : TList() {} 21 virtual ~MGList(); 18 22 19 23 void Add(TObject *obj); 20 24 void Add(TObject *obj, Option_t *opt); 21 25 26 const TGPicture *GetPicture(const char *name); 27 const TGPicture *GetPicture(const char *name, Int_t width, Int_t height); 22 28 23 29 TObject *FindWidget(Int_t id) const; -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r1077 r1086 22 22 class ofstream; 23 23 class ifstream; 24 /*25 class MParContainer : public TObject26 {27 private:28 void Init(const char *name, const char *title)29 {30 fName = new TString;31 (*fName) = name;32 fTitle = new TString;33 (*fTitle) = title;34 35 cout << " <***> " << flush;36 }37 38 protected:39 MLog *fLog; //! The general log facility for this object, initialized with the global object40 41 TString *fName; //! parameter container identifier (name)42 TString *fTitle; //! parameter container title43 44 Bool_t fReadyToSave; //! should be set to true if the contents of the container is changed somehow45 46 public:47 MParContainer(const char *name="", const char *title="") : fLog(&gLog), fReadyToSave(kFALSE) { Init(name, title); }48 MParContainer(const TString &name, const TString &title) : fLog(&gLog), fReadyToSave(kFALSE) { Init(name, title); }49 MParContainer(const MParContainer &named);50 MParContainer& operator=(const MParContainer& rhs);51 52 void SetLogStream(MLog *lg) { fLog = lg; }53 54 virtual ~MParContainer() {55 //delete fName; delete fTitle;56 }57 virtual TObject *Clone(const char *newname) const;58 virtual Int_t Compare(const TObject *obj) const;59 virtual void Copy(TObject &named);60 virtual void FillBuffer(char *&buffer);61 virtual const char *GetName() const {return fName->Data();}62 virtual const char *GetTitle() const {return fTitle->Data();}63 virtual ULong_t Hash() { return fName->Hash(); }64 virtual Bool_t IsSortable() const { return kTRUE; }65 virtual void SetName(const char *name); // *MENU*66 virtual void SetObject(const char *name, const char *title);67 virtual void SetTitle(const char *title=""); // *MENU*68 virtual void ls(Option_t *option="") const;69 virtual void Print(Option_t *option="") const;70 virtual Int_t Sizeof() const;71 72 virtual void Reset() {};73 74 virtual Bool_t IsReadyToSave() { return fReadyToSave; }75 virtual void SetReadyToSave(Bool_t flag=kTRUE) { fReadyToSave=flag; }76 77 virtual void AsciiRead(ifstream &fin);78 virtual void AsciiWrite(ofstream &fout) const;79 80 ClassDef(MParContainer, 0) //The basis for all parameter containers81 };82 */83 24 84 25 class MParContainer : public TObject -
trunk/MagicSoft/Mars/mbase/MReadTree.h
r1084 r1086 24 24 TList *fNotify; // List of TObjects to notify when switching files 25 25 26 TGProgressBar *fProgress; //Possible display of status26 TGProgressBar *fProgress; //! Possible display of status 27 27 28 28 void SetBranchStatus(const TList *list, Bool_t status); … … 32 32 void EnableBranches(MParList *plist); 33 33 void EnableBranchChoosing(); 34 35 virtual void SetReadyToSave(Bool_t flag=kTRUE); 34 36 35 37 enum { kIsOwner = BIT(14) }; … … 58 60 virtual void AddNotify(TObject *obj); 59 61 virtual void SetOwner(Bool_t flag=kTRUE); 60 virtual void SetReadyToSave(Bool_t flag=kTRUE);61 62 virtual void Print(Option_t *opt="") const; 62 63 -
trunk/MagicSoft/Mars/mbase/MTask.cc
r1084 r1086 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@uni-sw.gwdg.de> 19 19 ! 20 20 ! Copyright: MAGIC Software Development, 2000-2001 … … 67 67 #include "MTask.h" 68 68 69 #include <TMethod.h>70 #include <TOrdCollection.h>71 72 69 #include "MLog.h" 73 70 #include "MLogManip.h" … … 227 224 void MTask::PrintStatistics(const Int_t lvl) const 228 225 { 229 *fLog << setw(lvl) << " " << GetDescriptor() << "\t";226 *fLog << all << setw(lvl) << " " << GetDescriptor() << "\t"; 230 227 *fLog << dec << fNumExecutions << endl; 231 228 } -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r1084 r1086 240 240 } 241 241 242 *fLog << endl;242 *fLog << all << endl; 243 243 244 244 return kTRUE; -
trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc
r1080 r1086 72 72 // 73 73 fBranches.SetOwner(); 74 fTrees.SetOwner(); 74 75 // 76 // Believing the root user guide, TTree instanced are owned by the 77 // directory (file) in which they are. This means we don't have to 78 // care about their destruction. 79 // 80 //fTrees.SetOwner(); 75 81 76 82 // … … 118 124 void MWriteRootFile::Print(Option_t *) const 119 125 { 120 cout << all << " File: " << GetFileName() << endl; 121 cout << setfill('-') << setw(strlen(GetFileName())+8) << "" << endl; 122 123 TTree *t; 126 *fLog << all << " File: " << GetFileName() << endl; 127 *fLog << setfill('-') << setw(strlen(GetFileName())+8) << "" << endl; 128 *fLog << setfill(' '); // FIXME: not resetting setfill results in strange output??? 129 130 TTree *t = NULL; 124 131 TIter Next(&fTrees); 125 132 while ((t=(TTree*)Next())) 126 cout<< t->GetName() << ": \t" << t->GetEntries() << " entries." << endl;133 *fLog << t->GetName() << ": \t" << t->GetEntries() << " entries." << endl; 127 134 } 128 135 -
trunk/MagicSoft/Mars/mmain/MAnalysis.cc
r1082 r1086 31 31 #include <TGTextEntry.h> // TGNumberEntry 32 32 33 #include "MGList.h" 33 34 #include "MImgCleanStd.h" // MImgCleanStd 34 35 … … 36 37 37 38 enum { 38 kButHillas 39 kButHillas = 0x100 39 40 }; 40 41 -
trunk/MagicSoft/Mars/mmain/MBrowser.cc
r1082 r1086 26 26 #include "MBrowser.h" 27 27 28 #include <iostream.h> 29 #include <sys/stat.h> // S_ISDIR 30 28 31 #include <TSystem.h> // gSystem 29 32 30 33 #include <TGTab.h> // TGTab 31 34 #include <TGMenu.h> // TGPopupMenu 35 #include <TG3DLine.h> // TGHorizontal3DLine 32 36 #include <TGButton.h> // TGTextButton 33 37 #include <TGMsgBox.h> // TGMsgBox 34 38 #include <TBrowser.h> // TBrowser 35 #include <TGListBox.h> // TGListBox36 39 #include <TGTextEntry.h> // TGTextEntry 37 40 #include <TGFSComboBox.h> // TGFSComboBox, TGFSLboxEntry … … 39 42 #include <TGFSContainer.h> // TGFileContainer 40 43 41 #include <TG3DLine.h> // TGHorizontal3DLine 42 // use TGSplitter.h for root<3.00 43 44 #include <sys/stat.h> // S_ISDIR 45 46 #include <iostream.h> 44 #include "MGList.h" 47 45 48 46 ClassImp(MBrowser); … … 55 53 kButDetailMode, 56 54 kCBDirectory, 55 kCBFilter, 57 56 kTEFileName 58 57 }; … … 116 115 // Create Dir-Listbox and buttons in first frame 117 116 // 118 fDir = new TGFSComboBox(frame, kCBDirectory);119 fDir->Resize(350, 20);117 TGFSComboBox *dir = new TGFSComboBox(frame, kCBDirectory); 118 dir->SetHeight(fEntry->GetHeight()); 120 119 121 120 // 122 121 // Get the three picturs from the system (must be deleted by FreePicture) 123 122 // 124 fPic1 = fClient->GetPicture("tb_uplevel.xpm");125 fPic2 = fClient->GetPicture("tb_list.xpm");126 fPic3 = fClient->GetPicture("tb_details.xpm");123 const TGPicture *pic1 = fList->GetPicture("tb_uplevel.xpm"); 124 const TGPicture *pic2 = fList->GetPicture("tb_list.xpm"); 125 const TGPicture *pic3 = fList->GetPicture("tb_details.xpm"); 127 126 128 127 // 129 128 // Create the corresponding picture buttons 130 129 // 131 fCdup = new TGPictureButton(frame, fPic1, kButDirUp);132 fListMode = new TGPictureButton(frame, fPic2, kButListMode);133 fDetail = new TGPictureButton(frame, fPic3, kButDetailMode);130 TGPictureButton *cdup = new TGPictureButton(frame, pic1, kButDirUp); 131 TGPictureButton *list = new TGPictureButton(frame, pic2, kButListMode); 132 TGPictureButton *detail = new TGPictureButton(frame, pic3, kButDetailMode); 134 133 135 134 // 136 135 // setup the buttons 137 136 // 138 fCdup->SetToolTipText("One Level up!");139 fListMode->SetToolTipText("List Mode");140 fDetail->SetToolTipText("Details Mode");141 142 fListMode->SetState(kButtonUp);143 fDetail->SetState(kButtonEngaged);144 145 fListMode->AllowStayDown(kTRUE);146 fDetail->AllowStayDown(kTRUE);137 cdup ->SetToolTipText("One Level up!"); 138 list ->SetToolTipText("List Mode"); 139 detail->SetToolTipText("Details Mode"); 140 141 list ->SetState(kButtonUp); 142 detail->SetState(kButtonEngaged); 143 144 list ->AllowStayDown(kTRUE); 145 detail->AllowStayDown(kTRUE); 147 146 148 147 // 149 148 // send messages to 'this' object 150 149 // 151 fDir->Associate(this);152 fCdup->Associate(this);153 fDetail->Associate(this);154 fListMode->Associate(this);150 dir ->Associate(this); 151 cdup ->Associate(this); 152 detail->Associate(this); 153 list ->Associate(this); 155 154 156 155 // 157 156 // Add to list for 'automatic' deletion 158 157 // 159 fList->Add( fDir);160 fList->Add( fCdup);161 fList->Add( fListMode);162 fList->Add( fDetail);158 fList->Add(dir); 159 fList->Add(cdup); 160 fList->Add(list); 161 fList->Add(detail); 163 162 164 163 // … … 175 174 fList->Add(layout); 176 175 177 frame->AddFrame( fDir,laydir);178 frame->AddFrame( fListMode,layout);179 frame->AddFrame( fDetail,layout);180 frame->AddFrame( fCdup,layout);176 frame->AddFrame(dir, laydir); 177 frame->AddFrame(list, layout); 178 frame->AddFrame(detail, layout); 179 frame->AddFrame(cdup, layout); 181 180 } 182 181 … … 198 197 fFileView->SetViewMode(kLVDetails); 199 198 200 fFileCont->SetFilter("* ");199 fFileCont->SetFilter("*.root"); 201 200 fFileCont->Associate(this); 202 201 fFileCont->Sort(kSortByName); … … 210 209 void MBrowser::CreateTab1() 211 210 { 211 static const char *filters[] = 212 { 213 "*.root <root-files>", 214 "* <All Files>", 215 NULL 216 }; 217 212 218 TGCompositeFrame *frame = CreateNewTab("Input File"); 213 219 … … 215 221 // Create three frames for the first tab 216 222 // 217 TGHorizontalFrame *tab1a = new TGHorizontalFrame(frame, 100, 100); 218 TGHorizontalFrame *tab1b = new TGHorizontalFrame(frame, 100, 100); 219 TGVerticalFrame *tab2 = new TGVerticalFrame (frame, 100, 100); 220 221 TGLayoutHints *laytab1 = new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 10, 10, 10); 222 TGLayoutHints *laytab2 = new TGLayoutHints(kLHintsExpandX|kLHintsExpandY, 10, 10, 10, 10); 223 TGLayoutHints *layentry = new TGLayoutHints(kLHintsNormal|kLHintsExpandX); //, 5, 5, 5); 224 225 frame->AddFrame(tab1a, laytab1); 226 frame->AddFrame(tab1b, laytab1); 227 frame->AddFrame(tab2, laytab2); 228 229 fEntry = new TGTextEntry(tab1a, "", kTEFileName); 230 fEntry->Resize(350, 20); 223 TGHorizontalFrame *tab1 = new TGHorizontalFrame(frame, 100, 100); 224 TGVerticalFrame *tab2 = new TGVerticalFrame (frame, 100, 100); 225 226 TGLayoutHints *laytab1 = new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 10, 10, 10); 227 TGLayoutHints *laytab2 = new TGLayoutHints(kLHintsExpandX|kLHintsExpandY, 10, 10, 10, 10); 228 TGLayoutHints *layfilter = new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 10, 10, 10); 229 230 fEntry = new TGTextEntry(frame, "", kTEFileName); 231 231 fEntry->Associate(this); 232 tab1a->AddFrame(fEntry, layentry); 233 234 CreateDirListMenu(tab1b); 232 233 TGComboBox *filter = new TGComboBox(frame, kCBFilter); 234 filter->SetHeight(fEntry->GetHeight()); 235 filter->Associate(this); 236 for (int i=0; filters[i]; i++) 237 filter->AddEntry(filters[i], i); 238 filter->Select(0); 239 240 frame->AddFrame(fEntry, laytab1); 241 frame->AddFrame(tab1, laytab1); 242 frame->AddFrame(filter, layfilter); 243 frame->AddFrame(tab2, laytab2); 244 245 CreateDirListMenu(tab1); 235 246 CreateDirListBox(tab2); 236 247 237 248 fList->Add(laytab1); 238 249 fList->Add(laytab2); 239 fList->Add(tab1a); 240 fList->Add(tab1b); 250 fList->Add(tab1); 241 251 fList->Add(tab2); 242 fList->Add(lay entry);252 fList->Add(layfilter); 243 253 fList->Add(fEntry); 254 fList->Add(filter); 244 255 } 245 256 … … 279 290 fInputFile[0] = '\0'; 280 291 281 fList = new TList;292 fList = new MGList; 282 293 fList->SetOwner(); 283 294 … … 331 342 MBrowser::~MBrowser() 332 343 { 333 fClient->FreePicture(fPic1);334 fClient->FreePicture(fPic2);335 fClient->FreePicture(fPic3);336 337 344 delete fList; 338 345 } … … 412 419 413 420 const char *dir = fFileCont->GetDirectory(); 414 fDir->Update(dir); 421 422 TGFSComboBox *cbox = (TGFSComboBox*)fList->FindWidget(kCBDirectory); 423 if (cbox) 424 cbox->Update(dir); 415 425 } 416 426 … … 454 464 *slash = '\0'; 455 465 ChangeDir(fname); 466 } 467 468 void MBrowser::SetDir() 469 { 470 TGFSComboBox *cbox = (TGFSComboBox*)fList->FindWidget(kCBDirectory); 471 if(!cbox) 472 return; 473 474 const TGTreeLBEntry *entry = (TGTreeLBEntry*)cbox->GetSelectedEntry(); 475 476 ChangeDir(entry->GetPath()->GetString()); 477 } 478 479 void MBrowser::SetFilter() 480 { 481 // 482 // Try to get widget from list 483 // 484 TGComboBox *filter = (TGComboBox*)fList->FindWidget(kCBFilter); 485 if (!filter) 486 return; 487 488 // 489 // Get the selected text from the list box 490 // 491 const TGTextLBEntry *selected = (TGTextLBEntry*)filter->GetListBox()->GetSelectedEntry(); 492 493 const char *txt = StrDup(selected->GetText()->GetString()); 494 495 // 496 // find filter and remove leading spaces 497 // 498 char *lt = strchr(txt, '<'); 499 if (lt) 500 { 501 do *lt-- = '\0'; 502 while (lt>txt && *lt==' '); 503 504 // 505 // Set new filter and refresh the file container 506 // 507 fFileCont->SetFilter(txt); 508 fFileCont->DisplayDirectory(); 509 } 510 511 delete [] txt; 512 } 513 514 void MBrowser::SetViewMode(const Int_t mode) 515 { 516 fFileView->SetViewMode(mode ? kLVList : kLVDetails); 517 518 TGButton *but = (TGButton*)fList->FindWidget(mode); 519 if(!but) 520 return; 521 522 but->SetState(kButtonUp); 456 523 } 457 524 … … 498 565 499 566 case kButListMode: 500 fFileView->SetViewMode(kLVList);501 fDetail->SetState(kButtonUp);502 return kTRUE;503 504 567 case kButDetailMode: 505 fFileView->SetViewMode(kLVDetails); 506 fListMode->SetState(kButtonUp); 568 SetViewMode(parm1); 507 569 return kTRUE; 508 570 } … … 510 572 511 573 case kCM_COMBOBOX: 512 if (parm1 != kCBDirectory) 513 return kTRUE; 514 515 ChangeDir(((TGTreeLBEntry*)fDir->GetSelectedEntry())->GetPath()->GetString()); 574 switch (parm1) 575 { 576 case kCBDirectory: 577 SetDir(); 578 return kTRUE; 579 case kCBFilter: 580 SetFilter(); 581 return kTRUE; 582 } 516 583 return kTRUE; 517 584 } -
trunk/MagicSoft/Mars/mmain/MBrowser.h
r1050 r1086 10 10 #endif 11 11 12 class TList;12 class MGList; 13 13 class TGTab; 14 14 class TGListView; … … 24 24 TGTab *fTabs; 25 25 26 TGFSComboBox *fDir;27 26 TGTextEntry *fEntry; 28 29 TGPictureButton *fCdup;30 TGPictureButton *fListMode;31 TGPictureButton *fDetail;32 27 33 28 TGFileContainer *fFileCont; 34 29 TGListView *fFileView; 35 36 const TGPicture *fPic1;37 const TGPicture *fPic2;38 const TGPicture *fPic3;39 30 40 31 void CreateMenuBar(); … … 47 38 void SetFileName(const char *name); 48 39 40 void SetFilter(); 41 void SetDir(); 42 void SetViewMode(const Int_t mode); 43 49 44 protected: 50 TList *fList;45 MGList *fList; 51 46 Char_t fInputFile[256]; 52 47 -
trunk/MagicSoft/Mars/mmain/MCameraDisplay.cc
r1082 r1086 28 28 #include <TGButton.h> // TGTextButton 29 29 30 #include "MGList.h" 30 31 #include "MGCamDisplay.h" 31 32 … … 33 34 34 35 enum { 35 M_BUTTON_DISP36 kButDisplay = 0x100 36 37 }; 37 38 … … 46 47 : MBrowser(main, p, w, h) 47 48 { 48 TGTextButton *disp = new TGTextButton(fTop2, "Display Events", M_BUTTON_DISP);49 TGTextButton *disp = new TGTextButton(fTop2, "Display Events", kButDisplay); 49 50 fList->Add(disp); 50 51 … … 79 80 switch (parm1) 80 81 { 81 case M_BUTTON_DISP:82 case kButDisplay: 82 83 if (!InputFileSelected()) 83 84 { … … 88 89 switch (parm1) 89 90 { 90 case M_BUTTON_DISP:91 case kButDisplay: 91 92 new MGCamDisplay(fInputFile, 92 93 fClient->GetRoot(), this, 600, 500); -
trunk/MagicSoft/Mars/mmain/MDataCheck.cc
r1082 r1086 28 28 #include <TGButton.h> // TGTextButton 29 29 30 #include "MGList.h" 31 #include "MFillH.h" 30 32 #include "MParList.h" 31 33 #include "MTaskList.h" 32 34 #include "MEvtLoop.h" 33 35 #include "MReadTree.h" 34 #include "MFillH.h"35 36 #include "MGDisplayAdc.h" 36 37 … … 40 41 41 42 enum { 42 kButPedAdc ,43 kButEvtAdc ,44 kButPedTdc ,45 kButEvtTdc 43 kButPedAdc = 0x100, 44 kButEvtAdc = 0x101, 45 kButPedTdc = 0x102, 46 kButEvtTdc = 0x103 46 47 }; 47 48 -
trunk/MagicSoft/Mars/mmain/MEvtDisp.cc
r1082 r1086 28 28 #include <TGButton.h> // TGTextButton 29 29 30 #include "MGList.h" 30 31 #include "MGFadcDisp.h" 31 32 … … 33 34 34 35 enum { 35 M_BUT_DISP1_EVT,36 M_BUT_DISP1_PED,37 M_BUT_DISP1_CAL36 kButDispEvt = 0x100, 37 kButDispPedestal = 0x101, 38 kButDispCalibration = 0x102 38 39 }; 39 40 … … 42 43 : MBrowser(main, p, w, h) 43 44 { 44 TGTextButton *fadcevt = new TGTextButton(fTop1, "FADC Disp for Events", M_BUT_DISP1_EVT);45 TGTextButton *fadcped = new TGTextButton(fTop1, "FADC Disp for PedEvts", M_BUT_DISP1_PED);46 TGTextButton *fadccal = new TGTextButton(fTop1, "FADC Disp for CalEvts", M_BUT_DISP1_CAL);45 TGTextButton *fadcevt = new TGTextButton(fTop1, "FADC Disp for Events", kButDispEvt); 46 TGTextButton *fadcped = new TGTextButton(fTop1, "FADC Disp for PedEvts", kButDispPedestal); 47 TGTextButton *fadccal = new TGTextButton(fTop1, "FADC Disp for CalEvts", kButDispCalibration); 47 48 48 49 fadcevt->Associate(this); … … 82 83 switch (parm1) 83 84 { 84 case M_BUT_DISP1_EVT:85 case M_BUT_DISP1_PED:86 case M_BUT_DISP1_CAL:85 case kButDispEvt: 86 case kButDispPedestal: 87 case kButDispCalibration: 87 88 if (!InputFileSelected()) 88 89 { … … 93 94 switch (parm1) 94 95 { 95 case M_BUT_DISP1_EVT:96 case kButDispEvt: 96 97 new MGFadcDisp(fInputFile, "Events", 97 98 fClient->GetRoot(), this, 600, 500); 98 99 return kTRUE; 99 100 100 case M_BUT_DISP1_PED:101 case kButDispPedestal: 101 102 new MGFadcDisp(fInputFile , "PedEvts", 102 103 fClient->GetRoot(), this, 600, 500); 103 104 return kTRUE; 104 105 105 case M_BUT_DISP1_CAL:106 case kButDispCalibration: 106 107 new MGFadcDisp(fInputFile , "CalEvts", 107 108 fClient->GetRoot(), this, 600, 500); -
trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc
r1082 r1086 35 35 #include <TGButtonGroup.h> // TGVButtonGroup 36 36 37 #include "MGList.h" 38 37 39 ClassImp(MMonteCarlo) 38 40 39 41 enum { 40 M_BUTTON_COLAREA,41 M_BUTTON_RATE,42 M_BUTTON_THRESHOLD42 kButCollArea = 0x100, 43 kButTrigRate = 0x101, 44 kButThreshold = 0x102 43 45 }; 44 46 45 47 void MMonteCarlo::AddButtons() 46 48 { 47 TGTextButton *carea = new TGTextButton(fTop2, "Collection Area", M_BUTTON_COLAREA);48 TGTextButton *trate = new TGTextButton(fTop2, "Trigger Rate", M_BUTTON_RATE);49 TGTextButton *thold = new TGTextButton(fTop2, "Threshold", M_BUTTON_THRESHOLD);49 TGTextButton *carea = new TGTextButton(fTop2, "Collection Area", kButCollArea); 50 TGTextButton *trate = new TGTextButton(fTop2, "Trigger Rate", kButTrigRate); 51 TGTextButton *thold = new TGTextButton(fTop2, "Threshold", kButThreshold); 50 52 51 53 fList->Add(carea); … … 492 494 switch (parm1) 493 495 { 494 case M_BUTTON_COLAREA:496 case kButCollArea: 495 497 CalculateCollectionArea(); 496 498 return kTRUE; 497 499 498 case M_BUTTON_RATE:500 case kButTrigRate: 499 501 CalculateTriggerRate(); 500 502 return kTRUE; 501 503 502 case M_BUTTON_THRESHOLD:504 case kButThreshold: 503 505 CalculateThreshold(); 504 506 return kTRUE;
Note:
See TracChangeset
for help on using the changeset viewer.