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

proper rounding of date of first sample to nearest microsecond

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: 4566
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 769a7f0e
......@@ -86,11 +86,13 @@
* libgsexx limits. This this provides the full
* dynamic range of 24bit data acquisition systems to
* be stored without round-off.
* - 17/02/2012 V1.18 - properly round date of first sample to
* microseconds when passing to libgsexx
*
* ============================================================================
*/
#define TF_SFFXX_CC_VERSION \
"TF_SFFXX_CC V1.17"
"TF_SFFXX_CC V1.18"
#define TF_SFFXX_CC_CVSID \
"$Id$"
......@@ -656,15 +658,18 @@ c (90.0 if horizontal)
std::string WID2::line() const
{
GSE2::waveform::TWID2 wid2line;
wid2line.Fyear=date.year();
wid2line.Fmonth=date.month();
wid2line.Fday=date.day();
wid2line.Fhour=date.hour();
wid2line.Fminute=date.minute();
// wid2line.Fseconds=double(date.second())+
// 1.e-3*double(date.milsec()+1.e-3*double(date.micsec()));
wid2line.Fmilsec=date.second()*1000+date.milsec()+
int(rint(1.e-3*date.micsec()));
// apply proper rounding to nearest millisecond
libtime::TAbsoluteTime rnddate(date.year(), date.month(),
date.day(), date.hour(),
date.minute(), date.second(),
date.milsec());
if (date.micsec()>499) { rnddate += libtime::TRelativeTime(0,0,0,0,1); }
wid2line.Fyear=rnddate.year();
wid2line.Fmonth=rnddate.month();
wid2line.Fday=rnddate.day();
wid2line.Fhour=rnddate.hour();
wid2line.Fminute=rnddate.minute();
wid2line.Fmilsec=rnddate.second()*1000+rnddate.milsec();
wid2line.Fstation=station;
wid2line.Fchannel=channel;
wid2line.Fauxid=auxid;
......
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