Bug avec StatiC
Posté : 24 févr. 2014, 15:37
Bonjour,
Je souhaite utiliser StatiC avec WsWIn. J'ai copié le fichier Static.txt (voir ci-joint) dans le dossier Wswin pour obtenir le fichier en php.
<!-- %customfile=statIC.php% -->
<!-- StatIC 1.55 13.08.08 -->
<html>
<body>
%unit_off%
%curminmaxhour_on%
<b>%ws_location%</b> %ws_year%-%ws_month2%-%ws_day2% %ws_hour2%:%ws_minute2%<br> <br>
<b>tmp;pressure;Hum;dew point;actual wind;wind direction;wind gust 10m;wind gust 1h;rain day;max rain rate/1h;rainrate</b><br>
%curval[2]%;
%curval[33]%;
%curval[18]%;
%curval[43]%;
%curval[35]%;
%curval[36]%;
<?php
$liste ="%ws_arraygust[5]% "; # 10/step WsWin
$tableau = explode(" ", $liste);
for($i=0;$i<5;$i=$i+1){
$tableau[$i]=0.0;
}
rsort($tableau);
$max= $tableau[0] * 1.852;
$max= round($max*10) / 10;
echo "$max;";
?>
%curminmaxhour[2,1,45]%;
%rain24h%;
%ws_setmem[1]=%curminmaxhour[2,1,34]%%
%ws_calc1[*]=%ws_calc[/]=60~2~2%~%ws_getmem[1]%~1%;
%rainrate%<br>
<br>
%unit_on%
%curminmaxhour_off%
<?php
$timeutc=date(Z);
$utc=$timeutc / 3600;
$fichier="./noaa/yesterday.txt"; // Fichier Template WsWin Yesterday
$fp = fopen ("$fichier",'r');
$content = fread ($fp,filesize($fichier));
$fichier=explode("-------------------------------------------------------------------------------------------" , $content);
$tabfich=explode("
", $fichier[1]);
$b= count($tabfich)-1;
$tempmax0y=-30.0;
$tempmin0y=50.0;
$tempmin66=50.0;
$tempmax66=-30.0;
$tempmax186=-30.0;
$tempmin186=50.0;
$tempmax618=-30.0;
$tempmin618=50.0;
$p0y=0.0;
$p0d=0.0;
$p66=0.0;
$p186=0.0;
$p618=0.0;
for ($i=1;$i<$b;$i++) {
$ligne=explode(";" ,$tabfich[$i]);
$heur=explode(":" ,$ligne[0]);
$heure=$heur[0];
$time=$ligne[0];
$temp=$ligne[1];
$pluie=$ligne[2];
//min max hier entre 0h et 0h
if ($temp > $tempmax0y) {$tempmax0y=$temp;}
if ($temp < $tempmin0y) {$tempmin0y=$temp;}
$p0y=$p0y+$pluie;
//min max hier aprs 6h
if ($heure >= (6+$utc)) {
if ($temp > $tempmax66) {$tempmax66=$temp;}
if ($temp < $tempmin66) {$tempmin66=$temp;}
$p66=$p66+$pluie;
}
//min max hier aprs 18h
if ($heure >= (18+$utc)) {
if ($temp > $tempmax186) {$tempmax186=$temp;}
if ($temp < $tempmin186) {$tempmin186=$temp;}
$p186=$p186+$pluie;
}
}
$fichier="./noaa/day.txt"; // Fichier Template WsWin Day
$fp = fopen ("$fichier",'r');
$content = fread ($fp,filesize($fichier));
$fichier=explode("-------------------------------------------------------------------------------------------" , $content);
$tabfich=explode("
", $fichier[1]);
$b= count($tabfich)-1;
$tempmin0d= 50;
$tempmax0d=-30;
for ($i=1;$i<$b;$i++) {
$ligne=explode(";" ,$tabfich[$i]);
$heur=explode(":" ,$ligne[0]);
$heure=$heur[0];
$time=$ligne[0];
$temp=$ligne[1];
$pluie=$ligne[2];
//min max aujourd'hui entre 0h et 0h
if ($temp > $tempmax0d) {$tempmax0d=$temp;}
if ($temp < $tempmin0d) {$tempmin0d=$temp;}
$p0d=$p0d+$pluie;
//min max aujourd'hui avant 6h
if ($heure < (6+$utc)) {
if ($temp > $tempmax66) {$tempmax66=$temp;}
if ($temp < $tempmin66) {$tempmin66=$temp;}
if ($temp > $tempmax186) {$tempmax186=$temp;}
if ($temp < $tempmin186) {$tempmin186=$temp;}
$p186=$p186+$pluie;
$p66=$p66+$pluie;
}
//min max aujourd'hui entre 6h et 18h
if (($heure < (18+$utc))&&($heure >= (6+$utcu))) {
if ($temp > $tempmax618) {$tempmax618=$temp;}
if ($temp < $tempmin618) {$tempmin618=$temp;}
$p618=$p618+$pluie;
}
}
echo"
06h 06h UTC:$tempmin66;$tempmax66;$p66<br>
18h 06h UTC:$tempmin186;$tempmax186;$p186<br>
06h 18h UTC:$tempmin618;$tempmax618;$p618<br>
0h 0h UTC:$tempmin0y;$tempmax0y;$p0y<br>";
?>
</body>
</html> [/i]
Ensuite j'ai rajouté Static.txt dans CFG Custom Fichier (voir-ci joint)
Puis chaque minute lorsque les fichiers se créés Wswin m'affiche le message d'erreur suivant en bas à gauche Var %CurMinMaxHour_On%. Ces tags ne fonctionnent plus sur mon site web.
Aurai-je paramétré quelque chose de mal? Y a-t-il une erreur dans mon fichier StatIC.txt? Aurai je omis une partie du paramétrage?
Je souhaite utiliser StatiC avec WsWIn. J'ai copié le fichier Static.txt (voir ci-joint) dans le dossier Wswin pour obtenir le fichier en php.
<!-- %customfile=statIC.php% -->
<!-- StatIC 1.55 13.08.08 -->
<html>
<body>
%unit_off%
%curminmaxhour_on%
<b>%ws_location%</b> %ws_year%-%ws_month2%-%ws_day2% %ws_hour2%:%ws_minute2%<br> <br>
<b>tmp;pressure;Hum;dew point;actual wind;wind direction;wind gust 10m;wind gust 1h;rain day;max rain rate/1h;rainrate</b><br>
%curval[2]%;
%curval[33]%;
%curval[18]%;
%curval[43]%;
%curval[35]%;
%curval[36]%;
<?php
$liste ="%ws_arraygust[5]% "; # 10/step WsWin
$tableau = explode(" ", $liste);
for($i=0;$i<5;$i=$i+1){
$tableau[$i]=0.0;
}
rsort($tableau);
$max= $tableau[0] * 1.852;
$max= round($max*10) / 10;
echo "$max;";
?>
%curminmaxhour[2,1,45]%;
%rain24h%;
%ws_setmem[1]=%curminmaxhour[2,1,34]%%
%ws_calc1[*]=%ws_calc[/]=60~2~2%~%ws_getmem[1]%~1%;
%rainrate%<br>
<br>
%unit_on%
%curminmaxhour_off%
<?php
$timeutc=date(Z);
$utc=$timeutc / 3600;
$fichier="./noaa/yesterday.txt"; // Fichier Template WsWin Yesterday
$fp = fopen ("$fichier",'r');
$content = fread ($fp,filesize($fichier));
$fichier=explode("-------------------------------------------------------------------------------------------" , $content);
$tabfich=explode("
", $fichier[1]);
$b= count($tabfich)-1;
$tempmax0y=-30.0;
$tempmin0y=50.0;
$tempmin66=50.0;
$tempmax66=-30.0;
$tempmax186=-30.0;
$tempmin186=50.0;
$tempmax618=-30.0;
$tempmin618=50.0;
$p0y=0.0;
$p0d=0.0;
$p66=0.0;
$p186=0.0;
$p618=0.0;
for ($i=1;$i<$b;$i++) {
$ligne=explode(";" ,$tabfich[$i]);
$heur=explode(":" ,$ligne[0]);
$heure=$heur[0];
$time=$ligne[0];
$temp=$ligne[1];
$pluie=$ligne[2];
//min max hier entre 0h et 0h
if ($temp > $tempmax0y) {$tempmax0y=$temp;}
if ($temp < $tempmin0y) {$tempmin0y=$temp;}
$p0y=$p0y+$pluie;
//min max hier aprs 6h
if ($heure >= (6+$utc)) {
if ($temp > $tempmax66) {$tempmax66=$temp;}
if ($temp < $tempmin66) {$tempmin66=$temp;}
$p66=$p66+$pluie;
}
//min max hier aprs 18h
if ($heure >= (18+$utc)) {
if ($temp > $tempmax186) {$tempmax186=$temp;}
if ($temp < $tempmin186) {$tempmin186=$temp;}
$p186=$p186+$pluie;
}
}
$fichier="./noaa/day.txt"; // Fichier Template WsWin Day
$fp = fopen ("$fichier",'r');
$content = fread ($fp,filesize($fichier));
$fichier=explode("-------------------------------------------------------------------------------------------" , $content);
$tabfich=explode("
", $fichier[1]);
$b= count($tabfich)-1;
$tempmin0d= 50;
$tempmax0d=-30;
for ($i=1;$i<$b;$i++) {
$ligne=explode(";" ,$tabfich[$i]);
$heur=explode(":" ,$ligne[0]);
$heure=$heur[0];
$time=$ligne[0];
$temp=$ligne[1];
$pluie=$ligne[2];
//min max aujourd'hui entre 0h et 0h
if ($temp > $tempmax0d) {$tempmax0d=$temp;}
if ($temp < $tempmin0d) {$tempmin0d=$temp;}
$p0d=$p0d+$pluie;
//min max aujourd'hui avant 6h
if ($heure < (6+$utc)) {
if ($temp > $tempmax66) {$tempmax66=$temp;}
if ($temp < $tempmin66) {$tempmin66=$temp;}
if ($temp > $tempmax186) {$tempmax186=$temp;}
if ($temp < $tempmin186) {$tempmin186=$temp;}
$p186=$p186+$pluie;
$p66=$p66+$pluie;
}
//min max aujourd'hui entre 6h et 18h
if (($heure < (18+$utc))&&($heure >= (6+$utcu))) {
if ($temp > $tempmax618) {$tempmax618=$temp;}
if ($temp < $tempmin618) {$tempmin618=$temp;}
$p618=$p618+$pluie;
}
}
echo"
06h 06h UTC:$tempmin66;$tempmax66;$p66<br>
18h 06h UTC:$tempmin186;$tempmax186;$p186<br>
06h 18h UTC:$tempmin618;$tempmax618;$p618<br>
0h 0h UTC:$tempmin0y;$tempmax0y;$p0y<br>";
?>
</body>
</html> [/i]
Ensuite j'ai rajouté Static.txt dans CFG Custom Fichier (voir-ci joint)
Puis chaque minute lorsque les fichiers se créés Wswin m'affiche le message d'erreur suivant en bas à gauche Var %CurMinMaxHour_On%. Ces tags ne fonctionnent plus sur mon site web.
Aurai-je paramétré quelque chose de mal? Y a-t-il une erreur dans mon fichier StatIC.txt? Aurai je omis une partie du paramétrage?