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

refactored DisTime utilities package in open-dis7-java library

parent 10c9e34f
No related branches found
No related tags found
No related merge requests found
...@@ -65,7 +65,6 @@ public class BrennenstuhlEspduSender ...@@ -65,7 +65,6 @@ public class BrennenstuhlEspduSender
int port = DEFAULT_MULTICAST_PORT; int port = DEFAULT_MULTICAST_PORT;
MulticastSocket socket = null; // must be initialized to avoid later error, even if null; MulticastSocket socket = null; // must be initialized to avoid later error, even if null;
EntityStatePdu espdu = new EntityStatePdu(); EntityStatePdu espdu = new EntityStatePdu();
DisTime disTime = new DisTime();
// ICBM coordinates for my office // ICBM coordinates for my office
double latitude = 36.595517; double latitude = 36.595517;
...@@ -200,7 +199,7 @@ public class BrennenstuhlEspduSender ...@@ -200,7 +199,7 @@ public class BrennenstuhlEspduSender
// 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.
int timestamp = disTime.getDisAbsoluteTimestamp(); int timestamp = DisTime.getCurrentDisAbsoluteTimestamp();
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
......
...@@ -70,7 +70,6 @@ public class SchuttESPDUSender { ...@@ -70,7 +70,6 @@ public class SchuttESPDUSender {
int port = DEFAULT_MULTICAST_PORT; int port = DEFAULT_MULTICAST_PORT;
MulticastSocket socket = null; // must be initialized to avoid later error, even if null; MulticastSocket socket = null; // must be initialized to avoid later error, even if null;
EntityStatePdu espdu = new EntityStatePdu(); EntityStatePdu espdu = new EntityStatePdu();
DisTime disTime = new DisTime();
// Entity Location // Entity Location
double latitude = 36.595517; double latitude = 36.595517;
...@@ -194,7 +193,7 @@ public class SchuttESPDUSender { ...@@ -194,7 +193,7 @@ public class SchuttESPDUSender {
// 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.
int timestamp = disTime.getDisAbsoluteTimestamp(); int timestamp = DisTime.getCurrentDisAbsoluteTimestamp();
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
......
...@@ -61,7 +61,6 @@ public class Yurk_EspduSender ...@@ -61,7 +61,6 @@ public class Yurk_EspduSender
int port = DEFAULT_MULTICAST_PORT; int port = DEFAULT_MULTICAST_PORT;
MulticastSocket socket = null; // must be initialized to avoid later error, even if null; MulticastSocket socket = null; // must be initialized to avoid later error, even if null;
EntityStatePdu espdu = new EntityStatePdu(); EntityStatePdu espdu = new EntityStatePdu();
DisTime disTime = new DisTime();
// ICBM coordinates for my office // ICBM coordinates for my office
double latitude = 36.595517; double latitude = 36.595517;
...@@ -196,7 +195,7 @@ public class Yurk_EspduSender ...@@ -196,7 +195,7 @@ public class Yurk_EspduSender
// 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.
int timestamp = disTime.getDisAbsoluteTimestamp(); int timestamp = DisTime.getCurrentDisAbsoluteTimestamp();
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
......
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