source: subversion/applications/routing/pyroute/mod_base.py @ 5730

Last change on this file since 5730 was 5495, checked in by ojw, 12 years ago

Changes from the weekend

File size: 781 bytes
Line 
1import geometry
2
3class dataItem:
4    def __init__(self,lat,lon):
5        self.lat = lat
6        self.lon = lon
7        self.title = 'Untitled at %1.3f, %1.3f' % (lat,lon)
8    def formatText(self):
9        return(self.title)
10    def formatPos(self, ownPos = None):
11        if(ownPos):
12            return("%1.2fkm at %03.1f" % \
13                   (geometry.distance(ownPos,(self.lat,self.lon)),
14                    geometry.bearing(ownPos,(self.lat,self.lon))))
15        else:
16            return("%f,%f" % (self.lat,self.lon))
17
18class dataGroup:
19    def __init__(self,name):
20        self.items = []
21        self.name = name
22
23class dataSource:
24    def __init__(self):
25        self.groups = []
26    def callbacks(self, modules):
27        self.modules = modules
Note: See TracBrowser for help on using the repository browser.