jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [trunk/] [lib/] [HotSaNICdiagram.pm] - Blame information for rev 15

 

Line No. Rev Author Line
11simandl#
2# $Id: HotSaNICdiagram.pm,v 1.3 2004/01/25 05:14:00 bernisys Exp $
3#
4 
5package HotSaNICdiagram;
6 
7($VERSION = '$Revision: 1.3 $') =~ s/.*(\d+\.\d+).*/$1/;
8 
9my @Weekday=("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
10 
11######################################################################
12#
13# evaluates some diagram properties from the given range
14#
15# Usage:
16# ($description,$file_description,$build_interval,$diagram_range,$timestring)=get_diagram_properties($range);
17#
18sub get_diagram_properties {
19 my ($range)=@_;
20 my ($descr,$file,$build,$fullrange);
21 if ($range eq "1h") { $descr="hour"; $file=$descr; $build=0; $fullrange=3600; }
22 elsif ($range eq "6h") { $descr="6 hours"; $file="6h"; $build=30; $fullrange=21600; }
23 elsif ($range eq "1day") { $descr="day"; $file=$descr; $build=120; $fullrange=86400; }
24 elsif ($range eq "1week") { $descr="week"; $file=$descr; $build=1000; $fullrange=604800; }
25 elsif ($range eq "1month") { $descr="month"; $file=$descr; $build=4300; $fullrange=2592000; }
26 elsif ($range eq "1year") { $descr="year"; $file=$descr; $build=52500; $fullrange=31536000; }
27 
28 ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
29 $year+=1900;
30 $mon++;
31 if ($mon<10) { $mon="0".$mon; }
32 if ($mday<10) { $mday="0".$mday; }
33 if ($hour<10) { $hour="0".$hour; }
34 if ($min<10) { $min="0".$min; }
35 $buildtime="$Weekday[$wday] $year-$mon-$mday $hour:$min";
36 
37 return ($descr,$file,$build,$fullrange,$buildtime);
38 }
39 
401;
41 

Powered by WebSVN 2.2.1