Changeset 14250
- Timestamp:
- Jul 16, 2007, 5:09:48 PM (19 years ago)
- Location:
- trunk/ippTools
- Files:
-
- 4 edited
-
scripts/difftest.sh (modified) (1 diff)
-
src/difftool.c (modified) (2 diffs)
-
src/difftoolConfig.c (modified) (1 diff)
-
src/pxtables.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/scripts/difftest.sh
r14018 r14250 6 6 7 7 8 difftool -definerun -workdir file:///tmp/diff -skycell_id foo -tess_id bar || exit 19 difftool -addinputskyfile -diff_id 1 -warp_id 1 - skycell_id foo1 -tess_id bar -kind warped -template || exit 110 difftool -addinputskyfile -diff_id 1 -warp_id 1 - skycell_id foo2 -tess_id bar -kind warped || exit 18 difftool -definerun -workdir file:///tmp/diff -skycell_id foo1 -tess_id bar || exit 1 9 difftool -addinputskyfile -diff_id 1 -warp_id 1 -kind warped -template || exit 1 10 difftool -addinputskyfile -diff_id 1 -warp_id 1 -kind warped || exit 1 11 11 difftool -updaterun -state run -diff_id 1 || exit 1 12 12 difftool -todiffskyfile || exit 1 -
trunk/ippTools/src/difftool.c
r14108 r14250 236 236 } 237 237 238 psString stack_id = psMetadataLookupStr(&status, config->args, "-stack_id"); 239 if (!status) { 240 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -stack_id"); 241 return false; 242 } 243 238 244 psString warp_id = psMetadataLookupStr(&status, config->args, "-warp_id"); 239 245 if (!status) { 240 246 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -warp_id"); 241 return false;242 }243 if (!diff_id) {244 psError(PS_ERR_UNKNOWN, true, "-diff_id is required");245 return false;246 }247 248 psString skycell_id = psMetadataLookupStr(&status, config->args, "-skycell_id");249 if (!status) {250 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -skycell_id");251 return false;252 }253 if (!skycell_id) {254 psError(PS_ERR_UNKNOWN, true, "-skycell_id is required");255 return false;256 }257 258 psString tess_id = psMetadataLookupStr(&status, config->args, "-tess_id");259 if (!status) {260 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tess_id");261 return false;262 }263 if (!tess_id) {264 psError(PS_ERR_UNKNOWN, true, "-tess_id is required");265 247 return false; 266 248 } … … 279 261 } 280 262 281 // XXX need to validate the warp_id here 282 // XXX instead of validiting it here we should just use forgein key 283 // constrants 263 // must provide either stack_id or warp_id but not BOTH 264 if (!(stack_id || warp_id)) { 265 psError(PS_ERR_UNKNOWN, true, "either -stack_id or -warp_id must be specified"); 266 return false; 267 } 268 if (stack_id && warp_id) { 269 psError(PS_ERR_UNKNOWN, true, "either -stack_id or -warp_id must be specified"); 270 return false; 271 } 272 273 // if a warp_id was provided we need to lookup the skycell_id and tess_id 274 // from the warpRun 275 psString skycell_id = NULL; 276 psString tess_id = NULL; 277 if (warp_id) { 278 if (!p_psDBRunQuery(config->dbh, "SELECT * from diffRun WHERE diff_id = %" PRId64, (psS64)atoll(diff_id))) { 279 psError(PS_ERR_UNKNOWN, false, "database error"); 280 return false; 281 } 282 283 psArray *output = p_psDBFetchResult(config->dbh); 284 if (!output) { 285 psError(PS_ERR_UNKNOWN, false, "database error"); 286 return false; 287 } 288 if (!psArrayLength(output)) { 289 psError(PS_ERR_UNKNOWN, false, "diff_id %" PRId64 " not found", (psS64)atoll(diff_id)); 290 psFree(output); 291 return false; 292 } 293 294 diffRunRow *run = diffRunObjectFromMetadata(output->data[0]); 295 skycell_id = run->skycell_id; 296 tess_id = run->tess_id; 297 } 298 284 299 if (!diffInputSkyfileInsert(config->dbh, 285 300 (psS64)atoll(diff_id), 286 (psS64)atoll(warp_id), 301 template, 302 stack_id ? (psS64)atoll(stack_id) : PS_MAX_S64, // defined or NULL 303 warp_id ? (psS64)atoll(warp_id) : PS_MAX_S64, // defined or NULL 287 304 skycell_id, 288 305 tess_id, 289 kind, 290 template 306 kind 291 307 )) { 292 308 psError(PS_ERR_UNKNOWN, false, "database error"); -
trunk/ippTools/src/difftoolConfig.c
r14108 r14250 78 78 "define diff ID (required)", NULL); 79 79 psMetadataAddStr(addinputskyfileArgs, PS_LIST_TAIL, "-warp_id", 0, 80 "define warp ID (required)", NULL); 81 psMetadataAddStr(addinputskyfileArgs, PS_LIST_TAIL, "-skycell_id", 0, 82 "define by skycell ID (required)", NULL); 83 psMetadataAddStr(addinputskyfileArgs, PS_LIST_TAIL, "-tess_id", 0, 84 "dfine tess ID (required)", NULL); 80 "define warp ID", NULL); 81 psMetadataAddStr(addinputskyfileArgs, PS_LIST_TAIL, "-stack_id", 0, 82 "define stack ID)", NULL); 85 83 psMetadataAddStr(addinputskyfileArgs, PS_LIST_TAIL, "-kind", 0, 86 84 "define kind", NULL); -
trunk/ippTools/src/pxtables.c
r14213 r14250 83 83 CREATE_TABLE(warpSkyCellMapCreateTable); 84 84 CREATE_TABLE(warpSkyfileCreateTable); 85 CREATE_TABLE(stackRunCreateTable); 86 CREATE_TABLE(stackInputSkyfileCreateTable); 87 CREATE_TABLE(stackSumSkyfileCreateTable); 85 88 CREATE_TABLE(diffRunCreateTable); 86 89 CREATE_TABLE(diffInputSkyfileCreateTable); 87 90 CREATE_TABLE(diffSkyfileCreateTable); 88 CREATE_TABLE(stackRunCreateTable);89 CREATE_TABLE(stackInputSkyfileCreateTable);90 CREATE_TABLE(stackSumSkyfileCreateTable);91 91 92 92 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
