Index: /trunk/psModules/src/camera/pmFPAConstruct.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAConstruct.c	(revision 9569)
+++ /trunk/psModules/src/camera/pmFPAConstruct.c	(revision 9570)
@@ -368,5 +368,5 @@
         }
         newCell->config = psMemIncrRefCounter(cellData);
-        if (!pmConceptsReadCell(newCell, PM_CONCEPT_SOURCE_CAMERA | PM_CONCEPT_SOURCE_DEFAULTS,
+        if (!pmConceptsReadCell(newCell, PM_CONCEPT_SOURCE_CELLS | PM_CONCEPT_SOURCE_DEFAULTS,
                                 false, NULL)) {
             psError(PS_ERR_UNKNOWN, false, "Unable to read concepts from camera and defaults for chip %s, "
Index: /trunk/psModules/src/camera/pmFPARead.c
===================================================================
--- /trunk/psModules/src/camera/pmFPARead.c	(revision 9569)
+++ /trunk/psModules/src/camera/pmFPARead.c	(revision 9570)
@@ -191,5 +191,5 @@
 
     // Make sure we have the information we need
-    if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CAMERA |
+    if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS |
                             PM_CONCEPT_SOURCE_DEFAULTS, true, NULL)) {
         psError(PS_ERR_IO, false, "Failed to read concepts for cell.\n");
Index: /trunk/psModules/src/camera/pmFPAWrite.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAWrite.c	(revision 9569)
+++ /trunk/psModules/src/camera/pmFPAWrite.c	(revision 9570)
@@ -116,5 +116,5 @@
 
     if (writeBlank || writeImage) {
-        pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CAMERA |
+        pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS |
                                  PM_CONCEPT_SOURCE_DEFAULTS;
         if (!pmConceptsWriteCell(cell, source, false, NULL)) {
@@ -162,5 +162,5 @@
 
         if (writeBlank || writeImage) {
-            pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CAMERA |
+            pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS |
                                      PM_CONCEPT_SOURCE_DEFAULTS;
             if (!pmConceptsWriteChip(chip, source, false, true, NULL)) {
@@ -225,5 +225,5 @@
 
         if (writeBlank || writeImage) {
-            pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CAMERA |
+            pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS |
                                      PM_CONCEPT_SOURCE_DEFAULTS;
             if (!pmConceptsWriteFPA(fpa, source, true, NULL)) {
Index: /trunk/psModules/src/concepts/pmConcepts.c
===================================================================
--- /trunk/psModules/src/concepts/pmConcepts.c	(revision 9569)
+++ /trunk/psModules/src/concepts/pmConcepts.c	(revision 9570)
@@ -117,7 +117,7 @@
 // Read all registered concepts for the specified level
 static bool conceptsRead(psMetadata **specs, // One of the concepts specifications
-                         pmFPA *fpa,    // The FPA
-                         pmChip *chip,  // The chip
-                         pmCell *cell,  // The cell
+                         const pmFPA *fpa,    // The FPA
+                         const pmChip *chip,  // The chip
+                         const pmCell *cell, // The cell
                          unsigned int *read,     // What's already been read
                          pmConceptSource source, // The source of the concepts to read
@@ -135,7 +135,7 @@
 
     bool success = true;                // Success in reading concepts?
-    if (source & PM_CONCEPT_SOURCE_CAMERA && !(*read & PM_CONCEPT_SOURCE_CAMERA)) {
-        if (pmConceptsReadFromCamera(*specs, cell, target)) {
-            *read |= PM_CONCEPT_SOURCE_CAMERA;
+    if (source & PM_CONCEPT_SOURCE_CELLS && !(*read & PM_CONCEPT_SOURCE_CELLS)) {
+        if (p_pmConceptsReadFromCells(target, *specs, cell)) {
+            *read |= PM_CONCEPT_SOURCE_CELLS;
         } else {
             psError(PS_ERR_UNKNOWN, false, "Error reading concepts from camera configuration.\n");
@@ -145,5 +145,5 @@
 
     if (source & PM_CONCEPT_SOURCE_DEFAULTS && !(*read & PM_CONCEPT_SOURCE_DEFAULTS)) {
-        if (pmConceptsReadFromDefaults(*specs, fpa, chip, cell, target)) {
+        if (p_pmConceptsReadFromDefaults(target, *specs, fpa, chip, cell)) {
             *read |= PM_CONCEPT_SOURCE_DEFAULTS;
         } else {
@@ -154,5 +154,5 @@
 
     if (source & PM_CONCEPT_SOURCE_PHU && !(*read & PM_CONCEPT_SOURCE_PHU)) {
-        if (!pmConceptsReadFromHeader(*specs, fpa, chip, cell, target)) {
+        if (!p_pmConceptsReadFromHeader(target, *specs, fpa, chip, cell)) {
             psError(PS_ERR_UNKNOWN, false, "Error reading concepts from header.\n");
             success = false;
@@ -161,5 +161,5 @@
 
     if (source & PM_CONCEPT_SOURCE_HEADER && !(*read & PM_CONCEPT_SOURCE_HEADER)) {
-        if (pmConceptsReadFromHeader(*specs, fpa, chip, cell, target)) {
+        if (p_pmConceptsReadFromHeader(target, *specs, fpa, chip, cell)) {
             *read |= PM_CONCEPT_SOURCE_HEADER;
         } else {
@@ -171,5 +171,5 @@
     #ifndef OMIT_PSDB
     if (source & PM_CONCEPT_SOURCE_DATABASE && !(*read & PM_CONCEPT_SOURCE_DATABASE)) {
-        if (pmConceptsReadFromDatabase(*specs, fpa, chip, cell, db, target)) {
+        if (p_pmConceptsReadFromDatabase(target, *specs, fpa, chip, cell, db)) {
             *read |= PM_CONCEPT_SOURCE_DATABASE;
         } else {
@@ -202,15 +202,15 @@
     psTrace("psModules.concepts", 3, "Writing concepts (%p %p %p): %d\n", fpa, chip, cell, source);
 
-    if (source & PM_CONCEPT_SOURCE_CAMERA) {
-        pmConceptsWriteToCamera(*specs, cell, concepts);
+    if (source & PM_CONCEPT_SOURCE_CELLS) {
+        p_pmConceptsWriteToCells(*specs, cell, concepts);
     }
     if (source & PM_CONCEPT_SOURCE_DEFAULTS) {
-        pmConceptsWriteToDefaults(*specs, fpa, chip, cell, concepts);
+        p_pmConceptsWriteToDefaults(*specs, fpa, chip, cell, concepts);
     }
     if (source & (PM_CONCEPT_SOURCE_PHU | PM_CONCEPT_SOURCE_HEADER)) {
-        pmConceptsWriteToHeader(*specs, fpa, chip, cell, concepts);
+        p_pmConceptsWriteToHeader(*specs, fpa, chip, cell, concepts);
     }
     if (source & PM_CONCEPT_SOURCE_DATABASE) {
-        pmConceptsWriteToDatabase(*specs, fpa, chip, cell, db, concepts);
+        p_pmConceptsWriteToDatabase(*specs, fpa, chip, cell, db, concepts);
     }
 
Index: /trunk/psModules/src/concepts/pmConcepts.h
===================================================================
--- /trunk/psModules/src/concepts/pmConcepts.h	(revision 9569)
+++ /trunk/psModules/src/concepts/pmConcepts.h	(revision 9570)
@@ -35,5 +35,5 @@
 typedef enum {
     PM_CONCEPT_SOURCE_NONE     = 0x00,  // No concepts
-    PM_CONCEPT_SOURCE_CAMERA   = 0x01,  // Concept comes from the camera information
+    PM_CONCEPT_SOURCE_CELLS    = 0x01,  // Concept comes from the camera information
     PM_CONCEPT_SOURCE_DEFAULTS = 0x02,  // Concept comes from defaults
     PM_CONCEPT_SOURCE_PHU      = 0x04,  // Concept comes from PHU
Index: /trunk/psModules/src/concepts/pmConceptsRead.c
===================================================================
--- /trunk/psModules/src/concepts/pmConceptsRead.c	(revision 9569)
+++ /trunk/psModules/src/concepts/pmConceptsRead.c	(revision 9570)
@@ -22,5 +22,5 @@
 // since the type is already known.
 static psMetadataItem *parsePlain(psMetadataItem *concept, // The concept to parse
-                                  psMetadataItem *pattern // The concept pattern
+                                  const psMetadataItem *pattern // The concept pattern
                                  )
 {
@@ -55,7 +55,7 @@
                          psMetadata *cameraFormat, // The camera format
                          psMetadata *target, // The target
-                         pmFPA *fpa,    // The FPA
-                         pmChip *chip,  // The chip
-                         pmCell *cell   // The cell
+                         const pmFPA *fpa, // The FPA
+                         const pmChip *chip, // The chip
+                         const pmCell *cell // The cell
                         )
 {
@@ -111,8 +111,5 @@
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-bool pmConceptsReadFromCamera(psMetadata *specs, // The concept specifications
-                              pmCell *cell,  // The cell
-                              psMetadata *target // Place into which to read the concepts
-                             )
+bool p_pmConceptsReadFromCells(psMetadata *target, const psMetadata *specs, const pmCell *cell)
 {
     PS_ASSERT_PTR_NON_NULL(specs, false);
@@ -172,10 +169,6 @@
 
 
-bool pmConceptsReadFromDefaults(psMetadata *specs, // The concept specifications
-                                pmFPA *fpa, // The FPA
-                                pmChip *chip, // The chip
-                                pmCell *cell, // The cell
-                                psMetadata *target // Place into which to read the concepts
-                               )
+bool p_pmConceptsReadFromDefaults(psMetadata *target, const psMetadata *specs,
+                                  const pmFPA *fpa, const pmChip *chip, const pmCell *cell)
 {
     PS_ASSERT_PTR_NON_NULL(specs, false);
@@ -256,10 +249,6 @@
 
 
-bool pmConceptsReadFromHeader(psMetadata *specs, // The concept specifications
-                              pmFPA *fpa, // The FPA
-                              pmChip *chip, // The chip
-                              pmCell *cell,  // The cell
-                              psMetadata *target // Place into which to read the concepts
-                             )
+bool p_pmConceptsReadFromHeader(psMetadata *target, const psMetadata *specs,
+                                const pmFPA *fpa, const pmChip *chip, const pmCell *cell)
 {
     PS_ASSERT_PTR_NON_NULL(specs, false);
@@ -358,11 +347,6 @@
 
 // XXX --- the below code has NOT been tested!
-bool pmConceptsReadFromDatabase(psMetadata *specs, // The concept specifications
-                                pmFPA *fpa, // The FPA
-                                pmChip *chip, // The chip
-                                pmCell *cell,  // The cell
-                                psDB *db, // The database handle
-                                psMetadata *target // Place into which to read the concepts
-                               )
+bool p_pmConceptsReadFromDatabase(psMetadata *target, const psMetadata *specs,
+                                  const pmFPA *fpa, const pmChip *chip, const pmCell *cell, psDB *db)
 {
     PS_ASSERT_PTR_NON_NULL(specs, false);
Index: /trunk/psModules/src/concepts/pmConceptsRead.h
===================================================================
--- /trunk/psModules/src/concepts/pmConceptsRead.h	(revision 9569)
+++ /trunk/psModules/src/concepts/pmConceptsRead.h	(revision 9570)
@@ -2,93 +2,52 @@
 #define PM_CONCEPTS_READ_H
 
-#include "pslib.h"
+#include <pslib.h>
 #include "pmFPA.h"
 
-bool pmConceptsReadFromCamera(psMetadata *specs, // The concept specifications
-                              pmCell *cell,  // The cell
-                              psMetadata *target // Place into which to read the concepts
-                             );
-bool pmConceptsReadFromDefaults(psMetadata *specs, // The concept specifications
-                                pmFPA *fpa, // The FPA
-                                pmChip *chip, // The chip
-                                pmCell *cell, // The cell
-                                psMetadata *target // Place into which to read the concepts
-                               );
-bool pmConceptsReadFromHeader(psMetadata *specs, // The concept specifications
-                              pmFPA *fpa, // The FPA
-                              pmChip *chip, // The chip
-                              pmCell *cell,  // The cell
-                              psMetadata *target // Place into which to read the concepts
-                             );
-bool pmConceptsReadFromDatabase(psMetadata *specs, // The concept specifications
-                                pmFPA *fpa, // The FPA
-                                pmChip *chip, // The chip
-                                pmCell *cell,  // The cell
-                                psDB *db, // The database handle
-                                psMetadata *target // Place into which to read the concepts
+/// Read concepts from the camera configuration file's CELLS.
+///
+/// Examines the CELLS metadata in the camera configuration file
+/// for the current type of cell, and sucks in the concepts defined there.
+/// This is a useful way of defining concepts that vary depending on the
+/// type of the cell.
+bool p_pmConceptsReadFromCells(psMetadata *target, ///< Place into which to read the concepts
+                               const psMetadata *specs, ///< The concept specifications
+                               const pmCell *cell ///< The cell
+                              );
+
+/// Read concepts from the DEFAULTS in the camera configuration file.
+///
+/// Examines the DEFAULTS metadata in the camera configuration file
+/// for concepts in the specs, and imports them into the target.
+bool p_pmConceptsReadFromDefaults(psMetadata *target, // Place into which to read the concepts
+                                  const psMetadata *specs, // The concept specifications
+                                  const pmFPA *fpa, // The FPA
+                                  const pmChip *chip, // The chip
+                                  const pmCell *cell // The cell
+                                 );
+
+/// Read concepts from the header TRANSLATION in the camera configuration file.
+///
+/// Examines the TRANSLATION metadata in the camera configuration file
+/// for concepts in the specs, and imports them into the target.
+bool p_pmConceptsReadFromHeader(psMetadata *target, // Place into which to read the concepts
+                                const psMetadata *specs, // The concept specifications
+                                const pmFPA *fpa, // The FPA
+                                const pmChip *chip, // The chip
+                                const pmCell *cell  // The cell
                                );
 
-
-
-
-#ifdef OLD
-psMetadataItem *pmConceptReadFromCamera(pmCell *cell, // The cell
-                                        const char *concept // Name of concept
-                                       );
-
-psMetadataItem *pmConceptReadFromHeader(pmFPA *fpa, // The FPA that contains the chip
-                                        pmChip *chip, // The chip that contains the cell
-                                        pmCell *cell, // The cell
-                                        const char *concept // Name of concept
-                                       );
-
-psMetadataItem *pmConceptReadFromDefault(pmFPA *fpa, // The FPA that contains the chip
-        pmChip *chip, // The chip that contains the cell
-        pmCell *cell, // The cell
-        const char *concept // Name of concept
-                                        );
-
-psMetadataItem *pmConceptReadFromDB(pmFPA *fpa, // The FPA that contains the chip
-                                    pmChip *chip, // The chip that contains the cell
-                                    pmCell *cell, // The cell
-                                    psDB *db, // DB handle
-                                    const char *concept // Name of concept
-                                   );
-
-psMetadataItem *pmConceptRead(pmFPA *fpa, // The FPA
-                              pmChip *chip,// The chip
-                              pmCell *cell, // The cell
-                              psDB *db, // DB handle
-                              const char *concept // Concept name
-                             );
-
-float pmConceptReadF32(pmFPA *fpa,        // The FPA
-                       pmChip *chip,      // The chip
-                       pmCell *cell,      // The cell
-                       psDB *db,          // DB handle
-                       const char *name // Name of the concept
-                      );
-
-double pmConceptReadF64(pmFPA *fpa,   // The FPA
-                        pmChip *chip, // The chip
-                        pmCell *cell, // The cell
-                        psDB *db,     // DB handle
-                        const char *name // Name of the concept
-                       );
-
-int pmConceptReadS32(pmFPA *fpa,   // The FPA
-                     pmChip *chip, // The chip
-                     pmCell *cell, // The cell
-                     psDB *db,     // DB handle
-                     const char *name // Name of the concept
-                    );
-
-psString pmConceptReadString(pmFPA *fpa, // The FPA
-                             pmChip *chip, // The chip
-                             pmCell *cell, // The cell
-                             psDB *db,  // DB handle
-                             const char *name // Name of the concept
-                            );
-#endif
+/// Read concepts from the header DATABASE in the camera configuration file.
+///
+/// Examines the DATABASE metadata in the camera configuration file
+/// for concepts in the specs, and imports them into the target.
+/// WARNING: This function has not been tested; use at your own risk!
+bool p_pmConceptsReadFromDatabase(psMetadata *target, // Place into which to read the concepts
+                                  const psMetadata *specs, // The concept specifications
+                                  const pmFPA *fpa, // The FPA
+                                  const pmChip *chip, // The chip
+                                  const pmCell *cell,  // The cell
+                                  psDB *db // The database handle
+                                 );
 
 #endif
Index: /trunk/psModules/src/concepts/pmConceptsWrite.c
===================================================================
--- /trunk/psModules/src/concepts/pmConceptsWrite.c	(revision 9569)
+++ /trunk/psModules/src/concepts/pmConceptsWrite.c	(revision 9570)
@@ -220,8 +220,8 @@
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-bool pmConceptsWriteToCamera(psMetadata *specs, // The concept specifications
-                             pmCell *cell,   // The cell
-                             psMetadata *concepts // The concepts
-                            )
+bool p_pmConceptsWriteToCells(psMetadata *specs, // The concept specifications
+                              pmCell *cell,   // The cell
+                              psMetadata *concepts // The concepts
+                             )
 {
     PS_ASSERT_PTR_NON_NULL(specs, false);
@@ -291,10 +291,10 @@
 }
 
-bool pmConceptsWriteToDefaults(psMetadata *specs, // The concept specifications
-                               pmFPA *fpa, // The FPA
-                               pmChip *chip, // The chip
-                               pmCell *cell, // The cell
-                               psMetadata *concepts // The concepts
-                              )
+bool p_pmConceptsWriteToDefaults(psMetadata *specs, // The concept specifications
+                                 pmFPA *fpa, // The FPA
+                                 pmChip *chip, // The chip
+                                 pmCell *cell, // The cell
+                                 psMetadata *concepts // The concepts
+                                )
 {
     PS_ASSERT_PTR_NON_NULL(specs, false);
@@ -357,10 +357,10 @@
 
 
-bool pmConceptsWriteToHeader(psMetadata *specs, // The concept specifications
-                             pmFPA *fpa, // The FPA
-                             pmChip *chip, // The chip
-                             pmCell *cell, // The cell
-                             psMetadata *concepts // The concepts
-                            )
+bool p_pmConceptsWriteToHeader(psMetadata *specs, // The concept specifications
+                               pmFPA *fpa, // The FPA
+                               pmChip *chip, // The chip
+                               pmCell *cell, // The cell
+                               psMetadata *concepts // The concepts
+                              )
 {
     PS_ASSERT_PTR_NON_NULL(specs, false);
@@ -405,11 +405,11 @@
 
 // XXX Warning: This code has not been tested at all
-bool pmConceptsWriteToDatabase(psMetadata *specs, // The concept specifications
-                               pmFPA *fpa, // The FPA
-                               pmChip *chip, // The chip
-                               pmCell *cell, // The cell
-                               psDB *db,// The database handle
-                               psMetadata *concepts // The concepts
-                              )
+bool p_pmConceptsWriteToDatabase(psMetadata *specs, // The concept specifications
+                                 pmFPA *fpa, // The FPA
+                                 pmChip *chip, // The chip
+                                 pmCell *cell, // The cell
+                                 psDB *db,// The database handle
+                                 psMetadata *concepts // The concepts
+                                )
 {
     PS_ASSERT_PTR_NON_NULL(specs, false);
Index: /trunk/psModules/src/concepts/pmConceptsWrite.h
===================================================================
--- /trunk/psModules/src/concepts/pmConceptsWrite.h	(revision 9569)
+++ /trunk/psModules/src/concepts/pmConceptsWrite.h	(revision 9570)
@@ -2,12 +2,18 @@
 #define PM_CONCEPTS_WRITE_H
 
-#include "pslib.h"
+#include <pslib.h>
 #include "pmFPA.h"
 
-bool pmConceptsWriteToCamera(psMetadata *specs, // The concept specifications
-                             pmCell *cell,   // The cell
-                             psMetadata *concepts // The concepts
-                            );
-bool pmConceptsWriteToDefaults(psMetadata *specs, // The concept specifications
+bool p_pmConceptsWriteToCells(psMetadata *specs, // The concept specifications
+                              pmCell *cell,   // The cell
+                              psMetadata *concepts // The concepts
+                             );
+bool p_pmConceptsWriteToDefaults(psMetadata *specs, // The concept specifications
+                                 pmFPA *fpa, // The FPA
+                                 pmChip *chip, // The chip
+                                 pmCell *cell, // The cell
+                                 psMetadata *concepts // The concepts
+                                );
+bool p_pmConceptsWriteToHeader(psMetadata *specs, // The concept specifications
                                pmFPA *fpa, // The FPA
                                pmChip *chip, // The chip
@@ -15,64 +21,11 @@
                                psMetadata *concepts // The concepts
                               );
-bool pmConceptsWriteToHeader(psMetadata *specs, // The concept specifications
-                             pmFPA *fpa, // The FPA
-                             pmChip *chip, // The chip
-                             pmCell *cell, // The cell
-                             psMetadata *concepts // The concepts
-                            );
-bool pmConceptsWriteToDatabase(psMetadata *specs, // The concept specifications
-                               pmFPA *fpa, // The FPA
-                               pmChip *chip, // The chip
-                               pmCell *cell, // The cell
-                               psDB *db,// The database handle
-                               psMetadata *concepts // The concepts
-                              );
-
-
-#ifdef OLD
-
-// Well, not really "write", but check to make sure it's there and matches
-bool pmConceptWriteToCamera(pmCell *cell, // The cell
-                            psMetadataItem *concept // Concept
-                           );
-
-// Write the concept to the header in the appropriate location
-bool pmConceptWriteToHeader(pmFPA *fpa, // The FPA that contains the chip
-                            pmChip *chip, // The chip that contains the cell
-                            pmCell *cell, // The cell
-                            psMetadataItem *concept // Concept
-                           );
-
-// Well, not really "write", but check to see if it's there, and matches
-bool pmConceptWriteToDefault(pmFPA *fpa, // The FPA that contains the chip
-                             pmChip *chip, // The chip that contains the cell
-                             pmCell *cell, // The cell
-                             psMetadataItem *concept // Concept
-                            );
-
-bool pmConceptWriteToDB(pmFPA *fpa, // The FPA that contains the chip
-                        pmChip *chip, // The chip that contains the cell
-                        pmCell *cell, // The cell
-                        psDB *db,    // DB handle
-                        psMetadataItem *concept // Concept
-                       );
-
-// Concept write from item
-bool pmConceptWriteItem(pmFPA *fpa,     // The FPA
-                        pmChip *chip,   // The chip
-                        pmCell *cell,   // The cell
-                        psDB *db,       // DB handle
-                        psMetadataItem *concept // Concept item
-                       );
-
-bool pmConceptWrite(pmFPA *fpa, // The FPA
-                    pmChip *chip,// The chip
-                    pmCell *cell,    // The cell
-                    psDB *db, // DB handle
-                    psMetadata *concepts, // Concepts MD from which to set
-                    const char *name // Name of the concept
-                   );
+bool p_pmConceptsWriteToDatabase(psMetadata *specs, // The concept specifications
+                                 pmFPA *fpa, // The FPA
+                                 pmChip *chip, // The chip
+                                 pmCell *cell, // The cell
+                                 psDB *db,// The database handle
+                                 psMetadata *concepts // The concepts
+                                );
 
 #endif
-
-#endif
