Changeset 14018 for trunk/ippTools/src/regtool.c
- Timestamp:
- Jul 5, 2007, 10:15:41 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/regtool.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/regtool.c
r13617 r14018 44 44 // static guidePendingExpRow *newToP1PendingExp(newExpRow *newExp); 45 45 //static chipPendingExpRow *newTochipPendingExp(pxConfig *config, newExpRow *newExp); 46 //static chip PendingImfileRow *rawImfileTochipPendingImfile(pxConfig *config, psS64 chip_id, rawImfileRow *rawImfile);46 //static chipInputImfileRow *rawImfileTochipInputImfile(pxConfig *config, psS64 chip_id, rawImfileRow *rawImfile); 47 47 48 48 static rawExpRow *newToRawExp(pxConfig *config, newExpRow *exp); … … 282 282 return false; 283 283 } 284 psFree(object); 284 285 // insert the rawImfile object into the database 285 286 if (!rawImfileInsertObject(config->dbh, imfile)) { … … 290 291 psError(PS_ERR_UNKNOWN, false, "failed to insert row into the database"); 291 292 psFree(imfile); 292 psFree(object);293 293 psFree(output); 294 294 return false; 295 295 } 296 296 psFree(imfile); 297 // remove the neImfile object from the database298 if (!newImfileDeleteObject(config->dbh, object)) {299 // rollback300 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);309 297 } 310 298 … … 573 561 } 574 562 if (!psArrayLength(output)) { 575 ps Trace("regtool", PS_LOG_INFO, "norows found");563 psError(PS_ERR_UNKNOWN, false, "no pending newExp rows found"); 576 564 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 582 568 if (!psDBTransaction(config->dbh)) { 583 569 psError(PS_ERR_UNKNOWN, false, "database error"); … … 603 589 return false; 604 590 } 591 psFree(newExp); 605 592 606 593 // insert the rawExp object into the database … … 612 599 psError(PS_ERR_UNKNOWN, false, "database error"); 613 600 psFree(rawExp); 614 psFree(newExp);615 601 psFree(output); 616 602 return false; … … 618 604 psFree(rawExp); 619 605 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")) { 622 625 // rollback 623 626 if (!psDBRollback(config->dbh)) { 624 627 psError(PS_ERR_UNKNOWN, false, "database error"); 625 628 } 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); 628 630 psFree(output); 629 631 return false; 630 632 } 631 633 632 psFree(newExp);633 634 // if this is a detrend image don't put it in the chip queue (and we're635 // done)636 if (detrend) {637 continue;638 }639 640 634 // 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)) { 642 637 // rollback 643 638 if (!psDBRollback(config->dbh)) { … … 649 644 } 650 645 } 651 652 646 psFree(output); 653 647 … … 828 822 829 823 830 static chip PendingImfileRow *rawImfileTochipPendingImfile(pxConfig *config, psS64 chip_id, rawImfileRow *rawImfile)831 { 832 return chip PendingImfileRowAlloc(824 static chipInputImfileRow *rawImfileTochipInputImfile(pxConfig *config, psS64 chip_id, rawImfileRow *rawImfile) 825 { 826 return chipInputImfileRowAlloc( 833 827 chip_id, 834 828 rawImfile->class_id,
Note:
See TracChangeset
for help on using the changeset viewer.
