org.mbari.siam.devices.seabird.sbe52mp
Class SBE52MP

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.PolledInstrumentService
                          extended by org.mbari.siam.devices.seabird.base.Seabird
                              extended by org.mbari.siam.devices.seabird.sbe52mp.SBE52MP
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, ScheduleOwner, Device, DeviceServiceIF, Instrument

public class SBE52MP
extends Seabird
implements Instrument

SBE52MP implements a PolledInstrumentService for a Seabird SBE 52-MP Moored Profiler CTD and Optional Dissolved Oxygen Sensor.

Author:
Bob Herlien
See Also:
Serialized Form

Nested Class Summary
 class SBE52MP.DevicePacketParser
           
protected  class SBE52MP.SBE52Attributes
           
 
Nested classes/interfaces inherited from class org.mbari.siam.devices.seabird.base.Seabird
Seabird.Attributes
 
Field Summary
protected  boolean _continuousPumping
           
protected  byte[] _getPrompt
           
protected  byte[] _haltSample
           
protected  byte[] _haltSampleEcho
           
protected  byte[] _requestSample
           
protected  byte[] _requestSampleEcho
           
protected  byte[] _requestSampleNotPumped
           
protected  byte[] _requestSamplePumped
          Command to sample depends on whether sample is logged to instrument FLASH (see initializeInstrument())
protected  byte[] _startNow
           
protected  byte[] _startNowEcho
           
protected  java.lang.String _startPump
           
protected  java.lang.String _stopPump
           
 
Fields inherited from class org.mbari.siam.devices.seabird.base.Seabird
_attributes, _getStatusEcho, _getStatusInfo, _maxCalBytes, _maxStatusBytes, _quitSession, _quitSessionEcho, _safeMode, _sendLast, _sendLastEcho, _setSampleInterval, MAX_AUTO_SAMPLE_INTERVAL_SEC, MIN_AUTO_SAMPLE_INTERVAL_SEC
 
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
SBE52MP()
          Constructor.
 
Method Summary
 int addSchedule(java.lang.String name, java.lang.String schedule, boolean overwrite)
          We override addschedule so we know when to reinitialize the device for sample mode.
protected  byte[] getCalibrationCmd()
          Return command to get calibrations
 DevicePacketParser getDevicePacketParser()
          Get instruments' DevicePacketParser, which returns JDDAC records.
protected  byte[] getFormatForSummaryCmd()
          This is not used in this subclass, but must be defined since it's an abstract method in Seabird
protected  byte[] getInstrumentStateMetadata()
          Get device's notion of its state: a Seabird status packet.
 PacketParser getParser()
          Return CTD packet parser.
protected  void getPrompt()
           
protected  void initializeInstrument()
          Initialize the SBE 52MP.
 java.lang.Object parseDataPacket(SensorDataPacket pkt)
          Parse the CTD data into a CTDData struct
protected  void postSample()
          postSample processing.
protected  void requestSample()
          Request a sample.
 void setClock()
          SBE 52MP doesn't have a clock.
protected  void setPumpMode(boolean forcePumpChange)
          Set mode of using the pump to either continuous pumping or pumped while sampling, depending on the sample rate.
protected  void stopAutonomousLogging()
          Stop instrument sampling.
 
Methods inherited from class org.mbari.siam.devices.seabird.base.Seabird
createDefaultSampleSchedule, getPrompt, getSerialPortParameters, initCommunicationPowerPolicy, initCurrentLimit, initInstrumentPowerPolicy, initInstrumentStartDelay, initMaxSampleBytes, initPromptString, initSampleTerminator, quitSession, sendCommand, sendCommandConfirm, setAutonomousSampleInterval, setDataFormat, startAutonomousLogging, test
 
Methods inherited from class org.mbari.siam.core.PolledInstrumentService
acquire, doScheduledTask, setAttributes
 
Methods inherited from class org.mbari.siam.core.BaseInstrumentService
acquireSample, addDefaultPacketFilters, 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, powerOff, powerOffCallback, powerOn, powerOnCallback, prepareToRun, prepareToSample, printData, processSample, readSample, removeAllSchedules, removeSchedule, resetPortDiagnostics, resume, resumeSchedule, running, setClock, setCommunicationPowerPolicy, setCurrentLimit, setDefaultSampleScheduleName, setInstrumentPowerPolicy, setInstrumentServiceBlock, setInstrumentStartDelay, setMaxSampleBytes, setMaxSampleTries, setPromptString, setProperty, setRecordType, setSampleTerminator, setSampleTimeout, shutdown, shutdownInstrument, sleepingUntil, snooze, startDeviceAccess, summaryEnabled, suspend, 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, setClock, 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, test
 
Methods inherited from interface org.mbari.siam.distributed.DeviceServiceIF
getName
 
Methods inherited from interface org.mbari.siam.core.ScheduleOwner
getAllSchedules, getScheduleKey, removeAllSchedules, removeSchedule, resumeSchedule, sleepingUntil, suspendSchedule, syncSchedule
 

Field Detail

_requestSamplePumped

protected final byte[] _requestSamplePumped
Command to sample depends on whether sample is logged to instrument FLASH (see initializeInstrument())


_requestSampleNotPumped

protected final byte[] _requestSampleNotPumped

_getPrompt

protected byte[] _getPrompt

_requestSample

protected byte[] _requestSample

_requestSampleEcho

protected byte[] _requestSampleEcho

_haltSample

protected byte[] _haltSample

_haltSampleEcho

protected byte[] _haltSampleEcho

_startNow

protected byte[] _startNow

_startNowEcho

protected byte[] _startNowEcho

_startPump

protected final java.lang.String _startPump
See Also:
Constant Field Values

_stopPump

protected final java.lang.String _stopPump
See Also:
Constant Field Values

_continuousPumping

protected boolean _continuousPumping
Constructor Detail

SBE52MP

public SBE52MP()
        throws java.rmi.RemoteException
Constructor.

Throws:
java.rmi.RemoteException
Method Detail

getFormatForSummaryCmd

protected byte[] getFormatForSummaryCmd()
This is not used in this subclass, but must be defined since it's an abstract method in Seabird

Specified by:
getFormatForSummaryCmd in class Seabird

getCalibrationCmd

protected byte[] getCalibrationCmd()
Return command to get calibrations

Specified by:
getCalibrationCmd in class Seabird

getParser

public PacketParser getParser()
Return CTD packet parser.

Specified by:
getParser in interface Instrument
Overrides:
getParser in class Seabird

setClock

public void setClock()
SBE 52MP doesn't have a clock.

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

initializeInstrument

protected void initializeInstrument()
                             throws java.lang.Exception
Initialize the SBE 52MP.

Overrides:
initializeInstrument in class Seabird
Throws:
java.lang.Exception

setPumpMode

protected void setPumpMode(boolean forcePumpChange)
Set mode of using the pump to either continuous pumping or pumped while sampling, depending on the sample rate.

Parameters:
forcePumpChange - - true to always send the PUMPON or PUMPOFF command, even if the mode hasn't changed.

requestSample

protected void requestSample()
Request a sample. SBE52MP doesn't echo commands

Overrides:
requestSample in class Seabird

postSample

protected void postSample()
postSample processing. If in continuous pumping mode, we must turn the pump back on, because %*&*#* Seabird turns it off after "TS"

Overrides:
postSample in class Seabird

stopAutonomousLogging

protected void stopAutonomousLogging()
                              throws java.io.IOException,
                                     java.lang.Exception,
                                     TimeoutException
Stop instrument sampling. Overrides base class because SBE52 doesn't re-prompt.

Overrides:
stopAutonomousLogging in class Seabird
Throws:
java.io.IOException
java.lang.Exception
TimeoutException

getPrompt

protected void getPrompt()
                  throws TimeoutException,
                         java.io.IOException,
                         java.lang.NullPointerException,
                         java.lang.Exception
Overrides:
getPrompt in class Seabird
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

getInstrumentStateMetadata

protected byte[] getInstrumentStateMetadata()
Get device's notion of its state: a Seabird status packet. Overrides base class because the SBE52MP doesn't echo commands.

Overrides:
getInstrumentStateMetadata in class Seabird

addSchedule

public int addSchedule(java.lang.String name,
                       java.lang.String schedule,
                       boolean overwrite)
We override addschedule so we know when to reinitialize the device for sample mode.

Specified by:
addSchedule in interface ScheduleOwner
Overrides:
addSchedule in class BaseInstrumentService
Parameters:
name - Schedule name
schedule - Representation of schedule
overwrite - If true, replace existing schedule
Returns:
Scheduler.UNDEFINED, Scheduler.INVALID_SCHEDULE

parseDataPacket

public java.lang.Object parseDataPacket(SensorDataPacket pkt)
                                 throws InvalidDataException
Parse the CTD data into a CTDData struct

Throws:
InvalidDataException

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 Seabird
Throws:
NotSupportedException


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.