source: subversion/applications/routing/pyroute-dev/tracklog.py @ 34690

Last change on this file since 34690 was 18456, checked in by buerste, 10 years ago

-reodering imports

  • Property svn:keywords set to Rev
File size: 1.4 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4"""
5"""
6
7__version__ = "$Rev: 18456 $"[1:-2]
8__license__ = """This program is free software: you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation, either version 3 of the License, or
11(at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with this program. If not, see <http://www.gnu.org/licenses/>."""
20_debug = 0
21
22
23from base import pyrouteModule
24from lib_gpx import lib_gpx
25import cairo
26import os
27
28class tracklog(pyrouteModule, lib_gpx):
29        """"""
30        def __init__(self, modules):
31                lib_gpx.__init__(self)
32                pyrouteModule.__init__(self, modules)
33                self.active = []
34                self.lines.append(self.active)
35                self.pointsSinceSave = 0
36
37        def addPoint(self,lat,lon):
38                self.active.append([lat,lon])
39                self.pointsSinceSave = self.pointsSinceSave + 1
40
41        def checkIfNeedsSaving(self, forceSave = False):
42                if(self.pointsSinceSave > 20 or forceSave):
43                        self.save()
44
45        def save(self):
46                self.saveAs(os.path.join(os.path.dirname(__file__),
47                                                                                                                 "data","tracklogs.gpx"), "tracklogs")
48                self.pointsSinceSave = 0
49
Note: See TracBrowser for help on using the repository browser.