source: mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19130_sensor_data/location_model/sd_platformdynamics.py @ 8457

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19130_sensor_data/location_model/sd_platformdynamics.py@8457
Revision 8457, 2.7 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
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_19130_sensor_data.location_model.sd_dynamics import  SD_Dynamics
22from ascore.utils import has_value, collectionProofHash
23
24'''
25Created on 10-Jul-2012 14:15:01
26
27@author: mnagni
28'''
29
30class SD_PlatformDynamics(SD_Dynamics):
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._sd_dynamics = SD_Dynamics()       
43
44                self.trueHeading = None
45                self.angularAcceleration = None
46                self.velocity = None
47                self.attitude = None
48                self.yaw = None
49                self.angularVelocity = None
50                self.dateTime = None
51                super(SD_PlatformDynamics, self).__init__()
52        @property
53        def angularAcceleration(self): 
54                return self._sd_dynamics.angularAcceleration
55
56        @angularAcceleration.setter
57        def angularAcceleration(self, value):   
58                        self._sd_dynamics.angularAcceleration = value
59        @property
60        def velocity(self):     
61                return self._sd_dynamics.velocity
62
63        @velocity.setter
64        def velocity(self, value):     
65                        self._sd_dynamics.velocity = value
66        @property
67        def acceleration(self):
68                return self._sd_dynamics.acceleration
69
70        @acceleration.setter
71        def acceleration(self, value): 
72                        self._sd_dynamics.acceleration = value
73        @property
74        def attitude(self):     
75                return self._sd_dynamics.attitude
76
77        @attitude.setter
78        def attitude(self, value):     
79                        self._sd_dynamics.attitude = value
80        @property
81        def angularVelocity(self):     
82                return self._sd_dynamics.angularVelocity
83
84        @angularVelocity.setter
85        def angularVelocity(self, value):       
86                        self._sd_dynamics.angularVelocity = value
87        @property
88        def dateTime(self):     
89                return self._sd_dynamics.dateTime
90
91        @dateTime.setter
92        def dateTime(self, value):     
93                        self._sd_dynamics.dateTime = value
94        @property
95        def relativeVelocity(self):     
96                return self._sd_dynamics.relativeVelocity
97
98        @relativeVelocity.setter
99        def relativeVelocity(self, value):     
100                        self._sd_dynamics.relativeVelocity = value
101
102        def synchronize(self):
103                pass
104
105        def __key(self):
106                return (self.trueHeading, self.angularAcceleration, self.velocity, self.acceleration, self.attitude, self.yaw, self.angularVelocity, self.dateTime, self.relativeVelocity)
107
108        def __eq__(self, y):
109                if type(self) != type(y):
110                        return False
111                '''
112                Cannot compare classes which do not define a "__key" attribute
113                '''
114                if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
115                        return self.__key() == y.__key()
116                return id(self) == id(y)
117
118        def __hash__(self):
119                return collectionProofHash(self.__key())
Note: See TracBrowser for help on using the repository browser.