From 7f0b72c6b8fedf82a953e6d7952868277bd885bb Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Fri, 8 Aug 2008 10:46:25 +0000 Subject: [PATCH] FHEMWEB cleanup, some small additional fixes/additions git-svn-id: https://svn.fhem.de/fhem/trunk@230 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 5 +- fhem/FHEM/92_FileLog.pm | 7 +- fhem/docs/HOWTO.html | 8 + fhem/docs/commandref.html | 14 +- fhem/examples/sample_pgm2 | 3 + fhem/fhem.pl | 23 +- fhem/webfrontend/pgm2/01_FHEMWEB.pm | 817 ++++++++++++---------------- fhem/webfrontend/pgm2/98_SVG.pm | 1 + fhem/webfrontend/pgm2/98_weblink.pm | 2 +- fhem/webfrontend/pgm2/cpulog.gplot | 27 + fhem/webfrontend/pgm2/garden.gplot | 35 ++ fhem/webfrontend/pgm2/style.css | 2 +- fhem/webfrontend/pgm2/svg_style.css | 2 +- 13 files changed, 477 insertions(+), 469 deletions(-) create mode 100644 fhem/webfrontend/pgm2/cpulog.gplot create mode 100644 fhem/webfrontend/pgm2/garden.gplot diff --git a/fhem/CHANGED b/fhem/CHANGED index 572f5fa34..4985317af 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -411,7 +411,7 @@ - feature: webpgm2 generates SVG's from logs: no need for gnuplot - bugfix: examples corrected to work with current syntax -- ==DATE== (4.4) +- 2008-08-04 (4.4) - feature: RM100-2 battery empty warning (mare 23.07.08) - feature: optimising the pgm2/SVG memory usage - feature: autoloading FHEM modules @@ -421,3 +421,6 @@ - feature: HMS100-FIT added (01.01.08 by Peter and 22.01.08 by Juergen) - feature: 91_watchdog added to handle the HMS100-FIT - feature: cum_kWh/cum_m3 added to EMWZ/EMGZ (11.01.08 by Peter) + +- ==DATE== (4.5) + - feature: further 01_FHEMWEB cleanup diff --git a/fhem/FHEM/92_FileLog.pm b/fhem/FHEM/92_FileLog.pm index ca2ba1a7e..d21943033 100755 --- a/fhem/FHEM/92_FileLog.pm +++ b/fhem/FHEM/92_FileLog.pm @@ -41,7 +41,7 @@ FileLog_Define($@) my @t = localtime; my $f = ResolveDateWildcards($a[2], @t); $fh = new IO::File ">>$f"; - return "Can't open $f" if(!defined($fh)); + return "Can't open $f: $!" if(!defined($fh)); $hash->{FH} = $fh; $hash->{REGEXP} = $a[3]; @@ -226,6 +226,7 @@ FileLog_Get($@) } my %lastdate; + my $d; # Used by eval functions while(my $l = <$ifh>) { last if($l gt $to); my @fld = split("[ \r\n]+", $l); # 40% @@ -263,7 +264,6 @@ FileLog_Get($@) } $h->{last2} = $fld[$col]; $lastdate{$hd} = $fld[0]; - next if(!$line); } elsif($t == 3) { # int function my $val = $fld[$col]; @@ -272,6 +272,7 @@ FileLog_Get($@) } else { # evaluate $line = "$fld[0] " . eval($h->{fn}) . "\n"; } + next if(!$line); if($outf eq "-") { $h->{ret} .= $line; @@ -318,7 +319,7 @@ FileLog_Get($@) } if($internal) { $internal_data = \$ret; - return "OK"; + return undef; } return ($outf eq "-") ? $ret : join(" ", @fname); diff --git a/fhem/docs/HOWTO.html b/fhem/docs/HOWTO.html index 1ccfc64d5..a12d95e70 100644 --- a/fhem/docs/HOWTO.html +++ b/fhem/docs/HOWTO.html @@ -225,6 +225,14 @@
+ define messages FileLog /var/log/messages fakelog ++