Merge remote-tracking branch 'origin/splitIntoTwoModules' into splitIntoTwoModules

This commit is contained in:
cbt24
2017-04-28 11:30:58 +12:00
144 changed files with 4168 additions and 2801 deletions
+3 -2
View File
@@ -1,4 +1,4 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -90,7 +90,8 @@
<version>2.4.3</version>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>seng302.App</Main-Class>
<X-Compile-Source-JDK>${maven.compiler.source}</X-Compile-Source-JDK>
-50
View File
@@ -29,54 +29,4 @@ public class App extends Application {
stage.show();
}
// /**
// * Loads and sets up the GUI elements
// *
// * @param primaryStage Base for all scenes
// * @throws Exception Error in initialising programme
// */
// @Override
// public void start(Stage primaryStage) throws Exception {
// this.primaryStage = primaryStage;
// primaryStage.minHeightProperty().setValue(600);
// primaryStage.minWidthProperty().setValue(780);
// //load the first container
// try {
// FXMLLoader loader = new FXMLLoader();
// InputStream in = getClass().getClassLoader().getResourceAsStream("scenes/main.fxml");
// mainContainer = (BorderPane) loader.load(in);
// mainScene = new Scene(mainContainer, 1200, 800);
// primaryStage.setScene(mainScene);
// primaryStage.sizeToScene();
// MainController mainController = (MainController) loader.getController();
// mainController.setParent(this);
// in.close();
// //add the center
// loadPane("race.fxml");
// } catch (Exception e) {
// e.printStackTrace();
// }
// primaryStage.show();
// }
//
// /**
// * Loads panes for use in the GUI
// *
// * @param fxmlName name of resource fxml file
// * @throws Exception critical error in loading file
// */
// public void loadPane(String fxmlName) throws Exception {
// FXMLLoader loader = new FXMLLoader();
// InputStream in = getClass().getClassLoader().getResourceAsStream("scenes/" + fxmlName);
// Parent page;
// try {
// page = (Parent) loader.load(in);
// } finally {
// in.close();
// }
// mainContainer.getChildren().remove(mainContainer.getCenter());
// mainContainer.setCenter(page);
// Controller controller = (Controller) loader.getController();
// controller.setParent(this);
// }
}
@@ -1,7 +1,6 @@
package seng302.Controllers;
import javafx.fxml.Initializable;
import seng302.App;
import java.net.URL;
import java.util.ResourceBundle;
@@ -25,7 +24,7 @@ public abstract class Controller implements Initializable {
/**
* Initialisation class that is run on start up.
*
* @param location resources location
* @param location resources location
* @param resources resources bundle
*/
@Override
@@ -1,11 +1,8 @@
package seng302.Controllers;
import javafx.fxml.FXML;
import javafx.scene.control.SplitPane;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.GridPane;
import seng302.RaceDataSource;
import seng302.RaceXMLReader;
import java.net.URL;
import java.util.ResourceBundle;
@@ -14,20 +11,20 @@ import java.util.ResourceBundle;
* Created by fwy13 on 15/03/2017.
*/
public class MainController extends Controller {
@FXML StartController startController;
@FXML RaceController raceController;
@FXML
StartController startController;
@FXML
RaceController raceController;
public void beginRace(int scaleFactor, RaceDataSource raceData) {
raceController.startRace(scaleFactor, raceData);
}
/**
* Main Controller for the applications will house the menu and the displayed pane.
*
* @param location of resources
* @param location of resources
* @param resources bundle
*/
@Override
@@ -1,25 +1,19 @@
package seng302.Controllers;
import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.*;
import javafx.scene.layout.GridPane;
import org.xml.sax.SAXException;
import seng302.Mock.StreamedRace;
import seng302.Model.*;
import seng302.Model.BoatInRace;
import seng302.Model.Race;
import seng302.Model.RaceClock;
import seng302.Model.ResizableRaceCanvas;
import seng302.RaceDataSource;
import seng302.RaceXMLReader;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.ResourceBundle;
/**
@@ -28,16 +22,11 @@ import java.util.ResourceBundle;
public class RaceController extends Controller {
@FXML
GridPane canvasBase;
//user saved data for annotation display
private ArrayList<Boolean> presetAnno;
ResizableRaceCanvas raceMap;
@FXML
SplitPane race;
@FXML
CheckBox showFPS;
@FXML
CheckBox showBoatPath;
@FXML
@@ -48,7 +37,6 @@ public class RaceController extends Controller {
Label FPS;
@FXML
Label timeZone;
@FXML
CheckBox showName;
@FXML
@@ -59,7 +47,6 @@ public class RaceController extends Controller {
Button saveAnno;
@FXML
Button showSetAnno;
@FXML
TableView<BoatInRace> boatInfoTable;
@FXML
@@ -70,6 +57,8 @@ public class RaceController extends Controller {
TableColumn<BoatInRace, String> boatMarkColumn;
@FXML
TableColumn<BoatInRace, String> boatSpeedColumn;
//user saved data for annotation display
private ArrayList<Boolean> presetAnno;
/**
* Updates the ResizableRaceCanvas (raceMap) with most recent data
@@ -17,7 +17,6 @@ import seng302.Mock.*;
import seng302.Model.BoatInRace;
import seng302.Model.RaceClock;
import seng302.RaceDataSource;
import seng302.RaceXMLReader;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
@@ -31,20 +30,28 @@ import java.util.ResourceBundle;
*/
public class StartController extends Controller {
@FXML private GridPane start;
@FXML private AnchorPane startWrapper;
@FXML private TableView<BoatInRace> boatNameTable;
@FXML private TableColumn<BoatInRace, String> boatNameColumn;
@FXML private TableColumn<BoatInRace, String> boatCodeColumn;
@FXML private Label timeZoneTime;
@FXML private Label timer;
@FXML private int PRERACE_TIME = 15000;
@FXML Button oneMinButton;
@FXML Button fiveMinButton;
@FXML Button fifteenMinButton;
@FXML
Button oneMinButton;
@FXML
Button fiveMinButton;
@FXML
Button fifteenMinButton;
@FXML
private GridPane start;
@FXML
private AnchorPane startWrapper;
@FXML
private TableView<BoatInRace> boatNameTable;
@FXML
private TableColumn<BoatInRace, String> boatNameColumn;
@FXML
private TableColumn<BoatInRace, String> boatCodeColumn;
@FXML
private Label timeZoneTime;
@FXML
private Label timer;
@FXML
private int PRERACE_TIME = 15000;
private RaceClock raceClock;
private RaceDataSource raceData;
@@ -71,7 +78,7 @@ public class StartController extends Controller {
startRace(1);
}
private void startRace(int raceScale){
private void startRace(int raceScale) {
oneMinButton.setDisable(true);
fiveMinButton.setDisable(true);
@@ -80,7 +87,7 @@ public class StartController extends Controller {
}
@Override
public void initialize(URL location, ResourceBundle resources){
public void initialize(URL location, ResourceBundle resources) {
raceData = null;
try {
StreamedCourse streamedCourse = new StreamedCourse(new BoatXMLReader("mockXML/boatXML/boatTest.xml"));
@@ -102,7 +109,7 @@ public class StartController extends Controller {
setRaceClock();
}
public AnchorPane startWrapper(){
public AnchorPane startWrapper() {
return startWrapper;
}
@@ -133,7 +140,7 @@ public class StartController extends Controller {
protected void countdownTimer(int scaleFactor) {
new AnimationTimer() {
long currentTime = System.currentTimeMillis();
long startTime = currentTime + (PRERACE_TIME/scaleFactor);
long startTime = currentTime + (PRERACE_TIME / scaleFactor);
long minutes;
long currentTimeInSeconds;
long remainingSeconds;
@@ -149,7 +156,7 @@ public class StartController extends Controller {
startWrapper.setVisible(false);
} else {
currentTimeInSeconds = (timeLeft*scaleFactor) / 1000;
currentTimeInSeconds = (timeLeft * scaleFactor) / 1000;
minutes = currentTimeInSeconds / 60;
remainingSeconds = currentTimeInSeconds % 60;
hours = minutes / 60;
@@ -3,13 +3,11 @@ package seng302.Mock;
import javafx.scene.paint.Color;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import seng302.XMLReader;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.lang.annotation.ElementType;
import java.text.ParseException;
import java.util.*;
@@ -17,16 +15,17 @@ import java.util.*;
* Created by Joseph on 24/04/2017.
*/
public class BoatXMLReader extends XMLReader {
private static int currentColourIndex = 0;
Map<Integer, StreamedBoat> streamedBoatMap = new HashMap<>();
Map<Integer, StreamedBoat> participants = new HashMap<>();
private List<Color> colours;
private static int currentColourIndex = 0;
/**
* Constructor for Boat XML Reader
*
* @param filePath path of the file
* @throws IOException error
* @throws SAXException error
* @throws IOException error
* @throws SAXException error
* @throws ParserConfigurationException error
*/
public BoatXMLReader(String filePath) throws IOException, SAXException, ParserConfigurationException, ParseException {
@@ -36,10 +35,11 @@ public class BoatXMLReader extends XMLReader {
/**
* Constructor for Boat XML Reader
*
* @param filePath file path to read
* @param read whether or not to read and store the files straight away.
* @throws IOException error
* @throws SAXException error
* @param read whether or not to read and store the files straight away.
* @throws IOException error
* @throws SAXException error
* @throws ParserConfigurationException error
*/
public BoatXMLReader(String filePath, boolean read) throws IOException, SAXException, ParserConfigurationException, ParseException {
@@ -98,7 +98,8 @@ public class BoatXMLReader extends XMLReader {
String shortName = null;
String country = null;
if (exists(boat, "Type")) type = boat.getAttributes().getNamedItem("Type").getTextContent();
if (exists(boat, "SourceID")) sourceID = Integer.parseInt(boat.getAttributes().getNamedItem("SourceID").getTextContent());
if (exists(boat, "SourceID"))
sourceID = Integer.parseInt(boat.getAttributes().getNamedItem("SourceID").getTextContent());
if (exists(boat, "BoatName")) boatName = boat.getAttributes().getNamedItem("BoatName").getTextContent();
if (exists(boat, "ShortName")) shortName = boat.getAttributes().getNamedItem("ShortName").getTextContent();
if (exists(boat, "Country")) country = boat.getAttributes().getNamedItem("Country").getTextContent();
@@ -3,7 +3,6 @@ package seng302.Mock;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import seng302.RaceDataSource;
import seng302.XMLReader;
import javax.xml.parsers.ParserConfigurationException;
@@ -17,9 +16,10 @@ public class RegattaXMLReader extends XMLReader {
/**
* Constructor for Regatta XML
*
* @param filePath path of the file
* @throws IOException error
* @throws SAXException error
* @throws IOException error
* @throws SAXException error
* @throws ParserConfigurationException error
*/
public RegattaXMLReader(String filePath) throws IOException, SAXException, ParserConfigurationException {
@@ -28,10 +28,11 @@ public class RegattaXMLReader extends XMLReader {
/**
* Constructor for Regatta XML
*
* @param filePath file path to read
* @param read whether or not to read and store the files straight away.
* @throws IOException error
* @throws SAXException error
* @param read whether or not to read and store the files straight away.
* @throws IOException error
* @throws SAXException error
* @throws ParserConfigurationException error
*/
public RegattaXMLReader(String filePath, boolean read) throws IOException, SAXException, ParserConfigurationException {
@@ -1,8 +1,6 @@
package seng302.Mock;
import javafx.scene.paint.Color;
import seng302.GPSCoordinate;
import seng302.Model.Boat;
import seng302.Model.BoatInRace;
/**
@@ -27,8 +25,9 @@ public class StreamedBoat extends BoatInRace {
/**
* Overridden to ignore this function
* @deprecated
*
* @return 0
* @deprecated
*/
public double getScaledVelocity() {
return 0;
@@ -36,8 +35,9 @@ public class StreamedBoat extends BoatInRace {
/**
* Overridden to ignore this function
* @deprecated
*
* @param velocity of boat
* @deprecated
*/
public void setScaledVelocity(double velocity) {
}
@@ -8,7 +8,8 @@ import seng302.Model.RaceClock;
import seng302.RaceDataSource;
import java.time.ZonedDateTime;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
/**
* Created by jjg64 on 21/04/17.
@@ -43,14 +44,14 @@ public class StreamedCourse implements RaceDataSource {
}
}
public void setRegattaXMLReader(RegattaXMLReader regattaXMLReader) {
this.regattaXMLReader = regattaXMLReader;
}
public RegattaXMLReader getRegattaXMLReader() {
return regattaXMLReader;
}
public void setRegattaXMLReader(RegattaXMLReader regattaXMLReader) {
this.regattaXMLReader = regattaXMLReader;
}
public List<BoatInRace> getBoats() {
return new ArrayList<>(boatXMLReader.getStreamedBoatMap().values());
}
@@ -1,14 +1,10 @@
package seng302.Mock;
import javafx.collections.FXCollections;
import seng302.Controllers.RaceController;
import seng302.Model.BoatInRace;
import seng302.Model.Leg;
import seng302.Model.Race;
import seng302.RaceDataSource;
import java.util.*;
/**
* Created by jjg64 on 21/04/17.
*/
@@ -26,6 +22,7 @@ public class StreamedRace extends Race {
/**
* Checks if the boat cannot finish the race
*
* @return True if boat cannot finish the race
*/
protected boolean doNotFinish() {
@@ -46,7 +43,7 @@ public class StreamedRace extends Race {
/**
* Updates the boat's gps coordinates
*
* @param boat to be updated
* @param boat to be updated
* @param millisecondsElapsed time since last update
*/
protected void updatePosition(BoatInRace boat, int millisecondsElapsed) {
@@ -18,7 +18,7 @@ public class Boat {
*
* @param name Name of the Boat.
* @param velocity Speed in m/s that the boat travels at.
* @param abbrev nam abbreviation
* @param abbrev nam abbreviation
*/
public Boat(String name, double velocity, String abbrev) {
this.velocity = velocity;
@@ -30,7 +30,7 @@ public class Boat {
/**
* Boat initialiser which keeps all of the information of the boat.
*
* @param name Name of the Boat.
* @param name Name of the Boat.
* @param abbrev nam abbreviation
*/
public Boat(String name, String abbrev) {
@@ -17,8 +17,10 @@ import java.util.concurrent.ConcurrentLinkedQueue;
*/
public class BoatInRace extends Boat {
protected static final float BASE_TRACK_POINT_TIME_INTERVAL = 5000;
protected static float trackPointTimeInterval = 5000; // every 1 seconds
protected final int TRACK_POINT_LIMIT = 10;
protected Leg currentLeg;
private double scaledVelocity;
protected double distanceTravelledInLeg;
protected GPSCoordinate currentPosition;
protected long timeFinished;
@@ -28,14 +30,10 @@ public class BoatInRace extends Boat {
protected boolean started = false;
protected StringProperty position;
protected double heading;
protected Queue<TrackPoint> track = new ConcurrentLinkedQueue<>();
protected long nextValidTime = 0;
protected static final float BASE_TRACK_POINT_TIME_INTERVAL = 5000;
protected static float trackPointTimeInterval = 5000; // every 1 seconds
protected final int TRACK_POINT_LIMIT = 10;
protected boolean trackVisible = true;
private double scaledVelocity;
/**
* Constructor method.
@@ -43,7 +41,7 @@ public class BoatInRace extends Boat {
* @param name Name of the boat.
* @param velocity Speed that the boat travels.
* @param colour Colour the boat will be displayed as on the map
* @param abbrev of boat
* @param abbrev of boat
*/
public BoatInRace(String name, double velocity, Color colour, String abbrev) {
super(name, velocity, abbrev);
@@ -55,8 +53,8 @@ public class BoatInRace extends Boat {
/**
* Constructor method.
*
* @param name Name of the boat.
* @param colour Colour the boat will be displayed as on the map
* @param name Name of the boat.
* @param colour Colour the boat will be displayed as on the map
* @param abbrev of boat
*/
public BoatInRace(String name, Color colour, String abbrev) {
@@ -66,6 +64,38 @@ public class BoatInRace extends Boat {
position = new SimpleStringProperty("-");
}
/**
* Converts an azimuth to a bearing
*
* @param azimuth azimuth value to be converted
* @return the bearings in degrees (0 to 360).
*/
public static double calculateHeading(double azimuth) {
if (azimuth >= 0) {
return azimuth;
} else {
return azimuth + 360;
}
}
/**
* Get base track point time interval
*
* @return base track point time interval
*/
public static float getBaseTrackPointTimeInterval() {
return BASE_TRACK_POINT_TIME_INTERVAL;
}
/**
* Set track point time interval
*
* @param value track point time interval value
*/
public static void setTrackPointTimeInterval(float value) {
trackPointTimeInterval = value;
}
/**
* Calculates the azimuth of the travel via map coordinates of the raceMarkers
*
@@ -83,20 +113,6 @@ public class BoatInRace extends Boat {
return calc.getAzimuth();
}
/**
* Converts an azimuth to a bearing
*
* @param azimuth azimuth value to be converted
* @return the bearings in degrees (0 to 360).
*/
public static double calculateHeading(double azimuth) {
if (azimuth >= 0) {
return azimuth;
} else {
return azimuth + 360;
}
}
public double getHeading() {
return heading;
}
@@ -276,16 +292,17 @@ public class BoatInRace extends Boat {
return position.get();
}
public StringProperty positionProperty() {
return position;
}
public void setPosition(String position) {
this.position.set(position);
}
public StringProperty positionProperty() {
return position;
}
/**
* Adds a new point to boat's track.
*
* @param coordinate of point on track
* @return whether add is successful
* @see seng302.Model.TrackPoint
@@ -302,6 +319,7 @@ public class BoatInRace extends Boat {
/**
* Returns the boat's sampled track between start of race and current time.
*
* @return queue of track points
* @see seng302.Model.TrackPoint
*/
@@ -311,6 +329,7 @@ public class BoatInRace extends Boat {
/**
* Returns whether track is visible
*
* @return true if visible
*/
public boolean isTrackVisible() {
@@ -319,25 +338,10 @@ public class BoatInRace extends Boat {
/**
* Sets track visibility.
*
* @param trackVisible visible if true.
*/
public void setTrackVisible(boolean trackVisible) {
this.trackVisible = trackVisible;
}
/**
* Get base track point time interval
* @return base track point time interval
*/
public static float getBaseTrackPointTimeInterval() {
return BASE_TRACK_POINT_TIME_INTERVAL;
}
/**
* Set track point time interval
* @param value track point time interval value
*/
public static void setTrackPointTimeInterval(float value) {
trackPointTimeInterval = value;
}
}
@@ -25,9 +25,9 @@ public class ConstantVelocityRace extends Race {
* Initialiser for a constant velocity race without standard data source
*
* @param startingBoats in race
* @param legs in race
* @param controller for graphics
* @param scaleFactor of timer
* @param legs in race
* @param controller for graphics
* @param scaleFactor of timer
*/
public ConstantVelocityRace(List<BoatInRace> startingBoats, List<Leg> legs, RaceController controller, int scaleFactor) {
super(startingBoats, legs, controller, scaleFactor);
@@ -37,10 +37,9 @@ public class ConstantVelocityRace extends Race {
* Initialiser for legacy tests
*
* @param startingBoats in race
* @param legs in race
* @param controller for graphics
* @param scaleFactor of timer
*
* @param legs in race
* @param controller for graphics
* @param scaleFactor of timer
* @deprecated Please use {@link #ConstantVelocityRace(List, List, RaceController, int) } for future tests.
*/
public ConstantVelocityRace(BoatInRace[] startingBoats, List<Leg> legs, RaceController controller, int scaleFactor) {
@@ -49,14 +48,39 @@ public class ConstantVelocityRace extends Race {
/**
* Initialiser for constant velocity race with standard data source
* @param raceData for race
* @param controller for graphics
*
* @param raceData for race
* @param controller for graphics
* @param scaleFactor of timer
*/
public ConstantVelocityRace(RaceDataSource raceData, RaceController controller, int scaleFactor) {
super(raceData, controller, scaleFactor);
}
/**
* Calculates the boats next GPS position based on its distance travelled and heading
*
* @param oldCoordinates GPS coordinates of the boat's starting position
* @param distanceTravelled distance in nautical miles
* @param azimuth boat's current direction. Value between -180 and 180
* @return The boat's new coordinate
*/
public static GPSCoordinate calculatePosition(GPSCoordinate oldCoordinates, double distanceTravelled, double azimuth) {
//Find new coordinate using current heading and distance
GeodeticCalculator geodeticCalculator = new GeodeticCalculator();
//Load start point into calculator
Point2D startPoint = new Point2D.Double(oldCoordinates.getLongitude(), oldCoordinates.getLatitude());
geodeticCalculator.setStartingGeographicPoint(startPoint);
//load direction and distance tranvelled into calculator
geodeticCalculator.setDirection(azimuth, distanceTravelled * Constants.NMToMetersConversion);
//get new point
Point2D endPoint = geodeticCalculator.getDestinationGeographicPoint();
return new GPSCoordinate(endPoint.getY(), endPoint.getX());
}
public void initialiseBoats() {
Leg officialStart = legs.get(0);
String name = officialStart.getName();
@@ -115,6 +139,7 @@ public class ConstantVelocityRace extends Race {
/**
* Sets the chance each boat has of failing at a gate or marker
*
* @param chance percentage chance a boat has of failing per checkpoint.
*/
protected void setDnfChance(int chance) {
@@ -131,7 +156,7 @@ public class ConstantVelocityRace extends Race {
/**
* Calculates the distance a boat has travelled and updates its current position according to this value.
*
* @param boat to be updated
* @param boat to be updated
* @param millisecondsElapsed since last update
*/
protected void updatePosition(BoatInRace boat, int millisecondsElapsed) {
@@ -181,28 +206,4 @@ public class ConstantVelocityRace extends Race {
}
}
/**
* Calculates the boats next GPS position based on its distance travelled and heading
*
* @param oldCoordinates GPS coordinates of the boat's starting position
* @param distanceTravelled distance in nautical miles
* @param azimuth boat's current direction. Value between -180 and 180
* @return The boat's new coordinate
*/
public static GPSCoordinate calculatePosition(GPSCoordinate oldCoordinates, double distanceTravelled, double azimuth) {
//Find new coordinate using current heading and distance
GeodeticCalculator geodeticCalculator = new GeodeticCalculator();
//Load start point into calculator
Point2D startPoint = new Point2D.Double(oldCoordinates.getLongitude(), oldCoordinates.getLatitude());
geodeticCalculator.setStartingGeographicPoint(startPoint);
//load direction and distance tranvelled into calculator
geodeticCalculator.setDirection(azimuth, distanceTravelled * Constants.NMToMetersConversion);
//get new point
Point2D endPoint = geodeticCalculator.getDestinationGeographicPoint();
return new GPSCoordinate(endPoint.getY(), endPoint.getX());
}
}
@@ -17,9 +17,9 @@ public class Leg {
/**
* Leg Initialiser
*
* @param name Name of the Leg
* @param start marker
* @param end marker
* @param name Name of the Leg
* @param start marker
* @param end marker
* @param number Leg's position in race
*/
public Leg(String name, Marker start, Marker end, int number) {
@@ -33,7 +33,7 @@ public class Leg {
/**
* Construction Method
*
* @param name Name of the Leg
* @param name Name of the Leg
* @param number leg number
*/
public Leg(String name, int number) {
@@ -74,16 +74,14 @@ public class Leg {
return startMarker;
}
public void setStartMarker(Marker startMarker) {
this.startMarker = startMarker;
}
public Marker getEndMarker() {
return endMarker;
}
public void setStartMarker(Marker startMarker) {
this.startMarker = startMarker;
}
public void setEndMarker(Marker endMarker) {
this.endMarker = endMarker;
}
@@ -5,16 +5,11 @@ import javafx.animation.AnimationTimer;
import javafx.application.Platform;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import org.geotools.referencing.GeodeticCalculator;
import seng302.Controllers.RaceController;
import seng302.GPSCoordinate;
import seng302.RaceDataSource;
import java.awt.geom.Point2D;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
/**
* Parent class for races
@@ -27,19 +22,17 @@ public abstract class Race implements Runnable {
protected RaceController controller;
protected int boatsFinished = 0;
protected long totalTimeElapsed;
private int lastFPS = 20;
protected int scaleFactor;
protected int PRERACE_TIME = 120000; //time in milliseconds to pause during pre-race
private int lastFPS = 20;
private boolean timerEnabled = true; //boolean to determine if timer is ran
/**
* Initailiser for Race
*
* @param boats Takes in an array of boats that are participating in the race.
* @param legs Number of marks in order that the boats pass in order to complete the race.
* @param controller race controller
* @param boats Takes in an array of boats that are participating in the race.
* @param legs Number of marks in order that the boats pass in order to complete the race.
* @param controller race controller
* @param scaleFactor for race
*/
public Race(List<BoatInRace> boats, List<Leg> legs, RaceController controller, int scaleFactor) {
@@ -66,6 +59,7 @@ public abstract class Race implements Runnable {
/**
* Checks if the boat cannot finish the race
*
* @return True if boat cannot finish the race
*/
protected abstract boolean doNotFinish();
@@ -82,7 +76,7 @@ public abstract class Race implements Runnable {
/**
* Updates the boat's gps coordinates
*
* @param boat to be updated
* @param boat to be updated
* @param millisecondsElapsed time since last update
*/
protected abstract void updatePosition(BoatInRace boat, int millisecondsElapsed);
@@ -111,7 +105,7 @@ public abstract class Race implements Runnable {
protected void countdownTimer() {
new AnimationTimer() {
long currentTime = System.currentTimeMillis();
long startTime = currentTime + (PRERACE_TIME/scaleFactor);
long startTime = currentTime + (PRERACE_TIME / scaleFactor);
long minutes;
long currentTimeInSeconds;
long remainingSeconds;
@@ -120,22 +114,22 @@ public abstract class Race implements Runnable {
@Override
public void handle(long arg0) {
timeLeft = startTime - currentTime;
if (timeLeft <= 0 && controller != null) {
updateTime("Race is starting...");
stop();
simulateRace();
} else {
currentTimeInSeconds = (timeLeft*scaleFactor) / 1000;
minutes = currentTimeInSeconds / 60;
remainingSeconds = currentTimeInSeconds % 60;
hours = minutes / 60;
minutes = minutes % 60;
if (controller != null) {
updateTime(String.format("Race clock: -%02d:%02d:%02d", hours, minutes, remainingSeconds));
}
timeLeft = startTime - currentTime;
if (timeLeft <= 0 && controller != null) {
updateTime("Race is starting...");
stop();
simulateRace();
} else {
currentTimeInSeconds = (timeLeft * scaleFactor) / 1000;
minutes = currentTimeInSeconds / 60;
remainingSeconds = currentTimeInSeconds % 60;
hours = minutes / 60;
minutes = minutes % 60;
if (controller != null) {
updateTime(String.format("Race clock: -%02d:%02d:%02d", hours, minutes, remainingSeconds));
}
currentTime = System.currentTimeMillis();
}
currentTime = System.currentTimeMillis();
}
}.start();
}
@@ -234,8 +228,8 @@ public abstract class Race implements Runnable {
*/
protected void updatePositions() {
FXCollections.sort(startingBoats, (a, b) -> b.getCurrentLeg().getLegNumber() - a.getCurrentLeg().getLegNumber());
for(BoatInRace boat: startingBoats) {
if(boat != null) {
for (BoatInRace boat : startingBoats) {
if (boat != null) {
boat.setPosition(Integer.toString(startingBoats.indexOf(boat) + 1));
if (boat.getCurrentLeg().getName().equals("DNF") || boat.getCurrentLeg().getLegNumber() == 0)
boat.setPosition("-");
@@ -12,7 +12,6 @@ import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAmount;
/**
* Created by Gondr on 19/04/2017.
@@ -39,6 +38,7 @@ public class RaceClock {
/**
* Sets time to arbitrary zoned time.
*
* @param time arbitrary time with timezone.
*/
public void setTime(ZonedDateTime time) {
@@ -13,9 +13,10 @@ public class TrackPoint {
/**
* Creates a new track point with fixed GPS coordinates and time, to reach minimum opacity on expiry.
*
* @param coordinate position of point on physical race map
* @param timeAdded system clock at time of addition
* @param expiry time to minimum opacity after added
* @param timeAdded system clock at time of addition
* @param expiry time to minimum opacity after added
*/
public TrackPoint(GPSCoordinate coordinate, long timeAdded, long expiry) {
this.coordinate = coordinate;
@@ -26,6 +27,7 @@ public class TrackPoint {
/**
* Gets the position of the point on physical race map.
*
* @return GPS coordinate of point
*/
public GPSCoordinate getCoordinate() {
@@ -34,14 +36,16 @@ public class TrackPoint {
/**
* Gets opacity of point scaled by age in proportion to expiry, between 1 and minimum opacity inclusive.
*
* @return greater of minimum opacity and scaled opacity
*/
public double getAlpha() {
return Double.max(minAlpha,1.0 - (double)(System.currentTimeMillis() - timeAdded) / expiry);
return Double.max(minAlpha, 1.0 - (double) (System.currentTimeMillis() - timeAdded) / expiry);
}
/**
* Gets time point was added to track.
*
* @return system clock at time of addition
*/
public long getTimeAdded() {
@@ -16,14 +16,14 @@ public class BinaryMesageEncoder {
private byte[] message;
//private byte[] crc;
private byte headerSync1 = (byte)0x47;
private byte headerSync2 = (byte)0x83;
private byte headerSync1 = (byte) 0x47;
private byte headerSync2 = (byte) 0x83;
private byte headerMessageType;
private long headerTimeStamp;
private int headerSourceID;
private short headerMessageLength;
public BinaryMesageEncoder(MessageType headerMessageType, long headerTimeStamp, int headerSourceID, short headerMessageLength, byte[] message){
public BinaryMesageEncoder(MessageType headerMessageType, long headerTimeStamp, int headerSourceID, short headerMessageLength, byte[] message) {
//set the header
this.headerMessageType = headerMessageType.getValue();
this.headerTimeStamp = headerTimeStamp;
@@ -45,7 +45,7 @@ public class BinaryMesageEncoder {
this.message = message;
//set full message
ByteBuffer tempMessageByteBuffer = ByteBuffer.allocate(19+this.headerMessageLength);
ByteBuffer tempMessageByteBuffer = ByteBuffer.allocate(19 + this.headerMessageLength);
tempMessageByteBuffer.put(this.header);
tempMessageByteBuffer.put(this.message);
@@ -25,7 +25,7 @@ public class BinaryMessageDecoder {
this.fullMessage = fullMessage;
}
public void decode() throws IndexOutOfBoundsException{
public void decode() throws IndexOutOfBoundsException {
//get the header
this.header = Arrays.copyOfRange(this.fullMessage, 0, 15);
@@ -43,37 +43,37 @@ public class BinaryMessageDecoder {
this.crc = Arrays.copyOfRange(this.fullMessage, this.fullMessage.length - 4, fullMessage.length);
//run through the checks
if (this.message.length != bytesToShort(this.headerMessageLength)){
if (this.message.length != bytesToShort(this.headerMessageLength)) {
System.err.println("message length in header does not equal the message length");
System.err.println("message length in header: " + bytesToInt(this.headerMessageLength));
System.err.println("message length: " + this.message.length);
}else if(this.headerSync1 != 0x47){
} else if (this.headerSync1 != 0x47) {
System.err.println("Sync byte 1 is wrong");
}else if(this.headerSync2 !=(byte) 0x83){
} else if (this.headerSync2 != (byte) 0x83) {
System.err.println("Sync byte 2 is wrong");
}else if(false){
} else if (false) {
//todo check crc
}
}
private short bytesToShort(byte[] bytesShort){
private short bytesToShort(byte[] bytesShort) {
ByteBuffer wrapped = ByteBuffer.wrap(bytesShort);
short num = wrapped.getShort();
return num;
}
private int bytesToInt(byte[] bytesInt){
private int bytesToInt(byte[] bytesInt) {
ByteBuffer wrapped = ByteBuffer.wrap(bytesInt);
int num = wrapped.getInt();
return num;
}
private long bytesToLong(byte[] bytesLong){
private long bytesToLong(byte[] bytesLong) {
ByteBuffer byteBuffer = ByteBuffer.allocate(8);
byteBuffer.order(ByteOrder.BIG_ENDIAN);
byteBuffer.put((byte)0);
byteBuffer.put((byte)0);
byteBuffer.put((byte) 0);
byteBuffer.put((byte) 0);
byteBuffer.put(bytesLong[0]);
byteBuffer.put(bytesLong[1]);
byteBuffer.put(bytesLong[2]);
@@ -96,7 +96,7 @@ public class BinaryMessageDecoder {
return bytesToShort(this.headerMessageLength);
}
public int getMessageType(){
public int getMessageType() {
return (int) this.headerMessageType;
}
@@ -42,66 +42,66 @@ public class BoatLocationDecoder {
seqNum = Arrays.copyOfRange(encodedBoatLocation, 11, 15);
deviceType = encodedBoatLocation[15];
latitude = Arrays.copyOfRange(encodedBoatLocation, 16, 20);
longitude = Arrays.copyOfRange(encodedBoatLocation,20, 24);
longitude = Arrays.copyOfRange(encodedBoatLocation, 20, 24);
altitude = Arrays.copyOfRange(encodedBoatLocation, 24, 28);
heading = Arrays.copyOfRange(encodedBoatLocation,28, 30);
pitch =Arrays.copyOfRange(encodedBoatLocation,30,32);
roll = Arrays.copyOfRange(encodedBoatLocation,32,34);
boatSpeed = Arrays.copyOfRange(encodedBoatLocation,34,36);
cog = Arrays.copyOfRange(encodedBoatLocation,36,38);
sog = Arrays.copyOfRange(encodedBoatLocation,38, 40);
heading = Arrays.copyOfRange(encodedBoatLocation, 28, 30);
pitch = Arrays.copyOfRange(encodedBoatLocation, 30, 32);
roll = Arrays.copyOfRange(encodedBoatLocation, 32, 34);
boatSpeed = Arrays.copyOfRange(encodedBoatLocation, 34, 36);
cog = Arrays.copyOfRange(encodedBoatLocation, 36, 38);
sog = Arrays.copyOfRange(encodedBoatLocation, 38, 40);
apparentWindSpeed = Arrays.copyOfRange(encodedBoatLocation, 40, 42);
apparentWindAngle = Arrays.copyOfRange(encodedBoatLocation, 42, 44);
trueWindSpeed = Arrays.copyOfRange(encodedBoatLocation,44, 46);
trueWindSpeed = Arrays.copyOfRange(encodedBoatLocation, 44, 46);
trueWindDirection = Arrays.copyOfRange(encodedBoatLocation, 46, 48);
trueWindAngle = Arrays.copyOfRange(encodedBoatLocation, 48, 50);
currentDrift = Arrays.copyOfRange(encodedBoatLocation,50,52);
currentSet = Arrays.copyOfRange(encodedBoatLocation,52, 54);
rudderAngle = Arrays.copyOfRange(encodedBoatLocation,54, 56);
currentDrift = Arrays.copyOfRange(encodedBoatLocation, 50, 52);
currentSet = Arrays.copyOfRange(encodedBoatLocation, 52, 54);
rudderAngle = Arrays.copyOfRange(encodedBoatLocation, 54, 56);
message = new BoatLocationMessage(messageVersionNumber, bytesToLong(time),
bytesToInt(sourceID), bytesToInt(seqNum),
deviceType, bytesToInt(latitude),
bytesToInt(longitude), bytesToInt(altitude),
twoByteToInt(heading), bytesToShort(pitch),
bytesToShort(roll), twoByteToInt(boatSpeed),
twoByteToInt(cog), twoByteToInt(sog),
twoByteToInt(apparentWindSpeed), bytesToShort(apparentWindAngle),
twoByteToInt(trueWindSpeed), bytesToShort(trueWindDirection),
bytesToShort(trueWindAngle), twoByteToInt(currentDrift),
twoByteToInt(currentSet), bytesToShort(rudderAngle)
bytesToInt(sourceID), bytesToInt(seqNum),
deviceType, bytesToInt(latitude),
bytesToInt(longitude), bytesToInt(altitude),
twoByteToInt(heading), bytesToShort(pitch),
bytesToShort(roll), twoByteToInt(boatSpeed),
twoByteToInt(cog), twoByteToInt(sog),
twoByteToInt(apparentWindSpeed), bytesToShort(apparentWindAngle),
twoByteToInt(trueWindSpeed), bytesToShort(trueWindDirection),
bytesToShort(trueWindAngle), twoByteToInt(currentDrift),
twoByteToInt(currentSet), bytesToShort(rudderAngle)
);
}
private int twoByteToInt(byte[] bytesInt){
private int twoByteToInt(byte[] bytesInt) {
ByteBuffer byteBuffer = ByteBuffer.allocate(4);
byteBuffer.order(ByteOrder.BIG_ENDIAN);
byteBuffer.put((byte)0);
byteBuffer.put((byte)0);
byteBuffer.put((byte) 0);
byteBuffer.put((byte) 0);
byteBuffer.put(bytesInt);
int num = byteBuffer.getInt(0);
return num;
}
private int bytesToInt(byte[] bytesInt){
private int bytesToInt(byte[] bytesInt) {
ByteBuffer wrapped = ByteBuffer.wrap(bytesInt);
int num = wrapped.getInt();
return num;
}
private short bytesToShort(byte[] bytesShort){
private short bytesToShort(byte[] bytesShort) {
ByteBuffer wrapped = ByteBuffer.wrap(bytesShort);
short num = wrapped.getShort();
return num;
}
private long bytesToLong(byte[] bytesLong){
private long bytesToLong(byte[] bytesLong) {
ByteBuffer byteBuffer = ByteBuffer.allocate(8);
byteBuffer.order(ByteOrder.BIG_ENDIAN);
byteBuffer.put((byte)0);
byteBuffer.put((byte)0);
byteBuffer.put((byte) 0);
byteBuffer.put((byte) 0);
byteBuffer.put(bytesLong);
// byteBuffer.put(bytesLong[0]);
// byteBuffer.put(bytesLong[1]);
@@ -22,11 +22,11 @@ public class CourseWindDecoder {
messageVersionNumber = encodedCourseWind[0];
byteWindID = encodedCourseWind[1];
loopCount = encodedCourseWind[2];
byte[] loopMessagesBytes = Arrays.copyOfRange(encodedCourseWind, 3, lengthInBytesOfMessages*loopCount+3);
byte[] loopMessagesBytes = Arrays.copyOfRange(encodedCourseWind, 3, lengthInBytesOfMessages * loopCount + 3);
int messageLoopIndex = 0;
for (int i=0; i < loopCount; i++) {
byte[] messageBytes = Arrays.copyOfRange(loopMessagesBytes, messageLoopIndex, messageLoopIndex+20);
for (int i = 0; i < loopCount; i++) {
byte[] messageBytes = Arrays.copyOfRange(loopMessagesBytes, messageLoopIndex, messageLoopIndex + 20);
ArrayList test = new ArrayList();
byte[] windId = Arrays.copyOfRange(messageBytes, 0, 1);
byte[] time = Arrays.copyOfRange(messageBytes, 1, 7);
@@ -38,20 +38,20 @@ public class CourseWindDecoder {
byte[] flags = Arrays.copyOfRange(messageBytes, 19, 20);
CourseWind message = new CourseWind(windId[0], bytesToLong(time),
bytesToInt(raceID), twoByteToInt(windDirection),
twoByteToInt(windSpeed), twoByteToInt(bestUpwindAngle),
twoByteToInt(bestDownwindAngle), flags[0]);
bytesToInt(raceID), twoByteToInt(windDirection),
twoByteToInt(windSpeed), twoByteToInt(bestUpwindAngle),
twoByteToInt(bestDownwindAngle), flags[0]);
loopMessages.add(message);
messageLoopIndex += 20;
}
}
private int twoByteToInt(byte[] bytesInt){
private int twoByteToInt(byte[] bytesInt) {
ByteBuffer byteBuffer = ByteBuffer.allocate(4);
byteBuffer.order(ByteOrder.BIG_ENDIAN);
byteBuffer.put((byte)0);
byteBuffer.put((byte)0);
byteBuffer.put((byte) 0);
byteBuffer.put((byte) 0);
byteBuffer.put(bytesInt);
int num = byteBuffer.getInt(0);
@@ -59,17 +59,17 @@ public class CourseWindDecoder {
}
private int bytesToInt(byte[] bytesInt){
private int bytesToInt(byte[] bytesInt) {
ByteBuffer wrapped = ByteBuffer.wrap(bytesInt);
int num = wrapped.getInt();
return num;
}
private long bytesToLong(byte[] bytesLong){
private long bytesToLong(byte[] bytesLong) {
ByteBuffer byteBuffer = ByteBuffer.allocate(8);
byteBuffer.order(ByteOrder.BIG_ENDIAN);
byteBuffer.put((byte)0);
byteBuffer.put((byte)0);
byteBuffer.put((byte) 0);
byteBuffer.put((byte) 0);
byteBuffer.put(bytesLong[0]);
byteBuffer.put(bytesLong[1]);
byteBuffer.put(bytesLong[2]);
@@ -1,10 +1,7 @@
package seng302.Networking.MessageDecoders;
import seng302.Model.BoatInRace;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.Arrays;
/**
@@ -40,32 +37,32 @@ public class RaceStartStatusDecoder {
notification = byteToChar(notificationType);
}
private char byteToChar(byte bytesInt){
private char byteToChar(byte bytesInt) {
ByteBuffer byteBuffer = ByteBuffer.allocate(4);
byteBuffer.order(ByteOrder.BIG_ENDIAN);
byteBuffer.put((byte)0);
byteBuffer.put((byte) 0);
byteBuffer.put(bytesInt);
char num = byteBuffer.getChar(0);
return num;
}
private short bytesToShort(byte[] bytesShort){
private short bytesToShort(byte[] bytesShort) {
ByteBuffer wrapped = ByteBuffer.wrap(bytesShort);
short num = wrapped.getShort();
return num;
}
private int bytesToInt(byte[] bytesInt){
private int bytesToInt(byte[] bytesInt) {
ByteBuffer wrapped = ByteBuffer.wrap(bytesInt);
int num = wrapped.getInt();
return num;
}
private long bytesToLong(byte[] bytesLong){
private long bytesToLong(byte[] bytesLong) {
ByteBuffer byteBuffer = ByteBuffer.allocate(8);
byteBuffer.order(ByteOrder.BIG_ENDIAN);
byteBuffer.put((byte)0);
byteBuffer.put((byte)0);
byteBuffer.put((byte) 0);
byteBuffer.put((byte) 0);
byteBuffer.put(bytesLong[0]);
byteBuffer.put(bytesLong[1]);
byteBuffer.put(bytesLong[2]);
@@ -33,7 +33,7 @@ public class RaceStatusDecoder {
private ArrayList<BoatStatus> boats = new ArrayList<>();
public RaceStatusDecoder(byte[] encodedRaceStatus){
public RaceStatusDecoder(byte[] encodedRaceStatus) {
versionNum = encodedRaceStatus[0];
timeBytes = Arrays.copyOfRange(encodedRaceStatus, 1, 7);
raceID = Arrays.copyOfRange(encodedRaceStatus, 7, 11);
@@ -43,7 +43,7 @@ public class RaceStatusDecoder {
windSpeed = Arrays.copyOfRange(encodedRaceStatus, 20, 22);
numBoats = encodedRaceStatus[22];
bytesRaceType = encodedRaceStatus[23];
boatsBytes = Arrays.copyOfRange(encodedRaceStatus, 24, 25+20*this.numBoats);
boatsBytes = Arrays.copyOfRange(encodedRaceStatus, 24, 25 + 20 * this.numBoats);
time = bytesToLong(timeBytes);
race = bytesToInt(raceID);
@@ -55,8 +55,8 @@ public class RaceStatusDecoder {
int boatLoopIndex = 0;
for (int i=0; i < numberOfBoats; i++) {
byte[] boatBytes = Arrays.copyOfRange(boatsBytes, boatLoopIndex, boatLoopIndex+20);
for (int i = 0; i < numberOfBoats; i++) {
byte[] boatBytes = Arrays.copyOfRange(boatsBytes, boatLoopIndex, boatLoopIndex + 20);
byte[] sourceID = Arrays.copyOfRange(boatBytes, 1, 5);
byte boatStatus = boatBytes[5];
@@ -66,7 +66,7 @@ public class RaceStatusDecoder {
byte[] estTimeAtNextMark = Arrays.copyOfRange(boatBytes, 9, 15);
byte[] estTimeAtFinish = Arrays.copyOfRange(boatBytes, 15, 20);
BoatStatus boat = new BoatStatus(bytesToInt(sourceID),boatStatus,
BoatStatus boat = new BoatStatus(bytesToInt(sourceID), boatStatus,
legNumber, numPenaltiesAwarded, numPenaltiesServed,
bytesToLong(estTimeAtNextMark), bytesToLong(estTimeAtFinish));
@@ -75,24 +75,24 @@ public class RaceStatusDecoder {
}
}
private int byteToInt(byte bytesInt){
private int byteToInt(byte bytesInt) {
ByteBuffer byteBuffer = ByteBuffer.allocate(4);
byteBuffer.order(ByteOrder.BIG_ENDIAN);
byteBuffer.put((byte)0);
byteBuffer.put((byte)0);
byteBuffer.put((byte)0);
byteBuffer.put((byte) 0);
byteBuffer.put((byte) 0);
byteBuffer.put((byte) 0);
byteBuffer.put(bytesInt);
int intVal = byteBuffer.getInt(0);
return intVal;
}
private short bytesToShort(byte[] bytesShort){
private short bytesToShort(byte[] bytesShort) {
ByteBuffer wrapped = ByteBuffer.wrap(bytesShort);
short num = wrapped.getShort();
return num;
}
private int bytesToInt(byte[] bytesInt){
private int bytesToInt(byte[] bytesInt) {
ByteBuffer wrapped = ByteBuffer.wrap(bytesInt);
int num = wrapped.getInt();
return num;
@@ -22,7 +22,7 @@ public class XMLMessageDecoder {
this.bytes = bytes;
}
public void decode(){
public void decode() {
byte[] ackNumberBytes = Arrays.copyOfRange(bytes, 1, 3);
byte[] timeStampBytes = Arrays.copyOfRange(bytes, 3, 9);
byte[] sequenceNumberBytes = Arrays.copyOfRange(bytes, 10, 12);
@@ -40,7 +40,7 @@ public class XMLMessageDecoder {
this.xmlMessage = new String(xmlMessagebytes);
}
private short bytesToShort(byte[] bytesShort){
private short bytesToShort(byte[] bytesShort) {
ByteBuffer byteBuffer = ByteBuffer.allocate(2);
byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
byteBuffer.put(bytesShort[0]);
@@ -49,11 +49,11 @@ public class XMLMessageDecoder {
return shortVal;
}
private long bytesToLong(byte[] bytesLong){
private long bytesToLong(byte[] bytesLong) {
ByteBuffer byteBuffer = ByteBuffer.allocate(8);
byteBuffer.order(ByteOrder.BIG_ENDIAN);
byteBuffer.put((byte)0);
byteBuffer.put((byte)0);
byteBuffer.put((byte) 0);
byteBuffer.put((byte) 0);
byteBuffer.put(bytesLong[0]);
byteBuffer.put(bytesLong[1]);
byteBuffer.put(bytesLong[2]);
@@ -15,15 +15,15 @@ import java.util.Arrays;
*/
public class RaceVisionByteEncoder {
public byte[] heartBeat(int seq){
public byte[] heartBeat(int seq) {
ByteBuffer heartBeat = ByteBuffer.allocate(4);
heartBeat.putInt(seq);
byte [] result = heartBeat.array();
byte[] result = heartBeat.array();
return result;
}
public byte[] raceStatus(long time, int race, int raceState, long startTime, short raceWindDir, short raceWindSpeed, int raceType, ArrayList<BoatInRace> boats){
ByteBuffer raceStatusMessage = ByteBuffer.allocate(24 + 20*boats.size());
public byte[] raceStatus(long time, int race, int raceState, long startTime, short raceWindDir, short raceWindSpeed, int raceType, ArrayList<BoatInRace> boats) {
ByteBuffer raceStatusMessage = ByteBuffer.allocate(24 + 20 * boats.size());
//Version Number 1 bytes
byte versionNum = 0b10; //this changes with the pdf. (2)
byte[] timeBytes = convert(time, 6);//time (6 bytes)
@@ -45,12 +45,12 @@ public class RaceVisionByteEncoder {
raceStatusMessage.put(numBoats);
raceStatusMessage.put(bytesRaceType);
for (int i = 0; i < boats.size(); i++){
for (int i = 0; i < boats.size(); i++) {
int sourceID = 0; //TODO use boats source id.
byte[] legNum = convert(boats.get(i).getCurrentLeg().getLegNumber(), 1);
byte[] numPenalties = convert(0, 1); //TODO use boats in race penalties class
byte[] numPenaltiesServed = convert(0, 1);//TODO use boats in race penalites served.
byte[] estNextMarkTime = convert((long)0, 6);//TODO use boats estimated time to next mark.
byte[] estNextMarkTime = convert((long) 0, 6);//TODO use boats estimated time to next mark.
byte[] estFinishTime = convert((long) 0, 6);//TODO use boats estimated time to the finish.
raceStatusMessage.putInt(sourceID);
@@ -64,7 +64,7 @@ public class RaceVisionByteEncoder {
return raceStatusMessage.array();
}
public byte[] displayTextMessage(RaceMessage[] message){
public byte[] displayTextMessage(RaceMessage[] message) {
//ByteBuffer result = ByteBuffer.allocate(4 + numLines * 32);
int messageVersionNumber = 0b1;//version number
short ackNum = 0;//no clue what this does just a placeholder for 2 bytes.
@@ -77,16 +77,16 @@ public class RaceVisionByteEncoder {
ArrayList<byte[]> messages = new ArrayList<byte[]>();
int size = 4;
for (int i = 0; i < message.length; i ++){
for (int i = 0; i < message.length; i++) {
int messageLen = message[i].getMessageText().getBytes().length;
byte[] messageAsBytes = message[i].getMessageText().getBytes();
if (messageLen < 30){
if (messageLen < 30) {
messageLen = 30;
}
ByteBuffer mess = ByteBuffer.allocate(2 + messageLen);
mess.put(convert(message[i].getLineNumber(), 1));
mess.put(convert(messageLen, 1));
for (int j = 0; j < messageLen; j ++){
for (int j = 0; j < messageLen; j++) {
mess.put(messageAsBytes[j]);
}
messages.add(mess.array());
@@ -98,14 +98,14 @@ public class RaceVisionByteEncoder {
result.putShort(ackNum);
result.put(messLines);
for(byte[] mess: messages){
for (byte[] mess : messages) {
result.put(mess);
}
return result.array();
}
public byte[] raceStartStatus(long time, short ack, long startTime, int raceID, char notification){
public byte[] raceStartStatus(long time, short ack, long startTime, int raceID, char notification) {
int messageVersion = 0b1;
byte[] timestamp = convert(time, 6);
byte[] ackNumber = convert(ack, 2);
@@ -125,7 +125,7 @@ public class RaceVisionByteEncoder {
}
public byte[] yachtEventCode(long time, short acknowledgeNumber, int raceID, int destSourceID, int incidentID,
int eventID){
int eventID) {
int messageVersion = 0b10;
byte[] encodeTime = convert(time, 6);
short ackNum = acknowledgeNumber;
@@ -145,7 +145,7 @@ public class RaceVisionByteEncoder {
return result.array();
}
public byte[] chatterText(int messageType, String message){
public byte[] chatterText(int messageType, String message) {
int messageVersion = 0b1;
byte[] type = convert(messageType, 1);
byte[] length = convert(message.length(), 1);
@@ -160,7 +160,7 @@ public class RaceVisionByteEncoder {
return result.array();
}
public byte[] boatLocation(BoatLocationMessage boatLocationMessage){
public byte[] boatLocation(BoatLocationMessage boatLocationMessage) {
int messageVersionNumber = 0b1;
byte[] time = convert(boatLocationMessage.getTime(), 6);
byte[] sourceID = convert(boatLocationMessage.getSourceID(), 4);
@@ -210,7 +210,7 @@ public class RaceVisionByteEncoder {
return result.array();
}
public byte[] markRounding(int time, int ackNumber, int raceID, int sourceID, int boatStatus, int roundingSide, int markType, int markID){
public byte[] markRounding(int time, int ackNumber, int raceID, int sourceID, int boatStatus, int roundingSide, int markType, int markID) {
int messageVersionNumber = 0b1;
byte[] byteTime = convert(time, 6);
byte[] byteAck = convert(ackNumber, 2);
@@ -234,7 +234,7 @@ public class RaceVisionByteEncoder {
return result.array();
}
public byte[] courseWind(byte windID, ArrayList<CourseWind> courseWinds){
public byte[] courseWind(byte windID, ArrayList<CourseWind> courseWinds) {
int messageVersionNumber = 0b1;
byte byteWindID = windID;
byte[] loopcount = convert(courseWinds.size(), 1);
@@ -242,7 +242,7 @@ public class RaceVisionByteEncoder {
result.put(convert(messageVersionNumber, 1));
result.put(byteWindID);
result.put(loopcount);
for (CourseWind wind: courseWinds){
for (CourseWind wind : courseWinds) {
result.put(convert(wind.getID(), 1));
result.put(convert(wind.getTime(), 6));
result.put(convert(wind.getRaceID(), 4));
@@ -255,9 +255,9 @@ public class RaceVisionByteEncoder {
return result.array();
}
public byte[] averageWind(int time, int rawPeriod, int rawSampleSpeed, int period2, int speed2, int period3, int speed3, int period4, int speed4){
public byte[] averageWind(int time, int rawPeriod, int rawSampleSpeed, int period2, int speed2, int period3, int speed3, int period4, int speed4) {
int messageVersionNumber = 0b1;
byte[] byteTime = convert(time,6);
byte[] byteTime = convert(time, 6);
byte[] byteRawPeriod = convert(rawPeriod, 2);
byte[] byteRawSpeed = convert(rawSampleSpeed, 2);
byte[] bytePeriod2 = convert(period2, 2);
@@ -281,13 +281,13 @@ public class RaceVisionByteEncoder {
return result.array();
}
public byte[] convert(String s, int size){
public byte[] convert(String s, int size) {
byte[] m = s.getBytes(Charset.forName("UTF-8"));
int length = m.length;
byte[] result;
if (length > 255){
if (length > 255) {
length = 255;
} else if (size < 1){
} else if (size < 1) {
result = new byte[0];
return result;
}
@@ -295,12 +295,12 @@ public class RaceVisionByteEncoder {
return result;
}
public byte[] convert(int n, int size){
public byte[] convert(int n, int size) {
byte[] result;
if (size > 4){
if (size > 4) {
result = new byte[4];
return result;
} else if (size < 1){
} else if (size < 1) {
result = new byte[0];
return result;
}
@@ -311,12 +311,12 @@ public class RaceVisionByteEncoder {
return result;
}
public byte[] convert(long n, int size){
public byte[] convert(long n, int size) {
byte[] result;
if (size > 8){
if (size > 8) {
result = new byte[8];
return result;
} else if (size < 1){
} else if (size < 1) {
result = new byte[0];
return result;
}
@@ -328,12 +328,12 @@ public class RaceVisionByteEncoder {
}
public byte[] convert(short n, int size){
public byte[] convert(short n, int size) {
byte[] result;
if (size > 2){
if (size > 2) {
result = new byte[2];
return result;
} else if (size < 1){
} else if (size < 1) {
result = new byte[0];
return result;
}
@@ -1,7 +1,6 @@
package seng302.Networking.MessageEncoders;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Arrays;
/**
@@ -7,8 +7,7 @@ package seng302.Networking.Utils;
/**
* Represents the information in a boat location message (AC streaming spec: 4.9).
*/
public class BoatLocationMessage
{
public class BoatLocationMessage {
///Version number of the message - is always 1.
private byte messageVersionNumber = 1;
@@ -78,12 +77,12 @@ public class BoatLocationMessage
/**
* Ctor.
*/
public BoatLocationMessage()
{
public BoatLocationMessage() {
}
/**
* Ctor, with all parameters.
*
* @param messageVersionNumber
* @param time
* @param sourceID
@@ -107,8 +106,7 @@ public class BoatLocationMessage
* @param currentSet
* @param rudderAngle
*/
public BoatLocationMessage(byte messageVersionNumber, long time, int sourceID, int sequenceNumber, byte deviceType, int latitude, int longitude, int altitude, int heading, short pitch, short roll, int boatSpeed, int boatCOG, int boatSOG, int apparentWindSpeed, short apparentWindAngle, int trueWindSpeed, short trueWindDirection, short trueWindAngle, int currentDrift, int currentSet, short rudderAngle)
{
public BoatLocationMessage(byte messageVersionNumber, long time, int sourceID, int sequenceNumber, byte deviceType, int latitude, int longitude, int altitude, int heading, short pitch, short roll, int boatSpeed, int boatCOG, int boatSOG, int apparentWindSpeed, short apparentWindAngle, int trueWindSpeed, short trueWindDirection, short trueWindAngle, int currentDrift, int currentSet, short rudderAngle) {
this.messageVersionNumber = messageVersionNumber;
this.time = time;
this.sourceID = sourceID;
@@ -136,174 +134,140 @@ public class BoatLocationMessage
//Getters and setters for message properties.
public byte getMessageVersionNumber()
{
public byte getMessageVersionNumber() {
return messageVersionNumber;
}
public void setMessageVersionNumber(byte messageVersionNumber)
{
public void setMessageVersionNumber(byte messageVersionNumber) {
this.messageVersionNumber = messageVersionNumber;
}
public long getTime()
{
public long getTime() {
return time;
}
public void setTime(long time)
{
public void setTime(long time) {
this.time = time;
}
public int getSourceID()
{
public int getSourceID() {
return sourceID;
}
public void setSourceID(int sourceID)
{
public void setSourceID(int sourceID) {
this.sourceID = sourceID;
}
public int getSequenceNumber()
{
public int getSequenceNumber() {
return sequenceNumber;
}
public void setSequenceNumber(int sequenceNumber)
{
public void setSequenceNumber(int sequenceNumber) {
this.sequenceNumber = sequenceNumber;
}
public byte getDeviceType()
{
public byte getDeviceType() {
return deviceType;
}
public void setDeviceType(byte deviceType)
{
public void setDeviceType(byte deviceType) {
this.deviceType = deviceType;
}
public int getLatitude()
{
public int getLatitude() {
return latitude;
}
public void setLatitude(int latitude)
{
public void setLatitude(int latitude) {
this.latitude = latitude;
}
public int getLongitude()
{
public int getLongitude() {
return longitude;
}
public void setLongitude(int longitude)
{
public void setLongitude(int longitude) {
this.longitude = longitude;
}
public int getAltitude()
{
public int getAltitude() {
return altitude;
}
public void setAltitude(int altitude)
{
public void setAltitude(int altitude) {
this.altitude = altitude;
}
public int getHeading()
{
public int getHeading() {
return heading;
}
public void setHeading(int heading)
{
public void setHeading(int heading) {
this.heading = heading;
}
public short getPitch()
{
public short getPitch() {
return pitch;
}
public void setPitch(short pitch)
{
public void setPitch(short pitch) {
this.pitch = pitch;
}
public short getRoll()
{
public short getRoll() {
return roll;
}
public void setRoll(short roll)
{
public void setRoll(short roll) {
this.roll = roll;
}
public int getBoatSpeed()
{
public int getBoatSpeed() {
return boatSpeed;
}
public void setBoatSpeed(int boatSpeed)
{
public void setBoatSpeed(int boatSpeed) {
this.boatSpeed = boatSpeed;
}
public int getBoatCOG()
{
public int getBoatCOG() {
return boatCOG;
}
public void setBoatCOG(int boatCOG)
{
public void setBoatCOG(int boatCOG) {
this.boatCOG = boatCOG;
}
public int getBoatSOG()
{
public int getBoatSOG() {
return boatSOG;
}
public void setBoatSOG(int boatSOG)
{
public void setBoatSOG(int boatSOG) {
this.boatSOG = boatSOG;
}
public int getApparentWindSpeed()
{
public int getApparentWindSpeed() {
return apparentWindSpeed;
}
public void setApparentWindSpeed(int apparentWindSpeed)
{
public void setApparentWindSpeed(int apparentWindSpeed) {
this.apparentWindSpeed = apparentWindSpeed;
}
public short getApparentWindAngle()
{
public short getApparentWindAngle() {
return apparentWindAngle;
}
public void setApparentWindAngle(short apparentWindAngle)
{
public void setApparentWindAngle(short apparentWindAngle) {
this.apparentWindAngle = apparentWindAngle;
}
public int getTrueWindSpeed()
{
public int getTrueWindSpeed() {
return trueWindSpeed;
}
public void setTrueWindSpeed(int trueWindSpeed)
{
public void setTrueWindSpeed(int trueWindSpeed) {
this.trueWindSpeed = trueWindSpeed;
}
@@ -315,43 +279,35 @@ public class BoatLocationMessage
this.trueWindDirection = trueWindDirection;
}
public short getTrueWindAngle()
{
public short getTrueWindAngle() {
return trueWindAngle;
}
public void setTrueWindAngle(short trueWindAngle)
{
public void setTrueWindAngle(short trueWindAngle) {
this.trueWindAngle = trueWindAngle;
}
public int getCurrentDrift()
{
public int getCurrentDrift() {
return currentDrift;
}
public void setCurrentDrift(int currentDrift)
{
public void setCurrentDrift(int currentDrift) {
this.currentDrift = currentDrift;
}
public int getCurrentSet()
{
public int getCurrentSet() {
return currentSet;
}
public void setCurrentSet(int currentSet)
{
public void setCurrentSet(int currentSet) {
this.currentSet = currentSet;
}
public short getRudderAngle()
{
public short getRudderAngle() {
return rudderAngle;
}
public void setRudderAngle(short rudderAngle)
{
public void setRudderAngle(short rudderAngle) {
this.rudderAngle = rudderAngle;
}
}
@@ -9,7 +9,7 @@ public class CourseWind {
private long time;
public CourseWind(int ID, long time, int raceID, int windDirection, int windSpeed, int bestUpwindAngle, int bestDownwindAngle,
int flags){
int flags) {
this.ID = ID;
this.time = time;
this.raceID = raceID;
@@ -10,7 +10,9 @@ public enum MessageType {
private byte value;
private MessageType(int value) { this.value = (byte)value; }
private MessageType(int value) {
this.value = (byte) value;
}
public byte getValue() {
return value;
@@ -8,7 +8,7 @@ public class RaceMessage {
private int lineNumber;
private String messageText;
public RaceMessage(int lineNumber, String messageText){
public RaceMessage(int lineNumber, String messageText) {
this.lineNumber = lineNumber;
this.messageText = messageText;
}
@@ -4,7 +4,10 @@ import javafx.scene.paint.Color;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import seng302.Model.*;
import seng302.Model.BoatInRace;
import seng302.Model.Leg;
import seng302.Model.Marker;
import seng302.Model.RaceClock;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
@@ -17,19 +20,20 @@ import java.util.List;
* @deprecated use {@link seng302.Mock.StreamedCourseXMLReader}
*/
public class RaceXMLReader extends XMLReader implements RaceDataSource {
private static double COORDINATEPADDING = 0.0005;
private List<BoatInRace> boats = new ArrayList<>();
private Color[] colors = {Color.BLUEVIOLET, Color.BLACK, Color.RED, Color.ORANGE, Color.DARKOLIVEGREEN, Color.LIMEGREEN};//TODO make this established in xml or come up with a better system.
private List<Leg> legs = new ArrayList<>();
private GPSCoordinate mark, startPt1, startPt2, finishPt1, finishPt2, leewardPt1, leewardPt2, windwardPt1, windwardPt2;
private GPSCoordinate mapTopLeft, mapBottomRight;
private List<GPSCoordinate> boundary = new ArrayList<>();
private static double COORDINATEPADDING = 0.0005;
/**
* Constractor for Race XML
*
* @param filePath path of the file
* @throws IOException error
* @throws SAXException error
* @throws IOException error
* @throws SAXException error
* @throws ParserConfigurationException error
*/
public RaceXMLReader(String filePath) throws IOException, SAXException, ParserConfigurationException {
@@ -38,10 +42,11 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
/**
* COnstructor for Race XML
*
* @param filePath file path to read
* @param read whether or not to read and store the files straight away.
* @throws IOException error
* @throws SAXException error
* @param read whether or not to read and store the files straight away.
* @throws IOException error
* @throws SAXException error
* @throws ParserConfigurationException error
*/
public RaceXMLReader(String filePath, boolean read) throws IOException, SAXException, ParserConfigurationException {
@@ -62,7 +67,7 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
/**
* Read all the boats in the XML file
*/
*/
public void readBoats() {
//get all boats
NodeList nBoats = doc.getElementsByTagName("boat");
@@ -169,6 +174,7 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
/**
* gets a marker from the XML file
*
* @param start base nodelist this should be the tag that contains <coordinate></coordinate>
* @return
*/
@@ -178,7 +184,8 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
/**
* gets a marker from the XML file
* @param start base nodelist this should be the tag that contains <coordinate></coordinate>
*
* @param start base nodelist this should be the tag that contains <coordinate></coordinate>
* @param startIndex index in the node that has the coordinate tag
* @return
*/
@@ -188,9 +195,10 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
/**
* gets a marker from the XML file
* @param start base nodelist this should be the tag that contains <coordinate></coordinate>
*
* @param start base nodelist this should be the tag that contains <coordinate></coordinate>
* @param startIndex index in the node that has the coordinate tag
* @param nodeIndex coordinate index
* @param nodeIndex coordinate index
* @return
*/
private Marker getMarker(NodeList start, int startIndex, int nodeIndex) {
@@ -201,6 +209,7 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
/**
* gets a changes a marker to GPS coordinates into a marker
*
* @param markerNode marker to turn into coordinates
* @return
*/
@@ -221,6 +230,7 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
/**
* gets a coordinates from the XML file
*
* @param start base nodelist this should be the tag that contains <coordinate></coordinate>
* @return
*/
@@ -228,9 +238,10 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
return getCoordinates(start, 0);
}
/**
/**
* gets a coordinates from the XML file
* @param start base nodelist this should be the tag that contains <coordinate></coordinate>
*
* @param start base nodelist this should be the tag that contains <coordinate></coordinate>
* @param startIndex the index the tag containing the coordinate should be in
* @return
*/
@@ -238,11 +249,12 @@ public class RaceXMLReader extends XMLReader implements RaceDataSource {
return getCoordinates(start, startIndex, 0);
}
/**
/**
* gets a coordinates from the XML file
* @param start base nodelist this should be the tag that contains <coordinate></coordinate>
*
* @param start base nodelist this should be the tag that contains <coordinate></coordinate>
* @param startIndex the index the tag containing the coordinate should be in
* @param nodeIndex The coordinate index
* @param nodeIndex The coordinate index
* @return
*/
private GPSCoordinate getCoordinates(NodeList start, int startIndex, int nodeIndex) {
@@ -8,13 +8,13 @@
<Settings>
<RaceBoatType Type="AC45" />
<RaceBoatType Type="AC45"/>
<BoatDimension BoatLength="14.019" HullLength="13.449" />
<BoatDimension BoatLength="14.019" HullLength="13.449"/>
<ZoneSize MarkZoneSize="40.347" CourseZoneSize="40.347" />
<ZoneSize MarkZoneSize="40.347" CourseZoneSize="40.347"/>
<ZoneLimits Limit1="200" Limit2="100" Limit3="40.347" Limit4="0" Limit5="-100" />
<ZoneLimits Limit1="200" Limit2="100" Limit3="40.347" Limit4="0" Limit5="-100"/>
</Settings>
@@ -24,13 +24,13 @@
<Vertices>
<Vtx Seq="1" Y="0" X="-2.659" />
<Vtx Seq="1" Y="0" X="-2.659"/>
<Vtx Seq="2" Y="18.359" X="-2.659" />
<Vtx Seq="2" Y="18.359" X="-2.659"/>
<Vtx Seq="3" Y="18.359" X="2.659" />
<Vtx Seq="3" Y="18.359" X="2.659"/>
<Vtx Seq="4" Y="0" X="2.659" />
<Vtx Seq="4" Y="0" X="2.659"/>
</Vertices>
@@ -40,13 +40,13 @@
<Vertices>
<Vtx Seq="1" Y="0" X="-1.278" />
<Vtx Seq="1" Y="0" X="-1.278"/>
<Vtx Seq="2" Y="8.876" X="-1.278" />
<Vtx Seq="2" Y="8.876" X="-1.278"/>
<Vtx Seq="3" Y="8.876" X="1.278" />
<Vtx Seq="3" Y="8.876" X="1.278"/>
<Vtx Seq="4" Y="0" X="1.278" />
<Vtx Seq="4" Y="0" X="1.278"/>
</Vertices>
@@ -56,13 +56,13 @@
<Vertices>
<Vtx Seq="1" Y="0" X="-1.1" />
<Vtx Seq="1" Y="0" X="-1.1"/>
<Vtx Seq="2" Y="8.3" X="-1.1" />
<Vtx Seq="2" Y="8.3" X="-1.1"/>
<Vtx Seq="3" Y="8.3" X="1.1" />
<Vtx Seq="3" Y="8.3" X="1.1"/>
<Vtx Seq="4" Y="0" X="1.1" />
<Vtx Seq="4" Y="0" X="1.1"/>
</Vertices>
@@ -72,13 +72,13 @@
<Vertices>
<Vtx Seq="1" Y="0" X="-0.75" />
<Vtx Seq="1" Y="0" X="-0.75"/>
<Vtx Seq="2" Y="3" X="-0.75" />
<Vtx Seq="2" Y="3" X="-0.75"/>
<Vtx Seq="3" Y="3" X="0.75" />
<Vtx Seq="3" Y="3" X="0.75"/>
<Vtx Seq="4" Y="0" X="0.75" />
<Vtx Seq="4" Y="0" X="0.75"/>
</Vertices>
@@ -88,83 +88,83 @@
<Vertices>
<Vtx Seq="1" Y="0" X="-3.46" />
<Vtx Seq="1" Y="0" X="-3.46"/>
<Vtx Seq="2" Y="13.449" X="-3.46" />
<Vtx Seq="2" Y="13.449" X="-3.46"/>
<Vtx Seq="3" Y="14.019" X="0" />
<Vtx Seq="3" Y="14.019" X="0"/>
<Vtx Seq="4" Y="13.449" X="3.46" />
<Vtx Seq="4" Y="13.449" X="3.46"/>
<Vtx Seq="5" Y="0" X="3.46" />
<Vtx Seq="5" Y="0" X="3.46"/>
</Vertices>
<Catamaran>
<Vtx Seq="1" Y="1.769" X="-2.752" />
<Vtx Seq="1" Y="1.769" X="-2.752"/>
<Vtx Seq="2" Y="0" X="-2.813" />
<Vtx Seq="2" Y="0" X="-2.813"/>
<Vtx Seq="3" Y="0" X="-3.34" />
<Vtx Seq="3" Y="0" X="-3.34"/>
<Vtx Seq="4" Y="5.351" X="-3.46" />
<Vtx Seq="4" Y="5.351" X="-3.46"/>
<Vtx Seq="5" Y="10.544" X="-3.387" />
<Vtx Seq="5" Y="10.544" X="-3.387"/>
<Vtx Seq="6" Y="13.449" X="-3.075" />
<Vtx Seq="6" Y="13.449" X="-3.075"/>
<Vtx Seq="7" Y="10.851" X="-2.793" />
<Vtx Seq="7" Y="10.851" X="-2.793"/>
<Vtx Seq="8" Y="6.669" X="-2.699" />
<Vtx Seq="8" Y="6.669" X="-2.699"/>
<Vtx Seq="9" Y="6.669" X="2.699" />
<Vtx Seq="9" Y="6.669" X="2.699"/>
<Vtx Seq="10" Y="10.851" X="2.793" />
<Vtx Seq="10" Y="10.851" X="2.793"/>
<Vtx Seq="11" Y="13.449" X="3.075" />
<Vtx Seq="11" Y="13.449" X="3.075"/>
<Vtx Seq="12" Y="10.544" X="3.387" />
<Vtx Seq="12" Y="10.544" X="3.387"/>
<Vtx Seq="13" Y="5.351" X="3.46" />
<Vtx Seq="13" Y="5.351" X="3.46"/>
<Vtx Seq="14" Y="0" X="3.34" />
<Vtx Seq="14" Y="0" X="3.34"/>
<Vtx Seq="15" Y="0" X="2.813" />
<Vtx Seq="15" Y="0" X="2.813"/>
<Vtx Seq="16" Y="1.769" X="2.752" />
<Vtx Seq="16" Y="1.769" X="2.752"/>
</Catamaran>
<Bowsprit>
<Vtx Seq="1" Y="6.669" X="-0.2" />
<Vtx Seq="1" Y="6.669" X="-0.2"/>
<Vtx Seq="2" Y="11.377" X="-0.2" />
<Vtx Seq="2" Y="11.377" X="-0.2"/>
<Vtx Seq="3" Y="14.019" X="0" />
<Vtx Seq="3" Y="14.019" X="0"/>
<Vtx Seq="4" Y="11.377" X="0.2" />
<Vtx Seq="4" Y="11.377" X="0.2"/>
<Vtx Seq="5" Y="6.669" X="0.2" />
<Vtx Seq="5" Y="6.669" X="0.2"/>
</Bowsprit>
<Trampoline>
<Vtx Seq="1" Y="2" X="-2.699" />
<Vtx Seq="1" Y="2" X="-2.699"/>
<Vtx Seq="2" Y="6.438" X="-2.699" />
<Vtx Seq="2" Y="6.438" X="-2.699"/>
<Vtx Seq="3" Y="6.438" X="2.699" />
<Vtx Seq="3" Y="6.438" X="2.699"/>
<Vtx Seq="4" Y="2" X="2.699" />
<Vtx Seq="4" Y="2" X="2.699"/>
</Trampoline>
</BoatShape>
<BoatShape ShapeID="5" />
<BoatShape ShapeID="5"/>
</BoatShapes>
@@ -174,9 +174,9 @@
BoatName="Regardless">
<GPSposition Z="6.840" Y="7.800" X="0.000" />
<GPSposition Z="6.840" Y="7.800" X="0.000"/>
<FlagPosition Z="0.000" Y="7.800" X="0.000" />
<FlagPosition Z="0.000" Y="7.800" X="0.000"/>
</Boat>
@@ -184,9 +184,9 @@
BoatName="Constellation">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
</Boat>
@@ -194,17 +194,17 @@
BoatName="Mischief">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
</Boat>
<Boat Type="Mark" SourceID="124" ShapeID="1" HullNum="LC03" ShortName="Atalanta" BoatName="Atalanta">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
</Boat>
@@ -212,9 +212,9 @@
BoatName="Volunteer">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
</Boat>
@@ -222,17 +222,17 @@
BoatName="Defender">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
</Boat>
<Boat Type="Mark" SourceID="128" ShapeID="1" HullNum="LC01" ShortName="Shamrock" BoatName="Shamrock">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
</Boat>
@@ -240,9 +240,9 @@
BoatName="TEAM KOREA" Country="KOR">
<GPSposition Z="1.738" Y="0.625" X="0.001" />
<GPSposition Z="1.738" Y="0.625" X="0.001"/>
<MastTop Z="21.496" Y="4.233" X="0.000" />
<MastTop Z="21.496" Y="4.233" X="0.000"/>
</Boat>
@@ -6,15 +6,15 @@
<RaceType>Match</RaceType>
<CreationTimeDate>2011-08-06T13:25:00-0000</CreationTimeDate >
<CreationTimeDate>2011-08-06T13:25:00-0000</CreationTimeDate>
<RaceStartTime Time="2011-08-06T13:30:00-0700" Postpone="false" />
<RaceStartTime Time="2011-08-06T13:30:00-0700" Postpone="false"/>
<Participants>
<Yacht SourceID="101" Entry="Port" />
<Yacht SourceID="101" Entry="Port"/>
<Yacht SourceID="108" Entry="Stbd" />
<Yacht SourceID="108" Entry="Stbd"/>
</Participants>
@@ -22,29 +22,29 @@
<CompoundMark CompoundMarkID="1" Name="StartLine">
<Mark SeqID="1" Name="PRO" TargetLat="-36.83" TargetLng="174.83" SourceID="101" />
<Mark SeqID="1" Name="PRO" TargetLat="-36.83" TargetLng="174.83" SourceID="101"/>
<Mark SeqID="2" Name="PIN" TargetLat="-36.84" TargetLng="174.81" SourceID="102" />
<Mark SeqID="2" Name="PIN" TargetLat="-36.84" TargetLng="174.81" SourceID="102"/>
</CompoundMark>
<CompoundMark CompoundMarkID="2" Name="M1">
<Mark Name="M1" TargetLat="-36.63566590" TargetLng="174.88543944" SourceID="103" />
<Mark Name="M1" TargetLat="-36.63566590" TargetLng="174.88543944" SourceID="103"/>
</CompoundMark>
<CompoundMark CompoundMarkID="3" Name="M2">
<Mark Name="M2" TargetLat="-36.83" TargetLng="174.80" SourceID="102" />
<Mark Name="M2" TargetLat="-36.83" TargetLng="174.80" SourceID="102"/>
</CompoundMark>
<CompoundMark CompoundMarkID="4" Name="Gate">
<Mark SeqID="1" Name="G1" TargetLat="-36.63566590" TargetLng="174.97205159" SourceID="104" />
<Mark SeqID="1" Name="G1" TargetLat="-36.63566590" TargetLng="174.97205159" SourceID="104"/>
<Mark SeqID="2" Name="G2" TargetLat="-36.64566590" TargetLng="174.98205159" SourceID="105" />
<Mark SeqID="2" Name="G2" TargetLat="-36.64566590" TargetLng="174.98205159" SourceID="105"/>
</CompoundMark>
@@ -52,13 +52,13 @@
<CompoundMarkSequence>
<Corner SeqID="1" CompoundMarkID="1" Rounding="SP" ZoneSize="3" />
<Corner SeqID="1" CompoundMarkID="1" Rounding="SP" ZoneSize="3"/>
<Corner SeqID="2" CompoundMarkID="2" Rounding="Port" ZoneSize="3" />
<Corner SeqID="2" CompoundMarkID="2" Rounding="Port" ZoneSize="3"/>
<Corner SeqID="3" CompoundMarkID="3" Rounding="Stbd" ZoneSize="6" />
<Corner SeqID="3" CompoundMarkID="3" Rounding="Stbd" ZoneSize="6"/>
<Corner SeqID="4" CompoundMarkID="4" Rounding="PS" ZoneSize="6" />
<Corner SeqID="4" CompoundMarkID="4" Rounding="PS" ZoneSize="6"/>
<Corner SeqID="5" CompoundMarkID="1" Rounding="SP" ZoneSize="3"/>
+63 -63
View File
@@ -4,116 +4,116 @@
<Modified>2017-04-19T15:49:40+1200</Modified>
<Version>1</Version>
<Settings>
<RaceBoatType Type="AC45" />
<BoatDimension BoatLength="14.019" HullLength="13.449" />
<ZoneSize MarkZoneSize="40.347" CourseZoneSize="40.347" />
<ZoneLimits Limit1="200" Limit2="100" Limit3="40.347" Limit4="0" Limit5="-100" />
<RaceBoatType Type="AC45"/>
<BoatDimension BoatLength="14.019" HullLength="13.449"/>
<ZoneSize MarkZoneSize="40.347" CourseZoneSize="40.347"/>
<ZoneLimits Limit1="200" Limit2="100" Limit3="40.347" Limit4="0" Limit5="-100"/>
</Settings>
<BoatShapes>
<BoatShape ShapeID="0">
<Vertices>
<Vtx Seq="1" Y="0" X="-2.659" />
<Vtx Seq="2" Y="18.359" X="-2.659" />
<Vtx Seq="3" Y="18.359" X="2.659" />
<Vtx Seq="4" Y="0" X="2.659" />
<Vtx Seq="1" Y="0" X="-2.659"/>
<Vtx Seq="2" Y="18.359" X="-2.659"/>
<Vtx Seq="3" Y="18.359" X="2.659"/>
<Vtx Seq="4" Y="0" X="2.659"/>
</Vertices>
</BoatShape>
<BoatShape ShapeID="1">
<Vertices>
<Vtx Seq="1" Y="0" X="-1.278" />
<Vtx Seq="2" Y="8.876" X="-1.278" />
<Vtx Seq="3" Y="8.876" X="1.278" />
<Vtx Seq="4" Y="0" X="1.278" />
<Vtx Seq="1" Y="0" X="-1.278"/>
<Vtx Seq="2" Y="8.876" X="-1.278"/>
<Vtx Seq="3" Y="8.876" X="1.278"/>
<Vtx Seq="4" Y="0" X="1.278"/>
</Vertices>
</BoatShape>
<BoatShape ShapeID="2">
<Vertices>
<Vtx Seq="1" Y="0" X="-1.1" />
<Vtx Seq="2" Y="8.3" X="-1.1" />
<Vtx Seq="3" Y="8.3" X="1.1" />
<Vtx Seq="4" Y="0" X="1.1" />
<Vtx Seq="1" Y="0" X="-1.1"/>
<Vtx Seq="2" Y="8.3" X="-1.1"/>
<Vtx Seq="3" Y="8.3" X="1.1"/>
<Vtx Seq="4" Y="0" X="1.1"/>
</Vertices>
</BoatShape>
<BoatShape ShapeID="3">
<Vertices>
<Vtx Seq="1" Y="0" X="-0.75" />
<Vtx Seq="2" Y="3" X="-0.75" />
<Vtx Seq="3" Y="3" X="0.75" />
<Vtx Seq="4" Y="0" X="0.75" />
<Vtx Seq="1" Y="0" X="-0.75"/>
<Vtx Seq="2" Y="3" X="-0.75"/>
<Vtx Seq="3" Y="3" X="0.75"/>
<Vtx Seq="4" Y="0" X="0.75"/>
</Vertices>
</BoatShape>
<BoatShape ShapeID="4">
<Vertices>
<Vtx Seq="1" Y="0" X="-3.46" />
<Vtx Seq="2" Y="13.449" X="-3.46" />
<Vtx Seq="3" Y="14.019" X="0" />
<Vtx Seq="4" Y="13.449" X="3.46" />
<Vtx Seq="5" Y="0" X="3.46" />
<Vtx Seq="1" Y="0" X="-3.46"/>
<Vtx Seq="2" Y="13.449" X="-3.46"/>
<Vtx Seq="3" Y="14.019" X="0"/>
<Vtx Seq="4" Y="13.449" X="3.46"/>
<Vtx Seq="5" Y="0" X="3.46"/>
</Vertices>
<Catamaran>
<Vtx Seq="1" Y="1.769" X="-2.752" />
<Vtx Seq="2" Y="0" X="-2.813" />
<Vtx Seq="3" Y="0" X="-3.34" />
<Vtx Seq="4" Y="5.351" X="-3.46" />
<Vtx Seq="5" Y="10.544" X="-3.387" />
<Vtx Seq="6" Y="13.449" X="-3.075" />
<Vtx Seq="7" Y="10.851" X="-2.793" />
<Vtx Seq="8" Y="6.669" X="-2.699" />
<Vtx Seq="9" Y="6.669" X="2.699" />
<Vtx Seq="10" Y="10.851" X="2.793" />
<Vtx Seq="11" Y="13.449" X="3.075" />
<Vtx Seq="12" Y="10.544" X="3.387" />
<Vtx Seq="13" Y="5.351" X="3.46" />
<Vtx Seq="14" Y="0" X="3.34" />
<Vtx Seq="15" Y="0" X="2.813" />
<Vtx Seq="16" Y="1.769" X="2.752" />
<Vtx Seq="1" Y="1.769" X="-2.752"/>
<Vtx Seq="2" Y="0" X="-2.813"/>
<Vtx Seq="3" Y="0" X="-3.34"/>
<Vtx Seq="4" Y="5.351" X="-3.46"/>
<Vtx Seq="5" Y="10.544" X="-3.387"/>
<Vtx Seq="6" Y="13.449" X="-3.075"/>
<Vtx Seq="7" Y="10.851" X="-2.793"/>
<Vtx Seq="8" Y="6.669" X="-2.699"/>
<Vtx Seq="9" Y="6.669" X="2.699"/>
<Vtx Seq="10" Y="10.851" X="2.793"/>
<Vtx Seq="11" Y="13.449" X="3.075"/>
<Vtx Seq="12" Y="10.544" X="3.387"/>
<Vtx Seq="13" Y="5.351" X="3.46"/>
<Vtx Seq="14" Y="0" X="3.34"/>
<Vtx Seq="15" Y="0" X="2.813"/>
<Vtx Seq="16" Y="1.769" X="2.752"/>
</Catamaran>
<Bowsprit>
<Vtx Seq="1" Y="6.669" X="-0.2" />
<Vtx Seq="2" Y="11.377" X="-0.2" />
<Vtx Seq="3" Y="14.019" X="0" />
<Vtx Seq="4" Y="11.377" X="0.2" />
<Vtx Seq="5" Y="6.669" X="0.2" />
<Vtx Seq="1" Y="6.669" X="-0.2"/>
<Vtx Seq="2" Y="11.377" X="-0.2"/>
<Vtx Seq="3" Y="14.019" X="0"/>
<Vtx Seq="4" Y="11.377" X="0.2"/>
<Vtx Seq="5" Y="6.669" X="0.2"/>
</Bowsprit>
<Trampoline>
<Vtx Seq="1" Y="2" X="-2.699" />
<Vtx Seq="2" Y="6.438" X="-2.699" />
<Vtx Seq="3" Y="6.438" X="2.699" />
<Vtx Seq="4" Y="2" X="2.699" />
<Vtx Seq="1" Y="2" X="-2.699"/>
<Vtx Seq="2" Y="6.438" X="-2.699"/>
<Vtx Seq="3" Y="6.438" X="2.699"/>
<Vtx Seq="4" Y="2" X="2.699"/>
</Trampoline>
</BoatShape>
<BoatShape ShapeID="5" />
<BoatShape ShapeID="5"/>
</BoatShapes>
<Boats>>
<Boat Type="Yacht" SourceID="101" ShapeID="4" HullNum="AC4501" ShortName="USA"
BoatName="ORACLE TEAM USA" Country="USA">
<GPSposition Z="1.738" Y="0.625" X="0.001" />
<MastTop Z="21.496" Y="4.233" X="0.000" />
<GPSposition Z="1.738" Y="0.625" X="0.001"/>
<MastTop Z="21.496" Y="4.233" X="0.000"/>
</Boat>
<Boat Type="Yacht" SourceID="102" ShapeID="4" HullNum="AC4502" ShortName="GBR"
BoatName="Land Rover BAR" Country="United Kingdom">
<GPSposition Z="1.738" Y="0.625" X="0.001" />
<MastTop Z="21.496" Y="4.233" X="0.000" />
<GPSposition Z="1.738" Y="0.625" X="0.001"/>
<MastTop Z="21.496" Y="4.233" X="0.000"/>
</Boat>
<Boat Type="Yacht" SourceID="103" ShapeID="4" HullNum="AC4503" ShortName="JPN"
BoatName="SoftBank Team Japan" Country="Japan">
<GPSposition Z="1.738" Y="0.625" X="0.001" />
<MastTop Z="21.496" Y="4.233" X="0.000" />
<GPSposition Z="1.738" Y="0.625" X="0.001"/>
<MastTop Z="21.496" Y="4.233" X="0.000"/>
</Boat>
<Boat Type="Yacht" SourceID="104" ShapeID="4" HullNum="AC4504" ShortName="FRA"
BoatName="Groupama Team France" Country="France">
<GPSposition Z="1.738" Y="0.625" X="0.001" />
<MastTop Z="21.496" Y="4.233" X="0.000" />
<GPSposition Z="1.738" Y="0.625" X="0.001"/>
<MastTop Z="21.496" Y="4.233" X="0.000"/>
</Boat>
<Boat Type="Yacht" SourceID="105" ShapeID="4" HullNum="AC4505" ShortName="SWE"
BoatName="Artemis Racing" Country="Sweden">
<GPSposition Z="1.738" Y="0.625" X="0.001" />
<MastTop Z="21.496" Y="4.233" X="0.000" />
<GPSposition Z="1.738" Y="0.625" X="0.001"/>
<MastTop Z="21.496" Y="4.233" X="0.000"/>
</Boat>
<Boat Type="Yacht" SourceID="106" ShapeID="4" HullNum="AC4506" ShortName="NZL"
BoatName="Emirates Team New Zealand" Country="New Zealand">
<GPSposition Z="1.738" Y="0.625" X="0.001" />
<MastTop Z="21.496" Y="4.233" X="0.000" />
<GPSposition Z="1.738" Y="0.625" X="0.001"/>
<MastTop Z="21.496" Y="4.233" X="0.000"/>
</Boat>
</Boats>
</BoatConfig>
+22 -22
View File
@@ -2,43 +2,43 @@
<Race>
<RaceID>17041901</RaceID>
<RaceType>Fleet</RaceType>
<CreationTimeDate>2017-04-19T15:30:00+1200</CreationTimeDate >
<RaceStartTime Time="2019-06-01T13:30:00-0400" Postpone="false" />
<CreationTimeDate>2017-04-19T15:30:00+1200</CreationTimeDate>
<RaceStartTime Time="2019-06-01T13:30:00-0400" Postpone="false"/>
<Participants>
<Yacht SourceID="001" Entry="Port" />
<Yacht SourceID="002" Entry="Port" />
<Yacht SourceID="003" Entry="Port" />
<Yacht SourceID="004" Entry="Port" />
<Yacht SourceID="005" Entry="Port" />
<Yacht SourceID="006" Entry="Port" />
<Yacht SourceID="001" Entry="Port"/>
<Yacht SourceID="002" Entry="Port"/>
<Yacht SourceID="003" Entry="Port"/>
<Yacht SourceID="004" Entry="Port"/>
<Yacht SourceID="005" Entry="Port"/>
<Yacht SourceID="006" Entry="Port"/>
</Participants>
<Course>
<CompoundMark CompoundMarkID="1" Name="StartLine">
<Mark SeqID="1" Name="PRO" TargetLat="32.296577" TargetLng="-64.854304" SourceID="101" />
<Mark SeqID="2" Name="PIN" TargetLat="32.293771" TargetLng="-64.855242" SourceID="102" />
<Mark SeqID="1" Name="PRO" TargetLat="32.296577" TargetLng="-64.854304" SourceID="101"/>
<Mark SeqID="2" Name="PIN" TargetLat="32.293771" TargetLng="-64.855242" SourceID="102"/>
</CompoundMark>
<CompoundMark CompoundMarkID="2" Name="M1">
<Mark Name="M1" TargetLat="32.293039" TargetLng="-64.843983" SourceID="103" />
<Mark Name="M1" TargetLat="32.293039" TargetLng="-64.843983" SourceID="103"/>
</CompoundMark>
<CompoundMark CompoundMarkID="3" Name="WindwardGate">
<Mark SeqID="1" Name="G1" TargetLat="32.284680" TargetLng="-64.850045" SourceID="104" />
<Mark SeqID="2" Name="G2" TargetLat="32.280164" TargetLng="-64.847591" SourceID="105" />
<Mark SeqID="1" Name="G1" TargetLat="32.284680" TargetLng="-64.850045" SourceID="104"/>
<Mark SeqID="2" Name="G2" TargetLat="32.280164" TargetLng="-64.847591" SourceID="105"/>
</CompoundMark>
<CompoundMark CompoundMarkID="4" Name="LeewardGate">
<Mark SeqID="1" Name="G1" TargetLat="32.309693" TargetLng="-64.835249" SourceID="106" />
<Mark SeqID="2" Name="G2" TargetLat="32.308046" TargetLng="-64.831785" SourceID="107" />
<Mark SeqID="1" Name="G1" TargetLat="32.309693" TargetLng="-64.835249" SourceID="106"/>
<Mark SeqID="2" Name="G2" TargetLat="32.308046" TargetLng="-64.831785" SourceID="107"/>
</CompoundMark>
<CompoundMark CompoundMarkID="5" Name="FinishLine">
<Mark SeqID="1" Name="PRO" TargetLat="32.317379" TargetLng="-64.839291" SourceID="108" />
<Mark SeqID="2" Name="PIN" TargetLat="32.317257" TargetLng="-64.836260" SourceID="109" />
<Mark SeqID="1" Name="PRO" TargetLat="32.317379" TargetLng="-64.839291" SourceID="108"/>
<Mark SeqID="2" Name="PIN" TargetLat="32.317257" TargetLng="-64.836260" SourceID="109"/>
</CompoundMark>
</Course>
<CompoundMarkSequence>
<Corner SeqID="1" CompoundMarkID="1" Rounding="SP" ZoneSize="3" />
<Corner SeqID="2" CompoundMarkID="2" Rounding="Port" ZoneSize="3" />
<Corner SeqID="3" CompoundMarkID="3" Rounding="Port" ZoneSize="3" />
<Corner SeqID="4" CompoundMarkID="4" Rounding="Port" ZoneSize="3" />
<Corner SeqID="3" CompoundMarkID="3" Rounding="Port" ZoneSize="3" />
<Corner SeqID="1" CompoundMarkID="1" Rounding="SP" ZoneSize="3"/>
<Corner SeqID="2" CompoundMarkID="2" Rounding="Port" ZoneSize="3"/>
<Corner SeqID="3" CompoundMarkID="3" Rounding="Port" ZoneSize="3"/>
<Corner SeqID="4" CompoundMarkID="4" Rounding="Port" ZoneSize="3"/>
<Corner SeqID="3" CompoundMarkID="3" Rounding="Port" ZoneSize="3"/>
<Corner SeqID="5" CompoundMarkID="5" Rounding="SP" ZoneSize="3"/>
</CompoundMarkSequence>
<CourseLimit>
@@ -1,14 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import javafx.geometry.*?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<AnchorPane fx:id="main" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng302.Controllers.MainController">
<?import javafx.scene.layout.AnchorPane?>
<AnchorPane xmlns:fx="http://javafx.com/fxml/1" fx:id="main" xmlns="http://javafx.com/javafx/8"
fx:controller="seng302.Controllers.MainController">
<children>
<fx:include source="race.fxml" fx:id="race"/>
<fx:include source="start.fxml" fx:id="start"/>
+55 -33
View File
@@ -1,20 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import javafx.geometry.*?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<SplitPane fx:id="race" dividerPositions="0.7" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng302.Controllers.RaceController">
<?import javafx.scene.text.Font?>
<SplitPane xmlns:fx="http://javafx.com/fxml/1" fx:id="race" dividerPositions="0.7" visible="false" AnchorPane.bottomAnchor="0.0"
AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"
xmlns="http://javafx.com/javafx/8" fx:controller="seng302.Controllers.RaceController">
<items>
<GridPane fx:id="canvasBase">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES"/>
</rowConstraints>
<children>
<Pane prefHeight="200.0" prefWidth="400.0" GridPane.halignment="LEFT" GridPane.valignment="TOP">
@@ -25,13 +24,28 @@
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="240.0" prefWidth="200.0">
<children>
<CheckBox fx:id="showBoatPath" mnemonicParsing="false" selected="true" text="Show Boat Paths" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="104.0" />
<CheckBox fx:id="showAnnotations" layoutX="-2.0" layoutY="14.0" mnemonicParsing="false" selected="true" text="Show Annotations" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0" />
<CheckBox fx:id="showName" layoutY="39.0" mnemonicParsing="false" selected="true" text="Show Boat Name" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="26.0" />
<CheckBox fx:id="showAbbrev" layoutY="61.0" mnemonicParsing="false" selected="true" text="Show Boat Abbreviation" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="52.0" />
<CheckBox fx:id="showSpeed" layoutY="90.0" mnemonicParsing="false" selected="true" text="Show Boat Speed" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="78.0" />
<Button fx:id="saveAnno" layoutX="11.0" layoutY="106.0" maxWidth="154.0" mnemonicParsing="false" prefWidth="154.0" text="Save Annotation" AnchorPane.topAnchor="130.0" />
<Button fx:id="showSetAnno" layoutX="11.0" layoutY="139.0" mnemonicParsing="false" text="Show Set Annotation" AnchorPane.topAnchor="160.0" />
<CheckBox fx:id="showBoatPath" mnemonicParsing="false" selected="true"
text="Show Boat Paths" AnchorPane.leftAnchor="0.0"
AnchorPane.topAnchor="104.0"/>
<CheckBox fx:id="showAnnotations" layoutX="-2.0" layoutY="14.0"
mnemonicParsing="false" selected="true"
text="Show Annotations" AnchorPane.leftAnchor="0.0"
AnchorPane.topAnchor="0.0"/>
<CheckBox fx:id="showName" layoutY="39.0" mnemonicParsing="false"
selected="true" text="Show Boat Name"
AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="26.0"/>
<CheckBox fx:id="showAbbrev" layoutY="61.0" mnemonicParsing="false"
selected="true" text="Show Boat Abbreviation"
AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="52.0"/>
<CheckBox fx:id="showSpeed" layoutY="90.0" mnemonicParsing="false"
selected="true" text="Show Boat Speed"
AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="78.0"/>
<Button fx:id="saveAnno" layoutX="11.0" layoutY="106.0" maxWidth="154.0"
mnemonicParsing="false" prefWidth="154.0" text="Save Annotation"
AnchorPane.topAnchor="130.0"/>
<Button fx:id="showSetAnno" layoutX="11.0" layoutY="139.0"
mnemonicParsing="false" text="Show Set Annotation"
AnchorPane.topAnchor="160.0"/>
</children>
</AnchorPane>
</content>
@@ -40,7 +54,9 @@
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<CheckBox fx:id="showFPS" layoutX="-14.0" layoutY="13.0" mnemonicParsing="false" selected="true" text="Show FPS" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0" />
<CheckBox fx:id="showFPS" layoutX="-14.0" layoutY="13.0"
mnemonicParsing="false" selected="true" text="Show FPS"
AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0"/>
</children>
</AnchorPane>
</content>
@@ -49,34 +65,40 @@
</Accordion>
</children>
</Pane>
<Label fx:id="timer" layoutX="45.0" layoutY="146.0" maxHeight="20.0" text="0:0" AnchorPane.bottomAnchor="0.0" AnchorPane.rightAnchor="0.0" GridPane.halignment="RIGHT" GridPane.valignment="BOTTOM">
<Label fx:id="timer" layoutX="45.0" layoutY="146.0" maxHeight="20.0" text="0:0"
AnchorPane.bottomAnchor="0.0" AnchorPane.rightAnchor="0.0" GridPane.halignment="RIGHT"
GridPane.valignment="BOTTOM">
<font>
<Font name="System Bold" size="15.0" />
<Font name="System Bold" size="15.0"/>
</font>
</Label>
<Label fx:id="FPS" text="FPS: 0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" GridPane.halignment="LEFT" GridPane.valignment="BOTTOM">
<Label fx:id="FPS" text="FPS: 0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
GridPane.halignment="LEFT" GridPane.valignment="BOTTOM">
<font>
<Font name="System Bold" size="15.0" />
<Font name="System Bold" size="15.0"/>
</font>
</Label>
<Label fx:id="timeZone" text="Label" GridPane.halignment="RIGHT" GridPane.valignment="BOTTOM">
<GridPane.margin>
<Insets bottom="20.0"/>
</GridPane.margin>
<font>
<Font name="System Bold" size="15.0"/>
</font>
</Label>
<Label fx:id="timeZone" text="Label" GridPane.halignment="RIGHT" GridPane.valignment="BOTTOM">
<GridPane.margin>
<Insets bottom="20.0" />
</GridPane.margin>
<font>
<Font name="System Bold" size="15.0" />
</font>
</Label>
</children>
</GridPane>
<AnchorPane layoutX="450.0" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="200.0" GridPane.columnIndex="1">
<AnchorPane layoutX="450.0" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="200.0"
GridPane.columnIndex="1">
<children>
<TableView fx:id="boatInfoTable" layoutX="-2.0" prefHeight="600.0" prefWidth="264.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="-2.0" AnchorPane.rightAnchor="-62.0" AnchorPane.topAnchor="0.0">
<TableView fx:id="boatInfoTable" layoutX="-2.0" prefHeight="600.0" prefWidth="264.0"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="-2.0" AnchorPane.rightAnchor="-62.0"
AnchorPane.topAnchor="0.0">
<columns>
<TableColumn fx:id="boatPlacingColumn" prefWidth="50.0" text="Place" />
<TableColumn fx:id="boatTeamColumn" prefWidth="100.0" text="Team" />
<TableColumn fx:id="boatMarkColumn" prefWidth="130.0" text="Mark" />
<TableColumn fx:id="boatSpeedColumn" prefWidth="75.0" text="Speed" />
<TableColumn fx:id="boatPlacingColumn" prefWidth="50.0" text="Place"/>
<TableColumn fx:id="boatTeamColumn" prefWidth="100.0" text="Team"/>
<TableColumn fx:id="boatMarkColumn" prefWidth="130.0" text="Mark"/>
<TableColumn fx:id="boatSpeedColumn" prefWidth="75.0" text="Speed"/>
</columns>
</TableView>
</children>
+42 -34
View File
@@ -1,57 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<AnchorPane fx:id="startWrapper" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng302.Controllers.StartController">
<AnchorPane xmlns:fx="http://javafx.com/fxml/1" fx:id="startWrapper" maxHeight="1.7976931348623157E308"
maxWidth="1.7976931348623157E308" xmlns="http://javafx.com/javafx/8"
fx:controller="seng302.Controllers.StartController">
<children>
<GridPane fx:id="start" prefHeight="600.0" prefWidth="780.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<GridPane fx:id="start" prefHeight="600.0" prefWidth="780.0" AnchorPane.bottomAnchor="0.0"
AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" prefWidth="200.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="372.0" minWidth="10.0" prefWidth="200.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="394.0" minWidth="10.0" prefWidth="250.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="416.0" minWidth="10.0" prefWidth="200.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" prefWidth="200.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" prefWidth="200.0"/>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="372.0" minWidth="10.0" prefWidth="200.0"/>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="394.0" minWidth="10.0" prefWidth="250.0"/>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="416.0" minWidth="10.0" prefWidth="200.0"/>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" prefWidth="200.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="241.0" minHeight="10.0" prefHeight="116.5" vgrow="SOMETIMES" />
<RowConstraints maxHeight="383.0" minHeight="10.0" prefHeight="257.5" vgrow="SOMETIMES" />
<RowConstraints maxHeight="369.0" minHeight="10.0" prefHeight="50.5" vgrow="SOMETIMES" />
<RowConstraints maxHeight="369.0" minHeight="10.0" prefHeight="38.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="191.5" minHeight="10.0" prefHeight="53.5" vgrow="SOMETIMES" />
<RowConstraints maxHeight="191.5" minHeight="10.0" prefHeight="82.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="241.0" minHeight="10.0" prefHeight="116.5" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="383.0" minHeight="10.0" prefHeight="257.5" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="369.0" minHeight="10.0" prefHeight="50.5" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="369.0" minHeight="10.0" prefHeight="38.0" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="191.5" minHeight="10.0" prefHeight="53.5" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="191.5" minHeight="10.0" prefHeight="82.0" vgrow="SOMETIMES"/>
</rowConstraints>
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Welcome to RaceVision" GridPane.columnSpan="5" GridPane.halignment="CENTER">
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Welcome to RaceVision" GridPane.columnSpan="5"
GridPane.halignment="CENTER">
<font>
<Font size="36.0" />
<Font size="36.0"/>
</font>
</Text>
<Button maxWidth="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#startRace1Min" prefWidth="100.0" fx:id="oneMinButton" text="1 Minute" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="4">
<Button maxWidth="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#startRace1Min"
prefWidth="100.0" fx:id="oneMinButton" text="1 Minute" GridPane.columnIndex="1"
GridPane.halignment="RIGHT" GridPane.rowIndex="4">
<GridPane.margin>
<Insets />
<Insets/>
</GridPane.margin>
</Button>
<Button maxWidth="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#startRaceNoScaling" prefWidth="100.0" fx:id="fifteenMinButton" text="15 Minutes" GridPane.columnIndex="3" GridPane.halignment="LEFT" GridPane.rowIndex="4" />
<Button maxWidth="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#startRace5Min" prefWidth="100.0" fx:id="fiveMinButton" text="5 Minutes" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="4" />
<Label text="Select Race Duration:" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="3" />
<TableView fx:id="boatNameTable" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.columnSpan="3" GridPane.rowIndex="1">
<Button maxWidth="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#startRaceNoScaling"
prefWidth="100.0" fx:id="fifteenMinButton" text="15 Minutes" GridPane.columnIndex="3"
GridPane.halignment="LEFT" GridPane.rowIndex="4"/>
<Button maxWidth="-Infinity" minWidth="-Infinity" mnemonicParsing="false" onAction="#startRace5Min"
prefWidth="100.0" fx:id="fiveMinButton" text="5 Minutes" GridPane.columnIndex="2"
GridPane.halignment="CENTER" GridPane.rowIndex="4"/>
<Label text="Select Race Duration:" GridPane.columnIndex="2" GridPane.halignment="CENTER"
GridPane.rowIndex="3"/>
<TableView fx:id="boatNameTable" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1"
GridPane.columnSpan="3" GridPane.rowIndex="1">
<columns>
<TableColumn fx:id="boatNameColumn" prefWidth="360.0" style="-fx-font-size: 16;" text="Team Name" />
<TableColumn fx:id="boatCodeColumn" prefWidth="133.0" style="-fx-font-size: 16;" text="Code" />
<TableColumn fx:id="boatNameColumn" prefWidth="360.0" style="-fx-font-size: 16;"
text="Team Name"/>
<TableColumn fx:id="boatCodeColumn" prefWidth="133.0" style="-fx-font-size: 16;" text="Code"/>
</columns>
</TableView>
<Label fx:id="timeZoneTime" contentDisplay="CENTER" text="timeZoneTime" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="2" GridPane.valignment="CENTER" />
<Label fx:id="timer" text=" " GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.rowIndex="5" />
<Label fx:id="timeZoneTime" contentDisplay="CENTER" text="timeZoneTime" GridPane.columnIndex="2"
GridPane.halignment="CENTER" GridPane.rowIndex="2" GridPane.valignment="CENTER"/>
<Label fx:id="timer" text=" " GridPane.columnIndex="2" GridPane.halignment="CENTER"
GridPane.rowIndex="5"/>
</children>
</GridPane>
</children>
@@ -2,11 +2,7 @@ package seng302.Mock;
import org.junit.Before;
import org.junit.Test;
import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;
@@ -3,9 +3,7 @@ package seng302.Mock;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.fail;
import static org.junit.Assert.*;
/**
* Created by jjg64 on 19/04/17.
@@ -14,7 +12,7 @@ public class RegattaXMLTest {
RegattaXMLReader regattaXMLReader;
@Before
public void findFile(){
public void findFile() {
try {
regattaXMLReader = new RegattaXMLReader("mockXML/regattaXML/regattaTest.xml");
} catch (Exception e) {
@@ -1,14 +1,10 @@
package seng302.Model;
import javafx.scene.paint.Color;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import seng302.GPSCoordinate;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertFalse;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.*;
/**
* Created by esa46 on 22/03/17.
@@ -146,13 +142,13 @@ public class BoatInRaceTest {
Marker endMarker = new Marker(new GPSCoordinate(50, 0));
Leg leg0deg = new Leg("Start", startMarker, endMarker, 0);
boat.setCurrentLeg(leg0deg);
boat.setCurrentPosition(new GPSCoordinate(0,0));
boat.setCurrentPosition(new GPSCoordinate(0, 0));
// Get latitude of endpoint of wake at 10 kn (longitude is 0)
double endpointAt10Kn = boat.getWake().getLatitude();
// Latitude of endpoint at 20 kn should be twice endpoint at 10 kn
boat.setVelocity(20);
assertEquals(2*endpointAt10Kn, boat.getWake().getLatitude(), 1e-8);
assertEquals(2 * endpointAt10Kn, boat.getWake().getLatitude(), 1e-8);
}
}
@@ -7,7 +7,6 @@ import org.junit.Test;
import seng302.Constants;
import seng302.GPSCoordinate;
import java.lang.reflect.Array;
import java.util.ArrayList;
import static org.junit.Assert.assertEquals;
@@ -5,7 +5,6 @@ import org.junit.Test;
import seng302.Constants;
import seng302.GPSCoordinate;
import java.awt.*;
import java.awt.geom.Point2D;
import static junit.framework.TestCase.assertEquals;
@@ -1,15 +1,5 @@
package seng302.Model;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.mockito.Mock;
import seng302.RaceDataSource;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.*;
/**
* Created by esa46 on 15/03/17.
*/
@@ -2,22 +2,18 @@ package seng302.Model;/**
* Created by Gondr on 26/03/2017.
*/
import static org.junit.Assert.*;
import org.junit.Test;
import org.xml.sax.SAXException;
import seng302.RaceXMLReader;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.*;
public class RaceXMLTest {
RaceXMLReader raceXMLReader;
@Test
public void canFindFile(){
public void canFindFile() {
try {
RaceXMLReader raceXMLReader = new RaceXMLReader("raceXML/bermuda_AC35.xml", false);
} catch (Exception e) {
@@ -26,7 +22,7 @@ public class RaceXMLTest {
}
@Test
public void canReadBoats(){
public void canReadBoats() {
try {
RaceXMLReader raceXMLReader = new RaceXMLReader("raceXML/bermuda_AC35.xml", false);
raceXMLReader.readBoats();
@@ -61,7 +57,7 @@ public class RaceXMLTest {
}
@Test
public void canReadLegs(){
public void canReadLegs() {
try {
RaceXMLReader raceXMLReader = new RaceXMLReader("raceXML/bermuda_AC35.xml", false);
raceXMLReader.readLegs();
@@ -72,7 +68,7 @@ public class RaceXMLTest {
}
@Test
public void canReadCourse(){
public void canReadCourse() {
try {
RaceXMLReader raceXMLReader = new RaceXMLReader("raceXML/bermuda_AC35.xml", false);
raceXMLReader.readCourse();
@@ -2,8 +2,6 @@ package seng302.Networking;
import org.junit.Assert;
import org.junit.Test;
import seng302.Networking.BinaryMesageEncoder;
import seng302.Networking.BinaryMessageDecoder;
import seng302.Networking.MessageDecoders.XMLMessageDecoder;
import seng302.Networking.MessageEncoders.XMLMessageEncoder;
import seng302.Networking.Utils.MessageType;
@@ -17,30 +15,30 @@ import java.io.InputStreamReader;
*/
public class BinaryMessageDecoderTest {
@Test
public void decodeTest(){
try{
public void decodeTest() {
try {
StringBuilder xmlString;
BufferedReader br = new BufferedReader(new InputStreamReader(
this.getClass().getResourceAsStream(("../../raceXML/Regatta.xml"))));
String line;
xmlString = new StringBuilder();
while((line=br.readLine())!= null){
while ((line = br.readLine()) != null) {
xmlString.append(line.trim());
}
long time = System.currentTimeMillis();
XMLMessageEncoder testEncoder = new XMLMessageEncoder((byte)1, (short)1, time, (byte)7, (short)1, (short)xmlString.length(), xmlString.toString());
XMLMessageEncoder testEncoder = new XMLMessageEncoder((byte) 1, (short) 1, time, (byte) 7, (short) 1, (short) xmlString.length(), xmlString.toString());
byte[] encodedMessage = testEncoder.encode();
BinaryMesageEncoder testMessage = new BinaryMesageEncoder(MessageType.XMLMESSAGE, time, 1, (short)encodedMessage.length, encodedMessage);
BinaryMesageEncoder testMessage = new BinaryMesageEncoder(MessageType.XMLMESSAGE, time, 1, (short) encodedMessage.length, encodedMessage);
BinaryMessageDecoder testDecoder = new BinaryMessageDecoder(testMessage.getFullMessage());
testDecoder.decode();
//message length
Assert.assertEquals((short) encodedMessage.length,testDecoder.getMessageLength());
Assert.assertEquals((short) encodedMessage.length, testDecoder.getMessageLength());
//time stamp
Assert.assertEquals(time,testDecoder.getTimeStamp());
Assert.assertEquals(time, testDecoder.getTimeStamp());
//source ID
Assert.assertEquals((short) 1, testDecoder.getSourceID());
//message type
@@ -50,15 +48,15 @@ public class BinaryMessageDecoderTest {
decoderXML.decode();
//tests from seng302.Networking.MessageDecoders.XMLMessageDecoderTest to make sure the file is still good
Assert.assertEquals((byte)1, decoderXML.getMessageVersionNumber());
Assert.assertEquals((short)1, decoderXML.getAckNumber());
Assert.assertEquals((byte) 1, decoderXML.getMessageVersionNumber());
Assert.assertEquals((short) 1, decoderXML.getAckNumber());
Assert.assertEquals(time, decoderXML.getTimeStamp());
Assert.assertEquals((byte)7, decoderXML.getXmlMsgSubType());
Assert.assertEquals((short)1, decoderXML.getSequenceNumber());
Assert.assertEquals((short)xmlString.length(), decoderXML.getXmlMsgLength());
Assert.assertEquals((byte) 7, decoderXML.getXmlMsgSubType());
Assert.assertEquals((short) 1, decoderXML.getSequenceNumber());
Assert.assertEquals((short) xmlString.length(), decoderXML.getXmlMsgLength());
Assert.assertEquals(xmlString.toString(), decoderXML.getXmlMessage());
}catch (IOException e){
} catch (IOException e) {
System.out.println(e);
}
}
@@ -2,9 +2,8 @@ package seng302.Networking.MessageDecoders;
import org.junit.Assert;
import org.junit.Test;
import seng302.Networking.MessageDecoders.BoatLocationDecoder;
import seng302.Networking.Utils.BoatLocationMessage;
import seng302.Networking.MessageEncoders.RaceVisionByteEncoder;
import seng302.Networking.Utils.BoatLocationMessage;
/**
@@ -12,15 +11,15 @@ import seng302.Networking.MessageEncoders.RaceVisionByteEncoder;
*/
public class BoatLocationDecoderTest {
@Test
public void getByteArrayTest(){
public void getByteArrayTest() {
long time = System.currentTimeMillis();
BoatLocationMessage testMessage = new BoatLocationMessage((byte)1, time, (byte)2,
3, (byte) 1, 180, -180, 4, (short)5,
(short)6, (short)7, 8, 9, 10, 11,
(short) 12, 13,(short) 14 ,(short) 15,
BoatLocationMessage testMessage = new BoatLocationMessage((byte) 1, time, (byte) 2,
3, (byte) 1, 180, -180, 4, (short) 5,
(short) 6, (short) 7, 8, 9, 10, 11,
(short) 12, 13, (short) 14, (short) 15,
16, 17, (short) 18);
RaceVisionByteEncoder raceVisionByteEncoder = new RaceVisionByteEncoder();
byte [] testEncodedMessage = raceVisionByteEncoder.boatLocation(testMessage);
byte[] testEncodedMessage = raceVisionByteEncoder.boatLocation(testMessage);
BoatLocationDecoder testDecoder = new BoatLocationDecoder(testEncodedMessage);
BoatLocationMessage decodedTest = testDecoder.getMessage();
@@ -2,9 +2,8 @@ package seng302.Networking.MessageDecoders;
import org.junit.Assert;
import org.junit.Test;
import seng302.Networking.MessageDecoders.CourseWindDecoder;
import seng302.Networking.Utils.CourseWind;
import seng302.Networking.MessageEncoders.RaceVisionByteEncoder;
import seng302.Networking.Utils.CourseWind;
import java.util.ArrayList;
@@ -14,11 +13,11 @@ import java.util.ArrayList;
*/
public class CourseWindDecoderTest {
@Test
public void getByteArrayTest(){
public void getByteArrayTest() {
long time = System.currentTimeMillis();
CourseWind testCourseWind1 = new CourseWind(1, time, 2,
3, 4, 5,
7, 6);
3, 4, 5,
7, 6);
long time2 = System.currentTimeMillis();
CourseWind testCourseWind2 = new CourseWind(2, time2, 2,
@@ -2,7 +2,6 @@ package seng302.Networking.MessageDecoders;
import org.junit.Assert;
import org.junit.Test;
import seng302.Networking.MessageDecoders.RaceStartStatusDecoder;
import seng302.Networking.MessageEncoders.RaceVisionByteEncoder;
/**
@@ -10,13 +9,13 @@ import seng302.Networking.MessageEncoders.RaceVisionByteEncoder;
*/
public class RaceStartStatusDecoderTest {
@Test
public void getByteArrayTest(){
public void getByteArrayTest() {
long time = System.currentTimeMillis();
RaceVisionByteEncoder raceVisionByteEncoder = new RaceVisionByteEncoder();
long time2 = System.currentTimeMillis();
byte[] encodedRaceStartStatus = raceVisionByteEncoder.raceStartStatus(time, (short)1,
time2, 2, (char)3);
byte[] encodedRaceStartStatus = raceVisionByteEncoder.raceStartStatus(time, (short) 1,
time2, 2, (char) 3);
RaceStartStatusDecoder testDecoder = new RaceStartStatusDecoder(encodedRaceStartStatus);
@@ -25,7 +24,7 @@ public class RaceStartStatusDecoderTest {
Assert.assertEquals(1, testDecoder.getAck());
Assert.assertEquals(time2, testDecoder.getStartTime());
Assert.assertEquals(2, testDecoder.getRaceID());
Assert.assertEquals((char)3, testDecoder.getNotification());
Assert.assertEquals((char) 3, testDecoder.getNotification());
}
}
@@ -5,7 +5,6 @@ import org.junit.Assert;
import org.junit.Test;
import seng302.Model.BoatInRace;
import seng302.Model.Leg;
import seng302.Networking.MessageDecoders.RaceStatusDecoder;
import seng302.Networking.MessageEncoders.RaceVisionByteEncoder;
import java.util.ArrayList;
@@ -15,7 +14,7 @@ import java.util.ArrayList;
*/
public class RaceStatusDecoderTest {
@Test
public void getByteArrayTest(){
public void getByteArrayTest() {
long time = System.currentTimeMillis();
BoatInRace boat1 = new BoatInRace("Test", 1, Color.ALICEBLUE, "tt");
Leg testLeg = new Leg("test leg", 1);
@@ -30,7 +29,7 @@ public class RaceStatusDecoderTest {
RaceVisionByteEncoder raceVisionByteEncoder = new RaceVisionByteEncoder();
byte[] encodedRaceStatus = raceVisionByteEncoder.raceStatus(time, 1, 2, time2,
(short)2, (short)3,4, boats);
(short) 2, (short) 3, 4, boats);
RaceStatusDecoder decoderTest = new RaceStatusDecoder(encodedRaceStatus);
@@ -39,8 +38,8 @@ public class RaceStatusDecoderTest {
Assert.assertEquals(1, decoderTest.getRace());
Assert.assertEquals(2, decoderTest.getRaceState());
Assert.assertEquals(time2, decoderTest.getStartTime());
Assert.assertEquals((short)2, decoderTest.getRaceWindDir());
Assert.assertEquals((short)3, decoderTest.getRaceWindSpeed());
Assert.assertEquals((short) 2, decoderTest.getRaceWindDir());
Assert.assertEquals((short) 3, decoderTest.getRaceWindSpeed());
Assert.assertEquals(0, decoderTest.getBoats().get(0).getBoatStatus());
Assert.assertEquals(0, decoderTest.getBoats().get(0).getLegNumber());
@@ -2,7 +2,6 @@ package seng302.Networking.MessageDecoders;
import org.junit.Assert;
import org.junit.Test;
import seng302.Networking.MessageDecoders.XMLMessageDecoder;
import seng302.Networking.MessageEncoders.XMLMessageEncoder;
import java.io.BufferedReader;
@@ -14,18 +13,18 @@ import java.io.InputStreamReader;
*/
public class XMLMessageDecoderTest {
@Test
public void getByteArrayTest(){
try{
public void getByteArrayTest() {
try {
StringBuilder xmlString;
BufferedReader br = new BufferedReader(new InputStreamReader(
this.getClass().getResourceAsStream(("../../../raceXML/Regatta.xml"))));
String line;
xmlString = new StringBuilder();
while((line=br.readLine())!= null){
while ((line = br.readLine()) != null) {
xmlString.append(line.trim());
}
long time = System.currentTimeMillis();
XMLMessageEncoder testEncoder = new XMLMessageEncoder((byte)1, (short)1, time, (byte)7, (short)1, (short)xmlString.length(), xmlString.toString());
XMLMessageEncoder testEncoder = new XMLMessageEncoder((byte) 1, (short) 1, time, (byte) 7, (short) 1, (short) xmlString.length(), xmlString.toString());
byte[] encodedXML = testEncoder.encode();
@@ -33,15 +32,15 @@ public class XMLMessageDecoderTest {
decoderXML.decode();
Assert.assertEquals((byte)1, decoderXML.getMessageVersionNumber());
Assert.assertEquals((short)1, decoderXML.getAckNumber());
Assert.assertEquals((byte) 1, decoderXML.getMessageVersionNumber());
Assert.assertEquals((short) 1, decoderXML.getAckNumber());
Assert.assertEquals(time, decoderXML.getTimeStamp());
Assert.assertEquals((byte)7, decoderXML.getXmlMsgSubType());
Assert.assertEquals((short)1, decoderXML.getSequenceNumber());
Assert.assertEquals((short)xmlString.length(), decoderXML.getXmlMsgLength());
Assert.assertEquals((byte) 7, decoderXML.getXmlMsgSubType());
Assert.assertEquals((short) 1, decoderXML.getSequenceNumber());
Assert.assertEquals((short) xmlString.length(), decoderXML.getXmlMsgLength());
Assert.assertEquals(xmlString.toString(), decoderXML.getXmlMessage());
}catch (IOException e){
} catch (IOException e) {
System.out.println(e);
}
}
@@ -4,51 +4,53 @@ import org.junit.Assert;
import org.junit.Test;
import seng302.Networking.MessageEncoders.XMLMessageEncoder;
import java.io.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* Created by hba56 on 19/04/17.
*/
public class XMLMessageEncoderTest {
@Test
public void getByteArrayTest(){
public void getByteArrayTest() {
StringBuilder xmlString;
try{
try {
BufferedReader br = new BufferedReader(new InputStreamReader(
this.getClass().getResourceAsStream(("../../raceXML/Regatta.xml"))));
String line;
xmlString = new StringBuilder();
while((line=br.readLine())!= null){
while ((line = br.readLine()) != null) {
xmlString.append(line.trim());
}
XMLMessageEncoder testEncoder = new XMLMessageEncoder((byte)1, (short)1, System.currentTimeMillis(), (byte)7, (short)1, (short)xmlString.length(), xmlString.toString());
XMLMessageEncoder testEncoder = new XMLMessageEncoder((byte) 1, (short) 1, System.currentTimeMillis(), (byte) 7, (short) 1, (short) xmlString.length(), xmlString.toString());
byte[] encodedXML = testEncoder.encode();
//1 + 2 + 6 + 1 + 2 + 2 + 374
Assert.assertEquals(388, encodedXML.length);
}catch (IOException e){
} catch (IOException e) {
System.out.println(e);
}
}
@Test
public void getByteArrayNullTest(){
public void getByteArrayNullTest() {
StringBuilder xmlString;
try{
try {
BufferedReader br = new BufferedReader(new InputStreamReader(
this.getClass().getResourceAsStream(("../../raceXML/Regatta.xml"))));
String line;
xmlString = new StringBuilder();
while((line=br.readLine())!= null){
while ((line = br.readLine()) != null) {
xmlString.append(line.trim());
}
XMLMessageEncoder testEncoder = new XMLMessageEncoder((byte)1, (short)1, System.currentTimeMillis(), (byte)7, (short)1, (short)1, xmlString.toString());
XMLMessageEncoder testEncoder = new XMLMessageEncoder((byte) 1, (short) 1, System.currentTimeMillis(), (byte) 7, (short) 1, (short) 1, xmlString.toString());
byte[] encodedXML = testEncoder.encode();
Assert.assertEquals(null, encodedXML);
}catch (IOException e){
} catch (IOException e) {
System.out.println(e);
}
}
@@ -8,13 +8,13 @@
<Settings>
<RaceBoatType Type="AC45" />
<RaceBoatType Type="AC45"/>
<BoatDimension BoatLength="14.019" HullLength="13.449" />
<BoatDimension BoatLength="14.019" HullLength="13.449"/>
<ZoneSize MarkZoneSize="40.347" CourseZoneSize="40.347" />
<ZoneSize MarkZoneSize="40.347" CourseZoneSize="40.347"/>
<ZoneLimits Limit1="200" Limit2="100" Limit3="40.347" Limit4="0" Limit5="-100" />
<ZoneLimits Limit1="200" Limit2="100" Limit3="40.347" Limit4="0" Limit5="-100"/>
</Settings>
@@ -24,13 +24,13 @@
<Vertices>
<Vtx Seq="1" Y="0" X="-2.659" />
<Vtx Seq="1" Y="0" X="-2.659"/>
<Vtx Seq="2" Y="18.359" X="-2.659" />
<Vtx Seq="2" Y="18.359" X="-2.659"/>
<Vtx Seq="3" Y="18.359" X="2.659" />
<Vtx Seq="3" Y="18.359" X="2.659"/>
<Vtx Seq="4" Y="0" X="2.659" />
<Vtx Seq="4" Y="0" X="2.659"/>
</Vertices>
@@ -40,13 +40,13 @@
<Vertices>
<Vtx Seq="1" Y="0" X="-1.278" />
<Vtx Seq="1" Y="0" X="-1.278"/>
<Vtx Seq="2" Y="8.876" X="-1.278" />
<Vtx Seq="2" Y="8.876" X="-1.278"/>
<Vtx Seq="3" Y="8.876" X="1.278" />
<Vtx Seq="3" Y="8.876" X="1.278"/>
<Vtx Seq="4" Y="0" X="1.278" />
<Vtx Seq="4" Y="0" X="1.278"/>
</Vertices>
@@ -56,13 +56,13 @@
<Vertices>
<Vtx Seq="1" Y="0" X="-1.1" />
<Vtx Seq="1" Y="0" X="-1.1"/>
<Vtx Seq="2" Y="8.3" X="-1.1" />
<Vtx Seq="2" Y="8.3" X="-1.1"/>
<Vtx Seq="3" Y="8.3" X="1.1" />
<Vtx Seq="3" Y="8.3" X="1.1"/>
<Vtx Seq="4" Y="0" X="1.1" />
<Vtx Seq="4" Y="0" X="1.1"/>
</Vertices>
@@ -72,13 +72,13 @@
<Vertices>
<Vtx Seq="1" Y="0" X="-0.75" />
<Vtx Seq="1" Y="0" X="-0.75"/>
<Vtx Seq="2" Y="3" X="-0.75" />
<Vtx Seq="2" Y="3" X="-0.75"/>
<Vtx Seq="3" Y="3" X="0.75" />
<Vtx Seq="3" Y="3" X="0.75"/>
<Vtx Seq="4" Y="0" X="0.75" />
<Vtx Seq="4" Y="0" X="0.75"/>
</Vertices>
@@ -88,83 +88,83 @@
<Vertices>
<Vtx Seq="1" Y="0" X="-3.46" />
<Vtx Seq="1" Y="0" X="-3.46"/>
<Vtx Seq="2" Y="13.449" X="-3.46" />
<Vtx Seq="2" Y="13.449" X="-3.46"/>
<Vtx Seq="3" Y="14.019" X="0" />
<Vtx Seq="3" Y="14.019" X="0"/>
<Vtx Seq="4" Y="13.449" X="3.46" />
<Vtx Seq="4" Y="13.449" X="3.46"/>
<Vtx Seq="5" Y="0" X="3.46" />
<Vtx Seq="5" Y="0" X="3.46"/>
</Vertices>
<Catamaran>
<Vtx Seq="1" Y="1.769" X="-2.752" />
<Vtx Seq="1" Y="1.769" X="-2.752"/>
<Vtx Seq="2" Y="0" X="-2.813" />
<Vtx Seq="2" Y="0" X="-2.813"/>
<Vtx Seq="3" Y="0" X="-3.34" />
<Vtx Seq="3" Y="0" X="-3.34"/>
<Vtx Seq="4" Y="5.351" X="-3.46" />
<Vtx Seq="4" Y="5.351" X="-3.46"/>
<Vtx Seq="5" Y="10.544" X="-3.387" />
<Vtx Seq="5" Y="10.544" X="-3.387"/>
<Vtx Seq="6" Y="13.449" X="-3.075" />
<Vtx Seq="6" Y="13.449" X="-3.075"/>
<Vtx Seq="7" Y="10.851" X="-2.793" />
<Vtx Seq="7" Y="10.851" X="-2.793"/>
<Vtx Seq="8" Y="6.669" X="-2.699" />
<Vtx Seq="8" Y="6.669" X="-2.699"/>
<Vtx Seq="9" Y="6.669" X="2.699" />
<Vtx Seq="9" Y="6.669" X="2.699"/>
<Vtx Seq="10" Y="10.851" X="2.793" />
<Vtx Seq="10" Y="10.851" X="2.793"/>
<Vtx Seq="11" Y="13.449" X="3.075" />
<Vtx Seq="11" Y="13.449" X="3.075"/>
<Vtx Seq="12" Y="10.544" X="3.387" />
<Vtx Seq="12" Y="10.544" X="3.387"/>
<Vtx Seq="13" Y="5.351" X="3.46" />
<Vtx Seq="13" Y="5.351" X="3.46"/>
<Vtx Seq="14" Y="0" X="3.34" />
<Vtx Seq="14" Y="0" X="3.34"/>
<Vtx Seq="15" Y="0" X="2.813" />
<Vtx Seq="15" Y="0" X="2.813"/>
<Vtx Seq="16" Y="1.769" X="2.752" />
<Vtx Seq="16" Y="1.769" X="2.752"/>
</Catamaran>
<Bowsprit>
<Vtx Seq="1" Y="6.669" X="-0.2" />
<Vtx Seq="1" Y="6.669" X="-0.2"/>
<Vtx Seq="2" Y="11.377" X="-0.2" />
<Vtx Seq="2" Y="11.377" X="-0.2"/>
<Vtx Seq="3" Y="14.019" X="0" />
<Vtx Seq="3" Y="14.019" X="0"/>
<Vtx Seq="4" Y="11.377" X="0.2" />
<Vtx Seq="4" Y="11.377" X="0.2"/>
<Vtx Seq="5" Y="6.669" X="0.2" />
<Vtx Seq="5" Y="6.669" X="0.2"/>
</Bowsprit>
<Trampoline>
<Vtx Seq="1" Y="2" X="-2.699" />
<Vtx Seq="1" Y="2" X="-2.699"/>
<Vtx Seq="2" Y="6.438" X="-2.699" />
<Vtx Seq="2" Y="6.438" X="-2.699"/>
<Vtx Seq="3" Y="6.438" X="2.699" />
<Vtx Seq="3" Y="6.438" X="2.699"/>
<Vtx Seq="4" Y="2" X="2.699" />
<Vtx Seq="4" Y="2" X="2.699"/>
</Trampoline>
</BoatShape>
<BoatShape ShapeID="5" />
<BoatShape ShapeID="5"/>
</BoatShapes>
@@ -174,9 +174,9 @@
BoatName="Regardless">
<GPSposition Z="6.840" Y="7.800" X="0.000" />
<GPSposition Z="6.840" Y="7.800" X="0.000"/>
<FlagPosition Z="0.000" Y="7.800" X="0.000" />
<FlagPosition Z="0.000" Y="7.800" X="0.000"/>
</Boat>
@@ -184,9 +184,9 @@
BoatName="Constellation">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
</Boat>
@@ -194,17 +194,17 @@
BoatName="Mischief">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
</Boat>
<Boat Type="Mark" SourceID="124" ShapeID="1" HullNum="LC03" ShortName="Atalanta" BoatName="Atalanta">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
</Boat>
@@ -212,9 +212,9 @@
BoatName="Volunteer">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
</Boat>
@@ -222,17 +222,17 @@
BoatName="Defender">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
</Boat>
<Boat Type="Mark" SourceID="128" ShapeID="1" HullNum="LC01" ShortName="Shamrock" BoatName="Shamrock">
<GPSposition Z="5.334" Y="3.804" X="0.000" />
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
<FlagPosition Z="0.000" Y="3.426" X="0.000" />
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
</Boat>
@@ -240,9 +240,9 @@
BoatName="TEAM KOREA" Country="KOR">
<GPSposition Z="1.738" Y="0.625" X="0.001" />
<GPSposition Z="1.738" Y="0.625" X="0.001"/>
<MastTop Z="21.496" Y="4.233" X="0.000" />
<MastTop Z="21.496" Y="4.233" X="0.000"/>
</Boat>
@@ -6,15 +6,15 @@
<RaceType>Match</RaceType>
<CreationTimeDate>2011-08-06T13:25:00-0000</CreationTimeDate >
<CreationTimeDate>2011-08-06T13:25:00-0000</CreationTimeDate>
<RaceStartTime Time="2011-08-06T13:30:00-0700" Postpone="false" />
<RaceStartTime Time="2011-08-06T13:30:00-0700" Postpone="false"/>
<Participants>
<Yacht SourceID="107" Entry="Port" />
<Yacht SourceID="107" Entry="Port"/>
<Yacht SourceID="108" Entry="Stbd" />
<Yacht SourceID="108" Entry="Stbd"/>
</Participants>
@@ -22,29 +22,29 @@
<CompoundMark CompoundMarkID="1" Name="StartLine">
<Mark SeqID="1" Name="PRO" TargetLat="-36.83" TargetLng="174.83" SourceID="101" />
<Mark SeqID="1" Name="PRO" TargetLat="-36.83" TargetLng="174.83" SourceID="101"/>
<Mark SeqID="2" Name="PIN" TargetLat="-36.84" TargetLng="174.81" SourceID="102" />
<Mark SeqID="2" Name="PIN" TargetLat="-36.84" TargetLng="174.81" SourceID="102"/>
</CompoundMark>
<CompoundMark CompoundMarkID="2" Name="M1">
<Mark Name="M1" TargetLat="-36.63566590" TargetLng="174.88543944" SourceID="103" />
<Mark Name="M1" TargetLat="-36.63566590" TargetLng="174.88543944" SourceID="103"/>
</CompoundMark>
<CompoundMark CompoundMarkID="3" Name="M2">
<Mark Name="M2" TargetLat="-36.83" TargetLng="174.80" SourceID="102" />
<Mark Name="M2" TargetLat="-36.83" TargetLng="174.80" SourceID="102"/>
</CompoundMark>
<CompoundMark CompoundMarkID="4" Name="Gate">
<Mark SeqID="1" Name="G1" TargetLat="-36.63566590" TargetLng="174.97205159" SourceID="104" />
<Mark SeqID="1" Name="G1" TargetLat="-36.63566590" TargetLng="174.97205159" SourceID="104"/>
<Mark SeqID="2" Name="G2" TargetLat="-36.64566590" TargetLng="174.98205159" SourceID="105" />
<Mark SeqID="2" Name="G2" TargetLat="-36.64566590" TargetLng="174.98205159" SourceID="105"/>
</CompoundMark>
@@ -52,13 +52,13 @@
<CompoundMarkSequence>
<Corner SeqID="1" CompoundMarkID="1" Rounding="SP" ZoneSize="3" />
<Corner SeqID="1" CompoundMarkID="1" Rounding="SP" ZoneSize="3"/>
<Corner SeqID="2" CompoundMarkID="2" Rounding="Port" ZoneSize="3" />
<Corner SeqID="2" CompoundMarkID="2" Rounding="Port" ZoneSize="3"/>
<Corner SeqID="3" CompoundMarkID="3" Rounding="Stbd" ZoneSize="6" />
<Corner SeqID="3" CompoundMarkID="3" Rounding="Stbd" ZoneSize="6"/>
<Corner SeqID="4" CompoundMarkID="4" Rounding="PS" ZoneSize="6" />
<Corner SeqID="4" CompoundMarkID="4" Rounding="PS" ZoneSize="6"/>
<Corner SeqID="5" CompoundMarkID="1" Rounding="SP" ZoneSize="3"/>