- Timestamp:
- 10/15/19 08:42:18 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/datalogger.cc
r19391 r19771 349 349 string CompileFileNameWithPath(const string &path, const string &service, const string & extension); 350 350 ///Form the file names only 351 string CompileFileName(const string& service, const string& extension, const Time& time=Time()) const;351 string CompileFileName(const string& service, const string& extension, const uint32_t& night) const; 352 352 ///Check whether service is in black and/or white list 353 353 bool ShouldSubscribe(const string& server, const string& service); … … 831 831 //! @param extension the extension to add, if any 832 832 // 833 string DataLogger::CompileFileName(const string& service, const string& extension, const Time& time) const833 string DataLogger::CompileFileName(const string& service, const string& extension, const uint32_t& night) const 834 834 { 835 835 ostringstream str; 836 836 837 const Time ftime(time);//removed this as already done by nightAsInt: -boost::posix_time::hours(12)); 838 str << ftime.NightAsInt(); 837 str << night; 839 838 840 839 if (!service.empty()) … … 853 852 const Time time; 854 853 855 //calculate time suitable for naming files. 856 //fCurrentDay is 30 minutes after upcoming sunrise. So just use 12 hours before then 854 // calculate time suitable for naming files. Get a time between the next sun-rise (fCurrentDay) 855 // and the previous sun-rise so that NightAsInt (which refers to the previous sun-rise) 856 // provides reasonable results. 857 858 // WARNING: This fails if the sun-rise is around midnight UTC! 859 // It would be more appropriate to relate the "NightAsInt" to 860 // the LOCAL time of sun-rise! 857 861 const Time ftime = fCurrentDay-boost::posix_time::hours(12); 858 862 859 863 //output it 860 str << path << ftime.GetAsStr("/%Y/%m/%d"); 864 const uint32_t night = ftime.NightAsInt(); 865 str << path << Tools::Form("/%04d/%02d/%02d/", night/10000, (night/100)%100, night%100); 861 866 862 867 //check if target directory exist … … 864 869 CreateDirectory(str.str()); 865 870 866 str << '/' << CompileFileName(service, extension, ftime);//fCurrentDay);871 str << '/' << CompileFileName(service, extension, night);//fCurrentDay); 867 872 868 873 return str.str();
Note:
See TracChangeset
for help on using the changeset viewer.