IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 15, 2008, 10:30:59 AM (18 years ago)
Author:
eugene
Message:

completely deprecate config->where; make all command-line handling consistent; move nearly all sql into share/*.sql; ensure consistency between args supplied and used

File:
1 edited

Legend:

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

    r14023 r18561  
    6161    PS_ASSERT_PTR_NON_NULL(config, false);
    6262
     63    psMetadata *where = psMetadataAlloc();
     64    PXOPT_COPY_STR(config->args, where, "-exp_id",        "exp_id", "==");
     65    PXOPT_COPY_STR(config->args, where, "-inst",          "camera", "==");
     66    PXOPT_COPY_STR(config->args, where, "-telescope",     "telescope", "==");
     67    PXOPT_COPY_STR(config->args, where, "-exp_type",      "exp_type", "==");
     68    PXOPT_COPY_S32(config->args, where, "-imfiles",       "imfiles", "==");
     69    PXOPT_COPY_STR(config->args, where, "-filter",        "filter", "==");
     70    PXOPT_COPY_STR(config->args, where, "-recip",         "recipe", "==");
     71    PXOPT_COPY_S32(config->args, where, "-guide_version", "guide_version", "==");
     72    if (!psListLength(where->list)) {
     73        psFree (where);
     74        where = NULL;
     75    }
     76
    6377    // return all guidePendingExp rows unless there CLI search options
    64     psArray *guidePendingExp = guidePendingExpSelectRowObjects(
    65         config->dbh,
    66         config->where ? config->where : NULL,
    67         0
    68     );
     78    psArray *guidePendingExp = guidePendingExpSelectRowObjects(config->dbh, where, 0);
     79    psFree (where);
     80
    6981    if (!guidePendingExp) {
    7082        psError(PS_ERR_UNKNOWN, false, "no guidePendingExp found");
    7183        return false;
    7284    }
    73 
    7485    psMetadata *output = psMetadataAlloc();
    7586
     
    94105    PS_ASSERT_PTR_NON_NULL(config, false);
    95106   
     107    psMetadata *where = psMetadataAlloc();
     108    PXOPT_COPY_STR(config->args, where, "-exp_id",        "exp_id", "==");
     109    PXOPT_COPY_STR(config->args, where, "-inst",          "camera", "==");
     110    PXOPT_COPY_STR(config->args, where, "-telescope",     "telescope", "==");
     111    PXOPT_COPY_STR(config->args, where, "-exp_type",      "exp_type", "==");
     112    PXOPT_COPY_S32(config->args, where, "-imfiles",       "imfiles", "==");
     113    PXOPT_COPY_STR(config->args, where, "-filter",        "filter", "==");
     114    if (!psListLength(where->list)) {
     115        psFree (where);
     116        where = NULL;
     117    }
     118
    96119    // return all rawScienceExp rows unless there CLI search options
    97     psArray *rawScienceExps = rawScienceExpSelectRowObjects(
    98         config->dbh,
    99         config->where ? config->where : NULL,
    100         0
    101     );
    102 
     120    psArray *rawScienceExps = rawScienceExpSelectRowObjects(config->dbh, where, 0);
     121    psFree (where);
     122   
    103123    if (!rawScienceExps) {
    104124        psError(PS_ERR_UNKNOWN, false, "no rawScienceExp rows found");
Note: See TracChangeset for help on using the changeset viewer.