mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
98_SVG.pm/92_FileLog.pm: add SVG_regexpFn function (Forum #40176)
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@9107 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
1c294257de
commit
97a85113a7
@ -43,6 +43,7 @@ FileLog_Initialize($)
|
|||||||
$hash->{FW_summaryFn} = "FileLog_fhemwebFn";
|
$hash->{FW_summaryFn} = "FileLog_fhemwebFn";
|
||||||
$hash->{FW_detailFn} = "FileLog_fhemwebFn";
|
$hash->{FW_detailFn} = "FileLog_fhemwebFn";
|
||||||
$hash->{SVG_sampleDataFn} = "FileLog_sampleDataFn";
|
$hash->{SVG_sampleDataFn} = "FileLog_sampleDataFn";
|
||||||
|
$hash->{SVG_regexpFn} = "FileLog_regexpFn";
|
||||||
$data{FWEXT}{"/FileLog_toSVG"}{CONTENTFUNC} = "FileLog_toSVG";
|
$data{FWEXT}{"/FileLog_toSVG"}{CONTENTFUNC} = "FileLog_toSVG";
|
||||||
$data{FWEXT}{"/FileLog_logWrapper"}{CONTENTFUNC} = "FileLog_logWrapper";
|
$data{FWEXT}{"/FileLog_logWrapper"}{CONTENTFUNC} = "FileLog_logWrapper";
|
||||||
|
|
||||||
@ -989,6 +990,18 @@ FileLog_sampleDataFn($$$$$)
|
|||||||
return ($desc, \@htmlArr, $example);
|
return ($desc, \@htmlArr, $example);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub
|
||||||
|
FileLog_regexpFn($$)
|
||||||
|
{
|
||||||
|
my ($name, $filter) = @_;
|
||||||
|
$filter = " $filter ";
|
||||||
|
$filter =~ s/ [^: ]*:/ /g;
|
||||||
|
$filter =~ s/:[^ ]* / /g;
|
||||||
|
$filter =~ s/(^ | $)//g;
|
||||||
|
$filter =~ s/ /|/g;
|
||||||
|
return $filter;
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
=pod
|
=pod
|
||||||
|
@ -1285,11 +1285,12 @@ SVG_render($$$$$$$$$$)
|
|||||||
my $w = $ow-$nr_left_axis*$axis_width-$nr_right_axis*$axis_width;
|
my $w = $ow-$nr_left_axis*$axis_width-$nr_right_axis*$axis_width;
|
||||||
my $h = $oh-2*$y; # Rect size
|
my $h = $oh-2*$y; # Rect size
|
||||||
|
|
||||||
my $filter = $srcDesc->{all}." ";
|
my @filter;
|
||||||
$filter =~ s/ [^: ]*:/ /g;
|
foreach my $src (keys $srcDesc->{src}) {
|
||||||
$filter =~ s/:[^ ]* / /g;
|
my $f = CallFn($src, "SVG_regexpFn", $src, $srcDesc->{src}{$src}{arg});
|
||||||
$filter =~ s/(^ | $)//g;
|
push(@filter, $f) if($f);
|
||||||
$filter =~ s/ /|/g;
|
}
|
||||||
|
my $filter = join("|", @filter);
|
||||||
$filter =~ s/"/./g;
|
$filter =~ s/"/./g;
|
||||||
$filter = AttrVal($parent_name, "longpollSVG", 0) ? "flog=\"$filter\"" : "";
|
$filter = AttrVal($parent_name, "longpollSVG", 0) ? "flog=\"$filter\"" : "";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user