Bug fixes for final commit

This commit is contained in:
Zhi You Tan
2017-08-17 13:43:31 +12:00
parent 7a11b5eb77
commit 5a2a78a7d5
3 changed files with 7 additions and 6 deletions
@@ -360,7 +360,7 @@ public class GameState implements Runnable {
Double velocity = yacht.getCurrentVelocity(); Double velocity = yacht.getCurrentVelocity();
Double trueWindAngle = Math.abs(windDirection - yacht.getHeading()); Double trueWindAngle = Math.abs(windDirection - yacht.getHeading());
Double boatSpeedInKnots = PolarTable.getBoatSpeed(getWindSpeedKnots(), trueWindAngle); Double boatSpeedInKnots = PolarTable.getBoatSpeed(getWindSpeedKnots(), trueWindAngle);
Double maxBoatSpeed = GeoUtility.knotsToMMS(boatSpeedInKnots) * 5; Double maxBoatSpeed = GeoUtility.knotsToMMS(boatSpeedInKnots);
// TODO: 15/08/17 remove magic numbers from these equations. // TODO: 15/08/17 remove magic numbers from these equations.
if (yacht.getSailIn()) { if (yacht.getSailIn()) {
if (velocity < maxBoatSpeed - 500) { if (velocity < maxBoatSpeed - 500) {
@@ -252,9 +252,6 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
.stream() .stream()
.filter(yacht -> yacht.getPosition() != null) .filter(yacht -> yacht.getPosition() != null)
.forEach(yacht -> { .forEach(yacht -> {
System.out.println(
yacht.getBoatName() + " pos: " + yacht.getPosition() + " legno: " + yacht
.getLegNumber());
Series<String, Double> yachtData = new Series<>(); Series<String, Double> yachtData = new Series<>();
yachtData.setName(yacht.getSourceId().toString()); yachtData.setName(yacht.getSourceId().toString());
yachtData.getData().add( yachtData.getData().add(
@@ -283,7 +280,6 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
.stream() .stream()
.filter(spark -> !raceSparkLine.getData().contains(spark)) .filter(spark -> !raceSparkLine.getData().contains(spark))
.forEach(spark -> { .forEach(spark -> {
System.out.println(spark.getName());
raceSparkLine.getData().add(spark); raceSparkLine.getData().add(spark);
spark.getNode().lookup(".chart-series-line").setStyle("-fx-stroke:" + getBoatColorAsRGB(spark.getName())); spark.getNode().lookup(".chart-series-line").setStyle("-fx-stroke:" + getBoatColorAsRGB(spark.getName()));
}); });
@@ -38,7 +38,12 @@
<Corner SeqID="3" CompoundMarkID="3" Rounding="SP" ZoneSize="3" /> <Corner SeqID="3" CompoundMarkID="3" Rounding="SP" ZoneSize="3" />
<Corner SeqID="4" CompoundMarkID="4" Rounding="PS" ZoneSize="3" /> <Corner SeqID="4" CompoundMarkID="4" Rounding="PS" ZoneSize="3" />
<Corner SeqID="5" CompoundMarkID="3" Rounding="SP" ZoneSize="3" /> <Corner SeqID="5" CompoundMarkID="3" Rounding="SP" ZoneSize="3" />
<Corner SeqID="6" CompoundMarkID="5" Rounding="PS" ZoneSize="3" /> <Corner SeqID="6" CompoundMarkID="4" Rounding="PS" ZoneSize="3" />
<Corner SeqID="7" CompoundMarkID="3" Rounding="SP" ZoneSize="3" />
<Corner SeqID="8" CompoundMarkID="4" Rounding="PS" ZoneSize="3" />
<Corner SeqID="9" CompoundMarkID="3" Rounding="SP" ZoneSize="3" />
<Corner SeqID="10" CompoundMarkID="4" Rounding="PS" ZoneSize="3" />
<Corner SeqID="11" CompoundMarkID="5" Rounding="PS" ZoneSize="3" />
</CompoundMarkSequence> </CompoundMarkSequence>
<CourseLimit> <CourseLimit>
<Limit SeqID="1" Lat="57.6739450" Lon="11.8417100" /> <Limit SeqID="1" Lat="57.6739450" Lon="11.8417100" />