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

[FIX][FEATURE] (ThiesDL1): simply add values

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.

f4dd72c 2015-01-07 12:37:29 +0100 Thomas Forbriger <Thomas.Forbriger@kit.edu>
 [FEATURE] (DL1sum.sh): implement option -y|--year
 src/conv/ThiesDL1/DL1sum.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

63beb28 2015-01-07 12:24:46 +0100 Thomas Forbriger <Thomas.Forbriger@kit.edu>
 [FIX] (libdatrwxx/thiesdl1): simply add values
 src/libs/libdatrwxx/thiesdl1/thiesdl1file.cc | 51 ++++++++++------------------
 1 file changed, 18 insertions(+), 33 deletions(-)

SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 5666
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parents 8a2e1366 eefa2870
#!/bin/sh
# this is <DL1sum.sh>
# ----------------------------------------------------------------------------
VERSION=2014-05-09
VERSION=2015-01-07
#
# Copyright (c) 2014 by Thomas Forbriger (BFO Schiltach)
#
......@@ -26,6 +26,7 @@ VERSION=2014-05-09
#
# REVISIONS and CHANGES
# 09/05/2014 V1.0 Thomas Forbriger
# 07/01/2015 implement option -y|--year
#
# ============================================================================
#
......@@ -80,8 +81,8 @@ verbose() {
# ----
# read command line options
# -------------------------
TEMP=$(getopt -o hb:t:Dv --long \
help,basepath:,tmpfile:,verbose,debug \
TEMP=$(getopt -o hb:t:y:Dv --long \
help,year:,basepath:,tmpfile:,verbose,debug \
-n $(basename $0) -- "$@") || {
echo >&2
echo >&2 "ERROR: command line parameters are incorrect!"
......@@ -114,6 +115,7 @@ while true; do
--help|-h) usage; echo; longusage; exit 1;;
--) shift; break;;
-b|--basepath) BASEPATH=$2; shift;;
-y|--year) YEAR=$2; shift;;
-t|--tmpfile) TMPFILE=$2; shift;;
-v|--verbose) VERBOSE=1;;
-D) set -x ;;
......
......@@ -33,6 +33,18 @@
* - 31/10/2012 V1.1 distinguish warning and critical warning; the latter
* for duplicate sample values being at variance
* - 07/11/2012 V1.2 add sample values for duplicate entries
* - 07/01/2015 V1.3
* modifications applied to File::put() function:
* - accept duplicate time stamps as part of normal
* operation; this is consistent with the behaviour
* of DL1logger as implemented on 20/03/2014; it is
* further consistent with the tested behaviour of
* the ThiesDL1 logger (see note below).
* - add sample values for duplicate time stamps
* - tr-mode (input stream tolerates redundant samples)
* now suppresses a notice-message which otherwise
* would be output to the terminal in cases of
* duplicate time stamps
*
* ============================================================================
* A statement of Volker König at ThiesClima regarding the duplicate entries
......@@ -48,9 +60,9 @@
* ============================================================================
*/
#define DATRW_THIESDL1FILE_CC_VERSION \
"DATRW_THIESDL1FILE_CC V1.2"
"DATRW_THIESDL1FILE_CC V1.3"
#define DATRW_THIESDL1FILE_CC_CVSID \
"$Id$"
"2015-01-07"
#include <datrwxx/thiesdl1file.h>
#include <datrwxx/thiesdl1line.h>
......@@ -348,47 +360,20 @@ namespace datrw {
}
if (i>=0 && i<Mnsamples)
{
int countvalue=line.counts();
if (Mfilled(i))
{
oss.clear();
oss.str("");
oss << "WARNING: duplicate sample (index "
oss << "NOTICE: duplicate sample time (index "
<< i << "): " << line.line();
std::cerr << oss.str() << std::endl;
Mtracefree.append(oss.str());
if (countvalue != Miseries(i))
{
oss.clear();
oss.str("");
oss << "CRITICAL WARNING: counts for duplicate sample differ: ";
std::cerr << oss.str() << std::endl;
Mtracefree.append(oss.str());
}
if ((countvalue > 0) || (countvalue != Miseries(i)))
if (!this->Mbetolerantagainstredundant)
{
oss.clear();
oss.str("");
oss << " previous value: " << Miseries(i)
<< " this value: " << countvalue;
if (countvalue > 0)
{
oss << " (adding this to previous)";
}
std::cerr << oss.str() << std::endl;
Mtracefree.append(oss.str());
}
}
if (!this->Mbetolerantagainstredundant)
{
DL1_rcassert (!Mfilled(i),
"duplicate sample",
this->Mheader.earliestdate,
this->Mheader.latestdate,
line.line());
Mtracefree.append(oss.str());
}
Mfilled(i)=true;
Miseries(i)+=countvalue;
Miseries(i) += line.counts();
}
else
{
......
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