IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24777


Ignore:
Timestamp:
Jul 12, 2009, 3:20:10 PM (17 years ago)
Author:
eugene
Message:

add {FPA.DATE} derived from {FPA.TIME}

File:
1 edited

Legend:

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

    r23832 r24777  
    485485        concept[length - 1] = '\0';
    486486
     487        // special variants:
     488        if (!strcmp(concept, "FPA.DATE")) {
     489          psTime *fpaTime = psMetadataLookupPtr(NULL, fpa->concepts, "FPA.TIME");
     490          if (!fpaTime) {
     491            psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Missing concept FPA.TIME needed for FPA.DATE");
     492            psFree(string);
     493            return NULL;
     494          }
     495          psString dateTimeString = psTimeToISO(fpaTime); // String representation
     496          psList *dateTime = psStringSplit(dateTimeString, "T", true);
     497          psFree(dateTimeString);
     498          psString dateString = psMemIncrRefCounter(psListGet(dateTime, PS_LIST_HEAD)); // The date string
     499          psFree (dateTime);
     500
     501          if (!psStringSubstitute(&string, dateString, "{FPA.DATE}")) {
     502              psError(PS_ERR_UNKNOWN, false, "Unable to replace concept %s", concept);
     503              psFree(string);
     504              psFree(dateString);
     505              return NULL;
     506          }
     507          psFree (dateString);
     508          continue;
     509        }
     510
    487511        psTrace("psModules.concepts", 7, "Interpolating concept %s", concept);
    488512
Note: See TracChangeset for help on using the changeset viewer.