Changeset 18357 for branches/cleanup/ippTools/src/chiptool.c
- Timestamp:
- Jun 29, 2008, 2:44:04 PM (18 years ago)
- File:
-
- 1 edited
-
branches/cleanup/ippTools/src/chiptool.c (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cleanup/ippTools/src/chiptool.c
r18154 r18357 110 110 PS_ASSERT_PTR_NON_NULL(config, NULL); 111 111 112 PXOPT_LOOKUP_S TR(exp_id, config->args, "-exp_id", false, false);112 PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", false, false); 113 113 114 114 psMetadata *where = psMetadataAlloc(); 115 // convert exp_id into a psS64 116 if (exp_id) { 117 if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", 0, "==", (psS64)atoll(exp_id))) { 118 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 119 psFree(where); 120 return false; 121 } 122 } 123 115 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 124 116 PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "=="); 125 117 PXOPT_COPY_STR(config->args, where, "-inst", "camera", "=="); … … 158 150 PXOPT_COPY_F32(config->args, where, "-solang_min", "solang", ">="); 159 151 PXOPT_COPY_F32(config->args, where, "-solang_max", "solang", "<"); 152 PXOPT_COPY_STR(config->args, where, "-comment", "comment", "LIKE"); 160 153 161 154 if (!psListLength(where->list) … … 266 259 267 260 psMetadata *where = psMetadataAlloc(); 268 PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false); 269 // convert chip_id into a psS64 270 if (chip_id) { 271 if (!psMetadataAddS64(where, PS_LIST_TAIL, "chip_id", 0, "==", (psS64)atoll(chip_id))) { 272 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id"); 273 psFree(where); 274 return false; 275 } 276 } 277 278 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false); 279 // convert exp_id into a psS64 280 if (exp_id) { 281 if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", 0, "==", (psS64)atoll(exp_id))) { 282 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 283 psFree(where); 284 return false; 285 } 286 } 287 288 PXOPT_COPY_STR(config->args, where, "-chip_id", "chip_id", "=="); 289 PXOPT_COPY_STR(config->args, where, "-exp_id", "exp_id", "=="); 261 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 262 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 290 263 PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "=="); 291 264 PXOPT_COPY_STR(config->args, where, "-inst", "camera", "=="); … … 374 347 375 348 psMetadata *where = psMetadataAlloc(); 376 PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false); 377 // convert chip_id into a psS64 378 if (chip_id) { 379 if (!psMetadataAddS64(where, PS_LIST_TAIL, "chipRun.chip_id", 0, "==", (psS64)atoll(chip_id))) { 380 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id"); 381 psFree(where); 382 return false; 383 } 384 } 385 386 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false); 387 // convert exp_id into a psS64 388 if (exp_id) { 389 if (!psMetadataAddS64(where, PS_LIST_TAIL, "rawExp.exp_id", 0, "==", (psS64)atoll(exp_id))) { 390 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 391 psFree(where); 392 return false; 393 } 394 } 395 349 PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "=="); 350 PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.exp_id", "=="); 396 351 PXOPT_COPY_STR(config->args, where, "-class_id", "rawImfile.class_id", "=="); 397 352 PXOPT_COPY_STR(config->args, where, "-inst", "rawExp.telescope", "=="); … … 436 391 } 437 392 438 if (!convertIdToStr(output)) {439 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");440 psFree(output);441 return false;442 }443 444 393 // negative simple so the default is true 445 394 if (!ippdbPrintMetadatas(stdout, output, "chipPendingImfile", !simple)) { … … 460 409 461 410 // chip_id, ext_tag, class_id are required 462 PXOPT_LOOKUP_S TR(chip_id, config->args, "-chip_id", true, false);463 PXOPT_LOOKUP_S TR(exp_id, config->args, "-exp_id", true, false);411 PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", true, false); 412 PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", true, false); 464 413 PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false); 465 414 … … 501 450 502 451 if (!chipProcessedImfileInsert(config->dbh, 503 (psS64)atoll(chip_id),504 (psS64)atoll(exp_id),452 chip_id, 453 exp_id, 505 454 class_id, 506 455 uri, … … 572 521 573 522 psMetadata *where = psMetadataAlloc(); 574 PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false); 575 // convert chip_id into a psS64 576 if (chip_id) { 577 if (!psMetadataAddS64(where, PS_LIST_TAIL, "chipRun.chip_id", 0, "==", (psS64)atoll(chip_id))) { 578 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id"); 579 psFree(where); 580 return false; 581 } 582 } 583 584 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false); 585 // convert exp_id into a psS64 586 if (exp_id) { 587 if (!psMetadataAddS64(where, PS_LIST_TAIL, "rawExp.exp_id", 0, "==", (psS64)atoll(exp_id))) { 588 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 589 psFree(where); 590 return false; 591 } 592 } 593 523 PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "=="); 524 PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.chip_id", "=="); 594 525 PXOPT_COPY_STR(config->args, where, "-class_id", "rawImfile.class_id", "=="); 595 526 PXOPT_COPY_STR(config->args, where, "-inst", "rawExp.telescope", "=="); … … 642 573 } 643 574 644 if (!convertIdToStr(output)) {645 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");646 psFree(output);647 return false;648 }649 650 575 // negative simple so the default is true 651 576 if (!ippdbPrintMetadatas(stdout, output, "chipProcessedImfile", !simple)) { … … 665 590 666 591 psMetadata *where = psMetadataAlloc(); 667 PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false); 668 // convert chip_id into a psS64 669 if (chip_id) { 670 if (!psMetadataAddS64(where, PS_LIST_TAIL, "chip_id", 0, "==", (psS64)atoll(chip_id))) { 671 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id"); 672 psFree(where); 673 return false; 674 } 675 } 676 677 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false); 678 // convert exp_id into a psS64 679 if (exp_id) { 680 if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", 0, "==", (psS64)atoll(exp_id))) { 681 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 682 psFree(where); 683 return false; 684 } 685 } 686 592 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 593 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 687 594 PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "=="); 688 595 PXOPT_COPY_STR(config->args, where, "-inst", "camera", "=="); … … 835 742 } 836 743 837 if (!convertIdToStr(output)) {838 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");839 psFree(output);840 return false;841 }842 843 744 // negative simple so the default is true 844 745 if (!ippdbPrintMetadatas(stdout, output, "chipMask", !simple)) { … … 908 809 } 909 810 910 if (!convertIdToStr(output)) {911 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");912 psFree(output);913 return false;914 }915 916 811 // negative simple so the default is true 917 812 if (!ippdbPrintMetadatas(stdout, output, "chipUnmask", !simple)) { … … 992 887 } 993 888 994 if (!convertIdToStr(output)) {995 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");996 psFree(output);997 return false;998 }999 1000 889 // negative simple so the default is true 1001 890 if (!ippdbPrintMetadatas(stdout, output, "chipPendingCleanupRun", !simple)) { … … 1063 952 } 1064 953 1065 if (!convertIdToStr(output)) {1066 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");1067 psFree(output);1068 return false;1069 }1070 1071 954 // negative simple so the default is true 1072 955 if (!ippdbPrintMetadatas(stdout, output, "chipPendingCleanupImfile", !simple)) { … … 1130 1013 } 1131 1014 1132 if (!convertIdToStr(output)) {1133 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");1134 psFree(output);1135 return false;1136 }1137 1138 1015 // negative simple so the default is true 1139 1016 if (!ippdbPrintMetadatas(stdout, output, "chipDoneCleanup", !simple)) { … … 1203 1080 psFree(output); 1204 1081 return true; 1205 }1206 1207 if (!convertIdToStr(output)) {1208 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");1209 psFree(output);1210 return false;1211 1082 } 1212 1083
Note:
See TracChangeset
for help on using the changeset viewer.
