source: subversion/applications/editors/osmpedit/trackpoint.pm @ 34468

Last change on this file since 34468 was 734, checked in by tpersson, 14 years ago

Initial commit of osmpedit

File size: 1.5 KB
Line 
1#    Copyright (C) 2005 Tommy Persson, tpe@ida.liu.se
2#
3#    This program is free software; you can redistribute it and/or modify
4#    it under the terms of the GNU General Public License as published by
5#    the Free Software Foundation; either version 2 of the License, or
6#    (at your option) any later version.
7#
8#    This program is distributed in the hope that it will be useful,
9#    but WITHOUT ANY WARRANTY; without even the implied warranty of
10#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11#    GNU General Public License for more details.
12#
13#    You should have received a copy of the GNU General Public License
14#    along with this program; if not, write to the Free Software
15#    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
16
17package trackpoint;
18
19use FindBin qw($RealBin);
20use lib "$RealBin/../perl";
21
22use strict;
23
24
25sub new {
26    my $this = shift;
27    my $class = ref($this) || $this;
28    bless {
29        LAT => 0,
30        LON => 0,
31        TIME => "",
32        COURSE => 0,
33        SPEED => 0,
34        FIX => "",
35        SAT => 0,
36        HDOP => 0,
37        @_
38        }, $class;
39}
40
41
42sub set_lat {
43    my $self = shift;
44    my $val = shift;
45    $self->{LAT} = $val;
46}
47
48sub get_lat {
49    my $self = shift;
50    return $self->{LAT};;
51}
52
53sub set_lon {
54    my $self = shift;
55    my $val = shift;
56    $self->{LON} = $val;
57}
58
59sub get_lon {
60    my $self = shift;
61    return $self->{LON};;
62}
63
64sub print {
65    my $self = shift;
66    my $lat = $self->get_lat ();
67    my $lon = $self->get_lon ();
68    print "TP: $lat $lon\n";
69}
70
71
72return 1;
Note: See TracBrowser for help on using the repository browser.