source: mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19156_2011_observations_and_measurements/sampling_coverage_observation/samplingcoverageobservation.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/sampling_coverage_observation/samplingcoverageobservation.py@8457
Revision 8457, 6.1 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 
[8398]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.coverageobservation.om_discretecoverageobservation import  OM_DiscreteCoverageObservation
22from ascore.utils import has_value, collectionProofHash
23
24'''
[8457]25Created on 10-Jul-2012 14:15:11
[8398]26
27@author: mnagni
28'''
29
30class SamplingCoverageObservation(OM_DiscreteCoverageObservation):
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_discretecoverageobservation = OM_DiscreteCoverageObservation()         
43
44                self.metadata = None
45                self._featureOfInterest_sf_samplingsolid = None
[8457]46                self._featureOfInterest_sf_samplingcurve = None
47                self._featureOfInterest_sf_samplingsurface = None
[8398]48                self._featureOfInterest_sf_samplingpoint = None
49                self._featureOfInterest = None
[8457]50                self.procedure = None
[8437]51                self.phenomenonTime = None
[8398]52                self.result = None
53                self.result = None
54                self.resultTime = None
55                self.validTime = None
56                self.observedProperty = None
57                super(SamplingCoverageObservation, self).__init__()
58        @property
59        def metadata(self):     
60                return self._om_discretecoverageobservation.metadata
61
62        @metadata.setter
63        def metadata(self, value):     
64                        self._om_discretecoverageobservation.metadata = value
65        @property
66        def featureOfInterest(self):   
67                if(has_value(self._featureOfInterest_sf_samplingsolid)):
68                        return self._featureOfInterest_sf_samplingsolid
[8457]69                if(has_value(self._featureOfInterest_sf_samplingcurve)):
70                        return self._featureOfInterest_sf_samplingcurve
71                if(has_value(self._featureOfInterest_sf_samplingsurface)):
72                        return self._featureOfInterest_sf_samplingsurface
[8398]73                if(has_value(self._featureOfInterest_sf_samplingpoint)):
74                        return self._featureOfInterest_sf_samplingpoint
75                return  None
76
77        @featureOfInterest.setter
78        def featureOfInterest(self, value):     
79                valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
80                if valueClass == "ea_model.iso_19156_2011_observations_and_measurements.sampling_features.samplingsolid.sf_samplingsolid.SF_SamplingSolid":
81                        self._featureOfInterest_sf_samplingsolid = value
[8457]82                        self._featureOfInterest_sf_samplingcurve = None
83                        self._featureOfInterest_sf_samplingsurface = None
[8398]84                        self._featureOfInterest_sf_samplingpoint = None
[8457]85                if valueClass == "ea_model.iso_19156_2011_observations_and_measurements.sampling_features.samplingcurve.sf_samplingcurve.SF_SamplingCurve":
86                        self._featureOfInterest_sf_samplingcurve = value
[8398]87                        self._featureOfInterest_sf_samplingsolid = None
88                        self._featureOfInterest_sf_samplingsurface = None
[8457]89                        self._featureOfInterest_sf_samplingpoint = None
[8398]90                if valueClass == "ea_model.iso_19156_2011_observations_and_measurements.sampling_features.samplingsurface.sf_samplingsurface.SF_SamplingSurface":
91                        self._featureOfInterest_sf_samplingsurface = value
[8437]92                        self._featureOfInterest_sf_samplingsolid = None
[8457]93                        self._featureOfInterest_sf_samplingcurve = None
[8437]94                        self._featureOfInterest_sf_samplingpoint = None
[8457]95                if valueClass == "ea_model.iso_19156_2011_observations_and_measurements.sampling_features.samplingpoint.sf_samplingpoint.SF_SamplingPoint":
96                        self._featureOfInterest_sf_samplingpoint = value
97                        self._featureOfInterest_sf_samplingsolid = None
[8398]98                        self._featureOfInterest_sf_samplingcurve = None
[8437]99                        self._featureOfInterest_sf_samplingsurface = None
[8398]100        @property
[8457]101        def procedure(self):   
102                return self._om_discretecoverageobservation.procedure
[8398]103
[8457]104        @procedure.setter
105        def procedure(self, value):     
106                        self._om_discretecoverageobservation.procedure = value
[8398]107        @property
108        def relatedObservation(self):   
109                return self._om_discretecoverageobservation.relatedObservation
110
111        @relatedObservation.setter
112        def relatedObservation(self, value):   
113                        self._om_discretecoverageobservation.relatedObservation = value
114        @property
[8457]115        def phenomenonTime(self):       
116                return self._om_discretecoverageobservation.phenomenonTime
[8437]117
[8457]118        @phenomenonTime.setter
119        def phenomenonTime(self, value):       
120                        self._om_discretecoverageobservation.phenomenonTime = value
[8437]121        @property
[8398]122        def result(self):       
123                return self._om_discretecoverageobservation.result
124
125        @result.setter
126        def result(self, value):       
127                        self._om_discretecoverageobservation.result = value
128        @property
129        def result(self):       
130                return self._om_discretecoverageobservation.result
131
132        @result.setter
133        def result(self, value):       
134                        self._om_discretecoverageobservation.result = value
135        @property
136        def resultTime(self):   
137                return self._om_discretecoverageobservation.resultTime
138
139        @resultTime.setter
140        def resultTime(self, value):   
141                        self._om_discretecoverageobservation.resultTime = value
142        @property
[8457]143        def resultQuality(self):       
144                return self._om_discretecoverageobservation.resultQuality
145
146        @resultQuality.setter
147        def resultQuality(self, value):
148                        self._om_discretecoverageobservation.resultQuality = value
149        @property
[8437]150        def validTime(self):   
151                return self._om_discretecoverageobservation.validTime
152
153        @validTime.setter
154        def validTime(self, value):     
155                        self._om_discretecoverageobservation.validTime = value
156        @property
[8398]157        def observedProperty(self):     
158                return self._om_discretecoverageobservation.observedProperty
159
160        @observedProperty.setter
161        def observedProperty(self, value):     
162                        self._om_discretecoverageobservation.observedProperty = value
163        @property
164        def parameter(self):   
165                return self._om_discretecoverageobservation.parameter
166
167        @parameter.setter
168        def parameter(self, value):     
169                        self._om_discretecoverageobservation.parameter = value
170
171        def synchronize(self):
172                pass
173
174        def __key(self):
[8457]175                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)
[8398]176
177        def __eq__(self, y):
178                if type(self) != type(y):
179                        return False
180                '''
181                Cannot compare classes which do not define a "__key" attribute
182                '''
183                if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
184                        return self.__key() == y.__key()
185                return id(self) == id(y)
186
187        def __hash__(self):
188                return collectionProofHash(self.__key())
Note: See TracBrowser for help on using the repository browser.