From e00a697bdb9f7c066b3e921d4f8ccc9bb9cf7485 Mon Sep 17 00:00:00 2001 From: djk Date: Sun, 6 Dec 1998 14:52:06 +0000 Subject: [PATCH] fixed some problems with headings --- Changes | 7 +++++++ cmd/show/heading.pl | 23 ++++++++++++----------- perl/DXBearing.pm | 2 +- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Changes b/Changes index 91f8c9f9..7da05fce 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,10 @@ +06Dec98======================================================================== +1. Fixed DXBearing::is_qra so that it correctly detects full QRA locators +2. Added a QRA locator thing to sh/heading so that if the 'prefix' looks like +a locator it will print the bearing and distance to it (as well as doing the +normal sh/heading on a prefix thing). +05Dec98======================================================================== +1. Added sh/heading and QRA locator calculation stuff 04Dec98======================================================================== 1. Started Changes file 2. Added load/cmd_cache.pl to clear cmd cache shortcuts (use this if cluster.pl diff --git a/cmd/show/heading.pl b/cmd/show/heading.pl index aebf8da3..b7dd05c9 100644 --- a/cmd/show/heading.pl +++ b/cmd/show/heading.pl @@ -1,5 +1,5 @@ # -# show the dxcc number for each callsign or prefix entered +# show the heading and distance for each callsign or prefix entered # # $Id$ # @@ -18,16 +18,17 @@ if (!$long && !$lat) { } foreach $l (@list) { - 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 "%-9s (%s, %s) Bearing: %.0f Recip: %.0f %.0fKm %.0fMi", uc $l, $pre, $a->name(), $b, $r, $dx, $dx * 0.62133785; + $l = ""; + } } return (1, @out); diff --git a/perl/DXBearing.pm b/perl/DXBearing.pm index 798339cb..ea17c2a4 100644 --- a/perl/DXBearing.pm +++ b/perl/DXBearing.pm @@ -88,7 +88,7 @@ sub dr sub is_qra { my $qra = shift; - return $qra =~ /\a\a\d\d\a\a/o; + return $qra =~ /^[A-Za-z][A-Za-z]\d\d[A-Za-z][A-Za-z]$/o; } # calc bearing and distance, with arguments in DEGREES -- 2.43.0