Cherrypicked changes allowing vis to display est time from bugged branch to current master.
#story[875]
This commit is contained in:
@@ -31,6 +31,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
private boolean annoAbbrev = true;
|
||||
private boolean annoSpeed = true;
|
||||
private boolean annoPath = true;
|
||||
private boolean annoEstTime = true;
|
||||
private boolean annoTimeSinceLastMark = true;
|
||||
private List<Color> colours;
|
||||
private final List<Marker> markers;
|
||||
@@ -177,7 +178,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
* @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, String estTime, ZonedDateTime timeSinceLastMark) {
|
||||
String text = "";
|
||||
//Check name toggle value
|
||||
if (annoName){
|
||||
@@ -191,10 +192,13 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
if (annoSpeed){
|
||||
text += String.format("%.2fkn ", speed);
|
||||
}
|
||||
if (annoEstTime) {
|
||||
text += estTime;
|
||||
}
|
||||
//Check time since last mark toggle value
|
||||
if(annoTimeSinceLastMark){
|
||||
Duration timeSince = Duration.between(timeSinceLastMark, raceClock.getTime());
|
||||
text += String.format("%d", timeSince.getSeconds());
|
||||
text += String.format(" %ds ", timeSince.getSeconds());
|
||||
}
|
||||
//String text = String.format("%s, %2$.2fkn", name, speed);
|
||||
long xCoord = coordinate.getX() + 20;
|
||||
@@ -277,6 +281,10 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
annoPath = !annoPath;
|
||||
}
|
||||
|
||||
public void toggleEstTime() {
|
||||
annoEstTime = !annoEstTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle boat time display in annotation
|
||||
*/
|
||||
@@ -320,7 +328,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
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.getFormattedEstTime(), boat.getTimeSinceLastMark());
|
||||
//TODO this needs to be fixed.
|
||||
drawTrack(boat, boatColours.get(sourceID));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user