From 69d30e6a2c2b4a3951b94b3c38f029db0af977d4 Mon Sep 17 00:00:00 2001 From: brutzman <brutzman@nps.edu> Date: Sun, 2 Jan 2022 20:25:40 -0800 Subject: [PATCH] tweaks --- .../ExampleTrackInterpolation.java | 4 ++-- .../ExampleTrackInterpolationLog.txt | 20 ++++++++++--------- examples/src/OpenDis7Examples/PduTrack.java | 18 ++++++++++------- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/examples/src/OpenDis7Examples/ExampleTrackInterpolation.java b/examples/src/OpenDis7Examples/ExampleTrackInterpolation.java index afae382248..eb7ab1687a 100644 --- a/examples/src/OpenDis7Examples/ExampleTrackInterpolation.java +++ b/examples/src/OpenDis7Examples/ExampleTrackInterpolation.java @@ -176,8 +176,8 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram .createRawWaypoints(); System.out.println("pduTrack_1 getEspduCount()=" + pduTrack_1.getEspduCount()); - System.out.println("pduTrack_1 duration = " + pduTrack_1.getTrackDurationSeconds() + " seconds = " + - pduTrack_1.getTrackDurationTicks() + " ticks"); + System.out.println("pduTrack_1 duration = " + pduTrack_1.getTotalDurationSeconds() + " seconds = " + + pduTrack_1.getTotalDurationTicks() + " ticks"); System.out.println(pduTrack_1.createX3dTimeSensorString()); System.out.println(pduTrack_1.createX3dPositionInterpolatorString()); diff --git a/examples/src/OpenDis7Examples/ExampleTrackInterpolationLog.txt b/examples/src/OpenDis7Examples/ExampleTrackInterpolationLog.txt index e0ed9f91c6..106cc9f0e6 100644 --- a/examples/src/OpenDis7Examples/ExampleTrackInterpolationLog.txt +++ b/examples/src/OpenDis7Examples/ExampleTrackInterpolationLog.txt @@ -13,7 +13,7 @@ run-single: [DisThreadedNetworkInterface] createThreads() sendingThread.isAlive()=true Network confirmation: address=239.1.2.3 port=3000 Beginning pdu save to directory ./pduLog -Recorder log file open: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\pduLog\PduCaptureLog132.dislog +Recorder log file open: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\pduLog\PduCaptureLog165.dislog [DisThreadedNetworkInterface] using network interface Intel(R) Wi-Fi 6E AX210 160MHz [DisThreadedNetworkInterface] datagramSocket.joinGroup address=239.1.2.3 port=3000 isConnected()=false createDatagramSocket() complete. [DisThreadedNetworkInterface] createThreads() receiveThread.isAlive()=true @@ -60,18 +60,20 @@ Recorder log file open: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\pduLog\ 38 Entity location=( 2.0, 0.0, 0.0) WEST 39 Entity location=( 1.0, 0.0, 0.0) WEST 40 Entity location=( 0.0, 0.0, 0.0) WEST +41 Entity location=(-1.0, 0.0, 0.0) WEST [OpenDis7Examples.ExampleTrackInterpolation] loop termination condition met, simulationComplete=true -[OpenDis7Examples.ExampleTrackInterpolation] all PDUs successfully sent for this loop, pduList.size()=41 -pduTrack_1 getEspduCount()=41 -pduTrack_1 duration = 41.0 seconds = -1 ticks -<TimeSensor DEF='testing123Clock' cycleInterval='41.0' loop='true'/> -<PositionInterpolator DEF='testing123Positions' key='0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0' keyValue='0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0,0.0 0.0 0.0'/> -*** setKillSentinelAndInterrupts() killed=true sendingThread.isInterrupted()=false receiveThread.isInterrupted()=true +[OpenDis7Examples.ExampleTrackInterpolation] all PDUs successfully sent for this loop (pduSentList.size()=42 total) +[OpenDis7Examples.ExampleTrackInterpolation] pduTrack_1 initialLocation=Vector3Double x:0.0 y:0.0 z:0.0, latestLocation=Vector3Double x:-1.0 y:0.0 z:0.0 +pduTrack_1 getEspduCount()=42 +pduTrack_1 duration = 42.0 seconds = 0 ticks +<TimeSensor DEF='testing123Clock' cycleInterval='42.0' loop='true'/> +<PositionInterpolator DEF='testing123Positions' key='0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0' keyValue='0.0 0.0 0.0,0.0 1.0 0.0,0.0 2.0 0.0,0.0 3.0 0.0,0.0 4.0 0.0,0.0 5.0 0.0,0.0 6.0 0.0,0.0 7.0 0.0,0.0 8.0 0.0,0.0 9.0 0.0,0.0 10.0 0.0,1.0 10.0 0.0,2.0 10.0 0.0,3.0 10.0 0.0,4.0 10.0 0.0,5.0 10.0 0.0,6.0 10.0 0.0,7.0 10.0 0.0,8.0 10.0 0.0,9.0 10.0 0.0,10.0 10.0 0.0,10.0 9.0 0.0,10.0 8.0 0.0,10.0 7.0 0.0,10.0 6.0 0.0,10.0 5.0 0.0,10.0 4.0 0.0,10.0 3.0 0.0,10.0 2.0 0.0,10.0 1.0 0.0,10.0 0.0 0.0,9.0 0.0 0.0,8.0 0.0 0.0,7.0 0.0 0.0,6.0 0.0 0.0,5.0 0.0 0.0,4.0 0.0 0.0,3.0 0.0 0.0,2.0 0.0 0.0,1.0 0.0 0.0,0.0 0.0 0.0,-1.0 0.0 0.0'/> +*** setKillSentinelAndInterrupts() killed=true sendingThread.isInterrupted()=true receiveThread.isInterrupted()=true [DisThreadedNetworkInterface PduRecorder] close(): pdus2send.size()=0 baos.size()=0 dos.size()=0 *** killThread() status: sendingThread.isAlive()=false sendingThread.isInterrupted()=true *** killThread() status: receiveThread.isAlive()=false receiveThread.isInterrupted()=true *** Thread close status: sendingThread.isAlive()=false receiveThread.isAlive()=false -PduRecorder.selfTest() stop() closing recorder log file: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\pduLog\PduCaptureLog132.dislog +PduRecorder.stop() closing recorder log file: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\pduLog\PduCaptureLog165.dislog [OpenDis7Examples.ExampleTrackInterpolation] complete. -BUILD SUCCESSFUL (total time: 11 seconds) +BUILD SUCCESSFUL (total time: 12 seconds) diff --git a/examples/src/OpenDis7Examples/PduTrack.java b/examples/src/OpenDis7Examples/PduTrack.java index c30633ec02..e089498822 100644 --- a/examples/src/OpenDis7Examples/PduTrack.java +++ b/examples/src/OpenDis7Examples/PduTrack.java @@ -159,6 +159,10 @@ public class PduTrack deepCopyEspdu.setMarking (((EntityStatePdu)newPdu).getMarking()); deepCopyEspdu.setEntityLocation (((EntityStatePdu)newPdu).getEntityLocation()); deepCopyEspdu.setEntityOrientation(((EntityStatePdu)newPdu).getEntityOrientation()); + + // TODO apparently not working +// EntityStatePdu deepCopyEspdu = ((EntityStatePdu)newPdu).copy(); + pduList.add(deepCopyEspdu); if (initialLocation == null) @@ -279,7 +283,7 @@ public class PduTrack * Compute track duration in timestamp ticks * @return duration in timestamp ticks between initial and final ESPDU timestamps in waypointList */ - public int getTrackDurationTicks() + public int getTotalDurationTicks() { int initialTime = -1; int finalTime = -1; @@ -311,18 +315,18 @@ public class PduTrack * Compute track duration in seconds * @return duration in seconds between initial and final ESPDU timestamps in waypointList */ - public float getTrackDurationSeconds() + public float getTotalDurationSeconds() { if (defaultWaypointInterval > 0) { return getEspduCount() * defaultWaypointInterval; } - else if (getTrackDurationTicks() < 0) - durationSeconds = getTrackDurationTicks() * 1.0f; // TODO convert + else if (getTotalDurationTicks() < 0) + durationSeconds = getTotalDurationTicks() * 1.0f; // TODO convert return durationSeconds; } /** - * Create waypoints and angles using all PDU points + * Create waypoints and angles using all ESPDU points, with no linear regression or array reduction. * @return same object to permit progressive setters */ public PduTrack createRawWaypoints() @@ -363,7 +367,7 @@ public class PduTrack StringBuilder sb = new StringBuilder(); sb.append("<TimeSensor"); sb.append(" DEF='").append(getX3dTimeSensorDEF()).append("'"); - sb.append(" cycleInterval='").append(String.valueOf(getTrackDurationSeconds())).append("'"); + sb.append(" cycleInterval='").append(String.valueOf(getTotalDurationSeconds())).append("'"); sb.append(" loop='true'"); sb.append("/>"); @@ -457,7 +461,7 @@ public class PduTrack System.out.println(TRACE_PREFIX + "getEspduCount()=" + pduTrack.getEspduCount()); System.out.println(TRACE_PREFIX + "getDefaultWaypointInterval()=" + pduTrack.getDefaultWaypointInterval()); - System.out.println(TRACE_PREFIX + "getTrackDurationSeconds()=" + pduTrack.getTrackDurationSeconds()); + System.out.println(TRACE_PREFIX + "getTotalDurationSeconds()=" + pduTrack.getTotalDurationSeconds()); System.out.println(TRACE_PREFIX + "selfTest() complete."); } -- GitLab