Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -255,22 +255,19 @@ private void connectionOrValueChanged(final WidgetProperty<?> property, final Ob
AlarmSeverity severity = AlarmSeverity.NONE;

// Ignore custom border and value of primary PV, show disconnected
if (! model_widget.runtimePropConnected().getValue())
final VType value = value_prop.getValue();
final Alarm alarm = Alarm.alarmOf(value);
if (! model_widget.runtimePropConnected().getValue() || alarm.equals(Alarm.disconnected()))
severity = AlarmSeverity.UNDEFINED;
else
{ // Reflect severity of primary PV's value
if (value_prop != null && alarm_sensitive_border_prop.getValue())
{
final Object value = value_prop.getValue();
final Alarm alarm = Alarm.alarmOf(value);
if (alarm != null && alarm.getSeverity() != AlarmSeverity.NONE)
// Have alarm info
severity = alarm.getSeverity();
else if (value instanceof VType)
// VType that doesn't provide alarm, always OK
severity = AlarmSeverity.NONE;
else if (value != null)
// Not a vtype, but non-null, assume OK
// VType that doesn't provide alarm, always OK
severity = AlarmSeverity.NONE;
else // null
severity = AlarmSeverity.UNDEFINED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.csstudio.display.builder.model.widgets.SpinnerWidget;
import org.csstudio.display.builder.representation.javafx.Cursors;
import org.csstudio.display.builder.representation.javafx.JFXUtil;
import org.epics.vtype.Alarm;
import org.epics.vtype.Display;
import org.epics.vtype.VNumber;
import org.epics.vtype.VType;
Expand Down Expand Up @@ -374,7 +375,8 @@ private void writeResultingValue(double change)
*/
private String computeText(final VType value)
{
if (value == null)
Alarm alarm = Alarm.alarmOf(value);
if (value == null || alarm.equals(Alarm.disconnected()))
return "<" + model_widget.propPVName().getValue() + ">";
return FormatOptionHandler.format(value,
model_widget.propFormat().getValue(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.csstudio.display.builder.model.widgets.TextEntryWidget;
import org.csstudio.display.builder.representation.javafx.Cursors;
import org.csstudio.display.builder.representation.javafx.JFXUtil;
import org.epics.vtype.Alarm;
import org.epics.vtype.VType;
import org.phoebus.ui.javafx.Styles;
import org.phoebus.ui.vtype.FormatOptionHandler;
Expand Down Expand Up @@ -345,7 +346,8 @@ private void styleChanged(final WidgetProperty<?> property, final Object old_val
*/
private String computeText(final VType value)
{
if (value == null)
Alarm alarm = Alarm.alarmOf(value);
if (value == null || alarm.equals(Alarm.disconnected()))
return "<" + model_widget.propPVName().getValue() + ">";
if (value == PVWidget.RUNTIME_VALUE_NO_PV)
return "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.csstudio.display.builder.model.widgets.PVWidget;
import org.csstudio.display.builder.model.widgets.TextUpdateWidget;
import org.csstudio.display.builder.representation.javafx.JFXUtil;
import org.epics.vtype.Alarm;
import org.epics.vtype.VType;
import org.phoebus.ui.vtype.FormatOptionHandler;

Expand Down Expand Up @@ -167,7 +168,8 @@ private void styleChanged(final WidgetProperty<?> property, final Object old_val
private String computeText(final VType value)
{
Objects.requireNonNull(model_widget, "No widget");
if (value == null)
Alarm alarm = Alarm.alarmOf(value);
if (value == null || alarm.equals(Alarm.disconnected()))
return "<" + model_widget.propPVName().getValue() + ">";
if (value == PVWidget.RUNTIME_VALUE_NO_PV)
return "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public static void attach(final Node node, final WidgetProperty<String> tooltip_

// If 'vtype' supports it (i.e., it is an instance of "DisplayProvider"),
// append the alarm limits to $(pv_value):
if (vtype instanceof DisplayProvider) {
if (vtype instanceof DisplayProvider && !Alarm.alarmOf(vtype).equals(Alarm.disconnected()) ) {

Range alarmRange = display.getAlarmRange();
double lolo = alarmRange.getMinimum();
Expand Down