2 # Generated python file of Graph aNewDataFlow
6 aNewDataFlow = Graph( 'aNewDataFlow' )
7 aNewDataFlow.SetName( 'aNewDataFlow' )
8 aNewDataFlow.SetAuthor( '' )
9 aNewDataFlow.SetComment( '' )
10 aNewDataFlow.Coords( 0 , 0 )
12 # Creation of Factory Nodes
14 # Creation of InLine Nodes
16 PyFunc.append( 'def Func( A ): ' )
17 PyFunc.append( ' import batchmode_visu ' )
18 PyFunc.append( ' batchmode_visu.myVisu.CreateTestView() ' )
19 PyFunc.append( ' batchmode_visu.myVisu.ShowTestObject() ' )
20 PyFunc.append( ' return A ' )
21 Func = aNewDataFlow.INode( 'Func' , PyFunc )
22 Func.SetName( 'Func' )
24 Func.SetComment( 'Compute Node' )
25 Func.Coords( 375 , 162 )
26 Func.InPort( 'A' , 'int' )
27 Func.OutPort( 'B' , 'int' )
29 # Creation of Loop Nodes
31 PyInit.append( 'def Init( A ): ' )
32 PyInit.append( ' return A ' )
34 PyMoreInit.append( 'def More( A ): ' )
35 PyMoreInit.append( ' if A < 10: ' )
36 PyMoreInit.append( ' return 1,A ' )
37 PyMoreInit.append( ' return 0,A ' )
39 PyNextInit.append( 'def Next( A ): ' )
40 PyNextInit.append( ' return (A + 1) ' )
41 Init,EndInit = aNewDataFlow.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
42 EndInit.SetName( 'EndInit' )
43 EndInit.SetAuthor( '' )
44 EndInit.SetComment( '' )
45 EndInit.Coords( 740 , 168 )
47 EndInit.SetPyFunction( 'EndInit' , PyEndInit )
48 Init.SetName( 'Init' )
51 Init.Coords( 118 , 160 )
52 Init.InPort( 'A' , 'int' )
53 Init.OutPort( 'A' , 'int' )
56 InitA = Init.Port( 'A' )
57 FuncA = aNewDataFlow.Link( InitA , Func.Port( 'A' ) )
59 FuncB = Func.Port( 'B' )
60 EndInitA = aNewDataFlow.Link( FuncB , EndInit.Port( 'A' ) )
62 # Creation of Input datas
63 InitA = Init.Input( 'A' , 0)
65 # Creation of Output variables
66 EndInitA = EndInit.Port( 'A' )