FACT++  1.0
int UIConnector::SetupConfiguration ( Configuration conf)
slot

Definition at line 2264 of file RawEventsViewer.cc.

References RawDataViewer::assignPixelMapFile(), BasicGlCamera::bb, Configuration::Get(), BasicGlCamera::gg, Configuration::Has(), i, BasicGlCamera::rr, BasicGlCamera::ss, and Configuration::Vec().

Referenced by main().

2265 {
2266  RawDataViewer *canvas = GLWindow;
2267 
2268  if (conf.Has("mappingFile"))
2269  {
2270  canvas->assignPixelMapFile(conf.Get<string>("mappingFile"));
2271  }
2272  else
2273  canvas->assignPixelMapFile("");
2274 
2275  if (conf.Has("color.range"))
2276  {
2277  vector<double> value = conf.Vec<double>("color.range");
2278  if (value.size() != 5)
2279  {
2280  cout << "Error, colorRange option should have exactly 5 double values" << endl;
2281  return -1;
2282  }
2283  for (int i=0;i<5;i++)
2284  canvas->ss[i] = value[i];
2285  }
2286 
2287  if (conf.Has("color.red"))
2288  {
2289  vector<double> value = conf.Vec<double>("color.red");
2290  if (value.size() != 5)
2291  {
2292  cout << "Error, colorRed option should have exactly 5 double values" << endl;
2293  return -1;
2294  }
2295  for (int i=0;i<5;i++)
2296  canvas->rr[i] = value[i];
2297  }
2298 
2299  if (conf.Has("color.green"))
2300  {
2301  vector<double> value = conf.Vec<double>("color.green");
2302  if (value.size() != 5)
2303  {
2304  cout << "Error, colorGreen option should have exactly 5 double values" << endl;
2305  return -1;
2306  }
2307  for (int i=0;i<5;i++)
2308  canvas->gg[i] = value[i];
2309  }
2310 
2311  if (conf.Has("color.blue"))
2312  {
2313  vector<double> value = conf.Vec<double>("color.blue");
2314  if (value.size() != 5)
2315  {
2316  cout << "Error, colorBlue option should have exactly 5 double values" << endl;
2317  return -1;
2318  }
2319  for (int i=0;i<5;i++)
2320  canvas->bb[i] = value[i];
2321  }
2322 
2323  colorRange0->setValue(canvas->ss[0]);
2324  colorRange1->setValue(canvas->ss[1]);
2325  colorRange2->setValue(canvas->ss[2]);
2326  colorRange3->setValue(canvas->ss[3]);
2327  colorRange4->setValue(canvas->ss[4]);
2328  redValue0->setValue(canvas->rr[0]);
2329  redValue1->setValue(canvas->rr[1]);
2330  redValue2->setValue(canvas->rr[2]);
2331  redValue3->setValue(canvas->rr[3]);
2332  redValue4->setValue(canvas->rr[4]);
2333  greenValue0->setValue(canvas->gg[0]);
2334  greenValue1->setValue(canvas->gg[1]);
2335  greenValue2->setValue(canvas->gg[2]);
2336  greenValue3->setValue(canvas->gg[3]);
2337  greenValue4->setValue(canvas->gg[4]);
2338  blueValue0->setValue(canvas->bb[0]);
2339  blueValue1->setValue(canvas->bb[1]);
2340  blueValue2->setValue(canvas->bb[2]);
2341  blueValue3->setValue(canvas->bb[3]);
2342  blueValue4->setValue(canvas->bb[4]);
2343 
2344  if (conf.Has("drs"))
2345  {
2346  const QString qstr(conf.Get<string>("drs").c_str());
2347  calibFileSelected(qstr);
2348  }
2349 
2350  if (conf.Has("file"))
2351  {
2352  const QString qstr(conf.Get<string>("file").c_str());
2353  fileSelected(qstr);
2354  }
2355 
2356 
2357  return 0;
2358 }
void assignPixelMapFile(const string &map="")
void fileSelected(QString file)
int i
Definition: db_dim_client.c:21
T Get(const std::string &var)
std::vector< T > Vec(const std::string &var)
void calibFileSelected(QString file)
bool Has(const std::string &var)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: