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

compiles

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: 2985
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 41b90b42
......@@ -53,8 +53,8 @@ FILE_PATTERNS = README \
RECURSIVE = YES
EXCLUDE = contrib
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_PATH = tests
EXAMPLE_PATTERNS = *.cc
IMAGE_PATH =
INPUT_FILTER =
FILTER_SOURCE_FILES = NO
......@@ -79,7 +79,7 @@ ENUM_VALUES_PER_LINE = 4
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = YES
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
COMPACT_LATEX = YES
PAPER_TYPE = a4wide
......@@ -91,7 +91,7 @@ LATEX_BATCHMODE = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = YES
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: reservoir.cc,v 1.1 2010-02-20 22:33:32 tforb Exp $
* $Id: reservoir.cc,v 1.2 2010-02-21 12:31:33 tforb Exp $
* \author Thomas Forbriger
* \date 20/02/2010
*
......@@ -36,7 +36,7 @@
#define DATWRITE_RESERVOIR_CC_VERSION \
"TF_RESERVOIR_CC V1.0 "
#define DATWRITE_RESERVOIR_CC_CVSID \
"$Id: reservoir.cc,v 1.1 2010-02-20 22:33:32 tforb Exp $"
"$Id: reservoir.cc,v 1.2 2010-02-21 12:31:33 tforb Exp $"
#include <datwritexx/reservoir.h>
#include <datwritexx/error.h>
......@@ -45,6 +45,11 @@ namespace datwrite {
namespace util {
seriesreservoir::seriesreservoir()
{
Mvaluetype=Fnone;
} // seriesreservoir::seriesreservoir()
seriesreservoir::seriesreservoir(const Tdseries& series)
{
Mvaluetype=Fdouble;
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: reservoir.h,v 1.1 2010-02-20 22:33:32 tforb Exp $
* $Id: reservoir.h,v 1.2 2010-02-21 12:31:33 tforb Exp $
* \author Thomas Forbriger
* \date 20/02/2010
*
......@@ -40,7 +40,7 @@
#define DATWRITE_RESERVOIR_H_VERSION \
"TF_RESERVOIR_H V1.0 "
#define DATWRITE_RESERVOIR_H_CVSID \
"$Id: reservoir.h,v 1.1 2010-02-20 22:33:32 tforb Exp $"
"$Id: reservoir.h,v 1.2 2010-02-21 12:31:33 tforb Exp $"
#include<datwritexx/datwrite.h>
......@@ -52,6 +52,7 @@ namespace datwrite {
*
*/
enum Evaluetype {
Fnone, //! empty reservoir
Fdouble, //! double precision floating point
Ffloat, //! single precision floating point
Finteger //! integer
......@@ -71,6 +72,7 @@ namespace datwrite {
*/
class seriesreservoir {
public:
seriesreservoir();
seriesreservoir(const Tdseries& series);
seriesreservoir(const Tfseries& series);
seriesreservoir(const Tiseries& series);
......@@ -79,10 +81,10 @@ namespace datwrite {
Tfseries fseries() const;
Tiseries iseries() const;
private:
Evaluetype Mvaluetype;
Tdseries Mdseries;
Tfseries Mfseries;
Tiseries Miseries;
Evaluetype Mvaluetype;
}; // class seriesreservoir
} // namespace util
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: sff.h,v 1.5 2010-02-20 22:33:32 tforb Exp $
* $Id: sff.h,v 1.6 2010-02-21 12:31:33 tforb Exp $
* \author Thomas Forbriger
* \date 11/04/2006
*
......@@ -40,7 +40,7 @@
#define DATWRITE_SFF_H_VERSION \
"TF_SFF_H V1.0 "
#define DATWRITE_SFF_H_CVSID \
"$Id: sff.h,v 1.5 2010-02-20 22:33:32 tforb Exp $"
"$Id: sff.h,v 1.6 2010-02-21 12:31:33 tforb Exp $"
#include<datwritexx/datwrite.h>
#include<datwritexx/reservoir.h>
......@@ -62,7 +62,8 @@ namespace datwrite {
public:
typedef odatstream Tbase;
osffstream(std::ostream& os, const bool& debug=false);
virtual ~osffstream() { }
virtual ~osffstream()
{ this->flushwaitingtrace(true); }
static void help(std::ostream& os=std::cout);
protected:
virtual void writefileheader();
......@@ -70,12 +71,18 @@ namespace datwrite {
virtual void writetrace(const Tfseries& series);
virtual void writetrace(const Tiseries& series);
private:
/*! flush waiting trace data
* \PARAM last true if no other trace will be written,
* i.e. only set to true when called from destructor
*/
void flushwaitingtrace(const bool& last=false);
bool Mdebug;
bool Mwid2iswaiting, Mfreeiswaiting, Minfoiswaiting;
sff::WID2 Mwid2waiting;
sff::FREE Mfreewaiting;
sff::INFO Minfowaiting;
datwrite::util::seriesreservoir Mserieswaiting;
bool Mwid2iswaiting, Mfreeiswaiting, Minfoiswaiting;
}; // class osffstream
/*----------------------------------------------------------------------*/
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: sff.cc,v 1.4 2010-02-20 22:05:29 tforb Exp $
* $Id: sff.cc,v 1.5 2010-02-21 12:31:33 tforb Exp $
* \author Thomas Forbriger
* \date 11/04/2006
*
......@@ -34,19 +34,22 @@
* ============================================================================
*/
#define DATWRITE_SFF_CC_VERSION \
"TF_SFF_CC V1.0 "
"DATWRITE_SFF_CC V1.0 "
#define DATWRITE_SFF_CC_CVSID \
"$Id: sff.cc,v 1.4 2010-02-20 22:05:29 tforb Exp $"
"$Id: sff.cc,v 1.5 2010-02-21 12:31:33 tforb Exp $"
#include <datwritexx/sff.h>
#include <datwritexx/util.h>
#include <datwritexx/sffwriters.h>
namespace datwrite {
osffstream::osffstream(std::ostream& os, const bool& debug):
Tbase(os),
Msffos(os, debug),
Mdebug(debug)
Mdebug(debug),
Mwid2iswaiting(false),
Mfreeiswaiting(false),
Minfoiswaiting(false)
{
Mdebug=debug;
DATWRITE_debug(Mdebug, "osffstream::osffstream",
......@@ -66,8 +69,10 @@ namespace datwrite {
{
DATWRITE_debug(Mdebug, "osffstream::writefileheader",
"write file header to file");
if (Msrceset) { Msffos << Msrce; }
if (Mfreeset) { Msffos << Mfree; }
::sff::FileHeader fileheader;
if (Msrceset) { fileheader.setsrce(Msrce); }
if (Mfreeset) { fileheader.setfree(Mfree); }
Mos << fileheader;
} // void osffstream::writefileheader()
/*----------------------------------------------------------------------*/
......@@ -76,10 +81,8 @@ namespace datwrite {
{
DATWRITE_debug(Mdebug, "osffstream::writefileheader",
"write series of type double to file");
Msffos << series.copyout();
Msffos << Mwid2;
if (Minfoset) { Msffos << Minfo; }
if (Mfreeset) { Msffos << Mfree; }
this->flushwaitingtrace();
Mserieswaiting=datwrite::util::seriesreservoir(series);
} // void osffstream::writetrace(const Tdseries& series)
/*----------------------------------------------------------------------*/
......@@ -88,10 +91,8 @@ namespace datwrite {
{
DATWRITE_debug(Mdebug, "osffstream::writefileheader",
"write series of type float to file");
Msffos << series.copyout();
Msffos << Mwid2;
if (Minfoset) { Msffos << Minfo; }
if (Mfreeset) { Msffos << Mfree; }
this->flushwaitingtrace();
Mserieswaiting=datwrite::util::seriesreservoir(series);
} // void osffstream::writetrace(const Tfseries& series)
/*----------------------------------------------------------------------*/
......@@ -100,12 +101,46 @@ namespace datwrite {
{
DATWRITE_debug(Mdebug, "osffstream::writefileheader",
"write series of type integer to file");
Msffos << series.copyout();
Msffos << Mwid2;
if (Minfoset) { Msffos << Minfo; }
if (Mfreeset) { Msffos << Mfree; }
this->flushwaitingtrace();
Mserieswaiting=datwrite::util::seriesreservoir(series);
} // void osffstream::writetrace(const Tiseries& series)
/*----------------------------------------------------------------------*/
void osffstream::flushwaitingtrace(const bool& last)
{
DATWRITE_debug(Mdebug, "osffstream::flushwaitingtrace",
"flush previous trace data to file");
// flush previous trace
if (Mwid2iswaiting)
{
// prepare trace header
::sff::TraceHeader traceheader(Mwid2waiting, last);
if (Mfreeiswaiting) { traceheader.setfree(Mfreewaiting); }
if (Minfoiswaiting) { traceheader.setinfo(Minfowaiting); }
datwrite::sff::writesfftrace(Mos,
traceheader,
Mserieswaiting,
::sff::NM_maxdyn);
}
else
{
DATWRITE_assert((!last),
"file is to be closed and no data was written");
}
// check for current trace headers and store them
if (!last)
{
DATWRITE_assert(Mwid2set, "missing trace header data");
Mwid2iswaiting=true;
Mwid2waiting=Mwid2;
Mfreeiswaiting=false;
if (Mfreeset) { Mfreeiswaiting=true; Mfreewaiting=Mfree; }
Minfoiswaiting=false;
if (Mfreeset) { Minfoiswaiting=true; Minfowaiting=Minfo; }
}
}
} // namespace datwrite
/* ----- END OF sff.cc ----- */
/*! \file sffwriters.cc
* \brief functions to write sff data (implementation)
*
* ----------------------------------------------------------------------------
*
* $Id: sffwriters.cc,v 1.1 2010-02-21 12:31:33 tforb Exp $
* \author Thomas Forbriger
* \date 21/02/2010
*
* functions to write sff data (implementation)
*
* Copyright (c) 2010 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
* - 21/02/2010 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define DATWRITE_SFFWRITERS_CC_VERSION \
"DATWRITE_SFFWRITERS_CC V1.0 "
#define DATWRITE_SFFWRITERS_CC_CVSID \
"$Id: sffwriters.cc,v 1.1 2010-02-21 12:31:33 tforb Exp $"
#include <datwritexx/sffwriters.h>
#include <datwritexx/datwrite.h>
namespace datwrite {
namespace sff {
void writesfftrace(std::ostream& os,
const ::sff::TraceHeader& traceheader,
const datwrite::util::seriesreservoir& series,
const ::sff::Enormmode& normmode)
{
switch(series.valuetype()) {
case ::datwrite::util::Fdouble:
os << ::sff::OutputWaveform<Tdseries>(series.dseries(),
traceheader,
normmode);
break;
case ::datwrite::util::Ffloat:
os << ::sff::OutputWaveform<Tfseries>(series.fseries(),
traceheader,
normmode);
break;
case ::datwrite::util::Finteger:
os << ::sff::OutputWaveform<Tiseries>(series.iseries(),
traceheader,
normmode);
break;
default: DATWRITE_abort("empty reservoir!");
}
} // void writesfftrace
} // namespace sff
} // namespace datwrite
/* ----- END OF sffwriters.cc ----- */
/*! \file sffwriters.h
* \brief functions to write sff data (prototypes)
*
* ----------------------------------------------------------------------------
*
* $Id: sffwriters.h,v 1.1 2010-02-21 12:31:33 tforb Exp $
* \author Thomas Forbriger
* \date 21/02/2010
*
* functions to write sff data (prototypes)
*
* Copyright (c) 2010 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
* - 21/02/2010 V1.0 Thomas Forbriger
*
* ============================================================================
*/
// include guard
#ifndef DATWRITE_SFFWRITERS_H_VERSION
#define DATWRITE_SFFWRITERS_H_VERSION \
"DATWRITE_SFFWRITERS_H V1.0 "
#define DATWRITE_SFFWRITERS_H_CVSID \
"$Id: sffwriters.h,v 1.1 2010-02-21 12:31:33 tforb Exp $"
#include<sffxx.h>
#include<datwritexx/reservoir.h>
namespace datwrite {
namespace sff {
//! function to write an SFF trace from a series reservoir
void writesfftrace(std::ostream& os,
const ::sff::TraceHeader& traceheader,
const datwrite::util::seriesreservoir& series,
const ::sff::Enormmode& normmode);
} // namespace sff
} // namespace datwrite
#endif // DATWRITE_SFFWRITERS_H_VERSION (includeguard)
/* ----- END OF sffwriters.h ----- */
Markdown is supported
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