FACT++  1.0
void FactGui::handleFadTemperature ( const DimData d)
inlineprivate

Definition at line 802 of file FactGui.h.

References i, DimData::ptr(), DimData::size(), and DimData::time.

Referenced by infoHandler().

803  {
804  if (d.size()==0)
805  {
806  fFadTempMin->setEnabled(false);
807  fFadTempMax->setEnabled(false);
808  SetLedColor(fFadLedTemp, kLedGray, d.time);
809  return;
810  }
811 
812  if (!CheckSize(d, sizeof(uint16_t)+160*sizeof(float)))
813  return;
814 
815  const float *ptr = d.ptr<float>(2);
816 
817  fFadTempMin->setEnabled(true);
818  fFadTempMax->setEnabled(true);
819 
820  float min = FLT_MAX;
821  float max = -FLT_MAX;
822 
823  vector<float> mn(40, FLT_MAX);
824  vector<float> mx(40, -FLT_MAX);
825  for (int i=0; i<160; i++)
826  {
827  if (!finite(ptr[i]))
828  continue;
829 
830  if (ptr[i]<min)
831  min = ptr[i];
832  if (ptr[i]>max)
833  max = ptr[i];
834 
835  if (ptr[i]<mn[i/4])
836  mn[i/4] = ptr[i];
837  if (ptr[i]>mx[i/4])
838  mx[i/4] = ptr[i];
839  }
840 
841  fFadTempMin->setValue(min);
842  fFadTempMax->setValue(max);
843 
844  handleFadToolTip(d.time, fFadTempMin, mn.data());
845  handleFadToolTip(d.time, fFadTempMax, mx.data());
846  }
int i
Definition: db_dim_client.c:21
bool CheckSize(const DimData &d, size_t sz, bool print=true) const
Definition: FactGui.h:639
void handleFadToolTip(const Time &time, QWidget *w, T *ptr)
Definition: FactGui.h:1436
void SetLedColor(QPushButton *button, LedColor_t col, const Time &t)
Definition: FactGui.h:156
const Time time
Definition: DimData.h:9
size_t size() const
Definition: DimData.h:39
const T * ptr(uint32_t offset=0) const
Definition: DimData.h:32

+ Here is the call graph for this function:

+ Here is the caller graph for this function: