Changeset 10524 for trunk/FACT++/gui
- Timestamp:
- 05/03/11 10:02:55 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r10521 r10524 26 26 #include "TMarker.h" 27 27 #include "TColor.h" 28 #include "TQtTimer.h" 29 30 #define HAS_ROOT 28 31 29 32 using namespace std; 30 class Camera : public TObject 31 { 32 typedef pair<double,double> Position; 33 typedef vector<Position> Positions; 34 Positions fGeom; 33 34 // ######################################################################### 35 36 class Camera : public TObject 37 { 38 typedef pair<double,double> Position; 39 typedef vector<Position> Positions; 40 41 Positions fGeom; 35 42 36 43 void CreatePalette() 37 38 39 double ss[5] = {0., 0.10, 0.45, 0.75, 1.00};40 double rr[5] = {0., 0.35, 0.85, 1.00, 1.00};41 double gg[5] = {0., 0.10, 0.20, 0.73, 1.00};42 double bb[5] = {0., 0.03, 0.06, 0.00, 1.00};43 44 { 45 /* 46 double ss[5] = {0., 0.10, 0.45, 0.75, 1.00}; 47 double rr[5] = {0., 0.35, 0.85, 1.00, 1.00}; 48 double gg[5] = {0., 0.10, 0.20, 0.73, 1.00}; 49 double bb[5] = {0., 0.03, 0.06, 0.00, 1.00}; 50 */ 44 51 double ss[5] = {0., 0.25, 0.50, 0.75, 1.00}; 45 52 double rr[5] = {0., 0.00, 0.00, 1.00, 1.00}; … … 56 63 void CreateGeometry() 57 64 { 58 const double gsSin60 = sqrt(3.)/2; 65 const double gsSin60 = sqrt(3.)/2; 59 66 60 67 const int rings = 23; … … 298 305 fData = data; 299 306 } 300 301 302 }; 307 }; 308 309 // ######################################################################### 303 310 304 311 … … 317 324 bool Exec() { fFunction(*this); return true; } 318 325 }; 326 327 vector<bool> fFtuDisabled; 319 328 320 329 DimStampedInfo fDimDNS; … … 852 861 853 862 // ---------------------------------------------- 854 863 #ifdef HAS_ROOT 855 864 TCanvas *c = fFtmTempCanv->GetCanvas(); 856 865 … … 883 892 c->Modified(); 884 893 c->Update(); 894 #endif 885 895 } 886 896 … … 932 942 fEnableTimeMarker->setChecked(sdata.HasTimeMarker()); 933 943 934 cout << hex << sdata.fActiveFTU << dec << endl;935 936 for (int i=0; i<64; i++)937 std::cout << (sdata.fActiveFTU&(1<<i) ? 1 : 0);938 std::cout << std::endl;939 940 944 for (int i=0; i<40; i++) 945 { 941 946 if (!sdata.IsActive(i)) 947 { 942 948 fFtuLED[i]->setIcon(QIcon(":/Resources/icons/gray circle 1.png")); 949 fFtuDisabled[i] = true; 950 } 943 951 else 944 fFtuLED[i]->setIcon(QIcon(":/Resources/icons/green circle 1.png")); 945 952 { 953 if (fFtuDisabled[i]) 954 { 955 fFtuLED[i]->setIcon(QIcon(":/Resources/icons/green circle 1.png")); 956 fFtuDisabled[i] = false; 957 } 958 } 959 } 960 961 #ifdef HAS_ROOT 946 962 Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera"); 947 963 for (int i=0; i<1438; i++) 948 964 cam->SetEnable(i, sdata.IsEnabled(i)); 965 #endif 949 966 950 967 const int patch1 = fThresholdIdx->value(); … … 1013 1030 fFtuAnswersCrate3->setValue(sdata.fNumBoardsCrate[3]); 1014 1031 1015 cout << "FtuList received: fActiveFTU not handled yet." << endl; 1016 1032 // Same: When error received: Needs decoding 1017 1033 for (int i=0; i<40; i++) 1018 1034 { 1019 1035 if (sdata.IsActive(i)) 1020 1036 { 1021 if (sdata.fPing[i] >0)1037 if (sdata.fPing[i]==0) 1022 1038 fFtuLED[i]->setIcon(QIcon(":/Resources/icons/red circle 1.png")); 1023 else 1039 1040 if (sdata.fPing[i]==1) 1024 1041 fFtuLED[i]->setIcon(QIcon(":/Resources/icons/green circle 1.png")); 1025 //if (sdata.fCRC[i]>0) 1026 // fFtuLED[i]->setIcon(QIcon(":/Resources/icons/warning 1.png")); 1042 1043 if (sdata.fPing[i]>1) 1044 fFtuLED[i]->setIcon(QIcon(":/Resources/icons/orange circle 1.png")); 1045 1046 fFtuDisabled[i] = false; 1027 1047 } 1028 1048 else 1049 { 1029 1050 fFtuLED[i]->setIcon(QIcon(":/Resources/icons/gray circle 1.png")); 1051 fFtuDisabled[i] = true; 1052 } 1053 1030 1054 } 1031 1055 } … … 1035 1059 if (d.size()==0) 1036 1060 return; 1061 1037 1062 const Converter conv(d.format); 1038 1063 cout << "Error:" << endl; … … 1102 1127 fStatusLoggerLed->setIcon(QIcon(":/Resources/icons/green circle 1.png")); 1103 1128 1104 cout << "enable " << s.index << " " << enable << endl;1105 1129 fLoggerWidget->setEnabled(enable); 1106 1130 } … … 1389 1413 } 1390 1414 1415 #ifdef HAS_ROOT 1391 1416 void slot_RootEventProcessed(TObject *obj, unsigned int evt, TCanvas *) 1392 1417 { … … 1398 1423 // kEnterEvent // TCanvas processed QEvent enterEvent 1399 1424 // kLeaveEvent // TCanvas processed QEvent leaveEvent 1400 1401 1425 if (dynamic_cast<TCanvas*>(obj)) 1402 1426 return; … … 1476 1500 { 1477 1501 gSystem->ProcessEvents(); 1478 QTimer::singleShot(100, this, SLOT(slot_RootUpdate())); 1479 } 1502 QTimer::singleShot(0, this, SLOT(slot_RootUpdate())); 1503 } 1504 1480 1505 void on_fThresholdIdx_valueChanged(int idx) 1481 1506 { … … 1483 1508 ChoosePatch(*cam, idx); 1484 1509 } 1510 #endif 1485 1511 1486 1512 TGraph fGraphFtmTemp[4]; … … 1490 1516 public: 1491 1517 FactGui() : 1518 fFtuDisabled(40), 1492 1519 fDimDNS("DIS_DNS/VERSION_NUMBER", 1, int(0), this), 1493 1520 … … 1551 1578 1552 1579 // -------------------------------------------------------------------------- 1553 1580 #ifdef HAS_ROOT 1554 1581 TCanvas *c = fFtmTempCanv->GetCanvas(); 1555 1582 c->SetBit(TCanvas::kNoContextMenu); … … 1608 1635 ChoosePixel(*cam, 1); 1609 1636 1610 QTimer::singleShot(100, this, SLOT(slot_RootUpdate()));1637 // QTimer::singleShot(0, this, SLOT(slot_RootUpdate())); 1611 1638 1612 1639 //widget->setMouseTracking(true); … … 1619 1646 fRatesCanv->EnableSignalEvents(kMouseMoveEvent|kMouseReleaseEvent|kMouseDoubleClickEvent); 1620 1647 1621 connect(fRatesCanv, SIGNAL( RootEventProcessed(TObject *, unsigned int, TCanvas *)), 1622 this, SLOT (slot_RootEventProcessed(TObject *, unsigned int, TCanvas *))); 1623 connect(fFtmTempCanv, SIGNAL( RootEventProcessed(TObject *, unsigned int, TCanvas *)), 1624 this, SLOT (slot_RootEventProcessed(TObject *, unsigned int, TCanvas *))); 1625 } 1648 connect(fRatesCanv, SIGNAL( RootEventProcessed(TObject*, unsigned int, TCanvas*)), 1649 this, SLOT (slot_RootEventProcessed(TObject*, unsigned int, TCanvas*))); 1650 connect(fFtmTempCanv, SIGNAL( RootEventProcessed(TObject*, unsigned int, TCanvas*)), 1651 this, SLOT (slot_RootEventProcessed(TObject*, unsigned int, TCanvas*))); 1652 #endif 1653 } 1654 1626 1655 ~FactGui() 1627 1656 {
Note:
See TracChangeset
for help on using the changeset viewer.