Race is now showing a speedometer in the bottom right corner. Next step is to update with speed of boat and improve appearance. #story[1311]
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package visualiser.Controllers;
|
||||
|
||||
import com.interactivemesh.jfx.importer.stl.StlMeshImporter;
|
||||
import eu.hansolo.medusa.Gauge;
|
||||
import eu.hansolo.medusa.GaugeBuilder;
|
||||
import javafx.animation.AnimationTimer;
|
||||
import javafx.application.Platform;
|
||||
import javafx.collections.FXCollections;
|
||||
@@ -93,6 +95,7 @@ public class RaceViewController extends Controller {
|
||||
private @FXML Label tutorialText;
|
||||
private @FXML AnchorPane infoWrapper;
|
||||
private @FXML AnchorPane lineChartWrapper;
|
||||
private @FXML StackPane speedPane;
|
||||
|
||||
/**
|
||||
* Displays a specified race.
|
||||
@@ -200,6 +203,16 @@ public class RaceViewController extends Controller {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create speedometer
|
||||
*/
|
||||
private void initialiseSpeedometer() {
|
||||
Gauge gauge = GaugeBuilder.create().title("Speedometer").subTitle("Speed").unit("Knots").build();
|
||||
gauge.valueProperty().setValue(100);
|
||||
speedPane.getChildren().add(gauge);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialises the various UI components to listen to the {@link #visualiserRace}.
|
||||
*/
|
||||
@@ -222,6 +235,7 @@ public class RaceViewController extends Controller {
|
||||
initialiseInfoTable();
|
||||
initialiseView3D(this.visualiserRace);
|
||||
initialiseRaceClock();
|
||||
initialiseSpeedometer();
|
||||
raceTimer(); // start the timer
|
||||
new Sparkline(this.raceState, this.sparklineChart);
|
||||
timeZone.setText(this.raceState.getRaceClock().getTimeZone());
|
||||
|
||||
Reference in New Issue
Block a user