Changeset 11045 for trunk/FACT++/src
- Timestamp:
- 06/16/11 21:27:59 (13 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/LocalControl.h
r10870 r11045 57 57 lout << " " << kUnderline << "Specific commands:" << endl; 58 58 lout << kBold << " st,states " << kReset << "Display a list of the available states with description." << endl; 59 lout << kBold << " .s " << kReset << "Wait for the state-machine to change to the given state." << endl; 60 lout << " " " .s <state> [<timeout>]" << endl; 61 lout << " " "<state> The state id (see 'states') for which to wait (e.g. 3)" << endl; 62 lout << " " "<imeout> A timeout in millisenconds how long to wait (e.g. 500)" << endl; 59 63 lout << endl; 60 64 return true; … … 83 87 if (fStateMachine) 84 88 fStateMachine->PrintListOfStates(lout); 89 return true; 90 } 91 92 if (str.substr(0, 3)==".s ") 93 { 94 istringstream in(str.substr(3)); 95 96 int state=-100, ms=0; 97 in >> state >> ms; 98 99 if (state==-100) 100 return true; 101 102 const Time timeout = Time()+boost::posix_time::millisec(ms); 103 104 const int target = atoi(str.c_str()+3); 105 while (fStateMachine->GetCurrentState()!=target && timeout>Time()) 106 usleep(1); 85 107 return true; 86 108 } -
trunk/FACT++/src/RemoteControl.h
r10494 r11045 130 130 lout << kBold << " svc,services " << kReset << "List all services in the network." << endl; 131 131 lout << kBold << " st,states " << kReset << "List all states in the network." << endl; 132 lout << kBold << " .s " << kReset << "Wait for the state-machine to change to the given state." << endl; 133 lout << " " " .s <server> <state> [<timeout>]" << endl; 134 lout << " " "<server> The server for which state to wait (e.g. FTM_CONTROL)" << endl; 135 lout << " " "<state> The state id (see 'states') for which to wait (e.g. 3)" << endl; 136 lout << " " "<imeout> A timeout in millisenconds how long to wait (e.g. 500)" << endl; 132 137 lout << endl; 133 138 return true; … … 168 173 } 169 174 175 if (str.substr(0, 3)==".s ") 176 { 177 istringstream in(str.substr(3)); 178 179 int state=-100, ms=0; 180 string server; 181 182 in >> server >> state >> ms; 183 if (state==-100) 184 return true; 185 186 const ClientList::const_iterator l = fClientList.find(server); 187 if (l==fClientList.end()) 188 return true; 189 190 const Time timeout = Time()+boost::posix_time::millisec(ms); 191 192 while (l->second->GetState()!=state && timeout>Time()) 193 usleep(1); 194 195 return true; 196 } 197 170 198 if (ReadlineColor::Process(lout, str)) 171 199 return true;
Note:
See TracChangeset
for help on using the changeset viewer.