|
|
|
@ -11,8 +11,10 @@ import fr.uca.iut.clfreville2.model.sensor.Sensor;
|
|
|
|
|
import fr.uca.iut.clfreville2.persistence.StubSensorRegistryLoader;
|
|
|
|
|
import javafx.fxml.FXML;
|
|
|
|
|
import javafx.scene.control.Button;
|
|
|
|
|
import javafx.scene.control.CheckBox;
|
|
|
|
|
import javafx.scene.control.ListView;
|
|
|
|
|
import javafx.scene.control.Slider;
|
|
|
|
|
import javafx.scene.control.Spinner;
|
|
|
|
|
import javafx.scene.control.TextField;
|
|
|
|
|
import javafx.scene.image.ImageView;
|
|
|
|
|
import javafx.scene.text.Text;
|
|
|
|
@ -40,6 +42,12 @@ public class MainWindows {
|
|
|
|
|
@FXML
|
|
|
|
|
private Button visualizeBtn;
|
|
|
|
|
|
|
|
|
|
@FXML
|
|
|
|
|
private Spinner<Integer> updateInterval;
|
|
|
|
|
|
|
|
|
|
@FXML
|
|
|
|
|
private CheckBox autoUpdate;
|
|
|
|
|
|
|
|
|
|
public MainWindows(Stage primaryStage) {
|
|
|
|
|
this.ticker = new Ticker(registry);
|
|
|
|
|
this.modalFactory = new ModalFactory(primaryStage);
|
|
|
|
@ -84,6 +92,7 @@ public class MainWindows {
|
|
|
|
|
private void initialize() {
|
|
|
|
|
bindSensorList();
|
|
|
|
|
bindActiveButtons();
|
|
|
|
|
bindUpdate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@FXML
|
|
|
|
@ -113,6 +122,12 @@ public class MainWindows {
|
|
|
|
|
visualizeBtn.visibleProperty().bind(sensorsList.getSelectionModel().selectedItemProperty().isNotNull());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@FXML
|
|
|
|
|
private void bindUpdate() {
|
|
|
|
|
updateInterval.getValueFactory().valueProperty().bindBidirectional(ticker.millisPerTickProperty().asObject());
|
|
|
|
|
autoUpdate.selectedProperty().bindBidirectional(ticker.runningProperty());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Sensor getSelectedSensor() {
|
|
|
|
|
return sensorsList.getSelectionModel().getSelectedItem();
|
|
|
|
|
}
|
|
|
|
|