IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 26, 2009, 2:45:31 PM (17 years ago)
Author:
Paul Price
Message:

Reorganised the concepts files, moving the Write functions into pmConceptsWrite, and the Read functions into pmConceptsRead, which sort of makes sense. Added new type of concept property: copy. Most concepts use the default copy method (which is to simply copy the item), but for the TIMESYS concepts, we want to ensure that the target is of the correct type --- if it's already set (e.g., via the DEFAULTS), then we don't copy it. This will allow us to set the target TIMESYS using the DEFAULTS in the camera format, and have the output time be adjusted appropriately. Without this, the TIMESYS is simply copied, and specifying the TIMESYS in the DEFAULTS results in a warning ('values don't match'). Removed pmFPACopyConcepts, since it is pretty much the same as pmConceptsCopyFPA.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/concepts/pmConcepts.h

    r22688 r22699  
    3737
    3838/// Function to call to parse a concept once it has been read
    39 typedef psMetadataItem* (*pmConceptParseFunc)(const psMetadataItem *concept, ///< Concept to parse
    40         const psMetadataItem *pattern, ///< Pattern for parsing
    41                                               pmConceptSource source, ///< Source of concept
    42         const psMetadata *cameraFormat, ///< Camera format definition
    43         const pmFPA *fpa, ///< FPA for concept, or NULL
    44         const pmChip *chip, ///< Chip for concept, or NULL
    45         const pmCell *cell ///< Cell for concept, or NULL
    46                                              );
     39typedef psMetadataItem* (*pmConceptParseFunc)(
     40    const psMetadataItem *concept, ///< Concept to parse
     41    const psMetadataItem *pattern, ///< Pattern for parsing
     42    pmConceptSource source, ///< Source of concept
     43    const psMetadata *cameraFormat, ///< Camera format definition
     44    const pmFPA *fpa, ///< FPA for concept, or NULL
     45    const pmChip *chip, ///< Chip for concept, or NULL
     46    const pmCell *cell ///< Cell for concept, or NULL
     47    );
    4748
    4849/// Function to call to format a concept for writing
    49 typedef psMetadataItem* (*pmConceptFormatFunc)(const psMetadataItem *concept, ///< Concept to format
    50                                                pmConceptSource source, ///< Source of concept
    51         const psMetadata *cameraFormat, ///< Camera format definition
    52         const pmFPA *fpa, ///< FPA for concept, or NULL
    53         const pmChip *chip, ///< Chip for concept, or NULL
    54         const pmCell *cell ///< Cell for concept, or NULL
    55                                               );
     50typedef psMetadataItem* (*pmConceptFormatFunc)(
     51    const psMetadataItem *concept, ///< Concept to format
     52    pmConceptSource source, ///< Source of concept
     53    const psMetadata *cameraFormat, ///< Camera format definition
     54    const pmFPA *fpa, ///< FPA for concept, or NULL
     55    const pmChip *chip, ///< Chip for concept, or NULL
     56    const pmCell *cell ///< Cell for concept, or NULL
     57    );
     58
     59/// Function to call to copy a concept
     60typedef psMetadataItem* (*pmConceptCopyFunc)(
     61    const psMetadataItem *target,       ///< Target concept
     62    const psMetadataItem *source,       ///< Source concept
     63    const psMetadata *cameraFormat,     ///< Camera format definition
     64    const pmFPA *fpa,                   ///< Source FPA for concept, or NULL
     65    const pmChip *chip,                 ///< Source chip for concept, or NULL
     66    const pmCell *cell                  ///< Source cell for concept, or NULL
     67    );
     68
    5669
    5770/// A "concept" specification
     
    5972/// Defines the name, default comment, blank value, and functions to parse (after reading) and format (before
    6073/// writing) the concept.
    61 typedef struct
    62 {
     74typedef struct {
    6375    psMetadataItem *blank;              ///< Blank value of concept; also contains the name and comment
    64     pmConceptParseFunc parse;           ///< Function to call to read the concept
    65     pmConceptFormatFunc format;         ///< Function to call to write the concept
     76    pmConceptParseFunc parse;           ///< Function to call to read the concept, or NULL
     77    pmConceptFormatFunc format;         ///< Function to call to write the concept, or NULL
     78    pmConceptCopyFunc copy;             ///< Function to call to copy the concept, or NULL
    6679    bool required;                      ///< Is concept required (throw an error on problems)?
    6780}
     
    7083/// Allocator for pmConceptSpec
    7184pmConceptSpec *pmConceptSpecAlloc(psMetadataItem *blank, ///< Blank value; contains the name
    72                                   pmConceptParseFunc parse, ///< Function to call to parse the concept
    73                                   pmConceptFormatFunc format, ///< Function to call to format the concept
     85                                  pmConceptParseFunc parse, ///< Function to call to parse the concept/NULL
     86                                  pmConceptFormatFunc format, ///< Function to call to format the concept/NULL
     87                                  pmConceptCopyFunc copy, ///< Function to call to copy the concept, or NULL
    7488                                  bool required ///< Is concept required?
    7589                                 );
     
    95109                       pmConceptParseFunc parse, ///< Function to call to parse the concept, or NULL
    96110                       pmConceptFormatFunc format, ///< Function to call to format the concept, or NULL
     111                       pmConceptCopyFunc copy, ///< Function to call to copy the concept, or NULL
    97112                       bool required,   ///< Is concept required?
    98113                       pmFPALevel level ///< Level at which to store concept in the FPA hierarchy
    99114                      );
    100115
    101 /// Get a list of defined concepts for a particular level.
    102 psList *pmConceptsList(pmFPALevel level);
     116/// Get the specifications for defined concepts of a particular level
     117psMetadata *pmConceptsSpecs(pmFPALevel level);
    103118
    104 /// Read the concepts for the given set of fpa, chip, cell
    105 ///
    106 /// Attempts to read as many concepts as possible from the specified source for the specified FPA, chip and
    107 /// cell.  That is, it will read chip- and cell-level concepts in addition to fpa-level concepts, if the chip
    108 /// and cell are provided.
    109 bool pmConceptsRead(pmFPA *fpa,         ///< FPA for which to read concepts
    110                     pmChip *chip,       ///< Chip for which to read concepts, or NULL
    111                     pmCell *cell,       ///< Cell for which to read concepts, or NULL
    112                     pmConceptSource source, ///< The source of the concepts to read
    113                     pmConfig *config    ///< Configuration
    114                    );
    115119
    116120/// Set the concepts within the FPA to the blank value
    117121bool pmConceptsBlankFPA(pmFPA *fpa      ///< FPA for which to set blank concepts
    118                        );
    119 
    120 /// Read concepts for an FPA; optionally, read concepts at all lower levels.
    121 ///
    122 /// Once concepts should be available for reading at the FPA-level, this function attempts to read the
    123 /// concepts from the specified source.  It also allows concepts to be read at lower levels by iterating over
    124 /// the components.
    125 bool pmConceptsReadFPA(pmFPA *fpa,      ///< FPA for which to read concepts
    126                        pmConceptSource source, ///< Source for concepts
    127                        bool propagateDown, ///< Propagate to lower levels?
    128                        pmConfig *config         ///< Configuration
    129                       );
    130 
    131 /// Write concepts for an FPA; optionally, write concepts at all lower levels.
    132 ///
    133 /// This function writes all concepts for the FPA to the specified "source".  It also allows concepts to be
    134 /// written for all lower levels by iterating over the components.
    135 bool pmConceptsWriteFPA(const pmFPA *fpa,     ///< FPA for which to write concepts
    136                         pmConceptSource source, ///< Source for concepts
    137                         bool propagateDown, ///< Propagate to lower levels?
    138                         pmConfig *config        ///< Configuration
    139122                       );
    140123
     
    143126                        );
    144127
    145 /// Read concepts for a chip; optionally, read concepts at the FPA and cell levels.
    146 ///
    147 /// Once concepts should be available for reading at the FPA-level, this function attempts to read the
    148 /// concepts from the specified source.  It also allows concepts to be read at the fpa level (through the
    149 /// parent), and the cell level by iterating over the components.
    150 bool pmConceptsReadChip(pmChip *chip,   ///< Chip for which to read concepts
    151                         pmConceptSource source, ///< Source for concepts
    152                         bool propagateUp, ///< Propagate to higher levels?
    153                         bool propagateDown, ///< Propagate to lower levels?
    154                         pmConfig *config        ///< Configuration
    155                        );
    156 
    157 /// Write concepts for a chip; optionally, write concepts at the FPA and cell levels.
    158 ///
    159 /// This function writes all concepts for the chip to the specified "source".  It also allows concepts to be
    160 /// written for the FPA, and the cell level by iterating over the components.
    161 bool pmConceptsWriteChip(const pmChip *chip,  ///< Chip for which to write concepts
    162                          pmConceptSource source, ///< Source for concepts
    163                          bool propagateUp,///< Propagate to higher levels?
    164                          bool propagateDown, ///< Propagate to lower levels?
    165                          pmConfig *config       ///< Configuration
    166                         );
    167 
    168128/// Set the concepts within the cell to the blank value
    169129bool pmConceptsBlankCell(pmCell *cell   ///< Cell for which to set blank concepts
    170                         );
    171 
    172 /// Read concepts for a cell; optionally, read concepts for the parents.
    173 ///
    174 /// Once concepts should be available for reading at the FPA-level, this function attempts to read the
    175 /// concepts from the specified source.  It also allows concepts to be read at upper levels through the
    176 /// parents (note, it would not read concepts for all chips, but only the parent of this cell).
    177 bool pmConceptsReadCell(pmCell *cell,   ///< Cell for which to read concepts
    178                         pmConceptSource source, ///< Source for concepts
    179                         bool propagateUp, ///< Propagate to higher levels?
    180                         pmConfig *config        ///< Configuration
    181                        );
    182 
    183 /// Write concepts for a cell; optionally, write concepts for the parents.
    184 ///
    185 /// This function writes all concepts for the chip to the specified "source".  It also allows concepts to be
    186 /// written for the upper levels through the parents (note, it would not write concepts for all chips, but
    187 /// only the parent of this cell).
    188 bool pmConceptsWriteCell(const pmCell *cell,  ///< FPA for which to write concepts
    189                          pmConceptSource source, ///< Source for concepts
    190                          bool propagateUp, ///< Propagate to higher levels?
    191                          pmConfig *config ///< Configuration
    192130                        );
    193131
     
    202140/// Frees the registered concepts so there is no memory leak when the user checks "persistent" memory.
    203141void pmConceptsDone(void);
    204 
    205 /// Copy all the concepts within an FPA to another FPA
    206 ///
    207 /// Iterates over all components of the FPA, and copies the concepts metadata from the source to the target.
    208 bool pmFPACopyConcepts(pmFPA *target,   ///< The target FPA
    209                        const pmFPA *source    ///< The source FPA
    210                       );
    211 
    212 /// Copy the concepts within an FPA to another FPA; optionally recurse to lower levels
    213 bool pmConceptsCopyFPA(pmFPA *target,   ///< Target FPA
    214                        const pmFPA *source, ///< Source FPA
    215                        bool chips,      ///< Recurse to chips level?
    216                        bool cells       ///< Recurse to cells level?
    217     );
    218 
    219 /// Copy the concepts within a chip to another chip; optionally recurse to lower level
    220 bool pmConceptsCopyChip(pmChip *target, ///< Target chip
    221                         const pmChip *source, ///< Source chip
    222                         bool cells      ///< Recurse to cells level?
    223     );
    224 
    225 /// Copy the concepts within a cell to another cell
    226 bool pmConceptsCopyCell(pmCell *target, ///< Target cell
    227                         const pmCell *source ///< Source cell
    228     );
    229142
    230143/// Interpolate a concept name to the actual value
Note: See TracChangeset for help on using the changeset viewer.