public class Precipitation extends SensorTask
DataEvent.DATA_SOURCE_TOTAL
DataEvent.DATA_SOURCE_RATE
PrecipitationTotal
and
PrecipitationRate
will scale and process the
units based on configurable calibration constants. We calculate the rate and
total accumulation here instead of in the data processors in order to
preserve state on the server, so that clients can drop off and return without
losing rate, minimum or maximum information. In addition, it makes the data
processors much simpler with fewer special cases.
Refer to this internal default resource file for property keys and default values used to configure this task. If an anemometer is also installed, it will be necessary to specify an address to associate the correct DS2423 counter with each device.
Modifier and Type | Class and Description |
---|---|
private class |
Precipitation.ReadTask
Samples the rain gauge on the configured schedule.
|
Modifier and Type | Field and Description |
---|---|
private com.dalsemi.onewire.container.OneWireContainer1D |
container
DS2423 memory sensor.
|
private int |
counterPage
Counter page address (counter 1 = 14, counter 2 = 15).
|
private static byte[] |
FAMILY
DS2423 memory sensor family code.
|
private static long |
MSEC_PER_HR
Milliseconds per hour.
|
private long[] |
values
Rate buffer.
|
adapter, address, cancel, CFG_DEVICE_ADDRESS_KEY, CFG_DEVICE_CHANNEL_KEY, CFG_DEVICE_OFFSET_KEY, CFG_DEVICE_SCALE_KEY, CFG_SAMPLING_INTERVAL_KEY, config, dataExchange, LOGGER, name, ONE_WIRE_TIMEOUT, population, SENSOR_TIMEOUT
Constructor and Description |
---|
Precipitation(java.lang.String name,
com.dalsemi.onewire.adapter.DSPortAdapter adapter,
java.util.Properties config,
IDataExchange dataExchange,
IServiceControl serviceControl)
Creates a new instance of Precipitation
|
beginExclusive, curveFit, doADConvertEFT, doADConvertEFT, doTemperatureConvertEFT, endExclusive, findContainerEFT, findContainerEFT, findContainerEFT, getADVoltageEFT, getADVoltageEFT, getTemperatureEFT, readBytesEFT, readCounterEFT, readDeviceEFT, readFileEFT, setMaxTemperatureResolutionEFT, stdDev, toHexString, toString, writeByteEFT, writeDeviceEFT
private static final byte[] FAMILY
private static final long MSEC_PER_HR
private com.dalsemi.onewire.container.OneWireContainer1D container
private long[] values
private int counterPage
public Precipitation(java.lang.String name, com.dalsemi.onewire.adapter.DSPortAdapter adapter, java.util.Properties config, IDataExchange dataExchange, IServiceControl serviceControl)
name
- of this sensor task.adapter
- 1-Wire adapter.config
- configuration properties.dataExchange
- to notify with new data.serviceControl
- to schedule the task.