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

    r25800 r25835  
    4848
    4949static bool setstackRunState(pxConfig *config, psS64 stack_id, const char *state);
    50 static bool setstackRunStateByLabel(pxConfig *config, const char *label, const char *state);
    5150
    5251# define MODECASE(caseName, func) \
     
    110109
    111110    // required options
    112     PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false);
    113     PXOPT_LOOKUP_STR(label, config->args, "-label", false, false);
    114     PXOPT_LOOKUP_STR(reduction, config->args, "-reduction", false, false);
    115     PXOPT_LOOKUP_STR(dvodb, config->args, "-dvodb", false, false);
     111    PXOPT_LOOKUP_STR(workdir, config->args, "-set_workdir", true, false);
     112
     113    // optional
     114    PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false);
     115    PXOPT_LOOKUP_STR(data_group, config->args, "-set_data_group", false, false);
     116    PXOPT_LOOKUP_STR(dist_group, config->args, "-set_dist_group", false, false);
     117    PXOPT_LOOKUP_STR(reduction, config->args, "-set_reduction", false, false);
     118    PXOPT_LOOKUP_STR(dvodb, config->args, "-set_dvodb", false, false);
     119    PXOPT_LOOKUP_STR(note, config->args, "-set_note", false, false);
     120    PXOPT_LOOKUP_TIME(registered, config->args, "-set_registered", false, false);
    116121
    117122    psMetadata *where = psMetadataAlloc();
     
    161166    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    162167    PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false);
    163     PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false);
    164 
    165     if (!psListLength(where->list) &&
    166         !psMetadataLookupBool(NULL, config->args, "-all")) {
     168
     169    if (!psListLength(where->list)) {
    167170        psFree(where);
    168171        psError(PXTOOLS_ERR_DATA, false, "search parameters are required");
     
    346349            workdir,
    347350            label,
     351            data_group ? data_group : label,
     352            dist_group,
    348353            reduction,
    349354            dvodb,
     
    351356            skycell_id,
    352357            tess_id,
    353             filter);
     358            filter,
     359            note);
    354360
    355361        if (!stackRunInsertObject(config->dbh, run)) {
     
    469475
    470476    // required options
    471     PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false);
     477    PXOPT_LOOKUP_STR(workdir, config->args, "-set_workdir", true, false);
    472478    PXOPT_LOOKUP_STR(skycell_id, config->args, "-skycell_id", true, false);
    473479    PXOPT_LOOKUP_STR(tess_id, config->args, "-tess_id", true, false);
     
    476482    // default
    477483    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    478     PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false);
     484    PXOPT_LOOKUP_TIME(registered, config->args, "-set_registered", false, false);
    479485
    480486    // options
    481     PXOPT_LOOKUP_STR(label, config->args, "-label", false, false);
    482     PXOPT_LOOKUP_STR(reduction, config->args, "-reduction", false, false);
    483     PXOPT_LOOKUP_STR(dvodb, config->args, "-dvodb", false, false);
     487    PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false);
     488    PXOPT_LOOKUP_STR(data_group, config->args, "-set_data_group", false, false);
     489    PXOPT_LOOKUP_STR(dist_group, config->args, "-set_dist_group", false, false);
     490    PXOPT_LOOKUP_STR(note, config->args, "-set_note", false, false);
     491    PXOPT_LOOKUP_STR(reduction, config->args, "-set_reduction", false, false);
     492    PXOPT_LOOKUP_STR(dvodb, config->args, "-set_dvodb", false, false);
    484493
    485494    // we have to support multipe exp_ids
     
    496505        workdir,
    497506        label,
     507        data_group ? data_group : label,
     508        dist_group,
    498509        reduction,
    499510        dvodb,
     
    501512        skycell_id,
    502513        tess_id,
    503         filter);
     514        filter,
     515        note);
    504516
    505517    if (!run) {
     
    570582    PS_ASSERT_PTR_NON_NULL(config, false);
    571583
     584#ifdef notdef
    572585    PXOPT_LOOKUP_S64(stack_id, config->args, "-stack_id", false, false);
    573586    PXOPT_LOOKUP_STR(state, config->args, "-state", true, false);
    574587    PXOPT_LOOKUP_STR(label, config->args, "-label", false, false);
    575 
     588#endif
     589    psMetadata *where = psMetadataAlloc();
     590    PXOPT_COPY_S64(config->args, where, "-stack_id",  "stack_id",   "==");
     591    PXOPT_COPY_STR(config->args, where, "-label",     "label",     "==");
     592    PXOPT_COPY_STR(config->args, where, "-state",     "state",     "==");
     593    if (!psListLength(where->list)) {
     594        psFree(where);
     595        psError(PXTOOLS_ERR_DATA, false, "search parameters are required");
     596        return false;
     597    }
     598
     599    psString query = psStringCopy("UPDATE stackRun");
     600
     601    // pxUpdateRun gets parameters from config->args and updates
     602    bool result = pxUpdateRun(config, where, &query, true);
     603
     604    psFree(query);
     605    psFree(where);
     606
     607    return result;
     608
     609#ifdef notdef
    576610    // Hack-y work around to make stacktool more like the other tools, without breaking other stuff (hopefully).
    577611
     
    587621    psError(PS_ERR_UNKNOWN, false, "Required options not found.");
    588622    return false;
     623#endif
    589624}
    590625
     
    10151050}
    10161051
     1052#ifdef notdef
    10171053static bool setstackRunStateByLabel(pxConfig *config, const char *label, const char *state)
    10181054{
     
    10341070    return true;
    10351071}
     1072#endif
    10361073
    10371074static bool pendingcleanuprunMode(pxConfig *config)
Note: See TracChangeset for help on using the changeset viewer.