Skip to content

PVManager loc:// Local PV issue in scripts that use 'Long' data #473

@kasemir

Description

@kasemir

This error occured after updating to the PVManager version of CSS.
A script was used to monitor the pixels in some image (IntensityGraph), allowing to enable/disable auto-scale of the color map.
There are actually two images, and the color map of both could be synchronized.

This much shorter example shows the issue:

  1. Create new display file.
  2. Add TextUpdate, set PV Name to "loc://x(3)".
  3. Add ActionButton, also set PV Name to "loc://x(3)", and as action add this (embedded) python script:
# In the real world, code determines a value
# based on input PVs of type VLongArray, so the resulting value is a Long:
from java.lang import Long
value = Long.valueOf(10)

# Write that value to a (local) PV
widget.getPV().setValue(value)
  1. Run, press button: PV is not updated

If the script instead uses one of these to write a Double

value = 10.0
value = float(10)

or one of these to write an int, all is fine:

value = 10
value = int(10.0)

But with 'Long', it fails.
In the debugger, I can see that Jython turns the java.Long into a PyLong, then into a BigInteger.
So the PVManager LocalChannelHandler receives a BigInteger, which it doesn't handle.
The actual error occurs in
org.epics.vtype.ValueFactory#newVNumber(Number the_big_integer, …)

Can the PVManager/VTypes be extended to allow writing BigInteger?
Failing if the BigInteger is larger than a VLong or VDouble would be OK, but if the BigInteger is 10, it should simply go into a VLong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions