Skip to content

Setting XY Plot scale min/max from script requires multiple runs #3824

@kasemir

Description

@kasemir

Configure an XY plot with a script like this:

# pvs[0] - minimum PV
# pvs[1] - maximum  PV
# pvs[2] - man/auto PV
# All configured to trigger the script
from org.csstudio.display.builder.runtime.script import PVUtil

widget.setPropertyValue('y_axes[0].autoscale', PVUtil.getLong(pvs[2]) > 0)
widget.setPropertyValue('y_axes[0].minimum',   PVUtil.getDouble(pvs[0]))
widget.setPropertyValue('y_axes[0].maximum',   PVUtil.getDouble(pvs[1]))
print("Set to %lf, %lf" % (PVUtil.getDouble(pvs[0]), PVUtil.getDouble(pvs[1])))

When enabling autoscale, the widget will immediately autoscale.
When disabling autoscale, however, the axis keeps its most recent limits.
Need to trigger the script once more, updating minimum and/or maximum once more, to get the desired manual min..max range

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions