Changeset 7469 for trunk/psModules/src/camera
- Timestamp:
- Jun 9, 2006, 3:55:20 PM (20 years ago)
- Location:
- trunk/psModules/src/camera
- Files:
-
- 4 edited
-
pmFPAConstruct.c (modified) (4 diffs)
-
pmFPAHeader.c (modified) (3 diffs)
-
pmFPARead.c (modified) (5 diffs)
-
pmFPAWrite.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAConstruct.c
r7449 r7469 138 138 fpa->hdu = psMemIncrRefCounter(hdu); 139 139 bool success = true; // Success of reading concepts 140 if (hdu->header && !pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_HEADER, NULL)) {140 if (hdu->header && !pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_HEADER, false, NULL)) { 141 141 psError(PS_ERR_UNKNOWN, false, "Unable to read concepts from header.\n"); 142 142 success = false; … … 164 164 chip->hdu = psMemIncrRefCounter(hdu); 165 165 bool success = true; // Success of reading concepts 166 if (hdu->header && !pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_HEADER, true, NULL)) {166 if (hdu->header && !pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_HEADER, true, false, NULL)) { 167 167 psError(PS_ERR_UNKNOWN, false, "Unable to read concepts from header.\n"); 168 168 success = false; … … 299 299 } 300 300 301 if (!pmConceptsReadChip(newChip, PM_CONCEPT_SOURCE_DEFAULTS, false, NULL)) {301 if (!pmConceptsReadChip(newChip, PM_CONCEPT_SOURCE_DEFAULTS, false, false, NULL)) { 302 302 psError(PS_ERR_UNKNOWN, false, "Unable to read concepts from camera and defaults for chip %s\n", 303 303 chipName); … … 751 751 psFree(contentsIter); 752 752 753 if (!pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_DEFAULTS, NULL)) {753 if (!pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_DEFAULTS, true, NULL)) { 754 754 psError(PS_ERR_UNKNOWN, false, "Unable to read concepts from defaults for FPA %s. Attempting to " 755 755 "proceed anyway.\n", currentFPAname); -
trunk/psModules/src/camera/pmFPAHeader.c
r7314 r7469 6 6 #include "pmConcepts.h" 7 7 #include "pmFPAHeader.h" 8 9 //////////////////////////////////////////////////////////////////////////////////////////////////////////////10 // File-static (private) functions11 //////////////////////////////////////////////////////////////////////////////////////////////////////////////12 13 // Read concepts for all cells in a chip14 static bool chipConcepts(pmChip *chip // The chip for which to read the concepts15 )16 {17 assert(chip);18 19 bool status = true; // Status of concept reading20 status |= pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_HEADER, false, NULL);21 psArray *cells = chip->cells; // The cells22 for (int i = 0; i < cells->n; i++) {23 pmCell *cell = cells->data[i]; // The cell of interest24 if (!cell) {25 continue;26 }27 status |= pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER, false, NULL);28 }29 30 return status;31 }32 33 // Read concepts for all chips in an FPA34 static bool fpaConcepts(pmFPA *fpa // The FPA for which to read the concepts35 )36 {37 assert(fpa);38 39 bool status = true; // Status of concept reading40 status |= pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_HEADER, NULL);41 psArray *chips = fpa->chips; // The chips42 for (int i = 0; i < chips->n; i++) {43 pmChip *chip = chips->data[i]; // The chip of interest44 if (!chip) {45 continue;46 }47 status |= chipConcepts(chip);48 }49 50 return status;51 }52 53 8 54 9 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 90 45 } 91 46 92 if (! chipConcepts(chip)) {47 if (!pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_HEADER, true, true, NULL)) { 93 48 psError(PS_ERR_UNKNOWN, false, "Unable to read concepts for chip.\n"); 94 49 return false; … … 114 69 } 115 70 116 if (! fpaConcepts(fpa)) {71 if (!pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_HEADER, true, NULL)) { 117 72 psError(PS_ERR_UNKNOWN, false, "Unable to read concepts for FPA.\n"); 118 73 return false; -
trunk/psModules/src/camera/pmFPARead.c
r7407 r7469 183 183 184 184 // Make sure we have the information we need 185 pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CAMERA | PM_CONCEPT_SOURCE_DEFAULTS, 186 false, NULL); 185 if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CAMERA | 186 PM_CONCEPT_SOURCE_DEFAULTS, true, NULL)) { 187 psError(PS_ERR_IO, false, "Failed to read concepts for cell.\n"); 188 return false; 189 } 187 190 188 191 // Get the trim and bias sections … … 322 325 } 323 326 324 if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER, false, NULL)) {327 if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER, true, NULL)) { 325 328 psError(PS_ERR_UNKNOWN, false, "Failed to read concepts for cell"); 326 329 return false; … … 354 357 } 355 358 356 pmCellSetDataStatus (cell, true);359 pmCellSetDataStatus(cell, true); 357 360 return true; 358 361 } … … 374 377 } 375 378 if (success) { 376 pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_HEADER, false, NULL); 379 if (!pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_HEADER, true, true, NULL)) { 380 psError(PS_ERR_IO, false, "Failed to read concepts for FPA.\n"); 381 return false; 382 } 377 383 // XXX probably could just use chip->data_exists 378 pmChipSetDataStatus (chip, true);384 pmChipSetDataStatus(chip, true); 379 385 } 380 386 … … 398 404 } 399 405 if (success) { 400 pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_HEADER, NULL); 406 if (!pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_HEADER, true, NULL)) { 407 psError(PS_ERR_IO, false, "Failed to read concepts for FPA.\n"); 408 return false; 409 } 401 410 } else { 402 411 psError(PS_ERR_UNKNOWN, false, "Unable to read any chips in FPA"); -
trunk/psModules/src/camera/pmFPAWrite.c
r7278 r7469 136 136 (pixels && (hdu->images || (!hdu->images && pmHDUGenerateForChip(chip) && hdu->images)))) { // Data 137 137 success &= pmConceptsWriteChip(chip, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CAMERA | 138 PM_CONCEPT_SOURCE_DEFAULTS, false, NULL);138 PM_CONCEPT_SOURCE_DEFAULTS, false, true, NULL); 139 139 success &= pmHDUWrite(hdu, fits); 140 140 } … … 177 177 (pixels && (hdu->images || (!hdu->images && pmHDUGenerateForFPA(fpa) && hdu->images)))) { // Data 178 178 success &= pmConceptsWriteFPA(fpa, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CAMERA | 179 PM_CONCEPT_SOURCE_DEFAULTS, NULL);179 PM_CONCEPT_SOURCE_DEFAULTS, true, NULL); 180 180 success &= pmHDUWrite(hdu, fits); 181 181 }
Note:
See TracChangeset
for help on using the changeset viewer.
