com.prosysopc.ua
Class AggregateCalculator

java.lang.Object
  extended by com.prosysopc.ua.AggregateCalculator

public class AggregateCalculator
extends Object

A class for calculating the Aggregates defined in OPC Unified Architecture Specification Part 13.

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().


Nested Class Summary
static class AggregateCalculator.AggregateCalculatorContinuationPoint
           
static interface AggregateCalculator.HistoryDataProvider
           
protected  class AggregateCalculator.IntervalOutsideRawData
           
 
Constructor Summary
AggregateCalculator()
           
 
Method Summary
 AggregateCalculator.AggregateCalculatorContinuationPoint calculateAggregates(org.opcfoundation.ua.builtintypes.DateTime startTime, org.opcfoundation.ua.builtintypes.DateTime endTime, double processingIntervalInMillis, org.opcfoundation.ua.builtintypes.NodeId aggregateType, org.opcfoundation.ua.core.AggregateConfiguration aggregateConfiguration, boolean useSteppedInterpolation, AggregateCalculator.HistoryDataProvider history, AggregateCalculator.AggregateCalculatorContinuationPoint continuationPoint, org.opcfoundation.ua.core.HistoryData aggregateData)
          Function for calculating the aggregate specified by the aggregateType NodeId from the list of DataValues provided in values.
 int getMaxIntervalsPerHistoryRead()
           
 org.opcfoundation.ua.core.AggregateConfiguration getServerDefaults()
           
 Set<org.opcfoundation.ua.builtintypes.NodeId> getSupportedFunctions()
           
static boolean percentValuesAreValid(org.opcfoundation.ua.core.AggregateConfiguration aggregateConfiguration)
           
 void registerFunction(org.opcfoundation.ua.builtintypes.NodeId aggregateFunctionId, AggregateFunction functionImpl)
           
 void setMaxIntervalsPerHistoryRead(int maxIntervalsPerHistoryRead)
           
 void setServerDefaults(org.opcfoundation.ua.core.AggregateConfiguration newServerDefaults)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregateCalculator

public AggregateCalculator()
Method Detail

percentValuesAreValid

public static boolean percentValuesAreValid(org.opcfoundation.ua.core.AggregateConfiguration aggregateConfiguration)

calculateAggregates

public AggregateCalculator.AggregateCalculatorContinuationPoint calculateAggregates(org.opcfoundation.ua.builtintypes.DateTime startTime,
                                                                                    org.opcfoundation.ua.builtintypes.DateTime endTime,
                                                                                    double processingIntervalInMillis,
                                                                                    org.opcfoundation.ua.builtintypes.NodeId aggregateType,
                                                                                    org.opcfoundation.ua.core.AggregateConfiguration aggregateConfiguration,
                                                                                    boolean useSteppedInterpolation,
                                                                                    AggregateCalculator.HistoryDataProvider history,
                                                                                    AggregateCalculator.AggregateCalculatorContinuationPoint continuationPoint,
                                                                                    org.opcfoundation.ua.core.HistoryData aggregateData)
                                                                             throws StatusException
Function for calculating the aggregate specified by the aggregateType NodeId from the list of DataValues provided in values.

Parameters:
startTime - the time stamp at the beginning of the sequence of time intervals
endTime - the time stamp at the end of the sequence of time intervals
processingInterval - the time span for which aggregated DataValues are produced (values is milliseconds)
aggregateType - the identifier of the Aggregate to be used
aggregateConfiguration - information on how the Server treats Aggregate specific functionality
useSteppedInterpolation - whether to hold the last data point constant instead of fitting a line
history - class providing the raw DataValues used in calculating the aggregated through the HistoryDataProvider interface
continuationPoint - returned by this function or null for first call of this function
aggregateData - will be filled with the aggregate values calculated by this function
Returns:
a continuationPoint that can be used in continuing the calculations in calling this function again or null if the specified calculations are complete
Throws:
StatusException - if reads from the HistoryDataProvider fails or the function is called with invalid parameters

getMaxIntervalsPerHistoryRead

public int getMaxIntervalsPerHistoryRead()

getServerDefaults

public org.opcfoundation.ua.core.AggregateConfiguration getServerDefaults()

getSupportedFunctions

public Set<org.opcfoundation.ua.builtintypes.NodeId> getSupportedFunctions()

registerFunction

public void registerFunction(org.opcfoundation.ua.builtintypes.NodeId aggregateFunctionId,
                             AggregateFunction functionImpl)

setMaxIntervalsPerHistoryRead

public void setMaxIntervalsPerHistoryRead(int maxIntervalsPerHistoryRead)

setServerDefaults

public void setServerDefaults(org.opcfoundation.ua.core.AggregateConfiguration newServerDefaults)


Copyright © 2018. All rights reserved.