IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18551


Ignore:
Timestamp:
Jul 15, 2008, 10:18:41 AM (18 years ago)
Author:
bills
Message:

adapt uri to the presence of the Fake stage in the pipeline.
This functionality will be moved to the ippTools soon

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/src/pstampparse.c

    r18379 r18551  
    304304                        (_id), NULL, false, NULL))
    305305
    306 #define warpIDForCam(_opt, _id) \
    307         lastID(runQuery((_opt), "SELECT %s from warpInputExp  WHERE cam_id = %s", "warp_id", \
     306#define fakeIDForCam(_opt, _id) \
     307        lastID(runQuery((_opt), "SELECT %s from fakeRun  WHERE cam_id = %s", "fake_id", \
    308308                            (_id), NULL, false, NULL))
    309309
     310#define warpIDForFake(_opt, _id) \
     311        lastID(runQuery((_opt), "SELECT %s from warpRun  WHERE fake_id = %s", "warp_id", \
     312                            (_id), NULL, false, NULL))
     313
    310314
    311315
     
    317321        return NULL;
    318322
    319     psArray *chip_files = runQuery(options,
    320                         "SELECT %s from chipProcessedImfile WHERE chip_id = %s AND class_id = '%s'",
     323    psString query = NULL;
     324    psStringAppend(&query, "SELECT %s from chipProcessedImfile WHERE chip_id = %s", "%s", "%s");
     325    if (class_id && (strcmp(class_id, "null") != 0)) {
     326        psStringAppend(&query, " AND class_id = '%s'", "%s");
     327    }
     328
     329    psArray *chip_files = runQuery(options, query,
    321330                        "uri", chip_id, class_id, true, NULL);
     331    psFree(query);
    322332    psFree(chip_id);
    323333
     
    336346        return NULL;
    337347
    338     psString warp_id = warpIDForCam(options, cam_id);
     348    psString fake_id = fakeIDForCam(options, cam_id);
     349    if (fake_id == NULL)
     350        return NULL;
     351
     352    psString warp_id = warpIDForFake(options, fake_id);
     353    if (warp_id == NULL)
     354        return NULL;
    339355
    340356    psArray *warp_files = runQuery(options,
     
    344360
    345361    psFree(warp_id);
     362    psFree(fake_id);
    346363    psFree(cam_id);
    347364    psFree(chip_id);
     
    361378        return NULL;
    362379
    363     psString warp_id = warpIDForCam(options, cam_id);
     380    psString fake_id = fakeIDForCam(options, cam_id);
     381    if (fake_id == NULL)
     382        return NULL;
     383
     384    psString warp_id = warpIDForFake(options, fake_id);
    364385    if (warp_id == NULL)
    365386        return NULL;
     
    369390
    370391    psFree(warp_id);
     392    psFree(fake_id);
    371393    psFree(cam_id);
    372394    psFree(chip_id);
     
    402424        return NULL;
    403425
    404     psString warp_id = warpIDForCam(options, cam_id);
     426    psString fake_id = fakeIDForCam(options, cam_id);
     427    if (fake_id == NULL)
     428        return NULL;
     429
     430    psString warp_id = warpIDForFake(options, fake_id);
     431    if (warp_id == NULL)
     432        return NULL;
    405433
    406434    psArray *diffIDs = runQuery(options,
     
    409437
    410438    psFree(warp_id);
     439    psFree(fake_id);
    411440    psFree(cam_id);
    412441    psFree(chip_id);
     
    632661        // or are there simply no images matching the request
    633662        fprintf(stderr, "No matching images found.\n");
    634         // don't return an error
    635         return true;
     663        return false;
    636664    }
    637665
Note: See TracChangeset for help on using the changeset viewer.