From: djk Date: Sat, 10 Jun 2000 14:21:49 +0000 (+0000) Subject: fixed croatia prefix X-Git-Tag: R_1_40~4 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=a565e3b0349dfe4f82233fa30c7dc1ae09ff028a;p=spider.git fixed croatia prefix fixed sh/qra 4 letter calcs as well as allow more flexibility in lat/long entry. --- diff --git a/Changes b/Changes index 67359516..1bdb396f 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +10Jun00======================================================================= +1. got rid of some more nasty bugs in sh/qra. +2. fixed 9A3xx to always be Croatia (and not Haiti!). 09Jun00======================================================================= 1. change some print commands in DXMsg to dbg('err'... 2. overloaded confess, croak et al into DXDebug and removed Carp from diff --git a/cmd/show/qra.pl b/cmd/show/qra.pl index f18b29b4..48bd249f 100644 --- a/cmd/show/qra.pl +++ b/cmd/show/qra.pl @@ -11,8 +11,18 @@ my @list = split /\s+/, $line; # generate a list of callsigns return (1, $self->msg('qrashe1')) unless @list > 0; my @out; -my $fll; -my $tll; + +# every thing is dealt with in upper case +$line = uc $line; + +# convert a lat/long into a qra locator if we see a pattern looking like a lat/long +if ($line =~ /^\d+\s+\d+\s*[NS]\s+\d+\s+\d+\s*[EW]/) { + $line =~ s/(\d)([NSEW])/$1 $2/g; + my ($llat, $llong) = DXBearing::stoll(uc $line); + return (1, "QRA $line = " . DXBearing::lltoqra($llat, $llong)); +} + +# get the user's lat/long else the cluster's (and whinge about it) my $lat = $self->user->lat; my $long = $self->user->long; if (!$long && !$lat) { @@ -21,34 +31,28 @@ if (!$long && !$lat) { $long = $main::mylongitude; } -my $fqra = DXBearing::is_qra($list[0]); -my $sqra = $list[0] =~ /^[A-Za-z][A-Za-z]\d\d$/; -my $ll = $line =~ /^\d+\s+\d+\s+[NSns]\s+\d+\s+\d+\s+[EWew]/; -return (1, $self->msg('qrae2', $list[0])) unless $fqra || $sqra || $ll; - -# convert a lat/long into a qra locator -if ($ll) { - my ($llat, $llong) = DXBearing::stoll($line); - return (1, "QRA $line = " . DXBearing::lltoqra($llat, $llong)); -} - unshift @list, $self->user->qra if @list == 1 && $self->user->qra; unshift @list, DXBearing::lltoqra($lat, $long) unless @list > 1; +# check from qra my $f = uc $list[0]; $f .= 'MM' if $f =~ /^[A-Z][A-Z]\d\d$/; +return (1, $self->msg('qrae2', $f)) unless DXBearing::is_qra($f); ($lat, $long) = DXBearing::qratoll($f); -return (1, $self->msg('qrae2', $list[1])) unless (DXBearing::is_qra($list[1]) || $list[1] =~ /^[A-Za-z][A-Za-z]\d\d$/); +# check to qra my $l = uc $list[1]; - -$fll = DXBearing::lltos($lat, $long); +$l .= 'MM' if $l =~ /^[A-Z][A-Z]\d\d$/; +return (1, $self->msg('qrae2', $l)) unless DXBearing::is_qra($l); my ($qlat, $qlong) = DXBearing::qratoll($l); -$tll = DXBearing::lltos($qlat, $qlong); -$tll =~ s/\s+([NSEW])/$1/g; +# generate alpha lat/long +my $fll = DXBearing::lltos($lat, $long); $fll =~ s/\s+([NSEW])/$1/g; +my $tll = DXBearing::lltos($qlat, $qlong); +$tll =~ s/\s+([NSEW])/$1/g; +# calc bearings and distances my ($b, $dx) = DXBearing::bdist($lat, $long, $qlat, $qlong); my ($r, $rdx) = DXBearing::bdist($qlat, $qlong, $lat, $long); my $to = ''; @@ -59,3 +63,4 @@ my $from = "\U$list[0]($fll)" ; push @out, sprintf "$from$to To: %.0f Fr: %.0f Dst: %.0fMi %.0fKm", $b, $r, $dx * 0.62133785, $dx; return (1, @out); + diff --git a/data/prefix_data.pl b/data/prefix_data.pl index 1cf2c9b7..fcce6312 100644 --- a/data/prefix_data.pl +++ b/data/prefix_data.pl @@ -484,7 +484,6 @@ '8Z' => '149,377', '8l' => '159', '9A' => '313', - '9A3A/4U' => '138', '9B' => '100', '9C' => '100', '9D' => '100,103', @@ -1878,7 +1877,6 @@ 'T8' => '418', 'T88' => '167', 'T9' => '311', - 'T93A/4U' => '138', 'TA' => '232', 'TB' => '232', 'TC' => '232', diff --git a/data/rsgb.cty b/data/rsgb.cty index 812a0ef2..08aa08c2 100644 --- a/data/rsgb.cty +++ b/data/rsgb.cty @@ -139,7 +139,7 @@ Switzerland: EU: 28: 14: HB: HB=HE; Liechtenstein: EU: 28: 14: HB0: HB0=HE0; Ecuador: SA: 12: 10: HC: HC=HD; Galapagos Is.: SA: 12: 10: HC8: HC8=HD8; -Haiti: NA: 11: 08: HH: 4V=9A3A/4U=HH=T93A/4U; +Haiti: NA: 11: 08: HH: HH=4V; Dominican Republic: NA: 11: 08: HI: HI; Colombia: SA: 12: 09: HK: 5J=5K=HJ=HK; San Andres/Providencia: NA: 11: 07: HK0/a: 5J0=5K0=HJ0=HK0;