jhomenet.hw.sensor
Class TempSensor

java.lang.Object
  extended by Model
      extended by jhomenet.hw.HomenetHardware
          extended by jhomenet.hw.sensor.Sensor
              extended by jhomenet.hw.sensor.ValueSensor
                  extended by jhomenet.hw.sensor.TempSensor
All Implemented Interfaces:
java.io.Serializable, Hardware

public class TempSensor
extends ValueSensor
implements java.io.Serializable


Field Summary
static float maxRangeValue
          Define minimum and maximum acceptable range values.
static float minRangeValue
          Define minimum and maximum acceptable range values.
 
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
TempSensor()
          Constructor.
TempSensor(java.lang.String hardwareID, java.lang.String description)
          Default constructor.
 
Method Summary
protected  void initializeHardware()
          Initialize the temperature sensor.
protected  void initializeHardwareDescription()
          Set the hardware description.
protected  double readFromDriver()
          Read the current temperature from the sensor.
 HardwareData readSensor()
          Capture the sensor's data in the sensor's current unit (if applicable).
 
Methods inherited from class jhomenet.hw.sensor.Sensor
capture, getCurrentAsString, 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, 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

minRangeValue

public static final float minRangeValue
Define minimum and maximum acceptable range values.

See Also:
Constant Field Values

maxRangeValue

public static final float maxRangeValue
Define minimum and maximum acceptable range values.

See Also:
Constant Field Values
Constructor Detail

TempSensor

public TempSensor(java.lang.String hardwareID,
                  java.lang.String description)
Default constructor.

Parameters:
hardwareID -
description -

TempSensor

public TempSensor()
Constructor.

Method Detail

initializeHardwareDescription

protected void initializeHardwareDescription()
Description copied from class: HomenetHardware
Set the hardware description.

Specified by:
initializeHardwareDescription in class HomenetHardware
See Also:
HomenetHardware.initializeHardwareDescription()

initializeHardware

protected void initializeHardware()
Initialize the temperature sensor.

Overrides:
initializeHardware in class HomenetHardware
See Also:
HomenetHardware.initializeHardware()

readSensor

public HardwareData readSensor()
                        throws SensorException
Description copied from class: Sensor
Capture the sensor's data in the sensor's current unit (if applicable).

Specified by:
readSensor in class Sensor
Returns:
The sensor's data in the sensor's default data unit.
Throws:
SensorException
See Also:
Sensor.readSensor()

readFromDriver

protected double readFromDriver()
                         throws SensorException
Read the current temperature from the sensor. The 1-Wire temperature sensors by default read in a celcius value. It is up to the preferences to determine whether the celcius value should be converted into fahrenheit.

Specified by:
readFromDriver in class Sensor
Returns:
The raw value read from the driver.
Throws:
SensorException
See Also:
Sensor.readSensor()


Copyright © 2004-2005 David Irwin. All Rights Reserved.