mil.navy.nps.dis
Class ReceiverPdu

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

public class ReceiverPdu
extends RadioCommunicationsFamily

Receiver PDU for DIS .

Version:
1.0
Author:
David W. Laflam (http://www.web3d.org/WorkingGroups/vrtp/dis-java-vrml/)
, Don Brutzman (http://web.nps.navy.mil/~brutzman)
Location:
Web: http://www.web3d.org/WorkingGroups/vrtp/mil/navy/nps/dis/ReceiverPdu.java
or locally: ~/mil/navy/nps/dis/ReceiverPdu.java
Hierarchy Diagram:
Summary:
The receiving radio this is the the incomming traffic .
Explanation:
The ReceiverPdu denotes the reciving of a transmission from a radio. It inherits the header information from ProtocolDataUnit, an abstract class that contains assorted protocol information. It implements the IDs of what's transmitting a signal.

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:
15May2000 /Dave Laflam /New
17DAug00 /Dave Laflam /Added toString method
References:
DIS Data Dictionary: Receiver PDU (local) and Receiver PDU (SISO)
DIS-Java-VRML Working Group: http://www.web3d.org/WorkingGroups/vrtp/dis-java-vrml/
DIS specification : IEEE 1278.1-1995, Section 5.3.8.3
Note:
No accessor methods to nested records is provided. (NOTE: the ProtocolDataUnit will keep all the header information)
See Also:
EntityID, PduElement, ProtocolDataUnit, RadioCommunicationsFamily, RadioCommunicationsPduScriptNode, SerializationInterface, SignalPdu, TransmitterPdu

Field Summary
protected  EntityID entityID
          entityID: Entity Identification - This field shall identify the entity that is controlling the radio transmission.
protected  UnsignedShort padding
          Padding: is never set or read but they are serialized and de-serialized.
protected  UnsignedShort radioID
          Radio Identification - This field shall identify a particular radio within a given entity.
protected  float receiverPower
          Received Power.
protected  UnsignedShort receiverState
          Receiver State.
static int sizeOf
          Constant value--size of ReceiverPDU with header.
protected  EntityID transmitterEntityID
          Transmitter Entity ID.
protected  UnsignedShort transmitterRadioID
          Transmitter Radio ID.
 
Fields inherited from class mil.navy.nps.dis.ProtocolDataUnit
DEBUG, exerciseID, pduType, protocolFamily, protocolVersion, timeReceived, timestamp
 
Constructor Summary
ReceiverPdu()
          Default constructor - creates entityID, radioID, receiverState, padding, reciverPower, transmitterEntityID, and transmitterRadioID - fills with zeros for all values of the following parameters: padding
 
Method Summary
 java.lang.Object clone()
          Make a copy of the object.
 void deSerialize(java.io.DataInputStream inputStream)
          Deserialize the input stream, and order is important here, since we need to read in the same order as specified by the DIS standard
 EntityID getEntityID()
          Gets reciver entity ID.
 UnsignedShort getRadioID()
          Gets Radio entity ID.
 float getReceiverPower()
          Gets the getReceiverPower
 UnsignedShort getReceiverState()
          Gets the ReceiverStateID.
 EntityID getTransmitterEntityID()
          Gets the Transmitter EntityID.
 UnsignedShort getTransmitterRadioID()
          Gets the TransmitterRadioID
 int length()
          Returns the length of the entity
 java.lang.String pduName()
          Returns the PDU name - Receiver PDU
 void printValues(int indentLevel, java.io.PrintStream printStream)
          Print the values of the following object out, with correct level of indentation on the page.
 void serialize(java.io.DataOutputStream outputStream)
          Serialize and write out the output stream, order is important here since it needs to conform to the DIS standard
 void setEntityID(EntityID pEntityID)
          Sets reciver entity ID Each Entity in a given exercise executing on a DIS application shall be assigned an Entity Identifier Record Unique to the exercise.
 void setEntityID(short pSiteID, short pApplicationID, short pEntityID)
          Sets setEntityID(short pSiteID, short pApplicationID, short pEntityID),accessor method.
 void setRadioID(UnsignedShort pRadioID)
          Sets Radio entity ID.
 void setReceiverPower(float pReceiverPower)
          Sets the ReceiverPower
 void setReceiverState(UnsignedShort pReceiverState)
          Sets the ReceiverState ID
 void setTransmitterEntityID(EntityID pEntityID)
          Sets the Transmitter EntityID.
 void setTransmitterRadioID(UnsignedShort pTransmitterRadioID)
          Sets the TransmitterRadioID
 java.lang.String toString()
          String toString Used for debuging System.out.println("Receiver Object.
 
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, trace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

entityID

protected EntityID entityID
entityID: Entity Identification - This field shall identify the entity that is controlling the radio transmission. The source entity may either represent the radio itself or represent an entity (such as a vehicle) that contains the radio. This field shall be represented by an Entity Identifier record (see 5.2.14).
Reference:
DIS Data Dictionary: Event Identifier (local) and Event Identifier Record


radioID

protected UnsignedShort radioID
Radio Identification - This field shall identify a particular radio within a given entity. Radio IDs shall be assigned sequentially to the radios within an entity, starting with Radio ID 1. The combination of Entity ID and Radio ID uniquely identifies a radio within a simulation exercise. The Radio ID field shall be represented by a 16-bit unsigned integer.
Value:
If the intended target is unknown, this field shall contain TARGET_ID_ UNKNOWN.
Reference:
DIS Data Dictionary: Event Identifier Record (local) and Event Identifier Record


receiverState

protected UnsignedShort receiverState
Receiver State. This field shall indicate the state of the receiver, which shall either be idle or active, and shall be represented by a 16-bit enumeration (see Section 9 of EBV-DOC).
Value:
Reference:
DIS Data Dictionary: Event Identifier Record (local) and Event Identifier Record


padding

protected UnsignedShort padding
Padding: is never set or read but they are serialized and de-serialized. The values are initially set to zero and then they are passed back and forth to insure the proper placement of the bits and in the fields.
Reference:
DIS Data Dictionary: Event Identifier Record (local) and Event Identifier Record


receiverPower

protected float receiverPower
Received Power. This field shall indicate the radio frequency power received, after applying any propagation loss and antenna gain, and shall be represented by a 32-bit foating point number in units of decibel milliwatts.
Value:
This field shall be represented by a 32-bit unsigned integer
Reference:
DIS Data Dictionary: ????? Index Field (local) and Index Field


transmitterEntityID

protected EntityID transmitterEntityID
Transmitter Entity ID. This Želd shall identify the entity that is the source of the transmission that is currently being received. The selection of the received transmitter depends on the characteristics and state of the simulated receiver. This Želd shall be represented by an Entity IdentiŽer record (see5.2.14).
Value:
This field shall contain the following: a. Site - 16 bit unsigned integer b. Application - 16 bit unsigned integer c. Entity - 16 bit unsigned integer (note short 16 bit and ints are 32 bit)
Reference:
DIS Data Dictionary: receiverPower Record (local) and World Coordinate Record


transmitterRadioID

protected UnsignedShort transmitterRadioID
Transmitter Radio ID. This field shall identify the particular radio within the entity cited in item f)that is the source of the radio transmission(Who the message is from). The Transmitter Radio ID shall be represented by a 16-bit unsigned integer. (note short 16 bit and ints are 32 bit)
Reference:
DIS Data Dictionary: Burst Descriptor Record (local) and Burst Descriptor Record


sizeOf

public static final int sizeOf
Constant value--size of ReceiverPDU with header. Here: sizeOf = 288 bytes

See Also:
Constant Field Values
Constructor Detail

ReceiverPdu

public ReceiverPdu()
Default constructor - creates entityID, radioID, receiverState, padding, reciverPower, transmitterEntityID, and transmitterRadioID - fills with zeros for all values of the following parameters: padding

Method Detail

clone

public java.lang.Object 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 RadioCommunicationsFamily
Returns:
a new Receiver PDU entity

serialize

public void serialize(java.io.DataOutputStream outputStream)
Serialize and write out the output stream, order is important here since it needs to conform to the DIS standard

Specified by:
serialize in interface SerializationInterface
Overrides:
serialize in class RadioCommunicationsFamily
Throws:
java.lang.RuntimeException - when IO error occurs.

deSerialize

public void deSerialize(java.io.DataInputStream inputStream)
Deserialize the input stream, and order is important here, since we need to read in the same order as specified by the DIS standard

Specified by:
deSerialize in interface SerializationInterface
Overrides:
deSerialize in class RadioCommunicationsFamily
Throws:
java.lang.RuntimeException - when IO error occurs.

length

public int length()
Returns the length of the entity

Overrides:
length in class RadioCommunicationsFamily
Returns:
an integer length of the entity

pduName

public java.lang.String pduName()
Returns the PDU name - Receiver PDU

Overrides:
pduName in class RadioCommunicationsFamily
Returns:
a string "Receiver PDU"

printValues

public void printValues(int indentLevel,
                        java.io.PrintStream printStream)
Print the values of the following object out, with correct level of indentation on the page. radioID,receiverState , receiverPower, entityID, transmitterRadioID.

Overrides:
printValues in class RadioCommunicationsFamily

getEntityID

public EntityID getEntityID()
Gets reciver entity ID. Each Entity in a given exercise executing on a DIS application shall be assigned an Entity Identifier Record Unique to the exercise.

Overrides:
getEntityID in class RadioCommunicationsFamily
Returns:
a clone of the reciver entity ID

setEntityID

public void setEntityID(EntityID pEntityID)
Sets reciver entity ID Each Entity in a given exercise executing on a DIS application shall be assigned an Entity Identifier Record Unique to the exercise.

Overrides:
setEntityID in class RadioCommunicationsFamily
Parameters:
pEntityID - the reciver entity ID

setEntityID

public void setEntityID(short pSiteID,
                        short pApplicationID,
                        short pEntityID)
Sets setEntityID(short pSiteID, short pApplicationID, short pEntityID),accessor method. will create an new EntityID = entityID This field shall identify the entity issuing the PDU, and shall be represented by the PDU Header Record (see 5.2.24)


getRadioID

public UnsignedShort getRadioID()
Gets Radio entity ID. Each Entity in a given exercise executing on a DIS application shall be assigned an Entity Identifier Record Unique to the exercise.

Overrides:
getRadioID in class RadioCommunicationsFamily
Returns:
a clone of the Radio entity ID

setRadioID

public void setRadioID(UnsignedShort pRadioID)
Sets Radio entity ID. Each Entity in a given exercise executing on a DIS application shall be assigned an Entity Identifier Record Unique to the exercise.

Overrides:
setRadioID in class RadioCommunicationsFamily
Parameters:
pRadioID - target entity ID value

getReceiverState

public UnsignedShort getReceiverState()
Gets the ReceiverStateID. Each Entity in a given exercise executing on a DIS application shall be assigned an Entity Identifier Record Unique to the exercise.

Returns:
a clone of a ReceiverStateID

setReceiverState

public void setReceiverState(UnsignedShort pReceiverState)
Sets the ReceiverState ID

Parameters:
pReceiverState - a ReceiverState ID

getReceiverPower

public float getReceiverPower()
Gets the getReceiverPower


setReceiverPower

public void setReceiverPower(float pReceiverPower)
Sets the ReceiverPower

Parameters:
pReceiverPower - a ReceiverPower

getTransmitterEntityID

public EntityID getTransmitterEntityID()
Gets the Transmitter EntityID. The EntityID shall identify the entity that is the source of the transmission that is currently being received. The selection of the received transmitter depends on the characteristics and state of the simulated receiver. This field shall be identified by an Entity Identifier record (EntityID) (see paragraph 5.2.14).

Returns:
a clone of an EntityID

setTransmitterEntityID

public void setTransmitterEntityID(EntityID pEntityID)
Sets the Transmitter EntityID. The EntityID shall identify the entity that is the source of the transmission that is currently being received. The selection of the received transmitter depends on the characteristics and state of the simulated receiver. This field shall be identified by an Entity Identifier record (EntityID) (see paragraph 5.2.14).

Parameters:
pEntityID - entityID value

getTransmitterRadioID

public UnsignedShort getTransmitterRadioID()
Gets the TransmitterRadioID

Returns:
a clone an unsigned short value of TransmitterRadioID

setTransmitterRadioID

public void setTransmitterRadioID(UnsignedShort pTransmitterRadioID)
Sets the TransmitterRadioID

Parameters:
pTransmitterRadioID - an unsigned short value for TransmitterRadioID

toString

public java.lang.String toString()
String toString Used for debuging System.out.println("Receiver Object. = " + receiver); This print out all values for the fields for the NEW Receiver object

Overrides:
toString in class ProtocolDataUnit