IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23280


Ignore:
Timestamp:
Mar 11, 2009, 4:22:01 PM (17 years ago)
Author:
Paul Price
Message:

Need to cull recipes from the camera-level overrides.

File:
1 edited

Legend:

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

    r19399 r23280  
    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    }
     61
     62    // Need to cull recipes from all cameras as well
     63    psMetadata *cameras = psMetadataLookupMetadata(NULL, config->system, "CAMERAS"); // Known cameras
     64    if (!cameras) {
     65        psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find CAMERAS in the system configuration.\n");
     66        return false;
     67    }
     68
     69    psMetadataIterator *iter = psMetadataIteratorAlloc(cameras, PS_LIST_HEAD, NULL); // Iterator for cameras
     70    psMetadataItem *item;               // Item from iteration
     71    while ((item = psMetadataGetAndIncrement(iter))) {
     72        psAssert(item->type == PS_DATA_METADATA, "Should only be metadata types on the camera list.");
     73        psMetadata *camera = item->data.md; // Camera configuration
     74        bool mdok;                      // Status of MD lookup
     75        psMetadata *recipes = psMetadataLookupMetadata(&mdok, camera, "RECIPES"); // Recipe overrides
     76        if (!recipes) {
     77            continue;
     78        }
     79        if (!configCull(recipes, keep)) {
     80            psError(PS_ERR_UNKNOWN, false, "Unable to cull recipes for camera %s", item->name);
     81            psFree(iter);
     82            psFree(keep);
     83            return false;
     84        }
     85    }
     86    psFree(iter);
     87
    5788    psFree(keep);
    5889
    59     return result;
     90    return true;
    6091}
    6192
Note: See TracChangeset for help on using the changeset viewer.