Skip to content

Commit a1d0fa6

Browse files
committed
DTD-976 Do not deflatline uncalibrated targets
Signed-off-by: Johan Fitié <jfitie@gmail.com>
1 parent e12babf commit a1d0fa6

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/DBMDataRef/DBMDataRef.vb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
' Dynamic Bandwidth Monitor
22
' Leak detection method implemented in a real-time data historian
3-
' Copyright (C) 2014-2023 J.H. Fitié, Vitens N.V.
3+
' Copyright (C) 2014-2024 J.H. Fitié, Vitens N.V.
44
'
55
' This file is part of DBM.
66
'
@@ -687,6 +687,7 @@ Namespace Vitens.DynamicBandwidthMonitor
687687
Dim rawValues As AFValues = Nothing
688688
Dim result As DBMResult
689689
Dim iR, iD As Integer ' Iterators for raw values and DBM results.
690+
Dim statistics As DBMStatisticsItem
690691

691692
GetValues = New AFValues
692693

@@ -959,12 +960,13 @@ Namespace Vitens.DynamicBandwidthMonitor
959960
GetValues.Item(GetValues.Count-1).Timestamp = timeRange.EndTime
960961
End If
961962

962-
' For the Target values, if there are more than two results, check for and
963-
' remove flatlines, and annotate the first value with model calibration
964-
' metrics.
963+
' For the Target values, if there are more than two results and a
964+
' reliable forecast can be made, check for and remove flatlines, and
965+
' annotate the first value with model calibration metrics.
965966
If Attribute.Trait Is LimitTarget And results.Count > 2 Then
966-
GetValues = Deflatline(GetValues, results, Me.Step)
967-
Annotate(GetValues.Item(0), Statistics(results).Brief)
967+
statistics = Statistics(results)
968+
If statistics.Calibrated Then GetValues = Deflatline(GetValues, results, Me.Step)
969+
Annotate(GetValues.Item(0), statistics.Brief)
968970
End If
969971

970972
' Returns the collection of values for the attribute sorted in increasing

src/dbm/DBMManifest.vb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
' Dynamic Bandwidth Monitor
22
' Leak detection method implemented in a real-time data historian
3-
' Copyright (C) 2014-2023 J.H. Fitié, Vitens N.V.
3+
' Copyright (C) 2014-2024 J.H. Fitié, Vitens N.V.
44
'
55
' This file is part of DBM.
66
'
@@ -22,14 +22,14 @@
2222
' returned using the DBM.Version function.
2323

2424

25-
<assembly:System.Reflection.AssemblyVersion("1.80.*")>
25+
<assembly:System.Reflection.AssemblyVersion("1.81.*")>
2626

2727
<assembly:System.Reflection.AssemblyProduct("Dynamic Bandwidth Monitor")>
2828

2929
<assembly:System.Reflection.AssemblyDescription(
3030
"Leak detection method implemented in a real-time data historian")>
3131

3232
<assembly:System.Reflection.AssemblyCopyright(
33-
"Copyright (C) 2014-2023 J.H. Fitié, Vitens N.V.")>
33+
"Copyright (C) 2014-2024 J.H. Fitié, Vitens N.V.")>
3434

3535
<assembly:System.Reflection.AssemblyCompany("Vitens N.V.")>

0 commit comments

Comments
 (0)