Added Knots <-> MMperSec conversions to AC35UnitConverter.
Removed redundant/unused conversions. Documented all of the conversions, and renamed them to pack/unpackX, to match the API spec. Updated/added some tests in AC35UnitConverterTest. RaceStatus now contains a Bearing instead of a packed int bearing. RaceStatus now contains wind speed in knots, instead of MMperSec packed. This means that only RaceStatus decoder/encoder need to care about the bits-over-wire packed values. issue #35 #36 #story[1095]
This commit is contained in:
@@ -133,9 +133,6 @@ public class RaceServer {
|
||||
}
|
||||
|
||||
|
||||
//Convert wind direction and speed to ints. //TODO this conversion should be done inside the racestatus class.
|
||||
int windDirectionInt = AC35UnitConverter.encodeHeading(race.getWindDirection().degrees());
|
||||
int windSpeedInt = (int) (race.getWindSpeed() * Constants.KnotsToMMPerSecond);
|
||||
|
||||
//Create race status object, and send it.
|
||||
RaceStatus raceStatus = new RaceStatus(
|
||||
@@ -144,8 +141,8 @@ public class RaceServer {
|
||||
race.getRaceId(),
|
||||
race.getRaceStatusEnum(),
|
||||
race.getRaceClock().getStartingTimeMilli(),
|
||||
windDirectionInt,
|
||||
windSpeedInt,
|
||||
race.getWindDirection(),
|
||||
race.getWindSpeed(),
|
||||
race.getRaceType(),
|
||||
boatStatuses);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user