/[omni_gantt]/db2gantt.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /db2gantt.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by dpavlin, Fri Sep 13 14:03:47 2002 UTC revision 1.9 by dpavlin, Fri Sep 13 14:34:02 2002 UTC
# Line 25  my %cols = ( Line 25  my %cols = (
25          'Completed/Errors'      => '255,128,0',          'Completed/Errors'      => '255,128,0',
26          'Completed/Failure'     => '128,0,128',          'Completed/Failure'     => '128,0,128',
27          'Mount Request'         => '128,128,255',          'Mount Request'         => '128,128,255',
28            'Mount/Errors'          => '255,64,128',
29          );          );
30    
31  my $int_t = (12 * 60 * 60);     # interval to display on one screen  my $int_t = (12 * 60 * 60);     # interval to display on one screen
# Line 34  my $min_l = 3;                 # min length of bar seg Line 35  my $min_l = 3;                 # min length of bar seg
35    
36  # time range  # time range
37    
38    $int_t = m_round($int_t);
39    
40  my ($from_t,$to_t) = (time()-$int_t,time());  my ($from_t,$to_t) = (time()-$int_t,time());
41    
42  $to_t = param('to_t') if (param('to_t'));  $to_t = param('to_t') if (param('to_t'));
43  $from_t = param('from_t') if (param('from_t'));  $from_t = param('from_t') if (param('from_t'));
44    
45  # round to nearest minute  # round to nearest minute
46  $to_t = $to_t - ($to_t % 60);  sub m_round {
47  $from_t = $from_t - ($from_t % 60) + 60;          my $t = shift @_;
48            return ($t - ($t % 60));
49    }
50    
51    $to_t = m_round($to_t);
52    $from_t = m_round($from_t);
53    
54  my $to=strftime("%Y-%m-%d %H:%M",localtime ($to_t));  my $to=strftime("%Y-%m-%d %H:%M",localtime ($to_t));
55  my $from=strftime("%Y-%m-%d %H:%M",localtime ($from_t));  my $from=strftime("%Y-%m-%d %H:%M",localtime ($from_t));
# Line 191  while(my $row = $sth->fetchrow_hashref) Line 199  while(my $row = $sth->fetchrow_hashref)
199    
200          }          }
201    
202          my $start_t = str2time($row->{start});          my $start_t = m_round(str2time($row->{start}));
203          my $fin_t = str2time($row->{finish});          my $fin_t = m_round(str2time($row->{finish}));
204    
205          if ($start_t > $curr_t) {          if ($start_t > $curr_t + 60) {
206                  my $t = $start_t - $curr_t;                  my $t = $start_t - $curr_t;
207                  print STDERR "[middle filler $curr_t:$t]" if ($debug);                  print STDERR "[middle filler $curr_t:$t]" if ($debug);
208                  print bar($t);                  print bar($t);

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.26