IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23447


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

Split the FILES in the RUN metadata into two parts --- FILES.INPUT and FILES.OUTPUT. Bill needs this distinction so he knows what has to be distributed.

Location:
trunk/psModules/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAfileIO.c

    r23272 r23447  
    166166    }
    167167
    168     if (!pmConfigRunFileAdd(config, file)) {
     168    if (!pmConfigRunFileAddRead(config, file)) {
    169169        psError(PS_ERR_UNKNOWN, false, "Unable to add file to run-time information");
    170170        return false;
     
    421421    }
    422422
    423     if (!pmConfigRunFileAdd(config, file)) {
     423    if (!pmConfigRunFileAddWrite(config, file)) {
    424424        psError(PS_ERR_UNKNOWN, false, "Unable to add file to run-time information");
    425425        return false;
  • trunk/psModules/src/config/pmConfigRun.c

    r23272 r23447  
    3939}
    4040
    41 
    42 bool pmConfigRunFileAdd(pmConfig *config, const pmFPAfile *file)
     41// Add a file to a nominated metadata in the RUN information
     42static bool configRunFileAdd(pmConfig *config, // Configuration
     43                             const pmFPAfile *file, // File to add
     44                             const char *target // Name of metadata to which to add
     45                             )
    4346{
    4447    PS_ASSERT_PTR_NON_NULL(config, false);
     
    4750    psMetadata *run = configRun(config);// RUN information
    4851    psAssert(run, "Require run-time information");
    49     psMetadata *files = configElement(run, "FILES", "Filerules used during execution");
     52    psMetadata *files = configElement(run, target, "Filerules used during execution");
    5053    psAssert(files, "Require list of files");
    5154
     
    7174}
    7275
    73 psArray *pmConfigRunFileGet(pmConfig *config, const char *name)
     76bool pmConfigRunFileAddRead(pmConfig *config, const pmFPAfile *file)
    7477{
    7578    PS_ASSERT_PTR_NON_NULL(config, false);
    76     PS_ASSERT_STRING_NON_EMPTY(name, false);
     79    PS_ASSERT_PTR_NON_NULL(file, false);
    7780
     81    return configRunFileAdd(config, file, "FILES.INPUT");
     82}
     83
     84bool pmConfigRunFileAddWrite(pmConfig *config, const pmFPAfile *file)
     85{
     86    PS_ASSERT_PTR_NON_NULL(config, false);
     87    PS_ASSERT_PTR_NON_NULL(file, false);
     88
     89    return configRunFileAdd(config, file, "FILES.OUTPUT");
     90}
     91
     92// Get an array of filenames from the nominated RUN information
     93static psArray *configRunFileGet(pmConfig *config, // Configuration
     94                                 const char *name, // Name of file
     95                                 const char *source // Source metadata for file
     96                                 )
     97{
    7898    psMetadata *run = configRun(config);// RUN information
    7999    psAssert(run, "Require run-time information");
    80     psMetadata *files = configElement(run, "FILES", "Filerules used during execution");
     100    psMetadata *files = configElement(run, source, "Filerules used during execution");
    81101    psAssert(files, "Require list of files");
     102
     103    if (psListLength(files->list) == 0) {
     104        // Can't find anything
     105        return NULL;
     106    }
    82107
    83108    psList *list = psListAlloc(NULL);   // List of file names
     
    104129
    105130    return array;
     131}
     132
     133
     134psArray *pmConfigRunFileGet(pmConfig *config, const char *name)
     135{
     136    PS_ASSERT_PTR_NON_NULL(config, false);
     137    PS_ASSERT_STRING_NON_EMPTY(name, false);
     138
     139    // Try the input and output, in turn
     140    psArray *files = configRunFileGet(config, name, "FILES.INPUT"); // Files from RUN metadata
     141    if (!files) {
     142        configRunFileGet(config, name, "FILES.OUTPUT");
     143    }
     144
     145    return files;
    106146}
    107147
  • trunk/psModules/src/config/pmConfigRun.h

    r23268 r23447  
    66#include <pmFPAfile.h>
    77
    8 /// Add a file to the list of files used in the run-time information
    9 bool pmConfigRunFileAdd(
     8/// Add a file to the list of files read in the run-time information
     9bool pmConfigRunFileAddRead(
     10    pmConfig *config,                   ///< Configuration
     11    const pmFPAfile *file               ///< File to add
     12    );
     13
     14/// Add a file to the list of files written in the run-time information
     15bool pmConfigRunFileAddWrite(
    1016    pmConfig *config,                   ///< Configuration
    1117    const pmFPAfile *file               ///< File to add
Note: See TracChangeset for help on using the changeset viewer.