IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 15, 2009, 9:33:58 AM (17 years ago)
Author:
bills
Message:

add -clean argument to the exportrun modes. If set switch
state and data state from 'full' to 'cleaned'.
If no rows are found in -exportrun return error status for
the command

File:
1 edited

Legend:

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

    r23830 r23873  
    109109    psMetadata *where = psMetadataAlloc();
    110110    pxcamGetSearchArgs (config, where);
    111     PXOPT_COPY_STR(config->args, where, "-label",     "chipRun.label",     "==");
    112     PXOPT_COPY_STR(config->args, where, "-reduction", "chipRun.reduction", "==");
     111    PXOPT_COPY_STR(config->args, where, "-label",     "camRun.label",     "==");
     112    PXOPT_COPY_STR(config->args, where, "-reduction", "camRun.reduction", "==");
    113113
    114114    if (!psListLength(where->list) &&
     
    196196    }
    197197
    198     // loop over our list of chipRun rows
     198    // loop over our list of camRun rows
    199199    for (long i = 0; i < psArrayLength(output); i++) {
    200200        psMetadata *md = output->data[i];
    201201
    202         chipRunRow *row = chipRunObjectFromMetadata(md);
     202        camRunRow *row = camRunObjectFromMetadata(md);
    203203        if (!row) {
    204             psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into chipRun");
     204            psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into camRun");
    205205            psFree(output);
    206206            return false;
     
    268268
    269269    if (state) {
    270         // set chipRun.state to state
     270        // set camRun.state to state
    271271        if (!pxcamRunSetStateByQuery(config, where, state)) {
    272272            psFree(where);
     
    276276
    277277    if (label) {
    278         // set chipRun.label to label
     278        // set camRun.label to label
    279279        if (!pxcamRunSetLabelByQuery(config, where, label)) {
    280280            psFree(where);
     
    362362    PXOPT_COPY_STR(config->args, where, "-label",     "camRun.label",                 "==");
    363363    PXOPT_COPY_STR(config->args, where, "-reduction", "camRun.reduction",             "==");
    364     PXOPT_COPY_S64(config->args, where, "-chip_id",   "chipRun.chip_id",              "==");
    365     PXOPT_COPY_STR(config->args, where, "-class_id",  "chipProcessedImfile.class_id", "==");
     364    PXOPT_COPY_S64(config->args, where, "-chip_id",   "camRun.chip_id",              "==");
     365    PXOPT_COPY_STR(config->args, where, "-class_id",  "camProcessedExp.class_id", "==");
    366366
    367367    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     
    400400
    401401    // negate simple so the default is true
    402     if (!ippdbPrintMetadatas(stdout, output, "chipProcessedImfile", !simple)) {
     402    if (!ippdbPrintMetadatas(stdout, output, "camProcessedExp", !simple)) {
    403403        psError(PS_ERR_UNKNOWN, false, "failed to print array");
    404404        psFree(output);
     
    11451145  PXOPT_LOOKUP_STR(outfile, config->args, "-outfile", true,  false);
    11461146  PXOPT_LOOKUP_U64(limit,   config->args, "-limit",   false, false);
     1147  PXOPT_LOOKUP_BOOL(clean, config->args, "-clean", false);
    11471148
    11481149  FILE *f = fopen (outfile, "w");
     
    11931194    }
    11941195    if (!psArrayLength(output)) {
    1195       psTrace("regtool", PS_LOG_INFO, "no rows found");
     1196      psError(PS_ERR_UNKNOWN, true, "no rows found");
    11961197      psFree(output);
    1197       return true;
     1198      return false;
     1199    }
     1200
     1201    if (clean) {
     1202        if (!strcmp(tables[i].tableName, "camRun")) {
     1203            if (!pxSetStateCleaned("camRun", "state", output)) {
     1204                psFree(output);
     1205                psError(PS_ERR_UNKNOWN, false, "pxSetStateClean failed for table %s",  tables[i].tableName);
     1206                return false;
     1207            }
     1208        }
    11981209    }
    11991210
Note: See TracChangeset for help on using the changeset viewer.