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

    r25324 r25835  
    177177    PXOPT_LOOKUP_STR(tess_id, config->args, "-set_tess_id", false, false);
    178178    PXOPT_LOOKUP_STR(end_stage, config->args, "-set_end_stage", false, false);
     179    PXOPT_LOOKUP_STR(data_group, config->args, "-set_data_group", false, false);
     180    PXOPT_LOOKUP_STR(dist_group, config->args, "-set_dist_group", false, false);
     181    PXOPT_LOOKUP_STR(note, config->args, "-set_note", false, false);
    179182
    180183    // default
     
    265268
    266269        // queue the exp
    267         if (!pxfakeQueueByCamID(config, cam_id, workdir, label, reduction, expgroup, dvodb, tess_id, end_stage)) {
     270        if (!pxfakeQueueByCamID(config, cam_id, workdir, label, data_group ? data_group : label, dist_group, reduction, expgroup, dvodb, tess_id, end_stage, note)) {
    268271            if (!psDBRollback(config->dbh)) {
    269272                psError(PS_ERR_UNKNOWN, false, "database error");
     
    330333    PXOPT_COPY_F32(config->args, where, "-sun_angle_max", "sun_angle", "<");
    331334    PXOPT_COPY_STR(config->args, where, "-label", "fakeRun.label", "==");
    332 
    333     if (!psListLength(where->list)
    334         && !psMetadataLookupBool(NULL, config->args, "-all")) {
     335    PXOPT_COPY_STR(config->args, where, "-data_group", "fakeRun.data_group", "==");
     336    PXOPT_COPY_STR(config->args, where, "-dist_group", "fakeRun.dist_group", "==");
     337
     338    if (!psListLength(where->list)) {
    335339        psFree(where);
    336340        where = NULL;
     
    339343    }
    340344
    341     PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false);
    342     PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false);
    343 
    344     if ((!state) && (!label)) {
    345         psError(PXTOOLS_ERR_DATA, false, "parameters are required");
    346         psFree(where);
    347         return false;
    348     }
    349 
    350     if (state) {
    351         // set fakeRun.state to state
    352         if (!pxfakeRunSetStateByQuery(config, where, state)) {
    353             psFree(where);
    354             return false;
    355         }
    356     }
    357 
    358     if (label) {
    359         // set fakeRun.label to label
    360         if (!pxfakeRunSetLabelByQuery(config, where, label)) {
    361             psFree(where);
    362             return false;
    363         }
    364     }
    365 
     345    psString query = psStringCopy("UPDATE fakeRun JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id)");
     346
     347    // pxUpdateRun gets parameters from config->args and updates
     348    bool result = pxUpdateRun(config, where, &query, true);
     349    if (!result) {
     350        psError(PXTOOLS_ERR_DATA, false, "pxUpdateRun failed");
     351    }
     352
     353    psFree(query);
    366354    psFree(where);
    367355
    368     return true;
     356    return result;
    369357}
    370358
     
    11621150                                 fakeRun->workdir,
    11631151                                 fakeRun->label,
     1152                                 fakeRun->data_group,
     1153                                 fakeRun->dist_group,
    11641154                                 fakeRun->dvodb,
    11651155                                 fakeRun->tess_id,
    11661156                                 fakeRun->reduction,
    1167                                  fakeRun->end_stage
     1157                                 fakeRun->end_stage,
     1158                                 NULL // note does not propagate
    11681159        )) {
    11691160            psError(PS_ERR_UNKNOWN, false, "failed to queue warpRun");
Note: See TracChangeset for help on using the changeset viewer.