-
Notifications
You must be signed in to change notification settings - Fork 1
Alarm sensitivity
Will Rogers edited this page Oct 13, 2020
·
8 revisions
If a widget has an associated PV, you may want to configure it to be alarm-sensitive - that is, change its appearance depending on the PV's alarm status.
- define CSS custom properties for any theme colours, including disconnected, minor alarm, major alarm, invalid
- if a widget is disconnected, replace its border with 2px dotted disconnected
- have one
alarmSensitive
property and allow the creator to define how the widget reacts to that, using the following mechanism:- give string values to the
AlarmQuality
enum (e.g.valid
,alarm
) - use classes with these names in the
.module.css
file for each widget to define the appearance (e.g..alarm
) - if
alarmSensitive
is true for a widget, add the relevant alarm quality as a class to the appropriate element (e.g.<div class=`readback ${alarmQuality}`>
)
- give string values to the
- parse specific properties in
.opi
files (e.g.foreColorAlarmSensitive
) as additional rules, so that it is possible to be backward-compatible
Colors for minor alarm, major alarm, **invalid **and disconnected are configured in colors.def
.
Widgets with PVs typically have the following boolean properties, triggered if the alarm state is not 'valid':
- border alarm sensitive: if alarm not valid, replace the configured border with a 2px solid border of the alarm colour
- foreground colour alarm sensitive: replace the configured foreground colour with the alarm colour
- background colour alarm sensitive: replace the configured background colour with the alarm colour
If none of these properties are set to true, alarm state will not affect the widget's appearance.
If the PV is disconnected, all components will display this in a different way (a block of the disconnected colour at the top of the widget); this is not configurable.