Changeset 13899


Ignore:
Timestamp:
05/26/12 10:47:21 (13 years ago)
Author:
tbretz
Message:
Made the script depth static to be able to access it from dimctrl; added it to the command-log
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Readline.cc

    r13897 r13899  
    7272Readline   *Readline::This   =  0;
    7373bool        Readline::fStopScript = false;
     74int         Readline::fScriptDepth = 0;
    7475std::string Readline::fScript;
    7576
     
    9899//
    99100Readline::Readline(const char *prgname) :
    100     fMaxLines(500), fLine(0), fScriptDepth(0), fCompletion(0)
     101    fMaxLines(500), fLine(0), fLabel(-1), fCompletion(0)
    101102{
    102103    if (This)
     
    10191020        catch (const logic_error &e)
    10201021        {
    1021             fCommandLog << "# ERROR - Inavlid label '" << str.substr(1) << "'" << endl;
     1022            fCommandLog << "# ERROR[" << fScriptDepth << "] - Inavlid label '" << str.substr(1) << "'" << endl;
    10221023            fLabel = -2;
    10231024            return true;
     
    10301031    if (fLabel>=0)
    10311032    {
    1032         fCommandLog << "# SKIP[" << fLabel << "]: " << str << endl;
     1033        fCommandLog << "# SKIP[" << fScriptDepth << "]: " << fLabel << " - " << str << endl;
    10331034        return true;
    10341035    }
     
    13581359    }
    13591360
    1360     fCommandLog << "# " << Time() << " - " << name << " (START";
     1361    if (fScriptDepth++==0)
     1362        fStopScript = false;
     1363
     1364    fCommandLog << "# " << Time() << " - " << name << " (START[" << fScriptDepth<< "]";
    13611365    if (fLabel>=0)
    13621366        fCommandLog << ':' << fLabel;
    13631367    fCommandLog << ")" << endl;
    1364 
    1365     if (fScriptDepth++==0)
    1366         fStopScript = false;
    13671368
    13681369    fSection = -1;
     
    14021403    SetSection(-3);
    14031404
     1405    fCommandLog << "# " << Time() << " - " << name << " (FINISHED[" << fScriptDepth<< "])" << endl;
     1406
    14041407    if (--fScriptDepth==0)
    14051408        fStopScript = false;
    1406 
    1407     fCommandLog << "# " << Time() << " - " << name << " (FINISHED)" << endl;
    14081409
    14091410    return rc;
  • trunk/FACT++/src/Readline.h

    r13898 r13899  
    2929    int fSection;
    3030    int fLabel;
    31     int fScriptDepth;
     31    static int fScriptDepth;
    3232    static bool fStopScript;
    3333    static std::string fScript;
     
    108108    static void  StopScript() { fStopScript = true; }
    109109    static bool  IsScriptStopped() { return fStopScript; }
     110    static int   GetScriptDepth() { return fScriptDepth; }
    110111
    111112    static std::string GetScript() { return fScript; }
Note: See TracChangeset for help on using the changeset viewer.