From 7b687ce3b1c3fe29385c11e5645db80ed416fcee Mon Sep 17 00:00:00 2001 From: smh Date: Fri, 2 Apr 2004 14:25:44 +0000 Subject: [PATCH] Add test_events.xml graph to test postEvents() functionality of VISU component --- examples/test_events.py | 66 ++++++++++++++++ examples/test_events.xml | 167 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 233 insertions(+) create mode 100644 examples/test_events.py create mode 100644 examples/test_events.xml diff --git a/examples/test_events.py b/examples/test_events.py new file mode 100644 index 0000000..fe394f4 --- /dev/null +++ b/examples/test_events.py @@ -0,0 +1,66 @@ + +# Generated python file of Graph aNewDataFlow + +from SuperV import * +# Graph creation +aNewDataFlow = Graph( 'aNewDataFlow' ) +aNewDataFlow.SetName( 'aNewDataFlow' ) +aNewDataFlow.SetAuthor( '' ) +aNewDataFlow.SetComment( '' ) +aNewDataFlow.Coords( 0 , 0 ) + +# Creation of Factory Nodes + +# Creation of InLine Nodes +PyFunc = [] +PyFunc.append( 'def Func( A ): ' ) +PyFunc.append( ' import batchmode_visu ' ) +PyFunc.append( ' batchmode_visu.myVisu.CreateTestView() ' ) +PyFunc.append( ' batchmode_visu.myVisu.ShowTestObject() ' ) +PyFunc.append( ' return A ' ) +Func = aNewDataFlow.INode( 'Func' , PyFunc ) +Func.SetName( 'Func' ) +Func.SetAuthor( '' ) +Func.SetComment( 'Compute Node' ) +Func.Coords( 375 , 162 ) +Func.InPort( 'A' , 'int' ) +Func.OutPort( 'B' , 'int' ) + +# Creation of Loop Nodes +PyInit = [] +PyInit.append( 'def Init( A ): ' ) +PyInit.append( ' return A ' ) +PyMoreInit = [] +PyMoreInit.append( 'def More( A ): ' ) +PyMoreInit.append( ' if A < 10: ' ) +PyMoreInit.append( ' return 1,A ' ) +PyMoreInit.append( ' return 0,A ' ) +PyNextInit = [] +PyNextInit.append( 'def Next( A ): ' ) +PyNextInit.append( ' return (A + 1) ' ) +Init,EndInit = aNewDataFlow.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) +EndInit.SetName( 'EndInit' ) +EndInit.SetAuthor( '' ) +EndInit.SetComment( '' ) +EndInit.Coords( 740 , 168 ) +PyEndInit = [] +EndInit.SetPyFunction( 'EndInit' , PyEndInit ) +Init.SetName( 'Init' ) +Init.SetAuthor( '' ) +Init.SetComment( '' ) +Init.Coords( 118 , 160 ) +Init.InPort( 'A' , 'int' ) +Init.OutPort( 'A' , 'int' ) + +# Creation of Links +InitA = Init.Port( 'A' ) +FuncA = aNewDataFlow.Link( InitA , Func.Port( 'A' ) ) + +FuncB = Func.Port( 'B' ) +EndInitA = aNewDataFlow.Link( FuncB , EndInit.Port( 'A' ) ) + +# Creation of Input datas +InitA = Init.Input( 'A' , 0) + +# Creation of Output variables +EndInitA = EndInit.Port( 'A' ) diff --git a/examples/test_events.xml b/examples/test_events.xml new file mode 100644 index 0000000..97a7ce8 --- /dev/null +++ b/examples/test_events.xml @@ -0,0 +1,167 @@ + + + + +? + ? + aNewDataFlow + 1 + ? + +aNewDataFlow + + +int + Init\A + + +int + EndInit\A + + + 2/4/2004 - 16:38:31 + 2/4/2004 - 18:30:31 + 1.05 + ? + ? + ? + 0 + 0 + + +? + ? + Init + 4 + EndInit + +Init + + +int + A + + +int + A + + + +Init + + + +More + + + + + +Next + + + 2/4/2004 - 18:30:31 + 2/4/2004 - 18:30:31 + 1.05 + ? + ? + ? + 118 + 160 + +? + ? + EndInit + 5 + Init + +EndInit + + +int + A + + +int + A + + + +EndInit + + 2/4/2004 - 18:30:31 + 2/4/2004 - 18:30:31 + 1.05 + ? + ? + ? + 740 + 168 + +? + ? + Func + 3 + ? + +Func + + +int + A + + +int + B + + + +Func + + + + + + 2/4/2004 - 18:30:31 + 2/4/2004 - 18:30:31 + 1.05 + ? + ? + Compute Node + 375 + 162 + + +Init + DoLoop + EndInit + DoLoop + + +Init + A + Func + A + + +EndInit + DoLoop + Init + InitLoop + + +Func + B + EndInit + A + + + +aNewDataFlow + Init\A + Init + A + +3 + 0 + -- 2.39.2