IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 17, 2009, 12:07:42 PM (17 years ago)
Author:
beaumont
Message:

merged with head

Location:
branches/cnb_branches/cnb_branch_20090301/psModules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301/psModules

  • branches/cnb_branches/cnb_branch_20090301/psModules/src/config/pmConfigDump.c

    r19399 r23351  
    5454    psArray *keep = psStringSplitArray(save, " ,;", false); // List of items to keep
    5555
    56     bool result = configCull(config->recipes, keep); // Result of culling
     56    if (!configCull(config->recipes, keep)) {
     57        psError(PS_ERR_UNKNOWN, false, "Unable to cull system recipes.");
     58        psFree(keep);
     59        return false;
     60    }
    5761    psFree(keep);
    5862
    59     return result;
     63    // Need to cull recipes from all cameras as well
     64    psMetadata *cameras = psMetadataLookupMetadata(NULL, config->system, "CAMERAS"); // Known cameras
     65    if (!cameras) {
     66        psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find CAMERAS in the system configuration.\n");
     67        return false;
     68    }
     69
     70    psMetadataIterator *iter = psMetadataIteratorAlloc(cameras, PS_LIST_HEAD, NULL); // Iterator for cameras
     71    psMetadataItem *item;               // Item from iteration
     72    keep = psArrayAllocEmpty(1);
     73    while ((item = psMetadataGetAndIncrement(iter))) {
     74        psAssert(item->type == PS_DATA_METADATA, "Should only be metadata types on the camera list.");
     75        psMetadata *camera = item->data.md; // Camera configuration
     76        bool mdok;                      // Status of MD lookup
     77        psMetadata *recipes = psMetadataLookupMetadata(&mdok, camera, "RECIPES"); // Recipe overrides
     78        if (!recipes) {
     79            continue;
     80        }
     81        if (!configCull(recipes, keep)) {
     82            psError(PS_ERR_UNKNOWN, false, "Unable to cull recipes for camera %s", item->name);
     83            psFree(iter);
     84            psFree(keep);
     85            return false;
     86        }
     87    }
     88    psFree(iter);
     89    psFree(keep);
     90
     91    return true;
    6092}
    6193
Note: See TracChangeset for help on using the changeset viewer.