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

Definition at line 2025 of file smartfact.cc.

References EventImp::GetJavaDate(), EventImp::Ptr(), and temp.

Referenced by StateMachineSmartFACT().

2026  {
2027  if (!CheckDataSize(d, "Temperature:Data", 3*sizeof(float)))
2028  return GetCurrentState();
2029 
2030  const float *temp = d.Ptr<float>();
2031 
2032  ostringstream out;
2033 
2034  out << fixed << setprecision(1);
2035  out << d.GetJavaDate() << '\n';
2036 
2037  out << GetTempColor(temp[1]) << '\t' << temp[1] << '\n';
2038  out << GetTempColor(temp[0]) << '\t' << temp[0] << '\n';
2039  out << GetTempColor(temp[2]) << '\t' << temp[2] << '\n';
2040 
2041  ofstream(fPath+"/temperature.data") << out.str();
2042 
2043  fTemperatureControlHist.push_back(temp[0]);
2044  if (fTemperatureControlHist.size()>60) // 1h
2045  fTemperatureControlHist.pop_front();
2046 
2047  WriteHist(d, "hist-temperaturecontrol",
2048  fTemperatureControlHist, 45, 0);
2049 
2050  return GetCurrentState();
2051  }
string GetTempColor(float t)
Definition: smartfact.cc:2014
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
void WriteHist(const EventImp &d, const string &fname, const T &t, double scale, double offset=0)
Definition: smartfact.cc:752
float temp
Definition: HeadersPFmini.h:56
uint64_t GetJavaDate() const
Definition: EventImp.cc:303
deque< float > fTemperatureControlHist
Definition: smartfact.cc:560
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: