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

Definition at line 848 of file FactGui.h.

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

Referenced by infoHandler().

849  {
850  if (d.size()==0)
851  {
852  fFadRefClockMin->setEnabled(false);
853  fFadRefClockMax->setEnabled(false);
854  SetLedColor(fFadLedRefClock, kLedGray, d.time);
855  return;
856  }
857 
858  if (!CheckSize(d, sizeof(uint16_t)+40*sizeof(float)))
859  return;
860 
861  const float *ptr = d.ptr<float>(2);
862 
863  fFadRefClockMin->setEnabled(true);
864  fFadRefClockMax->setEnabled(true);
865 
866  float min = FLT_MAX;
867  float max = -FLT_MAX;
868  for (int i=0; i<40; i++)
869  {
870  if (!finite(ptr[i]))
871  continue;
872 
873  if (ptr[i]<min)
874  min = ptr[i];
875  if (ptr[i]>max)
876  max = ptr[i];
877  }
878 
879  fFadRefClockMin->setValue(min);
880  fFadRefClockMax->setValue(max);
881 
882  const int64_t diff = int64_t(max) - int64_t(min);
883 
884  SetLedColor(fFadLedRefClock, abs(diff)>3?kLedRed:kLedGreen, d.time);
885 
886  handleFadToolTip(d.time, fFadLedRefClock, ptr);
887  }
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: