stella.sensor
Class UpsSensor
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.UpsSensor
- All Implemented Interfaces:
- DriverDepending, Cloneable, Remote, Caster, DataCaster, RmiDataCaster, RmiErrorCaster, Cumulating, Deriving, Predicting, Smoothing, Telemetering, WeatherJudging, WeatherCaster, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiCaster, RmiPropertyBearing
public class UpsSensor
- extends WeatherSensor
- implements DriverDepending
A sensor representation of a ups sensor. THe UPSD must be running on the
target host and the UpsDriver must be supplied to this sensor.
The driver is caching all relevant sensor values, thus reading the
sensor has almost no latency. To reduce the number of parameters, we
recommend that the name of this sensor is equal to the sensor representation
in the UPS, though this is not possible for multiple UPS's.
| 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 |
|
Constructor Summary |
UpsSensor(Map prop)
Constructs a new ups 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 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_UPSNAME
public static final String KEY_UPSNAME
- The name of the ups driver to use.
- See Also:
- Constant Field Values
KEY_VARIABLE
public static final String KEY_VARIABLE
- The name of this sensor in the ups driver cache.
- See Also:
- Constant Field Values
DEFUPSNAME
private static final String DEFUPSNAME
- The default name of the ups
- See Also:
- Constant Field Values
upsd
private transient UpsDriver upsd
- The instance of the ups driver to use.
UpsSensor
public UpsSensor(Map prop)
throws RemoteException
- Constructs a new ups sensor. These sensors normally read in physical
quantities, thus we will use an identical conversion on them.
- 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
getSensorDescription
public String getSensorDescription()
- We get our description from the underlying driver, if we have it.
- Specified by:
getSensorDescription in interface Telemetering- Overrides:
getSensorDescription in class AbstractSensor