org.mbari.siam.devices.nortek.vector
Class Aquadopp

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.mbari.siam.core.DeviceService
                  extended by org.mbari.siam.core.BaseInstrumentService
                      extended by org.mbari.siam.core.StreamingInstrumentService
                          extended by org.mbari.siam.devices.nortek.vector.Aquadopp
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, ScheduleOwner, AquadoppIF, Device, DeviceServiceIF, Instrument, Safeable
Direct Known Subclasses:
Vector

public class Aquadopp
extends StreamingInstrumentService
implements AquadoppIF, Safeable

Instrument service for Aquadopp current profiler.

See Also:
Serialized Form

Nested Class Summary
 class Aquadopp.Attributes
          Service attributes.
 class Aquadopp.Parser
           
 
Field Summary
static java.lang.String ASCII_CONFIG_TAG
           
static java.lang.String BINARY_CONFIG_TAG
           
static int HARDWARE_CONFIGURATION
           
static int HR_PROFILER_DATA
           
static int INSTRUMENT_CONFIGURATION
           
static int PROFILER_VELOCITY_DATA
           
static int SYNC_BYTE
           
 
Fields inherited from class org.mbari.siam.core.StreamingInstrumentService
_shutdown, _subsampleInterval, _suspend
 
Fields inherited from class org.mbari.siam.core.BaseInstrumentService
_defaultSamplerTask, _defaultSampleScheduleName, _errorCache, _instrumentAttributes, _lastPacket, _lastSensorDataPacket, _maxSampleBytes, _messagePacket, _nPowerRequests, _nWakeRequests, _packetLog, _recordType, _running, _samplerWakeupTime, _scheduleKey, _schedules, _sensorDataPacket, _turbinator, MAX_BASE_RECORDTYPE, RECORDTYPE_DEFAULT, RECORDTYPE_METADATA, RECORDTYPE_UNDEFINED
 
Fields inherited from class org.mbari.siam.core.DeviceService
_fromDevice, _instrumentPort, _nodeProperties, _parentNode, _regEntry, _sandBox, _serviceCachePath, _serviceName, _servicePropertiesPath, _serviceXMLPath, _toDevice, CACHED_PROPERTIES_FILENAME, PROPERTIES_FILENAME, XML_FILENAME
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface org.mbari.siam.distributed.Device
ERROR, INITIAL, INSTRUMENT_STATE, MDATA_ALL, OK, SAFE, SAMPLING, SERVICE_ATTRIBUTES, SERVICE_CACHE, SERVICE_PROPERTIES, SERVICE_XML, SHUTDOWN, SLEEPING, SUSPEND, UNKNOWN
 
Constructor Summary
Aquadopp()
           
 
Method Summary
protected  ScheduleSpecifier createDefaultSampleSchedule()
          Return specifier for default sampling schedule.
 void enterSafeMode()
          Enter mode for resource-restricted environement.
 void eraseRecorder()
          Erase the recorder
 DevicePacketParser getDevicePacketParser()
          Get instruments' DevicePacketParser, which returns JDDAC records.
protected  byte[] getInstrumentStateMetadata()
          Get Instrument State Metadata.
 PacketParser getParser()
          Get instrument's parser.
 SerialPortParameters getSerialPortParameters()
          Return parameters to use on serial port.
protected  PowerPolicy initCommunicationPowerPolicy()
          Sets Aquadopp communications power policy
protected  int initCurrentLimit()
          Sets Aquadopp current limit.
protected  void initializeInstrument()
          Initialize the Instrument This means to set all initial settings - This section for one time only instrument settings
protected  PowerPolicy initInstrumentPowerPolicy()
          Sets Aquadopp power policy
protected  int initInstrumentStartDelay()
          Set Aquadopp startup delay time.
protected  int initMaxSampleBytes()
          Sets the Aquadopp maximum number of bytes in an instrument data sample
protected  byte[] initPromptString()
          Sets the Aquadopp command prompt.
protected  byte[] initSampleTerminator()
          Sets the Aquadopp sample terminator.
protected  boolean isStreaming()
          Return true if instrument is streaming.
protected  int readSample(byte[] sample)
          Read a Nortek binary sample; overrides BaseInstrumentService.readSample().
 void setClock()
          Set instrument clock to current time
 void setClock(long t)
          Set the Aquadopp's clock.
protected  void setMeasurementInterval(short sec)
          Send command to set the measurement interval (assumes we've got instrument's attention already)
protected  java.lang.String shutdownInstrument()
          Make sure to terminate measurement mode - it is "bad" to disconnect power while in measurement mode.
protected  void startStreaming()
          Put instrument into streaming mode
protected  void stopStreaming()
          Stop streaming
 int test()
          Self-test routine; This does nothing in the Aquadopp driver
 
Methods inherited from class org.mbari.siam.core.StreamingInstrumentService
acquire, acquireFromStream, doneAcquiring, doScheduledTask, resume, setAttributes, shutdown, suspend
 
Methods inherited from class org.mbari.siam.core.BaseInstrumentService
acquireSample, addDefaultPacketFilters, addSchedule, addSchedule, annotate, assertSamplingState, cacheProperties, callDataListeners, canSummarize, checkInputProperties, cleanupServiceState, clearDefaultPacketFilters, clearPropertiesCache, createPacketLog, createTask, createTurbinators, disableSummary, enableSummary, endDeviceAccess, getAllSchedules, getChildren, getCommunicationPowerPolicy, getCurrentLimit, getDefaultPacketFilters, getDefaultSampleSchedule, getDefaultSampleScheduleName, getFileBytes, getInstrumentPowerPolicy, getInstrumentServiceBlock, getInstrumentStartDelay, getLastSample, getMaxSampleBytes, getMaxSampleTries, getMetadata, getMetadata, getMetadataPayload, getPackets, getPackets, getParent, getPortDiagnostics, getPortDiagnosticsSummary, getPromptString, getProperties, getProperty, getSampleBuf, getSampleSchedule, getSampleTerminator, getSampleTimeout, getSchedule, getScheduleKey, getSchedules, getServicePropertiesBytes, initialize, initializeDriverDefaults, initializePooledResources, interruptDeviceAccess, logPacket, managePowerSleep, managePowerWake, nPowerRequests, postSample, powerOff, powerOffCallback, powerOn, powerOnCallback, prepareToRun, prepareToSample, printData, processSample, removeAllSchedules, removeSchedule, resetPortDiagnostics, resumeSchedule, running, setCommunicationPowerPolicy, setCurrentLimit, setDefaultSampleScheduleName, setInstrumentPowerPolicy, setInstrumentServiceBlock, setInstrumentStartDelay, setMaxSampleBytes, setMaxSampleTries, setPromptString, setProperty, setRecordType, setSampleTerminator, setSampleTimeout, sleepingUntil, snooze, startDeviceAccess, summaryEnabled, suspendSchedule, sync, syncSchedule, validateSample
 
Methods inherited from class org.mbari.siam.core.DeviceService
addDataListener, advertiseService, createRegistryEntry, getAttributes, getCommPortName, getFrameworkVersion, getId, getInstrumentPort, getLocation, getName, getRemoteSerialPort, getRemoteSerialPort, getSamplingCount, getSamplingErrorCount, getSamplingRetryCount, getStatus, host, incRetryCount, initializePropertyDefaults, registryEntry, registryName, removeDataListener, setInstrumentPort, setNodeProperties, setParent, setSerialPort, setStatusError, setStatusInitial, setStatusOk, setStatusSafe, setStatusSampling, setStatusShutdown, setStatusSuspend
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mbari.siam.distributed.Instrument
acquireSample, addDefaultPacketFilters, annotate, cacheProperties, clearDefaultPacketFilters, clearPropertiesCache, disableSummary, enableSummary, getDefaultPacketFilters, getLastSample, getPackets, getPackets, getPortDiagnostics, getPortDiagnosticsSummary, getProperties, getProperty, getSampleSchedule, getSchedules, resetPortDiagnostics, setProperty, summaryEnabled
 
Methods inherited from interface org.mbari.siam.distributed.Device
getChildren, getCommPortName, getFrameworkVersion, getId, getLocation, getMetadata, getName, getParent, getSamplingCount, getSamplingErrorCount, getSamplingRetryCount, getStatus, host, powerOff, powerOn, prepareToRun, resume, shutdown, suspend
 
Methods inherited from interface org.mbari.siam.distributed.DeviceServiceIF
getName
 
Methods inherited from interface org.mbari.siam.core.ScheduleOwner
addSchedule, getAllSchedules, getScheduleKey, removeAllSchedules, removeSchedule, resumeSchedule, sleepingUntil, suspendSchedule, syncSchedule
 

Field Detail

ASCII_CONFIG_TAG

public static final java.lang.String ASCII_CONFIG_TAG
See Also:
Constant Field Values

BINARY_CONFIG_TAG

public static final java.lang.String BINARY_CONFIG_TAG
See Also:
Constant Field Values

INSTRUMENT_CONFIGURATION

public static final int INSTRUMENT_CONFIGURATION
See Also:
Constant Field Values

HARDWARE_CONFIGURATION

public static final int HARDWARE_CONFIGURATION
See Also:
Constant Field Values

PROFILER_VELOCITY_DATA

public static final int PROFILER_VELOCITY_DATA
See Also:
Constant Field Values

HR_PROFILER_DATA

public static final int HR_PROFILER_DATA
See Also:
Constant Field Values

SYNC_BYTE

public static final int SYNC_BYTE
See Also:
Constant Field Values
Constructor Detail

Aquadopp

public Aquadopp()
         throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException
Method Detail

initInstrumentPowerPolicy

protected PowerPolicy initInstrumentPowerPolicy()
Sets Aquadopp power policy

Specified by:
initInstrumentPowerPolicy in class BaseInstrumentService

initCommunicationPowerPolicy

protected PowerPolicy initCommunicationPowerPolicy()
Sets Aquadopp communications power policy

Specified by:
initCommunicationPowerPolicy in class BaseInstrumentService

initInstrumentStartDelay

protected int initInstrumentStartDelay()
Set Aquadopp startup delay time. Set to 0 above.

Specified by:
initInstrumentStartDelay in class BaseInstrumentService

initCurrentLimit

protected int initCurrentLimit()
Sets Aquadopp current limit. Set to 1000 above.

Specified by:
initCurrentLimit in class BaseInstrumentService

initSampleTerminator

protected byte[] initSampleTerminator()
Sets the Aquadopp sample terminator. The string is terminated by CR (\r) and LF (\n).

Specified by:
initSampleTerminator in class BaseInstrumentService

initPromptString

protected byte[] initPromptString()
Sets the Aquadopp command prompt. There is no command prompt.

Specified by:
initPromptString in class BaseInstrumentService

initMaxSampleBytes

protected int initMaxSampleBytes()
Sets the Aquadopp maximum number of bytes in an instrument data sample

Specified by:
initMaxSampleBytes in class BaseInstrumentService

initializeInstrument

protected void initializeInstrument()
                             throws InitializeException,
                                    java.lang.Exception
Initialize the Instrument This means to set all initial settings - This section for one time only instrument settings

Overrides:
initializeInstrument in class StreamingInstrumentService
Throws:
InitializeException
java.lang.Exception

getSerialPortParameters

public SerialPortParameters getSerialPortParameters()
                                             throws gnu.io.UnsupportedCommOperationException
Return parameters to use on serial port.

Overrides:
getSerialPortParameters in class DeviceService
Throws:
gnu.io.UnsupportedCommOperationException

stopStreaming

protected void stopStreaming()
                      throws java.lang.Exception
Stop streaming

Specified by:
stopStreaming in class StreamingInstrumentService
Throws:
java.lang.Exception

isStreaming

protected boolean isStreaming()
Return true if instrument is streaming.

Specified by:
isStreaming in class StreamingInstrumentService

startStreaming

protected void startStreaming()
                       throws java.lang.Exception
Put instrument into streaming mode

Specified by:
startStreaming in class StreamingInstrumentService
Throws:
java.lang.Exception

eraseRecorder

public void eraseRecorder()
                   throws java.lang.Exception
Erase the recorder

Specified by:
eraseRecorder in interface AquadoppIF
Throws:
java.lang.Exception

getInstrumentStateMetadata

protected byte[] getInstrumentStateMetadata()
                                     throws java.lang.Exception
Get Instrument State Metadata. TRUE STATE OF INSTRUMENT.

Overrides:
getInstrumentStateMetadata in class BaseInstrumentService
Throws:
java.lang.Exception

setClock

public void setClock()
Set instrument clock to current time

Specified by:
setClock in interface Instrument
Overrides:
setClock in class BaseInstrumentService

setClock

public void setClock(long t)
              throws NotSupportedException
Set the Aquadopp's clock. This does nothing in the Aquadopp driver

Specified by:
setClock in interface Instrument
Overrides:
setClock in class BaseInstrumentService
Throws:
NotSupportedException

getDevicePacketParser

public DevicePacketParser getDevicePacketParser()
                                         throws NotSupportedException
Description copied from class: BaseInstrumentService
Get instruments' DevicePacketParser, which returns JDDAC records. Not supported by default

Overrides:
getDevicePacketParser in class BaseInstrumentService
Throws:
NotSupportedException

getParser

public PacketParser getParser()
                       throws NotSupportedException
Description copied from class: BaseInstrumentService
Get instrument's parser. Not supported, by default.

Specified by:
getParser in interface Instrument
Overrides:
getParser in class BaseInstrumentService
Throws:
NotSupportedException

test

public int test()
Self-test routine; This does nothing in the Aquadopp driver

Specified by:
test in interface Device

enterSafeMode

public void enterSafeMode()
                   throws java.lang.Exception
Enter mode for resource-restricted environement.

Specified by:
enterSafeMode in interface Safeable
Throws:
java.lang.Exception

createDefaultSampleSchedule

protected ScheduleSpecifier createDefaultSampleSchedule()
                                                 throws ScheduleParseException
Return specifier for default sampling schedule. Subclasses MUST provide the default sample schedule.

Specified by:
createDefaultSampleSchedule in class BaseInstrumentService
Throws:
ScheduleParseException

readSample

protected int readSample(byte[] sample)
                  throws TimeoutException,
                         java.io.IOException,
                         java.lang.Exception
Read a Nortek binary sample; overrides BaseInstrumentService.readSample().

Overrides:
readSample in class BaseInstrumentService
Parameters:
sample - output buffer
Throws:
TimeoutException
java.io.IOException
java.lang.Exception

setMeasurementInterval

protected void setMeasurementInterval(short sec)
                               throws java.lang.Exception
Send command to set the measurement interval (assumes we've got instrument's attention already)

Throws:
java.lang.Exception

shutdownInstrument

protected java.lang.String shutdownInstrument()
                                       throws java.lang.Exception
Make sure to terminate measurement mode - it is "bad" to disconnect power while in measurement mode.

Overrides:
shutdownInstrument in class BaseInstrumentService
Throws:
java.lang.Exception


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.