UA Bundle SDK .NET
2.1.0.222
|
Calculates the value of an aggregate. More...
Inherits UnifiedAutomation.UaServer.IAggregateCalculator.
Inherited by UnifiedAutomation.UaServer.AverageAggregateCalculator, UnifiedAutomation.UaServer.CountAggregateCalculator, UnifiedAutomation.UaServer.MinMaxAggregateCalculator, UnifiedAutomation.UaServer.StartEndAggregateCalculator, UnifiedAutomation.UaServer.StatusAggregateCalculator, and UnifiedAutomation.UaServer.StdDevAggregateCalculator.
Classes | |
class | SubRegion |
A subset of a slice bounded by two raw data points. More... | |
class | TimeSlice |
Stores information about a slice of data to be processed. More... | |
Public Member Functions | |
AggregateCalculator (NodeId aggregateId, DateTime startTime, DateTime endTime, double processingInterval, bool stepped, AggregateConfiguration configuration) | |
Initializes the calculation stream. | |
bool | QueueRawValue (DataValue value) |
Queues a raw value for processing. | |
DataValue | GetProcessedValue (bool returnPartial) |
Returns the next processed value. | |
bool | HasEndTimePassed (DateTime currentTime) |
Returns true if the specified time is later than the end of the current interval. | |
Public Member Functions inherited from UnifiedAutomation.UaServer.IAggregateCalculator | |
bool | QueueRawValue (DataValue value) |
Pushes the next raw value into the stream. | |
DataValue | GetProcessedValue (bool returnPartial) |
Returns the next processed value. | |
bool | HasEndTimePassed (DateTime currentTime) |
Returns true if the specified time is later than the end of the current interval. | |
Static Public Member Functions | |
static DataValue | SteppedInterpolate (DateTime timestamp, DataValue earlyBound) |
Calculate the value at the timestamp using slopped interpolation. | |
static DataValue | SlopedInterpolate (DateTime timestamp, DataValue earlyBound, DataValue lateBound) |
Calculate the value at the timestamp using slopped interpolation. | |
Protected Member Functions | |
AggregateCalculator (NodeId aggregateId) | |
Creates a default aggregator. | |
void | Initialize (NodeId aggregateId, DateTime startTime, DateTime endTime, double processingInterval, bool stepped, AggregateConfiguration configuration) |
Initializes the calculation stream. | |
int | CompareTimestamps (DataValue value1, DataValue value2) |
Compares timestamps for two DataValues according to the current UseServerTimestamp setting. | |
int | CompareTimestamps (DataValue value1, LinkedListNode< DataValue > value2) |
Compares timestamps for two DataValues according to the current UseServerTimestamp setting. | |
int | CompareTimestamps (LinkedListNode< DataValue > value1, LinkedListNode< DataValue > value2) |
Compares timestamps for two DataValues according to the current UseServerTimestamp setting. | |
int | CompareTimestamps (DateTime value1, LinkedListNode< DataValue > value2) |
Compares timestamps for a timestamp to a DataValue according to the current UseServerTimestamp setting. | |
bool | IsGood (DataValue value) |
Checks if the value is good according to the configuration rules. | |
TimeSlice | CreateSlice (TimeSlice previousSlice) |
Creates a new time slice to process. | |
bool | UpdateSlice (TimeSlice slice) |
Creates a new time slice to process. | |
virtual DataValue | ComputeValue (TimeSlice slice) |
Calculates the value for the timeslice. | |
DataValue | Interpolate (TimeSlice slice) |
Calculate the interpolate aggregate for the timeslice. | |
DataValue | GetNoDataValue (TimeSlice slice) |
Return a value indicating there is no data in the time slice. | |
DateTime | GetTimestamp (TimeSlice slice) |
Returns the timestamp to use for the slice value. | |
DataValue | GetNoDataValue (DateTime timestamp) |
Return a value indicating there is no data in the time slice. | |
DataValue | Interpolate (DateTime timestamp, TimeSlice reference) |
Interpolates a value at the timestamp. | |
DataValue | GetSimpleBound (DateTime timestamp, TimeSlice slice) |
Returns the simple bound for the timestamp. | |
List< DataValue > | GetValuesWithSimpleBounds (TimeSlice slice) |
Returns the values in the list with simple bounds. | |
List< DataValue > | GetValues (TimeSlice slice) |
Returns the values between the start time and the end time for the slice. | |
List< DataValue > | GetValuesWithInterpolatedBounds (TimeSlice slice) |
Returns the values in the list with interpolated bounds. | |
List< SubRegion > | GetRegionsInValueSet (List< DataValue > values, bool ignoreBadData, bool useSteppedCalculations) |
Returns the values in the list with simple bounds. | |
StatusCode | GetValueBasedStatusCode (TimeSlice slice, List< DataValue > values, StatusCode statusCode) |
Calculates the value based status code for the slice | |
StatusCode | GetTimeBasedStatusCode (TimeSlice slice, List< DataValue > values, StatusCode defaultCode) |
Calculates the status code for the slice | |
StatusCode | GetTimeBasedStatusCode (List< SubRegion > regions, StatusCode statusCode) |
Calculates the status code for the slice | |
Static Protected Member Functions | |
static double | CastToDouble (DataValue value) |
Converts the value to a double for use in calculations (throws exceptions if conversion fails). | |
static Variant | CastToOriginalType (double value, DataValue original) |
Converts the value back to its original type (throws exceptions if conversion fails). | |
Properties | |
NodeId | AggregateId [get, set] |
The aggregate function applied by the calculator. | |
DateTime | StartTime [get, set] |
The start time for the request. | |
DateTime | EndTime [get, set] |
The end time for the request. | |
double | ProcessingInterval [get, set] |
The processing interval for the request. | |
bool | Stepped [get, set] |
True if the data series requires stepped interpolation. | |
AggregateConfiguration | Configuration [get, set] |
The configuration to use when processing. | |
bool | UseServerTimestamp [get, set] |
Whether to use the server timestamp for all processing. | |
bool | TimeFlowsBackward [get, set] |
True if data is being processed in reverse order. | |
TimeSlice | CurrentSlice [get, set] |
Whether to use the server timestamp for all processing. | |
bool | Complete [get, set] |
True if all values required for the request have been received and processed | |
bool | SetPartialBit [get, set] |
True if the GetProcessedValue method should set the Partial bit when appropriate. | |
bool | UsingExtrapolation [get, set] |
True if data is extrapolated after the end of data. | |
Properties inherited from UnifiedAutomation.UaServer.IAggregateCalculator | |
NodeId | AggregateId [get] |
The aggregate function applied by the calculator. | |
Calculates the value of an aggregate.
|
protected |
Creates a default aggregator.
UnifiedAutomation.UaServer.AggregateCalculator.AggregateCalculator | ( | NodeId | aggregateId, |
DateTime | startTime, | ||
DateTime | endTime, | ||
double | processingInterval, | ||
bool | stepped, | ||
AggregateConfiguration | configuration | ||
) |
Initializes the calculation stream.
aggregateId | The aggregate function to apply. |
startTime | The start time. |
endTime | The end time. |
processingInterval | The processing interval. |
stepped | Whether to use stepped interpolation. |
configuration | The aggregate configuration. |
|
staticprotected |
Converts the value to a double for use in calculations (throws exceptions if conversion fails).
|
staticprotected |
Converts the value back to its original type (throws exceptions if conversion fails).
|
protected |
Compares timestamps for two DataValues according to the current UseServerTimestamp setting.
value1 | The first value to compare. |
value2 | The second value to compare. |
|
protected |
Compares timestamps for two DataValues according to the current UseServerTimestamp setting.
value1 | The first value to compare. |
value2 | The second value to compare. |
|
protected |
Compares timestamps for two DataValues according to the current UseServerTimestamp setting.
value1 | The first value to compare. |
value2 | The second value to compare. |
|
protected |
Compares timestamps for a timestamp to a DataValue according to the current UseServerTimestamp setting.
value1 | The timestamp to compare. |
value2 | The data value to compare. |
|
protectedvirtual |
Calculates the value for the timeslice.
slice | The slice to process. |
Reimplemented in UnifiedAutomation.UaServer.AverageAggregateCalculator, UnifiedAutomation.UaServer.CountAggregateCalculator, UnifiedAutomation.UaServer.MinMaxAggregateCalculator, UnifiedAutomation.UaServer.StartEndAggregateCalculator, UnifiedAutomation.UaServer.StatusAggregateCalculator, and UnifiedAutomation.UaServer.StdDevAggregateCalculator.
|
protected |
Creates a new time slice to process.
previousSlice | The previous processed slice. |
|
protected |
Return a value indicating there is no data in the time slice.
|
protected |
Return a value indicating there is no data in the time slice.
DataValue UnifiedAutomation.UaServer.AggregateCalculator.GetProcessedValue | ( | bool | returnPartial | ) |
Returns the next processed value.
returnPartial | If true a partial interval should be processed. |
|
protected |
Returns the values in the list with simple bounds.
|
protected |
Returns the simple bound for the timestamp.
|
protected |
Calculates the status code for the slice
|
protected |
Calculates the status code for the slice
|
protected |
Returns the timestamp to use for the slice value.
|
protected |
Calculates the value based status code for the slice
|
protected |
Returns the values between the start time and the end time for the slice.
|
protected |
Returns the values in the list with interpolated bounds.
|
protected |
Returns the values in the list with simple bounds.
bool UnifiedAutomation.UaServer.AggregateCalculator.HasEndTimePassed | ( | DateTime | currentTime | ) |
Returns true if the specified time is later than the end of the current interval.
Return true if time flows forward and the time is later than the end time.
|
protected |
Initializes the calculation stream.
aggregateId | The aggregate function to apply. |
startTime | The start time. |
endTime | The end time. |
processingInterval | The processing interval. |
stepped | Whether to use stepped interpolation. |
configuration | The aggregate configuration. |
Calculate the interpolate aggregate for the timeslice.
|
protected |
Interpolates a value at the timestamp.
timestamp | The timestamp. |
reference | The timeslice that contains the timestamp. |
|
protected |
Checks if the value is good according to the configuration rules.
value | The value to test. |
bool UnifiedAutomation.UaServer.AggregateCalculator.QueueRawValue | ( | DataValue | value | ) |
Queues a raw value for processing.
value | The data value to process. |
|
static |
Calculate the value at the timestamp using slopped interpolation.
|
static |
Calculate the value at the timestamp using slopped interpolation.
|
protected |
Creates a new time slice to process.
slice | The slice to update. |
|
getset |
The aggregate function applied by the calculator.
|
getsetprotected |
True if all values required for the request have been received and processed
|
getsetprotected |
The configuration to use when processing.
|
getsetprotected |
Whether to use the server timestamp for all processing.
|
getsetprotected |
The end time for the request.
|
getsetprotected |
The processing interval for the request.
|
getsetprotected |
True if the GetProcessedValue method should set the Partial bit when appropriate.
|
getsetprotected |
The start time for the request.
|
getsetprotected |
True if the data series requires stepped interpolation.
|
getsetprotected |
True if data is being processed in reverse order.
|
getsetprotected |
Whether to use the server timestamp for all processing.
|
getsetprotected |
True if data is extrapolated after the end of data.