Changeset 13702 for trunk/FACT++/src


Ignore:
Timestamp:
05/13/12 15:38:46 (12 years ago)
Author:
tbretz
Message:
Slight change to the meaning of labels; added the direct exit to th eexecution loop; implemented interruption of state waiting
Location:
trunk/FACT++/src
Files:
4 edited

Legend:

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

    r13682 r13702  
    7171
    7272Readline *Readline::This   =  0;
    73 int       Readline::fLabel = -2;
     73int       Readline::fLabel = -3;
    7474
    7575// --------------------------------------------------------------------------
     
    12481248        return 0;
    12491249
    1250     SetSection(-1);
     1250    SetSection(-2);
    12511251    fLabel = -1;
    12521252
     
    12631263    if (!fin)
    12641264    {
    1265         SetSection(-2);
     1265        SetSection(-3);
    12661266        return -1;
    12671267    }
     
    12721272    fCommandLog << ")" << endl;
    12731273
    1274     SetSection(0);
     1274    SetSection(-1);
    12751275
    12761276    int rc = 0;
    12771277
    12781278    string buffer;
    1279     while (getline(fin, buffer, '\n'))
     1279    while (getline(fin, buffer, '\n') && fLabel>-2)
    12801280    {
    12811281        buffer = Tools::Trim(buffer);
     
    13041304
    13051305    fLabel = -1;
    1306     SetSection(-2);
     1306    SetSection(-3);
    13071307
    13081308    fCommandLog << "# " << Time() << " - " << name << " (FINISHED)" << endl;
  • trunk/FACT++/src/Readline.h

    r13668 r13702  
    100100    void         ProcessLine(const std::string &str);
    101101    static  void SetLabel(int l) { fLabel = l; }
     102    static  int  GetLabel() { return fLabel; }
    102103
    103104    int GetLine() const { return fLine; }
  • trunk/FACT++/src/RemoteControl.h

    r13672 r13702  
    6868    int Write(const Time &time, const std::string &txt, int qos=kMessage)
    6969    {
     70        if (!fImp)
     71            return 0;
    7072        return fImp ? fImp->Write(time, txt, qos) : MessageImp::Write(time, txt, qos);
    7173    }
     
    213215            T::GetStreamOut().SetBacklog(false);
    214216            T::GetStreamOut().SetNullOutput(false);
    215             while (l->second->GetState()!=state && timeout>Time())
     217            while (l->second->GetState()!=state && timeout>Time() && T::GetLabel()!=-2)
    216218                usleep(1);
    217219            T::GetStreamOut().SetNullOutput(true);
    218220            T::GetStreamOut().SetBacklog(true);
    219221
    220             if (l->second->GetState()!=state)
     222            if (T::GetLabel()!=0 && l->second->GetState()!=state)
    221223            {
    222224                int label = -1;
  • trunk/FACT++/src/dimctrl.cc

    r13681 r13702  
    9595        {
    9696            Debug("Stop received");
    97             Readline::SetLabel(0);
     97            Readline::SetLabel(-2);
    9898        }
    9999
     
    165165            {
    166166                string msg;
    167                 if (fLabel<0)
     167                switch (fLabel)
    168168                {
    169                     if (fLabel==-1)
    170                         msg = Line("Begin ["+fScript+"]", '=');
    171                     else
    172                         msg = Line("End ["+fScript+"]", '=');
    173                 }
    174                 else
    175                 {
    176                     ostringstream out;
    177                     out << "Label " << fLabel << " [" << fScript << "]";
    178                     msg = Line(out.str(), '-');
     169                case -3: msg = Line("End ["+fScript+"]", '=');   break;
     170                case -2: msg = Line("Load ["+fScript+"]", '=');  break;
     171                case -1: msg = Line("Begin ["+fScript+"]", '-'); break;
     172                default:
     173                    {
     174                        ostringstream out;
     175                        out << "Label " << fLabel << " [" << fScript << "]";
     176                        msg = Line(out.str(), '-');
     177                    }
    179178                }
    180179
     
    185184            switch (fLabel)
    186185            {
    187             case -2: return fSrvState.Update(fScript+" [end]");
    188             case -1: return fSrvState.Update(fScript+" [load]");
    189             case  0: return fSrvState.Update(fScript+" [start]");
     186            case -3: return fSrvState.Update(fScript+" [end]");
     187            case -2: return fSrvState.Update(fScript+" [load]");
     188            case -1: return fSrvState.Update(fScript+" [start]");
    190189            }
    191190
Note: See TracChangeset for help on using the changeset viewer.