2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

pgm3: bugfix userdef.php Broken Graphic

git-svn-id: https://svn.fhem.de/fhem/trunk@622 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinhaas 2010-04-26 12:00:50 +00:00
parent 11c3e6d4a4
commit d99a286402
3 changed files with 10 additions and 3 deletions

View File

@ -204,3 +204,6 @@ It is not necessary to tell fhem that there are other logs.
-- Feature: DBLog for everything except UserDefs -- Feature: DBLog for everything except UserDefs
Changed: index.php, config.php, fht.php, hsm100.php, Changed: index.php, config.php, fht.php, hsm100.php,
fhtpulldown.php, ks300.php fhtpulldown.php, ks300.php
2010-04-26
-- Bugfix: userdefs.php: FS20-Type the first time with broken graphic

View File

@ -108,3 +108,5 @@
- Martin 2010-03-12 - Martin 2010-03-12
-- Bugfix: better check of availability of google-weather -- Bugfix: better check of availability of google-weather
-- Feature: DBLog added for everything except UserDefs -- Feature: DBLog added for everything except UserDefs
-Martin 201004-26
-- Bugfxi: the FS20-Type from Userdef the first time with a broken graphic

View File

@ -42,13 +42,14 @@ include "functions.php";
$today= date("H"); $today= date("H");
$savefile=$AbsolutPath."/tmp/USERDEF.".$drawuserdef.".log.".$parts[0].".png"; $savefile=$AbsolutPath."/tmp/USERDEF.".$drawuserdef.".log.".$parts[0].".png";
$fmtime=date ("H", filemtime($savefile)); #at least one new graphic per hour (gnuplot) if (file_exists($savefile)) {
if ((file_exists($savefile)) and ($fmtime == $today)) { $fmtime=date ("H", filemtime($savefile)); #at least one new graphic per hour (gnuplot)
if ($fmtime == $today) {
$im2 = @ImageCreateFromPNG($savefile); $im2 = @ImageCreateFromPNG($savefile);
header("Content-type: image/png"); header("Content-type: image/png");
imagePng($im2); imagePng($im2);
exit; # ;-))) exit; # ;-)))
}
} }
else #delete old pngs else #delete old pngs
{ {
@ -239,6 +240,7 @@ if ($gnuplottype=='piri' or $gnuplottype=='fs20')
fputs($f1,$message); fputs($f1,$message);
fclose($f1); fclose($f1);
exec("$gnuplot $AbsolutPath/tmp/$drawuserdef",$output); exec("$gnuplot $AbsolutPath/tmp/$drawuserdef",$output);
sleep(3);
$w = imagesx($im); $w = imagesx($im);
$h = imagesy($im); $h = imagesy($im);