FACT++  1.0
template<class T , class S >
StateMachineGPSControl< T, S >::StateMachineGPSControl ( ostream &  out = cout)
inline

Definition at line 431 of file gpsctrl.cc.

References StateMachineGPSControl< T, S >::Disconnect(), GPS::State::kConnected, GPS::State::kDisabled, GPS::State::kDisconnected, GPS::State::kEnabled, GPS::State::kLocked, StateMachineGPSControl< T, S >::Reconnect(), StateMachineGPSControl< T, S >::Send(), StateMachineGPSControl< T, S >::SendCommand(), and StateMachineGPSControl< T, S >::SetVerbosity().

431  :
432  StateMachineAsio<T>(out, "GPS_CONTROL"), fGPS(*this, *this)
433  {
434  // State names
435  T::AddStateName(GPS::State::kDisconnected, "Disconnected",
436  "No connection to web-server could be established recently");
437 
438  T::AddStateName(GPS::State::kConnected, "Connected",
439  "Connection established, but status still not known");
440 
441  T::AddStateName(GPS::State::kDisabled, "Disabled",
442  "Veto is on, no trigger will be emitted");
443 
444  T::AddStateName(GPS::State::kEnabled, "Enabled",
445  "System enabled, waiting for satellites");
446 
447  T::AddStateName(GPS::State::kLocked, "Locked",
448  "One trigger per second will be send, but the one at the exact minute is vetoed");
449 
450  // Commands
451  T::AddEvent("SEND_COMMAND", "C")
452  (bind(&StateMachineGPSControl::SendCommand, this, placeholders::_1))
453  ("Send command to GPS");
454 
455  // Verbosity commands
456  T::AddEvent("SET_VERBOSE", "B")
457  (bind(&StateMachineGPSControl::SetVerbosity, this, placeholders::_1))
458  ("set verbosity state"
459  "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data");
460 
461  T::AddEvent("ENABLE")
462  (bind(&StateMachineGPSControl::Send, this, "veto_60"))
463  ("Enable trigger signal once a second vetoed at every exact minute");
464 
465  T::AddEvent("DISABLE")
466  (bind(&StateMachineGPSControl::Send, this, "veto_on"))
467  ("Diable trigger output");
468 
469  // Conenction commands
470  T::AddEvent("DISCONNECT")
472  ("disconnect from ethernet");
473 
474  T::AddEvent("RECONNECT", "O")
475  (bind(&StateMachineGPSControl::Reconnect, this, placeholders::_1))
476  ("(Re)connect ethernet connection to GPS, a new address can be given"
477  "|[host][string]:new ethernet address in the form <host:port>");
478 
479  }
int Reconnect(const EventImp &evt)
Definition: gpsctrl.cc:384
int Send(const string &cmd)
Definition: gpsctrl.cc:412
int SetVerbosity(const EventImp &evt)
Definition: gpsctrl.cc:402
int SendCommand(const EventImp &evt)
Definition: gpsctrl.cc:419

+ Here is the call graph for this function: