mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
Bugfix, userdefs.php now works with new gnuplot
git-svn-id: https://svn.fhem.de/fhem/trunk@1542 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c0e6223c01
commit
6f1753056b
@ -217,4 +217,7 @@ It is not necessary to tell fhem that there are other logs.
|
||||
-- Bugfix: getting xmllist from FHEM without \r\n, no netcat any more
|
||||
Changed: index.php, config.php
|
||||
|
||||
2012-05-07
|
||||
-- Bugfix: userdefs.php works with new gnuplot-version
|
||||
|
||||
|
||||
|
@ -119,3 +119,6 @@
|
||||
|
||||
- Martin 2012-05-03
|
||||
-- Bugfix: getting xmllist from FHEM without \r\n
|
||||
|
||||
- Martin 2012-05-07
|
||||
-- bugfix: userdefs.php. Now wokrs with new Gnuplot (imagecopy)
|
||||
|
@ -12,6 +12,7 @@ include "functions.php";
|
||||
|
||||
|
||||
$userdefnr=$_GET['userdefnr'];
|
||||
#$userdefnr=0;
|
||||
|
||||
$room=$userdef[$userdefnr]['room'];
|
||||
|
||||
@ -29,7 +30,9 @@ include "functions.php";
|
||||
$gnuplottype=$userdef[$userdefnr]['gnuplottype'];
|
||||
|
||||
|
||||
|
||||
# echo "userdefnr: $userdefnr";
|
||||
# echo "file: $file";
|
||||
#exit;
|
||||
if (! file_exists($file)) show_error($file,$drawuserdef,$imgmaxxuserdef,$imgmaxyuserdef,$type,$userdefnr);
|
||||
|
||||
|
||||
@ -76,6 +79,7 @@ include "functions.php";
|
||||
#Logrotate
|
||||
if ((($logrotateUSERDEFlines+100) < $counter) and ($logrotate == 'yes')) LogRotate($array,$file,$logrotateUSERDEFlines);
|
||||
|
||||
#echo "test1";
|
||||
#print_r($array[1]);
|
||||
#print_r($array[1][12]); exit;
|
||||
###########################################################################
|
||||
@ -108,7 +112,6 @@ include "functions.php";
|
||||
|
||||
|
||||
|
||||
|
||||
# Start Graphic
|
||||
$im = ImageCreateTrueColor($imgmaxxuserdef,$imgmaxyuserdef);
|
||||
$black = ImageColorAllocate($im, 0, 0, 0);
|
||||
@ -156,6 +159,7 @@ include "functions.php";
|
||||
if ($maxcountUSERDEF < $_SESSION["maxdata"]) {$anzlines=$maxcountUSERDEF;} else {$anzlines= $_SESSION["maxdata"];}
|
||||
|
||||
|
||||
|
||||
if ($gnuplottype=='piri' or $gnuplottype=='fs20')
|
||||
{
|
||||
$datumtomorrow= mktime (0,0,0,date("m") ,date("d")+1,date("Y"));
|
||||
@ -205,7 +209,6 @@ EOD;
|
||||
fclose($f1);
|
||||
|
||||
|
||||
#plot "< awk '{print $1, $3==\"on\"? 1 : $3==\"dimup\"? 0.8 : $3==\"dimdown\"? 0.2 : $3==\"off\"? 0 : 0.5;}' \
|
||||
$messageB=<<<EOD
|
||||
plot "< awk '{print $1, $3==\"on\"? 1 : $3==\"dimup\"? 1 : $3==\"dimdown\"? 0 : $3==\"off\"? 0 : 0.5;}' \
|
||||
$filename" using 1:2 title '' with steps
|
||||
@ -240,7 +243,8 @@ if ($gnuplottype=='piri' or $gnuplottype=='fs20')
|
||||
fputs($f1,$message);
|
||||
fclose($f1);
|
||||
exec("$gnuplot $AbsolutPath/tmp/$drawuserdef",$output);
|
||||
sleep(3);
|
||||
#echo "output: $output";exit;
|
||||
#sleep(3);
|
||||
|
||||
$w = imagesx($im);
|
||||
$h = imagesy($im);
|
||||
@ -248,7 +252,10 @@ if ($gnuplottype=='piri' or $gnuplottype=='fs20')
|
||||
$im2 = imagecreatefrompng("$AbsolutPath/tmp/$gnuplotpng");
|
||||
$w2 = imagesx($im2);
|
||||
$h2 = imagesy($im2);
|
||||
ImageCopy($im,$im2,163,0,0,10,$w2-20,$h2);
|
||||
#Old Gnuplot
|
||||
#ImageCopy($im,$im2,163,0,0,10,$w2-20,$h2);
|
||||
#New Gnuplot
|
||||
ImageCopy($im,$im2,163,0,10,420,$w2-20,50);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user