IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35381


Ignore:
Timestamp:
Apr 9, 2013, 12:09:52 PM (13 years ago)
Author:
eugene
Message:

add function pmPFAfileDefineNewConfig

Location:
branches/eam_branches/ipp-20130307/psModules/src/camera
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130307/psModules/src/camera/pmFPAfileDefine.c

    r35379 r35381  
    708708}
    709709
    710 
    711 pmFPAfile *pmFPAfileDefineFromArgs(bool *success, pmConfig *config,
    712                                    const char *filename, const char *argname)
     710// find the file associated with the argname & generate a pmFPAfile for it based on the filerule
     711pmFPAfile *pmFPAfileDefineFromArgs(bool *success, pmConfig *config, const char *filename, const char *argname)
    713712{
    714713    PS_ASSERT_PTR_NON_NULL(config, NULL);
     
    742741}
    743742
    744 pmFPAfile *pmFPAfileBindFromArgs(bool *success, pmFPAfile *input, pmConfig *config,
    745                                 const char *filename, const char *argname)
     743// find the file associated with the argname & bind it to the given pmFPAfile for it based on the filerule
     744pmFPAfile *pmFPAfileBindFromArgs(bool *success, pmFPAfile *input, pmConfig *config, const char *filename, const char *argname)
    746745{
    747746    PS_ASSERT_PTR_NON_NULL(input, NULL);
     
    776775}
    777776
    778 pmFPAfile *pmFPAfileDefineSingleFromArgs(bool *success, pmConfig *config, const char *filename,
    779                                         const char *argname, int entry)
     777// find the specific file associated with the argname & generate a pmFPAfile for it based on the filerule
     778pmFPAfile *pmFPAfileDefineSingleFromArgs(bool *success, pmConfig *config, const char *filename, const char *argname, int entry)
    780779{
    781780    PS_ASSERT_PTR_NON_NULL(config, NULL);
     
    813812}
    814813
     814// find the file in the config list & generate a pmFPAfile for it based on the filerule
    815815pmFPAfile *pmFPAfileDefineFromRun(bool *success, pmFPAfile *bind, pmConfig *config, const char *filename)
    816816{
     
    836836}
    837837
     838// find the files in the config list & generate an array of pmFPAfiles for them based on the filerule
    838839psArray *pmFPAfileDefineMultipleFromRun(bool *success, psArray *bind, pmConfig *config, const char *filename)
    839840{
     
    880881
    881882    return files;
     883}
     884
     885// find the file associated with the argname & generate a pmFPAfile for it based on the filerule
     886pmFPAfile *pmFPAfileDefineNewConfig(bool *success, pmConfig **outConfig, pmConfig *sysConfig, const char *filename, const char *argname)
     887{
     888    PS_ASSERT_PTR_NON_NULL(outConfig, NULL);
     889    PS_ASSERT_PTR_NON_NULL(sysConfig, NULL);
     890    PS_ASSERT_STRING_NON_EMPTY(filename, NULL);
     891    PS_ASSERT_STRING_NON_EMPTY(argname, NULL);
     892
     893    // Search the argument data for the named fileset (argname)
     894    bool status;                        // Status of MD lookup
     895    psArray *filenames = psMetadataLookupPtr(&status, sysConfig->arguments, argname); // Filenames for file
     896    if (!status) {
     897        if (success) {
     898            *success = true;
     899        }
     900        return NULL;
     901    }
     902    if (filenames->n == 0) {
     903        psError(PM_ERR_CONFIG, true, "No files in array in %s in arguments", argname);
     904        if (success) {
     905            *success = false;
     906        }
     907        return NULL;
     908    }
     909
     910    pmFPAfile *file = fpaFileDefineFromArray(outConfig, sysConfig, NULL, filename, filenames); // File of interest
     911
     912    if (success) {
     913        *success = file ? true : false;
     914    }
     915
     916    return file;
    882917}
    883918
  • branches/eam_branches/ipp-20130307/psModules/src/camera/pmFPAfileDefine.h

    r27657 r35381  
    8181    const char *filename                ///< Name of file
    8282    );
     83
     84// find the file associated with the argname & generate a pmFPAfile for it based on the filerule
     85pmFPAfile *pmFPAfileDefineNewConfig(
     86    bool *success,                      ///< Found files?
     87    pmConfig **outConfig,               ///< output configuration for this file
     88    pmConfig *sysConfig,                ///< existing system config info
     89    const char *filename,               ///< name of filerule
     90    const char *argname                 ///< argument entry
     91    );
     92
    8393
    8494// look for the given argname on the argument list.  find the give filename from the file rules
Note: See TracChangeset for help on using the changeset viewer.