Changeset 9510 for trunk/psModules/src/concepts/pmConcepts.c
- Timestamp:
- Oct 12, 2006, 11:38:28 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/concepts/pmConcepts.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/concepts/pmConcepts.c
r9216 r9510 153 153 } 154 154 155 if (source & PM_CONCEPT_SOURCE_PHU && !(*read & PM_CONCEPT_SOURCE_PHU)) { 156 if (!pmConceptsReadFromHeader(*specs, fpa, chip, cell, target)) { 157 psError(PS_ERR_UNKNOWN, false, "Error reading concepts from header.\n"); 158 success = false; 159 } 160 } 161 155 162 if (source & PM_CONCEPT_SOURCE_HEADER && !(*read & PM_CONCEPT_SOURCE_HEADER)) { 156 163 if (pmConceptsReadFromHeader(*specs, fpa, chip, cell, target)) { … … 201 208 pmConceptsWriteToDefaults(*specs, fpa, chip, cell, concepts); 202 209 } 203 if (source & PM_CONCEPT_SOURCE_HEADER) {210 if (source & (PM_CONCEPT_SOURCE_PHU | PM_CONCEPT_SOURCE_HEADER)) { 204 211 pmConceptsWriteToHeader(*specs, fpa, chip, cell, concepts); 205 212 } … … 218 225 psTrace("psModules.concepts", 5, "Blanking FPA concepts: %p %p\n", conceptsFPA, fpa->concepts); 219 226 return conceptsBlank(&conceptsFPA, fpa->concepts); 227 } 228 229 // Read the concepts for the given set of fpa, chip, cell 230 bool pmConceptsRead(pmFPA *fpa, // FPA for which to read concepts 231 pmChip *chip, // Chip for which to read concepts, or NULL 232 pmCell *cell, // Cell for which to read concepts, or NULL 233 pmConceptSource source, // The source of the concepts to read 234 psDB *db // Database handle 235 ) 236 { 237 PS_ASSERT_PTR_NON_NULL(fpa, false); 238 bool success = conceptsRead(&conceptsFPA, fpa, chip, cell, &fpa->conceptsRead, source, db, fpa->concepts); 239 if (chip) { 240 success |= conceptsRead(&conceptsChip, fpa, chip, cell, &chip->conceptsRead, source, db, chip->concepts); 241 } 242 if (cell) { 243 success |= conceptsRead(&conceptsCell, fpa, chip, cell, &cell->conceptsRead, source, db, cell->concepts); 244 } 245 246 return success; 220 247 } 221 248 … … 501 528 } 502 529 530 // FPA.TIMESYS 531 { 532 psMetadataItem *fpaTimesys = psMetadataItemAllocS32("FPA.TIMESYS", "Time system", -1); 533 pmConceptRegister(fpaTimesys, (pmConceptParseFunc)p_pmConceptParse_TIMESYS, 534 (pmConceptFormatFunc)p_pmConceptFormat_TIMESYS, PM_FPA_LEVEL_FPA); 535 psFree(fpaTimesys); 536 } 537 538 // FPA.TIME 539 { 540 psTime *time = psTimeAlloc(PS_TIME_TAI); // Blank time 541 // Not particularly distinguishing, but should be good enough 542 time->sec = 0; 543 time->nsec = 0; 544 psMetadataItem *fpaTime = psMetadataItemAlloc("FPA.TIME", PS_DATA_TIME, 545 "Time of exposure", time); 546 psFree(time); 547 pmConceptRegister(fpaTime, (pmConceptParseFunc)p_pmConceptParse_TIME, 548 (pmConceptFormatFunc)p_pmConceptFormat_TIME, PM_FPA_LEVEL_FPA); 549 psFree(fpaTime); 550 } 551 503 552 // Done with FPA level concepts 504 553 } … … 675 724 { 676 725 psMetadataItem *cellTimesys = psMetadataItemAllocS32("CELL.TIMESYS", "Time system", -1); 677 pmConceptRegister(cellTimesys, (pmConceptParseFunc)p_pmConceptParse_ CELL_TIMESYS,678 (pmConceptFormatFunc)p_pmConceptFormat_ CELL_TIMESYS, PM_FPA_LEVEL_CELL);726 pmConceptRegister(cellTimesys, (pmConceptParseFunc)p_pmConceptParse_TIMESYS, 727 (pmConceptFormatFunc)p_pmConceptFormat_TIMESYS, PM_FPA_LEVEL_CELL); 679 728 psFree(cellTimesys); 680 729 } … … 689 738 "Time of exposure", time); 690 739 psFree(time); 691 pmConceptRegister(cellTime, (pmConceptParseFunc)p_pmConceptParse_ CELL_TIME,692 (pmConceptFormatFunc)p_pmConceptFormat_ CELL_TIME, PM_FPA_LEVEL_CELL);740 pmConceptRegister(cellTime, (pmConceptParseFunc)p_pmConceptParse_TIME, 741 (pmConceptFormatFunc)p_pmConceptFormat_TIME, PM_FPA_LEVEL_CELL); 693 742 psFree(cellTime); 694 743 }
Note:
See TracChangeset
for help on using the changeset viewer.
