Skip to content
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

The value of Text Input widget is not same with the actual content #2730

Open
1458861693 opened this issue May 27, 2024 · 1 comment
Open

Comments

@1458861693
Copy link

1458861693 commented May 27, 2024

I create a Text Input widget for file selector, but the file list value of Text Input widget is different from the actual contents.
The OPI file is as the follow picture.

image

The name of Text Input widget is "FileInput". By click "text" action button, Python script will run and the console will print selected file list.
My Python script attached to this action button are as follows.

from org.csstudio.opibuilder.scriptUtil import ConsoleUtil

text = display.getWidget("FileInput").getPropertyValue("text")
ConsoleUtil.writeInfo(text)
new_text = text.strip(" \n").split("|")
for item in new_text:
    ConsoleUtil.writeInfo(item)

When I selecte all files of a directory by this Text Input widget and click "test" action button, the output information are as follows.

2024-05-27 15:59:40 INFO: /home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test/test_action_order05.py|/home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test/test2.py|/home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test/test3.py|/home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test/test4.py|/home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test/test_action_order01.py|/home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test/test_action_order02.py|/home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test/test_action_order03.py|/home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test/test_action_order04.py|/home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test/test_action_order05.py
2024-05-27 15:59:40 INFO: /home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test/test_action_order05.py
2024-05-27 15:59:40 INFO: /home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test/test2.py
2024-05-27 15:59:40 INFO: /home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test/test3.py
2024-05-27 15:59:40 INFO: /home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test/test4.py
2024-05-27 15:59:40 INFO: /home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test/test_action_order01.py
2024-05-27 15:59:40 INFO: /home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test/test_action_order02.py
2024-05-27 15:59:40 INFO: /home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test/test_action_order03.py
2024-05-27 15:59:40 INFO: /home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test/test_action_order04.py
2024-05-27 15:59:40 INFO: /home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test/test_action_order05.py

What's strange is that the output information is different from the actual file list.
The actual file list is as the follow.

ls@ubuntu64:~$ ls /home/ls/epics/tools/cs-studio/workspace/CSS/scripts_test
test2.py test_action_order01.py test_action_order04.py
test3.py test_action_order02.py test_action_order05.py
test4.py test_action_order03.py test.py

We can see, "test_action_order05.py" was print twice, "test.py" wasn't print.

Question2:
what is the function of display.isActive() ?
I can't find any description about it in Help Contents of Cs-studio.
Could you provided a full and online help document for Cs-studio?
Thanks for your help very much, looking forward to your reply.

@1458861693
Copy link
Author

Hi, looking forward to your reply.

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

No branches or pull requests

1 participant