mil.navy.nps.dis
Class DetonationPdu

java.lang.Object
  extended bymil.navy.nps.dis.PduElement
      extended bymil.navy.nps.dis.ProtocolDataUnit
          extended bymil.navy.nps.dis.DetonationPdu
All Implemented Interfaces:
java.lang.Cloneable, SerializationInterface

public class DetonationPdu
extends ProtocolDataUnit

Detonation or impact.

Version:
1.0
Author:
Don McGregor (http://www.npsnet.org/~mcgredo )
Location:
Web: http://www.web3d.org/WorkingGroups/vrtp/mil/navy/nps/dis/ DetonationPdu.
or locally: ~/mil/navy/nps/dis/DetonationPdu.java
Hierarchy Diagram:
Summary:
The detonation or impact of munitions shall be communicated by issuing a Detonation PDU.
Explanation:
The detonation Pdu denotes the detonation of a weapon. It inherits the header information from ProtocolDataUnit, an abstract class that contains assorted protocol information. It implements the IDs of what's firing, what's being shot at, the munition, the event, and where the munition is headed. As with other PDUs, it knows how to serialize and deserialize itself from the wire. It also knows how to clone itself, and knows how to calculate its size when sent to the wire.
History:
16Dec96 /Don McGregor /New
10Mar97 /Don McGregor /Cleaned up for javadoc
16Apr97 /Don McGregor /PrintStream passed to printValues
8Dec97 /Ronan Fauglas /changes for documentation templates + complements in documentation
11Dec97 /Ronan Fauglas /changed access methods: thisVariable() --> getThisVariable()
23Nov99 /Thomas Miller /General cleanup and javadocs
References:
DIS Data Dictionary :Detonation PDU
DIS-Java-VRML Working Group: http://www.web3d.org/ WorkingGroups/vrtp/dis-java-vrml/
DIS specification : IEEE 1278.1, Section 4.4.3.3, 5.4.4.2
See Also:
ProtocolDataUnit, PduElement, SerializationInterface, FirePdu

Field Summary
protected  java.util.Vector articulationParameters
          List of articulation parameters.
protected  BurstDescriptor burstDescription
          Burst Descriptor - This field shall describe the type of munition impacting or detonating, the warhead, the fuse, the quantity, and the rate
protected  UnsignedByte detonationResult
          Detonation Result - This field shall specify the result of the detonation.
protected  EventID eventID
          Event Identification - This field shall contain the same data as in the Event Identification field of the Fire PDU that communicated the launch of the munition.
protected  EntityID firingEntityID
          Firing Entity Identification - This field shall identify the firing entity Value: If the detonation is not preceded by a Fire PDU then the Firing Entity Identification shall be NO SPECIFIC ENTITY.
protected  EntityCoordinate locationInEntityCoordinates
          Location in Entity's coordinates - This field shall specify the location of the detonation or impact in the target entity's coordinate system.
protected  WorldCoordinate locationInWorldCoordinate
          Location in World Coordinate - This field shall specify the location of the detonation in world coordinates (x, y, z coordinates ).
protected  EntityID munitionID
          Munition Identification - This field shall specify the entity ID of the fired munition if tracking data is required.
static int sizeOf
          Constant value--size of an Detonation PDU with header, without the articulation parameters.
protected  EntityID targetEntityID
          Target Entity Identification - This field shall identify the target entity Value: If the target ID is unknown, this field shall contain the value TARGET ID UNKNOWN.
protected  LinearVelocity velocity
          Velocity - This field shall specify the velocity of the munition immediately before detonation/impact.
 
Fields inherited from class mil.navy.nps.dis.ProtocolDataUnit
DEBUG, exerciseID, pduType, protocolFamily, protocolVersion, timeReceived, timestamp
 
Constructor Summary
DetonationPdu()
          Default constructor--fills with zeros for all values.
 
Method Summary
 void addArticulationParameter(ArticulationParameter pParameter)
          Inserts a Articulation Parameter at the end of the list and increment the parameter count accordingly.
 java.lang.Object clone()
          clone - make a copy of the object.
 void deSerialize(java.io.DataInputStream inputStream)
          deserialize - reads the detonation PDU to the wire in DIS format
 ArticulationParameter getArticulationParameterAt(int pIdx)
          Returns the Articulation Parameter at the index given in parameter.
 BurstDescriptor getBurstDescription()
           
 UnsignedByte getDetonationResult()
           
 EventID getEventID()
           
 EntityID getFiringEntityID()
           
 EntityCoordinate getLocationInEntityCoordinates()
           
 WorldCoordinate getLocationInWorldCoordinate()
           
 EntityID getMunitionID()
           
 EntityID getTargetEntityID()
           
 LinearVelocity getVelocity()
           
 int length()
          length returns basic size + size of list of parameters.
 java.lang.String pduName()
          pduName returns the type of PDU
 void printValues(int indentLevel, java.io.PrintStream printStream)
          printValues - print the values of the object out, with correct level of indentation on the page..
 void serialize(java.io.DataOutputStream outputStream)
          serialize - writes the detonation PDU to the wire in DIS format Order is important here, since it needs to conform to the DIS standard.
 void setBurstDescription(BurstDescriptor pBurstDescription)
           
 void setDetonationResult(int pDetonationResult)
           
 void setDetonationResult(UnsignedByte pDetonationResult)
           
 void setEventID(EventID pEventID)
           
 void setFiringEntityID(EntityID pFiringEntityID)
           
 void setLocationInEntityCoordinates(EntityCoordinate pLocationInEntityCoordinates)
           
 void setLocationInEntityCoordinates(float x, float y, float z)
           
 void setLocationInWorldCoordinate(double x, double y, double z)
           
 void setLocationInWorldCoordinate(WorldCoordinate pLocation)
           
 void setMunitionID(EntityID pMunitionID)
           
 void setTargetEntityID(EntityID pTargetEntityID)
           
 void setVelocity(float x, float y, float z)
           
 void setVelocity(LinearVelocity pVelocity)
           
 
Methods inherited from class mil.navy.nps.dis.ProtocolDataUnit
byteArrayToPdu, datagramToPdu, debug, getExerciseID, getPaddingOfLength, getPduType, getProtocolFamily, getProtocolVersion, getRtpHeaderEnabled, getTimeReceived, getTimestamp, getVRMLTimestamp, makeTimestampCurrent, setExerciseID, setExerciseID, setPduType, setPduType, setProtocolFamily, setProtocolFamily, setProtocolVersion, setProtocolVersion, setRtpHeaderEnabled, setSimulationStartTime, setTimeReceived, setTimestamp, setTimestamp, stampTimeReceived, toString, trace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

firingEntityID

protected EntityID firingEntityID
Firing Entity Identification - This field shall identify the firing entity
Value:
If the detonation is not preceded by a Fire PDU then the Firing Entity Identification shall be NO SPECIFIC ENTITY.


targetEntityID

protected EntityID targetEntityID
Target Entity Identification - This field shall identify the target entity
Value:
If the target ID is unknown, this field shall contain the value TARGET ID UNKNOWN.


munitionID

protected EntityID munitionID
Munition Identification - This field shall specify the entity ID of the fired munition if tracking data is required.
Value:
A munition ID shall have a value of MUNITION NOT TRACKED if tracking data for the munition is not required.


eventID

protected EventID eventID
Event Identification - This field shall contain the same data as in the Event Identification field of the Fire PDU that communicated the launch of the munition.
Value:
If the detonation is not preceded by a corresponding fire event, then the Event Number field of the Event Identifier record shall be zero (e.g., land mines detonation).


velocity

protected LinearVelocity velocity
Velocity - This field shall specify the velocity of the munition immediately before detonation/impact.


locationInWorldCoordinate

protected WorldCoordinate locationInWorldCoordinate
Location in World Coordinate - This field shall specify the location of the detonation in world coordinates (x, y, z coordinates ).


burstDescription

protected BurstDescriptor burstDescription
Burst Descriptor - This field shall describe the type of munition impacting or detonating, the warhead, the fuse, the quantity, and the rate


locationInEntityCoordinates

protected EntityCoordinate locationInEntityCoordinates
Location in Entity's coordinates - This field shall specify the location of the detonation or impact in the target entity's coordinate system. This information should be used for damage assessment.
Value:
If the ID of the target is unknown, this field shall contain NO LOCATION.


detonationResult

protected UnsignedByte detonationResult
Detonation Result - This field shall specify the result of the detonation.
Value:
Enumeration. See information below for more information
References:
DIS Data Dictionary: Force ID Field
See Section 5 in EBV-DOC


articulationParameters

protected java.util.Vector articulationParameters
List of articulation parameters.
References:
DIS Data Dictionary: Articulation Parameter Record
See Section 5 in EBV-DOC


sizeOf

public static final int sizeOf
Constant value--size of an Detonation PDU with header, without the articulation parameters. sizeOf = 104 bytes

See Also:
Constant Field Values
Constructor Detail

DetonationPdu

public DetonationPdu()
Default constructor--fills with zeros for all values.

Method Detail

clone

public java.lang.Object clone()
clone - make a copy of the object. This requires a deep copy, so we don't have two objects sharing pointers to the same data.

Overrides:
clone in class ProtocolDataUnit
Returns:
the cloned object

serialize

public void serialize(java.io.DataOutputStream outputStream)
serialize - writes the detonation PDU to the wire in DIS format Order is important here, since it needs to conform to the DIS standard.

Specified by:
serialize in interface SerializationInterface
Overrides:
serialize in class ProtocolDataUnit
Returns:
void

deSerialize

public void deSerialize(java.io.DataInputStream inputStream)
deserialize - reads the detonation PDU to the wire in DIS format

Specified by:
deSerialize in interface SerializationInterface
Overrides:
deSerialize in class ProtocolDataUnit
Returns:
void

length

public int length()
length returns basic size + size of list of parameters.

Overrides:
length in class ProtocolDataUnit
Returns:
int representing the length

pduName

public java.lang.String pduName()
pduName returns the type of PDU

Specified by:
pduName in class ProtocolDataUnit
Returns:
String

printValues

public void printValues(int indentLevel,
                        java.io.PrintStream printStream)
printValues - print the values of the object out, with correct level of indentation on the page..

Overrides:
printValues in class ProtocolDataUnit
Returns:
void

getArticulationParameterAt

public ArticulationParameter getArticulationParameterAt(int pIdx)
Returns the Articulation Parameter at the index given in parameter.

Returns:
the Articulation Parameter pointed by the index in parameter

addArticulationParameter

public void addArticulationParameter(ArticulationParameter pParameter)
Inserts a Articulation Parameter at the end of the list and increment the parameter count accordingly.

Parameters:
pParameter - the Articulation Parameter to be inserted in the list

getFiringEntityID

public EntityID getFiringEntityID()

setFiringEntityID

public void setFiringEntityID(EntityID pFiringEntityID)

getTargetEntityID

public EntityID getTargetEntityID()

setTargetEntityID

public void setTargetEntityID(EntityID pTargetEntityID)

getMunitionID

public EntityID getMunitionID()

setMunitionID

public void setMunitionID(EntityID pMunitionID)

getEventID

public EventID getEventID()

setEventID

public void setEventID(EventID pEventID)

getVelocity

public LinearVelocity getVelocity()

setVelocity

public void setVelocity(LinearVelocity pVelocity)

setVelocity

public void setVelocity(float x,
                        float y,
                        float z)

getLocationInWorldCoordinate

public WorldCoordinate getLocationInWorldCoordinate()

setLocationInWorldCoordinate

public void setLocationInWorldCoordinate(WorldCoordinate pLocation)

setLocationInWorldCoordinate

public void setLocationInWorldCoordinate(double x,
                                         double y,
                                         double z)

getBurstDescription

public BurstDescriptor getBurstDescription()

setBurstDescription

public void setBurstDescription(BurstDescriptor pBurstDescription)

getLocationInEntityCoordinates

public EntityCoordinate getLocationInEntityCoordinates()

setLocationInEntityCoordinates

public void setLocationInEntityCoordinates(EntityCoordinate pLocationInEntityCoordinates)

setLocationInEntityCoordinates

public void setLocationInEntityCoordinates(float x,
                                           float y,
                                           float z)

getDetonationResult

public UnsignedByte getDetonationResult()

setDetonationResult

public void setDetonationResult(UnsignedByte pDetonationResult)

setDetonationResult

public void setDetonationResult(int pDetonationResult)