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

Reflectometry performance #1458

Merged
merged 9 commits into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ org.csstudio.opibuilder/show_fullscreen_dialog=false

# Don't pop up messages warning about newer-style OPIs
org.csstudio.opibuilder/popup_console=NO_CONSOLE
org.csstudio.opibuilder/java_script_engine=RHINO_WITH_FAST_PATH

org.csstudio.utility.pvmanager.loc/zero_initialization=false

Expand Down
5 changes: 4 additions & 1 deletion base/uk.ac.stfc.isis.ibex.opis/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ Require-Bundle: uk.ac.stfc.isis.ibex.epics;bundle-version="1.0.0",
org.apache.commons.io,
uk.ac.stfc.isis.ibex.instrument,
commonj.sdo;bundle-version="2.1.1",
uk.ac.stfc.isis.ibex.jaxb;bundle-version="1.0.0"
uk.ac.stfc.isis.ibex.jaxb;bundle-version="1.0.0",
org.csstudio.simplepv;bundle-version="1.0.0",
org.eclipse.gef;bundle-version="3.11.0"
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-ActivationPolicy: lazy
Export-Package: uk.ac.stfc.isis.ibex.opis,
uk.ac.stfc.isis.ibex.opis.desc
Automatic-Module-Name: uk.ac.stfc.isis.ibex.opis
Bundle-ClassPath: .
8 changes: 4 additions & 4 deletions base/uk.ac.stfc.isis.ibex.opis/build.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
resources/,\
plugin.xml,\
.,\
resources/,\
plugin.xml,\
.

10 changes: 10 additions & 0 deletions base/uk.ac.stfc.isis.ibex.opis/resources/opi_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2929,6 +2929,16 @@
<category>Temperature controllers</category>
</categories>
</value>
</entry>
<entry>
<key>Rules tests (developer)</key>
<value>
<type>DEBUG</type>
<path>rules_tests.opi</path>
<description>Developer system-testing OPI for CS-Studio rules engines</description>
<macros/>
<categories/>
</value>
</entry>
</opis>
</descriptions>
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ $(pv_value)</tooltip>
<name>bump_strip_message</name>
<rules>
<rule name="visible_when_tripped" prop_id="visible" out_exp="false">
<exp bool_exp="pv0 ==0">
<exp bool_exp="pv0==0">
<value>true</value>
</exp>
<pv trig="true">$(P)MOT:BUMP_STOP</pv>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ $(pv_value)</tooltip>
<horizontal_alignment>1</horizontal_alignment>
<name>Mirror_RBV</name>
<rules>
<rule name="Visible" prop_id="visible" out_exp="true">
<rule name="Visible" prop_id="visible" out_exp="false">
<exp bool_exp="pv0!=0">
<value>true</value>
</exp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
import time
import zlib

from org.csstudio.ui.util.thread import UIBundlingThread
from java.lang import Thread, Runnable


from org.eclipse.swt.widgets import Display
currentDisplay = Display.getCurrent()


def _set_opi(widget, param_type, has_cv):
"""
Expand Down Expand Up @@ -65,8 +72,18 @@ def populate_list(pv, widget_name_prefix, macro_prefix, has_type, max):
else:
target_widget.setPropertyValue("visible", False)

# Widget names need to be set before trying to set properties
time.sleep(0.2)

macros = widget.getPropertyValue("macros").getMacrosMap()
populate_list(pvs[0], macros["GROUP_KEY"], macros["MACRO_PREFIX"], bool(int(macros["HAS_TYPE"])), int(macros["MAX_NUMBER"]))
class WorkerThread(Runnable):
def run(self):
# Widget names need to be set before trying to set properties
Thread.sleep(200)

class UITask(Runnable):
def run(self):
macros = widget.getPropertyValue("macros").getMacrosMap()
populate_list(pvs[0], macros["GROUP_KEY"], macros["MACRO_PREFIX"], bool(int(macros["HAS_TYPE"])), int(macros["MAX_NUMBER"]))
UIBundlingThread.getInstance().addRunnable(currentDisplay, UITask())


thread = Thread(WorkerThread(), "reflectometry OPI populate_list.py worker")
thread.start()

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<include_parent_macros>true</include_parent_macros>
</macros>
<name>Horizontal Gaps</name>
<opi_file>crisp/hgaps_CRISP.opi</opi_file>
<opi_file>crisp/hgaps.opi</opi_file>
<resize_behaviour>0</resize_behaviour>
<rules />
<scale_options>
Expand Down Expand Up @@ -462,7 +462,7 @@
<include_parent_macros>true</include_parent_macros>
</macros>
<name>Important Params</name>
<opi_file>crisp/important_params_CRISP.opi</opi_file>
<opi_file>crisp/important_params.opi</opi_file>
<resize_behaviour>3</resize_behaviour>
<rules />
<scale_options>
Expand Down Expand Up @@ -502,7 +502,7 @@
<include_parent_macros>true</include_parent_macros>
</macros>
<name>Sample Stack</name>
<opi_file>crisp/sample_stack_CRISP.opi</opi_file>
<opi_file>crisp/sample_stack.opi</opi_file>
<resize_behaviour>3</resize_behaviour>
<rules />
<scale_options>
Expand Down Expand Up @@ -542,7 +542,7 @@
<include_parent_macros>true</include_parent_macros>
</macros>
<name>Vertical Gaps</name>
<opi_file>crisp/vgaps_CRISP.opi</opi_file>
<opi_file>crisp/vgaps.opi</opi_file>
<resize_behaviour>3</resize_behaviour>
<rules />
<scale_options>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
<horizontal_alignment>1</horizontal_alignment>
<name>Label</name>
<rules>
<rule name="Visible" prop_id="visible" out_exp="true">
<rule name="Visible" prop_id="visible" out_exp="false">
<exp bool_exp="pv0 != 0">
<value>false</value>
</exp>
Expand Down
Loading