summaryrefslogtreecommitdiffstats
path: root/Monitoring/MonitoringService/DataProcessing/DataSample.py
blob: ee7245d78f207efc149805ec8b64fa9dd81b1955 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
'''
Created on Mar 4, 2013

@author: steger
'''
from DataProcessing.DataSource import DataSource
from DataProcessing.DataReader import DataReader

class DataSample(DataSource):
    pass

    def __init__(self, table):
        '''
        Constructor
        '''
        DataSource.__init__(self)
        self._data = table
    
    def __len__(self):
        return len(self._data)

    def __getitem__(self, k):
        return None

    @property
    def name(self):
        return "Original(%s)" % self._data.name

    @property
    def readerClass(self):
        return DataReader

    def _process(self):
        status = 0
        with self._data.readlock:
            if self._data.evCleared.isSet():
                self._sourcecleared()
                self._data.evCleared.clear()
                status |= self.CLEARED
            if self._data.evExpanded.isSet():
                self._sourceexpanded()
                self._data.evExpanded.clear()
                status |= self.EXPANDED
        return status
    
    @property
    def writelock(self):
        return self._data.writelock
    
    
    @property
    def um(self):
        return self._data.um