IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14268


Ignore:
Timestamp:
Jul 17, 2007, 10:37:55 AM (19 years ago)
Author:
jhoblitt
Message:

add detool -revertresidexp

Location:
trunk/ippTools
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/share/Makefile.am

    r14266 r14268  
    2121        dettool_revertprocessedexp.sql \
    2222        dettool_revertprocessedimfile.sql \
     23        dettool_revertresidexp.sql \
    2324        dettool_revertresidimfile.sql\
    2425        dettool_revertstacked.sql \
  • trunk/ippTools/src/dettool.c

    r14266 r14268  
    5151static bool processedexpMode(pxConfig *config);
    5252static bool revertprocessedexpMode(pxConfig *config);
    53 // stacked[imfile]
     53// stackedimfile
    5454static bool tostackedMode(pxConfig *config);
    5555static bool addstackedMode(pxConfig *config);
     
    8080static bool addresidexpMode(pxConfig *config);
    8181static bool residexpMode(pxConfig *config);
     82static bool revertresidexpMode(pxConfig *config);
     83static bool updateresidexpMode(pxConfig *config);
     84// detrunsummary
    8285static bool todetrunsummaryMode(pxConfig *config);
    83 static bool updateresidexpMode(pxConfig *config);
    8486static bool adddetrunsummaryMode(pxConfig *config);
    8587static bool detrunsummaryMode(pxConfig *config);
    8688static bool updatedetrunMode(pxConfig *config);
    8789static bool rerunMode(pxConfig *config);
     90// register
    8891static bool register_detrendMode(pxConfig *config);
    8992static bool register_detrend_imfileMode(pxConfig *config);
     
    168171        MODECASE(DETTOOL_MODE_ADDRESIDEXP,      addresidexpMode);
    169172        MODECASE(DETTOOL_MODE_RESIDEXP,         residexpMode);
     173        MODECASE(DETTOOL_MODE_REVERTRESIDEXP,   revertresidexpMode);
    170174        MODECASE(DETTOOL_MODE_UPDATERESIDEXP,   updateresidexpMode);
    171175        // detrunsummary
     
    56105614}
    56115615
     5616
     5617static bool revertresidexpMode(pxConfig *config)
     5618{
     5619    PS_ASSERT_PTR_NON_NULL(config, false);
     5620
     5621    psString query = pxDataGet("dettool_revertresidexp.sql");
     5622    if (!query) {
     5623        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     5624        return false;
     5625    }
     5626
     5627    if (config->where) {
     5628        psString whereClause = psDBGenerateWhereConditionSQL(config->where, "detResidExp");
     5629        psStringAppend(&query, " AND %s", whereClause);
     5630        psFree(whereClause);
     5631    }
     5632
     5633    if (!p_psDBRunQuery(config->dbh, query)) {
     5634        psError(PS_ERR_UNKNOWN, false, "database error");
     5635        psFree(query);
     5636        return false;
     5637    }
     5638    psFree(query);
     5639
     5640    if (psDBAffectedRows(config->dbh) < 1) {
     5641        psError(PS_ERR_UNKNOWN, false, "should have affected atleast 1 row");
     5642        return false;
     5643    }
     5644
     5645    return true;
     5646}
     5647
     5648
    56125649static bool todetrunsummaryMode(pxConfig *config)
    56135650{
  • trunk/ippTools/src/dettool.h

    r14266 r14268  
    6262    DETTOOL_MODE_REVERTRESIDIMFILE,
    6363    DETTOOL_MODE_TORESIDEXP,
     64    DETTOOL_MODE_ADDRESIDEXP,
    6465    DETTOOL_MODE_RESIDEXP,
    65     DETTOOL_MODE_ADDRESIDEXP,
     66    DETTOOL_MODE_REVERTRESIDEXP,
    6667    DETTOOL_MODE_TODETRUNSUMMARY,
    6768    DETTOOL_MODE_UPDATERESIDEXP,
  • trunk/ippTools/src/dettoolConfig.c

    r14266 r14268  
    855855            "use the simple output format", false);
    856856
     857    // -revertresidexp
     858    psMetadata *revertresidexpArgs = psMetadataAlloc();
     859    psMetadataAddStr(revertresidexpArgs, PS_LIST_TAIL, "-det_id", 0,
     860            "search by detrend ID (required)", NULL);
     861    psMetadataAddS32(revertresidexpArgs, PS_LIST_TAIL, "-iteration", 0,
     862            "search by iteration number", 0);
     863    psMetadataAddStr(revertresidexpArgs, PS_LIST_TAIL, "-exp_id",  0,
     864            "search by detrend ID", NULL);
     865    psMetadataAddS16(revertresidexpArgs, PS_LIST_TAIL, "-code",  0,
     866            "search by fault code", 0);
     867
    857868    // -todetrunsummary
    858869    psMetadata *todetrunsummaryArgs = psMetadataAlloc();
     
    10541065    PXTOOL_ADD_MODE("-addresidexp",     "", DETTOOL_MODE_ADDRESIDEXP,  addresidexpArgs);
    10551066    PXTOOL_ADD_MODE("-residexp",        "", DETTOOL_MODE_RESIDEXP,     residexpArgs);
     1067    PXTOOL_ADD_MODE("-revertresidexp",  "", DETTOOL_MODE_REVERTRESIDEXP, revertresidexpArgs);
    10561068    PXTOOL_ADD_MODE("-todetrunsummary",  "", DETTOOL_MODE_TODETRUNSUMMARY,  todetrunsummaryArgs);
    10571069    PXTOOL_ADD_MODE("-updateresidexp", "", DETTOOL_MODE_UPDATERESIDEXP,updateresidexpArgs);
Note: See TracChangeset for help on using the changeset viewer.