mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
98_SVG.pm: plotReplace changes (Forum #611802)
git-svn-id: https://svn.fhem.de/fhem/trunk@13822 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
657187bf94
commit
5f414d38cd
@ -761,9 +761,11 @@ SVG_readgplotfile($$$)
|
||||
my ($list, $pr) = parseParams($plotReplace) if($plotReplace);
|
||||
if($plotReplace) {
|
||||
for my $k (keys %$pr) {
|
||||
if($pr->{$k} =~ m/^{.*}$/) {
|
||||
if($k =~ m/^_/) {
|
||||
$cmdFromAnalyze = $pr->{$k};
|
||||
$pr->{$k} = eval $cmdFromAnalyze;
|
||||
} elsif($pr->{$k} =~ m/^{.*}$/) {
|
||||
delete $pr->{$k};
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -831,7 +833,6 @@ SVG_substcfg($$$$$$)
|
||||
my $fileesc = $file;
|
||||
$fileesc =~ s/\\/\\\\/g; # For Windows, by MarkusRR
|
||||
my $title = AttrVal($wl, "title", "\"$fileesc\"");
|
||||
|
||||
$title = AnalyzeCommand(undef, "{ $title }");
|
||||
my $label = AttrVal($wl, "label", undef);
|
||||
my @g_label;
|
||||
@ -861,6 +862,21 @@ SVG_substcfg($$$$$$)
|
||||
}
|
||||
}
|
||||
|
||||
my $plotReplace = AttrVal($wl, "plotReplace", undef);
|
||||
if($plotReplace) {
|
||||
my ($list, $pr) = parseParams($plotReplace);
|
||||
for my $k (keys %$pr) {
|
||||
if($k !~ m/^_/) {
|
||||
if($pr->{$k} =~ m/^{.*}$/) {
|
||||
$cmdFromAnalyze = $pr->{$k};
|
||||
$pr->{$k} = eval $cmdFromAnalyze;
|
||||
}
|
||||
$gplot_script =~ s/<$k>/$pr->{$k}/gs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$plot =~ s/\r//g; # For our windows friends...
|
||||
$gplot_script =~ s/\r//g;
|
||||
|
||||
@ -2515,7 +2531,13 @@ plotAsPng(@)
|
||||
space separated list of key=value pairs. value may contain spaces if
|
||||
enclosed in "" or {}. value will be evaluated, if it is enclosed in {}.
|
||||
In the .gplot file <key> is replaced with the corresponding value.
|
||||
Replaces the title, label and plotfunction attributes.
|
||||
<br>
|
||||
If the key starts with the _ character, <key> is replaced
|
||||
<i>before</i> the input is processed, so it can be used to modify the
|
||||
input processing parameters.<br> Else <key> is replaced
|
||||
<i>after</i> the input is processed, so $data{min1} etc can be used.
|
||||
plotReplace is the successor of the title, label and plotfunction
|
||||
attributes.
|
||||
</li><br>
|
||||
</ul>
|
||||
<br>
|
||||
@ -2739,8 +2761,14 @@ plotAsPng(@)
|
||||
perl-Ausdruck ausgewertet, falls es in {} eingeschlossen ist. In der
|
||||
.gplot Datei werden alle <Name> Zeichenketten durch den
|
||||
zugehoerigen Wert ersetzt.
|
||||
<br>
|
||||
Falls das erste Zeichen von Name _ ist, dann erfolgt die Ersetzung von
|
||||
<Name> <i>vor</i> der Erzeugung der Inputdaten (damit man die
|
||||
Parameter für die Erzeugung der Inputdaten bestimmen zu kann).
|
||||
Sonst erfolgt sie <i>danach</i>, z.Bsp. um die $data{min1},usw Werte
|
||||
verwenden zu können.
|
||||
</li><br>
|
||||
</ul>
|
||||
</ul>
|
||||
<br>
|
||||
|
||||
<a name="plotEditor"></a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user