Changeset 11749 for trunk/psModules/src/concepts/pmConceptsWrite.c
- Timestamp:
- Feb 12, 2007, 12:22:15 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/concepts/pmConceptsWrite.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/concepts/pmConceptsWrite.c
r11257 r11749 106 106 static psMetadataItem *conceptFormat(const pmConceptSpec *spec, // The concept specification 107 107 const psMetadataItem *concept, // The concept to parse 108 pmConceptSource source, // The concept source 108 109 const psMetadata *cameraFormat, // The camera format 109 110 const pmFPA *fpa, // The FPA … … 118 119 psMetadataItem *formatted = NULL; // The formatted concept 119 120 if (spec->format) { 120 formatted = spec->format(concept, cameraFormat, fpa, chip, cell);121 formatted = spec->format(concept, source, cameraFormat, fpa, chip, cell); 121 122 } else if (strcmp(concept->name, spec->blank->name) != 0) { 122 123 // Adjust so that the name is correct … … 251 252 // Grab the concept 252 253 psMetadataItem *conceptItem = psMetadataLookup(concepts, name); // The concept 253 // Formatted version 254 psMetadataItem *formatted = conceptFormat(spec, conceptItem, cameraFormat, NULL, NULL, cell); 255 if (!formatted) { 256 continue; 257 } 254 258 255 psString nameSource = NULL; // String with the concept name and ".SOURCE" added 259 256 psStringAppend(&nameSource, "%s.SOURCE", name); … … 268 265 continue; 269 266 } 267 268 // Formatted version 269 psMetadataItem *formatted = conceptFormat(spec, conceptItem, PM_CONCEPT_SOURCE_HEADER, 270 cameraFormat, NULL, NULL, cell); 271 if (!formatted) { 272 continue; 273 } 274 270 275 psTrace("psModules.concepts", 8, "Writing %s to header %s\n", name, cameraItem->data.str); 271 276 writeHeader(hdu, cameraItem->data.V, formatted); 277 psFree(formatted); 272 278 } else if (strcasecmp(source, "VALUE") == 0) { 279 // Formatted version 280 psMetadataItem *formatted = conceptFormat(spec, conceptItem, PM_CONCEPT_SOURCE_CELLS, 281 cameraFormat, NULL, NULL, cell); 282 if (!formatted) { 283 continue; 284 } 285 273 286 psTrace("psModules.concepts", 8, "Checking %s against camera format.\n", name); 274 287 if (! compareConcepts(formatted, cameraItem)) { … … 276 289 "format, but the values don't match.\n", name); 277 290 } 291 psFree(formatted); 278 292 } else { 279 293 psLogMsg(__func__, PS_LOG_WARN, "Concept source %s isn't HEADER or VALUE --- can't " 280 294 "write\n", nameSource); 281 295 } 282 } else if (! compareConcepts(formatted, cameraItem)){296 } else { 283 297 // Assume it's specified by value 284 psLogMsg(__func__, PS_LOG_WARN, "Concept %s is specified by value in the camera " 285 "format, but the values don't match.\n", name); 286 } 287 psFree(formatted); 298 psMetadataItem *formatted = conceptFormat(spec, conceptItem, PM_CONCEPT_SOURCE_CELLS, 299 cameraFormat, NULL, NULL, cell); 300 if (!formatted) { 301 continue; 302 } 303 304 if (! compareConcepts(formatted, cameraItem)) { 305 psLogMsg(__func__, PS_LOG_WARN, "Concept %s is specified by value in the camera " 306 "format, but the values don't match.\n", name); 307 } 308 psFree(formatted); 309 } 288 310 psFree(nameSource); 289 311 } … … 346 368 } 347 369 conceptItem = psMetadataLookup(concepts, name); // The item from the concepts 348 psMetadataItem *formatted = conceptFormat(spec, conceptItem, cameraFormat, fpa, chip, cell); 370 psMetadataItem *formatted = conceptFormat(spec, conceptItem, PM_CONCEPT_SOURCE_DEFAULTS, 371 cameraFormat, fpa, chip, cell); 349 372 if (!formatted) { 350 373 continue; … … 394 417 psTrace("psModules.concepts", 3, "Writing %s to header %s\n", name, headerItem->data.str); 395 418 psMetadataItem *conceptItem = psMetadataLookup(concepts, name); // The item from the concepts 396 psMetadataItem *formatted = conceptFormat(spec, conceptItem, cameraFormat, fpa, chip, cell); 419 psMetadataItem *formatted = conceptFormat(spec, conceptItem, PM_CONCEPT_SOURCE_HEADER, 420 cameraFormat, fpa, chip, cell); 397 421 if (!formatted) { 398 422 continue; … … 446 470 447 471 psMetadataItem *conceptItem = psMetadataLookup(concepts, name); // The item from the concepts 448 psMetadataItem *formatted = conceptFormat(spec, conceptItem, cameraFormat, fpa, chip, cell); 472 psMetadataItem *formatted = conceptFormat(spec, conceptItem, PM_CONCEPT_SOURCE_DATABASE, 473 cameraFormat, fpa, chip, cell); 449 474 if (!formatted) { 450 475 continue;
Note:
See TracChangeset
for help on using the changeset viewer.
