added k1b and 3xa
authorminima <minima>
Mon, 24 Jun 2002 15:21:17 +0000 (15:21 +0000)
committerminima <minima>
Mon, 24 Jun 2002 15:21:17 +0000 (15:21 +0000)
changed prefix searching so it goes from right to left instead of the other
way around. This may leave stuff out...

Changes
cmd/show/prefix.pl
data/cty.dat
data/prefix_data.pl
perl/DXUtil.pm
perl/Prefix.pm

diff --git a/Changes b/Changes
index 800dc23df127bf57ad72f874a2af5ff98429b84b..c111566912a7132db0e482a0562017ea63664790 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,6 +1,8 @@
 24Jun02=======================================================================
 1. make set/badspotter non SSID sensitive. Set/badnode is left to be SSID
 sensitive. 
+2. added 3XA(=3X) and K1B(=KH1) also changed the logic of sh/prefix. This
+may break things, please test it. 
 19Jun02=======================================================================
 1. make set/badspotter and set/badnode apply to announces and talks as well
 as spots. 
index a12903799903e01eb7b29ae0d607b7580fa41f58..ed53d9277b302f072c9cb775f7c80f68024f927f 100644 (file)
@@ -13,12 +13,13 @@ my @out;
 #print "line: $line\n";
 foreach $l (@list) {
   my @ans = Prefix::extract($l);
-  #print "ans:", @ans, "\n";
+  my $dd = new Data::Dumper([ \@ans ]);
+  print "ans:", $dd->Dumpxs;
   next if !@ans;
   my $pre = shift @ans;
   my $a;
   foreach $a (@ans) {
-    push @out, sprintf "%s DXCC: %d ITU: %d CQ: %d LL: %s %s (%s, %s)", uc $l, $a->dxcc(), $a->itu(), $a->cq(), slat($a->lat), slong($a->long), $pre, $a->name();
+    push @out, sprintf "%s DXCC: %d ITU: %d CQ: %d LL: %s %s (%s, %s)", uc $l, $a->dxcc, $a->itu, $a->cq, slat($a->lat), slong($a->long), $pre, $a->name;
        $l = " " x length $l;
   }
 }
index c876d7bb984dcbc34b5070d88ea1b709027ff32b..596dff12e48f6029112b9e655109325dc6de5af3 100644 (file)
@@ -28,7 +28,7 @@ Tunisia:                  33:  37:  AF:   36.80:   -10.20:    -1.0:  3V:
 Vietnam:                  26:  49:  AS:   10.80:  -106.70:    -7.0:  3W:\r
     3W,XV;\r
 Republic of Guinea:       35:  46:  AF:    9.50:    13.70:     0.0:  3X:\r
-    3X;\r
+    3X,3XA;\r
 Bouvet:                   38:  67:  AF:  -54.50:    -3.40:     0.0:  3Y/b:\r
     3Y;\r
 Peter I I.:               12:  72:  SA:  -68.80:    90.60:     6.0:  3Y/p:\r
@@ -413,7 +413,7 @@ Guantanamo Bay:           08:  11:  NA:   19.90:    75.20:     5.0:  KG4:
 Mariana Is.:              27:  64:  OC:   15.20:  -145.80:    10.0:  KH0:\r
     AH0,KG6SL,KH0,NH0,WH0;\r
 Baker & Howland Is.:      31:  61:  OC:    0.50:   176.00:    11.0:  KH1:\r
-    AH1,KH1,NH1,WH1;\r
+    AH1,KH1,NH1,WH1,K1B;\r
 Guam:                     27:  64:  OC:   13.50:  -144.80:   -10.0:  KH2:\r
     AH2,KG6ASO,KH2,NH2,WH2;\r
 Johnston I.:              31:  61:  OC:   16.80:   169.50:    10.0:  KH3:\r
index 637c7c8c47f9bf1d6df6b110f787ce3c6ea36709..5b221bd8a162d4d02d6112ad2db6a55adb6fa3f7 100644 (file)
   '3V' => '13',
   '3W' => '14',
   '3X' => '15',
+  '3XA' => '15',
   '3Y' => '16,17',
   '3Y/B' => '16',
   '3Y/P' => '17',
   'K0PP' => '293',
   'K0TV' => '293',
   'K1' => '473,474,475,476,477,478',
+  'K1B' => '169',
   'K1KY' => '293',
   'K1VWL/BY1QH' => '68,346,347',
   'K2' => '479,480',
index 0942c69a0c0ed5aeeb66c33f9250744d9cb2adda..4ea3782ef4ccda85415b55a995cec44673cccdd9 100644 (file)
@@ -340,7 +340,7 @@ sub unpad
 # check that a field only has callsign characters in it
 sub is_callsign
 {
-       return $_[0] =~ /^(?:[A-Z]{1,2}\d+|\d[A-Z]\d+)[A-Z]{1,3}(?:-\d{1,2}|\/(?:[A-Z]{1,2}\d{0,2}|\d[A-Z]\d{0,2}))?$/;
+       return $_[0] =~ /^(?:[A-Z]{1,2}\d+|\d[A-Z]{1,2}\d+)[A-Z]{1,3}(?:-\d{1,2}|\/(?:[A-Z]{1,2}\d{0,2}|\d[A-Z]\d{0,2}))?$/;
 }
 
 # check that a PC protocol field is valid text
index 01e3079c7387c46b2aa39d010c4d6dd95fea5c12..15b6752dbcbc2bfef0810e4d408a730273253be1 100644 (file)
@@ -177,12 +177,15 @@ sub extract
                foreach $p (@parts) {
                        $sp = $p if length $sp > length $p;
                }
-               # now start to resolve it from the left hand end
-               for ($i = 1; $i <= length $sp; ++$i) {
+#              # now start to resolve it from the left hand end
+#              for ($i = 1; $i <= length $sp; ++$i) {
+               # now start to resolve it from the right hand end
+               for ($i = length $sp; $i >= 1; --$i) {
                        my @wout = get(substr($sp, 0, $i));
                        last if @wout > 0 && $wout[0] gt $sp;
-                       last if @wout == 0;
+#                      last if @wout == 0;
                        push @out, @wout;
+                       last if @wout;
                }
        }
        return @out;