From c3717b7fc5000c11a5c872510b5eee3fa1ca8d38 Mon Sep 17 00:00:00 2001 From: Fan-Wu Yang Date: Sat, 29 Apr 2017 18:26:02 +1200 Subject: [PATCH] Added Classes to help Visualiser - Added Get Boat GPS Coordinate - Added Get Heading as Degrees - Added Get True Wind Angle as Degrees #story[782] --- .idea/copyright/profiles_settings.xml | 3 +++ .../Networking/Utils/BoatLocationMessage.java | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 .idea/copyright/profiles_settings.xml diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 00000000..e7bedf33 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/network/src/main/java/seng302/Networking/Utils/BoatLocationMessage.java b/network/src/main/java/seng302/Networking/Utils/BoatLocationMessage.java index 454de935..033c60fe 100644 --- a/network/src/main/java/seng302/Networking/Utils/BoatLocationMessage.java +++ b/network/src/main/java/seng302/Networking/Utils/BoatLocationMessage.java @@ -470,6 +470,19 @@ public class BoatLocationMessage extends AC35Data this.rudderAngle = rudderAngle; } + public seng302.GPSCoordinate getGPSLocation(){ + seng302.GPSCoordinate coord = new seng302.GPSCoordinate(AC35UnitConverter.convertGPS(latitude), AC35UnitConverter.convertGPS(longitude)); + return coord; + } + + public double getHeadingDegrees(){ + return AC35UnitConverter.convertHeading(getHeading()); + } + + public double getTrueWindAngleDegrees(){ + return AC35UnitConverter.convertTrueWindAngle(getTrueWindAngle()); + } + @Override public String toString() { StringBuilder builder = new StringBuilder();