Changeset 9570
- Timestamp:
- Oct 13, 2006, 3:02:31 PM (20 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 9 edited
-
camera/pmFPAConstruct.c (modified) (1 diff)
-
camera/pmFPARead.c (modified) (1 diff)
-
camera/pmFPAWrite.c (modified) (3 diffs)
-
concepts/pmConcepts.c (modified) (7 diffs)
-
concepts/pmConcepts.h (modified) (1 diff)
-
concepts/pmConceptsRead.c (modified) (6 diffs)
-
concepts/pmConceptsRead.h (modified) (1 diff)
-
concepts/pmConceptsWrite.c (modified) (4 diffs)
-
concepts/pmConceptsWrite.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAConstruct.c
r9539 r9570 368 368 } 369 369 newCell->config = psMemIncrRefCounter(cellData); 370 if (!pmConceptsReadCell(newCell, PM_CONCEPT_SOURCE_C AMERA| PM_CONCEPT_SOURCE_DEFAULTS,370 if (!pmConceptsReadCell(newCell, PM_CONCEPT_SOURCE_CELLS | PM_CONCEPT_SOURCE_DEFAULTS, 371 371 false, NULL)) { 372 372 psError(PS_ERR_UNKNOWN, false, "Unable to read concepts from camera and defaults for chip %s, " -
trunk/psModules/src/camera/pmFPARead.c
r9321 r9570 191 191 192 192 // Make sure we have the information we need 193 if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_C AMERA|193 if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS | 194 194 PM_CONCEPT_SOURCE_DEFAULTS, true, NULL)) { 195 195 psError(PS_ERR_IO, false, "Failed to read concepts for cell.\n"); -
trunk/psModules/src/camera/pmFPAWrite.c
r8815 r9570 116 116 117 117 if (writeBlank || writeImage) { 118 pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_C AMERA|118 pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS | 119 119 PM_CONCEPT_SOURCE_DEFAULTS; 120 120 if (!pmConceptsWriteCell(cell, source, false, NULL)) { … … 162 162 163 163 if (writeBlank || writeImage) { 164 pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_C AMERA|164 pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS | 165 165 PM_CONCEPT_SOURCE_DEFAULTS; 166 166 if (!pmConceptsWriteChip(chip, source, false, true, NULL)) { … … 225 225 226 226 if (writeBlank || writeImage) { 227 pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_C AMERA|227 pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS | 228 228 PM_CONCEPT_SOURCE_DEFAULTS; 229 229 if (!pmConceptsWriteFPA(fpa, source, true, NULL)) { -
trunk/psModules/src/concepts/pmConcepts.c
r9539 r9570 117 117 // Read all registered concepts for the specified level 118 118 static bool conceptsRead(psMetadata **specs, // One of the concepts specifications 119 pmFPA *fpa, // The FPA120 pmChip *chip, // The chip121 pmCell *cell,// The cell119 const pmFPA *fpa, // The FPA 120 const pmChip *chip, // The chip 121 const pmCell *cell, // The cell 122 122 unsigned int *read, // What's already been read 123 123 pmConceptSource source, // The source of the concepts to read … … 135 135 136 136 bool success = true; // Success in reading concepts? 137 if (source & PM_CONCEPT_SOURCE_C AMERA && !(*read & PM_CONCEPT_SOURCE_CAMERA)) {138 if (p mConceptsReadFromCamera(*specs, cell, target)) {139 *read |= PM_CONCEPT_SOURCE_C AMERA;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; 140 140 } else { 141 141 psError(PS_ERR_UNKNOWN, false, "Error reading concepts from camera configuration.\n"); … … 145 145 146 146 if (source & PM_CONCEPT_SOURCE_DEFAULTS && !(*read & PM_CONCEPT_SOURCE_DEFAULTS)) { 147 if (p mConceptsReadFromDefaults(*specs, fpa, chip, cell, target)) {147 if (p_pmConceptsReadFromDefaults(target, *specs, fpa, chip, cell)) { 148 148 *read |= PM_CONCEPT_SOURCE_DEFAULTS; 149 149 } else { … … 154 154 155 155 if (source & PM_CONCEPT_SOURCE_PHU && !(*read & PM_CONCEPT_SOURCE_PHU)) { 156 if (!p mConceptsReadFromHeader(*specs, fpa, chip, cell, target)) {156 if (!p_pmConceptsReadFromHeader(target, *specs, fpa, chip, cell)) { 157 157 psError(PS_ERR_UNKNOWN, false, "Error reading concepts from header.\n"); 158 158 success = false; … … 161 161 162 162 if (source & PM_CONCEPT_SOURCE_HEADER && !(*read & PM_CONCEPT_SOURCE_HEADER)) { 163 if (p mConceptsReadFromHeader(*specs, fpa, chip, cell, target)) {163 if (p_pmConceptsReadFromHeader(target, *specs, fpa, chip, cell)) { 164 164 *read |= PM_CONCEPT_SOURCE_HEADER; 165 165 } else { … … 171 171 #ifndef OMIT_PSDB 172 172 if (source & PM_CONCEPT_SOURCE_DATABASE && !(*read & PM_CONCEPT_SOURCE_DATABASE)) { 173 if (p mConceptsReadFromDatabase(*specs, fpa, chip, cell, db, target)) {173 if (p_pmConceptsReadFromDatabase(target, *specs, fpa, chip, cell, db)) { 174 174 *read |= PM_CONCEPT_SOURCE_DATABASE; 175 175 } else { … … 202 202 psTrace("psModules.concepts", 3, "Writing concepts (%p %p %p): %d\n", fpa, chip, cell, source); 203 203 204 if (source & PM_CONCEPT_SOURCE_C AMERA) {205 p mConceptsWriteToCamera(*specs, cell, concepts);204 if (source & PM_CONCEPT_SOURCE_CELLS) { 205 p_pmConceptsWriteToCells(*specs, cell, concepts); 206 206 } 207 207 if (source & PM_CONCEPT_SOURCE_DEFAULTS) { 208 p mConceptsWriteToDefaults(*specs, fpa, chip, cell, concepts);208 p_pmConceptsWriteToDefaults(*specs, fpa, chip, cell, concepts); 209 209 } 210 210 if (source & (PM_CONCEPT_SOURCE_PHU | PM_CONCEPT_SOURCE_HEADER)) { 211 p mConceptsWriteToHeader(*specs, fpa, chip, cell, concepts);211 p_pmConceptsWriteToHeader(*specs, fpa, chip, cell, concepts); 212 212 } 213 213 if (source & PM_CONCEPT_SOURCE_DATABASE) { 214 p mConceptsWriteToDatabase(*specs, fpa, chip, cell, db, concepts);214 p_pmConceptsWriteToDatabase(*specs, fpa, chip, cell, db, concepts); 215 215 } 216 216 -
trunk/psModules/src/concepts/pmConcepts.h
r9510 r9570 35 35 typedef enum { 36 36 PM_CONCEPT_SOURCE_NONE = 0x00, // No concepts 37 PM_CONCEPT_SOURCE_C AMERA= 0x01, // Concept comes from the camera information37 PM_CONCEPT_SOURCE_CELLS = 0x01, // Concept comes from the camera information 38 38 PM_CONCEPT_SOURCE_DEFAULTS = 0x02, // Concept comes from defaults 39 39 PM_CONCEPT_SOURCE_PHU = 0x04, // Concept comes from PHU -
trunk/psModules/src/concepts/pmConceptsRead.c
r9539 r9570 22 22 // since the type is already known. 23 23 static psMetadataItem *parsePlain(psMetadataItem *concept, // The concept to parse 24 psMetadataItem *pattern // The concept pattern24 const psMetadataItem *pattern // The concept pattern 25 25 ) 26 26 { … … 55 55 psMetadata *cameraFormat, // The camera format 56 56 psMetadata *target, // The target 57 pmFPA *fpa,// The FPA58 pmChip *chip,// The chip59 pmCell *cell// The cell57 const pmFPA *fpa, // The FPA 58 const pmChip *chip, // The chip 59 const pmCell *cell // The cell 60 60 ) 61 61 { … … 111 111 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 112 112 113 bool pmConceptsReadFromCamera(psMetadata *specs, // The concept specifications 114 pmCell *cell, // The cell 115 psMetadata *target // Place into which to read the concepts 116 ) 113 bool p_pmConceptsReadFromCells(psMetadata *target, const psMetadata *specs, const pmCell *cell) 117 114 { 118 115 PS_ASSERT_PTR_NON_NULL(specs, false); … … 172 169 173 170 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 ) 171 bool p_pmConceptsReadFromDefaults(psMetadata *target, const psMetadata *specs, 172 const pmFPA *fpa, const pmChip *chip, const pmCell *cell) 180 173 { 181 174 PS_ASSERT_PTR_NON_NULL(specs, false); … … 256 249 257 250 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 ) 251 bool p_pmConceptsReadFromHeader(psMetadata *target, const psMetadata *specs, 252 const pmFPA *fpa, const pmChip *chip, const pmCell *cell) 264 253 { 265 254 PS_ASSERT_PTR_NON_NULL(specs, false); … … 358 347 359 348 // 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 ) 349 bool p_pmConceptsReadFromDatabase(psMetadata *target, const psMetadata *specs, 350 const pmFPA *fpa, const pmChip *chip, const pmCell *cell, psDB *db) 367 351 { 368 352 PS_ASSERT_PTR_NON_NULL(specs, false); -
trunk/psModules/src/concepts/pmConceptsRead.h
r7017 r9570 2 2 #define PM_CONCEPTS_READ_H 3 3 4 #include "pslib.h"4 #include <pslib.h> 5 5 #include "pmFPA.h" 6 6 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. 13 bool 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. 22 bool 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. 33 bool 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 29 38 ); 30 39 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! 45 bool 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 ); 93 52 94 53 #endif -
trunk/psModules/src/concepts/pmConceptsWrite.c
r9539 r9570 220 220 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 221 221 222 bool p mConceptsWriteToCamera(psMetadata *specs, // The concept specifications223 pmCell *cell, // The cell224 psMetadata *concepts // The concepts225 )222 bool p_pmConceptsWriteToCells(psMetadata *specs, // The concept specifications 223 pmCell *cell, // The cell 224 psMetadata *concepts // The concepts 225 ) 226 226 { 227 227 PS_ASSERT_PTR_NON_NULL(specs, false); … … 291 291 } 292 292 293 bool p mConceptsWriteToDefaults(psMetadata *specs, // The concept specifications294 pmFPA *fpa, // The FPA295 pmChip *chip, // The chip296 pmCell *cell, // The cell297 psMetadata *concepts // The concepts298 )293 bool 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 ) 299 299 { 300 300 PS_ASSERT_PTR_NON_NULL(specs, false); … … 357 357 358 358 359 bool p mConceptsWriteToHeader(psMetadata *specs, // The concept specifications360 pmFPA *fpa, // The FPA361 pmChip *chip, // The chip362 pmCell *cell, // The cell363 psMetadata *concepts // The concepts364 )359 bool 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 ) 365 365 { 366 366 PS_ASSERT_PTR_NON_NULL(specs, false); … … 405 405 406 406 // XXX Warning: This code has not been tested at all 407 bool p mConceptsWriteToDatabase(psMetadata *specs, // The concept specifications408 pmFPA *fpa, // The FPA409 pmChip *chip, // The chip410 pmCell *cell, // The cell411 psDB *db,// The database handle412 psMetadata *concepts // The concepts413 )407 bool 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 ) 414 414 { 415 415 PS_ASSERT_PTR_NON_NULL(specs, false); -
trunk/psModules/src/concepts/pmConceptsWrite.h
r7017 r9570 2 2 #define PM_CONCEPTS_WRITE_H 3 3 4 #include "pslib.h"4 #include <pslib.h> 5 5 #include "pmFPA.h" 6 6 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 7 bool p_pmConceptsWriteToCells(psMetadata *specs, // The concept specifications 8 pmCell *cell, // The cell 9 psMetadata *concepts // The concepts 10 ); 11 bool 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 ); 17 bool p_pmConceptsWriteToHeader(psMetadata *specs, // The concept specifications 12 18 pmFPA *fpa, // The FPA 13 19 pmChip *chip, // The chip … … 15 21 psMetadata *concepts // The concepts 16 22 ); 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 ); 23 bool 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 ); 75 30 76 31 #endif 77 78 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
