FACT++  1.0
int ConnectionAgilent::GetState ( )
inline

Definition at line 270 of file agilentctrl.cc.

References Agilent::Data::fCurrentMeasured, fMode, Agilent::Data::fVoltageMeasured, Agilent::Data::fVoltageSet, State::kConnected, State::kDisconnected, Agilent::State::kVoltageHigh, Agilent::State::kVoltageLow, Agilent::State::kVoltageOff, and Agilent::State::kVoltageOn.

271  {
272  if (!IsConnected())
273  return State::kDisconnected;
274 
275  if (fLastReceived+boost::posix_time::seconds(fInterval*2)<Time())
276  return State::kDisconnected;
277 
278  if (fData.fCurrentMeasured<0)
279  return State::kConnected;
280 
281  if (fData.fVoltageMeasured<0.1)
282  return State::kVoltageOff;
283 
285  return State::kVoltageLow;
286 
288  return State::kVoltageHigh;
289 
290  return State::kVoltageOn;
291  }
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
uint16_t fInterval
Definition: agilentctrl.cc:33
bool IsConnected() const
Definition: Connection.h:145
float fCurrentMeasured
float fVoltageMeasured