|
1 | 1 | ' Dynamic Bandwidth Monitor |
2 | 2 | ' 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. |
4 | 4 | ' |
5 | 5 | ' This file is part of DBM. |
6 | 6 | ' |
@@ -687,6 +687,7 @@ Namespace Vitens.DynamicBandwidthMonitor |
687 | 687 | Dim rawValues As AFValues = Nothing |
688 | 688 | Dim result As DBMResult |
689 | 689 | Dim iR, iD As Integer ' Iterators for raw values and DBM results. |
| 690 | + Dim stats As DBMStatisticsItem |
690 | 691 |
|
691 | 692 | GetValues = New AFValues |
692 | 693 |
|
@@ -959,12 +960,15 @@ Namespace Vitens.DynamicBandwidthMonitor |
959 | 960 | GetValues.Item(GetValues.Count-1).Timestamp = timeRange.EndTime |
960 | 961 | End If |
961 | 962 |
|
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. |
965 | 965 | 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) |
| 966 | + stats = Statistics(results) |
| 967 | + If stats.Calibrated Then |
| 968 | + GetValues = Deflatline(GetValues, results, Me.Step) |
| 969 | + End If |
| 970 | + ' Annotate the first value with model calibration metrics. |
| 971 | + Annotate(GetValues.Item(0), stats.Brief) |
968 | 972 | End If |
969 | 973 |
|
970 | 974 | ' Returns the collection of values for the attribute sorted in increasing |
|
0 commit comments