jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [branches/] [HotSaNIC-0.5.0-pre6/] [modules/] [apcusv/] [makeindex.pl] - Rev 33 Go to most recent revision

Compare with Previous - Blame - Download


#!/usr/bin/env perl

# $Id: makeindex.pl,v 1.15 2004/05/29 09:42:59 bernisys Exp $

# include PERL libraries
use warnings;
use diagnostics;

# include HotSaNIC libraries
use lib "../../lib";

use HotSaNICparser;
use HotSaNIChtml;


(my $VERSION = '$Revision: 1.15 $') =~ s/.*(\d+\.\d+).*/$1/;
(my $IDENTIFIER = '$Id: makeindex.pl,v 1.15 2004/05/29 09:42:59 bernisys Exp $') =~ s/.*,v (.*) \$/$1/;

# read global settings
#
$MODNAME=lc HotSaNICparser::get_module_name();
%CONFIG=HotSaNICparser::get_config("../..");
$IMAGEFORMAT=$CONFIG{IMAGEFORMAT};
$WEBDIR=$CONFIG{WEBDIR}."/".lc $MODNAME;
$VARDIR=$CONFIG{VARDIR}."/modules/".lc $MODNAME;
$REFRESH=$CONFIG{REFRESH};
$REFRESH=0 if !defined $REFRESH;



@DIAGRAMS=("hour","6h","day","week","month","year");
@TIMES=("6h","week");

# build time-based .html files
#
$DESCR{loadpct}="USV load";
$DESCR{timeleft}="uptime left";
$DESCR{battpct}="battery charge";
$DESCR{battv}="battery voltage";
$DESCR{outv}="output voltage";
$DESCR{temp}="temperature";

foreach $time (@TIMES) {
  open (FILE,">$WEBDIR/$time.html");
  print FILE HotSaNIChtml::create_header($MODNAME,$REFRESH,"$time overview page")."<table>\n";

  foreach (keys %DESCR) {
    ($page=$_) =~ s/[.:]/_/g;
    print FILE HotSaNIChtml::create_table_entry($IMAGEFORMAT,$page,$time,$_,$DESCR{$_},1);
    }
  print FILE "</table>\n".HotSaNIChtml::create_footer($MODNAME);
  close FILE;
  }

# build device-based .html files and complete index
#
print "$VARDIR\n";
open (IDXFILE,">$VARDIR/idxdata");
print IDXFILE HotSaNIChtml::create_overview_table_header($MODNAME,join(" ",@TIMES),1);
$num=0;
foreach $dev (sort keys %DESCR) {
  $num++;
  $description=$DESCR{$dev};
  ($file=$dev) =~ s/[.:]/_/g;
  print IDXFILE HotSaNIChtml::create_overview_table_entry($MODNAME,$IMAGEFORMAT,$num,$file,$dev,$description);
  HotSaNIChtml::make_device_page($MODNAME,$WEBDIR,$IMAGEFORMAT,$file,$description,@DIAGRAMS);
  }

close IDXFILE;


Powered by WebSVN 2.2.1