Implemented estimated time to next mark. Added checkbox for estimated time to next mark. To be fix: change from long to human readable time, update time every second

#story[923]
This commit is contained in:
Zhi You Tan
2017-05-12 20:04:09 +12:00
parent 5472765b95
commit 47880d09bc
4 changed files with 44 additions and 5 deletions
@@ -28,6 +28,9 @@ public class ImportantAnnotationController implements Initializable {
@FXML
private CheckBox boatNameSelect;
@FXML
private CheckBox boatEstTimeToNextMarkSelect;
@FXML
private AnchorPane annotationSelectWindow;
@@ -87,6 +90,10 @@ public class ImportantAnnotationController implements Initializable {
boatNameSelect.setSelected(importantAnnotations.get(key));
break;
case "BoatEstTimeToNextMark":
boatEstTimeToNextMarkSelect.setSelected(importantAnnotations.get(key));
break;
default:
break;
}
@@ -120,6 +127,11 @@ public class ImportantAnnotationController implements Initializable {
sendUpdate();
});
boatEstTimeToNextMarkSelect.setOnAction(event -> {
setAnnotation("BoatEstTimeToNextMark", boatEstTimeToNextMarkSelect.isSelected());
sendUpdate();
});
closeButton.setOnAction(event -> stage.close());
}
}
@@ -315,6 +315,7 @@ public class RaceViewController extends Thread{
BoatGroup bg = (BoatGroup) ro;
bg.setTeamNameObjectVisible(false);
bg.setVelocityObjectVisible(false);
bg.setEstTimeToNextMarkVisible(false);
bg.setLineGroupVisible(false);
bg.setWakeVisible(false);
}
@@ -326,6 +327,7 @@ public class RaceViewController extends Thread{
BoatGroup bg = (BoatGroup) ro;
bg.setTeamNameObjectVisible(true);
bg.setVelocityObjectVisible(false);
bg.setEstTimeToNextMarkVisible(false);
bg.setLineGroupVisible(false);
bg.setWakeVisible(false);
}
@@ -348,7 +350,14 @@ public class RaceViewController extends Thread{
bg.setVelocityObjectVisible(true);
}
else{
bg.setTeamNameObjectVisible(false);
bg.setVelocityObjectVisible(false);
}
if (importantAnnotations.containsKey("BoatEstTimeToNextMark") && importantAnnotations.get("BoatEstTimeToNextMark")) {
bg.setEstTimeToNextMarkVisible(true);
}
else{
bg.setEstTimeToNextMarkVisible(false);
}
if (importantAnnotations.containsKey("BoatTrack") && importantAnnotations.get("BoatTrack")){
@@ -373,6 +382,7 @@ public class RaceViewController extends Thread{
BoatGroup bg = (BoatGroup) ro;
bg.setTeamNameObjectVisible(true);
bg.setVelocityObjectVisible(true);
bg.setEstTimeToNextMarkVisible(true);
bg.setLineGroupVisible(true);
bg.setWakeVisible(true);
}