Changeset 10930
- Timestamp:
- 06/08/11 18:04:28 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/dataLogger.cc
r10927 r10930 423 423 void AppendYearMonthDaytoPath(string& path); 424 424 ///Form the files path 425 string CompileFileName(const string &path, const Time &time, const string &service, const string & extension);425 string CompileFileName(const string &path, const string &service, const string & extension, const Time &time=Time()); 426 426 ///Form the files path 427 string CompileFileName(const string &path, const Time &time, uint32_t run, const string &service, const string & extension);427 string CompileFileName(const string &path, uint32_t run, const string &service, const string & extension, const Time &time=Time()); 428 428 ///Check whether service is in black and/or white list 429 429 bool ShouldSubscribe(const string& server, const string& service); … … 690 690 //! @param extension the extension to add, if any 691 691 // 692 string DataLogger::CompileFileName(const string &path, const Time &time, const string &service, const string & extension)692 string DataLogger::CompileFileName(const string &path, const string &service, const string & extension, const Time &time) 693 693 { 694 694 ostringstream str; … … 725 725 //! @param extension the extension to add, if any 726 726 // 727 string DataLogger::CompileFileName(const string &path, const Time &time, uint32_t run, const string &service, const string & extension)727 string DataLogger::CompileFileName(const string &path, uint32_t run, const string &service, const string & extension, const Time &time) 728 728 { 729 729 ostringstream str; … … 1215 1215 return -1; 1216 1216 } 1217 run.logName = CompileFileName(fRunFilePath, Time(),run.runNumber, "", "log");1217 run.logName = CompileFileName(fRunFilePath, run.runNumber, "", "log"); 1218 1218 errno = 0; 1219 1219 run.logFile->open(run.logName.c_str(), ios_base::out | ios_base::app); … … 1226 1226 #endif 1227 1227 //open report file 1228 run.reportName = CompileFileName(fRunFilePath, Time(),run.runNumber, "", "rep");1228 run.reportName = CompileFileName(fRunFilePath, run.runNumber, "", "rep"); 1229 1229 if (run.reportFile->is_open()) 1230 1230 { … … 1265 1265 1266 1266 //TODO this notification scheme might be messed up now.... fix it ! 1267 string baseFileName = CompileFileName(fRunFilePath, Time(),run.runNumber, "", "");1267 string baseFileName = CompileFileName(fRunFilePath, run.runNumber, "", ""); 1268 1268 NotifyOpenedFile(baseFileName, 3, fOpenedRunFiles); 1269 1269 run.openedFits.clear(); … … 1357 1357 //construct the header 1358 1358 ostringstream header; 1359 Time cTime(I->getTimestamp(), I->getTimestampMillisecs()*1000);1359 const Time cTime(I->getTimestamp(), I->getTimestampMillisecs()*1000); 1360 1360 fQuality = I->getQuality(); 1361 1361 fMjD = cTime.Mjd(); … … 1394 1394 Error(str); 1395 1395 } 1396 1396 1397 } 1397 1398 } … … 1495 1496 //print active run numbers 1496 1497 ostringstream str; 1497 str << "Active Run Numbers: 1498 str << "Active Run Numbers:"; 1498 1499 for (list<RunNumberType>::iterator it=fRunNumber.begin(); it!=fRunNumber.end(); it++) 1499 str << "\n" << it->runNumber; 1500 str << " " << it->runNumber; 1501 if (fRunNumber.size()==0) 1502 str << " <none>"; 1500 1503 Message(str); 1501 1504 … … 1503 1506 Message("------------ OPENED FILES ----------------"); 1504 1507 if (fNightlyLogFile.is_open()) 1505 Message("Nightly log-file: "/*+filename+*/" (OPEN)");1508 Message("Nightly log-file: OPEN"); 1506 1509 1507 1510 if (fNightlyReportFile.is_open()) 1508 Message("Nightly report-file: "/*filename+*/" (OPEN)");1511 Message("Nightly report-file: OPEN"); 1509 1512 1510 1513 for (list<RunNumberType>::iterator it=fRunNumber.begin(); it!=fRunNumber.end(); it++) … … 1758 1761 { 1759 1762 ostringstream str; 1760 str << "Updating files service " << service->getName() << "with code: " << type << " and file: " << name;1763 str << "Updating " << service->getName() << " file '" << name << "' (type=" << type << ")"; 1761 1764 Debug(str); 1762 1765 str.str(""); … … 1789 1792 Debug("Starting..."); 1790 1793 } 1791 fFullNightlyLogFileName = CompileFileName(fNightlyFilePath, Time(),"", "log");1794 fFullNightlyLogFileName = CompileFileName(fNightlyFilePath, "", "log"); 1792 1795 OpenTextFilePlease(fNightlyLogFile, fFullNightlyLogFileName); 1793 1796 1794 fFullNightlyReportFileName = CompileFileName(fNightlyFilePath, Time(),"", "rep");1797 fFullNightlyReportFileName = CompileFileName(fNightlyFilePath, "", "rep"); 1795 1798 OpenTextFilePlease(fNightlyReportFile, fFullNightlyReportFileName); 1796 1799 … … 1810 1813 1811 1814 //notify that a new file has been opened. 1812 string baseFileName = CompileFileName(fNightlyFilePath, Time(),"", "");1815 string baseFileName = CompileFileName(fNightlyFilePath, "", ""); 1813 1816 NotifyOpenedFile(baseFileName, 3, fOpenedNightlyFiles); 1814 1817 … … 1860 1863 { 1861 1864 string fileNameOnly, partialName; 1862 partialName = CompileFileName(fNightlyFilePath, Time(),serviceName, "fits");1865 partialName = CompileFileName(fNightlyFilePath, serviceName, "fits"); 1863 1866 fileNameOnly = partialName.substr(partialName.find_last_of('/')+1, partialName.size()); 1864 1867 AllocateFITSBuffers(sub); … … 1870 1873 1871 1874 //notify the opening 1872 string baseFileName = CompileFileName(fNightlyFilePath, Time(),"", "");1875 string baseFileName = CompileFileName(fNightlyFilePath, "", ""); 1873 1876 NotifyOpenedFile(baseFileName, 7, fOpenedNightlyFiles); 1874 1877 if (fNumSubAndFitsIsOn) … … 1877 1880 { 1878 1881 ostringstream str; 1879 str << "Opened Nightly FITS: " << partialName << " and table: FACT-" << serviceName << ".current number of opened FITS: " << fNumSubAndFitsData.numOpenFits;1882 str << "Opened Nightly FITS: " << partialName << " and table: " << serviceName << ".current number of opened FITS: " << fNumSubAndFitsData.numOpenFits; 1880 1883 Debug(str); 1881 1884 } … … 1888 1891 if (hasGrouping) 1889 1892 { 1890 partialName = CompileFileName(fRunFilePath, Time(),sub.runNumber, "group", "fits");1893 partialName = CompileFileName(fRunFilePath, sub.runNumber, "group", "fits"); 1891 1894 fileNameOnly = partialName.substr(partialName.find_last_of('/')+1, partialName.size()); 1892 1895 } 1893 1896 else 1894 1897 { 1895 partialName = CompileFileName(fRunFilePath, Time(),sub.runNumber, serviceName, "fits");1898 partialName = CompileFileName(fRunFilePath, sub.runNumber, serviceName, "fits"); 1896 1899 fileNameOnly = partialName.substr(partialName.find_last_of('/')+1, partialName.size()); 1897 1900 } … … 1919 1922 } 1920 1923 1921 string baseFileName = CompileFileName(fRunFilePath, Time(),sub.runNumber, "", "");1924 string baseFileName = CompileFileName(fRunFilePath, sub.runNumber, "", ""); 1922 1925 NotifyOpenedFile(baseFileName, 7, fOpenedRunFiles);// + '_' + serviceName, 4); 1923 1926 if (hasGrouping) … … 1931 1934 { 1932 1935 ostringstream str; 1933 str << "Opened Run FITS: " << partialName << " and table: FACT-" << serviceName << ".current number of opened FITS: " << fNumSubAndFitsData.numOpenFits;1936 str << "Opened Run FITS: " << partialName << " and table: " << serviceName << ".current number of opened FITS: " << fNumSubAndFitsData.numOpenFits; 1934 1937 Debug(str); 1935 1938 } … … 2101 2104 string groupName; 2102 2105 if (runNumber != 0) 2103 groupName = CompileFileName(fRunFilePath, Time(),runNumber, "", "fits");2106 groupName = CompileFileName(fRunFilePath, runNumber, "", "fits"); 2104 2107 else 2105 groupName = CompileFileName(fNightlyFilePath, Time(),"", "fits");2108 groupName = CompileFileName(fNightlyFilePath, "", "fits"); 2106 2109 2107 2110 CCfits::Table* groupTable;
Note:
See TracChangeset
for help on using the changeset viewer.