Changeset 11967 for trunk/FACT++
- Timestamp:
- 09/05/11 16:27:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r11959 r11967 23 23 #include "src/tools.h" 24 24 #include "src/FAD.h" 25 #include "src/PixelMap.h" 25 26 26 27 … … 355 356 */ 356 357 // ######################################################################### 357 358 359 struct PixelMapEntry360 {361 int index;362 int cbpx;363 int gapd;364 int hv_board;365 int hv_channel;366 367 int crate() const { return cbpx/1000; }368 int board() const { return (cbpx/100)%10; }369 int patch() const { return (cbpx/10)%10; }370 int pixel() const { return cbpx%10; }371 int hw() const { return pixel()+patch()*9+board()*36+crate()*360; }372 int group() const { return pixel()>4; }373 int hv() const { return hv_channel+hv_board*32; }374 };375 376 class PixelMap : public vector<PixelMapEntry>377 {378 public:379 static const PixelMapEntry empty;380 381 PixelMap() : vector<PixelMapEntry>(1440)382 {383 }384 385 const PixelMapEntry &index(int idx) const386 {387 for (vector<PixelMapEntry>::const_iterator it=begin(); it!=end(); it++)388 if (it->index==idx)389 return *it;390 cerr << "PixelMap: index " << idx << " not found" << endl;391 return empty;392 }393 394 const PixelMapEntry &cbpx(int c) const395 {396 for (vector<PixelMapEntry>::const_iterator it=begin(); it!=end(); it++)397 if (it->cbpx==c)398 return *it;399 cerr << "PixelMap: cbpx " << c << " not found" << endl;400 return empty;401 }402 403 const PixelMapEntry &cbpx(int c, int b, int p, int px) const404 {405 return cbpx(px + p*9 + b*36 + c*360);406 }407 408 const PixelMapEntry &hv(int board, int channel) const409 {410 for (vector<PixelMapEntry>::const_iterator it=begin(); it!=end(); it++)411 if (it->hv_board==board && it->hv_channel==channel)412 return *it;413 cerr << "PixelMap: hv " << board << "/" << channel << " not found" << endl;414 return empty;415 }416 417 const PixelMapEntry &hv(int idx) const418 {419 return hv(idx/32, idx%32);420 }421 };422 423 const PixelMapEntry PixelMap::empty = { 0, 0, 0, 0, 0 };424 425 358 426 359 class FactGui : public MainWindow, public DimNetwork … … 509 442 kLedWarnTriangleBorder, 510 443 kLedWarnTriangle, 444 kLedInProgress, 511 445 }; 512 446 … … 549 483 case kLedWarnTriangleBorder: 550 484 button->setIcon(QIcon(":/Resources/icons/warning 4.png")); 485 break; 486 487 case kLedInProgress: 488 button->setIcon(QIcon(":/Resources/icons/in progress.png")); 551 489 break; 552 490 … … 2665 2603 SetLedColor(fStatusBiasLed, kLedYellow, time); 2666 2604 if (s.index==BIAS::kRamping) // Ramping 2667 SetLedColor(fStatusBiasLed, kLed Warn, time);2605 SetLedColor(fStatusBiasLed, kLedInProgress, time); 2668 2606 if (s.index==BIAS::kOverCurrent) // Over current 2669 2607 SetLedColor(fStatusBiasLed, kLedWarnBorder, time); … … 3615 3553 // -------------------------------------------------------------------------- 3616 3554 3555 if (!fPixelMap.Read("FACTmapV5.txt")) 3556 { 3557 cerr << "ERROR - Problems reading FACTmapV5.txt" << endl; 3558 exit(-1); 3559 } 3560 3561 /* 3617 3562 ifstream fin0("FACTmapV5.txt"); 3618 3563 … … 3656 3601 exit(-1); 3657 3602 } 3658 3603 */ 3659 3604 // -------------------------------------------------------------------------- 3660 3605 3661 3606 ifstream fin1("Trigger-Patches.txt"); 3662 3607 3663 l = 0; 3608 string buf; 3609 3610 int l = 0; 3664 3611 while (getline(fin1, buf, '\n')) 3665 3612 {
Note:
See TracChangeset
for help on using the changeset viewer.