FACT++  1.0
int StateMachineSmartFACT::HandleFscHumidity ( const EventImp d)
inlineprivate

Definition at line 1904 of file smartfact.cc.

References EventImp::Ptr(), and t.

Referenced by StateMachineSmartFACT().

1905  {
1906  if (!CheckDataSize(d, "FscControl:Humidity", 5*4))
1907  return GetCurrentState();
1908 
1909  const float *ptr = d.Ptr<float>(4);
1910 
1911  double avg =0;
1912  int num = 0;
1913 
1914  for (const float *t=ptr; t<ptr+4; t++)
1915  if (*t>0 && *t<=100 && t!=ptr+2 /*excl broken sensor*/)
1916  {
1917  avg += *t;
1918  num++;
1919  }
1920 
1921  fFscControlHumidityAvg = num>0 ? avg/num : 0;
1922 
1923  return GetCurrentState();
1924  }
int GetCurrentState() const
return the current state of the machine
bool CheckDataSize(const EventImp &d, const char *name, size_t size, bool min=false)
Definition: smartfact.cc:669
TT t
Definition: test_client.c:26
const T * Ptr(size_t offset=0) const
Definition: EventImp.h:74

+ Here is the call graph for this function:

+ Here is the caller graph for this function: