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

Definition at line 2266 of file FactGui.h.

References PixelMapEntry::hv(), i, PixelMap::index(), DimData::ptr(), and DimData::time.

Referenced by infoHandler().

2267  {
2268  if (!CheckSize(d, (416+1+1+1+1+1+416+1+1)*sizeof(float)+sizeof(uint32_t)))
2269  return;
2270 
2271  const float *ptr = d.ptr<float>();
2272  const float *Uov = ptr+416+6;
2273 
2274  fVecFeedbackCurrents.assign(ptr, ptr+416);
2275 
2276  valarray<double> datc(0., 1440);
2277  valarray<double> datu(0., 1440);
2278 
2279  // fPatch converts from software id to software patch id
2280  for (int i=0; i<1440; i++)
2281  {
2282  const PixelMapEntry &entry = fPixelMap.index(i);
2283 
2284  datc[i] = fVecFeedbackCurrents[entry.hv()];
2285  datu[i] = Uov[entry.hv()];
2286 
2287  if (fVecBiasCurrent.size()>0)
2288  {
2289  fBiasCamA->SetEnable(i, uint16_t(fVecBiasCurrent[entry.hv()])!=0x8000);
2290  fBiasCamA->highlightPixel(i, fVecBiasCurrent[entry.hv()]<0);
2291  }
2292  }
2293 
2294  fBiasCamA->SetData(datc);
2295  fBiasCamA->updateCamera();
2296 
2297  UpdateBiasValues();
2298 
2299  // --------------------------------------------------------
2300 
2301  double avg = 0;
2302  double rms = 0;
2303 
2304  for (int i=0; i<320; i++)
2305  {
2306  avg += Uov[i];
2307  rms += Uov[i]*Uov[i];
2308  }
2309 
2310  avg /= 320;
2311  rms /= 320;
2312  rms = sqrt(rms-avg*avg);
2313 
2314 
2315  fFeedbackDevCam->SetData(datu);
2316  //fFeedbackCmdCam->SetData(cmd);
2317 
2318  fFeedbackDevCam->updateCamera();
2319  //fFeedbackCmdCam->updateCamera();
2320 
2321 #ifdef HAVE_ROOT
2322  UpdateFeedback(*fFeedbackDev, d.time, fGraphFeedbackDev, avg, rms);
2323  //UpdateFeedback(*fFeedbackCmd, d.time, fGraphFeedbackCmd, avgcmd, rmscmd);
2324 #endif
2325  }
vector< float > fVecFeedbackCurrents
Definition: FactGui.h:2264
int i
Definition: db_dim_client.c:21
bool CheckSize(const DimData &d, size_t sz, bool print=true) const
Definition: FactGui.h:639
const Time time
Definition: DimData.h:9
PixelMap fPixelMap
Definition: FactGui.h:73
void UpdateBiasValues()
Definition: FactGui.h:3352
int hv() const
Definition: PixelMap.h:42
const PixelMapEntry & index(int idx) const
Definition: PixelMap.h:107
vector< int16_t > fVecBiasCurrent
Definition: FactGui.h:2452
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: