#!/usr/bin/env perl
use warnings;
use diagnostics;
use lib "../../lib";
use HotSaNICparser;
# read global settings
#
$MODNAME=lc HotSaNICparser::get_module_name();
%CONFIG=HotSaNICparser::get_config("../..");
$IMAGEFORMAT=$CONFIG{"IMAGEFORMAT"};
$REFRESH=$CONFIG{"REFRESH"};
$REFRESH=0 if !defined $REFRESH;
# read module-specific settings
#
undef %SENSOR;
undef %SENSORDB;
foreach (HotSaNICparser::read_settings(".")) {
($var,$value)=HotSaNICparser::parse_line($_);
if ($var eq "SENSOR") {
($dev,$dbname,$name)=split(/,/,$value);
$SENSORDB{$dbname}=$dbname;
$SENSOR{$dbname}=$name;
print "$dev\n";
}
}
@DIAGRAMS=("hour","6h","day","week","month","year");
# build time-based .html files
#
foreach $index ("6h","week") {
open (FILE,">index/$index.html");
print FILE "\n";
if ($REFRESH > 0) {
print FILE "
\n";
}
print FILE "
\n\n";
foreach $dev (keys %SENSOR) {
$dbname=$SENSORDB{$dev};
$name=$SENSOR{$dev};
print FILE " |
",$name," |
\n";
}
print FILE "
\n\n\n";
close FILE;
}
# build device-based .html files and complete index
#
open (IDXFILE,">idxdata");
print IDXFILE "0## ",$MODNAME,"
0## 6 hours
0## week
0##
0## | \n";
$nn=0;
foreach $dev (sort(keys %SENSOR)) {
$nn++;
$dbname=$SENSORDB{$dev};
$name=$SENSOR{$dev};
print IDXFILE $nn,"## |
",$nn,"## ",$name,"
| \n";
# build device-based .html
#
open (FILE,">index/$dbname.html");
print FILE "\n";
if ($REFRESH > 0) {
print FILE "
\n";
}
print FILE "\n";
foreach $diagram (@DIAGRAMS) {
print FILE "\n";
}
print FILE "\n\n";
close FILE;
}
close IDXFILE;
WebSVN
- hotsanic
- Blame
- Rev 36
- /trunk/modules/sensors/makeindex.pl
hotsanic |
Subversion Repositories: |
[/] [trunk/] [modules/] [sensors/] [makeindex.pl] - Blame information for rev 36
Powered by WebSVN 2.2.1