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

    r25822 r25835  
    146146    PXOPT_LOOKUP_STR(tess_id, config->args, "-set_tess_id", false, false);
    147147    PXOPT_LOOKUP_STR(end_stage, config->args, "-set_end_stage", false, false);
     148    PXOPT_LOOKUP_STR(dist_group, config->args, "-set_dist_group", false, false);
     149    PXOPT_LOOKUP_STR(data_group, config->args, "-set_data_group", false, false);
     150    PXOPT_LOOKUP_STR(note, config->args, "-set_note", false, false);
    148151
    149152    // default
     
    265268                                 workdir     ? workdir   : raw_workdir,
    266269                                 label       ? label     : raw_label,
     270                                 data_group  ? data_group : (label ? label : raw_label),
     271                                 dist_group,
    267272                                 reduction   ? reduction : raw_reduction,
    268273                                 // expgroup    ? expgroup  : raw_expgroup,
     
    271276                                 dvodb       ? dvodb     : raw_dvodb,
    272277                                 tess_id     ? tess_id   : raw_tess_id,
    273                                  end_stage   ? end_stage : raw_end_stage
     278                                 end_stage   ? end_stage : raw_end_stage,
     279                                 note
    274280                                 )) {
    275281            if (!psDBRollback(config->dbh)) {
     
    303309    PXOPT_COPY_STR(config->args,  where, "-label",   "chipRun.label",   "==");
    304310    PXOPT_COPY_STR(config->args,  where, "-state",   "chipRun.state",   "==");
    305 
    306     if (!psListLength(where->list) &&
    307         !psMetadataLookupBool(NULL, config->args, "-all")) {
     311    PXOPT_COPY_STR(config->args,  where, "-data_group", "chipRun.data_group",   "==");
     312    PXOPT_COPY_STR(config->args,  where, "-dist_group", "chipRun.dist_group",   "==");
     313
     314    if (!psListLength(where->list)) {
    308315        psFree(where);
    309         where = NULL;
    310316        psError(PXTOOLS_ERR_DATA, false, "search parameters are required");
    311317        return false;
    312318    }
    313 
    314     PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false);
    315     PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false);
    316 
    317     if ((!state) && (!label)) {
    318         psError(PXTOOLS_ERR_DATA, false, "parameters are required");
    319         psFree(where);
    320         return false;
    321     }
    322 
    323     if (state) {
    324         // set chipRun.state to state
    325         if (!pxchipRunSetStateByQuery(config, where, state)) {
    326             psFree(where);
    327             return false;
    328         }
    329     }
    330 
    331     if (label) {
    332         // set chipRun.label to label
    333         if (!pxchipRunSetLabelByQuery(config, where, label)) {
    334             psFree(where);
    335             return false;
    336         }
    337     }
    338 
     319    psString query = psStringCopy("UPDATE chipRun JOIN rawExp USING(exp_id)");
     320
     321    // pxUpdateRun gets parameters from config->args and updates
     322    bool result = pxUpdateRun(config, where, &query, true);
     323    if (!result) {
     324        psError(PXTOOLS_ERR_DATA, false, "pxUpdateRun failed");
     325    }
     326
     327    psFree(query);
    339328    psFree(where);
    340329
    341     return true;
     330    return result;
    342331}
    343332
     
    12581247                    chipRun->workdir,
    12591248                    chipRun->label,
     1249                    chipRun->data_group,
     1250                    chipRun->dist_group,
    12601251                    chipRun->reduction,
    12611252                    chipRun->expgroup,
    12621253                    chipRun->dvodb,
    12631254                    chipRun->tess_id,
    1264                     chipRun->end_stage
     1255                    chipRun->end_stage,
     1256                    NULL    // note does not propagate
    12651257        )) {
    12661258           if (!psDBRollback(config->dbh)) {
Note: See TracChangeset for help on using the changeset viewer.