IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 26, 2006, 1:48:43 PM (20 years ago)
Author:
jhoblitt
Message:

factor out 'where' query from parameter generation

File:
1 edited

Legend:

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

    r6210 r6214  
    116116    EMPTY_TO_NULL_STRING(config->url);
    117117
     118    psMetadata *where = psMetadataAlloc();
     119
     120    if (config->camera_name != NULL) {
     121        if (!psMetadataAddStr(where, PS_LIST_TAIL, "camera", 0, "==",
     122            config->camera_name)) {
     123            psError(PS_ERR_UNKNOWN, false, "failed to add item camera");
     124            psFree(where);
     125            return NULL;
     126        }
     127    }
     128    if (config->filter != NULL) {
     129        psMetadataAddStr(where, PS_LIST_TAIL, "filter", 0, "==",
     130            config->filter);
     131    }
     132    if (config->exp_id != NULL) {
     133        psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==",
     134            config->exp_id);
     135    }
     136    if (config->class != NULL) {
     137        psMetadataAddStr(where, PS_LIST_TAIL, "class", 0, "==",
     138            config->class);
     139    }
     140    if (config->class_id != NULL) {
     141        psMetadataAddStr(where, PS_LIST_TAIL, "class_id", 0, "==",
     142             config->class_id);
     143    }
     144
     145    /*
     146    // psMetadataConfig does not support times yet
     147    if (!psTimeIsZero(config->start) && !psTimeIsZero(config->stop)) {
     148        psMetadataAddTime (where, PS_LIST_TAIL, "TIME_START", 0, "<", config->stop);
     149        psMetadataAddTime (where, PS_LIST_TAIL, "TIME_STOP", 0, ">", config->start);
     150    }
     151    */
     152
     153    if (where->list->n < 1) {
     154        psFree(where);
     155        where = NULL;
     156    }
     157
     158    config->where = where;
     159
     160
    118161    // add the input and output images to the arguments list
    119162    //psMetadataAddStr (config->arguments, PS_LIST_TAIL, "-output", 0, "Name of the output image", argv[1]);
Note: See TracChangeset for help on using the changeset viewer.