Changeset 11985 for trunk/ippTools/src/difftool.c
- Timestamp:
- Feb 21, 2007, 3:59:20 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/difftool.c (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/difftool.c
r11979 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);37 static bool todiffs cfileMode(pxConfig *config);38 static bool adddiffs cfileMode(pxConfig *config);39 static bool diffs cfileMode(pxConfig *config);35 static bool addinputskyfileMode(pxConfig *config); 36 static bool inputskyfileMode(pxConfig *config); 37 static bool todiffskyfileMode(pxConfig *config); 38 static bool adddiffskyfileMode(pxConfig *config); 39 static bool diffskyfileMode(pxConfig *config); 40 40 41 41 static bool setp5RunState(pxConfig *config, const char *p4_id, const char *state); … … 61 61 MODECASE(P5TOOL_MODE_DEFINERUN, definerunMode); 62 62 MODECASE(P5TOOL_MODE_UPDATERUN, updaterunMode); 63 MODECASE(P5TOOL_MODE_ADDINPUTS CFILE, addinputscfileMode);64 MODECASE(P5TOOL_MODE_INPUTS CFILE, inputscfileMode);65 MODECASE(P5TOOL_MODE_TODIFFS CFILE, todiffscfileMode);66 MODECASE(P5TOOL_MODE_ADDDIFFS CFILE, adddiffscfileMode);67 MODECASE(P5TOOL_MODE_DIFFS CFILE, diffscfileMode);63 MODECASE(P5TOOL_MODE_ADDINPUTSKYFILE, addinputskyfileMode); 64 MODECASE(P5TOOL_MODE_INPUTSKYFILE, inputskyfileMode); 65 MODECASE(P5TOOL_MODE_TODIFFSKYFILE, todiffskyfileMode); 66 MODECASE(P5TOOL_MODE_ADDDIFFSKYFILE, adddiffskyfileMode); 67 MODECASE(P5TOOL_MODE_DIFFSKYFILE, diffskyfileMode); 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); … … 280 280 // XXX instead of validiting it here we should just use forgein key 281 281 // constrants 282 if (!p5InputS cfileInsert(config->dbh,282 if (!p5InputSkyfileInsert(config->dbh, 283 283 (psS32)atoi(p5_id), 284 284 (psS32)atoi(p4_id), … … 296 296 297 297 298 static bool inputs cfileMode(pxConfig *config)298 static bool inputskyfileMode(pxConfig *config) 299 299 { 300 300 PS_ASSERT_PTR_NON_NULL(config, false); … … 310 310 psString query = psStringCopy( 311 311 "SELECT\n" 312 " p4S cfile.*,\n"313 " p5InputS cfile.template\n"312 " p4Skyfile.*,\n" 313 " p5InputSkyfile.template\n" 314 314 " FROM p5Run\n" 315 " JOIN p5InputS cfile\n"315 " JOIN p5InputSkyfile\n" 316 316 " USING(p5_id)\n" 317 " JOIN p4S cfile\n"318 " ON p5InputS cfile.p4_id = p4Scfile.p4_id\n"319 " AND p5InputS cfile.skycell_id = p4Scfile.skycell_id\n"320 " AND p5InputS cfile.tess_id = p4Scfile.tess_id\n"317 " JOIN p4Skyfile\n" 318 " ON p5InputSkyfile.p4_id = p4Skyfile.p4_id\n" 319 " AND p5InputSkyfile.skycell_id = p4Skyfile.skycell_id\n" 320 " AND p5InputSkyfile.tess_id = p4Skyfile.tess_id\n" 321 321 " WHERE\n" 322 322 " p5Run.state = 'run'\n" … … 324 324 325 325 if (config->where) { 326 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p5InputS cfile");326 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p5InputSkyfile"); 327 327 psStringAppend(&query, " AND %s", whereClause); 328 328 psFree(whereClause); … … 358 358 } 359 359 if (!psArrayLength(output)) { 360 psError(PS_ERR_UNKNOWN, false, "no p5InputS cfile rows found");360 psError(PS_ERR_UNKNOWN, false, "no p5InputSkyfile rows found"); 361 361 psFree(output); 362 362 return true; … … 375 375 if (psArrayLength(output)) { 376 376 // negative simple so the default is true 377 if (!ippdbPrintMetadatas(stdout, output, "p5InputS cfile", !simple)) {377 if (!ippdbPrintMetadatas(stdout, output, "p5InputSkyfile", !simple)) { 378 378 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 379 379 psFree(output); … … 388 388 389 389 390 static bool todiffs cfileMode(pxConfig *config)390 static bool todiffskyfileMode(pxConfig *config) 391 391 { 392 392 PS_ASSERT_PTR_NON_NULL(config, false); … … 404 404 " p5Run.p5_id\n" 405 405 " FROM p5Run\n" 406 " JOIN p5InputS cfile\n"406 " JOIN p5InputSkyfile\n" 407 407 " USING(p5_id)\n" 408 " JOIN p4S cfile\n"409 " ON p5InputS cfile.p4_id = p4Scfile.p4_id\n"410 " AND p5InputS cfile.skycell_id = p4Scfile.skycell_id\n"411 " AND p5InputS cfile.tess_id = p4Scfile.tess_id\n"412 " LEFT JOIN p5DiffS cfile\n"413 " ON p5InputS cfile.p5_id = p5DiffScfile.p5_id\n"408 " JOIN p4Skyfile\n" 409 " ON p5InputSkyfile.p4_id = p4Skyfile.p4_id\n" 410 " AND p5InputSkyfile.skycell_id = p4Skyfile.skycell_id\n" 411 " AND p5InputSkyfile.tess_id = p4Skyfile.tess_id\n" 412 " LEFT JOIN p5DiffSkyfile\n" 413 " ON p5InputSkyfile.p5_id = p5DiffSkyfile.p5_id\n" 414 414 " WHERE\n" 415 415 " p5Run.state = 'run'\n" 416 " AND p5DiffS cfile.p5_id IS NULL\n"416 " AND p5DiffSkyfile.p5_id IS NULL\n" 417 417 ); 418 418 419 419 if (config->where) { 420 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p5S cfile");420 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p5Skyfile"); 421 421 psStringAppend(&query, " AND %s", whereClause); 422 422 psFree(whereClause); … … 452 452 } 453 453 if (!psArrayLength(output)) { 454 psError(PS_ERR_UNKNOWN, false, "no p5S cfile rows found");454 psError(PS_ERR_UNKNOWN, false, "no p5Skyfile rows found"); 455 455 psFree(output); 456 456 return true; … … 469 469 if (psArrayLength(output)) { 470 470 // negative simple so the default is true 471 if (!ippdbPrintMetadatas(stdout, output, "p5S cfile", !simple)) {471 if (!ippdbPrintMetadatas(stdout, output, "p5Skyfile", !simple)) { 472 472 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 473 473 psFree(output); … … 482 482 483 483 484 static bool adddiffs cfileMode(pxConfig *config)484 static bool adddiffskyfileMode(pxConfig *config) 485 485 { 486 486 PS_ASSERT_PTR_NON_NULL(config, false); … … 521 521 522 522 523 if (!p5DiffS cfileInsert(config->dbh,523 if (!p5DiffSkyfileInsert(config->dbh, 524 524 (psS32)atoi(p5_id), 525 525 uri, … … 535 535 536 536 537 static bool diffs cfileMode(pxConfig *config)537 static bool diffskyfileMode(pxConfig *config) 538 538 { 539 539 PS_ASSERT_PTR_NON_NULL(config, false); … … 551 551 " p5Run.skycell_id,\n" 552 552 " p5Run.tess_id,\n" 553 " p5DiffS cfile.*\n"553 " p5DiffSkyfile.*\n" 554 554 " FROM p5Run\n" 555 " JOIN p5DiffS cfile\n"555 " JOIN p5DiffSkyfile\n" 556 556 " USING(p5_id)\n" 557 557 " WHERE\n" … … 560 560 561 561 if (config->where) { 562 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p5DiffS cfile");562 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p5DiffSkyfile"); 563 563 psStringAppend(&query, " AND %s", whereClause); 564 564 psFree(whereClause); … … 594 594 } 595 595 if (!psArrayLength(output)) { 596 psError(PS_ERR_UNKNOWN, false, "no p5DiffS cfile rows found");596 psError(PS_ERR_UNKNOWN, false, "no p5DiffSkyfile rows found"); 597 597 psFree(output); 598 598 return true; … … 611 611 if (psArrayLength(output)) { 612 612 // negative simple so the default is true 613 if (!ippdbPrintMetadatas(stdout, output, "p5DiffS cfile", !simple)) {613 if (!ippdbPrintMetadatas(stdout, output, "p5DiffSkyfile", !simple)) { 614 614 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 615 615 psFree(output);
Note:
See TracChangeset
for help on using the changeset viewer.
