/[maps]/lib/NMEA.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/NMEA.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 14 by dpavlin, Mon Dec 3 14:25:40 2007 UTC revision 16 by dpavlin, Mon Dec 3 14:57:31 2007 UTC
# Line 25  sub line { Line 25  sub line {
25                  chomp;                  chomp;
26                  my @a = split(/,/,$_);                  my @a = split(/,/,$_);
27    
28  #               next unless $#a == 12;                  return unless $#a == 12;
29    
30                  warn "## [$#a] ", join(' ',  #               warn "## [$#a] ", join(' ', map { "$_:$a[$_]" } ( 0 .. $#a )), " from $_\n";
                         map { "$_:$a[$_]" }  
                         ( 0 .. $#a )  
                 ), " from $_\n";  
31    
32                  # is valid?                  # is valid?
33                  return unless $a[2] eq 'A';                  return unless $a[2] eq 'A';
# Line 42  sub line { Line 39  sub line {
39                  / );                  / );
40    
41                  $hash->{lat} = hhmm( ( $hash->{lat_ns} eq 'S' ? -1 : 1 ) * $hash->{lat_hhmm} ) || return;                  $hash->{lat} = hhmm( ( $hash->{lat_ns} eq 'S' ? -1 : 1 ) * $hash->{lat_hhmm} ) || return;
42                  $hash->{lon} = hhmm( ( $hash->{lon_ns} eq 'W' ? -1 : 1 ) * $hash->{lon_hhmm} ) || return;                  $hash->{lon} = hhmm( ( $hash->{lon_ew} eq 'W' ? -1 : 1 ) * $hash->{lon_hhmm} ) || return;
43    
44                  return if ( $got_it->{ $hash->{lat} . ' ' . $hash->{lon} }++ );                  return if ( $got_it->{ $hash->{lat} . ' ' . $hash->{lon} }++ );
45    
46                  warn "##>>>> ",dump( $hash );  #               warn "##>>>> ",dump( $hash );
47                  return $hash;                  return $hash;
48          }          }
49    

Legend:
Removed from v.14  
changed lines
  Added in v.16

  ViewVC Help
Powered by ViewVC 1.1.26