- Timestamp:
- 05/02/03 12:46:43 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Makefile.conf.general
r1965 r2054 12 12 # 13 13 14 DEFINES = -D__MARS__ -DMARSVER=\"\<cvs\>\" -DROOTVER=\"$(ROOTVER)\" $(ARCHDEF) 14 # 15 # You can use this flags to further costumize compilation: 16 # export MARSDEFINES="-DHAVE_DARKBACKGROUND -DHAVE_XPM" 17 # export MARSFLAGS= 18 # export MARSLIBS="-lX11 -lXpm -L/usr/X11R6/lib" 19 # 20 DEFINES = -DMARSVER=\"\<cvs\>\" -D__MARS__ -DROOTVER=\"$(ROOTVER)\" $(ARCHDEF) $(MARSDEFINES) 15 21 16 22 CXXFLAGS = $(ROOTCFLAGS) $(INCLUDES) $(OPTIM) $(DEBUG) $(DEFINES) 17 CFLAGS = $(CXXFLAGS) 23 CFLAGS = $(CXXFLAGS) $(MARSFLAGS) 18 24 FFLAGS = $(CXXFLAGS) 19 25 -
trunk/MagicSoft/Mars/Makefile.conf.linux
r1880 r2054 21 21 # 22 22 OPTIM = -O5 -Wall -fnonnull-objects -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual 23 DEBUG = 23 DEBUG = 24 24 ARCHDEF = -D__LINUX__ 25 25 … … 27 27 # For producing gmon.out use '-pg' 28 28 29 MARS_LIB = -Llib $(SUBDIRS:%=-l%) 29 MARS_LIB = -Llib $(SUBDIRS:%=-l%) $(MARSLIBS) 30 30 INCLUDES = -I. $(SUBDIRS:%=-I%) 31 31 -
trunk/MagicSoft/Mars/Makefile.conf.linux-gnu
r1172 r2054 24 24 ARCHDEF = -D__LINUX__ 25 25 26 # To be tested: 27 # OPTIM = -pipe 28 # OPTIM2 = -fomit-frame-pointer -ffast-math -march=i686 -mcpu=i686 29 26 30 # For debugging information use '-g' 27 31 # For producing gmon.out use '-pg' 28 32 29 MARS_LIB = -Llib $(SUBDIRS:%=-l%) 33 MARS_LIB = -Llib $(SUBDIRS:%=-l%) $(MARSLIBS) 30 34 INCLUDES = -I. $(SUBDIRS:%=-I%) 31 35 -
trunk/MagicSoft/Mars/Makefile.conf.osf1
r1752 r2054 27 27 ARCHDEF = -D__OSF__ 28 28 29 MARS_LIB = -Llib $(SUBDIRS/*/-l&) 29 MARS_LIB = -Llib $(SUBDIRS/*/-l&) $(MARSLIBS) 30 30 INCLUDES = -I. $(SUBDIRS/*/-I&) 31 31 -
trunk/MagicSoft/Mars/Makefile.conf.osf5.1
r1579 r2054 27 27 ARCHDEF = -D__OSF__ 28 28 29 MARS_LIB = -Llib $(SUBDIRS/*/-l&) 29 MARS_LIB = -Llib $(SUBDIRS/*/-l&) $(MARSLIBS) 30 30 INCLUDES = -I. $(SUBDIRS/*/-I&) 31 31 -
trunk/MagicSoft/Mars/NEWS
r2015 r2054 56 56 57 57 - added (event-)weights to fill histograms 58 59 - colors in logging output to screen 58 60 59 61 -
trunk/MagicSoft/Mars/mars.cc
r1965 r2054 11 11 #include "MParContainer.h" 12 12 13 //#define HAVE_LOGO 1 14 #ifdef HAVE_LOGO 13 #ifdef HAVE_XPM 15 14 #include "MLogo.h" 16 15 #endif … … 28 27 { 29 28 gLog << "Sorry the usage is:" << endl; 30 gLog << " mars [-v n]" << endl << endl;29 gLog << " mars [-v#]" << endl << endl; 31 30 gLog << " -v0: verbosity level: as less as possible" << endl; 32 31 gLog << " -v1: errors only" << endl; … … 37 36 int main(int argc, char **argv) 38 37 { 39 #ifdef HAVE_ LOGO38 #ifdef HAVE_XPM 40 39 MLogo logo; 41 40 logo.Popup(); … … 106 105 TApplication app("MarsApp", &argc, argv); 107 106 108 #ifdef HAVE_ LOGO107 #ifdef HAVE_XPM 109 108 logo.Popdown(); 110 109 #endif -
trunk/MagicSoft/Mars/mbase/MLog.cc
r2052 r2054 89 89 // check for TObjectWarning, TObject::Info, gErrorIgnoreLevel 90 90 91 const char MLog::kESC = '\033'; // (char)27 92 const char *const MLog::kEsc = "\033["; 93 const char *const MLog::kReset = "\033[0m"; 94 const char *const MLog::kRed = "\033[31m"; 95 const char *const MLog::kGreen = "\033[32m"; 96 #ifdef HAVE_DARKBACKGROUND 97 const char *const MLog::kYellow = "\033[33m\033[1m"; 98 #else 99 const char *const MLog::kYellow = "\033[33m"; 100 #endif 101 const char *const MLog::kUnderline = "\033[4m";; 102 const char *const MLog::kBlink = "\033[5m";; 103 const char *const MLog::kBright = "\033[1m";; 104 const char *const MLog::kDark = "\033[2m";; 105 91 106 // 92 107 // This is the definition of the global log facility … … 180 195 } 181 196 197 void MLog::Output(ostream &out, int len) 198 { 199 if (!TestBit(eNoColors)) 200 switch (fOutputLevel) 201 { 202 case 0: out << MLog::kReset; break; // all 203 case 1: out << MLog::kRed; break; // err 204 case 2: out << MLog::kYellow; break; // warn 205 case 3: out << MLog::kGreen; break; // inf 206 } 207 208 // Check for EOL 209 const Bool_t endline = fBase[len-1]=='\n'; 210 // output text to screen (without trailing '\0' or '\n') 211 out << TString(fBase, len-1); 212 // reset colors if working with colors 213 if (!TestBit(eNoColors)) 214 out << kReset; 215 // output EOL of check found EOL 216 if (endline) 217 out << '\n'; 218 out.flush(); 219 } 220 182 221 // -------------------------------------------------------------------------- 183 222 // … … 198 237 199 238 if (fDevice&eStdout) 200 cout.write(fBase, len);239 Output(cout, len); 201 240 202 241 if (fDevice&eStderr) 203 cerr.write(fBase, len);242 Output(cerr, len); 204 243 205 244 if (fDevice&eFile && fout) … … 289 328 290 329 if (fDevice&eStdout) 330 { 331 cout << kReset; 291 332 cout.flush(); 333 } 292 334 293 335 if (fDevice&eStderr) -
trunk/MagicSoft/Mars/mbase/MLog.h
r2052 r2054 23 23 { 24 24 public: 25 typedef enum _flags { eStdout = 0x1, eStderr = 0x2, eFile = 0x4, eGui = 0x8 } Flags_t; 25 typedef enum _flags { 26 eStdout = 0x001, 27 eStderr = 0x002, 28 eFile = 0x004, 29 eGui = 0x008, 30 eNoColors = 0x400 //BIT(15) 31 } Flags_t; 26 32 27 33 private: 34 static const char kESC; 35 static const char *const kEsc; 36 static const char *const kReset; 37 static const char *const kRed; 38 static const char *const kGreen; 39 static const char *const kYellow; 40 static const char *const kUnderline; 41 static const char *const kBlink; 42 static const char *const kBright; 43 static const char *const kDark; 44 28 45 char fBuffer; //! 29 46 char fBase[bsz+1]; //! Buffer to store the data in … … 46 63 TString **fGuiLines; //! Lines to pipe to gui 47 64 Int_t fNumLines; //! 48 // Bool_t fGuiLineFlushed; 49 TString fGuiLine; //! 65 TString fGuiLine; //! 50 66 51 67 #ifdef _REENTRANT … … 63 79 void ReallocateFile(const char *f); 64 80 void CheckFlag(Flags_t chk, int flag); 81 void Output(ostream &out, int len); 65 82 66 83 public: … … 143 160 void SetNullOutput(Bool_t n=kTRUE) { fIsNull = n; } 144 161 162 void SetNoColors(Bool_t flag=kTRUE) { flag ? SetBit(eNoColors) : ResetBit(eNoColors); } 163 145 164 ClassDef(MLog, 0) // This is what we call 'The logging system' 146 165 }; -
trunk/MagicSoft/Mars/mbase/MLogo.cc
r1337 r2054 32 32 // // 33 33 ////////////////////////////////////////////////////////////////////////////// 34 #ifdef HAVE_XPM 34 35 #include "MLogo.h" 35 36 … … 123 124 mag1, &logo, 0, &attr); 124 125 #else 125 #include "../marslogo _neu.xpm"126 #include "../marslogo.xpm" 126 127 int ret = XpmCreatePixmapFromData(fDisplay, fLogoWindow, 127 marslogo _neu_xpm, &logo, 0, &attr);128 marslogo, &logo, 0, &attr); 128 129 #endif 129 130 XpmFreeAttributes(&attr); … … 206 207 } 207 208 } 209 #endif -
trunk/MagicSoft/Mars/mbase/MLogo.h
r1337 r2054 1 1 #ifndef MARS_MLogo 2 2 #define MARS_MLogo 3 4 #ifdef HAVE_XPM 3 5 4 6 #ifndef __CINT__ … … 31 33 }; 32 34 33 #endif 34 35 #endif 35 #endif // __CINT__ 36 #endif // HAVE_XPM 37 #endif // MARS_MLogo -
trunk/MagicSoft/Mars/mbase/Makefile
r1715 r2054 50 50 MContinue.cc \ 51 51 MPrint.cc \ 52 MLogo.cc \ 52 53 MLogManip.cc 53 54 -
trunk/MagicSoft/Mars/mmain/MGMenu.cc
r1968 r2054 213 213 // was pressed close the popup. 214 214 // 215 if ( !rc || event->fCode==9/*ESC*/)216 {217 f.SetState(kFALSE); 218 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE); // ungrab pointer219 fCurrent = 0;220 }221 215 if (rc && event->fCode!=9/*ESC*/) 216 return kTRUE; 217 218 f.SetState(kFALSE); 219 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE); // ungrab pointer 220 gVirtualX->SetKeyAutoRepeat(kTRUE); // set in TGMainFrame::HandleKey 221 fCurrent = 0; 222 222 return kTRUE; 223 223 } -
trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc
r2053 r2054 80 80 #include <TGButton.h> // TGPictureButton 81 81 #include <TGListBox.h> // TGListBox 82 #include <TGStatusBar.h> // TGStatusBar 82 83 #include <TGProgressBar.h> // TGHProgressBar 83 84 … … 219 220 f->AddFrame(mars, lay2); 220 221 } 222 /* 223 TGShutter *s = new TGShutter(f); 224 fList->Add(s); 225 f->AddFrame(s, lay); 226 s->AddItem(new TGShutterItem(s, new TGHotString("Hallo1"))); 227 s->AddItem(new TGShutterItem(s, new TGHotString("Hallo2"))); 228 */ 221 229 222 230 // Add date and time … … 304 312 305 313 // Add fTab to Frame 306 TGLayoutHints *laytabs = new TGLayoutHints(kLHintsNormal|kLHintsExpandX|kLHintsExpandY, 5, 6, 5);314 TGLayoutHints *laytabs = new TGLayoutHints(kLHintsNormal|kLHintsExpandX|kLHintsExpandY, 5, 5, 5); 307 315 AddFrame(fTab, laytabs); 308 316 … … 317 325 void MStatusDisplay::AddProgressBar() 318 326 { 319 TGLayoutHints *laybar=new TGLayoutHints(kLHintsExpandX, 5, 6, 5, 5);327 TGLayoutHints *laybar=new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5); 320 328 fList->Add(laybar); 321 329 … … 329 337 // -------------------------------------------------------------------------- 330 338 // 331 // Adds the status lines to the GUI 332 // 333 void MStatusDisplay::AddStatusLines() 334 { 335 TGHorizontalFrame *hf = new TGHorizontalFrame(this, 1, 1); 336 337 TGCompositeFrame *f = new TGCompositeFrame(hf, 1, 1, kSunkenFrame); 338 339 fLine1 = new TGLabel(f, ""); 340 341 TGLayoutHints *lay = new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 0, 5); 342 f->AddFrame(fLine1, lay); 343 hf->AddFrame(f, lay); 344 345 fList->Add(f); 346 fList->Add(fLine1); 347 fList->Add(lay); 348 349 f = new TGCompositeFrame(hf, 1, 1, kSunkenFrame); 350 351 fLine2 = new TGLabel(f, ""); 352 f->AddFrame(fLine2, lay); 353 hf->AddFrame(f, lay); 354 355 TGLayoutHints *layf = new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 5, 0, 0, 3); 356 AddFrame(hf, layf); 357 358 fList->Add(layf); 359 fList->Add(f); 360 fList->Add(fLine2); 361 fList->Add(hf); 339 // Adds the status bar to the GUI 340 // 341 void MStatusDisplay::AddStatusBar() 342 { 343 fStatusBar = new TGStatusBar(this, 1, 1); 344 345 fStatusBar->SetParts(2); 346 347 TGLayoutHints *layb = new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 5, 4, 0, 3); 348 AddFrame(fStatusBar, layb); 349 350 fList->Add(fStatusBar); 351 fList->Add(layb); 362 352 } 363 353 … … 368 358 void MStatusDisplay::SetStatusLine1(const char *txt) 369 359 { 370 f Line1->SetText(txt);371 gClient->ProcessEventsFor(f Line1);360 fStatusBar->SetText(txt, 0); 361 gClient->ProcessEventsFor(fStatusBar); 372 362 } 373 363 … … 378 368 void MStatusDisplay::SetStatusLine2(const char *txt) 379 369 { 380 f Line2->SetText(txt);381 gClient->ProcessEventsFor(f Line2);370 fStatusBar->SetText(txt, 1); 371 gClient->ProcessEventsFor(fStatusBar); 382 372 } 383 373 … … 404 394 // 405 395 MStatusDisplay::MStatusDisplay(Long_t t) 406 : TGMainFrame(gClient->GetRoot(), 1, 1), fTimer(this, t, kTRUE), f Log(&gLog), fLogIdx(-1), fLogTimer(this, 250, kTRUE), fLogBox(NULL)396 : TGMainFrame(gClient->GetRoot(), 1, 1), fTimer(this, t, kTRUE), fStatus(kLoopNone), fLog(&gLog), fLogIdx(-1), fLogTimer(this, 250, kTRUE), fLogBox(NULL) 407 397 { 408 398 gROOT->GetListOfSpecials()->Add(this); 399 gROOT->GetListOfCleanups()->Add(this); 400 409 401 410 402 // … … 434 426 AddTabs(); 435 427 AddProgressBar(); 436 AddStatus Lines();428 AddStatusBar(); 437 429 438 430 // … … 447 439 MapWindow(); 448 440 449 //lient->ProcessEventsFor(this);450 441 gSystem->ProcessEvents(); 451 452 //TSeqCollection *GetListOfCleanups() const {return fCleanups;}453 454 442 } 455 443 … … 466 454 467 455 gROOT->GetListOfSpecials()->Remove(this); 456 gROOT->GetListOfCleanups()->Remove(this); 468 457 } 469 458 -
trunk/MagicSoft/Mars/mmain/MStatusDisplay.h
r2052 r2054 23 23 24 24 class TGTab; 25 class TGLabel;26 25 class TGListBox; 26 class TGStatusBar; 27 27 class TGProgressBar; 28 28 class TGHProgressBar; … … 69 69 TTimer fTimer; 70 70 71 TGLabel *fLine1; 72 TGLabel *fLine2; 71 TGStatusBar *fStatusBar; 73 72 74 73 Status_t fStatus; … … 86 85 void AddLogTab(); 87 86 void AddTabs(); 88 void AddStatus Lines();87 void AddStatusBar(); 89 88 90 89 TCanvas *GetCanvas(TGCompositeFrame *f) const;
Note:
See TracChangeset
for help on using the changeset viewer.