Integrated changes from story33-estimateTime branch

- Used refactored bearing methods
- Sent accurate current time to visualiser

#story[875]
This commit is contained in:
cbt24
2017-05-25 12:53:40 +12:00
parent 5f23f335e5
commit b58c3b98ed
7 changed files with 36 additions and 12 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;
@@ -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;
}