p4p icon indicating copy to clipboard operation
p4p copied to clipboard

New methods for Handler and SharedPV

Open Monarda opened this issue 7 months ago • 0 comments

[This issue is related to PR #172]

Following on from conversations at the Spring 2025 EPICS Collaboration meeting I've begun looking at what it would take to create a new module that would implement the logic of the Normative Types, e.g. control limits, setting alarm status and severity automatically based on alarm limits, etc.. The structure of the Normative Types are already implemented in p4p.

I believe this may be done with the existing Handler system, and we have a prototype implementation using a derivative of that already.

However, I believe that some additional Handler functionality is required to handle the following hypothetical situation:

pv = SharedPV(
    nt=NTScalar("d", control=True),
    handler=SimpleControl(),
    initial={
        "value": 12.0,
        "control.limitHigh": 11,
        "control.limitLow": -1,
        "control.minStep": 2,
    },  # Immediately limited to 11 due to handler
)

Here the initial value is outside the control limits and must be immeditately limited by the handler. This may be achieved by adding open callback methods to the Handler and SharedPV.

We can imagine a similar situation in which alarm limits have been set. The status and severity updates would need to be triggered even if it's a post that updates the value.

Of course, this assumes that a handler is the best way to implement the NT type logic in the first place.

Monarda avatar May 27 '25 21:05 Monarda