IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 16, 2008, 4:49:26 PM (18 years ago)
Author:
jhoblitt
Message:

add dettool -updatedetrunsummary

File:
1 edited

Legend:

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

    r18148 r18157  
    8787static bool detrunsummaryMode(pxConfig *config);
    8888static bool revertdetrunsummaryMode(pxConfig *config);
     89static bool updatedetrunsummaryMode(pxConfig *config);
     90// run
    8991static bool updatedetrunMode(pxConfig *config);
    9092static bool rerunMode(pxConfig *config);
     
    179181        MODECASE(DETTOOL_MODE_DETRUNSUMMARY,    detrunsummaryMode);
    180182        MODECASE(DETTOOL_MODE_REVERTDETRUNSUMMARY, revertdetrunsummaryMode);
     183        MODECASE(DETTOOL_MODE_UPDATEDETRUNSUMMARY, updatedetrunsummaryMode);
    181184        MODECASE(DETTOOL_MODE_UPDATEDETRUN,     updatedetrunMode);
    182185        MODECASE(DETTOOL_MODE_RERUN,            rerunMode);
     
    38513854
    38523855
     3856static bool updatedetrunsummaryMode(pxConfig *config)
     3857{
     3858    PS_ASSERT_PTR_NON_NULL(config, false);
     3859
     3860    // required
     3861    PXOPT_LOOKUP_STR(det_id, config->args, "-det_id", true, false);
     3862
     3863    PXOPT_LOOKUP_BOOL(accept, config->args, "-accept", false);
     3864    PXOPT_LOOKUP_BOOL(reject, config->args, "-reject", false);
     3865
     3866    if (accept && reject) {
     3867        psError(PS_ERR_UNKNOWN, true, "-accept and -reject are exclusive");
     3868        return false;
     3869    }
     3870
     3871    if (!(accept || reject)) {
     3872        psError(PS_ERR_UNKNOWN, true, "either -accept or -reject is required");
     3873        return false;
     3874    }
     3875
     3876    char *query = "UPDATE detRunSummary SET accept = %d WHERE det_id = %"PRId64;
     3877    if (!p_psDBRunQuery(config->dbh, query, accept, (psS64)atoll(det_id))) {
     3878        psError(PS_ERR_UNKNOWN, false, "database error");
     3879        return false;
     3880    }
     3881
     3882    return true;
     3883}
     3884
     3885
    38533886static bool updatedetrunMode(pxConfig *config)
    38543887{
Note: See TracChangeset for help on using the changeset viewer.