Changeset 10967 for trunk/psModules/src/concepts/pmConceptsWrite.c
- Timestamp:
- Jan 8, 2007, 12:31:41 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/concepts/pmConceptsWrite.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/concepts/pmConceptsWrite.c
r10487 r10967 119 119 if (spec->format) { 120 120 formatted = spec->format(concept, cameraFormat, fpa, chip, cell); 121 } else if (strcmp(concept->name, spec->blank->name) != 0) { 122 // Adjust so that the name is correct 123 formatted = psMetadataItemCopy(concept); 124 psFree(formatted->name); 125 formatted->name = psStringCopy(spec->blank->name); 121 126 } else { 127 // Can get away with merely incrementing the reference counter 122 128 formatted = psMemIncrRefCounter((const psPtr)concept); 123 129 } … … 294 300 PS_ASSERT_PTR_NON_NULL(concepts, false); 295 301 296 pmHDU *hdu = pmHDUGetLowest( NULL, NULL, cell); // The HDU at the lowest level302 pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // The HDU at the lowest level 297 303 if (!hdu) { 298 304 return false; … … 316 322 // It's a menu --- need to look up the .DEPEND 317 323 psString dependName = NULL; // The concept name with ".DEPEND" on the end 318 psStringAppend(&dependName, " .DEPEND");324 psStringAppend(&dependName, "%s.DEPEND", defaultItem->name); 319 325 psString dependKey = psMetadataLookupStr(&mdok, defaults, dependName); // The keyword 320 psFree(dependName);321 326 if (!mdok || !dependKey || strlen(dependKey) == 0) { 322 327 psLogMsg(__func__, PS_LOG_WARN, "Can't find %s in the DEFAULTS for %s --- ignored.\n", 323 328 dependName, name); 329 psFree(dependName); 324 330 continue; 325 331 } 326 psString dependValue = psMetadataLookupStr(&mdok, concepts, depend Name); // The value327 if (!mdok || !depend Key || strlen(dependKey) == 0) {332 psString dependValue = psMetadataLookupStr(&mdok, concepts, dependKey); // The value 333 if (!mdok || !dependValue || strlen(dependValue) == 0) { 328 334 psLogMsg(__func__, PS_LOG_WARN, "Concept %s specified by %s isn't of type STR -- " 329 "ignored.\n", name, dependName); 335 "ignored.\n", dependKey, dependName); 336 psFree(dependName); 330 337 continue; 331 338 } 332 conceptItem = psMetadataLookup(defaultItem->data.V, dependValue); 339 psFree(dependName); 340 // Get the actual item of interest, and correct the name to match the concept name 341 defaultItem = psMetadataItemCopy(psMetadataLookup(defaultItem->data.md, dependValue)); 342 psFree(defaultItem->name); 343 defaultItem->name = psStringCopy(name); 333 344 } else { 334 conceptItem = psMetadataLookup(concepts, name); // The item from the concepts 335 } 345 psMemIncrRefCounter(defaultItem); 346 } 347 conceptItem = psMetadataLookup(concepts, name); // The item from the concepts 336 348 psMetadataItem *formatted = conceptFormat(spec, conceptItem, cameraFormat, fpa, chip, cell); 337 349 if (!formatted) { … … 342 354 "format, but the values don't match.\n", name); 343 355 } 356 psFree(defaultItem); 344 357 psFree(formatted); 345 358 } … … 356 369 PS_ASSERT_PTR_NON_NULL(concepts, false); 357 370 358 pmHDU *hdu = pmHDUGetLowest( NULL, NULL, cell); // The HDU at the lowest level371 pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // The HDU at the lowest level 359 372 if (!hdu) { 360 373 return false; … … 408 421 #else 409 422 410 pmHDU *hdu = pmHDUGetLowest( NULL, NULL, cell); // The HDU at the lowest level423 pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // The HDU at the lowest level 411 424 if (!hdu) { 412 425 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
