Ignore:
Timestamp:
08/04/04 11:19:34 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
7 edited

Legend:

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

    r2728 r4452  
    1818!   Author(s): Thomas Bretz, 7/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2003
     20!   Copyright: MAGIC Software Development, 2003-2004
    2121!
    2222!
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.cc

    r4368 r4452  
    952952    }
    953953
     954    fLog->ReadEnv(env, prefix, print);
     955
    954956    return kTRUE;
    955957}
     
    10031005    }
    10041006
     1007    fLog->WriteEnv(env, prefix, print);
     1008
    10051009    return kTRUE;
    10061010}
  • trunk/MagicSoft/Mars/mbase/MLog.cc

    r4253 r4452  
    108108
    109109#include "MLogPlugin.h"
     110#include "MParContainer.h"
     111#include "MArgs.h"
    110112
    111113ClassImp(MLog);
     
    509511// --------------------------------------------------------------------------
    510512//
     513// Setup MLog and global debug output from command line arguments.
     514//
     515//    gLog << "     -v#                              Verbosity level # [default=2]" << endl;
     516//    gLog << "     -a, --no-colors                  Do not use Ansii color codes" << endl;
     517//    gLog << "     --debug[=n]                      Enable root debugging (Default: gDebug=1)" << endl;
     518//
     519void MLog::Setup(MArgs &arg)
     520{
     521    if (arg.HasOnlyAndRemove("--no-colors") || arg.HasOnlyAndRemove("-a"))
     522        SetNoColors();
     523
     524    SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2);
     525
     526    gDebug = arg.HasOption("--debug=") ? arg.GetIntAndRemove("--debug=") : 0;
     527    if (gDebug==0 && arg.HasOnlyAndRemove("--debug"))
     528        gDebug=1;
     529}
     530
     531// --------------------------------------------------------------------------
     532//
     533// Read the setup from a TEnv:
     534//   MLog.VerbosityLevel: 0, 1, 2, 3, 4
     535//   MLog.DebugLevel: 0, 1, 2, 3, 4
     536//   MLog.NoColors
     537//
     538// Depending on your setup it might be correct to use something like:
     539//   Job1.MLog.VerbosityLevel: 1
     540//   Job1.DebugLevel: 2
     541//   Job1.MLog.NoColors
     542//
     543void MLog::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     544{
     545    if (!prefix.IsNull())
     546        prefix += ".";
     547    prefix += "MLog";
     548
     549    MParContainer mlog("MLog");
     550
     551    if (mlog.IsEnvDefined(env, prefix, "VerbosityLevel", print))
     552        SetDebugLevel(mlog.GetEnvValue(env, prefix, "VerbosityLevel", 2));
     553
     554    if (mlog.IsEnvDefined(env, prefix, "DebugLevel", print))
     555        gDebug = mlog.GetEnvValue(env, prefix, "DebugLevel", 0);
     556
     557    if (mlog.IsEnvDefined(env, prefix, "NoColors", print))
     558        if (mlog.GetEnvValue(env, prefix, "NoColors", 1)>0)
     559            SetNoColors();
     560}
     561
     562// --------------------------------------------------------------------------
     563//
     564// Read the setup from a TEnv:
     565//   MLog.VerbosityLevel: 0, 1, 2, 3, 4
     566//   MLog.DebugLevel: 0, 1, 2, 3, 4
     567//   MLog.NoColors
     568//
     569// Depending on your setup it might be correct to use something like:
     570//   Job1.MLog.VerbosityLevel: 1
     571//   Job1.DebugLevel: 2
     572//   Job1.MLog.NoColors
     573//
     574void MLog::WriteEnv(TEnv &env, TString prefix, Bool_t print) const
     575{
     576    if (!prefix.IsNull())
     577        prefix += ".";
     578    prefix += "MLog";
     579
     580    cout << "MLog::WriteEnv: not yet implemented!" << endl;
     581}
     582
     583// --------------------------------------------------------------------------
     584//
    511585// Create a new instance of an file output stream
    512586// an set the corresponding flag
  • trunk/MagicSoft/Mars/mbase/MLog.h

    r4253 r4452  
    1313#define bsz    160 // two standard lines
    1414
     15class MArgs;
     16
     17class TEnv;
    1518class TMutex;
    1619class TGTextView;
     
    181184    void SetNoColors(Bool_t flag=kTRUE) { flag ? SetBit(eNoColors) : ResetBit(eNoColors); }
    182185
     186    void Setup(MArgs &arg);
     187
     188    void ReadEnv(const TEnv &env, TString prefix="", Bool_t print=kFALSE);
     189    void WriteEnv(TEnv &env, TString prefix="", Bool_t print=kFALSE) const;
     190
    183191    void Separator(TString str="", int outlvl=0)
    184192    {
  • trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc

    r2206 r4452  
    3434// This is a simple way to develop new code in a macro without need
    3535// to compile it.
     36//
     37// Example:
     38//    Int_t Process()
     39//    {
     40//       gLog << "Processing..." << endl;
     41//       return kTRUE;
     42//    }
     43//
     44//    void main()
     45//    {
     46//       MTaskInteractive task;
     47//       task.SetProcess(Process);
     48//       MTaskList list;
     49//       list.AddToList(&task);
     50//    }
     51//
    3652//
    3753//  Input Containers:
  • trunk/MagicSoft/Mars/mbase/MTaskInteractive.h

    r2206 r4452  
    11#ifndef MARS_MTaskInteractive
    22#define MARS_MTaskInteractive
    3 
    4 /////////////////////////////////////////////////////////////////////////////
    5 //                                                                         //
    6 // MTaskInteractive                                                               //
    7 //                                                                         //
    8 // Does nothing than return kCONTINUE in the Process-fucntion              //
    9 // (use with filters)                                                      //
    10 //                                                                         //
    11 /////////////////////////////////////////////////////////////////////////////
    123
    134#ifndef MARS_MTask
  • trunk/MagicSoft/Mars/mbase/MTime.cc

    r4358 r4452  
    157157// strange offsets. You can get rid of this by calling:
    158158//    TAxis::SetTimeFormat("[your-format] %F1995-01-01 00:00:00");
     159//
     160// Be carefull: It seems that root takes sommer and winter time into account!
     161//              In some circumstances you may need
     162//    TAxis::SetTimeFormat("[your-format] %F1995-01-00 23:00:00");
    159163//
    160164Double_t MTime::GetAxisTime() const
Note: See TracChangeset for help on using the changeset viewer.