IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 21, 2006, 7:07:56 PM (20 years ago)
Author:
jhoblitt
Message:

add p2pendingToDoneImfile()
add p2searchPendingImfiles()

File:
1 edited

Legend:

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

    r6133 r6156  
    1818    }
    1919    /*
     20    if (config->exp_id != NULL) {
     21        psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==",
     22            config->exp_id);
     23    }
     24    if (config->class != NULL) {
     25        psMetadataAddStr(where, PS_LIST_TAIL, "class", 0, "==",
     26            config->class);
     27    }
     28    if (config->class_id != NULL) {
     29        psMetadataAddStr(where, PS_LIST_TAIL, "class_id", 0, "==",
     30            config->class_id);
     31    }
     32    */
     33    /*
    2034    if (!psTimeIsZero(config->start) && !psTimeIsZero(config->stop)) {
    2135        psMetadataAddTime(where, PS_LIST_TAIL, "TIME_START", 0, "<", config->stop);
     
    2640    psArray *exposures = p2PendingExpSelectRowObjects(config->database, where, MAX_ROWS);
    2741    psFree(where);
     42    if (!exposures) {
     43        psError(PS_ERR_UNKNOWN, false, "no p2PendingExp rows found");
     44        return NULL;
     45    }
     46
    2847
    2948    // output array of rawSet
     
    5271// which have the appropriate state.  that would limit the ability to filter
    5372// the selection.  test to see how well/poorly this performs
     73
     74psArray *p2searchPendingImfiles(p2Config *config)
     75{
     76    PS_ASSERT_PTR_NON_NULL(config, NULL);
     77
     78    psMetadata *where = psMetadataAlloc();
     79    if (config->camera_name != NULL) {
     80        if (!psMetadataAddStr(where, PS_LIST_TAIL, "camera", 0, "==",
     81            config->camera_name)) {
     82            psError(PS_ERR_UNKNOWN, false, "failed to add item camera");
     83            psFree(where);
     84            return NULL;
     85        }
     86    }
     87    if (config->filter != NULL) {
     88        psMetadataAddStr(where, PS_LIST_TAIL, "filter", 0, "==",
     89            config->filter);
     90    }
     91    if (config->exp_id != NULL) {
     92        psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==",
     93            config->exp_id);
     94    }
     95    if (config->class != NULL) {
     96        psMetadataAddStr(where, PS_LIST_TAIL, "class", 0, "==",
     97            config->class);
     98    }
     99    if (config->class_id != NULL) {
     100        psMetadataAddStr(where, PS_LIST_TAIL, "class_id", 0, "==",
     101            config->class_id);
     102    }
     103
     104    psArray *imfiles = p2PendingImfileSelectRowObjects(config->database, where,
     105        MAX_ROWS);
     106    psFree(where);
     107
     108    return imfiles;
     109}
Note: See TracChangeset for help on using the changeset viewer.