Ignore:
Timestamp:
05/05/03 10:37:08 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.cc

    r2052 r2058  
    108108    fName = name;
    109109
    110     *fLog << inf << "Instantiated MEvtLoop (" << name << "), using ROOT v" << ROOTVER << endl;
     110    fLog->Underline();
     111    *fLog << inf << "Instantiated MEvtLoop (" << name << "), using ROOT v" << ROOTVER << "\033[0m" << endl;
    111112}
    112113
     
    240241            return kTRUE;
    241242        default:
     243            *fLog << warn << "MEvtloop: fDisplay->ChecStatus() has returned unknown status #" << fDisplay->CheckStatus() << "... cleared." << endl;
    242244            fDisplay->ClearStatus();
    243             *fLog << warn << "Display shows unknown status... cleared." << endl;
    244245            break;
    245246        }
  • trunk/MagicSoft/Mars/mbase/MLog.cc

    r2054 r2058  
    8080#include <pthread.h>
    8181#endif
    82 #include <TGListBox.h>
     82#include <TGTextView.h>
    8383
    8484#include "MLogManip.h"
     
    133133// which is used for the output (i)
    134134//
    135 MLog::MLog(int i) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(i), fIsNull(kFALSE), fGuiLineId(0), fout(NULL), fOutAllocated(kFALSE), fgui(NULL), fNumLines(0)
     135MLog::MLog(int i) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(i), fIsNull(kFALSE), fout(NULL), fOutAllocated(kFALSE), fgui(NULL), fNumLines(0)
    136136{
    137137    Init();
     
    143143// ofstream as the default output device
    144144//
    145 MLog::MLog(ofstream &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fGuiLineId(0),  fout(&out), fOutAllocated(kFALSE), fgui(NULL), fNumLines(0)
     145MLog::MLog(ofstream &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fout(&out), fOutAllocated(kFALSE), fgui(NULL), fNumLines(0)
    146146{
    147147    Init();
     
    151151//
    152152// default constructor which initializes the streamer and sets the given
    153 // TGListBox as the default output device
    154 //
    155 MLog::MLog(TGListBox &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eGui), fGuiLineId(0), fout(NULL), fOutAllocated(kFALSE), fgui(&out), fNumLines(0)
     153// TGTextView as the default output device
     154//
     155MLog::MLog(TGTextView &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eGui), fout(NULL), fOutAllocated(kFALSE), fgui(&out), fNumLines(0)
    156156{
    157157    Init();
     
    164164// or not.
    165165//
    166 MLog::MLog(const char *fname, int flag) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fGuiLineId(0),  fgui(NULL), fNumLines(0)
     166MLog::MLog(const char *fname, int flag) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fgui(NULL), fNumLines(0)
    167167{
    168168    Init();
     
    193193    fDebugLevel  = log.fDebugLevel;
    194194    fDevice      = log.fDevice;
     195}
     196
     197void MLog::Underline()
     198{
     199    if (fDevice&eStdout)
     200        cout << kUnderline;
     201
     202    if (fDevice&eStderr)
     203        cerr << kUnderline;
    195204}
    196205
     
    272281}
    273282
     283#include <TVirtualX.h>
    274284void MLog::UpdateGui()
    275285{
     
    279289    // lock mutex
    280290    Lock();
     291
     292    TGText &txt=*fgui->GetText();
    281293
    282294    // copy lines to TGListBox
     
    285297        // Replace all tabs by 7 white spaces
    286298        fGuiLines[i]->ReplaceAll("\t", "       ");
    287         fgui->AddEntry(*fGuiLines[i], fGuiLineId++);
     299        txt.InsText(TGLongPosition(0, txt.RowCount()), *fGuiLines[i]);
    288300        delete fGuiLines[i];
    289301    }
     
    292304    fNumLines=0;
    293305
    294     // cut list box top 1000 lines
    295     fgui->RemoveEntries(0, fGuiLineId-1000);
     306    // cut text box top 1000 lines
     307    while (txt.RowCount()>1000)
     308        txt.DelLine(0);
     309
    296310    // show last entry
    297     fgui->SetTopEntry(fGuiLineId-1);
     311    fgui->Layout();
     312    fgui->SetVsbPosition(txt.RowCount()-1);
     313
    298314    // tell a main loop, that list box contents have changed
    299315    fgui->SetBit(kHasChanged);
  • trunk/MagicSoft/Mars/mbase/MLog.h

    r2054 r2058  
    1818
    1919
    20 class TGListBox;
     20class TGTextView;
    2121
    2222class MLog : public streambuf, public ostream, public TObject
     
    5454    Bool_t fIsNull;           //! Switch output completely off
    5555
    56     Int_t fGuiLineId;         //!
    57 
    58     ofstream  *fout;          //! possible file output stream
    59     Bool_t     fOutAllocated; //! flag if fout is created by MLogging
    60     TGListBox *fgui;          //! Listbox output
     56    ofstream   *fout;          //! possible file output stream
     57    Bool_t      fOutAllocated; //! flag if fout is created by MLogging
     58    TGTextView *fgui;          //! Text View output
    6159
    6260    Bool_t     fIsDirectGui;  //! Pipe text directly to the GUI (for single threaded environments)
     
    8482    MLog(int i=eStdout);
    8583    MLog(ofstream &out);
    86     MLog(TGListBox &out);
     84    MLog(TGTextView &out);
    8785    MLog(const char *fname, int flag=-1);
    8886
     
    9795    void UpdateGui();
    9896
     97    void Underline();
     98
    9999    void SetDebugLevel(int i)           { fDebugLevel  =  i;  }
    100100    int  GetDebugLevel() const          { return fDebugLevel; }
     
    104104    void DisableOutputDevice(Flags_t f) { fDevice     &= ~f;  }
    105105    void operator=(ofstream &out)       { SetOutputFile(out); }
    106     void operator=(TGListBox *out)      { SetOutputGui(out);  }
     106    void operator=(TGTextView *out)     { SetOutputGui(out);  }
    107107
    108108    Bool_t IsOutputDeviceEnabled(int i) const { return fDevice & i; }
    109109
    110     void SetOutputGui(TGListBox *out, int flag=-1)
     110    void SetOutputGui(TGTextView *out, int flag=-1)
    111111    {
    112112        fgui = out;
Note: See TracChangeset for help on using the changeset viewer.