Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

pmConcepts.h

Go to the documentation of this file.
00001 #ifndef PM_CONCEPTS_H
00002 #define PM_CONCEPTS_H
00003 
00004 #include "pslib.h"
00005 #include "pmFPA.h"
00006 
00007 // Function to call to parse a concept once it has been read
00008 typedef psMetadataItem* (*pmConceptParseFunc)(const psMetadataItem *concept, const psMetadataItem *pattern, const psMetadata *cameraFormat, const pmFPA *fpa, const pmChip *chip, const pmCell *cell);
00009 // Function to call to format a concept for writing
00010 typedef psMetadataItem* (*pmConceptFormatFunc)(const psMetadataItem *concept, const psMetadata *cameraFormat, const pmFPA *fpa, const pmChip *chip, const pmCell *cell);
00011 
00012 // A "concept" specification
00013 typedef struct
00014 {
00015     psMetadataItem *blank;              // Blank value of concept; also contains the name
00016     pmConceptParseFunc parse;           // Function to call to read the concept
00017     pmConceptFormatFunc format;         // Function to call to write the concept
00018 }
00019 pmConceptSpec;
00020 
00021 // Allocator
00022 pmConceptSpec *pmConceptSpecAlloc(psMetadataItem *blank, // Blank value; contains the name
00023                                   pmConceptParseFunc parse, // Function to call to parse the concept
00024                                   pmConceptFormatFunc format // Function to call to format the concept
00025                                  );
00026 
00027 // Register a new concept
00028 bool pmConceptRegister(psMetadataItem *blank, // Blank value; contains the name
00029                        pmConceptParseFunc parse, // Function to call to parse the concept
00030                        pmConceptFormatFunc format, // Function to call to format the concept
00031                        pmFPALevel level // Level at which to store concept in the FPA hierarchy
00032                       );
00033 
00034 // Some specificity to reading and writing concepts
00035 typedef enum {
00036     PM_CONCEPT_SOURCE_NONE     = 0x00,  // No concepts
00037     PM_CONCEPT_SOURCE_CAMERA   = 0x01,  // Concept comes from the camera information
00038     PM_CONCEPT_SOURCE_DEFAULTS = 0x02,  // Concept comes from defaults
00039     PM_CONCEPT_SOURCE_HEADER   = 0x04,  // Concept comes from FITS header
00040     PM_CONCEPT_SOURCE_DATABASE = 0x08,  // Concept comes from database
00041     PM_CONCEPT_SOURCE_ALL      = 0x0e   // All concepts
00042 } pmConceptSource;
00043 
00044 // Set blanks, read or write concepts at the appropriate level
00045 bool pmConceptsBlankFPA(pmFPA *fpa      // FPA for which to set blank concepts
00046                        );
00047 bool pmConceptsReadFPA(pmFPA *fpa,      // FPA for which to read concepts
00048                        pmConceptSource source, // Source for concepts
00049                        bool propagateDown, // Propagate to lower levels?
00050                        psDB *db         // Database handle
00051                       );
00052 bool pmConceptsWriteFPA(pmFPA *fpa,     // FPA for which to write concepts
00053                         pmConceptSource source, // Source for concepts
00054                         bool propagateDown, // Propagate to lower levels?
00055                         psDB *db        // Database handle
00056                        );
00057 bool pmConceptsBlankChip(pmChip *chip   // FPA for which to set blank concepts
00058                         );
00059 bool pmConceptsReadChip(pmChip *chip,   // Chip for which to read concepts
00060                         pmConceptSource source, // Source for concepts
00061                         bool propagateUp, // Propagate to higher levels?
00062                         bool propagateDown, // Propagate to lower levels?
00063                         psDB *db        // Database handle
00064                        );
00065 bool pmConceptsWriteChip(pmChip *chip,  // Chip for which to write concepts
00066                          pmConceptSource source, // Source for concepts
00067                          bool propagateUp,// Propagate to higher levels?
00068                          bool propagateDown, // Propagate to lower levels?
00069                          psDB *db       // Database handle
00070                         );
00071 bool pmConceptsBlankCell(pmCell *cell   // Cell for which to set blank concepts
00072                         );
00073 bool pmConceptsReadCell(pmCell *cell,   // Cell for which to read concepts
00074                         pmConceptSource source, // Source for concepts
00075                         bool propagateUp, // Propagate to higher levels?
00076                         psDB *db        // Database handle
00077                        );
00078 bool pmConceptsWriteCell(pmCell *cell,  // FPA for which to write concepts
00079                          pmConceptSource source, // Source for concepts
00080                          bool propagateUp, // Propagate to higher levels?
00081                          psDB *db       // Database handle
00082                         );
00083 
00084 // Set up the blank concepts
00085 bool pmConceptsInit(void);
00086 // Free the concept specs so there's no memory leak
00087 void pmConceptsDone(void);
00088 
00089 // Copy all the concepts within an FPA to another FPA
00090 bool pmFPACopyConcepts(pmFPA *target,   // The target FPA
00091                        pmFPA *source    // The target FPA
00092                       );
00093 
00094 
00095 #endif

Generated on Mon Jul 3 14:24:27 2006 for Pan-STARRS Module Library by  doxygen 1.4.4