use of org.csstudio.vtype.pv.local.LocalPVFactory in project org.csstudio.display.builder by kasemir.
the class RulesJythonScriptTest method testJythonScript.
@Test
public void testJythonScript() throws Exception {
final DisplayModel display = ModelLoader.resolveAndLoadModel("../org.csstudio.display.builder.runtime.test/examples/dummy.opi", "rules_test.opi");
final Widget widget = display.getChildren().parallelStream().filter(w -> w.getName().equals("Rectangle")).findFirst().get();
System.out.println(widget);
String pv_name = "loc://test2";
PVPool.addPVFactory(new LocalPVFactory());
final PV pv = PVPool.getPV(pv_name);
pv.write(1);
// Set widget variable in script
// final ScriptSupport scripting = new ScriptSupport();
// final Script script = scripting.compile("../org.csstudio.display.builder.runtime.test/examples/updateText.py");
/*
for (int run=0; run<10; ++run)
{
widget.setPropertyValue("text", "Initial");
String text = widget.getPropertyValue("text");
assertThat(text, equalTo("Initial"));
script.submit(widget).get();
assertThat(widget.getPropertyValue("text"), equalTo("Hello"));
widget.setPropertyValue("text", "Initial");
assertThat(widget.getPropertyValue("text"), equalTo("Initial"));
script.submit(widget).get();
assertThat(widget.getPropertyValue("text"), equalTo("Hello"));
}
scripting.close();
*/
}
use of org.csstudio.vtype.pv.local.LocalPVFactory in project org.csstudio.display.builder by kasemir.
the class TestHelper method setup.
public static void setup() {
PVPool.addPVFactory(new JCA_PVFactory());
PVPool.addPVFactory(new LocalPVFactory());
PVPool.addPVFactory(new SimPVFactory());
PVPool.setDefaultType(LocalPVFactory.TYPE);
// Logging
final Level level = Level.FINE;
Logger logger = Logger.getLogger("");
logger.setLevel(level);
for (Handler handler : logger.getHandlers()) handler.setLevel(level);
}
Aggregations