IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 5, 2007, 10:15:41 AM (19 years ago)
Author:
jhoblitt
Message:

merge backtrack branch

File:
1 edited

Legend:

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

    r13617 r14018  
    4444// static guidePendingExpRow *newToP1PendingExp(newExpRow *newExp);
    4545//static chipPendingExpRow *newTochipPendingExp(pxConfig *config, newExpRow *newExp);
    46 //static chipPendingImfileRow *rawImfileTochipPendingImfile(pxConfig *config, psS64 chip_id, rawImfileRow *rawImfile);
     46//static chipInputImfileRow *rawImfileTochipInputImfile(pxConfig *config, psS64 chip_id, rawImfileRow *rawImfile);
    4747
    4848static rawExpRow *newToRawExp(pxConfig *config, newExpRow *exp);
     
    282282                return false;
    283283            }
     284            psFree(object);
    284285            // insert the rawImfile object into the database
    285286            if (!rawImfileInsertObject(config->dbh, imfile)) {
     
    290291                psError(PS_ERR_UNKNOWN, false, "failed to insert row into the database");
    291292                psFree(imfile);
    292                 psFree(object);
    293293                psFree(output);
    294294                return false;
    295295            }
    296296            psFree(imfile);
    297             // remove the neImfile object from the database
    298             if (!newImfileDeleteObject(config->dbh, object)) {
    299                 // rollback
    300                 if (!psDBRollback(config->dbh)) {
    301                     psError(PS_ERR_UNKNOWN, false, "database error");
    302                 }
    303                 psError(PS_ERR_UNKNOWN, false, "failed to delete row from the database");
    304                 psFree(object);
    305                 psFree(output);
    306                 return false;
    307             }
    308             psFree(object);
    309297        }
    310298
     
    573561    }
    574562    if (!psArrayLength(output)) {
    575         psTrace("regtool", PS_LOG_INFO, "no rows found");
     563        psError(PS_ERR_UNKNOWN, false, "no pending newExp rows found");
    576564        psFree(output);
    577         return true;
    578     }
    579 
    580     // start a transaction so we don't end up with an exp in both rawExp &
    581     // newExp
     565        return false;
     566    }
     567
    582568    if (!psDBTransaction(config->dbh)) {
    583569        psError(PS_ERR_UNKNOWN, false, "database error");
     
    603589            return false;
    604590        }
     591        psFree(newExp);
    605592
    606593        // insert the rawExp object into the database
     
    612599            psError(PS_ERR_UNKNOWN, false, "database error");
    613600            psFree(rawExp);
    614             psFree(newExp);
    615601            psFree(output);
    616602            return false;
     
    618604        psFree(rawExp);
    619605
    620         // delete the newExp object from the database
    621         if (!newExpDeleteObject(config->dbh, newExp)) {
     606        // if this is a detrend image don't put it in the chip queue (and we're
     607        // done)
     608        if (detrend) {
     609            // set the state for the newExp to stop
     610            if (!pxnewExpSetState(config, exp_tag, "stop")) {
     611                // rollback
     612                if (!psDBRollback(config->dbh)) {
     613                    psError(PS_ERR_UNKNOWN, false, "database error");
     614                }
     615                psError(PS_ERR_UNKNOWN, false, "failed to change newExp.state for exp_tag: %s", exp_tag);
     616                psFree(output);
     617                return false;
     618            }
     619            continue;
     620        }
     621
     622
     623        // set the state for the newExp to stop
     624        if (!pxnewExpSetState(config, exp_tag, "stop")) {
    622625            // rollback
    623626            if (!psDBRollback(config->dbh)) {
    624627                psError(PS_ERR_UNKNOWN, false, "database error");
    625628            }
    626             psError(PS_ERR_UNKNOWN, false, "database error");
    627             psFree(newExp);
     629            psError(PS_ERR_UNKNOWN, false, "failed to change newExp.state for exp_tag: %s", exp_tag);
    628630            psFree(output);
    629631            return false;
    630632        }
    631633
    632         psFree(newExp);
    633 
    634         // if this is a detrend image don't put it in the chip queue (and we're
    635         // done)
    636         if (detrend) {
    637             continue;
    638         }
    639 
    640634        // insert an entry into the chipPendingExp table
    641         if (!chipQueueExpTag(config, exp_tag, NULL, NULL, NULL, NULL, NULL)) {
     635        // this can only be run as the newExp's state has been set to stop
     636        if (!pxchipQueueByExpTag(config, exp_tag, NULL, NULL, NULL, NULL, NULL)) {
    642637            // rollback
    643638            if (!psDBRollback(config->dbh)) {
     
    649644        }
    650645    }
    651 
    652646    psFree(output);
    653647
     
    828822
    829823
    830 static chipPendingImfileRow *rawImfileTochipPendingImfile(pxConfig *config, psS64 chip_id, rawImfileRow *rawImfile)
    831 {
    832     return chipPendingImfileRowAlloc(
     824static chipInputImfileRow *rawImfileTochipInputImfile(pxConfig *config, psS64 chip_id, rawImfileRow *rawImfile)
     825{
     826    return chipInputImfileRowAlloc(
    833827            chip_id,
    834828            rawImfile->class_id,
Note: See TracChangeset for help on using the changeset viewer.