slaclab / pydm

Python Display Manager
http://slaclab.github.io/pydm/
Other
111 stars 76 forks source link

Enable widgets to summarize alarm severities from multiple PVs #1057

Closed shilorigins closed 5 months ago

shilorigins commented 5 months ago

What's the problem this feature will solve?

Some displays need to summarize alarms from multiple PVs e.g. a button that opens a valve status panel will show the highest alarm present in any of the valves. The current workaround is to create a drawing for each alarm state and use visibility rules with calc plugins to show the correct alarm. This involves additional work to set up, is less intuitive than using channels directly, and obstructs common design patterns like layouts.

Describe the solution you'd like

Ideally, I would be able to set a widget's alarm severity using a calc plugin such as calc://summary_alarm?A=PV1.SEVR&B=PV2.SEVR&expr=max(A, B). Maybe widgets could have an additional property called e.g. color channel that accepts the example calc. Maybe a new plugin type could take a list of PVs and summarize their alarms internally, in a way that's compatible with channel's current alarm support. The exact interface is less important than ease of use.

Additional context

mattgibbs commented 5 months ago

Hi @shilorigins,

I think in most cases at SLAC, the best thing to do is use the alarm handler and create a new alarm summary PV, rather than handling this at the display layer. This is more work up front (editing the alarm tree files, restarting the alarm IOC), but there are several advantages:

shilorigins commented 5 months ago

Got it, thanks for the explanation!