Changeset 11985 for trunk/ippTools/src/stacktool.c
- Timestamp:
- Feb 21, 2007, 3:59:20 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/stacktool.c (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/stacktool.c
r11983 r11985 33 33 static bool definerunMode(pxConfig *config); 34 34 static bool updaterunMode(pxConfig *config); 35 static bool addinputs cfileMode(pxConfig *config);36 static bool inputs cfileMode(pxConfig *config);35 static bool addinputskyfileMode(pxConfig *config); 36 static bool inputskyfileMode(pxConfig *config); 37 37 static bool tosumMode(pxConfig *config); 38 static bool addsums cfileMode(pxConfig *config);39 static bool sums cfileMode(pxConfig *config);38 static bool addsumskyfileMode(pxConfig *config); 39 static bool sumskyfileMode(pxConfig *config); 40 40 41 41 static bool setp6RunState(pxConfig *config, const char *p6_id, const char *state); … … 61 61 MODECASE(P6TOOL_MODE_DEFINERUN, definerunMode); 62 62 MODECASE(P6TOOL_MODE_UPDATERUN, updaterunMode); 63 MODECASE(P6TOOL_MODE_ADDINPUTS CFILE, addinputscfileMode);64 MODECASE(P6TOOL_MODE_INPUTS CFILE, inputscfileMode);63 MODECASE(P6TOOL_MODE_ADDINPUTSKYFILE, addinputskyfileMode); 64 MODECASE(P6TOOL_MODE_INPUTSKYFILE, inputskyfileMode); 65 65 MODECASE(P6TOOL_MODE_TOSUM, tosumMode); 66 MODECASE(P6TOOL_MODE_ADDSUMS CFILE, addsumscfileMode);67 MODECASE(P6TOOL_MODE_SUMS CFILE, sumscfileMode);66 MODECASE(P6TOOL_MODE_ADDSUMSKYFILE, addsumskyfileMode); 67 MODECASE(P6TOOL_MODE_SUMSKYFILE, sumskyfileMode); 68 68 default: 69 69 psAbort("invalid option (this should not happen)"); … … 219 219 220 220 221 static bool addinputs cfileMode(pxConfig *config)221 static bool addinputskyfileMode(pxConfig *config) 222 222 { 223 223 PS_ASSERT_PTR_NON_NULL(config, false); … … 249 249 // XXX instead of validiting it here we should just use forgein key 250 250 // constrants 251 if (!p6InputS cfileInsert(config->dbh,251 if (!p6InputSkyfileInsert(config->dbh, 252 252 (psS32)atoi(p6_id), 253 253 (psS32)atoi(p4_id) … … 261 261 262 262 263 static bool inputs cfileMode(pxConfig *config)263 static bool inputskyfileMode(pxConfig *config) 264 264 { 265 265 PS_ASSERT_PTR_NON_NULL(config, false); … … 275 275 psString query = psStringCopy( 276 276 "SELECT\n" 277 " p4S cfile.*\n"277 " p4Skyfile.*\n" 278 278 " FROM p6Run\n" 279 " JOIN p6InputS cfile\n"279 " JOIN p6InputSkyfile\n" 280 280 " USING(p6_id)\n" 281 " JOIN p4S cfile\n"282 " ON p6InputS cfile.p4_id = p4Scfile.p4_id\n"283 " AND p6Run.skycell_id = p4S cfile.skycell_id\n"284 " AND p6Run.tess_id = p4S cfile.tess_id\n"281 " JOIN p4Skyfile\n" 282 " ON p6InputSkyfile.p4_id = p4Skyfile.p4_id\n" 283 " AND p6Run.skycell_id = p4Skyfile.skycell_id\n" 284 " AND p6Run.tess_id = p4Skyfile.tess_id\n" 285 285 " WHERE\n" 286 286 " p6Run.state = 'run'\n" 287 287 ); 288 288 if (config->where) { 289 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p6InputS cfile");289 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p6InputSkyfile"); 290 290 psStringAppend(&query, " AND %s", whereClause); 291 291 psFree(whereClause); … … 321 321 } 322 322 if (!psArrayLength(output)) { 323 psError(PS_ERR_UNKNOWN, false, "no p6InputS cfile rows found");323 psError(PS_ERR_UNKNOWN, false, "no p6InputSkyfile rows found"); 324 324 psFree(output); 325 325 return true; … … 338 338 if (psArrayLength(output)) { 339 339 // negative simple so the default is true 340 if (!ippdbPrintMetadatas(stdout, output, "p6InputS cfile", !simple)) {340 if (!ippdbPrintMetadatas(stdout, output, "p6InputSkyfile", !simple)) { 341 341 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 342 342 psFree(output); … … 367 367 " p6Run.p6_id\n" 368 368 " FROM p6Run\n" 369 " LEFT JOIN p6SumS cfile\n"369 " LEFT JOIN p6SumSkyfile\n" 370 370 " USING(p6_id)\n" 371 371 " WHERE\n" 372 372 " p6Run.state = 'run'\n" 373 " AND p6SumS cfile.p6_id IS NULL\n"373 " AND p6SumSkyfile.p6_id IS NULL\n" 374 374 ); 375 375 376 376 if (config->where) { 377 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p6SumS cfile");377 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p6SumSkyfile"); 378 378 psStringAppend(&query, " AND %s", whereClause); 379 379 psFree(whereClause); … … 409 409 } 410 410 if (!psArrayLength(output)) { 411 psError(PS_ERR_UNKNOWN, false, "no p6SumS cfile rows found");411 psError(PS_ERR_UNKNOWN, false, "no p6SumSkyfile rows found"); 412 412 psFree(output); 413 413 return true; … … 426 426 if (psArrayLength(output)) { 427 427 // negative simple so the default is true 428 if (!ippdbPrintMetadatas(stdout, output, "p6SumS cfile", !simple)) {428 if (!ippdbPrintMetadatas(stdout, output, "p6SumSkyfile", !simple)) { 429 429 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 430 430 psFree(output); … … 439 439 440 440 441 static bool addsums cfileMode(pxConfig *config)441 static bool addsumskyfileMode(pxConfig *config) 442 442 { 443 443 PS_ASSERT_PTR_NON_NULL(config, false); … … 486 486 // XXX instead of validiting it here we should just use forgein key 487 487 // constrants 488 if (!p6SumS cfileInsert(config->dbh,488 if (!p6SumSkyfileInsert(config->dbh, 489 489 (psS32)atoi(p6_id), 490 490 uri, … … 517 517 518 518 519 static bool sums cfileMode(pxConfig *config)519 static bool sumskyfileMode(pxConfig *config) 520 520 { 521 521 PS_ASSERT_PTR_NON_NULL(config, false); … … 531 531 psString query = psStringCopy( 532 532 "SELECT\n" 533 " p6SumS cfile.*\n"533 " p6SumSkyfile.*\n" 534 534 " FROM p6Run\n" 535 " JOIN p6SumS cfile\n"535 " JOIN p6SumSkyfile\n" 536 536 " USING(p6_id)\n" 537 537 " WHERE\n" … … 540 540 541 541 if (config->where) { 542 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p6SumS cfile");542 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p6SumSkyfile"); 543 543 psStringAppend(&query, " AND %s", whereClause); 544 544 psFree(whereClause); … … 574 574 } 575 575 if (!psArrayLength(output)) { 576 psError(PS_ERR_UNKNOWN, false, "no p4S cfile rows found");576 psError(PS_ERR_UNKNOWN, false, "no p4Skyfile rows found"); 577 577 psFree(output); 578 578 return true; … … 590 590 591 591 if (psArrayLength(output)) { 592 if (!ippdbPrintMetadatas(stdout, output, "p6SumS cfile", !simple)) {592 if (!ippdbPrintMetadatas(stdout, output, "p6SumSkyfile", !simple)) { 593 593 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 594 594 psFree(output);
Note:
See TracChangeset
for help on using the changeset viewer.
