Changeset 7602 for trunk/ippTools/src/dettool.c
- Timestamp:
- Jun 20, 2006, 5:13:14 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettool.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r7600 r7602 11 11 static bool defineMode(pxConfig *config); 12 12 static bool runsMode(pxConfig *config); 13 static bool selectrunsMode(pxConfig *config); 13 14 static bool inputMode(pxConfig *config); 14 15 static bool rawMode(pxConfig *config); … … 50 51 MODECASE(DETTOOL_MODE_DEFINE, defineMode); 51 52 MODECASE(DETTOOL_MODE_RUNS, runsMode); 53 MODECASE(DETTOOL_MODE_SELECTRUNS, selectrunsMode); 52 54 MODECASE(DETTOOL_MODE_INPUT, inputMode); 53 55 MODECASE(DETTOOL_MODE_RAW, rawMode); … … 269 271 270 272 psFree(runs); 273 274 return true; 275 } 276 277 static bool selectrunsMode(pxConfig *config) 278 { 279 PS_ASSERT_PTR_NON_NULL(config, 0); 280 281 // -inst & -dete_type are required 282 bool status = false; 283 psString camera = psMetadataLookupStr(&status, config->args, "-inst"); 284 if (!status) { 285 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -inst"); 286 return false; 287 } 288 if (!camera) { 289 psError(PS_ERR_UNKNOWN, true, "-inst is required"); 290 return false; 291 } 292 psString det_type = psMetadataLookupStr(&status, config->args, "-det_type"); 293 if (!status) { 294 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -det_type"); 295 return false; 296 } 297 if (!det_type) { 298 psError(PS_ERR_UNKNOWN, true, "-det_type is required"); 299 return false; 300 } 301 302 char *query = "SELECT detRun.position, det_type, camera FROM detRun JOIN detInputExp where camera = '%s' and det_type = '%s' LIMIT 1"; 303 304 if (!p_psDBRunQuery(config->dbh, query, camera, det_type)) { 305 psError(PS_ERR_UNKNOWN, false, "database error"); 306 return false; 307 } 308 309 psArray *result = p_psDBFetchResult(config->dbh); 310 if (!result) { 311 } 312 313 // sanity check the result 314 if (psArrayLength(result) != 1) { 315 } 316 317 // just a view... doesn't need to be free'd 318 psMetadata *run = result->data[0]; 319 320 psS32 det_id = psMetadataLookupS32(&status, run, "position"); 321 if (!status) { 322 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for position"); 323 psFree(result); 324 return false; 325 } 326 327 psFree(result); 328 329 fprintf(stdout, "FLAT CHIP %d DONE\n", det_id); 271 330 272 331 return true; … … 1987 2046 return newIteration; 1988 2047 } 2048
Note:
See TracChangeset
for help on using the changeset viewer.
