From 44b8321d1809cfba710d58a3ece8776ccf6bad5f Mon Sep 17 00:00:00 2001 From: Damian <> Date: Thu, 8 Apr 2021 14:44:48 +0000 Subject: [PATCH] 98_DOIF.pm: svg card: min, max, currend points git-svn-id: https://svn.fhem.de/fhem/trunk@24187 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_DOIF.pm | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/fhem/FHEM/98_DOIF.pm b/fhem/FHEM/98_DOIF.pm index a0cf6fe31..77360c925 100644 --- a/fhem/FHEM/98_DOIF.pm +++ b/fhem/FHEM/98_DOIF.pm @@ -1328,8 +1328,10 @@ sub collect_setValue my $diff_slots=1; my $maxVal; my $maxValTime; + my $maxValSlot; my $minVal; my $minValTime; + my $minValSlot; my $va=$hash->{collect}{"$name $reading"}{$hours}{values}; my $ta=$hash->{collect}{"$name $reading"}{$hours}{times}; @@ -1387,19 +1389,23 @@ sub collect_setValue if (!defined $maxVal or $value > $maxVal) { $maxVal=$value; $maxValTime=$time; + $maxValSlot=$i; } if (!defined $minVal or $value < $minVal) { $minVal=$value; $minValTime=$time; - + $minValSlot=$i; } } } $hash->{collect}{"$name $reading"}{$hours}{max_value}=$maxVal; $hash->{collect}{"$name $reading"}{$hours}{max_value_time}=$maxValTime; + $hash->{collect}{"$name $reading"}{$hours}{max_value_slot}=$maxValSlot; + $hash->{collect}{"$name $reading"}{$hours}{min_value}=$minVal; $hash->{collect}{"$name $reading"}{$hours}{min_value_time}=$minValTime; + $hash->{collect}{"$name $reading"}{$hours}{min_value_slot}=$minValSlot; } sub EvalAllDoIf($$) @@ -4456,8 +4462,11 @@ sub card my $a=@{$collect}{values}; my $maxVal = ${$collect}{max_value}; my $maxValTime = ${$collect}{max_value_time}; + my $maxValSlot = ${$collect}{max_value_slot}; + my $minVal = ${$collect}{min_value}; my $minValTime = ${$collect}{min_value_time}; + my $minValSlot = ${$collect}{min_value_slot}; my $hours = ${$collect}{hours}; my $time = ${$collect}{time}; @@ -4562,6 +4571,7 @@ sub card } $out.= sprintf('',$htrans); $out.=''; + $out.= ''; $out.= ''; my $points=""; my $first=1; @@ -4586,8 +4596,12 @@ sub card $out.=sprintf('',$xpos,$maxValColor,$minColor,(defined $lr ? $lr:0),$maxValColor,$minColor,(defined $lr ? $lr:0)); - + + $out.=sprintf('',$maxValSlot,(50-int((${$a}[$maxValSlot]*$m+$n)*10)/10),color($maxValColor,$ln)) if (defined $maxVal); + $out.=sprintf(',',$minValSlot,(50-int((${$a}[$minValSlot]*$m+$n)*10)/10),color($minValColor,$ln)) if (defined $minVal); + $out.=sprintf('',(50-int((${$a}[59]*$m+$n)*10)/10),color($currColor,$ln)); + $out.= sprintf('%s',color($maxColor,$lmm),"",$max); $out.= sprintf('%s',color($minColor,$lmm),"",$min); $out.= sprintf('%s',$xpos+3,color($nullColor,$lmm),"",0) if (defined $nullColor); @@ -4597,7 +4611,7 @@ sub card $out.=sprintf('%s',::strftime("%H:%M",localtime($time-$hours*1800))); $out.=sprintf('%s',::strftime("%H:%M",localtime($time))); $out.= ''; - + $out.= ''; if (defined $header or !defined $icon) { $out.=''; #$out.=''; $out.= ui_Table::ring($val,$min,$max,$minColor,$maxColor,$unit,100,$func,$decfont,$model,$lightness);