mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 10:46:53 +00:00
SVGcache added
git-svn-id: https://svn.fhem.de/fhem/trunk@3250 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
feb50058ba
commit
93739d13b3
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII
|
# Add changes at the top of the list. Keep it in ASCII
|
||||||
- SVN
|
- SVN
|
||||||
|
- feature: FHEMWEB: SVGcache attribute & clearSvgCache set command added
|
||||||
- feature: SYSSTAT: allow (remote) monitoring raspberry pi on cpu frequency
|
- feature: SYSSTAT: allow (remote) monitoring raspberry pi on cpu frequency
|
||||||
- feature: MANTAINER.txt added
|
- feature: MANTAINER.txt added
|
||||||
- feature: PRESENCE: new mode "shellscript" to use own
|
- feature: PRESENCE: new mode "shellscript" to use own
|
||||||
@ -8,7 +9,7 @@
|
|||||||
- feature: PRESENCE: new attribute ping_count
|
- feature: PRESENCE: new attribute ping_count
|
||||||
- feature: userReadings may have a filter
|
- feature: userReadings may have a filter
|
||||||
- feature: HUEBridge: allow starting of bridge firmware update
|
- feature: HUEBridge: allow starting of bridge firmware update
|
||||||
- change: EnOcean: profil PM101 changed, old profiles FAH, FBH, FTF, SR04
|
- change: EnOcean: profile PM101 changed, old profiles FAH, FBH, FTF, SR04
|
||||||
removed
|
removed
|
||||||
- feature: TCM: new attr blockSenderID:
|
- feature: TCM: new attr blockSenderID:
|
||||||
Block receiving telegrams with a TCM SenderID sent by repeaters
|
Block receiving telegrams with a TCM SenderID sent by repeaters
|
||||||
@ -16,7 +17,7 @@
|
|||||||
commands supported
|
commands supported
|
||||||
- feature: EnOcean: Now all RPS / 1BS profiles, more than 90 4BS profiles and
|
- feature: EnOcean: Now all RPS / 1BS profiles, more than 90 4BS profiles and
|
||||||
some manufacturer specific profiles are supported
|
some manufacturer specific profiles are supported
|
||||||
- feature: EnOcean: profiles (subType) are updated from EEP 2.1 to EEP 2.5
|
- feature: EnOcean: profiles (subType) are updated from EEP 2.1 to EEP 2.5
|
||||||
- feature: FHEMWEB attribute roomIcons added
|
- feature: FHEMWEB attribute roomIcons added
|
||||||
- feature: SYSSTAT: optionaly calculate geometric average of last 4
|
- feature: SYSSTAT: optionaly calculate geometric average of last 4
|
||||||
temperature values
|
temperature values
|
||||||
|
@ -119,7 +119,7 @@ FHEMWEB_Initialize($)
|
|||||||
"stylesheetPrefix touchpad:deprecated smallscreen:deprecated ".
|
"stylesheetPrefix touchpad:deprecated smallscreen:deprecated ".
|
||||||
"basicAuth basicAuthMsg hiddenroom hiddengroup HTTPS allowfrom CORS:0,1 ".
|
"basicAuth basicAuthMsg hiddenroom hiddengroup HTTPS allowfrom CORS:0,1 ".
|
||||||
"refresh longpoll:1,0 redirectCmds:0,1 reverseLogs:0,1 menuEntries ".
|
"refresh longpoll:1,0 redirectCmds:0,1 reverseLogs:0,1 menuEntries ".
|
||||||
"roomIcons";
|
"roomIcons SVGcache";
|
||||||
|
|
||||||
###############
|
###############
|
||||||
# Initialize internal structures
|
# Initialize internal structures
|
||||||
@ -1519,12 +1519,31 @@ FW_showLog($)
|
|||||||
Log 1, $ret if($ret);
|
Log 1, $ret if($ret);
|
||||||
}
|
}
|
||||||
Log 5, "plotcommand: get $d $file INT $f $t " . join(" ", @{$flog});
|
Log 5, "plotcommand: get $d $file INT $f $t " . join(" ", @{$flog});
|
||||||
$ret = FW_fC("get $d $file INT $f $t " . join(" ", @{$flog}));
|
|
||||||
($cfg, $plot) = FW_substcfg(1, $wl, $cfg, $plot, $file, "<OuT>");
|
|
||||||
FW_pO SVG_render($wl, $f, $t, $cfg,
|
|
||||||
$internal_data, $plot, $FW_wname, $FW_cssdir);
|
|
||||||
$FW_RETTYPE = "image/svg+xml";
|
$FW_RETTYPE = "image/svg+xml";
|
||||||
|
|
||||||
|
my $SVGcache = (AttrVal($FW_wname, "SVGcache", undef) && $t lt TimeNow());
|
||||||
|
my $cDir = "$FW_dir/SVGcache";
|
||||||
|
my $cName = "$cDir/$wl-$f-$t.svg";
|
||||||
|
if($SVGcache && open(CFH, $cName)) {
|
||||||
|
FW_pO join("", <CFH>);
|
||||||
|
close(CFH);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
FW_fC("get $d $file INT $f $t " . join(" ", @{$flog}));
|
||||||
|
($cfg, $plot) = FW_substcfg(1, $wl, $cfg, $plot, $file, "<OuT>");
|
||||||
|
$ret = SVG_render($wl, $f, $t, $cfg,
|
||||||
|
$internal_data, $plot, $FW_wname, $FW_cssdir);
|
||||||
|
FW_pO $ret;
|
||||||
|
if($SVGcache) {
|
||||||
|
mkdir($cDir) if(! -d $cDir);
|
||||||
|
if(open(CFH, ">$cName")) {
|
||||||
|
print CFH $ret;
|
||||||
|
close(CFH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2434,15 +2453,27 @@ sub
|
|||||||
FW_Set($@)
|
FW_Set($@)
|
||||||
{
|
{
|
||||||
my ($hash, @a) = @_;
|
my ($hash, @a) = @_;
|
||||||
|
my %cmd = ("rereadicons" => 1, "clearSvgCache" => 1);
|
||||||
|
|
||||||
return "no set value specified" if(@a < 2);
|
return "no set value specified" if(@a < 2);
|
||||||
return "Unknown argument $a[1], choose one of " . "rereadicons"
|
return ("Unknown argument $a[1], choose one of ".join(" ", sort keys %cmd))
|
||||||
unless($a[1] eq "rereadicons");
|
if(!$cmd{$a[1]});
|
||||||
|
|
||||||
my @dirs = keys %FW_icons;
|
if($a[1] eq "rereadicons") {
|
||||||
%FW_icons = ();
|
my @dirs = keys %FW_icons;
|
||||||
foreach my $d (@dirs) {
|
%FW_icons = ();
|
||||||
FW_readIcons($d);
|
foreach my $d (@dirs) {
|
||||||
|
FW_readIcons($d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($a[1] eq "clearSvgCache") {
|
||||||
|
my $cDir = "$FW_dir/SVGcache";
|
||||||
|
if(opendir(DH, $cDir)) {
|
||||||
|
map { my $n="$cDir/$_"; unlink($n) if(-f $n); } readdir(DH);;
|
||||||
|
closedir(DH);
|
||||||
|
} else {
|
||||||
|
return "Can't open $cDir: $!";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
@ -2585,13 +2616,16 @@ FW_dropdownFn()
|
|||||||
<a name="FHEMWEBset"></a>
|
<a name="FHEMWEBset"></a>
|
||||||
<b>Set</b>
|
<b>Set</b>
|
||||||
<ul>
|
<ul>
|
||||||
<code>set <name> rereadicons</code>
|
<li>rereadicons<br>
|
||||||
<br><br>
|
Rereads the icons in the icon path and updates the mapping from logical
|
||||||
Rereads the icons in the icon path and updates the mapping from logical icons to physical files.
|
icons to physical files. Use after adding, deleting or changing icons.
|
||||||
Use after adding, deleting or changing icons.
|
</li>
|
||||||
<br><br>
|
<li>clearSvgCache<br>
|
||||||
|
Delete all files found in the www/SVGcache directory, which is used to
|
||||||
|
cache SVG data, if the SVGcache attribute is set.
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<br>
|
||||||
|
|
||||||
<a name="FHEMWEBget"></a>
|
<a name="FHEMWEBget"></a>
|
||||||
<b>Get</b>
|
<b>Get</b>
|
||||||
@ -2605,7 +2639,8 @@ FW_dropdownFn()
|
|||||||
</code>
|
</code>
|
||||||
</ul>
|
</ul>
|
||||||
<li>pathlist<br>
|
<li>pathlist<br>
|
||||||
return FHEMWEB specific directories, where files for given types are located
|
return FHEMWEB specific directories, where files for given types are
|
||||||
|
located
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@ -2664,6 +2699,14 @@ FW_dropdownFn()
|
|||||||
smallscreen.
|
smallscreen.
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
|
<a name="SVGcache"></a>
|
||||||
|
<li>SVGcache<br>
|
||||||
|
if set, cache plots which won't change any more (the end-date is prior
|
||||||
|
to the current timestamp). The files are written to the www/SVGcache
|
||||||
|
directory. Default is off.<br>
|
||||||
|
See also the clearSvgCache command for clearing the cache.
|
||||||
|
</li><br>
|
||||||
|
|
||||||
<a name="fixedrange"></a>
|
<a name="fixedrange"></a>
|
||||||
<li>fixedrange<br>
|
<li>fixedrange<br>
|
||||||
Can be applied to weblink devices (FHEMWEB).<br>
|
Can be applied to weblink devices (FHEMWEB).<br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user