mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-28 11:01:59 +00:00
title and label(s) for gplot, fixedrange day/week/month/year, multiple room assignments
git-svn-id: https://svn.fhem.de/fhem/trunk@324 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
08b7248b54
commit
e0e7e225bf
@ -355,9 +355,10 @@ FW_updateHashes()
|
|||||||
# Make a room hash
|
# Make a room hash
|
||||||
%__rooms = ();
|
%__rooms = ();
|
||||||
foreach my $d (keys %defs ) {
|
foreach my $d (keys %defs ) {
|
||||||
my $r = FW_getAttr($d, "room", "Unsorted");
|
foreach my $r (split(",", FW_getAttr($d, "room", "Unsorted"))) {
|
||||||
$__rooms{$r}{$d} = 1;
|
$__rooms{$r}{$d} = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
###############
|
###############
|
||||||
# Needed for type sorting
|
# Needed for type sorting
|
||||||
@ -804,7 +805,18 @@ FW_showLog($)
|
|||||||
|
|
||||||
my $pm = FW_getAttr($wl,"plotmode",$__plotmode);
|
my $pm = FW_getAttr($wl,"plotmode",$__plotmode);
|
||||||
my $ps = FW_getAttr($wl,"plotsize",$__plotsize);
|
my $ps = FW_getAttr($wl,"plotsize",$__plotsize);
|
||||||
|
# interprete title and label as a perl command and open accessiblity
|
||||||
|
# to all internal values e.g. $value.
|
||||||
|
my $title = FW_getAttr($wl, "title", "\"$file\"");
|
||||||
|
$title = AnalyzeCommand(undef, "\{ return(" . $title . ");;\}");
|
||||||
|
my $label = FW_getAttr($wl, "label", undef);
|
||||||
|
my @g_label;
|
||||||
|
if ($label) {
|
||||||
|
@g_label = split(":",$label);
|
||||||
|
foreach (@g_label) {
|
||||||
|
$_ = AnalyzeCommand(undef, "\{ return(" . $_ . ");;\}");
|
||||||
|
}
|
||||||
|
}
|
||||||
my $gplot_pgm = "$__dir/$type.gplot";
|
my $gplot_pgm = "$__dir/$type.gplot";
|
||||||
return FW_fatal("Cannot read $gplot_pgm") if(!-r $gplot_pgm);
|
return FW_fatal("Cannot read $gplot_pgm") if(!-r $gplot_pgm);
|
||||||
FW_calcWeblink($d,$wl);
|
FW_calcWeblink($d,$wl);
|
||||||
@ -817,7 +829,6 @@ FW_showLog($)
|
|||||||
if($pm eq "gnuplot" || !$__devs{$d}{from}) {
|
if($pm eq "gnuplot" || !$__devs{$d}{from}) {
|
||||||
|
|
||||||
# Looking for the logfile....
|
# Looking for the logfile....
|
||||||
|
|
||||||
$defs{$d}{logfile} =~ m,^(.*)/([^/]*)$,; # Dir and File
|
$defs{$d}{logfile} =~ m,^(.*)/([^/]*)$,; # Dir and File
|
||||||
my $path = "$1/$file";
|
my $path = "$1/$file";
|
||||||
$path = FW_getAttr($d,"archivedir","") . "/$file" if(!-f $path);
|
$path = FW_getAttr($d,"archivedir","") . "/$file" if(!-f $path);
|
||||||
@ -830,7 +841,14 @@ FW_showLog($)
|
|||||||
$gplot_script =~ s/<OUT>/$tmpfile/g;
|
$gplot_script =~ s/<OUT>/$tmpfile/g;
|
||||||
$gplot_script =~ s/<SIZE>/$ps/g;
|
$gplot_script =~ s/<SIZE>/$ps/g;
|
||||||
$gplot_script =~ s/<IN>/$path/g;
|
$gplot_script =~ s/<IN>/$path/g;
|
||||||
$gplot_script =~ s/<TL>/$file/g;
|
$gplot_script =~ s/<TL>/$title/g;
|
||||||
|
my $g_count=0;
|
||||||
|
if ($label) {
|
||||||
|
foreach (@g_label) {
|
||||||
|
$gplot_script =~ s/<L$g_count>/$_/g;
|
||||||
|
$g_count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
my $fr = FW_getAttr($wl, "fixedrange", undef);
|
my $fr = FW_getAttr($wl, "fixedrange", undef);
|
||||||
if($fr) {
|
if($fr) {
|
||||||
@ -864,8 +882,15 @@ FW_showLog($)
|
|||||||
my $gplot_script = join("", @data);
|
my $gplot_script = join("", @data);
|
||||||
$gplot_script =~ s/<OUT>/$tmpfile/g;
|
$gplot_script =~ s/<OUT>/$tmpfile/g;
|
||||||
$gplot_script =~ s/<SIZE>/$ps/g;
|
$gplot_script =~ s/<SIZE>/$ps/g;
|
||||||
$gplot_script =~ s/<TL>/$file/g;
|
$gplot_script =~ s/<TL>/$title/g;
|
||||||
|
my $g_count=0;
|
||||||
|
if ($label) {
|
||||||
|
foreach (@g_label) {
|
||||||
|
$gplot_script =~ s/<L$g_count>/$_/g;
|
||||||
|
$plot =~ s/<L$g_count>/$_/g;
|
||||||
|
$g_count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
my ($f,$t)=($__devs{$d}{from}, $__devs{$d}{to});
|
my ($f,$t)=($__devs{$d}{from}, $__devs{$d}{to});
|
||||||
|
|
||||||
my $oll = $attr{global}{verbose};
|
my $oll = $attr{global}{verbose};
|
||||||
@ -1088,13 +1113,20 @@ FW_calcWeblink($$)
|
|||||||
return if(!$defs{$wl});
|
return if(!$defs{$wl});
|
||||||
|
|
||||||
my $fr = FW_getAttr($wl, "fixedrange", undef);
|
my $fr = FW_getAttr($wl, "fixedrange", undef);
|
||||||
|
my $frx;
|
||||||
if($fr) {
|
if($fr) {
|
||||||
|
#klaus fixed range day, week, month or year
|
||||||
|
if($fr eq "day" || $fr eq "week" || $fr eq "month" || $fr eq "year" ) {
|
||||||
|
$frx=$fr;
|
||||||
|
}
|
||||||
|
else {
|
||||||
my @range = split(" ", $fr);
|
my @range = split(" ", $fr);
|
||||||
my @t = localtime;
|
my @t = localtime;
|
||||||
$__devs{$d}{from} = ResolveDateWildcards($range[0], @t);
|
$__devs{$d}{from} = ResolveDateWildcards($range[0], @t);
|
||||||
$__devs{$d}{to} = ResolveDateWildcards($range[1], @t);
|
$__devs{$d}{to} = ResolveDateWildcards($range[1], @t);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
my $off = $__pos{$d};
|
my $off = $__pos{$d};
|
||||||
$off = 0 if(!$off);
|
$off = 0 if(!$off);
|
||||||
@ -1103,6 +1135,7 @@ FW_calcWeblink($$)
|
|||||||
my $now = time();
|
my $now = time();
|
||||||
my $zoom = $__pos{zoom};
|
my $zoom = $__pos{zoom};
|
||||||
$zoom = "day" if(!$zoom);
|
$zoom = "day" if(!$zoom);
|
||||||
|
$zoom = $frx if ($frx); #for fixedrange {day|week|...} klaus
|
||||||
|
|
||||||
if($zoom eq "qday") {
|
if($zoom eq "qday") {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user