From cceefb00d1cd17693e0d3e9e84dc320d9a126b3f Mon Sep 17 00:00:00 2001 From: nitroxmh <> Date: Sun, 20 May 2012 20:03:43 +0000 Subject: [PATCH] Bugfix: timeproblem notify, Feature: userdefs.php better gnuplot picture, FS20 with HM git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@1572 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- webfrontend/pgm3/CHANGED | 3 +++ webfrontend/pgm3/HISTORY | 5 +++++ webfrontend/pgm3/config.php | 2 +- webfrontend/pgm3/include/fht.php | 9 ++++++--- webfrontend/pgm3/include/fs20.php | 13 ++++++++++++- webfrontend/pgm3/include/userdefs.php | 18 ++++++++++++++---- webfrontend/pgm3/index.php | 16 ++++++++++------ 7 files changed, 51 insertions(+), 15 deletions(-) diff --git a/webfrontend/pgm3/CHANGED b/webfrontend/pgm3/CHANGED index ff6d5baa1..5b5c41c4b 100644 --- a/webfrontend/pgm3/CHANGED +++ b/webfrontend/pgm3/CHANGED @@ -222,3 +222,6 @@ It is not necessary to tell fhem that there are other logs. 2012-05-08 -- Feature: homematic added, FS20-Buttons now different depending of the state +2012-05-20 + -- Feature: userdefs.php better gnuplot picture + -- Bugfix: index.php: time problem by notify commands wihtin fhem diff --git a/webfrontend/pgm3/HISTORY b/webfrontend/pgm3/HISTORY index 9287aec3c..32e6fa5e2 100644 --- a/webfrontend/pgm3/HISTORY +++ b/webfrontend/pgm3/HISTORY @@ -125,3 +125,8 @@ . Martin 2012-05-08 -- Feature: Homematic added, FS20-Buttons now depending of the state + +- Martin 20120-05-20 + -- Bugfix: time problem with notify within fhem + -- Feature: userdefs.php better gnuplot pictures + diff --git a/webfrontend/pgm3/config.php b/webfrontend/pgm3/config.php index 0f059d0bb..826ca844e 100644 --- a/webfrontend/pgm3/config.php +++ b/webfrontend/pgm3/config.php @@ -116,7 +116,7 @@ $imgmaxxroom=$imgmaxxfs20; # Size of the pictures, default=$imgmaxxfs20 $imgmaxyroom=22; # default=30 $roomfontsizetitel=10; # default=9 - $roommaxiconperline=$fs20maxiconperline; # default=$fs20maxiconperline + $roommaxiconperline=$fs20maxiconperline-1; # default=$fs20maxiconperline $namesortroom='1'; # [1|0] $namesortroomsign=')'; # If $namesortroom = 1 the Sign ")" will replace with " " [x] diff --git a/webfrontend/pgm3/include/fht.php b/webfrontend/pgm3/include/fht.php index 6cd5a0060..f13df338a 100755 --- a/webfrontend/pgm3/include/fht.php +++ b/webfrontend/pgm3/include/fht.php @@ -197,16 +197,19 @@ setlocale (LC_ALL, 'de_DE.utf8'); $fontsize=7; $txtcolor=$bg3p; ImageTTFText ($im, $fontsize, 0, 3, 10, $txtcolor, $fontttf, $text); - $text=$resultreverse[0][2]." °C"; - + $text=$resultreverse[0][2]; ImageTTFText ($im, 9, 0, 90-$XcorrectMainText, 37, $txtcolor, $fontttfb, $text); + $text=" °C"; + ImageTTFText ($im, 9, 0, 120-$XcorrectMainText, 37, $txtcolor, $fontttfb, $text); $text= $drawfht; ImageTTFText ($im, 8, 0, 90-$XcorrectMainText, 22, $txtcolor, $fontttfb, $text); $txtcolor=$bg3p; $fontsize=7; - $text="min= $mintemp max= $maxtemp"; + $text="min= $mintemp"; ImageTTFText ($im, $fontsize, 0, 90-$XcorrectMainText, 49, $txtcolor, $fontttf, $text); + $text="max= $maxtemp"; + ImageTTFText ($im, $fontsize, 0, 145-$XcorrectMainText, 49, $txtcolor, $fontttf, $text); $text=$txtroom.$room; ImageTTFText ($im, $fontsize, 0, 3, 49, $txtcolor, $fontttf, $text); diff --git a/webfrontend/pgm3/include/fs20.php b/webfrontend/pgm3/include/fs20.php index 5266e99be..0a20cd5c3 100755 --- a/webfrontend/pgm3/include/fs20.php +++ b/webfrontend/pgm3/include/fs20.php @@ -16,6 +16,7 @@ include "../config.php"; $img_path=$AbsolutPath."/include/img/"; + ## do we really need a new graphic?? #$execorder=$tailpath.' -1 '.$file; #exec($execorder,$tail1); @@ -24,8 +25,8 @@ include "../config.php"; $savefile=$AbsolutPath."/tmp/FS20.".$drawfs20.".log.".$datefs20.".png"; - if (file_exists($savefile)) { + if ((file_exists($savefile)) and (substr($statefs20,0,3) != 'MIS')) { $im2 = @ImageCreateFromPNG($savefile); header("Content-type: image/png"); imagePng($im2); @@ -59,10 +60,18 @@ include "../config.php"; $datefs20sep=explode(" ",$datefs20); $statefs20sep=explode(" ",$statefs20); + +#echo (substr($statefs20sep[0],0,3)); +#exit; + if (($icon!='')) { if ((substr($statefs20sep[0],0,3)=='dim')) { $statefs20tmp = 'on'; } + else + if ((substr($statefs20sep[0],0,3)=='MIS')) { + $statefs20tmp = 'missing'; + } else { $statefs20tmp = $statefs20sep[0]; } @@ -118,6 +127,8 @@ include "../config.php"; else { $text=$emap; } +#echo $text; +#exit; $txtcolor=$bg3p; $fontsize=7; diff --git a/webfrontend/pgm3/include/userdefs.php b/webfrontend/pgm3/include/userdefs.php index 7e5042766..7dc07c047 100755 --- a/webfrontend/pgm3/include/userdefs.php +++ b/webfrontend/pgm3/include/userdefs.php @@ -171,17 +171,26 @@ if ($gnuplottype=='piri' or $gnuplottype=='fs20') $gnuplotpng=$drawuserdef.".sm.png"; $messageA=<<\n"; } else { fwrite($fp, "$order;quit\n"); - $errormessage= fgets($fp); + #buggy in fhem by notify? + #$errormessage= fgets($fp); fclose($fp); } return $errormessage; @@ -308,6 +308,7 @@ function new_xml_parser($live) { global $parser_live; $xml_parser = xml_parser_create(); + xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8"); xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 0); xml_set_element_handler($xml_parser, "startElement", "endElement"); @@ -330,15 +331,16 @@ if (!(list($xml_parser, $live) = new_xml_parser($live))) { $data = $output[0]; if (!xml_parse($xml_parser, $data)) { $now=date($timeformat); - echo("There is a xmllist file for debugging under $AbsolutPath/tmp/debugxml$now

"); + echo("There is a xmllist file for debugging: $AbsolutPath/tmp/debugxml$now

"); $handle=fopen("tmp/debugxml$now","w"); fwrite($handle,$outputvar); - fclose($handle); $warning=sprintf("XML error: %s at line %d\n", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser)); echo $warning; - }; + fwrite($handle,$warning); + fclose($handle); + } @@ -358,6 +360,7 @@ xml_parser_free($xml_parser); $culhmdevs=array(); $fhtdevs=array(); $logpaths=array(); + $actors=array(); for($i=0; $i < count($stack[0][children]); $i++) { @@ -852,6 +855,7 @@ ht> $counter++; echo""; if (fmod($counter,$fs20maxiconperline)== 0.0) echo "
"; + array_push($actors,array($phpfileurl,$order,$showroom,$link,$fs20,$state,$measured,$icon,$emap,$subType,$room)); }; # $fs20=""; $state="";