Skip to content

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

Open
@1458861693

Description

@1458861693

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions