diff --git a/fhem/webfrontend/pgm3/CHANGED b/fhem/webfrontend/pgm3/CHANGED index 5e4828aa7..2401f8c73 100644 --- a/fhem/webfrontend/pgm3/CHANGED +++ b/fhem/webfrontend/pgm3/CHANGED @@ -152,3 +152,6 @@ It is not necessary to tell fhem that there are other logs. 2007-11-30 (071130) -- 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. + diff --git a/fhem/webfrontend/pgm3/HISTORY b/fhem/webfrontend/pgm3/HISTORY index c01750cf0..40004ba79 100644 --- a/fhem/webfrontend/pgm3/HISTORY +++ b/fhem/webfrontend/pgm3/HISTORY @@ -52,3 +52,7 @@ - Martin 2007-11-30 - feature: RSS-Feeds added. New include/rssfeeds.php. Changes in index.php and config.php +- Martin 2007-12-03 + -- 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 + diff --git a/fhem/webfrontend/pgm3/config.php b/fhem/webfrontend/pgm3/config.php index 27c01db2d..b81f802c8 100644 --- a/fhem/webfrontend/pgm3/config.php +++ b/fhem/webfrontend/pgm3/config.php @@ -30,7 +30,7 @@ # this is only possible, if the webserver (e.g.wwwrun) has the rights ro write the # files from fh1000.pl. If you want that then run fhz1000.pl as wwwrun too. # if 'yes' then only the needed lines are in the logfiles, the rest will be deleted. - $logrotate='yes'; # yes/no default='no' + $logrotate='yes'; # yes/no default='yes' ## Kioskmode. Only show but don't switch anything. Values: on/off diff --git a/fhem/webfrontend/pgm3/include/fht.php b/fhem/webfrontend/pgm3/include/fht.php index 5626be3b7..f007344bb 100755 --- a/fhem/webfrontend/pgm3/include/fht.php +++ b/fhem/webfrontend/pgm3/include/fht.php @@ -19,6 +19,34 @@ setlocale (LC_ALL, 'de_DE.utf8'); $file="$logpath/$drawfht.log"; if (! file_exists($file)) show_error($file,$drawfht,$imgmaxxfht,$imgmaxyfht); + + + + ## do we really need a new graphic?? + $execorder=$tailpath.' -1 '.$file; + exec($execorder,$tail1); + $parts = explode(" ", $tail1[0]); + $date=$parts[0]; + + #if the expected graphic already exist then do not redraw the picture + + $savefile=$AbsolutPath."/tmp/FHT.".$drawfht.".log.".$parts[0].".png"; + if (file_exists($savefile)) { + + $im2 = @ImageCreateFromPNG($savefile); + header("Content-type: image/png"); + imagePng($im2); + exit; # ;-))) + } + else #delete old pngs + { + $delfile=$AbsolutPath."/tmp/FHT.".$drawfht.".log.*.png"; + foreach (glob($delfile) as $filename) { + unlink($filename); + } + } + + $_SESSION["arraydata"] = array(); @@ -63,23 +91,23 @@ setlocale (LC_ALL, 'de_DE.utf8'); $resultreverse = array_reverse($_SESSION["arraydata"]); - #if the expected graphic alreay exist then do not redraw the picture + #if the expected graphic already exist then do not redraw the picture - $savefile=$AbsolutPath."/tmp/FHT.".$drawfht.".log.".$resultreverse[0][0].".png"; - if (file_exists($savefile)) { - - $im2 = @ImageCreateFromPNG($savefile); - header("Content-type: image/png"); - imagePng($im2); - exit; # ;-))) - } - else #delete old pngs - { - $delfile=$AbsolutPath."/tmp/FHT.".$drawfht.".log.*.png"; - foreach (glob($delfile) as $filename) { - unlink($filename); - } - } +# $savefile=$AbsolutPath."/tmp/FHT.".$drawfht.".log.".$resultreverse[0][0].".png"; +# if (file_exists($savefile)) { +# +# $im2 = @ImageCreateFromPNG($savefile); +# header("Content-type: image/png"); +# imagePng($im2); +# exit; # ;-))) +# } +# else #delete old pngs +# { +# $delfile=$AbsolutPath."/tmp/FHT.".$drawfht.".log.*.png"; +# foreach (glob($delfile) as $filename) { + # unlink($filename); +# } +# } $im = ImageCreateTrueColor($imgmaxxfht,$imgmaxyfht); diff --git a/fhem/webfrontend/pgm3/include/functions.php b/fhem/webfrontend/pgm3/include/functions.php index b6f1cd47c..696e2c513 100644 --- a/fhem/webfrontend/pgm3/include/functions.php +++ b/fhem/webfrontend/pgm3/include/functions.php @@ -9,7 +9,7 @@ function LogRotate($array,$file,$logrotatelines) $filename=$file; if (!$handle = fopen($filename, "w")) { - print "Logrotate: cannot open $filename -- correct rights??"; + print "Logrotate: cannot open $filename -- correct rights?? Read the chapter in the config.php!"; exit; } for ($x = $counter-$logrotatelines; $x < $counter; $x++) diff --git a/fhem/webfrontend/pgm3/index.php b/fhem/webfrontend/pgm3/index.php index c0fa2b472..8f98a1e9b 100644 --- a/fhem/webfrontend/pgm3/index.php +++ b/fhem/webfrontend/pgm3/index.php @@ -41,7 +41,7 @@ include "include/gnuplot.php"; include "include/functions.php"; -$pgm3version='071130'; +$pgm3version='071203'; $Action = $_POST['Action'];