Changeset 11983 for trunk/ippTools/src/stacktool.c
- Timestamp:
- Feb 21, 2007, 3:52:48 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/stacktool.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/stacktool.c
r11976 r11983 39 39 static bool sumscfileMode(pxConfig *config); 40 40 41 static bool setp6RunState(pxConfig *config, const char *p 4_id, const char *state);41 static bool setp6RunState(pxConfig *config, const char *p6_id, const char *state); 42 42 43 43 # define MODECASE(caseName, func) \ … … 104 104 } 105 105 106 psString skycell_id = psMetadataLookupStr(&status, config->args, "-skycell_id"); 107 if (!status) { 108 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -skycell_id"); 109 return false; 110 } 111 if (!skycell_id) { 112 psError(PS_ERR_UNKNOWN, true, "-skycell_id is required"); 113 return false; 114 } 115 116 psString tess_id = psMetadataLookupStr(&status, config->args, "-tess_id"); 117 if (!status) { 118 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tess_id"); 119 return false; 120 } 121 if (!tess_id) { 122 psError(PS_ERR_UNKNOWN, true, "-tess_id is required"); 123 return false; 124 } 125 106 126 psTime *registered = NULL; 107 127 { … … 124 144 workdir, 125 145 NULL, // dvodb 126 registered 146 registered, 147 skycell_id, 148 tess_id 127 149 ); 128 150 psFree(registered); … … 223 245 } 224 246 225 psString skycell_id = psMetadataLookupStr(&status, config->args, "-skycell_id");226 if (!status) {227 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -skycell_id");228 return false;229 }230 if (!skycell_id) {231 psError(PS_ERR_UNKNOWN, true, "-skycell_id is required");232 return false;233 }234 235 psString tess_id = psMetadataLookupStr(&status, config->args, "-tess_id");236 if (!status) {237 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tess_id");238 return false;239 }240 if (!tess_id) {241 psError(PS_ERR_UNKNOWN, true, "-tess_id is required");242 return false;243 }244 247 245 248 // XXX need to validate the p4_id here … … 248 251 if (!p6InputScfileInsert(config->dbh, 249 252 (psS32)atoi(p6_id), 250 (psS32)atoi(p4_id), 251 skycell_id, 252 tess_id 253 (psS32)atoi(p4_id) 253 254 )) { 254 255 psError(PS_ERR_UNKNOWN, false, "database error"); … … 279 280 " USING(p6_id)\n" 280 281 " JOIN p4Scfile\n" 281 " ON p6InputScfile.p4_id = p4Scfile.p4_id\n"282 " AND p6 InputScfile.skycell_id= p4Scfile.skycell_id\n"283 " AND p6 InputScfile.tess_id= p4Scfile.tess_id\n"282 " ON p6InputScfile.p4_id = p4Scfile.p4_id\n" 283 " AND p6Run.skycell_id = p4Scfile.skycell_id\n" 284 " AND p6Run.tess_id = p4Scfile.tess_id\n" 284 285 " WHERE\n" 285 286 " p6Run.state = 'run'\n" … … 454 455 } 455 456 456 psString skycell_id = psMetadataLookupStr(&status, config->args, "-skycell_id");457 if (!status) {458 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -skycell_id");459 return false;460 }461 if (!skycell_id) {462 psError(PS_ERR_UNKNOWN, true, "-skycell_id is required");463 return false;464 }465 466 psString tess_id = psMetadataLookupStr(&status, config->args, "-tess_id");467 if (!status) {468 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tess_id");469 return false;470 }471 if (!tess_id) {472 psError(PS_ERR_UNKNOWN, true, "-tess_id is required");473 return false;474 }475 476 457 psString uri = psMetadataLookupStr(&status, config->args, "-uri"); 477 458 if (!status) { … … 494 475 if (!status) { 495 476 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -bg_mean_stdev"); 477 return false; 478 } 479 480 if (!psDBTransaction(config->dbh)) { 481 psError(PS_ERR_UNKNOWN, false, "database error"); 496 482 return false; 497 483 } … … 502 488 if (!p6SumScfileInsert(config->dbh, 503 489 (psS32)atoi(p6_id), 504 skycell_id,505 tess_id,506 490 uri, 507 491 bg, 508 492 bg_mean_stdev 509 493 )) { 494 if (!psDBRollback(config->dbh)) { 495 psError(PS_ERR_UNKNOWN, false, "database error"); 496 } 497 psError(PS_ERR_UNKNOWN, false, "database error"); 498 return false; 499 } 500 501 if (setp6RunState(config, p6_id, "stop")) { 502 if (!psDBRollback(config->dbh)) { 503 psError(PS_ERR_UNKNOWN, false, "database error"); 504 } 505 psError(PS_ERR_UNKNOWN, false, "failed to change p6Run's state"); 506 return false; 507 } 508 509 // point of no return 510 if (!psDBCommit(config->dbh)) { 510 511 psError(PS_ERR_UNKNOWN, false, "database error"); 511 512 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
