Changeset 14370 for trunk/FACT++


Ignore:
Timestamp:
08/14/12 12:28:37 (12 years ago)
Author:
tbretz
Message:
Adapted ChangeState to properly send informations; adapted Write to keep mssages in sync; renamed DIM_CONTROL2 to DIM_CONTROL
File:
1 edited

Legend:

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

    r14212 r14370  
    3131int StateMachineDimControl::ChangeState(int qos, const Time &time, int scriptdepth, string scriptfile, string user)
    3232{
    33     ostringstream pid;
    34     pid << getpid();
    35 
    3633    string msg;
     34    /*
    3735    switch (qos)
    3836    {
     
    4745        }
    4846    }
    49 
    50     if (qos<0)
    51         msg += "-"+to_string(scriptdepth);
    52 
    53     msg += ": "+scriptfile+" ["+user+":"+pid.str()+"]";
    54 
    55     if (fDebug)
    56         Write(time, Line(msg, qos<-1 ? '=' :'-'), 90);
     47    */
     48
     49    //if (qos<0)
     50        msg += to_string(scriptdepth);
     51
     52    msg += ":"+scriptfile+"["+user+":"+to_string(getpid())+"]";
     53
     54    //if (fDebug)
     55    //Write(time, Line(msg, qos<-1 ? '=' :'-'), MessageImp::kInternal);
    5756
    5857    if (qos==-3)
    5958        fScriptUser = fUser;
    6059
    61     return qos+3;
     60    SetCurrentState(qos+3, msg.c_str());
     61    //SetCurrentState(qos+3, Line(msg, qos<-1 ? '=' :'-').c_str());
     62    return GetCurrentState();
     63
     64    //return qos+3;
    6265}
    6366
     
    6669    if (txt=="")
    6770    {
     71        return ChangeState(qos, time, Readline::GetScriptDepth(), Readline::GetScript(), fScriptUser);
     72        /*
     73         === This might be necessary for thread safety,
     74         === but it break that the signal for the start of a new
     75         === script arrives synchronously before the first output
     76         === from the script
     77
    6878        // Post an anonymous event to the event loop
    6979        Event evt("");
     
    7282                                Readline::GetScript(), fScriptUser));
    7383        return PostEvent(evt);
     84        */
    7485    }
    7586
     
    426437}
    427438
    428 StateMachineDimControl::StateMachineDimControl(ostream &out) : StateMachineDim(out, fIsServer?"DIM_CONTROL2":"")
     439StateMachineDimControl::StateMachineDimControl(ostream &out) : StateMachineDim(out, fIsServer?"DIM_CONTROL":"")
    429440{
    430441    fDim.Subscribe(*this);
Note: See TracChangeset for help on using the changeset viewer.