Changeset 20397 for trunk/ippTools/src/flatcorr.c
- Timestamp:
- Oct 25, 2008, 9:12:41 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/flatcorr.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/flatcorr.c
r20377 r20397 39 39 static bool addchipMode(pxConfig *config); 40 40 static bool addcameraMode(pxConfig *config); 41 static bool dropchipMode(pxConfig *config); 42 static bool dropcameraMode(pxConfig *config); 41 43 static bool pendingprocessMode(pxConfig *config); 42 44 static bool addprocessMode(pxConfig *config); … … 69 71 MODECASE(FLATCORR_MODE_ADDCHIP, addchipMode); 70 72 MODECASE(FLATCORR_MODE_ADDCAMERA, addcameraMode); 73 MODECASE(FLATCORR_MODE_DROPCHIP, dropchipMode); 74 MODECASE(FLATCORR_MODE_DROPCAMERA, dropcameraMode); 71 75 MODECASE(FLATCORR_MODE_PENDINGPROCESS, pendingprocessMode); 72 76 MODECASE(FLATCORR_MODE_ADDPROCESS, addprocessMode); … … 236 240 } 237 241 238 // add a flatcorrChipLink to the flatcorr Run we just created 239 if (!flatcorrChipLinkInsert(config->dbh, corr_id, chip_id )) {242 // add a flatcorrChipLink to the flatcorr Run we just created (initial state has include = TRUE) 243 if (!flatcorrChipLinkInsert(config->dbh, corr_id, chip_id, 1)) { 240 244 if (!psDBRollback(config->dbh)) { 241 245 psError(PS_ERR_UNKNOWN, false, "database error"); … … 337 341 PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", true, false); 338 342 339 if (!flatcorrChipLinkInsert(config->dbh, corr_id, chip_id)) { 340 psError(PS_ERR_UNKNOWN, false, "database error"); 343 // add a flatcorrChipLink (initial state has include = TRUE) 344 if (!flatcorrChipLinkInsert(config->dbh, corr_id, chip_id, 1)) { 345 psError(PS_ERR_UNKNOWN, false, "database error"); 346 return false; 347 } 348 349 return true; 350 } 351 352 static bool dropchipMode(pxConfig *config) 353 { 354 PS_ASSERT_PTR_NON_NULL(config, false); 355 356 // required 357 PXOPT_LOOKUP_S64(corr_id, config->args, "-corr_id", true, false); 358 PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", true, false); 359 360 // UPDATE flatcorrChipLink set include = 0 where corr_id = %lld AND chip_id = %lld 361 psString query = pxDataGet("flatcorr_dropchip.sql"); 362 if (!query) { 363 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 364 return false; 365 } 366 367 if (!p_psDBRunQuery(config->dbh, query, (long long) corr_id, (long long) chip_id)) { 368 psError(PS_ERR_UNKNOWN, false, "database error"); 369 psFree(query); 341 370 return false; 342 371 } … … 448 477 psS64 cam_id = psDBLastInsertID(config->dbh); 449 478 450 // add the camRun entry to the flatcorrCamLink table :451 if (!flatcorrCamLinkInsert(config->dbh, corr_id, row->chip_id, cam_id )) {479 // add the camRun entry to the flatcorrCamLink table (include is TRUE) 480 if (!flatcorrCamLinkInsert(config->dbh, corr_id, row->chip_id, cam_id, 1)) { 452 481 if (!psDBRollback(config->dbh)) { 453 482 psError(PS_ERR_UNKNOWN, false, "database error"); … … 467 496 468 497 return false; 498 } 499 500 static bool dropcameraMode(pxConfig *config) 501 { 502 PS_ASSERT_PTR_NON_NULL(config, false); 503 504 // required 505 PXOPT_LOOKUP_S64(corr_id, config->args, "-corr_id", true, false); 506 PXOPT_LOOKUP_S64(cam_id, config->args, "-cam_id", true, false); 507 508 // UPDATE flatcorrCamLink set include = 0 where corr_id = %lld AND cam_id = %lld 509 psString query = pxDataGet("flatcorr_dropcamera.sql"); 510 if (!query) { 511 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 512 return false; 513 } 514 515 if (!p_psDBRunQuery(config->dbh, query, (long long) corr_id, (long long) cam_id)) { 516 psError(PS_ERR_UNKNOWN, false, "database error"); 517 psFree(query); 518 return false; 519 } 520 521 return true; 469 522 } 470 523
Note:
See TracChangeset
for help on using the changeset viewer.
