From a333fd213cecfa912948ef7ea08749d5165d1ef9 Mon Sep 17 00:00:00 2001
From: martinhaas <>
Date: Sat, 8 Dec 2007 20:16:34 +0000
Subject: [PATCH] Bugfixes for IE, Drewpoint for HMS100TF, better arrangement
of RSS-Feeds
git-svn-id: https://svn.fhem.de/fhem/trunk@122 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/webfrontend/pgm3/CHANGED | 6 ++-
fhem/webfrontend/pgm3/HISTORY | 5 ++
fhem/webfrontend/pgm3/config.php | 1 +
fhem/webfrontend/pgm3/include/functions.php | 21 +++++++-
fhem/webfrontend/pgm3/include/hms100.php | 23 ++++----
fhem/webfrontend/pgm3/include/rssfeeds.php | 58 ++++++++++++++++++---
fhem/webfrontend/pgm3/index.php | 6 +--
7 files changed, 99 insertions(+), 21 deletions(-)
diff --git a/fhem/webfrontend/pgm3/CHANGED b/fhem/webfrontend/pgm3/CHANGED
index 2401f8c73..cbb12783a 100644
--- a/fhem/webfrontend/pgm3/CHANGED
+++ b/fhem/webfrontend/pgm3/CHANGED
@@ -153,5 +153,9 @@ It is not necessary to tell fhem that there are other logs.
-- feature: RSS-Feeds added
2007-12-03 (071203)
--- minor: rebuild picture of fht on every entry in the log (not only on change of measured-temp.
+-- change: rebuild picture of fht on every entry in the log (not only on change of measured-temp.
+2007-12-08 (071208)
+-- bugfix: Wrong display in MS IE. (Reported and solved by Boris)
+-- Feature: Drewpoint im HMS100TF (Boris)
+-- Feature: RSS-Feeds now new arranged
diff --git a/fhem/webfrontend/pgm3/HISTORY b/fhem/webfrontend/pgm3/HISTORY
index 40004ba79..a4183a654 100644
--- a/fhem/webfrontend/pgm3/HISTORY
+++ b/fhem/webfrontend/pgm3/HISTORY
@@ -56,3 +56,8 @@
-- minor bugfix: rebuild picture of fht on every entry in the log (not only on change of measured-temp. Changes in fht.php
-- logrotate: better warning if there are wrong rights for the pgm3-logrotate
+- Martin 2007-12-08
+ -- bugfix: Wrong display in MS IE. (Reported and solved by Boris)
+ -- Feature: Drewpoint im HMS100TF (Boris)
+ -- Feature: RSS-Feeds now new arranged
+
diff --git a/fhem/webfrontend/pgm3/config.php b/fhem/webfrontend/pgm3/config.php
index b81f802c8..fb7e44ab4 100644
--- a/fhem/webfrontend/pgm3/config.php
+++ b/fhem/webfrontend/pgm3/config.php
@@ -99,6 +99,7 @@
$imgmaxyhms=52;
$maxcountHMS='575'; # Maximum count of pixel (from right to left) (Default:575)
$XcorrectMainTextHMS=25; # Text of main text from the right side (Default:)
+ $showdewpoint='yes'; # Dewpoint (german: taupunkt)
$logrotateHMSlines=1200; # automatic Logrotate; $logrotate must be 'yes'.
# Default:1200
# read docs/logrotate if you want adjust it manually!
diff --git a/fhem/webfrontend/pgm3/include/functions.php b/fhem/webfrontend/pgm3/include/functions.php
index 696e2c513..e6e2ac708 100644
--- a/fhem/webfrontend/pgm3/include/functions.php
+++ b/fhem/webfrontend/pgm3/include/functions.php
@@ -37,6 +37,25 @@ 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
+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));
+}
function randdefine()
{
@@ -44,7 +63,7 @@ function randdefine()
$rand2 = rand(500,20000);
$rq = md5($rand1.$rand2);
$randdefine=substr($rq,0,5);
-return ($randdefine);
+ return ($randdefine);
}
diff --git a/fhem/webfrontend/pgm3/include/hms100.php b/fhem/webfrontend/pgm3/include/hms100.php
index b32c55eff..d169009f7 100755
--- a/fhem/webfrontend/pgm3/include/hms100.php
+++ b/fhem/webfrontend/pgm3/include/hms100.php
@@ -194,15 +194,6 @@ if ( $type == "HMS100TF") ## hms100tf-Device.
ImageTTFText ($im, $fontsize, 0, 182, 47, $txtcolor, $fontttf, $text);
-# Taupunkt
-# $tp = Taupunkt($tvalue,$hvalue);
-# $fontsize=9;
-# $text=$tp." °C";
-# ImageTTFText ($im, $fontsize, 0, 350, 35, $bg1p, $fontttfb, $text);
-# $txtcolor=$orange;
-# $fontsize=7;
-# $text="Taupunkt";
-# ImageTTFText ($im, $fontsize, 0, 350, 47, $bg1p, $fontttf, $text);
};
@@ -228,6 +219,20 @@ if ( $type == "HMS100T" or $type == "HMS100TF" )
$text=$resultreverse[0][0];
ImageTTFText ($im, $fontsize, 0, $imgmaxxhms-127, 13, $txtcolor, $fontttf, $text);
};
+#############################################################################
+## dew point
+if ( $type == "HMS100TF" and $showdewpoint=='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);
+}
+
#############################################################################
## general
$txtcolor=$bg3p;
diff --git a/fhem/webfrontend/pgm3/include/rssfeeds.php b/fhem/webfrontend/pgm3/include/rssfeeds.php
index a86126eb9..5193c303d 100644
--- a/fhem/webfrontend/pgm3/include/rssfeeds.php
+++ b/fhem/webfrontend/pgm3/include/rssfeeds.php
@@ -38,6 +38,10 @@
header("Content-Type: text/xml");
+
+$fs20list=array();
+
+
echo "
@@ -56,7 +60,6 @@ echo "
############################
if (substr($stack[0][children][$i][name],0,5)=='FS20_')
{
- echo "