mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-30 12:07:09 +00:00
98_DOIF.pm: now dot allowed in doif block name, fixed min,max in card bar decade
git-svn-id: https://svn.fhem.de/fhem/trunk@27190 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
8eec0b7efc
commit
c83d5bf983
@ -1704,11 +1704,11 @@ sub DOIF_statistic_bar
|
|||||||
if (defined $value and ($numOrig != 1 or (int($i/$dim) == 0 or $i % $dim > $period1 or $i % $dim == $period1 and !defined ${$va}[$period1]))) {
|
if (defined $value and ($numOrig != 1 or (int($i/$dim) == 0 or $i % $dim > $period1 or $i % $dim == $period1 and !defined ${$va}[$period1]))) {
|
||||||
$numb++;
|
$numb++;
|
||||||
$sum+=$value;
|
$sum+=$value;
|
||||||
if (!defined $maxVal or $value >= $maxVal) {
|
if (!defined $maxVal or $value > $maxVal) {
|
||||||
$maxVal=$value;
|
$maxVal=$value;
|
||||||
$maxValSlot=$i;
|
$maxValSlot=$i;
|
||||||
}
|
}
|
||||||
if (!defined $minVal or $value <= $minVal) {
|
if (!defined $minVal or $value < $minVal) {
|
||||||
$minVal=$value;
|
$minVal=$value;
|
||||||
$minValSlot=$i;
|
$minValSlot=$i;
|
||||||
}
|
}
|
||||||
@ -1721,8 +1721,8 @@ sub DOIF_statistic_bar
|
|||||||
${$bar}{min_value_slot}=$minValSlot;
|
${$bar}{min_value_slot}=$minValSlot;
|
||||||
${$bar}{average_value}=$sum/$numb;
|
${$bar}{average_value}=$sum/$numb;
|
||||||
if (${$bar}{period} eq "decade") {
|
if (${$bar}{period} eq "decade") {
|
||||||
${$bar}{max_value_time}=((${$bar}{last_period2}-int($maxValSlot/$dim))*10+$maxValSlot);
|
${$bar}{max_value_time}=((${$bar}{last_period2}-int($maxValSlot/$dim))*10+($maxValSlot % $dim));
|
||||||
${$bar}{min_value_time}=((${$bar}{last_period2}-int($minValSlot/$dim))*10+$minValSlot);
|
${$bar}{min_value_time}=((${$bar}{last_period2}-int($minValSlot/$dim))*10+($minValSlot % $dim));
|
||||||
} elsif (${$bar}{period} eq "year") {
|
} elsif (${$bar}{period} eq "year") {
|
||||||
${$bar}{max_value_time}=qw(Jan Feb Mär Apr Mai Jun Jul Aug Sep Okt Nov Dez)[$maxValSlot % $dim]." ".(($period2-int($maxValSlot/$dim)) % 100);
|
${$bar}{max_value_time}=qw(Jan Feb Mär Apr Mai Jun Jul Aug Sep Okt Nov Dez)[$maxValSlot % $dim]." ".(($period2-int($maxValSlot/$dim)) % 100);
|
||||||
${$bar}{min_value_time}=qw(Jan Feb Mär Apr Mai Jun Jul Aug Sep Okt Nov Dez)[$minValSlot % $dim]." ".(($period2-int($minValSlot/$dim)) % 100);
|
${$bar}{min_value_time}=qw(Jan Feb Mär Apr Mai Jun Jul Aug Sep Okt Nov Dez)[$minValSlot % $dim]." ".(($period2-int($minValSlot/$dim)) % 100);
|
||||||
@ -3920,7 +3920,7 @@ sub DOIF_Perlblock
|
|||||||
my ($hash,$table,$tail,$subs) =@_;
|
my ($hash,$table,$tail,$subs) =@_;
|
||||||
my ($beginning,$perlblock,$err,$i);
|
my ($beginning,$perlblock,$err,$i);
|
||||||
$i=0;
|
$i=0;
|
||||||
while($tail =~ /(?:^|\n)\s*(\w*)\s*\{/g) {
|
while($tail =~ /(?:^|\n)\s*([\w\.]*)\s*\{/g) {
|
||||||
my $blockname=$1;
|
my $blockname=$1;
|
||||||
($beginning,$perlblock,$err,$tail)=GetBlockDoIf($tail,'[\{\}]');
|
($beginning,$perlblock,$err,$tail)=GetBlockDoIf($tail,'[\{\}]');
|
||||||
if ($err) {
|
if ($err) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user