IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 22, 2008, 10:21:52 AM (18 years ago)
Author:
eugene
Message:

using new user/site/system construction for config files

File:
1 edited

Legend:

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

    r15788 r16611  
    2424
    2525// Generate the skycell version of a named camera configuration
    26 bool pmConfigCameraSkycellVersion(psMetadata *site, // The site configuration
     26bool pmConfigCameraSkycellVersion(psMetadata *system, // The system configuration
    2727                                  const char *name // Name of the un-mosaicked camera
    2828                                  )
    2929{
    30     PS_ASSERT_METADATA_NON_NULL(site, false);
     30    PS_ASSERT_METADATA_NON_NULL(system, false);
    3131    PS_ASSERT_STRING_NON_EMPTY(name, false);
    3232
    3333    bool mdok;                          // Status of MD lookup
    34     psMetadata *cameras = psMetadataLookupMetadata(&mdok, site, "CAMERAS"); // List of cameras
     34    psMetadata *cameras = psMetadataLookupMetadata(&mdok, system, "CAMERAS"); // List of cameras
    3535    if (!mdok || !cameras) {
    36         psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find CAMERAS in the site configuration.\n");
    37         return false;
    38     }
    39     if (!pmConfigGenerateSkycellVersion(cameras, cameras, name, site)) {
     36        psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find CAMERAS in the system configuration.\n");
     37        return false;
     38    }
     39    if (!pmConfigGenerateSkycellVersion(cameras, cameras, name, system)) {
    4040        psError(PS_ERR_UNKNOWN, true, "Failed to build skycell camera description for %s\n", name);
    4141        return false;
     
    4545
    4646
    47 bool pmConfigCameraSkycellVersionsAll(psMetadata *site)
    48 {
    49     PS_ASSERT_METADATA_NON_NULL(site, false);
     47bool pmConfigCameraSkycellVersionsAll(psMetadata *system)
     48{
     49    PS_ASSERT_METADATA_NON_NULL(system, false);
    5050
    5151    bool mdok;                          // Status of MD lookup
    52     psMetadata *cameras = psMetadataLookupMetadata(&mdok, site, "CAMERAS"); // List of cameras
     52    psMetadata *cameras = psMetadataLookupMetadata(&mdok, system, "CAMERAS"); // List of cameras
    5353    if (!mdok || !cameras) {
    54         psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find CAMERAS in the site configuration.\n");
     54        psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find CAMERAS in the system configuration.\n");
    5555        return false;
    5656    }
     
    6161    while ((camerasItem = psMetadataGetAndIncrement(camerasIter))) {
    6262        assert(camerasItem->type == PS_DATA_METADATA); // Only metadata are allowed here!
    63         if (!pmConfigGenerateSkycellVersion(cameras, new, camerasItem->name, site)) {
     63        if (!pmConfigGenerateSkycellVersion(cameras, new, camerasItem->name, system)) {
    6464            psError(PS_ERR_UNKNOWN, true, "Failed to build skycell camera description for %s\n",
    6565                    camerasItem->name);
     
    9292static const char *skycellConceptName(const char *name, // Name of concept
    9393                                      const char **concepts, // List of concepts NOT to update
    94                                       const psMetadata *site // Site configuration
     94                                      const psMetadata *system // System configuration
    9595                                      )
    9696{
     
    101101    }
    102102
    103     if (!site) {
     103    if (!system) {
    104104        return name;
    105105    }
    106106    bool mdok;                          // Status of MD lookup
    107     psMetadata *skycells = psMetadataLookupMetadata(&mdok, site, "SKYCELLS"); // Skycell concept headers
     107    psMetadata *skycells = psMetadataLookupMetadata(&mdok, system, "SKYCELLS"); // Skycell concept headers
    108108    if (!skycells) {
    109109        return name;
     
    121121                                    psMetadata *newCameras, // New list of camera configurations
    122122                                    const char *name, // Name of original camera configuration
    123                                     const psMetadata *site // Site configuration
     123                                    const psMetadata *system // System configuration
    124124                                    )
    125125{
     
    213213        iter = psListIteratorAlloc(concepts, PS_LIST_HEAD, false);
    214214        while ((name = psListGetAndIncrement(iter))) {
    215             const char *new = skycellConceptName(name, skycellConceptsFPA, site); // Name for skycell
     215            const char *new = skycellConceptName(name, skycellConceptsFPA, system); // Name for skycell
    216216            if (new) {
    217217                psMetadataAddStr(translation, PS_LIST_TAIL, name, 0, NULL, new);
     
    224224        iter = psListIteratorAlloc(concepts, PS_LIST_HEAD, false);
    225225        while ((name = psListGetAndIncrement(iter))) {
    226             const char *new = skycellConceptName(name, skycellConceptsChip, site); // Name for skycell
     226            const char *new = skycellConceptName(name, skycellConceptsChip, system); // Name for skycell
    227227            if (new) {
    228228                psMetadataAddStr(translation, PS_LIST_TAIL, name, 0, NULL, new);
     
    235235        iter = psListIteratorAlloc(concepts, PS_LIST_HEAD, false);
    236236        while ((name = psListGetAndIncrement(iter))) {
    237             const char *new = skycellConceptName(name, skycellConceptsCell, site); // Name for skycell
     237            const char *new = skycellConceptName(name, skycellConceptsCell, system); // Name for skycell
    238238            if (new) {
    239239                psMetadataAddStr(translation, PS_LIST_TAIL, name, 0, NULL, new);
     
    299299
    300300// Generate the Chip and FPA mosaicked version of a named camera configuration
    301 bool pmConfigCameraMosaickedVersions(psMetadata *site, // The site configuration
     301bool pmConfigCameraMosaickedVersions(psMetadata *system, // The system configuration
    302302                                     const char *name // Name of the un-mosaicked camera
    303303                                    )
    304304{
    305     PS_ASSERT_METADATA_NON_NULL(site, false);
     305    PS_ASSERT_METADATA_NON_NULL(system, false);
    306306    PS_ASSERT_STRING_NON_EMPTY(name, false);
    307307
    308308    bool mdok;                          // Status of MD lookup
    309     psMetadata *cameras = psMetadataLookupMetadata(&mdok, site, "CAMERAS"); // List of cameras
     309    psMetadata *cameras = psMetadataLookupMetadata(&mdok, system, "CAMERAS"); // List of cameras
    310310    if (!mdok || !cameras) {
    311         psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find CAMERAS in the site configuration.\n");
     311        psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find CAMERAS in the system configuration.\n");
    312312        return false;
    313313    }
     
    325325// the operation putting the new entries first is now implemented in pmConfigGenerateMosaickedVersion
    326326// Generate the Chip and FPA mosaicked version of a named camera configuration
    327 bool pmConfigCameraMosaickedVersionsAll(psMetadata *site)
    328 {
    329     PS_ASSERT_METADATA_NON_NULL(site, false);
     327bool pmConfigCameraMosaickedVersionsAll(psMetadata *system)
     328{
     329    PS_ASSERT_METADATA_NON_NULL(system, false);
    330330
    331331    bool mdok;                          // Status of MD lookup
    332     psMetadata *cameras = psMetadataLookupMetadata(&mdok, site, "CAMERAS"); // List of cameras
     332    psMetadata *cameras = psMetadataLookupMetadata(&mdok, system, "CAMERAS"); // List of cameras
    333333    if (!mdok || !cameras) {
    334         psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find CAMERAS in the site configuration.\n");
     334        psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find CAMERAS in the system configuration.\n");
    335335        return false;
    336336    }
Note: See TracChangeset for help on using the changeset viewer.