Bugfix, userdefs.php now works with new gnuplot
git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@1542 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -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
|
-- Bugfix: getting xmllist from FHEM without \r\n, no netcat any more
|
||||||
Changed: index.php, config.php
|
Changed: index.php, config.php
|
||||||
|
|
||||||
|
2012-05-07
|
||||||
|
-- Bugfix: userdefs.php works with new gnuplot-version
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -119,3 +119,6 @@
|
|||||||
|
|
||||||
- Martin 2012-05-03
|
- Martin 2012-05-03
|
||||||
-- Bugfix: getting xmllist from FHEM without \r\n
|
-- 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=$_GET['userdefnr'];
|
||||||
|
#$userdefnr=0;
|
||||||
|
|
||||||
$room=$userdef[$userdefnr]['room'];
|
$room=$userdef[$userdefnr]['room'];
|
||||||
|
|
||||||
@@ -29,7 +30,9 @@ include "functions.php";
|
|||||||
$gnuplottype=$userdef[$userdefnr]['gnuplottype'];
|
$gnuplottype=$userdef[$userdefnr]['gnuplottype'];
|
||||||
|
|
||||||
|
|
||||||
|
# echo "userdefnr: $userdefnr";
|
||||||
|
# echo "file: $file";
|
||||||
|
#exit;
|
||||||
if (! file_exists($file)) show_error($file,$drawuserdef,$imgmaxxuserdef,$imgmaxyuserdef,$type,$userdefnr);
|
if (! file_exists($file)) show_error($file,$drawuserdef,$imgmaxxuserdef,$imgmaxyuserdef,$type,$userdefnr);
|
||||||
|
|
||||||
|
|
||||||
@@ -76,6 +79,7 @@ include "functions.php";
|
|||||||
#Logrotate
|
#Logrotate
|
||||||
if ((($logrotateUSERDEFlines+100) < $counter) and ($logrotate == 'yes')) LogRotate($array,$file,$logrotateUSERDEFlines);
|
if ((($logrotateUSERDEFlines+100) < $counter) and ($logrotate == 'yes')) LogRotate($array,$file,$logrotateUSERDEFlines);
|
||||||
|
|
||||||
|
#echo "test1";
|
||||||
#print_r($array[1]);
|
#print_r($array[1]);
|
||||||
#print_r($array[1][12]); exit;
|
#print_r($array[1][12]); exit;
|
||||||
###########################################################################
|
###########################################################################
|
||||||
@@ -108,7 +112,6 @@ include "functions.php";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Start Graphic
|
# Start Graphic
|
||||||
$im = ImageCreateTrueColor($imgmaxxuserdef,$imgmaxyuserdef);
|
$im = ImageCreateTrueColor($imgmaxxuserdef,$imgmaxyuserdef);
|
||||||
$black = ImageColorAllocate($im, 0, 0, 0);
|
$black = ImageColorAllocate($im, 0, 0, 0);
|
||||||
@@ -156,6 +159,7 @@ include "functions.php";
|
|||||||
if ($maxcountUSERDEF < $_SESSION["maxdata"]) {$anzlines=$maxcountUSERDEF;} else {$anzlines= $_SESSION["maxdata"];}
|
if ($maxcountUSERDEF < $_SESSION["maxdata"]) {$anzlines=$maxcountUSERDEF;} else {$anzlines= $_SESSION["maxdata"];}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($gnuplottype=='piri' or $gnuplottype=='fs20')
|
if ($gnuplottype=='piri' or $gnuplottype=='fs20')
|
||||||
{
|
{
|
||||||
$datumtomorrow= mktime (0,0,0,date("m") ,date("d")+1,date("Y"));
|
$datumtomorrow= mktime (0,0,0,date("m") ,date("d")+1,date("Y"));
|
||||||
@@ -205,7 +209,6 @@ EOD;
|
|||||||
fclose($f1);
|
fclose($f1);
|
||||||
|
|
||||||
|
|
||||||
#plot "< awk '{print $1, $3==\"on\"? 1 : $3==\"dimup\"? 0.8 : $3==\"dimdown\"? 0.2 : $3==\"off\"? 0 : 0.5;}' \
|
|
||||||
$messageB=<<<EOD
|
$messageB=<<<EOD
|
||||||
plot "< awk '{print $1, $3==\"on\"? 1 : $3==\"dimup\"? 1 : $3==\"dimdown\"? 0 : $3==\"off\"? 0 : 0.5;}' \
|
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
|
$filename" using 1:2 title '' with steps
|
||||||
@@ -240,7 +243,8 @@ 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);
|
#echo "output: $output";exit;
|
||||||
|
#sleep(3);
|
||||||
|
|
||||||
$w = imagesx($im);
|
$w = imagesx($im);
|
||||||
$h = imagesy($im);
|
$h = imagesy($im);
|
||||||
@@ -248,7 +252,10 @@ if ($gnuplottype=='piri' or $gnuplottype=='fs20')
|
|||||||
$im2 = imagecreatefrompng("$AbsolutPath/tmp/$gnuplotpng");
|
$im2 = imagecreatefrompng("$AbsolutPath/tmp/$gnuplotpng");
|
||||||
$w2 = imagesx($im2);
|
$w2 = imagesx($im2);
|
||||||
$h2 = imagesy($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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user