Changeset 11983
- Timestamp:
- Feb 21, 2007, 3:52:48 PM (19 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 3 edited
-
stacktool.c (modified) (9 diffs)
-
stacktoolConfig.c (modified) (6 diffs)
-
warptool.c (modified) (2 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; -
trunk/ippTools/src/stacktoolConfig.c
r11866 r11983 52 52 psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-registered", 0, 53 53 "time detrend run was registered", now); 54 psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-skycell_id", 0, 55 "define skycell ID (required)", NULL); 56 psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-tess_id", 0, 57 "define tessellation ID (required)", NULL); 54 58 psMetadataAddBool(definerunArgs, PS_LIST_TAIL, "-simple", 0, 55 59 "use the simple output format", false); … … 74 78 psMetadataAddStr(addinputscfileArgs, PS_LIST_TAIL, "-p4_id", 0, 75 79 "define p4 ID (required)", NULL); 76 psMetadataAddStr(addinputscfileArgs, PS_LIST_TAIL, "-skycell_id", 0,77 "define skycell ID (required)", NULL);78 psMetadataAddStr(addinputscfileArgs, PS_LIST_TAIL, "-tess_id", 0,79 "define tessellation ID (required)", NULL);80 80 81 81 // -inputscfile … … 85 85 psMetadataAddStr(inputscfileArgs, PS_LIST_TAIL, "-p4_id", 0, 86 86 "search by p4 ID (required)", NULL); 87 psMetadataAddStr(inputscfileArgs, PS_LIST_TAIL, "-skycell_id", 0,88 "search by skycell ID (required)", NULL);89 psMetadataAddStr(inputscfileArgs, PS_LIST_TAIL, "-tess_id", 0,90 "search by tessellation ID (required)", NULL);91 87 psMetadataAddU64(inputscfileArgs, PS_LIST_TAIL, "-limit", 0, 92 88 "limit result set to N items", 0); … … 100 96 psMetadataAddStr(tosumArgs, PS_LIST_TAIL, "-p4_id", 0, 101 97 "search by p4 ID (required)", NULL); 102 psMetadataAddStr(tosumArgs, PS_LIST_TAIL, "-skycell_id", 0,103 "search by skycell ID (required)", NULL);104 psMetadataAddStr(tosumArgs, PS_LIST_TAIL, "-tess_id", 0,105 "search by tessellation ID (required)", NULL);106 98 psMetadataAddU64(tosumArgs, PS_LIST_TAIL, "-limit", 0, 107 99 "limit result set to N items", 0); … … 113 105 psMetadataAddStr(addsumscfileArgs, PS_LIST_TAIL, "-p6_id", 0, 114 106 "define p4 ID (required)", NULL); 115 psMetadataAddStr(addsumscfileArgs, PS_LIST_TAIL, "-skycell_id", 0,116 "define skycell ID (required)", NULL);117 psMetadataAddStr(addsumscfileArgs, PS_LIST_TAIL, "-tess_id", 0,118 "define tessellation ID (required)", NULL);119 107 psMetadataAddStr(addsumscfileArgs, PS_LIST_TAIL, "-uri", 0, 120 108 "define URI of file (required)", 0); … … 130 118 psMetadataAddStr(sumscfileArgs, PS_LIST_TAIL, "-p4_id", 0, 131 119 "search by p4 ID (required)", NULL); 132 psMetadataAddStr(sumscfileArgs, PS_LIST_TAIL, "-skycell_id", 0,133 "search by skycell ID (required)", NULL);134 psMetadataAddStr(sumscfileArgs, PS_LIST_TAIL, "-tess_id", 0,135 "search by tessellation ID (required)", NULL);136 120 psMetadataAddU64(sumscfileArgs, PS_LIST_TAIL, "-limit", 0, 137 121 "limit result set to N items", 0); -
trunk/ippTools/src/warptool.c
r11981 r11983 909 909 bg_mean_stdev 910 910 )) { 911 if (!psDBRollback(config->dbh)) { 912 psError(PS_ERR_UNKNOWN, false, "database error"); 913 } 911 914 psError(PS_ERR_UNKNOWN, false, "database error"); 912 915 return false; … … 914 917 915 918 if (!p4CompletedRuns(config)) { 919 if (!psDBRollback(config->dbh)) { 920 psError(PS_ERR_UNKNOWN, false, "database error"); 921 } 916 922 psError(PS_ERR_UNKNOWN, false, "database error"); 917 923 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
