boats have an annotation beside them that shows time since last mark passed

#story[878]
main
hba56 9 years ago
parent 9eb4e3daea
commit a24dda2fd8

@ -55,8 +55,8 @@ public class StreamedRace implements Runnable {
if (boat != null) {
Leg startLeg = new Leg(name, 0);
startLeg.setEndMarker(endCompoundMark);
System.out.println(controller.getRaceClock().getTime());
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 speed speed of the boat
* @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) {
String text = "";
@ -304,6 +305,9 @@ public class ResizableRaceCanvas extends ResizableCanvas {
}
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());
//TODO this needs to be fixed.
drawTrack(boat, colours.get(currentColour));

Loading…
Cancel
Save