- Timestamp:
- 06/08/11 14:40:14 (13 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Fits.cc
r10898 r10927 148 148 { 149 149 string factTableName = "FACT-" + tableName; 150 fTable = fFile->addTable(factTableName, 0, allNames, allDataTypes, allUnits); 151 fTable->makeThisCurrent(); 150 //first, let's check if the table already exist in the file 151 vector<string> tryToLoadName; 152 tryToLoadName.push_back(factTableName); 153 fFile->read(tryToLoadName); 154 const multimap< string, CCfits::ExtHDU * >& extMap = fFile->extension(); 155 if (extMap.find(factTableName) == extMap.end()) 156 { 157 for (multimap<string, CCfits::ExtHDU*>::const_iterator it=extMap.begin(); it!= extMap.end(); it++) 158 fMess->Debug(it->first); 159 fTable = fFile->addTable(factTableName, 0, allNames, allDataTypes, allUnits); 160 } 161 else 162 { 163 fTable = dynamic_cast<CCfits::Table*>(extMap.find(factTableName)->second); 164 } 165 if (!fTable) 166 { 167 fMess->Error("The table " + factTableName + " could not be created nor loaded. skipping it"); 168 return; 169 } 170 fTable->makeThisCurrent(); 152 171 fCopyBuffer = new unsigned char[fTotalNumBytes]; 153 172 fNumRows = fTable->rows(); … … 178 197 updating = true; 179 198 } 199 180 200 } 181 201 catch(CCfits::FitsException e) … … 301 321 WriteSingleHeaderKey("TSTOP", fEndMjD, "Time of the last receied data"); 302 322 if (fFile != NULL && fOwner) 303 delete fFile; 323 { 324 // fFile->flush(); 325 delete fFile; 326 } 304 327 fFile = NULL; 305 328 if (fCopyBuffer != NULL) -
trunk/FACT++/src/dataLogger.cc
r10907 r10927 933 933 } 934 934 //check if daily files should be closed and reopened. 935 //FIXME when Time().h() == 12, the actual time is 2pm 935 936 if (Time().h() == 12 && !resetDone) 936 937 { 938 if (fDebugIsOn) 939 Debug("Change of day detected. Closing daily files and restarting the dataLogger"); 937 940 int cState = GetCurrentState(); 938 941 GoToReadyPlease(); … … 952 955 } 953 956 else 954 resetDone = false; 957 // { 958 // if (Time().h() != 12 && resetDone) 959 resetDone = false; 960 // } 955 961 if (fStatsPeriodDuration == 0.0f) 956 962 { … … 2093 2099 return; 2094 2100 } 2095 string groupName = CompileFileName(fRunFilePath, Time(), runNumber, "", "fits"); 2101 string groupName; 2102 if (runNumber != 0) 2103 groupName = CompileFileName(fRunFilePath, Time(), runNumber, "", "fits"); 2104 else 2105 groupName = CompileFileName(fNightlyFilePath, Time(), "", "fits"); 2106 2096 2107 CCfits::Table* groupTable; 2097 2108 int maxCharLength = 50;//FILENAME_MAX;
Note:
See TracChangeset
for help on using the changeset viewer.