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

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@8437
Revision 8437, 2.6 KB checked in by mnagni, 7 years ago (diff)

Added a new function to ascore.utils in order to synchronize classes before committing to database

The following constraints has been added to the official model:

MO_ObservationCollection:member:CEDA_Observation
MO_ObservationCollection:phenomenonTime:TM_GeometricPrimitive
MO_Project:observationCollection:CEDA_ObservationCollection
MO_Observation:result:CEDA_Result
MO_Observation:inSupportOf:CEDA_Project
MO_Project:subProject:CEDA_Project
OM_Observation:procedure:CEDA_Process
OM_Observation:phenomenonTime:TM_GeometricPrimitive
MO_ResponsiblePartyFunctionValue:CEDA_RoleValue

  • Property svn:mime-type set to text/plain
Line 
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'''
25Created on 06-Jul-2012 07:43:16
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
65        def superComplex(self):
66                return self._nt_network.superComplex
67
68        @superComplex.setter
69        def superComplex(self, value): 
70                        self._nt_network.superComplex = value
71        @property
72        def subComplex(self):   
73                return self._nt_network.subComplex
74
75        @subComplex.setter
76        def subComplex(self, value):   
77                        self._nt_network.subComplex = value
78        @property
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):
111                return (self.turn, self.maximalComplex, self.superComplex, self.subComplex, self.summary, self.geometry, self.junction, self.geometry, self.element, self.link, self.maneuver)
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.