Changeset 9078 for trunk/ippTools/src/dettool.c
- Timestamp:
- Sep 29, 2006, 5:59:36 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettool.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r9073 r9078 1050 1050 { 1051 1051 PS_ASSERT_PTR_NON_NULL(config, false); 1052 1053 // select detProcessedImfile.det_id 1054 // select detRun.iteration 1055 // select detRun.det_type 1056 // select detProcessedImfile.exp_tag 1057 // by: 1058 // find the current iteration bassed on det_id 1059 // find all exp_tags in the current det_id/iteration from detInputExp 1060 // find all rawImfiles in the current exp_tags 1061 // compare to detProcessedImfiles by det_id/exp_tag 1062 // found how many imfile there are in each class_id 1063 // and: 1064 // det_id is not in detProcessedExp; 1065 // iteration is not in detProcessedExp; 1066 // class_id is not in detProcessedExp; 1067 1068 psString query = psStringCopy( 1069 " SELECT" 1070 " detProcessedImfile.det_id," 1071 " detRun.iteration," 1072 " detRun.det_type," 1073 " detProcessedImfile.exp_tag" 1074 " FROM detRun" 1075 " JOIN detInputExp" 1076 " ON detRun.position = detInputExp.det_id" 1077 " AND detRun.iteration = detInputExp.iteration" 1078 " JOIN rawDetrendExp" 1079 " ON detInputExp.exp_tag = rawDetrendExp.exp_tag" 1080 " JOIN detProcessedImfile" 1081 " ON detInputExp.det_id = detProcessedImfile.det_id" 1082 " AND detInputExp.exp_tag = detProcessedImfile.exp_tag" 1083 " LEFT JOIN detProcessedExp" 1084 " ON detInputExp.det_id = detStackedImfile.det_id" 1085 " AND detInputExp.iteration = detStackedImfile.iteration" 1086 " AND detProcessedImfile.exp_tag= detStackedImfile.exp_tag" 1087 " LEFT JOIN rawImfile" 1088 " ON detInputExp.exp_tag = rawImfile.exp_tag" 1089 " AND detProcessedImfile.class_id = rawImfile.class_id" 1090 " WHERE" 1091 " detProcessedExp.det_id IS NULL" 1092 " AND detProcessedExp.iteration IS NULL" 1093 " AND detProcessedExp.exp_tag IS NULL" 1094 " AND detInputExp.include = 1" 1095 " GROUP BY" 1096 " detProcessedImfile.class_id," 1097 " rawImfile.class_id" 1098 " HAVING" 1099 " COUNT(detProcessedImfile.class_id) = COUNT(rawImfile.class_id)" 1100 ); 1101 1102 // XXX does it make sens to accept any search params? 1103 #if 0 1104 if (config->where) { 1105 psString whereClause = psDBGenerateWhereConditionSQL(config->where); 1106 psStringAppend(&query, " AND %s", whereClause); 1107 psFree(whereClause); 1108 } 1109 #endif 1110 1111 if (!p_psDBRunQuery(config->dbh, query)) { 1112 psError(PS_ERR_UNKNOWN, false, "database error"); 1113 psFree(query); 1114 return false; 1115 } 1116 psFree(query); 1117 1118 psArray *output = p_psDBFetchResult(config->dbh); 1119 if (!output) { 1120 // XXX check psError here 1121 psError(PS_ERR_UNKNOWN, false, "no pending rawDetrendExp rows found"); 1122 return false; 1123 } 1124 1125 bool simple = false; 1126 { 1127 bool status = false; 1128 simple = psMetadataLookupBool(&status, config->args, "-simple"); 1129 if (!status) { 1130 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple"); 1131 return false; 1132 } 1133 } 1134 1135 // negative simple so the default is true 1136 if (!ippdbPrintMetadatas(stdout, output, "detProcessedImfile", !simple)) { 1137 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 1138 psFree(output); 1139 return false; 1140 } 1141 1142 psFree(output); 1052 1143 1053 1144 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
