Part 6: Alarms and Events¶
Static AlarmSet.Base description¶
Alarm is the only public Part 6 model in the initial implementation.
AlarmGroup, alarm texts, and their CAEX references are generated internally by
the MTPGenerator. Register
alarms with PEA.add_alarm. The API does not expose
alarm runtime state or acknowledgement methods.
mtppy.part6.alarm_set.alarm.Alarm(tag_name, data_assembly, trigger, trigger_value, message, ack_required, severity)
dataclass
¶
Describe a POL-evaluated AlarmSet.Base alarm.
The alarm links a value of an existing DataItem to static alarm metadata in the generated MTP. It does not observe the DataItem or maintain alarm state inside the PEA.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tag_name
|
str
|
Unique alarm name within the PEA. |
required |
data_assembly
|
DataAssembly
|
DataAssembly containing the trigger DataItem. |
required |
trigger
|
DataItem
|
Existing DataItem used as the alarm trigger. |
required |
trigger_value
|
object
|
Value for which the POL considers the alarm active. |
required |
message
|
str
|
Operator-facing alarm message. |
required |
ack_required
|
bool
|
Whether the POL should require acknowledgement. |
required |
severity
|
int
|
Alarm severity in the inclusive range from 1 to 1000. |
required |
Raises:
| Type | Description |
|---|---|
TypeError
|
If an argument has an unsupported type. |
ValueError
|
If text is empty, severity is out of range, or the trigger does not belong to the DataAssembly. |
validate()
¶
Revalidate this alarm and its mutable DataItem reference.
Raises:
| Type | Description |
|---|---|
TypeError
|
If a field or trigger type is unsupported. |
ValueError
|
If a value is outside its permitted range or the trigger no longer belongs to the configured DataAssembly. |