source: mauRepo/MolesManager/trunk/src/ea_model/iso_19130_sensor_data/sensor_model/sd_sensor.py @ 8091

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/ea_model/iso_19130_sensor_data/sensor_model/sd_sensor.py@8091
Revision 8091, 2.5 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_19115_2_2009_metadata___imagery.acquisition_information___imagery.mi_instrument import  MI_Instrument
22from ascore.utils import has_value
23
24'''
25Created on 16-Feb-2012 16:18:09
26
27@author: mnagni
28'''
29
30class SD_Sensor(MI_Instrument):
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._mi_instrument = MI_Instrument()   
43
44        self.identifier = None
45        self.type = None
46        self.status = None
47        self.mountedOn = None
48        self.platformReference = None
49        self.description = None
50        self.calibration = None
51        self.mode = []
52        self.operationalBand = []
53        self.citation = []
54        super(SD_Sensor, self).__init__()
55
56    @property
57    def identifier(self):       
58        return self._mi_instrument.identifier
59
60    @identifier.setter
61    def identifier(self, value):       
62            self._mi_instrument.identifier = value
63
64    @property
65    def type(self):     
66        return self._mi_instrument.type
67
68    @type.setter
69    def type(self, value):     
70            self._mi_instrument.type = value
71
72    @property
73    def mountedOn(self):       
74        return self._mi_instrument.mountedOn
75
76    @mountedOn.setter
77    def mountedOn(self, value): 
78            self._mi_instrument.mountedOn = value
79
80    @property
81    def description(self):     
82        return self._mi_instrument.description
83
84    @description.setter
85    def description(self, value):       
86            self._mi_instrument.description = value
87
88    @property
89    def citation(self): 
90        return self._mi_instrument.citation
91
92    @citation.setter
93    def citation(self, value): 
94            self._mi_instrument.citation = value
95
96    def __key(self):
97        return (self.identifier, self.type, self.status, self.mountedOn, self.platformReference, self.description, self.calibration, self.mode, self.operationalBand, self.citation)
98
99    def __eq__(self, y):
100        '''
101        Cannot compare classes which do not define a "__key" attribute
102        '''
103        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
104            return self.__key() == y.__key()
105        return id(self) == id(y)
106
107    def __hash__(self):
108        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.