Fixed Annotations and bound windarrow

- Wind arrow for the bermuda race is bound between 215 and 235 degrees
- annotations will not correctly highlight what they are showing
#story[877] #story[882]
This commit is contained in:
Fan-Wu Yang
2017-05-25 14:45:13 +12:00
18 changed files with 530 additions and 190 deletions
@@ -152,11 +152,11 @@ public class BoatLocation extends AC35Data {
this.rudderAngle = rudderAngle;
}
public BoatLocation(int sourceID, double lat, double lon, long sequenceNumber, double heading, double boatSpeed) {
public BoatLocation(int sourceID, double lat, double lon, long sequenceNumber, double heading, double boatSpeed, long time) {
super(MessageType.BOATLOCATION);
this.messageVersionNumber = (byte) 1;
this.time = System.currentTimeMillis();
this.time = time;
this.sourceID = sourceID;
this.sequenceNumber = sequenceNumber;
this.deviceType = 1;
@@ -227,7 +227,7 @@ public class BoatLocation extends AC35Data {
*/
public static int convertHeadingDoubleToInt(double heading) {
int headingInt = (int) ((heading / 360.0) * 65536.0);
int headingInt = (int) ((heading * 65536.0) / 360.0);
return headingInt;
}
@@ -27,14 +27,14 @@ public class BoatStatus {
}
public BoatStatus(int sourceID, BoatStatusEnum boatStatusEnum, int legNum) {
public BoatStatus(int sourceID, BoatStatusEnum boatStatusEnum, int legNum, long estTimeAtNextMark) {
this.sourceID = sourceID;
this.boatStatus = boatStatusEnum.getValue();
this.legNumber = ByteConverter.intToBytes(legNum)[0];
this.numPenaltiesAwarded = 0;
this.numPenaltiesServed = 0;
this.estTimeAtFinish = 0;
this.estTimeAtNextMark = 0;
this.estTimeAtNextMark = estTimeAtNextMark;
}