IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 28, 2008, 2:46:04 PM (18 years ago)
Author:
jhoblitt
Message:

strip out use of config->where

File:
1 edited

Legend:

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

    r17186 r17188  
    244244    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-filter",  0,
    245245            "search by filter of interest", NULL);
    246     psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-uri",  0,
    247             "search by URL", NULL);
    248246    psMetadataAddU64(pendingimfileArgs, PS_LIST_TAIL, "-limit",  0,
    249247            "limit result set to N items", 0);
     
    327325    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-filter",  0,
    328326            "define filter of interest", NULL);
    329     psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-uri",  0,
    330             "define URL", NULL);
    331327    psMetadataAddU64(processedimfileArgs, PS_LIST_TAIL, "-limit",  0,
    332328            "limit result set to N items", 0);
     
    492488    psFree(modes);
    493489
    494     // setup search criterion
    495 #define addWhereStr(name) \
    496 { \
    497     psString str = NULL; \
    498     bool status = false; \
    499     if ((str = psMetadataLookupStr(&status, config->args, "-" #name))) { \
    500         if (!psMetadataAddStr(config->where, PS_LIST_TAIL, #name, 0, "==", str)) {\
    501             psError(PS_ERR_UNKNOWN, false, "failed to add item " #name); \
    502             psFree(config); \
    503             return NULL; \
    504         } \
    505     } \
    506 }
    507 
    508     // generate SQL where clause
    509     config->where = psMetadataAlloc();
    510 
    511 {
    512     psString str = NULL;
    513     bool status = false;
    514     if ((str = psMetadataLookupStr(&status, config->args, "-chip_id"))) {
    515         if (!psMetadataAddS64(config->where, PS_LIST_TAIL, "chip_id", 0, "==", (psS64)atoll(str))) {
    516             psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id");
    517             psFree(config);
    518             return NULL;
    519         }
    520     }
    521 }
    522 
    523     addWhereStr(exp_id);
    524     // convert '-inst' to 'camera'
    525     {
    526         psString str = NULL;
    527         bool status = false;
    528         if ((str = psMetadataLookupStr(&status, config->args, "-inst"))) {
    529             if (!psMetadataAddStr(config->where, PS_LIST_TAIL, "camera", 0, "==", str)) {
    530                 psError(PS_ERR_UNKNOWN, false, "failed to add item camera");
    531                 psFree(config);
    532                 return NULL;
    533             }
    534         }
    535     }
    536 
    537 
    538     addWhereStr(filter);
    539     addWhereStr(class_id);
    540 
    541     // convert '-code' to 'fault'
    542     {
    543         psS16 fault = 0;
    544         bool status = false;
    545         if ((fault = psMetadataLookupS16(&status, config->args, "-code"))) {
    546             if (!psMetadataAddS16(config->where, PS_LIST_TAIL, "fault", 0, "==", fault)) {
    547                 psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    548                 psFree(config);
    549                 return NULL;
    550             }
    551         }
    552     }
    553 
    554     /*
    555     // psMetadataConfig does not support times yet
    556     if (!psTimeIsZero(config->start) && !psTimeIsZero(config->stop)) {
    557         psMetadataAddTime (where, PS_LIST_TAIL, "TIME_START", 0, "<", config->stop);
    558         psMetadataAddTime (where, PS_LIST_TAIL, "TIME_STOP", 0, ">", config->start);
    559     }
    560     */
    561 
    562     if (config->where->list->n < 1) {
    563         psFree(config->where);
    564         config->where = NULL;
    565     }
    566 
    567490    // define Database handle, if used
    568491    config->dbh = pmConfigDB(config->modules);
Note: See TracChangeset for help on using the changeset viewer.