mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-04 05:16:45 +00:00
98_DOIF.pm: card: $noColor parameter
git-svn-id: https://svn.fhem.de/fhem/trunk@24462 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2093e9c2a7
commit
a8a48134e2
@ -4484,14 +4484,14 @@ sub format_value {
|
|||||||
if ($val eq "") {
|
if ($val eq "") {
|
||||||
$val="N/A";
|
$val="N/A";
|
||||||
$format='%s';
|
$format='%s';
|
||||||
$value=0;
|
$value=$min;
|
||||||
} elsif ($val =~ /(-?\d+(\.\d+)?)/) {
|
} elsif ($val =~ /(-?\d+(\.\d+)?)/) {
|
||||||
$format='%1.'.$dec.'f';
|
$format='%1.'.$dec.'f';
|
||||||
$value=$1;
|
$value=$1;
|
||||||
$val=$value;
|
$val=$value;
|
||||||
} else {
|
} else {
|
||||||
$format='%s';
|
$format='%s';
|
||||||
$value=0;
|
$value=$min;
|
||||||
}
|
}
|
||||||
return($format,$value,$val);
|
return($format,$value,$val);
|
||||||
}
|
}
|
||||||
@ -4553,12 +4553,12 @@ sub card
|
|||||||
my $out;
|
my $out;
|
||||||
my ($ic,$iscale,$ix,$iy,$rotate);
|
my ($ic,$iscale,$ix,$iy,$rotate);
|
||||||
|
|
||||||
my ($size,$plot,$steps,$noFooter);
|
my ($size,$plot,$steps,$noFooter,$noColor);
|
||||||
($size,$plot,$steps,$noFooter)=split (/,/,$prop) if (defined $prop);
|
($size,$plot,$steps,$noFooter,$noColor)=split (/,/,$prop) if (defined $prop);
|
||||||
$plot = "" if (!defined $plot);
|
$plot = "" if (!defined $plot);
|
||||||
$steps = "" if (!defined $steps);
|
$steps = "" if (!defined $steps);
|
||||||
$noFooter = "" if (!defined $noFooter);
|
$noFooter = "" if (!defined $noFooter);
|
||||||
|
$noColor = "" if (!defined $noColor);
|
||||||
|
|
||||||
my ($dec,$fontformat,$unitformat);
|
my ($dec,$fontformat,$unitformat);
|
||||||
($dec,$fontformat,$unitformat)=split (/,/,$decfont) if (defined $decfont);
|
($dec,$fontformat,$unitformat)=split (/,/,$decfont) if (defined $decfont);
|
||||||
@ -4728,7 +4728,7 @@ sub card
|
|||||||
for (my $i=0;$i<=4;$i++) {
|
for (my $i=0;$i<=4;$i++) {
|
||||||
my $v=($maxPlot-$minPlot)*(1-$i*0.25)+$minPlot;
|
my $v=($maxPlot-$minPlot)*(1-$i*0.25)+$minPlot;
|
||||||
my ($color)= get_color($v,$min,$max,$minColor,$maxColor,$func);
|
my ($color)= get_color($v,$min,$max,$minColor,$maxColor,$func);
|
||||||
$out.= sprintf('<text text-anchor="end" x="-2.5" y="%s" style="fill:%s;font-size:7px;%s">%s</text>',$i*12.5+2,color($color,$lmm),"",sprintf($format,$v));
|
$out.= sprintf('<text text-anchor="end" x="-2.5" y="%s" style="fill:%s;font-size:7px;%s">%s</text>',$i*12.5+2,$noColor ? "#CCCCCC":color($color,$lmm),"",sprintf($format,$v));
|
||||||
}
|
}
|
||||||
|
|
||||||
my $timebeginn=$time-$hours*3600;
|
my $timebeginn=$time-$hours*3600;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user