Changeset 10265 for trunk/FACT++
- Timestamp:
- 03/30/11 11:55:50 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/dataLogger.cc
r10264 r10265 49 49 #include "MessageImp.h" 50 50 51 //#define HAS_FITS 52 51 53 #include <fstream> 52 54 53 55 #include <boost/bind.hpp> 54 56 57 #ifdef HAS_FITS 55 58 #include <astroroot.h> 59 #endif 56 60 57 61 class DataLogger : public StateMachineDim, DimInfoHandler … … 143 147 struct SubscriptionType 144 148 { 149 #ifdef HAS_FITS 145 150 ///daily FITS output file 146 151 AstroRootIo dailyFile; 147 152 ///run-specific FITS output file 148 153 AstroRootIo runFile; 154 #endif 149 155 ///the actual dimInfo pointer 150 156 DimStampedInfo* dimInfo; … … 154 160 void operator = (const SubscriptionType& other) 155 161 { 162 #ifdef HAS_FITS 156 163 dailyFile = other.dailyFile; 157 164 runFile = other.runFile; 165 #endif 158 166 dimInfo = other.dimInfo; 159 167 numCopies = other.numCopies; … … 162 170 SubscriptionType(const SubscriptionType& other) 163 171 { 172 #ifdef HAS_FITS 164 173 dailyFile = other.dailyFile; 165 174 runFile = other.runFile; 175 #endif 166 176 dimInfo = other.dimInfo; 167 177 numCopies = other.numCopies; … … 185 195 if (*numCopies < 1) 186 196 { 197 #ifdef HAS_FITS 187 198 if (dailyFile.IsOpen()) 188 199 dailyFile.Close(); 189 200 if (runFile.IsOpen()) 190 201 runFile.Close(); 202 #endif 191 203 if (dimInfo) 192 204 delete dimInfo; … … 227 239 ///from dailyOpen to waiting transition 228 240 int DailyToWaitRunPlease(); 241 #ifdef HAS_FITS 229 242 ///Open fits files 230 243 void OpenFITSFilesPlease(SubscriptionType& sub); … … 233 246 ///Allocate the buffers required for fits 234 247 void AllocateFITSBuffers(SubscriptionType& sub); 248 #endif 235 249 public: 236 250 ///checks with fServiceList whether or not the services got updated … … 663 677 } 664 678 } 665 679 680 #ifdef HAS_FITS 666 681 if (!sub.dailyFile.IsOpen() || !sub.runFile.IsOpen()) 667 682 OpenFITSFilesPlease(sub); 668 683 WriteToFITS(sub); 669 684 #endif 670 685 671 686 } … … 792 807 return kSM_DailyOpen; 793 808 } 809 810 #ifdef HAS_FITS 794 811 // -------------------------------------------------------------------------- 795 812 // … … 943 960 sub.runFile.Write(); 944 961 } 962 #endif //if has_fits 945 963 // -------------------------------------------------------------------------- 946 964 // … … 984 1002 fRunLogFile.close(); 985 1003 fRunReportFile.close(); 1004 #ifdef HAS_FITS 986 1005 for (SubscriptionsListType::iterator i = fServiceSubscriptions.begin(); i != fServiceSubscriptions.end(); i++) 987 1006 for (std::map<std::string, SubscriptionType>::iterator j = i->second.begin(); j != i->second.end(); j++) … … 990 1009 j->second.runFile.Close(); 991 1010 } 1011 #endif 992 1012 return kSM_WaitingRun; 993 1013 … … 1011 1031 fRunReportFile.close(); 1012 1032 1033 #ifdef HAS_FITS 1013 1034 for (SubscriptionsListType::iterator i = fServiceSubscriptions.begin(); i != fServiceSubscriptions.end(); i++) 1014 1035 for (std::map<std::string, SubscriptionType>::iterator j = i->second.begin(); j != i->second.end(); j++) … … 1019 1040 j->second.runFile.Close(); 1020 1041 } 1042 #endif 1021 1043 return kSM_Ready; 1022 1044 }
Note:
See TracChangeset
for help on using the changeset viewer.