IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 12, 2006, 11:38:28 AM (20 years ago)
Author:
Paul Price
Message:

Adding FPA.TIME, FPA.TIMESYS. Genericized the parse and format functions for CELL.TIME and CELL.TIMESYS so that they can be used for the FPA versions as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/concepts/pmConcepts.c

    r9216 r9510  
    153153    }
    154154
     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
    155162    if (source & PM_CONCEPT_SOURCE_HEADER && !(*read & PM_CONCEPT_SOURCE_HEADER)) {
    156163        if (pmConceptsReadFromHeader(*specs, fpa, chip, cell, target)) {
     
    201208        pmConceptsWriteToDefaults(*specs, fpa, chip, cell, concepts);
    202209    }
    203     if (source & PM_CONCEPT_SOURCE_HEADER) {
     210    if (source & (PM_CONCEPT_SOURCE_PHU | PM_CONCEPT_SOURCE_HEADER)) {
    204211        pmConceptsWriteToHeader(*specs, fpa, chip, cell, concepts);
    205212    }
     
    218225    psTrace("psModules.concepts", 5, "Blanking FPA concepts: %p %p\n", conceptsFPA, fpa->concepts);
    219226    return conceptsBlank(&conceptsFPA, fpa->concepts);
     227}
     228
     229// Read the concepts for the given set of fpa, chip, cell
     230bool 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;
    220247}
    221248
     
    501528        }
    502529
     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
    503552        // Done with FPA level concepts
    504553    }
     
    675724        {
    676725            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);
    679728            psFree(cellTimesys);
    680729        }
     
    689738                                       "Time of exposure", time);
    690739            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);
    693742            psFree(cellTime);
    694743        }
Note: See TracChangeset for help on using the changeset viewer.