Changeset 12443 for trunk/FACT++
- Timestamp:
- 11/07/11 04:43:15 (13 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Fits.cc
r12422 r12443 68 68 {//services have one (or two) more description than columns. skip the first entry while copying as it describes the table itself. 69 69 fDataColDesc.clear(); 70 fTableDesc = desc[0].comment; 71 if (fTableDesc.size() > 68) 72 { 73 out->Warn("Table description \"" + fTableDesc + "\" too long. truncating it (68 char max.)"); 74 fTableDesc = fTableDesc.substr(0,68); 75 } 70 76 for (unsigned int i=0;i<dataFormat.size(); i++) 71 77 { 72 78 string name = desc[i+1].name; 73 if (name.length() > 68) name = name.substr(0, 68); 79 if (name.length() > 68) 80 { 81 out->Warn("Column name " + name + "too long. truncating it (68 char max.)"); 82 name = name.substr(0, 68); 83 } 74 84 string comment = desc[i+1].comment; 75 if (comment.length() > 68) comment = comment.substr(0,68); 85 if ((comment.length() + name.length()) > 71) 86 { 87 out->Warn("Column " + name + " added to \"" + comment + "\" too long. truncating to fit 68 chars."); 88 comment = comment.substr(0,68); 89 } 76 90 string unit = desc[i+1].unit; 77 91 if (unit.length() > 68) unit = comment.substr(0,68); … … 170 184 171 185 fCopyBuffer.resize(fFile->GetDataSize()); 172 186 //write header comments 187 ostringstream str; 188 for (unsigned int i=0;i<fStandardColDesc.size();i++) 189 { 190 str.str(""); 191 str << "TTYPE" << i+1; 192 fFile->WriteKeyNT(str.str(), fStandardColDesc[i].name, fStandardColDesc[i].comment); 193 str.str(""); 194 str << "TCOMM" << i+1; 195 fFile->WriteKeyNT(str.str(), fStandardColDesc[i].comment, ""); 196 } 197 198 for (unsigned int i=0; i<fDataColDesc.size(); i++) 199 { 200 string name = fDataColDesc[i].name; 201 if (name.empty()) 202 { 203 ostringstream stt; 204 stt << "Data" << i; 205 name = stt.str(); 206 } 207 str.str(""); 208 str << "TTYPE" << i+fStandardColDesc.size()+1; 209 fFile->WriteKeyNT(str.str(), name, fDataColDesc[i].comment); 210 str.str(""); 211 str << "TCOMM" << i+fStandardColDesc.size()+1; 212 fFile->WriteKeyNT(str.str(), fDataColDesc[i].comment, ""); 213 } 214 fFile->WriteKeyNT("COMMENT", fTableDesc, ""); 215 //END COMMENTS UPDATE 173 216 return fFile->GetNumRows()==0 ? true : WriteHeaderKeys(); 174 217 } -
trunk/FACT++/src/Fits.h
r12277 r12443 33 33 ///the vector of data column names 34 34 vector<Description> fDataColDesc; 35 //Description of the table 36 string fTableDesc; 35 37 ///the data format of the data columns 36 38 vector<string> fDataFormats; -
trunk/FACT++/src/datalogger.cc
r12442 r12443 806 806 807 807 fOpenedNightlyFiles = new DimDescribedService(GetName() + "/FILENAME_NIGHTLY", "I:1;C", fToDim, 808 "Path and base name which is used to compile the filenamesfor the nightly files."808 "Path and base name used for the nightly files." 809 809 "|Type[int]:type of open files (1=log, 2=rep, 4=fits)" 810 810 "|Name[string]:path and base file name"); 811 811 812 812 fOpenedRunFiles = new DimDescribedService(GetName() + "/FILENAME_RUN", "I:1;C", fToDim, 813 "Path and base name which is used to compile the filenamesfor the run files."813 "Path and base name used for the run files." 814 814 "|Type[int]:type of open files (1=log, 2=rep, 4=fits)" 815 815 "|Name[string]:path and base file name"); … … 818 818 fNumSubAndFitsData.numOpenFits = 0; 819 819 fNumSubAndFits = new DimDescribedService(GetName() + "/NUM_SUBS", "I:2", fNumSubAndFitsData, 820 " Shows number of services to which the data logger is currently subscribed and the total number of open files."821 "|N umSubAndNumOpenFiles[int]:number of dim services to which the data logger is currently subscribed plus number of files currently open by the data logger");820 "Num. open files + num. subscribed services" 821 "|NSubAndOpenFiles[int]:Num. of subs and open files"); 822 822 823 823 //services parameters … … 955 955 void DataLogger::infoHandler() 956 956 { 957 if ( !fAutoStarted&& fShouldAutoStart)957 if ((GetCurrentState() == kSM_Ready) && (!fAutoStarted) && fShouldAutoStart) 958 958 { 959 959 fAutoStarted = true; 960 960 SetCurrentState(StartPlease()); 961 } 962 else {if (GetCurrentState() > kSM_Ready) 963 fAutoStarted = true; 961 964 } 962 965 DimInfo* I = getInfo();
Note:
See TracChangeset
for help on using the changeset viewer.