source: mauRepo/MolesManager/trunk/src/ea_model/iso_19130_sensor_data/replacement/sd_localmodel.py @ 8091

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/ea_model/iso_19130_sensor_data/replacement/sd_localmodel.py@8091
Revision 8091, 4.8 KB checked in by mnagni, 8 years ago (diff)

The migration process now includes
1) deployment_data files
2) XML document hash
3) full Dojo support


Line 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21from ascore.utils import has_value
22
23'''
24Created on 16-Feb-2012 16:18:11
25
26@author: mnagni
27'''
28
29class SD_LocalModel(object):
30    '''
31        Represents a data entity defined in a UML diagram and supposed to
32        be persisted in a relational database.
33 
34        This class has been genererated automatically using the Apache Velocity project.
35    '''
36    '''
37        Please note that any access to the inner attributes should be done using
38        the given get/set methods and NOT accessing them directly.
39    '''
40    def __init__(self):
41
42        self.identifier = None
43        self.childModel = []
44        self._localGeolocationInformation_sd_gcpcollection = None
45        self._localGeolocationInformation_sd_sensormodel = None
46        self._localGeolocationInformation_sd_functionalfitmodel = None
47        self._localGeolocationInformation_sd_multimodel = None
48        self._localGeolocationInformation_sd_rasterdigitisedproduct = None
49        self.parentModel = None
50        self.regionOfValidity = []
51        super(SD_LocalModel, self).__init__()
52
53    @property
54    def localGeolocationInformation(self):     
55        if(has_value(self._localGeolocationInformation_sd_gcpcollection)):
56            return self._localGeolocationInformation_sd_gcpcollection
57        if(has_value(self._localGeolocationInformation_sd_sensormodel)):
58            return self._localGeolocationInformation_sd_sensormodel
59        if(has_value(self._localGeolocationInformation_sd_functionalfitmodel)):
60            return self._localGeolocationInformation_sd_functionalfitmodel
61        if(has_value(self._localGeolocationInformation_sd_multimodel)):
62            return self._localGeolocationInformation_sd_multimodel
63        if(has_value(self._localGeolocationInformation_sd_rasterdigitisedproduct)):
64            return self._localGeolocationInformation_sd_rasterdigitisedproduct
65        return  None
66
67    @localGeolocationInformation.setter
68    def localGeolocationInformation(self, value):       
69        valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
70        if valueClass == "ea_model.iso_19130_sensor_data.ground_control.sd_gcpcollection.SD_GCPCollection":
71            self._localGeolocationInformation_sd_gcpcollection = value
72            self._localGeolocationInformation_sd_sensormodel = None
73            self._localGeolocationInformation_sd_functionalfitmodel = None
74            self._localGeolocationInformation_sd_multimodel = None
75            self._localGeolocationInformation_sd_rasterdigitisedproduct = None
76        if valueClass == "ea_model.iso_19130_sensor_data.sensor_model.sd_sensormodel.SD_SensorModel":
77            self._localGeolocationInformation_sd_sensormodel = value
78            self._localGeolocationInformation_sd_gcpcollection = None
79            self._localGeolocationInformation_sd_functionalfitmodel = None
80            self._localGeolocationInformation_sd_multimodel = None
81            self._localGeolocationInformation_sd_rasterdigitisedproduct = None
82        if valueClass == "ea_model.iso_19130_sensor_data.functional_fit.sd_functionalfitmodel.SD_FunctionalFitModel":
83            self._localGeolocationInformation_sd_functionalfitmodel = value
84            self._localGeolocationInformation_sd_gcpcollection = None
85            self._localGeolocationInformation_sd_sensormodel = None
86            self._localGeolocationInformation_sd_multimodel = None
87            self._localGeolocationInformation_sd_rasterdigitisedproduct = None
88        if valueClass == "ea_model.iso_19130_sensor_data.sd_multimodel.SD_MultiModel":
89            self._localGeolocationInformation_sd_multimodel = value
90            self._localGeolocationInformation_sd_gcpcollection = None
91            self._localGeolocationInformation_sd_sensormodel = None
92            self._localGeolocationInformation_sd_functionalfitmodel = None
93            self._localGeolocationInformation_sd_rasterdigitisedproduct = None
94        if valueClass == "ea_model.iso_19130_sensor_data.raster_digitised_product.sd_rasterdigitisedproduct.SD_RasterDigitisedProduct":
95            self._localGeolocationInformation_sd_rasterdigitisedproduct = value
96            self._localGeolocationInformation_sd_gcpcollection = None
97            self._localGeolocationInformation_sd_sensormodel = None
98            self._localGeolocationInformation_sd_functionalfitmodel = None
99            self._localGeolocationInformation_sd_multimodel = None
100
101    def __key(self):
102        return (self.identifier, self.childModel, self.localGeolocationInformation, self.parentModel, self.regionOfValidity)
103
104    def __eq__(self, y):
105        '''
106        Cannot compare classes which do not define a "__key" attribute
107        '''
108        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
109            return self.__key() == y.__key()
110        return id(self) == id(y)
111
112    def __hash__(self):
113        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.