Changeset 12188
- Timestamp:
- Mar 2, 2007, 12:42:55 PM (19 years ago)
- Location:
- trunk/ippTools
- Files:
-
- 2 added
- 7 edited
-
scripts/camtest.sh (modified) (1 diff)
-
share/Makefile.am (modified) (1 diff)
-
share/camtool_queue_chip_id.sql (added)
-
src/Makefile.am (modified) (1 diff)
-
src/camqueue.c (added)
-
src/camtool.c (modified) (3 diffs)
-
src/camtool.h (modified) (1 diff)
-
src/camtoolConfig.c (modified) (1 diff)
-
src/chiptool.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/scripts/camtest.sh
r12131 r12188 8 8 camtool -pendingimfile || exit 1 9 9 10 camtool -addprocessedexp -cam_id 1 -uri file:// camp -recip myrecipe-bg 1 -bg_stdev 2 -bg_mean_stdev 3 -sigma_ra 1 -sigma_dec 2 -nastro 42 -path_base file:///foo -zp_mean 1 -zp_stdev 2 || exit 111 camtool -addprocessedexp -cam_id 2 -uri file:// camp -recip myrecipe-bg 1 -bg_stdev 2 -bg_mean_stdev 3 -sigma_ra 1 -sigma_dec 2 -nastro 42 -path_base file:///foo -zp_mean 1 -zp_stdev 2 || exit 110 camtool -addprocessedexp -cam_id 1 -uri file:///cam -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -sigma_ra 1 -sigma_dec 2 -nastro 42 -path_base file:///foo -zp_mean 1 -zp_stdev 2 || exit 1 11 camtool -addprocessedexp -cam_id 2 -uri file:///cam -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -sigma_ra 1 -sigma_dec 2 -nastro 42 -path_base file:///foo -zp_mean 1 -zp_stdev 2 || exit 1 -
trunk/ippTools/share/Makefile.am
r12184 r12188 1 1 dist_pkgdata_DATA = \ 2 camtool_queue_chip_id.sql \ 2 3 chiptool_completely_processed_exp.sql \ 4 chiptool_find_rawexp.sql \ 3 5 chiptool_find_unprocessed_imfile.pl \ 4 6 chiptool_pendingimfile.sql \ 5 7 chiptool_processedimfile.sql \ 8 chiptool_queuerawexp.sql \ 9 chiptool_queuerawimfile.sql \ 10 regtool_find_unprocessed_exp.sql \ 11 regtool_find_unprocessed_imfile.sql \ 12 regtool_pendingexp.sql \ 6 13 regtool_pendingimfile.sql \ 7 regtool_find_unprocessed_exp.sql \8 14 regtool_processedexp.sql \ 9 regtool_find_unprocessed_imfile.sql \ 10 regtool_processedimfile.sql \ 11 regtool_pendingexp.sql \ 12 chiptool_queuerawexp.sql \ 13 chiptool_queuerawimfile.sql 14 chiptool_find_rawexp.sql 15 regtool_processedimfile.sql -
trunk/ippTools/src/Makefile.am
r12177 r12188 51 51 pxio.c \ 52 52 pxtag.c \ 53 chipqueuerawexp.c 53 chipqueuerawexp.c \ 54 camqueue.c 54 55 55 56 # for pxtools.h -
trunk/ippTools/src/camtool.c
r12176 r12188 293 293 } 294 294 295 psString recipe = psMetadataLookupStr(&status, config->args, "-recip");296 if (!status) {297 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -recip");298 return false;299 }300 if (!recipe) {301 psError(PS_ERR_UNKNOWN, true, "-recip is required");302 return false;303 }304 305 295 psF64 bg = psMetadataLookupF64(&status, config->args, "-bg"); 306 296 if (!status) { … … 428 418 pendingRow->chip_id, 429 419 pendingRow->label, 420 pendingRow->recipe, 421 pendingRow->expgroup, 422 pendingRow->dvodb, 430 423 uri, 431 recipe,432 424 bg, 433 425 bg_stdev, … … 439 431 zp_mean, 440 432 zp_stdev, 441 code, 442 pendingRow->expgroup, 443 pendingRow->dvodb 433 code 444 434 ); 445 435 -
trunk/ippTools/src/camtool.h
r12025 r12188 37 37 pxConfig *camtoolConfig(pxConfig *config, int argc, char **argv); 38 38 39 bool camQueueChipID(pxConfig *config, 40 psS64 chip_id, 41 psString label, 42 psString recipe, 43 psString expgroup, 44 psString dvodb); 45 39 46 #endif // CAMTOOL_H -
trunk/ippTools/src/camtoolConfig.c
r12131 r12188 78 78 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-uri", 0, 79 79 "define URI (required)", NULL); 80 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-recip", 0,81 "define recipe (required)", NULL);82 80 psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-bg", 0, 83 81 "define exposue background (required)", NAN); -
trunk/ippTools/src/chiptool.c
r12184 r12188 29 29 #include "pxdata.h" 30 30 #include "chiptool.h" 31 #include "camtool.h" 31 32 32 33 static bool queuerawexpMode(pxConfig *config); … … 41 42 static chipProcessedImfileRow *chipPendingToProcessedImfile(pxConfig *config, chipPendingImfileRow *imfile); 42 43 static chipProcessedExpRow *chipPendingToProcessedExp(pxConfig *config, chipPendingExpRow *pendingExp); 43 static camPendingExpRow *chipPendingTocamPendingExp(pxConfig *config, chipPendingExpRow *pendingExp);44 44 static bool chipProcessedCompleteExp(pxConfig *config); 45 45 … … 748 748 for (long i = 0; i < psArrayLength(output); i++) { 749 749 psMetadata *row = output->data[i]; 750 750 751 // convert metadata into a chipPendingExp object 751 chipPendingExpRow *object = chipPendingExpObjectFromMetadata(row); 752 // do both *Exp type conversion first so we don't insert one and then 753 // have to rollback the change as the 2nd failed 752 chipPendingExpRow *pendingExp = chipPendingExpObjectFromMetadata(row); 753 if (!pendingExp) { 754 psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into chipPendingExp"); 755 psFree(output); 756 return false; 757 } 758 754 759 // convert chipPendingExp object into a chipProcesseExp object 755 chipProcessedExpRow *processedExp = chipPendingToProcessedExp(config, object);760 chipProcessedExpRow *processedExp = chipPendingToProcessedExp(config, pendingExp); 756 761 if (!processedExp) { 757 762 psError(PS_ERR_UNKNOWN, false, "failed to convert chipPendingExp to chipProcessedExp"); 758 psFree(object); 759 psFree(output); 760 return false; 761 } 762 // convert chipPendingExp object into a camPendingExp object 763 camPendingExpRow *pendingExp = chipPendingTocamPendingExp(config, object); 764 if (!processedExp) { 765 psError(PS_ERR_UNKNOWN, false, "failed to convert chipPendingExp to camPendingExp"); 763 psFree(pendingExp); 764 psFree(output); 765 return false; 766 } 767 768 // delete the chipPendingExp object from the database 769 if (!chipPendingExpDeleteObject(config->dbh, pendingExp)) { 770 // there must be atleast 1 Imfile to get this far 771 psError(PS_ERR_UNKNOWN, false, "database error"); 766 772 psFree(processedExp); 767 psFree(object); 768 psFree(output); 769 return false; 770 } 773 psFree(pendingExp); 774 psFree(output); 775 return false; 776 } 777 psFree(pendingExp); 778 771 779 // insert chipProccessedExp object into the database 772 780 if (!chipProcessedExpInsertObject(config->dbh, processedExp)) { 773 781 psError(PS_ERR_UNKNOWN, false, "database error"); 774 782 psFree(processedExp); 775 psFree(pendingExp); 776 psFree(object); 777 psFree(output); 778 return false; 779 } 783 psFree(output); 784 return false; 785 } 786 787 // camQueueChipID() can only be run after the chipProcessedExp entry 788 // has been inserted. 789 // queue the chip_id in the camPendingExp table 790 if (!camQueueChipID(config, 791 processedExp->chip_id, 792 processedExp->label, 793 processedExp->recipe, 794 processedExp->expgroup, 795 processedExp->dvodb 796 )) { 797 // rollback 798 if (!psDBRollback(config->dbh)) { 799 psError(PS_ERR_UNKNOWN, false, "database error"); 800 } 801 psError(PS_ERR_UNKNOWN, false, "failed to queue camPendingExp"); 802 psFree(processedExp); 803 psFree(output); 804 return false; 805 } 806 780 807 psFree(processedExp); 781 // insert camPendingExp object into the database782 if (!camPendingExpInsertObject(config->dbh, pendingExp)) {783 psError(PS_ERR_UNKNOWN, false, "database error");784 psFree(pendingExp);785 psFree(object);786 psFree(output);787 return false;788 }789 psFree(pendingExp);790 // delete the chipPendingExp object from the database791 if (!chipPendingExpDeleteObject(config->dbh, object)) {792 // there must be atleast 1 Imfile to get this far793 psError(PS_ERR_UNKNOWN, false, "database error");794 psFree(object);795 psFree(output);796 return false;797 }798 psFree(object);799 808 } 800 809 … … 875 884 pendingExp->guide_id, 876 885 pendingExp->label, 886 pendingExp->recipe, 877 887 pendingExp->expgroup, 878 888 pendingExp->dvodb 879 889 ); 880 890 } 881 882 883 static camPendingExpRow *chipPendingTocamPendingExp(pxConfig *config, chipPendingExpRow *pendingExp)884 {885 PS_ASSERT_PTR_NON_NULL(pendingExp, NULL);886 887 return camPendingExpRowAlloc(888 0, // cam version, assigned by db889 pendingExp->chip_id,890 pendingExp->label,891 pendingExp->expgroup,892 pendingExp->dvodb893 );894 }
Note:
See TracChangeset
for help on using the changeset viewer.
