diff --git a/README.md b/README.md index 616a0129..6effc52c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # DBM Dynamic Bandwidth Monitor\ Leak detection method implemented in a real-time data historian\ -Copyright (C) 2014-2023 J.H. Fitié, Vitens N.V. +Copyright (C) 2014-2024 J.H. Fitié, Vitens N.V. ## Description Water company Vitens has created a demonstration site called the Vitens Innovation Playground (VIP), in which new technologies and methodologies are developed, tested, and demonstrated. The projects conducted in the demonstration site can be categorized into one of four themes: energy optimization, real-time leak detection, online water quality monitoring, and customer interaction. In the real-time leak detection theme, a method for leak detection based on statistical demand forecasting was developed. @@ -109,7 +109,7 @@ DBMDataRef is a custom AVEVA PI Asset Framework data reference which integrates The `Target` trait returns the original, valid raw measurements, augmented with forecast data for invalid and future data. Data quality is marked as `Substituted` for invalid data replaced by forecast values and for future forecast values, or as `Questionable` for data exceeding `Minimum` and `Maximum` control limits. ![Augmented](img/augmented.png) -For the `Target` trait, DBM also detects and removes incorrect flatlines in the data and replaces them with forecast values, which are then weight adjusted to the original time range total. Data quality is marked as `Substituted` for this data. +For the `Target` trait, DBM also detects and removes incorrect flatlines in the data and, if a reliable forecast can be made, replaces them with forecast values, which are then weight adjusted to the original time range total. Data quality is marked as `Substituted` for this data. Beginning with PI AF 2018 SP3 Patch 2, all AF plugins must be signed with a valid certificate. Users must ensure any 3rd party or custom plugins are signed with a valid certificate. Digitally signing plugins increases the users' confidence that it is from a trusted entity. AF data references that are not signed could have been tampered with and are potentially dangerous. Therefore, in order to protect its users, AVEVA software enforces that all AF 2.x data reference plugins be signed. Use `sign.bat` to sign the data reference and support assemblies with your pfx certificate file before registering the data reference with PI AF. diff --git a/src/DBMDataRef/DBMDataRef.vb b/src/DBMDataRef/DBMDataRef.vb index 557fdb3b..19c01d79 100644 --- a/src/DBMDataRef/DBMDataRef.vb +++ b/src/DBMDataRef/DBMDataRef.vb @@ -1,6 +1,6 @@ ' Dynamic Bandwidth Monitor ' Leak detection method implemented in a real-time data historian -' Copyright (C) 2014-2023 J.H. Fitié, Vitens N.V. +' Copyright (C) 2014-2024 J.H. Fitié, Vitens N.V. ' ' This file is part of DBM. ' @@ -687,6 +687,7 @@ Namespace Vitens.DynamicBandwidthMonitor Dim rawValues As AFValues = Nothing Dim result As DBMResult Dim iR, iD As Integer ' Iterators for raw values and DBM results. + Dim stats As DBMStatisticsItem GetValues = New AFValues @@ -959,12 +960,15 @@ Namespace Vitens.DynamicBandwidthMonitor GetValues.Item(GetValues.Count-1).Timestamp = timeRange.EndTime End If - ' For the Target values, if there are more than two results, check for and - ' remove flatlines, and annotate the first value with model calibration - ' metrics. + ' For the Target values, if there are more than two results and a + ' reliable forecast can be made, check for and remove flatlines. If Attribute.Trait Is LimitTarget And results.Count > 2 Then - GetValues = Deflatline(GetValues, results, Me.Step) - Annotate(GetValues.Item(0), Statistics(results).Brief) + stats = Statistics(results) + If stats.Calibrated Then + GetValues = Deflatline(GetValues, results, Me.Step) + End If + ' Annotate the first value with model calibration metrics. + Annotate(GetValues.Item(0), stats.Brief) End If ' Returns the collection of values for the attribute sorted in increasing diff --git a/src/dbm/DBMManifest.vb b/src/dbm/DBMManifest.vb index ea71e861..25bb2939 100644 --- a/src/dbm/DBMManifest.vb +++ b/src/dbm/DBMManifest.vb @@ -1,6 +1,6 @@ ' Dynamic Bandwidth Monitor ' Leak detection method implemented in a real-time data historian -' Copyright (C) 2014-2023 J.H. Fitié, Vitens N.V. +' Copyright (C) 2014-2024 J.H. Fitié, Vitens N.V. ' ' This file is part of DBM. ' @@ -22,7 +22,7 @@ ' returned using the DBM.Version function. - + @@ -30,6 +30,6 @@ "Leak detection method implemented in a real-time data historian")> + "Copyright (C) 2014-2024 J.H. Fitié, Vitens N.V.")>