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

    r18643 r18991  
    7373    PS_ASSERT_PTR_NON_NULL(config, false);
    7474   
    75     PXOPT_LOOKUP_STR(det_id, config->args, "-det_id", true, false); // required
     75    PXOPT_LOOKUP_S64(det_id, config->args, "-det_id", true, false); // required
    7676    PXOPT_LOOKUP_S32(iteration, config->args, "-iteration", false, false);
    7777    PXOPT_LOOKUP_S16(code, config->args, "-code", false, false);
     
    9494
    9595    // XXX in some other places, we put the arguments in the .sql and supply them to RunQuery
    96     psStringAppend(&query, " WHERE det_id = %s AND iteration = %d", det_id, iteration);
     96    psStringAppend(&query, " WHERE det_id = %" PRId64 " AND iteration = %d", det_id, iteration);
    9797
    9898    if (!p_psDBRunQuery(config->dbh, query)) {
     
    116116
    117117    // insert the new row into the detProcessedImfile table
    118     if (!detNormalizedExpInsert(config->dbh,
    119         (psS64)atoll(det_id),
    120         iteration,
    121         recipe,
    122         bg,
    123         bg_stdev,
    124         bg_mean_stdev,
    125         user_1,
    126         user_2,
    127         user_3,
    128         user_4,
    129         user_5,
    130         path_base,
    131         code
    132     )) {
     118    if (!detNormalizedExpInsert(
     119            config->dbh,
     120            det_id,
     121            iteration,
     122            recipe,
     123            bg,
     124            bg_stdev,
     125            bg_mean_stdev,
     126            user_1,
     127            user_2,
     128            user_3,
     129            user_4,
     130            user_5,
     131            path_base,
     132            "full",
     133            code
     134            )) {
    133135        psError(PS_ERR_UNKNOWN, false, "database error");
    134136        return false;
     
    144146
    145147    psMetadata *where = psMetadataAlloc();
    146     PXOPT_COPY_STR(config->args, where, "-det_id",    "det_id", "==");
     148    PXOPT_COPY_S64(config->args, where, "-det_id",    "det_id", "==");
    147149    PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "==");
    148150    PXOPT_COPY_STR(config->args, where, "-recip",  "recipe", "==");
     
    217219
    218220    psMetadata *where = psMetadataAlloc();
    219     PXOPT_COPY_STR(config->args, where, "-det_id",    "det_id", "==");
     221    PXOPT_COPY_S64(config->args, where, "-det_id",    "det_id", "==");
    220222    PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "==");
    221223    PXOPT_COPY_S16(config->args, where, "-code",      "fault", "==");
     
    249251}
    250252
     253bool updatenormalizedexpMode(pxConfig *config)
     254{
     255    PS_ASSERT_PTR_NON_NULL(config, NULL);
     256
     257    PXOPT_LOOKUP_S64(det_id, config->args, "-det_id", true, false);
     258    PXOPT_LOOKUP_S32(iteration, config->args, "-iteration", true, false);
     259    PXOPT_LOOKUP_STR(data_state, config->args, "-data_state", true, false);
     260
     261    if (!setNormExpDataState(config, det_id, iteration, data_state)) {
     262        return false;
     263    }
     264    return true;
     265}
     266
    251267bool pendingcleanup_normalizedexpMode(pxConfig *config)
    252268{
    253269    PS_ASSERT_PTR_NON_NULL(config, NULL);
    254270
    255     PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", false, false);
    256271    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    257272    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    258273
    259274    psMetadata *where = psMetadataAlloc();
    260     if (chip_id) {
    261         PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "==");
    262     }
    263     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     275    PXOPT_COPY_S64(config->args, where, "-det_id", "detNormalizedExp.det_id", "==");
     276    PXOPT_COPY_S32(config->args, where, "-iteration", "detNormalizedExp.iteration", "==");
    264277
    265278    psString query = pxDataGet("dettool_pendingcleanup_normalizedexp.sql");
     
    302315
    303316    // negative simple so the default is true
    304     if (!ippdbPrintMetadatas(stdout, output, "detPendingCleanup_normalizedexp", !simple)) {
     317    if (!ippdbPrintMetadatas(stdout, output, "detCleanupNormExp", !simple)) {
    305318        psError(PS_ERR_UNKNOWN, false, "failed to print array");
    306319        psFree(output);
Note: See TracChangeset for help on using the changeset viewer.