Added heading to boatlocation messages

#story[778]
This commit is contained in:
Erika Savell
2017-05-02 19:21:43 +12:00
parent f2e0eec212
commit 42ad1f78fc
11 changed files with 9 additions and 19 deletions
@@ -150,7 +150,7 @@ public class BoatLocationMessage extends AC35Data
this.rudderAngle = rudderAngle;
}
public BoatLocationMessage(int sourceID, double lat, double lon, long sequenceNumber) {
public BoatLocationMessage(int sourceID, double lat, double lon, long sequenceNumber, double heading) {
super(MessageType.BOATLOCATION);
this.messageVersionNumber = (byte) 1;
@@ -161,7 +161,7 @@ public class BoatLocationMessage extends AC35Data
this.latitude = convertGPSToInt(lat);
this.longitude = convertGPSToInt(lon);
this.altitude = 0;
this.heading = 0;
this.heading = convertHeadingDoubleToInt(heading);
this.pitch = 0;
this.roll = 0;
this.boatSpeed = 0;
@@ -62,7 +62,7 @@ public class BinaryMessageDecoderTest {
// Assert.assertEquals(xmlString.toString(), contents);
}catch (IOException e){
System.out.println(e);
e.printStackTrace();
}
}
}
@@ -41,7 +41,7 @@ public class XMLMessageDecoderTest {
Assert.assertEquals((short)xmlString.length(), decoderXML.getXmlMsgLength());
}catch (IOException e){
System.out.println(e);
e.printStackTrace();
}
}
}
@@ -28,7 +28,7 @@ public class XMLMessageEncoderTest {
//1 + 2 + 6 + 1 + 2 + 2 + 374
Assert.assertEquals(388, encodedXML.length);
}catch (IOException e){
System.out.println(e);
e.printStackTrace();
}
}
@@ -49,7 +49,7 @@ public class XMLMessageEncoderTest {
Assert.assertEquals(null, encodedXML);
}catch (IOException e){
System.out.println(e);
e.printStackTrace();
}
}
}