Skip to content

Commit

Permalink
Added tango delta_t and delta_val alarm parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
evalott100 committed Dec 11, 2024
1 parent f63fbb4 commit 631c5c0
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
27 changes: 26 additions & 1 deletion src/event_model/documents/event_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,39 @@ class LimitsRange(TypedDict):

class Limits(TypedDict):
"""
Epics limits:
Epics and tango limits:
see 3.4.1 https://epics.anl.gov/base/R3-14/12-docs/AppDevGuide/node4.html
and
https://tango-controls.readthedocs.io/en/latest/development/device-api/attribute-alarms.html#the-read-different-than-set-rds-alarm
"""

control: NotRequired[Annotated[LimitsRange, Field(description="Control limits.")]]
display: NotRequired[Annotated[LimitsRange, Field(description="Display limits.")]]
warning: NotRequired[Annotated[LimitsRange, Field(description="Warning limits.")]]
alarm: NotRequired[Annotated[LimitsRange, Field(description="Alarm limits.")]]
delta_t: NotRequired[
Annotated[
float,
Field(
description=(
"ms since last update to fail after if set point and "
"read point are not within `delta_val` of each other."
)
),
]
]
delta_val: NotRequired[
Annotated[
float,
Field(
description=(
"Allowed difference in value between set point and read point "
"after `delta_t`."
)
),
]
]


_ConstrainedDtype = Annotated[
Expand Down
12 changes: 11 additions & 1 deletion src/event_model/schemas/event_descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
},
"Limits": {
"title": "Limits",
"description": "Epics limits:\nsee 3.4.1 https://epics.anl.gov/base/R3-14/12-docs/AppDevGuide/node4.html",
"description": "Epics and tango limits:\nsee 3.4.1 https://epics.anl.gov/base/R3-14/12-docs/AppDevGuide/node4.html\n\nand\nhttps://tango-controls.readthedocs.io/en/latest/development/device-api/attribute-alarms.html#the-read-different-than-set-rds-alarm",
"type": "object",
"properties": {
"alarm": {
Expand All @@ -161,6 +161,16 @@
"description": "Control limits.",
"$ref": "#/$defs/LimitsRange"
},
"delta_t": {
"title": "Delta T",
"description": "ms since last update to fail after if set point and read point are not within `delta_val` of each other.",
"type": "number"
},
"delta_val": {
"title": "Delta Val",
"description": "Allowed difference in value between set point and read point after `delta_t`.",
"type": "number"
},
"display": {
"description": "Display limits.",
"$ref": "#/$defs/LimitsRange"
Expand Down

0 comments on commit 631c5c0

Please sign in to comment.