Skip to content
Snippets Groups Projects
Commit 84a9258d authored by Schutt, Thomas (Capt)'s avatar Schutt, Thomas (Capt)
Browse files

Merge origin/master

parents ea38d9cc 6d0024d1
No related branches found
No related tags found
No related merge requests found
Showing
with 605 additions and 17 deletions
...@@ -25,3 +25,5 @@ ...@@ -25,3 +25,5 @@
/specifications/RPR*.xml /specifications/RPR*.xml
/specifications/SISO*.xml /specifications/SISO*.xml
/specifications/archive /specifications/archive
!/specifications/2019-SIW-Presentation-039_CompressedDis.pdf
!/specifications/IeeeDisPduColorFigures.pdf
\ No newline at end of file
package MV3500Cohort2019JulySeptember.homework4.McCann;
import java.net.*;
import java.io.*;
import edu.nps.moves.dis7.*;
import edu.nps.moves.dis7.enumerations.*;
import edu.nps.moves.dis7.util.*;
import java.util.ArrayList;
public class McCannPduReceiver
{
public static final int DEFAULT_MULTICAST_PORT = McCannPduSender.DEFAULT_MULTICAST_PORT;
public static final String DEFAULT_MULTICAST_ADDRESS = McCannPduSender.DEFAULT_MULTICAST_ADDRESS;
public static final boolean USE_FAST_ESPDU = false;
public static void main(String args[])
{
PduFactory factory;
MulticastSocket socket;
InetAddress address;
DatagramPacket packet;
try {
System.out.println("McCann.AllPduReceiver started...");
if (args.length == 2) {
socket = new MulticastSocket(Integer.parseInt(args[0]));
address = InetAddress.getByName(args[1]);
}
else {
System.out.println("Usage: AllPduReceiver <port> <multicast group>");
System.out.println("Default: AllPduReceiver " + DEFAULT_MULTICAST_PORT + " " + DEFAULT_MULTICAST_ADDRESS);
socket = new MulticastSocket(DEFAULT_MULTICAST_PORT);
address = InetAddress.getByName(DEFAULT_MULTICAST_ADDRESS);
}
socket.joinGroup(address);
factory = new PduFactory();
while (true) // Loop infinitely, receiving datagrams
{
byte buffer[] = new byte[1500]; // typical MTU size
packet = new DatagramPacket(buffer, buffer.length); // reset
socket.receive(packet);
Pdu pdu = factory.createPdu(packet.getData());
if (pdu != null)
{
DISPDUType currentPduType = pdu.getPduType(); //short currentPduType = pdu.getPduType();
String currentPduTypeName = pdu.getClass().getName();
DISProtocolFamily currentProtocolFamilyID = pdu.getProtocolFamily(); //short currentProtocolFamilyID = pdu.getProtocolFamily();
String currentPduFamilyName = pdu.getClass().getSuperclass().getSimpleName();
StringBuilder message = new StringBuilder();
message.append("received DIS PDU ");
if (currentPduType.getValue() < 10)
message.append(" "); // column spacing
message.append(currentPduType.getValue());
String currentPduTypePadded = String.format("%-34s", currentPduType); // - indicates right padding of whitespace
message.append(" " ).append(currentPduTypePadded);
String currentPduTypeNamePadded = String.format("%-49s", currentPduTypeName); // - indicates right padding of whitespace
message.append(" of type ").append(currentPduTypeNamePadded); // package.class name
message.append(" (protocolFamily ").append(currentProtocolFamilyID);
// message.append(" ").append(currentPduFamilyName); // class name is also available
message.append(")");
System.out.println(message.toString());
switch (currentPduType) // using enumeration values from edu.​nps.​moves.​dis7.​enumerations.​DISPDUType
{
case COMMENT:
CommentPdu commentPdu = (CommentPdu)pdu; // cast to precise type
ArrayList<VariableDatum> payloadList = (ArrayList)commentPdu.getVariableDatums();
for (VariableDatum variableDatum : payloadList)
{
String nextComment = new String(variableDatum.getVariableDatumValue()); // convert byte[] to String
System.out.println("\"" + nextComment + "\"");
}
}
}
else
System.out.println("received packet but pdu is null, packet.getData().length=" + packet.getData().length + ", error...");
}
}
catch (IOException e) {
System.out.println("Problem with DisExamplesOpenDis7.AllPduReceiver, see exception trace:");
System.out.println(e);
}
finally {
System.out.println("DisExamplesOpenDis7.AllPduReceiver complete.");
}
}
}
...@@ -11,6 +11,15 @@ ...@@ -11,6 +11,15 @@
<project name="Networked_Graphics_MV3500_examples" default="default" basedir="."> <project name="Networked_Graphics_MV3500_examples" default="default" basedir=".">
<description>Builds, tests, and runs the project Networked Graphics MV3500 examples.</description> <description>Builds, tests, and runs the project Networked Graphics MV3500 examples.</description>
<import file="nbproject/build-impl.xml"/> <import file="nbproject/build-impl.xml"/>
<target name="clean.pduLogAdditions">
<delete verbose="true">
<fileset dir="pduLog">
<include name="Pdusave*.dislog"/>
<exclude name="Pdusave.dislog"/><!-- version control default example -->
</fileset>
</delete>
</target>
<!-- <!--
There exist several targets which are by default empty and which can be There exist several targets which are by default empty and which can be
...@@ -71,11 +80,4 @@ ...@@ -71,11 +80,4 @@
nbproject/build-impl.xml file. nbproject/build-impl.xml file.
--> -->
<target name="view.gitlab.examples" description="view gitlab MV3500 examples in web browser (Netbeans only)">
<echo message="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/tree/master/examples"/>
<nbbrowse url="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/tree/master/examples"/>
<!-- TODO implementation-independent approach if possible. other Ant approachs have to be customized for each OS -->
</target>
</project> </project>
main.class=OpenDis7Examples.PduListenerSaver
main.class=OpenDis7Examples.PduReaderPlayer
File added
File added
File added
File added
...@@ -8,7 +8,19 @@ space exploration and medicine.* ...@@ -8,7 +8,19 @@ space exploration and medicine.*
* [Simulation Interoperabilty Standards Organization (SISO)](https://www.sisostds.org): "Simulation Interoperability and Reuse through Standards" * [Simulation Interoperabilty Standards Organization (SISO)](https://www.sisostds.org): "Simulation Interoperability and Reuse through Standards"
* SISO Product Support Group (PSG): [DIS / RPR FOM PSG - Distributed Interactive Simulation / Real-time Platform Reference Federation Object Model](https://www.sisostds.org/StandardsActivities/SupportGroups/DISRPRFOMPSG.aspx) * SISO Product Support Group (PSG): [DIS / RPR FOM PSG - Distributed Interactive Simulation / Real-time Platform Reference Federation Object Model](https://www.sisostds.org/StandardsActivities/SupportGroups/DISRPRFOMPSG.aspx)
Manual download links follow. IEEE standards must be downloaded manually while within NPS campus or firewall. ## Working-Group Resources
**DIS/RPR FOM Product Support Group**
* "The Distributed Interactive Simulation / Real-time Platform Reference Federation Object Model (DIS / RPR FOM) Product Support Group (PSG) is a permanent support group chartered by the SISO Standards Activity Committee to support multiple DIS-related products."
* [Distributed Interactive Simulation / Real-time Platform Reference Federation Object Model (DIS / RPR FOM) Product Support Group (PSG)](https://www.sisostds.org/StandardsActivities/SupportGroups/DISRPRFOMPSG.aspx)
* [SISO Digital Library](https://www.sisostds.org/Default.aspx?tabid=105&EntryId=31596)
** [DIS Introduction and Briefings](https://www.sisostds.org/Default.aspx?tabid=105&EntryId=31596)
** [IEEE 1278 Bibliography Material](https://www.sisostds.org/Default.aspx?tabid=105&EntryId=31596)
** [DIS PDU data structures](IeeeDisPduColorFigures.pdf)
** [Compressed DIS](2019-SIW-Presentation-039_CompressedDis.pdf) overview, Lance Call, Simulation Interoperability Workshop (SIW), Orlando Florida, February 2019.
Specification download links follow. For free access, IEEE standards must be downloaded manually while within NPS campus or firewall.
## Standards Documents ## Standards Documents
...@@ -60,12 +72,4 @@ Guidelines are established for the verification, validation, and accreditation ( ...@@ -60,12 +72,4 @@ Guidelines are established for the verification, validation, and accreditation (
* *Abstract.* * *Abstract.*
SISO-REF-010 specifies numerical values and associated definitions for fields that are identified as enumerations in SISO Standards Products and SISO-sponsored standards published by IEEE for High Level Architecture (HLA) and Distributed Interactive Simulation (DIS). Enumerations for simulations may be applied in other architectures, such as the Test and Training Enabling Architecture (TENA). SISO-REF-010 specifies numerical values and associated definitions for fields that are identified as enumerations in SISO Standards Products and SISO-sponsored standards published by IEEE for High Level Architecture (HLA) and Distributed Interactive Simulation (DIS). Enumerations for simulations may be applied in other architectures, such as the Test and Training Enabling Architecture (TENA).
## Working Groups ---
**DIS/RPR FOM Product Support Group**
* "The Distributed Interactive Simulation / Real-time Platform Reference Federation Object Model (DIS / RPR FOM) Product Support Group (PSG) is a permanent support group chartered by the SISO Standards Activity Committee to support multiple DIS-related products."
* [Distributed Interactive Simulation / Real-time Platform Reference Federation Object Model (DIS / RPR FOM) Product Support Group (PSG)](https://www.sisostds.org/StandardsActivities/SupportGroups/DISRPRFOMPSG.aspx)
* [SISO Digital Library](https://www.sisostds.org/Default.aspx?tabid=105&EntryId=31596) including DIS RPRFOM Product Support Group (PSG),
** [DIS Introduction and Briefings](https://www.sisostds.org/Default.aspx?tabid=105&EntryId=31596)
** [IEEE 1278 Bibliography Material](https://www.sisostds.org/Default.aspx?tabid=105&EntryId=31596)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment