stella.sensor
Class DewPointConvert

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.sensor.AbstractConversion
                  extended by stella.sensor.DewPointConvert
All Implemented Interfaces:
Serializable, Cloneable, ConvertToPhysical, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class DewPointConvert
extends AbstractConversion

The helper class to convert dew-point offsets in degrees centigrade to true temperatures in centigrades. To make this work under the general ConvertToPhysical contract, some dirty tricks are involved.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  double ambient
          The last ambient temperature.
 
Fields inherited from class stella.sensor.AbstractConversion
KEY_UNIT, KEY_VALUEFORMAT, KEY_VALUESIGMA
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
DewPointConvert(Map info)
          Constructs a new cosine converter.
 
Method Summary
 double getDeviation(double raw, double dev)
          A dew point sensor already delivers degrees centigrade.
 double getPhysical(double raw)
          A dew point sensor already delivers degrees centigrade, but only the difference to the ambient temperature.
 double getRaw(double physical)
          A dew point sensor always delivers degrees centrigrade, but only the difference to the ambient temperature.
protected  void setAmbientTemperature(double temperature)
          Sets the last ambient temperature used for calculating the raw reading of the dew-point sensor.
 
Methods inherited from class stella.sensor.AbstractConversion
createConversion, getSigmaValueFormat, getUnit, getValueFormat
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, init, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, 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, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 
Methods inherited from interface util.Initializable
init
 

Field Detail

ambient

private double ambient
The last ambient temperature.

Constructor Detail

DewPointConvert

public DewPointConvert(Map info)
Constructs a new cosine converter. Since the conversion does not need any additional parameters, all the properties defined for the decimal formats should be given in the properties of the solz sensor itself. Its properties are also used to construct this converter.

Method Detail

getPhysical

public double getPhysical(double raw)
A dew point sensor already delivers degrees centigrade, but only the difference to the ambient temperature. It seems feasable to change the physical value delivered by the dewpoint to the 'true' dewpoint temperature. This is only possible with a 'dirty trick'; the dew-point sensor reading-delivery method must call the conversions setAmbientTemperature(double) at each reading.

Parameters:
raw - The raw reading value.
Returns:
The raw-reading plus the ambient temperature.

getRaw

public double getRaw(double physical)
A dew point sensor always delivers degrees centrigrade, but only the difference to the ambient temperature. The physical reading is the raw reading plus the ambient temperature, therefore reconstruction of the raw reading is only possible if the ambient temperature is known.


getDeviation

public double getDeviation(double raw,
                           double dev)
A dew point sensor already delivers degrees centigrade. The deviation is unaffected by an offset.

Parameters:
raw - The raw reading value.
dev - The standard deviation of the raw readings.
Returns:
The physical quantity corresponding to the standard deviation of the raw readings.

setAmbientTemperature

protected void setAmbientTemperature(double temperature)
Sets the last ambient temperature used for calculating the raw reading of the dew-point sensor. This is a very dirty trick to make this conversion class work without an inner class construct. This method must be called whenever a dew-point sensor delivers a reading.