source: mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19133_tracking_and_navigation/network/route/nt_route.py @ 8457

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19133_tracking_and_navigation/network/route/nt_route.py@8457
Revision 8457, 2.6 KB checked in by mnagni, 7 years ago (diff)

Corrected an error in the generation of the classes "synchronize" method.

  • Property svn:mime-type set to text/plain
RevLine 
[8397]1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21from ea_model.iso_19133_tracking_and_navigation.network.network_model.nt_network import  NT_Network
22from ascore.utils import has_value, collectionProofHash
23
24'''
[8457]25Created on 10-Jul-2012 14:15:03
[8397]26
27@author: mnagni
28'''
29
30class NT_Route(NT_Network):
31        '''
32                Represents a data entity defined in a UML diagram and supposed to
33                be persisted in a relational database.
34 
35                This class has been genererated automatically using the Apache Velocity project.
36        '''
37        '''
38                Please note that any access to the inner attributes should be done using
39                the given get/set methods and NOT accessing them directly.
40        '''
41        def __init__(self):
42                self._nt_network = NT_Network()         
43
44                self.maximalComplex = None
45                self.summary = None
46                self.geometry = None
47                self.geometry = None
48                self.maneuver = []
49                super(NT_Route, self).__init__()
50        @property
51        def turn(self):
52                return self._nt_network.turn
53
54        @turn.setter
55        def turn(self, value): 
56                        self._nt_network.turn = value
57        @property
58        def maximalComplex(self):       
59                return self._nt_network.maximalComplex
60
61        @maximalComplex.setter
62        def maximalComplex(self, value):       
63                        self._nt_network.maximalComplex = value
64        @property
[8457]65        def subComplex(self):   
66                return self._nt_network.subComplex
67
68        @subComplex.setter
69        def subComplex(self, value):   
70                        self._nt_network.subComplex = value
71        @property
[8437]72        def superComplex(self):
73                return self._nt_network.superComplex
74
75        @superComplex.setter
76        def superComplex(self, value): 
77                        self._nt_network.superComplex = value
78        @property
[8397]79        def geometry(self):     
80                return self._nt_network.geometry
81
82        @geometry.setter
83        def geometry(self, value):     
84                        self._nt_network.geometry = value
85        @property
86        def junction(self):     
87                return self._nt_network.junction
88
89        @junction.setter
90        def junction(self, value):     
91                        self._nt_network.junction = value
92        @property
93        def element(self):     
94                return self._nt_network.element
95
96        @element.setter
97        def element(self, value):       
98                        self._nt_network.element = value
99        @property
100        def link(self):
101                return self._nt_network.link
102
103        @link.setter
104        def link(self, value): 
105                        self._nt_network.link = value
106
107        def synchronize(self):
108                pass
109
110        def __key(self):
[8457]111                return (self.turn, self.maximalComplex, self.subComplex, self.superComplex, self.summary, self.geometry, self.junction, self.geometry, self.element, self.link, self.maneuver)
[8397]112
113        def __eq__(self, y):
114                if type(self) != type(y):
115                        return False
116                '''
117                Cannot compare classes which do not define a "__key" attribute
118                '''
119                if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
120                        return self.__key() == y.__key()
121                return id(self) == id(y)
122
123        def __hash__(self):
124                return collectionProofHash(self.__key())
Note: See TracBrowser for help on using the repository browser.