- Timestamp:
- 10/26/11 11:41:42 (13 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Fits.cc
r12035 r12277 56 56 //! @param dataPointer the memory location where the DIM data starts 57 57 //! @param numDataBytes the number of bytes taken by the DIM data. 58 //! @param out Message object to use for propagating messages 58 59 // 59 void Fits::InitDataColumns(const vector<Description> &desc, const vector<string>& dataFormat, void* dataPointer )60 void Fits::InitDataColumns(const vector<Description> &desc, const vector<string>& dataFormat, void* dataPointer, MessageImp* out) 60 61 { 61 62 fDataFormats = dataFormat; … … 63 64 64 65 //we will copy this information here. It duplicates the data, which is not great, but it is the easiest way of doing it right now 65 if (desc.size() == dataFormat.size()) 66 { 67 fDataColDesc = desc; 66 if ((desc.size() == dataFormat.size()+1) || //regular service 67 (desc.size() == dataFormat.size()+2))//service with ending string. skipped in fits 68 {//services have one (or two) more description than columns. skip the first entry while copying as it describes the table itself. 69 fDataColDesc.clear(); 70 for (unsigned int i=0;i<dataFormat.size(); i++) 71 { 72 string name = desc[i+1].name; 73 if (name.length() > 68) name = name.substr(0, 68); 74 string comment = desc[i+1].comment; 75 if (comment.length() > 68) comment = comment.substr(0,68); 76 string unit = desc[i+1].unit; 77 if (unit.length() > 68) unit = comment.substr(0,68); 78 fDataColDesc.push_back(Description(name, comment, unit)); 79 } 68 80 return; 69 81 } 70 82 83 {//if we arrived here, this means that the columns descriptions could not be parsed 84 ostringstream str; 85 str << "Expected " << dataFormat.size() << " descriptions of columns, got " << desc.size()-1 << " for service: "; 86 if (desc.size() > 0) 87 str << desc[0].name; 88 else 89 str << "<unknown>"; 90 91 out->Warn(str.str()); 92 } 93 71 94 fDataColDesc.clear(); 95 // fDataColDesc.push_back(Description("service", "comment", "unit")); 72 96 for (unsigned int i=0;i<dataFormat.size();i++) 73 97 { … … 133 157 name = stt.str(); 134 158 } 135 159 //cout << endl << "#####adding column: " << name << " " << fDataFormats[i] << " " << fDataColDesc[i].unit << endl << endl; 136 160 fFile->AddColumn(name, fDataFormats[i], fDataColDesc[i].unit); 137 161 } … … 249 273 fFile->WriteKeyNT("TSTART", Time(doubleValue).Iso(), 250 274 "Time of the first received data"); 275 fFile->WriteKeyNT("TSTOP", Time(fEndMjD).Iso(), 276 "Time of the last receied data"); 251 277 } 252 278 fEndMjD = *reinterpret_cast<double*>(fStandardPointers[0]); -
trunk/FACT++/src/Fits.h
r12071 r12277 78 78 79 79 ///Adds columns specific to the service being logged. 80 void InitDataColumns(const vector<Description> &desc, const vector<string>& dataFormat, void* dataPointer );80 void InitDataColumns(const vector<Description> &desc, const vector<string>& dataFormat, void* dataPointer, MessageImp* out); 81 81 82 82 ///Opens a FITS file -
trunk/FACT++/src/datalogger.cc
r12167 r12277 645 645 ostringstream str; 646 646 647 const Time ftime(time -boost::posix_time::hours(12));647 const Time ftime(time);//removed this as already done by nightAsInt: -boost::posix_time::hours(12)); 648 648 str << ftime.NightAsInt(); 649 649 … … 811 811 fNumSubAndFits = new DimDescribedService(GetName() + "/NUM_SUBS", "I:2", fNumSubAndFitsData, 812 812 "Shows number of services to which the data logger is currently subscribed and the total number of open files." 813 "|Subscriptions[int]:number of dim services to which the data logger is currently subscribed." 814 "|NumOpenFiles[int]:number of files currently open by the data logger"); 813 "|NumSubAndNumOpenFiles[int]:number of dim services to which the data logger is currently subscribed plus number of files currently open by the data logger"); 815 814 816 815 //services parameters … … 1851 1850 const vector<string> dataFormatsLocal = sub.fConv->GetFitsFormat(); 1852 1851 1853 sub.nightlyFile.InitDataColumns(GetDescription(sub.server, sub.service), dataFormatsLocal, sub.dimInfo->getData() );1854 sub.runFile.InitDataColumns(GetDescription(sub.server, sub.service), dataFormatsLocal, sub.dimInfo->getData() );1852 sub.nightlyFile.InitDataColumns(GetDescription(sub.server, sub.service), dataFormatsLocal, sub.dimInfo->getData(), this); 1853 sub.runFile.InitDataColumns(GetDescription(sub.server, sub.service), dataFormatsLocal, sub.dimInfo->getData(), this); 1855 1854 sub.fitsBufferAllocated = true; 1856 1855 }
Note:
See TracChangeset
for help on using the changeset viewer.