Inherited by OneWireContainer41.
ADContainer
extends OneWireSensor
, so the general usage model applies to any ADContainer
:
ADContainer
Consider this interaction with an ADContainer
that reads from all of its A/D channels, then tries to set its high alarm on its first channel (channel 0):
//adcontainer is a com.dalsemi.onewire.container.ADContainer
byte[] state = adcontainer.readDevice();
double[] voltages = new double[adcontainer.getNumberADChannels()];
for (int i=0; i < adcontainer.getNumberADChannels(); i++)
{
adcontainer.doADConvert(i, state);
voltages[i] = adc.getADVoltage(i, state);
}
if (adcontainer.hasADAlarms())
{
double highalarm = adcontainer.getADAlarm(0, ADContainer.ALARM_HIGH, state);
adcontainer.setADAlarm(0, ADContainer.ALARM_HIGH, highalarm + 1.0, state);
adcontainer.writeDevice(state);
}
Public Member Functions | |
void | startNewMission (int sampleRate, int missionStartDelay, boolean rolloverEnabled, boolean syncClock, boolean[] channelEnabled) throws OneWireException, OneWireIOException |
Begins a new mission on this missioning device. | |
void | stopMission () throws OneWireException, OneWireIOException |
Ends the currently running mission. | |
boolean | isMissionRunning () throws OneWireException, OneWireIOException |
Returns true if a mission is currently running. | |
boolean | isMissionRolloverEnabled () throws OneWireException, OneWireIOException |
Returns true if a rollover is enabled. | |
boolean | hasMissionRolloverOccurred () throws OneWireException, OneWireIOException |
Returns true if a mission has rolled over. | |
void | loadMissionResults () throws OneWireException, OneWireIOException |
Loads the results of the currently running mission. | |
void | clearMissionResults () throws OneWireException, OneWireIOException |
Clears the mission results and erases the log memory from this missioning device. | |
int | getNumberMissionChannels () throws OneWireException, OneWireIOException |
Gets the number of channels supported by this Missioning device. | |
void | setMissionChannelEnable (int channel, boolean enable) throws OneWireException, OneWireIOException |
Enables/disables the specified mission channel, indicating whether or not the channel's readings will be recorded in the mission log. | |
boolean | getMissionChannelEnable (int channel) throws OneWireException, OneWireIOException |
Returns true if the specified mission channel is enabled, indicating that the channel's readings will be recorded in the mission log. | |
String | getMissionLabel (int channel) throws OneWireException, OneWireIOException |
Returns a default friendly label for each channel supported by this Missioning device. | |
long | getMissionTimeStamp (int channel) throws OneWireException, OneWireIOException |
Returns the time, in milliseconds, that the mission began. | |
long | getFirstSampleOffset (int channel) throws OneWireException, OneWireIOException |
Returns the amount of time, in milliseconds, before the first sample occurred. | |
int | getMissionSampleRate (int channel) throws OneWireException, OneWireIOException |
Returns the amount of time, in seconds, between samples taken by this missioning device. | |
int | getMissionSampleCount (int channel) throws OneWireException, OneWireIOException |
Returns the number of samples taken for the specified channel during the current mission. | |
int | getMissionSampleCountTotal (int channel) throws OneWireException, OneWireIOException |
Returns the total number of samples taken for the specified channel during the current mission. | |
double | getMissionSample (int channel, int sampleNum) throws OneWireException, OneWireIOException |
Returns the value of each sample taken by the current mission. | |
int | getMissionSampleAsInteger (int channel, int sampleNum) throws OneWireException, OneWireIOException |
Returns the sample as an integer value. | |
long | getMissionSampleTimeStamp (int channel, int sampleNum) throws OneWireException, OneWireIOException |
Returns the time, in milliseconds, that each sample was taken by the current mission. | |
double[] | getMissionResolutions (int channel) throws OneWireException, OneWireIOException |
Returns all available resolutions for the specified mission channel. | |
double | getMissionResolution (int channel) throws OneWireException, OneWireIOException |
Returns the currently selected resolution for the specified channel. | |
void | setMissionResolution (int channel, double resolution) throws OneWireException, OneWireIOException |
Sets the selected resolution for the specified channel. | |
boolean | hasMissionAlarms (int channel) |
Indicates whether or not the specified channel of this missioning device has mission alarm capabilities. | |
boolean | hasMissionAlarmed (int channel, int alarmType) throws OneWireException, OneWireIOException |
Returns true if the specified channel's alarm value of the specified type has been triggered during the mission. | |
boolean | getMissionAlarmEnable (int channel, int alarmType) throws OneWireException, OneWireIOException |
Returns true if the alarm of the specified type has been enabled for the specified channel. | |
void | setMissionAlarmEnable (int channel, int alarmType, boolean enable) throws OneWireException, OneWireIOException |
Enables/disables the alarm of the specified type for the specified channel. | |
double | getMissionAlarm (int channel, int alarmType) throws OneWireException, OneWireIOException |
Returns the threshold value which will trigger the alarm of the specified type on the specified channel. | |
void | setMissionAlarm (int channel, int alarmType, double threshold) throws OneWireException, OneWireIOException |
Sets the threshold value which will trigger the alarm of the specified type on the specified channel. | |
Static Public Attributes | |
static final int | ALARM_HIGH = 1 |
Indicates the high alarm. | |
static final int | ALARM_LOW = 0 |
Indicates the low alarm. |
void startNewMission | ( | int | sampleRate, | |
int | missionStartDelay, | |||
boolean | rolloverEnabled, | |||
boolean | syncClock, | |||
boolean[] | channelEnabled | |||
) | throws OneWireException, OneWireIOException |
Begins a new mission on this missioning device.
sampleRate | indicates the sampling rate, in seconds, that this missioning device should log samples. | |
missionStartDelay | indicates the amount of time, in seconds, that should pass before the mission begins. | |
rolloverEnabled | if false , this device will stop recording new samples after the data log is full. Otherwise, it will replace samples starting at the beginning. | |
syncClock | if true , the real-time clock of this missioning device will be synchronized with the current time according to this java.util.Date . |
Implemented in OneWireContainer41.
boolean isMissionRunning | ( | ) | throws OneWireException, OneWireIOException |
Returns true
if a mission is currently running.
true
if a mission is currently running. Implemented in OneWireContainer41.
boolean isMissionRolloverEnabled | ( | ) | throws OneWireException, OneWireIOException |
Returns true
if a rollover is enabled.
true
if a rollover is enabled. Implemented in OneWireContainer41.
boolean hasMissionRolloverOccurred | ( | ) | throws OneWireException, OneWireIOException |
Returns true
if a mission has rolled over.
true
if a mission has rolled over. Implemented in OneWireContainer41.
void loadMissionResults | ( | ) | throws OneWireException, OneWireIOException |
Loads the results of the currently running mission.
Must be called before all mission result/status methods.
Implemented in OneWireContainer41.
int getNumberMissionChannels | ( | ) | throws OneWireException, OneWireIOException |
Gets the number of channels supported by this Missioning device.
Channel specific methods will use a channel number specified by an integer from [0 to (getNumberOfMissionChannels()
- 1)].
Implemented in OneWireContainer41.
void setMissionChannelEnable | ( | int | channel, | |
boolean | enable | |||
) | throws OneWireException, OneWireIOException |
Enables/disables the specified mission channel, indicating whether or not the channel's readings will be recorded in the mission log.
channel | the channel to enable/disable | |
enable | if true, the channel is enabled |
Implemented in OneWireContainer41.
boolean getMissionChannelEnable | ( | int | channel | ) | throws OneWireException, OneWireIOException |
Returns true if the specified mission channel is enabled, indicating that the channel's readings will be recorded in the mission log.
channel | the channel to enable/disable | |
enable | if true, the channel is enabled |
Implemented in OneWireContainer41.
String getMissionLabel | ( | int | channel | ) | throws OneWireException, OneWireIOException |
Returns a default friendly label for each channel supported by this Missioning device.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
Implemented in OneWireContainer41.
long getMissionTimeStamp | ( | int | channel | ) | throws OneWireException, OneWireIOException |
Returns the time, in milliseconds, that the mission began.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
Implemented in OneWireContainer41.
long getFirstSampleOffset | ( | int | channel | ) | throws OneWireException, OneWireIOException |
Returns the amount of time, in milliseconds, before the first sample occurred.
If rollover disabled, or datalog didn't fill up, this will be 0.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
Implemented in OneWireContainer41.
int getMissionSampleRate | ( | int | channel | ) | throws OneWireException, OneWireIOException |
Returns the amount of time, in seconds, between samples taken by this missioning device.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
Implemented in OneWireContainer41.
int getMissionSampleCount | ( | int | channel | ) | throws OneWireException, OneWireIOException |
Returns the number of samples taken for the specified channel during the current mission.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
Implemented in OneWireContainer41.
int getMissionSampleCountTotal | ( | int | channel | ) | throws OneWireException, OneWireIOException |
Returns the total number of samples taken for the specified channel during the current mission.
This number can be more than the actual sample count if rollover is enabled and the log has been filled.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
Implemented in OneWireContainer41.
double getMissionSample | ( | int | channel, | |
int | sampleNum | |||
) | throws OneWireException, OneWireIOException |
Returns the value of each sample taken by the current mission.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) | |
sampleNum | the sample number to return, between 0 and (getMissionSampleCount(channel)-1) |
Implemented in OneWireContainer41.
int getMissionSampleAsInteger | ( | int | channel, | |
int | sampleNum | |||
) | throws OneWireException, OneWireIOException |
Returns the sample as an integer value.
This value is not converted to degrees Celsius for temperature or to percent RH for Humidity. It is simply the 8 or 16 bits of digital data written in the mission log for this sample entry. It is up to the user to mask off the unused bits and convert this value to it's proper units. This method is primarily for users of the DS2422 who are using an input device which is not an A-D or have an A-D wholly dissimilar to the one specified in the datasheet.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) | |
sampleNum | the sample number to return, between 0 and (getMissionSampleCount(channel)-1) |
Implemented in OneWireContainer41.
long getMissionSampleTimeStamp | ( | int | channel, | |
int | sampleNum | |||
) | throws OneWireException, OneWireIOException |
Returns the time, in milliseconds, that each sample was taken by the current mission.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) | |
sampleNum | the sample number to return, between 0 and (getMissionSampleCount(channel)-1) |
Implemented in OneWireContainer41.
double [] getMissionResolutions | ( | int | channel | ) | throws OneWireException, OneWireIOException |
Returns all available resolutions for the specified mission channel.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
Implemented in OneWireContainer41.
double getMissionResolution | ( | int | channel | ) | throws OneWireException, OneWireIOException |
Returns the currently selected resolution for the specified channel.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
Implemented in OneWireContainer41.
void setMissionResolution | ( | int | channel, | |
double | resolution | |||
) | throws OneWireException, OneWireIOException |
Sets the selected resolution for the specified channel.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) | |
resolution | the new resolution for the specified channel. |
Implemented in OneWireContainer41.
boolean hasMissionAlarms | ( | int | channel | ) |
Indicates whether or not the specified channel of this missioning device has mission alarm capabilities.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
Implemented in OneWireContainer41.
boolean hasMissionAlarmed | ( | int | channel, | |
int | alarmType | |||
) | throws OneWireException, OneWireIOException |
Returns true if the specified channel's alarm value of the specified type has been triggered during the mission.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) | |
alarmType | valid value: ALARM_HIGH or ALARM_LOW |
Implemented in OneWireContainer41.
boolean getMissionAlarmEnable | ( | int | channel, | |
int | alarmType | |||
) | throws OneWireException, OneWireIOException |
Returns true if the alarm of the specified type has been enabled for the specified channel.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) | |
alarmType | valid value: ALARM_HIGH or ALARM_LOW |
Implemented in OneWireContainer41.
void setMissionAlarmEnable | ( | int | channel, | |
int | alarmType, | |||
boolean | enable | |||
) | throws OneWireException, OneWireIOException |
Enables/disables the alarm of the specified type for the specified channel.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) | |
alarmType | valid value: ALARM_HIGH or ALARM_LOW | |
enable | if true, alarm is enabled. |
Implemented in OneWireContainer41.
double getMissionAlarm | ( | int | channel, | |
int | alarmType | |||
) | throws OneWireException, OneWireIOException |
Returns the threshold value which will trigger the alarm of the specified type on the specified channel.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) | |
alarmType | valid value: ALARM_HIGH or ALARM_LOW |
Implemented in OneWireContainer41.
void setMissionAlarm | ( | int | channel, | |
int | alarmType, | |||
double | threshold | |||
) | throws OneWireException, OneWireIOException |
Sets the threshold value which will trigger the alarm of the specified type on the specified channel.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) | |
alarmType | valid value: ALARM_HIGH or ALARM_LOW | |
threshold | the threshold value which will trigger the alarm |
Implemented in OneWireContainer41.