add thermometre project

master
Victor GABORIT 2 years ago
commit 43ce578b1f

3
.idea/.gitignore vendored

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="18" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Thermometre.iml" filepath="$PROJECT_DIR$/Thermometre.iml" />
</modules>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Text?>
<BorderPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1">
<center>
<ImageView fx:id="imageView" fitHeight="400.0" fitWidth="425.0" pickOnBounds="true" preserveRatio="true" BorderPane.alignment="CENTER" />
</center>
<bottom>
<Button mnemonicParsing="false" onAction="#boutonFermer" text="Fermer" BorderPane.alignment="CENTER" fx:id="bouton">
<BorderPane.margin>
<Insets bottom="30.0" top="50.0" />
</BorderPane.margin>
</Button> </bottom>
<top>
<VBox alignment="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="50.0" prefWidth="100.0" BorderPane.alignment="CENTER">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Image" />
<HBox prefHeight="100.0" prefWidth="200.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Capteur :">
<HBox.margin>
<Insets right="5.0" />
</HBox.margin>
</Text>
<Text fx:id="nomDuCapteur" strokeType="OUTSIDE" strokeWidth="0.0" />
</children>
</HBox>
</children>
<BorderPane.margin>
<Insets top="20.0" />
</BorderPane.margin>
</VBox>
</top>
</BorderPane>

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.Spinner?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.control.ToggleButton?>
<?import javafx.scene.control.TreeView?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Text?>
<BorderPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="views.fenetre.FenetreMenu">
<left>
<TreeView fx:id="treeView" prefHeight="200.0" prefWidth="250.0" BorderPane.alignment="CENTER" />
</left>
<center>
<VBox prefHeight="200.0" prefWidth="100.0" BorderPane.alignment="CENTER">
<children>
<TextField fx:id="nomDuCapteur" text="Nom" />
<HBox prefWidth="200.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Température :">
<HBox.margin>
<Insets right="5.0" />
</HBox.margin></Text>
<Text fx:id="temperature" strokeType="OUTSIDE" strokeWidth="0.0" />
</children>
</HBox>
<HBox prefWidth="200.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="ID :">
<HBox.margin>
<Insets right="5.0" />
</HBox.margin></Text>
<Text fx:id="idDuCpateur" strokeType="OUTSIDE" strokeWidth="0.0" />
</children>
<VBox.margin>
<Insets bottom="15.0" />
</VBox.margin>
</HBox>
<HBox prefWidth="200.0" fx:id="strategie">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Choix stratégie :">
<HBox.margin>
<Insets right="5.0" />
</HBox.margin>
</Text>
<ComboBox fx:id="comboBox" prefWidth="150.0" />
</children>
</HBox>
<ToggleButton fx:id="toggleButton" />
<HBox prefWidth="200.0" fx:id="frequence">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Tick génération (en seconde) :">
<HBox.margin>
<Insets right="5.0" />
</HBox.margin>
</Text>
<Spinner fx:id="spinner" />
</children>
<VBox.margin>
<Insets />
</VBox.margin>
</HBox>
<TableView fx:id="tableView" prefHeight="200.0" prefWidth="200.0">
<columns>
<TableColumn fx:id="tableType" prefWidth="75.0" text="Type" />
<TableColumn fx:id="tablePoids" prefWidth="75.0" text="Coeff" />
<TableColumn fx:id="tableId" prefWidth="75.0" text="Id" />
</columns>
</TableView>
</children>
<padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
</padding>
</VBox>
</center>
<bottom>
<HBox alignment="CENTER" prefHeight="50.0" BorderPane.alignment="CENTER">
<children>
<Button fx:id="boutonDuSlider" mnemonicParsing="false" onAction="#boutonSlider" text="Thermostat">
<HBox.margin>
<Insets right="20.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" onAction="#boutonImage" text="Image">
<HBox.margin>
<Insets right="20.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" onAction="#boutonFermer" text="Fermer" />
</children>
</HBox>
</bottom>
</BorderPane>

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Slider?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Text?>
<BorderPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1">
<center>
<Slider fx:id="slider" max="70" min="-30" orientation="VERTICAL" showTickLabels="true" showTickMarks="true" value="0" BorderPane.alignment="CENTER">
<BorderPane.margin>
<Insets />
</BorderPane.margin>
</Slider>
</center>
<bottom>
<Button mnemonicParsing="false" onAction="#butonFermer" text="Fermer" BorderPane.alignment="CENTER">
<BorderPane.margin>
<Insets bottom="30.0" top="50.0" />
</BorderPane.margin>
</Button>
</bottom>
<top>
<VBox alignment="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="50.0" prefWidth="100.0" BorderPane.alignment="CENTER">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="thermometre" />
<HBox prefHeight="100.0" prefWidth="200.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Capteur :">
<HBox.margin>
<Insets right="5.0" />
</HBox.margin>
</Text>
<Text fx:id="nomDuCapteur" strokeType="OUTSIDE" strokeWidth="0.0" />
</children>
</HBox>
<HBox prefHeight="100.0" prefWidth="200.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Température :">
<HBox.margin>
<Insets right="5.0" />
</HBox.margin>
</Text>
<Text fx:id="valTemperature" strokeType="OUTSIDE" strokeWidth="0.0" />
</children>
</HBox>
</children>
<BorderPane.margin>
<Insets top="20.0" />
</BorderPane.margin>
</VBox>
</top>
</BorderPane>

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="_x2014_ÎÓÈ_1"
x="0px"
y="0px"
width="720px"
height="720px"
viewBox="0 0 720 720"
enable-background="new 0 0 720 720"
xml:space="preserve"
sodipodi:docname="captor.svg"
inkscape:version="0.92.2 2405546, 2018-03-11"><metadata
id="metadata23"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs21">
</defs><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1831"
inkscape:window-height="1352"
id="namedview19"
showgrid="false"
inkscape:zoom="0.46354778"
inkscape:cx="-76.496407"
inkscape:cy="340.27546"
inkscape:window-x="1391"
inkscape:window-y="586"
inkscape:window-maximized="0"
inkscape:current-layer="_x2014_ÎÓÈ_1" />
<path
style="clip-rule:evenodd;fill:#dae1e6;fill-rule:evenodd"
inkscape:connector-curvature="0"
id="path2"
d="m 250.4,563.9 c -49.7,-60.1 -49.6,-147.3 0.1,-207.3 5.7,-6.8 5.2,-16.7 -1,-22.9 l -16.1,-16.1 c -3.5,-3.5 -7.8,-5.2 -12.8,-5 -4.9,0.2 -9.1,2.3 -12.3,6.1 -69.1,81.5 -69.1,201.7 -0.1,283.3 3.2,3.8 7.3,5.8 12.3,6.1 4.9,0.2 9.3,-1.5 12.8,-5 l 16.1,-16 c 6.2,-6.5 6.7,-16.4 1,-23.2 z" /><path
style="clip-rule:evenodd;fill:#dae1e6;fill-rule:evenodd"
inkscape:connector-curvature="0"
id="path4"
d="m 168.3,644.8 c -93.2,-105.2 -93.1,-264 0.2,-369.1 6.3,-7.2 6,-18 -0.7,-24.8 l -17.1,-17 c -3.6,-3.6 -8.1,-5.5 -13.3,-5.3 -5.2,0.2 -9.5,2.2 -13,6 -114.8,128.2 -114.9,323 -0.2,451.3 3.4,3.9 7.8,5.9 13,6 5.2,0.2 9.7,-1.6 13.3,-5.3 l 17,-17 c 6.8,-6.8 7.1,-17.6 0.8,-24.8 z" /><path
style="clip-rule:evenodd;fill:#dae1e6;fill-rule:evenodd"
inkscape:connector-curvature="0"
id="path6"
d="m 469.1,564 c 49.7,-60 49.7,-147.3 0.1,-207.3 -5.7,-6.8 -5.2,-16.7 1.1,-22.9 l 16.1,-16.1 c 3.5,-3.5 7.8,-5.2 12.8,-5 5,0.2 9.2,2.3 12.4,6.1 69,81.6 68.9,201.8 -0.1,283.3 -3.2,3.8 -7.4,5.8 -12.4,6 -4.9,0.2 -9.3,-1.5 -12.8,-5 L 470.2,587 c -6.3,-6.2 -6.7,-16.2 -1.1,-23 z" /><path
style="clip-rule:evenodd;fill:#dae1e6;fill-rule:evenodd"
inkscape:connector-curvature="0"
id="path8"
d="m 551.2,644.9 c 93.3,-105.1 93.3,-263.9 0.2,-369.1 -6.4,-7.1 -6.1,-18 0.7,-24.8 l 17.1,-17 c 3.7,-3.6 8.1,-5.4 13.3,-5.3 5.2,0.1 9.5,2.2 13,6 114.7,128.4 114.6,323.1 -0.2,451.3 -3.5,3.9 -7.9,5.9 -13,6 -5.2,0.2 -9.7,-1.7 -13.3,-5.3 l -17,-17 c -6.9,-6.7 -7.2,-17.6 -0.8,-24.8 z" /><path
style="clip-rule:evenodd;fill:#3d566e;fill-rule:evenodd"
inkscape:connector-curvature="0"
id="path10"
d="m 411.55727,374.34214 c 0.3,27.4 -22.4,49.8 -49.6,49.8 -27.4,0 -49.6,-22.2 -49.5,-49.6 0,-132.4 0,-163.4 0.1,-295.799998 0,-27.4 22.2,-49.600002 49.6,-49.500002 27.3,0 49.8,22.200002 49.5,49.600002 -1.5,131.899998 -0.1,163.599998 -0.1,295.499998 z" /><path
style="clip-rule:evenodd;fill:#3d566e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.55791605"
inkscape:connector-curvature="0"
id="path14"
d="m 361.98068,559.74504 c 54.99444,0 99.39504,-44.4006 99.55083,-99.39504 0,-54.83863 -44.55639,-99.39503 -99.39503,-99.39503 -54.99443,0 -99.55083,44.40061 -99.55083,99.39503 0,54.99444 44.5564,99.39504 99.39503,99.39504 z" />
<path
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818"
inkscape:connector-curvature="0"
id="path10-6-5"
d="m 356.96233,336.4462 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26221 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09795 -4.14559,9.29956 -9.26222,9.24354 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z" /><path
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818"
inkscape:connector-curvature="0"
id="path10-6-5-3"
d="m 356.96233,273.96604 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26222 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09796 -4.14559,9.29957 -9.26222,9.24355 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z" /><path
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818"
inkscape:connector-curvature="0"
id="path10-6-5-5"
d="m 356.96233,211.48587 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26221 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09795 -4.14559,9.29956 -9.26222,9.24354 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z" /></svg>

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="_x2014_ÎÓÈ_1"
x="0px"
y="0px"
width="720px"
height="720px"
viewBox="0 0 720 720"
enable-background="new 0 0 720 720"
xml:space="preserve"
sodipodi:docname="super-captor.svg"
inkscape:version="0.92.2 2405546, 2018-03-11"><metadata
id="metadata23"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs21">
</defs><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1831"
inkscape:window-height="1352"
id="namedview19"
showgrid="false"
inkscape:zoom="0.46354778"
inkscape:cx="227.12649"
inkscape:cy="661.57428"
inkscape:window-x="1391"
inkscape:window-y="586"
inkscape:window-maximized="0"
inkscape:current-layer="_x2014_ÎÓÈ_1" />
<g
id="g4759"
transform="translate(-230.33898,65.506578)"><path
d="m 411.55727,374.34214 c 0.3,27.4 -22.4,49.8 -49.6,49.8 -27.4,0 -49.6,-22.2 -49.5,-49.6 0,-132.4 0,-163.4 0.1,-295.799998 0,-27.4 22.2,-49.600002 49.6,-49.500002 27.3,0 49.8,22.200002 49.5,49.600002 -1.5,131.899998 -0.1,163.599998 -0.1,295.499998 z"
id="path10"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#3d566e;fill-rule:evenodd" /><path
d="m 361.98068,559.74504 c 54.99444,0 99.39504,-44.4006 99.55083,-99.39504 0,-54.83863 -44.55639,-99.39503 -99.39503,-99.39503 -54.99443,0 -99.55083,44.40061 -99.55083,99.39503 0,54.99444 44.5564,99.39504 99.39503,99.39504 z"
id="path14"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#3d566e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.55791605" /><path
d="m 356.96233,336.4462 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26221 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09795 -4.14559,9.29956 -9.26222,9.24354 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z"
id="path10-6-5"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818" /><path
d="m 356.96233,273.96604 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26222 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09796 -4.14559,9.29957 -9.26222,9.24355 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z"
id="path10-6-5-3"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818" /><path
d="m 356.96233,211.48587 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26221 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09795 -4.14559,9.29956 -9.26222,9.24354 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z"
id="path10-6-5-5"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818" /></g><g
id="g4816"
transform="translate(-23.730024,-2.157275)"><path
d="m 556.0139,154.71496 c 0.11368,10.38268 -8.48803,18.87071 -18.79492,18.87071 -10.38268,0 -18.79493,-8.41225 -18.75703,-18.79493 0,-50.17032 0,-61.917148 0.0379,-112.087468 0,-10.38268 8.41224,-18.794924 18.79492,-18.757031 10.34479,0 18.87071,8.412244 18.75704,18.794924 -0.5684,49.980855 -0.0379,61.992935 -0.0379,111.973795 z"
id="path10-0"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#3d566e;fill-rule:evenodd;stroke-width:0.37892991" /><path
d="m 537.22785,224.96966 c 20.83904,0 37.66375,-16.82471 37.72279,-37.66375 0,-20.78 -16.88375,-37.66375 -37.66375,-37.66375 -20.83904,0 -37.72279,16.82472 -37.72279,37.66375 0,20.83904 16.88375,37.66375 37.66375,37.66375 z"
id="path14-93"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#3d566e;fill-opacity:1;fill-rule:evenodd;stroke-width:0.59034103" /><path
d="m 535.32625,140.35505 c -1.93884,0.0212 -3.52388,-1.58504 -3.52388,-3.50973 0,-1.93884 1.57088,-3.50973 3.50972,-3.50265 9.36872,0 11.5623,0 20.93102,0.007 1.93884,0 3.50972,1.57089 3.50265,3.50973 0,1.93177 -1.57089,3.52388 -3.50973,3.50266 -9.33334,-0.10615 -11.57645,-0.007 -20.90978,-0.007 z"
id="path10-6-5-6"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.07076068" /><path
d="m 535.32625,116.67945 c -1.93884,0.0212 -3.52388,-1.58504 -3.52388,-3.50973 0,-1.93885 1.57088,-3.50974 3.50972,-3.50266 9.36872,0 11.5623,0 20.93102,0.007 1.93884,0 3.50972,1.57089 3.50265,3.50973 0,1.93177 -1.57089,3.52388 -3.50973,3.50265 -9.33334,-0.10614 -11.57645,-0.007 -20.90978,-0.007 z"
id="path10-6-5-3-0"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.07076068" /></g><g
transform="translate(-327.19856,34.74909)"
id="g4689-2"><path
d="m 621.18788,540.26998 c 49.7,-60 49.7,-147.3 0.1,-207.3 -5.7,-6.8 -5.2,-16.7 1.1,-22.9 l 16.1,-16.1 c 3.5,-3.5 7.8,-5.2 12.8,-5 5,0.2 9.2,2.3 12.4,6.1 69,81.6 68.9,201.8 -0.1,283.3 -3.2,3.8 -7.4,5.8 -12.4,6 -4.9,0.2 -9.3,-1.5 -12.8,-5 l -16.1,-16.1 c -6.3,-6.2 -6.7,-16.2 -1.1,-23 z"
id="path6-6"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#dae1e6;fill-rule:evenodd" /><path
d="m 703.28788,621.16998 c 93.3,-105.1 93.3,-263.9 0.2,-369.1 -6.4,-7.1 -6.1,-18 0.7,-24.8 l 17.1,-17 c 3.7,-3.6 8.1,-5.4 13.3,-5.3 5.2,0.1 9.5,2.2 13,6 114.7,128.4 114.6,323.1 -0.2,451.3 -3.5,3.9 -7.9,5.9 -13,6 -5.2,0.2 -9.7,-1.7 -13.3,-5.3 l -17,-17 c -6.9,-6.7 -7.2,-17.6 -0.8,-24.8 z"
id="path8-1"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#dae1e6;fill-rule:evenodd" /></g><g
id="g4752-3"
transform="matrix(0.37892992,0,0,0.37892992,590.04258,251.2355)"><path
d="m 201.58657,175.31763 c 0.3,27.4 -22.4,49.8 -49.6,49.8 -27.4,0 -49.6,-22.2 -49.5,-49.6 0,-132.400002 0,-163.400004 0.1,-295.8 0,-27.4 22.2,-49.6 49.6,-49.5 27.3,0 49.8,22.2 49.5,49.6 -1.5,131.899996 -0.1,163.599998 -0.1,295.5 z"
id="path10-0-7"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#3d566e;fill-rule:evenodd" /><path
d="m 152.00998,360.72053 c 54.99444,0 99.39504,-44.4006 99.55083,-99.39504 0,-54.83863 -44.55639,-99.39503 -99.39503,-99.39503 -54.994432,0 -99.550832,44.40061 -99.550832,99.39503 0,54.99444 44.5564,99.39504 99.395032,99.39504 z"
id="path14-93-5"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#3d566e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.55791605" /><path
d="m 146.99163,137.42169 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26221 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09795 -4.14559,9.29956 -9.26222,9.24354 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z"
id="path10-6-5-6-9"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818" /><path
d="m 146.99163,74.941528 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26222 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09796 -4.14559,9.29957 -9.26222,9.24355 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z"
id="path10-6-5-3-0-2"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818" /></g><g
id="g4752-8"
transform="matrix(0.37892992,0,0,0.37892992,602.35437,520.97377)"><path
d="m 201.58657,175.31763 c 0.3,27.4 -22.4,49.8 -49.6,49.8 -27.4,0 -49.6,-22.2 -49.5,-49.6 0,-132.400002 0,-163.400004 0.1,-295.8 0,-27.4 22.2,-49.6 49.6,-49.5 27.3,0 49.8,22.2 49.5,49.6 -1.5,131.899996 -0.1,163.599998 -0.1,295.5 z"
id="path10-0-9"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#3d566e;fill-rule:evenodd" /><path
d="m 152.00998,360.72053 c 54.99444,0 99.39504,-44.4006 99.55083,-99.39504 0,-54.83863 -44.55639,-99.39503 -99.39503,-99.39503 -54.994432,0 -99.550832,44.40061 -99.550832,99.39503 0,54.99444 44.5564,99.39504 99.395032,99.39504 z"
id="path14-93-7"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#3d566e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.55791605" /><path
d="m 146.99163,137.42169 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26221 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09795 -4.14559,9.29956 -9.26222,9.24354 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z"
id="path10-6-5-6-3"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818" /><path
d="m 146.99163,74.941528 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26222 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09796 -4.14559,9.29957 -9.26222,9.24355 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z"
id="path10-6-5-3-0-6"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818" /></g></svg>

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/Ressources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="lib" level="application" />
</component>
</module>

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Text?>
<BorderPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1">
<center>
<ImageView fx:id="imageView" fitHeight="400.0" fitWidth="425.0" pickOnBounds="true" preserveRatio="true" BorderPane.alignment="CENTER" />
</center>
<bottom>
<Button mnemonicParsing="false" onAction="#boutonFermer" text="Fermer" BorderPane.alignment="CENTER" fx:id="bouton">
<BorderPane.margin>
<Insets bottom="30.0" top="50.0" />
</BorderPane.margin>
</Button> </bottom>
<top>
<VBox alignment="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="50.0" prefWidth="100.0" BorderPane.alignment="CENTER">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Image" />
<HBox prefHeight="100.0" prefWidth="200.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Capteur :">
<HBox.margin>
<Insets right="5.0" />
</HBox.margin>
</Text>
<Text fx:id="nomDuCapteur" strokeType="OUTSIDE" strokeWidth="0.0" />
</children>
</HBox>
</children>
<BorderPane.margin>
<Insets top="20.0" />
</BorderPane.margin>
</VBox>
</top>
</BorderPane>

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.Spinner?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.control.ToggleButton?>
<?import javafx.scene.control.TreeView?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Text?>
<BorderPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="views.fenetre.FenetreMenu">
<left>
<TreeView fx:id="treeView" prefHeight="200.0" prefWidth="250.0" BorderPane.alignment="CENTER" />
</left>
<center>
<VBox prefHeight="200.0" prefWidth="100.0" BorderPane.alignment="CENTER">
<children>
<TextField fx:id="nomDuCapteur" text="Nom" />
<HBox prefWidth="200.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Température :">
<HBox.margin>
<Insets right="5.0" />
</HBox.margin></Text>
<Text fx:id="temperature" strokeType="OUTSIDE" strokeWidth="0.0" />
</children>
</HBox>
<HBox prefWidth="200.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="ID :">
<HBox.margin>
<Insets right="5.0" />
</HBox.margin></Text>
<Text fx:id="idDuCpateur" strokeType="OUTSIDE" strokeWidth="0.0" />
</children>
<VBox.margin>
<Insets bottom="15.0" />
</VBox.margin>
</HBox>
<HBox prefWidth="200.0" fx:id="strategie">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Choix stratégie :">
<HBox.margin>
<Insets right="5.0" />
</HBox.margin>
</Text>
<ComboBox fx:id="comboBox" prefWidth="150.0" />
</children>
</HBox>
<ToggleButton fx:id="toggleButton" />
<HBox prefWidth="200.0" fx:id="frequence">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Tick génération (en seconde) :">
<HBox.margin>
<Insets right="5.0" />
</HBox.margin>
</Text>
<Spinner fx:id="spinner" />
</children>
<VBox.margin>
<Insets />
</VBox.margin>
</HBox>
<TableView fx:id="tableView" prefHeight="200.0" prefWidth="200.0">
<columns>
<TableColumn fx:id="tableType" prefWidth="75.0" text="Type" />
<TableColumn fx:id="tablePoids" prefWidth="75.0" text="Coeff" />
<TableColumn fx:id="tableId" prefWidth="75.0" text="Id" />
</columns>
</TableView>
</children>
<padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
</padding>
</VBox>
</center>
<bottom>
<HBox alignment="CENTER" prefHeight="50.0" BorderPane.alignment="CENTER">
<children>
<Button fx:id="boutonDuSlider" mnemonicParsing="false" onAction="#boutonSlider" text="Thermostat">
<HBox.margin>
<Insets right="20.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" onAction="#boutonImage" text="Image">
<HBox.margin>
<Insets right="20.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" onAction="#boutonFermer" text="Fermer" />
</children>
</HBox>
</bottom>
</BorderPane>

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Slider?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Text?>
<BorderPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1">
<center>
<Slider fx:id="slider" max="70" min="-30" orientation="VERTICAL" showTickLabels="true" showTickMarks="true" value="0" BorderPane.alignment="CENTER">
<BorderPane.margin>
<Insets />
</BorderPane.margin>
</Slider>
</center>
<bottom>
<Button mnemonicParsing="false" onAction="#butonFermer" text="Fermer" BorderPane.alignment="CENTER">
<BorderPane.margin>
<Insets bottom="30.0" top="50.0" />
</BorderPane.margin>
</Button>
</bottom>
<top>
<VBox alignment="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="50.0" prefWidth="100.0" BorderPane.alignment="CENTER">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="thermometre" />
<HBox prefHeight="100.0" prefWidth="200.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Capteur :">
<HBox.margin>
<Insets right="5.0" />
</HBox.margin>
</Text>
<Text fx:id="nomDuCapteur" strokeType="OUTSIDE" strokeWidth="0.0" />
</children>
</HBox>
<HBox prefHeight="100.0" prefWidth="200.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Température :">
<HBox.margin>
<Insets right="5.0" />
</HBox.margin>
</Text>
<Text fx:id="valTemperature" strokeType="OUTSIDE" strokeWidth="0.0" />
</children>
</HBox>
</children>
<BorderPane.margin>
<Insets top="20.0" />
</BorderPane.margin>
</VBox>
</top>
</BorderPane>

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="_x2014_ÎÓÈ_1"
x="0px"
y="0px"
width="720px"
height="720px"
viewBox="0 0 720 720"
enable-background="new 0 0 720 720"
xml:space="preserve"
sodipodi:docname="captor.svg"
inkscape:version="0.92.2 2405546, 2018-03-11"><metadata
id="metadata23"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs21">
</defs><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1831"
inkscape:window-height="1352"
id="namedview19"
showgrid="false"
inkscape:zoom="0.46354778"
inkscape:cx="-76.496407"
inkscape:cy="340.27546"
inkscape:window-x="1391"
inkscape:window-y="586"
inkscape:window-maximized="0"
inkscape:current-layer="_x2014_ÎÓÈ_1" />
<path
style="clip-rule:evenodd;fill:#dae1e6;fill-rule:evenodd"
inkscape:connector-curvature="0"
id="path2"
d="m 250.4,563.9 c -49.7,-60.1 -49.6,-147.3 0.1,-207.3 5.7,-6.8 5.2,-16.7 -1,-22.9 l -16.1,-16.1 c -3.5,-3.5 -7.8,-5.2 -12.8,-5 -4.9,0.2 -9.1,2.3 -12.3,6.1 -69.1,81.5 -69.1,201.7 -0.1,283.3 3.2,3.8 7.3,5.8 12.3,6.1 4.9,0.2 9.3,-1.5 12.8,-5 l 16.1,-16 c 6.2,-6.5 6.7,-16.4 1,-23.2 z" /><path
style="clip-rule:evenodd;fill:#dae1e6;fill-rule:evenodd"
inkscape:connector-curvature="0"
id="path4"
d="m 168.3,644.8 c -93.2,-105.2 -93.1,-264 0.2,-369.1 6.3,-7.2 6,-18 -0.7,-24.8 l -17.1,-17 c -3.6,-3.6 -8.1,-5.5 -13.3,-5.3 -5.2,0.2 -9.5,2.2 -13,6 -114.8,128.2 -114.9,323 -0.2,451.3 3.4,3.9 7.8,5.9 13,6 5.2,0.2 9.7,-1.6 13.3,-5.3 l 17,-17 c 6.8,-6.8 7.1,-17.6 0.8,-24.8 z" /><path
style="clip-rule:evenodd;fill:#dae1e6;fill-rule:evenodd"
inkscape:connector-curvature="0"
id="path6"
d="m 469.1,564 c 49.7,-60 49.7,-147.3 0.1,-207.3 -5.7,-6.8 -5.2,-16.7 1.1,-22.9 l 16.1,-16.1 c 3.5,-3.5 7.8,-5.2 12.8,-5 5,0.2 9.2,2.3 12.4,6.1 69,81.6 68.9,201.8 -0.1,283.3 -3.2,3.8 -7.4,5.8 -12.4,6 -4.9,0.2 -9.3,-1.5 -12.8,-5 L 470.2,587 c -6.3,-6.2 -6.7,-16.2 -1.1,-23 z" /><path
style="clip-rule:evenodd;fill:#dae1e6;fill-rule:evenodd"
inkscape:connector-curvature="0"
id="path8"
d="m 551.2,644.9 c 93.3,-105.1 93.3,-263.9 0.2,-369.1 -6.4,-7.1 -6.1,-18 0.7,-24.8 l 17.1,-17 c 3.7,-3.6 8.1,-5.4 13.3,-5.3 5.2,0.1 9.5,2.2 13,6 114.7,128.4 114.6,323.1 -0.2,451.3 -3.5,3.9 -7.9,5.9 -13,6 -5.2,0.2 -9.7,-1.7 -13.3,-5.3 l -17,-17 c -6.9,-6.7 -7.2,-17.6 -0.8,-24.8 z" /><path
style="clip-rule:evenodd;fill:#3d566e;fill-rule:evenodd"
inkscape:connector-curvature="0"
id="path10"
d="m 411.55727,374.34214 c 0.3,27.4 -22.4,49.8 -49.6,49.8 -27.4,0 -49.6,-22.2 -49.5,-49.6 0,-132.4 0,-163.4 0.1,-295.799998 0,-27.4 22.2,-49.600002 49.6,-49.500002 27.3,0 49.8,22.200002 49.5,49.600002 -1.5,131.899998 -0.1,163.599998 -0.1,295.499998 z" /><path
style="clip-rule:evenodd;fill:#3d566e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.55791605"
inkscape:connector-curvature="0"
id="path14"
d="m 361.98068,559.74504 c 54.99444,0 99.39504,-44.4006 99.55083,-99.39504 0,-54.83863 -44.55639,-99.39503 -99.39503,-99.39503 -54.99443,0 -99.55083,44.40061 -99.55083,99.39503 0,54.99444 44.5564,99.39504 99.39503,99.39504 z" />
<path
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818"
inkscape:connector-curvature="0"
id="path10-6-5"
d="m 356.96233,336.4462 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26221 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09795 -4.14559,9.29956 -9.26222,9.24354 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z" /><path
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818"
inkscape:connector-curvature="0"
id="path10-6-5-3"
d="m 356.96233,273.96604 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26222 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09796 -4.14559,9.29957 -9.26222,9.24355 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z" /><path
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818"
inkscape:connector-curvature="0"
id="path10-6-5-5"
d="m 356.96233,211.48587 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26221 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09795 -4.14559,9.29956 -9.26222,9.24354 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z" /></svg>

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="_x2014_ÎÓÈ_1"
x="0px"
y="0px"
width="720px"
height="720px"
viewBox="0 0 720 720"
enable-background="new 0 0 720 720"
xml:space="preserve"
sodipodi:docname="super-captor.svg"
inkscape:version="0.92.2 2405546, 2018-03-11"><metadata
id="metadata23"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs21">
</defs><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1831"
inkscape:window-height="1352"
id="namedview19"
showgrid="false"
inkscape:zoom="0.46354778"
inkscape:cx="227.12649"
inkscape:cy="661.57428"
inkscape:window-x="1391"
inkscape:window-y="586"
inkscape:window-maximized="0"
inkscape:current-layer="_x2014_ÎÓÈ_1" />
<g
id="g4759"
transform="translate(-230.33898,65.506578)"><path
d="m 411.55727,374.34214 c 0.3,27.4 -22.4,49.8 -49.6,49.8 -27.4,0 -49.6,-22.2 -49.5,-49.6 0,-132.4 0,-163.4 0.1,-295.799998 0,-27.4 22.2,-49.600002 49.6,-49.500002 27.3,0 49.8,22.200002 49.5,49.600002 -1.5,131.899998 -0.1,163.599998 -0.1,295.499998 z"
id="path10"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#3d566e;fill-rule:evenodd" /><path
d="m 361.98068,559.74504 c 54.99444,0 99.39504,-44.4006 99.55083,-99.39504 0,-54.83863 -44.55639,-99.39503 -99.39503,-99.39503 -54.99443,0 -99.55083,44.40061 -99.55083,99.39503 0,54.99444 44.5564,99.39504 99.39503,99.39504 z"
id="path14"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#3d566e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.55791605" /><path
d="m 356.96233,336.4462 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26221 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09795 -4.14559,9.29956 -9.26222,9.24354 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z"
id="path10-6-5"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818" /><path
d="m 356.96233,273.96604 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26222 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09796 -4.14559,9.29957 -9.26222,9.24355 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z"
id="path10-6-5-3"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818" /><path
d="m 356.96233,211.48587 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26221 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09795 -4.14559,9.29956 -9.26222,9.24354 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z"
id="path10-6-5-5"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818" /></g><g
id="g4816"
transform="translate(-23.730024,-2.157275)"><path
d="m 556.0139,154.71496 c 0.11368,10.38268 -8.48803,18.87071 -18.79492,18.87071 -10.38268,0 -18.79493,-8.41225 -18.75703,-18.79493 0,-50.17032 0,-61.917148 0.0379,-112.087468 0,-10.38268 8.41224,-18.794924 18.79492,-18.757031 10.34479,0 18.87071,8.412244 18.75704,18.794924 -0.5684,49.980855 -0.0379,61.992935 -0.0379,111.973795 z"
id="path10-0"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#3d566e;fill-rule:evenodd;stroke-width:0.37892991" /><path
d="m 537.22785,224.96966 c 20.83904,0 37.66375,-16.82471 37.72279,-37.66375 0,-20.78 -16.88375,-37.66375 -37.66375,-37.66375 -20.83904,0 -37.72279,16.82472 -37.72279,37.66375 0,20.83904 16.88375,37.66375 37.66375,37.66375 z"
id="path14-93"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#3d566e;fill-opacity:1;fill-rule:evenodd;stroke-width:0.59034103" /><path
d="m 535.32625,140.35505 c -1.93884,0.0212 -3.52388,-1.58504 -3.52388,-3.50973 0,-1.93884 1.57088,-3.50973 3.50972,-3.50265 9.36872,0 11.5623,0 20.93102,0.007 1.93884,0 3.50972,1.57089 3.50265,3.50973 0,1.93177 -1.57089,3.52388 -3.50973,3.50266 -9.33334,-0.10615 -11.57645,-0.007 -20.90978,-0.007 z"
id="path10-6-5-6"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.07076068" /><path
d="m 535.32625,116.67945 c -1.93884,0.0212 -3.52388,-1.58504 -3.52388,-3.50973 0,-1.93885 1.57088,-3.50974 3.50972,-3.50266 9.36872,0 11.5623,0 20.93102,0.007 1.93884,0 3.50972,1.57089 3.50265,3.50973 0,1.93177 -1.57089,3.52388 -3.50973,3.50265 -9.33334,-0.10614 -11.57645,-0.007 -20.90978,-0.007 z"
id="path10-6-5-3-0"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.07076068" /></g><g
transform="translate(-327.19856,34.74909)"
id="g4689-2"><path
d="m 621.18788,540.26998 c 49.7,-60 49.7,-147.3 0.1,-207.3 -5.7,-6.8 -5.2,-16.7 1.1,-22.9 l 16.1,-16.1 c 3.5,-3.5 7.8,-5.2 12.8,-5 5,0.2 9.2,2.3 12.4,6.1 69,81.6 68.9,201.8 -0.1,283.3 -3.2,3.8 -7.4,5.8 -12.4,6 -4.9,0.2 -9.3,-1.5 -12.8,-5 l -16.1,-16.1 c -6.3,-6.2 -6.7,-16.2 -1.1,-23 z"
id="path6-6"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#dae1e6;fill-rule:evenodd" /><path
d="m 703.28788,621.16998 c 93.3,-105.1 93.3,-263.9 0.2,-369.1 -6.4,-7.1 -6.1,-18 0.7,-24.8 l 17.1,-17 c 3.7,-3.6 8.1,-5.4 13.3,-5.3 5.2,0.1 9.5,2.2 13,6 114.7,128.4 114.6,323.1 -0.2,451.3 -3.5,3.9 -7.9,5.9 -13,6 -5.2,0.2 -9.7,-1.7 -13.3,-5.3 l -17,-17 c -6.9,-6.7 -7.2,-17.6 -0.8,-24.8 z"
id="path8-1"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#dae1e6;fill-rule:evenodd" /></g><g
id="g4752-3"
transform="matrix(0.37892992,0,0,0.37892992,590.04258,251.2355)"><path
d="m 201.58657,175.31763 c 0.3,27.4 -22.4,49.8 -49.6,49.8 -27.4,0 -49.6,-22.2 -49.5,-49.6 0,-132.400002 0,-163.400004 0.1,-295.8 0,-27.4 22.2,-49.6 49.6,-49.5 27.3,0 49.8,22.2 49.5,49.6 -1.5,131.899996 -0.1,163.599998 -0.1,295.5 z"
id="path10-0-7"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#3d566e;fill-rule:evenodd" /><path
d="m 152.00998,360.72053 c 54.99444,0 99.39504,-44.4006 99.55083,-99.39504 0,-54.83863 -44.55639,-99.39503 -99.39503,-99.39503 -54.994432,0 -99.550832,44.40061 -99.550832,99.39503 0,54.99444 44.5564,99.39504 99.395032,99.39504 z"
id="path14-93-5"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#3d566e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.55791605" /><path
d="m 146.99163,137.42169 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26221 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09795 -4.14559,9.29956 -9.26222,9.24354 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z"
id="path10-6-5-6-9"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818" /><path
d="m 146.99163,74.941528 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26222 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09796 -4.14559,9.29957 -9.26222,9.24355 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z"
id="path10-6-5-3-0-2"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818" /></g><g
id="g4752-8"
transform="matrix(0.37892992,0,0,0.37892992,602.35437,520.97377)"><path
d="m 201.58657,175.31763 c 0.3,27.4 -22.4,49.8 -49.6,49.8 -27.4,0 -49.6,-22.2 -49.5,-49.6 0,-132.400002 0,-163.400004 0.1,-295.8 0,-27.4 22.2,-49.6 49.6,-49.5 27.3,0 49.8,22.2 49.5,49.6 -1.5,131.899996 -0.1,163.599998 -0.1,295.5 z"
id="path10-0-9"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#3d566e;fill-rule:evenodd" /><path
d="m 152.00998,360.72053 c 54.99444,0 99.39504,-44.4006 99.55083,-99.39504 0,-54.83863 -44.55639,-99.39503 -99.39503,-99.39503 -54.994432,0 -99.550832,44.40061 -99.550832,99.39503 0,54.99444 44.5564,99.39504 99.395032,99.39504 z"
id="path14-93-7"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#3d566e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.55791605" /><path
d="m 146.99163,137.42169 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26221 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09795 -4.14559,9.29956 -9.26222,9.24354 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z"
id="path10-6-5-6-3"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818" /><path
d="m 146.99163,74.941528 c -5.11662,0.056 -9.29956,-4.18294 -9.29956,-9.26222 0,-5.11663 4.14559,-9.26222 9.26221,-9.24354 24.72414,0 30.51302,0 55.23716,0.0187 5.11662,0 9.26221,4.14559 9.24354,9.26221 0,5.09796 -4.14559,9.29957 -9.26222,9.24355 -24.63077,-0.28011 -30.55036,-0.0187 -55.18113,-0.0187 z"
id="path10-6-5-3-0-6"
inkscape:connector-curvature="0"
style="clip-rule:evenodd;fill:#020000;fill-opacity:1;fill-rule:evenodd;stroke-width:0.18673818" /></g></svg>

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

@ -0,0 +1,45 @@
package DonneePersistante;
import models.TachePeriodique;
import models.capteurs.CapteurTemperature;
import models.capteurs.CapteurTemperatureAbstrait;
import models.capteurs.CapteurTemperatureVirtuel;
import models.generateurs.GenerateurAleatoire;
import models.generateurs.GeneratureParIntervalle;
public class Stub {
public static CapteurTemperatureAbstrait chargerArbre(TachePeriodique tachePeriodique) {
CapteurTemperatureAbstrait CapteurEnRacine = new CapteurTemperatureVirtuel("Capteur virtuel", 5);
CapteurTemperature capteur1 = new CapteurTemperature("Capteur 1", 5, new GenerateurAleatoire(), tachePeriodique);
CapteurTemperature capteur2 = new CapteurTemperature("Capteur 2", 5, null, tachePeriodique);
CapteurTemperature capteur3 = new CapteurTemperature("Capteur 3", 10, new GeneratureParIntervalle(30,5), tachePeriodique);
CapteurTemperature capteur4 = new CapteurTemperature("Capteur 4", -9, null, tachePeriodique);
CapteurTemperature capteur5 = new CapteurTemperature("Capteur 5", 65, null, tachePeriodique);
CapteurTemperatureAbstrait capteurVirtuel1 = new CapteurTemperatureVirtuel("Capteur virtuel 1", 5);
CapteurTemperatureAbstrait capteurVirtuel2 = new CapteurTemperatureVirtuel("Capteur virtuel 2", 5);
((CapteurTemperatureVirtuel)capteurVirtuel1).AjouterUnCapteur(capteur1,1);
((CapteurTemperatureVirtuel)capteurVirtuel1).AjouterUnCapteur(capteur2,1);
((CapteurTemperatureVirtuel)capteurVirtuel1).AjouterUnCapteur(capteur3,2);
((CapteurTemperatureVirtuel)capteurVirtuel1).AjouterUnCapteur(capteurVirtuel2,2);
((CapteurTemperatureVirtuel)capteurVirtuel2).AjouterUnCapteur(capteur4,2);
((CapteurTemperatureVirtuel)capteurVirtuel2).AjouterUnCapteur(capteur1,2);
((CapteurTemperatureVirtuel)capteurVirtuel2).MiseAjourTemperature();
((CapteurTemperatureVirtuel)capteurVirtuel1).MiseAjourTemperature();
((CapteurTemperatureVirtuel)CapteurEnRacine).AjouterUnCapteur(capteurVirtuel1,2);
((CapteurTemperatureVirtuel)CapteurEnRacine).AjouterUnCapteur(capteur5,2);
return CapteurEnRacine;
}
}

@ -0,0 +1,18 @@
package launchers;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class ThermometreApplication extends Application {
@Override
public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("/FXML/FenetreMenu.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
}

@ -0,0 +1,4 @@
package launchers;
public class ThermometreConsole {
}

@ -0,0 +1,7 @@
package models;
import models.capteurs.CapteurTemperatureAbstrait;
public abstract interface Observateur {
public abstract void update();
}

@ -0,0 +1,28 @@
package models;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public abstract class Sujet {
private List<Observateur> ListObservateurs = new ArrayList<>();
public List<Observateur> getListObservateurs(){
return Collections.unmodifiableList(ListObservateurs);
}
public void ajouterObservateur(Observateur observateur){
ListObservateurs.add(observateur);
}
public void enleverObservateur(Observateur observateur){
ListObservateurs.remove(observateur);
}
public void notifier(){
for (Observateur observateur : ListObservateurs){
observateur.update();
}
}
}

@ -0,0 +1,55 @@
package models;
import javafx.application.Platform;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleIntegerProperty;
import models.capteurs.CapteurTemperature;
import java.util.ArrayList;
import java.util.List;
public class TachePeriodique extends Thread{
private CapteurTemperature capteur;
protected final BooleanProperty arret = new SimpleBooleanProperty();
private List<CapteurTemperature> ListCapteurTachePeriodique = new ArrayList<>();
public TachePeriodique(){
setArret(true);
}
public BooleanProperty arretProperty(){
return arret;
}
public boolean getArret(){
return arret.get();
}
private void setArret(boolean arret){
this.arret.set(arret);
if(arret){
this.start();
}
}
public void ajouterUnCpateurTachePeriodique(CapteurTemperature capteur ){
ListCapteurTachePeriodique.add(capteur);
}
@Override
public void run() {
while (getArret()) {
try {
Thread.sleep(1000);
Platform.runLater(() -> {
ListCapteurTachePeriodique.forEach(e -> e.compute());
});
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
}

@ -0,0 +1,12 @@
package models;
import models.capteurs.CapteurTemperatureAbstrait;
public abstract class Visualisateur {
protected CapteurTemperatureAbstrait capteur;
public Visualisateur(CapteurTemperatureAbstrait capteur){
this.capteur = capteur;
}
}

@ -0,0 +1,35 @@
package models.capteurs;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
public abstract class Capteur {
private static int idCourantIncremente = 0;
private int id;
private StringProperty nom = new SimpleStringProperty();
public Capteur(String nom){
this.nom.set(nom);
idCourantIncremente += 1;
id = idCourantIncremente;
}
public StringProperty nomProperty(){
return nom;
}
public String getNom() {
return nom.get();
}
public void setNom(String nom) {
this.nom.set(nom);
}
public int getId() {
return id;
}
}

@ -0,0 +1,73 @@
package models.capteurs;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.collections.ObservableList;
import models.TachePeriodique;
import models.generateurs.StrategieTemperatureGenere;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.Objects;
import java.util.Optional;
public class CapteurTemperature extends CapteurTemperatureAbstrait{
private LocalDateTime updatedTime;
public CapteurTemperature(String nom, double temperature, StrategieTemperatureGenere strategieGeneration, TachePeriodique tachePeriodique) {
super(nom, temperature);
setStrategieGeneration(strategieGeneration);
setFrequence(1);
setenFonctionnementProperty(true);
updatedTime = LocalDateTime.now();
tachePeriodique.ajouterUnCpateurTachePeriodique(this);
}
@Override
public double getTemperature() {return this.temperature.get();}
private IntegerProperty frequence = new SimpleIntegerProperty();
public IntegerProperty frequenceProperty() {
return frequence;
}
private void setFrequence(int tick) {this.frequence.set(tick);}
public int getFrequence() { return frequence.get();}
private BooleanProperty enFonctionnement = new SimpleBooleanProperty();
public BooleanProperty enFonctionnementProperty() {
return enFonctionnement;
}
private void setenFonctionnementProperty(boolean activate) {
this.enFonctionnement.set(activate);
}
public boolean getenFonctionnementProperty() { return enFonctionnement.get();}
@Override
public ObservableList<CapteurTemperatureAbstrait> getListCapteurs() throws NoSuchMethodException {
throw new NoSuchMethodException();
}
private StrategieTemperatureGenere strategieGeneration;
public StrategieTemperatureGenere getStrategieGeneration() {
return strategieGeneration;
}
public void setStrategieGeneration(StrategieTemperatureGenere strategieGeneration) {
this.strategieGeneration = strategieGeneration;
}
public void compute() {
if(Objects.nonNull(strategieGeneration) && Boolean.TRUE.equals(getenFonctionnementProperty())) {
if(ChronoUnit.SECONDS.between(updatedTime, LocalDateTime.now()) >= getFrequence()) {
updatedTime = LocalDateTime.now();
temperatureProperty().setValue(strategieGeneration.compute(temperatureProperty().getValue()));
}
}
}
}

@ -0,0 +1,25 @@
package models.capteurs;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.collections.ObservableList;
public abstract class CapteurTemperatureAbstrait extends Capteur{
protected DoubleProperty temperature = new SimpleDoubleProperty();
public CapteurTemperatureAbstrait(String nom, double temperature) {
super(nom);
this.temperature.set(temperature);
}
public DoubleProperty temperatureProperty(){
return temperature;
}
private void setTemperature(double temperature){
this.temperature.set(temperature);
}
public abstract double getTemperature();
public abstract ObservableList<CapteurTemperatureAbstrait> getListCapteurs() throws NoSuchMethodException;
}

@ -0,0 +1,12 @@
package models.capteurs;
public class CapteurTemperatureManuel extends CapteurTemperature{
public CapteurTemperatureManuel(String nom, double temperature) {
super(nom, temperature, null, null);
}
public void setTemperature(double temperature){
setTemperature(temperature);
}
}

@ -0,0 +1,74 @@
package models.capteurs;
import javafx.beans.property.ListProperty;
import javafx.beans.property.SimpleListProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import models.generateurs.GenerateurAleatoire;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class CapteurTemperatureVirtuel extends CapteurTemperatureAbstrait{
private Map<Integer, List<CapteurTemperatureAbstrait>> ListCapteur = new HashMap<>();
private ObservableList<CapteurTemperatureAbstrait> ListCapteurObserve = FXCollections.observableArrayList();
public ListProperty<CapteurTemperatureAbstrait> listeCapteur = new SimpleListProperty<>(ListCapteurObserve);
public CapteurTemperatureVirtuel(String nom, double temperature) {
super(nom, temperature);
}
public List<CapteurTemperatureAbstrait> getCapteur(){
List<CapteurTemperatureAbstrait> list = new ArrayList<>();
for(Map.Entry<Integer, List<CapteurTemperatureAbstrait>> valeur : ListCapteur.entrySet()){
valeur.getValue().forEach(list::add);
}
return list;
}
public void AjouterUnCapteur(CapteurTemperatureAbstrait capteur, Integer poids){
if(ListCapteur.containsKey(poids)){
ListCapteur.get(poids).add(capteur);
ListCapteurObserve.add(capteur);
}else {
ListCapteur.put(poids, new ArrayList<>());
ListCapteur.get(poids).add(capteur);
ListCapteurObserve.add(capteur);
}
}
public void supprimerCapteur(CapteurTemperatureAbstrait capteur){
ListCapteurObserve.remove(capteur);
for(Map.Entry<Integer, List<CapteurTemperatureAbstrait>> valeur : ListCapteur.entrySet()){
if(valeur.getValue().contains(capteur)){
valeur.getValue().remove(capteur);
}
}
}
private double calculMoyenne(){
double SommeDesPoids = 0;
double SommeDesTemperatures = 0;
double Moyenne = 0;
for (Map.Entry<Integer, List<CapteurTemperatureAbstrait>> valeur : ListCapteur.entrySet()){
for (CapteurTemperatureAbstrait capteur : valeur.getValue()){
SommeDesPoids += valeur.getKey();
SommeDesTemperatures += (capteur.temperatureProperty().getValue() * valeur.getKey());
}
}
Moyenne = SommeDesTemperatures/SommeDesPoids;
return Moyenne;
}
public void MiseAjourTemperature() {temperatureProperty().setValue(calculMoyenne());}
@Override
public double getTemperature() {
return temperatureProperty().getValue();
}
@Override
public ObservableList<CapteurTemperatureAbstrait> getListCapteurs() throws NoSuchMethodException {
return ListCapteurObserve;
}
}

@ -0,0 +1,17 @@
package models.generateurs;
import java.util.Random;
public class GenerateurAleatoire implements StrategieTemperatureGenere {
@Override
public double compute(double temperature) {
Random random = new Random();
final int minTemperatureEnFrance = -40;
final int maxTemeperatureEnFrance = 55;
double temperatureGenere;
temperatureGenere = minTemperatureEnFrance + random.nextDouble() * (maxTemeperatureEnFrance - minTemperatureEnFrance);
return temperatureGenere;
}
}

@ -0,0 +1,38 @@
package models.generateurs;
import java.util.Random;
public class GenerateurParVariation implements StrategieTemperatureGenere{
private final double valeurVariable;
public GenerateurParVariation(double valeurVariable) {
this.valeurVariable = valeurVariable;
}
@Override
public double compute(double temperature) {
Random random = new Random();
double variation = random.nextDouble() * valeurVariable;
int signe = random.nextInt(2);
double temperatureGenere;
if(signe == 0){
temperatureGenere = temperature - variation;
}
else {
temperatureGenere = temperature + variation;
}
if(temperatureGenere < -40){
return 40;
} else if (temperatureGenere > 54) {
return 54;
}
else {
return temperatureGenere;
}
}
}

@ -0,0 +1,20 @@
package models.generateurs;
import java.util.Random;
public class GeneratureParIntervalle implements StrategieTemperatureGenere{
private final double valeurIntervalleMax;
private final double valeurIntervalMin;
public GeneratureParIntervalle(double valMaxInterval, double valMinInterval){
valeurIntervalleMax = valMaxInterval;
valeurIntervalMin = valMinInterval;
}
@Override
public double compute(double temperature) {
double temperatureGenere;
Random random = new Random();
temperatureGenere = valeurIntervalMin + random.nextDouble() * (valeurIntervalleMax - valeurIntervalMin);
return temperatureGenere;
}
}

@ -0,0 +1,5 @@
package models.generateurs;
public interface StrategieTemperatureGenere {
abstract double compute(double temperature);
}

@ -0,0 +1,53 @@
package views.cellules;
import javafx.fxml.FXML;
import javafx.scene.control.TreeCell;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;
import models.capteurs.CapteurTemperatureAbstrait;
import models.capteurs.CapteurTemperatureVirtuel;
public class CelluleArbre extends TreeCell {
@FXML
private ImageView imageView;
@FXML
private HBox hBox;
@FXML
private VBox vBox;
@FXML
private Text nomDuCapteur = new Text();
@FXML
private Text Degretemperature = new Text();
protected void updateItem(Object item, boolean empty) {
super.updateItem(item, empty);
if(!empty) {
hBox = new HBox();
vBox = new VBox();
imageView = new ImageView();
imageView.setFitWidth(30);
imageView.setFitHeight(30);
if(item instanceof CapteurTemperatureVirtuel) {
imageView.setImage(new Image("/images/multi_captor_icon.png"));
} else {
imageView.setImage(new Image("/images/captor_icon.png"));
}
nomDuCapteur.textProperty().bind(((CapteurTemperatureAbstrait)item).nomProperty());
Degretemperature.textProperty().bind(((CapteurTemperatureAbstrait)item).temperatureProperty().asString());
vBox.getChildren().addAll(nomDuCapteur, Degretemperature);
hBox.getChildren().addAll(imageView, vBox);
setGraphic(hBox);
} else {
nomDuCapteur.textProperty().unbind();
Degretemperature.textProperty().unbind();
setGraphic(null);
}
}
}

@ -0,0 +1,24 @@
package views.cellules;
import javafx.fxml.FXML;
import javafx.scene.control.TableCell;
import javafx.scene.text.Text;
public class CelluleId extends TableCell {
@FXML
Text text;
protected void updateItem(Object objet, boolean empty){
super.updateItem(objet, empty);
if(!empty) {
text = new Text();
text.setText(String.valueOf(objet));
setGraphic(text);
} else {
setGraphic(null);
}
}
}

@ -0,0 +1,49 @@
package views.cellules;
import javafx.fxml.FXML;
import javafx.scene.control.TextField;
import javafx.scene.control.TreeCell;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
import javafx.scene.text.Text;
import models.capteurs.CapteurTemperatureAbstrait;
import models.capteurs.CapteurTemperatureVirtuel;
public class CelluleListVue extends TreeCell {
@FXML
ImageView imageView;
@FXML
HBox hBox;
@FXML
private Text idDuCapteur = new Text();
@FXML
private TextField PoidsDuCapteur = new TextField();
@Override
protected void updateItem(Object item, boolean empty) {
super.updateItem(item, empty);
if(!empty) {
hBox = new HBox();
imageView = new ImageView();
imageView.setFitWidth(30);
imageView.setFitHeight(30);
if(item instanceof CapteurTemperatureVirtuel) {
imageView.setImage(new Image("/images/multi_captor_icon.png"));
} else {
imageView.setImage(new Image("/images/captor_icon.png"));
}
idDuCapteur.setText(String.valueOf(((CapteurTemperatureAbstrait)item).getId()));
hBox.getChildren().addAll(imageView, PoidsDuCapteur, idDuCapteur);
setGraphic(hBox);
} else {
setGraphic(null);
}
}
}

@ -0,0 +1,25 @@
package views.cellules;
import javafx.fxml.FXML;
import javafx.scene.control.TableCell;
import javafx.scene.control.TextField;
public class CellulePoids extends TableCell {
@FXML
TextField textField;
protected void updateItem(Object objet, boolean empty){
super.updateItem(objet, empty);
if(!empty) {
textField = new TextField();
textField.setText("objet.toString()");
setGraphic(textField);
} else {
setGraphic(null);
}
}
}

@ -0,0 +1,35 @@
package views.cellules;
import javafx.fxml.FXML;
import javafx.scene.control.TableCell;
import javafx.scene.control.TextField;
import javafx.scene.control.TreeCell;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import models.capteurs.CapteurTemperatureVirtuel;
public class CelluleType extends TableCell {
@FXML
ImageView imageView;
protected void updateItem(Object objet, boolean empty){
super.updateItem(objet, empty);
if(!empty) {
imageView = new ImageView();
imageView.setFitHeight(25);
imageView.setFitWidth(25);
if(objet instanceof CapteurTemperatureVirtuel) {
imageView.setImage(new Image("/images/multi_captor_icon.png"));
} else {
imageView.setImage(new Image("/images/captor_icon.png"));
}
setGraphic(imageView);
} else {
setGraphic(null);
}
}
}

@ -0,0 +1,41 @@
package views.fabriques;
import javafx.collections.ListChangeListener;
import models.capteurs.CapteurTemperature;
import models.capteurs.CapteurTemperatureAbstrait;
import models.generateurs.StrategieTemperatureGenere;
import views.vues.CapteurTemperatureAbstraitVue;
public class FabriqueVueCapteurTemperatureAbstrait {
public static CapteurTemperatureAbstraitVue from(CapteurTemperatureAbstrait root) {
CapteurTemperatureAbstraitVue retour = new CapteurTemperatureAbstraitVue(root);
plonger(root, retour);
try {
root.getListCapteurs().addListener(new ListChangeListener<CapteurTemperatureAbstrait>() {
@Override
public void onChanged(Change<? extends CapteurTemperatureAbstrait> c) {
while(c.next()) {
c.getAddedSubList().forEach(o -> {
retour.getChildren().add(FabriqueVueCapteurTemperatureAbstrait.from(o));
});
}
plonger(root, retour);
}
});
} catch (NoSuchMethodException e) {}
return retour;
}
public static void plonger(CapteurTemperatureAbstrait root, CapteurTemperatureAbstraitVue retour) {
try {
root.getListCapteurs().forEach(e -> {
retour.getChildren().add(FabriqueVueCapteurTemperatureAbstrait.from(e));
});
} catch (NoSuchMethodException e) {}
}
}

@ -0,0 +1,59 @@
package views.fenetre;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import models.Visualisateur;
import models.capteurs.CapteurTemperatureAbstrait;
public class FenetreImage extends Visualisateur {
private final int nuageux = 25;
private final int froid = 0;
@FXML
private ImageView imageView;
@FXML
private Text nomDuCapteur;
@FXML
private Button bouton;
public FenetreImage(CapteurTemperatureAbstrait capteur) {
super(capteur);
}
@FXML
public void boutonFermer() {
Stage stage = (Stage) imageView.getScene().getWindow();
stage.close();
}
private void DetermineImage() {
String imageRessource;
if(capteur.getTemperature() <= froid) {
imageRessource = "froid";
} else if (capteur.getTemperature() <= nuageux) {
imageRessource = "nuageux";
} else {
imageRessource = "chaud";
}
if(imageView.getImage() == null || !imageView.getImage().getUrl().endsWith(imageRessource+".jpg")) {
imageView.setImage(new Image("/images/"+imageRessource+".jpg"));
}
}
public void initialize() {
nomDuCapteur.textProperty().bind(capteur.nomProperty());
DetermineImage();
capteur.temperatureProperty().addListener((__, ___, newValue) -> DetermineImage());
}
}

@ -0,0 +1,206 @@
package views.fenetre;
import DonneePersistante.Stub;
import javafx.collections.FXCollections;
import javafx.collections.ListChangeListener;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.HBox;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import models.TachePeriodique;
import models.capteurs.CapteurTemperature;
import models.capteurs.CapteurTemperatureAbstrait;
import models.capteurs.CapteurTemperatureVirtuel;
import models.generateurs.GenerateurAleatoire;
import models.generateurs.GenerateurParVariation;
import models.generateurs.GeneratureParIntervalle;
import views.cellules.CelluleArbre;
import views.cellules.CelluleId;
import views.cellules.CellulePoids;
import views.cellules.CelluleType;
import views.fabriques.FabriqueVueCapteurTemperatureAbstrait;
import java.io.IOException;
public class FenetreMenu {
private CapteurTemperatureAbstrait capteur;
@FXML
private Button boutonDuSlider;
@FXML
private TextField nomDuCapteur;
@FXML
private Text temperature;
@FXML
private Text idDuCpateur;
@FXML
private TreeView<CapteurTemperatureAbstrait> treeView;
@FXML
private HBox frequence;
@FXML
private HBox strategie;
@FXML
private ComboBox<String> comboBox;
@FXML
private Spinner<Integer> spinner;
@FXML
private ToggleButton toggleButton;
@FXML
private TableView<CapteurTemperatureAbstrait> tableView;
@FXML
private TableColumn<CapteurTemperatureAbstrait,Integer> tableId;
@FXML
private TableColumn<ObservableList, ObservableList<Integer>> tablePoids;
@FXML
private TableColumn<ObservableList, ObservableList<CapteurTemperatureAbstrait>> tableType;
private ObservableList<ObservableList> listeTableView = FXCollections.observableArrayList();
@FXML
public void boutonSlider() throws IOException {
FXMLLoader loader = new FXMLLoader(getClass().getResource("/FXML/FenetreThermometre.fxml"));
loader.setController(new FenetreThermometre(treeView.getSelectionModel().getSelectedItem().getValue()));
Parent root = loader.load();
Stage stage = new Stage();
stage.initOwner(boutonDuSlider.getScene().getWindow());
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
@FXML
public void boutonImage(ActionEvent e) throws IOException {
FXMLLoader loader = new FXMLLoader(getClass().getResource("/FXML/FenetreImage.fxml"));
loader.setController(new FenetreImage(treeView.getSelectionModel().getSelectedItem().getValue()));
Parent root = loader.load();
Stage stage = new Stage();
stage.initOwner(((Button)e.getSource()).getScene().getWindow());
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
@FXML
public void boutonFermer() {
Stage stage = (Stage) nomDuCapteur.getScene().getWindow();
stage.close();
}
private void MiseAjourCapteur(){
if(capteur != null){
unbindPropriété();
}
bindPropriété();
updateInfoCapteur();
}
private void unbindPropriété(){
nomDuCapteur.textProperty().unbindBidirectional(capteur.nomProperty());
temperature.textProperty().unbind();
if(capteur instanceof CapteurTemperature){
toggleButton.selectedProperty().unbindBidirectional(((CapteurTemperature) capteur).enFonctionnementProperty());
spinner.getValueFactory().valueProperty().unbindBidirectional(((CapteurTemperature) capteur).frequenceProperty().asObject());
}
}
private void bindPropriété(){
capteur = treeView.getSelectionModel().getSelectedItem().getValue();
nomDuCapteur.textProperty().bindBidirectional(capteur.nomProperty());
temperature.textProperty().bind(capteur.temperatureProperty().asString());
idDuCpateur.textProperty().setValue(String.valueOf(capteur.getId()));
if(capteur instanceof CapteurTemperature){
spinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(0,60,1));
spinner.getValueFactory().valueProperty().bindBidirectional(((CapteurTemperature) capteur).frequenceProperty().asObject());
toggleButton.selectedProperty().bindBidirectional(((CapteurTemperature) capteur).enFonctionnementProperty());
}
}
private void updateInfoCapteur(){
if(capteur instanceof CapteurTemperature){
strategie.setVisible(true);
if(((CapteurTemperature) capteur).getStrategieGeneration() != null){
frequence.setVisible(true);
toggleButton.setVisible(true);
} else {
frequence.setVisible(false);
toggleButton.setVisible(false);
}
} else {
strategie.setVisible(false);
frequence.setVisible(false);
toggleButton.setVisible(false);
}
if(capteur instanceof CapteurTemperatureVirtuel) {
tableView.setVisible(true);
} else {
var strat = (((CapteurTemperature) capteur).getStrategieGeneration() != null) ? ((CapteurTemperature) capteur).getStrategieGeneration().toString() : "Manuel";
comboBox.getSelectionModel().select(strat);
tableView.setVisible(false);
}
}
private void ChangementDeStrategie(String strategieGeneration){
var capteurTemperature = treeView.getSelectionModel().getSelectedItem().getValue();
if(capteurTemperature instanceof CapteurTemperature){
if(strategieGeneration.equals("Aléatoire")){
((CapteurTemperature) capteurTemperature).setStrategieGeneration(new GenerateurAleatoire());
} else if (strategieGeneration.equals("Intervalle")) {
((CapteurTemperature) capteurTemperature).setStrategieGeneration(new GeneratureParIntervalle(-40, 55));
} else if (strategieGeneration.equals("Variation")) {
((CapteurTemperature) capteurTemperature).setStrategieGeneration(new GenerateurParVariation(8));
} else if (strategieGeneration.equals("Manuel")) {
((CapteurTemperature) capteurTemperature).setStrategieGeneration(null);
}
}
}
public void initialize() {
ObservableList<String> listeStratGen = FXCollections.observableArrayList();
listeStratGen.add("Aléatoire");
listeStratGen.add("Intervalle");
listeStratGen.add("Variation");
listeStratGen.add("Manuel");
comboBox.setItems(listeStratGen);
treeView.setCellFactory(__ -> new CelluleArbre());
tableId.setCellFactory(__ -> new CelluleId());
tableType.setCellFactory(__ -> new CelluleType());
tablePoids.setCellFactory(__ -> new CellulePoids());
var TachePeriodique = new TachePeriodique();
var root = FabriqueVueCapteurTemperatureAbstrait.from(Stub.chargerArbre(TachePeriodique));
treeView.getSelectionModel().getSelectedItems().addListener((ListChangeListener<TreeItem<CapteurTemperatureAbstrait>>) c -> MiseAjourCapteur());
spinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(0,30,1));
comboBox.setOnAction(actionEvent -> ChangementDeStrategie(comboBox.getValue()));
treeView.setRoot(root);
treeView.setShowRoot(false);
toggleButton.setText("arrêter");
}
}

@ -0,0 +1,42 @@
package views.fenetre;
import javafx.fxml.FXML;
import javafx.scene.control.ListView;
import javafx.scene.control.Slider;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import models.Visualisateur;
import models.capteurs.CapteurTemperatureAbstrait;
public class FenetreThermometre extends Visualisateur {
@FXML
private Text valTemperature;
@FXML
private Text nomDuCapteur;
@FXML
private Slider slider;
@FXML
private ListView<CapteurTemperatureAbstrait> listVue;
public FenetreThermometre(CapteurTemperatureAbstrait capteur) {
super(capteur);
}
@FXML
public void butonFermer(){
Stage stage = (Stage) slider.getScene().getWindow();
stage.close();
}
public void initialize() {
slider.valueProperty().bindBidirectional(capteur.temperatureProperty());
valTemperature.textProperty().bind(capteur.temperatureProperty().asString());
nomDuCapteur.textProperty().bind((capteur.nomProperty()));
}
}

@ -0,0 +1,14 @@
package views.vues;
import javafx.scene.control.TreeItem;
import models.capteurs.CapteurTemperatureAbstrait;
public class CapteurTemperatureAbstraitVue extends TreeItem<CapteurTemperatureAbstrait> {
protected CapteurTemperatureAbstrait capteurTemperatureAbstrait;
public CapteurTemperatureAbstraitVue(CapteurTemperatureAbstrait capteur) {
super(capteur);
capteurTemperatureAbstrait = capteur;
}
}

@ -0,0 +1,26 @@
package views.vues;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.control.TreeItem;
import models.capteurs.CapteurTemperatureAbstrait;
public class CapteurTemperatureVirtuelVue extends CapteurTemperatureAbstraitVue{
private ObservableList<TreeItem<CapteurTemperatureAbstrait>> observableListCapteurtemperatureAbstrait = FXCollections.observableArrayList();
public CapteurTemperatureVirtuelVue(CapteurTemperatureAbstrait capteur) {
super(capteur);
}
@Override
public boolean isLeaf() {
return true;
}
@Override
public ObservableList<TreeItem<CapteurTemperatureAbstrait>> getChildren() {
System.out.println(observableListCapteurtemperatureAbstrait.stream().count());
return observableListCapteurtemperatureAbstrait;
}
}

@ -0,0 +1,25 @@
package views.vues;
import javafx.collections.ObservableList;
import javafx.scene.control.TreeItem;
import models.capteurs.CapteurTemperatureAbstrait;
public class CapteurTemperatureVue extends CapteurTemperatureAbstraitVue{
public CapteurTemperatureVue(CapteurTemperatureAbstrait capteur) {
super(capteur);
}
@Override
public boolean isLeaf() {
return false;
}
@Override
public ObservableList<TreeItem<CapteurTemperatureAbstrait>> getChildren() {
throw new RuntimeException();
}
}
Loading…
Cancel
Save