From f93325c66ca16f954b731db3ea0257831d9c35d1 Mon Sep 17 00:00:00 2001
From: rudolfkoenig <>
Date: Sat, 7 Feb 2015 07:55:42 +0000
Subject: [PATCH] 98_SVG: fix warnings with non-existent .gplot file (Forum
#33412)
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@7899 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
FHEM/98_SVG.pm | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/FHEM/98_SVG.pm b/FHEM/98_SVG.pm
index 73f1d2fdb..fa88b3543 100755
--- a/FHEM/98_SVG.pm
+++ b/FHEM/98_SVG.pm
@@ -345,7 +345,6 @@ SVG_PEdit($$$$)
$ret .= "
| ";
}
- my $max = @{$conf{lType}}+1;
my ($desc, $cnt) = ("Spec", 0);
my (@srcHtml, @paramHtml, @exampleHtml, @revIdx);
my @srcNames = grep { $modules{$defs{$_}{TYPE}}{SVG_sampleDataFn} }
@@ -376,8 +375,9 @@ SVG_PEdit($$$$)
}
# Last, empty line
push @revIdx,int(@revIdx);
- push @srcHtml, $srcHtml[0];
- push @paramHtml, $paramHtml[0];
+ push @srcHtml, FW_select(undef,"src_".int(@srcHtml),\@srcNames,"","svgSrc");
+ push @paramHtml, (@paramHtml==0 ?
+ SVG_txt("par_0_0", "", "parameter", 10) : $paramHtml[0]);
push @exampleHtml, "Set the label and 'Write .gplot file' first in order to ".
"get example data and correct parameter choice";
@@ -394,6 +394,7 @@ SVG_PEdit($$$$)
my ($r, $example, @output) = (0, "");
+ my $max = int(@srcHtml);
for($r=0; $r < $max; $r++) {
my $idx = $revIdx[$r];
$example .= "'.
+ "missing data in logfile: won't write incomplete .gplot definition".
+ '
';
return 0;
}
@@ -569,7 +573,6 @@ SVG_WriteGplot($)
next if($i !~ m/^title_(.*)$/);
$maxLines = $1 if($1 > $maxLines);
}
- return 0 if(!$maxLines);
my $wlName = $FW_webArgs{detail};
my $fName = "$FW_gplotdir/$defs{$wlName}{GPLOTFILE}.gplot";
@@ -625,7 +628,7 @@ SVG_WriteGplot($)
}
my $err = FileWrite($fName, @rows);
- $FW_RET="SVG_WriteGplot: $err" if($err);
+ $FW_RET .= "SVG_WriteGplot: $err
" if($err);
return 0;
}