Changeset 18905
- Timestamp:
- Aug 4, 2008, 4:16:06 PM (18 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 2 added
- 6 edited
-
camera/pmFPAview.c (modified) (2 diffs)
-
camera/pmFPAview.h (modified) (2 diffs)
-
config/Makefile.am (modified) (1 diff)
-
config/pmConfig.c (modified) (4 diffs)
-
config/pmConfig.h (modified) (4 diffs)
-
config/pmConfigDump.c (added)
-
config/pmConfigDump.h (added)
-
psmodules.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAview.c
r15972 r18905 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $6 * @date $Date: 2008-0 1-02 20:33:14$5 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2008-08-05 02:16:06 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 374 374 } 375 375 376 pmFPAview *pmFPAviewTop(const pmFPA *fpa) 377 { 378 PS_ASSERT_PTR_NON_NULL(fpa, NULL); 379 380 pmFPAview *view = pmFPAviewAlloc(0);// View to top 381 382 int numChips = 0; // Number of active chips 383 psArray *chips = fpa->chips; // Chips of interest 384 for (int i = 0; i < chips->n; i++) { 385 pmChip *chip = chips->data[i]; // Chip of interest 386 if (!chip || !chip->file_exists) { 387 continue; 388 } 389 numChips++; 390 view->chip = i; 391 392 int numCells = 0; // Number of active cells 393 psArray *cells = chip->cells; // Cells of interest 394 for (int j = 0; j < cells->n; j++) { 395 pmCell *cell = cells->data[j]; // Cell of interest 396 if (!cell || !cell->file_exists) { 397 continue; 398 } 399 numCells++; 400 view->cell = j; 401 } 402 403 if (numCells > 1) { 404 if (numCells != cells->n) { 405 psWarning("More than one, but not all cells are active."); 406 } 407 view->cell = -1; 408 } 409 } 410 411 if (numChips > 1) { 412 if (numChips != chips->n) { 413 psWarning("More than one, but not all chips are active."); 414 } 415 view->chip = -1; 416 view->cell = -1; 417 } 418 419 return view; 420 } 421 -
trunk/psModules/src/camera/pmFPAview.h
r15972 r18905 4 4 * @author Eugene Magnier, IfA 5 5 * 6 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $7 * @date $Date: 2008-0 1-02 20:33:14$6 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2008-08-05 02:16:06 $ 8 8 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii 9 9 */ … … 124 124 125 125 126 /// Determine the view suitable for the top level of the provided FPA 127 pmFPAview *pmFPAviewTop(const pmFPA *fpa ///< FPA of interest 128 ); 129 126 130 /// @} 127 131 #endif -
trunk/psModules/src/config/Makefile.am
r13591 r18905 4 4 libpsmodulesconfig_la_LDFLAGS = -release $(PACKAGE_VERSION) 5 5 libpsmodulesconfig_la_SOURCES = \ 6 pmConfig.c \ 7 pmConfigRecipes.c \ 8 pmConfigCamera.c \ 9 pmConfigCommand.c \ 10 pmConfigMask.c \ 11 pmVersion.c \ 12 pmErrorCodes.c 6 pmConfig.c \ 7 pmConfigRecipes.c \ 8 pmConfigCamera.c \ 9 pmConfigCommand.c \ 10 pmConfigMask.c \ 11 pmConfigDump.c \ 12 pmVersion.c \ 13 pmErrorCodes.c 13 14 14 15 pkginclude_HEADERS = \ 15 pmConfig.h \ 16 pmConfigRecipes.h \ 17 pmConfigCamera.h \ 18 pmConfigCommand.h \ 19 pmConfigMask.h \ 20 pmVersion.h \ 21 pmErrorCodes.h 16 pmConfig.h \ 17 pmConfigRecipes.h \ 18 pmConfigCamera.h \ 19 pmConfigCommand.h \ 20 pmConfigMask.h \ 21 pmConfigDump.h \ 22 pmVersion.h \ 23 pmErrorCodes.h 22 24 23 25 # Error codes. -
trunk/psModules/src/config/pmConfig.c
r18830 r18905 68 68 psFree(config->arguments); 69 69 psFree(config->database); 70 psFree(config->program); 70 71 71 72 // Close log and trace files … … 150 151 config->database = NULL; 151 152 config->defaultRecipe = NULL; 153 config->program = NULL; 152 154 153 155 config->traceFD = DEFAULT_TRACE; … … 442 444 443 445 pmConfig *config = pmConfigAlloc(); // The configuration, containing site, camera and recipes 446 config->program = psStringCopy(argv[0]); 444 447 config->defaultRecipe = defaultRecipe; 445 448 … … 1745 1748 } 1746 1749 1747 1748 #if 01749 bool pmConfigDump(const pmConfig *config, const pmFPA *source, const char *outroot)1750 {1751 PS_ASSERT_PTR_NON_NULL(config, false);1752 PS_ASSERT_STRING_NON_EMPTY(outroot, false);1753 1754 pmFPAview *view = source ? pmFPAviewTop(source) : pmFPAviewAlloc(0);// View to top level1755 if (!view) {1756 psError(PS_ERR_UNKNOWN, false, "Unable to determine top view for FPA.");1757 return false;1758 }1759 1760 psMetadata *dumpRules = psMetadataLookupMetadata(NULL, config->system, "CONFIG.RULES"); // Name rules1761 if (!dumpRules) {1762 psError(PS_ERR_UNKNOWN, false, "Unable to find CONFIG.RULES in system configuration");1763 psFree(view);1764 return false;1765 }1766 1767 const char *name =1768 #endif -
trunk/psModules/src/config/pmConfig.h
r18073 r18905 5 5 * @author Eugene Magnier, IfA 6 6 * 7 * @version $Revision: 1.3 8$ $Name: not supported by cvs2svn $8 * @date $Date: 2008-0 6-10 21:53:09$7 * @version $Revision: 1.39 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2008-08-05 02:16:06 $ 9 9 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii 10 10 */ … … 37 37 /// command-line arguments, the pmFPAfiles used, and the database handle. 38 38 typedef struct { 39 psMetadata *user; ///< User configuration40 psMetadata *site; ///< Site configuration41 psMetadata *system; ///< System configuration39 psMetadata *user; ///< User configuration 40 psMetadata *site; ///< Site configuration 41 psMetadata *system; ///< System configuration 42 42 psMetadata *complete; ///< Full merged configuration 43 43 psMetadata *camera; ///< Camera specification … … 51 51 psDB *database; ///< Database handle 52 52 const char *defaultRecipe; ///< name of top-level recipe for this program 53 psString program; ///< Name of program 53 54 // Private members 54 55 pmRecipeSource recipesRead; ///< Which recipe sources have been read … … 108 109 /// configuration. The accepted format is returned. 109 110 psMetadata *pmConfigCameraFormatFromHeader(psMetadata **camera, // selected camera (or meta-camera) 110 psString *formatName, // selected format name111 pmConfig *config, ///< The configuration111 psString *formatName, // selected format name 112 pmConfig *config, ///< The configuration 112 113 const psMetadata *header, ///< The FITS header 113 114 bool readRecipes ///< optionally read the recipes as well as the format -
trunk/psModules/src/psmodules.h
r18893 r18905 26 26 #include <pmConfigCommand.h> 27 27 #include <pmConfigMask.h> 28 #include <pmConfigDump.h> 28 29 #include <pmVersion.h> 29 30
Note:
See TracChangeset
for help on using the changeset viewer.
