IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 14, 2009, 11:06:18 AM (17 years ago)
Author:
bills
Message:

Add data_group, dist_group, and note to the pipeline. These new columns will be used
for some of the tasks that label was used previously.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/camtool.c

    r25330 r25835  
    121121    PXOPT_LOOKUP_STR(workdir, config->args, "-set_workdir", false, false);
    122122    PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false);
     123    PXOPT_LOOKUP_STR(data_group, config->args, "-set_data_group", false, false);
     124    PXOPT_LOOKUP_STR(dist_group, config->args, "-set_dist_group", false, false);
    123125    PXOPT_LOOKUP_STR(reduction, config->args, "-set_reduction", false, false);
    124126    PXOPT_LOOKUP_STR(expgroup, config->args, "-set_expgroup", false, false);
     
    126128    PXOPT_LOOKUP_STR(tess_id, config->args, "-set_tess_id", false, false);
    127129    PXOPT_LOOKUP_STR(end_stage, config->args, "-set_end_stage", false, false);
     130    PXOPT_LOOKUP_STR(note, config->args, "-set_note", false, false);
    128131
    129132    // find the exp_id of all the exposures that we want to queue up.
     
    212215                    workdir     ? workdir   : row->workdir,
    213216                    label       ? label     : row->label,
     217                    data_group  ? data_group: row->data_group,
     218                    dist_group  ? dist_group: row->dist_group,
    214219                    reduction   ? reduction : row->reduction,
    215220                    expgroup    ? expgroup  : row->expgroup,
    216221                    dvodb       ? dvodb     : row->dvodb,
    217222                    tess_id     ? tess_id   : row->tess_id,
    218                     end_stage   ? end_stage : row->end_stage
     223                    end_stage   ? end_stage : row->end_stage,
     224                    note
    219225        )) {
    220226            if (!psDBRollback(config->dbh)) {
     
    251257    PXOPT_COPY_STR(config->args, where, "-reduction", "camRun.reduction", "==");
    252258
    253     if (!psListLength(where->list)
    254         && !psMetadataLookupBool(NULL, config->args, "-all")) {
     259    if (!psListLength(where->list)) {
    255260        psFree(where);
    256261        psError(PXTOOLS_ERR_DATA, false, "search parameters are required");
    257262        return false;
    258263    }
    259 
    260     PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false);
    261     PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false);
    262 
    263     if ((!state) && (!label)) {
    264         psError(PXTOOLS_ERR_DATA, false, "parameters are required");
    265         psFree(where);
    266         return false;
    267     }
    268 
    269     if (state) {
    270         // set camRun.state to state
    271         if (!pxcamRunSetStateByQuery(config, where, state)) {
    272             psFree(where);
    273             return false;
    274         }
    275     }
    276 
    277     if (label) {
    278         // set camRun.label to label
    279         if (!pxcamRunSetLabelByQuery(config, where, label)) {
    280             psFree(where);
    281             return false;
    282         }
    283     }
    284 
     264    psString query = psStringCopy("UPDATE camRun JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id)");
     265
     266    // pxUpdateRun gets parameters from config->args and updates
     267    bool result = pxUpdateRun(config, where, &query, true);
     268    if (!result) {
     269        psError(PXTOOLS_ERR_DATA, false, "pxUpdateRun failed");
     270    }
     271
     272    psFree(query);
    285273    psFree(where);
    286274
    287     return true;
     275    return result;
    288276}
    289277
     
    642630            pendingRow->workdir,
    643631            pendingRow->label,
     632            pendingRow->data_group,
     633            pendingRow->dist_group,
    644634            pendingRow->reduction,
    645635            pendingRow->expgroup,
    646636            pendingRow->dvodb,
    647637            pendingRow->tess_id,
    648             pendingRow->end_stage
     638            pendingRow->end_stage,
     639            NULL    // note does not propagate
    649640    )) {
    650641        // rollback
     
    656647        return false;
    657648    }
    658 
    659 /*     if (!pxaddQueueByCamID(config, */
    660 /*                         pendingRow->cam_id, */
    661 /*                         pendingRow->workdir, */
    662 /*                         pendingRow->label, */
    663 /*                         pendingRow->reduction, */
    664 /*                         pendingRow->dvodb */
    665 /*     )) { */
    666 /*         // rollback */
    667 /*         if (!psDBRollback(config->dbh)) { */
    668 /*             psError(PS_ERR_UNKNOWN, false, "database error"); */
    669 /*         } */
    670 /*         psError(PS_ERR_UNKNOWN, false, "failed to queue new addRun"); */
    671 /*         psFree(pendingRow); */
    672 /*         return false; */
    673 /*     } */
    674649
    675650    psFree(pendingRow);
Note: See TracChangeset for help on using the changeset viewer.