Skip to content

Fix Write Action command => manage default type and Enum PV Type #3412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

katysaintin
Copy link
Contributor

Fix Action WritePV on ButtonWidget.

  • default datasource was not take in account (for a custom default datasource as Muscade) action doesn't work
  • Write 1 on a Enum PV (such as a bo record) doesn't work, because it sent the wrong type

@shroffk
Copy link
Member

shroffk commented Jul 10, 2025

@katysaintin is it possible to create a test .opi to reproduce this issue

@katysaintin
Copy link
Contributor Author

@katysaintin is it possible to create a test .opi to reproduce this issue
Yes , I should be able to reproduce this bug with loc:// datasource in action. I will be on vacation for one week. I'm not sure that I can do that before. Katy

@shroffk
Copy link
Member

shroffk commented Jul 10, 2025

No rush
I am going to hold all PR's until after 5.0.2 release so please enjoy your vacation

@katysaintin
Copy link
Contributor Author

katysaintin commented Jul 24, 2025

No rush I am going to hold all PR's until after 5.0.2 release so please enjoy your vacation

Please find the settings.ini and the Display to reproduce the bug.
settings.txt
in settings.ini the default pv datasource set to loc factory (in my case it is set to muscade).
org.phoebus.pv/default=loc

And a Display to reproduce the bug
BugAction.bob.txt

In the display , Write 1 on loc://my_pv works fine in TextEntry and Boolean Button . without precising the loc://
But in Action Button, the command doesn't works, because the action doesn't check the default datasource and do not
concat loc://$(pv_name) and it searching for a $pv_name that does not exist in PVPool .

It will occur also if you set `org.phoebus.pv/default=pva' if the defaut EPICS protocol is pv access.
All the Writing Actions will failed, because , Action will not add pva://pvname .

Here is the stacktrace with no correction

GRAVE: No default setting for preference org.csstudio.display.builder.model/enable_svg_rendering_resolution_factor
java.lang.Exception: Unknown PV 'my_pv' (expanded: 'my_pv')
	at org.csstudio.display.builder.runtime.WidgetRuntime.writePV(WidgetRuntime.java:432)
	at org.csstudio.display.builder.runtime.test.WidgetRuntimeTest.testWriteAction(WidgetRuntimeTest.java:61)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

@katysaintin
Copy link
Contributor Author

Hello @shroffk I have just add a Unit Test for testing the corrections.
Normaly if you test the current version without my modification , the WidgetRuntimeTest will fail

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.

2 participants