- Timestamp:
- 06/07/12 16:16:46 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/smartfact.cc
r14045 r14110 388 388 string fMcpConfigurationName; 389 389 Time fMcpConfigurationRunStart; 390 Time fMcpConfigurationLastTime; 391 deque<string> fMcpConfigurationHist; 390 392 391 393 enum weather_t { kWeatherBegin=0, kTemp = kWeatherBegin, kDew, kHum, kPress, kWind, kGusts, kDir, kWeatherEnd = kDir+1 }; … … 694 696 } 695 697 696 // If a run ends and no script is running play a tirili 697 if (fMcpConfigurationState==MCP::State::kTakingData && d.GetQoS()==MCP::State::kIdle && fDimControl.state()<-2) 698 SetAudio("sound_10"); 699 700 // If a run ends and a script is running just play a simple 'tick' 701 if (fMcpConfigurationState==MCP::State::kTakingData && d.GetQoS()==MCP::State::kIdle && fDimControl.state()>=-2) 702 SetAudio("losticks"); 698 if (d.GetTime()>fMcpConfigurationLastTime+boost::posix_time::hours(12)) 699 fMcpConfigurationHist.clear(); 700 701 // If a run ends... 702 if (fMcpConfigurationState==MCP::State::kTakingData && d.GetQoS()==MCP::State::kIdle) 703 { 704 //...and no script is running just play a simple 'tick' 705 if (fDimControl.state()<-2) 706 SetAudio("sound_10"); 707 708 // ...and a script is running just play a simple 'tick' 709 if (fDimControl.state()>=-2) 710 SetAudio("losticks"); 711 712 ostringstream out; 713 out << HTML::kBlue << '\t' << d.GetTimeAsStr("%H:%M:%S") << " " << d.Ptr<char>(16); 714 if (!fDriveControlSourceName.empty()) 715 out << " [" << fDriveControlSourceName << "]\n"; 716 fMcpConfigurationHist.push_back(out.str()); 717 } 703 718 704 719 if (d.GetQoS()==MCP::State::kTakingData) … … 706 721 fMcpConfigurationRunStart = Time(); 707 722 SetAudio("losticks"); 723 724 ostringstream out; 725 out << HTML::kGreen << '\t' << d.GetTimeAsStr("%H:%M:%S") << " " << fMcpConfigurationName << '\n'; 726 fMcpConfigurationHist.push_back(out.str()); 727 if (!fDriveControlSourceName.empty()) 728 out << " [" << fDriveControlSourceName << "]\n"; 708 729 } 709 730 … … 712 733 fMcpConfigurationMaxEvents = d.Get<uint64_t>(8); 713 734 fMcpConfigurationName = d.Ptr<char>(16); 735 fMcpConfigurationLastTime = d.GetTime(); 736 737 ostringstream out; 738 out << d.GetJavaDate() << '\n'; 739 for (auto it=fMcpConfigurationHist.rbegin(); it!=fMcpConfigurationHist.rend(); it++) 740 out << *it; 741 742 ofstream(fPath+"/observations.txt") << out.str(); 714 743 715 744 return GetCurrentState();
Note:
See TracChangeset
for help on using the changeset viewer.