From: Ian Jackson Date: Sat, 6 Nov 2010 13:54:30 +0000 (+0000) Subject: slopecalc shows cp relative heights X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=6eeb5875865791d53d2a44bf5465a047f7fa0687;p=trains.git slopecalc shows cp relative heights --- diff --git a/layout/slopecalc b/layout/slopecalc index f42cfe2..33ffe2a 100755 --- a/layout/slopecalc +++ b/layout/slopecalc @@ -179,10 +179,11 @@ sub dump_schedule ($) { $absoffset=0 unless defined $absoffset; my $i; my $last_l= 0; + my $last_h; my $last; for ($i=0; $i<@cp; $i++) { my $this= $cp[$i]; - lprintf("%4s %7s %7s =%5.2f %s %5.02f%% %s", + lprintf("%4s %7s %7s =%5.2f %s %5.02f%% %s %s", "#$i", '+'.($this->{L} - $last_l), '@'.($this->{L} - $absoffset), @@ -191,6 +192,9 @@ sub dump_schedule ($) { $this->{S} > 0 ? '\\' : '|'), $this->{S} * 100, + (defined $last_h ? + sprintf "=%+6.2f", $this->{H} - $last_h : + ' '), "@{ $this->{Args} }"); my $next= $cp[$i+1]; if ($interpolate and defined $next) { @@ -222,6 +226,7 @@ sub dump_schedule ($) { } } $last_l= $this->{L}; + $last_h= $this->{H}; $last= $this; } if ($interpolate) {