Merge branch 'develop' into Story34_Sparklines

This commit is contained in:
Kusal Ekanayake
2017-05-21 17:37:41 +12:00
+14 -5
View File
@@ -109,9 +109,13 @@ public class BoatGroup extends RaceObject {
teamNameObject.setCacheHint(CacheHint.SPEED); teamNameObject.setCacheHint(CacheHint.SPEED);
velocityObject = new Text(String.valueOf(boat.getVelocity())); velocityObject = new Text(String.valueOf(boat.getVelocity()));
DateFormat format = new SimpleDateFormat("mm:ss"); DateFormat format = new SimpleDateFormat("mm:ss");
String timeToNextMark = format // TODO: 21/05/17 make a nice way of checking for this to be null
estTimeToNextMarkObject = new Text("Next mark: null");
if (boat.getEstimateTimeAtNextMark() != null) {
String timeToNextMark = format
.format(boat.getEstimateTimeAtNextMark() - StreamParser.getCurrentTimeLong()); .format(boat.getEstimateTimeAtNextMark() - StreamParser.getCurrentTimeLong());
estTimeToNextMarkObject = new Text("Next mark: " + timeToNextMark); estTimeToNextMarkObject = new Text("Next mark: " + timeToNextMark);
}
if (boat.getMarkRoundingTime() != null) { if (boat.getMarkRoundingTime() != null) {
String elapsedTime = format String elapsedTime = format
.format(StreamParser.getCurrentTimeLong() - boat.getMarkRoundingTime()); .format(StreamParser.getCurrentTimeLong() - boat.getMarkRoundingTime());
@@ -280,9 +284,14 @@ public class BoatGroup extends RaceObject {
velocityObject.setText(String.format("%.2f m/s", boat.getVelocity())); velocityObject.setText(String.format("%.2f m/s", boat.getVelocity()));
DateFormat format = new SimpleDateFormat("mm:ss"); DateFormat format = new SimpleDateFormat("mm:ss");
// estimate time to next mark // estimate time to next mark
String timeToNextMark = format // TODO: 21/05/17 make a nice way of checking for this to be null
.format(boat.getEstimateTimeAtNextMark() - StreamParser.getCurrentTimeLong()); estTimeToNextMarkObject.setText("Next mark: null");
estTimeToNextMarkObject.setText("Next mark: " + timeToNextMark); if (boat.getEstimateTimeAtNextMark() != null) {
String timeToNextMark = format
.format(
boat.getEstimateTimeAtNextMark() - StreamParser.getCurrentTimeLong());
estTimeToNextMarkObject.setText("Next mark: " + timeToNextMark);
}
// elapsed time // elapsed time
if (boat.getMarkRoundingTime() != null) { if (boat.getMarkRoundingTime() != null) {
String elapsedTime = format String elapsedTime = format