public class AggregateCalculator extends Object
For now, only some of the Aggregates are implemented. They can be found by looking at the names of the methods that begin with the prefix "calculate".
This class can be called e.g. from MyHistorian.onReadProcessed().
| Modifier and Type | Class and Description |
|---|---|
static class |
AggregateCalculator.AggregateCalculatorContinuationPoint |
static interface |
AggregateCalculator.HistoryDataProvider |
protected class |
AggregateCalculator.IntervalOutsideRawData |
| Constructor and Description |
|---|
AggregateCalculator() |
| Modifier and Type | Method and Description |
|---|---|
AggregateCalculator.AggregateCalculatorContinuationPoint |
calculateAggregates(DateTime startTime,
DateTime endTime,
double processingIntervalInMillis,
NodeId aggregateType,
AggregateConfiguration aggregateConfiguration,
boolean useSteppedInterpolation,
AggregateCalculator.HistoryDataProvider history,
AggregateCalculator.AggregateCalculatorContinuationPoint continuationPoint,
HistoryData aggregateData)
Function for calculating the aggregate specified by the aggregateType NodeId from the list of
DataValues provided in values.
|
int |
getMaxIntervalsPerHistoryRead() |
AggregateConfiguration |
getServerDefaults() |
Set<NodeId> |
getSupportedFunctions() |
static boolean |
percentValuesAreValid(AggregateConfiguration aggregateConfiguration) |
void |
registerFunction(NodeId aggregateFunctionId,
AggregateFunction functionImpl) |
void |
setMaxIntervalsPerHistoryRead(int maxIntervalsPerHistoryRead) |
void |
setServerDefaults(AggregateConfiguration newServerDefaults) |
public static boolean percentValuesAreValid(AggregateConfiguration aggregateConfiguration)
public AggregateCalculator.AggregateCalculatorContinuationPoint calculateAggregates(DateTime startTime, DateTime endTime, double processingIntervalInMillis, NodeId aggregateType, AggregateConfiguration aggregateConfiguration, boolean useSteppedInterpolation, AggregateCalculator.HistoryDataProvider history, AggregateCalculator.AggregateCalculatorContinuationPoint continuationPoint, HistoryData aggregateData) throws StatusException
startTime - the time stamp at the beginning of the sequence of time intervalsendTime - the time stamp at the end of the sequence of time intervalsprocessingInterval - the time span for which aggregated DataValues are produced (values is
milliseconds)aggregateType - the identifier of the Aggregate to be usedaggregateConfiguration - information on how the Server treats Aggregate specific
functionalityuseSteppedInterpolation - whether to hold the last data point constant instead of fitting
a linehistory - class providing the raw DataValues used in calculating the aggregated through
the HistoryDataProvider interfacecontinuationPoint - returned by this function or null for first call of this functionaggregateData - will be filled with the aggregate values calculated by this functionStatusException - if reads from the HistoryDataProvider fails or the function is called
with invalid parameterspublic int getMaxIntervalsPerHistoryRead()
public AggregateConfiguration getServerDefaults()
public void registerFunction(NodeId aggregateFunctionId, AggregateFunction functionImpl)
public void setMaxIntervalsPerHistoryRead(int maxIntervalsPerHistoryRead)
public void setServerDefaults(AggregateConfiguration newServerDefaults)
Copyright © 2026. All rights reserved.