/[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.1 by dpavlin, Thu Sep 12 12:06:34 2002 UTC revision 1.2 by dpavlin, Thu Sep 12 12:52:38 2002 UTC
# Line 32  my $width = 900; Line 32  my $width = 900;
32  sub draw {  sub draw {
33          my $l = shift @_;       # lenght of event utime          my $l = shift @_;       # lenght of event utime
34          my $type = shift @_;    # what to draw          my $type = shift @_;    # what to draw
35            my $alt = shift @_;
36    
37          my $size = int($l / ($len_t / $width)) || 1;    # dump size (min. size=1)          my $size = int($l / ($len_t / $width)) || 1;    # dump size (min. size=1)
38    
39          print STDERR "l[$type]:$l scale:",($len_t/$width)," size:$size<br>\n" if ($debug);          print STDERR "l[$type]:$l scale:",($len_t/$width)," size:$size<br>\n" if ($debug);
40    
41          print "<img src=$type.png width=$size height=8>";          print "<img src=$type.png width=$size height=8 alt=\"$alt\">";
42  }  }
43    
44  my $sql = "select start,finish,specification,status  my $sql = "select start,finish,specification,status
# Line 54  my $curr_spec; Line 56  my $curr_spec;
56  my $curr_t = $from_t;  my $curr_t = $from_t;
57    
58  $sth->execute() || die "sql: $sql ".$dbh->errstr;  $sth->execute() || die "sql: $sql ".$dbh->errstr;
59    
60  while(my $row = $sth->fetchrow_hashref) {  while(my $row = $sth->fetchrow_hashref) {
61          if ($row->{specification} ne $curr_spec) {          if ($row->{specification} ne $curr_spec) {
62    
63                  if ($curr_t < $to_t ) {                  if ($curr_t < $to_t ) {
64                          my $t = $to_t - $curr_t;                          my $t = $to_t - $curr_t;
65                          print STDERR "[filler $curr_t:$t]" if ($debug);                          print STDERR "[filler $curr_t:$t]" if ($debug);
66                          draw($t,"gray");                          draw($t,"gray",$row->{start}." - ".$row->{finish}." ".$row->{status});
67                  }                  }
68    
69                  print "</td></tr>\n" if ($curr_t != 0);                  print "</td></tr>\n" if ($curr_t != 0);
# Line 77  while(my $row = $sth->fetchrow_hashref) Line 80  while(my $row = $sth->fetchrow_hashref)
80          if ($start_t > $curr_t) {          if ($start_t > $curr_t) {
81                  my $t = $start_t - $curr_t;                  my $t = $start_t - $curr_t;
82                  print STDERR "[filler $curr_t:$t]" if ($debug);                  print STDERR "[filler $curr_t:$t]" if ($debug);
83                  draw($t,"gray");                  draw($t,"gray",$row->{start}." - ".$row->{finish}." ".$row->{status});
84                  $curr_t = $start_t;                  $curr_t = $start_t;
85          }          }
86    
# Line 98  while(my $row = $sth->fetchrow_hashref) Line 101  while(my $row = $sth->fetchrow_hashref)
101          }          }
102    
103          print STDERR "[$less",$row->{status}," $curr_t:$len$more]" if ($debug);          print STDERR "[$less",$row->{status}," $curr_t:$len$more]" if ($debug);
104          draw($len,"red");          draw($len,"red",$row->{start}." - ".$row->{finish}." ".$row->{status});
105    
106          $curr_t += $len;          $curr_t += $len;
107    
# Line 109  while(my $row = $sth->fetchrow_hashref) Line 112  while(my $row = $sth->fetchrow_hashref)
112  if ($curr_t < $to_t ) {  if ($curr_t < $to_t ) {
113          my $t = $to_t - $curr_t;          my $t = $to_t - $curr_t;
114          print STDERR "[filler $curr_t:$t]" if ($debug);          print STDERR "[filler $curr_t:$t]" if ($debug);
115          draw($t,"white");          draw($t,"gray");
116  }  }
117    
118  undef $sth;  undef $sth;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.26