C# Класс Opc.Ua.Server.AggregateCalculator

Calculates the value of an aggregate.
Наследование: IAggregateCalculator
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AggregateCalculator ( NodeId aggregateId, System.DateTime startTime, System.DateTime endTime, double processingInterval, bool stepped, AggregateConfiguration configuration ) : System

Initializes the calculation stream.

GetProcessedValue ( bool returnPartial ) : DataValue

Returns the next processed value.

HasEndTimePassed ( System.DateTime currentTime ) : bool

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.

QueueRawValue ( DataValue value ) : bool

Queues a raw value for processing.

SlopedInterpolate ( System.DateTime timestamp, DataValue earlyBound, DataValue lateBound ) : DataValue

Calculate the value at the timestamp using slopped interpolation.

SteppedInterpolate ( System.DateTime timestamp, DataValue earlyBound ) : DataValue

Calculate the value at the timestamp using slopped interpolation.

Защищенные методы

Метод Описание
AggregateCalculator ( NodeId aggregateId ) : System

Creates a default aggregator.

CastToDouble ( DataValue value ) : double

Converts the value to a double for use in calculations (throws exceptions if conversion fails).

CastToOriginalType ( double value, DataValue original ) : Variant

Converts the value back to its original type (throws exceptions if conversion fails).

CompareTimestamps ( DataValue value1, DataValue value2 ) : int

Compares timestamps for two DataValues according to the current UseServerTimestamp setting.

CompareTimestamps ( DataValue value1, LinkedListNode value2 ) : int

Compares timestamps for two DataValues according to the current UseServerTimestamp setting.

CompareTimestamps ( System.DateTime value1, LinkedListNode value2 ) : int

Compares timestamps for a timestamp to a DataValue according to the current UseServerTimestamp setting.

CompareTimestamps ( LinkedListNode value1, LinkedListNode value2 ) : int

Compares timestamps for two DataValues according to the current UseServerTimestamp setting.

ComputeValue ( Opc.Ua.Server.TimeSlice slice ) : DataValue

Calculates the value for the timeslice.

CreateSlice ( Opc.Ua.Server.TimeSlice previousSlice ) : Opc.Ua.Server.TimeSlice

Creates a new time slice to process.

GetNoDataValue ( System.DateTime timestamp ) : DataValue

Return a value indicating there is no data in the time slice.

GetNoDataValue ( Opc.Ua.Server.TimeSlice slice ) : DataValue

Return a value indicating there is no data in the time slice.

GetRegionsInValueSet ( List values, bool ignoreBadData, bool useSteppedCalculations ) : List

Returns the values in the list with simple bounds.

GetSimpleBound ( System.DateTime timestamp, Opc.Ua.Server.TimeSlice slice ) : DataValue

Returns the simple bound for the timestamp.

GetTimeBasedStatusCode ( List regions, StatusCode statusCode ) : StatusCode

Calculates the status code for the slice

GetTimeBasedStatusCode ( Opc.Ua.Server.TimeSlice slice, List values, StatusCode defaultCode ) : StatusCode

Calculates the status code for the slice

GetTimestamp ( Opc.Ua.Server.TimeSlice slice ) : System.DateTime

Returns the timestamp to use for the slice value.

GetValueBasedStatusCode ( Opc.Ua.Server.TimeSlice slice, List values, StatusCode statusCode ) : StatusCode

Calculates the value based status code for the slice

GetValues ( Opc.Ua.Server.TimeSlice slice ) : List

Returns the values between the start time and the end time for the slice.

GetValuesWithInterpolatedBounds ( Opc.Ua.Server.TimeSlice slice ) : List

Returns the values in the list with interpolated bounds.

GetValuesWithSimpleBounds ( Opc.Ua.Server.TimeSlice slice ) : List

Returns the values in the list with simple bounds.

Initialize ( NodeId aggregateId, System.DateTime startTime, System.DateTime endTime, double processingInterval, bool stepped, AggregateConfiguration configuration ) : void

Initializes the calculation stream.

Interpolate ( System.DateTime timestamp, Opc.Ua.Server.TimeSlice reference ) : DataValue

Interpolates a value at the timestamp.

Interpolate ( Opc.Ua.Server.TimeSlice slice ) : DataValue

Calculate the interpolate aggregate for the timeslice.

IsGood ( DataValue value ) : bool

Checks if the value is good according to the configuration rules.

UpdateSlice ( Opc.Ua.Server.TimeSlice slice ) : bool

Creates a new time slice to process.

Описание методов

AggregateCalculator() защищенный Метод

Creates a default aggregator.
protected AggregateCalculator ( NodeId aggregateId ) : System
aggregateId NodeId
Результат System

AggregateCalculator() публичный Метод

Initializes the calculation stream.
public AggregateCalculator ( NodeId aggregateId, System.DateTime startTime, System.DateTime endTime, double processingInterval, bool stepped, AggregateConfiguration configuration ) : System
aggregateId NodeId The aggregate function to apply.
startTime System.DateTime The start time.
endTime System.DateTime The end time.
processingInterval double The processing interval.
stepped bool Whether to use stepped interpolation.
configuration AggregateConfiguration The aggregate configuration.
Результат System

CastToDouble() защищенный статический Метод

Converts the value to a double for use in calculations (throws exceptions if conversion fails).
protected static CastToDouble ( DataValue value ) : double
value DataValue
Результат double

CastToOriginalType() защищенный статический Метод

Converts the value back to its original type (throws exceptions if conversion fails).
protected static CastToOriginalType ( double value, DataValue original ) : Variant
value double
original DataValue
Результат System.Variant

CompareTimestamps() защищенный Метод

Compares timestamps for two DataValues according to the current UseServerTimestamp setting.
protected CompareTimestamps ( DataValue value1, DataValue value2 ) : int
value1 DataValue The first value to compare.
value2 DataValue The second value to compare.
Результат int

CompareTimestamps() защищенный Метод

Compares timestamps for two DataValues according to the current UseServerTimestamp setting.
protected CompareTimestamps ( DataValue value1, LinkedListNode value2 ) : int
value1 DataValue The first value to compare.
value2 LinkedListNode The second value to compare.
Результат int

CompareTimestamps() защищенный Метод

Compares timestamps for a timestamp to a DataValue according to the current UseServerTimestamp setting.
protected CompareTimestamps ( System.DateTime value1, LinkedListNode value2 ) : int
value1 System.DateTime The timestamp to compare.
value2 LinkedListNode The data value to compare.
Результат int

CompareTimestamps() защищенный Метод

Compares timestamps for two DataValues according to the current UseServerTimestamp setting.
protected CompareTimestamps ( LinkedListNode value1, LinkedListNode value2 ) : int
value1 LinkedListNode The first value to compare.
value2 LinkedListNode The second value to compare.
Результат int

ComputeValue() защищенный Метод

Calculates the value for the timeslice.
protected ComputeValue ( Opc.Ua.Server.TimeSlice slice ) : DataValue
slice Opc.Ua.Server.TimeSlice The slice to process.
Результат DataValue

CreateSlice() защищенный Метод

Creates a new time slice to process.
protected CreateSlice ( Opc.Ua.Server.TimeSlice previousSlice ) : Opc.Ua.Server.TimeSlice
previousSlice Opc.Ua.Server.TimeSlice The previous processed slice.
Результат Opc.Ua.Server.TimeSlice

GetNoDataValue() защищенный Метод

Return a value indicating there is no data in the time slice.
protected GetNoDataValue ( System.DateTime timestamp ) : DataValue
timestamp System.DateTime
Результат DataValue

GetNoDataValue() защищенный Метод

Return a value indicating there is no data in the time slice.
protected GetNoDataValue ( Opc.Ua.Server.TimeSlice slice ) : DataValue
slice Opc.Ua.Server.TimeSlice
Результат DataValue

GetProcessedValue() публичный Метод

Returns the next processed value.
public GetProcessedValue ( bool returnPartial ) : DataValue
returnPartial bool If true a partial interval should be processed.
Результат DataValue

GetRegionsInValueSet() защищенный Метод

Returns the values in the list with simple bounds.
protected GetRegionsInValueSet ( List values, bool ignoreBadData, bool useSteppedCalculations ) : List
values List
ignoreBadData bool
useSteppedCalculations bool
Результат List

GetSimpleBound() защищенный Метод

Returns the simple bound for the timestamp.
protected GetSimpleBound ( System.DateTime timestamp, Opc.Ua.Server.TimeSlice slice ) : DataValue
timestamp System.DateTime
slice Opc.Ua.Server.TimeSlice
Результат DataValue

GetTimeBasedStatusCode() защищенный Метод

Calculates the status code for the slice
protected GetTimeBasedStatusCode ( List regions, StatusCode statusCode ) : StatusCode
regions List
statusCode StatusCode
Результат StatusCode

GetTimeBasedStatusCode() защищенный Метод

Calculates the status code for the slice
protected GetTimeBasedStatusCode ( Opc.Ua.Server.TimeSlice slice, List values, StatusCode defaultCode ) : StatusCode
slice Opc.Ua.Server.TimeSlice
values List
defaultCode StatusCode
Результат StatusCode

GetTimestamp() защищенный Метод

Returns the timestamp to use for the slice value.
protected GetTimestamp ( Opc.Ua.Server.TimeSlice slice ) : System.DateTime
slice Opc.Ua.Server.TimeSlice
Результат System.DateTime

GetValueBasedStatusCode() защищенный Метод

Calculates the value based status code for the slice
protected GetValueBasedStatusCode ( Opc.Ua.Server.TimeSlice slice, List values, StatusCode statusCode ) : StatusCode
slice Opc.Ua.Server.TimeSlice
values List
statusCode StatusCode
Результат StatusCode

GetValues() защищенный Метод

Returns the values between the start time and the end time for the slice.
protected GetValues ( Opc.Ua.Server.TimeSlice slice ) : List
slice Opc.Ua.Server.TimeSlice
Результат List

GetValuesWithInterpolatedBounds() защищенный Метод

Returns the values in the list with interpolated bounds.
protected GetValuesWithInterpolatedBounds ( Opc.Ua.Server.TimeSlice slice ) : List
slice Opc.Ua.Server.TimeSlice
Результат List

GetValuesWithSimpleBounds() защищенный Метод

Returns the values in the list with simple bounds.
protected GetValuesWithSimpleBounds ( Opc.Ua.Server.TimeSlice slice ) : List
slice Opc.Ua.Server.TimeSlice
Результат List

HasEndTimePassed() публичный Метод

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.
public HasEndTimePassed ( System.DateTime currentTime ) : bool
currentTime System.DateTime
Результат bool

Initialize() защищенный Метод

Initializes the calculation stream.
protected Initialize ( NodeId aggregateId, System.DateTime startTime, System.DateTime endTime, double processingInterval, bool stepped, AggregateConfiguration configuration ) : void
aggregateId NodeId The aggregate function to apply.
startTime System.DateTime The start time.
endTime System.DateTime The end time.
processingInterval double The processing interval.
stepped bool Whether to use stepped interpolation.
configuration AggregateConfiguration The aggregate configuration.
Результат void

Interpolate() защищенный Метод

Interpolates a value at the timestamp.
protected Interpolate ( System.DateTime timestamp, Opc.Ua.Server.TimeSlice reference ) : DataValue
timestamp System.DateTime The timestamp.
reference Opc.Ua.Server.TimeSlice The timeslice that contains the timestamp.
Результат DataValue

Interpolate() защищенный Метод

Calculate the interpolate aggregate for the timeslice.
protected Interpolate ( Opc.Ua.Server.TimeSlice slice ) : DataValue
slice Opc.Ua.Server.TimeSlice
Результат DataValue

IsGood() защищенный Метод

Checks if the value is good according to the configuration rules.
protected IsGood ( DataValue value ) : bool
value DataValue The value to test.
Результат bool

QueueRawValue() публичный Метод

Queues a raw value for processing.
public QueueRawValue ( DataValue value ) : bool
value DataValue The data value to process.
Результат bool

SlopedInterpolate() публичный статический Метод

Calculate the value at the timestamp using slopped interpolation.
public static SlopedInterpolate ( System.DateTime timestamp, DataValue earlyBound, DataValue lateBound ) : DataValue
timestamp System.DateTime
earlyBound DataValue
lateBound DataValue
Результат DataValue

SteppedInterpolate() публичный статический Метод

Calculate the value at the timestamp using slopped interpolation.
public static SteppedInterpolate ( System.DateTime timestamp, DataValue earlyBound ) : DataValue
timestamp System.DateTime
earlyBound DataValue
Результат DataValue

UpdateSlice() защищенный Метод

Creates a new time slice to process.
protected UpdateSlice ( Opc.Ua.Server.TimeSlice slice ) : bool
slice Opc.Ua.Server.TimeSlice The slice to update.
Результат bool