IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 1, 2007, 6:16:29 PM (19 years ago)
Author:
Paul Price
Message:

Updating high-level programs to use symbolic names for mask values in the recipes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackArguments.c

    r13557 r13593  
    6464}
    6565
     66// Get a mask value from the command-line or recipe, and add it to the arguments
     67#define VALUE_ARG_RECIPE_MASK(ARGNAME, RECIPENAME) { \
     68    bool mdok; \
     69    const char *name = psMetadataLookupStr(&mdok, arguments, ARGNAME); \
     70    if (!mdok || !name || strlen(name) == 0) { \
     71        name = psMetadataLookupStr(NULL, recipe, RECIPENAME); \
     72        if (!name) { \
     73            psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unable to find %s in recipe %s", \
     74                RECIPENAME, PPSTACK_RECIPE); \
     75            goto ERROR; \
     76        } \
     77    } \
     78    psMaskType value = pmConfigMask(name, config); \
     79    psMetadataAddU8(config->arguments, PS_LIST_TAIL, RECIPENAME, 0, NULL, value); \
     80}
     81
    6682// Get a string value from the command-line and add it to the target
    6783static bool valueArgStr(pmConfig *config,      // Configuration
     
    119135    VALUE_ARG_RECIPE_FLOAT("-convolve-rej", "CONVOLVE.REJ", F32);
    120136    VALUE_ARG_RECIPE_FLOAT("-extent",       "EXTENT",       F32);
    121     VALUE_ARG_RECIPE_INT("-mask-bad",       "MASK.BAD",     U8, 0);
    122     VALUE_ARG_RECIPE_INT("-mask-blank",     "MASK.BLANK",   U8, 0);
     137    VALUE_ARG_RECIPE_MASK("-mask-bad",      "MASK.BAD");
     138    VALUE_ARG_RECIPE_MASK("-mask-blank",    "MASK.BLANK");
    123139
    124140    psTrace("ppStack", 1, "Done reading command-line arguments\n");
Note: See TracChangeset for help on using the changeset viewer.