Last minute changes to get ready for DoD
#story[875]
This commit is contained in:
@@ -50,8 +50,8 @@ public abstract class XMLReader {
|
||||
|
||||
/**
|
||||
* Alternate constructor
|
||||
* @param xmlFile
|
||||
* @param isWholeFile
|
||||
* @param xmlFile File to be read
|
||||
* @param isWholeFile boolean value whether entire file is being passed
|
||||
*/
|
||||
public XMLReader(String xmlFile, Boolean isWholeFile) {
|
||||
|
||||
@@ -91,9 +91,9 @@ public abstract class XMLReader {
|
||||
|
||||
/**
|
||||
* Get the contents of the XML FILe.
|
||||
* @param document
|
||||
* @return
|
||||
* @throws TransformerException
|
||||
* @param document holds all xml information
|
||||
* @return String representation of document
|
||||
* @throws TransformerException when document is malformed, and cannot be turned into a string
|
||||
*/
|
||||
public static String getContents(Document document) throws TransformerException {
|
||||
DOMSource source = new DOMSource(document);
|
||||
|
||||
@@ -108,6 +108,7 @@ public class MockOutput implements Runnable
|
||||
* @param lon longitude of boat
|
||||
* @param heading heading of boat
|
||||
* @param speed speed of boat
|
||||
* @param time historical time of race
|
||||
*/
|
||||
public synchronized void parseBoatLocation(int sourceID, double lat, double lon, double heading, double speed, long time){
|
||||
|
||||
|
||||
@@ -374,26 +374,29 @@ public class Race implements Runnable {
|
||||
|
||||
} else {
|
||||
//Otherwise, the race is over!
|
||||
System.out.println("test");
|
||||
raceFinished.start();
|
||||
setRaceStatusEnum(RaceStatusEnum.FINISHED);
|
||||
this.stop();
|
||||
}
|
||||
|
||||
// Change wind direction
|
||||
changeWindDir();
|
||||
if (getNumberOfActiveBoats() != 0) {
|
||||
// Change wind direction
|
||||
changeWindDir();
|
||||
|
||||
//Parse the boat locations.
|
||||
parseBoatLocations();
|
||||
//Parse the boat locations.
|
||||
parseBoatLocations();
|
||||
|
||||
//Parse the marks.
|
||||
parseMarks();
|
||||
//Parse the marks.
|
||||
parseMarks();
|
||||
|
||||
//Parse the race status.
|
||||
parseRaceStatus();
|
||||
//Parse the race status.
|
||||
parseRaceStatus();
|
||||
|
||||
|
||||
//Update the last frame time.
|
||||
this.lastFrameTime = currentTime;
|
||||
//Update the last frame time.
|
||||
this.lastFrameTime = currentTime;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -404,7 +407,7 @@ public class Race implements Runnable {
|
||||
int iters = 0;
|
||||
@Override
|
||||
public void handle(long now) {
|
||||
RaceStatus raceStatus = new RaceStatus(System.currentTimeMillis(), raceId, 4, startTime, 0, 2300, 2, null);
|
||||
RaceStatus raceStatus = new RaceStatus(System.currentTimeMillis(), raceId, 4, startTime, 0, 2300, 2, new ArrayList<>());
|
||||
mockOutput.parseRaceStatus(raceStatus);
|
||||
if (iters > 500){
|
||||
mockOutput.stop();
|
||||
@@ -625,10 +628,10 @@ public class Race implements Runnable {
|
||||
boat.setVMG(newVMG);
|
||||
}
|
||||
|
||||
|
||||
this.updateEstimatedTime(boat);
|
||||
//Check the boats position (update leg and stuff).
|
||||
this.checkPosition(boat, totalTimeElapsed);
|
||||
this.updateEstimatedTime(boat);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -751,7 +754,6 @@ public class Race implements Runnable {
|
||||
boat.setTimeFinished(timeElapsed);
|
||||
boat.setCurrentSpeed(0);
|
||||
boat.setStatus(BoatStatusEnum.FINISHED);
|
||||
|
||||
} else if (doNotFinish()) {
|
||||
//Boat has pulled out of race.
|
||||
boat.setTimeFinished(timeElapsed);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<?import javafx.scene.layout.StackPane?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<SplitPane fx:id="race" dividerPositions="0.7" prefHeight="431.0" prefWidth="610.0" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng302.Controllers.RaceController">
|
||||
<SplitPane fx:id="race" dividerPositions="0.7" prefHeight="431.0" prefWidth="610.0" 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">
|
||||
<items>
|
||||
<GridPane fx:id="canvasBase">
|
||||
<columnConstraints>
|
||||
|
||||
@@ -29,6 +29,7 @@ public class RaceConnectionTest {
|
||||
assertTrue(onlineConnection.check());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void offlineConnectionStatusOffline() {
|
||||
assertFalse(offlineConnection.check());
|
||||
|
||||
Reference in New Issue
Block a user