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

    r18643 r18991  
    2525
    2626    psMetadata *where = psMetadataAlloc();
    27     PXOPT_COPY_STR(config->args, where, "-det_id",   "det_id", "==");
    28     PXOPT_COPY_STR(config->args, where, "-exp_id",   "exp_id", "==");
     27    PXOPT_COPY_S64(config->args, where, "-det_id",   "det_id", "==");
     28    PXOPT_COPY_S64(config->args, where, "-exp_id",   "exp_id", "==");
    2929    PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "==");
    3030
     
    8787
    8888    // det_id, exp_id, class_id, uri, recipe, -bg, -bg_stdev are required
    89     PXOPT_LOOKUP_STR(det_id, config->args, "-det_id", true, false);
    90     PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", true, false);
     89    PXOPT_LOOKUP_S64(det_id, config->args, "-det_id", true, false);
     90    PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", true, false);
    9191    PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false);
    9292
     
    114114    // find the matching rawImfile by exp_id/class_id
    115115    psMetadata *where = psMetadataAlloc();
    116     PXOPT_COPY_STR(config->args, where, "-exp_id",   "exp_id", "==");
     116    PXOPT_COPY_S64(config->args, where, "-exp_id",   "exp_id", "==");
    117117    PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "==");
    118118
     
    127127    // create a new detProcessedImfile object
    128128    detProcessedImfileRow *detRow = detProcessedImfileRowAlloc(
    129         (psS64)atoll(det_id),
    130         (psS64)atoll(exp_id),
     129        det_id,
     130        exp_id,
    131131        class_id,
    132132        uri,
     
    144144        user_5,
    145145        path_base,
     146        "full",
    146147        code
    147148    );
     
    172173
    173174    psMetadata *where = psMetadataAlloc();
    174     PXOPT_COPY_STR(config->args, where, "-det_id", "det_id", "==");
    175     PXOPT_COPY_STR(config->args, where, "-exp_id", "exp_id", "==");
     175    PXOPT_COPY_S64(config->args, where, "-det_id", "det_id", "==");
     176    PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "==");
    176177    PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "==");
    177178
     
    261262
    262263    psMetadata *where = psMetadataAlloc();
    263     PXOPT_COPY_STR(config->args, where, "-det_id", "det_id", "==");
    264     PXOPT_COPY_STR(config->args, where, "-exp_id", "exp_id", "==");
     264    PXOPT_COPY_S64(config->args, where, "-det_id", "det_id", "==");
     265    PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "==");
    265266    PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "==");
    266267    PXOPT_COPY_S16(config->args, where, "-code", "fault", "==");
     
    294295}
    295296
     297bool updateprocessedimfileMode(pxConfig *config)
     298{
     299    PS_ASSERT_PTR_NON_NULL(config, NULL);
     300
     301    PXOPT_LOOKUP_S64(det_id, config->args, "-det_id", true, false);
     302    PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", true, false);
     303    PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false);
     304    PXOPT_LOOKUP_STR(data_state, config->args, "-data_state", true, false);
     305
     306    if (!setProcessedImfileDataState(config, det_id, exp_id, class_id, data_state)) {
     307        return false;
     308    }
     309    return true;
     310}
     311
    296312bool pendingcleanup_processedimfileMode(pxConfig *config)
    297313{
    298314    PS_ASSERT_PTR_NON_NULL(config, NULL);
    299315
    300     PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", false, false);
    301316    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    302317    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    303318
    304319    psMetadata *where = psMetadataAlloc();
    305     if (chip_id) {
    306         PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "==");
    307     }
    308     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     320    PXOPT_COPY_S64(config->args, where, "-det_id", "detProcessedImfile.det_id", "==");
    309321
    310322    psString query = pxDataGet("dettool_pendingcleanup_processedimfile.sql");
     
    347359
    348360    // negative simple so the default is true
    349     if (!ippdbPrintMetadatas(stdout, output, "detPendingCleanup_processedimfile", !simple)) {
     361    if (!ippdbPrintMetadatas(stdout, output, "detCleanupProcessedImfile", !simple)) {
    350362        psError(PS_ERR_UNKNOWN, false, "failed to print array");
    351363        psFree(output);
     
    358370}
    359371
    360 
     372// XXX SQL missing
    361373bool donecleanup_processedimfileMode(pxConfig *config)
    362374{
Note: See TracChangeset for help on using the changeset viewer.