Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NetworkedGraphicsMV3500
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Savage
NetworkedGraphicsMV3500
Commits
ad42db1a
"...git@gitlab.nps.edu:Savage/NetworkedGraphicsMV3500.git" did not exist on "e6aa054e9b3188cb401c9a57b92b145b2d3ce3cd"
Commit
ad42db1a
authored
6 years ago
by
Brutzman, Don
Browse files
Options
Downloads
Patches
Plain Diff
report number of packets being sent
parent
b670513e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CourseExamples/src/DisExamples/EspduSender.java
+6
-5
6 additions, 5 deletions
CourseExamples/src/DisExamples/EspduSender.java
with
6 additions
and
5 deletions
CourseExamples/src/DisExamples/EspduSender.java
+
6
−
5
View file @
ad42db1a
...
...
@@ -45,7 +45,7 @@ public class EspduSender {
*/
public
static
void
main
(
String
args
[])
{
System
.
out
.
println
(
"DisExamples.EspduSender started..."
);
System
.
out
.
println
(
"DisExamples.EspduSender started...
send "
+
NUMBER_TO_SEND
+
" ESPDUs, initial index=0
"
);
/**
* an entity state pdu
*/
...
...
@@ -159,8 +159,9 @@ public class EspduSender {
try
{
System
.
out
.
println
(
"Sending "
+
NUMBER_TO_SEND
+
" ESPDU packets to "
+
destinationIp
.
toString
());
for
(
int
idx
=
0
;
idx
<
NUMBER_TO_SEND
;
idx
++)
{
// DIS time is a pain in the ass. DIS time units are 2^31-1 units per
for
(
int
index
=
0
;
index
<
NUMBER_TO_SEND
;
index
++)
{
// DIS time is a pain in the uh, neck. DIS time units are 2^31-1 units per
// hour, and time is set to DIS time units from the top of the hour.
// This means that if you start sending just before the top of the hour
// the time units can roll over to zero as you are sending. The receivers
...
...
@@ -200,7 +201,7 @@ public class EspduSender {
// The x and y values will change, but the z value should not.
//lon = lon + (double)((double)idx / 100000.0);
//System.out.println("lla=" + lat + "," + lon + ", 0.0");
double
direction
=
Math
.
pow
((
double
)
(-
1.0
),
(
double
)
(
i
d
x
));
double
direction
=
Math
.
pow
((
double
)
(-
1.0
),
(
double
)
(
i
nde
x
));
lon
=
lon
+
(
direction
*
0.00006
);
System
.
out
.
println
(
lon
);
...
...
@@ -253,7 +254,7 @@ public class EspduSender {
location
=
espdu
.
getEntityLocation
();
System
.
out
.
println
(
"Espdu #"
+
i
d
x
+
" EID=["
+
entityID
.
getSite
()
+
","
+
entityID
.
getApplication
()
+
","
+
entityID
.
getEntity
()
+
"]"
);
System
.
out
.
println
(
"Espdu #"
+
i
nde
x
+
" EID=["
+
entityID
.
getSite
()
+
","
+
entityID
.
getApplication
()
+
","
+
entityID
.
getEntity
()
+
"]"
);
System
.
out
.
println
(
" DIS coordinates location=["
+
location
.
getX
()
+
","
+
location
.
getY
()
+
","
+
location
.
getZ
()
+
"]"
);
double
c
[]
=
{
location
.
getX
(),
location
.
getY
(),
location
.
getZ
()};
double
lla
[]
=
CoordinateConversions
.
xyzToLatLonDegrees
(
c
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment