readback_value#

class Quality(*values)[source]#

Bases: Enum

Enumeration for data quality indicators.

VALID#

Data is valid and reliable

Type:

int

INVALID#

Data is invalid

Type:

int

ALARM#

Data indicates an alarm condition

Type:

int

CHANGING#

Data is currently changing

Type:

int

WARNING#

Data indicates a warning condition

Type:

int

ALARM = 3#
CHANGING = 4#
INVALID = 2#
VALID = 1#
WARNING = 5#
class Value(value, quality=Quality.VALID, timestamp=None)[source]#

Bases: object

Represents a numerical value with associated quality and timestamp.

This class wraps a scalar or NumPy array and can be used in arithmetic operations and comparisons. It also retains metadata like quality and timestamp.

Parameters:
  • value (float, int or numpy.ndarray) – The numerical value(s) to wrap.

  • quality (Quality, optional) – The quality of the value. Defaults to Quality.VALID.

  • timestamp (datetime, optional) – Timestamp associated with the value. Defaults to current time.

is_good()[source]#

Check if the value quality is good.

Returns:

bool – True if the quality is VALID or CHANGING.