source: mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19130_sensor_data/sensor_model/sd_sensormodel.py @ 8457

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19130_sensor_data/sensor_model/sd_sensormodel.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 
[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_19115_2_2009_metadata___imagery.spatial_representation_information___imagery.mi_geolocationinformation import  MI_GeolocationInformation
22from ea_model.iso_19130_sensor_data.sd_geolocationinformation import  SD_GeolocationInformation
23from ascore.utils import has_value, collectionProofHash
24
25'''
[8457]26Created on 10-Jul-2012 14:15:08
[8398]27
28@author: mnagni
29'''
30
31class SD_SensorModel(MI_GeolocationInformation,SD_GeolocationInformation):
32        '''
33                Represents a data entity defined in a UML diagram and supposed to
34                be persisted in a relational database.
35 
36                This class has been genererated automatically using the Apache Velocity project.
37        '''
38        '''
39                Please note that any access to the inner attributes should be done using
40                the given get/set methods and NOT accessing them directly.
41        '''
42        def __init__(self):
43                self._sd_geolocationinformation = SD_GeolocationInformation()   
44                self._mi_geolocationinformation = MI_GeolocationInformation()   
45
46                self.platformParameters = None
[8457]47                self._sensorParameters_sd_mtiparameters = None
[8437]48                self._sensorParameters_sd_imageryparameters = None
[8398]49                self._sensorParameters = None
50                super(SD_SensorModel, self).__init__()
51        @property
52        def qualityInfo(self): 
53                return self._sd_geolocationinformation.qualityInfo
54
55        @qualityInfo.setter
56        def qualityInfo(self, value):   
57                        self._sd_geolocationinformation.qualityInfo = value
58        @property
59        def sensorParameters(self):     
[8457]60                if(has_value(self._sensorParameters_sd_mtiparameters)):
61                        return self._sensorParameters_sd_mtiparameters
[8437]62                if(has_value(self._sensorParameters_sd_imageryparameters)):
63                        return self._sensorParameters_sd_imageryparameters
[8398]64                return  None
65
66        @sensorParameters.setter
67        def sensorParameters(self, value):     
68                valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
[8457]69                if valueClass == "ea_model.iso_19130_sensor_data.sensor_model.sd_mtiparameters.SD_MTIParameters":
70                        self._sensorParameters_sd_mtiparameters = value
71                        self._sensorParameters_sd_imageryparameters = None
[8437]72                if valueClass == "ea_model.iso_19130_sensor_data.sensor_model.sd_imageryparameters.SD_ImageryParameters":
73                        self._sensorParameters_sd_imageryparameters = value
74                        self._sensorParameters_sd_mtiparameters = None
[8398]75
76        def synchronize(self):
77                pass
78
79        def __key(self):
80                return (self.platformParameters, self.qualityInfo, self.sensorParameters)
81
82        def __eq__(self, y):
83                if type(self) != type(y):
84                        return False
85                '''
86                Cannot compare classes which do not define a "__key" attribute
87                '''
88                if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
89                        return self.__key() == y.__key()
90                return id(self) == id(y)
91
92        def __hash__(self):
93                return collectionProofHash(self.__key())
Note: See TracBrowser for help on using the repository browser.