2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 23:09:26 +00:00

55_InfoPanel.pm: remove smartmatch issues

git-svn-id: https://svn.fhem.de/fhem/trunk@28755 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2024-04-05 10:57:20 +00:00
parent 8e3cce952b
commit 53b309137e

View File

@ -78,6 +78,8 @@
# #
# 2023-07-04 - 27724 - changed: minor bugfix for perl 5.36 # 2023-07-04 - 27724 - changed: minor bugfix for perl 5.36
# #
# 2024-04-05 - changed: remove smartmatch issues
#
############################################## ##############################################
=cut =cut
@ -87,7 +89,7 @@ use warnings;
#use Data::Dumper; #use Data::Dumper;
use feature qw/switch/; #use feature qw/switch/;
use vars qw(%data); use vars qw(%data);
use HttpUtils; use HttpUtils;
@ -96,7 +98,7 @@ my @valid_halign = qw(start middle end);
my $useImgTools = 1; my $useImgTools = 1;
no if $] >= 5.017011, warnings => 'experimental'; #no if $] >= 5.017011, warnings => 'experimental';
sub btIP_Define; sub btIP_Define;
sub btIP_Undef; sub btIP_Undef;
@ -211,28 +213,22 @@ sub btIP_Set {
my $usage= "Unknown argument, choose one of reread:noArg ovClear ovEnable ovDisable"; my $usage= "Unknown argument, choose one of reread:noArg ovClear ovEnable ovDisable";
my $ret = undef; my $ret = undef;
my $cmd = $a[1];
given ($a[1]) { if ($cmd eq "ovClear") {
if ($a[2] eq "all") {
when ("ovClear") { delete $defs{$name}{fhem}{override};
if ($a[2] eq "all") { } else {
delete $defs{$name}{fhem}{override}; delete $defs{$name}{fhem}{override}{$a[2]};
} else { }
delete $defs{$name}{fhem}{override}{$a[2]}; } elsif ($cmd eq "ovDisable") {
} $defs{$name}{fhem}{override}{$a[2]} = 0;
} } elsif ($cmd eq "ovEnable") {
when ("ovDisable") { $defs{$name}{fhem}{override}{$a[2]} = 1;
$defs{$name}{fhem}{override}{$a[2]} = 0; } elsif ($cmd eq "reread") {
} btIP_readLayout($hash);
when ("ovEnable") { } else {
$defs{$name}{fhem}{override}{$a[2]} = 1; $ret = $usage;
}
when ("reread") {
btIP_readLayout($hash);
}
default {
$ret = $usage;
}
} }
return $ret; return $ret;
} }
@ -244,24 +240,20 @@ sub btIP_Get {
my $usage= "Unknown argument, choose one of reread:noArg counter:noArg layout:noArg overrides:noArg"; my $usage= "Unknown argument, choose one of reread:noArg counter:noArg layout:noArg overrides:noArg";
my $ret = undef; my $ret = undef;
my $cmd = $a[1];
given ($a[1]) { if ($cmd eq "counter") {
when ("counter") { $ret = $defs{$name}{fhem}{counter};
$ret = $defs{$name}{fhem}{counter}; } elsif ($cmd eq "layout") {
} $ret = $defs{$name}{fhem}{layout};
when ("layout") { } elsif ($cmd eq "overrides") {
$ret = $defs{$name}{fhem}{layout}; last if(!defined($defs{$name}{fhem}{override}));
} foreach my $key ( keys %{$defs{$name}{fhem}{override}} ) {
when ("overrides") { $ret .= "$key => $defs{$name}{fhem}{override}{$key} \n";
last if(!defined($defs{$name}{fhem}{override})); }
foreach my $key ( keys %{$defs{$name}{fhem}{override}} ) { } else {
$ret .= "$key => $defs{$name}{fhem}{override}{$key} \n"; $ret = $usage;
} }
}
default {
$ret = $usage;
}
}
return $ret; return $ret;
} }
@ -1018,44 +1010,34 @@ sub btIP_evalLayout {
# Debug "before command $line: x= " . $params{xx} . ", y= " . $params{yy}; # Debug "before command $line: x= " . $params{xx} . ", y= " . $params{yy};
eval { eval {
given($cmd) { if ($cmd eq "area") {
when("area") {
($id,$x1,$y1,$x2,$y2,$link,$target)= split("[ \t]+", $def, 7); ($id,$x1,$y1,$x2,$y2,$link,$target)= split("[ \t]+", $def, 7);
$target //= ""; $target //= "";
($x1,$y1)= btIP_xy($x1,$y1,%params); ($x1,$y1)= btIP_xy($x1,$y1,%params);
($x2,$y2)= btIP_xy($x2,$y2,%params); ($x2,$y2)= btIP_xy($x2,$y2,%params);
$link = AnalyzePerlCommand(undef,$link); $link = AnalyzePerlCommand(undef,$link);
$params{xx} = $x1; $params{xx} = $x1;
$params{yy} = $y2; $params{yy} = $y2;
$svg .= btIP_itemArea($id,$x1,$y1,$x2,$y2,$link,$target,%params); $svg .= btIP_itemArea($id,$x1,$y1,$x2,$y2,$link,$target,%params);
} } elsif ($cmd eq "boxcolor") {
when("boxcolor"){
$def = "\"$def\"" if(length($def) == 6 && $def =~ /[[:xdigit:]]{6}/); $def = "\"$def\"" if(length($def) == 6 && $def =~ /[[:xdigit:]]{6}/);
$params{boxcolor} = AnalyzePerlCommand(undef, $def); $params{boxcolor} = AnalyzePerlCommand(undef, $def);
} } elsif ($cmd eq "button") {
when("button") {
($id,$x1,$y1,$x2,$y2,$rx,$ry,$link,$text)= split("[ \t]+", $def, 9); ($id,$x1,$y1,$x2,$y2,$rx,$ry,$link,$text)= split("[ \t]+", $def, 9);
($x1,$y1)= btIP_xy($x1,$y1,%params); ($x1,$y1)= btIP_xy($x1,$y1,%params);
($x2,$y2)= btIP_xy($x2,$y2,%params); ($x2,$y2)= btIP_xy($x2,$y2,%params);
($rx,$ry)= btIP_xy($rx,$ry,%params); ($rx,$ry)= btIP_xy($rx,$ry,%params);
$params{xx} = $x1; $params{xx} = $x1;
$params{yy} = $y2; $params{yy} = $y2;
$link = AnalyzePerlCommand(undef,$link); $link = AnalyzePerlCommand(undef,$link);
$link = (length($link)) ? $link : "-$params{name}.html"; $link = (length($link)) ? $link : "-$params{name}.html";
$text = AnalyzePerlCommand(undef,$text); $text = AnalyzePerlCommand(undef,$text);
$svg .= btIP_itemButton($id,$x1,$y1,$x2,$y2,$rx,$ry,$link,$text,%params); $svg .= btIP_itemButton($id,$x1,$y1,$x2,$y2,$rx,$ry,$link,$text,%params);
} } elsif ($cmd eq "buttonpanel") {
$defs{$params{name}}{fhem}{div} .= "<div id=\"hiddenDiv\" ".
when("buttonpanel"){ "style=\"display:none\" >".
$defs{$params{name}}{fhem}{div} .= "<div id=\"hiddenDiv\" ". "<iframe id=\"secretFrame\" name=\"secret\" src=\"\"></iframe></div>\n";
"style=\"display:none\" >". } elsif ($cmd eq "circle") {
"<iframe id=\"secretFrame\" name=\"secret\" src=\"\"></iframe></div>\n";
}
when("circle") {
($id,$x1,$y1,$radius,$filled,$stroked,$link)= split("[ \t]+", $def, 7); ($id,$x1,$y1,$radius,$filled,$stroked,$link)= split("[ \t]+", $def, 7);
($x1,$y1)= btIP_xy($x1,$y1,%params); ($x1,$y1)= btIP_xy($x1,$y1,%params);
$params{xx} = $x1; $params{xx} = $x1;
@ -1063,27 +1045,21 @@ sub btIP_evalLayout {
$filled //= 0; $filled //= 0;
$stroked //= 0; $stroked //= 0;
$link //= ""; $link //= "";
$link = AnalyzePerlCommand(undef,$link); $link = AnalyzePerlCommand(undef,$link);
$svg .= btIP_itemCircle($id,$x1,$y1,$radius,$filled,$stroked,$link,%params); $svg .= btIP_itemCircle($id,$x1,$y1,$radius,$filled,$stroked,$link,%params);
} } elsif ($cmd eq "counter") {
when("counter") {
($id,$x,$y)= split("[ \t]+", $def, 3); ($id,$x,$y)= split("[ \t]+", $def, 3);
($x,$y)= btIP_xy($x,$y,%params); ($x,$y)= btIP_xy($x,$y,%params);
$params{xx} = $x; $params{xx} = $x;
$params{yy} = $y; $params{yy} = $y;
$svg .= btIP_itemCounter($id,$x,$y,%params); $svg .= btIP_itemCounter($id,$x,$y,%params);
} } elsif ($cmd eq "date") {
when("date") {
($id,$x,$y)= split("[ \t]+", $def, 3); ($id,$x,$y)= split("[ \t]+", $def, 3);
($x,$y)= btIP_xy($x,$y,%params); ($x,$y)= btIP_xy($x,$y,%params);
$params{xx} = $x; $params{xx} = $x;
$params{yy} = $y; $params{yy} = $y;
$svg .= btIP_itemDate($id,$x,$y,%params); $svg .= btIP_itemDate($id,$x,$y,%params);
} } "ellipse") {
when("ellipse") {
($id,$x1,$y1,$rx,$ry,$filled,$stroked,$link)= split("[ \t]+", $def, 8); ($id,$x1,$y1,$rx,$ry,$filled,$stroked,$link)= split("[ \t]+", $def, 8);
($x1,$y1) = btIP_xy($x1,$y1,%params); ($x1,$y1) = btIP_xy($x1,$y1,%params);
($rx,$ry) = btIP_xy($rx,$ry,%params); ($rx,$ry) = btIP_xy($rx,$ry,%params);
@ -1094,257 +1070,190 @@ sub btIP_evalLayout {
$link //= ""; $link //= "";
$link = AnalyzePerlCommand(undef,$link); $link = AnalyzePerlCommand(undef,$link);
$svg .= btIP_itemEllipse($id,$x1,$y1,$rx,$ry,$filled,$stroked,$link,%params); $svg .= btIP_itemEllipse($id,$x1,$y1,$rx,$ry,$filled,$stroked,$link,%params);
} } "embed") {
when("embed") {
($id,$x,$y,$width,$height,$arg)= split("[ \t]+", $def, 6); ($id,$x,$y,$width,$height,$arg)= split("[ \t]+", $def, 6);
($x,$y)= btIP_xy($x,$y,%params); ($x,$y)= btIP_xy($x,$y,%params);
($width,$height)= btIP_xy($width,$height,%params); ($width,$height)= btIP_xy($width,$height,%params);
$params{xx} = $x; $params{xx} = $x;
$params{yy} = $y; $params{yy} = $y;
$arg = AnalyzePerlCommand(undef,$arg); $arg = AnalyzePerlCommand(undef,$arg);
$defs{$name}{fhem}{div} .= btIP_itemEmbed($id,$x,$y,$width,$height,$arg,%params); $defs{$name}{fhem}{div} .= btIP_itemEmbed($id,$x,$y,$width,$height,$arg,%params);
} } elsif ($cmd eq "font") {
when("font") {
$params{font} = $def; $params{font} = $def;
} } elsif ($cmd eq "group") {
when("group") {
($id,$text,$x,$y) = split("[ \t]+", $def, 4); ($id,$text,$x,$y) = split("[ \t]+", $def, 4);
$x //= $params{xx}; $x //= $params{xx};
$y //= $params{yy}; $y //= $params{yy};
($x,$y)= btIP_xy($x,$y,%params); ($x,$y)= btIP_xy($x,$y,%params);
$params{xx} = $x; $params{xx} = $x;
$params{yy} = $y; $params{yy} = $y;
if($text eq 'open') { if($text eq 'open') {
$params{groupx} = $x; $params{groupx} = $x;
$params{groupy} = $y; $params{groupy} = $y;
} else { } else {
$params{groupx} = 0; $params{groupx} = 0;
$params{groupy} = 0; $params{groupy} = 0;
}
$svg .= btIP_itemGroup($id,$text,$x,$y,%params);
} }
$svg .= btIP_itemGroup($id,$text,$x,$y,%params);
when("img") { } elsif ($cmd eq "img") {
($id,$x,$y,$scale,$link,$srctype,$arg) = split("[ \t]+", $def,7); ($id,$x,$y,$scale,$link,$srctype,$arg) = split("[ \t]+", $def,7);
($x,$y) = btIP_xy($x,$y,%params); ($x,$y) = btIP_xy($x,$y,%params);
$params{xx} = $x; $params{xx} = $x;
$params{yy} = $y; $params{yy} = $y;
$arg = AnalyzePerlCommand(undef,$arg); $arg = AnalyzePerlCommand(undef,$arg);
$link = AnalyzePerlCommand(undef,$link); $link = AnalyzePerlCommand(undef,$link);
my($output,$width,$height)= btIP_itemImg($id,$x,$y,$scale,$link,$srctype,$arg,%params); my($output,$width,$height)= btIP_itemImg($id,$x,$y,$scale,$link,$srctype,$arg,%params);
$svg .= $output; $svg .= $output;
$params{xx} = $x; $params{xx} = $x;
$params{yy} = $y+$height; $params{yy} = $y+$height;
} } elsif ($cmd eq "line") {
when("line") {
($id,$x1,$y1,$x2,$y2,$format) = split("[ \t]+", $def, 6); ($id,$x1,$y1,$x2,$y2,$format) = split("[ \t]+", $def, 6);
($x1,$y1) = btIP_xy($x1,$y1,%params); ($x1,$y1) = btIP_xy($x1,$y1,%params);
($x2,$y2) = btIP_xy($x2,$y2,%params); ($x2,$y2) = btIP_xy($x2,$y2,%params);
$format //= 1; $format //= 1;
$svg .= btIP_itemLine($id,$x1,$y1,$x2,$y2,$format,%params); $svg .= btIP_itemLine($id,$x1,$y1,$x2,$y2,$format,%params);
} } elsif ($cmd eq "longpoll") {
($id,$x,$y,$text)= split("[ \t]+", $def, 4);
when("longpoll") { $text //= undef;
($id,$x,$y,$text)= split("[ \t]+", $def, 4); $text = AnalyzePerlCommand(undef,$text) if defined($text);
$text //= undef;
$text = AnalyzePerlCommand(undef,$text) if defined($text);
($x,$y)= btIP_xy($x,$y,%params); ($x,$y)= btIP_xy($x,$y,%params);
$x += $params{groupx}; $x += $params{groupx};
$y += $params{groupy}; $y += $params{groupy};
$params{xx} = $x; $params{xx} = $x;
$params{yy} = $y; $params{yy} = $y;
$svg .= btIP_itemLongpoll($id,$x,$y,$text,%params); $svg .= btIP_itemLongpoll($id,$x,$y,$text,%params);
} } elsif ($cmd eq "movecalculated") {
my ($tox,$toy)= split('[ \t]+', $def, 2);
when("movecalculated") { $params{xx} = AnalyzePerlCommand(undef,$tox);
my ($tox,$toy)= split('[ \t]+', $def, 2); $params{yy} = AnalyzePerlCommand(undef,$toy);
$params{xx} = AnalyzePerlCommand(undef,$tox); } elsif ($cmd eq "moveby") {
$params{yy} = AnalyzePerlCommand(undef,$toy); my ($byx,$byy) = split('[ \t]+', $def, 2);
} my ($x,$y)= btIP_xy($byx,$byy,%params);
$params{xx} += $x;
when("moveby") { $params{yy} += $y;
my ($byx,$byy) = split('[ \t]+', $def, 2); } elsif ($cmd eq "moveto") {
my ($x,$y)= btIP_xy($byx,$byy,%params); my ($tox,$toy)= split('[ \t]+', $def, 2);
$params{xx} += $x; my ($x,$y)= btIP_xy($tox,$toy,%params);
$params{yy} += $y; $params{xx} = $x;
} $params{yy} = $y;
} elsif ($cmd eq "padding") {
when("moveto") { $params{padding}= AnalyzePerlCommand(undef,$def);
my ($tox,$toy)= split('[ \t]+', $def, 2); } elsif ($cmd eq "plain") {
my ($x,$y)= btIP_xy($tox,$toy,%params); $svg .= AnalyzePerlCommand(undef,$def);
$params{xx} = $x; } elsif ($cmd eq "plot") {
$params{yy} = $y;
}
when("padding") {
$params{padding}= AnalyzePerlCommand(undef,$def);
}
when("plain") {
$svg .= AnalyzePerlCommand(undef,$def);
}
when("plot") {
($id,$x,$y,$scale,$inline,$arg)= split("[ \t]+", $def,6); ($id,$x,$y,$scale,$inline,$arg)= split("[ \t]+", $def,6);
($x,$y)= btIP_xy($x,$y,%params); ($x,$y)= btIP_xy($x,$y,%params);
$arg = AnalyzePerlCommand(undef, $arg); $arg = AnalyzePerlCommand(undef, $arg);
my($output,$width,$height)= btIP_itemPlot($id,$x,$y,$scale,$inline,$arg,%params); my($output,$width,$height)= btIP_itemPlot($id,$x,$y,$scale,$inline,$arg,%params);
$svg .= $output; $svg .= $output;
$params{xx} = $x; $params{xx} = $x;
$params{yy} = $y+$height; $params{yy} = $y+$height;
} } elsif ($cmd eq "pop") {
return unless $pstackcount;
when("pop") { foreach my $key ( keys %{$pstack{$pstackcount}} ) {
return unless $pstackcount; # Debug "pop key: $key, value: $pstack{$pstackcount}{$key}";
foreach my $key ( keys %{$pstack{$pstackcount}} ) { $params{$key} = $pstack{$pstackcount}{$key};
# Debug "pop key: $key, value: $pstack{$pstackcount}{$key}";
$params{$key} = $pstack{$pstackcount}{$key};
}
delete $pstack{$pstackcount};
$pstackcount--;
} }
delete $pstack{$pstackcount};
when("pt") { $pstackcount--;
$def = AnalyzePerlCommand(undef, $def); } elsif ($cmd eq "pt") {
$def = AnalyzePerlCommand(undef, $def);
if($def =~ m/^[+-]/) { if($def =~ m/^[+-]/) {
$params{pt} += $def; $params{pt} += $def;
} else { } else {
$params{pt} = $def; $params{pt} = $def;
} }
$params{pt} = 6 if($params{pt} < 0); $params{pt} = 6 if($params{pt} < 0);
} elsif ($cmd eq "push") {
$pstackcount++;
foreach my $key ( keys %params ) {
# Debug "push key: $key, value: $params{$key}";
$pstack{$pstackcount}{$key} = $params{$key};
} }
} elsif ($cmd eq "rect") {
when("push") {
$pstackcount++;
foreach my $key ( keys %params ) {
# Debug "push key: $key, value: $params{$key}";
$pstack{$pstackcount}{$key} = $params{$key};
}
}
when("rect") {
($id,$x1,$y1,$x2,$y2,$rx,$ry,$filled,$stroked,$link)= split("[ \t]+", $def, 10); ($id,$x1,$y1,$x2,$y2,$rx,$ry,$filled,$stroked,$link)= split("[ \t]+", $def, 10);
($x1,$y1)= btIP_xy($x1,$y1,%params); ($x1,$y1)= btIP_xy($x1,$y1,%params);
($x2,$y2)= btIP_xy($x2,$y2,%params); ($x2,$y2)= btIP_xy($x2,$y2,%params);
($rx,$ry) = btIP_xy($rx,$ry,%params); ($rx,$ry) = btIP_xy($rx,$ry,%params);
$params{xx} = $x1; $params{xx} = $x1;
$params{yy} = $y2; $params{yy} = $y2;
$filled //= 0; # set 0 as default (not filled) $filled //= 0; # set 0 as default (not filled)
$stroked //= 0; # set 0 as default (not stroked) $stroked //= 0; # set 0 as default (not stroked)
$link //= ""; $link //= "";
$link = AnalyzePerlCommand(undef,$link); $link = AnalyzePerlCommand(undef,$link);
$svg .= btIP_itemRect($id,$x1,$y1,$x2,$y2,$rx,$ry,$filled,$stroked,$link,undef,%params); $svg .= btIP_itemRect($id,$x1,$y1,$x2,$y2,$rx,$ry,$filled,$stroked,$link,undef,%params);
} } elsif ($cmd eq "rgb") {
when("rgb"){
$def = "\"$def\"" if(length($def) == 6 && $def =~ /[[:xdigit:]]{6}/); $def = "\"$def\"" if(length($def) == 6 && $def =~ /[[:xdigit:]]{6}/);
$params{rgb} = AnalyzePerlCommand(undef, $def); $params{rgb} = AnalyzePerlCommand(undef, $def);
} } elsif ($cmd eq "seconds") {
($id,$x,$y,$format) = split("[ \+]", $def,4);
when("seconds") { ($x,$y)= btIP_xy($x,$y,%params);
($id,$x,$y,$format) = split("[ \+]", $def,4); $params{xx} = $x;
($x,$y)= btIP_xy($x,$y,%params); $params{yy} = $y;
$params{xx} = $x; $svg .= btIP_itemSeconds($id,$x,$y,$format,%params);
$params{yy} = $y; } elsif ($cmd eq "text") {
$svg .= btIP_itemSeconds($id,$x,$y,$format,%params); ($id,$x,$y,$text)= split("[ \t]+", $def, 4);
}
when("text") {
($id,$x,$y,$text)= split("[ \t]+", $def, 4);
($x,$y)= btIP_xy($x,$y,%params); ($x,$y)= btIP_xy($x,$y,%params);
$params{xx} = $x; $params{xx} = $x;
$params{yy} = $y; $params{yy} = $y;
$text= AnalyzePerlCommand(undef, $text); $text= AnalyzePerlCommand(undef, $text);
$svg .= btIP_itemText($id,$x,$y,$text,%params); $svg .= btIP_itemText($id,$x,$y,$text,%params);
} } elsif ($cmd eq "textbox") {
($id,$x,$y,$boxwidth,$boxheight,$link,$text)= split("[ \t]+", $def, 7);
when("lptext") {
$svg .= "\n<!-- lptext no longer provided. Use longpoll instead. -->\n\n";
Log3($name, 2, "InfoPanel $name: command 'lptext' no longer supported.");
}
when("textbox") {
($id,$x,$y,$boxwidth,$boxheight,$link,$text)= split("[ \t]+", $def, 7);
($x,$y)= btIP_xy($x,$y,%params); ($x,$y)= btIP_xy($x,$y,%params);
$text = AnalyzePerlCommand(undef, $text); $text = AnalyzePerlCommand(undef, $text);
$text =~ s/\n/<br\/>/g; $text =~ s/\n/<br\/>/g;
$link = AnalyzePerlCommand(undef, $link); $link = AnalyzePerlCommand(undef, $link);
$svg .= btIP_itemTextBox($id,$x,$y,$boxwidth,$boxheight,$text,$link,%params); $svg .= btIP_itemTextBox($id,$x,$y,$boxwidth,$boxheight,$text,$link,%params);
$params{xx} = $x; $params{xx} = $x;
$params{yy} = $y + $boxheight; $params{yy} = $y + $boxheight;
} } elsif ($cmd eq "textboxalign") {
$params{tbalign} = $def;
when("textboxalign") { } elsif ($cmd eq "textdesign") {
$params{tbalign} = $def; my @args = split(/,/,$def);
} my @deco = qw(underline overline line-through); #text-decoration
my @style = qw(italic oblique); #font-style
when("textdesign") { my @weight = qw(bold); #font-weight
my @args = split(/,/,$def); $params{fontstyle} = "initial";
my @deco = qw(underline overline line-through); #text-decoration $params{fontweight} = "initial";
my @style = qw(italic oblique); #font-style $params{textdecoration} = "none";
my @weight = qw(bold); #font-weight foreach my $s (@args) {
$params{fontstyle} = "initial"; if($s ne 'clear') {
$params{fontweight} = "initial"; $params{fontstyle} = "$s " if($s ~~ @style);
$params{textdecoration} = "none"; $params{fontweight} = "$s " if($s ~~ @weight);
$params{textdecoration} = "$s " if($s ~~ @deco);
foreach my $s (@args) {
if($s ne 'clear') {
$params{fontstyle} = "$s " if($s ~~ @style);
$params{fontweight} = "$s " if($s ~~ @weight);
$params{textdecoration} = "$s " if($s ~~ @deco);
}
} }
} }
} elsif ($cmd eq "ticker") {
when("ticker") {
($id,$x,$y,$width,$format,$speed,$arg)= split("[ \t]+", $def, 7); ($id,$x,$y,$width,$format,$speed,$arg)= split("[ \t]+", $def, 7);
($x,$y)= btIP_xy($x,$y,%params); ($x,$y)= btIP_xy($x,$y,%params);
$params{xx} = $x; $params{xx} = $x;
$params{yy} = $y; $params{yy} = $y;
$arg = AnalyzePerlCommand(undef,$arg); $arg = AnalyzePerlCommand(undef,$arg);
$defs{$name}{fhem}{div} .= btIP_itemTicker($id,$x,$y,$width,$format,$speed,$arg,%params); $defs{$name}{fhem}{div} .= btIP_itemTicker($id,$x,$y,$width,$format,$speed,$arg,%params);
} } elsif ($cmd eq "time") {
when("time") {
($id,$x,$y)= split("[ \t]+", $def, 3); ($id,$x,$y)= split("[ \t]+", $def, 3);
($x,$y)= btIP_xy($x,$y,%params); ($x,$y)= btIP_xy($x,$y,%params);
$params{xx} = $x; $params{xx} = $x;
$params{yy} = $y; $params{yy} = $y;
$svg .= btIP_itemTime($id,$x,$y,%params); $svg .= btIP_itemTime($id,$x,$y,%params);
} } elsif ($cmd eq "thalign"){
my $d = AnalyzePerlCommand(undef, $def);
when("trash") { if($d ~~ @valid_halign) {
$svg .= "\n<!-- Trashcan no longer provided by module due to perfomance issues. -->\n\n"; $params{thalign}= $d;
Log3($name, 2, "InfoPanel $name: command 'trash' no longer supported."); } else {
} Log3($name, 2, "InfoPanel $name: Illegal horizontal alignment $d");
when("thalign"){
my $d = AnalyzePerlCommand(undef, $def);
if($d ~~ @valid_halign) {
$params{thalign}= $d;
} else {
Log3($name, 2, "InfoPanel $name: Illegal horizontal alignment $d");
}
} }
} elsif ($cmd eq "tvalign"){
when("tvalign"){ my $d = AnalyzePerlCommand(undef, $def);
my $d = AnalyzePerlCommand(undef, $def); if($d ~~ @valid_valign) {
if($d ~~ @valid_valign) { $params{tvalign}= $d;
$params{tvalign}= $d; } else {
} else { Log3($name, 2, "InfoPanel $name: Illegal vertical alignment $d");
Log3($name, 2, "InfoPanel $name: Illegal vertical alignment $d");
}
} }
} else {
default { Log3($name, 2, "InfoPanel $name: Illegal command $cmd in layout definition.");
Log3($name, 2, "InfoPanel $name: Illegal command $cmd in layout definition."); }
} # default
} # given
} # eval } # eval
#Debug "after command $line: x= " . $params{xx} . ", y= " . $params{yy}; #Debug "after command $line: x= " . $params{xx} . ", y= " . $params{yy};