IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 19, 2006, 4:16:26 PM (21 years ago)
Author:
jhoblitt
Message:

compilation fixes
switch to using the metadatadb API

File:
1 edited

Legend:

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

    r6032 r6060  
    11# include "p2search.h"
    22
     3bool psTimeIsZero(psTime *time) {
     4    if (time->sec == 0 || time->nsec == 0) {
     5        return false;
     6    }
     7
     8    return true;
     9}
     10
    311// select pending frames (exposure+images) which are done/not done
    4 psArray *p2searchPendingFrames (p2SearchConfig *config) {
     12psArray *p2searchPendingFrames (p2Config *config) {
    513
    614    // build 'where' structure
     
    917    // in order to include these restrictions, we need to define these table columns
    1018    if (config->camera != NULL) {
    11         psMetadataAddStr (where, PS_LIST_TAIL, "CAMERA", 0, "==", config->camera);
     19        psMetadataAddStr (where, PS_LIST_TAIL, "CAMERA", 0, "==", config->camera_name);
    1220    }
    1321    if (config->filter != NULL) {
    14         psMetadataAddStr (where, PS_LIST_TAIL, "FILTER", 0, "==", config->filter);
     22    psMetadataAddStr (where, PS_LIST_TAIL, "FILTER", 0, "==", config->filter);
    1523    }
    1624    if (!psTimeIsZero(config->start) && !psTimeIsZero(config->stop)) {
    17         psMetadataAddTime (where, PS_LIST_TAIL, "TIME_START", 0, "<", config->time_stop);
    18         psMetadataAddTime (where, PS_LIST_TAIL, "TIME_STOP", 0, ">", config->time_start);
     25    psMetadataAddTime (where, PS_LIST_TAIL, "TIME_START", 0, "<", config->stop);
     26    psMetadataAddTime (where, PS_LIST_TAIL, "TIME_STOP", 0, ">", config->start);
    1927    }
    2028
    21     psArray *exposures = p2PendingExposureSelectRows (config->database, where, MAX_ROWS);
     29    psArray *exposures = p2PendingExpSelectRowObjects (config->database, where, MAX_ROWS);
    2230    psFree (where);
    2331
     
    2634
    2735    // 'where' to select each exposure
    28     psMetadata *where = psMetadataAlloc ();
     36    where = psMetadataAlloc ();
    2937    for (int i = 0; i < exposures->n; i++) {
    30         p2PendingExposure *exposure = exposures->data[i];
     38        p2PendingExpRow *exposure = exposures->data[i];
    3139       
    32         psMetadataAddStr (where, PS_LIST_TAIL, "EXP_ID", PS_META_REPLACE, "==", exposure->expID);
    33         psMetadataAddStr (where, PS_LIST_TAIL, "P2_VERSION", PS_META_REPLACE, "==", exposure->P2version);
     40        psMetadataAddStr (where, PS_LIST_TAIL, "EXP_ID", PS_META_REPLACE, "==", exposure->exp_id);
     41        psMetadataAddS32 (where, PS_LIST_TAIL, "P2_VERSION", PS_META_REPLACE, "==", exposure->p2_version);
    3442
    35         psArray *images = ppPendingImageSelectRows (config->database, where, MAX_ROWS);
     43        psArray *images = p2PendingImfileSelectRowObjects (config->database, where, MAX_ROWS);
    3644
    37         ppPendingFrame *frame = ppPendingFrameAlloc (exposure, images);
     45        p2PendingFrame *frame = p2PendingFrameAlloc (exposure, images);
    3846
    3947        psArrayAdd (frames, 100, frame);
Note: See TracChangeset for help on using the changeset viewer.