Changeset 12963


Ignore:
Timestamp:
02/29/12 10:05:36 (13 years ago)
Author:
tbretz
Message:
Print jumps and labels help text; use a MessageImp for output now.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/RemoteControl.h

    r12903 r12963  
    6161{
    6262private:
     63    MessageImp *fImp;
     64
     65    int32_t fLabel;
     66
     67    int Write(const Time &time, const std::string &txt, int qos=kMessage)
     68    {
     69        return fImp ? fImp->Write(time, txt, qos) : MessageImp::Write(time, txt, qos);
     70    }
     71
    6372    static void append(std::string &str)
    6473    {
     
    118127    // Redirect asynchronous output to the output window
    119128    RemoteControl(const char *name) : T(name),
    120         RemoteControlImp(T::GetStreamOut(), T::GetStreamIn())
     129        RemoteControlImp(T::GetStreamOut(), T::GetStreamIn()), fImp(0), fLabel(-1)
    121130    {
    122131    }
     
    125134    {
    126135        T::PrintGeneralHelp();
    127         lout << " " << kUnderline << "Specific commands:" << endl;
    128         lout << kBold << "   h,help <arg> " << kReset << "List help text for given server or command." << endl;
     136        lout << " " << kUnderline << "Specific commands:\n";
     137        lout << kBold << "   h,help <arg> " << kReset << "List help text for given server or command.\n";
    129138//        lout << kBold << "   s,servers    " << kReset << "List all servers which are connected." << endl;
    130         lout << kBold << "   svc,services " << kReset << "List all services in the network." << endl;
    131         lout << kBold << "   st,states    " << kReset << "List all states in the network." << endl;
    132         lout << kBold << "   # <text>     " << kReset << "Echo <text> to the output stream" << endl;
    133         lout << kBold << "   .s           " << kReset << "Wait for the state-machine to change to the given state." << endl;
    134         lout <<          "                "              "     .s <server> [<state> [<timeout>]]" << endl;
    135         lout <<          "                "              "<server>  The server for which state to wait (e.g. FTM_CONTROL)" << endl;
    136         lout <<          "                "              "<state>   The state id (see 'states') for which to wait (e.g. 3)" << endl;
    137         lout <<          "                "              "<imeout>  A timeout in millisenconds how long to wait (e.g. 500)" << endl;
     139        lout << kBold << "   svc,services " << kReset << "List all services in the network.\n";
     140        lout << kBold << "   st,states    " << kReset << "List all states in the network.\n";
     141        lout << kBold << "   # <text>     " << kReset << "Echo <text> to the output stream\n";
     142        lout << kBold << "   .s           " << kReset << "Wait for the state-machine to change to the given state.\n";
     143        lout <<          "                "              "     .s <server> [<state> [<timeout> [<label>]]]\n";
     144        lout <<          "                "              "<server>  The server for which state to wait (e.g. FTM_CONTROL)\n";
     145        lout <<          "                "              "<state>   The state id (see 'states') for which to wait (e.g. 3)\n";
     146        lout <<          "                "              "<imeout>  A timeout in millisenconds how long to wait (e.g. 500)\n";
     147        lout <<          "                "              "<label>   A label until which everything is skipped in case of timeout\n";
    138148        lout << endl;
    139149        return true;
     
    200210                usleep(1);
    201211
     212            if (l->second->GetState()!=state)
     213            {
     214                int label = -1;
     215                in >> label;
     216                T::SetLabel(label);
     217            }
     218
    202219            return true;
    203220        }
     
    205222        if (str[0]=='#')
    206223        {
    207             lout << Tools::Trim(str.substr(1)) << endl;
     224            //lout << Tools::Trim(str.substr(1)) << endl;
     225            fImp->Info(Tools::Trim(str.substr(1)));
    208226            return true;
    209227        }
     
    229247        return ProcessCommand(str);
    230248    }
     249
     250    void SetReceiver(MessageImp &imp) { fImp = &imp; }
    231251};
    232252
Note: See TracChangeset for help on using the changeset viewer.