Changeset 10939 for trunk


Ignore:
Timestamp:
06/08/11 20:17:59 (13 years ago)
Author:
tbretz
Message:
Some little layout improvements.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/dataLogger.cc

    r10932 r10939  
    361361    ///monitoring notification loop
    362362    void ServicesMonitoring();
    363     inline void NotifyOpenedFile(string name, int type, DimDescribedService* service);
     363    inline void NotifyOpenedFile(const string &name, int type, DimDescribedService* service);
    364364    ///services notification thread
    365365    boost::thread fMonitoringThread;
     
    479479        if (!boost::filesystem::is_directory(fullPath))
    480480        {
    481             Error("Path to be created contains a file name: \"" + path + "\"");
     481            Error("Path to be created contains a file name: '" + path + "'");
    482482            return false;
    483483        }
    484         else
    485             return true;
     484
     485        return true;
    486486    }
    487487    //path does not exist, and upper level have been created already by recusrion.
     
    516516    if (!boost::filesystem::is_directory(fullPath))
    517517    {
    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");
    519519        return false;
    520520    }
     
    522522    if (access(path.c_str(), R_OK|W_OK|X_OK) != 0)
    523523    {
    524         Error("Missing read, write or execute permissions on directory\"" + path + "\"");
     524        Error("Missing read, write or execute permissions on directory '" + path + "'");
    525525        return false;
    526526    }
     
    975975            {
    976976                srvc.updateService();
     977
    977978                if(fDebugIsOn)
    978979                {
     
    17501751//!        this is not a problem though because file are not opened so often.
    17511752//! @ 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     }
     1753inline 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();
    17761781}
    17771782// --------------------------------------------------------------------------
     
    20272032            if (fDebugIsOn)
    20282033            {
    2029                 Debug("Writing to nightly FITS " + sub.nightlyFile.fFileName);   
     2034                Debug("Writing to nightly FITS " + sub.nightlyFile.fFileName);
    20302035            }
    20312036        }
Note: See TracChangeset for help on using the changeset viewer.