Changeset 13589 for trunk/FACT++
- Timestamp:
- 05/07/12 20:45:56 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/smartfact.cc
r13562 r13589 31 31 // ------------------------------------------------------------------------ 32 32 33 const static string kHtmlWhite = "#ffffff"; 34 const static string kHtmlYellow = "#fffff0"; 35 const static string kHtmlRed = "#fff8f0"; 36 const static string kHtmlGreen = "#f0fff0"; 37 const static string kHtmlBlue = "#f0f0ff"; 38 33 39 class StateMachineSmartFACT : public StateMachineDim, public DimInfoHandler 34 40 { … … 48 54 // ----------------------------- Data storage ------------------------- 49 55 50 enum weather_t { kTemp = 0, kDew, kHum, kPress, kWind, kGusts, kDir }; 51 float fMagicWeatherData[7]; 56 uint32_t fMcpConfigurationState; 57 uint64_t fMcpConfigurationMaxTime; 58 uint64_t fMcpConfigurationMaxEvents; 59 string fMcpConfigurationName; 60 61 enum weather_t { kWeatherBegin=0, kTemp = kWeatherBegin, kDew, kHum, kPress, kWind, kGusts, kDir, kWeatherEnd = kDir }; 62 deque<float> fMagicWeatherHist[kWeatherEnd+1]; 52 63 53 64 vector<float> fFeedbackCalibration; … … 59 70 60 71 deque<float> fBiasControlCurrentHist; 72 deque<float> fFscControlTemperatureHist; 73 74 float fFscControlTemperatureAvg; 75 float fFscControlHumidityAvg; 61 76 62 77 float fDriveControlPointingZd; … … 72 87 DimServiceInfoList fNetwork; 73 88 74 pair<Time, int> fStatusDim; 75 pair<Time, int> fStatusDriveControl; 76 pair<Time, int> fStatusMagicWeather; 77 pair<Time, int> fStatusFeedback; 78 pair<Time, int> fStatusBiasControl; 79 pair<Time, int> fStatusFtmControl; 80 pair<Time, int> fStatusFadControl; 81 82 DimStampedInfo fDim; 83 84 DimStampedInfo fDimDriveControl; 89 class DimState : public DimInfoHandler 90 { 91 public: 92 DimState(const string &n, const string s="STATE") : 93 server(n), info(make_pair(Time(-1), -2)), 94 dim((n+"/"+s).c_str(), (void*)NULL, 0, this) { } 95 96 string server; 97 pair<Time, int> info; 98 99 DimStampedInfo dim; 100 101 void infoHandler() 102 { 103 DimInfo *curr = getInfo(); // get current DimInfo address 104 if (!curr || curr != &dim) 105 return; 106 107 const bool disconnected = dim.getSize()==0; 108 109 // Make sure getTimestamp is called _before_ getTimestampMillisecs 110 const int tsec = dim.getTimestamp(); 111 const int tms = dim.getTimestampMillisecs(); 112 113 info = make_pair(Time(tsec, tms*1000), 114 disconnected ? -2 : dim.getQuality()); 115 } 116 117 const Time &time() const { return info.first; } 118 const int &state() const { return info.second; } 119 120 const string &name() const { return server; } 121 }; 122 123 class DimVersion : public DimState 124 { 125 public: 126 DimVersion() : DimState("DIS_DNS", "VERSION_NUMBER") { } 127 128 void infoHandler() 129 { 130 DimInfo *curr = getInfo(); // get current DimInfo address 131 if (!curr || curr != &dim) 132 return; 133 134 DimState::infoHandler(); 135 136 info.second = dim.getSize()==4 ? dim.getInt() : 0; 137 } 138 139 string version() const 140 { 141 if (info.second==0) 142 return "Offline"; 143 144 ostringstream msg; 145 msg << "V" << info.second/100 << 'r' << info.second%100; 146 return msg.str(); 147 } 148 }; 149 150 151 DimVersion fDim; 152 DimState fDimMcp; 153 DimState fDimDataLogger; 154 DimState fDimDriveControl; 155 DimState fDimMagicWeather; 156 DimState fDimFeedback; 157 DimState fDimBiasControl; 158 DimState fDimFtmControl; 159 DimState fDimFadControl; 160 DimState fDimFscControl; 161 DimState fDimRateControl; 162 DimState fDimRateScan; 163 DimState fDimChatServer; 164 165 DimStampedInfo fDimMcpConfiguration; 166 85 167 DimStampedInfo fDimDriveControlPointing; 86 168 DimStampedInfo fDimDriveControlTracking; 87 169 DimStampedInfo fDimDriveControlSource; 88 170 89 DimStampedInfo fDimMagicWeather; 171 DimStampedInfo fDimFscControlTemperature; 172 DimStampedInfo fDimFscControlHumidity; 173 90 174 DimStampedInfo fDimMagicWeatherData; 91 175 92 DimStampedInfo fDimFeedback;93 176 DimStampedInfo fDimFeedbackCalibration; 94 177 95 DimStampedInfo fDimBiasControl;96 178 DimStampedInfo fDimBiasControlVoltage; 97 179 DimStampedInfo fDimBiasControlCurrent; 98 180 99 DimStampedInfo fDimFtmControl;100 181 DimStampedInfo fDimFtmControlTriggerRates; 101 182 102 DimStampedInfo fDimFadControl;103 183 DimStampedInfo *fDimFadControlEventData; 104 184 105 185 // ------------------------------------------------------------------- 106 186 107 pair<Time, int> GetNewState(DimStampedInfo &info) const 108 { 109 const bool disconnected = info.getSize()==0; 110 111 // Make sure getTimestamp is called _before_ getTimestampMillisecs 112 const int tsec = info.getTimestamp(); 113 const int tms = info.getTimestampMillisecs(); 114 115 return make_pair(Time(tsec, tms*1000), 116 disconnected ? -2 : info.getQuality()); 117 } 118 119 bool UpdateState(DimInfo *curr, DimStampedInfo &service, pair<Time,int> &rc) 187 const State GetState(const DimState &s) const 188 { 189 return fNetwork.GetState(s.name(), s.state()); 190 } 191 192 bool HandleService(DimInfo *curr, const DimInfo &service, void (StateMachineSmartFACT::*handle)(const DimData &)) 120 193 { 121 194 if (curr!=&service) 122 195 return false; 123 196 124 rc = GetNewState(service);125 return true;126 }127 128 bool HandleService(DimInfo *curr, const DimInfo &service, void (StateMachineSmartFACT::*handle)(const DimData &))129 {130 if (curr!=&service)131 return false;132 133 197 (this->*handle)(DimData(curr)); 134 198 return true; … … 136 200 137 201 138 bool CheckDataSize(const DimData &d, const char *name, size_t size )139 { 140 if ( d.data.size()==size)202 bool CheckDataSize(const DimData &d, const char *name, size_t size, bool min=false) 203 { 204 if ((!min && d.data.size()==size) || (min && d.data.size()>size)) 141 205 return true; 142 206 143 207 ostringstream msg; 144 msg << name << " - Received service has " << d.data.size() << " bytes, but expected " << size << "."; 208 msg << name << " - Received service has " << d.data.size() << " bytes, but expected "; 209 if (min) 210 msg << "more than "; 211 msg << size << "."; 145 212 Warn(msg); 146 213 return false; … … 172 239 // ------------------------------------------------------------------- 173 240 241 void HandleMcpConfiguration(const DimData &d) 242 { 243 if (!CheckDataSize(d, "Mcp:Configuration", 16, true)) 244 return; 245 246 fMcpConfigurationState = d.qos; 247 fMcpConfigurationMaxTime = d.get<uint64_t>(); 248 fMcpConfigurationMaxEvents = d.get<uint64_t>(8); 249 fMcpConfigurationName = d.ptr<char>(16); 250 } 251 252 void WriteWeather(const DimData &d, const string &name, int i, float min, float max) 253 { 254 const auto fmin = min_element(fMagicWeatherHist[i].begin(), fMagicWeatherHist[i].end()); 255 const auto fmax = max_element(fMagicWeatherHist[i].begin(), fMagicWeatherHist[i].end()); 256 const float favg = accumulate (fMagicWeatherHist[i].begin(), fMagicWeatherHist[i].end(), 0.)/fMagicWeatherHist[i].size(); 257 258 ostringstream out; 259 out << setprecision(3); 260 out << uint64_t(d.time.UnixTime()*1000) << '\n'; 261 262 out << "#ffffff\t" << fMagicWeatherHist[i].back() << '\n'; 263 out << "#ffffff\t" << *fmin << '\n'; 264 out << "#ffffff\t" << favg << '\n'; 265 out << "#ffffff\t" << *fmax << '\n'; 266 267 ofstream("www/"+name+".txt") << out.str(); 268 269 WriteBinary("magicweather-"+name+"-hist", fMagicWeatherHist[i], max-min, -min); 270 } 271 174 272 void HandleMagicWeatherData(const DimData &d) 175 273 { … … 177 275 return; 178 276 179 // FIXME: Check size (7*4+2) 180 181 //const uint16_t status = d.get<uint16_t>(); 182 memcpy(fMagicWeatherData, d.ptr<float>(2), 7*sizeof(float)); 277 // Store a history of the last 300 entries 278 for (int i=kWeatherBegin; i<=kWeatherEnd; i++) 279 { 280 fMagicWeatherHist[i].push_back(d.ptr<float>(2)[i]); 281 if (fMagicWeatherHist[i].size()>300) 282 fMagicWeatherHist[i].pop_front(); 283 } 183 284 184 285 ostringstream out; … … 186 287 187 288 for (int i=0; i<7; i++) 188 out << "#ffffff\t" << fMagicWeatherData[i] << '\n'; 189 190 ofstream fout("www/magicweather.txt"); 191 fout << out.str(); 289 out << "#ffffff\t" << fMagicWeatherHist[i].back() << '\n'; 290 291 ofstream("www/magicweather.txt") << out.str(); 292 293 WriteWeather(d, "temp", kTemp, -5, 35); 294 WriteWeather(d, "dew", kDew, -5, 35); 295 WriteWeather(d, "hum", kHum, 0, 100); 296 WriteWeather(d, "wind", kWind, 0, 100); 297 WriteWeather(d, "gusts", kGusts, 0, 100); 298 WriteWeather(d, "press", kPress, 700, 1000); 192 299 } 193 300 … … 244 351 void HandleDriveControlSource(const DimData &d) 245 352 { 246 //if (!CheckDataSize(d, "DriveControl:Source", 7*4+2))247 //return;353 if (!CheckDataSize(d, "DriveControl:Source", 7*4+2, true)) 354 return; 248 355 249 356 const double *ptr = d.ptr<double>(); … … 381 488 return; 382 489 383 384 490 //const float *avg = d.ptr<float>(); 385 491 //const float *rms = d.ptr<float>(1440*sizeof(float)); … … 403 509 } 404 510 511 void HandleFscControlTemperature(const DimData &d) 512 { 513 if (!CheckDataSize(d, "FscControl:Temperature", 240)) 514 return; 515 516 const float *ptr = d.ptr<float>(4); 517 518 double avg = 0; 519 double rms = 0; 520 double min = 99; 521 double max = -99; 522 523 int num = 0; 524 for (const float *t=ptr; t<ptr+31; t++) 525 { 526 if (*t==0) 527 continue; 528 529 if (*t>max) 530 max = *t; 531 532 if (*t<min) 533 min = *t; 534 535 avg += *t; 536 rms += *t * *t; 537 538 num++; 539 } 540 541 avg /= num; 542 rms = sqrt(rms/num-avg*avg); 543 544 fFscControlTemperatureAvg = avg; 545 546 fFscControlTemperatureHist.push_back(avg); 547 if (fFscControlTemperatureHist.size()>300) 548 fFscControlTemperatureHist.pop_front(); 549 550 const auto beg = fFscControlTemperatureHist.begin(); 551 const auto end = fFscControlTemperatureHist.end(); 552 553 const auto fmin = min_element(beg, end); 554 const auto fmax = max_element(beg, end); 555 const float favg = accumulate (beg, end, 0)/fFscControlTemperatureHist.size(); 556 557 ostringstream out; 558 out << setprecision(3); 559 out << uint64_t(d.time.UnixTime()*1000) << '\n'; 560 out << "#ffffff\t" << min << '\n'; 561 out << "#ffffff\t" << avg << '\n'; 562 out << "#ffffff\t" << max << '\n'; 563 out << "#ffffff\t" << *fmin << '\n'; 564 out << "#ffffff\t" << favg << '\n'; 565 out << "#ffffff\t" << *fmax << '\n'; 566 567 ofstream("www/fsc.txt") << out.str(); 568 569 WriteBinary("fsccontrol-temperature-hist", 570 fFscControlTemperatureHist, 30); 571 572 } 573 574 void HandleFscControlHumidity(const DimData &d) 575 { 576 if (!CheckDataSize(d, "FscControl:Humidity", 5*4)) 577 return; 578 579 const float *ptr = d.ptr<float>(4); 580 581 double avg = 0; 582 int num = 0; 583 584 for (const float *t=ptr; t<ptr+4; t++) 585 if (*t>0) 586 { 587 avg += *t; 588 num++; 589 } 590 591 fFscControlHumidityAvg = avg/num; 592 } 593 594 405 595 // ------------------------------------------------------------------- 406 596 … … 411 601 return; 412 602 603 if (HandleService(curr, fDimMcpConfiguration, &StateMachineSmartFACT::HandleMcpConfiguration)) 604 return; 413 605 if (HandleService(curr, fDimMagicWeatherData, &StateMachineSmartFACT::HandleMagicWeatherData)) 414 606 return; … … 429 621 if (HandleService(curr, *fDimFadControlEventData, &StateMachineSmartFACT::HandleFadControlEventData)) 430 622 return; 431 432 if (UpdateState(curr, fDimMagicWeather, fStatusMagicWeather)) 433 return; 434 if (UpdateState(curr, fDimDriveControl, fStatusDriveControl)) 435 return; 436 if (UpdateState(curr, fDimFeedback, fStatusFeedback)) 437 return; 438 if (UpdateState(curr, fDimBiasControl, fStatusBiasControl)) 439 return; 440 if (UpdateState(curr, fDimFtmControl, fStatusFtmControl)) 441 return; 442 if (UpdateState(curr, fDimFadControl, fStatusFadControl)) 443 return; 444 445 if (curr==&fDim) 446 { 447 fStatusDim = GetNewState(fDim); 448 fStatusDim.second = curr->getSize()==4 ? curr->getInt() : 0; 449 return; 450 } 623 if (HandleService(curr, fDimFscControlTemperature, &StateMachineSmartFACT::HandleFscControlTemperature)) 624 return; 625 if (HandleService(curr, fDimFscControlHumidity, &StateMachineSmartFACT::HandleFscControlHumidity)) 626 return; 451 627 } 452 628 … … 462 638 } 463 639 464 void PrintState(const pair<Time,int> &state, const char *server)465 { 466 const State rc = fNetwork.GetState(server, state.second);467 468 Out() << state. first.GetAsStr("%H:%M:%S.%f").substr(0, 12) << " - ";469 Out() << kBold << s erver<< ": ";640 void PrintState(const DimState &state) const 641 { 642 const State rc = GetState(state); 643 644 Out() << state.time().GetAsStr("%H:%M:%S.%f").substr(0, 12) << " - "; 645 Out() << kBold << state.name() << ": "; 470 646 if (rc.index==-2) 471 647 { … … 477 653 } 478 654 479 int Print() 480 { 481 Out() << fStatusDim.first.GetAsStr("%H:%M:%S.%f").substr(0, 12) << " - "; 482 Out() << kBold << "DIM_DNS: "; 483 if (fStatusDim.second==0) 484 Out() << "Offline" << endl; 485 else 486 Out() << "V" << fStatusDim.second/100 << 'r' << fStatusDim.second%100 << endl; 487 488 PrintState(fStatusMagicWeather, "MAGIC_WEATHER"); 489 PrintState(fStatusDriveControl, "DRIVE_CONTROL"); 490 PrintState(fStatusFeedback, "FEEDBACK"); 491 PrintState(fStatusBiasControl, "BIAS_CONTROL"); 492 PrintState(fStatusFadControl, "FAD_CONTROL"); 655 int Print() const 656 { 657 Out() << fDim.time().GetAsStr("%H:%M:%S.%f").substr(0, 12) << " - "; 658 Out() << kBold << "DIM_DNS: " << fDim.version() << endl; 659 660 PrintState(fDimMcp); 661 PrintState(fDimDataLogger); 662 PrintState(fDimDriveControl); 663 PrintState(fDimFadControl); 664 PrintState(fDimFtmControl); 665 PrintState(fDimBiasControl); 666 PrintState(fDimFeedback); 667 PrintState(fDimRateControl); 668 PrintState(fDimFscControl); 669 PrintState(fDimMagicWeather); 670 PrintState(fDimRateScan); 671 PrintState(fDimChatServer); 493 672 494 673 return GetCurrentState(); 674 } 675 676 string GetStateHtml(const DimState &state, int green) const 677 { 678 const State rc = GetState(state); 679 680 //ostringstream msg; 681 //msg << kHtmlWhite << '\t' << rc.name << " [" << rc.index << "]\n"; 682 //return msg.str(); 683 684 if (rc.index<1) 685 return kHtmlWhite + "\t---\n"; 686 687 688 return (rc.index<green?kHtmlYellow:kHtmlGreen) + '\t' + rc.name + '\n'; 495 689 } 496 690 … … 504 698 //poll_one(); 505 699 506 if (f StatusDim.second==0)700 if (fDim.state()==0) 507 701 return kStateDimNetworkNA; 508 702 … … 518 712 519 713 // -------------- System status -------------- 520 out << "n/a\n"; 521 522 const static string kWhite = "#ffffff"; 523 const static string kYellow = "#fffff0"; 524 const static string kRed = "#fff8f0"; 525 const static string kGreen = "#f0fff0"; 526 const static string kBlue = "#f0f0ff"; 714 if (fDimMcp.state()>=5) // Idle 715 { 716 string col = kHtmlBlue; 717 if (fMcpConfigurationState!=5) 718 col = kHtmlYellow; 719 else 720 if (fDimFadControl.state()==FAD::kWritingData) 721 col = kHtmlGreen; 722 723 out << fMcpConfigurationName; 724 if (fMcpConfigurationMaxEvents>0 || fMcpConfigurationMaxTime>0) 725 out << " ["; 726 if (fMcpConfigurationMaxEvents>0) 727 out << fMcpConfigurationMaxEvents; 728 if (fMcpConfigurationMaxEvents>0 && fMcpConfigurationMaxTime>0) 729 out << "/"; 730 if (fMcpConfigurationMaxTime>0) 731 out << fMcpConfigurationMaxTime << "s"; 732 if (fMcpConfigurationMaxEvents>0 || fMcpConfigurationMaxTime>0) 733 out << "]"; 734 } 735 else 736 out << kHtmlWhite << '\n'; 527 737 528 738 // ------------------ Drive ----------------- 529 if (f StatusDriveControl.second>=5) // Armed, Moving, Tracking530 { 531 const State rc = fNetwork.GetState("DRIVE_CONTROL", fStatusDriveControl.second);532 out << k White << '\t';739 if (fDimDriveControl.state()>=5) // Armed, Moving, Tracking 740 { 741 const State rc = GetState(fDimDriveControl); 742 out << kHtmlWhite << '\t'; 533 743 out << rc.name << '\t'; 534 744 out << fDriveControlPointingZd << '\t'; 535 745 out << fDriveControlPointingAz << '\t'; 536 if (f StatusDriveControl.second==7)746 if (fDimDriveControl.state()==7) 537 747 { 538 748 out << fDriveControlTrackingDev << '\t'; … … 543 753 } 544 754 else 545 out << kWhite << '\n'; 755 out << kHtmlWhite << '\n'; 756 757 // ------------------- FSC ------------------ 758 if (fDimFscControl.state()>1) 759 { 760 out << kHtmlGreen << '\t' << fFscControlTemperatureAvg << '\n'; 761 } 762 else 763 out << kHtmlWhite << '\n'; 546 764 547 765 // --------------- MagicWeather ------------- 548 if (fStatusMagicWeather.second==3) 549 { 550 const float diff = fMagicWeatherData[kTemp]-fMagicWeatherData[kDew]; 551 string col1 = kRed; 766 if (fDimMagicWeather.state()==3) 767 { 768 /* 769 const float diff = fMagicWeatherHist[kTemp].back()-fMagicWeatherHist[kDew].back(); 770 string col1 = kHtmlRed; 552 771 if (diff>0.3) 553 col1 = k Yellow;772 col1 = kHtmlYellow; 554 773 if (diff>0.7) 555 col1 = k Green;556 557 const float wind = fMagicWeatherData[kGusts]; 558 string col2 = kGreen;559 if (wind>35)560 col2 = kYellow;561 if (wind> 50)562 col 2 = kRed;563 564 out << col1 << '\t';565 out << fMagicWeatherData[kTemp] << '\t'; 566 out << fMagicWeatherData[kDew] << '\n';567 out << col2<< '\t';568 out << fMagicWeather Data[kGusts]<< '\n';774 col1 = kHtmlGreen; 775 */ 776 777 const float wind = fMagicWeatherHist[kGusts].back(); 778 const float hum = fMagicWeatherHist[kHum].back(); 779 string col = kHtmlGreen; 780 if (wind>35 || hum>95) 781 col = kHtmlYellow; 782 if (wind>50 || hum>98) 783 col = kHtmlRed; 784 785 out << col << '\t'; 786 out << fMagicWeatherHist[kHum].back() << '\t'; 787 out << fMagicWeatherHist[kGusts].back() << '\n'; 569 788 } 570 789 else 571 out << k White << "\n\n";790 out << kHtmlWhite << "\n"; 572 791 573 792 // --------------- FtmControl ------------- 574 if (f StatusFtmControl.second>=FTM::kIdle)575 { 576 string col = k Green;793 if (fDimFtmControl.state()>=FTM::kIdle) 794 { 795 string col = kHtmlGreen; 577 796 if (fFtmControlTriggerRateCam<15) 578 col = k Yellow;797 col = kHtmlYellow; 579 798 if (fFtmControlTriggerRateCam>100) 580 col = k Red;799 col = kHtmlRed; 581 800 582 801 out << col << '\t' << fFtmControlTriggerRateCam << '\n'; 583 802 } 584 803 else 585 out << k White << '\n';804 out << kHtmlWhite << '\n'; 586 805 587 806 // --------------- BiasControl ------------- 588 if (f StatusBiasControl.second==5 || // Ramping589 f StatusBiasControl.second==7 || // On590 f StatusBiasControl.second==9) // Off591 { 592 string col = fBiasControlVoltageMed>3?k Green:kWhite;807 if (fDimBiasControl.state()==5 || // Ramping 808 fDimBiasControl.state()==7 || // On 809 fDimBiasControl.state()==9) // Off 810 { 811 string col = fBiasControlVoltageMed>3?kHtmlGreen:kHtmlWhite; 593 812 if (fBiasControlCurrentMax>280) 594 col = k Yellow;813 col = kHtmlYellow; 595 814 if (fBiasControlCurrentMax>350) 596 col = k Red;815 col = kHtmlRed; 597 816 598 817 if (fFeedbackCalibration.size()==0) 599 col = k Blue;818 col = kHtmlBlue; 600 819 601 820 out << col << '\t'; … … 605 824 } 606 825 else 607 out << k White << '\n';826 out << kHtmlWhite << '\n'; 608 827 609 828 610 829 // ------------------------------------------ 611 ofstream fout("www/fact.txt"); 612 fout << out.str(); 830 831 ofstream("www/fact.txt") << out.str(); 832 833 // ========================================== 834 835 out.str(""); 836 out << uint64_t(nearbyint(now.UnixTime()*1000)) << '\n'; 837 838 if (fDim.state()==0) 839 out << kHtmlWhite << "\tOffline\n\n\n\n\n\n\n\n\n\n\n\n"; 840 else 841 { 842 out << kHtmlGreen << '\t' << fDim.version() << '\n'; 843 844 out << GetStateHtml(fDimMcp, 4); 845 out << GetStateHtml(fDimDataLogger, 1); 846 out << GetStateHtml(fDimDriveControl, 2); 847 out << GetStateHtml(fDimFadControl, FAD::kConnected); 848 out << GetStateHtml(fDimFtmControl, FTM::kConnected); 849 out << GetStateHtml(fDimBiasControl, BIAS::kConnected); 850 out << GetStateHtml(fDimFeedback, 4); 851 out << GetStateHtml(fDimRateControl, 4); 852 out << GetStateHtml(fDimFscControl, 2); 853 out << GetStateHtml(fDimMagicWeather, 2); 854 out << GetStateHtml(fDimRateScan, 4); 855 out << GetStateHtml(fDimChatServer, 1); 856 } 857 858 ofstream("www/status.txt") << out.str(); 613 859 614 860 return kStateRunning; … … 618 864 StateMachineSmartFACT(ostream &out=cout) : StateMachineDim(out, "SMART_FACT"), 619 865 //--- 620 fStatusDim (make_pair(Time(), -2)), 621 fStatusDriveControl(make_pair(Time(), -2)), 622 fStatusMagicWeather(make_pair(Time(), -2)), 623 fStatusFeedback (make_pair(Time(), -2)), 624 fStatusBiasControl (make_pair(Time(), -2)), 625 fStatusFtmControl (make_pair(Time(), -2)), 626 fStatusFadControl (make_pair(Time(), -2)), 866 fDimMcp ("MCP"), 867 fDimDataLogger ("DATA_LOGGER"), 868 fDimDriveControl ("DRIVE_CONTROL"), 869 fDimMagicWeather ("MAGIC_WEATHER"), 870 fDimFeedback ("FEEDBACK"), 871 fDimBiasControl ("BIAS_CONTROL"), 872 fDimFtmControl ("FTM_CONTROL"), 873 fDimFadControl ("FAD_CONTROL"), 874 fDimFscControl ("FSC_CONTROL"), 875 fDimRateControl ("RATE_CONTROL"), 876 fDimRateScan ("RATE_SCAN"), 877 fDimChatServer ("CHAT_SERVER"), 627 878 //--- 628 fDim ("DIS_DNS/VERSION_NUMBER",(void*)NULL, 0, this),879 fDimMcpConfiguration ("MCP/CONFIGURATION", (void*)NULL, 0, this), 629 880 //--- 630 fDimDriveControl ("DRIVE_CONTROL/STATE", (void*)NULL, 0, this),631 881 fDimDriveControlPointing ("DRIVE_CONTROL/POINTING_POSITION", (void*)NULL, 0, this), 632 882 fDimDriveControlTracking ("DRIVE_CONTROL/TRACKING_POSITION", (void*)NULL, 0, this), 633 883 fDimDriveControlSource ("DRIVE_CONTROL/SOURCE_POSITION", (void*)NULL, 0, this), 634 884 //--- 635 fDimMagicWeather ("MAGIC_WEATHER/STATE", (void*)NULL, 0, this), 885 fDimFscControlTemperature ("FSC_CONTROL/TEMPERATURE", (void*)NULL, 0, this), 886 fDimFscControlHumidity ("FSC_CONTROL/HUMIDITY", (void*)NULL, 0, this), 887 //--- 636 888 fDimMagicWeatherData ("MAGIC_WEATHER/DATA", (void*)NULL, 0, this), 637 889 //--- 638 fDimFeedback ("FEEDBACK/STATE", (void*)NULL, 0, this),639 890 fDimFeedbackCalibration ("FEEDBACK/CALIBRATION", (void*)NULL, 0, this), 640 891 //--- 641 fDimBiasControl ("BIAS_CONTROL/STATE", (void*)NULL, 0, this),642 892 fDimBiasControlVoltage ("BIAS_CONTROL/VOLTAGE", (void*)NULL, 0, this), 643 893 fDimBiasControlCurrent ("BIAS_CONTROL/CURRENT", (void*)NULL, 0, this), 644 894 //--- 645 fDimFtmControl ("FTM_CONTROL/STATE", (void*)NULL, 0, this),646 895 fDimFtmControlTriggerRates("FTM_CONTROL/TRIGGER_RATES", (void*)NULL, 0, this), 647 896 //- 648 fDimFadControl ("FAD_CONTROL/STATE", (void*)NULL, 0, this),649 897 fDimFadControlEventData(0) 650 898 {
Note:
See TracChangeset
for help on using the changeset viewer.