source: mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19156_2011_observations_and_measurements/observation_schema/coverageobservation/om_discretecoverageobservation.py @ 8457

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19156_2011_observations_and_measurements/observation_schema/coverageobservation/om_discretecoverageobservation.py@8457
Revision 8457, 7.2 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_19156_2011_observations_and_measurements.observation_schema.observation.om_observation import  OM_Observation
22from ascore.utils import has_value, collectionProofHash
23
24'''
25Created on 10-Jul-2012 14:15:07
26
27@author: mnagni
28'''
29
30class OM_DiscreteCoverageObservation(OM_Observation):
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._om_observation = OM_Observation()         
43
44                self.metadata = None
45                self.featureOfInterest = None
46                self.procedure = None
47                self.phenomenonTime = None
48                self.result = None
49                self._result_cvt_discretetimeinstantcoverage = None
50                self._result_cv_discretesolidcoverage = None
51                self._result_cv_discretecurvecoverage = None
52                self._result_cv_discretesurfacecoverage = None
53                self._result_cv_discretepointcoverage = None
54                self._result_cv_discretegridpointcoverage = None
55                self._result = None
56                self.resultTime = None
57                self.validTime = None
58                self.observedProperty = None
59                super(OM_DiscreteCoverageObservation, self).__init__()
60        @property
61        def metadata(self):     
62                return self._om_observation.metadata
63
64        @metadata.setter
65        def metadata(self, value):     
66                        self._om_observation.metadata = value
67        @property
68        def featureOfInterest(self):   
69                return self._om_observation.featureOfInterest
70
71        @featureOfInterest.setter
72        def featureOfInterest(self, value):     
73                        self._om_observation.featureOfInterest = value
74        @property
75        def procedure(self):   
76                return self._om_observation.procedure
77
78        @procedure.setter
79        def procedure(self, value):     
80                        self._om_observation.procedure = value
81        @property
82        def relatedObservation(self):   
83                return self._om_observation.relatedObservation
84
85        @relatedObservation.setter
86        def relatedObservation(self, value):   
87                        self._om_observation.relatedObservation = value
88        @property
89        def phenomenonTime(self):       
90                return self._om_observation.phenomenonTime
91
92        @phenomenonTime.setter
93        def phenomenonTime(self, value):       
94                        self._om_observation.phenomenonTime = value
95        @property
96        def result(self):       
97                return self._om_observation.result
98
99        @result.setter
100        def result(self, value):       
101                        self._om_observation.result = value
102        @property
103        def result(self):       
104                if(has_value(self._result_cvt_discretetimeinstantcoverage)):
105                        return self._result_cvt_discretetimeinstantcoverage
106                if(has_value(self._result_cv_discretesolidcoverage)):
107                        return self._result_cv_discretesolidcoverage
108                if(has_value(self._result_cv_discretecurvecoverage)):
109                        return self._result_cv_discretecurvecoverage
110                if(has_value(self._result_cv_discretesurfacecoverage)):
111                        return self._result_cv_discretesurfacecoverage
112                if(has_value(self._result_cv_discretepointcoverage)):
113                        return self._result_cv_discretepointcoverage
114                if(has_value(self._result_cv_discretegridpointcoverage)):
115                        return self._result_cv_discretegridpointcoverage
116                return  None
117
118        @result.setter
119        def result(self, value):       
120                valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
121                if valueClass == "ea_model.iso_19156_2011_observations_and_measurements.temporal_coverage.cvt_discretetimeinstantcoverage.CVT_DiscreteTimeInstantCoverage":
122                        self._result_cvt_discretetimeinstantcoverage = value
123                        self._result_cv_discretesolidcoverage = None
124                        self._result_cv_discretecurvecoverage = None
125                        self._result_cv_discretesurfacecoverage = None
126                        self._result_cv_discretepointcoverage = None
127                        self._result_cv_discretegridpointcoverage = None
128                if valueClass == "ea_model.iso_19123_2005_coverages.coverages.discrete_coverages.cv_discretesolidcoverage.CV_DiscreteSolidCoverage":
129                        self._result_cv_discretesolidcoverage = value
130                        self._result_cvt_discretetimeinstantcoverage = None
131                        self._result_cv_discretecurvecoverage = None
132                        self._result_cv_discretesurfacecoverage = None
133                        self._result_cv_discretepointcoverage = None
134                        self._result_cv_discretegridpointcoverage = None
135                if valueClass == "ea_model.iso_19123_2005_coverages.coverages.discrete_coverages.cv_discretecurvecoverage.CV_DiscreteCurveCoverage":
136                        self._result_cv_discretecurvecoverage = value
137                        self._result_cvt_discretetimeinstantcoverage = None
138                        self._result_cv_discretesolidcoverage = None
139                        self._result_cv_discretesurfacecoverage = None
140                        self._result_cv_discretepointcoverage = None
141                        self._result_cv_discretegridpointcoverage = None
142                if valueClass == "ea_model.iso_19123_2005_coverages.coverages.discrete_coverages.cv_discretesurfacecoverage.CV_DiscreteSurfaceCoverage":
143                        self._result_cv_discretesurfacecoverage = value
144                        self._result_cvt_discretetimeinstantcoverage = None
145                        self._result_cv_discretesolidcoverage = None
146                        self._result_cv_discretecurvecoverage = None
147                        self._result_cv_discretepointcoverage = None
148                        self._result_cv_discretegridpointcoverage = None
149                if valueClass == "ea_model.iso_19123_2005_coverages.coverages.discrete_coverages.cv_discretepointcoverage.CV_DiscretePointCoverage":
150                        self._result_cv_discretepointcoverage = value
151                        self._result_cvt_discretetimeinstantcoverage = None
152                        self._result_cv_discretesolidcoverage = None
153                        self._result_cv_discretecurvecoverage = None
154                        self._result_cv_discretesurfacecoverage = None
155                        self._result_cv_discretegridpointcoverage = None
156                if valueClass == "ea_model.iso_19123_2005_coverages.coverages.discrete_coverages.cv_discretegridpointcoverage.CV_DiscreteGridPointCoverage":
157                        self._result_cv_discretegridpointcoverage = value
158                        self._result_cvt_discretetimeinstantcoverage = None
159                        self._result_cv_discretesolidcoverage = None
160                        self._result_cv_discretecurvecoverage = None
161                        self._result_cv_discretesurfacecoverage = None
162                        self._result_cv_discretepointcoverage = None
163        @property
164        def resultTime(self):   
165                return self._om_observation.resultTime
166
167        @resultTime.setter
168        def resultTime(self, value):   
169                        self._om_observation.resultTime = value
170        @property
171        def resultQuality(self):       
172                return self._om_observation.resultQuality
173
174        @resultQuality.setter
175        def resultQuality(self, value):
176                        self._om_observation.resultQuality = value
177        @property
178        def validTime(self):   
179                return self._om_observation.validTime
180
181        @validTime.setter
182        def validTime(self, value):     
183                        self._om_observation.validTime = value
184        @property
185        def observedProperty(self):     
186                return self._om_observation.observedProperty
187
188        @observedProperty.setter
189        def observedProperty(self, value):     
190                        self._om_observation.observedProperty = value
191        @property
192        def parameter(self):   
193                return self._om_observation.parameter
194
195        @parameter.setter
196        def parameter(self, value):     
197                        self._om_observation.parameter = value
198
199        def synchronize(self):
200                pass
201
202        def __key(self):
203                return (self.metadata, self.featureOfInterest, self.procedure, self.relatedObservation, self.phenomenonTime, self.result, self.result, self.resultTime, self.resultQuality, self.validTime, self.observedProperty, self.parameter)
204
205        def __eq__(self, y):
206                if type(self) != type(y):
207                        return False
208                '''
209                Cannot compare classes which do not define a "__key" attribute
210                '''
211                if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
212                        return self.__key() == y.__key()
213                return id(self) == id(y)
214
215        def __hash__(self):
216                return collectionProofHash(self.__key())
Note: See TracBrowser for help on using the repository browser.