AIS
Class AISDataUnit

java.lang.Object
  extended by PamguardMVC.PamDataUnit
      extended by AIS.AISDataUnit
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<PamDataUnit>

public class AISDataUnit
extends PamDataUnit
implements java.io.Serializable, java.lang.Cloneable

See Also:
Serialized Form

Field Summary
protected  java.lang.String aisChannel
          When provided, the AIS channel is indicated as either "1" or "2." This channel indication is relative to the operating conditions of the transponder when the packet is received.
(package private)  AISLocalisation aisLocalisation
           
(package private)  NMEABitArray bitData
           
protected  java.lang.String charData
          Contents of the M.1371 radio message using the six-bit field type
protected  java.lang.String dataType
          AIVDM, etc.
protected  int fillBits
          Number of "fill-bits" added to complete the last six-bit character
protected  boolean isInRange
          Flag used when a limit is placed on range.
protected  int messageID
          Pulled out from the start of the AIVDM string.
private static int MINIMUMBITS
           
 int mmsiNumber
           
protected  boolean newUnit
           
private static int POSITIONREPORTBITS
           
private  java.util.ArrayList<AISPositionReport> positionReports
           
protected  int sentenceNumber
          Message sentence number
protected  int sequentialIdentifier
          The "message sequential identifier" is a number from 0 to 9 that is sequentially assigned as needed.
(package private) static long serialVersionUID
           
private  AISStaticData staticData
           
private static int STATICDATABITS
           
protected  int totalSentences
          Total number of sentences needed to transfer the message
 
Fields inherited from class PamguardMVC.PamDataUnit
absBlockIndex, channelBitmap, localisation, oLL, timeMilliseconds
 
Constructor Summary
AISDataUnit(long timeMilliseconds)
          Constructor used in data collection - doesn't do much
AISDataUnit(long timeMillis, java.lang.String charData, int fillBits)
          Constructor used when reading back from binary files.
 
Method Summary
 void addPositionReport(AISPositionReport positionReport)
           
protected  AISDataUnit clone()
           
 boolean decodeMessage()
          Decode the binary data which are currently in a character string
 AISPositionReport findPositionReport(long timeMillis)
           
 AISPositionReport getPositionReport()
           
 java.util.ArrayList<AISPositionReport> getPositionReports()
           
 AISStaticData getStaticData()
           
 boolean isComplete()
           
 void setStaticData(AISStaticData staticData)
           
 void update(AISDataUnit newAISUnit)
          Update an existing AIS data unit with new data.
 
Methods inherited from class PamguardMVC.PamDataUnit
clearUpdateCount, compareTo, getAbsBlockIndex, getChannelBitmap, getDatabaseIndex, getDatabaseUpdateOf, getDataUnitFileInformation, getGpsPosition, getLastUpdateTime, getLocalisation, getOriginLatLong, getPairAngle, getParentDataBlock, getTimeMilliseconds, getUpdateCount, setAbsBlockIndex, setChannelBitmap, setDatabaseIndex, setDatabaseUpdateOf, setDataUnitFileInformation, setLastUpdateTime, setLocalisation, setOriginLatLong, setParentDataBlock, setTimeMilliseconds, updateDataUnit
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

aisLocalisation

AISLocalisation aisLocalisation

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

isInRange

protected boolean isInRange
Flag used when a limit is placed on range. If it's clearly out of range, then this flag is set and no more updates are made from static data.

the flag can be set false again if new position data come within range.


newUnit

protected boolean newUnit

dataType

protected java.lang.String dataType
AIVDM, etc.


messageID

protected int messageID
Pulled out from the start of the AIVDM string.


totalSentences

protected int totalSentences
Total number of sentences needed to transfer the message


sentenceNumber

protected int sentenceNumber
Message sentence number


sequentialIdentifier

protected int sequentialIdentifier
The "message sequential identifier" is a number from 0 to 9 that is sequentially assigned as needed. This identifier is incremented for each new multi-sentence message. The count resets to 0, after 9 is used. For radio broadcast messages requiring multiple sentences, each sentence of the message contains the same sequential identification number. The purpose of this number is to link the separate sentences containing portions of the same radio message. This allows for the possibility that other sentences might be interleaved with the message sentences that contain the complete message contents. This number also links an ABK-sentence acknowledgement to the appropriate BBM-sentence.


aisChannel

protected java.lang.String aisChannel
When provided, the AIS channel is indicated as either "1" or "2." This channel indication is relative to the operating conditions of the transponder when the packet is received. This field shall be null when the channel identification is not provided.


charData

protected java.lang.String charData
Contents of the M.1371 radio message using the six-bit field type

The maximum string length of encapsulation is limited such that the total number of sentence characters does not exceed 82. This field supports a maximum of 62 valid characters for messages transferred using multiple sentences, and 63 valid characters for messages using a single sentence.


fillBits

protected int fillBits
Number of "fill-bits" added to complete the last six-bit character

Each character in the preceding six-bit coded character string represents six binary bits. This parameter indicates the number of bits that were added to the end of the binary packet as a result of creating the last character of the string. When the coding of the last six-bit character of the message packet does not create additional "fill-bits," this value shall be set to zero. The value "0" indicates that no "fill-bits" were added. This field may not be null.


mmsiNumber

public int mmsiNumber

positionReports

private java.util.ArrayList<AISPositionReport> positionReports

staticData

private AISStaticData staticData

bitData

transient NMEABitArray bitData

MINIMUMBITS

private static final int MINIMUMBITS
See Also:
Constant Field Values

POSITIONREPORTBITS

private static final int POSITIONREPORTBITS
See Also:
Constant Field Values

STATICDATABITS

private static final int STATICDATABITS
See Also:
Constant Field Values
Constructor Detail

AISDataUnit

public AISDataUnit(long timeMilliseconds)
Constructor used in data collection - doesn't do much


AISDataUnit

public AISDataUnit(long timeMillis,
                   java.lang.String charData,
                   int fillBits)
Constructor used when reading back from binary files.

Parameters:
timeMillis - time millis
charData - 6 bit character data string
fillBits - fill bits to ignore at end of string
Method Detail

decodeMessage

public boolean decodeMessage()
Decode the binary data which are currently in a character string

Returns:
true if the message was decoded successfully

isComplete

public boolean isComplete()

update

public void update(AISDataUnit newAISUnit)
Update an existing AIS data unit with new data.

Parameters:
newAISUnit -

clone

protected AISDataUnit clone()
Overrides:
clone in class java.lang.Object

getPositionReport

public AISPositionReport getPositionReport()

findPositionReport

public AISPositionReport findPositionReport(long timeMillis)

getStaticData

public AISStaticData getStaticData()

getPositionReports

public java.util.ArrayList<AISPositionReport> getPositionReports()

addPositionReport

public void addPositionReport(AISPositionReport positionReport)

setStaticData

public void setStaticData(AISStaticData staticData)