-
Notifications
You must be signed in to change notification settings - Fork 11
CSSTUDIO-3337 Bugfix: The alarm status "Disconnected" should have alarm severity "Undefined" instead of "Invalid" #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…rm severity "Undefined" instead of "Invalid".
EPICS records have a severity in their SEVR field that can be OK, MINOR, MAJOR, INVALID. PVAccess has severities OK, MINOR, MAJOR, INVALID, UNDEFINED.
The VType uses the same severity options as PVAccess, because that's the widest range of options. This looks like a worthwhile attempt, "Right now we think disconnected should go with UNDEFINED", but whatever you do might be considered wrong the next time around we look at this. |
The way I think about it is that the EPICS alarm severity indicates problems on the IOC. In the relevant case here, I think that In contrast, the fact that Phoebus (or another client) cannot establish a connection is a fact about the client, not about a value received from the PV. For this reason, I think it makes sense that the status A better solution that to represent disconnection as an @kasemir, Do you have any alternative suggestions to fix the issue described in the description of the pull request? |
I do think there is some value in trying to create a convention/standard around distinct meanings for INVALID and UNDEFINED. While I agree that these terms are nebulous enough that no matter what there will always be someone who misinterprets the convention, I think the linking UNDEFINED to client side issues is fine by me.
This seems like a lot of change and a potential for further confusion. |
The term UNDEFINED could lead to some user confusion because the IOC does has an alarm status of Undefined (spelled UDF), which has historically appeared with a severity of INVALID but can now be configured separately for each record, so I'm not making an argument either way, just providing a little more info. |
Looking at usages of the constant And, of course, I don't know how other EPICS clients relying on That said, the logic for displaying alarm borders around widgets in Phoebus assumes that I have now updated the associated the pull request to Phoebus with a fix of the bug that doesn't depend on this pull request. This commit, in particular, fixes the observed issue: ControlSystemStudio/phoebus@b62cc94 Since a change to |
@shroffk suggested that I re-open the pull request (ControlSystemStudio/phoebus#3474 (comment)). Should we document the meaning of My own thinking is still that sum types of the form |
You'll never be wrong when you document the meaning of UNDEFINED and check that implementations follow that meaning. As for changing anything, I'd rather simplify. Splitting out UNDEFINED as a designated severity was a bad idea. ==> I would suggest simplifying the VType severity to OK, Minor, Major, Invalid. Perfect match to the original EPICS record and Channel Access severities. Yes, PVAccess might report "UNDEFINED" in its severity, so we map that to INVALID as a VType severity. |
I agree that it would be good to document the meaning of
I agree that this makes sense from an UI perspective, since it prevents confusion and increases situational awareness. However, that doesn't prevent the underlying implementation to distinguish between more states in order to handle them in the appropriate way for each case.
Phoebus displays five severities right now: OK, Minor, Major, Invalid, and Disconnected. I originally created this pull request because a widget could display "Invalid" when in fact "Disconnected" should be displayed.
I don't think Invalid covers a network disconnect. According to [1], Invalid means that the IOC is reporting that there is a problem with the data. |
This pull request intends to fix a bug encountered in Phoebus that can be reproduced using the following steps:
It seems that the "Invalid" state that is displayed comes from the constant
org.epics.vtype.Alarm.DISCONNECTED
, and this pull request changes the constant to have alarm severityAlarmSeverity.UNDEFINED
instead ofAlarmSeverity.INVALID
.Based on the following comment, this seems to be the intention of the code:
https://github.com/abrahamwolk/epicsCoreJava/blob/25d0346c92868d5d76aa0781a5e70f78ab55117c/epics-vtype/vtype/src/main/java/org/epics/vtype/Alarm.java#L158-L166
The EPICS documentation, on the other hand, does not mention an alarm severity
UNDEFINED
: https://docs.epics-controls.org/en/latest/process-database/EPICS_Process_Database_Concepts.html#alarm-specification. Since a disconnection is a fact about the client and not a status reported over the EPICS protocol, I think it makes sense for a disconnection to have alarm severityUNDEFINED
whereUNDEFINED
means it is not defined in the EPICS specification.Perhaps it would be a good idea to rename
UNDEFINED
toDISCONNECTED
?UNDEFINED
only seems to be used for this purpose in the code.Changes required for Phoebus

While this change does fix the alarm border to show
DISCONNECTED
instead ofINVALID
, the TextUpdate widget now displaysNaN
instead of<PV-Name>
when a PV is not connected, as well as more information in the tooltip:I will create a separate pull request to https://github.com/ControlSystemStudio/phoebus to solve this.Update: I have created a pull request to thePhoebus
project to solve this: ControlSystemStudio/phoebus#3474