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

    r18643 r18991  
    7676    // det_id, exp_id, recip, -bg, -bg_stdev
    7777    // are required
    78     PXOPT_LOOKUP_STR(det_id, config->args, "-det_id", true, false);
    79     PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", true, false);
     78    PXOPT_LOOKUP_S64(det_id, config->args, "-det_id", true, false);
     79    PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", true, false);
    8080
    8181    // default values
     
    126126    // create a new detProcessedImfile object
    127127    detProcessedExpRow *detRow = detProcessedExpRowAlloc(
    128         (psS64)atoll(det_id),
    129         (psS64)atoll(exp_id),
     128        det_id,
     129        exp_id,
    130130        recipe,
    131131        bg,
     
    141141        user_5,
    142142        path_base,
     143        "full",
    143144        code
    144145    );
     
    161162
    162163    psMetadata *where = psMetadataAlloc();
    163     PXOPT_COPY_STR(config->args, where, "-det_id", "det_id", "==");
    164     PXOPT_COPY_STR(config->args, where, "-exp_id", "exp_id", "==");
     164    PXOPT_COPY_S64(config->args, where, "-det_id", "det_id", "==");
     165    PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "==");
    165166
    166167    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     
    228229
    229230    psMetadata *where = psMetadataAlloc();
    230     PXOPT_COPY_STR(config->args, where, "-det_id", "det_id", "==");
    231     PXOPT_COPY_STR(config->args, where, "-exp_id", "exp_id", "==");
     231    PXOPT_COPY_S64(config->args, where, "-det_id", "det_id", "==");
     232    PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "==");
    232233    PXOPT_COPY_S16(config->args, where, "-code",   "fault", "==");
    233234
     
    260261}
    261262
     263bool updateprocessedexpMode(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_S64(exp_id, config->args, "-exp_id", true, false);
     269    PXOPT_LOOKUP_STR(data_state, config->args, "-data_state", true, false);
     270    if (!setProcessedExpDataState(config, det_id, exp_id, data_state)) {
     271        return false;
     272    }
     273    return true;
     274}
     275
    262276bool pendingcleanup_processedexpMode(pxConfig *config)
    263277{
    264278    PS_ASSERT_PTR_NON_NULL(config, NULL);
    265279
    266     PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", false, false);
    267280    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    268281    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    269282
    270283    psMetadata *where = psMetadataAlloc();
    271     if (chip_id) {
    272         PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "==");
    273     }
    274     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     284    PXOPT_COPY_S64(config->args, where, "-det_id", "detProcessedExp.det_id", "==");
     285    PXOPT_COPY_STR(config->args, where, "-label", "detProcessedExp.label", "==");
    275286
    276287    psString query = pxDataGet("dettool_pendingcleanup_processedexp.sql");
     
    313324
    314325    // negative simple so the default is true
    315     if (!ippdbPrintMetadatas(stdout, output, "detPendingCleanup_processedexp", !simple)) {
     326    if (!ippdbPrintMetadatas(stdout, output, "detCleanupProcessedExp", !simple)) {
    316327        psError(PS_ERR_UNKNOWN, false, "failed to print array");
    317328        psFree(output);
     
    324335}
    325336
    326 
     337// XXX SQL missing
    327338bool donecleanup_processedexpMode(pxConfig *config)
    328339{
     
    374385
    375386    // negative simple so the default is true
    376     if (!ippdbPrintMetadatas(stdout, output, "detDoneCleanup_processedexp", !simple)) {
     387    if (!ippdbPrintMetadatas(stdout, output, "detDoneCleanupProcessedExp", !simple)) {
    377388        psError(PS_ERR_UNKNOWN, false, "failed to print array");
    378389        psFree(output);
Note: See TracChangeset for help on using the changeset viewer.