IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

add dettool -revertnormalizedexp

File:
1 edited

Legend:

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

    r14243 r14265  
    7070static bool addnormalizedexpMode(pxConfig *config);
    7171static bool normalizedexpMode(pxConfig *config);
    72 
     72static bool revertnormalizedexpMode(pxConfig *config);
    7373// residimfile
    7474static bool toresidimfileMode(pxConfig *config);
     
    156156        MODECASE(DETTOOL_MODE_ADDNORMALIZEDEXP, addnormalizedexpMode);
    157157        MODECASE(DETTOOL_MODE_NORMALIZEDEXP,    normalizedexpMode);
     158        MODECASE(DETTOOL_MODE_REVERTNORMALIZEDEXP, revertnormalizedexpMode);
     159        // residimfile
    158160        MODECASE(DETTOOL_MODE_TORESIDIMFILE,    toresidimfileMode);
    159161        MODECASE(DETTOOL_MODE_ADDRESIDIMFILE,   addresidimfileMode);
     162        MODECASE(DETTOOL_MODE_RESIDIMFILE,      residimfileMode);
     163
    160164        MODECASE(DETTOOL_MODE_TORESIDEXP,       toresidexpMode);
    161         MODECASE(DETTOOL_MODE_RESIDIMFILE,      residimfileMode);
    162165        MODECASE(DETTOOL_MODE_ADDRESIDEXP,      addresidexpMode);
    163166        MODECASE(DETTOOL_MODE_RESIDEXP,         residexpMode);
     
    43394342}
    43404343
     4344
    43414345static bool normalizedexpMode(pxConfig *config)
    43424346{
     
    44274431    return true;
    44284432}
     4433
    44294434
    44304435static  detNormalizedImfileRow *detNormalizedStatToDetNormalizedmfile(pxConfig *config, detNormalizedStatImfileRow *statImfile)
     
    45244529    );
    45254530}
     4531
     4532
     4533static bool revertnormalizedexpMode(pxConfig *config)
     4534{
     4535    PS_ASSERT_PTR_NON_NULL(config, false);
     4536
     4537    psString query = pxDataGet("dettool_revertnormalizedexp.sql");
     4538    if (!query) {
     4539        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     4540        return false;
     4541    }
     4542
     4543    if (config->where) {
     4544        psString whereClause = psDBGenerateWhereConditionSQL(config->where, "detNormalizedExp");
     4545        psStringAppend(&query, " AND %s", whereClause);
     4546        psFree(whereClause);
     4547    }
     4548
     4549    if (!p_psDBRunQuery(config->dbh, query)) {
     4550        psError(PS_ERR_UNKNOWN, false, "database error");
     4551        psFree(query);
     4552        return false;
     4553    }
     4554    psFree(query);
     4555
     4556    if (psDBAffectedRows(config->dbh) < 1) {
     4557        psError(PS_ERR_UNKNOWN, false, "should have affected atleast 1 row");
     4558        return false;
     4559    }
     4560
     4561    return true;
     4562}
     4563
    45264564
    45274565static bool toresidimfileMode(pxConfig *config)
Note: See TracChangeset for help on using the changeset viewer.