Changeset 8344
- Timestamp:
- Aug 14, 2006, 7:00:28 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettool.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r8334 r8344 116 116 117 117 if (config->where) { 118 psString whereClaus = psDBGenerateWhereConditionSQL(config->where );118 psString whereClaus = psDBGenerateWhereConditionSQL(config->where, "rawDetrendExp"); 119 119 psStringAppend(&query, " AND %s", whereClaus); 120 120 psFree(whereClaus); … … 751 751 // get det_id from detInputExp.det_id 752 752 // get det_type from detRun.position 753 // 754 // det_id is in detInputExp 755 // exp_id is in detInputExp 753 756 // det_id is not in detProccessedImfile 754 757 // exp_id is not in detProccessedImfile … … 763 766 " AND rawImfile.exp_id = detProcessedImfile.exp_id" 764 767 " AND rawImfile.class_id = detProcessedImfile.class_id" 765 " WHERE detProcessedImfile.det_id IS NULL AND" 766 " detProcessedImfile.exp_id IS NULL AND" 767 " detProcessedImfile.class_id IS NULL" 768 " WHERE" 769 " detInputExp.det_id IS NOT NULL" 770 " AND detInputExp.exp_id IS NOT NULL" 771 " AND detProcessedImfile.det_id IS NULL" 772 " AND detProcessedImfile.exp_id IS NULL" 773 " AND detProcessedImfile.class_id IS NULL" 768 774 ); 769 775 770 // XXX search criterian are disabled771 #if 0772 776 if (config->where) { 773 psString whereClaus = psDBGenerateWhereConditionSQL(config->where );777 psString whereClaus = psDBGenerateWhereConditionSQL(config->where, "rawImfile"); 774 778 psStringAppend(&query, " AND %s", whereClaus); 775 779 psFree(whereClaus); 776 780 } 777 #endif778 781 779 782 if (!p_psDBRunQuery(config->dbh, query)) { … … 986 989 { 987 990 PS_ASSERT_PTR_NON_NULL(config, false); 988 989 /*990 which returns a list of stacks that are ready to be performed. This991 list includes the detrend id, iteration, class id and detrend types992 (note that class id is unique per detrend id). In terms of the993 database, the command returns the list where the detrend id, iteration994 and class id triplet do not have an entry in detStackedImfile; the995 results are masked by entries in detResidExpAnalysis996 */997 998 //select detProcessedImfile.det_id, detRun.iteration, detProcessedImfile.class_id from detProcessedImfile LEFT JOIN detRun ON detProcessedImfile.det_id = detRun.position LEFT JOIN rawImfile ON detprocessedImfile.exp_id999 991 1000 992 // select detRun.iteration … … 1021 1013 " ON detRun.position = detInputExp.det_id" 1022 1014 " AND detRun.iteration = detInputExp.iteration" 1023 " LEFT JOIN rawImfile"1024 " ON detInputExp.exp_id = rawImfile.exp_id"1025 1015 " LEFT JOIN detProcessedImfile" 1026 1016 " ON detInputExp.det_id = detProcessedImfile.det_id" … … 1030 1020 " AND detInputExp.iteration = detStackedImfile.iteration" 1031 1021 " AND detProcessedImfile.class_id = detStackedImfile.class_id" 1022 " LEFT JOIN rawImfile" 1023 " ON detInputExp.exp_id = rawImfile.exp_id" 1024 " AND detProcessedImfile.class_id = rawImfile.class_id" 1032 1025 " WHERE" 1033 1026 " detStackedImfile.det_id IS NULL" 1034 1027 " AND detStackedImfile.iteration IS NULL" 1035 1028 " AND detStackedImfile.class_id IS NULL" 1029 " GROUP BY" 1030 " detProcessedImfile.class_id," 1031 " rawImfile.class_id" 1036 1032 " HAVING" 1037 1033 " COUNT(detProcessedImfile.class_id) = COUNT(rawImfile.class_id)" 1038 1034 ); 1039 1035 1040 // XXX search criterian are disabled1036 // XXX does it make sens to accept any search params? 1041 1037 #if 0 1042 1038 if (config->where) { … … 1086 1082 { 1087 1083 PS_ASSERT_PTR_NON_NULL(config, false); 1084 1085 // select detRun.det_type 1086 // select detProcessedImfile 1087 psString query = psStringCopy( 1088 " SELECT" 1089 " detRun.det_type," 1090 " detProcessedImfile.*" 1091 " FROM detProcessedImfile" 1092 " JOIN detRun" 1093 " ON detProcessedImfile.det_id = detRun.position" 1094 ); 1095 1096 // XXX search criterian are disabled 1097 #if 1 1098 if (config->where) { 1099 psString whereClaus = psDBGenerateWhereConditionSQL(config->where, "detProcessedImfile"); 1100 psStringAppend(&query, " AND %s", whereClaus); 1101 psFree(whereClaus); 1102 } 1103 #endif 1104 1105 if (!p_psDBRunQuery(config->dbh, query)) { 1106 psError(PS_ERR_UNKNOWN, false, "database error"); 1107 psFree(query); 1108 return false; 1109 } 1110 psFree(query); 1111 1112 psArray *output = p_psDBFetchResult(config->dbh); 1113 if (!output) { 1114 // XXX check psError here 1115 psError(PS_ERR_UNKNOWN, false, "no pending rawDetrendExp rows found"); 1116 return false; 1117 } 1118 1119 bool simple = false; 1120 { 1121 bool status = false; 1122 simple = psMetadataLookupBool(&status, config->args, "-simple"); 1123 if (!status) { 1124 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple"); 1125 return false; 1126 } 1127 } 1128 1129 // negative simple so the default is true 1130 if (!ippdbPrintMetadatas(stdout, output, "rawDetrendImfile", !simple)) { 1131 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 1132 psFree(output); 1133 return false; 1134 } 1135 1136 psFree(output); 1088 1137 1138 return true; 1139 } 1140 1141 #if 0 1142 { 1089 1143 // find all matching detProcessedImfiles where query should be 1090 1144 // pre-generated the entry for iteration must be pruned from the default … … 1339 1393 return true; 1340 1394 } 1395 #endif 1341 1396 1342 1397 static bool addstackedMode(pxConfig *config)
Note:
See TracChangeset
for help on using the changeset viewer.
