jablonka.czprosek.czf

hotsanic

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

 

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; }
2727simandl elsif ($range eq "10year") { $descr="10year"; $file=$descr; $build=525000; $fullrange=315360000; }
281simandl 
29 ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
30 $year+=1900;
31 $mon++;
32 if ($mon<10) { $mon="0".$mon; }
33 if ($mday<10) { $mday="0".$mday; }
34 if ($hour<10) { $hour="0".$hour; }
35 if ($min<10) { $min="0".$min; }
36 $buildtime="$Weekday[$wday] $year-$mon-$mday $hour:$min";
37 
38 return ($descr,$file,$build,$fullrange,$buildtime);
39 }
40 
411;
42 

Powered by WebSVN 2.2.1