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_normalizedimfile.c

    r18643 r18991  
    7676
    7777    // required
    78     PXOPT_LOOKUP_STR(det_id, config->args, "-det_id", true, false);
     78    PXOPT_LOOKUP_S64(det_id, config->args, "-det_id", true, false);
    7979    PXOPT_LOOKUP_S32(iteration, config->args, "-iteration", false, false);
    8080    PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false);
     
    9696    PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", false, false);
    9797
    98     if (!detNormalizedImfileInsert(config->dbh,
    99         (psS64)atoll(det_id),
    100         iteration,
    101         class_id,
    102         uri,
    103         bg,
    104         bg_stdev,
    105         bg_mean_stdev,
    106         user_1,
    107         user_2,
    108         user_3,
    109         user_4,
    110         user_5,
    111         path_base,
    112         code
    113     )) {
     98    if (!detNormalizedImfileInsert(
     99            config->dbh,
     100            det_id,
     101            iteration,
     102            class_id,
     103            uri,
     104            bg,
     105            bg_stdev,
     106            bg_mean_stdev,
     107            user_1,
     108            user_2,
     109            user_3,
     110            user_4,
     111            user_5,
     112            path_base,
     113            "full",
     114            code
     115            )) {
    114116        psError(PS_ERR_UNKNOWN, false, "database error");
    115117        return false;
     
    124126
    125127    psMetadata *where = psMetadataAlloc();
    126     PXOPT_COPY_STR(config->args, where, "-det_id",    "det_id", "==");
     128    PXOPT_COPY_S64(config->args, where, "-det_id",    "det_id", "==");
    127129    PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "==");
    128130    PXOPT_COPY_STR(config->args, where, "-class_id",  "class_id", "==");
     
    196198
    197199    psMetadata *where = psMetadataAlloc();
    198     PXOPT_COPY_STR(config->args, where, "-det_id",    "det_id", "==");
     200    PXOPT_COPY_S64(config->args, where, "-det_id",    "det_id", "==");
    199201    PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "==");
    200202    PXOPT_COPY_STR(config->args, where, "-class_id",  "class_id", "==");
     
    229231}
    230232
     233bool updatenormalizedimfileMode(pxConfig *config)
     234{
     235    PS_ASSERT_PTR_NON_NULL(config, NULL);
     236
     237    PXOPT_LOOKUP_S64(det_id, config->args, "-det_id", true, false);
     238    PXOPT_LOOKUP_S32(iteration, config->args, "-iteration", true, false);
     239    PXOPT_LOOKUP_STR(class_id, config->args, "-class_id",  true, false);
     240    PXOPT_LOOKUP_STR(data_state, config->args, "-data_state", true, false);
     241
     242    if (!setNormImfileDataState(config, det_id, iteration, class_id, data_state)) {
     243        return false;
     244    }
     245    return true;
     246}
     247
    231248bool pendingcleanup_normalizedimfileMode(pxConfig *config)
    232249{
    233250    PS_ASSERT_PTR_NON_NULL(config, NULL);
    234251
    235     PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", false, false);
    236252    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    237253    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    238254
    239255    psMetadata *where = psMetadataAlloc();
    240     if (chip_id) {
    241         PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "==");
    242     }
    243     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     256    PXOPT_COPY_S64(config->args, where, "-det_id", "detNormalizedImfile.det_id", "==");
     257    PXOPT_COPY_S32(config->args, where, "-iteration", "detNormalizedImfile.iteration", "==");
     258    PXOPT_COPY_STR(config->args, where, "-class_id", "detNormalizedImfile.det_id", "==");
    244259
    245260    psString query = pxDataGet("dettool_pendingcleanup_normalizedimfile.sql");
     
    282297
    283298    // negative simple so the default is true
    284     if (!ippdbPrintMetadatas(stdout, output, "detPendingCleanup_normalizedimfile", !simple)) {
     299    if (!ippdbPrintMetadatas(stdout, output, "detCleanupNormImfile", !simple)) {
    285300        psError(PS_ERR_UNKNOWN, false, "failed to print array");
    286301        psFree(output);
Note: See TracChangeset for help on using the changeset viewer.