diff --git a/CourseExamples/src/DisExamples/EspduSender.java b/CourseExamples/src/DisExamples/EspduSender.java index 4f9a2e2c72c3567fbc204391b9b9375ff46a75d5..0e559495edae5040c362d25a368de56d20a6f5af 100644 --- a/CourseExamples/src/DisExamples/EspduSender.java +++ b/CourseExamples/src/DisExamples/EspduSender.java @@ -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) (idx)); + double direction = Math.pow((double) (-1.0), (double) (index)); lon = lon + (direction * 0.00006); System.out.println(lon); @@ -253,7 +254,7 @@ public class EspduSender { location = espdu.getEntityLocation(); - System.out.println("Espdu #" + idx + " EID=[" + entityID.getSite() + "," + entityID.getApplication() + "," + entityID.getEntity() + "]"); + System.out.println("Espdu #" + index + " 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);