Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

DTD-976 Do not deflatline uncalibrated targets (#324) #325

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.

Expand Down
16 changes: 10 additions & 6 deletions src/DBMDataRef/DBMDataRef.vb
Original file line number Diff line number Diff line change
@@ -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.
'
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/dbm/DBMManifest.vb
Original file line number Diff line number Diff line change
@@ -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.
'
Expand All @@ -22,14 +22,14 @@
' returned using the DBM.Version function.


<assembly:System.Reflection.AssemblyVersion("1.80.*")>
<assembly:System.Reflection.AssemblyVersion("1.81.*")>

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

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

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

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