Skip to content
Snippets Groups Projects
Commit 7b6f02c4 authored by Stefano Borini's avatar Stefano Borini
Browse files

Added new flag to DataValue to store KPI status

parent b82b6044
No related branches found
No related tags found
1 merge request!119Added new flag is_kpi to DataValue
from traits.api import HasStrictTraits, Any, String, Enum from traits.api import HasStrictTraits, Any, String, Enum, Bool
class DataValue(HasStrictTraits): class DataValue(HasStrictTraits):
...@@ -22,6 +22,9 @@ class DataValue(HasStrictTraits): ...@@ -22,6 +22,9 @@ class DataValue(HasStrictTraits):
#: A flag for the quality of the data. #: A flag for the quality of the data.
quality = Enum("AVERAGE", "POOR", "GOOD") quality = Enum("AVERAGE", "POOR", "GOOD")
# Set by the engine. True if the data value contains a KPI.
is_kpi = Bool(False)
def __str__(self): def __str__(self):
s = "{} {} = {}".format( s = "{} {} = {}".format(
...@@ -31,4 +34,8 @@ class DataValue(HasStrictTraits): ...@@ -31,4 +34,8 @@ class DataValue(HasStrictTraits):
s += " +/- {}".format(str(self.accuracy)) s += " +/- {}".format(str(self.accuracy))
s += " ({})".format(str(self.quality)) s += " ({})".format(str(self.quality))
if self.is_kpi:
s += " (KPI)"
return s return s
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment