org.mbari.siam.distributed
Class DevicePacketParser

java.lang.Object
  extended by org.mbari.siam.distributed.DevicePacketParser
Direct Known Subclasses:
DevicePacketParser, DevicePacketParser, Ocr3000.DevicePacketParser, SBE52MP.DevicePacketParser, Seabird.DevicePacketParser, StreamingSBE19.SBE19DevicePacketParser

public abstract class DevicePacketParser
extends java.lang.Object

A DevicePacketParser generates JDDAC Records from SIAM DevicePackets.


Field Summary
protected  SiamRecord _record
           
 
Constructor Summary
DevicePacketParser()
           
 
Method Summary
protected  void addArrayMeasurement(java.lang.String name, java.lang.String description, java.lang.String units, double[] values)
          Add a Measurement which contains an array of float values to this DevicePacketParser's Record.
protected  void addArrayMeasurement(java.lang.String name, java.lang.String description, java.lang.String units, float[] values)
          Add a Measurement which contains an array of float values to this DevicePacketParser's Record.
protected  void addArrayMeasurement(java.lang.String name, java.lang.String description, java.lang.String units, int[] values)
          Add a Measurement which contains an array of integer values to this DevicePacketParser's Record.
protected  void addMeasurement(java.lang.String name, java.lang.String description, java.lang.String units, int value)
          Add an integer-valued Measurement to this object's Record, and specify the initial integer value.
protected  void addMeasurement(java.lang.String name, java.lang.String description, java.lang.String units, java.lang.Number value)
          Add a Number-valued Measurement to this object's Record
 SiamRecord parse(DevicePacket packet)
          Parse DevicePacket, return Record containing Measurements.
protected abstract  void parseFields(DevicePacket packet)
          Parse raw data from DevicePacket, fill in _record appropriately.
 void setArrayMeasurement(java.lang.String name, int index, int value)
          Set integer array values of specified measurement.
protected  void setAttributes(java.lang.String name, java.lang.String description, java.lang.String units, java.lang.String dataType)
          Set basic measurement attribute strings.
 void setMeasurement(java.lang.String name, int value)
          Set integer value of specified measurement.
protected  void setRecordTimestamp(long timestamp)
          Set the timestamp on the record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_record

protected SiamRecord _record
Constructor Detail

DevicePacketParser

public DevicePacketParser()
Method Detail

parse

public final SiamRecord parse(DevicePacket packet)
                       throws NotSupportedException,
                              java.lang.Exception
Parse DevicePacket, return Record containing Measurements.

Throws:
NotSupportedException
java.lang.Exception

parseFields

protected abstract void parseFields(DevicePacket packet)
                             throws NotSupportedException,
                                    java.lang.Exception
Parse raw data from DevicePacket, fill in _record appropriately.

Throws:
NotSupportedException
java.lang.Exception

addMeasurement

protected void addMeasurement(java.lang.String name,
                              java.lang.String description,
                              java.lang.String units,
                              int value)
Add an integer-valued Measurement to this object's Record, and specify the initial integer value.


addMeasurement

protected void addMeasurement(java.lang.String name,
                              java.lang.String description,
                              java.lang.String units,
                              java.lang.Number value)
Add a Number-valued Measurement to this object's Record

Parameters:
name - The name of the measurement
description - Descriptive info about the measurement
units - The measurment units
value - The value of the measurement

setMeasurement

public void setMeasurement(java.lang.String name,
                           int value)
                    throws java.lang.Exception
Set integer value of specified measurement. Throws exception if specified measurement does not have integer value.

Throws:
java.lang.Exception

addArrayMeasurement

protected void addArrayMeasurement(java.lang.String name,
                                   java.lang.String description,
                                   java.lang.String units,
                                   int[] values)
Add a Measurement which contains an array of integer values to this DevicePacketParser's Record.


addArrayMeasurement

protected void addArrayMeasurement(java.lang.String name,
                                   java.lang.String description,
                                   java.lang.String units,
                                   float[] values)
Add a Measurement which contains an array of float values to this DevicePacketParser's Record.


addArrayMeasurement

protected void addArrayMeasurement(java.lang.String name,
                                   java.lang.String description,
                                   java.lang.String units,
                                   double[] values)
Add a Measurement which contains an array of float values to this DevicePacketParser's Record.


setArrayMeasurement

public void setArrayMeasurement(java.lang.String name,
                                int index,
                                int value)
                         throws java.lang.Exception
Set integer array values of specified measurement. Throws exception if specified measurement is not an integer array.

Throws:
java.lang.Exception

setRecordTimestamp

protected void setRecordTimestamp(long timestamp)
Set the timestamp on the record.


setAttributes

protected final void setAttributes(java.lang.String name,
                                   java.lang.String description,
                                   java.lang.String units,
                                   java.lang.String dataType)
Set basic measurement attribute strings.



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.