Fixed speed notbeing displayed from AC35 live data
- Turns out the AC35 stream gives the speed in the SOG (speed over ground) section, not the boat speed section #story[782]
This commit is contained in:
@@ -61,6 +61,9 @@ public class BoatLocationDecoder {
|
|||||||
currentSet = Arrays.copyOfRange(encodedBoatLocation,52, 54);
|
currentSet = Arrays.copyOfRange(encodedBoatLocation,52, 54);
|
||||||
rudderAngle = Arrays.copyOfRange(encodedBoatLocation,54, 56);
|
rudderAngle = Arrays.copyOfRange(encodedBoatLocation,54, 56);
|
||||||
|
|
||||||
|
// System.out.println(bytesToInt(sourceID));
|
||||||
|
// System.out.println(bytesToInt(boatSpeed));
|
||||||
|
|
||||||
message = new BoatLocationMessage(messageVersionNumber, bytesToLong(time),
|
message = new BoatLocationMessage(messageVersionNumber, bytesToLong(time),
|
||||||
bytesToInt(sourceID), bytesToInt(seqNum),
|
bytesToInt(sourceID), bytesToInt(seqNum),
|
||||||
deviceType, bytesToInt(latitude),
|
deviceType, bytesToInt(latitude),
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ public class BoatLocationMessage extends AC35Data
|
|||||||
this.roll = 0;
|
this.roll = 0;
|
||||||
this.boatSpeed = convertBoatSpeedDoubleToInt(boatSpeed);
|
this.boatSpeed = convertBoatSpeedDoubleToInt(boatSpeed);
|
||||||
this.boatCOG = 0;
|
this.boatCOG = 0;
|
||||||
this.boatSOG = 0;
|
this.boatSOG = convertBoatSpeedDoubleToInt(boatSpeed);
|
||||||
this.apparentWindSpeed = 0;
|
this.apparentWindSpeed = 0;
|
||||||
this.apparentWindAngle = 0;
|
this.apparentWindAngle = 0;
|
||||||
this.trueWindSpeed = 0;
|
this.trueWindSpeed = 0;
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class StreamedRace extends Race {
|
|||||||
double lon = boatLocationMessage.getLongitudeDouble();
|
double lon = boatLocationMessage.getLongitudeDouble();
|
||||||
boat.setCurrentPosition(new GPSCoordinate(lat, lon));
|
boat.setCurrentPosition(new GPSCoordinate(lat, lon));
|
||||||
boat.setHeading(boatLocationMessage.getHeadingDegrees());
|
boat.setHeading(boatLocationMessage.getHeadingDegrees());
|
||||||
boat.setVelocity(boatLocationMessage.getBoatSpeed() * MMPS_TO_KN);
|
boat.setVelocity(boatLocationMessage.getBoatSOG() * MMPS_TO_KN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user