Skip to content

Connection flag and alarms with pvmanager #57

@gcarcassi

Description

@gcarcassi

The transition from utility.pv to pvmanager increases the number of possible states of disconnects and alarms. Here we want to define how these are notified to the user, bearing in mind the new use cases.

Pvmanager returns the following:

  • connection flag - always present for reader. true/false
  • write connection flag - always present for writers. true/false
  • alarm severity - only present if value is available and only for a subset of vtypes. none/minor/major/invalid/undefined

The following cases are all valid:

  • disconnected, no value/alarm. The channel is waiting for connection. An expression is partially connected to some channels, but needs the other to produce a result
  • disconnected, value/alarm present. An expression is partially connected to some channels, but can produce a value (e.g. an array created from multiple pvs)
  • connected, no value/alarm. The channel is connected, but the value is not of requested type. Values are taken from the network, but the formula takes time to compute. The connection notification arrived well before the actual value.
  • connected, value/alarm present. By far the most normal case
    The 2nd and 3rd possibilities are new, and some application (e.g. BOY) do not handle those cases well.

Proposal:

  • If value is present, user feedback (e.g. border, ...) should be based on the value only. In case of a formula, the functions can then decide what is the logic to be used much better than anything else. Therefore, disconnected+value, should look at the value for the alarm.
  • If value is not present, user feedback should be based on the connection flag. Connected+no value should be the same as an invalid alarm. Disconnected+no value should be treated as disconnected

This logic will be embedded in a utility function:
Alarm VType.toAlarm(PVReader<?> reader)
The return will always be non-null. Based on severity, the correct display is:

  • none - nothing to display ((dis)connected + value with no alarm or value that does not have an alarm)
  • minor - minor alarm ((dis)connected + value with minor alarm)
  • major - major alarm ((dis)connected + value with major alarm)
  • invalid - no valid value (connected+no value or connected+invalid value)
  • undefined - display disconnected (disconnected+no value, (dis)connnection+value with undefined alarm)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions