2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

Aenderungen von Klaus

git-svn-id: https://svn.fhem.de/fhem/trunk@419 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2009-08-04 07:50:38 +00:00
parent efea326a90
commit 0d18e1eb17
2 changed files with 11 additions and 6 deletions

View File

@ -21,6 +21,7 @@ sub FW_showWeblink($$$);
sub FW_select($$$); sub FW_select($$$);
sub FW_textfield($$); sub FW_textfield($$);
sub FW_submit($$); sub FW_submit($$);
sub FW_substcfg($$$$$$);
sub FW_style($$); sub FW_style($$);
sub FW_roomOverview($); sub FW_roomOverview($);
sub FW_fatal($); sub FW_fatal($);
@ -851,7 +852,7 @@ FW_substcfg($$$$$$)
{ {
my ($splitret, $wl, $cfg, $plot, $file, $tmpfile) = @_; my ($splitret, $wl, $cfg, $plot, $file, $tmpfile) = @_;
# interprete title and label as a perl command and open accessiblity # interpret title and label as a perl command and make
# to all internal values e.g. $value. # to all internal values e.g. $value.
my $oll = $attr{global}{verbose}; my $oll = $attr{global}{verbose};
@ -886,9 +887,9 @@ FW_substcfg($$$$$$)
} }
} }
if($splitret) { if($splitret == 1) {
my @ret = split("\n", $gplot_script); my @ret = split("\n", $gplot_script);
return \@ret; return (\@ret, $plot);
} else { } else {
return $gplot_script; return $gplot_script;
} }
@ -995,7 +996,7 @@ FW_showLog($)
Log 0, $ret if($ret); Log 0, $ret if($ret);
} }
$ret = fC("get $d $file INT $f $t " . join(" ", @{$flog})); $ret = fC("get $d $file INT $f $t " . join(" ", @{$flog}));
$cfg = FW_substcfg(1, $wl, $cfg, $plot, $file, "<OuT>"); ($cfg, $plot) = FW_substcfg(1, $wl, $cfg, $plot, $file, "<OuT>");
SVG_render($f, $t, $cfg, $internal_data, $plot); SVG_render($f, $t, $cfg, $internal_data, $plot);
$__RETTYPE = "image/svg+xml"; $__RETTYPE = "image/svg+xml";

View File

@ -112,8 +112,10 @@ SVG_render($$$$$)
$dpoff = $ndpoff+1; $dpoff = $ndpoff+1;
if($l =~ m/^#/) { if($l =~ m/^#/) {
my $a = $axes[$idx]; my $a = $axes[$idx];
if(defined($a)) {
$hmin{$a} = $min if(!defined($hmin{$a}) || $hmin{$a} > $min); $hmin{$a} = $min if(!defined($hmin{$a}) || $hmin{$a} > $min);
$hmax{$a} = $max if(!defined($hmax{$a}) || $hmax{$a} < $max); $hmax{$a} = $max if(!defined($hmax{$a}) || $hmax{$a} < $max);
}
($min, $max) = (99999999, -99999999); ($min, $max) = (99999999, -99999999);
$hdx[$idx] = $dxp; $hdy[$idx] = $dyp; $hdx[$idx] = $dxp; $hdy[$idx] = $dyp;
($dxp, $dyp) = (\(), \()); ($dxp, $dyp) = (\(), \());
@ -208,6 +210,7 @@ SVG_render($$$$$)
for my $axis ("x1y1", "x1y2") { for my $axis ("x1y1", "x1y2") {
# Round values, compute a nice step # Round values, compute a nice step
next if(!defined($hmax{$axis}));
my $dh = $hmax{$axis} - $hmin{$axis}; my $dh = $hmax{$axis} - $hmin{$axis};
my ($step, $mi, $ma); my ($step, $mi, $ma);
my @limit = (1,2,5,10,20,50,100,200,500,1000,2000,5000,10000); my @limit = (1,2,5,10,20,50,100,200,500,1000,2000,5000,10000);
@ -279,6 +282,7 @@ SVG_render($$$$$)
# Second loop over the data: draw the measured points # Second loop over the data: draw the measured points
for my $idx (0..int(@hdx)-1) { for my $idx (0..int(@hdx)-1) {
my $a = $axes[$idx]; my $a = $axes[$idx];
next if(!defined($a));
$min = $hmin{$a}; $min = $hmin{$a};
$hmax{$a} += 1 if($min == $hmax{$a}); # Else division by 0 in the next line $hmax{$a} += 1 if($min == $hmax{$a}); # Else division by 0 in the next line
my $hmul = $h/($hmax{$a}-$min); my $hmul = $h/($hmax{$a}-$min);