- Timestamp:
- Aug 8, 2008, 5:08:29 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20080719/ippTools/src/dettool_detrunsummary.c
r18641 r18991 94 94 return false; 95 95 } 96 psString data_state = psMetadataLookupStr(&status, row, "data_state"); 97 if (!status) { 98 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for iteration"); 99 return false; 100 } 96 101 97 102 // optional … … 107 112 det_id, 108 113 iteration, 114 data_state, 109 115 bg, 110 116 bg_stdev, … … 115 121 } 116 122 123 // XXX data_state should be set to 'full' here 117 124 bool adddetrunsummaryMode(pxConfig *config) 118 125 { … … 121 128 // build a query to search by det_id, iteration, exp_id 122 129 psMetadata *where = psMetadataAlloc(); 123 PXOPT_COPY_S TR(config->args, where, "-det_id", "det_id", "==");130 PXOPT_COPY_S64(config->args, where, "-det_id", "det_id", "=="); 124 131 PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "=="); 125 132 126 PXOPT_LOOKUP_S TR(det_id, config->args, "-det_id", true, false); // required133 PXOPT_LOOKUP_S64(det_id, config->args, "-det_id", true, false); // required 127 134 PXOPT_LOOKUP_BOOL(again, config->args, "-again", false); 128 135 … … 200 207 // XXX it should be an error for -again and -code to both be set 201 208 if (again) { 202 if (!startNewIteration(config, (psS64)atoll(det_id))) {209 if (!startNewIteration(config, det_id)) { 203 210 if (!psDBRollback(config->dbh)) { 204 211 psError(PS_ERR_UNKNOWN, false, "database error"); … … 209 216 } else { 210 217 // set detRun.state to stop 211 if (!setDetRunState(config, (psS64)atoll(det_id), "stop")) {218 if (!setDetRunState(config, det_id, "stop")) { 212 219 if (!psDBRollback(config->dbh)) { 213 220 psError(PS_ERR_UNKNOWN, false, "database error"); … … 230 237 231 238 psMetadata *where = psMetadataAlloc(); 232 PXOPT_COPY_S TR(config->args, where, "-det_id", "det_id", "==");239 PXOPT_COPY_S64(config->args, where, "-det_id", "det_id", "=="); 233 240 PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "=="); 234 241 … … 302 309 303 310 psMetadata *where = psMetadataAlloc(); 304 PXOPT_COPY_S TR(config->args, where, "-det_id", "det_id", "==");311 PXOPT_COPY_S64(config->args, where, "-det_id", "det_id", "=="); 305 312 PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "=="); 306 313 PXOPT_COPY_STR(config->args, where, "-code", "fault", "=="); … … 334 341 } 335 342 336 343 // XXX need to add -data_state here 337 344 bool updatedetrunsummaryMode(pxConfig *config) 338 345 { 339 346 PS_ASSERT_PTR_NON_NULL(config, false); 340 347 341 PXOPT_LOOKUP_S TR(det_id, config->args, "-det_id", true, false); // required348 PXOPT_LOOKUP_S64(det_id, config->args, "-det_id", true, false); // required 342 349 PXOPT_LOOKUP_BOOL(accept, config->args, "-accept", false); 343 350 PXOPT_LOOKUP_BOOL(reject, config->args, "-reject", false); … … 354 361 355 362 char *query = "UPDATE detRunSummary SET accept = %d WHERE det_id = %"PRId64; 356 if (!p_psDBRunQuery(config->dbh, query, accept, (psS64)atoll(det_id))) {357 psError(PS_ERR_UNKNOWN, false, "database error"); 358 return false; 359 } 360 361 return true; 362 } 363 364 363 if (!p_psDBRunQuery(config->dbh, query, accept, det_id)) { 364 psError(PS_ERR_UNKNOWN, false, "database error"); 365 return false; 366 } 367 368 return true; 369 } 370 371
Note:
See TracChangeset
for help on using the changeset viewer.
