IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

add detool -revertresidexp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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{
Note: See TracChangeset for help on using the changeset viewer.