IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9570


Ignore:
Timestamp:
Oct 13, 2006, 3:02:31 PM (20 years ago)
Author:
Paul Price
Message:

Renaming functions in pmConceptsRead.h and pmConceptsWrite.h to be private ("p_").
Adding const where appropriate, and changing order of parameters to match usual
convention (outputs go first).

Location:
trunk/psModules/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAConstruct.c

    r9539 r9570  
    368368        }
    369369        newCell->config = psMemIncrRefCounter(cellData);
    370         if (!pmConceptsReadCell(newCell, PM_CONCEPT_SOURCE_CAMERA | PM_CONCEPT_SOURCE_DEFAULTS,
     370        if (!pmConceptsReadCell(newCell, PM_CONCEPT_SOURCE_CELLS | PM_CONCEPT_SOURCE_DEFAULTS,
    371371                                false, NULL)) {
    372372            psError(PS_ERR_UNKNOWN, false, "Unable to read concepts from camera and defaults for chip %s, "
  • trunk/psModules/src/camera/pmFPARead.c

    r9321 r9570  
    191191
    192192    // Make sure we have the information we need
    193     if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CAMERA |
     193    if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS |
    194194                            PM_CONCEPT_SOURCE_DEFAULTS, true, NULL)) {
    195195        psError(PS_ERR_IO, false, "Failed to read concepts for cell.\n");
  • trunk/psModules/src/camera/pmFPAWrite.c

    r8815 r9570  
    116116
    117117    if (writeBlank || writeImage) {
    118         pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CAMERA |
     118        pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS |
    119119                                 PM_CONCEPT_SOURCE_DEFAULTS;
    120120        if (!pmConceptsWriteCell(cell, source, false, NULL)) {
     
    162162
    163163        if (writeBlank || writeImage) {
    164             pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CAMERA |
     164            pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS |
    165165                                     PM_CONCEPT_SOURCE_DEFAULTS;
    166166            if (!pmConceptsWriteChip(chip, source, false, true, NULL)) {
     
    225225
    226226        if (writeBlank || writeImage) {
    227             pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CAMERA |
     227            pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS |
    228228                                     PM_CONCEPT_SOURCE_DEFAULTS;
    229229            if (!pmConceptsWriteFPA(fpa, source, true, NULL)) {
  • trunk/psModules/src/concepts/pmConcepts.c

    r9539 r9570  
    117117// Read all registered concepts for the specified level
    118118static bool conceptsRead(psMetadata **specs, // One of the concepts specifications
    119                          pmFPA *fpa,    // The FPA
    120                          pmChip *chip,  // The chip
    121                          pmCell *cell, // The cell
     119                         const pmFPA *fpa,    // The FPA
     120                         const pmChip *chip,  // The chip
     121                         const pmCell *cell, // The cell
    122122                         unsigned int *read,     // What's already been read
    123123                         pmConceptSource source, // The source of the concepts to read
     
    135135
    136136    bool success = true;                // Success in reading concepts?
    137     if (source & PM_CONCEPT_SOURCE_CAMERA && !(*read & PM_CONCEPT_SOURCE_CAMERA)) {
    138         if (pmConceptsReadFromCamera(*specs, cell, target)) {
    139             *read |= PM_CONCEPT_SOURCE_CAMERA;
     137    if (source & PM_CONCEPT_SOURCE_CELLS && !(*read & PM_CONCEPT_SOURCE_CELLS)) {
     138        if (p_pmConceptsReadFromCells(target, *specs, cell)) {
     139            *read |= PM_CONCEPT_SOURCE_CELLS;
    140140        } else {
    141141            psError(PS_ERR_UNKNOWN, false, "Error reading concepts from camera configuration.\n");
     
    145145
    146146    if (source & PM_CONCEPT_SOURCE_DEFAULTS && !(*read & PM_CONCEPT_SOURCE_DEFAULTS)) {
    147         if (pmConceptsReadFromDefaults(*specs, fpa, chip, cell, target)) {
     147        if (p_pmConceptsReadFromDefaults(target, *specs, fpa, chip, cell)) {
    148148            *read |= PM_CONCEPT_SOURCE_DEFAULTS;
    149149        } else {
     
    154154
    155155    if (source & PM_CONCEPT_SOURCE_PHU && !(*read & PM_CONCEPT_SOURCE_PHU)) {
    156         if (!pmConceptsReadFromHeader(*specs, fpa, chip, cell, target)) {
     156        if (!p_pmConceptsReadFromHeader(target, *specs, fpa, chip, cell)) {
    157157            psError(PS_ERR_UNKNOWN, false, "Error reading concepts from header.\n");
    158158            success = false;
     
    161161
    162162    if (source & PM_CONCEPT_SOURCE_HEADER && !(*read & PM_CONCEPT_SOURCE_HEADER)) {
    163         if (pmConceptsReadFromHeader(*specs, fpa, chip, cell, target)) {
     163        if (p_pmConceptsReadFromHeader(target, *specs, fpa, chip, cell)) {
    164164            *read |= PM_CONCEPT_SOURCE_HEADER;
    165165        } else {
     
    171171    #ifndef OMIT_PSDB
    172172    if (source & PM_CONCEPT_SOURCE_DATABASE && !(*read & PM_CONCEPT_SOURCE_DATABASE)) {
    173         if (pmConceptsReadFromDatabase(*specs, fpa, chip, cell, db, target)) {
     173        if (p_pmConceptsReadFromDatabase(target, *specs, fpa, chip, cell, db)) {
    174174            *read |= PM_CONCEPT_SOURCE_DATABASE;
    175175        } else {
     
    202202    psTrace("psModules.concepts", 3, "Writing concepts (%p %p %p): %d\n", fpa, chip, cell, source);
    203203
    204     if (source & PM_CONCEPT_SOURCE_CAMERA) {
    205         pmConceptsWriteToCamera(*specs, cell, concepts);
     204    if (source & PM_CONCEPT_SOURCE_CELLS) {
     205        p_pmConceptsWriteToCells(*specs, cell, concepts);
    206206    }
    207207    if (source & PM_CONCEPT_SOURCE_DEFAULTS) {
    208         pmConceptsWriteToDefaults(*specs, fpa, chip, cell, concepts);
     208        p_pmConceptsWriteToDefaults(*specs, fpa, chip, cell, concepts);
    209209    }
    210210    if (source & (PM_CONCEPT_SOURCE_PHU | PM_CONCEPT_SOURCE_HEADER)) {
    211         pmConceptsWriteToHeader(*specs, fpa, chip, cell, concepts);
     211        p_pmConceptsWriteToHeader(*specs, fpa, chip, cell, concepts);
    212212    }
    213213    if (source & PM_CONCEPT_SOURCE_DATABASE) {
    214         pmConceptsWriteToDatabase(*specs, fpa, chip, cell, db, concepts);
     214        p_pmConceptsWriteToDatabase(*specs, fpa, chip, cell, db, concepts);
    215215    }
    216216
  • trunk/psModules/src/concepts/pmConcepts.h

    r9510 r9570  
    3535typedef enum {
    3636    PM_CONCEPT_SOURCE_NONE     = 0x00,  // No concepts
    37     PM_CONCEPT_SOURCE_CAMERA   = 0x01,  // Concept comes from the camera information
     37    PM_CONCEPT_SOURCE_CELLS    = 0x01,  // Concept comes from the camera information
    3838    PM_CONCEPT_SOURCE_DEFAULTS = 0x02,  // Concept comes from defaults
    3939    PM_CONCEPT_SOURCE_PHU      = 0x04,  // Concept comes from PHU
  • trunk/psModules/src/concepts/pmConceptsRead.c

    r9539 r9570  
    2222// since the type is already known.
    2323static psMetadataItem *parsePlain(psMetadataItem *concept, // The concept to parse
    24                                   psMetadataItem *pattern // The concept pattern
     24                                  const psMetadataItem *pattern // The concept pattern
    2525                                 )
    2626{
     
    5555                         psMetadata *cameraFormat, // The camera format
    5656                         psMetadata *target, // The target
    57                          pmFPA *fpa,    // The FPA
    58                          pmChip *chip, // The chip
    59                          pmCell *cell  // The cell
     57                         const pmFPA *fpa, // The FPA
     58                         const pmChip *chip, // The chip
     59                         const pmCell *cell // The cell
    6060                        )
    6161{
     
    111111//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    112112
    113 bool pmConceptsReadFromCamera(psMetadata *specs, // The concept specifications
    114                               pmCell *cell,  // The cell
    115                               psMetadata *target // Place into which to read the concepts
    116                              )
     113bool p_pmConceptsReadFromCells(psMetadata *target, const psMetadata *specs, const pmCell *cell)
    117114{
    118115    PS_ASSERT_PTR_NON_NULL(specs, false);
     
    172169
    173170
    174 bool pmConceptsReadFromDefaults(psMetadata *specs, // The concept specifications
    175                                 pmFPA *fpa, // The FPA
    176                                 pmChip *chip, // The chip
    177                                 pmCell *cell, // The cell
    178                                 psMetadata *target // Place into which to read the concepts
    179                                )
     171bool p_pmConceptsReadFromDefaults(psMetadata *target, const psMetadata *specs,
     172                                  const pmFPA *fpa, const pmChip *chip, const pmCell *cell)
    180173{
    181174    PS_ASSERT_PTR_NON_NULL(specs, false);
     
    256249
    257250
    258 bool pmConceptsReadFromHeader(psMetadata *specs, // The concept specifications
    259                               pmFPA *fpa, // The FPA
    260                               pmChip *chip, // The chip
    261                               pmCell *cell,  // The cell
    262                               psMetadata *target // Place into which to read the concepts
    263                              )
     251bool p_pmConceptsReadFromHeader(psMetadata *target, const psMetadata *specs,
     252                                const pmFPA *fpa, const pmChip *chip, const pmCell *cell)
    264253{
    265254    PS_ASSERT_PTR_NON_NULL(specs, false);
     
    358347
    359348// XXX --- the below code has NOT been tested!
    360 bool pmConceptsReadFromDatabase(psMetadata *specs, // The concept specifications
    361                                 pmFPA *fpa, // The FPA
    362                                 pmChip *chip, // The chip
    363                                 pmCell *cell,  // The cell
    364                                 psDB *db, // The database handle
    365                                 psMetadata *target // Place into which to read the concepts
    366                                )
     349bool p_pmConceptsReadFromDatabase(psMetadata *target, const psMetadata *specs,
     350                                  const pmFPA *fpa, const pmChip *chip, const pmCell *cell, psDB *db)
    367351{
    368352    PS_ASSERT_PTR_NON_NULL(specs, false);
  • trunk/psModules/src/concepts/pmConceptsRead.h

    r7017 r9570  
    22#define PM_CONCEPTS_READ_H
    33
    4 #include "pslib.h"
     4#include <pslib.h>
    55#include "pmFPA.h"
    66
    7 bool pmConceptsReadFromCamera(psMetadata *specs, // The concept specifications
    8                               pmCell *cell,  // The cell
    9                               psMetadata *target // Place into which to read the concepts
    10                              );
    11 bool pmConceptsReadFromDefaults(psMetadata *specs, // The concept specifications
    12                                 pmFPA *fpa, // The FPA
    13                                 pmChip *chip, // The chip
    14                                 pmCell *cell, // The cell
    15                                 psMetadata *target // Place into which to read the concepts
    16                                );
    17 bool pmConceptsReadFromHeader(psMetadata *specs, // The concept specifications
    18                               pmFPA *fpa, // The FPA
    19                               pmChip *chip, // The chip
    20                               pmCell *cell,  // The cell
    21                               psMetadata *target // Place into which to read the concepts
    22                              );
    23 bool pmConceptsReadFromDatabase(psMetadata *specs, // The concept specifications
    24                                 pmFPA *fpa, // The FPA
    25                                 pmChip *chip, // The chip
    26                                 pmCell *cell,  // The cell
    27                                 psDB *db, // The database handle
    28                                 psMetadata *target // Place into which to read the concepts
     7/// Read concepts from the camera configuration file's CELLS.
     8///
     9/// Examines the CELLS metadata in the camera configuration file
     10/// for the current type of cell, and sucks in the concepts defined there.
     11/// This is a useful way of defining concepts that vary depending on the
     12/// type of the cell.
     13bool p_pmConceptsReadFromCells(psMetadata *target, ///< Place into which to read the concepts
     14                               const psMetadata *specs, ///< The concept specifications
     15                               const pmCell *cell ///< The cell
     16                              );
     17
     18/// Read concepts from the DEFAULTS in the camera configuration file.
     19///
     20/// Examines the DEFAULTS metadata in the camera configuration file
     21/// for concepts in the specs, and imports them into the target.
     22bool p_pmConceptsReadFromDefaults(psMetadata *target, // Place into which to read the concepts
     23                                  const psMetadata *specs, // The concept specifications
     24                                  const pmFPA *fpa, // The FPA
     25                                  const pmChip *chip, // The chip
     26                                  const pmCell *cell // The cell
     27                                 );
     28
     29/// Read concepts from the header TRANSLATION in the camera configuration file.
     30///
     31/// Examines the TRANSLATION metadata in the camera configuration file
     32/// for concepts in the specs, and imports them into the target.
     33bool p_pmConceptsReadFromHeader(psMetadata *target, // Place into which to read the concepts
     34                                const psMetadata *specs, // The concept specifications
     35                                const pmFPA *fpa, // The FPA
     36                                const pmChip *chip, // The chip
     37                                const pmCell *cell  // The cell
    2938                               );
    3039
    31 
    32 
    33 
    34 #ifdef OLD
    35 psMetadataItem *pmConceptReadFromCamera(pmCell *cell, // The cell
    36                                         const char *concept // Name of concept
    37                                        );
    38 
    39 psMetadataItem *pmConceptReadFromHeader(pmFPA *fpa, // The FPA that contains the chip
    40                                         pmChip *chip, // The chip that contains the cell
    41                                         pmCell *cell, // The cell
    42                                         const char *concept // Name of concept
    43                                        );
    44 
    45 psMetadataItem *pmConceptReadFromDefault(pmFPA *fpa, // The FPA that contains the chip
    46         pmChip *chip, // The chip that contains the cell
    47         pmCell *cell, // The cell
    48         const char *concept // Name of concept
    49                                         );
    50 
    51 psMetadataItem *pmConceptReadFromDB(pmFPA *fpa, // The FPA that contains the chip
    52                                     pmChip *chip, // The chip that contains the cell
    53                                     pmCell *cell, // The cell
    54                                     psDB *db, // DB handle
    55                                     const char *concept // Name of concept
    56                                    );
    57 
    58 psMetadataItem *pmConceptRead(pmFPA *fpa, // The FPA
    59                               pmChip *chip,// The chip
    60                               pmCell *cell, // The cell
    61                               psDB *db, // DB handle
    62                               const char *concept // Concept name
    63                              );
    64 
    65 float pmConceptReadF32(pmFPA *fpa,        // The FPA
    66                        pmChip *chip,      // The chip
    67                        pmCell *cell,      // The cell
    68                        psDB *db,          // DB handle
    69                        const char *name // Name of the concept
    70                       );
    71 
    72 double pmConceptReadF64(pmFPA *fpa,   // The FPA
    73                         pmChip *chip, // The chip
    74                         pmCell *cell, // The cell
    75                         psDB *db,     // DB handle
    76                         const char *name // Name of the concept
    77                        );
    78 
    79 int pmConceptReadS32(pmFPA *fpa,   // The FPA
    80                      pmChip *chip, // The chip
    81                      pmCell *cell, // The cell
    82                      psDB *db,     // DB handle
    83                      const char *name // Name of the concept
    84                     );
    85 
    86 psString pmConceptReadString(pmFPA *fpa, // The FPA
    87                              pmChip *chip, // The chip
    88                              pmCell *cell, // The cell
    89                              psDB *db,  // DB handle
    90                              const char *name // Name of the concept
    91                             );
    92 #endif
     40/// Read concepts from the header DATABASE in the camera configuration file.
     41///
     42/// Examines the DATABASE metadata in the camera configuration file
     43/// for concepts in the specs, and imports them into the target.
     44/// WARNING: This function has not been tested; use at your own risk!
     45bool p_pmConceptsReadFromDatabase(psMetadata *target, // Place into which to read the concepts
     46                                  const psMetadata *specs, // The concept specifications
     47                                  const pmFPA *fpa, // The FPA
     48                                  const pmChip *chip, // The chip
     49                                  const pmCell *cell,  // The cell
     50                                  psDB *db // The database handle
     51                                 );
    9352
    9453#endif
  • trunk/psModules/src/concepts/pmConceptsWrite.c

    r9539 r9570  
    220220//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    221221
    222 bool pmConceptsWriteToCamera(psMetadata *specs, // The concept specifications
    223                              pmCell *cell,   // The cell
    224                              psMetadata *concepts // The concepts
    225                             )
     222bool p_pmConceptsWriteToCells(psMetadata *specs, // The concept specifications
     223                              pmCell *cell,   // The cell
     224                              psMetadata *concepts // The concepts
     225                             )
    226226{
    227227    PS_ASSERT_PTR_NON_NULL(specs, false);
     
    291291}
    292292
    293 bool pmConceptsWriteToDefaults(psMetadata *specs, // The concept specifications
    294                                pmFPA *fpa, // The FPA
    295                                pmChip *chip, // The chip
    296                                pmCell *cell, // The cell
    297                                psMetadata *concepts // The concepts
    298                               )
     293bool p_pmConceptsWriteToDefaults(psMetadata *specs, // The concept specifications
     294                                 pmFPA *fpa, // The FPA
     295                                 pmChip *chip, // The chip
     296                                 pmCell *cell, // The cell
     297                                 psMetadata *concepts // The concepts
     298                                )
    299299{
    300300    PS_ASSERT_PTR_NON_NULL(specs, false);
     
    357357
    358358
    359 bool pmConceptsWriteToHeader(psMetadata *specs, // The concept specifications
    360                              pmFPA *fpa, // The FPA
    361                              pmChip *chip, // The chip
    362                              pmCell *cell, // The cell
    363                              psMetadata *concepts // The concepts
    364                             )
     359bool p_pmConceptsWriteToHeader(psMetadata *specs, // The concept specifications
     360                               pmFPA *fpa, // The FPA
     361                               pmChip *chip, // The chip
     362                               pmCell *cell, // The cell
     363                               psMetadata *concepts // The concepts
     364                              )
    365365{
    366366    PS_ASSERT_PTR_NON_NULL(specs, false);
     
    405405
    406406// XXX Warning: This code has not been tested at all
    407 bool pmConceptsWriteToDatabase(psMetadata *specs, // The concept specifications
    408                                pmFPA *fpa, // The FPA
    409                                pmChip *chip, // The chip
    410                                pmCell *cell, // The cell
    411                                psDB *db,// The database handle
    412                                psMetadata *concepts // The concepts
    413                               )
     407bool p_pmConceptsWriteToDatabase(psMetadata *specs, // The concept specifications
     408                                 pmFPA *fpa, // The FPA
     409                                 pmChip *chip, // The chip
     410                                 pmCell *cell, // The cell
     411                                 psDB *db,// The database handle
     412                                 psMetadata *concepts // The concepts
     413                                )
    414414{
    415415    PS_ASSERT_PTR_NON_NULL(specs, false);
  • trunk/psModules/src/concepts/pmConceptsWrite.h

    r7017 r9570  
    22#define PM_CONCEPTS_WRITE_H
    33
    4 #include "pslib.h"
     4#include <pslib.h>
    55#include "pmFPA.h"
    66
    7 bool pmConceptsWriteToCamera(psMetadata *specs, // The concept specifications
    8                              pmCell *cell,   // The cell
    9                              psMetadata *concepts // The concepts
    10                             );
    11 bool pmConceptsWriteToDefaults(psMetadata *specs, // The concept specifications
     7bool p_pmConceptsWriteToCells(psMetadata *specs, // The concept specifications
     8                              pmCell *cell,   // The cell
     9                              psMetadata *concepts // The concepts
     10                             );
     11bool p_pmConceptsWriteToDefaults(psMetadata *specs, // The concept specifications
     12                                 pmFPA *fpa, // The FPA
     13                                 pmChip *chip, // The chip
     14                                 pmCell *cell, // The cell
     15                                 psMetadata *concepts // The concepts
     16                                );
     17bool p_pmConceptsWriteToHeader(psMetadata *specs, // The concept specifications
    1218                               pmFPA *fpa, // The FPA
    1319                               pmChip *chip, // The chip
     
    1521                               psMetadata *concepts // The concepts
    1622                              );
    17 bool pmConceptsWriteToHeader(psMetadata *specs, // The concept specifications
    18                              pmFPA *fpa, // The FPA
    19                              pmChip *chip, // The chip
    20                              pmCell *cell, // The cell
    21                              psMetadata *concepts // The concepts
    22                             );
    23 bool pmConceptsWriteToDatabase(psMetadata *specs, // The concept specifications
    24                                pmFPA *fpa, // The FPA
    25                                pmChip *chip, // The chip
    26                                pmCell *cell, // The cell
    27                                psDB *db,// The database handle
    28                                psMetadata *concepts // The concepts
    29                               );
    30 
    31 
    32 #ifdef OLD
    33 
    34 // Well, not really "write", but check to make sure it's there and matches
    35 bool pmConceptWriteToCamera(pmCell *cell, // The cell
    36                             psMetadataItem *concept // Concept
    37                            );
    38 
    39 // Write the concept to the header in the appropriate location
    40 bool pmConceptWriteToHeader(pmFPA *fpa, // The FPA that contains the chip
    41                             pmChip *chip, // The chip that contains the cell
    42                             pmCell *cell, // The cell
    43                             psMetadataItem *concept // Concept
    44                            );
    45 
    46 // Well, not really "write", but check to see if it's there, and matches
    47 bool pmConceptWriteToDefault(pmFPA *fpa, // The FPA that contains the chip
    48                              pmChip *chip, // The chip that contains the cell
    49                              pmCell *cell, // The cell
    50                              psMetadataItem *concept // Concept
    51                             );
    52 
    53 bool pmConceptWriteToDB(pmFPA *fpa, // The FPA that contains the chip
    54                         pmChip *chip, // The chip that contains the cell
    55                         pmCell *cell, // The cell
    56                         psDB *db,    // DB handle
    57                         psMetadataItem *concept // Concept
    58                        );
    59 
    60 // Concept write from item
    61 bool pmConceptWriteItem(pmFPA *fpa,     // The FPA
    62                         pmChip *chip,   // The chip
    63                         pmCell *cell,   // The cell
    64                         psDB *db,       // DB handle
    65                         psMetadataItem *concept // Concept item
    66                        );
    67 
    68 bool pmConceptWrite(pmFPA *fpa, // The FPA
    69                     pmChip *chip,// The chip
    70                     pmCell *cell,    // The cell
    71                     psDB *db, // DB handle
    72                     psMetadata *concepts, // Concepts MD from which to set
    73                     const char *name // Name of the concept
    74                    );
     23bool p_pmConceptsWriteToDatabase(psMetadata *specs, // The concept specifications
     24                                 pmFPA *fpa, // The FPA
     25                                 pmChip *chip, // The chip
     26                                 pmCell *cell, // The cell
     27                                 psDB *db,// The database handle
     28                                 psMetadata *concepts // The concepts
     29                                );
    7530
    7631#endif
    77 
    78 #endif
Note: See TracChangeset for help on using the changeset viewer.