Skip to content

Commit

Permalink
Use base again
Browse files Browse the repository at this point in the history
Signed-off-by: Johan Fitié <jfitie@gmail.com>
  • Loading branch information
jfitie committed Dec 4, 2023
1 parent 3dd5037 commit 0460c7d
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions src/DBMDataRef/DBMDataRef.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1016,51 +1016,6 @@ Namespace Vitens.DynamicBandwidthMonitor
End Function


Public Overrides Function InterpolatedValuesByCount(
timeRange As AFTimeRange, numberOfValues As Integer,
filterExpression As String, includeFilteredValues As Boolean,
inputAttributes As AFAttributeList, inputValues As AFValues()) As AFValues

' https://docs.osisoft.com/bundle/af-sdk/page/html/M_OSIsoft_AF_Asset_AFDa
' taReference_InterpolatedValuesByCount.htm
' Retrieves interpolated values over the specified time range evenly
' spaced using the numberOfValues.

Dim interval As AFTimeSpan

DBM.Logger.LogDebug(
"timeRange.StartTime " &
timeRange.StartTime.LocalTime.ToString("s") & "; " &
"timeRange.EndTime " &
timeRange.EndTime.LocalTime.ToString("s") & "; " &
"numberOfValues " & numberOfValues.ToString, Attribute.GetPath)

InterpolatedValuesByCount = New AFValues
If timeRange.StartTime = timeRange.EndTime Or numberOfValues = 1 Then
' Return a single value.
InterpolatedValuesByCount.Add(
GetValue(Nothing, timeRange.StartTime, Nothing, Nothing))
Else
' Return multiple values.
interval = New AFTimeSpan(0, 0, 0, 0, 0,
(timeRange.EndTime.UtcSeconds-timeRange.StartTime.UtcSeconds)/
(numberOfValues-1), 0)
' Use a shrinking window so that cached data can be used optimally.
Do While timeRange.StartTime <= timeRange.EndTime
InterpolatedValuesByCount.Add(
GetValues(Nothing, timeRange, 0, Nothing, Nothing)(0))
timeRange.StartTime += interval
Loop
End If

DBM.Logger.LogTrace(
"Return " & InterpolatedValuesByCount.Count.ToString & " values",
Attribute.GetPath)
Return InterpolatedValuesByCount

End Function


End Class


Expand Down

0 comments on commit 0460c7d

Please # to comment.