Changeset 23616
- Timestamp:
- Mar 30, 2009, 2:55:03 PM (17 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
camtool.c (modified) (9 diffs)
-
camtoolConfig.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/camtool.c
r23590 r23616 112 112 PXOPT_COPY_STR(config->args, where, "-reduction", "chipRun.reduction", "=="); 113 113 114 if (!psListLength(where->list) 115 &&!psMetadataLookupBool(NULL, config->args, "-all")) {114 if (!psListLength(where->list) && 115 !psMetadataLookupBool(NULL, config->args, "-all")) { 116 116 psFree(where); 117 117 psError(PXTOOLS_ERR_DATA, false, "search parameters are required"); … … 137 137 // use psDBGenerateWhereSQL because the SQL yields an intermediate table 138 138 if (where && psListLength(where->list)) { 139 psString whereClause = psDBGenerateWhere SQL(where, NULL);140 psStringAppend(&query, " %s", whereClause);139 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 140 psStringAppend(&query, " AND %s", whereClause); 141 141 psFree(whereClause); 142 142 } … … 289 289 // use psDBGenerateWhereSQL because the SQL yields an intermediate table 290 290 if (psListLength(where->list)) { 291 psString whereClause = psDBGenerateWhere SQL(where, NULL);292 psStringAppend(&query, " %s", whereClause);291 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 292 psStringAppend(&query, " AND %s", whereClause); 293 293 psFree(whereClause); 294 294 } … … 344 344 PXOPT_COPY_STR(config->args, where, "-class_id", "chipProcessedImfile.class_id", "=="); 345 345 346 // XXX is this used? PXOPT_COPY_STR(config->args, where, "-class", "class", "==");347 348 346 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 349 347 … … 356 354 // use psDBGenerateWhereSQL because the SQL yields an intermediate table 357 355 if (psListLength(where->list)) { 358 psString whereClause = psDBGenerateWhere SQL(where, NULL);359 psStringAppend(&query, " %s", whereClause);356 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 357 psStringAppend(&query, " AND %s", whereClause); 360 358 psFree(whereClause); 361 359 } … … 474 472 // generate restrictions 475 473 psMetadata *where = psMetadataAlloc(); 476 PXOPT_COPY_S64(config->args, where, "-cam_id", "cam _id", "==");474 PXOPT_COPY_S64(config->args, where, "-cam_id", "camRun.cam_id", "=="); 477 475 478 476 psString query = pxDataGet("camtool_find_pendingexp.sql"); … … 484 482 // use psDBGenerateWhereSQL because the SQL yields an intermediate table 485 483 if (psListLength(where->list)) { 486 psString whereClaus = psDBGenerateWhere SQL(where, NULL);487 psStringAppend(&query, " %s", whereClaus);484 psString whereClaus = psDBGenerateWhereConditionSQL(where, NULL); 485 psStringAppend(&query, " AND %s", whereClaus); 488 486 psFree(whereClaus); 489 487 } … … 659 657 PXOPT_COPY_STR(config->args, where, "-reduction", "camRun.reduction", "=="); 660 658 659 if (!psListLength(where->list) && 660 !psMetadataLookupBool(NULL, config->args, "-all")) { 661 psFree(where); 662 psError(PXTOOLS_ERR_DATA, false, "search parameters (or -all) are required"); 663 return false; 664 } 665 661 666 psString query = pxDataGet("camtool_find_processedexp.sql"); 662 667 if (!query) { … … 669 674 psStringAppend(&query, " WHERE %s", whereClause); 670 675 psFree(whereClause); 676 } 677 678 // we either add AND (condition) or WHERE (condition): 679 if (where->list && faulted) { 680 // list only faulted rows 681 psStringAppend(&query, " %s", " AND camProcessedExp.fault != 0"); 682 } 683 if (where->list && !faulted) { 684 // don't list faulted rows 685 psStringAppend(&query, " %s", " AND camProcessedExp.fault = 0"); 686 } 687 if (!where->list && faulted) { 688 // list only faulted rows 689 psStringAppend(&query, " %s", " WHERE camProcessedExp.fault != 0"); 690 } 691 if (!where->list && !faulted) { 692 // don't list faulted rows 693 psStringAppend(&query, " %s", " WHERE camProcessedExp.fault = 0"); 671 694 } 672 695 psFree(where); 673 674 if (faulted) {675 // list only faulted rows676 psStringAppend(&query, " %s", "AND camProcessedExp.fault != 0");677 } else {678 // don't list faulted rows679 psStringAppend(&query, " %s", "AND camProcessedExp.fault = 0");680 }681 696 682 697 // order by cam_id so that the postage stamp parser can easliy find the 'latest' astrometry -
trunk/ippTools/src/camtoolConfig.c
r23590 r23616 174 174 psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-reduction",0, "search by camRun reduction class", NULL); 175 175 176 psMetadataAddU64(processedexpArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); 177 psMetadataAddBool(processedexpArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 178 psMetadataAddBool(processedexpArgs, PS_LIST_TAIL, "-faulted", 0, "only return imfiles with a fault status set", false); 176 psMetadataAddU64(processedexpArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); 177 psMetadataAddBool(processedexpArgs, PS_LIST_TAIL, "-all", 0, "list everything without restriction", false); 178 psMetadataAddBool(processedexpArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 179 psMetadataAddBool(processedexpArgs, PS_LIST_TAIL, "-faulted", 0, "only return imfiles with a fault status set", false); 179 180 180 181 // -revertprocessedexp
Note:
See TracChangeset
for help on using the changeset viewer.
