IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 23, 2013, 4:56:22 PM (14 years ago)
Author:
bills
Message:

more progress on releasetool

File:
1 edited

Legend:

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

    r34933 r35041  
    441441    PS_ASSERT_PTR_NON_NULL(config, NULL);
    442442
     443    psMetadata *where = psMetadataAlloc();
     444
     445    PXOPT_COPY_STR(config->args, where, "-releaseName", "ippRelease.releaseName", "LIKE");
     446    PXOPT_COPY_STR(config->args, where, "-state",       "ippRelease.state", "==");
     447    PXOPT_COPY_STR(config->args, where, "-filter",      "rawExp.filter", "LIKE");
     448    PXOPT_COPY_TIME(config->args, where, "-dateobs_begin","rawExp.dateobs", ">=");
     449    PXOPT_COPY_TIME(config->args, where, "-dateobs_end", "rawExp.dateobs", "<=");
     450    PXOPT_COPY_F32(config->args, where, "-fwhm_min",    "camProcessedExp.fwhm_major", ">=");
     451    PXOPT_COPY_F32(config->args, where, "-fwhm_max",    "camProcessedExp.fwhm_major", "<=");
     452    PXOPT_COPY_STR(config->args, where, "-exp_name",    "rawExp.exp_name", "==");
     453    PXOPT_COPY_S64(config->args, where, "-exp_id",      "relExp.exp_id", "==");
     454    PXOPT_COPY_S64(config->args, where, "-chip_id",     "relExp.chip_id", "==");
     455    PXOPT_COPY_S64(config->args, where, "-cam_id",      "relExp.cam_id", "==");
     456    PXOPT_COPY_S64(config->args, where, "-warp_id",     "warpRun.warp_id", "==");
     457    PXOPT_COPY_STR(config->args, where, "-chip_data_group", "chipRun.data_group", "LIKE");
     458    PXOPT_COPY_STR(config->args, where, "-cam_data_group",  "camRun.data_group", "LIKE");
     459    PXOPT_COPY_STR(config->args, where, "-warp_data_group", "warpRun.data_group", "LIKE");
     460
     461    PXOPT_COPY_STR(config->args, where, "-surveyName",  "survey.surveyName", "LIKE");
     462    PXOPT_COPY_S32(config->args, where, "-rel_id",      "relExp.rel_id", "==");
     463
    443464    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    444465    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    445     psMetadata *where = psMetadataAlloc();
    446 
    447 //    PXOPT_COPY_STR(config->args, where, "-surveyName",  "surveyName", "LIKE");
    448     PXOPT_COPY_STR(config->args, where, "-releaseName", "releaseName", "LIKE");
    449 //    PXOPT_COPY_STR(config->args, where, "-state", "state", "==");
    450 //    PXOPT_COPY_S32(config->args, where, "-rel_id",  "rel_id", "==");
    451 //    PXOPT_COPY_S64(config->args, where, "-exp_id",  "exp_id", "==");
    452466
    453467    psString query = pxDataGet("releasetool_listrelexp.sql");
     
    465479    if (psListLength(where->list)) {
    466480        psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
    467         psStringAppend(&query, " WHERE %s", whereClause);
     481        psStringAppend(&query, "\nWHERE %s", whereClause);
    468482        psFree(whereClause);
     483    } else if (where2) {
     484        psStringAppend(&query, "\nWHERE ");
    469485    } else {
    470486        psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required\n");
Note: See TracChangeset for help on using the changeset viewer.