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

Definition at line 428 of file agilentctrl.cc.

References StateMachineAgilent< T, S >::Disconnect(), State::kConnected, State::kDisconnected, Agilent::State::kVoltageHigh, Agilent::State::kVoltageLow, Agilent::State::kVoltageOff, Agilent::State::kVoltageOn, StateMachineAgilent< T, S >::PowerCycle(), StateMachineAgilent< T, S >::Reconnect(), StateMachineAgilent< T, S >::SetPower(), and StateMachineAgilent< T, S >::SetVerbosity().

428  :
429  StateMachineAsio<T>(out, "AGILENT_CONTROL_"+S::fMode), fAgilent(*this, *this)
430  {
431  // State names
432  T::AddStateName(State::kDisconnected, "Disconnected",
433  "Agilent not connected via ethernet.");
434  T::AddStateName(State::kConnected, "Connected",
435  "Ethernet connection to Agilent established, but not data received yet.");
436 
437  T::AddStateName(State::kVoltageOff, "VoltageOff",
438  "The measured output voltage is lower than 0.1V");
439  T::AddStateName(State::kVoltageLow, "VoltageLow",
440  "The measured output voltage is higher than 0.1V, but lower than the command voltage");
441  T::AddStateName(State::kVoltageOn, "VoltageOn",
442  "The measured output voltage is higher than 0.1V and comparable to the command voltage");
443  T::AddStateName(State::kVoltageHigh, "VoltageHigh",
444  "The measured output voltage is higher than the command voltage!");
445 
446  // Verbosity commands
447  T::AddEvent("SET_VERBOSE", "B:1")
448  (bind(&StateMachineAgilent::SetVerbosity, this, placeholders::_1))
449  ("set verbosity state"
450  "|verbosity[bool]:disable or enable verbosity for received data (yes/no)");
451 
452  T::AddEvent("SET_DEBUG_RX", "B:1")
453  (bind(&StateMachineAgilent::SetVerbosity, this, placeholders::_1))
454  ("set debug state"
455  "|debug[bool]:disable or enable verbosity for received raw data (yes/no)");
456 
457  T::AddEvent("SET_POWER", "B:1")
458  (bind(&StateMachineAgilent::SetPower, this, placeholders::_1))
459  ("Enable or disable power output"
460  "|output[bool]:set power output to 'on' or 'off'");
461 
462  T::AddEvent("POWER_CYCLE", "S:1")
463  (bind(&StateMachineAgilent::PowerCycle, this, placeholders::_1))
464  ("Power cycle the power output"
465  "|delay[short]:Defines the delay between switching off and on.");
466 
467 
468  // Conenction commands
469  T::AddEvent("DISCONNECT", State::kConnected)
470  (bind(&StateMachineAgilent::Disconnect, this))
471  ("disconnect from ethernet");
472 
473  T::AddEvent("RECONNECT", "O", State::kDisconnected, State::kConnected)
474  (bind(&StateMachineAgilent::Reconnect, this, placeholders::_1))
475  ("(Re)connect ethernet connection to Agilent, a new address can be given"
476  "|[host][string]:new ethernet address in the form <host:port>");
477 
478  fAgilent.StartConnect();
479  }
int Reconnect(const EventImp &evt)
Definition: agilentctrl.cc:346
int PowerCycle(const EventImp &evt)
Definition: agilentctrl.cc:410
int SetPower(const EventImp &evt)
Definition: agilentctrl.cc:400
int SetVerbosity(const EventImp &evt)
Definition: agilentctrl.cc:380

+ Here is the call graph for this function: