$NetBSD: patch-dn,v 1.1 1999/04/28 23:57:04 rvb Exp $ diff -u /usr/pkgsrc/net/coda-5.2.2/coda-src/vtools/logbandwidth.in ./coda-src/vtools/logbandwidth.in --- /usr/pkgsrc/net/coda-5.2.2/coda-src/vtools/logbandwidth.in Thu Mar 11 23:18:26 1999 +++ ./coda-src/vtools/logbandwidth.in Mon Apr 26 13:58:38 1999 @@ -22,9 +22,11 @@ # set strip_value1 0 set strip_value2 0 +set strip_value3 0 set strip_interval 1000 set strip_log1 [ list ] set strip_log2 [ list ] +set strip_log3 [ list ] set strip_idx 0 set strip_label "" @@ -40,21 +42,38 @@ for { set x 0 } { $x < 200 } { incr x } { lappend strip_log1 0 lappend strip_log2 0 + lappend strip_log3 0 } proc strip_draw {} { global strip_log1 strip_value1 + global strip_log2 strip_value2 + global strip_log3 strip_value3 global strip_interval strip_idx strip_label set strip_log1 [ lreplace $strip_log1 $strip_idx $strip_idx $strip_value1 ] + set strip_log2 [ lreplace $strip_log2 $strip_idx $strip_idx $strip_value2 ] + set strip_log3 [ lreplace $strip_log3 $strip_idx $strip_idx $strip_value3 ] .strip_graph delete data set i [ expr 202 - $strip_idx ] - foreach v1 $strip_log1 { + foreach v1 $strip_log1 v2 $strip_log2 v3 $strip_log3 { if { $v1 < 100 } { set v1 100 } - set val1 [ expr 102 - ( ( log10($v1) - 3 ) * 20 ) ] - .strip_graph create line $i 103 $i $val1 -tags data -fill LightSlateBlue + if { $v2 < 100 } { set v2 100 } + if { $v3 < 100 } { set v3 100 } + set val1 [ expr ( ( log10($v1) - 3 ) * 20 ) ] + set val2 [ expr ( ( log10($v2) - 3 ) * 20 ) ] + set val3 [ expr ( ( log10($v3) - 3 ) * 20 ) ] + .strip_graph create line $i 103 \ + $i [ expr 102 - $val1 ] \ + -tags data -fill LightSlateBlue + .strip_graph create line $i [ expr 102 - $val1 ] \ + $i [ expr 102 - $val3 ] \ + -tags data -fill SkyBlue + .strip_graph create line $i [ expr 102 - $val2 ] \ + $i [ expr 103 - $val2 ] \ + -tags data -fill Red incr i if { $i >= 202 } { set i 2 } @@ -130,7 +149,7 @@ # Customized stuff # proc checkline {line} { - global who strip_value1 strip_label + global who strip_value1 strip_value2 strip_value3 strip_label # # match our patterns @@ -139,8 +158,12 @@ if { $who == "" } { set who [ lindex $line 1 ] } strip_title [ lindex $line 1] set strip_value1 [ lindex $line 2 ] + set strip_value2 [ lindex $line 3 ] + set strip_value3 [ lindex $line 4 ] if { $strip_value1 < 0 } { set strip_value1 0 } - set strip_label "[ expr $strip_value1 * 8 ] bps" + if { $strip_value2 < 0 } { set strip_value2 0 } + if { $strip_value3 < 0 } { set strip_value3 0 } + set strip_label "[ expr $strip_value2 * 8 ] bps" } }