IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13849


Ignore:
Timestamp:
Jun 15, 2007, 2:33:47 PM (19 years ago)
Author:
eugene
Message:

adding option to processedimfile to select on state and mode (default is run / master)

Location:
trunk/ippTools/src
Files:
2 edited

Legend:

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

    r13723 r13849  
    29552955    PS_ASSERT_PTR_NON_NULL(config, false);
    29562956
     2957    char *value = NULL;
    29572958    bool status = false;
     2959
    29582960    psU64 limit = psMetadataLookupU64(&status, config->args, "-limit");
    29592961    if (!status) {
     
    29802982        "   AND detProcessedImfile.exp_tag = detInputExp.exp_tag"
    29812983        " WHERE"
    2982         "   detRun.state = 'run'"
    2983         "   AND detRun.mode = 'master'"
    29842984    );
     2985    // NOTE the above WHERE is completed with the following line:
     2986
     2987    // add the two required restrictions: detRun.state and detRun.mode
     2988    if ((value = psMetadataLookupStr(&status, config->args, "-select_state"))) {
     2989        psStringAppend(&query, " detRun.state = '%s'", value);
     2990    } else {
     2991        psStringAppend(&query, " detRun.state = 'run'");
     2992    }
     2993    if ((value = psMetadataLookupStr(&status, config->args, "-select_mode"))) {
     2994        psStringAppend(&query, " AND detRun.mode = '%s'", value);
     2995    } else {
     2996        psStringAppend(&query, " AND detRun.mode = 'master'");
     2997    }
    29852998
    29862999    if (config->where) {
     
    30113024    }
    30123025
    3013     if (!p_psDBRunQuery(config->dbh, query)) {
    3014         psError(PS_ERR_UNKNOWN, false, "database error");
    3015         psFree(query);
    3016         return false;
    3017     }
    3018     psFree(query);
    3019 
    30203026    // treat limit == 0 as "no limit"
    30213027    if (limit) {
     
    30243030        psFree(limitString);
    30253031    }
     3032
     3033    if (!p_psDBRunQuery(config->dbh, query)) {
     3034        psError(PS_ERR_UNKNOWN, false, "database error");
     3035        psFree(query);
     3036        return false;
     3037    }
     3038    psFree(query);
    30263039
    30273040    psArray *output = p_psDBFetchResult(config->dbh);
  • trunk/ippTools/src/dettoolConfig.c

    r13723 r13849  
    356356    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-class_id",  0,
    357357            "search for class ID", NULL);
     358    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-select_state",  0,
     359            "search for state", NULL);
     360    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-select_mode",  0,
     361            "search for mode", NULL);
    358362    psMetadataAddBool(processedimfileArgs, PS_LIST_TAIL, "-chip",  0,
    359363            "restrict results to completed 'chip' sets", false);
Note: See TracChangeset for help on using the changeset viewer.