Changeset 18561 for trunk/ippTools/src/difftool.c
- Timestamp:
- Jul 15, 2008, 10:30:59 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/difftool.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/difftool.c
r18336 r18561 104 104 105 105 // default 106 PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false); 106 107 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 107 PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false);108 108 109 109 diffRunRow *run = diffRunRowAlloc( … … 282 282 PS_ASSERT_PTR_NON_NULL(config, false); 283 283 284 psMetadata *where = psMetadataAlloc(); 285 286 PXOPT_COPY_S64(config->args, where, "-diff_id", "diff_id", "=="); 287 PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "=="); 288 PXOPT_COPY_STR(config->args, where, "-skycell_id", "skycell_id", "=="); 289 PXOPT_COPY_STR(config->args, where, "-tess_id", "tess_id", "=="); 290 PXOPT_COPY_STR(config->args, where, "-kind", "kind", "=="); 291 284 292 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 285 293 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 294 PXOPT_LOOKUP_BOOL(template, config->args, "-template", false); 286 295 287 296 // find all rawImfiles matching the default query … … 292 301 } 293 302 294 if (config->where) { 295 psString whereClause = psDBGenerateWhereSQL(config->where, NULL); 296 psStringAppend(&query, " %s", whereClause); 303 if (template) { 304 // list only faulted rows 305 psStringAppend(&query, " %s", "WHERE diffInputSkyfile.template != 0"); 306 } else { 307 // don't list faulted rows 308 psStringAppend(&query, " %s", "WHERE diffInputSkyfile.template = 0"); 309 } 310 311 if (psListLength(where->list)) { 312 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 313 psStringAppend(&query, " AND %s", whereClause); 297 314 psFree(whereClause); 298 315 } 316 psFree(where); 299 317 300 318 // treat limit == 0 as "no limit" … … 351 369 PS_ASSERT_PTR_NON_NULL(config, false); 352 370 371 psMetadata *where = psMetadataAlloc(); 372 PXOPT_COPY_S64(config->args, where, "-diff_id", "diff_id", "=="); 373 353 374 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 354 375 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); … … 360 381 } 361 382 362 if ( config->where) {363 psString whereClause = psDBGenerateWhereConditionSQL( config->where, "diffSkyfile");383 if (psListLength(where->list)) { 384 psString whereClause = psDBGenerateWhereConditionSQL(where, "diffSkyfile"); 364 385 psStringAppend(&query, " AND %s", whereClause); 365 386 psFree(whereClause); 366 387 } 388 psFree(where); 367 389 368 390 // treat limit == 0 as "no limit" … … 418 440 { 419 441 PS_ASSERT_PTR_NON_NULL(config, false); 420 421 // required 422 PXOPT_LOOKUP_S64(diff_id, config->args, "-diff_id", true, false); 423 424 // default to 0 442 443 PXOPT_LOOKUP_S64(diff_id, config->args, "-diff_id", true, false); // required 425 444 PXOPT_LOOKUP_S16(code, config->args, "-code", false, false); 426 427 PXOPT_LOOKUP_STR(uri, config->args, "-uri", false, false); 428 if (code == 0 && !uri) { 429 psError(PS_ERR_UNKNOWN, true, "-uri is required"); 430 return false; 431 } 432 433 PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", false, false); 434 if (code == 0 && !path_base) { 435 psError(PS_ERR_UNKNOWN, true, "-path_base is required"); 436 return false; 437 } 445 PXOPT_LOOKUP_STR(uri, config->args, "-uri", (code == 0), false); 446 PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", (code == 0), false); 438 447 439 448 // optional … … 441 450 PXOPT_LOOKUP_F64(bg_stdev, config->args, "-bg_stdev", false, false); 442 451 PXOPT_LOOKUP_F32(dtime_diff, config->args, "-dtime_diff", false, false); 443 PXOPT_LOOKUP_STR(hostname, config->args, "-hostname", false, false);444 PXOPT_LOOKUP_F32(good_frac, config->args, "-good_frac", false, false);445 452 PXOPT_LOOKUP_S32(stamps_num, config->args, "-stamps_num", false, false); 446 453 PXOPT_LOOKUP_F32(stamps_rms, config->args, "-stamps_rms", false, false); 447 454 PXOPT_LOOKUP_S32(sources, config->args, "-sources", false, false); 455 PXOPT_LOOKUP_STR(hostname, config->args, "-hostname", false, false); 456 PXOPT_LOOKUP_F32(good_frac, config->args, "-good_frac", false, false); 448 457 449 458 if (!psDBTransaction(config->dbh)) { … … 495 504 PS_ASSERT_PTR_NON_NULL(config, false); 496 505 506 psMetadata *where = psMetadataAlloc(); 507 PXOPT_COPY_S64(config->args, where, "-diff_id", "diff_id", "=="); 508 PXOPT_COPY_STR(config->args, where, "-skycell_id", "skycell_id", "=="); 509 PXOPT_COPY_STR(config->args, where, "-tess_id", "tess_id", "=="); 510 497 511 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 498 512 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); … … 504 518 } 505 519 506 if ( config->where) {507 psString whereClause = psDBGenerateWhereConditionSQL( config->where, "diffSkyfile");520 if (psListLength(where->list)) { 521 psString whereClause = psDBGenerateWhereConditionSQL(where, "diffSkyfile"); 508 522 psStringAppend(&query, " AND %s", whereClause); 509 523 psFree(whereClause); 510 524 } 525 psFree(where); 511 526 512 527 // treat limit == 0 as "no limit" … … 563 578 PS_ASSERT_PTR_NON_NULL(config, false); 564 579 580 psMetadata *where = psMetadataAlloc(); 581 PXOPT_COPY_S64(config->args, where, "-diff_id", "diff_id", "=="); 582 PXOPT_COPY_S16(config->args, where, "-code", "fault", "=="); 583 565 584 psString query = pxDataGet("difftool_revertdiffskyfile.sql"); 566 585 if (!query) { … … 569 588 } 570 589 571 if ( config->where) {572 psString whereClause = psDBGenerateWhereConditionSQL( config->where, "diffSkyfile");590 if (psListLength(where->list)) { 591 psString whereClause = psDBGenerateWhereConditionSQL(where, "diffSkyfile"); 573 592 psStringAppend(&query, " AND %s", whereClause); 574 593 psFree(whereClause); 575 594 } 595 psFree(where); 576 596 577 597 if (!p_psDBRunQuery(config->dbh, query)) { … … 741 761 PS_ASSERT_PTR_NON_NULL(config, false); 742 762 743 // required options 744 PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false); 745 PXOPT_LOOKUP_STR(skycell_id, config->args, "-skycell_id", true, false); 746 PXOPT_LOOKUP_STR(tess_id, config->args, "-tess_id", true, false); 747 748 // optional 763 PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false); // required options 764 PXOPT_LOOKUP_STR(skycell_id, config->args, "-skycell_id", true, false); // required options 765 PXOPT_LOOKUP_STR(tess_id, config->args, "-tess_id", true, false); // required options 766 PXOPT_LOOKUP_S64(template_warp_id, config->args, "-template_warp_id", false, false); 749 767 PXOPT_LOOKUP_S64(template_stack_id, config->args, "-template_stack_id", false, false); 750 PXOPT_LOOKUP_S64(template_warp_id, config->args, "-template_warp_id", false, false); 768 PXOPT_LOOKUP_S64(input_warp_id, config->args, "-input_warp_id", false, false); 769 PXOPT_LOOKUP_S64(input_stack_id, config->args, "-input_stack_id", false, false); 751 770 752 771 if (template_stack_id && template_warp_id) { … … 760 779 } 761 780 762 PXOPT_LOOKUP_S64(input_stack_id, config->args, "-input_stack_id", false, false);763 PXOPT_LOOKUP_S64(input_warp_id, config->args, "-input_warp_id", false, false);764 781 if (input_stack_id && input_warp_id) { 765 782 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Only one input can be defined."); … … 787 804 PS_ASSERT_PTR_NON_NULL(config, false); 788 805 789 // required options 790 PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false); 791 792 // default 806 psMetadata *where = psMetadataAlloc(); 807 808 PXOPT_COPY_S64(config->args, where, "-diff_id", "diff_id", "=="); 809 PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "=="); 810 PXOPT_COPY_STR(config->args, where, "-skycell_id", "skycell_id", "=="); 811 PXOPT_COPY_STR(config->args, where, "-tess_id", "tess_id", "=="); 812 PXOPT_COPY_STR(config->args, where, "-kind", "kind", "=="); 813 PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false); // required options 814 PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false); 815 PXOPT_LOOKUP_BOOL(template, config->args, "-template", false); 793 816 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 794 PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false);795 817 796 818 // find all things to queue … … 801 823 } 802 824 803 if (config->where) { 804 psString whereClause = psDBGenerateWhereSQL(config->where, NULL); 805 psStringAppend(&query, " %s", whereClause); 825 if (template) { 826 // list only faulted rows 827 psStringAppend(&query, " %s", "WHERE diffInputSkyfile.template != 0"); 828 } else { 829 // don't list faulted rows 830 psStringAppend(&query, " %s", "WHERE diffInputSkyfile.template = 0"); 831 } 832 833 if (psListLength(where->list)) { 834 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 835 psStringAppend(&query, " AND %s", whereClause); 806 836 psFree(whereClause); 807 837 } 838 psFree(where); 808 839 809 840 if (!p_psDBRunQuery(config->dbh, query)) {
Note:
See TracChangeset
for help on using the changeset viewer.
