Package edu.nps.moves.dis7
Class FirePdu
java.lang.Object
edu.nps.moves.dis7.Pdu
edu.nps.moves.dis7.PduBase
edu.nps.moves.dis7.WarfareFamilyPdu
edu.nps.moves.dis7.FirePdu
- All Implemented Interfaces:
edu.nps.moves.dis7.Marshaller
,java.io.Serializable
public class FirePdu extends WarfareFamilyPdu implements java.io.Serializable
7.3.2 Used to communicate the firing of a weapon or expendable.
IEEE Std 1278.1-2012, IEEE Standard for Distributed Interactive Simulation—Application Protocols
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description protected MunitionDescriptor
descriptor
This field shall describe the firing or launch of a munition or expendable represented by one of the following types of Descriptor records: Munition Descriptor (6.2.20.2) or Expendable Descriptor (6.2.20.4).protected EventIdentifier
eventID
This field shall contain an identification generated by the firing entity to associate related firing and detonation events.protected int
fireMissionIndex
This field shall identify the fire mission (see 5.4.3.3).protected EntityID
firingEntityID
ID of the entity that shotprotected Vector3Double
locationInWorldCoordinates
This field shall specify the location, in world coordinates, from which the munition was launched, and shall be represented by a World Coordinates record (see 6.2.97).protected EntityID
munitionExpendibleID
This field shall specify the entity identification of the fired munition or expendable.protected float
range
This field shall specify the range that an entity's fire control system has assumed in computing the fire control solution.protected EntityID
targetEntityID
ID of the entity that is being shot atprotected Vector3Float
velocity
This field shall specify the velocity of the fired munition at the point when the issuing simulation application intends the externally visible effects of the launch (e.g.Fields inherited from class edu.nps.moves.dis7.Pdu
exerciseID, length, pduType, protocolFamily, protocolVersion, timestamp
-
Constructor Summary
Constructors Constructor Description FirePdu()
Constructor -
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object obj)
boolean
equalsImpl(java.lang.Object obj)
Compare all fields that contribute to the state, ignoring transient and static fields, forthis
and the supplied objectMunitionDescriptor
getDescriptor()
Getter fordescriptor
EventIdentifier
getEventID()
Getter foreventID
int
getFireMissionIndex()
Getter forfireMissionIndex
EntityID
getFiringEntityID()
Getter forfiringEntityID
Vector3Double
getLocationInWorldCoordinates()
Getter forlocationInWorldCoordinates
int
getMarshalledSize()
Returns the size of this serialized object in bytesEntityID
getMunitionExpendibleID()
Getter formunitionExpendibleID
float
getRange()
Getter forrange
EntityID
getTargetEntityID()
Getter fortargetEntityID
Vector3Float
getVelocity()
Getter forvelocity
void
marshal(java.io.DataOutputStream dos)
Serializes an object to a DataOutputStream.void
marshal(java.nio.ByteBuffer buff)
Packs an object into the ByteBuffer.FirePdu
setDescriptor(MunitionDescriptor pDescriptor)
Setter fordescriptor
FirePdu
setEventID(EventIdentifier pEventID)
Setter foreventID
FirePdu
setFireMissionIndex(int pFireMissionIndex)
Setter forfireMissionIndex
FirePdu
setFiringEntityID(EntityID pFiringEntityID)
Setter forfiringEntityID
FirePdu
setLocationInWorldCoordinates(Vector3Double pLocationInWorldCoordinates)
Setter forlocationInWorldCoordinates
FirePdu
setMunitionExpendibleID(EntityID pMunitionExpendibleID)
Setter formunitionExpendibleID
FirePdu
setRange(float pRange)
Setter forrange
FirePdu
setTargetEntityID(EntityID pTargetEntityID)
Setter fortargetEntityID
FirePdu
setVelocity(Vector3Float pVelocity)
Setter forvelocity
java.lang.String
toString()
int
unmarshal(java.io.DataInputStream dis)
Unserializes an object from a DataInputStream.int
unmarshal(java.nio.ByteBuffer buff)
Unpacks a Pdu from the underlying data.Methods inherited from class edu.nps.moves.dis7.PduBase
getPadding, getPduStatus, setPadding, setPduStatus
Methods inherited from class edu.nps.moves.dis7.Pdu
getExerciseID, getLength, getPduType, getProtocolFamily, getProtocolVersion, getTimestamp, marshal, setExerciseID, setLength, setPduType, setProtocolFamily, setProtocolVersion, setTimestamp
-
Field Details
-
firingEntityID
ID of the entity that shot -
targetEntityID
ID of the entity that is being shot at -
munitionExpendibleID
This field shall specify the entity identification of the fired munition or expendable. This field shall be represented by an Entity Identifier record (see 6.2.28). -
eventID
This field shall contain an identification generated by the firing entity to associate related firing and detonation events. This field shall be represented by an Event Identifier record (see 6.2.34). -
fireMissionIndex
protected int fireMissionIndexThis field shall identify the fire mission (see 5.4.3.3). This field shall be represented by a 32-bit unsigned integer. -
locationInWorldCoordinates
This field shall specify the location, in world coordinates, from which the munition was launched, and shall be represented by a World Coordinates record (see 6.2.97). -
descriptor
This field shall describe the firing or launch of a munition or expendable represented by one of the following types of Descriptor records: Munition Descriptor (6.2.20.2) or Expendable Descriptor (6.2.20.4). -
velocity
This field shall specify the velocity of the fired munition at the point when the issuing simulation application intends the externally visible effects of the launch (e.g. exhaust plume or muzzle blast) to first become apparent. The velocity shall be represented in world coordinates. This field shall be represented by a Linear Velocity Vector record [see 6.2.95 item c)]. -
range
protected float rangeThis field shall specify the range that an entity's fire control system has assumed in computing the fire control solution. This field shall be represented by a 32-bit floating point number in meters. For systems where range is unknown or unavailable, this field shall contain a value of zero.
-
-
Constructor Details
-
FirePdu
public FirePdu()Constructor
-
-
Method Details
-
getMarshalledSize
public int getMarshalledSize()Returns the size of this serialized object in bytes- Specified by:
getMarshalledSize
in interfaceedu.nps.moves.dis7.Marshaller
- Overrides:
getMarshalledSize
in classWarfareFamilyPdu
-
setFiringEntityID
Setter forfiringEntityID
-
getFiringEntityID
Getter forfiringEntityID
-
setTargetEntityID
Setter fortargetEntityID
-
getTargetEntityID
Getter fortargetEntityID
-
setMunitionExpendibleID
Setter formunitionExpendibleID
-
getMunitionExpendibleID
Getter formunitionExpendibleID
-
setEventID
Setter foreventID
-
getEventID
Getter foreventID
-
setFireMissionIndex
Setter forfireMissionIndex
-
getFireMissionIndex
public int getFireMissionIndex()Getter forfireMissionIndex
-
setLocationInWorldCoordinates
Setter forlocationInWorldCoordinates
-
getLocationInWorldCoordinates
Getter forlocationInWorldCoordinates
-
setDescriptor
Setter fordescriptor
-
getDescriptor
Getter fordescriptor
-
setVelocity
Setter forvelocity
-
getVelocity
Getter forvelocity
-
setRange
Setter forrange
-
getRange
public float getRange()Getter forrange
-
marshal
public void marshal(java.io.DataOutputStream dos) throws java.lang.ExceptionSerializes an object to a DataOutputStream.- Specified by:
marshal
in interfaceedu.nps.moves.dis7.Marshaller
- Overrides:
marshal
in classWarfareFamilyPdu
- Parameters:
dos
- the OutputStream- Throws:
java.lang.Exception
- if something goes wrong- See Also:
DataOutputStream
-
unmarshal
public int unmarshal(java.io.DataInputStream dis) throws java.lang.ExceptionUnserializes an object from a DataInputStream.- Specified by:
unmarshal
in interfaceedu.nps.moves.dis7.Marshaller
- Overrides:
unmarshal
in classWarfareFamilyPdu
- Parameters:
dis
- the InputStream- Returns:
- unmarshalled size
- Throws:
java.lang.Exception
- if something goes wrong- See Also:
DataInputStream
-
marshal
public void marshal(java.nio.ByteBuffer buff) throws java.lang.ExceptionPacks an object into the ByteBuffer.- Specified by:
marshal
in interfaceedu.nps.moves.dis7.Marshaller
- Overrides:
marshal
in classWarfareFamilyPdu
- Parameters:
buff
- The ByteBuffer at the position to begin writing- Throws:
java.nio.BufferOverflowException
- if buff is too smalljava.nio.ReadOnlyBufferException
- if buff is read onlyjava.lang.Exception
- ByteBuffer-generated exception- See Also:
ByteBuffer
-
unmarshal
public int unmarshal(java.nio.ByteBuffer buff) throws java.lang.ExceptionUnpacks a Pdu from the underlying data.- Specified by:
unmarshal
in interfaceedu.nps.moves.dis7.Marshaller
- Overrides:
unmarshal
in classWarfareFamilyPdu
- Parameters:
buff
- The ByteBuffer at the position to begin reading- Returns:
- marshalled size
- Throws:
java.nio.BufferUnderflowException
- if buff is too smalljava.lang.Exception
- ByteBuffer-generated exception- See Also:
ByteBuffer
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classWarfareFamilyPdu
-
equalsImpl
public boolean equalsImpl(java.lang.Object obj)Description copied from class:Pdu
Compare all fields that contribute to the state, ignoring transient and static fields, forthis
and the supplied object- Overrides:
equalsImpl
in classWarfareFamilyPdu
- Parameters:
obj
- the object to compare to- Returns:
- true if the objects are equal, false otherwise.
-
toString
public java.lang.String toString()- Overrides:
toString
in classWarfareFamilyPdu
-