IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3220


Ignore:
Timestamp:
Feb 14, 2005, 5:02:53 PM (21 years ago)
Author:
desonia
Message:

* empty log message *

Location:
trunk/psLib
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/config/psTime.config.template

    r3182 r3220  
    11# This configuration file specifies values required for time calculations by psLib.
    2 psLib.time.tables.dir STR PREFIX/data                                                   # Directory for time tables
     2psLib.time.tables.dir STR PREFIX/share/pslib                                            # Directory for time tables
    33psLib.time.tables.n S32 4                                                               # Number of time tables
    44psLib.time.tables.files STR ser7.dat eopc01_1900_2004.dat finals_all.dat tai_utc.dat    # These are the table file names
  • trunk/psLib/configure.ac

    r3219 r3220  
    150150
    151151CFLAGS="${CFLAGS=} -Wall -Werror"
    152 CFLAGS="${CFLAGS=}  -DCONFIG_FILE=\\\"$sysconfdir/pslib/psTime.config\\\""
    153 CFLAGS="${CFLAGS=}  -DXML_CONFIG_FILE=\\\"$sysconfdir/pslib/psTime.xml\\\""
    154 CFLAGS="${CFLAGS=}  -DUTC_DAT_FILE=\\\"$datadir/pslib/tai_utc.dat\\\""
     152CFLAGS="${CFLAGS=}  -DPS_CONFIG_FILE_DEFAULT=\\\"$sysconfdir/pslib/psTime.config\\\""
    155153
    156154
  • trunk/psLib/etc/pslib/psTime.config.template

    r3182 r3220  
    11# This configuration file specifies values required for time calculations by psLib.
    2 psLib.time.tables.dir STR PREFIX/data                                                   # Directory for time tables
     2psLib.time.tables.dir STR PREFIX/share/pslib                                            # Directory for time tables
    33psLib.time.tables.n S32 4                                                               # Number of time tables
    44psLib.time.tables.files STR ser7.dat eopc01_1900_2004.dat finals_all.dat tai_utc.dat    # These are the table file names
  • trunk/psLib/src/astro/psTime.c

    r3182 r3220  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-02-10 02:36:41 $
     12 *  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-02-15 03:02:53 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    7474psF64 searchTables(psF64 index, psU64 column, psLookupStatusType *status, char *metadataTableNames[], psU32 nTables);
    7575
     76
    7677/** Removes leading and trailing whitespace and # characters from a string. The cleaned string is a new null
    7778 *  terminated copy of the original input string. */
     
    133134    return cleanToken;
    134135}
     136
     137// get the psTime.config filename by checking environment variable first, then original installation area.
     138char* p_psGetConfigFileName()
     139{
     140    char* filename = getenv("PS_CONFIG_FILE");
     141
     142    if (filename == NULL) { // environment variable not found
     143        filename = PS_CONFIG_FILE_DEFAULT; // this should come from configure.ac
     144    }
     145
     146    return filename;
     147}
     148
    135149
    136150/** Searches time tables in priority order and performs interpolation if input index value is within a table.
     
    148162    // Check time metadata. Function call reports errors.
    149163    if(timeMetadata == NULL) {
    150         if(!p_psTimeInit(CONFIG_FILE))
     164        if(!p_psTimeInit(p_psGetConfigFileName()))
    151165            return 0.0;
    152166    }
     
    705719    // Check time metadata
    706720    if(timeMetadata == NULL) {
    707         if(!p_psTimeInit(CONFIG_FILE)) {
     721        if(!p_psTimeInit(p_psGetConfigFileName())) {
    708722            psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_FILE_NOT_FOUND, "psTime.config");
    709723            return 0.0;
  • trunk/psLib/src/astro/psTime.h

    r2725 r3220  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-12-16 18:52:51 $
     12 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-02-15 03:02:53 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    284284);
    285285
     286/** Get the filename of the psLib configuration file.
     287 *
     288 *  @return char*          If a PS_CONFIG_FILE environment variable exists,
     289 *                         that is returned, otherwise the default location
     290 *                         dependent on the installation location.
     291 */
     292char* p_psGetConfigFileName();
     293
    286294/// @}
    287295
  • trunk/psLib/src/astronomy/psTime.c

    r3182 r3220  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-02-10 02:36:41 $
     12 *  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-02-15 03:02:53 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    7474psF64 searchTables(psF64 index, psU64 column, psLookupStatusType *status, char *metadataTableNames[], psU32 nTables);
    7575
     76
    7677/** Removes leading and trailing whitespace and # characters from a string. The cleaned string is a new null
    7778 *  terminated copy of the original input string. */
     
    133134    return cleanToken;
    134135}
     136
     137// get the psTime.config filename by checking environment variable first, then original installation area.
     138char* p_psGetConfigFileName()
     139{
     140    char* filename = getenv("PS_CONFIG_FILE");
     141
     142    if (filename == NULL) { // environment variable not found
     143        filename = PS_CONFIG_FILE_DEFAULT; // this should come from configure.ac
     144    }
     145
     146    return filename;
     147}
     148
    135149
    136150/** Searches time tables in priority order and performs interpolation if input index value is within a table.
     
    148162    // Check time metadata. Function call reports errors.
    149163    if(timeMetadata == NULL) {
    150         if(!p_psTimeInit(CONFIG_FILE))
     164        if(!p_psTimeInit(p_psGetConfigFileName()))
    151165            return 0.0;
    152166    }
     
    705719    // Check time metadata
    706720    if(timeMetadata == NULL) {
    707         if(!p_psTimeInit(CONFIG_FILE)) {
     721        if(!p_psTimeInit(p_psGetConfigFileName())) {
    708722            psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_FILE_NOT_FOUND, "psTime.config");
    709723            return 0.0;
  • trunk/psLib/src/astronomy/psTime.h

    r2725 r3220  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-12-16 18:52:51 $
     12 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-02-15 03:02:53 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    284284);
    285285
     286/** Get the filename of the psLib configuration file.
     287 *
     288 *  @return char*          If a PS_CONFIG_FILE environment variable exists,
     289 *                         that is returned, otherwise the default location
     290 *                         dependent on the installation location.
     291 */
     292char* p_psGetConfigFileName();
     293
    286294/// @}
    287295
  • trunk/psLib/test/astronomy/Makefile.am

    r3152 r3220  
    1212
    1313AM_LDFLAGS = -L$(top_builddir)/src $(PSLIB_LIBS)
     14AM_CFLAGS = -DXML_CONFIG_FILE="\"$(top_srcdir)/etc/pslib/psTime.xml\""
    1415
    1516check_PROGRAMS = tst_psTime_01 \
  • trunk/psLib/test/astronomy/test.psTime.config2.template

    r3056 r3220  
    11# This configuration file specifies values required for time calculations by psLib.
    2 psLib.time.tables.dir STR PREFIX/data                                                    # Directory for time tables
     2psLib.time.tables.dir STR PREFIX/share/pslib                                            # Directory for time tables
    33psLib.time.tables.n S32 4                                                               # Number of time tables
    44psLib.time.tables.files STR eopc01_1900_2004.dat finals_all.dat tai_utc.dat    # These are the table file names
  • trunk/psLib/test/astronomy/test.psTime.config3.template

    r3056 r3220  
    11# This configuration file specifies values required for time calculations by psLib.
    2 psLib.time.tables.dir STR PREFIX/data                                                    # Directory for time tables
     2psLib.time.tables.dir STR PREFIX/share/pslib                                            # Directory for time tables
    33psLib.time.tables.n S32 4                                                               # Number of time tables
    44psLib.time.tables.files STR ser7.dat eopc01_1900_2004.dat finals_all.dat tai_utc.dat    # These are the table file names
  • trunk/psLib/test/astronomy/tst_psTime_04.c

    r3115 r3220  
    1414 *  @author  Ross Harman, MHPCC
    1515 *
    16  *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
    17  *  @date  $Date: 2005-02-03 00:54:12 $
     16 *  @version $Revision: 1.8 $  $Name: not supported by cvs2svn $
     17 *  @date  $Date: 2005-02-15 03:02:53 $
    1818 *
    1919 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3030    // Test A - Initialize time
    3131    printPositiveTestHeader(stdout, "psTime", "Test A - Initialize time");
    32     psLibInit(true, CONFIG_FILE);
     32    psLibInit(true, p_psGetConfigFileName());
    3333    psLibFinalize();
    3434    printFooter(stdout, "psTime", "Test A - Initialize time", true);
  • trunk/psLib/test/dataIO/Makefile.am

    r3127 r3220  
    1414
    1515AM_LDFLAGS = -L$(top_builddir)/src $(PSLIB_LIBS)
     16AM_CFLAGS = -DUTC_DAT_FILE="\"$(top_srcdir)/share/pslib/tai_utc.dat\""
    1617
    1718check_PROGRAMS = \
  • trunk/psLib/test/fileUtils/Makefile.am

    r3127 r3220  
    1414
    1515AM_LDFLAGS = -L$(top_builddir)/src $(PSLIB_LIBS)
     16AM_CFLAGS = -DUTC_DAT_FILE="\"$(top_srcdir)/share/pslib/tai_utc.dat\""
    1617
    1718check_PROGRAMS = \
Note: See TracChangeset for help on using the changeset viewer.