fixed some problems with headings
authordjk <djk>
Sun, 6 Dec 1998 14:52:06 +0000 (14:52 +0000)
committerdjk <djk>
Sun, 6 Dec 1998 14:52:06 +0000 (14:52 +0000)
Changes
cmd/show/heading.pl
perl/DXBearing.pm

diff --git a/Changes b/Changes
index 91f8c9f9bf1469b1366eb14a7296d611f84c305e..7da05fce3a636f99a7ccd670809982ffcbe934cb 100644 (file)
--- 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
index aebf8da36bd6b2b2123956a3187742dc8e2883d3..b7dd05c935aea474b665e89794784fdcffbd97c8 100644 (file)
@@ -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);
index 798339cbcaf5b231799c8b636e04cbfdc79e32bb..ea17c2a4221e58d5143f4786ec9d160e9acfb033 100644 (file)
@@ -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