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

WID2 now also reads WIDX transparently

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: 3036
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 5fa7fbee
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: sffxx.cc,v 1.32 2010-04-13 11:11:00 tforb Exp $
* $Id: sffxx.cc,v 1.33 2010-04-13 21:38:08 tforb Exp $
* \author Thomas Forbriger
* \date 21/12/2003
*
......@@ -61,15 +61,17 @@
* - 17/12/2007 V1.12 - modified output format (printf), since underlying
* Fortran code of libtime does no longer use
* long int
* - 13/04/2010 V1.13 - round time correctly to milliseconds when writing
* - 13/04/2010 V1.13
* - round time correctly to milliseconds when writing
* WID2 line
* - WIDX reading is now transparent
*
* ============================================================================
*/
#define TF_SFFXX_CC_VERSION \
"TF_SFFXX_CC V1.13"
#define TF_SFFXX_CC_CVSID \
"$Id: sffxx.cc,v 1.32 2010-04-13 11:11:00 tforb Exp $"
"$Id: sffxx.cc,v 1.33 2010-04-13 21:38:08 tforb Exp $"
#include<sstream>
#include <sffxx.h>
......@@ -625,8 +627,17 @@ c (90.0 if horizontal)
void WID2::read(std::istream& is)
{
std::string line;
std::getline(is, line);
if (line.substr(0,4) == WIDXID)
{
*this = WIDXline(line);
}
else
{
std::istringstream iss(line);
GSE2::waveform::TWID2 wid2line;
wid2line.read(is);
wid2line.read(iss);
int second=int(wid2line.Fmilsec/1000);
int milsec=wid2line.Fmilsec-1000*second;
date=libtime::TAbsoluteTime(wid2line.Fyear,
......@@ -645,6 +656,7 @@ c (90.0 if horizontal)
this->instype=wid2line.Finstype;
this->hang=wid2line.Fhang;
this->vang=wid2line.Fvang;
}
} // void WID2::read(std::istream& is)
/*----------------------------------------------------------------------*/
......
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