Skip to content
Snippets Groups Projects
Commit d9a9d484 authored by Brutzman, Don's avatar Brutzman, Don
Browse files

new package path edu.nps.moves.dis7.utilities.DisTime;

parent 9e445516
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ package edu.nps.moves.dis7.examples; ...@@ -7,6 +7,7 @@ package edu.nps.moves.dis7.examples;
import edu.nps.moves.dis7.pdus.*; import edu.nps.moves.dis7.pdus.*;
import edu.nps.moves.dis7.utilities.CoordinateConversions; import edu.nps.moves.dis7.utilities.CoordinateConversions;
import edu.nps.moves.dis7.utilities.DisTime;
import edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface; import edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface;
import edu.nps.moves.dis7.utilities.PduFactory; import edu.nps.moves.dis7.utilities.PduFactory;
...@@ -118,8 +119,8 @@ public class PduSender ...@@ -118,8 +119,8 @@ public class PduSender
} }
// Factory with default absolute time // Factory with default absolute time
PduFactory pduFac = new PduFactory(); PduFactory pduFactory = new PduFactory();
EntityStatePdu espdu = pduFac.makeEntityStatePdu(); EntityStatePdu espdu = pduFactory.makeEntityStatePdu();
// ICBM coordinates for my office // ICBM coordinates for my office
double lat = 36.595517; double lat = 36.595517;
...@@ -182,7 +183,7 @@ public class PduSender ...@@ -182,7 +183,7 @@ public class PduSender
// update the timestamp on ALL packets sent. // update the timestamp on ALL packets sent.
// An alterative approach: actually follow the standard. It's a crazy concept, // An alterative approach: actually follow the standard. It's a crazy concept,
// but it might just work. // but it might just work.
timestamp = pduFac.getTimestamp(); timestamp = DisTime.getTimestamp();
espdu.setTimestamp(timestamp); espdu.setTimestamp(timestamp);
// Set the position of the entity in the world. DIS uses a cartesian // Set the position of the entity in the world. DIS uses a cartesian
...@@ -233,7 +234,7 @@ public class PduSender ...@@ -233,7 +234,7 @@ public class PduSender
// datagram and send it. // datagram and send it.
data = baos.toByteArray(); data = baos.toByteArray();
fire = pduFac.makeFirePdu(); fire = pduFactory.makeFirePdu();
fireArray = fire.marshal(); fireArray = fire.marshal();
for (InetAddress broadcast : broadcastAddresses) { for (InetAddress broadcast : broadcastAddresses) {
......
...@@ -7,6 +7,7 @@ package edu.nps.moves.dis7.examples; ...@@ -7,6 +7,7 @@ package edu.nps.moves.dis7.examples;
import edu.nps.moves.dis7.pdus.Pdu; import edu.nps.moves.dis7.pdus.Pdu;
import edu.nps.moves.dis7.enumerations.Country; import edu.nps.moves.dis7.enumerations.Country;
import edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface; import edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface;
import edu.nps.moves.dis7.utilities.DisTime;
import edu.nps.moves.dis7.utilities.PduFactory; import edu.nps.moves.dis7.utilities.PduFactory;
/** /**
...@@ -35,7 +36,7 @@ public class ThreadedNetExample ...@@ -35,7 +36,7 @@ public class ThreadedNetExample
// Use PduFactory to make pdus, default country = Deutschland, exercise, site, app, absolute timestamps // Use PduFactory to make pdus, default country = Deutschland, exercise, site, app, absolute timestamps
PduFactory factory = new PduFactory(Country.GERMANY_DEU, (byte) 1, (short) 2, (short) 3, PduFactory.TimestampStyle.IEEE_ABSOLUTE); PduFactory factory = new PduFactory(Country.GERMANY_DEU, (byte) 1, (short) 2, (short) 3, DisTime.TimestampStyle.IEEE_ABSOLUTE);
// Make and send 3 pdus with no delay between, testing threaded receiver performance // Make and send 3 pdus with no delay between, testing threaded receiver performance
netif.send(factory.makeEntityStatePdu()); netif.send(factory.makeEntityStatePdu());
......
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