Class Interpolator
java.lang.Object
com.inductiveautomation.ignition.gateway.sqltags.history.query.processing.Interpolator
- Direct Known Subclasses:
Interpolator.AnalogInterpolator
,Interpolator.DiscreteInterpolator
Created by colby.clegg on 7/31/2015.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
For analog tags, the value is ramps directly between the valuesprotected static class
For discrete tags, the value is flat until it then changes, at the timestamp of B -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Interpolator
static Interpolator
getValueAt
(long timestamp) Returns the (potentially) interpolated value at the time.protected abstract ProcessedValue
interpolate
(long timestamp) "A" or "B" can be null, but the situation will be A < timestamp < B, if present.protected ProcessedValue
interpolateDiscrete
(long timestamp) protected ProcessedValue
interpolateLinear
(long timestamp) protected abstract boolean
void
update
(HistoricalValue value) Adds the value to the interpolator.protected ProcessedValue
valueFor
(Object value, QualityCode qual, long ts, boolean provisional) Returns interpolated processed value.protected ProcessedValue
valueFor
(Object value, QualityCode qual, long ts, boolean provisional, boolean interpolated)
-
Constructor Details
-
Interpolator
public Interpolator()
-
-
Method Details
-
createDiscreteInterpolator
-
createAnalogInterpolator
-
update
Adds the value to the interpolator. Values must go foward in time, and an exception will be thrown if a value is added out of order.- Throws:
IllegalArgumentException
- if the incoming value has a timestamp less than a previously added value.
-
getValueAt
Returns the (potentially) interpolated value at the time. Note that the timestamp must always be later than previous requests! Time must only move forward.- Throws:
IllegalArgumentException
- if the time requested is before a previously requested time. All requests must go forward.
-
valueFor
Returns interpolated processed value. -
valueFor
protected ProcessedValue valueFor(Object value, QualityCode qual, long ts, boolean provisional, boolean interpolated) -
needsDoubles
protected abstract boolean needsDoubles() -
interpolate
"A" or "B" can be null, but the situation will be A < timestamp < B, if present. -
interpolateDiscrete
-
interpolateLinear
-