ControlSystemStudio / cs-studio

Control System Studio is an Eclipse-based collections of tools to monitor and operate large scale control systems, such as the ones in the accelerator community.
https://controlsystemstudio.org/
Eclipse Public License 1.0
113 stars 96 forks source link

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

Open 1458861693 opened 4 months ago

1458861693 commented 4 months ago

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 commented 4 months ago

Hi, looking forward to your reply.