IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 20, 2006, 3:24:28 PM (20 years ago)
Author:
Paul Price
Message:

Applying patch from Josh: look for a symbolic camera name in the
CAMERAS metadata, otherwise fall back to trying the -camera option as
a literal filename.

File:
1 edited

Legend:

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

    r7589 r7597  
    33 *  @author PAP, IfA
    44 *
    5  *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-06-17 01:50:43 $
     5 *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-06-21 01:24:28 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    256256        if (argNum >= *argc) {
    257257            psLogMsg(__func__, PS_LOG_WARN,
    258                      "-camera command-line switch provided without the required filename --- ignored.\n");
     258                     "-camera command-line switch provided without the required camera or filename --- "
     259                     "ignored.\n");
    259260        } else {
    260             readConfig(&config->camera, argv[argNum], "camera");
     261            char *cameraFile = argv[argNum]; // The camera configuration file to read
     262
     263            // look for a symbolic camera name in the CAMERAS metadata
     264            // otherwise fall back to trying the -camera option as a literal
     265            // filename
     266            bool mdok = true;           // Status of MD lookup
     267            psMetadata *cameras = psMetadataLookupMD(&mdok, config->site, "CAMERAS");
     268            if (mdok && cameras) {
     269                char *newFile = psMetadataLookupStr(NULL, cameras, cameraFile); // The filename
     270                if (newFile) {
     271                    cameraFile = newFile;
     272                }
     273            } else {
     274                psError(PS_ERR_IO, false, "Unable to find CAMERAS in site configuration.\n");
     275                psFree(config);
     276                return NULL;
     277            }
     278
     279            readConfig(&config->camera, cameraFile, "camera");
    261280            psArgumentRemove(argNum, argc, argv);
    262281        }
Note: See TracChangeset for help on using the changeset viewer.