IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 26, 2009, 1:59:32 PM (17 years ago)
Author:
beaumont
Message:

merged with trunk

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
13 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/psModules

  • branches/cnb_branches/cnb_branch_20090301/psModules/src/config

    • Property svn:ignore
      •  

        old new  
        77pmErrorCodes.c
        88pmErrorCodes.h
         9pmVersionDefinitions.h
  • branches/cnb_branches/cnb_branch_20090301/psModules/src/config/Makefile.am

    r23351 r24244  
    11noinst_LTLIBRARIES = libpsmodulesconfig.la
    22
    3 # PSMODULES_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi`
    4 # PSMODULES_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi`
    5 # PSMODULES_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi`
     3if HAVE_SVNVERSION
     4PSMODULES_VERSION=`$(SVNVERSION) ../..`
     5else
     6PSMODULES_VERSION="UNKNOWN"
     7endif
     8
     9if HAVE_SVN
     10PSMODULES_BRANCH=`$(SVN) info ../.. | $(SED) -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'`
     11PSMODULES_SOURCE=`$(SVN) info | $(SED) -n -e 's/Repository UUID: // p'`
     12else
     13PSMODULES_BRANCH="UNKNOWN"
     14PSMODULES_SOURCE="UNKNOWN"
     15endif
    616
    717# Force recompilation of pmVersion.c, since it gets the version information
    8 # pmVersion.c: FORCE
    9 #       touch pmVersion.c
    10 # FORCE: ;
     18pmVersion.c: pmVersionDefinitions.h
     19pmVersionDefinitions.h: pmVersionDefinitions.h.in FORCE
     20        -$(RM) pmVersionDefinitions.h
     21        $(SED) -e "s|@PSMODULES_VERSION@|\"$(PSMODULES_VERSION)\"|" -e "s|@PSMODULES_BRANCH@|\"$(PSMODULES_BRANCH)\"|" -e "s|@PSMODULES_SOURCE@|\"$(PSMODULES_SOURCE)\"|" pmVersionDefinitions.h.in > pmVersionDefinitions.h
     22FORCE: ;
    1123
    12 libpsmodulesconfig_la_CPPFLAGS = $(SRCINC) $(PSMODULES_CFLAGS) -DPSMODULES_VERSION=$(SVN_VERSION) -DPSMODULES_BRANCH=$(SVN_BRANCH) -DPSMODULES_SOURCE=$(SVN_SOURCE)
     24libpsmodulesconfig_la_CPPFLAGS = $(SRCINC) $(PSMODULES_CFLAGS)
    1325libpsmodulesconfig_la_LDFLAGS  = -release $(PACKAGE_VERSION)
    1426libpsmodulesconfig_la_SOURCES  = \
     
    3547
    3648# Error codes.
    37 BUILT_SOURCES = pmErrorCodes.h pmErrorCodes.c
    38 CLEANFILES = *~ pmErrorCodes.h pmErrorCodes.c
     49BUILT_SOURCES = pmErrorCodes.h pmErrorCodes.c pmVersionDefinitions.h
     50CLEANFILES = *~ pmErrorCodes.h pmErrorCodes.c pmVersionDefinitions.h
    3951
    4052pmErrorCodes.h : pmErrorCodes.dat pmErrorCodes.h.in
  • branches/cnb_branches/cnb_branch_20090301/psModules/src/config/pmConfig.c

    r23594 r24244  
    551551                psWarning("Unable to resolve log destination: %s --- ignored", logDest);
    552552            } else {
     553                pmConfigRunFilenameAddWrite(config, "LOG", logDest);
    553554                config->logFD = psMessageDestination(resolved);
    554555            }
     
    609610                psWarning("Unable to resolve trace destination: %s --- ignored", traceDest);
    610611            } else {
     612                pmConfigRunFilenameAddWrite(config, "TRACE", traceDest);
    611613                config->traceFD = psMessageDestination(resolved);
    612614            }
  • branches/cnb_branches/cnb_branch_20090301/psModules/src/config/pmConfigDump.c

    r23351 r24244  
    138138
    139139
    140 bool pmConfigDump(const pmConfig *config, const pmFPA *source, const char *filename)
     140bool pmConfigDump(const pmConfig *config, const char *filename)
    141141{
    142142    PS_ASSERT_PTR_NON_NULL(config, false);
  • branches/cnb_branches/cnb_branch_20090301/psModules/src/config/pmConfigDump.h

    r19399 r24244  
    3131///
    3232bool pmConfigDump(const pmConfig *config, ///< Configuration to dump
    33                   const pmFPA *source,    ///< Source FPA, defines the level for the file rule
    3433                  const char *filename    ///< Output file name
    3534    );
  • branches/cnb_branches/cnb_branch_20090301/psModules/src/config/pmConfigRecipes.c

    r23351 r24244  
    8181            psTrace ("psModules.config", 3, "read recipes from camera config");
    8282        } else {
    83             psLogMsg ("psModules.config", PS_LOG_DETAIL, "no recipe supplied by camera config");
     83            psTrace ("psModules.config", PS_LOG_DETAIL, "no recipe supplied by camera config");
    8484        }
    8585    }
     
    9797            psTrace ("psModules.config", 3, "read recipes from symbolic references");
    9898        } else {
    99             psLogMsg ("psModules.config", PS_LOG_DETAIL, "no recipe supplied by symbolic reference");
     99            psTrace ("psModules.config", PS_LOG_DETAIL, "no recipe supplied by symbolic reference");
    100100        }
    101101
     
    105105            return false;
    106106        }
    107         psLogMsg ("psModules.config", PS_LOG_DETAIL, "merged camera recipes with system recipes");
     107        psTrace ("psModules.config", PS_LOG_DETAIL, "merged camera recipes with system recipes");
    108108
    109109        // load recipe-files specified on the command line
     
    115115            psTrace ("psModules.config", 3, "read recipes from command-line arguments");
    116116        } else {
    117             psLogMsg ("psModules.config", PS_LOG_DETAIL, "no recipe supplied on command-line arguments");
     117            psTrace ("psModules.config", PS_LOG_DETAIL, "no recipe supplied on command-line arguments");
    118118        }
    119119
     
    126126            psTrace ("psModules.config", 3, "read recipes from symbolic references");
    127127        } else {
    128             psLogMsg ("psModules.config", PS_LOG_DETAIL, "no recipe supplied by symbolic reference");
     128            psTrace ("psModules.config", PS_LOG_DETAIL, "no recipe supplied by symbolic reference");
    129129        }
    130130
     
    137137            psTrace ("psModules.config", 3, "read recipes from command-line arguments");
    138138        } else {
    139             psLogMsg ("psModules.config", PS_LOG_DETAIL, "no recipe supplied on command-line arguments");
     139            psTrace ("psModules.config", PS_LOG_DETAIL, "no recipe supplied on command-line arguments");
    140140        }
    141141    }
     
    348348            psFree(recipesIter);
    349349            return false;
    350         }
     350        }
    351351    }
    352352    psFree(recipesIter);
  • branches/cnb_branches/cnb_branch_20090301/psModules/src/config/pmConfigRun.c

    r23594 r24244  
    4141// Add a file to a nominated metadata in the RUN information
    4242static bool configRunFileAdd(pmConfig *config, // Configuration
    43                              const pmFPAfile *file, // File to add
     43                             const char *description, // Description of file
     44                             const char *name, // Name of file
    4445                             const char *target // Name of metadata to which to add
    4546                             )
    4647{
    4748    PS_ASSERT_PTR_NON_NULL(config, false);
    48     PS_ASSERT_PTR_NON_NULL(file, false);
     49    PS_ASSERT_STRING_NON_EMPTY(description, false);
     50    PS_ASSERT_STRING_NON_EMPTY(name, false);
     51    PS_ASSERT_STRING_NON_EMPTY(target, false);
    4952
    5053    psMetadata *run = configRun(config);// RUN information
     
    5356    psAssert(files, "Require list of files");
    5457
    55     const char *name = file->name;      // Name of symbolic file
    56     const char *value = file->origname ? file->origname : file->filename; // The file (system) name
    57 
    5858    psString regex = NULL;              // Regular expression for iteration
    59     psStringAppend(&regex, "^%s$", name);
     59    psStringAppend(&regex, "^%s$", description);
    6060    psMetadataIterator *iter = psMetadataIteratorAlloc(files, PS_LIST_HEAD, regex);
    6161    psFree(regex);
     
    6363    while ((item = psMetadataGetAndIncrement(iter))) {
    6464        psAssert(item->type == PS_DATA_STRING, "We only put STRING types here.");
    65         if (strcmp(item->data.str, value) == 0) {
     65        if (strcmp(item->data.str, name) == 0) {
    6666            // It's already present
    6767            psFree(iter);
     
    7171    psFree(iter);
    7272
    73     return psMetadataAddStr(files, PS_LIST_TAIL, name, PS_META_DUPLICATE_OK, NULL, value);
     73    return psMetadataAddStr(files, PS_LIST_TAIL, description, PS_META_DUPLICATE_OK, NULL, name);
    7474}
    7575
     
    7979    PS_ASSERT_PTR_NON_NULL(file, false);
    8080
    81     return configRunFileAdd(config, file, "FILES.INPUT");
     81    return configRunFileAdd(config, file->name, file->origname ? file->origname : file->filename,
     82                            "FILES.INPUT");
     83}
     84
     85bool pmConfigRunFilenameAddRead(pmConfig *config, const char *description, const char *name)
     86{
     87    PS_ASSERT_PTR_NON_NULL(config, false);
     88    PS_ASSERT_STRING_NON_EMPTY(description, false);
     89    PS_ASSERT_STRING_NON_EMPTY(name, false);
     90
     91    return configRunFileAdd(config, description, name, "FILES.INPUT");
    8292}
    8393
     
    8797    PS_ASSERT_PTR_NON_NULL(file, false);
    8898
    89     return configRunFileAdd(config, file, "FILES.OUTPUT");
     99    return configRunFileAdd(config, file->name, file->origname ? file->origname : file->filename,
     100                            "FILES.OUTPUT");
     101}
     102
     103bool pmConfigRunFilenameAddWrite(pmConfig *config, const char *description, const char *name)
     104{
     105    PS_ASSERT_PTR_NON_NULL(config, false);
     106    PS_ASSERT_STRING_NON_EMPTY(description, false);
     107    PS_ASSERT_STRING_NON_EMPTY(name, false);
     108
     109    return configRunFileAdd(config, description, name, "FILES.OUTPUT");
    90110}
    91111
  • branches/cnb_branches/cnb_branch_20090301/psModules/src/config/pmConfigRun.h

    r23594 r24244  
    1212    );
    1313
     14/// Add a filename to the list of files read in the run-time information
     15bool pmConfigRunFilenameAddRead(
     16    pmConfig *config,                   ///< Configuration
     17    const char *description,            ///< Description of file
     18    const char *name                    ///< Name of file
     19    );
     20
    1421/// Add a file to the list of files written in the run-time information
    1522bool pmConfigRunFileAddWrite(
    1623    pmConfig *config,                   ///< Configuration
    1724    const pmFPAfile *file               ///< File to add
     25    );
     26
     27/// Add a filename to the list of files written in the run-time information
     28bool pmConfigRunFilenameAddWrite(
     29    pmConfig *config,                   ///< Configuration
     30    const char *description,            ///< Description of file
     31    const char *name                    ///< Name of file
    1832    );
    1933
  • branches/cnb_branches/cnb_branch_20090301/psModules/src/config/pmErrorCodes.dat

    r13654 r24244  
    1111OBJECTS                 Problem in objects
    1212SKY                     Problem in sky
     13STAMPS                  Unable to select stamps for PSF-matching
    1314# these errors correspond to standard exit conditions
    1415ARGUMENTS               Incorrect arguments
  • branches/cnb_branches/cnb_branch_20090301/psModules/src/config/pmErrorCodes.h.in

    r11300 r24244  
    99 */
    1010typedef enum {
    11     PM_ERR_BASE = 1200,
     11    PM_ERR_BASE = 1000,
    1212    PM_ERR_${ErrorCode},
    1313    PM_ERR_NERROR
  • branches/cnb_branches/cnb_branch_20090301/psModules/src/config/pmVersion.c

    r23351 r24244  
    77#include <pslib.h>
    88#include "pmVersion.h"
     9#include "pmVersionDefinitions.h"
    910
    1011#ifndef PSMODULES_VERSION
     
    1819#endif
    1920
    20 #define xstr(s) str(s)
    21 #define str(s) #s
    22 
    2321psString psModulesVersion(void)
    2422{
    2523    char *value = NULL;
    26     psStringAppend(&value, "%s@%s", xstr(PSMODULES_BRANCH), xstr(PSMODULES_VERSION));
     24    psStringAppend(&value, "%s@%s", PSMODULES_BRANCH, PSMODULES_VERSION);
    2725    return value;
    2826}
     
    3028psString psModulesSource(void)
    3129{
    32     return psStringCopy(xstr(PSMODULES_SOURCE));
     30    return psStringCopy(PSMODULES_SOURCE);
    3331}
    3432
Note: See TracChangeset for help on using the changeset viewer.