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/p2searchRawFrames.c

    r6210 r6214  
    55    PS_ASSERT_PTR_NON_NULL(config, NULL);
    66
    7     psMetadata *where = psMetadataAlloc();
    8    
    9     if (config->camera_name != NULL) {
    10         psMetadataAddStr(where, PS_LIST_TAIL, "camera", 0, "==",
    11             config->camera_name);
    12     }
    13     if (config->filter != NULL) {
    14         psMetadataAddStr(where, PS_LIST_TAIL, "filter", 0, "==",
    15             config->filter);
    16     }
    17     // psMetadataConfig does not support times yet
    18     /*
    19     if (!psTimeIsZero(config->start) && !psTimeIsZero(config->stop)) {
    20         psMetadataAddTime (where, PS_LIST_TAIL, "TIME_START", 0, "<", config->stop);
    21         psMetadataAddTime (where, PS_LIST_TAIL, "TIME_STOP", 0, ">", config->start);
    22     }
    23     */
    24 
    25     // if no search criteria were added then set where to NULL to search for
    26     // everything
    27     // XXX fix handling of where
    28     if (where->list->n < 1) {
    29         psFree(where);
    30         where = NULL;
    31     }
    32 
    33     psArray *exposures = rawScienceExpSelectRowObjects(config->database, where,
    34         MAX_ROWS);
    35     psFree(where);
     7    psArray *exposures = rawScienceExpSelectRowObjects(config->database,
     8        config->where, MAX_ROWS);
    369    if (!exposures) {
    3710        psError(PS_ERR_UNKNOWN, false, "no rawScienceExp rows found");
     
    4518
    4619    // 'where' to select each exposure
    47     where = psMetadataAlloc ();
     20    psMetadata *where = psMetadataAlloc ();
    4821    for (int i = 0; i < exposures->n; i++) {
    4922        rawScienceExpRow *exposure = exposures->data[i];
Note: See TracChangeset for help on using the changeset viewer.