|
|
|
@ -86,7 +86,6 @@ public class Race implements Runnable {
|
|
|
|
//get new point
|
|
|
|
//get new point
|
|
|
|
Point2D endPoint = geodeticCalculator.getDestinationGeographicPoint();
|
|
|
|
Point2D endPoint = geodeticCalculator.getDestinationGeographicPoint();
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println(endPoint.getX());
|
|
|
|
|
|
|
|
return new GPSCoordinate(endPoint.getY(), endPoint.getX());
|
|
|
|
return new GPSCoordinate(endPoint.getY(), endPoint.getX());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -115,7 +114,6 @@ public class Race implements Runnable {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void handle(long arg0) {
|
|
|
|
public void handle(long arg0) {
|
|
|
|
timeLeft = startTime - currentTime;
|
|
|
|
timeLeft = startTime - currentTime;
|
|
|
|
System.out.println(timeLeft);
|
|
|
|
|
|
|
|
ArrayList<BoatStatus> boatStatuses = new ArrayList<>();
|
|
|
|
ArrayList<BoatStatus> boatStatuses = new ArrayList<>();
|
|
|
|
//For each boat, we update it's position, and generate a BoatLocationMessage.
|
|
|
|
//For each boat, we update it's position, and generate a BoatLocationMessage.
|
|
|
|
for (int i = 0; i < startingBoats.size(); i++) {
|
|
|
|
for (int i = 0; i < startingBoats.size(); i++) {
|
|
|
|
@ -160,7 +158,6 @@ public class Race implements Runnable {
|
|
|
|
|
|
|
|
|
|
|
|
for (Boat boat : startingBoats) {
|
|
|
|
for (Boat boat : startingBoats) {
|
|
|
|
boat.setStarted(true);
|
|
|
|
boat.setStarted(true);
|
|
|
|
System.out.println(boat.getName());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
new AnimationTimer() {
|
|
|
|
new AnimationTimer() {
|
|
|
|
@ -218,7 +215,6 @@ public class Race implements Runnable {
|
|
|
|
if (boat != null) {
|
|
|
|
if (boat != null) {
|
|
|
|
boat.setScaledVelocity(boat.getVelocity() * scaleFactor);
|
|
|
|
boat.setScaledVelocity(boat.getVelocity() * scaleFactor);
|
|
|
|
boat.setCurrentPosition(startingPositions.get(i));
|
|
|
|
boat.setCurrentPosition(startingPositions.get(i));
|
|
|
|
System.out.println(boat.getCurrentPosition());
|
|
|
|
|
|
|
|
boat.setCurrentLeg(officialStart);
|
|
|
|
boat.setCurrentLeg(officialStart);
|
|
|
|
boat.setHeading(boat.calculateHeading());
|
|
|
|
boat.setHeading(boat.calculateHeading());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -235,7 +231,6 @@ public class Race implements Runnable {
|
|
|
|
int nBoats = startingBoats.size();
|
|
|
|
int nBoats = startingBoats.size();
|
|
|
|
Marker compoundMark = legs.get(0).getStartCompoundMark();
|
|
|
|
Marker compoundMark = legs.get(0).getStartCompoundMark();
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println(compoundMark.getAverageGPSCoordinate());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GeodeticCalculator initialCalc = new GeodeticCalculator();
|
|
|
|
GeodeticCalculator initialCalc = new GeodeticCalculator();
|
|
|
|
initialCalc.setStartingGeographicPoint(compoundMark.getMark1().getLongitude(), compoundMark.getMark1().getLatitude());
|
|
|
|
initialCalc.setStartingGeographicPoint(compoundMark.getMark1().getLongitude(), compoundMark.getMark1().getLatitude());
|
|
|
|
@ -254,7 +249,6 @@ public class Race implements Runnable {
|
|
|
|
Point2D position = positionCalc.getDestinationGeographicPoint();
|
|
|
|
Point2D position = positionCalc.getDestinationGeographicPoint();
|
|
|
|
positions.add(new GPSCoordinate(position.getY(), position.getX()));
|
|
|
|
positions.add(new GPSCoordinate(position.getY(), position.getX()));
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println(position.getX());
|
|
|
|
|
|
|
|
positionCalc = new GeodeticCalculator();
|
|
|
|
positionCalc = new GeodeticCalculator();
|
|
|
|
positionCalc.setStartingGeographicPoint(position);
|
|
|
|
positionCalc.setStartingGeographicPoint(position);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|