IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 4, 2008, 4:16:06 PM (18 years ago)
Author:
Paul Price
Message:

Adding functions to dump configuration to an MDC file on disk, so we can record what parameters we used.

Location:
trunk/psModules/src/config
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/config/Makefile.am

    r13591 r18905  
    44libpsmodulesconfig_la_LDFLAGS  = -release $(PACKAGE_VERSION)
    55libpsmodulesconfig_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
    1314
    1415pkginclude_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
    2224
    2325# Error codes.
  • trunk/psModules/src/config/pmConfig.c

    r18830 r18905  
    6868    psFree(config->arguments);
    6969    psFree(config->database);
     70    psFree(config->program);
    7071
    7172    // Close log and trace files
     
    150151    config->database = NULL;
    151152    config->defaultRecipe = NULL;
     153    config->program = NULL;
    152154
    153155    config->traceFD = DEFAULT_TRACE;
     
    442444
    443445    pmConfig *config = pmConfigAlloc(); // The configuration, containing site, camera and recipes
     446    config->program = psStringCopy(argv[0]);
    444447    config->defaultRecipe = defaultRecipe;
    445448
     
    17451748}
    17461749
    1747 
    1748 #if 0
    1749 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 level
    1755     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 rules
    1761     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  
    55 *  @author Eugene Magnier, IfA
    66 *
    7  *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2008-06-10 21:53:09 $
     7 *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2008-08-05 02:16:06 $
    99 *  Copyright 2005-2006 Institute for Astronomy, University of Hawaii
    1010 */
     
    3737/// command-line arguments, the pmFPAfiles used, and the database handle.
    3838typedef struct {
    39     psMetadata *user;                   ///< User configuration
    40     psMetadata *site;                   ///< Site configuration
    41     psMetadata *system;                 ///< System configuration
     39    psMetadata *user;                   ///< User configuration
     40    psMetadata *site;                   ///< Site configuration
     41    psMetadata *system;                 ///< System configuration
    4242    psMetadata *complete;               ///< Full merged configuration
    4343    psMetadata *camera;                 ///< Camera specification
     
    5151    psDB *database;                     ///< Database handle
    5252    const char *defaultRecipe;          ///< name of top-level recipe for this program
     53    psString program;                   ///< Name of program
    5354    // Private members
    5455    pmRecipeSource recipesRead;         ///< Which recipe sources have been read
     
    108109/// configuration.  The accepted format is returned.
    109110psMetadata *pmConfigCameraFormatFromHeader(psMetadata **camera, // selected camera (or meta-camera)
    110                                            psString *formatName, // selected format name
    111                                            pmConfig *config, ///< The configuration
     111                                           psString *formatName, // selected format name
     112                                           pmConfig *config, ///< The configuration
    112113                                           const psMetadata *header, ///< The FITS header
    113114                                           bool readRecipes ///< optionally read the recipes as well as the format
Note: See TracChangeset for help on using the changeset viewer.