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

SAC code is active now

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: 2328
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent c67ece6e
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id: Makefile,v 1.29 2007-06-19 14:23:49 tforb Exp $
# $Id: Makefile,v 1.30 2007-06-29 10:33:22 tforb Exp $
#
# Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
#
......@@ -35,7 +35,7 @@ HEADERS=$(wildcard *.h */*.h)
HEADERS=datread.h bonjer.h bonjer/readbonjer.h readany.h error.h \
pdas.h pdas/pdasread.h pdas/pdasflags.h mseed/seedstructdump.h \
sff.h mseed.h mseed/mseedread.h mseed/seedstructs.h \
hpmo.h hpmo/readhpmo.h hpmo/hpmodata.h util.h
hpmo.h hpmo/readhpmo.h hpmo/hpmodata.h util.h sac.h sac/sacread.h
#SRC=misc/fortranio.cc misc/commandline.cc misc/ioswap.cc misc/error.cc \
# misc/blitzfortranio.cc hacks/hack_blitztogrepg.cc
......@@ -44,10 +44,10 @@ LIBSRC=datread.cc bonjer/bonjer.cc bonjer/readbonjer.cc readany.cc error.cc \
pdas/pdas.cc pdas/pdasread.cc mseed/seedstructdump.cc \
sff/sff.cc mseed/mseedread.cc mseed/mseed.cc mseed/seedstructs.cc \
hpmo/hpmo.cc hpmo/readhpmo.cc hpmo/hpmodata.cc \
util.cc
util.cc sac/sac.cc sac/sacread.cc
TESTSRC=tests/hpmotest.cc tests/pdastest.cc tests/mseedtest.cc \
tests/sfftest.cc
tests/sfftest.cc tests/sactest.cc
INCINSTALLPATH=$(LOCINCLUDEDIR)/datreadxx
LIBINSTALLPATH=$(LOCLIBDIR)
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: sac.cc,v 1.3 2006-03-28 16:07:48 tforb Exp $
* $Id: sac.cc,v 1.4 2007-06-29 10:33:22 tforb Exp $
* \author Thomas Forbriger
* \date 21/12/2004
*
......@@ -35,9 +35,9 @@
#define TF_SAC_CC_VERSION \
"TF_SAC_CC V1.0 "
#define TF_SAC_CC_CVSID \
"$Id: sac.cc,v 1.3 2006-03-28 16:07:48 tforb Exp $"
"$Id: sac.cc,v 1.4 2007-06-29 10:33:22 tforb Exp $"
#include <sac.h>
#include <datreadxx/sac.h>
namespace datread {
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: sacread.cc,v 1.3 2006-03-28 16:07:48 tforb Exp $
* $Id: sacread.cc,v 1.4 2007-06-29 10:33:22 tforb Exp $
* \author Thomas Forbriger
* \date 21/12/2004
*
......@@ -35,9 +35,9 @@
#define TF_SACREAD_CC_VERSION \
"TF_SACREAD_CC V1.0 "
#define TF_SACREAD_CC_CVSID \
"$Id: sacread.cc,v 1.3 2006-03-28 16:07:48 tforb Exp $"
"$Id: sacread.cc,v 1.4 2007-06-29 10:33:22 tforb Exp $"
#include <sacread.h>
#include <datreadxx/sacread.h>
namespace datread {
......
/*! \file sactest.cc
* \brief test SAC reading code
*
* ----------------------------------------------------------------------------
*
* $Id: sactest.cc,v 1.3 2007-06-29 10:33:23 tforb Exp $
* \author Thomas Forbriger
* \date 29/06/2007
*
* tes SAC reading code
*
* Copyright (c) 2007 by Thomas Forbriger (BFO Schiltach)
*
* ----
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* ----
*
* REVISIONS and CHANGES
* - 29/06/2007 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define SACTEST_VERSION \
"SACTEST V1.0 test SAC reading code"
#define SACTEST_CVSID \
"$Id: sactest.cc,v 1.3 2007-06-29 10:33:23 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[]=
{
SACTEST_VERSION "\n"
"usage: sactest" "\n"
" or: sactest --help|-h" "\n"
};
// define full help text
char help_text[]=
{
SACTEST_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; }
}
/*! \file sactest.cc
* \brief test SAC reading functions
*
* ----------------------------------------------------------------------------
*
* $Id: sactest.cc,v 1.2 2006-03-28 16:07:49 tforb Exp $
* $Id: sactest.cc,v 1.3 2007-06-29 10:33:23 tforb Exp $
* \author Thomas Forbriger
* \date 21/12/2004
*
......@@ -35,7 +149,7 @@
#define SACTEST_VERSION \
"SACTEST V1.0 test SAC reading functions"
#define SACTEST_CVSID \
"$Id: sactest.cc,v 1.2 2006-03-28 16:07:49 tforb Exp $"
"$Id: sactest.cc,v 1.3 2007-06-29 10:33:23 tforb Exp $"
#include <iostream>
#include <tfxx/commandline.h>
......@@ -114,3 +228,5 @@ int main(int iargc, char* argv[])
}
/* ----- END OF sactest.cc ----- */
/* ----- END OF sactest.cc ----- */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment