IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 10, 2010, 4:24:46 PM (16 years ago)
Author:
eugene
Message:

updates from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/psModules/src/config/pmConfigCamera.c

    r23452 r26879  
    149149    camerasIter = psMetadataIteratorAlloc(new, PS_LIST_HEAD, NULL); // Iterator
    150150    while ((camerasItem = psMetadataGetAndIncrement(camerasIter))) {
    151         psMetadataAddItem(cameras, camerasItem, PS_LIST_HEAD, 0);
     151        psMetadataAddItem(cameras, camerasItem, PS_LIST_HEAD, PS_META_REPLACE);
    152152    }
    153153    psFree(camerasIter);
     
    210210
    211211    // See if the new one is already there
    212     psString newName = NULL;       // Name of skycelled camera
    213     psStringAppend(&newName, "_%s-SKYCELL", name);
    214     if (psMetadataLookup(oldCameras, newName)) {
     212    psString newName = pmConfigCameraSkycellName(name); // Name of skycelled camera
     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);
    215220        psFree(newName);
    216221        return true;
     
    366371    // New camera MUST go to the head of the metadata, so that it will be recognised first
    367372    // 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);
    368374    psMetadataAddMetadata(newCameras, PS_LIST_HEAD, newName, PS_META_REPLACE,
    369375                          "Automatically generated", new);
     
    436442    camerasIter = psMetadataIteratorAlloc(new, PS_LIST_HEAD, NULL); // Iterator
    437443    while ((camerasItem = psMetadataGetAndIncrement(camerasIter))) {
    438         psMetadataAddItem(cameras, camerasItem, PS_LIST_HEAD, 0);
     444        psMetadataAddItem(cameras, camerasItem, PS_LIST_HEAD, PS_META_REPLACE);
    439445    }
    440446    psFree(camerasIter);
     
    469475
    470476    // See if the new one is already there
    471     psString newName = NULL;       // Name of mosaicked camera
    472     psStringAppend(&newName, "_%s-%s", name, mosaicLevel == PM_FPA_LEVEL_CHIP ? "CHIP" : "FPA");
    473     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);
    474486        psFree(newName);
    475487        return true;
     
    477489
    478490    psMetadata *new = psMetadataCopy(NULL, camera); // Copy of the camera description
    479     bool mdok;                          // Status of MD lookups
    480491
    481492    // ** Fix up the contents of the FPA description to match the mosaicked camera **
     
    849860    // New camera MUST go to the head of the metadata, so that it will be recognised first
    850861    // 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);
    851863    psMetadataAddMetadata(newCameras, PS_LIST_HEAD, newName, PS_META_REPLACE,
    852864                          "Automatically generated", new);
Note: See TracChangeset for help on using the changeset viewer.