Changeset 21308 for trunk/ippTools/src
- Timestamp:
- Feb 5, 2009, 9:35:41 AM (17 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 6 edited
-
chiptool.c (modified) (3 diffs)
-
chiptoolConfig.c (modified) (1 diff)
-
difftool.c (modified) (4 diffs)
-
difftoolConfig.c (modified) (1 diff)
-
pxchip.c (modified) (2 diffs)
-
warptool.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/chiptool.c
r20973 r21308 485 485 path_base, 486 486 code, 487 0, // chip_image_id488 487 0 // magic_ds_id 489 488 )) { … … 530 529 pxchipGetSearchArgs (config, where); // chipRun, chipProcessedImfile, rawExp 531 530 PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "=="); 531 PXOPT_COPY_S64(config->args, where, "-chip_imfile_id", "chipImfile.chip_imfile_id", "=="); 532 532 PXOPT_COPY_STR(config->args, where, "-class_id", "chipProcessedImfile.class_id", "=="); 533 533 PXOPT_COPY_STR(config->args, where, "-reduction", "chipRun.reduction", "=="); … … 542 542 if (where && psListLength(where->list)) { 543 543 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 544 psStringAppend(&query, " AND%s", whereClause);544 psStringAppend(&query, " WHERE %s", whereClause); 545 545 psFree(whereClause); 546 546 } -
trunk/ippTools/src/chiptoolConfig.c
r20244 r21308 150 150 // -processedimfile 151 151 psMetadata *processedimfileArgs = psMetadataAlloc(); 152 psMetadataAddS64(processedimfileArgs, PS_LIST_TAIL, "-chip_id", 0, "define chip ID", 0); 152 psMetadataAddS64(processedimfileArgs, PS_LIST_TAIL, "-chip_id", 0, "search by chip ID", 0); 153 psMetadataAddS64(processedimfileArgs, PS_LIST_TAIL, "-chip_imfile_id", 0, "search by chip_file_id", 0); 153 154 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-class_id", 0, "search by class ID", NULL); 154 155 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-reduction", 0, "search by reduction class", NULL); -
trunk/ippTools/src/difftool.c
r21237 r21308 239 239 warp2 ? warp2 : PS_MAX_S64, // defined or NULL 240 240 stack2 ? stack2 : PS_MAX_S64, // defined or NULL 241 tess_id 241 tess_id, 242 0 // diff_skyfile_id 242 243 )) { 243 244 if (!psDBRollback(config->dbh)) { … … 532 533 good_frac, 533 534 code, 534 0, // diff_image_id535 535 0 // magic_ds_id 536 536 )) { … … 568 568 PXOPT_COPY_S64(config->args, where, "-diff_id", "diffSkyfile.diff_id", "=="); 569 569 PXOPT_COPY_STR(config->args, where, "-skycell_id", "diffInputSkyfile.skycell_id", "=="); 570 PXOPT_COPY_S64(config->args, where, "-diff_ image_id", "diffSkyfile.diff_image_id", "==");570 PXOPT_COPY_S64(config->args, where, "-diff_skyfile_id", "diffInputSkyfile.diff_skyfile_id", "=="); 571 571 PXOPT_COPY_STR(config->args, where, "-tess_id", "diffSkyfile.tess_id", "=="); 572 572 PXOPT_COPY_S16(config->args, where, "-code", "diffSkyfile.fault", "=="); … … 834 834 template_warp_id, 835 835 template_stack_id, 836 tess_id 836 tess_id, 837 0 837 838 )) { 838 839 if (!psDBRollback(config->dbh)) { -
trunk/ippTools/src/difftoolConfig.c
r21188 r21308 115 115 psMetadataAddS64(diffskyfileArgs, PS_LIST_TAIL, "-diff_id", 0, "search by diff ID", 0); 116 116 psMetadataAddStr(diffskyfileArgs , PS_LIST_TAIL, "-skycell_id", 0, "define skycell ID", NULL); 117 psMetadataAddS64(diffskyfileArgs, PS_LIST_TAIL, "-diff_ image_id", 0, "search by diff_image_id ID", 0);117 psMetadataAddS64(diffskyfileArgs, PS_LIST_TAIL, "-diff_skyfile_id", 0, "search by diff_skyfile_id ID", 0); 118 118 psMetadataAddStr(diffskyfileArgs, PS_LIST_TAIL, "-tess_id", 0, "define tessellation ID", NULL); 119 119 psMetadataAddS64(diffskyfileArgs, PS_LIST_TAIL, "-exp_id", 0, "define exposure ID", 0); -
trunk/ippTools/src/pxchip.c
r20750 r21308 235 235 PS_ASSERT_PTR_NON_NULL(config, false); 236 236 237 if (!psDBTransaction(config->dbh)) { 238 psError(PS_ERR_UNKNOWN, false, "database error"); 239 return false; 240 } 241 242 237 243 // create a chipRun 238 244 if (!chipRunInsert(config->dbh, … … 249 255 end_stage) 250 256 ) { 257 if (!psDBRollback(config->dbh)) { 258 psError(PS_ERR_UNKNOWN, false, "database error failed to rollback transaction"); 259 } 251 260 psError(PS_ERR_UNKNOWN, false, "database error"); 252 261 return 0; 253 262 } 254 263 255 return psDBLastInsertID(config->dbh); 256 } 257 264 psS64 chip_id = psDBLastInsertID(config->dbh); 265 266 // Create rows in chipImfile table for each input exposure. 267 // This creates the chip_image_id values 268 psString query = "INSERT INTO chipImfile " 269 "SELECT %" PRId64 ", class_id, 0 FROM rawImfile WHERE exp_id = %" PRId64; 270 271 if (!p_psDBRunQuery(config->dbh, query, chip_id, exp_id)) { 272 psError(PS_ERR_UNKNOWN, false, "database error"); 273 // rollback 274 if (!psDBRollback(config->dbh)) { 275 psError(PS_ERR_UNKNOWN, false, "database error"); 276 } 277 psError(PS_ERR_UNKNOWN, false, "database error"); 278 return 0; 279 } 280 if (!psDBCommit(config->dbh)) { 281 psError(PS_ERR_UNKNOWN, false, "database error"); 282 return 0; 283 } 284 285 return chip_id; 286 } 287 -
trunk/ippTools/src/warptool.c
r20973 r21308 681 681 { 682 682 unsigned int nFail = 0; 683 psMetadata *imfiles = psMetadataAlloc(); 683 684 psMetadata *skycells = psMetadataConfigRead(NULL, &nFail, mapfile, false); 684 685 if (!skycells) { … … 689 690 psError(PS_ERR_UNKNOWN, false, "there were %d errors parsing mapfile: %s", nFail, mapfile); 690 691 psFree(skycells); 692 psFree(imfiles); 691 693 return false; 692 694 } … … 699 701 psFree(iter); 700 702 psFree(skycells); 703 psFree(imfiles); 701 704 return false; 702 705 } … … 710 713 psFree(iter); 711 714 psFree(skycells); 712 return false; 713 } 715 psFree(imfiles); 716 return false; 717 } 718 psMetadataAddS64(imfiles, PS_LIST_TAIL, row->skycell_id, PS_META_REPLACE, "", row->warp_id); 714 719 715 720 if (!warpSkyCellMapInsertObject(config->dbh, row)) { … … 726 731 psFree(iter); 727 732 psFree(skycells); 733 psFree(imfiles); 728 734 return false; 729 735 } 730 736 731 737 psFree(row); 738 } 739 psFree(iter); 740 741 // create warp_skyfile_ids for the output skyfiles 742 psString query = "INSERT INTO warpImfile VALUES(%" PRId64 ", '%s', 0)"; 743 iter = psMetadataIteratorAlloc(imfiles, 0, NULL); 744 while ((item = psMetadataGetAndIncrement(iter))) { 745 psString skycell_id = item->name; 746 psS64 warp_id = item->data.S64; 747 748 if (!p_psDBRunQuery(config->dbh, query, warp_id, skycell_id)) { 749 psError(PS_ERR_UNKNOWN, false, "database error"); 750 return false; 751 } 732 752 } 733 753 psFree(iter); 734 754 psFree(skycells); 755 psFree(imfiles); 735 756 736 757 return true; … … 940 961 !accept, 941 962 code, 942 0, // warp_image_id943 963 0 // magic_ds_id 944 964 )) {
Note:
See TracChangeset
for help on using the changeset viewer.
