From 0aaeaa3336428efc4ea34a7d56696ba4a30b2449 Mon Sep 17 00:00:00 2001 From: smh Date: Fri, 2 Apr 2004 12:31:33 +0000 Subject: [PATCH] Sample scripts for testing postEvent mechanism --- src/VISU_SWIG/Makefile.in | 2 +- src/VISU_SWIG/batch_test_events.py | 14 ++++++++++++++ src/VISU_SWIG/test_events.py | 16 ++++++++++++---- 3 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 src/VISU_SWIG/batch_test_events.py diff --git a/src/VISU_SWIG/Makefile.in b/src/VISU_SWIG/Makefile.in index 680856bc..5ecafb5d 100644 --- a/src/VISU_SWIG/Makefile.in +++ b/src/VISU_SWIG/Makefile.in @@ -44,7 +44,7 @@ SWIG_DEF = libVISU_Swig.i EXPORT_PYSCRIPTS = libVISU_Swig.py batchmode_visu.py batchmode_visu_table.py batchmode_visu_view3d.py \ visu_med.py visu_view3d.py visu.py visu_gui.py visu_prs_example.py\ visu_table.py visu_big_table.py visu_view.py \ - visu_swig_test.py test_events.py + visu_swig_test.py test_events.py batch_test_events.py EXPORT_SHAREDPYSCRIPTS = VISU_shared_modules.py LIB_CLIENT_IDL = diff --git a/src/VISU_SWIG/batch_test_events.py b/src/VISU_SWIG/batch_test_events.py new file mode 100644 index 00000000..df7f3c3c --- /dev/null +++ b/src/VISU_SWIG/batch_test_events.py @@ -0,0 +1,14 @@ +############################################################### +# +# File : batch_test_events.py +# Description : Test postEvent() functionality for VISU module +# +############################################################### + +import batchmode_visu + +for i in range ( 10 ): + batchmode_visu.myVisu.CreateTestView() + for j in range ( 10 ): + batchmode_visu.myVisu.ShowTestObject(); + diff --git a/src/VISU_SWIG/test_events.py b/src/VISU_SWIG/test_events.py index 33cf71eb..c553eae5 100755 --- a/src/VISU_SWIG/test_events.py +++ b/src/VISU_SWIG/test_events.py @@ -2,13 +2,21 @@ # # File : test_events.py # Description : Test postEvent() functionality for VISU module -# +# This script can be run from GUI Python console only! ############################################################### -import batchmode_visu +import salome + +# it's necessary to load VISU engine, this will cause VisuGUI to be loaded +salome.lcc.FindOrLoadComponent("FactoryServer","VISU") + +# this can be done only after VISU engine has been loaded +from libVISU_Swig import * + +visu=VISU_Swig() for i in range ( 10 ): - batchmode_visu.myVisu.CreateTestView() + visu.CreateTestView() for j in range ( 10 ): - batchmode_visu.myVisu.ShowTestObject(); + visu.ShowTestObject(); -- 2.39.2