Changeset 18336 for trunk/ippTools/src/warptool.c
- Timestamp:
- Jun 26, 2008, 3:39:54 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/warptool.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/warptool.c
r18029 r18336 111 111 112 112 // required options 113 PXOPT_LOOKUP_S TR(fake_id, config->args, "-fake_id", true, false);113 PXOPT_LOOKUP_S64(fake_id, config->args, "-fake_id", true, false); 114 114 PXOPT_LOOKUP_STR(mode, config->args, "-mode", true, false); 115 115 // check mode … … 133 133 warpRunRow *warpRun = warpRunRowAlloc( 134 134 0, // ID 135 (psS64)atoll(fake_id),135 fake_id, 136 136 mode, 137 137 "run", // state … … 175 175 PS_ASSERT_PTR_NON_NULL(config, false); 176 176 177 PXOPT_LOOKUP_STR(warp_id, config->args, "-warp_id", false, false);178 PXOPT_LOOKUP_STR(fake_id, config->args, "-fake_id", false, false);179 PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false);180 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false);181 182 177 psMetadata *where = psMetadataAlloc(); 183 // convert warp_id into a psS64 184 if (warp_id) { 185 if (!psMetadataAddS64(where, PS_LIST_TAIL, "warp_id", 0, "==", (psS64)atoll(warp_id))) { 186 psError(PS_ERR_UNKNOWN, false, "failed to add item warp_id"); 187 psFree(where); 188 return false; 189 } 190 } 191 192 // convert fake_id into a psS64 193 if (fake_id) { 194 if (!psMetadataAddS64(where, PS_LIST_TAIL, "fake_id", 0, "==", (psS64)atoll(fake_id))) { 195 psError(PS_ERR_UNKNOWN, false, "failed to add item fake_id"); 196 psFree(where); 197 return false; 198 } 199 } 200 201 // convert chip_id into a psS64 202 if (chip_id) { 203 if (!psMetadataAddS64(where, PS_LIST_TAIL, "chip_id", 0, "==", (psS64)atoll(chip_id))) { 204 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id"); 205 psFree(where); 206 return false; 207 } 208 } 209 210 // convert exp_id into a psS64 211 if (exp_id) { 212 if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", 0, "==", (psS64)atoll(exp_id))) { 213 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 214 psFree(where); 215 return false; 216 } 217 } 218 178 PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "=="); 179 PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "=="); 180 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 181 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 219 182 PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "=="); 220 183 PXOPT_COPY_STR(config->args, where, "-inst", "camera", "=="); … … 350 313 351 314 if (psArrayLength(output)) { 352 if (!convertIdToStr(output)) {353 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");354 psFree(output);355 return false;356 }357 358 315 // negative simple so the default is true 359 316 if (!ippdbPrintMetadatas(stdout, output, "warpRun", !simple)) { … … 425 382 426 383 if (psArrayLength(output)) { 427 if (!convertIdToStr(output)) {428 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");429 psFree(output);430 return false;431 }432 433 384 // negative simple so the default is true 434 385 if (!ippdbPrintMetadatas(stdout, output, "warpInputImfile", !simple)) { … … 500 451 501 452 if (psArrayLength(output)) { 502 if (!convertIdToStr(output)) {503 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");504 psFree(output);505 return false;506 }507 508 453 // negative simple so the default is true 509 454 if (!ippdbPrintMetadatas(stdout, output, "warpRun", !simple)) { … … 525 470 526 471 PXOPT_LOOKUP_STR(mapfile, config->args, "-mapfile", false, false); 527 PXOPT_LOOKUP_S TR(warp_id, config->args, "-warp_id", false, false);472 PXOPT_LOOKUP_S64(warp_id, config->args, "-warp_id", false, false); 528 473 PXOPT_LOOKUP_S16(code, config->args, "-code", false, false); 529 474 … … 544 489 } else { 545 490 warpSkyCellMapInsert(config->dbh, 546 (psS64)atoll(warp_id),491 warp_id, 547 492 NULL, // skycell_id 548 493 NULL, // tess_id … … 677 622 678 623 if (psArrayLength(output)) { 679 if (!convertIdToStr(output)) {680 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");681 psFree(output);682 return false;683 }684 685 624 // negative simple so the default is true 686 625 if (!ippdbPrintMetadatas(stdout, output, "warpSkyCellMap", !simple)) { … … 752 691 753 692 if (psArrayLength(output)) { 754 if (!convertIdToStr(output)) {755 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");756 psFree(output);757 return false;758 }759 760 693 // negative simple so the default is true 761 694 if (!ippdbPrintMetadatas(stdout, output, "warpPendingSkyCell", !simple)) { … … 776 709 PS_ASSERT_PTR_NON_NULL(config, false); 777 710 778 PXOPT_LOOKUP_S TR(warp_id, config->args, "-warp_id", true, false);711 PXOPT_LOOKUP_S64(warp_id, config->args, "-warp_id", true, false); 779 712 PXOPT_LOOKUP_STR(skycell_id, config->args, "-skycell_id", true, false); 780 713 PXOPT_LOOKUP_STR(tess_id, config->args, "-tess_id", true, false); … … 806 739 // XXX need to validate that this coresponds to an warpInputImfile 807 740 if (!warpSkyfileInsert(config->dbh, 808 (psS64)atoll(warp_id),741 warp_id, 809 742 skycell_id, 810 743 tess_id, … … 1009 942 1010 943 if (psArrayLength(output)) { 1011 if (!convertIdToStr(output)) {1012 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");1013 psFree(output);1014 return false;1015 }1016 1017 944 // negative simple so the default is true 1018 945 if (!ippdbPrintMetadatas(stdout, output, "warpSkyfile", !simple)) { … … 1033 960 PS_ASSERT_PTR_NON_NULL(config, false); 1034 961 1035 PXOPT_LOOKUP_STR(warp_id, config->args, "-warp_id", false, false);1036 PXOPT_LOOKUP_STR(fake_id, config->args, "-fake_id", false, false);1037 PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false);1038 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false);1039 1040 962 psMetadata *where = psMetadataAlloc(); 1041 // convert warp_id into a psS64 1042 if (warp_id) { 1043 if (!psMetadataAddS64(where, PS_LIST_TAIL, "warpRun.warp_id", 0, "==", (psS64)atoll(warp_id))) { 1044 psError(PS_ERR_UNKNOWN, false, "failed to add item warp_id"); 1045 psFree(where); 1046 return false; 1047 } 1048 } 1049 963 PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "=="); 964 PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "=="); 965 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 966 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 1050 967 PXOPT_COPY_STR(config->args, where, "-skycell_id", "skycell_id", "=="); 1051 968 PXOPT_COPY_STR(config->args, where, "-tess_id", "tess_id", "=="); 1052 1053 // convert fake_id into a psS641054 if (fake_id) {1055 if (!psMetadataAddS64(where, PS_LIST_TAIL, "fakeRun.fake_id", 0, "==", (psS64)atoll(fake_id))) {1056 psError(PS_ERR_UNKNOWN, false, "failed to add item fake_id");1057 psFree(where);1058 return false;1059 }1060 }1061 1062 // convert chip_id into a psS641063 if (chip_id) {1064 if (!psMetadataAddS64(where, PS_LIST_TAIL, "chipRun.chip_id", 0, "==", (psS64)atoll(chip_id))) {1065 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id");1066 psFree(where);1067 return false;1068 }1069 }1070 1071 // convert exp_id into a psS641072 if (exp_id) {1073 if (!psMetadataAddS64(where, PS_LIST_TAIL, "rawExp.exp_id", 0, "==", (psS64)atoll(exp_id))) {1074 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");1075 psFree(where);1076 return false;1077 }1078 }1079 969 1080 970 // XXX These may need to be updated with the table name? … … 1193 1083 } 1194 1084 1195 if (!convertIdToStr(output)) {1196 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");1197 psFree(output);1198 return false;1199 }1200 1201 1085 // negative simple so the default is true 1202 1086 if (!ippdbPrintMetadatas(stdout, output, "warpMask", !simple)) {
Note:
See TracChangeset
for help on using the changeset viewer.
