source: mauRepo/MolesManager/trunk/src/ea_model/iso_19130_sensor_data/parameter_model/sd_sampleset.py @ 8197

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

New database schema where URL class is a string and MO_Project.subProject use CEDA_Project as subType

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.parameter_model.sd_parameterset import  SD_ParameterSet
22from ascore.utils import has_value, collectionProofHash
23
24'''
25Created on 30-Mar-2012 16:45:20
26
27@author: mnagni
28'''
29
30class SD_SampleSet(SD_ParameterSet):
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_parameterset = SD_ParameterSet()       
43
44        self.fieldOfView = None
45        self.storageSize = None
46        self.sequenceNumber = None
47        self.detectionBand = None
48        self.dataJustification = None
49        self.meanDopplerFrequency = None
50        self.position = None
51        self.time = None
52        self.sampleSize = None
53        self.lookBand = None
54        super(SD_SampleSet, self).__init__()
55
56    @property
57    def fieldOfView(self):     
58        return self._sd_parameterset.fieldOfView
59
60    @fieldOfView.setter
61    def fieldOfView(self, value):       
62            self._sd_parameterset.fieldOfView = value
63
64    @property
65    def storageSize(self):     
66        return self._sd_parameterset.storageSize
67
68    @storageSize.setter
69    def storageSize(self, value):       
70            self._sd_parameterset.storageSize = value
71
72    @property
73    def position(self): 
74        return self._sd_parameterset.position
75
76    @position.setter
77    def position(self, value): 
78            self._sd_parameterset.position = value
79
80    @property
81    def time(self):     
82        return self._sd_parameterset.time
83
84    @time.setter
85    def time(self, value):     
86            self._sd_parameterset.time = value
87
88    def __key(self):
89        return (self.fieldOfView, self.storageSize, self.sequenceNumber, self.detectionBand, self.dataJustification, self.meanDopplerFrequency, self.position, self.time, self.sampleSize, self.lookBand)
90
91    def __eq__(self, y):
92        if type(self) != type(y):
93            return False
94        '''
95        Cannot compare classes which do not define a "__key" attribute
96        '''
97        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
98            return self.__key() == y.__key()
99        return id(self) == id(y)
100
101    def __hash__(self):
102        return collectionProofHash(self.__key())
Note: See TracBrowser for help on using the repository browser.