Changeset 13992 for trunk/FACT++
- Timestamp:
- 05/30/12 18:16:27 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/smartfact.cc
r13957 r13992 193 193 const string arr = isday ? 194 194 fSunSetDarkTime.MinutesTo(time)+"↓" : 195 fSunRiseDa yTime.MinutesTo(time)+"↑";195 fSunRiseDarkTime.MinutesTo(time)+"↑"; 196 196 197 197 description += " ["+arr+"]"; … … 384 384 385 385 bool fFtmControlFtuOk; 386 387 deque<float> fRateControlThreshold; 386 388 387 389 uint64_t fRateScanDataId; … … 414 416 DimDescribedState fDimRateScan; 415 417 DimDescribedState fDimChatServer; 418 DimDescribedState fDimSkypeClient; 416 419 417 420 // ------------------------------------------------------------------- … … 612 615 ofstream(fPath+"/"+name+".data") << out.str(); 613 616 614 WriteBinary(d, " magicweather-"+name+"-hist", fMagicWeatherHist[i], max-min, min);617 WriteBinary(d, "hist-magicweather-"+name, fMagicWeatherHist[i], max-min, min); 615 618 } 616 619 … … 709 712 const double scale = stat.max>0 ? pow(10, ceil(log10(stat.max))) : 0; 710 713 711 WriteBinary(d, " tng-dust-hist", fTngWeatherDustHist, scale);714 WriteBinary(d, "hist-tng-dust", fTngWeatherDustHist, scale); 712 715 713 716 ostringstream out; … … 776 779 fDriveControlTrackingDevHist.pop_front(); 777 780 778 WriteBinary(d, " control-deviation-hist", fDriveControlTrackingDevHist, 120);781 WriteBinary(d, "hist-control-deviation", fDriveControlTrackingDevHist, 120); 779 782 780 783 ostringstream out; … … 873 876 874 877 // Write the 160 patch values to a file 875 WriteBinary(d, " feedback-deviation", dev, 1);878 WriteBinary(d, "cam-feedback-deviation", dev, 1); 876 879 877 880 const Statistics stat(dev, 3); … … 913 916 914 917 if (fDimBiasControl.state()==BIAS::State::kVoltageOn) 915 WriteBinary(d, " biascontrol-voltage", val, 10, 65);918 WriteBinary(d, "cam-biascontrol-voltage", val, 10, 65); 916 919 else 917 WriteBinary(d, " biascontrol-voltage", val, 75);920 WriteBinary(d, "cam-biascontrol-voltage", val, 75); 918 921 919 922 ostringstream out; … … 989 992 990 993 // Write the 160 patch values to a file 991 WriteBinary(d, " biascontrol-current", val, 100);994 WriteBinary(d, "cam-biascontrol-current", val, 100); 992 995 993 996 const Statistics stat(v, 0, 3); … … 1003 1006 1004 1007 // write the history to a file 1005 WriteBinary(d, " biascontrol-current-hist", fBiasControlCurrentHist, 100);1008 WriteBinary(d, "hist-biascontrol-current", fBiasControlCurrentHist, 100); 1006 1009 1007 1010 const string col0 = cal ? HTML::kGreen : HTML::kWhite; … … 1148 1151 // FIXME: Add statistics for all kind of rates 1149 1152 1150 WriteBinary(d, " ftmcontrol-triggerrate-hist",1153 WriteBinary(d, "hist-ftmcontrol-triggerrate", 1151 1154 fFtmControlTriggerRateHist, 100); 1152 WriteBinary(d, " ftmcontrol-boardrates",1155 WriteBinary(d, "cam-ftmcontrol-boardrates", 1153 1156 vector<float>(brates, brates+40), 10); 1154 WriteBinary(d, " ftmcontrol-patchrates",1157 WriteBinary(d, "cam-ftmcontrol-patchrates", 1155 1158 vector<float>(prates, prates+160), 10); 1156 1159 … … 1194 1197 vector<uint16_t> vecb(dat.fMultiplicity, dat.fMultiplicity+40); 1195 1198 1196 WriteBinary(d, " ftmcontrol-thresholds-patch", vecp, 1000);1197 WriteBinary(d, " ftmcontrol-thresholds-board", vecb, 1000);1199 WriteBinary(d, "cam-ftmcontrol-thresholds-patch", vecp, 1000); 1200 WriteBinary(d, "cam-ftmcontrol-thresholds-board", vecb, 100); 1198 1201 1199 1202 const Statistics statp(vecp); … … 1207 1210 out << HTML::kWhite << '\t' << statb.min << '\n'; 1208 1211 out << HTML::kWhite << '\t' << statb.med << '\n'; 1209 //out << HTML::kWhite << '\t' << statb.avg << '\n';1210 1212 out << HTML::kWhite << '\t' << statb.max << '\n'; 1213 ofstream(fPath+"/thresholds-board.data") << out.str(); 1214 1215 ostringstream out; 1216 out << d.GetJavaDate() << '\n'; 1211 1217 out << HTML::kWhite << '\t' << statp.min << '\n'; 1212 1218 out << HTML::kWhite << '\t' << statp.med << '\n'; 1213 //out << HTML::kWhite << '\t' << statp.avg << '\n';1214 1219 out << HTML::kWhite << '\t' << statp.max << '\n'; 1220 ofstream(fPath+"/thresholds-patch.data") << out.str(); 1221 1222 ostringstream out; 1223 out << d.GetJavaDate() << '\n'; 1224 out << HTML::kWhite << '\t' << statb.med << '\n'; 1225 out << HTML::kWhite << '\t' << statp.med << '\n'; 1215 1226 ofstream(fPath+"/thresholds.data") << out.str(); 1216 1227 … … 1321 1332 switch (fFadControlDrsStep) 1322 1333 { 1323 case 0: WriteBinary(d, " fadcontrol-eventdata", max, 2, -1); break;1324 case 1: WriteBinary(d, " fadcontrol-eventdata", max, 2, 0); break;1325 default: WriteBinary(d, " fadcontrol-eventdata", max, 0.25, 0); break;1334 case 0: WriteBinary(d, "cam-fadcontrol-eventdata", max, 2, -1); break; 1335 case 1: WriteBinary(d, "cam-fadcontrol-eventdata", max, 2, 0); break; 1336 default: WriteBinary(d, "cam-fadcontrol-eventdata", max, 0.25, 0); break; 1326 1337 } 1327 1338 … … 1384 1395 ofstream(fPath+"/fsc.data") << out.str(); 1385 1396 1386 WriteBinary(d, " fsccontrol-temperature-hist",1397 WriteBinary(d, "hist-fsccontrol-temperature", 1387 1398 fFscControlTemperatureHist, 10); 1388 1399 … … 1440 1451 fRateScanBoard %= 40; 1441 1452 1442 WriteBinary(d, " ratescan-hist",fRateScanDataHist[0], 10, -2);1443 WriteBinary(d, " ratescan-board", fRateScanDataHist[fRateScanBoard+1], 10, -4);1453 WriteBinary(d, "hist-ratescan", fRateScanDataHist[0], 10, -2); 1454 WriteBinary(d, "cam-ratescan-board", fRateScanDataHist[fRateScanBoard+1], 10, -4); 1444 1455 1445 1456 ostringstream out; … … 1459 1470 1460 1471 ofstream(fPath+"/ratescan_board.data") << out.str(); 1472 1473 return GetCurrentState(); 1474 } 1475 1476 int HandleRateControlThreshold(const EventImp &d) 1477 { 1478 if (!CheckDataSize(d, "RateControl:Threshold", 2)) 1479 return GetCurrentState(); 1480 1481 const uint16_t th = d.Get<uint16_t>(); 1482 1483 fRateControlThreshold.push_back(th); 1484 if (fRateControlThreshold.size()>300) 1485 fRateControlThreshold.pop_front(); 1486 1487 WriteBinary(d, "hist-ratecontrol-threshold", fRateControlThreshold, 1000); 1461 1488 1462 1489 return GetCurrentState(); … … 1502 1529 Out() << fDimDataLogger << endl; 1503 1530 Out() << fDimDriveControl << endl; 1531 Out() << fDimTimeCheck << endl; 1504 1532 Out() << fDimFadControl << endl; 1505 1533 Out() << fDimFtmControl << endl; … … 1512 1540 Out() << fDimRateScan << endl; 1513 1541 Out() << fDimChatServer << endl; 1542 Out() << fDimSkypeClient << endl; 1514 1543 1515 1544 return GetCurrentState(); … … 1962 1991 out << GetStateHtml(fDimDataLogger, 1); 1963 1992 out << GetStateHtml(fDimDriveControl, 2); 1993 out << GetStateHtml(fDimTimeCheck, 1); 1964 1994 out << GetStateHtml(fDimFadControl, FAD::State::kConnected); 1965 1995 out << GetStateHtml(fDimFtmControl, FTM::State::kConnected); … … 1972 2002 out << GetStateHtml(fDimRateScan, 4); 1973 2003 out << GetStateHtml(fDimChatServer, 1); 2004 out << GetStateHtml(fDimSkypeClient, 1); 1974 2005 1975 2006 out << HTML::kGreen << '\t' << dt.str().substr(0, dt.str().length()-7) << '\n'; … … 2087 2118 (bind(&StateMachineSmartFACT::HandleFtmFtuList, this, placeholders::_1)); 2088 2119 2120 Subscribe("RATE_CONTROL/THRESHOLD") 2121 (bind(&StateMachineSmartFACT::HandleRateControlThreshold,this, placeholders::_1)); 2122 2089 2123 Subscribe("RATE_SCAN/DATA") 2090 2124 (bind(&StateMachineSmartFACT::HandleRateScanData, this, placeholders::_1));
Note:
See TracChangeset
for help on using the changeset viewer.