|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectModel
jhomenet.hw.HomenetHardware
jhomenet.hw.sensor.Sensor
jhomenet.hw.sensor.ValueSensor
jhomenet.hw.sensor.WindDirectionSensor
public class WindDirectionSensor
| Nested Class Summary | |
|---|---|
static class |
WindDirectionSensor.ConfigKeys
|
| Field Summary | |
|---|---|
static double[] |
degrees
|
static java.lang.String[] |
roseta
Used to indicate the current wind direction. |
| Fields inherited from class jhomenet.hw.sensor.Sensor |
|---|
currentData, INVALID_DATA, maxData, minData, pollingType, PROPERTYNAME_CURRENTDATA, PROPERTYNAME_MAXDATA, PROPERTYNAME_MINDATA, PROPERTYNAME_POLLINGTYPE, readFailed |
| Fields inherited from class jhomenet.hw.HomenetHardware |
|---|
configuration, driver, errorTracker, hardwareDescription, hardwareId, PROPERTYNAME_CONFIGURATION, PROPERTYNAME_SETUPDESC, setupDescription |
| Constructor Summary | |
|---|---|
WindDirectionSensor()
Constructor. |
|
WindDirectionSensor(java.lang.String hardwareID,
java.lang.String description)
Default constructor. |
|
| Method Summary | |
|---|---|
double |
directionToDegrees(int value)
Convert the value (int) to degrees. |
java.lang.String |
getCurrentAsString()
Returns the current sensor value as a string (includes the unit). |
protected void |
initializeHardwareDescription()
Set the hardware description. |
double |
readFromDriver()
Read from the sensor. |
HardwareData |
readSensor()
Retreives the offset used for northOffset detection. |
int |
readWindDirectionWithOffset()
Read the wind direcction corrected by the northOffset offset. |
void |
setNorthoffset()
|
void |
setNorthoffset(int north)
Sets the value added to the actual lecture to obtain the true northOffset. |
void |
storeNorthOffset()
|
static java.lang.String |
toWindRose(int value)
|
java.lang.String |
WindRose()
Get the string value for the wind direction. |
| Methods inherited from class jhomenet.hw.sensor.Sensor |
|---|
capture, getCurrentData, getMaxData, getMinData, getPollingType, getPollingTypeListModel, isFirstPoll, resetData, setCurrentData, setMaxData, setMinData, setPollingType, toString |
| Methods inherited from class jhomenet.hw.HomenetHardware |
|---|
equals, getConfiguration, getConfiguration, getDriverHardwareDescription, getDriverName, getErrorCount, getHardwareClassname, getHardwareDescription, getHardwareId, getSetupDescription, initializeHardware, isRegistered, setConfiguration, setConfiguration, setDriver, setHardwareId, setSetupDescription |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String[] roseta
public static final double[] degrees
| Constructor Detail |
|---|
public WindDirectionSensor(java.lang.String hardwareID,
java.lang.String description)
hardwareID - description - public WindDirectionSensor()
| Method Detail |
|---|
protected void initializeHardwareDescription()
HomenetHardware
initializeHardwareDescription in class HomenetHardwareHomenetHardware.initializeHardwareDescription()public void storeNorthOffset()
public void setNorthoffset(int north)
north - Digit between 1 and 16 that indicates the northOffsetpublic void setNorthoffset()
public HardwareData readSensor()
throws SensorException
readSensor in class SensorSensorException
public int readWindDirectionWithOffset()
throws SensorException
SensorException
public java.lang.String WindRose()
throws SensorException
SensorExceptionpublic static java.lang.String toWindRose(int value)
public double readFromDriver()
throws SensorException
readFromDriver in class SensorSensorExceptionSensor.readSensor()public double directionToDegrees(int value)
value - An integer value representation of the wind direction.
public java.lang.String getCurrentAsString()
Sensor
getCurrentAsString in class SensorSensor.getCurrentAsString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||