line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package GPS::Magellan::Coord; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
6
|
1
|
|
|
1
|
|
5
|
use Data::Dumper; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
7
|
1
|
|
|
1
|
|
5
|
use vars qw($AUTOLOAD); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
511
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
10
|
|
|
10
|
0
|
13
|
my $proto = shift; |
11
|
10
|
|
|
|
|
15
|
my $raw_data = shift; |
12
|
|
|
|
|
|
|
|
13
|
10
|
50
|
|
|
|
17
|
die "GPS::Magellan::Coord::new() didn't get raw data\n" unless $raw_data; |
14
|
|
|
|
|
|
|
|
15
|
10
|
|
33
|
|
|
44
|
my $class = ref($proto) || $proto; |
16
|
|
|
|
|
|
|
|
17
|
10
|
|
|
|
|
25
|
my $self = bless { }, $class; |
18
|
|
|
|
|
|
|
|
19
|
10
|
|
|
|
|
63
|
$self->fields( [ qw/longitude lnsign latitude ltsign altitude unknown name description icon/ ] ); |
20
|
|
|
|
|
|
|
|
21
|
10
|
|
|
|
|
21
|
$self->_parse($raw_data); |
22
|
|
|
|
|
|
|
|
23
|
10
|
|
|
|
|
35
|
return $self; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub _parse { |
27
|
10
|
|
|
10
|
|
13
|
my $self = shift; |
28
|
10
|
50
|
|
|
|
21
|
my $raw_data = shift or die "GPS::Magellan::Coord->new() didn't get raw data\n"; |
29
|
|
|
|
|
|
|
|
30
|
10
|
|
|
|
|
28
|
my @fields = qw/longitude lnsign latitude ltsign altitude unknown name description icon/; |
31
|
|
|
|
|
|
|
|
32
|
10
|
|
|
|
|
48
|
foreach my $val (split /,/, $raw_data){ |
33
|
90
|
|
|
|
|
103
|
my $field = shift @fields; |
34
|
90
|
|
|
|
|
159
|
$self->_set($field, $val); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub _dump { |
40
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
0
|
my @fields = qw/longitude lnsign latitude ltsign altitude unknown name description icon/; |
43
|
0
|
|
|
|
|
0
|
foreach my $field (@fields){ |
44
|
0
|
|
|
|
|
0
|
printf "%20s -> %20s\n", $field, $self->_get($field); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# Accessors |
49
|
|
|
|
|
|
|
sub _get { |
50
|
320
|
|
|
320
|
|
356
|
my $self = shift; |
51
|
320
|
|
|
|
|
543
|
my $attr = shift; |
52
|
320
|
|
|
|
|
1588
|
return $self->{$attr}; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub _set { |
56
|
100
|
|
|
100
|
|
111
|
my $self = shift; |
57
|
100
|
|
|
|
|
112
|
my $attr = shift; |
58
|
100
|
|
100
|
|
|
219
|
my $value = shift || ''; |
59
|
|
|
|
|
|
|
|
60
|
100
|
50
|
|
|
|
548
|
return unless $attr; |
61
|
|
|
|
|
|
|
|
62
|
100
|
|
|
|
|
192
|
$self->{$attr} = $value; |
63
|
100
|
|
|
|
|
195
|
return $self->_get($attr); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub _debug_autoload { |
67
|
110
|
|
|
110
|
|
122
|
my $self = shift; |
68
|
110
|
50
|
|
|
|
275
|
$self->_set('_debug_autoload', shift) if @_; |
69
|
110
|
|
|
|
|
189
|
$self->_get('_debug_autoload'); |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub AUTOLOAD { |
74
|
110
|
|
|
110
|
|
137
|
my $self = shift; |
75
|
110
|
|
|
|
|
214
|
my $attr = $AUTOLOAD; |
76
|
|
|
|
|
|
|
|
77
|
110
|
|
|
|
|
553
|
$attr =~ s/.*:://; |
78
|
|
|
|
|
|
|
|
79
|
110
|
50
|
|
|
|
401
|
return if $attr =~ /^_/; |
80
|
|
|
|
|
|
|
|
81
|
110
|
50
|
|
|
|
207
|
warn "AUTOLOAD: $attr\n" if $self->_debug_autoload; |
82
|
|
|
|
|
|
|
|
83
|
110
|
100
|
|
|
|
282
|
if(@_){ |
84
|
10
|
|
|
|
|
31
|
$self->_set($attr, shift); |
85
|
|
|
|
|
|
|
} |
86
|
110
|
|
|
|
|
192
|
return $self->_get($attr); |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
0
|
|
|
0
|
|
|
sub DESTROY { |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; |
95
|
|
|
|
|
|
|
|