public class Thermometer extends SensorData
Refer to
this internal default resource file
for property keys and default values used to configure this data processor.
To receive data, the variable sensor-name must map to the name of
a sensor task running on Service
.
Modifier and Type | Field and Description |
---|---|
private double |
offset
Offset to convert between units.
|
static java.lang.String |
OFFSET_CELSIUS
Offset for Celsius.
|
static java.lang.String |
OFFSET_FAHRENHEIT
Offset for Fahrenheit.
|
static java.lang.String |
OFFSET_KELVIN
Offset for Kelvin.
|
private double |
scale
Multiplier to convert between units.
|
static java.lang.String |
SCALE_CELSIUS
Multiplier for Celsius.
|
static java.lang.String |
SCALE_FAHRENHEIT
Multiplier for Fahrenheit.
|
static java.lang.String |
SCALE_KELVIN
Multiplier for Kelvin.
|
CFG_AVERAGING_INTERVAL_KEY, CFG_OFFSET_KEY, CFG_SCALE_KEY, constant, dataReceived, dataTime, index, maximumValue, minimumValue, name, reset, resetTime, sensorName, values
Constructor and Description |
---|
Thermometer(java.lang.String name,
java.lang.String sensorName,
java.util.Properties config)
Creates a new instance of Thermometer.
|
Modifier and Type | Method and Description |
---|---|
protected void |
processValue(double value)
Calls the base class multiplying the value by the scaling constant.
|
averageValue, currentValue, dataAvailable, dataAvailable, getConstant, getName, getResetTime, getSensorName, isReset, maximumValue, minimumValue, peakValue, putData, reset, sigmaValue
public static final java.lang.String SCALE_FAHRENHEIT
public static final java.lang.String SCALE_CELSIUS
public static final java.lang.String SCALE_KELVIN
public static final java.lang.String OFFSET_FAHRENHEIT
public static final java.lang.String OFFSET_CELSIUS
public static final java.lang.String OFFSET_KELVIN
private double scale
private double offset
public Thermometer(java.lang.String name, java.lang.String sensorName, java.util.Properties config)
name
- of this data processor.sensorName
- of the sensor associated with this data.config
- properties for configuring this data.protected void processValue(double value)
processValue
in class SensorData
value
- new value from sensor.