Changeset 26560 for trunk/psModules/src/config/pmConfigCamera.c
- Timestamp:
- Jan 11, 2010, 3:04:22 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/config/pmConfigCamera.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/config/pmConfigCamera.c
r26559 r26560 149 149 camerasIter = psMetadataIteratorAlloc(new, PS_LIST_HEAD, NULL); // Iterator 150 150 while ((camerasItem = psMetadataGetAndIncrement(camerasIter))) { 151 psMetadataAddItem(cameras, camerasItem, PS_LIST_HEAD, 0);151 psMetadataAddItem(cameras, camerasItem, PS_LIST_HEAD, PS_META_REPLACE); 152 152 } 153 153 psFree(camerasIter); … … 211 211 // See if the new one is already there 212 212 psString newName = pmConfigCameraSkycellName(name); // Name of skycelled camera 213 if (psMetadataLookup(oldCameras, newName)) { 213 bool mdok; // Status of MD lookup 214 psMetadata *oldCam = psMetadataLookupMetadata(&mdok, oldCameras, newName); // Existing camera configuration 215 if (mdok && oldCam) { 216 // Ensure new camera goes to the head of the metadata, so that it will be recognised first 217 // The old camera doesn't contain the PSMOSAIC header, so it will match anything! 218 psTrace("psModules.config", 6, "Camera configuration for %s exists, so moving to the front.", newName); 219 psMetadataAddMetadata(newCameras, PS_LIST_HEAD, newName, PS_META_REPLACE, NULL, oldCam); 214 220 psFree(newName); 215 221 return true; … … 365 371 // New camera MUST go to the head of the metadata, so that it will be recognised first 366 372 // The old camera doesn't contain the PSCAMERA and PSFORMAT headers, so it will match anything! 373 psTrace("psModules.config", 6, "Generated new camera configuration for %s.", newName); 367 374 psMetadataAddMetadata(newCameras, PS_LIST_HEAD, newName, PS_META_REPLACE, 368 375 "Automatically generated", new); … … 435 442 camerasIter = psMetadataIteratorAlloc(new, PS_LIST_HEAD, NULL); // Iterator 436 443 while ((camerasItem = psMetadataGetAndIncrement(camerasIter))) { 437 psMetadataAddItem(cameras, camerasItem, PS_LIST_HEAD, 0);444 psMetadataAddItem(cameras, camerasItem, PS_LIST_HEAD, PS_META_REPLACE); 438 445 } 439 446 psFree(camerasIter); … … 468 475 469 476 // See if the new one is already there 470 psString newName = NULL; // Name of mosaicked camera 471 psStringAppend(&newName, "_%s-%s", name, mosaicLevel == PM_FPA_LEVEL_CHIP ? "CHIP" : "FPA"); 472 if (psMetadataLookup(oldCameras, newName)) { 477 psString newName = mosaicLevel == PM_FPA_LEVEL_CHIP ? pmConfigCameraChipName(name) : 478 pmConfigCameraFPAName(name); // Name of mosaicked camera 479 bool mdok; // Status of MD lookup 480 psMetadata *oldCam = psMetadataLookupMetadata(&mdok, oldCameras, newName); // Existing camera configuration 481 if (mdok && oldCam) { 482 // Ensure new camera goes to the head of the metadata, so that it will be recognised first 483 // The old camera doesn't contain the PSMOSAIC header, so it will match anything! 484 psTrace("psModules.config", 6, "Camera configuration for %s exists, so moving to the front.", newName); 485 psMetadataAddMetadata(newCameras, PS_LIST_HEAD, newName, PS_META_REPLACE, NULL, oldCam); 473 486 psFree(newName); 474 487 return true; … … 476 489 477 490 psMetadata *new = psMetadataCopy(NULL, camera); // Copy of the camera description 478 bool mdok; // Status of MD lookups479 491 480 492 // ** Fix up the contents of the FPA description to match the mosaicked camera ** … … 848 860 // New camera MUST go to the head of the metadata, so that it will be recognised first 849 861 // The old camera doesn't contain the PSMOSAIC header, so it will match anything! 862 psTrace("psModules.config", 6, "Generated new camera configuration for %s.", newName); 850 863 psMetadataAddMetadata(newCameras, PS_LIST_HEAD, newName, PS_META_REPLACE, 851 864 "Automatically generated", new);
Note:
See TracChangeset
for help on using the changeset viewer.
