diff --git a/webfrontend/pgm2/98_SVG.pm b/webfrontend/pgm2/98_SVG.pm
index b4fd91c01..108a5d8c0 100755
--- a/webfrontend/pgm2/98_SVG.pm
+++ b/webfrontend/pgm2/98_SVG.pm
@@ -8,7 +8,7 @@ use POSIX;
-sub SVG_render($$$$$$$);
+sub SVG_render($$$$$);
sub time_to_sec($);
sub fmtTime($$);
@@ -24,20 +24,25 @@ SVG_Initialize($)
#####################################
sub
-SVG_render($$$$$$$)
+SVG_render($$$$$)
{
- my ($file, $wh, $from, $to, $confp, $dp, $plot) = @_;
+ my ($from, $to, $confp, $dp, $plot) = @_;
- my ($ow,$oh) = split(",", $wh); # Original width
my $th = 16; # "Font" height
my ($x, $y) = (3*$th, 1.2*$th); # Rect offset
- my ($w, $h) = ($ow-2*$x, $oh-2*$y); # Rect size
my %conf; # gnuplot file settings
# Convert the configuration to a "readable" form -> array to hash
map { chomp; my @a=split(" ",$_, 3);
if($a[0] && $a[0] eq "set") { $conf{$a[1]} = $a[2]; } } @{$confp};
+ my $ps = "800,400";
+ $ps = $1 if($conf{terminal} =~ m/.*size[ ]*([^ ]*)/);
+ $conf{title} =~ s/'//g;
+
+ my ($ow,$oh) = split(",", $ps); # Original width
+ my ($w, $h) = ($ow-2*$x, $oh-2*$y); # Rect size
+
# Html Header
pO "\n";
pO "\n";
@@ -50,7 +55,7 @@ SVG_render($$$$$$$)
my ($off1,$off2) = ($ow/2, 3*$y/4);
pO "$file\n";
+ class=\"title\" text-anchor=\"middle\">$conf{title}\n";
my $t = ($conf{ylabel} ? $conf{ylabel} : "");
$t =~ s/"//g;
@@ -105,7 +110,6 @@ SVG_render($$$$$$$)
$l = substr($$dp, $dpoff, $ndpoff-$dpoff);
}
$dpoff = $ndpoff+1;
-
if($l =~ m/^#/) {
my $a = $axes[$idx];
$hmin{$a} = $min if(!defined($hmin{$a}) || $hmin{$a} > $min);
@@ -352,6 +356,9 @@ sub
time_to_sec($)
{
my ($str) = @_;
+ if(!$str) {
+ return 0;
+ }
my ($y,$m,$d,$h,$mi,$s) = split("[-_:]", $str);
$s = 0 if(!$s);
$mi= 0 if(!$mi);
diff --git a/webfrontend/pgm2/README b/webfrontend/pgm2/README
deleted file mode 100644
index f11f79f9a..000000000
--- a/webfrontend/pgm2/README
+++ /dev/null
@@ -1,77 +0,0 @@
-Installation:
-=============
-- copy the gif files to the destination directory
- cp *.gif /home/httpd/icons
-- copy docs/commandref.html to the doc directory
- cp ../..docs/commandref.html /home/httpd/html
-- check if the above directories are set correctly in 01_FHEMWEB.pm
- vi 01_FHEMWEB.pm
-- copy 01_FHEMWEB.pm to the fhem module directory
- cp *.pm /usr/local/lib/FHEM
-- restart fhem.pl
-- define a new FHEMWEB instance in fhem
- define WEB FHEMWEB 8080 global
-
-Now you can access it from the web browser via
- http://:8080/fhem
-
-Additional features:
-====================
-- Rooms: If you have more than 10 devices/logs/notifies/etc. then it make sense
- to divide them into "rooms". For this purpose assign the attribute room to
- each device.
-- hide devices: Devices in the room "hidden" will not be shown. Devices without
- a room attribute go to the room "Unsorted".
-- Title: You can set the title of the webpage with
- attr global title "My-Title"
-- If you set the attribute model of an FS20 device, and the device is an
- FS20-sender, then you will not be able to switch it from the frontend.
-- You can first set an attribute to an arbitrary (wrong) value, then click on
- the attribute: you will be guided to the correct place in the documentation;
- now you can chnage the attribute value to the correct one.
-- To log the HTTP requests in the logfile, either set the global verbose to a
- value greater than 3 or set the HTTP device loglevel to a lower value
- attr loglevel 2
-
-
-Graphs for plotted logs (gnuplot):
-==================================
-- Set FHEMWEB_gnuplot in 01_FHEMWEB.pm to the gnuplot binary
-- copy the gnuplot files to the gnuplot scripts to the gnuplot directory
- cp *.gplot /home/httpd/cgi-bin
-- copy 99_weblink.pm to the FHEM modules directory and restart fhem.pl
-- assign the logtype attribute to your FileLog device.
- Look at the XXX.gplot file, how the FileLog should be defined, and
- set the corresponding logtype attribute to XXX.
- You can use more than one logtype, see commandref.html for more.
-- To show more than one plot on one page, convert them to weblink, and assign
- each weblink the same room. If a weblink is created for the CURRENT logfile,
- it will always use the CURRENT logfile.
-
-Password/HTTPS:
-===============
-- These features are implemented by apache, and apache must be configured to
- redirect the page to 01_FHEMWEB.pm. For this purpose add the following lines
- to your httpd.conf:
-
-
- AuthType Basic
- AuthName "Password Required"
- AuthUserFile /home/httpd/etc/passwd
- Require valid-user
- Allow from 127.0.0.1
-
- ProxyPass /fhem http://localhost:/fhem
- ProxyPassReverse /fhem http://localhost:/fhem
-
- and then restart httpd with apachectl graceful. To create the password file,
- execute htpasswd -c /home/httpd/etc/passwd
-
-- To enable HTTPS, please check the web.
- In essence:
- - Edit httpd.conf, add:
- LoadModule ssl_module lib/apache/mod_ssl.so
- Include /etc/httpd/conf/ssl.conf
- - Create a server certificate
- - Start httpd with the startssl option (SSL or the like must be set in one
- of your system files, look at /etc/init.d/httpd).