Alarm Objects

Alarm objects represent the state and severity of active alarms, but are otherwise intentionally quite featureless.

They are created and maintained by the Alarm_Manager and sent to any listeners registered in Alarm_Manager.callbacks .

Classes:

Alarm(alarm_type, severity[, start_time, ...])

Representation of alarm status and parameters

class pvp.alarm.alarm.Alarm(alarm_type: pvp.alarm.AlarmType, severity: pvp.alarm.AlarmSeverity, start_time: Optional[float] = None, latch: bool = True, cause: Optional[list] = None, value=None, message=None)[source]

Representation of alarm status and parameters

Parameterized by a Alarm_Rule and managed by Alarm_Manager

Parameters
  • alarm_type (AlarmType) – Type of alarm

  • severity (AlarmSeverity) – Severity of alarm

  • start_time (float) – Timestamp of alarm start, (as generated by time.time()

  • cause (ValueName) – The ValueName that caused the alarm to be fired

  • value (int, float) – optional - numerical value that generated the alarm

  • message (str) – optional - override default text generated by AlarmManager

id

unique alarm ID

Type

int

end_time

If None, alarm has not ended. otherwise timestamp

Type

None, float

active

Whether or not the alarm is currently active

Type

bool

Attributes:

id_counter

used to generate unique IDs for each alarm

severity

Alarm Severity, property without setter to prevent change after instantiation

alarm_type

Alarm Type, property without setter to prevent change after instantiation

Methods:

__init__(alarm_type, severity[, start_time, ...])

param alarm_type

Type of alarm

deactivate()

If active, register an end time and set as active == False Returns:

id_counter = count(0)

used to generate unique IDs for each alarm

Type

itertools.count

__init__(alarm_type: pvp.alarm.AlarmType, severity: pvp.alarm.AlarmSeverity, start_time: Optional[float] = None, latch: bool = True, cause: Optional[list] = None, value=None, message=None)[source]
Parameters
  • alarm_type (AlarmType) – Type of alarm

  • severity (AlarmSeverity) – Severity of alarm

  • start_time (float) – Timestamp of alarm start, (as generated by time.time()

  • cause (ValueName) – The ValueName that caused the alarm to be fired

  • value (int, float) – optional - numerical value that generated the alarm

  • message (str) – optional - override default text generated by AlarmManager

id

unique alarm ID

Type

int

end_time

If None, alarm has not ended. otherwise timestamp

Type

None, float

active

Whether or not the alarm is currently active

Type

bool

property severity: pvp.alarm.AlarmSeverity

Alarm Severity, property without setter to prevent change after instantiation

Returns

AlarmSeverity

property alarm_type: pvp.alarm.AlarmType

Alarm Type, property without setter to prevent change after instantiation

Returns

AlarmType

deactivate()[source]

If active, register an end time and set as active == False Returns: