Changeset 11719
- Timestamp:
- 07/30/11 16:12:38 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/FACT++/src/datalogger.cc ¶
r11621 r11719 964 964 // dim_lock(); 965 965 966 //now clear the services subscriptions 966 //now clear the services subscriptions 967 dim_lock(); 967 968 fServiceSubscriptions.clear(); 969 dim_unlock(); 968 970 969 971 //clear any remaining run number (should remain only one) … … 1805 1807 { 1806 1808 sub.runFile.Close(); 1807 Info("Closed: "+sub.runFile. fFileName+" (new run number)");1809 Info("Closed: "+sub.runFile.GetName()+" (new run number)"); 1808 1810 } 1809 1811 … … 1841 1843 fOpenedNightlyFits[fileNameOnly].push_back(serviceName); 1842 1844 1843 if (!sub.nightlyFile.Open(partialName, serviceName, NULL,&fNumSubAndFitsData.numOpenFits, this, 0))1845 if (!sub.nightlyFile.Open(partialName, serviceName, &fNumSubAndFitsData.numOpenFits, this, 0)) 1844 1846 { 1845 1847 GoToRunWriteErrorState(); … … 1865 1867 { 1866 1868 partialName = CompileFileNameWithPath(fRunFilePath, sub.runNumber, "", "fits"); 1867 fileNameOnly = partialName.substr(partialName.find_last_of('/')+1, partialName.size());1868 1869 } 1869 1870 else 1870 1871 { 1871 1872 partialName = CompileFileNameWithPath(fRunFilePath, sub.runNumber, serviceName, "fits"); 1872 fileNameOnly = partialName.substr(partialName.find_last_of('/')+1, partialName.size()); 1873 } 1873 } 1874 1875 fileNameOnly = partialName.substr(partialName.find_last_of('/')+1, partialName.size()); 1876 1874 1877 //get the size of the file we're about to open 1875 1878 if (fFilesStats.FileOpened(partialName)) … … 1902 1905 if (hasGrouping) 1903 1906 { 1904 if (!sub.runFile.Open(partialName, serviceName, (cRunNumber->runFitsFile).get(), &fNumSubAndFitsData.numOpenFits, this, sub.runNumber))1907 if (!sub.runFile.Open(partialName, serviceName, &fNumSubAndFitsData.numOpenFits, this, sub.runNumber, cRunNumber->runFitsFile.get())) 1905 1908 { 1906 1909 GoToRunWriteErrorState(); … … 1910 1913 else 1911 1914 { 1912 if (!sub.runFile.Open(partialName, serviceName, NULL,&fNumSubAndFitsData.numOpenFits, this, sub.runNumber))1915 if (!sub.runFile.Open(partialName, serviceName, &fNumSubAndFitsData.numOpenFits, this, sub.runNumber)) 1913 1916 { 1914 1917 GoToRunWriteErrorState(); … … 1941 1944 sub.runFile.AddStandardColumn(QoSDesc, "1J", &fQuality, sizeof(int)); 1942 1945 1943 const Converter::FormatList flist = sub.fConv->GetList();1944 1946 // Compilation failed 1945 1947 if (!sub.fConv->valid()) … … 1951 1953 //we've got a nice structure describing the format of this service's messages. 1952 1954 //Let's create the appropriate FITS columns 1953 int size = 0; 1954 1955 vector<string> dataFormatsLocal; 1956 for (unsigned int i=0;i<flist.size()-1;i++) 1957 { 1958 ostringstream dataQualifier; 1959 1960 dataQualifier << flist[i].second.first; 1961 switch (flist[i].first.first->name()[0]) 1962 { 1963 case 'c': dataQualifier << 'B'; break; 1964 case 's': dataQualifier << 'I'; break; 1965 case 'i': dataQualifier << 'J'; break; 1966 case 'l': dataQualifier << 'J'; break; 1967 case 'f': dataQualifier << 'E'; break; 1968 case 'd': dataQualifier << 'D'; break; 1969 case 'x': dataQualifier << 'K'; break; 1970 case 'S': //we skip the variable length strings 1971 continue; 1972 1973 default: 1974 Fatal("THIS SHOULD NEVER BE REACHED."); 1975 }; 1976 1977 size += flist[i].first.second * flist[i].second.first; 1978 dataFormatsLocal.push_back(dataQualifier.str()); 1979 } 1980 sub.nightlyFile.InitDataColumns(GetDescription(sub.server, sub.service), dataFormatsLocal, sub.dimInfo->getData(), size); 1981 sub.runFile.InitDataColumns(GetDescription(sub.server, sub.service), dataFormatsLocal, sub.dimInfo->getData(), size); 1982 sub.fitsBufferAllocated = true; 1955 const vector<string> dataFormatsLocal = sub.fConv->GetFitsFormat(); 1956 1957 sub.nightlyFile.InitDataColumns(GetDescription(sub.server, sub.service), dataFormatsLocal, sub.dimInfo->getData()); 1958 sub.runFile.InitDataColumns(GetDescription(sub.server, sub.service), dataFormatsLocal, sub.dimInfo->getData()); 1959 sub.fitsBufferAllocated = true; 1983 1960 } 1984 1961 // --------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.