IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15052


Ignore:
Timestamp:
Sep 27, 2007, 2:38:19 PM (19 years ago)
Author:
eugene
Message:

handle MULTI entries in FILTER.ID

File:
1 edited

Legend:

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

    r14293 r15052  
    132132    // the metadata is in the format (internal) STR (external)
    133133    // find the first internal name that matches
    134     psString value = psMetadataLookupStr(&mdok, filters, key); // Value to use
    135     if (!mdok || !value || strlen(value) == 0) {
     134    psMetadataItem *item = psMetadataLookup (filters, key);
     135    if (!item) {
    136136        psError(PS_ERR_UNEXPECTED_NULL, true,
    137137                "Unable to find %s in FILTER.ID in camera configuration.\n", key);
     
    139139    }
    140140
    141     return psMetadataItemAllocStr(concept->name, concept->comment, value);
     141    if (item->type == PS_DATA_STRING) {
     142        return psMetadataItemAllocStr(concept->name, concept->comment, item->data.V);
     143    }
     144
     145    if (item->type == PS_DATA_METADATA_MULTI) {
     146        psMetadataItem *entry = psListGet (item->data.list, PS_LIST_HEAD);
     147        if (!entry) {
     148            psError(PS_ERR_UNEXPECTED_NULL, true,
     149                    "List for %s in FILTER.ID in camera configuration is empty.\n", key);
     150            return NULL;
     151        }
     152        return psMetadataItemAllocStr(concept->name, concept->comment, entry->data.V);
     153    }
     154
     155    psError(PS_ERR_UNEXPECTED_NULL, true,
     156            "Unable to find %s in FILTER.ID in camera configuration.\n", key);
     157    return NULL;
    142158}
    143159
Note: See TracChangeset for help on using the changeset viewer.