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

    r18643 r18991  
    7676
    7777   
    78     PXOPT_LOOKUP_STR(det_id, config->args, "-det_id", true, false); // required
     78    PXOPT_LOOKUP_S64(det_id, config->args, "-det_id", true, false); // required
    7979    PXOPT_LOOKUP_S32(iteration, config->args, "-iteration", false, false);
    80     PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", true, false); // required
     80    PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", true, false); // required
    8181    PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false); // required
    8282    PXOPT_LOOKUP_S16(code, config->args, "-code", false, false);
     
    102102    PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", false, false);
    103103
    104     if (!detResidImfileInsert(config->dbh,
    105             (psS64)atoll(det_id),
     104    if (!detResidImfileInsert(
     105            config->dbh,
     106            det_id,
    106107            iteration,
    107             (psS64)atoll(exp_id),
     108            exp_id,
    108109            class_id,
    109110            uri,
     
    127128            user_5,
    128129            path_base,
     130            "full",
    129131            code
    130132    )) {
     
    142144
    143145    psMetadata *where = psMetadataAlloc();
    144     PXOPT_COPY_STR(config->args, where, "-det_id",     "det_id", "==");
     146    PXOPT_COPY_S64(config->args, where, "-det_id",     "det_id", "==");
    145147    PXOPT_COPY_S32(config->args, where, "-iteration",  "iteration", "==");
    146     PXOPT_COPY_STR(config->args, where, "-exp_id",     "exp_id", "==");
     148    PXOPT_COPY_S64(config->args, where, "-exp_id",     "exp_id", "==");
    147149    PXOPT_COPY_STR(config->args, where, "-class_id",   "class_id", "==");
    148150    PXOPT_COPY_STR(config->args, where, "-recip",      "recipe", "==");
     
    225227
    226228    psMetadata *where = psMetadataAlloc();
    227     PXOPT_COPY_STR(config->args, where, "-det_id",    "det_id", "==");
     229    PXOPT_COPY_S64(config->args, where, "-det_id",    "det_id", "==");
    228230    PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "==");
    229     PXOPT_COPY_STR(config->args, where, "-exp_id",  "exp_id", "==");
     231    PXOPT_COPY_S64(config->args, where, "-exp_id",  "exp_id", "==");
    230232    PXOPT_COPY_STR(config->args, where, "-class_id",  "class_id", "==");
    231233    PXOPT_COPY_S16(config->args, where, "-code",      "fault", "==");
     
    259261}
    260262
     263bool updateresidimfileMode(pxConfig *config)
     264{
     265    PS_ASSERT_PTR_NON_NULL(config, NULL);
     266
     267    PXOPT_LOOKUP_S64(det_id, config->args, "-det_id", true, false);
     268    PXOPT_LOOKUP_S32(iteration, config->args, "-iteration", true, false);
     269    PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", true, false);
     270    PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false);
     271    PXOPT_LOOKUP_STR(data_state, config->args, "-data_state", true, false);
     272    if (!setResidImfileDataState(config, det_id, iteration, exp_id, class_id, data_state)) {
     273        return false;
     274    }
     275    return true;
     276}
     277
    261278bool pendingcleanup_residimfileMode(pxConfig *config)
    262279{
    263280    PS_ASSERT_PTR_NON_NULL(config, NULL);
    264281
    265     PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", false, false);
    266282    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    267283    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    268284
    269285    psMetadata *where = psMetadataAlloc();
    270     if (chip_id) {
    271         PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "==");
    272     }
    273     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     286    PXOPT_COPY_S64(config->args, where, "-det_id", "detProcessedImfile.det_id", "==");
    274287
    275288    psString query = pxDataGet("dettool_pendingcleanup_residimfile.sql");
     
    312325
    313326    // negative simple so the default is true
    314     if (!ippdbPrintMetadatas(stdout, output, "detPendingCleanup_residimfile", !simple)) {
     327    if (!ippdbPrintMetadatas(stdout, output, "detCleanupResidImfile", !simple)) {
    315328        psError(PS_ERR_UNKNOWN, false, "failed to print array");
    316329        psFree(output);
Note: See TracChangeset for help on using the changeset viewer.