diff --git a/doc/Diagramme_de_classes.drawio b/doc/Diagramme_de_classes.drawio
new file mode 100644
index 0000000..117461c
--- /dev/null
+++ b/doc/Diagramme_de_classes.drawio
@@ -0,0 +1 @@
+
7V1rc5s4F/41nsnuTDKIOx9zadrMNLudJu3ufqRGtXkXgwfLueyvfyVAXCRhsI3Au1an0wYZiNFzdPScR0eHmXG7evuY+uvlYxLAaKZrwdvMuJvpuqsD/C9peM8bgGZrecsiDYOirWp4Cv+B9MSidRsGcNM4ESVJhMJ1s3GexDGco0abn6bJa/O0n0nU/K1rfwG5hqe5H/Gtf4QBWtLncqr2TzBcLOlvBraXf7Ly6cnFk2yWfpC81pqMDzPjNk0SlP+0eruFEek82i/5dfctn5ZfLIUx6nPBzd1dEjn3Xxd/fX1w3+4ePn379OGyuMuLH22LB7711yhJi6+M3mk/bF7DVeTH+OjmZxKjp+ITAx/7UbiI8c9z/EVgihteYIpC3IXXxQcoWePW+TKMgs/+e7IlX3eD/Pnf9OhmmaThP/i2foQ/ArgBf5yiwhp0u3HGE7kSN2u4NYUbfM4X2geAaXr03xonfvY3qGiYJ1Hkrzfhj+wxyIUrP12E8U2CULIqTio6Bz8OfGvtdVBiiQcBTFYQpe/4FHoBcAr8ixFgGsXxa2VOhlm0LWumZDh6YcaFCS/Km1co4x8KoPcAXedAv8wvwRZkXON/v317wK32TDferstuqBkD7g6UgZQmf8PbJML2YtzFSW4dYRQxTdRAIvgTtZrHZu3Pw3jxOTvnzqxavhZdQpoSfO3PKBtFyzAIYEygTZCP/BxHAto6CWOUdZl1g//inr3VrqyZhb/4LT4G1TH+S05P0W0S42fxwwxSiI3kFRJD6Yd/+7jijaKwAdK1fUyAnje4BRhCC4j9FSxt4AmluPMV9ANDb+kTQ28Koc8PKfZBsiWdqrAfFnvHnRh7S4g9CvGwV7jLwx1o5sTA2xzwHMhRmIGXg0ypLjgI4RXGKoIVpM8E8btLwMFu8LAbAogj/weMviSbEIUJuX+an8tA34Vu03zDeAnTUCrqfYmeKwl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6OIFD/qiSOD3cEPetkprBWZtzymEDwiu6PvQbot9yWf+ErS6M9SlGY9osXbUZDBXtBiTGU8Q0LdozrgakzbN7c7+h2/EzsigLY1GGQ+izzLTjft7ohnIdEKiRd1x7Yhf3smt5TqFviIdw5EOs8koRfXxaR2Qcd6M46olHimsY+8lHiHusliH2546jp7hak1ElW1KEsiNa5rfc6aTgTQbEJEHkQ1Ic/pUrNyPPCgzGNYMRHP/qGZQzi0qAjnFCGS39fQlEPKcyGFrSUe+oLOhz9KXdUp/Qac7YtklNlfAYmXR3gKrBcQypnSB1S5e6X5aAqvHe7vnJY5yAs5szzLMYWLffL18mPBH1xjN1TB5CjRugpunqoi0Rz/DyyD52DvZxDf6ntpR5rK2gVZVa5411jW7XhA25DzXd69mG54yJkSbXXFkp7HeEyL7TmtpE6LLvAjZKAqIyZ3fBMtItQiOM+imVXYUQpE4O2DG0xTHbJoNVrcmXaSKytLGPF5dvxOLISfUic2ETVdQZQYAQYAgLSnEE70jq92pHrVfvdWnVkmatciBpmtKjxu8vqmY3ohvVWDJt3NwBoerd9xJcuEnj5ewSVlG7J4FZcFOMh1MpkdwtaZbdRzeI4xaqtnjteeGrMRBdpZx2BDQ62ydTkG8NW4lAUCnIxVwDbrc5O39BqxRSwkArS3J5YWM/AtaTL+x1pAlvBGNuUtgxg9nvF2fs9YszXAmr0YANF6u67QckrSgDGdSw5m8TAHQeuxTH6h+uzi8KCMK2eFF30TyNsikvLPNYTSWw/PDuzLND44u8GGaJKh+Oo7Vl49Z0Vjjw/8B
\ No newline at end of file
diff --git a/doc/Diagramme_de_classes.png b/doc/Diagramme_de_classes.png
new file mode 100644
index 0000000..7acdd4d
Binary files /dev/null and b/doc/Diagramme_de_classes.png differ
diff --git a/src/TPCapteur.iml b/src/TPCapteur.iml
new file mode 100644
index 0000000..03179d7
--- /dev/null
+++ b/src/TPCapteur.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/TPCaptor/.idea/.gitignore b/src/TPCaptor/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/src/TPCaptor/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/src/TPCaptor/.idea/misc.xml b/src/TPCaptor/.idea/misc.xml
new file mode 100644
index 0000000..a346fd7
--- /dev/null
+++ b/src/TPCaptor/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/TPCaptor/.idea/modules.xml b/src/TPCaptor/.idea/modules.xml
new file mode 100644
index 0000000..b606a41
--- /dev/null
+++ b/src/TPCaptor/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/TPCaptor/.idea/uiDesigner.xml b/src/TPCaptor/.idea/uiDesigner.xml
new file mode 100644
index 0000000..2b63946
--- /dev/null
+++ b/src/TPCaptor/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/src/TPCaptor/.idea/vcs.xml b/src/TPCaptor/.idea/vcs.xml
new file mode 100644
index 0000000..b2bdec2
--- /dev/null
+++ b/src/TPCaptor/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/TPCaptor/TPCapteur.iml b/src/TPCaptor/TPCapteur.iml
new file mode 100644
index 0000000..4464c47
--- /dev/null
+++ b/src/TPCaptor/TPCapteur.iml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/TPCaptor/out/production/TPCapteur/fxml/CaptorWindow.fxml b/src/TPCaptor/out/production/TPCapteur/fxml/CaptorWindow.fxml
new file mode 100644
index 0000000..ee59b9d
--- /dev/null
+++ b/src/TPCaptor/out/production/TPCapteur/fxml/CaptorWindow.fxml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/TPCaptor/out/production/TPCapteur/fxml/ImageWindow.fxml b/src/TPCaptor/out/production/TPCapteur/fxml/ImageWindow.fxml
new file mode 100644
index 0000000..2af068c
--- /dev/null
+++ b/src/TPCaptor/out/production/TPCapteur/fxml/ImageWindow.fxml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/TPCaptor/out/production/TPCapteur/fxml/ThermostatWindow.fxml b/src/TPCaptor/out/production/TPCapteur/fxml/ThermostatWindow.fxml
new file mode 100644
index 0000000..c1dd8f0
--- /dev/null
+++ b/src/TPCaptor/out/production/TPCapteur/fxml/ThermostatWindow.fxml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/TPCaptor/out/production/TPCapteur/images/captor_icon.png b/src/TPCaptor/out/production/TPCapteur/images/captor_icon.png
new file mode 100644
index 0000000..6995fa2
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/images/captor_icon.png differ
diff --git a/src/TPCaptor/out/production/TPCapteur/images/multi_captor_icon.png b/src/TPCaptor/out/production/TPCapteur/images/multi_captor_icon.png
new file mode 100644
index 0000000..1e9dc6b
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/images/multi_captor_icon.png differ
diff --git a/src/TPCaptor/out/production/TPCapteur/images/neige.jpg b/src/TPCaptor/out/production/TPCapteur/images/neige.jpg
new file mode 100644
index 0000000..3f7406a
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/images/neige.jpg differ
diff --git a/src/TPCaptor/out/production/TPCapteur/images/nuage.jpg b/src/TPCaptor/out/production/TPCapteur/images/nuage.jpg
new file mode 100644
index 0000000..7231ab8
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/images/nuage.jpg differ
diff --git a/src/TPCaptor/out/production/TPCapteur/images/soleil.jpg b/src/TPCaptor/out/production/TPCapteur/images/soleil.jpg
new file mode 100644
index 0000000..140dff8
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/images/soleil.jpg differ
diff --git a/src/TPCaptor/out/production/TPCapteur/launcher/Console.class b/src/TPCaptor/out/production/TPCapteur/launcher/Console.class
new file mode 100644
index 0000000..5e77e62
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/launcher/Console.class differ
diff --git a/src/TPCaptor/out/production/TPCapteur/launcher/main.class b/src/TPCaptor/out/production/TPCapteur/launcher/main.class
new file mode 100644
index 0000000..88a8cf9
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/launcher/main.class differ
diff --git a/src/TPCaptor/out/production/TPCapteur/model/Captor.class b/src/TPCaptor/out/production/TPCapteur/model/Captor.class
new file mode 100644
index 0000000..0e91cd6
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/model/Captor.class differ
diff --git a/src/TPCaptor/out/production/TPCapteur/model/CaptorArea.class b/src/TPCaptor/out/production/TPCapteur/model/CaptorArea.class
new file mode 100644
index 0000000..78c4339
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/model/CaptorArea.class differ
diff --git a/src/TPCaptor/out/production/TPCapteur/model/CaptorBasic.class b/src/TPCaptor/out/production/TPCapteur/model/CaptorBasic.class
new file mode 100644
index 0000000..b930a64
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/model/CaptorBasic.class differ
diff --git a/src/TPCaptor/out/production/TPCapteur/model/CaptorStationStub$1.class b/src/TPCaptor/out/production/TPCapteur/model/CaptorStationStub$1.class
new file mode 100644
index 0000000..7cb26f8
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/model/CaptorStationStub$1.class differ
diff --git a/src/TPCaptor/out/production/TPCapteur/model/CaptorStationStub.class b/src/TPCaptor/out/production/TPCapteur/model/CaptorStationStub.class
new file mode 100644
index 0000000..ca9ad90
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/model/CaptorStationStub.class differ
diff --git a/src/TPCaptor/out/production/TPCapteur/model/GenBoundedRandom.class b/src/TPCaptor/out/production/TPCapteur/model/GenBoundedRandom.class
new file mode 100644
index 0000000..8e1e593
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/model/GenBoundedRandom.class differ
diff --git a/src/TPCaptor/out/production/TPCapteur/model/GenCPU.class b/src/TPCaptor/out/production/TPCapteur/model/GenCPU.class
new file mode 100644
index 0000000..e917dfb
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/model/GenCPU.class differ
diff --git a/src/TPCaptor/out/production/TPCapteur/model/GenStrategy.class b/src/TPCaptor/out/production/TPCapteur/model/GenStrategy.class
new file mode 100644
index 0000000..1f0ca1a
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/model/GenStrategy.class differ
diff --git a/src/TPCaptor/out/production/TPCapteur/model/Observable.class b/src/TPCaptor/out/production/TPCapteur/model/Observable.class
new file mode 100644
index 0000000..9217adb
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/model/Observable.class differ
diff --git a/src/TPCaptor/out/production/TPCapteur/model/Observer.class b/src/TPCaptor/out/production/TPCapteur/model/Observer.class
new file mode 100644
index 0000000..2ddbb37
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/model/Observer.class differ
diff --git a/src/TPCaptor/out/production/TPCapteur/model/VisitorCaptor.class b/src/TPCaptor/out/production/TPCapteur/model/VisitorCaptor.class
new file mode 100644
index 0000000..959857c
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/model/VisitorCaptor.class differ
diff --git a/src/TPCaptor/out/production/TPCapteur/view/CaptorMonitorWindow.class b/src/TPCaptor/out/production/TPCapteur/view/CaptorMonitorWindow.class
new file mode 100644
index 0000000..d801700
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/view/CaptorMonitorWindow.class differ
diff --git a/src/TPCaptor/out/production/TPCapteur/view/CaptorWindow.class b/src/TPCaptor/out/production/TPCapteur/view/CaptorWindow.class
new file mode 100644
index 0000000..36ac10f
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/view/CaptorWindow.class differ
diff --git a/src/TPCaptor/out/production/TPCapteur/view/FXMLWindow.class b/src/TPCaptor/out/production/TPCapteur/view/FXMLWindow.class
new file mode 100644
index 0000000..c6050c7
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/view/FXMLWindow.class differ
diff --git a/src/TPCaptor/out/production/TPCapteur/view/ImageWindow.class b/src/TPCaptor/out/production/TPCapteur/view/ImageWindow.class
new file mode 100644
index 0000000..4b99a04
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/view/ImageWindow.class differ
diff --git a/src/TPCaptor/out/production/TPCapteur/view/ThermostatWindow.class b/src/TPCaptor/out/production/TPCapteur/view/ThermostatWindow.class
new file mode 100644
index 0000000..e3c312f
Binary files /dev/null and b/src/TPCaptor/out/production/TPCapteur/view/ThermostatWindow.class differ
diff --git a/src/TPCaptor/res/fxml/CaptorWindow.fxml b/src/TPCaptor/res/fxml/CaptorWindow.fxml
new file mode 100644
index 0000000..ee59b9d
--- /dev/null
+++ b/src/TPCaptor/res/fxml/CaptorWindow.fxml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/TPCaptor/res/fxml/ImageWindow.fxml b/src/TPCaptor/res/fxml/ImageWindow.fxml
new file mode 100644
index 0000000..2af068c
--- /dev/null
+++ b/src/TPCaptor/res/fxml/ImageWindow.fxml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/TPCaptor/res/fxml/ThermostatWindow.fxml b/src/TPCaptor/res/fxml/ThermostatWindow.fxml
new file mode 100644
index 0000000..c1dd8f0
--- /dev/null
+++ b/src/TPCaptor/res/fxml/ThermostatWindow.fxml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/TPCaptor/res/images/captor_icon.png b/src/TPCaptor/res/images/captor_icon.png
new file mode 100644
index 0000000..6995fa2
Binary files /dev/null and b/src/TPCaptor/res/images/captor_icon.png differ
diff --git a/src/TPCaptor/res/images/multi_captor_icon.png b/src/TPCaptor/res/images/multi_captor_icon.png
new file mode 100644
index 0000000..1e9dc6b
Binary files /dev/null and b/src/TPCaptor/res/images/multi_captor_icon.png differ
diff --git a/src/TPCaptor/res/images/neige.jpg b/src/TPCaptor/res/images/neige.jpg
new file mode 100644
index 0000000..3f7406a
Binary files /dev/null and b/src/TPCaptor/res/images/neige.jpg differ
diff --git a/src/TPCaptor/res/images/nuage.jpg b/src/TPCaptor/res/images/nuage.jpg
new file mode 100644
index 0000000..7231ab8
Binary files /dev/null and b/src/TPCaptor/res/images/nuage.jpg differ
diff --git a/src/TPCaptor/res/images/soleil.jpg b/src/TPCaptor/res/images/soleil.jpg
new file mode 100644
index 0000000..140dff8
Binary files /dev/null and b/src/TPCaptor/res/images/soleil.jpg differ
diff --git a/src/TPCaptor/src/launcher/Console.java b/src/TPCaptor/src/launcher/Console.java
new file mode 100644
index 0000000..93bb0d4
--- /dev/null
+++ b/src/TPCaptor/src/launcher/Console.java
@@ -0,0 +1,29 @@
+package launcher;
+
+import model.*;
+
+import java.util.HashMap;
+
+public class Console {
+
+ public static void main(String[] args) throws Exception {
+
+ // Captor with GenCPU
+ Captor captor1 = new CaptorBasic("France", new GenCPU());
+ System.out.println(captor1.getId() + ": " + captor1.getName() + ", temperature : " + captor1.getTemperature());
+
+ // Captor with GenRandom
+ Captor captor2 = new CaptorBasic("Italie", new GenBoundedRandom(-10, 60));
+ System.out.println(captor2.getId() + ": " + captor2.getName() + ", temperature : " + captor2.getTemperature());
+
+
+ // CaptorArea
+ Captor captorZone = new CaptorArea("Europe", new HashMap<>());
+ captorZone.addCaptor(captor1, 20.0);
+ captorZone.addCaptor(captor2, 40.0);
+ System.out.println(captorZone.getId() + ": " + captorZone.getName() + ", temperature : " + captorZone.getTemperature());
+
+
+ }
+
+}
diff --git a/src/TPCaptor/src/launcher/main.java b/src/TPCaptor/src/launcher/main.java
new file mode 100644
index 0000000..205c627
--- /dev/null
+++ b/src/TPCaptor/src/launcher/main.java
@@ -0,0 +1,33 @@
+package launcher;
+
+import javafx.application.Application;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.stage.Stage;
+import model.CaptorBasic;
+import model.GenCPU;
+import view.FXMLWindow;
+import view.ImageWindow;
+
+import java.util.Objects;
+
+public class main extends Application {
+
+ @Override
+ public void start(Stage stage) throws Exception {
+
+ /*FXMLWindow fxmlWindow = new FXMLWindow("/fxml/CaptorWindow.fxml", "Home");
+ fxmlWindow.show();*/
+
+ Parent page = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/CaptorWindow.fxml")));
+ Scene scene = new Scene(page);
+ stage.setScene(scene);
+ stage.setResizable(false);
+ stage.setTitle("Home");
+ stage.show();
+
+ }
+
+
+}
diff --git a/src/TPCaptor/src/model/Captor.java b/src/TPCaptor/src/model/Captor.java
new file mode 100644
index 0000000..d5510ce
--- /dev/null
+++ b/src/TPCaptor/src/model/Captor.java
@@ -0,0 +1,68 @@
+package model;
+
+import javafx.beans.property.SimpleStringProperty;
+import javafx.beans.property.StringProperty;
+import javafx.scene.control.TreeItem;
+
+import java.util.List;
+import java.util.UUID;
+
+public abstract class Captor extends Observable {
+
+ private UUID id;
+ private StringProperty name;
+ private double value;
+ private double time;
+
+ public Captor(String name) {
+ this.id = UUID.randomUUID();
+ this.name = new SimpleStringProperty(name);
+ this.time = 4;
+ }
+
+ public UUID getId() {
+ return this.id;
+ }
+
+ public StringProperty getName() {
+ return this.name;
+ }
+
+ public void setName(String name) {
+ this.name = new SimpleStringProperty(name);
+ }
+
+ public abstract double getTemperature();
+
+ public abstract List
getCaptors() throws Exception;
+
+ public abstract GenStrategy getGenStrategy() throws Exception;
+
+ public abstract void setGenStrategy(GenStrategy genStrategy) throws Exception;
+
+ public abstract void addCaptor(Captor captor, double weight) throws Exception;
+
+ @Override
+ public String toString() {
+ return this.name.getValue();
+ }
+
+ public double getTime() {
+ return time;
+ }
+
+ public void setTime(double time) {
+ this.time = time;
+ }
+
+ public double getValue() {
+ return value;
+ }
+
+ public void setValue(double value) {
+ this.value = value;
+ this.notifyAllObservers();
+ }
+
+ public abstract TreeItem accept(VisitorCaptor visitorCaptor) throws Exception;
+}
diff --git a/src/TPCaptor/src/model/CaptorArea.java b/src/TPCaptor/src/model/CaptorArea.java
new file mode 100644
index 0000000..4c1cddf
--- /dev/null
+++ b/src/TPCaptor/src/model/CaptorArea.java
@@ -0,0 +1,62 @@
+package model;
+
+import javafx.beans.property.SimpleStringProperty;
+import javafx.scene.control.TreeItem;
+
+import java.util.*;
+
+public class CaptorArea extends Captor {
+
+ Map captors = new HashMap<>();
+
+ public CaptorArea(String name, Map captors) {
+ super(name);
+ this.captors = captors;
+ }
+
+ @Override
+ public GenStrategy getGenStrategy() throws Exception {
+ throw new Exception("Impossible de renvoyer la strategie");
+ }
+
+ @Override
+ public void setGenStrategy(GenStrategy genStrategy) throws Exception {
+ throw new Exception("Impossible de renvoyer la strategie");
+ }
+
+ @Override
+ public double getTemperature() {
+ double temperatureSum = 0.0;
+ double weightSum = 0.0;
+
+ for (Map.Entry entry : captors.entrySet()) {
+ Captor captor = entry.getKey();
+ double weight = entry.getValue();
+
+ temperatureSum += captor.getTemperature() * weight;
+ weightSum += weight;
+ }
+
+ return temperatureSum / weightSum;
+ }
+
+ @Override
+ public List getCaptors() throws Exception {
+ List captor = new ArrayList<>();
+ for (Map.Entry entry : captors.entrySet()) {
+ captor.add(entry.getKey());
+ }
+ return captor;
+ }
+
+ @Override
+ public void addCaptor(Captor captor, double weight) throws Exception {
+ captors.put(captor, weight);
+ }
+
+ @Override
+ public TreeItem accept(VisitorCaptor visitorCaptor) throws Exception {
+ return visitorCaptor.visit(this);
+ }
+
+}
diff --git a/src/TPCaptor/src/model/CaptorBasic.java b/src/TPCaptor/src/model/CaptorBasic.java
new file mode 100644
index 0000000..27e616f
--- /dev/null
+++ b/src/TPCaptor/src/model/CaptorBasic.java
@@ -0,0 +1,67 @@
+package model;
+
+import javafx.animation.Animation;
+import javafx.animation.KeyFrame;
+import javafx.animation.Timeline;
+import javafx.beans.property.SimpleStringProperty;
+import javafx.scene.control.TreeItem;
+import javafx.util.Duration;
+
+import java.util.List;
+import java.util.Map;
+
+public class CaptorBasic extends Captor implements Runnable {
+
+ private GenStrategy genStrategie;
+
+ public CaptorBasic(String name, GenStrategy genStrategie) {
+ super(name);
+ this.genStrategie = genStrategie;
+ setValue(this.getTemperature());
+ run();
+ }
+
+ @Override
+ public double getTemperature() {
+ return this.genStrategie.generate();
+ }
+
+ @Override
+ public List getCaptors() throws Exception {
+ throw new Exception("Impossible de retourner la liste des capteurs");
+ }
+
+ @Override
+ public GenStrategy getGenStrategy() {
+ return this.genStrategie;
+ }
+
+ @Override
+ public void setGenStrategy(GenStrategy genStrategie) {
+ this.genStrategie = genStrategie;
+ }
+
+ @Override
+ public void addCaptor(Captor captor, double weight) throws Exception {
+ throw new Exception("Impossible d'ajouter un capteur dans cette classe");
+ }
+
+ @Override
+ public void run() {
+ Timeline time = new Timeline(
+ new KeyFrame(Duration.seconds(this.getTime()), event -> {
+ if (getGenStrategy() != null) {
+ this.setValue(this.getGenStrategy().generate());
+ }
+ }
+ ));
+
+ time.setCycleCount(Animation.INDEFINITE);
+ time.play();
+ }
+
+ @Override
+ public TreeItem accept(VisitorCaptor visitorCaptor) {
+ return visitorCaptor.visit(this);
+ }
+}
diff --git a/src/TPCaptor/src/model/CaptorStationStub.java b/src/TPCaptor/src/model/CaptorStationStub.java
new file mode 100644
index 0000000..e1d65fd
--- /dev/null
+++ b/src/TPCaptor/src/model/CaptorStationStub.java
@@ -0,0 +1,37 @@
+package model;
+
+import javafx.beans.property.ListProperty;
+import javafx.beans.property.SimpleListProperty;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+
+import java.util.HashMap;
+import java.util.List;
+
+public class CaptorStationStub {
+
+ private ObservableList captors = FXCollections.observableArrayList();
+ private ListProperty groupe = new SimpleListProperty<>(captors);
+
+ public CaptorStationStub() throws Exception {
+
+ Captor captor1 = new CaptorBasic("France", new GenCPU());
+ Captor captor2 = new CaptorBasic("Italie", new GenBoundedRandom(-10, 60));
+
+ // CaptorArea
+ Captor captorZone = new CaptorArea("Europe", new HashMap<>()){{
+ addCaptor(captor1, 20.0);
+ addCaptor(captor2, 40.0);
+ }};
+
+ this.captors.add(captor1);
+ this.captors.add(captor2);
+ this.captors.add(captorZone);
+
+ }
+
+ public ObservableList getGroupe() {
+ return groupe.get();
+ }
+
+}
diff --git a/src/TPCaptor/src/model/GenBoundedRandom.java b/src/TPCaptor/src/model/GenBoundedRandom.java
new file mode 100644
index 0000000..a396dec
--- /dev/null
+++ b/src/TPCaptor/src/model/GenBoundedRandom.java
@@ -0,0 +1,29 @@
+package model;
+
+import java.util.Random;
+
+public class GenBoundedRandom implements GenStrategy {
+
+ private double min;
+ private double max;
+
+ public GenBoundedRandom(double min, double max) {
+ this.min = min;
+ this.max = max;
+ }
+
+ public void setMax(double max) {
+ this.max = max;
+ }
+
+ public void setMin(double min) {
+ this.min = min;
+ }
+
+ @Override
+ public double generate() {
+ Random random = new Random();
+ return random.nextDouble(min, max);
+ }
+
+}
diff --git a/src/TPCaptor/src/model/GenCPU.java b/src/TPCaptor/src/model/GenCPU.java
new file mode 100644
index 0000000..e1c4443
--- /dev/null
+++ b/src/TPCaptor/src/model/GenCPU.java
@@ -0,0 +1,31 @@
+package model;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.util.Scanner;
+
+public class GenCPU implements GenStrategy {
+
+ @Override
+ public double generate() {
+
+ File file = new File("/sys/class/thermal/thermal_zone2/temp");
+ Scanner scanner = null;
+ String line = null;
+ try {
+ scanner = new Scanner(file);
+
+ while (scanner.hasNextLine()) {
+ line = scanner.nextLine();
+ while (line.length() > 0 && line.charAt(line.length() - 1) == '0') {
+ line = line.substring(0, line.length() - 1);
+ }
+
+ }
+ scanner.close();
+ } catch (FileNotFoundException e) {
+ throw new RuntimeException(e);
+ }
+ return Double.parseDouble(line);
+ }
+}
diff --git a/src/TPCaptor/src/model/GenStrategy.java b/src/TPCaptor/src/model/GenStrategy.java
new file mode 100644
index 0000000..29a6f65
--- /dev/null
+++ b/src/TPCaptor/src/model/GenStrategy.java
@@ -0,0 +1,9 @@
+package model;
+
+public interface GenStrategy {
+
+ public default double generate() {
+ return (int) (Math.random() * (100 + 1));
+ }
+
+}
diff --git a/src/TPCaptor/src/model/Observable.java b/src/TPCaptor/src/model/Observable.java
new file mode 100644
index 0000000..bf06f73
--- /dev/null
+++ b/src/TPCaptor/src/model/Observable.java
@@ -0,0 +1,24 @@
+package model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public abstract class Observable {
+
+ private List observers = new ArrayList<>();
+
+ public void add(Observer o) {
+ observers.add(o);
+ }
+
+ public void remove(Observer o) {
+ observers.remove(o);
+ }
+
+ public void notifyAllObservers() {
+ for(Observer o : observers) {
+ o.update();
+ }
+ }
+
+}
diff --git a/src/TPCaptor/src/model/Observer.java b/src/TPCaptor/src/model/Observer.java
new file mode 100644
index 0000000..8d8c7b8
--- /dev/null
+++ b/src/TPCaptor/src/model/Observer.java
@@ -0,0 +1,5 @@
+package model;
+
+public interface Observer {
+ public abstract void update();
+}
diff --git a/src/TPCaptor/src/model/VisitorCaptor.java b/src/TPCaptor/src/model/VisitorCaptor.java
new file mode 100644
index 0000000..8d8ceea
--- /dev/null
+++ b/src/TPCaptor/src/model/VisitorCaptor.java
@@ -0,0 +1,24 @@
+package model;
+
+import javafx.scene.control.TreeItem;
+import javafx.scene.image.Image;
+import javafx.scene.image.ImageView;
+
+public class VisitorCaptor {
+
+ public TreeItem visit(CaptorArea captor) throws Exception {
+ TreeItem itemCaptor = new TreeItem<>(captor, new ImageView(new Image(getClass().getResourceAsStream("/images/multi_captor_icon.png"))));
+ itemCaptor.setExpanded(true);
+ for (Captor c : captor.getCaptors()) {
+ itemCaptor.getChildren().add(c.accept(this));
+ }
+ return itemCaptor;
+ }
+
+ public TreeItem visit(CaptorBasic captor){
+ TreeItem itemCaptor = new TreeItem<>(captor, new ImageView(new Image(getClass().getResourceAsStream("/images/captor_icon.png"))));
+ return itemCaptor;
+ }
+
+
+}
diff --git a/src/TPCaptor/src/view/CaptorMonitorWindow.java b/src/TPCaptor/src/view/CaptorMonitorWindow.java
new file mode 100644
index 0000000..fbef3c0
--- /dev/null
+++ b/src/TPCaptor/src/view/CaptorMonitorWindow.java
@@ -0,0 +1,31 @@
+package view;
+
+import model.Captor;
+import model.Observer;
+
+public class CaptorMonitorWindow extends FXMLWindow implements Observer {
+
+
+ private Captor captor;
+
+ public CaptorMonitorWindow(String title, String pathFxmlRessource, Captor captor) {
+ super(title, pathFxmlRessource);
+ this.captor = captor;
+ this.captor.add(this);
+ }
+
+ public Captor getCaptor() {
+ return this.captor;
+ }
+
+ public void setCaptor(Captor captor) {
+ this.captor = captor;
+ }
+
+
+ @Override
+ public void update() {
+
+ }
+}
+
diff --git a/src/TPCaptor/src/view/CaptorWindow.java b/src/TPCaptor/src/view/CaptorWindow.java
new file mode 100644
index 0000000..5d0bd6e
--- /dev/null
+++ b/src/TPCaptor/src/view/CaptorWindow.java
@@ -0,0 +1,84 @@
+package view;
+
+import javafx.application.Platform;
+import javafx.event.ActionEvent;
+import javafx.fxml.FXML;
+import javafx.scene.control.*;
+import javafx.scene.layout.BorderPane;
+import model.Captor;
+import model.CaptorStationStub;
+import model.VisitorCaptor;
+
+public class CaptorWindow {
+
+ @FXML
+ private TreeView lvCaptors;
+ @FXML
+ private Label id;
+ @FXML
+ private TextField nom;
+ @FXML
+ private BorderPane master;
+ private CaptorStationStub captors = new CaptorStationStub();
+
+ public CaptorWindow() throws Exception {
+ }
+
+ @FXML
+ private void initialize() throws Exception {
+ TreeItem root = new TreeItem<>();
+ root.setExpanded(true);
+ VisitorCaptor visitorCaptor = new VisitorCaptor();
+ for (Captor captor : captors.getGroupe()) {
+ root.getChildren().add(captor.accept(visitorCaptor));
+ //root.getChildren().add(toTreeItem(captor));
+ }
+ lvCaptors.setRoot(root);
+ lvCaptors.setShowRoot(false);
+ master.setVisible(false);
+
+ lvCaptors.getSelectionModel().selectedItemProperty().addListener((obs, oldV, newV) -> {
+ if(oldV != null) {
+ id.textProperty().unbind();
+ nom.textProperty().unbindBidirectional(oldV.getValue().getName());
+ master.setVisible(false);
+ }
+ if(newV != null) {
+ id.setText(newV.getValue().getId().toString());
+ nom.textProperty().bindBidirectional(newV.getValue().getName());
+ master.setVisible(true);
+ }
+ });
+
+ }
+
+ /*
+ public TreeItem toTreeItem(Captor captor) throws Exception {
+ TreeItem itemCaptor = new TreeItem<>(captor);
+ if (captor instanceof CaptorArea) {
+ itemCaptor.setExpanded(true);
+ for (Captor c : captor.getCaptors()) {
+ itemCaptor.getChildren().add(toTreeItem(c));
+ }
+ }
+ return itemCaptor;
+ }*/
+
+ public void openWindowImage(ActionEvent actionEvent) {
+ Captor selectedCaptor = lvCaptors.getSelectionModel().getSelectedItem().getValue();
+ ImageWindow imageWindow = new ImageWindow(selectedCaptor);
+ imageWindow.setResizable(false);
+ imageWindow.show();
+ }
+
+ public void openWindowThermosta(ActionEvent actionEvent) {
+ Captor selectedCaptor = lvCaptors.getSelectionModel().getSelectedItem().getValue();
+ ThermostatWindow thermostaWindow = new ThermostatWindow(selectedCaptor);
+ thermostaWindow.setResizable(false);
+ thermostaWindow.show();
+ }
+
+ public void buttonExit(ActionEvent actionEvent) {
+ Platform.exit();
+ }
+}
diff --git a/src/TPCaptor/src/view/FXMLWindow.java b/src/TPCaptor/src/view/FXMLWindow.java
new file mode 100644
index 0000000..83b5676
--- /dev/null
+++ b/src/TPCaptor/src/view/FXMLWindow.java
@@ -0,0 +1,26 @@
+package view;
+
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Parent;
+import javafx.stage.Stage;
+import javafx.scene.Scene;
+
+import java.io.IOException;
+import java.util.Objects;
+
+public class FXMLWindow extends Stage {
+
+ public FXMLWindow(String title, String pathFxmlRessource) {
+ try {
+ //Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource(pathFxmlRessource)));
+ FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(pathFxmlRessource));
+ fxmlLoader.setController(this);
+ Parent root = fxmlLoader.load();
+ setTitle(title);
+ setScene(new Scene(root));
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/src/TPCaptor/src/view/ImageWindow.java b/src/TPCaptor/src/view/ImageWindow.java
new file mode 100644
index 0000000..df60f8f
--- /dev/null
+++ b/src/TPCaptor/src/view/ImageWindow.java
@@ -0,0 +1,48 @@
+package view;
+
+import javafx.fxml.FXML;
+import javafx.scene.control.Label;
+import javafx.stage.Stage;
+import model.Captor;
+import javafx.scene.image.Image;
+import javafx.scene.image.ImageView;
+
+import java.util.Map;
+import java.util.NavigableMap;
+import java.util.TreeMap;
+
+public class ImageWindow extends CaptorMonitorWindow {
+
+ @FXML
+ private ImageView image;
+ @FXML
+ private Label nom;
+ @FXML
+ private Label labelTemp;
+
+ private static NavigableMap Images = new TreeMap<>();
+
+ public ImageWindow(Captor captor) {
+ super("Image", "/fxml/ImageWindow.fxml", captor);
+ Images.put(25.0, "soleil");
+ Images.put(0.0, "nuage");
+ nom.textProperty().bind(this.getCaptor().getName());
+ Images.put(-Double.MAX_VALUE, "neige");
+ update();
+ }
+
+ @FXML
+ public void buttonExit() {
+ Stage stage = (Stage) image.getScene().getWindow();
+ stage.close();
+ }
+
+ public void update() {
+ Map.Entry entry = Images.floorEntry(this.getCaptor().getValue());
+ if (entry != null && entry.getValue() != null) {
+ image.setImage(new Image("/images/" + entry.getValue() + ".jpg"));
+ }
+ labelTemp.setText(String.format("%.2f°C", this.getCaptor().getValue()));
+ }
+
+}
diff --git a/src/TPCaptor/src/view/ThermostatWindow.java b/src/TPCaptor/src/view/ThermostatWindow.java
new file mode 100644
index 0000000..53843e6
--- /dev/null
+++ b/src/TPCaptor/src/view/ThermostatWindow.java
@@ -0,0 +1,36 @@
+package view;
+
+import javafx.fxml.FXML;
+import javafx.scene.control.Slider;
+import javafx.scene.text.Text;
+import javafx.stage.Stage;
+import model.Captor;
+
+public class ThermostatWindow extends CaptorMonitorWindow{
+
+ @FXML
+ private Text valTemperature;
+
+ @FXML
+ private Slider slider;
+
+ public ThermostatWindow(Captor captor) {
+ super("Thermosta", "/fxml/ThermostatWindow.fxml", captor);
+ }
+
+ public void initialize() {
+ //slider.valueProperty().bindBidirectional(getCaptor().getValue());
+ //valTemperature.textProperty().bind(getCaptor().getValue().asString());
+ }
+
+ @FXML
+ public void onChange() {
+
+ }
+
+ @FXML
+ public void buttonExit() {
+ Stage stage = (Stage) slider.getScene().getWindow();
+ stage.close();
+ }
+}