Index: trunk/FACT++/src/RemoteControl.h
===================================================================
--- trunk/FACT++/src/RemoteControl.h	(revision 12962)
+++ trunk/FACT++/src/RemoteControl.h	(revision 12963)
@@ -61,4 +61,13 @@
 {
 private:
+    MessageImp *fImp;
+
+    int32_t fLabel;
+
+    int Write(const Time &time, const std::string &txt, int qos=kMessage)
+    {
+        return fImp ? fImp->Write(time, txt, qos) : MessageImp::Write(time, txt, qos);
+    }
+
     static void append(std::string &str)
     {
@@ -118,5 +127,5 @@
     // Redirect asynchronous output to the output window
     RemoteControl(const char *name) : T(name),
-        RemoteControlImp(T::GetStreamOut(), T::GetStreamIn())
+        RemoteControlImp(T::GetStreamOut(), T::GetStreamIn()), fImp(0), fLabel(-1)
     {
     }
@@ -125,15 +134,16 @@
     {
         T::PrintGeneralHelp();
-        lout << " " << kUnderline << "Specific commands:" << endl;
-        lout << kBold << "   h,help <arg> " << kReset << "List help text for given server or command." << endl;
+        lout << " " << kUnderline << "Specific commands:\n";
+        lout << kBold << "   h,help <arg> " << kReset << "List help text for given server or command.\n";
 //        lout << kBold << "   s,servers    " << kReset << "List all servers which are connected." << endl;
-        lout << kBold << "   svc,services " << kReset << "List all services in the network." << endl;
-        lout << kBold << "   st,states    " << kReset << "List all states in the network." << endl;
-        lout << kBold << "   # <text>     " << kReset << "Echo <text> to the output stream" << endl;
-        lout << kBold << "   .s           " << kReset << "Wait for the state-machine to change to the given state." << endl;
-        lout <<          "                "              "     .s <server> [<state> [<timeout>]]" << endl;
-        lout <<          "                "              "<server>  The server for which state to wait (e.g. FTM_CONTROL)" << endl;
-        lout <<          "                "              "<state>   The state id (see 'states') for which to wait (e.g. 3)" << endl;
-        lout <<          "                "              "<imeout>  A timeout in millisenconds how long to wait (e.g. 500)" << endl;
+        lout << kBold << "   svc,services " << kReset << "List all services in the network.\n";
+        lout << kBold << "   st,states    " << kReset << "List all states in the network.\n";
+        lout << kBold << "   # <text>     " << kReset << "Echo <text> to the output stream\n";
+        lout << kBold << "   .s           " << kReset << "Wait for the state-machine to change to the given state.\n";
+        lout <<          "                "              "     .s <server> [<state> [<timeout> [<label>]]]\n";
+        lout <<          "                "              "<server>  The server for which state to wait (e.g. FTM_CONTROL)\n";
+        lout <<          "                "              "<state>   The state id (see 'states') for which to wait (e.g. 3)\n";
+        lout <<          "                "              "<imeout>  A timeout in millisenconds how long to wait (e.g. 500)\n";
+        lout <<          "                "              "<label>   A label until which everything is skipped in case of timeout\n";
         lout << endl;
         return true;
@@ -200,4 +210,11 @@
                 usleep(1);
 
+            if (l->second->GetState()!=state)
+            {
+                int label = -1;
+                in >> label;
+                T::SetLabel(label);
+            }
+
             return true;
         }
@@ -205,5 +222,6 @@
         if (str[0]=='#')
         {
-            lout << Tools::Trim(str.substr(1)) << endl;
+            //lout << Tools::Trim(str.substr(1)) << endl;
+            fImp->Info(Tools::Trim(str.substr(1)));
             return true;
         }
@@ -229,4 +247,6 @@
         return ProcessCommand(str);
     }
+
+    void SetReceiver(MessageImp &imp) { fImp = &imp; }
 };
 
