Changeset 9395
- Timestamp:
- Oct 6, 2006, 7:08:58 PM (20 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
detselect.c (modified) (1 diff)
-
detselectConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/detselect.c
r9392 r9395 160 160 161 161 if (config->where) { 162 psString whereClause = psDBGenerateWhereConditionSQL(config->where, NULL);162 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "detNormalizedImfile"); 163 163 psStringAppend(&query, " AND %s", whereClause); 164 164 psFree(whereClause); -
trunk/ippTools/src/detselectConfig.c
r9392 r9395 136 136 } \ 137 137 } 138 #define addWhereS32(name) \ 139 { \ 140 psS32 s32 = 0; \ 141 bool status = false; \ 142 if ((s32= psMetadataLookupS32(&status, config->args, "-" #name))) { \ 143 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, #name, 0, "==", s32)) { \ 144 psError(PS_ERR_UNKNOWN, false, "failed to add item " #name); \ 145 goto FAIL; \ 146 } \ 147 } \ 148 } 149 150 #define addWhereF32(name) \ 151 { \ 152 psF32 var = 0; \ 153 bool status = false; \ 154 if (!isnan(psMetadataLookupF32(&status, config->args, "-" #name))) { \ 155 if (!psMetadataAddF32(config->where, PS_LIST_TAIL, #name, 0, "==", var)) { \ 156 psError(PS_ERR_UNKNOWN, false, "failed to add item " #name); \ 157 goto FAIL; \ 158 } \ 159 } \ 160 } 161 162 #define addWhereF64(name) \ 163 { \ 164 psF64 var = 0; \ 165 bool status = false; \ 166 if (!isnan(psMetadataLookupF64(&status, config->args, "-" #name))) { \ 167 if (!psMetadataAddF64(config->where, PS_LIST_TAIL, #name, 0, "==", var)) { \ 168 psError(PS_ERR_UNKNOWN, false, "failed to add item " #name); \ 169 goto FAIL; \ 170 } \ 171 } \ 172 } 138 173 139 174 // generate SQL where clause 140 175 config->where = psMetadataAlloc(); 141 176 177 addWhereStr(det_id); 178 addWhereS32(iteration); 142 179 addWhereStr(exp_tag); 143 180 // convert '-inst' to 'camera' … … 154 191 addWhereStr(telescope); 155 192 addWhereStr(exp_type); 156 { 157 int imfiles = 0; 158 bool status = false; 159 if ((imfiles = psMetadataLookupS32(&status, config->args, "-imfiles"))) { 160 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "imfiles", 0, "==", imfiles)) { 161 psError(PS_ERR_UNKNOWN, false, "failed to add item imfiles"); 162 goto FAIL; 163 } 164 } 165 } 193 addWhereStr(det_type); 194 addWhereS32(imfiles); 166 195 addWhereStr(class); 167 196 addWhereStr(class_id); 168 197 addWhereStr(filter); 198 addWhereF32(exp_time); 199 addWhereF64(ccd_temp); 200 addWhereF32(airmass); 169 201 170 202 if (config->where->list->n < 1) {
Note:
See TracChangeset
for help on using the changeset viewer.
