- Timestamp:
- 05/03/11 20:53:22 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r10544 r10547 902 902 FTM::DimStaticData fFtmStaticData; 903 903 904 int fFtuStatus; 905 906 904 907 void SetFtuLed(int idx, int counter) 905 908 { … … 908 911 909 912 if (counter==0) 913 { 910 914 fFtuLED[idx]->setIcon(QIcon(":/Resources/icons/red circle 1.png")); 911 915 fStatusFTULed->setIcon(QIcon(":/Resources/icons/red circle 1.png")); 916 fStatusFTULabel->setToolTip("At least one FTU didn't answer!"); 917 fStatusFTULabel->setText("ERROR"); 918 fFtuStatus = 0; 919 } 912 920 if (counter==1) 921 { 913 922 fFtuLED[idx]->setIcon(QIcon(":/Resources/icons/green circle 1.png")); 923 if (fFtuStatus<0) 924 { 925 fStatusFTULed->setIcon(QIcon(":/Resources/icons/green circle 1.png")); 926 fStatusFTULabel->setToolTip("Communication with FTU is smooth."); 927 fStatusFTULabel->setText("Ok"); 928 fFtuStatus = 1; 929 } 930 } 914 931 915 932 if (counter>1) 933 { 916 934 fFtuLED[idx]->setIcon(QIcon(":/Resources/icons/orange circle 1.png")); 935 if (fFtuStatus!=0) 936 { 937 fStatusFTULed->setIcon(QIcon(":/Resources/icons/orange circle 1.png")); 938 fStatusFTULabel->setText("Warning"); 939 fStatusFTULabel->setToolTip("At least one FTU didn't answer immediately"); 940 fFtuStatus = 2; 941 } 942 } 917 943 918 944 } … … 964 990 fEnableTimeMarker->setChecked(sdata.HasTimeMarker()); 965 991 992 bool active = false; 966 993 for (int i=0; i<40; i++) 967 994 { … … 973 1000 else 974 1001 { 1002 active = true; 975 1003 if (fFtuDisabled[i]) 976 1004 { … … 981 1009 } 982 1010 1011 if (!active) 1012 DisableStatusLedFtu(); 1013 983 1014 #ifdef HAS_ROOT 984 1015 Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera"); … … 1014 1045 fFtmBoardId->setText(str1.str().c_str()); 1015 1046 fFtmFirmwareId->setText(str2.str().c_str()); 1047 } 1048 1049 void DisableStatusLedFtu() 1050 { 1051 fFtuStatus = -1; 1052 fStatusFTULed->setIcon(QIcon(":/Resources/icons/gray circle 1.png")); 1053 fStatusFTULabel->setText("All disabled"); 1054 fStatusFTULabel->setToolTip("All FTUs are disabled"); 1016 1055 } 1017 1056 … … 1054 1093 fFtuAnswersCrate3->setValue(sdata.fNumBoardsCrate[3]); 1055 1094 1056 // Same: When error received: Needs decoding 1095 DisableStatusLedFtu(); 1096 1057 1097 for (int i=0; i<40; i++) 1058 1098 { 1059 1099 const bool active = sdata.IsActive(i); 1060 1061 cout << i << ": " << active << " " << (int)sdata.fPing[i] << endl;1062 1100 1063 1101 SetFtuLed(i, active ? sdata.fPing[i] : -1); … … 1108 1146 fFtuWidget->setEnabled(enable); 1109 1147 fRatesWidget->setEnabled(enable); 1110 } 1148 1149 if (!enable) 1150 { 1151 fFtuStatus = -1; 1152 fStatusFTULed->setIcon(QIcon(":/Resources/icons/gray circle 1.png")); 1153 fStatusFTULabel->setText("Offline"); 1154 fStatusFTULabel->setToolTip("FTM is not online."); 1155 } 1156 } 1111 1157 1112 1158 if (server=="FAD_CONTROL") … … 1548 1594 fDimFtmStaticData ("FTM_CONTROL/STATIC_DATA", (void*)NULL, 0, this), 1549 1595 fDimFtmDynamicData ("FTM_CONTROL/DYNAMIC_DATA", (void*)NULL, 0, this) 1550 1551 1552 { 1596 { 1597 fTriggerWidget->setEnabled(false); 1598 fFtuWidget->setEnabled(false); 1599 fRatesWidget->setEnabled(false); 1600 fLoggerWidget->setEnabled(false); 1601 1602 fChatSend->setEnabled(false); 1603 fChatMessage->setEnabled(false); 1604 1553 1605 DimClient::sendCommand("CHAT/MSG", "GUI online."); 1554 1606 // + MessageDimRX … … 1565 1617 fDim.push_back(&fDimLoggerNumSubs); 1566 1618 fDim.push_back(&fDimDNS); 1567 1568 fTriggerWidget->setEnabled(false);1569 fFtuWidget->setEnabled(false);1570 fRatesWidget->setEnabled(false);1571 fLoggerWidget->setEnabled(false);1572 1619 1573 1620 // --------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.