- Timestamp:
- 06/08/11 20:17:59 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/dataLogger.cc
r10932 r10939 361 361 ///monitoring notification loop 362 362 void ServicesMonitoring(); 363 inline void NotifyOpenedFile( stringname, int type, DimDescribedService* service);363 inline void NotifyOpenedFile(const string &name, int type, DimDescribedService* service); 364 364 ///services notification thread 365 365 boost::thread fMonitoringThread; … … 479 479 if (!boost::filesystem::is_directory(fullPath)) 480 480 { 481 Error("Path to be created contains a file name: \"" + path + "\"");481 Error("Path to be created contains a file name: '" + path + "'"); 482 482 return false; 483 483 } 484 else 485 484 485 return true; 486 486 } 487 487 //path does not exist, and upper level have been created already by recusrion. … … 516 516 if (!boost::filesystem::is_directory(fullPath)) 517 517 { 518 Error("Path given for checking \"" + path + "\"designate a file name. Please provide a path name only");518 Error("Path given for checking '" + path + "' designate a file name. Please provide a path name only"); 519 519 return false; 520 520 } … … 522 522 if (access(path.c_str(), R_OK|W_OK|X_OK) != 0) 523 523 { 524 Error("Missing read, write or execute permissions on directory \"" + path + "\"");524 Error("Missing read, write or execute permissions on directory '" + path + "'"); 525 525 return false; 526 526 } … … 975 975 { 976 976 srvc.updateService(); 977 977 978 if(fDebugIsOn) 978 979 { … … 1750 1751 //! this is not a problem though because file are not opened so often. 1751 1752 //! @ param type the type of the opened file. 0 = none open, 1 = log, 2 = text, 4 = fits 1752 inline void DataLogger::NotifyOpenedFile(string name, int type, DimDescribedService* service) 1753 { 1754 if (fOpenedFilesIsOn) 1755 { 1756 if (fDebugIsOn) 1757 { 1758 ostringstream str; 1759 str << "Updating " << service->getName() << " file '" << name << "' (type=" << type << ")"; 1760 Debug(str); 1761 str.str(""); 1762 str << "Num subs: " << fNumSubAndFitsData.numSubscriptions << " Num open FITS: " << fNumSubAndFitsData.numOpenFits; 1763 Debug(str); 1764 } 1765 if (name.size()+1 > FILENAME_MAX) 1766 { 1767 Error("Provided file name \"" + name + "\" is longer than allowed file name length"); 1768 } 1769 OpenFileToDim fToDim; 1770 fToDim.code = type; 1771 memcpy(fToDim.fileName, name.c_str(), name.size()+1); 1772 service->setData(reinterpret_cast<void*>(&fToDim), name.size()+1+sizeof(int)); 1773 service->setQuality(0); 1774 service->updateService(); 1775 } 1753 inline void DataLogger::NotifyOpenedFile(const string &name, int type, DimDescribedService* service) 1754 { 1755 if (!fOpenedFilesIsOn) 1756 return; 1757 1758 if (fDebugIsOn) 1759 { 1760 ostringstream str; 1761 str << "Updating " << service->getName() << " file '" << name << "' (type=" << type << ")"; 1762 Debug(str); 1763 1764 str.str(""); 1765 str << "Num subs: " << fNumSubAndFitsData.numSubscriptions << " Num open FITS: " << fNumSubAndFitsData.numOpenFits; 1766 Debug(str); 1767 } 1768 1769 if (name.size()+1 > FILENAME_MAX) 1770 { 1771 Error("Provided file name '" + name + "' is longer than allowed file name length"); 1772 } 1773 1774 OpenFileToDim fToDim; 1775 fToDim.code = type; 1776 memcpy(fToDim.fileName, name.c_str(), name.size()+1); 1777 1778 service->setData(reinterpret_cast<void*>(&fToDim), name.size()+1+sizeof(int)); 1779 service->setQuality(0); 1780 service->updateService(); 1776 1781 } 1777 1782 // -------------------------------------------------------------------------- … … 2027 2032 if (fDebugIsOn) 2028 2033 { 2029 Debug("Writing to nightly FITS " + sub.nightlyFile.fFileName); 2034 Debug("Writing to nightly FITS " + sub.nightlyFile.fFileName); 2030 2035 } 2031 2036 }
Note:
See TracChangeset
for help on using the changeset viewer.