Changeset 12536 for trunk/FACT++/src
- Timestamp:
- 11/16/11 12:09:16 (13 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Fits.cc
r12443 r12536 362 362 } 363 363 364 void Fits::Flush() 365 { 366 if (!fFile) 367 return; 368 369 fFile->Flush(); 370 } 364 371 // -------------------------------------------------------------------------- 365 372 //! Returns the size on the disk of the Fits file being written. -
trunk/FACT++/src/Fits.h
r12443 r12536 91 91 void Close(); 92 92 93 ///Flush the currently opened file to disk. 94 void Flush(); 95 93 96 ///Get the size currently written on the disk 94 97 int GetWrittenSize() const; -
trunk/FACT++/src/FitsFile.cc
r12529 r12536 403 403 } 404 404 405 void FitsFile::Flush() 406 { 407 if (!fFile) 408 return; 409 410 int status = 0; 411 fits_flush_file(fFile->fitsPointer(), &status); 412 413 if (status) 414 { 415 char text[30]; 416 fits_get_errstatus(status, text); 417 418 ostringstream str; 419 str << "Flushing file " << fFile->name() << " failed: " << text << " (fits_flush_file, rc=" << status << ")"; 420 Error(str); 421 } 422 } 405 423 size_t FitsFile::GetDataSize() const 406 424 { -
trunk/FACT++/src/FitsFile.h
r11744 r12536 93 93 void Close(); 94 94 95 void Flush(); 96 95 97 bool IsOpen() const { return fFile && fTable; } 96 98 -
trunk/FACT++/src/datalogger.cc
r12535 r12536 1172 1172 // 1173 1173 // Check whether we should close and reopen daily text files or not 1174 // 1175 // This should work in any case base of the following: 1176 // - fDailyFileDayChangedAlready is initialized to true. So if the 1177 // dataLogger is started around noon, no file will be closed 1178 // - fDailyFileDayChangedAlready is set to false if (time != 12), so 1179 // the file will be closed and reopened only if the logger runs since 1180 // before noon (which is the required behavior) 1181 // 1182 // This only applies to text files. Fits are closed and reopened based on 1183 // the last and current service received time. 1184 // This was not applicable to text files, because as they gather several 1185 // services, we have no guarantee that the received time will be greater 1186 // than the previous one, which could lead to several close/reopen instead 1187 // of only one. 1188 // 1189 // Last but not least, the datalogger MUST receive at least one service update during 1190 // noon otherwise this is skipped (which is not good). Thus I would suggest that the datalogger 1191 // should always subscribe to at least its statistics services. 1192 // 1193 //calculate time "centered" around noon instead of midnight 1174 // calculate time "centered" around noon instead of midnight 1175 // if number of days has changed, then files should be closed and reopenned. 1194 1176 const Time timeNow; 1195 1177 const Time nowMinusTwelve = timeNow-boost::posix_time::hours(12); … … 1923 1905 return; 1924 1906 } 1907 sub.nightlyFile.Flush(); 1925 1908 } 1926 1909
Note:
See TracChangeset
for help on using the changeset viewer.