boats have an annotation beside them that shows time since last mark passed
#story[878]
This commit is contained in:
@@ -55,8 +55,8 @@ public class StreamedRace implements Runnable {
|
|||||||
if (boat != null) {
|
if (boat != null) {
|
||||||
Leg startLeg = new Leg(name, 0);
|
Leg startLeg = new Leg(name, 0);
|
||||||
startLeg.setEndMarker(endCompoundMark);
|
startLeg.setEndMarker(endCompoundMark);
|
||||||
System.out.println(controller.getRaceClock().getTime());
|
|
||||||
boat.setCurrentLeg(startLeg, controller.getRaceClock());
|
boat.setCurrentLeg(startLeg, controller.getRaceClock());
|
||||||
|
boat.setTimeSinceLastMark(controller.getRaceClock().getTime());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,6 +165,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|||||||
* @param abbrev abbreviation of the boat name
|
* @param abbrev abbreviation of the boat name
|
||||||
* @param speed speed of the boat
|
* @param speed speed of the boat
|
||||||
* @param coordinate coordinate the text appears
|
* @param coordinate coordinate the text appears
|
||||||
|
* @param timeSinceLastMark time since the last mark was passed
|
||||||
*/
|
*/
|
||||||
private void displayText(String name, String abbrev, double speed, GraphCoordinate coordinate, ZonedDateTime timeSinceLastMark) {
|
private void displayText(String name, String abbrev, double speed, GraphCoordinate coordinate, ZonedDateTime timeSinceLastMark) {
|
||||||
String text = "";
|
String text = "";
|
||||||
@@ -304,6 +305,9 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (raceAnno)
|
if (raceAnno)
|
||||||
|
if (Duration.between(boat.getTimeSinceLastMark(), raceClock.getTime()).getSeconds() < 0){
|
||||||
|
boat.setTimeSinceLastMark(raceClock.getTime());
|
||||||
|
}
|
||||||
displayText(boat.toString(), boat.getAbbrev(), boat.getVelocity(), this.map.convertGPS(boat.getCurrentPosition()), boat.getTimeSinceLastMark());
|
displayText(boat.toString(), boat.getAbbrev(), boat.getVelocity(), this.map.convertGPS(boat.getCurrentPosition()), boat.getTimeSinceLastMark());
|
||||||
//TODO this needs to be fixed.
|
//TODO this needs to be fixed.
|
||||||
drawTrack(boat, colours.get(currentColour));
|
drawTrack(boat, colours.get(currentColour));
|
||||||
|
|||||||
Reference in New Issue
Block a user