public interface MissionContainer extends ClockContainer
Interface class for 1-Wire® devices that perform analog measuring operations. This class should be implemented for each A/D type 1-Wire device.
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);
}
Modifier and Type | Field and Description |
---|---|
static int |
ALARM_HIGH
Indicates the high alarm.
|
static int |
ALARM_LOW
Indicates the low alarm.
|
Modifier and Type | Method and Description |
---|---|
void |
clearMissionResults()
Clears the mission results and erases the log memory from this
missioning device.
|
long |
getFirstSampleOffset(int channel)
Returns the amount of time, in milliseconds, before the first sample
occurred.
|
double |
getMissionAlarm(int channel,
int alarmType)
Returns the threshold value which will trigger the alarm of the
specified type on the specified channel.
|
boolean |
getMissionAlarmEnable(int channel,
int alarmType)
Returns true if the alarm of the specified type has been enabled for
the specified channel.
|
boolean |
getMissionChannelEnable(int channel)
Returns true if the specified mission channel is enabled, indicating
that the channel's readings will be recorded in the mission log.
|
java.lang.String |
getMissionLabel(int channel)
Returns a default friendly label for each channel supported by this
Missioning device.
|
double |
getMissionResolution(int channel)
Returns the currently selected resolution for the specified
channel.
|
double[] |
getMissionResolutions(int channel)
Returns all available resolutions for the specified mission channel.
|
double |
getMissionSample(int channel,
int sampleNum)
Returns the value of each sample taken by the current mission.
|
int |
getMissionSampleAsInteger(int channel,
int sampleNum)
Returns the sample as an integer value.
|
int |
getMissionSampleCount(int channel)
Returns the number of samples taken for the specified channel
during the current mission.
|
int |
getMissionSampleCountTotal(int channel)
Returns the total number of samples taken for the specified channel
during the current mission.
|
int |
getMissionSampleRate(int channel)
Returns the amount of time, in seconds, between samples taken
by this missioning device.
|
long |
getMissionSampleTimeStamp(int channel,
int sampleNum)
Returns the time, in milliseconds, that each sample was taken by the
current mission.
|
long |
getMissionTimeStamp(int channel)
Returns the time, in milliseconds, that the mission began.
|
int |
getNumberMissionChannels()
Gets the number of channels supported by this Missioning device.
|
boolean |
hasMissionAlarmed(int channel,
int alarmType)
Returns true if the specified channel's alarm value of the specified
type has been triggered during the mission.
|
boolean |
hasMissionAlarms(int channel)
Indicates whether or not the specified channel of this missioning device
has mission alarm capabilities.
|
boolean |
hasMissionRolloverOccurred()
Returns
true if a mission has rolled over. |
boolean |
isMissionLoaded() |
boolean |
isMissionRolloverEnabled()
Returns
true if a rollover is enabled. |
boolean |
isMissionRunning()
Returns
true if a mission is currently running. |
void |
loadMissionResults()
Loads the results of the currently running mission.
|
void |
setMissionAlarm(int channel,
int alarmType,
double threshold)
Sets the threshold value which will trigger the alarm of the
specified type on the specified channel.
|
void |
setMissionAlarmEnable(int channel,
int alarmType,
boolean enable)
Enables/disables the alarm of the specified type for the specified channel
|
void |
setMissionChannelEnable(int channel,
boolean enable)
Enables/disables the specified mission channel, indicating whether or
not the channel's readings will be recorded in the mission log.
|
void |
setMissionResolution(int channel,
double resolution)
Sets the selected resolution for the specified channel.
|
void |
startNewMission(int sampleRate,
int missionStartDelay,
boolean rolloverEnabled,
boolean syncClock,
boolean[] channelEnabled)
Begins a new mission on this missioning device.
|
void |
stopMission()
Ends the currently running mission.
|
canDisableClock, getClock, getClockAlarm, getClockResolution, hasClockAlarm, isClockAlarmEnabled, isClockAlarming, isClockRunning, setClock, setClockAlarm, setClockAlarmEnable, setClockRunEnable
readDevice, writeDevice
static final int ALARM_HIGH
static final int ALARM_LOW
void startNewMission(int sampleRate, int missionStartDelay, boolean rolloverEnabled, boolean syncClock, boolean[] channelEnabled) throws OneWireException, OneWireIOException
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
.OneWireException
OneWireIOException
void stopMission() throws OneWireException, OneWireIOException
OneWireException
OneWireIOException
boolean isMissionRunning() throws OneWireException, OneWireIOException
true
if a mission is currently running.true
if a mission is currently running.OneWireException
OneWireIOException
boolean isMissionRolloverEnabled() throws OneWireException, OneWireIOException
true
if a rollover is enabled.true
if a rollover is enabled.OneWireException
OneWireIOException
boolean hasMissionRolloverOccurred() throws OneWireException, OneWireIOException
true
if a mission has rolled over.true
if a mission has rolled over.OneWireException
OneWireIOException
void loadMissionResults() throws OneWireException, OneWireIOException
OneWireException
OneWireIOException
boolean isMissionLoaded()
void clearMissionResults() throws OneWireException, OneWireIOException
OneWireException
OneWireIOException
int getNumberMissionChannels() throws OneWireException, OneWireIOException
getNumberOfMissionChannels()
- 1)].OneWireException
OneWireIOException
void setMissionChannelEnable(int channel, boolean enable) throws OneWireException, OneWireIOException
channel
- the channel to enable/disableenable
- if true, the channel is enabledOneWireException
OneWireIOException
boolean getMissionChannelEnable(int channel) throws OneWireException, OneWireIOException
channel
- the channel to enable/disableenable
- if true, the channel is enabledOneWireException
OneWireIOException
java.lang.String getMissionLabel(int channel) throws OneWireException, OneWireIOException
channel
- the mission channel, between 0
and
(getNumberOfMissionChannels()-1)
OneWireException
OneWireIOException
long getMissionTimeStamp(int channel) throws OneWireException, OneWireIOException
channel
- the mission channel, between 0
and
(getNumberOfMissionChannels()-1)
OneWireException
OneWireIOException
long getFirstSampleOffset(int channel) throws OneWireException, OneWireIOException
channel
- the mission channel, between 0
and
(getNumberOfMissionChannels()-1)
OneWireException
OneWireIOException
int getMissionSampleRate(int channel) throws OneWireException, OneWireIOException
channel
- the mission channel, between 0
and
(getNumberOfMissionChannels()-1)
OneWireException
OneWireIOException
int getMissionSampleCount(int channel) throws OneWireException, OneWireIOException
channel
- the mission channel, between 0
and
(getNumberOfMissionChannels()-1)
OneWireException
OneWireIOException
int getMissionSampleCountTotal(int channel) throws OneWireException, OneWireIOException
channel
- the mission channel, between 0
and
(getNumberOfMissionChannels()-1)
OneWireException
OneWireIOException
double getMissionSample(int channel, int sampleNum) throws OneWireException, OneWireIOException
channel
- the mission channel, between 0
and
(getNumberOfMissionChannels()-1)
sampleNum
- the sample number to return, between 0
and
(getMissionSampleCount(channel)-1)
OneWireException
OneWireIOException
int getMissionSampleAsInteger(int channel, int sampleNum) throws OneWireException, OneWireIOException
channel
- the mission channel, between 0
and
(getNumberOfMissionChannels()-1)
sampleNum
- the sample number to return, between 0
and
(getMissionSampleCount(channel)-1)
OneWireException
OneWireIOException
long getMissionSampleTimeStamp(int channel, int sampleNum) throws OneWireException, OneWireIOException
channel
- the mission channel, between 0
and
(getNumberOfMissionChannels()-1)
sampleNum
- the sample number to return, between 0
and
(getMissionSampleCount(channel)-1)
OneWireException
OneWireIOException
double[] getMissionResolutions(int channel) throws OneWireException, OneWireIOException
channel
- the mission channel, between 0
and
(getNumberOfMissionChannels()-1)
OneWireException
OneWireIOException
double getMissionResolution(int channel) throws OneWireException, OneWireIOException
channel
- the mission channel, between 0
and
(getNumberOfMissionChannels()-1)
OneWireException
OneWireIOException
void setMissionResolution(int channel, double resolution) throws OneWireException, OneWireIOException
channel
- the mission channel, between 0
and
(getNumberOfMissionChannels()-1)
resolution
- the new resolution for the specified channel.OneWireException
OneWireIOException
boolean hasMissionAlarms(int channel)
channel
- the mission channel, between 0
and
(getNumberOfMissionChannels()-1)
boolean hasMissionAlarmed(int channel, int alarmType) throws OneWireException, OneWireIOException
channel
- the mission channel, between 0
and
(getNumberOfMissionChannels()-1)
alarmType
- valid value: ALARM_HIGH
or
ALARM_LOW
OneWireException
OneWireIOException
boolean getMissionAlarmEnable(int channel, int alarmType) throws OneWireException, OneWireIOException
channel
- the mission channel, between 0
and
(getNumberOfMissionChannels()-1)
alarmType
- valid value: ALARM_HIGH
or
ALARM_LOW
OneWireException
OneWireIOException
void setMissionAlarmEnable(int channel, int alarmType, boolean enable) throws OneWireException, OneWireIOException
channel
- the mission channel, between 0
and
(getNumberOfMissionChannels()-1)
alarmType
- valid value: ALARM_HIGH
or
ALARM_LOW
enable
- if true, alarm is enabled.OneWireException
OneWireIOException
double getMissionAlarm(int channel, int alarmType) throws OneWireException, OneWireIOException
channel
- the mission channel, between 0
and
(getNumberOfMissionChannels()-1)
alarmType
- valid value: ALARM_HIGH
or
ALARM_LOW
OneWireException
OneWireIOException
void setMissionAlarm(int channel, int alarmType, double threshold) throws OneWireException, OneWireIOException
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 alarmOneWireException
OneWireIOException
Copyright © 1999-2012 Maxim Integrated Products. All Rights Reserved.