Changeset 6713 for branches/rel10_ifa/psModules/src/astrom/pmFPAview.c
- Timestamp:
- Mar 27, 2006, 4:16:26 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/rel10_ifa/psModules/src/astrom/pmFPAview.c
r6573 r6713 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1.2. 4$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-03- 14 02:21:07$5 * @version $Revision: 1.1.2.5 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-03-28 02:16:26 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 15 15 #include "pslib.h" 16 16 #include "pmHDU.h" 17 #include "pmHDUUtils.h" 17 18 #include "pmFPA.h" 18 19 #include "pmFPAview.h" … … 212 213 pmHDU *pmFPAviewThisHDU (pmFPAview *view, pmFPA *fpa) 213 214 { 214 215 215 // the HDU is attached to a cell, chip or fpa 216 216 // if this view has a -1 for the level which contains the hdu, … … 229 229 } 230 230 231 // select the rule from the camera configuration, perform substitutions as needed 232 char *pmFPAviewNameFromRule (char *rule, pmFPAview *view, pmFPA *fpa) 233 { 234 235 char *newName = NULL; // destination for resulting name 236 237 newName = psStringCopy (rule); 238 239 if (strstr (newName, "{CHIP.NAME}") != NULL) { 240 pmChip *chip = pmFPAviewThisChip (view, fpa); 241 if (chip != NULL) { 242 char *name = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME"); 243 if (name != NULL) { 244 newName = psStringSubstitute (newName, name, "{CHIP.NAME}"); 245 } 246 } 247 } 248 if (strstr (newName, "{CELL.NAME}") != NULL) { 249 pmCell *cell = pmFPAviewThisCell (view, fpa); 250 if (cell != NULL) { 251 char *name = psMetadataLookupStr (NULL, cell->concepts, "CELL.NAME"); 252 if (name != NULL) { 253 newName = psStringSubstitute (newName, name, "{CELL.NAME}"); 254 } 255 } 256 } 257 if (strstr (newName, "{EXTNAME}") != NULL) { 258 pmHDU *hdu = pmFPAviewThisHDU (view, fpa); 259 if (hdu->extname != NULL) { 260 newName = psStringSubstitute (newName, hdu->extname, "{EXTNAME}"); 261 } 262 } 263 return newName; 264 } 231 pmHDU *pmFPAviewThisPHU (pmFPAview *view, pmFPA *fpa) 232 { 233 // select the HDU which corresponds to the PHU containing this view 234 235 pmHDU *hdu; 236 pmFPAview *new; 237 pmChip *chip; 238 pmCell *cell; 239 240 *new = *view; 241 242 if (view->chip < 0) { 243 hdu = pmHDUFromFPA (fpa); 244 if (hdu->phu) 245 return hdu; 246 return NULL; 247 } 248 if (view->cell < 0) { 249 chip = pmFPAviewThisChip (view, fpa); 250 hdu = pmHDUFromChip (chip); 251 if (hdu->phu) 252 return hdu; 253 new->chip = -1; 254 hdu = pmFPAviewThisPHU (new, fpa); 255 return hdu; 256 } 257 if (view->readout < 0) { 258 cell = pmFPAviewThisCell (view, fpa); 259 hdu = pmHDUFromCell (cell); 260 if (hdu->phu) 261 return hdu; 262 new->cell = -1; 263 hdu = pmFPAviewThisPHU (new, fpa); 264 return hdu; 265 } 266 return NULL; 267 }
Note:
See TracChangeset
for help on using the changeset viewer.
