Commit d15400fa authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

lot of new work

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 1419
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent b7ee3b44
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id: Makefile,v 1.1 2003-12-18 15:59:04 tforb Exp $
# $Id: Makefile,v 1.2 2003-12-22 09:08:55 tforb Exp $
#
# Copyright (c) 2003 by Thomas Forbriger (BFO Schiltach)
#
......@@ -11,33 +11,6 @@
#
# ============================================================================
#
all:
flist: Makefile
echo $^ | tr ' ' '\n' | sort > $@
.PHONY: edit
edit: flist; vim $<
.PHONY: clean
clean: ;
-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id: Makefile,v 1.1 2003-12-18 15:59:04 tforb Exp $
#
# Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)
#
# GSE++ library to read and write GSE waveforms
#
# REVISIONS and CHANGES
# 16/03/2002 V1.0 Thomas Forbriger
# 14/11/2002 V1.1 place doxygen docu on WWW
#
# ============================================================================
# general part
# ------------
#
......@@ -48,9 +21,9 @@ CXXFLAGS=-Wall $(FLAGS)
LDFLAGS=-L$(LOCLIBDIR)
CPPFLAGS=-I$(LOCINCLUDEDIR) $(FLAGS)
all: libgsexx.a doxybrief doxyfull
all: libsffxx.a doxybrief doxyfull
flist: Makefile README $(wildcard *.h *.cc *.cfg)
flist: Makefile $(wildcard *.h *.cc *.cfg)
echo $^ | tr ' ' '\n' | sort > $@
.PHONY: edit
......@@ -59,7 +32,7 @@ edit: flist; vim $<
.PHONY: clean
clean: ;
-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist *.d *.o gsexx_tests
-/bin/rm -vf flist *.d *.o sffxx_tests
#======================================================================
# pattern rules
......@@ -75,28 +48,28 @@ clean: ;
# library part
# ------------
LIBSRC=gsexx.cc gsexx_TCHK2.cc gsexx_TWID2.cc gsexx_TSTA2.cc gsexx_TDAT2.cc \
gsexx_cm6.cc
INCSRC=gsexx.h gsexx_diff.h gsexx_TDAT2.h
LIBSRC=sffxx.cc sffxx_TCHK2.cc sffxx_TWID2.cc sffxx_TSTA2.cc sffxx_TDAT2.cc \
sffxx_cm6.cc
INCSRC=sffxx.h sffxx_diff.h sffxx_TDAT2.h
-include $(patsubst %.cc,%.d,$(LIBSRC))
libgsexx.a: $(patsubst %.cc,%.o,$(LIBSRC))
libsffxx.a: $(patsubst %.cc,%.o,$(LIBSRC))
ar rcv $@ $^
ranlib $@
newlib $@
install-include: ; newinclude gsexx.h
install-include: ; newinclude sffxx.h
#======================================================================
# documentation part
# ------------------
DOXYWWWPATH=$(HOME)/public_html/txt/cxx/libgsexx
DOXYWWWPATH=$(HOME)/public_html/txt/cxx/libsffxx
.PHONY: doxyclean doxyview doxybriefview doxyfullconf doxybriefconf
doxyclean: ;/bin/rm -rfv doc docbrief
DOXYSRC=README $(LIBSRC) $(INCSRC) gsexx_tests.cc
DOXYSRC=$(LIBSRC) $(INCSRC) sfftest.cc
doc/%: doxyfull.cfg $(DOXYSRC)
mkdir -vp $(DOXYWWWPATH)
......@@ -120,10 +93,8 @@ doxyview: doxyfullview doxybrief
# test code
# ---------
gsexx_tests: gsexx_tests.cc
$(CXX) -o $@ $< -I$(LOCINCLUDEDIR) -lgsexx -L$(LOCLIBDIR)
tests: gsexx_tests; $<; rm -fv $<
# ----- END OF Makefile -----
sffxx_tests: sffxx_tests.cc
$(CXX) -o $@ $< -I$(LOCINCLUDEDIR) -lsffxx -L$(LOCLIBDIR)
tests: sffxx_tests; $<; rm -fv $<
# ----- END OF Makefile -----
/*! \file sfftest.cc
* \brief test library modules
*
* ----------------------------------------------------------------------------
*
* $Id: sfftest.cc,v 1.1 2003-12-22 09:08:55 tforb Exp $
* \author Thomas Forbriger
* \date 21/12/2003
*
* test library modules
*
* Copyright (c) 2003 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 21/12/2003 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define SFFTEST_VERSION \
"SFFTEST V1.0 test library modules"
#define SFFTEST_CVSID \
"$Id: sfftest.cc,v 1.1 2003-12-22 09:08:55 tforb Exp $"
#include <iostream>
#include <tfxx/commandline.h>
using std::cout;
using std::cerr;
using std::endl;
int main(int iargc, char* argv[])
{
// define usage information
char usage_text[]=
{
SFFTEST_VERSION "\n"
"usage: sfftest" "\n"
" or: sfftest --help|-h" "\n"
};
// define full help text
char help_text[]=
{
SFFTEST_CVSID
};
// define commandline options
using namespace tfxx::cmdline;
static Declare options[]=
{
// 0: print help
{"help",arg_no,"-"},
// 1: verbose mode
{"v",arg_no,"-"},
{NULL}
};
// no arguments? print usage...
if (iargc<2)
{
cerr << usage_text << endl;
exit(0);
}
// collect options from commandline
Commandline cmdline(iargc, argv, options);
// help requested? print full help text...
if (cmdline.optset(0))
{
cerr << usage_text << endl;
cerr << help_text << endl;
exit(0);
}
// dummy operation: print option settings
for (int iopt=0; iopt<2; iopt++)
{
cout << "option: '" << options[iopt].opt_string << "'" << endl;
if (cmdline.optset(iopt)) { cout << " option was set"; }
else { cout << "option was not set"; }
cout << endl;
cout << " argument (string): '" << cmdline.string_arg(iopt) << "'" << endl;
cout << " argument (int): '" << cmdline.int_arg(iopt) << "'" << endl;
cout << " argument (long): '" << cmdline.long_arg(iopt) << "'" << endl;
cout << " argument (float): '" << cmdline.float_arg(iopt) << "'" << endl;
cout << " argument (double): '" << cmdline.double_arg(iopt) << "'" << endl;
cout << " argument (bool): '";
if (cmdline.bool_arg(iopt))
{ cout << "true"; } else { cout << "false"; }
cout << "'" << endl;
}
while (cmdline.extra()) { cout << cmdline.next() << endl; }
// dummy operation: print rest of command line
while (cmdline.extra()) { cout << cmdline.next() << endl; }
}
/* ----- END OF sfftest.cc ----- */
/*! \file sffxx.cc
* \brief SFF library (implementation)
*
* ----------------------------------------------------------------------------
*
* $Id: sffxx.cc,v 1.1 2003-12-22 09:08:56 tforb Exp $
* \author Thomas Forbriger
* \date 21/12/2003
*
* SFF library (implementation)
*
* Copyright (c) 2003 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 21/12/2003 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define TF_SFFXX_CC_VERSION \
"TF_SFFXX_CC V1.0 "
#define TF_SFFXX_CC_CVSID \
"$Id: sffxx.cc,v 1.1 2003-12-22 09:08:56 tforb Exp $"
#include <sffxx.h>
namespace sff {
//! Fortran library version (to ensure compatibility)
const double libversion=1.09;
const char* const STAT::LINEID="STAT";
const char* const FREE::LINEID="FREE";
const char* const SRCE::LINEID="SRCE";
const char* const DAST::LINEID="DAST";
const char* const INFO::LINEID="INFO";
char coosysID(const Ecoosys& csid)
{
char retval;
if (csid == CS_cartesian) retval='C';
else if (csid == CS_spherical) retval='S';
else throw
GSE::Terror("ERROR (sff::coosysID): library inconsistency!");
return(retval);
} // coosysID
Ecoosys coosysID(const char& csid)
{
if (csid.substr(0,1)==std::string("C")) { Fsubformat=SF_CM6; }
else throw
Terror("ERROR (TWID2): unknown subformat key!");
} // coosysID
} // namespace sff
/* ----- END OF sffxx.cc ----- */
/*! \file sffxx.h
* \brief SFF library (prototypes)
*
* ----------------------------------------------------------------------------
*
* $Id: sffxx.h,v 1.1 2003-12-22 09:08:56 tforb Exp $
* \author Thomas Forbriger
* \date 21/12/2003
*
* SFF library (prototypes)
*
* Copyright (c) 2003 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 21/12/2003 V1.0 Thomas Forbriger
*
* ============================================================================
*/
// include guard
#ifndef TF_SFFXX_H_VERSION
#define TF_SFFXX_H_VERSION \
"TF_SFFXX_H V1.0 "
#define TF_SFFXX_H_CVSID \
"$Id: sffxx.h,v 1.1 2003-12-22 09:08:56 tforb Exp $"
/*! \brief all SFF modules
*/
namespace sff {
//! valid coordinate systems
enum Ecoosys {
CS_cartesian,
CS_spherical
}; // enum Ecoosys
struct STAT {
static const double libversion;
static const char* const LINEID;
std::string timestamp;
bool hasfree;
bool hasinfo;
}; // struct STAT
struct FREE {
static const char* const LINEID;
}; // struct FREE
struct SRCE {
static const char* const LINEID;
std::string type;
Ecoosys cs;
double cx, cy, cz;
}; // struct SRCE
struct DAST {
static const char* const LINEID;
int nchar;
double ampfac;
bool hasfree;
bool hasinfo;
bool last;
}; // struct DAST
struct INFO {
static const char* const LINEID;
Ecoosys cs;
double cx, cy, cz;
int nstacks;
}; // struct INFO
std::string coosysID(const Ecoosys& csid);
Ecoosys coosysID(const std::string& csid);
} // namespace sff
#endif // TF_SFFXX_H_VERSION (includeguard)
/* ----- END OF sffxx.h ----- */
/* this is <base_constr.cc>
* ----------------------------------------------------------------------------
*
* $Id: base_constr.cc,v 1.4 2000-12-22 13:58:03 forbrig Exp $
* $Id: base_constr.cc,v 1.5 2003-12-22 09:08:57 tforb Exp $
*
* 09/08/2000 by Thomas Forbriger (IfG Stuttgart)
*
......@@ -12,12 +12,14 @@
* 06/09/2000 V1.1 added character array initializer
* 22/12/2000 V1.2 changed namespace time to libtime (resolved conflict
* with system time library)
* 22/12/2003 V1.3 added function now()
*
* ============================================================================
*/
#include "libtime++.h"
#include <cstring>
#include <ctime>
#include <iostream>
namespace libtime {
......@@ -39,6 +41,20 @@ void TBaseClassTime::string_read(const std::string &timestring)
char_read(charstring);
}
};
TAbsoluteTime now()
{
std::time_t nowtime=std::time(NULL);
std::tm *nowtm=std::localtime(&nowtime);
int year=nowtm->tm_year+1900;
int month=nowtm->tm_mon;
int day=nowtm->tm_mday;
int hour=nowtm->tm_hour;
int minute=nowtm->tm_min;
int second=nowtm->tm_sec;
TAbsoluteTime thetime(year, month, day, hour, minute, second);
return(thetime);
}
}; // namespace libtime
/* ----- END OF base_constr.cc ----- */
# Doxygen configuration generated by Doxywizard version 0.1
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "libtime++ library: handle time and time intervals"
PROJECT_NUMBER =
OUTPUT_DIRECTORY = doc
OUTPUT_LANGUAGE = English
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = YES
FULL_PATH_NAMES = NO
STRIP_FROM_PATH =
INTERNAL_DOCS = YES
CLASS_DIAGRAMS = YES
SOURCE_BROWSER = YES
INLINE_SOURCES = YES
STRIP_CODE_COMMENTS = YES
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
VERBATIM_HEADERS = YES
SHOW_INCLUDE_FILES = YES
JAVADOC_AUTOBRIEF = YES
INHERIT_DOCS = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
DISTRIBUTE_GROUP_DOC = YES
TAB_SIZE = 8
ENABLED_SECTIONS = internal
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
ALIASES =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ./
FILE_PATTERNS = README \
*.h \
*.cc \
*.c
RECURSIVE = YES
EXCLUDE =
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
IMAGE_PATH =
INPUT_FILTER =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = YES
LATEX_OUTPUT = latex
COMPACT_LATEX = YES
PAPER_TYPE = a4wide
EXTRA_PACKAGES = pslatex
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = YES
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = YES
MAN_OUTPUT = man
MAN_EXTENSION = .3
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
HAVE_DOT = NO
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
GRAPHICAL_HIERARCHY = YES
DOT_PATH =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
GENERATE_LEGEND = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
CGI_NAME = search.cgi
CGI_URL =
DOC_URL =
DOC_ABSPATH =
BIN_ABSPATH = /usr/local/bin/
EXT_DOC_PATHS =
/* this is <libtime++.h>
* ----------------------------------------------------------------------------
*
* $Id: libtime++.h,v 2.7 2002-11-14 14:24:00 forbrig Exp $
* $Id: libtime++.h,v 2.8 2003-12-22 09:08:57 tforb Exp $
*
* Copyright (c) by Thomas Forbriger (IfG Stuttgart)
*
......@@ -16,13 +16,14 @@
* implemented non-member multiplication
* 22/12/2000 V1.4 changed namespace time to libtime (resolved conflict
* with system time library)
* 22/12/2003 V1.5 added function now()
*
* ============================================================================
*/
#ifndef TF_LIBTIME_H_
#define TF_LIBTIME_H_ \
"$Id: libtime++.h,v 2.7 2002-11-14 14:24:00 forbrig Exp $";
"$Id: libtime++.h,v 2.8 2003-12-22 09:08:57 tforb Exp $";
#include <string>
#include "libtime.h"
......@@ -423,7 +424,14 @@ inline TRelativeTime &TRelativeTime::operator= (char *timestring)
{ string_read("0/0/" + std::string(timestring)); }
}
/*S*/
/*
* some functions
* --------------
*/
TAbsoluteTime now();
/*E*/
#endif // TF_LIBTIME_H_
/* ----- END OF libtime++.h ----- */
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id: Makefile,v 1.2 2003-12-19 15:00:03 tforb Exp $
# $Id: Makefile,v 1.3 2003-12-22 09:08:58 tforb Exp $
#
# Copyright (c) 2003 by Thomas Forbriger (BFO Schiltach)
#
......@@ -92,8 +92,8 @@ doxyview: doxyfullview doxybrief
# test code
# ---------
tsxx_tests: tsxx_tests.cc
$(CXX) -o $@ $< -I$(LOCINCLUDEDIR) -ltsxx -L$(LOCLIBDIR)
tests: tsxx_tests; $<; rm -fv $<
tstest: tstest.cc
$(CXX) -o $@ $< -I$(LOCINCLUDEDIR) -ltsxx -laff -L$(LOCLIBDIR)
tests: tstest; $<; rm -fv $<
# ----- END OF Makefile -----
/*! \file tstest.cc
* \brief test time series modules
*
* ----------------------------------------------------------------------------
*
* $Id: tstest.cc,v 1.1 2003-12-22 09:08:58 tforb Exp $
* \author Thomas Forbriger
* \date 20/12/2003
*
* test time series modules
*
* Copyright (c) 2003 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 20/12/2003 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define TSTEST_VERSION \
"TSTEST V1.0 test time series modules"
#define TSTEST_CVSID \
"$Id: tstest.cc,v 1.1 2003-12-22 09:08:58 tforb Exp $"
#include <iostream>
#include <tsxx.h>
#include <aff/dump.h>
using std::cout;
using std::cerr;