Skip to content

Conversation

abrahamwolk
Copy link
Collaborator

@abrahamwolk abrahamwolk commented Jul 23, 2025

The background for this pull request is described in epics-base/epicsCoreJava#143.

This pull request:

  1. Updates the widgets Text Update, Text Entry, and Spinner to display <PV-Name> when a value is received that has alarm status equal to Alarm.disconnected(). (This restores the behavior of the widgets prior to the changes in the pull request CSSTUDIO-3337 Bugfix: The alarm status "Disconnected" should have alarm severity "Undefined" instead of "Invalid" epics-base/epicsCoreJava#143.)
  2. Updates the tool tip-functionality for widgets so that the alarm ranges are not displayed when a value with alarm status equal to Alarm.disconnected() is received.

@abrahamwolk
Copy link
Collaborator Author

abrahamwolk commented Jul 23, 2025

I would like to add that this pull request should be added after epics-base/epicsCoreJava#143 has been merged and Phoebus uses the merged version, since otherwise the added logic may activate on the INVALID alarm state instead of when a disconnection has occurred. EDIT: This was incorrect: Alarm.equals() also checks the name of the alarm, and Alarm.DISCONNECTED has as its name "Disconnected", so the logic should not activate on any INVALID alarm.

@shroffk shroffk added the wip work in progress label Jul 23, 2025
@abrahamwolk
Copy link
Collaborator Author

I have updated this pull request so that it fixes the issue described in [1] without depending on the changes in [1]. In particular, this commit fixes the issue described in [1]: b62cc94

[1] epics-base/epicsCoreJava#143

@abrahamwolk abrahamwolk removed the wip work in progress label Jul 24, 2025
@shroffk
Copy link
Member

shroffk commented Jul 28, 2025

While I understand this is a good fix.
@abrahamwolk I would keep the epics core issue open since I feel like you and Kay have raised valid points about the confusion around undefined and invalid.

at the very least we might want to document some of that conversation.

@shroffk shroffk merged commit 67f8428 into master Jul 28, 2025
3 checks passed
@abrahamwolk
Copy link
Collaborator Author

@shroffk Ah, I see! I have re-opened the pull request (epics-base/epicsCoreJava#143)

@abrahamwolk abrahamwolk deleted the CSSTUDIO-3337 branch July 29, 2025 08:14
@kasemir
Copy link
Collaborator

kasemir commented Aug 28, 2025

Since this change I get

java.lang.NullPointerException:
Cannot invoke
"org.csstudio.display.builder.model.WidgetProperty.getValue()"
because "this.value_prop" is null
	at org.csstudio.display.builder.representation.javafx.widgets.RegionBaseRepresentation.connectionOrValueChanged(RegionBaseRepresentation.java:258)

In RegionBaseRepresentation.java:258, there's this:

final VType value = value_prop.getValue();

value_prop may be null. Before this PR, it was

if (value_prop != null  && ...
       final Object value = value_prop.getValue();

and something similar is still found a few lines later, but the initial access to value_prop without null check needs to be fixed.

@abrahamwolk
Copy link
Collaborator Author

@kasemir Thanks for catching this. I have created a pull request with a fix: #3522

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants