public class AnalogRainConversion extends AbstractConversion implements Initializable
| Modifier and Type | Class and Description |
|---|---|
static class |
AnalogRainConversion.Test |
| Modifier and Type | Field and Description |
|---|---|
private NavigableMap<Double,Function> |
convert |
private static String |
DEFCONVERT
Default conversion from mA to rain levels.
|
private static double |
DEFRESISTANCE
Default 120 Ohm.
|
private static DecimalFormat |
DEFVALUEFORMAT
The default decimal format for the values.
|
private static DecimalFormat |
DEFVALUESIGMA
The default deciaml format for the sigma of the values.
|
static String |
KEY_CONVERT
Reading ranges as the upper limit to the corresponding conversion.
|
static String |
KEY_RESISTANCE
Resistance in Ohm before voltmeter to get to mA.
|
KEY_UNIT, KEY_VALUEFORMAT, KEY_VALUESIGMAKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASS| Constructor and Description |
|---|
AnalogRainConversion(Map<String,String> prop) |
| Modifier and Type | Method and Description |
|---|---|
double |
getDeviation(double reading,
double deviation)
Numerical differentiation, call {link #getPhysical} twice with half
deviation applied and return
the difference.
|
double |
getPhysical(double reading)
(Sensor) Classes defining this interface should know how to convert
their sensor reading into physically meaningful results.
|
double |
getRaw(double physical)
Is the inversion of
ConvertToPhysical.getPhysical(double). |
void |
init()
Creates the conversion table.
|
createConversion, getSigmaValueFormat, getUnit, getValueFormataugment, augment, augment, augment, augment, clone, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, initProperties, isNew, parseObject, parseObject, reload, reload, removeProperty, requires, rescanned, setObject, setProperties, setProperty, stringProperties, toStringpublic static final String KEY_CONVERT
public static final String KEY_RESISTANCE
private static final transient DecimalFormat DEFVALUEFORMAT
private static final transient DecimalFormat DEFVALUESIGMA
private static final double DEFRESISTANCE
private static final String DEFCONVERT
private NavigableMap<Double,Function> convert
public void init()
init in interface Initializablepublic double getPhysical(double reading)
ConvertToPhysicalgetPhysical in interface ConvertToPhysicalreading - The raw reading value.public double getRaw(double physical)
ConvertToPhysicalConvertToPhysical.getPhysical(double). Calling this method with the
physical meaningful quantity converts it back into the raw reading.getRaw in interface ConvertToPhysicalpublic double getDeviation(double reading,
double deviation)
getDeviation in interface ConvertToPhysicalreading - The raw reading value.deviation - The standard deviation of the raw readings.