IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 5, 2008, 5:40:45 PM (18 years ago)
Author:
Paul Price
Message:

Don't get rid of derivative cameras when culling in preparation for dump.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/config/pmConfigDump.c

    r18908 r18939  
    1313#include "pmFPAview.h"
    1414#include "pmFPAfile.h"
     15#include "pmConfigCamera.h"
    1516
    1617#include "pmConfigDump.h"
     
    1819// Cull entries in the metadata, ignoring the ones listed.
    1920static bool configCull(psMetadata *md,  // Configuration metadata from which to cull
    20                        const char *list // List of items NOT to cull
     21                       const psArray *list // List of items NOT to cull
    2122    )
    2223{
    2324    PS_ASSERT_METADATA_NON_NULL(md, false);
     25    PS_ASSERT_ARRAY_NON_NULL(list, false);
    2426
    25     if (!list || strlen(list) == 0) {
    26         // Save everything if nothing is listed
    27         return true;
     27    psHash *keep = psHashAlloc(list->n); // Hash with strings to keep
     28    for (int i = 0; i < keep->n; i++) {
     29        psHashAdd(keep, list->data[i], list->data[i]);
    2830    }
    29 
    30     psArray *keepList = psStringSplitArray(list, " ,;", false); // List of items to keep
    31     psHash *keep = psHashAlloc(keepList->n); // Hash with strings to keep
    32     for (int i = 0; i < keep->n; i++) {
    33         psHashAdd(keep, keepList->data[i], keepList->data[i]);
    34     }
    35     psFree(keepList);
    3631
    3732    psMetadataIterator *iter = psMetadataIteratorAlloc(md, PS_LIST_HEAD, NULL); // Iterator
     
    5752    }
    5853
    59     return configCull(config->recipes, save);
     54    psArray *keep = psStringSplitArray(save, " ,;", false); // List of items to keep
     55
     56    bool result = configCull(config->recipes, keep); // Result of culling
     57    psFree(keep);
     58
     59    return result;
    6060}
    6161
     
    7070      }
    7171
    72       return configCull(cameras, config->cameraName);
     72      // Get names of the root camera and its derivatives
     73      psArray *keep = psArrayAlloc(4);
     74      keep->data[0] = pmConfigCameraRootName(config->cameraName);
     75      keep->data[1] = pmConfigCameraChipName(config->cameraName);
     76      keep->data[2] = pmConfigCameraFPAName(config->cameraName);
     77      keep->data[3] = pmConfigCameraSkycellName(config->cameraName);
     78
     79      bool result = configCull(cameras, keep); // Result of culling
     80      psFree(keep);
     81
     82      return result;
    7383}
    7484
Note: See TracChangeset for help on using the changeset viewer.