Changeset 16100
- Timestamp:
- Jan 16, 2008, 3:26:27 PM (18 years ago)
- File:
-
- 1 edited
-
branches/end_stage/ippTools/src/difftool.c (modified) (21 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/end_stage/ippTools/src/difftool.c
r15415 r16100 97 97 98 98 // required options 99 bool status = false; 100 psString workdir = psMetadataLookupStr(&status, config->args, "-workdir"); 101 if (!status) { 102 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -workdir"); 103 return false; 104 } 105 if (!workdir) { 106 psError(PS_ERR_UNKNOWN, true, "-workdir is required"); 107 return false; 108 } 109 110 psString skycell_id = psMetadataLookupStr(&status, config->args, "-skycell_id"); 111 if (!status) { 112 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -skycell_id"); 113 return false; 114 } 115 if (!skycell_id) { 116 psError(PS_ERR_UNKNOWN, true, "-skycell_id is required"); 117 return false; 118 } 119 120 psString tess_id = psMetadataLookupStr(&status, config->args, "-tess_id"); 121 if (!status) { 122 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tess_id"); 123 return false; 124 } 125 if (!tess_id) { 126 psError(PS_ERR_UNKNOWN, true, "-tess_id is required"); 127 return false; 128 } 99 PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false); 100 PXOPT_LOOKUP_STR(skycell_id, config->args, "-skycell_id", true, false); 101 PXOPT_LOOKUP_STR(tess_id, config->args, "-tess_id", true, false); 102 103 // optional 104 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 129 105 130 106 psTime *registered = NULL; 131 107 { 108 bool status; 132 109 psString registeredStr = psMetadataLookupStr(&status, config->args, "-registered"); 133 110 if (!status) { … … 166 143 run->diff_id = psDBLastInsertID(config->dbh); 167 144 168 bool simple = false;169 {170 bool status = false;171 simple = psMetadataLookupBool(&status, config->args, "-simple");172 if (!status) {173 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");174 psFree(run);175 return false;176 }177 }178 179 145 if (!diffRunPrintObject(stdout, run, !simple)) { 180 146 psError(PS_ERR_UNKNOWN, false, "failed to print object"); … … 193 159 PS_ASSERT_PTR_NON_NULL(config, false); 194 160 195 bool status = false; 196 psString diff_id = psMetadataLookupStr(&status, config->args, "-diff_id"); 197 if (!status) { 198 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -diff_id"); 199 return false; 200 } 201 if (!diff_id) { 202 psError(PS_ERR_UNKNOWN, true, "-diff_id is required"); 203 return false; 204 } 205 206 psString state = psMetadataLookupStr(&status, config->args, "-state"); 207 if (!status) { 208 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -state"); 209 return false; 210 } 211 if (!state) { 212 psError(PS_ERR_UNKNOWN, true, "-state is required"); 213 return false; 214 } 161 // required options 162 PXOPT_LOOKUP_STR(diff_id, config->args, "-diff_id", true, false); 163 PXOPT_LOOKUP_STR(state, config->args, "-state", true, false); 215 164 216 165 if (state) { … … 227 176 PS_ASSERT_PTR_NON_NULL(config, false); 228 177 229 bool status = false; 230 psString diff_id = psMetadataLookupStr(&status, config->args, "-diff_id"); 231 if (!status) { 232 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -diff_id"); 233 return false; 234 } 235 if (!diff_id) { 236 psError(PS_ERR_UNKNOWN, true, "-diff_id is required"); 237 return false; 238 } 239 240 psString stack_id = psMetadataLookupStr(&status, config->args, "-stack_id"); 241 if (!status) { 242 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -stack_id"); 243 return false; 244 } 245 246 psString warp_id = psMetadataLookupStr(&status, config->args, "-warp_id"); 247 if (!status) { 248 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -warp_id"); 249 return false; 250 } 251 252 psString kind = psMetadataLookupStr(&status, config->args, "-kind"); 253 if (!status) { 254 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -kind"); 255 return false; 256 } 178 // required options 179 PXOPT_LOOKUP_STR(diff_id, config->args, "-diff_id", true, false); 180 181 // optional 182 PXOPT_LOOKUP_STR(stack_id, config->args, "-stack_id", false, false); 183 PXOPT_LOOKUP_STR(warp_id, config->args, "-warp_id", false, false); 184 PXOPT_LOOKUP_STR(kind, config->args, "-kind", false, false); 257 185 258 186 // defaults to false 259 bool template = psMetadataLookupBool(&status, config->args, "-template"); 260 if (!status) { 261 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -template"); 262 return false; 263 } 187 PXOPT_LOOKUP_BOOL(template, config->args, "-template", false); 264 188 265 189 // must provide either stack_id or warp_id but not BOTH … … 345 269 } 346 270 271 bool status; 347 272 psS32 count = psMetadataLookupS32(&status, output->data[0], "count(diff_id)"); 348 273 … … 371 296 PS_ASSERT_PTR_NON_NULL(config, false); 372 297 373 bool status = false; 374 psU64 limit = psMetadataLookupU64(&status, config->args, "-limit"); 375 if (!status) { 376 psError(PXTOOLS_ERR_PROG, false, "failed to lookup value for -limit"); 377 return false; 378 } 298 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 299 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 379 300 380 301 // find all rawImfiles matching the default query … … 425 346 } 426 347 427 bool simple = false;428 {429 bool status = false;430 simple = psMetadataLookupBool(&status, config->args, "-simple");431 if (!status) {432 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");433 return false;434 }435 }436 437 348 if (psArrayLength(output)) { 438 349 if (!convertIdToStr(output)) { … … 460 371 PS_ASSERT_PTR_NON_NULL(config, false); 461 372 462 bool status = false; 463 psU64 limit = psMetadataLookupU64(&status, config->args, "-limit"); 464 if (!status) { 465 psError(PXTOOLS_ERR_PROG, false, "failed to lookup value for -limit"); 466 return false; 467 } 373 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 374 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 468 375 469 376 psString query = pxDataGet("difftool_todiffskyfile.sql"); … … 513 420 } 514 421 515 bool simple = false;516 {517 bool status = false;518 simple = psMetadataLookupBool(&status, config->args, "-simple");519 if (!status) {520 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");521 return false;522 }523 }524 525 422 if (psArrayLength(output)) { 526 423 if (!convertIdToStr(output)) { … … 548 445 PS_ASSERT_PTR_NON_NULL(config, false); 549 446 550 bool status = false; 551 psString diff_id = psMetadataLookupStr(&status, config->args, "-diff_id"); 552 if (!status) { 553 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -diff_id"); 554 return false; 555 } 556 if (!diff_id) { 557 psError(PS_ERR_UNKNOWN, true, "-diff_id is required"); 558 return false; 559 } 560 561 psS16 code = psMetadataLookupS16(&status, config->args, "-code"); 562 if (!status) { 563 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -code"); 564 return false; 565 } 566 567 psString uri = psMetadataLookupStr(&status, config->args, "-uri"); 568 if (!status) { 569 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -uri"); 570 return false; 571 } 447 // required 448 PXOPT_LOOKUP_STR(diff_id, config->args, "-diff_id", true, false); 449 450 // default to 0 451 PXOPT_LOOKUP_S16(code, config->args, "-code", false, false); 452 453 PXOPT_LOOKUP_STR(uri, config->args, "-uri", true, false); 572 454 if (code == 0 && !uri) { 573 455 psError(PS_ERR_UNKNOWN, true, "-uri is required"); … … 575 457 } 576 458 577 psString path_base = psMetadataLookupStr(&status, config->args, "-path_base"); 578 if (!status) { 579 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -path_base"); 580 return false; 581 } 459 PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", true, false); 582 460 if (code == 0 && !path_base) { 583 461 psError(PS_ERR_UNKNOWN, true, "-path_base is required"); … … 586 464 587 465 // optional 588 psF64 bg = psMetadataLookupF64(&status, config->args, "-bg"); 589 if (!status) { 590 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -bg"); 591 return false; 592 } 593 594 psF64 bg_stdev = psMetadataLookupF64(&status, config->args, "-bg_stdev"); 595 if (!status) { 596 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -bg_stdev"); 597 return false; 598 } 599 600 psF64 good_frac = psMetadataLookupF64(&status, config->args, "-good_frac"); 601 if (!status) { 602 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -good_frac"); 603 return false; 604 } 466 PXOPT_LOOKUP_F64(bg, config->args, "-bg", false, false); 467 PXOPT_LOOKUP_F64(bg_stdev, config->args, "-bg_stdev", false, false); 468 PXOPT_LOOKUP_F64(good_frac, config->args, "-good_frac", false, false); 605 469 606 470 if (!psDBTransaction(config->dbh)) { … … 647 511 PS_ASSERT_PTR_NON_NULL(config, false); 648 512 649 bool status = false; 650 psU64 limit = psMetadataLookupU64(&status, config->args, "-limit"); 651 if (!status) { 652 psError(PXTOOLS_ERR_PROG, false, "failed to lookup value for -limit"); 653 return false; 654 } 513 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 514 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 655 515 656 516 psString query = pxDataGet("difftool_skyfile.sql"); … … 700 560 } 701 561 702 bool simple = false;703 {704 bool status = false;705 simple = psMetadataLookupBool(&status, config->args, "-simple");706 if (!status) {707 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");708 return false;709 }710 }711 712 562 if (psArrayLength(output)) { 713 563 if (!convertIdToStr(output)) { … … 791 641 792 642 793 794 795 796 643 static bool definepoprunMode(pxConfig *config) 797 644 { … … 799 646 800 647 // required options 801 bool status = false; 802 psString workdir = psMetadataLookupStr(&status, config->args, "-workdir"); 803 if (!status) { 804 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -workdir"); 805 return false; 806 } 807 if (!workdir) { 808 psError(PS_ERR_UNKNOWN, true, "-workdir is required"); 809 return false; 810 } 811 812 psString skycell_id = psMetadataLookupStr(&status, config->args, "-skycell_id"); 813 if (!status) { 814 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -skycell_id"); 815 return false; 816 } 817 if (!skycell_id) { 818 psError(PS_ERR_UNKNOWN, true, "-skycell_id is required"); 819 return false; 820 } 821 822 psString tess_id = psMetadataLookupStr(&status, config->args, "-tess_id"); 823 if (!status) { 824 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tess_id"); 825 return false; 826 } 827 if (!tess_id) { 828 psError(PS_ERR_UNKNOWN, true, "-tess_id is required"); 829 return false; 830 } 831 832 psString template_stack_id = psMetadataLookupStr(&status, config->args, "-template_stack_id"); 833 if (!status) { 834 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -template_stack_id"); 835 return false; 836 } 837 psString template_warp_id = psMetadataLookupStr(&status, config->args, "-template_warp_id"); 838 if (!status) { 839 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -template_warp_id"); 840 return false; 841 } 648 PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false); 649 PXOPT_LOOKUP_STR(skycell_id, config->args, "-skycell_id", true, false); 650 PXOPT_LOOKUP_STR(tess_id, config->args, "-tess_id", true, false); 651 652 // optional 653 PXOPT_LOOKUP_STR(template_stack_id, config->args, "-template_stack_id", false, false); 654 PXOPT_LOOKUP_STR(template_warp_id, config->args, "-template_warp_id", false, false); 655 842 656 if (template_stack_id && template_warp_id) { 843 657 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Only one template can be defined."); … … 850 664 } 851 665 852 psString input_stack_id = psMetadataLookupStr(&status, config->args, "-input_stack_id"); 853 if (!status) { 854 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -input_stack_id"); 855 return false; 856 } 857 psString input_warp_id = psMetadataLookupStr(&status, config->args, "-input_warp_id"); 858 if (!status) { 859 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -input_warp_id"); 860 return false; 861 } 666 PXOPT_LOOKUP_STR(input_stack_id, config->args, "-input_stack_id", false, false); 667 PXOPT_LOOKUP_STR(input_warp_id, config->args, "-input_warp_id", false, false); 862 668 if (input_stack_id && input_warp_id) { 863 669 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Only one input can be defined."); … … 870 676 } 871 677 872 psString kind = NULL;873 874 678 psTime *registered = NULL; 875 679 { 680 bool status; 876 681 psString registeredStr = psMetadataLookupStr(&status, config->args, "-registered"); 877 682 if (!status) { … … 887 692 } 888 693 889 bool simple = false; 890 { 891 bool status = false; 892 simple = psMetadataLookupBool(&status, config->args, "-simple"); 893 if (!status) { 894 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple"); 895 return false; 896 } 897 } 694 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 898 695 899 696 diffRunRow *run = diffRunRowAlloc( … … 936 733 skycell_id, 937 734 tess_id, 938 kind735 NULL // kind 939 736 )) { 940 737 if (!psDBRollback(config->dbh)) { … … 953 750 skycell_id, 954 751 tess_id, 955 kind752 NULL // kind 956 753 )) { 957 754 if (!psDBRollback(config->dbh)) {
Note:
See TracChangeset
for help on using the changeset viewer.
