Changeset 6841
- Timestamp:
- Apr 11, 2006, 6:44:00 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/rel10_ifa/psModules/src/astrom/pmFPAConstruct.c
r6839 r6841 90 90 // Get the name of a PHU chip or cell from the header 91 91 static psString phuNameFromHeader(const char *name, // The name to lookup: "CELL.NAME" or "CHIP.NAME" 92 const psMetadata *f ormat, // FILE within the camera format description92 const psMetadata *fileInfo, // FILE within the camera format description 93 93 const psMetadata *header // Primary header 94 94 ) 95 95 { 96 96 bool mdok = true; // Result of MD lookup 97 psString keyword = psMetadataLookupStr(&mdok, f ormat, name);97 psString keyword = psMetadataLookupStr(&mdok, fileInfo, name); 98 98 if (!mdok || strlen(keyword) == 0) { 99 99 return false; … … 181 181 182 182 // Looks up the particular content based on the header 183 static const char *getContent(psMetadata *f ormat, // The FORMATfrom the camera format configuration183 static const char *getContent(psMetadata *fileInfo, // The FILE from the camera format configuration 184 184 psMetadata *contents, // The CONTENTS from the camera format configuration 185 185 psMetadata *header // The (primary) header … … 187 187 { 188 188 bool mdok = true; // Status of MD lookup 189 const char *contentHeaders = psMetadataLookupStr(&mdok, f ormat, "CONTENT"); // Headers for content189 const char *contentHeaders = psMetadataLookupStr(&mdok, fileInfo, "CONTENT"); // Headers for content 190 190 if (!mdok || !contentHeaders || strlen(contentHeaders) == 0) { 191 psError(PS_ERR_IO, true, "Unable to find CONTENT in F ORMAT.\n");191 psError(PS_ERR_IO, true, "Unable to find CONTENT in FILE within camera format configuration.\n"); 192 192 return NULL; 193 193 } … … 496 496 497 497 bool mdok = true; // Status from metadata lookups 498 psMetadata *f ormatSpec = psMetadataLookupMD(&mdok, format, "FILE"); // The format specification499 if (!mdok || !f ormatSpec) {498 psMetadata *fileInfo = psMetadataLookupMD(&mdok, format, "FILE"); // The file information 499 if (!mdok || !fileInfo) { 500 500 psError(PS_ERR_IO, false, "Unable to find FILE in the camera format configuration.\n"); 501 501 return NULL; … … 503 503 504 504 // Check the name of the FPA 505 psString newFPAname = phuNameFromHeader("FPA.NAME", f ormatSpec, phu); // New name for the FPA505 psString newFPAname = phuNameFromHeader("FPA.NAME", fileInfo, phu); // New name for the FPA 506 506 const char *currentFPAname = psMetadataLookupStr(&mdok, fpa->concepts, "FPA.NAME"); // Current name 507 507 if (mdok && currentFPAname && strlen(currentFPAname) > 0 && strcmp(currentFPAname, newFPAname) != 0) { … … 513 513 514 514 // Where does the PHU go? 515 const char *phuType = psMetadataLookupStr(&mdok, f ormatSpec, "PHU"); // What is the PHU?515 const char *phuType = psMetadataLookupStr(&mdok, fileInfo, "PHU"); // What is the PHU? 516 516 if (!mdok || strlen(phuType) == 0) { 517 517 psError(PS_ERR_IO, false, "Unable to find PHU in the format specification.\n"); … … 528 528 529 529 // And what are the individual extensions? 530 const char *extType = psMetadataLookupStr(&mdok, f ormatSpec, "EXTENSIONS"); // What's in the extns?530 const char *extType = psMetadataLookupStr(&mdok, fileInfo, "EXTENSIONS"); // What's in the extns? 531 531 if (!mdok || strlen(extType) == 0) { 532 532 psError(PS_ERR_IO, false, "Unable to find EXTENSIONS in the format specification.\n"); … … 565 565 if (strcasecmp(extType, "NONE") == 0) { 566 566 // We have already dealt with the case PHU=FPA, in a special case, above. 567 const char *content = getContent(f ormatSpec, contents, phu); // The content: string of chip:cell pairs567 const char *content = getContent(fileInfo, contents, phu); // The content: string of chip:cell pairs 568 568 569 569 // Need to look up what chip we have. 570 psString chipName = phuNameFromHeader("CHIP.NAME", f ormatSpec, phu);570 psString chipName = phuNameFromHeader("CHIP.NAME", fileInfo, phu); 571 571 psTrace(__func__, 5, "This is chip %s\n", chipName); 572 572 int chipNum = pmFPAFindChip(fpa, chipName); // Chip number … … 587 587 level = PM_FPA_LEVEL_CELL; 588 588 // Need to look up what cell we have. 589 psString cellName = phuNameFromHeader("CELL.NAME", f ormatSpec, phu);589 psString cellName = phuNameFromHeader("CELL.NAME", fileInfo, phu); 590 590 int cellNum = pmChipFindCell(chip, cellName); // Cell number 591 591 if (cellNum == -1) { … … 619 619 } else { 620 620 // Get the chip 621 psString chipName = phuNameFromHeader("CHIP.NAME", f ormatSpec, phu); // Name of the chip621 psString chipName = phuNameFromHeader("CHIP.NAME", fileInfo, phu); // Name of the chip 622 622 int chipNum = pmFPAFindChip(fpa, chipName); // Chip number 623 623 if (chipNum == -1) { … … 632 632 addHDUtoChip(chip, phdu); 633 633 } else if (strcasecmp(phuType, "CELL") == 0) { 634 psString cellName = phuNameFromHeader("CELL.NAME", f ormatSpec, phu); // Name of the cell634 psString cellName = phuNameFromHeader("CELL.NAME", fileInfo, phu); // Name of the cell 635 635 int cellNum = pmChipFindCell(chip, cellName); // Cell number 636 636 if (cellNum == -1) {
Note:
See TracChangeset
for help on using the changeset viewer.
