Connection au serveur réussie ! Count = 642 mesures

Série de mesure réalisée entre le : 2018-11-15 10:01:59 et le 2018-11-19 16:22:14

Cb = 17°C

Ch = 32°C

Première étude de l'autonomie du module de mesure :

Lien vers l'étude : recharge à l'aide du panneau solaire

Courbe suivi température

Courbe suivi tension accu

Apexcharts

Conditions de l'expérience :

Remarque : le format du Date Time est  l'heure UNIX en ms
Soit le nombre de millisecondes écoulées depuis le 1er janvier 1970 00:00:00.000

29-05-2025 09:58:05 = 1748505485000 Temps UNIX en ms

<!DOCTYPE html> <html lang="fr"> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" /> <title>Séries multiples</title> <link href="graphe/assets/styles.css" rel="stylesheet" /> <style> #chart-Tpiscine { max-width: 100%; margin: 35px auto; } #chart-pile { max-width: 100%; margin: 35px auto; } #wrapper { padding-top: 20px; padding-left: 10px; background: #fff; border: 1px solid #ddd; box-shadow: 0 22px 35px -16px rgba(0, 0, 0, 0.1); max-width: 80%; margin: 35px auto; } </style> </head> <body> <?php //bts2m.free.fr/PH/sql_grapheT2.php $link = mysql_connect('sql.free.fr','tpil.projet','motDePasse'); if(!$link) {echo"Impossible de se connecter au serveur".mysql_error();exit;} else {echo"Connection au serveur réussie !<br>";} //--Connexion à la base mysql_select_db('piscine',$link); $requete= "SELECT * FROM piscine"; $reponse=mysql_query($requete, $link); if(!$reponse) {echo"Echec de lecture de la base de données <br>".mysql_error();exit;} while($ligne=mysql_fetch_array($reponse, MYSQL_ASSOC)) // lecture d'une ligne (ou une entrée) de la base de données puis auto incrémentation { $dateUnix= 1000*strtotime ($ligne[date]); $pile.='['.$dateUnix.','.$ligne[pile].'],'; $Tpiscine.='['.$dateUnix.','.$ligne[t_piscine].'],'; } $requete= "SELECT * FROM consignes"; $reponse=mysql_query($requete, $link); $ligne=mysql_fetch_array($reponse, MYSQL_ASSOC); $Cb=$ligne[consigne]; echo '<p>Cb = '.$Cb.'°C</p>'; $ligne=mysql_fetch_array($reponse, MYSQL_ASSOC); $Ch=$ligne[consigne]; echo '<p>Ch = '.$Ch.'°C</p>'; mysql_close($link); ?> <!-- <?php echo $pile;?> --> <div id="wrapper"> <h2>Courbe suivi température</h2> <div id="chart-Tpiscine"> </div> <h2>Courbe suivi tension accu</h2> <div id="chart-pile"> </div> </div> <script src="graphe/dist/apexcharts.js"></script> <script> var temperature=[<?php echo $Tpiscine; ?>] var tensionPile=[<?php echo $pile; ?>] </script> <script> // The global window.Apex variable below can be used to set common options for all charts on the page Apex = { chart: { type: 'area', stacked: false, height: 350, zoom: { type: 'x', enabled: true }, toolbar: { autoSelected: 'zoom' } }, dataLabels: { enabled: false }, stroke: { curve: 'straight' }, toolbar: { tools: { selection: false } }, markers: { size: 0, style: 'full', }, plotOptions: { line: { curve: 'smooth', } }, tooltip: { followCursor: false, theme: 'dark', x: { show: false }, marker: { show: false }, y: { title: { formatter: function() { return '' } } } }, grid: { clipMarkers: false }, yaxis: { tickAmount: 2 }, xaxis: { type: 'datetime' }, } var optionsTpiscine = { annotations: { yaxis: [ { // Annotation horizontale pour signaler Ch y: <?php echo $Ch; ?>, borderColor: "#fb2f03", label: { borderColor: "#fb2f03", style: { color: "#fff", background: "#fb2f03" }, text: "Ch" } // fin annotation Ch }, { // Annotation horizontale pour signaler Cb y: <?php echo $Cb; ?>, borderColor: "#037ffb", label: { borderColor: "#037ffb", style: { color: "#fff", background: "#037ffb" }, text: "Cb" } // fin annotation Cb }, ] }, // fin annotations */ yaxis: { min: 15, max: 30, title: { text: 'T en °C' }, }, chart: { id: 'fb', group: 'social', type: 'line', }, colors: ['#008FFB'], series: [{ name: 'Temperature Piscine', data: temperature }], } var chartTpiscine = new ApexCharts( document.querySelector("#chart-Tpiscine"), optionsTpiscine ); chartTpiscine.render(); var optionsPile = { annotations: { yaxis: [ { y: 4.15, borderColor: "#fb2f03", label: { borderColor: "#fb2f03", style: { color: "#fff", background: "#fb2f03" }, text: "100 %" } }, { y: 3.45, borderColor: "#037ffb", label: { borderColor: "#037ffb", style: { color: "#fff", background: "#037ffb" }, text: "0 %" } }, ] }, // fin annotations */ yaxis: { min: 3, max: 4.2, title: { text: 'Uaccu en V' }, }, chart: { id: 'tw', group: 'social', type: 'line', }, colors: ['#546E7A'], series: [{ name: 'Tension accu', data: tensionPile }], } var chartPile = new ApexCharts( document.querySelector("#chart-pile"), optionsPile ); chartPile.render(); </script> </body> </html>