2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2024-11-22 09:49:50 +00:00

HMS100-CO added, Dewpoint for ks300, webcam/picture-support

git-svn-id: https://svn.fhem.de/fhem/trunk@125 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinhaas 2007-12-21 12:27:09 +00:00
parent 79c1d3a1dc
commit 09c5edb703
6 changed files with 88 additions and 16 deletions

View File

@ -159,3 +159,9 @@ It is not necessary to tell fhem that there are other logs.
-- bugfix: Wrong display in MS IE. (Reported and solved by Boris)
-- Feature: Drewpoint im HMS100TF (Boris)
-- Feature: RSS-Feeds now new arranged
2007-12-21 (071221)
-- Feature: HMS-CO supported (Peter A.) ==> hms100.php
-- Feature: Webcams or local pictures added ==>index.php. config.php
-- Feature: ks300 mit Drewpoint (Boris) ==>functions.php, ks300.php, config.php

View File

@ -61,3 +61,7 @@
-- Feature: Drewpoint im HMS100TF (Boris)
-- Feature: RSS-Feeds now new arranged
- Martin 2007-12-21
-- Feature: HMS-CO supported (Peter A.)
-- Feature: Webcams or local pictures added
-- Feature: ks300 mit Drewpoint (Boris)

View File

@ -37,6 +37,17 @@
$kioskmode='off';
## Webcams
$showwebcam=0; #shows webcam-Urls or other pictures
$webcamwidth='150'; # the width of the shown picture
$wgetpath="/usr/bin/wget"; # you need the package wget for http, ftp...
$webcam[0]='http://webcam/IMAGE.JPG';
#$webcam[1]='IMAGE.PNG'; # Supported are Webcams with http:// ftp:// ....
# and Images wich must be copied to <pgm3>/tmp/
# $webcam[2]='http://...';
# ...
##############################################################################################
@ -114,6 +125,7 @@
$imgmaxyks=52;
$showbft=1; # Display values additionaly in Beafort. Values: 0 /1 Default:1
$maxcountKS='575'; # Maximum count of pixel (from right to left) (Default:575)
$showdewpointks300='yes'; # Dewpoint (german: taupunkt)
$XcorrectMainTextKS=45; # Text of main text from the right side (Default: 35)
$logrotateKS300lines=2100; # automatic Logrotate; $logrotate must be 'yes'.

View File

@ -37,26 +37,19 @@ function bft($windspeed) # wind speed in Beaufort
return($bft);
}
# saturation vapour pressure, approximation for
# temperature range 0°C .. +100,9°C
# see http://www.umnicom.de/Elektronik/Projekte/Wetterstation/Sensoren/SattDruck/SattDruck.htm
function svp($temperature) # saturation vapour pressure in hPa
{
$c1= 6.10780; # hPa
$c2= 17.09085;
$c3= 234.175; # °C
return($c1*exp(($c2*$temperature)/($c3+$temperature)));
}
# see http://www.umnicom.de/Elektronik/Projekte/Wetterstation/Sensoren/Taupunkte/Taupunkte.htm
# see http://de.wikipedia.org/wiki/Taupunkt, http://en.wikipedia.org/wiki/Dewpoint
# The dew point (or dewpoint) is the temperature to which a given parcel of air must be cooled, at constant
# barometric pressure, for water vapor to condense into water. The condensed water is called dew. The dew point
# is a saturation point.
# approximation valid for -30°C < $temp < 70°C
function dewpoint($temp,$hum) # dew point and temperature in °C, humidity in %
{
$svp= svp($temp);
$log= log10($svp*$hum/100.0);
return( (234.67*$log-184.2)/(8.233-$log));
$log= log($hum/100.0);
return( (241.2*$log+(4222.03716*$temp)/(241.2+$temp))/(17.5043-$log-(17.5043*$temp)/(241.22+$temp)) );
}
function randdefine()
{
$rand1 = rand(500,20000);

View File

@ -147,6 +147,7 @@ $avgmonth=$_GET['avgmonth'];
ImageTTFText ($im, $fontsize, 0, 3, 10, $txtcolor, $fontttf, $text);
$fontsize=9;
$text=$temp." &#176;C";
$tvalue= $temp;
ImageTTFText ($im, $fontsize, 0, 90-$XcorrectMainTextKS, 37, $txtcolor, $fontttfb, $text);
$text= $drawks;
ImageTTFText ($im, 8, 0, 90-$XcorrectMainTextKS, 22, $txtcolor, $fontttfb, $text);
@ -207,6 +208,7 @@ $avgmonth=$_GET['avgmonth'];
ImageTTFText ($im, $fontsize, 0, 3, 10, $txtcolor, $fontttf, $text);
$fontsize=9;
$text=$temp." %";
$hvalue= $temp;
ImageTTFText ($im, $fontsize, 0, 90-$XcorrectMainText, 37, $txtcolor, $fontttfb, $text);
$fontsize=7;
$text="min= $min max= $max";
@ -214,6 +216,20 @@ $avgmonth=$_GET['avgmonth'];
$imh=$im;
# dewpoint
if ($showdewpointks300='yes')
{
$dp = sprintf("%3.1f", dewpoint($tvalue,$hvalue));
$fontsize=9;
$text=$dp." °C";
ImageTTFText ($im, $fontsize, 0, 350, 35, $bg1p, $fontttfb, $text);
$txtcolor=$orange;
$fontsize=7;
$text="Dewpoint";
ImageTTFText ($im, $fontsize, 0, 350, 47, $bg1p, $fontttf, $text);
}
#wind/Air Pressure
$im = ImageCreateTrueColor($imgmaxxks,$imgmaxyks);
ImageFill($im, 0, 0, $bg2p);

View File

@ -41,7 +41,7 @@ include "include/gnuplot.php";
include "include/functions.php";
$pgm3version='071208';
$pgm3version='071221';
$Action = $_POST['Action'];
@ -472,6 +472,47 @@ xml_parser_free($xml_parser);
<font size=-2 $fontcolor1><div align='right'>v$pgm3version</div></font>
</td></tr>";
###################### Webcam
if ($showwebcam==1)
{
echo " <tr>
<td $bg1 colspan=4><font $fontcolor1>
<table cellspacing='0' cellpadding='0' width='100%'>
<tr>
<td>
<font $fontcolor1>WEBCAM</font>
</td>
<td align=right>
";
for($i=0; $i < count($webcam); $i++)
{
$webcam1=$webcam[$i];
$pos = strpos($webcam1,'://'); # e.g. http://..
if ($pos === false) # picture instead of an URL
{
$webcamname=$webcam[$i];
}
else
{
$webcamname=str_replace("/","",$webcam1);
$webcamname=str_replace(":","",$webcamname);
$order="$wgetpath -O tmp/$webcamname $webcam1";
exec($order,$res);
$errormessage = $res[0];
echo $errormessage;
}
echo"<a href='tmp/$webcamname'><img src='tmp/$webcamname' width='$webcamwidth' border=2></a>";
}
echo"
</td>
</tr>
</table>
</td>
</tr>
";
};
############################ FHZ
if ($show_fs20pulldown==1 or $show_general==1 or $show_fhtpulldown==1)
{