java.lang.Object
com.inductiveautomation.ignition.gateway.sqltags.history.query.processing.Interpolator
Direct Known Subclasses:
Interpolator.AnalogInterpolator, Interpolator.DiscreteInterpolator

public abstract class Interpolator extends Object
Created by colby.clegg on 7/31/2015.
  • Constructor Details

    • Interpolator

      public Interpolator()
  • Method Details

    • createDiscreteInterpolator

      public static Interpolator createDiscreteInterpolator()
    • createAnalogInterpolator

      public static Interpolator createAnalogInterpolator()
    • update

      public void update(HistoricalValue value) throws IllegalArgumentException
      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

      public ProcessedValue getValueAt(long timestamp) throws IllegalArgumentException
      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

      protected ProcessedValue valueFor(Object value, QualityCode qual, long ts, boolean provisional)
      Returns interpolated processed value.
    • valueFor

      protected ProcessedValue valueFor(Object value, QualityCode qual, long ts, boolean provisional, boolean interpolated)
    • needsDoubles

      protected abstract boolean needsDoubles()
    • interpolate

      protected abstract ProcessedValue interpolate(long timestamp)
      "A" or "B" can be null, but the situation will be A < timestamp < B, if present.
    • interpolateDiscrete

      protected ProcessedValue interpolateDiscrete(long timestamp)
    • interpolateLinear

      protected ProcessedValue interpolateLinear(long timestamp)