stella.sensor
Class OneWireSensor
java.lang.Object
util.PropertyContainer
util.PropertyResources
util.PropertyBundles
util.rmi.RmiPropertyContainer
util.rmi.AbstractRmiCaster
stella.sensor.AbstractSensor
stella.sensor.TimerTaskSensor
stella.sensor.DataSensor
stella.sensor.CumulativeSensor
stella.sensor.PredictiveSensor
stella.sensor.SmoothingSensor
stella.sensor.DerivativeSensor
stella.sensor.WeatherSensor
stella.sensor.OneWireSensor
- All Implemented Interfaces:
- DriverDepending, Cloneable, Remote, Caster, DataCaster, RmiDataCaster, RmiErrorCaster, Cumulating, Deriving, Predicting, Smoothing, Telemetering, WeatherJudging, WeatherCaster, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiCaster, RmiPropertyBearing
- Direct Known Subclasses:
- OneWireRainSensor
public class OneWireSensor
- extends WeatherSensor
- implements DriverDepending
A sensor representation of a one-wire sensor.
| Fields inherited from class stella.sensor.WeatherSensor |
KEY_DERIVATIVEINVALID, KEY_DERIVATIVEPARAMETER, KEY_INVERSE, KEY_INVERSEDERIVATIVE, KEY_JUDGEDERIVATIVE, KEY_JUDGEPREDICT, KEY_JUDGERAW, KEY_JUDGESMOOTH, KEY_PREDICTINVALID, KEY_PREDICTPARAMETER, KEY_RAWINVALID, KEY_RAWPARAMETER, KEY_RETARDBADDERIVATIVE, KEY_RETARDBADPREDICT, KEY_RETARDBADRAW, KEY_RETARDBADSMOOTH, KEY_RETARDGOODDERIVATIVE, KEY_RETARDGOODPREDICT, KEY_RETARDGOODRAW, KEY_RETARDGOODSMOOTH, KEY_SMOOTHINVALID, KEY_SMOOTHPARAMETER |
|
Method Summary |
protected double |
readSensor()
Reads the sensor value. |
boolean |
registerDriver(Driver poller)
Registers the one-wire driver to this sensor. |
boolean |
validReading()
Returns true if the a driver has been registered to this sensor. |
| Methods inherited from class stella.sensor.WeatherSensor |
addWeatherListener, conductOneMeasure, currentlyClear, currentlyRetarding, generateDataEvent, getMinClearUpTime, getSensorInitInfo, goodFromDerivative, goodFromPredict, goodFromRaw, goodFromSmooth, isDerivativeRetard, isPredictRetard, isRawRetard, isSmoothRetard, judgeWeather, notifyWeatherListener, removeWeatherListener, status |
| Methods inherited from class stella.sensor.TimerTaskSensor |
cancel, equals, getRawToggleInfo, getReading, getRespawn, getTimeOfRead, hashCode, initSensorTimerTask, isReady, regetRaw, setTimeOfRead, validReading |
| Methods inherited from class stella.sensor.AbstractSensor |
addRmiErrorListener, createSensor, getBindName, getConvert, getSensorDescription, getSensorName, init, notifyErrorListener, removeRmiErrorListener, setConvert, toString |
| Methods inherited from class util.PropertyResources |
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, 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 |
| 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 |
KEY_ONEWIREDRIVER
public static final String KEY_ONEWIREDRIVER
- The name of the one-wire driver to use.
- See Also:
- Constant Field Values
KEY_ADDRESS
public static final String KEY_ADDRESS
- The command to issue on the driver to read the sensor data.
- See Also:
- Constant Field Values
owserver
protected transient OneWireDriver owserver
- The instance of the one-wire driver to use.
OneWireSensor
public OneWireSensor(Map prop)
throws RemoteException
- Constructs a new one-wire sensor. These sensor read data in physical
units, thus we have normally an identical conversion.
- Throws:
RemoteException
registerDriver
public boolean registerDriver(Driver poller)
- Registers the one-wire driver to this sensor. As normally only a single
instance of a one-wire driver exists, the name-checking is normally
not really an issue, but implemented for completeness.
- Specified by:
registerDriver in interface DriverDepending
- Returns:
- True if registering at the driver was successful.
readSensor
protected double readSensor()
- Reads the sensor value. If no serial server was registered to this
sensor or the server is not reading the sensor's input,
NaN is returned. Otherwise, the string returned by the
one-wire query is interpreted as a double.
- Specified by:
readSensor in class TimerTaskSensor
- See Also:
ConvertToPhysical
validReading
public boolean validReading()
- Returns true if the a driver has been registered to this sensor.
- Specified by:
validReading in interface Telemetering