IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 8, 2008, 5:08:29 PM (18 years ago)
Author:
eugene
Message:

adding cleanup operations to dettool

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20080719/ippTools/src/dettool_residexp.c

    r18643 r18991  
    8888    // limit search by det_id, iteration, exp_id
    8989    psMetadata *where = psMetadataAlloc();
    90     PXOPT_COPY_STR(config->args, where, "-det_id", "det_id", "==");
     90    PXOPT_COPY_S64(config->args, where, "-det_id", "det_id", "==");
    9191    PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "==");
    92     PXOPT_COPY_STR(config->args, where, "-exp_id", "exp_id", "==");
    93 
    94     PXOPT_LOOKUP_STR(det_id, config->args, "-det_id", true, false); // required
     92    PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "==");
     93
     94    PXOPT_LOOKUP_S64(det_id, config->args, "-det_id", true, false); // required
    9595    PXOPT_LOOKUP_S32(iteration, config->args, "-iteration", false, false);
    96     PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", true, false); // required
     96    PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", true, false); // required
    9797    PXOPT_LOOKUP_S16(code, config->args, "-code", false, false);
    9898    PXOPT_LOOKUP_STR(recipe, config->args, "-recip", (code == 0), false); // Required if code == 0
     
    150150    psFree(output);
    151151
    152     if (!detResidExpInsert(config->dbh,
    153             (psS64)atoll(det_id),
     152    if (!detResidExpInsert(
     153            config->dbh,
     154            det_id,
    154155            iteration,
    155             (psS64)atoll(exp_id),
     156            exp_id,
    156157            recipe,
    157158            bg,
     
    173174            user_5,
    174175            path_base,
     176            "full",
    175177            !reject,
    176178            code
     
    188190
    189191    psMetadata *where = psMetadataAlloc();
    190     PXOPT_COPY_STR(config->args, where, "-det_id",    "det_id", "==");
     192    PXOPT_COPY_S64(config->args, where, "-det_id",    "det_id", "==");
    191193    PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "==");
    192     PXOPT_COPY_STR(config->args, where, "-exp_id",    "exp_id", "==");
     194    PXOPT_COPY_S64(config->args, where, "-exp_id",    "exp_id", "==");
    193195    PXOPT_COPY_STR(config->args, where, "-recip",     "recipe", "==");
    194196
     
    268270
    269271    psMetadata *where = psMetadataAlloc();
    270     PXOPT_COPY_STR(config->args, where, "-det_id",    "det_id", "==");
     272    PXOPT_COPY_S64(config->args, where, "-det_id",    "det_id", "==");
    271273    PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "==");
    272     PXOPT_COPY_STR(config->args, where, "-exp_id",    "exp_id", "==");
     274    PXOPT_COPY_S64(config->args, where, "-exp_id",    "exp_id", "==");
    273275    PXOPT_COPY_S16(config->args, where, "-code",      "fault", "==");
    274276
     
    310312    // build a query to search by det_id, iteration, exp_id
    311313    psMetadata *where = psMetadataAlloc();
    312     PXOPT_COPY_STR(config->args, where, "-det_id", "det_id", "==");
     314    PXOPT_COPY_S64(config->args, where, "-det_id", "det_id", "==");
    313315    PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "==");
    314     PXOPT_COPY_STR(config->args, where, "-exp_id", "exp_id", "==");
     316    PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "==");
    315317
    316318    // find the values we're going to set
     
    323325    PXOPT_COPY_F64(config->args, set, "-bg_mean_stdev", "bg_mean_stdev", "==");
    324326    PXOPT_COPY_STR(config->args, set, "-path_base", "path_base", "==");
     327    PXOPT_COPY_STR(config->args, set, "-data_state", "data_state", "==");
     328
     329    // double-check the allowed data_state values
     330    PXOPT_LOOKUP_STR(data_state, config->args, "-data_state", false, false);
     331    if (data_state) {
     332        if (!isValidDataState (data_state)) return false;
     333    }
    325334
    326335    // this can't be PXOPT_ macro-ized as reject is !'d
     
    348357    PS_ASSERT_PTR_NON_NULL(config, NULL);
    349358
    350     PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", false, false);
    351359    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    352360    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    353361
    354362    psMetadata *where = psMetadataAlloc();
    355     if (chip_id) {
    356         PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "==");
    357     }
    358     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     363    PXOPT_COPY_S64(config->args, where, "-det_id", "detProcessedImfile.det_id", "==");
    359364
    360365    psString query = pxDataGet("dettool_pendingcleanup_residexp.sql");
     
    397402
    398403    // negative simple so the default is true
    399     if (!ippdbPrintMetadatas(stdout, output, "detPendingCleanup_residexp", !simple)) {
     404    if (!ippdbPrintMetadatas(stdout, output, "detCleanupResidExp", !simple)) {
    400405        psError(PS_ERR_UNKNOWN, false, "failed to print array");
    401406        psFree(output);
Note: See TracChangeset for help on using the changeset viewer.