From: djk Date: Sun, 6 Dec 1998 14:59:37 +0000 (+0000) Subject: added sh/qra X-Git-Tag: R_1_8~3 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=e853e515f070fdf091235fdd7428c760d2b5bb86;p=spider.git added sh/qra --- diff --git a/cmd/show/qra.pl b/cmd/show/qra.pl new file mode 100644 index 00000000..8e91cf5f --- /dev/null +++ b/cmd/show/qra.pl @@ -0,0 +1,33 @@ +# +# show the distance and bearing each QRA locator +# +# $Id$ +# + +my ($self, $line) = @_; +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::mylat; + $long = $main::mylong; +} + +foreach $l (@list) { + # locators ---> + if (DXBearing::is_qra($l) || $l =~ /^[A-Za-z][A-Za-z]\d\d$/) { + my $qra = uc $l; + $qra .= 'MM' if $l =~ /^[A-Za-z][A-Za-z]\d\d$/; + + my ($qlat, $qlong) = DXBearing::qratoll($qra); + my ($b, $dx) = DXBearing::bdist($lat, $long, $qlat, $qlong); + my ($r, $rdx) = DXBearing::bdist($qlat, $qlong, $lat, $long); + push @out, sprintf "%-9s Bearing: %.0f Recip: %.0f %.0fKm %.0fMi", $qra, $b, $r, $dx, $dx * 0.62133785; + } +} + +return (1, @out);