FACT++  1.0
template<class T , class S >
int StateMachineDrive< T, S >::HandleWeatherData ( const EventImp evt)
inlineprivate

Definition at line 1612 of file drivectrl.cc.

References EventImp::GetSize(), EventImp::GetTime(), Weather::hum, Time::none, Weather::press, EventImp::Ptr(), Weather::temp, and Weather::time.

Referenced by StateMachineDrive< T, S >::StateMachineDrive().

1613  {
1614  if (!CheckEventSize(evt.GetSize(), "HandleWeatherData", 7*4+2))
1615  {
1617  return T::GetCurrentState();
1618  }
1619 
1620  const float *ptr = evt.Ptr<float>(2);
1621 
1622  fWeather.temp = ptr[0];
1623  fWeather.hum = ptr[2];
1624  fWeather.press = ptr[3];
1625  fWeather.time = evt.GetTime();
1626 
1627  return T::GetCurrentState();
1628  }
float press
Definition: drivectrl.cc:111
float hum
Definition: drivectrl.cc:109
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
float temp
Definition: drivectrl.cc:110
virtual Time GetTime() const
Definition: EventImp.h:57
Time time
Definition: drivectrl.cc:112
bool CheckEventSize(size_t has, const char *name, size_t size)
Definition: cosyctrl.cc:804
Do not initialize the time.
Definition: Time.h:51
const T * Ptr(size_t offset=0) const
Definition: EventImp.h:74
virtual size_t GetSize() const
Definition: EventImp.h:55

+ Here is the call graph for this function:

+ Here is the caller graph for this function: