- Timestamp:
- Mar 5, 2012, 5:19:48 PM (14 years ago)
- Location:
- branches/meh_branches/ppstack_test
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
ippTools/src (modified) (2 props)
-
ippTools/src/laptool.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/meh_branches/ppstack_test
- Property svn:mergeinfo changed
-
branches/meh_branches/ppstack_test/ippTools/src
- Property svn:ignore
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20110710/ippTools/src (added) merged: 32337 /branches/eam_branches/ipp-20110906/ippTools/src (added) merged: 32630 /branches/eam_branches/ipp-20111110/ippTools/src (added) merged: 32694 /branches/haf_add201112/ippTools/src (added) merged: 32980,32986,33003,33023,33027
-
branches/meh_branches/ppstack_test/ippTools/src/laptool.c
r31827 r33415 30 30 static bool updateexpMode(pxConfig *config); 31 31 32 static bool diffcheckMode(pxConfig *config); 33 32 34 static bool inactiveexpMode(pxConfig *config); 33 35 … … 62 64 MODECASE(LAPTOOL_MODE_UPDATEEXP, updateexpMode); 63 65 66 MODECASE(LAPTOOL_MODE_DIFFCHECK, diffcheckMode); 67 64 68 MODECASE(LAPTOOL_MODE_INACTIVEEXP, inactiveexpMode); 65 69 default: … … 276 280 PXOPT_COPY_STR(config->args, where, "-filter", "rawExp.filter", "=="); 277 281 282 psMetadata *chipWhere = psMetadataAlloc(); 283 PXOPT_COPY_S64(config->args, chipWhere, "-seq_id", "lapRun.seq_id", "=="); 284 278 285 // This seems unnecessarily clunky. 279 286 if (!all_obsmode) { … … 296 303 } 297 304 305 psString chipWhereClause = psDBGenerateWhereConditionSQL(chipWhere,NULL); 298 306 if (whereClause) { 299 307 psStringSubstitute(&query,whereClause,"@WHERE@"); 300 308 } 309 if (chipWhereClause) { 310 psStringSubstitute(&query,chipWhereClause,"@CHIPWHERE@"); 311 } 301 312 psFree(where); 313 psFree(chipWhere); 302 314 303 315 // Fetch exposures … … 378 390 379 391 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 392 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 380 393 381 394 psMetadata *where = psMetadataAlloc(); … … 399 412 psStringAppend(&query, " WHERE %s", whereClause); 400 413 psFree(whereClause); 414 } 415 if (limit) { 416 psString limitString = psDBGenerateLimitSQL(limit); 417 psStringAppend(&query, "\n %s", limitString); 418 psFree(limitString); 401 419 } 402 420 … … 755 773 } 756 774 757 758 775 static bool diffcheckMode(pxConfig *config) 776 { 777 PS_ASSERT_PTR_NON_NULL(config, false); 778 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 779 780 psMetadata *where = psMetadataAlloc(); 781 PXOPT_COPY_S64(config->args, where, "-lap_id", "lapRun.lap_id", "=="); 782 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 783 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 784 PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "=="); 785 PXOPT_COPY_S64(config->args, where, "-seq_id", "seq_id", "=="); 786 PXOPT_COPY_STR(config->args, where, "-skycell_id", "skycell_id", "=="); 787 788 psString query = pxDataGet("laptool_WSdiff_check.sql"); 789 if (!query) { 790 psError(PXTOOLS_ERR_SYS, false, "failed to retrieve SQL statement"); 791 return(false); 792 } 793 794 if (psListLength(where->list)) { 795 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 796 psStringPrepend(&whereClause, "\n AND "); 797 psStringSubstitute(&query,whereClause,"@WHERE@"); 798 psFree(whereClause); 799 } 800 801 if (!p_psDBRunQuery(config->dbh, query)) { 802 psError(PS_ERR_UNKNOWN, false, "database error"); 803 psFree(query); 804 return false; 805 } 806 psFree(query); 807 808 psArray *output = p_psDBFetchResult(config->dbh); 809 if (!output) { 810 psErrorCode err = psErrorCodeLast(); 811 switch (err) { 812 case PS_ERR_DB_CLIENT: 813 psError(PXTOOLS_ERR_SYS, false, "database error"); 814 case PS_ERR_DB_SERVER: 815 psError(PXTOOLS_ERR_PROG, false, "database error"); 816 default: 817 psError(PXTOOLS_ERR_PROG, false, "unknown error %d",err); 818 } 819 820 return false; 821 } 822 if (!psArrayLength(output)) { 823 psTrace("laptool", PS_LOG_INFO, "no rows found"); 824 psFree(output); 825 return true; 826 } 827 828 if (psArrayLength(output)) { 829 if (!ippdbPrintMetadatas(stdout, output, "lapRunWarpStackSkycells", !simple)) { 830 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 831 psFree(output); 832 return false; 833 } 834 } 835 836 psFree(output); 837 return(true); 838 } 759 839 760 840 static bool inactiveexpMode(pxConfig *config)
Note:
See TracChangeset
for help on using the changeset viewer.
