Class WicaChannelValueAveragingFilter
- All Implemented Interfaces:
WicaChannelValueFilter
The filter only operates on values for types WicaChannelType.REAL and WicaChannelType.INTEGER. All other value types in the input list will be ignored and will not contribute to the averaging result.
The output of the filter will be of the same numeric type as the input values passed into it. In the unusual situation where both WicaChannelType.REAL and WicaChannelType.INTEGER values are supplied the output will be of the widest type (WicaChannelType.REAL).
If the input list contains an insufficient number of numeric samples to calculate an average then the output result will be empty. Any supplied values will be accumulated internally and will be used to contribute to the averaging result the next time the filter's apply method is invoked.
If any of the values in the input list indicate that the data source is offline then the averaging result will be a single offline value.
-
Constructor Summary
ConstructorsConstructorDescriptionWicaChannelValueAveragingFilter
(int numberOfSamplesInAverage) Constructs a new instance that calculates its output based on the arithmetic mean of the specified number of samples. -
Method Summary
Modifier and TypeMethodDescriptionapply
(List<WicaChannelValue> inputList) Transforms the values in the input apply to the output apply using some configurable filtering algorithm.toString()
-
Constructor Details
-
WicaChannelValueAveragingFilter
WicaChannelValueAveragingFilter(int numberOfSamplesInAverage) Constructs a new instance that calculates its output based on the arithmetic mean of the specified number of samples.- Parameters:
numberOfSamplesInAverage
- the number of samples to be used to calculate each output value.
-
-
Method Details
-
apply
Description copied from interface:WicaChannelValueFilter
Transforms the values in the input apply to the output apply using some configurable filtering algorithm.- Specified by:
apply
in interfaceWicaChannelValueFilter
- Parameters:
inputList
- the list of values to process.- Returns:
- the list of values that were produced from the processing step.
-
toString
-