IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 15, 2006, 12:33:53 PM (19 years ago)
Author:
jhoblitt
Message:

add -simple output options where appropriate

File:
1 edited

Legend:

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

    r10690 r10751  
    8484    psMetadataAddStr(towarpedimfileArgs, PS_LIST_TAIL, "-p4_id", 0,
    8585            "search by p4 ID", NULL);
     86    psMetadataAddBool(towarpedimfileArgs, PS_LIST_TAIL, "-simple",  0,
     87            "use the simple output format", false);
    8688 
    8789    // -addwarpedimfile
     
    106108    psMetadataAddStr(warpedimfileArgs, PS_LIST_TAIL, "-p4_id", 0,
    107109            "search by p4 ID", NULL);
     110    psMetadataAddBool(warpedimfileArgs, PS_LIST_TAIL, "-simple",  0,
     111            "use the simple output format", false);
    108112
    109113    // -tostackedimfile
     
    111115    psMetadataAddStr(tostackedimfileArgs, PS_LIST_TAIL, "-p4_id", 0,
    112116            "search by p4 ID", NULL);
     117    psMetadataAddBool(tostackedimfileArgs, PS_LIST_TAIL, "-simple",  0,
     118            "use the simple output format", false);
    113119
    114120    // -addstackedimfile
     
    133139    psMetadataAddStr(stackedimfileArgs, PS_LIST_TAIL, "-p4_id", 0,
    134140            "search by p4 ID", NULL);
     141    psMetadataAddBool(stackedimfileArgs, PS_LIST_TAIL, "-simple",  0,
     142            "use the simple output format", false);
    135143 
    136144    // -todiffimfile
     
    138146    psMetadataAddStr(todiffimfileArgs, PS_LIST_TAIL, "-p4_id", 0,
    139147            "search by p4 ID", NULL);
     148    psMetadataAddBool(todiffimfileArgs, PS_LIST_TAIL, "-simple",  0,
     149            "use the simple output format", false);
    140150 
    141151    // -adddiffimfile
     
    160170    psMetadataAddStr(diffimfileArgs, PS_LIST_TAIL, "-p4_id", 0,
    161171            "search by p4 ID", NULL);
     172    psMetadataAddBool(diffimfileArgs, PS_LIST_TAIL, "-simple",  0,
     173            "use the simple output format", false);
    162174
    163175    psFree(now);
     
    240252}
    241253
     254#define addWhereS32(name) \
     255{ \
     256    psS32 s32 = 0; \
     257    bool status = false; \
     258    if ((s32= psMetadataLookupS32(&status, config->args, "-" #name))) { \
     259        if (!psMetadataAddS32(config->where, PS_LIST_TAIL, #name, 0, "==", s32)) { \
     260            psError(PS_ERR_UNKNOWN, false, "failed to add item " #name); \
     261            goto FAIL; \
     262        } \
     263    } \
     264}
     265
     266
    242267    // generate SQL where clause
    243268    config->where = psMetadataAlloc();
    244269
    245     addWhereStr(det_id);
    246     {
    247         int n = 0;
    248         bool status = false;
    249         if ((n = psMetadataLookupS32(&status, config->args, "-iteration"))) {
    250             if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "iteration", 0, "==", n)) {
    251                 psError(PS_ERR_UNKNOWN, false, "failed to add item iteration");
    252                 goto FAIL;
    253             }
    254         }
    255     }
    256     addWhereStr(det_type);
    257     addWhereStr(exp_tag);
    258     addWhereStr(class_id);
    259     // convert '-inst' to 'camera'
    260     {
    261         psString str = NULL;
    262         bool status = false;
    263         if ((str = psMetadataLookupStr(&status, config->args, "-inst"))) {
    264             if (!psMetadataAddStr(config->where, PS_LIST_TAIL, "camera", 0, "==", str)) {
    265                 psError(PS_ERR_UNKNOWN, false, "failed to add item camera");
    266                 goto FAIL;
    267             }
    268         }
    269     }
    270     addWhereStr(telescope);
    271     addWhereStr(exp_type);
    272     {
    273         int n = 0;
    274         bool status = false;
    275         if ((n = psMetadataLookupS32(&status, config->args, "-imfiles"))) {
    276             if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "imfiles", 0, "==", n)) {
    277                 psError(PS_ERR_UNKNOWN, false, "failed to add item imfiles");
    278                 goto FAIL;
    279             }
    280         }
    281     }
    282     addWhereStr(filter);
    283     addWhereStr(recipe);
    284     {
    285         int n = 0;
    286         bool status = false;
    287         if ((n = psMetadataLookupS32(&status, config->args, "-p1_version"))) {
    288             if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "p1_version", 0, "==", n)) {
    289                 psError(PS_ERR_UNKNOWN, false, "failed to add item p1_version");
    290                 goto FAIL;
    291             }
    292         }
    293     }
    294     {
    295         bool boolean = false;
    296         bool status = false;
    297 
    298         // map reject -> !accept
    299         if ((boolean = psMetadataLookupBool(&status, config->args, "-reject"))) {
    300             if (!psMetadataAddBool(config->where, PS_LIST_TAIL, "accept", 0, "==", !boolean)) {
    301                 psError(PS_ERR_UNKNOWN, false, "failed to add item reject");
    302                 goto FAIL;
    303             }
    304         }
    305     }
     270    addWhereS32(p4_id);
    306271
    307272    if (config->where->list->n < 1) {
Note: See TracChangeset for help on using the changeset viewer.