stella.sensor
Interface Smoothing

All Superinterfaces:
Cumulating
All Known Implementing Classes:
AverageSensor, BadSensor, DerivativeSensor, DewPoint, FakeSensor, FakeSolZSensor, HealthSensor, KeystrokeSensor, MoxaSensor, NoiseSolZSensor, OneWireADSensor, OneWireRainSensor, OneWireSensor, ParameterSensor, QuickDumpSensor, RS485Sensor, SmoothingSensor, SolHeightSensor, SolZSensor, Ups, UpsSensor, WeatherSensor, WeirdSolZSensor

public interface Smoothing
extends Cumulating

The interface marking smoothing capabilities of a sensor. It is an extension to the cumulative interface because smoothing datas will always require storing some data. As a consequence, no methods for access to the time axis are given here. They are inherited from the base interface.

This interface is introduced to make it more convenient to derive one's own combination of smoothing and/or deriving sensors. A default implementation SmoothingSensor implements this interface and gives a body for this method.


Method Summary
 List getLastSmooth(int nr)
          Returns the last bulk of smoothed values as a list.
 boolean isSmoothing()
          Returns true if the implementing instance is really smoothing the data and should be treated seperately.
 double regetSmooth()
          Returns the last smoothed value as a double.
 void smoothOne(double raw)
          Smoothes the raw value and adds it to an internal buffer.
 
Methods inherited from interface stella.sensor.Cumulating
cumulateOne, getLastRaw, getLastTime, getMaxSize, getSize, getTimeOfRead, regetRaw
 

Method Detail

smoothOne

void smoothOne(double raw)
Smoothes the raw value and adds it to an internal buffer.


regetSmooth

double regetSmooth()
Returns the last smoothed value as a double.


getLastSmooth

List getLastSmooth(int nr)
Returns the last bulk of smoothed values as a list. The sublist consists of the given number of elements up to the last one in the list. The first element in the list is therefore buffer.size-nr.

Parameters:
nr - The number of smoothed values to be retrieved.

isSmoothing

boolean isSmoothing()
Returns true if the implementing instance is really smoothing the data and should be treated seperately.