source: mauRepo/MolesManager/trunk/src/ea_model/iso_19130_sensor_data/raster_digitised_product/sd_rasterdigitisedproduct.py @ 8091

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/ea_model/iso_19130_sensor_data/raster_digitised_product/sd_rasterdigitisedproduct.py@8091
Revision 8091, 4.9 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 ea_model.iso_19130_sensor_data.sd_geolocationinformation import  SD_GeolocationInformation
22from ascore.utils import has_value
23
24'''
25Created on 16-Feb-2012 16:18:09
26
27@author: mnagni
28'''
29
30class SD_RasterDigitisedProduct(SD_GeolocationInformation):
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_geolocationinformation = SD_GeolocationInformation()   
43
44        self.interiorOrientation = None
45        self.detectorArray = None
46        self.qualityInfo = []
47        self._scannerControlPoint_sd_gcpsurvey = None
48        self._scannerControlPoint_sd_gcplibrary = None
49        self._scannerControlPoint_sd_gcplocation = None
50        self._scannerControlPoint_sd_gcpregistry = None
51        self._hardcopy_sd_paper = []
52        self._hardcopy_sd_film = []
53        self.scannerTransformation = None
54        super(SD_RasterDigitisedProduct, self).__init__()
55
56    @property
57    def qualityInfo(self):     
58        return self._sd_geolocationinformation.qualityInfo
59
60    @qualityInfo.setter
61    def qualityInfo(self, value):       
62            self._sd_geolocationinformation.qualityInfo = value
63
64    @property
65    def scannerControlPoint(self):     
66        if(has_value(self._scannerControlPoint_sd_gcpsurvey)):
67            return self._scannerControlPoint_sd_gcpsurvey
68        if(has_value(self._scannerControlPoint_sd_gcplibrary)):
69            return self._scannerControlPoint_sd_gcplibrary
70        if(has_value(self._scannerControlPoint_sd_gcplocation)):
71            return self._scannerControlPoint_sd_gcplocation
72        if(has_value(self._scannerControlPoint_sd_gcpregistry)):
73            return self._scannerControlPoint_sd_gcpregistry
74        return  None
75
76    @scannerControlPoint.setter
77    def scannerControlPoint(self, value):       
78        valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
79        if valueClass == "ea_model.iso_19130_sensor_data.ground_control.sd_gcpsurvey.SD_GCPSurvey":
80            self._scannerControlPoint_sd_gcpsurvey = value
81            self._scannerControlPoint_sd_gcplibrary = None
82            self._scannerControlPoint_sd_gcplocation = None
83            self._scannerControlPoint_sd_gcpregistry = None
84        if valueClass == "ea_model.iso_19130_sensor_data.ground_control.sd_gcplibrary.SD_GCPLibrary":
85            self._scannerControlPoint_sd_gcplibrary = value
86            self._scannerControlPoint_sd_gcpsurvey = None
87            self._scannerControlPoint_sd_gcplocation = None
88            self._scannerControlPoint_sd_gcpregistry = None
89        if valueClass == "ea_model.iso_19130_sensor_data.ground_control.sd_gcplocation.SD_GCPLocation":
90            self._scannerControlPoint_sd_gcplocation = value
91            self._scannerControlPoint_sd_gcpsurvey = None
92            self._scannerControlPoint_sd_gcplibrary = None
93            self._scannerControlPoint_sd_gcpregistry = None
94        if valueClass == "ea_model.iso_19130_sensor_data.ground_control.sd_gcpregistry.SD_GCPRegistry":
95            self._scannerControlPoint_sd_gcpregistry = value
96            self._scannerControlPoint_sd_gcpsurvey = None
97            self._scannerControlPoint_sd_gcplibrary = None
98            self._scannerControlPoint_sd_gcplocation = None
99
100    @property
101    def hardcopy(self): 
102        ret = []
103        for item in self._hardcopy_sd_paper:
104            ret.append(item)
105        for item in self._hardcopy_sd_film:
106            ret.append(item)
107        return ret
108
109    @hardcopy.setter
110    def hardcopy(self, value): 
111        if isinstance(value, list):
112            self._hardcopy_sd_paper[:]
113            self._hardcopy_sd_film[:]
114            for item in value:
115                valueClass = "%s.%s" % (type(item).__module__,type(item).__name__)
116                if valueClass == "ea_model.iso_19130_sensor_data.raster_digitised_product.sd_paper.SD_Paper":
117                    self._hardcopy_sd_paper.append(item)
118                    continue
119                if valueClass == "ea_model.iso_19130_sensor_data.raster_digitised_product.sd_film.SD_Film":
120                    self._hardcopy_sd_film.append(item)
121                    continue
122
123    def __key(self):
124        return (self.interiorOrientation, self.detectorArray, self.qualityInfo, self.scannerControlPoint, self.hardcopy, self.scannerTransformation)
125
126    def __eq__(self, y):
127        '''
128        Cannot compare classes which do not define a "__key" attribute
129        '''
130        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
131            return self.__key() == y.__key()
132        return id(self) == id(y)
133
134    def __hash__(self):
135        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.