Merge remote-tracking branch 'origin/splitIntoTwoModules' into splitIntoTwoModules
This commit is contained in:
@@ -61,6 +61,9 @@ public class BoatLocationDecoder {
|
|||||||
currentSet = Arrays.copyOfRange(encodedBoatLocation,52, 54);
|
currentSet = Arrays.copyOfRange(encodedBoatLocation,52, 54);
|
||||||
rudderAngle = Arrays.copyOfRange(encodedBoatLocation,54, 56);
|
rudderAngle = Arrays.copyOfRange(encodedBoatLocation,54, 56);
|
||||||
|
|
||||||
|
// System.out.println(bytesToInt(sourceID));
|
||||||
|
// System.out.println(bytesToInt(boatSpeed));
|
||||||
|
|
||||||
message = new BoatLocationMessage(messageVersionNumber, bytesToLong(time),
|
message = new BoatLocationMessage(messageVersionNumber, bytesToLong(time),
|
||||||
bytesToInt(sourceID), bytesToInt(seqNum),
|
bytesToInt(sourceID), bytesToInt(seqNum),
|
||||||
deviceType, bytesToInt(latitude),
|
deviceType, bytesToInt(latitude),
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ public class BoatLocationMessage extends AC35Data
|
|||||||
this.roll = 0;
|
this.roll = 0;
|
||||||
this.boatSpeed = convertBoatSpeedDoubleToInt(boatSpeed);
|
this.boatSpeed = convertBoatSpeedDoubleToInt(boatSpeed);
|
||||||
this.boatCOG = 0;
|
this.boatCOG = 0;
|
||||||
this.boatSOG = 0;
|
this.boatSOG = convertBoatSpeedDoubleToInt(boatSpeed);
|
||||||
this.apparentWindSpeed = 0;
|
this.apparentWindSpeed = 0;
|
||||||
this.apparentWindAngle = 0;
|
this.apparentWindAngle = 0;
|
||||||
this.trueWindSpeed = 0;
|
this.trueWindSpeed = 0;
|
||||||
@@ -190,8 +190,6 @@ public class BoatLocationMessage extends AC35Data
|
|||||||
int coordinateInt = (int) ((coordinate / 180.0) * 2147483648.0);
|
int coordinateInt = (int) ((coordinate / 180.0) * 2147483648.0);
|
||||||
|
|
||||||
return coordinateInt;
|
return coordinateInt;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,8 +6,10 @@ import javafx.beans.value.ChangeListener;
|
|||||||
import javafx.beans.value.ObservableValue;
|
import javafx.beans.value.ObservableValue;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.Node;
|
||||||
import javafx.scene.control.*;
|
import javafx.scene.control.*;
|
||||||
import javafx.scene.layout.GridPane;
|
import javafx.scene.layout.GridPane;
|
||||||
|
import org.w3c.dom.NodeList;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
import seng302.Mock.StreamedRace;
|
import seng302.Mock.StreamedRace;
|
||||||
import seng302.Model.*;
|
import seng302.Model.*;
|
||||||
@@ -129,7 +131,7 @@ public class RaceController extends Controller {
|
|||||||
raceMap.drawRaceMap();
|
raceMap.drawRaceMap();
|
||||||
raceMap.setVisible(true);
|
raceMap.setVisible(true);
|
||||||
|
|
||||||
canvasBase.getChildren().add(raceMap);
|
canvasBase.getChildren().add(0, raceMap);
|
||||||
race.setVisible(true);
|
race.setVisible(true);
|
||||||
|
|
||||||
//Initialize save annotation array, fps listener, and annotation listeners
|
//Initialize save annotation array, fps listener, and annotation listeners
|
||||||
|
|||||||
@@ -58,6 +58,10 @@ public class StreamedRace extends Race {
|
|||||||
|
|
||||||
int legNumber = boatStatusMessage.getLegNumber();
|
int legNumber = boatStatusMessage.getLegNumber();
|
||||||
|
|
||||||
|
if (legNumber >= 1 && legNumber < legs.size()) {
|
||||||
|
boat.setCurrentLeg(legs.get(legNumber));
|
||||||
|
}
|
||||||
|
|
||||||
if (boatStatus == BoatStatus.DNF) {
|
if (boatStatus == BoatStatus.DNF) {
|
||||||
boat.setDnf(true);
|
boat.setDnf(true);
|
||||||
} else if (boatStatus == BoatStatus.FINISHED || legNumber > raceData.getLegs().size()) {
|
} else if (boatStatus == BoatStatus.FINISHED || legNumber > raceData.getLegs().size()) {
|
||||||
@@ -84,7 +88,7 @@ public class StreamedRace extends Race {
|
|||||||
double lon = boatLocationMessage.getLongitudeDouble();
|
double lon = boatLocationMessage.getLongitudeDouble();
|
||||||
boat.setCurrentPosition(new GPSCoordinate(lat, lon));
|
boat.setCurrentPosition(new GPSCoordinate(lat, lon));
|
||||||
boat.setHeading(boatLocationMessage.getHeadingDegrees());
|
boat.setHeading(boatLocationMessage.getHeadingDegrees());
|
||||||
boat.setVelocity(boatLocationMessage.getBoatSpeed() * MMPS_TO_KN);
|
boat.setVelocity(boatLocationMessage.getBoatSOG() * MMPS_TO_KN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ public abstract class Race implements Runnable {
|
|||||||
for(Boat boat: startingBoats) {
|
for(Boat boat: startingBoats) {
|
||||||
if(boat != null) {
|
if(boat != null) {
|
||||||
boat.setPosition(Integer.toString(startingBoats.indexOf(boat) + 1));
|
boat.setPosition(Integer.toString(startingBoats.indexOf(boat) + 1));
|
||||||
if (boat.getCurrentLeg().getName().equals("DNF") || boat.getCurrentLeg().getLegNumber() == 0)
|
if (boat.isDnf() || !boat.isStarted() || boat.getCurrentLeg().getLegNumber() < 0)
|
||||||
boat.setPosition("-");
|
boat.setPosition("-");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user