Commit 3130884e authored by thomas.forbriger's avatar thomas.forbriger
Browse files

[FIX] (libdatrwxx/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.

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).

Since the statement by Volker König is quite unsatisfactory, Peter Duffner and
Thomas Forbriger on 07.11.2012 checked Thies DL1 recordings of several month
against manual readings taken directly at the display of the Thies DL1 logger
by Peter Duffner for cases where duplicate samples are present in the recorded
data. The result is, that the values provided on the data loggers display are
obtained, if data values for lines with duplicate time value are added to form
the final value for the respective minute.
parent 8a2e1366
......@@ -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))
if (!this->Mbetolerantagainstredundant)
{
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)))
{
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());
}
Mfilled(i)=true;
Miseries(i)+=countvalue;
Miseries(i) += line.counts();
}
else
{
......
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