IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 6, 2007, 3:46:12 PM (18 years ago)
Author:
jhoblitt
Message:

impliemnt -flatcorrimfile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/flatcorrConfig.c

    r15684 r15755  
    144144            "use the simple output format", false);
    145145
     146    // -flatcorrimfile
     147    psMetadata *flatcorrimfileArgs = psMetadataAlloc();
     148    psMetadataAddStr(flatcorrimfileArgs, PS_LIST_TAIL, "-corr_id",  0,
     149            "search by exp_id", NULL);
     150    psMetadataAddU64(flatcorrimfileArgs, PS_LIST_TAIL, "-limit",  0,
     151            "limit result set to N items", 0);
     152    psMetadataAddBool(flatcorrimfileArgs, PS_LIST_TAIL, "-simple", 0,
     153            "use the simple output format", false);
     154
    146155    // -update
    147156    psMetadata *updateArgs = psMetadataAlloc();
     
    156165    PXTOOL_ADD_MODE("-pending", "show flat correction runs needing to be processed",
    157166        FLATCORR_MODE_PENDING,      pendingArgs);
     167    PXTOOL_ADD_MODE("-flatcorrimfile", "list all the exposures in flat correction runs",
     168        FLATCORR_MODE_FLATCORRIMFILE, flatcorrimfileArgs);
    158169    PXTOOL_ADD_MODE("-update",  "change a flat calibration run's state",
    159170        FLATCORR_MODE_UPDATE,       updateArgs);
     
    187198    config->where = psMetadataAlloc();
    188199
    189     addWhereStr(det_id);
    190     {
    191         // XXX this is broke because you can't specify -iteration 0
    192         psMetadataItem *item = psMetadataLookup(config->args, "-iteration");
    193         if (item && psStrcasestr(item->comment, "found")) {
    194             if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "iteration", 0, "==", item->data.S32)) {
    195                 psError(PS_ERR_UNKNOWN, false, "failed to add item iteration");
    196                 psFree(config);
    197                 return NULL;
    198             }
     200{   
     201    psString str = NULL;
     202    bool status = false;
     203    if ((str = psMetadataLookupStr(&status, config->args, "-corr_id"))) {
     204        if (!psMetadataAddS64(config->where, PS_LIST_TAIL, "corr_id", 0, "==", (psS64)atoll(str))) {
     205            psError(PS_ERR_UNKNOWN, false, "failed to add item corr_id");
     206            psFree(config);
     207            return NULL;
    199208        }
    200209    }
    201 
    202     addWhereStr(det_id);
    203 
    204     // convert '-code' to 'fault'
    205     {
    206         psS16 fault = 0;
    207         bool status = false;
    208         if ((fault = psMetadataLookupS16(&status, config->args, "-code"))) {
    209             if (!psMetadataAddS16(config->where, PS_LIST_TAIL, "fault", 0, "==", fault)) {
    210                 psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    211                 psFree(config);
    212                 return NULL;
    213             }
    214         }
    215     }
     210}
    216211
    217212    if (config->where->list->n < 1) {
Note: See TracChangeset for help on using the changeset viewer.