Changeset 10131
- Timestamp:
- Nov 21, 2006, 6:28:12 PM (19 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
regtool.c (modified) (5 diffs)
-
regtoolConfig.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/regtool.c
r10116 r10131 89 89 90 90 char *query = 91 "SELECT newExp.*" 91 "SELECT" 92 " newExp.*" 92 93 " FROM newExp" 93 " LEFT JOIN newImfile USING(exp_tag)" 94 " LEFT JOIN rawScienceExp USING(exp_tag)" 95 " LEFT JOIN rawDetrendExp USING(exp_tag)" 94 " LEFT JOIN newImfile" 95 " USING(exp_tag)" 96 " LEFT JOIN rawScienceExp" 97 " USING(exp_tag)" 98 " LEFT JOIN rawDetrendExp" 99 " USING(exp_tag)" 96 100 " WHERE" 97 " newExp.exp_tag IS NOT NULL" 98 " AND newImfile.exp_tag IS NULL" 101 " newImfile.exp_tag IS NULL" 99 102 " AND rawScienceExp.exp_tag IS NULL" 103 " AND rawDetrendExp.exp_tag IS NULL" 100 104 " AND newExp.imfiles =" 101 105 " (SELECT COUNT(exp_tag) FROM rawImfile" … … 131 135 132 136 // negate simple so the default is true 133 if (!ippdbPrintMetadatas(stdout, output, " newImfile", !simple)) {137 if (!ippdbPrintMetadatas(stdout, output, "p0PendingExp", !simple)) { 134 138 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 135 139 psFree(output); … … 209 213 // exp_tag is not in newImfile 210 214 // that the correct count of imfiles is in rawImfile 211 212 psString query = psStringCopy( 213 "SELECT newExp.*" 215 216 bool status = false; 217 psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag"); 218 if (!status) { 219 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag"); 220 return false; 221 } 222 if (!exp_tag) { 223 psError(PS_ERR_UNKNOWN, true, "-exp_tag is required"); 224 return false; 225 } 226 227 bool detrend = psMetadataLookupBool(&status, config->args, "-detrend"); 228 if (!status) { 229 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -detrend"); 230 return false; 231 } 232 233 char *query = psStringCopy( 234 "SELECT" 235 " newExp.*" 214 236 " FROM newExp" 215 " LEFT JOIN newImfile USING(exp_tag)" 216 " LEFT JOIN rawScienceExp USING(exp_tag)" 217 " LEFT JOIN rawDetrendExp USING(exp_tag)" 237 " LEFT JOIN newImfile" 238 " USING(exp_tag)" 239 " LEFT JOIN rawScienceExp" 240 " USING(exp_tag)" 241 " LEFT JOIN rawDetrendExp" 242 " USING(exp_tag)" 218 243 " WHERE" 219 244 " newExp.exp_tag IS NOT NULL" … … 223 248 " (SELECT COUNT(exp_tag) FROM rawImfile" 224 249 " WHERE rawImfile.exp_tag = newExp.exp_tag)" 250 " AND newExp.exp_tag = '%s'" 225 251 ); 226 252 227 { 228 bool status = false; 229 psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag"); 230 if (!status) { 231 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag"); 232 psFree(query); 233 return false; 234 } 235 if (exp_tag) { 236 psStringAppend(&query, " AND newExp.exp_tag = '%s'", exp_tag); 237 } 238 } 239 240 if (!p_psDBRunQuery(config->dbh, query)) { 253 if (!p_psDBRunQuery(config->dbh, query, exp_tag)) { 241 254 psError(PS_ERR_UNKNOWN, false, "database error"); 242 psFree(query); 243 return false; 244 } 245 psFree(query); 255 return false; 256 } 246 257 247 258 psArray *output = p_psDBFetchResult(config->dbh); … … 251 262 } 252 263 if (!psArrayLength(output)) { 253 // XXX check psError here254 264 psError(PS_ERR_UNKNOWN, false, "no pending newExp rows found"); 255 265 psFree(output); 256 return false; 257 } 258 259 bool status = false; 260 bool detrend = psMetadataLookupBool(&status, config->args, "-detrend"); 261 if (!status) { 262 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -detrend"); 263 return false; 264 } 266 return true; 267 } 268 265 269 266 270 // start a transaction so we don't end up with an exp in -
trunk/ippTools/src/regtoolConfig.c
r9764 r10131 71 71 psMetadata *updateexpArgs = psMetadataAlloc(); 72 72 psMetadataAddStr(updateexpArgs, PS_LIST_TAIL, "-exp_tag", 0, 73 "exp_tag to operate on ", NULL);73 "exp_tag to operate on (required)", NULL); 74 74 psMetadataAddStr(updateexpArgs, PS_LIST_TAIL, "-exp_type", 0, 75 75 "define exposure type", NULL);
Note:
See TracChangeset
for help on using the changeset viewer.
