Changeset 18336 for trunk/ippTools/src/chiptool.c
- Timestamp:
- Jun 26, 2008, 3:39:54 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/chiptool.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/chiptool.c
r18321 r18336 106 106 PS_ASSERT_PTR_NON_NULL(config, NULL); 107 107 108 PXOPT_LOOKUP_S TR(exp_id, config->args, "-exp_id", false, false);108 PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", false, false); 109 109 110 110 psMetadata *where = psMetadataAlloc(); 111 // convert exp_id into a psS64 112 if (exp_id) { 113 if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", 0, "==", (psS64)atoll(exp_id))) { 114 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 115 psFree(where); 116 return false; 117 } 118 } 119 111 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 120 112 PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "=="); 121 113 PXOPT_COPY_STR(config->args, where, "-inst", "camera", "=="); … … 263 255 264 256 psMetadata *where = psMetadataAlloc(); 265 PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false); 266 // convert chip_id into a psS64 267 if (chip_id) { 268 if (!psMetadataAddS64(where, PS_LIST_TAIL, "chip_id", 0, "==", (psS64)atoll(chip_id))) { 269 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id"); 270 psFree(where); 271 return false; 272 } 273 } 274 275 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false); 276 // convert exp_id into a psS64 277 if (exp_id) { 278 if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", 0, "==", (psS64)atoll(exp_id))) { 279 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 280 psFree(where); 281 return false; 282 } 283 } 284 285 PXOPT_COPY_STR(config->args, where, "-chip_id", "chip_id", "=="); 286 PXOPT_COPY_STR(config->args, where, "-exp_id", "exp_id", "=="); 257 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 258 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 287 259 PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "=="); 288 260 PXOPT_COPY_STR(config->args, where, "-inst", "camera", "=="); … … 371 343 372 344 psMetadata *where = psMetadataAlloc(); 373 PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false); 374 // convert chip_id into a psS64 375 if (chip_id) { 376 if (!psMetadataAddS64(where, PS_LIST_TAIL, "chipRun.chip_id", 0, "==", (psS64)atoll(chip_id))) { 377 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id"); 378 psFree(where); 379 return false; 380 } 381 } 382 383 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false); 384 // convert exp_id into a psS64 385 if (exp_id) { 386 if (!psMetadataAddS64(where, PS_LIST_TAIL, "rawExp.exp_id", 0, "==", (psS64)atoll(exp_id))) { 387 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 388 psFree(where); 389 return false; 390 } 391 } 392 345 PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "=="); 346 PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.exp_id", "=="); 393 347 PXOPT_COPY_STR(config->args, where, "-class_id", "rawImfile.class_id", "=="); 394 348 PXOPT_COPY_STR(config->args, where, "-inst", "rawExp.telescope", "=="); … … 433 387 } 434 388 435 if (!convertIdToStr(output)) {436 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");437 psFree(output);438 return false;439 }440 441 389 // negative simple so the default is true 442 390 if (!ippdbPrintMetadatas(stdout, output, "chipPendingImfile", !simple)) { … … 457 405 458 406 // chip_id, ext_tag, class_id are required 459 PXOPT_LOOKUP_S TR(chip_id, config->args, "-chip_id", true, false);460 PXOPT_LOOKUP_S TR(exp_id, config->args, "-exp_id", true, false);407 PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", true, false); 408 PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", true, false); 461 409 PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false); 462 410 … … 498 446 499 447 if (!chipProcessedImfileInsert(config->dbh, 500 (psS64)atoll(chip_id),501 (psS64)atoll(exp_id),448 chip_id, 449 exp_id, 502 450 class_id, 503 451 uri, … … 569 517 570 518 psMetadata *where = psMetadataAlloc(); 571 PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false); 572 // convert chip_id into a psS64 573 if (chip_id) { 574 if (!psMetadataAddS64(where, PS_LIST_TAIL, "chipRun.chip_id", 0, "==", (psS64)atoll(chip_id))) { 575 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id"); 576 psFree(where); 577 return false; 578 } 579 } 580 581 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false); 582 // convert exp_id into a psS64 583 if (exp_id) { 584 if (!psMetadataAddS64(where, PS_LIST_TAIL, "rawExp.exp_id", 0, "==", (psS64)atoll(exp_id))) { 585 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 586 psFree(where); 587 return false; 588 } 589 } 590 519 PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "=="); 520 PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.chip_id", "=="); 591 521 PXOPT_COPY_STR(config->args, where, "-class_id", "rawImfile.class_id", "=="); 592 522 PXOPT_COPY_STR(config->args, where, "-inst", "rawExp.telescope", "=="); … … 639 569 } 640 570 641 if (!convertIdToStr(output)) {642 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");643 psFree(output);644 return false;645 }646 647 571 // negative simple so the default is true 648 572 if (!ippdbPrintMetadatas(stdout, output, "chipProcessedImfile", !simple)) { … … 662 586 663 587 psMetadata *where = psMetadataAlloc(); 664 PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false); 665 // convert chip_id into a psS64 666 if (chip_id) { 667 if (!psMetadataAddS64(where, PS_LIST_TAIL, "chip_id", 0, "==", (psS64)atoll(chip_id))) { 668 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id"); 669 psFree(where); 670 return false; 671 } 672 } 673 674 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false); 675 // convert exp_id into a psS64 676 if (exp_id) { 677 if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", 0, "==", (psS64)atoll(exp_id))) { 678 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 679 psFree(where); 680 return false; 681 } 682 } 683 588 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 589 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 684 590 PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "=="); 685 591 PXOPT_COPY_STR(config->args, where, "-inst", "camera", "=="); … … 832 738 } 833 739 834 if (!convertIdToStr(output)) {835 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");836 psFree(output);837 return false;838 }839 840 740 // negative simple so the default is true 841 741 if (!ippdbPrintMetadatas(stdout, output, "chipMask", !simple)) { … … 905 805 } 906 806 907 if (!convertIdToStr(output)) {908 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");909 psFree(output);910 return false;911 }912 913 807 // negative simple so the default is true 914 808 if (!ippdbPrintMetadatas(stdout, output, "chipUnmask", !simple)) { … … 989 883 } 990 884 991 if (!convertIdToStr(output)) {992 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");993 psFree(output);994 return false;995 }996 997 885 // negative simple so the default is true 998 886 if (!ippdbPrintMetadatas(stdout, output, "chipPendingCleanup", !simple)) { … … 1054 942 psFree(output); 1055 943 return true; 1056 }1057 1058 if (!convertIdToStr(output)) {1059 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");1060 psFree(output);1061 return false;1062 944 } 1063 945
Note:
See TracChangeset
for help on using the changeset viewer.
