Changeset 20397
- Timestamp:
- Oct 25, 2008, 9:12:41 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
-
dbconfig/changes.txt (modified) (1 diff)
-
dbconfig/flatcorr.md (modified) (2 diffs)
-
ippTools/share/Makefile.am (modified) (1 diff)
-
ippTools/share/flatcorr_chiprundone.sql (modified) (1 diff)
-
ippTools/share/flatcorr_dropcamera.sql (added)
-
ippTools/share/flatcorr_dropchip.sql (added)
-
ippTools/share/flatcorr_pendingprocess.sql (modified) (2 diffs)
-
ippTools/share/pxadmin_create_tables.sql (modified) (2 diffs)
-
ippTools/src/flatcorr.c (modified) (6 diffs)
-
ippTools/src/flatcorr.h (modified) (1 diff)
-
ippTools/src/flatcorrConfig.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dbconfig/changes.txt
r20374 r20397 678 678 679 679 * 1.1.46 680 680 681 ALTER TABLE pzDownloadImfile ADD COLUMN hostname varchar(64) after epoch; 681 682 ALTER TABLE flatcorrRun ADD COLUMN det_type varchar(64) after corr_id; 682 683 ALTER TABLE flatcorrChipLink ADD COLUMN include tinyint after chip_id; 684 ALTER TABLE flatcorrCamLink ADD COLUMN include tinyint after cam_id; -
trunk/dbconfig/flatcorr.md
r20374 r20397 22 22 corr_id S64 0 # Primary Key fkey(corr_id) ref flatcorrRun(corr_id) 23 23 chip_id S64 0 # Primary Key fkey(chip_id) ref chipRun(chip_id) 24 include BOOL t 24 25 END 25 26 … … 29 30 chip_id S64 0 # Primary Key fkey(chip_id) ref chipRun(chip_id) 30 31 cam_id S64 0 # Primary Key fkey(chip_id) ref chipRun(chip_id) 32 include BOOL t 31 33 END 32 34 -
trunk/ippTools/share/Makefile.am
r19776 r20397 95 95 flatcorr_pendingprocess.sql \ 96 96 flatcorr_inputimfile.sql \ 97 flatcorr_dropchip.sql \ 98 flatcorr_dropcamera.sql \ 97 99 magictool_addmask.sql \ 98 100 magictool_create_tmp_warpcomplete.sql \ -
trunk/ippTools/share/flatcorr_chiprundone.sql
r19325 r20397 12 12 WHERE 13 13 flatcorrRun.state = 'new' 14 AND flatcorrChipLink.include = 1 14 15 AND chipRun.state = 'full' 15 16 AND camRun.cam_id is NULL; -
trunk/ippTools/share/flatcorr_pendingprocess.sql
r20376 r20397 20 20 JOIN flatcorrChipLink 21 21 ON flatcorrChipLink.corr_id = flatcorrRun.corr_id 22 WHERE flatcorrChipLink.include = 1 22 23 GROUP BY 23 24 flatcorrChipLink.corr_id) AS t1 … … 30 31 ON flatcorrCamLink.cam_id = camRun.cam_id 31 32 WHERE camRun.state = 'full' 33 AND flatcorrCamLink.include = 1 32 34 GROUP BY 33 35 flatcorrCamLink.corr_id) AS t2 -
trunk/ippTools/share/pxadmin_create_tables.sql
r20376 r20397 1100 1100 corr_id BIGINT, 1101 1101 chip_id BIGINT, 1102 include TINYINT, 1102 1103 PRIMARY KEY(corr_id, chip_id), 1103 1104 FOREIGN KEY (corr_id) REFERENCES flatcorrRun(corr_id), … … 1109 1110 chip_id BIGINT, 1110 1111 cam_id BIGINT, 1112 include TINYINT, 1111 1113 PRIMARY KEY(corr_id, cam_id), 1112 1114 FOREIGN KEY (corr_id) REFERENCES flatcorrRun(corr_id), -
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 -
trunk/ippTools/src/flatcorr.h
r19325 r20397 29 29 FLATCORR_MODE_ADDCHIP, 30 30 FLATCORR_MODE_ADDCAMERA, 31 FLATCORR_MODE_DROPCHIP, 32 FLATCORR_MODE_DROPCAMERA, 31 33 FLATCORR_MODE_PENDINGPROCESS, 32 34 FLATCORR_MODE_ADDPROCESS, -
trunk/ippTools/src/flatcorrConfig.c
r20377 r20397 81 81 psMetadataAddS64(addchipArgs, PS_LIST_TAIL, "-chip_id", 0, "define Chip ID (required)", 0); 82 82 83 // -dropchip 84 psMetadata *dropchipArgs = psMetadataAlloc(); 85 psMetadataAddS64(dropchipArgs, PS_LIST_TAIL, "-corr_id", 0, "define Flat Correction ID (required)", 0); 86 psMetadataAddS64(dropchipArgs, PS_LIST_TAIL, "-chip_id", 0, "define Chip ID (required)", 0); 87 83 88 // -addcamera 84 89 psMetadata *addcameraArgs = psMetadataAlloc(); … … 86 91 psMetadataAddBool(addcameraArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 87 92 psMetadataAddBool(addcameraArgs, PS_LIST_TAIL, "-pretend", 0, "use the simple output format", false); 93 94 // -dropcamera 95 psMetadata *dropcameraArgs = psMetadataAlloc(); 96 psMetadataAddS64(dropcameraArgs, PS_LIST_TAIL, "-corr_id", 0, "define Flat Correction ID (required)", 0); 97 psMetadataAddS64(dropcameraArgs, PS_LIST_TAIL, "-cam_id", 0, "define Camera ID (required)", 0); 88 98 89 99 // -pendingprocess … … 124 134 PXOPT_ADD_MODE("-addchip", "add a chip to a flat correction run", FLATCORR_MODE_ADDCHIP, addchipArgs); 125 135 PXOPT_ADD_MODE("-addcamera", "migrate completed chips to camera stage analysis", FLATCORR_MODE_ADDCAMERA, addcameraArgs); 136 PXOPT_ADD_MODE("-dropchip", "drop a chip from a flat correction run", FLATCORR_MODE_DROPCHIP, dropchipArgs); 137 PXOPT_ADD_MODE("-dropcamera", "drop an exposure (camera stage analysis)", FLATCORR_MODE_DROPCAMERA, dropcameraArgs); 126 138 PXOPT_ADD_MODE("-pendingprocess", "show flat correction runs needing to be processed", FLATCORR_MODE_PENDINGPROCESS, pendingprocessArgs); 127 139 PXOPT_ADD_MODE("-addprocess", "report completed flat correction analysis", FLATCORR_MODE_ADDPROCESS, addprocessArgs);
Note:
See TracChangeset
for help on using the changeset viewer.
