diff options
author | pikusa <pikusa@man.poznan.pl> | 2013-04-03 13:18:17 (GMT) |
---|---|---|
committer | pikusa <pikusa@man.poznan.pl> | 2013-04-03 13:18:17 (GMT) |
commit | 2f2a3a129c91de540e66c3bfbe30b0df1942cd4b (patch) | |
tree | 2d313cdf0068af368d4de6067d676be16f6a6464 /Monitoring/MonitoringService/DataProcessing/Bool.py | |
parent | ff8aa232b071a9b54dff833714a870fd0aec0b30 (diff) | |
download | novi-public-2f2a3a129c91de540e66c3bfbe30b0df1942cd4b.zip novi-public-2f2a3a129c91de540e66c3bfbe30b0df1942cd4b.tar.gz novi-public-2f2a3a129c91de540e66c3bfbe30b0df1942cd4b.tar.bz2 |
project commit and dir tree change
Diffstat (limited to 'Monitoring/MonitoringService/DataProcessing/Bool.py')
-rw-r--r-- | Monitoring/MonitoringService/DataProcessing/Bool.py | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Monitoring/MonitoringService/DataProcessing/Bool.py b/Monitoring/MonitoringService/DataProcessing/Bool.py new file mode 100644 index 0000000..54cbb4e --- /dev/null +++ b/Monitoring/MonitoringService/DataProcessing/Bool.py @@ -0,0 +1,62 @@ +''' +Created on Mar 22, 2013 + +@author: steger +''' +from DataProcessing.DataError import DataError + +#FIXME: this is a DataSource? +class Comparator(object): + ''' + classdocs + ''' + def __init__(self, datasource): + self._datasource = datasource + + @property + def value(self): + raise DataError("Implement value property") + +class IsPositive(Comparator): + ''' + ''' + @property + def name(self): + return "IsPositive(%s)" % self._datasource.name + + @property + def value(self): + return self._datasource.value > 0 + +class IsNegative(Comparator): + ''' + ''' + @property + def name(self): + return "IsNegative(%s)" % self._datasource.name + + @property + def value(self): + return self._datasource.value < 0 + +class IsNotPositive(Comparator): + ''' + ''' + @property + def name(self): + return "IsNotPositive(%s)" % self._datasource.name + + @property + def value(self): + return self._datasource.value <= 0 + +class IsNotNegative(Comparator): + ''' + ''' + @property + def name(self): + return "IsNotNegative(%s)" % self._datasource.name + + @property + def value(self): + return self._datasource.value >= 0
\ No newline at end of file |