Fixed boats not displayinggit stash
- Was gps coordinates being initialised with X and Y switched around #story[881]
This commit is contained in:
@@ -99,7 +99,7 @@ public class BoatXMLReader extends XMLReader implements BoatDataSource {
|
||||
Node nCoord = ((Element)boatNode).getElementsByTagName("GPSposition").item(0);
|
||||
double x = Double.parseDouble(nCoord.getAttributes().getNamedItem("X").getTextContent());
|
||||
double y = Double.parseDouble(nCoord.getAttributes().getNamedItem("Y").getTextContent());
|
||||
Mark mark = new Mark(sourceID, name, new GPSCoordinate(x,y));
|
||||
Mark mark = new Mark(sourceID, name, new GPSCoordinate(y,x));
|
||||
markerMap.put(sourceID, mark);
|
||||
}
|
||||
|
||||
|
||||
@@ -155,7 +155,8 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
|
||||
CompoundMark marker;
|
||||
|
||||
switch(nMarks.getLength()) {
|
||||
case 1: marker = new CompoundMark(getMark((Element)nMarks.item(0))); break;
|
||||
case 1: marker = new CompoundMark(getMark((Element)nMarks.item(0)));
|
||||
break;
|
||||
case 2: marker = new CompoundMark(getMark((Element)nMarks.item(0)), getMark((Element)nMarks.item(1))); break;
|
||||
default: throw new StreamedCourseXMLException();
|
||||
}
|
||||
@@ -216,7 +217,6 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
double maxLatitude = boundary.stream().max(Comparator.comparingDouble(GPSCoordinate::getLatitude)).get().getLatitude() + COORDINATEPADDING;
|
||||
double maxLongitude = boundary.stream().max(Comparator.comparingDouble(GPSCoordinate::getLongitude)).get().getLongitude() + COORDINATEPADDING;
|
||||
double minLatitude = boundary.stream().min(Comparator.comparingDouble(GPSCoordinate::getLatitude)).get().getLatitude() + COORDINATEPADDING;
|
||||
|
||||
@@ -86,7 +86,6 @@ public class Race implements Runnable {
|
||||
//get new point
|
||||
Point2D endPoint = geodeticCalculator.getDestinationGeographicPoint();
|
||||
|
||||
System.out.println(endPoint.getX());
|
||||
return new GPSCoordinate(endPoint.getY(), endPoint.getX());
|
||||
}
|
||||
|
||||
@@ -115,7 +114,6 @@ public class Race implements Runnable {
|
||||
@Override
|
||||
public void handle(long arg0) {
|
||||
timeLeft = startTime - currentTime;
|
||||
System.out.println(timeLeft);
|
||||
ArrayList<BoatStatus> boatStatuses = new ArrayList<>();
|
||||
//For each boat, we update it's position, and generate a BoatLocationMessage.
|
||||
for (int i = 0; i < startingBoats.size(); i++) {
|
||||
@@ -160,7 +158,6 @@ public class Race implements Runnable {
|
||||
|
||||
for (Boat boat : startingBoats) {
|
||||
boat.setStarted(true);
|
||||
System.out.println(boat.getName());
|
||||
}
|
||||
|
||||
new AnimationTimer() {
|
||||
@@ -218,7 +215,6 @@ public class Race implements Runnable {
|
||||
if (boat != null) {
|
||||
boat.setScaledVelocity(boat.getVelocity() * scaleFactor);
|
||||
boat.setCurrentPosition(startingPositions.get(i));
|
||||
System.out.println(boat.getCurrentPosition());
|
||||
boat.setCurrentLeg(officialStart);
|
||||
boat.setHeading(boat.calculateHeading());
|
||||
}
|
||||
@@ -235,7 +231,6 @@ public class Race implements Runnable {
|
||||
int nBoats = startingBoats.size();
|
||||
Marker compoundMark = legs.get(0).getStartCompoundMark();
|
||||
|
||||
System.out.println(compoundMark.getAverageGPSCoordinate());
|
||||
|
||||
GeodeticCalculator initialCalc = new GeodeticCalculator();
|
||||
initialCalc.setStartingGeographicPoint(compoundMark.getMark1().getLongitude(), compoundMark.getMark1().getLatitude());
|
||||
@@ -254,7 +249,6 @@ public class Race implements Runnable {
|
||||
Point2D position = positionCalc.getDestinationGeographicPoint();
|
||||
positions.add(new GPSCoordinate(position.getY(), position.getX()));
|
||||
|
||||
System.out.println(position.getX());
|
||||
positionCalc = new GeodeticCalculator();
|
||||
positionCalc.setStartingGeographicPoint(position);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user