allow norad keps to be translated
authorminima <minima>
Thu, 15 Feb 2007 11:11:21 +0000 (11:11 +0000)
committerminima <minima>
Thu, 15 Feb 2007 11:11:21 +0000 (11:11 +0000)
Changes
perl/convkeps.pl

diff --git a/Changes b/Changes
index f6a8dfb72bcdcc2aa5dbdb9f3ab21861240e657e..da1e831cae33fa4e507a88b9c849fc150f26db01 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,16 +1,18 @@
-22Jan06=======================================================================
+15Feb07=======================================================================
+1. allow convkeps.pl to parse NORAD keps files.
+22Jan07=======================================================================
 1. disable default propagation of PC9x sentences
 2. simplify PC17 handling 
-16Jan06=======================================================================
+16Jan07=======================================================================
 1. back ported a change to PC16 handling so that a locally connected node's
 info clears out and generally overrides any residual PC16 info gathered from
 elsewhere.
-15Jan06=======================================================================
+15Jan07=======================================================================
 1. added CTY-1701
-07Jan06=======================================================================
+07Jan07=======================================================================
 1. use IO::Socket blocking where available and switch off or ignore all 
 attempts to block.
-05Jan06=======================================================================
+05Jan07=======================================================================
 1. increase default ephemeral deduping on PC15 to 6 minutes (from 2).
 23Nov06=======================================================================
 1. added wrapping to over length lines in console.pl.
index a7f3e0ae8ec53753dd0b6180027c4211d7a38bc2..5b546ca7839d5a05979ccfea3d0830f1dfe15bc1 100755 (executable)
@@ -61,6 +61,14 @@ my $ref;
 my $line;
 my $count = 0;
 
+my %lookup = (
+       'AO-5' => 'AO-05',
+       'AO-6' => 'AO-06',
+       'AO-7' => 'AO-07',
+       'AO-8' => 'AO-08',
+       
+);
+
 my $f = \*STDIN;
 
 while (@ARGV) {
@@ -96,9 +104,11 @@ while (<$f>) {
                last if m{^-};
                next if m{^To\s+all}i;
                
-               if (/^[- \w]+$/) {
-                       s/\s/-/g;
-                       $name = uc $_;
+               if (/^([- \w]+)(?:\s+\[[-+\w]\])$/) {
+                       my $n = uc $1;
+                       $n =~ s/\s/-/g;
+                       $name = $lookup{$n};
+                       $name ||= $n;
                        $ref = $keps{$name} = {}; 
                        $state = 2;
                }