private class Precipitation.ReadTask
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
private int |
index
Rate buffer index.
|
private boolean |
initialize
Flag to initialize sensor.
|
private long |
prevCount
The previous count.
|
private java.lang.String |
RATE_NAME
Precipitation rate name.
|
private java.lang.String |
TOTAL_NAME
Total precipitation name.
|
private java.lang.String |
VALUE_ERROR_1
Message format for extreme rate anomalies.
|
Modifier | Constructor and Description |
---|---|
private |
ReadTask() |
Modifier and Type | Method and Description |
---|---|
private long |
getCount()
Gets the current count from the rain gauge.
|
private long |
getRate()
Gets the current rate from the rain gauge.
|
private void |
initDevice()
Initializes the sensor for operation.
|
void |
run()
Gets the precipitation units value from the rain gauge and posts it
to the data exchange.
|
private final java.lang.String VALUE_ERROR_1
private final java.lang.String RATE_NAME
private final java.lang.String TOTAL_NAME
private boolean initialize
private long prevCount
private int index
public void run()
run
in interface java.lang.Runnable
private void initDevice() throws com.dalsemi.onewire.OneWireException, ServiceException
com.dalsemi.onewire.OneWireException
- if 1-Wire communication fails.ServiceException
- if initialization fails.private long getRate() throws com.dalsemi.onewire.OneWireException, ValueException
com.dalsemi.onewire.OneWireException
- if a communication error occurs.ValueException
- if count < prevCount
,
indicating non-monotonic count progression.private long getCount()