Class VarianceAggregate
java.lang.Object
com.inductiveautomation.historian.gateway.query.aggregates.AbstractAggregationFunction
com.inductiveautomation.historian.gateway.query.aggregates.VarianceAggregate
- All Implemented Interfaces:
AggregationFunction
Filename: VarianceAggregate.java
Created on Feb 26, 2016
Author: Kathy Applebaum
Copyright Inductive Automation 2016
Project: SRGatewayAPI
-
Field Summary
Fields inherited from class com.inductiveautomation.historian.gateway.query.aggregates.AbstractAggregationFunction
NO_DATA
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
allowValue
(QualifiedValue value, boolean interpolated) By default only allows Good quality, non-interpolated.getDataType
(DataTypeClass columnDataType) This function returns the type class of the data returned by the function, given the type class of the incoming raw values.process
(QualifiedValue value, boolean interpolatedValue, boolean blockFinished, BlockContext blockContext, QueryContext queryContext) This function will be called for each value that should be processed, for the entire range of the query.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.inductiveautomation.ignition.gateway.sqltags.history.query.processing.AggregationFunction
supportsDataType
-
Constructor Details
-
VarianceAggregate
Mode should be Variance or StdDev
-
-
Method Details
-
getDataType
Description copied from interface:AggregationFunction
This function returns the type class of the data returned by the function, given the type class of the incoming raw values. For most aggregates this will be equal, but there are some functions that will return a different ype- usually a Float (such as returning a percentage or something). -
allowValue
By default only allows Good quality, non-interpolated. -
process
public QualifiedValue[] process(@Nullable QualifiedValue value, boolean interpolatedValue, boolean blockFinished, BlockContext blockContext, QueryContext queryContext) Description copied from interface:AggregationFunction
This function will be called for each value that should be processed, for the entire range of the query. It works in the following way:
- For each window, a new BlockContext is created. This object provides some information, but can also be used as a scratch pad for data in the aggregation window.
- The function will be called for each value that is actually read from the data source. In this case, interpolatedValue will be false
- The function will be called with values at the start of the window and at the end of the window. In these cases, the interpolatedValue boolean will be true (unless raw values just happen to correspond exactly).
- The BlockContext contains the previous raw and computed values prior to this block, which can be used for running sums, ongoing calculations, etc.
- The return value is only used when blockFinished is true. At the end of the window, the function will be called with an interpolated value for the end time, and blockFinished=true. The function should finalize calculations and return results. (* The function may reuse the return array, and mutate it after returning values)
-