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/warptool.c

    r25822 r25835  
    141141    PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false); // required
    142142    PXOPT_LOOKUP_STR(label, config->args, "-label", false, false);
     143    PXOPT_LOOKUP_STR(data_group, config->args, "-data_group", false, false);
     144    PXOPT_LOOKUP_STR(dist_group, config->args, "-dist_group", false, false);
     145    PXOPT_LOOKUP_STR(note, config->args, "-note", false, false);
    143146    PXOPT_LOOKUP_STR(dvodb, config->args, "-dvodb", false, false);
    144147    PXOPT_LOOKUP_STR(tess_id, config->args, "-tess_id", true, false); // required (no default TESS)
     
    162165            "dirty",    // workdir_state
    163166            label,
     167            data_group ? data_group : label,
     168            dist_group,
    164169            dvodb,
    165170            tess_id,
     
    167172            end_stage,
    168173            registered,
    169             0       // magicked
     174            0,       // magicked
     175            note
    170176    );
    171177    if (!warpRun) {
     
    253259    PXOPT_LOOKUP_STR(workdir, config->args, "-set_workdir", false, false);
    254260    PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false);
     261    PXOPT_LOOKUP_STR(data_group, config->args, "-set_data_group", false, false);
     262    PXOPT_LOOKUP_STR(dist_group, config->args, "-set_dist_group", false, false);
    255263    PXOPT_LOOKUP_STR(dvodb, config->args, "-set_dvodb", false, false);
    256264    PXOPT_LOOKUP_STR(tess_id, config->args, "-set_tess_id", false, false);
    257265    PXOPT_LOOKUP_STR(reduction, config->args, "-set_reduction", false, false);
    258266    PXOPT_LOOKUP_STR(end_stage, config->args, "-set_end_stage", false, false);
     267    PXOPT_LOOKUP_STR(note, config->args, "-set_note", false, false);
    259268
    260269    PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false);
     
    342351                                 workdir     ? workdir   : row->workdir,
    343352                                 label       ? label     : row->label,
     353                                 data_group  ? data_group: row->data_group,
     354                                 dist_group  ? dist_group: row->dist_group,
    344355                                 dvodb       ? dvodb     : row->dvodb,
    345356                                 tess_id     ? tess_id   : row->tess_id,
    346357                                 reduction   ? reduction : row->reduction,
    347                                  end_stage   ? end_stage : row->end_stage))
     358                                 end_stage   ? end_stage : row->end_stage,
     359                                 note))
    348360          {
    349361            psError(PS_ERR_UNKNOWN, false, "failed to trying to queue fake_id: %" PRId64, row->fake_id);
     
    373385    PXOPT_COPY_STR(config->args, where, "-label",     "warpRun.label",     "==");
    374386    PXOPT_COPY_STR(config->args, where, "-state",     "warpRun.state",     "==");
    375 
    376     if (!psListLength(where->list)
    377         && !psMetadataLookupBool(NULL, config->args, "-all")) {
     387    PXOPT_COPY_STR(config->args, where, "-data_group","warpRun.data_group",     "==");
     388    PXOPT_COPY_STR(config->args, where, "-dist_group","warpRun.dist_group",     "==");
     389
     390    if (!psListLength(where->list)) {
    378391        psFree(where);
    379         where = NULL;
    380392        psError(PXTOOLS_ERR_DATA, false, "search parameters are required");
    381393        return false;
    382394    }
    383 
    384     PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false);
    385     PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false);
    386 
    387     if ((!state) && (!label)) {
    388         psError(PXTOOLS_ERR_DATA, false, "parameters (-state or -label) are required");
    389         psFree(where);
    390         return false;
    391     }
    392 
    393     if (state) {
    394         // set warpRun.state to state
    395         if (!pxwarpRunSetStateByQuery(config, where, state)) {
    396             psFree(where);
    397             return false;
    398         }
    399     }
    400 
    401     if (label) {
    402         // set chipRun.label to label
    403         if (!pxwarpRunSetLabelByQuery(config, where, label)) {
    404             psFree(where);
    405             return false;
    406         }
    407     }
    408 
     395   
     396    psString query = psStringCopy("UPDATE warpRun JOIN fakeRun USING(fake_id) JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id)");
     397
     398    // pxUpdateRun gets parameters from config->args and updates
     399    bool result = pxUpdateRun(config, where, &query, true);
     400
     401    psFree(query);
    409402    psFree(where);
    410403
    411     return true;
    412 }
    413 
     404    return result;
     405}
    414406
    415407static bool expMode(pxConfig *config)
Note: See TracChangeset for help on using the changeset viewer.