Changeset 10665
- Timestamp:
- 05/11/11 16:24:11 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r10650 r10665 353 353 }; 354 354 355 void SetLedColor(QPushButton *button, LedColor_t col )355 void SetLedColor(QPushButton *button, LedColor_t col, const Time &t) 356 356 { 357 357 switch (col) … … 378 378 } 379 379 380 button->setToolTip("Last change: "+QDateTime::currentDateTimeUtc().toString()+" UTC"); 380 //button->setToolTip("Last change: "+QDateTime::currentDateTimeUtc().toString()+" UTC"); 381 button->setToolTip(("Last change: "+t.GetAsStr()+" UTC").c_str()); 381 382 } 382 383 … … 702 703 str << "V" << version/100 << 'r' << version%100; 703 704 704 SetLedColor(fStatusDNSLed, version==0 ? kLedRed : kLedGreen );705 SetLedColor(fStatusDNSLed, version==0 ? kLedRed : kLedGreen, Time()); 705 706 706 707 fStatusDNSLabel->setText(version==0?"Offline":str.str().c_str()); … … 809 810 const uint32_t files = d.get<uint32_t>(); 810 811 811 SetLedColor(fLoggerLedLog, files&1 ? kLedGreen : kLedGray );812 SetLedColor(fLoggerLedRep, files&2 ? kLedGreen : kLedGray );813 SetLedColor(fLoggerLedFits, files&4 ? kLedGreen : kLedGray );812 SetLedColor(fLoggerLedLog, files&1 ? kLedGreen : kLedGray, d.time); 813 SetLedColor(fLoggerLedRep, files&2 ? kLedGreen : kLedGray, d.time); 814 SetLedColor(fLoggerLedFits, files&4 ? kLedGreen : kLedGray, d.time); 814 815 } 815 816 … … 826 827 const uint32_t files = d.get<uint32_t>(); 827 828 828 SetLedColor(fLoggerLedLog, files&1 ? kLedGreen : kLedGray );829 SetLedColor(fLoggerLedRep, files&2 ? kLedGreen : kLedGray );830 SetLedColor(fLoggerLedFits, files&4 ? kLedGreen : kLedGray );829 SetLedColor(fLoggerLedLog, files&1 ? kLedGreen : kLedGray, d.time); 830 SetLedColor(fLoggerLedRep, files&2 ? kLedGreen : kLedGray, d.time); 831 SetLedColor(fLoggerLedFits, files&4 ? kLedGreen : kLedGray, d.time); 831 832 } 832 833 … … 945 946 FTM::DimStaticData fFtmStaticData; 946 947 947 void SetFtuLed(int idx, int counter )948 void SetFtuLed(int idx, int counter, const Time &t) 948 949 { 949 950 if (counter==0 || counter>3) … … 955 956 const LedColor_t col[4] = { kLedGray, kLedGreen, kLedOrange, kLedRed }; 956 957 957 SetLedColor(fFtuLED[idx], col[counter] );958 SetLedColor(fFtuLED[idx], col[counter], t); 958 959 959 960 fFtuStatus[idx] = counter; 960 961 } 961 962 962 void SetFtuStatusLed( )963 void SetFtuStatusLed(const Time &t) 963 964 { 964 965 const int max = fFtuStatus.max(); … … 967 968 { 968 969 case 0: 969 SetLedColor(fStatusFTULed, kLedGray );970 SetLedColor(fStatusFTULed, kLedGray, t); 970 971 fStatusFTULabel->setText("All disabled"); 971 972 fStatusFTULabel->setToolTip("All FTUs are disabled"); … … 973 974 974 975 case 1: 975 SetLedColor(fStatusFTULed, kLedGreen );976 SetLedColor(fStatusFTULed, kLedGreen, t); 976 977 fStatusFTULabel->setToolTip("Communication with FTU is smooth."); 977 978 fStatusFTULabel->setText("ok"); … … 979 980 980 981 case 2: 981 SetLedColor(fStatusFTULed, kLedOrange );982 SetLedColor(fStatusFTULed, kLedOrange, t); 982 983 fStatusFTULabel->setText("Warning"); 983 984 fStatusFTULabel->setToolTip("At least one FTU didn't answer immediately"); … … 985 986 986 987 case 3: 987 SetLedColor(fStatusFTULed, kLedRed );988 SetLedColor(fStatusFTULed, kLedRed, t); 988 989 fStatusFTULabel->setToolTip("At least one FTU didn't answer!"); 989 990 fStatusFTULabel->setText("ERROR"); … … 1037 1038 { 1038 1039 if (!sdata.IsActive(i)) 1039 SetFtuLed(i, -1 );1040 SetFtuLed(i, -1, d.time); 1040 1041 else 1041 1042 { 1042 1043 if (fFtuStatus[i]==0) 1043 SetFtuLed(i, 1 );1044 SetFtuLed(i, 1, d.time); 1044 1045 } 1045 1046 fFtuLED[i]->setChecked(false); 1046 1047 } 1047 SetFtuStatusLed( );1048 SetFtuStatusLed(d.time); 1048 1049 1049 1050 #ifdef HAS_ROOT … … 1121 1122 1122 1123 for (int i=0; i<40; i++) 1123 SetFtuLed(i, sdata.IsActive(i) ? sdata.fPing[i] : -1 );1124 1125 SetFtuStatusLed( );1124 SetFtuLed(i, sdata.IsActive(i) ? sdata.fPing[i] : -1, d.time); 1125 1126 SetFtuStatusLed(d.time); 1126 1127 } 1127 1128 … … 1133 1134 const FTM::DimError &sdata = *reinterpret_cast<const FTM::DimError*>(d.ptr()); 1134 1135 1135 SetFtuLed(sdata.fError.fDestAddress , sdata.fError.fNumCalls );1136 SetFtuStatusLed( );1136 SetFtuLed(sdata.fError.fDestAddress , sdata.fError.fNumCalls, d.time); 1137 SetFtuStatusLed(d.time); 1137 1138 1138 1139 // Write to special window! … … 1145 1146 bool fChatOnline; 1146 1147 1147 void handleStateChanged(const Time & /*time*/, const std::string &server,1148 void handleStateChanged(const Time &time, const std::string &server, 1148 1149 const State &s) 1149 1150 { … … 1157 1158 1158 1159 if (s.index<FTM::kDisconnected) // No Dim connection 1159 SetLedColor(fStatusFTMLed, kLedGray );1160 SetLedColor(fStatusFTMLed, kLedGray, time); 1160 1161 if (s.index==FTM::kDisconnected) // Dim connection / FTM disconnected 1161 SetLedColor(fStatusFTMLed, kLedYellow );1162 SetLedColor(fStatusFTMLed, kLedYellow, time); 1162 1163 if (s.index==FTM::kConnected || s.index==FTM::kIdle) // Dim connection / FTM connected 1163 1164 { 1164 SetLedColor(fStatusFTMLed, kLedGreen );1165 SetLedColor(fStatusFTMLed, kLedGreen, time); 1165 1166 enable = true; 1166 1167 } … … 1172 1173 if (!enable) 1173 1174 { 1174 SetLedColor(fStatusFTULed, kLedGray );1175 SetLedColor(fStatusFTULed, kLedGray, time); 1175 1176 fStatusFTULabel->setText("Offline"); 1176 1177 fStatusFTULabel->setToolTip("FTM is not online."); … … 1184 1185 1185 1186 if (s.index<FTM::kDisconnected) // No Dim connection 1186 SetLedColor(fStatusFADLed, kLedGray );1187 SetLedColor(fStatusFADLed, kLedGray, time); 1187 1188 if (s.index==FTM::kDisconnected) // Dim connection / FTM disconnected 1188 SetLedColor(fStatusFADLed, kLedYellow );1189 SetLedColor(fStatusFADLed, kLedYellow, time); 1189 1190 if (s.index==FTM::kConnected) // Dim connection / FTM connected 1190 SetLedColor(fStatusFADLed, kLedGreen );1191 SetLedColor(fStatusFADLed, kLedGreen, time); 1191 1192 } 1192 1193 … … 1199 1200 1200 1201 if (s.index<=30) // Ready/Waiting 1201 SetLedColor(fStatusLoggerLed, kLedYellow );1202 SetLedColor(fStatusLoggerLed, kLedYellow, time); 1202 1203 if (s.index<-1) // Offline 1203 1204 { 1204 SetLedColor(fStatusLoggerLed, kLedGray );1205 SetLedColor(fStatusLoggerLed, kLedGray, time); 1205 1206 enable = false; 1206 1207 } 1207 1208 if (s.index>=0x100) // Error 1208 SetLedColor(fStatusLoggerLed, kLedRed );1209 SetLedColor(fStatusLoggerLed, kLedRed, time); 1209 1210 if (s.index==40) // Logging 1210 SetLedColor(fStatusLoggerLed, kLedGreen );1211 SetLedColor(fStatusLoggerLed, kLedGreen, time); 1211 1212 1212 1213 fLoggerWidget->setEnabled(enable); … … 1219 1220 fChatOnline = s.index==0; 1220 1221 1221 SetLedColor(fStatusChatLed, fChatOnline ? kLedGreen : kLedRed );1222 SetLedColor(fStatusChatLed, fChatOnline ? kLedGreen : kLedRed, time); 1222 1223 1223 1224 fChatSend->setEnabled(fChatOnline); … … 1229 1230 fStatusSchedulerLabel->setText(s.name.c_str()); 1230 1231 1231 SetLedColor(fStatusSchedulerLed, s.index>=0 ? kLedGreen : kLedRed );1232 SetLedColor(fStatusSchedulerLed, s.index>=0 ? kLedGreen : kLedRed, time); 1232 1233 } 1233 1234 }
Note:
See TracChangeset
for help on using the changeset viewer.