mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
Now pgm3 shows other logfiles (like from wired devices) too.
git-svn-id: https://svn.fhem.de/fhem/trunk@95 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a2901ccd5d
commit
69133fcb71
@ -123,3 +123,7 @@ Changelog
|
||||
|
||||
2007-09-05 (cvs)
|
||||
-- feature: gnuplot pictures of FHT without all data (actuator, desired-temp) are shown with only measured temp
|
||||
|
||||
2007-10-13 (0.8.3)
|
||||
-- feature: Now it is possible to attach selfmade logfiles from e.g. wired devices. Everthing is explained in config.php.
|
||||
It is not necessary to tell fhem that there are other logs.
|
||||
|
@ -26,4 +26,7 @@
|
||||
- Martin 2007-09-05
|
||||
- Change in gnuplot.php: FHT: if there are not sufficient data (e.g. actuator) only measured-temp will be drawn
|
||||
|
||||
- Martin 2007-10-13
|
||||
- Now pgm3 shows other logfiles (like from wired devices) too. Changes in index.php, config.php, gnuplot.php, new userdefs.php)
|
||||
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
##################################################################################
|
||||
#### pgm3 -- a PHP-webfrontend for fhz1000.pl
|
||||
#### pgm3 -- a PHP-webfrontend for fhem.pl
|
||||
|
||||
|
||||
###### required settings
|
||||
$fhz1000="localhost"; #only php5 ! On which machine is fhz1000 runnning??
|
||||
$fhz1000="localhost"; #only php5 ! On which machine is fhem runnning??
|
||||
# if it is not localhost then the fhz1000.cfg must
|
||||
# run global: "port <nr> global"
|
||||
$fhz1000port="7072"; # port of fhz1000.pl
|
||||
@ -27,7 +27,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='no'; # yes/no default='no'
|
||||
$logrotate='yes'; # yes/no default='no'
|
||||
|
||||
|
||||
## Kioskmode. Only show but don't switch anything. Values: on/off
|
||||
@ -69,7 +69,7 @@
|
||||
##############################################################################################
|
||||
|
||||
## FHT-Devices
|
||||
$imgmaxxfht=725; #Size of the pictures Default: 725
|
||||
$imgmaxxfht=725; #Size of the pictures Default: 725
|
||||
$imgmaxyfht=52;
|
||||
$show_desiredtemp=1; # show the desired_temp as a graphic (0/1)
|
||||
$desR='255'; $desG='255'; $desB='255'; # Color of desired-temp-line Red/Green/Blue (Default: 255/255/255)
|
||||
@ -103,6 +103,19 @@
|
||||
# pgm3 (user www-data) needs the rights to write the logs
|
||||
# from fhz1000.pl (user = ???)
|
||||
|
||||
##############################################################################################
|
||||
## SCIVT-Devices
|
||||
$imgmaxxscivt=725; #Size of the pictures. Default: 725
|
||||
$imgmaxyscivt=52;
|
||||
$maxcountscivt='575'; # Maximum count of pixel (from right to left) (Default:575)
|
||||
$XcorrectMainTextSCIVT=25; # Text of main text from the right side (Default:)
|
||||
$logrotateSCIVTlines=1200; # automatic Logrotate; $logrotate must be 'yes'.
|
||||
# Default:1200
|
||||
# read docs/logrotate if you want adjust it manually!
|
||||
# otherwise the system will slow down
|
||||
# pgm3 (user www-data) needs the rights to write the logs
|
||||
# from fhz1000.pl (user = ???)
|
||||
|
||||
##############################################################################################
|
||||
## KS300-Device
|
||||
$imgmaxxks=725; #Size of the pictures Default: 725
|
||||
@ -112,12 +125,68 @@
|
||||
$maxcountKS='575'; # Maximum count of pixel (from right to left) (Default:575)
|
||||
$XcorrectMainTextKS=45; # Text of main text from the right side (Default: 35)
|
||||
|
||||
$logrotateKS300lines=1900; # automatic Logrotate; $logrotate must be 'yes'.
|
||||
# Default:1900
|
||||
$logrotateKS300lines=2100; # automatic Logrotate; $logrotate must be 'yes'.
|
||||
# Default:2100
|
||||
# read docs/logrotate if you want adjust it manually
|
||||
# otherwise the system will slow down
|
||||
# pgm3 (user www-data) needs the rights to write the logs
|
||||
# from fhz1000.pl (user = ???)
|
||||
##############################################################################################
|
||||
## user
|
||||
# Create your own graphics! If you have separate Programs (e.g. wired devices) then create your own
|
||||
# logfile and tell pgm3 to use it.
|
||||
# the logfile must look like this:
|
||||
###################################
|
||||
# 2007-10-13_13:45:14 solarI Is: 0.0
|
||||
###################################
|
||||
# Field1: <date>_<time> e.g. 2007-10-13_13:45:14
|
||||
# Field2: <name> e.g. solar
|
||||
# Field3: <free> this field has no meaning
|
||||
# Field4: <value> e.g. 0.0 this must be a numeric value
|
||||
|
||||
|
||||
$UserDefs=0; # Do you want user defined graphics? 1/0 Default: 0
|
||||
|
||||
#################
|
||||
## Userdef: 0 ## Switch $UserDefs to 1 !! ###
|
||||
$userdef[0]['name']='SolarV'; #Size of the pictures. Default: 725
|
||||
# No blanks or other special signs!!
|
||||
$userdef[0]['imagemax']=725;
|
||||
$userdef[0]['imagemay']=52;
|
||||
$userdef[0]['maxcount']=575; # Maximum count of pixel (from right to left) (Default:575)
|
||||
$userdef[0]['XcorrectMainText']=25; # Text of main text from the right side (Default:)
|
||||
$userdef[0]['logrotatelines']=2200; # automatic Logrotate; $logrotate must be 'yes'.
|
||||
# Default:2200
|
||||
# read docs/logrotate if you want adjust it manually!
|
||||
# otherwise the system will slow down
|
||||
# pgm3 (user www-data) needs the rights to write the logs
|
||||
# from fhz1000.pl (user = ???)
|
||||
$userdef[0]['logpath']=$logpath.'/lse_solarV.log'; # example, path to the logfile with the entrys like above
|
||||
$userdef[0]['room']='user';
|
||||
$userdef[0]['semlong']='Voltage'; # Sematic eg. Voltage
|
||||
$userdef[0]['semshort']='V'; # Sematic short e.g. V
|
||||
|
||||
#################
|
||||
## Userdef: 1
|
||||
# $userdef[1]['name']='Solar I'; #Size of the pictures. Default: 725
|
||||
# .....
|
||||
|
||||
|
||||
|
||||
#################
|
||||
## Userdef: 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
########################
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
##############################################################################################
|
||||
@ -125,12 +194,14 @@
|
||||
$taillog=1; #make shure to have the correct rights. Values: 0/1
|
||||
$tailcount=20; #make shure to have the correct rights. Values: 0/1
|
||||
$taillogorder="/usr/bin/tail -$tailcount $logpath/fhem.log ";
|
||||
#$taillogorder="/usr/bin/tail -$tailcount $logpath/fhemjens.log ";
|
||||
# $taillogorder="grep -v comparison $logpath/fhem.log| tail -20";
|
||||
|
||||
|
||||
|
||||
## show Information at startup.
|
||||
$showLOGS='no'; #show the LOGS at startup. Default: no Values: yes/no
|
||||
$showAT='no'; #show the AT_JOBS at startup. Default: no Values: yes/no
|
||||
$showAT='no'; #show the AT_JOBS at startup. Default: yes Values: yes/no
|
||||
$showNOTI='no'; #show the NOTIFICATIONS at startup. Default: no Values: yes/no
|
||||
$showHIST='yes'; #show the HISTORY (if taillog=1) at startup. Default: yes Values: yes/no
|
||||
|
||||
|
@ -45,7 +45,7 @@ setlocale (LC_ALL, 'de_DE.utf8');
|
||||
$array = file($file);
|
||||
$oldmin=0; //only the data from every 10min
|
||||
$oldhour=0; //only the data from every 10min
|
||||
$actuator=0;
|
||||
$actuator="00%";
|
||||
$actuator_date="unknown";
|
||||
$counter=count($array);
|
||||
$arraydesired=array();
|
||||
|
@ -9,8 +9,25 @@
|
||||
function drawgnuplot($gnudraw,$gnutyp,$gnuplot,$pictype,$logpath,$FHTyrange,$FHTy2range)
|
||||
{
|
||||
|
||||
$IN="$gnudraw ($gnutyp)";
|
||||
if ($gnutyp=="userdef")
|
||||
{
|
||||
$userdef=$FHTyrange; # workaround
|
||||
$userdefnr=$FHTy2range; # workaround
|
||||
|
||||
|
||||
$logfile= $userdef['logpath'];
|
||||
$drawuserdef=$userdef['name'];
|
||||
$SemanticLong=$userdef['semlong'];
|
||||
$SemanticShort=$userdef['semshort'];
|
||||
$type='UserDef '.$userdefnr;
|
||||
$IN="$gnudraw ($gnutyp $userdefnr)";
|
||||
}
|
||||
else
|
||||
{
|
||||
$logfile=$logpath."/".$gnudraw.".log";
|
||||
$IN="$gnudraw ($gnutyp)";
|
||||
|
||||
}
|
||||
$gnudraw1=$gnudraw.'1';
|
||||
$OUT1="set output 'tmp/$gnudraw.$pictype'";
|
||||
$OUT2="set output 'tmp/$gnudraw1.$pictype'";
|
||||
@ -34,6 +51,15 @@ $xrange="set xrange ['$xrange2':'$xrange1']
|
||||
|
||||
|
||||
switch ($gnutyp):
|
||||
Case FS20: ############################################
|
||||
$gplotmain=<<<EOD
|
||||
set yrange [-0.2:1.2]
|
||||
set ylabel "On/Off"
|
||||
plot "< awk '{print $1, $3==\"on\"? 1 : $3==\"dimup\"? 0.8 : $3==\"dimdown\"? 0.2 : $3==\"off\"? 0 : 0.5;}' $logfile" using 1:2 title 'On/Off' with steps
|
||||
EOD;
|
||||
#plot "< awk '{print $1, $3==\"on\"? 1 : 0; }' $logfile" using 1:2 title 'On/Off' with steps
|
||||
break;
|
||||
|
||||
Case WS300_t1: ############################################
|
||||
$gplotmain="
|
||||
set ylabel 'Temperature (Celsius)'
|
||||
@ -108,6 +134,13 @@ EOD;
|
||||
";
|
||||
break;
|
||||
|
||||
Case userdef: ############################################
|
||||
$gplotmain=<<<EOD
|
||||
\n set ylabel '$SemanticLong ( $SemanticShort )'
|
||||
plot "$logfile" using 1:4 axes x1y1 title '$SemanticLong' with lines lw 3
|
||||
EOD;
|
||||
break;
|
||||
|
||||
Case HMS100TF: ############################################
|
||||
$gplotmain="
|
||||
set ylabel 'Temperature (Celsius)'
|
||||
@ -119,7 +152,6 @@ EOD;
|
||||
default:
|
||||
endswitch;
|
||||
|
||||
|
||||
$message=$OUT1.$gplothdr.$gplotmain;
|
||||
$f1=fopen("tmp/gnu1","w");
|
||||
fputs($f1,$message);
|
||||
@ -133,7 +165,7 @@ fclose($f2);
|
||||
exec("$gnuplot tmp/gnu2",$output);
|
||||
$FOUT='tmp/'.$gnudraw1.'.'.$pictype;
|
||||
$FS=filesize($FOUT);
|
||||
if ($FS == '0')
|
||||
if (($FS == '0') and ($gnutyp != "userdef")) ##Grafic mistake (e.G. no actuator). Draw againg without actuator
|
||||
{
|
||||
$message=$OUT1.$gplothdr.$gplotmain2;
|
||||
$f1=fopen("tmp/gnu1","w");
|
||||
|
@ -40,7 +40,8 @@ include "../config.php";
|
||||
$textwidth = abs($box[4] - $box[0]);
|
||||
$textheight = abs($box[5] - $box[1]);
|
||||
$xcord = ($imgmaxxroom/2)-($textwidth/2)-2;
|
||||
$ycord = ($imgmaxyroom/2)+($textheight/2);
|
||||
# $ycord = ($imgmaxyroom/2)+($textheight/2);
|
||||
$ycord = ($imgmaxyroom/3+$roomfontsizetitel);
|
||||
ImageTTFText ($im, $roomfontsizetitel, 0, $xcord, $ycord, $txtcolor, $fontttfb, $text);
|
||||
|
||||
header("Content-type: image/png");
|
||||
|
202
fhem/webfrontend/pgm3/include/userdefs.php
Executable file
202
fhem/webfrontend/pgm3/include/userdefs.php
Executable file
@ -0,0 +1,202 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
################# Creates graphics vor pgm3
|
||||
|
||||
|
||||
################
|
||||
|
||||
include "../config.php";
|
||||
include "functions.php";
|
||||
|
||||
|
||||
$userdefnr=$_GET['userdefnr'];
|
||||
|
||||
$room=$userdef[$userdefnr]['room'];
|
||||
#echo "Raum: $room"; exit;
|
||||
|
||||
|
||||
|
||||
$file= $userdef[$userdefnr]['logpath'];
|
||||
$drawuserdef=$userdef[$userdefnr]['name'];
|
||||
$imgmaxxuserdef=$userdef[$userdefnr]['imagemax'];
|
||||
$imgmaxyuserdef=$userdef[$userdefnr]['imagemay'];
|
||||
$SemanticLong=$userdef[$userdefnr]['semlong'];
|
||||
$SemanticShort=$userdef[$userdefnr]['semshort'];
|
||||
$type='UserDef '.$userdefnr;
|
||||
$logrotateUSERDEFlines=$userdef[0]['logrotatelines'];
|
||||
$maxcountUSERDEF=$userdef[0]['maxcount'];
|
||||
$XcorrectMainTextUSERDEF=$userdef[0]['XcorrectMainText'];
|
||||
|
||||
|
||||
|
||||
#if (! in_array($type,$supported_USERDEF)) show_error_type($imgmaxxuserdef,$imgmaxyuserdef,$type);
|
||||
if (! file_exists($file)) show_error($file,$drawuserdef,$imgmaxxuserdef,$imgmaxyuserdef,$type,$userdefnr);
|
||||
|
||||
$_SESSION["arraydata"] = array();
|
||||
|
||||
$im = ImageCreateTrueColor($imgmaxxuserdef,$imgmaxyuserdef);
|
||||
$black = ImageColorAllocate($im, 0, 0, 0);
|
||||
$bg1p = ImageColorAllocate($im, 110,148,183);
|
||||
$bg2p = ImageColorAllocate($im, 175,198,219);
|
||||
$bg3p = ImageColorAllocate($im, $fontcol_grap_R,$fontcol_grap_G,$fontcol_grap_B);
|
||||
$white = ImageColorAllocate($im, 255, 255, 255);
|
||||
$gray= ImageColorAllocate($im, 133, 133, 133);
|
||||
$red = ImageColorAllocate($im, 255, 0, 0);
|
||||
$green = ImageColorAllocate($im, 0, 255, 0);
|
||||
$yellow= ImageColorAllocate($im, 255, 255, 0);
|
||||
$orange= ImageColorAllocate($im, 255, 230, 25);
|
||||
|
||||
|
||||
ImageFill($im, 0, 0, $bg2p);
|
||||
ImageRectangle($im, 0, 0, $imgmaxxuserdef-1, $imgmaxyuserdef-1, $white);
|
||||
|
||||
$array = file($file);
|
||||
$oldmin=0; //only the data from every 10min
|
||||
$oldhour=0; //only the data from every 10min
|
||||
$mintemp=100;
|
||||
$maxtemp=-100;
|
||||
$counter=count($array);
|
||||
#if ($maxcountUSERDEF < $counter) {$counter=$maxcountUSERDEF;};
|
||||
|
||||
#Logrotate
|
||||
if ((($logrotateUSERDEFlines+100) < $counter) and ($logrotate == 'yes')) LogRotate($array,$file,$logrotateUSERDEFlines);
|
||||
|
||||
#print_r($array[1]);
|
||||
#print_r($array[1][12]); exit;
|
||||
###########################################################################
|
||||
|
||||
for ($x = 0; $x < $counter; $x++)
|
||||
{
|
||||
list ($date,$userdef,$t,$temp,$h,$hum) = preg_split("/[\s,]+/", $array[$x]);
|
||||
if ((($array[$x][14] != $oldmin) or ($array[$x][12] != $oldhour) or ($x==$counter-1))
|
||||
and ( $date !="NEWLOGS"))
|
||||
{
|
||||
$oldmin=$array[$x][14];
|
||||
$oldhour=$array[$x][12];
|
||||
array_push( $_SESSION["arraydata"],array($date,$temp,$hum));
|
||||
}
|
||||
}
|
||||
|
||||
$resultreverse = array_reverse($_SESSION["arraydata"]);
|
||||
$xold=$imgmaxxuserdef;
|
||||
|
||||
if ( $imgmaxxuserdef > count ($resultreverse) )
|
||||
{ $_SESSION["maxdata"] = count ($resultreverse); }
|
||||
else
|
||||
{ $_SESSION["maxdata"] = $imgmaxxuserdef; };
|
||||
|
||||
###################
|
||||
### min/max
|
||||
$mintemp=100;
|
||||
$maxtemp=-100;
|
||||
for ($x = 0; $x <= $_SESSION["maxdata"]; $x++)
|
||||
{
|
||||
if ( $resultreverse[$x][1] > $maxtemp ) $maxtemp=$resultreverse[$x][1];
|
||||
if ( ($resultreverse[$x][1] < $mintemp) and ($resultreverse[$x][1]>-100) ) $mintemp=$resultreverse[$x][1];
|
||||
}
|
||||
$tempdiff=$maxtemp-$mintemp;
|
||||
if ($tempdiff==0) $tempdiff=1;
|
||||
$fac=$imgmaxyuserdef/$tempdiff;
|
||||
$yold=round($imgmaxyuserdef-(($resultreverse[0][1]-$mintemp)*$fac));
|
||||
###################
|
||||
|
||||
|
||||
if ($maxcountUSERDEF < $_SESSION["maxdata"]) {$anzlines=$maxcountUSERDEF;} else {$anzlines= $_SESSION["maxdata"];}
|
||||
for ($x = 0; $x < $anzlines; $x++)
|
||||
|
||||
{
|
||||
$parts = explode("_", $resultreverse[$x][0]);
|
||||
if ( ($parts[0] != $olddate) )
|
||||
{
|
||||
$olddate=$parts[0];
|
||||
ImageLine($im, $imgmaxxuserdef-$x, 0,$imgmaxxuserdef-$x , $imgmaxyuserdef, $bg1p);
|
||||
}
|
||||
$y = round($imgmaxyuserdef-(($resultreverse[$x][1]-$mintemp)*$fac));
|
||||
ImageLine($im, $imgmaxxuserdef-$x, $y, $xold, $yold, $red);
|
||||
$xold=$imgmaxxuserdef-$x;
|
||||
$yold=$y;
|
||||
};
|
||||
ImageLine($im, $imgmaxxuserdef-$x, 0,$imgmaxxuserdef-$x , $imgmaxyuserdef, $yellow);
|
||||
ImageLine($im, $imgmaxxuserdef-$maxcountUSERDEF, 0,$imgmaxxuserdef-$maxcountUSERDEF , $imgmaxyuserdef, $white);
|
||||
$tempTEMP=$temp;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#############################################################################
|
||||
|
||||
$text=$SemanticLong;
|
||||
$fontsize=7;
|
||||
$txtcolor=$bg3p;
|
||||
ImageTTFText ($im, $fontsize, 0, 3, 10, $txtcolor, $fontttf, $text);
|
||||
$txtcolor=$bg3p;
|
||||
$fontsize=9;
|
||||
$text=$tempTEMP." ".$SemanticShort;
|
||||
$tvalue=$tempTEMP;
|
||||
ImageTTFText ($im, $fontsize, 0, 90-$XcorrectMainTextUSERDEF, 37, $txtcolor, $fontttfb, $text);
|
||||
|
||||
$txtcolor=$bg3p;
|
||||
$fontsize=7;
|
||||
$text="min= $mintemp max= $maxtemp";
|
||||
ImageTTFText ($im, $fontsize, 0, 67-$XcorrectMainTextUSERDEF, 49, $txtcolor, $fontttf, $text);
|
||||
$text=$resultreverse[0][0];
|
||||
ImageTTFText ($im, $fontsize, 0, $imgmaxxuserdef-127, 13, $txtcolor, $fontttf, $text);
|
||||
#############################################################################
|
||||
## general
|
||||
$txtcolor=$bg3p;
|
||||
$fontsize=9;
|
||||
$text= $drawuserdef;
|
||||
ImageTTFText ($im, 8, 0,90-$XcorrectMainTextUSERDEF, 22, $txtcolor, $fontttfb, $text);
|
||||
$fontsize=7;
|
||||
$text=$txtroom.$room;
|
||||
ImageTTFText ($im, $fontsize, 0, 3, $imgmaxyuserdef-7, $txtcolor, $fontttf, $text);
|
||||
$text=$type;
|
||||
ImageTTFText ($im, $fontsize, 0, 5, $imgmaxyuserdef-17, $txtcolor, $fontttf, $text);
|
||||
|
||||
|
||||
#############################################################################
|
||||
#ok. let's draw
|
||||
|
||||
header("Content-type: image/png");
|
||||
imagePng($im);
|
||||
|
||||
|
||||
|
||||
###############################################################
|
||||
## first start: shows the required logfiles
|
||||
function show_error($file,$drawuserdef,$imgmaxx,$imgmaxy,$type,$section)
|
||||
{
|
||||
$im = ImageCreateTrueColor($imgmaxx,$imgmaxy);
|
||||
$black = ImageColorAllocate($im, 0, 0, 0);
|
||||
$bg2p = ImageColorAllocate($im, 175,198,219);
|
||||
$white = ImageColorAllocate($im, 255, 255, 255);
|
||||
$red = ImageColorAllocate($im, 255, 0, 0);
|
||||
|
||||
ImageFill($im, 0, 0, $bg2p);
|
||||
ImageRectangle($im, 0, 0, $imgmaxx-1, $imgmaxy-1, $white);
|
||||
|
||||
include "../config.php";
|
||||
$bg3p = ImageColorAllocate($im, $fontcol_grap_R,$fontcol_grap_G,$fontcol_grap_B);
|
||||
$text="There is a new supported $type-Device but no Logfile $file";
|
||||
$fontsize=9;
|
||||
$txtcolor=$bg3p;
|
||||
ImageTTFText ($im, $fontsize, 0, 5, 17, $txtcolor, $fontttf, $text);
|
||||
$text="Please check the userdef[$section] of <pgm3>/config.php and refresh your browser";
|
||||
#$fontsize=7;
|
||||
#ImageTTFText ($im, $fontsize, 0, 5, 30, $txtcolor, $fontttf, $text);
|
||||
#$logname=$drawuserdef."log";
|
||||
#$fontsize=9;
|
||||
#$text="define $logname FileLog $file $drawuserdef:.*s:.*";
|
||||
ImageTTFText ($im, $fontsize, 0, 5, 45, $txtcolor, $fontttf, $text);
|
||||
|
||||
header("Content-type: image/png");
|
||||
imagePng($im);
|
||||
exit;
|
||||
}
|
||||
|
||||
###############################################################
|
||||
|
||||
?>
|
@ -35,12 +35,13 @@
|
||||
############################### end of settings
|
||||
|
||||
error_reporting(E_ALL ^ E_NOTICE);
|
||||
$userdef=array();
|
||||
include "config.php";
|
||||
include "include/gnuplot.php";
|
||||
include "include/functions.php";
|
||||
|
||||
|
||||
$pgm3version='0.8.2';
|
||||
$pgm3version='0.8.3';
|
||||
|
||||
|
||||
$Action = $_POST['Action'];
|
||||
@ -51,6 +52,7 @@ $pgm3version='0.8.2';
|
||||
$showroom = $_POST['showroom'];
|
||||
$showmenu = $_POST['showmenu'];
|
||||
$showhmsgnu = $_POST['showhmsgnu'];
|
||||
$showuserdefgnu = $_POST['showuserdefgnu'];
|
||||
$temp = $_POST['temp'];
|
||||
$dofht = $_POST['dofht'];
|
||||
$orderpulldown = $_POST['orderpulldown'];
|
||||
@ -65,6 +67,12 @@ $pgm3version='0.8.2';
|
||||
if (! isset($showhmsgnu)) $showhmsgnu=$_GET['showhmsgnu'];
|
||||
if ($showhmsgnu=="") unset($showhmsgnu);
|
||||
|
||||
if (! isset($showuserdefgnu)) $showuserdefgnu=$_GET['showuserdefgnu'];
|
||||
if ($showuserdefgnu=="") unset($showuserdefgnu);
|
||||
|
||||
if (! isset($showfs20)) $showfs20=$_GET['showfs20'];
|
||||
if ($showfs20=="") unset($showfs20);
|
||||
|
||||
if (! isset($showfht)) $showfht=$_GET['showfht'];
|
||||
if ($showfht=="") unset($showfht);
|
||||
if ($showfht=="none") unset($showfht);
|
||||
@ -135,11 +143,13 @@ $pgm3version='0.8.2';
|
||||
{ $forwardurl=$forwardurl.'&fs20dev='.$fs20dev.'&orderpulldown='.$orderpulldown.'&showmenu='.$showmenu.'&showroom='.$showroom;};
|
||||
if (isset ($showks)) { $forwardurl=$forwardurl.'&showks='.$showks.'&kstyp='.$kstyp;};
|
||||
if (isset ($showhmsgnu)) { $forwardurl=$forwardurl.'&showhmsgnu='.$showhmsgnu;};
|
||||
if (isset ($showuserdefgnu)) { $forwardurl=$forwardurl.'&showuserdefgnu='.$showuserdefgnu;};
|
||||
if (isset ($showroom)) { $forwardurl=$forwardurl.'&showroom='.$showroom;};
|
||||
if (isset ($shownoti)) { $forwardurl=$forwardurl.'&shownoti';};
|
||||
if (isset ($showlogs)) { $forwardurl=$forwardurl.'&showlogs';};
|
||||
if (isset ($showat)) { $forwardurl=$forwardurl.'&showat';};
|
||||
if (isset ($showhist)) { $forwardurl=$forwardurl.'&showhist';};
|
||||
if (isset ($showfs20)) { $forwardurl=$forwardurl.'&showfs20='.$showfs20;};
|
||||
if (isset ($showmenu))
|
||||
{ $forwardurl=$forwardurl.'&fs20dev='.$fs20dev.'&orderpulldown='.$orderpulldown.'&valuetime='.$valuetime.'&showmenu='.$showmenu.'&showroom='.$showroom;}
|
||||
unset($link);
|
||||
@ -150,6 +160,7 @@ $pgm3version='0.8.2';
|
||||
if (isset ($showmenu)) $link=$link.'&showmenu='.$showmenu;
|
||||
if (isset ($showfht)) $link=$link.'&showfht='.$showfht;
|
||||
if (isset ($showhmsgnu)) $link=$link.'&showhmsgnu='.$showhmsgnu;
|
||||
if (isset ($showuserdefgnu)) $link=$link.'&showuserdefgnu='.$showuserdefgnu;
|
||||
if (isset ($showks)) $link=$link.'&showks='.$showks;
|
||||
|
||||
|
||||
@ -179,7 +190,7 @@ switch ($Action):
|
||||
if ($kioskmode=='off') execFHZ($order,$fhz1000,$fhz1000port);
|
||||
header("Location: $forwardurl");
|
||||
break;
|
||||
Case showfht|showroom|showks|showhmsgnu|hide:
|
||||
Case showfht|showroom|showks|showhmsgnu|hide|showuserdefgnu:
|
||||
header("Location: $forwardurl");
|
||||
break;
|
||||
default:
|
||||
@ -370,6 +381,19 @@ xml_parser_free($xml_parser);
|
||||
}
|
||||
}
|
||||
} # HMS
|
||||
elseif (substr($stack[0][children][$i][name],0,6)=='SCIVT_')
|
||||
{
|
||||
for($j=0; $j < count($stack[0][children][$i][children]); $j++)
|
||||
{
|
||||
for($k=0; $k < count($stack[0][children][$i][children][$j][children]); $k++)
|
||||
{
|
||||
if ( $stack[0][children][$i][children][$j][children][$k][attrs][key]=="room")
|
||||
{$room=$stack[0][children][$i][children][$j][children][$k][attrs][value];
|
||||
if (! in_array($room,$rooms)) array_push($rooms,$room);
|
||||
}
|
||||
}
|
||||
}
|
||||
} # SCIVT
|
||||
elseif (substr($stack[0][children][$i][name],0,6)=='KS300_')
|
||||
{
|
||||
for($j=0; $j < count($stack[0][children][$i][children]); $j++)
|
||||
@ -388,7 +412,18 @@ xml_parser_free($xml_parser);
|
||||
}
|
||||
}
|
||||
}
|
||||
} # end searching rooms
|
||||
} # end searching rooms in the array from fhem
|
||||
# user defined rooms?
|
||||
if ($UserDefs==1)
|
||||
{
|
||||
for($i=0; $i < count($userdef); $i++)
|
||||
{
|
||||
$room=$userdef[$i]['room'];
|
||||
if (! in_array($room,$rooms)) array_push($rooms,$room);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
array_push($rooms,'ALL');
|
||||
sort($rooms);
|
||||
|
||||
@ -526,6 +561,15 @@ xml_parser_free($xml_parser);
|
||||
};
|
||||
}
|
||||
echo "</td></tr>";
|
||||
if (isset($showfs20) and $showgnuplot == 1)
|
||||
{
|
||||
drawgnuplot($showfs20,"FS20",$gnuplot,$pictype,$logpath, $FHTyrange,$FHTy2range);
|
||||
$FS20dev1=$showfs20.'1';
|
||||
echo "<tr><td colspan=5 align=center><img src='tmp/$showfs20.$pictype'><br>
|
||||
<img src='tmp/$FS20dev1.$pictype'>
|
||||
</td></tr>
|
||||
<tr><td colspan=4><hr color='#AFC6DB'></td></tr>";
|
||||
}
|
||||
}
|
||||
############################
|
||||
elseif (substr($stack[0][children][$i][name],0,4)=='FHT_')
|
||||
@ -811,6 +855,54 @@ xml_parser_free($xml_parser);
|
||||
}
|
||||
}
|
||||
};
|
||||
## that is all of fhem
|
||||
##################### User defined graphics??
|
||||
if ($UserDefs==1)
|
||||
{
|
||||
echo "<tr><td $bg1 colspan=4><font $fontcolor1>
|
||||
<table cellspacing='0' cellpadding='0' width='100%'>
|
||||
<tr><td><font $fontcolor1>USER DEFINED</td><td align=right><font $fontcolor1><b>
|
||||
</font></td></tr></table></td></tr>";
|
||||
|
||||
$type='userdef';
|
||||
|
||||
for($i=0; $i < count($userdef); $i++)
|
||||
{
|
||||
$room=$userdef[$i]['room'];
|
||||
$UserDef=$userdef[$i]['name'];
|
||||
$imgmaxxuserdef=$userdef[$i]['imagemax'];
|
||||
$imgmaxyuserdef=$userdef[$i]['imagemay'];
|
||||
|
||||
|
||||
if (($room != 'hidden') and ($showroom=='ALL' or $showroom==$room))
|
||||
{
|
||||
if ($showuserdefgnu== $UserDef) {$formvalue="hide";$gnuvalue="";}
|
||||
else {$formvalue="show";$gnuvalue=$UserDef;};
|
||||
echo "<tr valign=center><td align=center $bg2 valign=center>
|
||||
<form action=$forwardurl method='POST'>
|
||||
<input type=hidden name=Action value=showuserdefgnu>
|
||||
<input type=hidden name=showroom value=$showroom>
|
||||
<input type=hidden name=showuserdefgnu value=$gnuvalue>
|
||||
<input type=submit value='$formvalue'></form></td><td $bg2 colspan=2>";
|
||||
|
||||
echo "<img src='include/userdefs.php?userdefnr=$i' width='$imgmaxxuserdef' height='$imgmaxyuserdef'></td> </tr>";
|
||||
|
||||
if ($showuserdefgnu == $UserDef and $showgnuplot == 1)
|
||||
{ drawgnuplot($UserDef,$type,$gnuplot,$pictype,$logpath,$userdef[$i],1);
|
||||
$UserDef1=$UserDef.'1';
|
||||
echo "<tr><td colspan=5 align=center><img src='tmp/$UserDef.$pictype'><br>
|
||||
<img src='tmp/$UserDef1.$pictype'>
|
||||
</td></tr>";
|
||||
}
|
||||
}# /not room hidden
|
||||
|
||||
}
|
||||
|
||||
} #/userdefs
|
||||
|
||||
##################### taillog
|
||||
|
||||
|
||||
if ($taillog==1)
|
||||
{
|
||||
echo "<tr><td $bg1 colspan=4><font $fontcolor1>
|
||||
|
Loading…
Reference in New Issue
Block a user