IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

add dettool -revertresidimfile

File:
1 edited

Legend:

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

    r14265 r14266  
    4141static bool inputMode(pxConfig *config);
    4242static bool rawMode(pxConfig *config);
    43 // imfile
     43// processedimfile
    4444static bool toprocessedimfileMode(pxConfig *config);
    4545static bool addprocessedimfileMode(pxConfig *config);
    4646static bool processedimfileMode(pxConfig *config);
    4747static bool revertprocessedimfileMode(pxConfig *config);
    48 // exp
     48// processedexp
    4949static bool toprocessedexpMode(pxConfig *config);
    5050static bool addprocessedexpMode(pxConfig *config);
     
    7474static bool toresidimfileMode(pxConfig *config);
    7575static bool addresidimfileMode(pxConfig *config);
     76static bool residimfileMode(pxConfig *config);
     77static bool revertresidimfileMode(pxConfig *config);
     78// residexp
    7679static bool toresidexpMode(pxConfig *config);
    77 static bool residimfileMode(pxConfig *config);
    7880static bool addresidexpMode(pxConfig *config);
    7981static bool residexpMode(pxConfig *config);
     
    161163        MODECASE(DETTOOL_MODE_ADDRESIDIMFILE,   addresidimfileMode);
    162164        MODECASE(DETTOOL_MODE_RESIDIMFILE,      residimfileMode);
    163 
     165        MODECASE(DETTOOL_MODE_REVERTRESIDIMFILE,revertresidimfileMode);
     166        // residexp
    164167        MODECASE(DETTOOL_MODE_TORESIDEXP,       toresidexpMode);
    165168        MODECASE(DETTOOL_MODE_ADDRESIDEXP,      addresidexpMode);
    166169        MODECASE(DETTOOL_MODE_RESIDEXP,         residexpMode);
     170        MODECASE(DETTOOL_MODE_UPDATERESIDEXP,   updateresidexpMode);
     171        // detrunsummary
    167172        MODECASE(DETTOOL_MODE_TODETRUNSUMMARY,  todetrunsummaryMode);
    168         MODECASE(DETTOOL_MODE_UPDATERESIDEXP,   updateresidexpMode);
    169173        MODECASE(DETTOOL_MODE_ADDDETRUNSUMMARY, adddetrunsummaryMode);
    170174        MODECASE(DETTOOL_MODE_DETRUNSUMMARY,    detrunsummaryMode);
    171175        MODECASE(DETTOOL_MODE_UPDATEDETRUN,     updatedetrunMode);
    172176        MODECASE(DETTOOL_MODE_RERUN,            rerunMode);
     177        // register
    173178        MODECASE(DETTOOL_MODE_REGISTER_DETREND, register_detrendMode);
    174179        MODECASE(DETTOOL_MODE_REGISTER_DETREND_IMFILE, register_detrend_imfileMode);
     
    50915096}
    50925097
     5098
     5099static bool revertresidimfileMode(pxConfig *config)
     5100{
     5101    PS_ASSERT_PTR_NON_NULL(config, false);
     5102
     5103    psString query = pxDataGet("dettool_revertresidimfile.sql");
     5104    if (!query) {
     5105        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     5106        return false;
     5107    }
     5108
     5109    if (config->where) {
     5110        psString whereClause = psDBGenerateWhereConditionSQL(config->where, "detResidImfile");
     5111        psStringAppend(&query, " AND %s", whereClause);
     5112        psFree(whereClause);
     5113    }
     5114
     5115    if (!p_psDBRunQuery(config->dbh, query)) {
     5116        psError(PS_ERR_UNKNOWN, false, "database error");
     5117        psFree(query);
     5118        return false;
     5119    }
     5120    psFree(query);
     5121
     5122    if (psDBAffectedRows(config->dbh) < 1) {
     5123        psError(PS_ERR_UNKNOWN, false, "should have affected atleast 1 row");
     5124        return false;
     5125    }
     5126
     5127    return true;
     5128}
     5129
     5130
    50935131static bool toresidexpMode(pxConfig *config)
    50945132{
Note: See TracChangeset for help on using the changeset viewer.