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

adjusted reportPdu() format

parent d6b24d1a
No related branches found
No related tags found
No related merge requests found
......@@ -38,12 +38,12 @@ package OpenDis7Examples;
import edu.nps.moves.dis7.entities.swe.platform.surface._001Poseidon;
import edu.nps.moves.dis7.enumerations.DisPduType;
import edu.nps.moves.dis7.enumerations.ForceID;
import edu.nps.moves.dis7.pdus.DisTime;
import edu.nps.moves.dis7.pdus.EntityID;
import edu.nps.moves.dis7.pdus.EntityStatePdu;
import edu.nps.moves.dis7.pdus.EulerAngles;
import edu.nps.moves.dis7.pdus.Pdu;
import edu.nps.moves.dis7.pdus.Vector3Double;
import edu.nps.moves.dis7.utilities.DisTime;
import edu.nps.moves.dis7.utilities.PduFactory;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
......@@ -85,7 +85,7 @@ public class PduTrack
private boolean addLineBreaksWithinKeyValues = false;
protected PduFactory pduFactory = new PduFactory();
PduFactory.TimestampStyle timestampStyle = PduFactory.TimestampStyle.IEEE_ABSOLUTE;
DisTime.TimestampStyle timestampStyle = DisTime.TimestampStyle.IEEE_ABSOLUTE;
protected ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
protected DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream);
private String TRACE_PREFIX = "[" + (PduTrack.class.getSimpleName()) + "] ";
......@@ -102,10 +102,10 @@ public class PduTrack
* Set timestampStyle used by PduFactory
* @param newTimestampStyle new value to set
*/
public PduTrack(PduFactory.TimestampStyle newTimestampStyle)
public PduTrack(DisTime.TimestampStyle newTimestampStyle)
{
timestampStyle = newTimestampStyle;
pduFactory.setTimestampStyle(newTimestampStyle);
DisTime.setTimestampStyle(newTimestampStyle);
}
/**
......@@ -131,7 +131,7 @@ public class PduTrack
* Get timestampStyle used by PduFactory
* @return current timestampStyle
*/
public PduFactory.TimestampStyle getTimestampStyle()
public DisTime.TimestampStyle getTimestampStyle()
{
return timestampStyle;
}
......@@ -140,10 +140,10 @@ public class PduTrack
* @param newTimestampStyle the timestampStyle to set
* @return same object to permit progressive setters
*/
public PduTrack setTimestampStyle(PduFactory.TimestampStyle newTimestampStyle)
public PduTrack setTimestampStyle(DisTime.TimestampStyle newTimestampStyle)
{
this.timestampStyle = newTimestampStyle;
pduFactory.setTimestampStyle(newTimestampStyle);
DisTime.setTimestampStyle(newTimestampStyle);
return this;
}
......@@ -827,13 +827,13 @@ public class PduTrack
public PduTrack reportPdu(EntityStatePdu anEspdu)
{
System.out.println (
String.format("%08d", anEspdu.getTimestamp()) + " " +
DisTime.convertToString(anEspdu.getTimestamp()) + ", " +
String.format("%s", anEspdu.getMarkingString().trim()) + ", " +
DisTime.convertToString(anEspdu.getTimestamp()) + " (" +
String.format("%08d", anEspdu.getTimestamp()) + "), " +
"EntityID=(" +
anEspdu.getEntityID().getSiteID() + ", " +
anEspdu.getEntityID().getApplicationID() + ", " +
anEspdu.getEntityID().getEntityID() + ") " +
anEspdu.getEntityID().getEntityID() + "), " +
"location=(" +
String.format("%4.1f", anEspdu.getEntityLocation().getX()) + ", " +
String.format("%4.1f", anEspdu.getEntityLocation().getY()) + ", " +
......
This diff is collapsed.
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