X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fheading.pl;h=122ed5e480623aeb4411bd2273b23bdd0c02628a;hb=d5b4190c36f130852973121042876af3c5642cd7;hp=aa7bb2f83e8bfdaa3e602958070dd0df2be6f961;hpb=4c0591c17b89dbb049ba119d3f3ea15c5b56128c;p=spider.git diff --git a/cmd/show/heading.pl b/cmd/show/heading.pl index aa7bb2f8..122ed5e4 100644 --- a/cmd/show/heading.pl +++ b/cmd/show/heading.pl @@ -3,32 +3,33 @@ # # $Id$ # - +# AK1A-compatible output Iain Philipps, G0RDI 16-Dec-1998 +# my ($self, $line) = @_; -my @list = split /\s+/, $line; # generate a list of callsigns +my @list = split /\s+/, $line; # generate a list of callsigns my $l; my @out; my $lat = $self->user->lat; my $long = $self->user->long; if (!$long && !$lat) { - push @out, $self->msg('heade1'); - $lat = $main::mylatitude; - $long = $main::mylongitude; + push @out, $self->msg('heade1'); + $lat = $main::mylatitude; + $long = $main::mylongitude; } foreach $l (@list) { - # prefixes ---> - my @ans = Prefix::extract($l); - next if !@ans; - my $pre = shift @ans; - my $a; - foreach $a (@ans) { - my ($b, $dx) = DXBearing::bdist($lat, $long, $a->{lat}, $a->{long}); - my ($r, $rdx) = DXBearing::bdist($a->{lat}, $a->{long}, $lat, $long); - push @out, sprintf "%-9s (%s, %s) Bearing: %.0f Recip: %.0f %.0fKm %.0fMi", uc $l, $pre, $a->name(), $b, $r, $dx, $dx * 0.62133785; - $l = ""; - } + # prefixes ---> + my @ans = Prefix::extract($l); + next if !@ans; + my $pre = shift @ans; + my $a; + foreach $a (@ans) { + my ($b, $dx) = DXBearing::bdist($lat, $long, $a->{lat}, $a->{long}); + my ($r, $rdx) = DXBearing::bdist($a->{lat}, $a->{long}, $lat, $long); + push @out, sprintf "%-2s %s: %.0f degs - dist: %.0f mi, %.0f km Reciprocal heading: %.0f degs", $pre, $a->name(), $b, $dx * 0.62133785, $dx, $r; + $l = ""; + } } return (1, @out);