IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6156


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

add p2pendingToDoneImfile()
add p2searchPendingImfiles()

Location:
trunk/ippTools/src
Files:
3 edited

Legend:

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

    r6152 r6156  
    6161
    6262// XXX the filename layout is defined by this code
     63psArray *p2pendingToDoneImfile(psArray *pendingImfiles)
     64{
     65    PS_ASSERT_PTR_NON_NULL(pendingImfiles, NULL);
     66
     67    psArray *doneImfiles = psArrayAlloc(pendingImfiles->n);
     68    doneImfiles->n = 0;
     69
     70    for (int i = 0; i < pendingImfiles->n; i++) {
     71        p2PendingImfileRow *pendingImfile = pendingImfiles->data[i];
     72
     73        p2DoneImfileRow *doneImfile = p2DoneImfileRowAlloc(
     74            pendingImfile->exp_id,
     75            pendingImfile->exptype,
     76            pendingImfile->class,
     77            pendingImfile->class_id,
     78            pendingImfile->p1_version,
     79            pendingImfile->p2_version,
     80            "", // recipe
     81            "", // stats
     82            pendingImfile->url
     83        );
     84
     85        psArrayAdd(doneImfiles, 100, doneImfile);
     86    }
     87
     88    return doneImfiles;
     89}
  • 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}
  • trunk/ippTools/src/pxtools.h

    r6150 r6156  
    9191bool p2writePendingFrames (p2Config *config, psArray *frames);
    9292psArray *p2searchDoneFrames(p2Config *config);
     93psArray *p2searchPendingImfiles(p2Config *config);
     94psArray *p2pendingToDoneImfile(psArray *pendingImfiles);
Note: See TracChangeset for help on using the changeset viewer.