Skip to content

Commit

Permalink
Print marking in espdu receiver example
Browse files Browse the repository at this point in the history
  • Loading branch information
leif81 committed Jun 12, 2023
1 parent bcff473 commit cd633b2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/java/edu/nps/moves/examples/EspduReceiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ public void run() {
if (pdu != null) {
System.out.println("Received PDU of type: " + pdu.getClass().getName());
if (pdu instanceof EntityStatePdu) {
EntityID eid = ((EntityStatePdu) pdu).getEntityID();
Vector3Double position = ((EntityStatePdu) pdu).getEntityLocation();
System.out.println(" Site,App,Id:[" + eid.getSite() + ", " + eid.getApplication() + ", " + eid.getEntity() + "] ");
System.out.println(" Location in DIS coordinates: [" + position.getX() + ", " + position.getY() + ", " + position.getZ() + "]");

EntityStatePdu espdu = (EntityStatePdu) pdu;
System.out.println(" Marking: " + espdu.getMarking().getCharactersString());
EntityID eid = espdu.getEntityID();
System.out.println(" Site, App, Id: [" + eid.getSite() + ", " + eid.getApplication() + ", " + eid.getEntity() + "] ");
Vector3Double position = espdu.getEntityLocation();
System.out.println(" Location in DIS geocentric xyz coordinates: [" + position.getX() + ", " + position.getY() + ", " + position.getZ() + "]");
final double[] latlon = CoordinateConversions.xyzToLatLonDegrees(position.toArray());
System.out.println(" Location in Latitude Longitude Elevation: [" + latlon[0] + ", " + latlon[1] + ", " + latlon[2] + "]");
}
Expand Down

0 comments on commit cd633b2

Please sign in to comment.