Page 1 sur 1

Reseau StatiC Infoclimat

Posté : 18 déc. 2010, 17:34
par Claude49
Bonjour

J’ai posté ce message sur Infoclimat le 9 décembre mais je n’ai pas eu de réponse, auriez-vous la solution ?

Ma station est sur le réseau StatiC, j'ai reçu par mail un fichier en pièce jointe et la procédure pour le mettre en place.
J’ai donc remis en route Weaterlink pour intégrer ce fichier car je ne fonctionne qu'avec WsWin.
Ma question: existe t-il un fichier pour WsWin?
Si oui comment je peux me le procurer?

Salutations

Claude

Re: Reseau StatiC Infoclimat

Posté : 18 déc. 2010, 18:38
par webmaster
Bonsoir,

Il y a diverses solutions pour mettre tes données à disposition.
J'utilisais personnellement la méthode PHP avec le code ci-dessous.

Code : Tout sélectionner

<!-- %customfile=statIC.php% -->   
<!-- StatIC 1.55c 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%


<?php
$timeutc=date('Z');
$utc=$timeutc / 3600;
$fichier="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="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+$utc))) {
	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>";
?>

%curminmaxhour_off%
</body>
</html>
Je l'ai corrigé et adapté pour qu'il fonctionne correctement jusqu'à la version 5.3.0, après j'ai lâché l'affaire mais je doute que ton hébergeur possède une version plus récente.

Re: Reseau StatiC Infoclimat

Posté : 18 déc. 2010, 23:28
par Claude49
Bonsoir

Merci je vais faire des essais

salutations

Claude

Re: Reseau StatiC Infoclimat

Posté : 19 déc. 2010, 11:13
par webmaster
Bonjour,
Il faudra quand même que tu vois avec eux pour leur donner l'adresse du fichier contenant les données.
Probablement: http://labrise.dnsalias.com/releves/static.php

Re: Reseau StatiC Infoclimat

Posté : 30 mai 2011, 03:44
par Claude49
oui merci Rieux
Je ferais ca plus tard (problème de santé) j'ai du mal a me concentrer.
Encore merci

Claude

Re: Reseau StatiC Infoclimat

Posté : 30 mai 2011, 08:07
par webmaster
Bonjour,

Tu as bien raison, ta santé est bien plus importante que la remontée d'info sur le réseau Static !
Reposes toi et reviens nous vite en bonne santé.