2 # Generated python file of Graph GraphLoop
6 # Graph creation of GraphLoop
8 GraphLoop = Graph( 'GraphLoop' )
9 GraphLoop.SetName( 'GraphLoop' )
10 GraphLoop.SetAuthor( '' )
11 GraphLoop.SetComment( '' )
12 GraphLoop.Coords( 0 , 0 )
14 # Creation of Factory Nodes
16 # Creation of Loop Nodes
18 PyInit.append( 'def Init(Index,Min,Max,Incr) : ' )
19 PyInit.append( ' if Min <= Max : ' )
20 PyInit.append( ' Index = Min ' )
21 PyInit.append( ' else : ' )
22 PyInit.append( ' Index = Max ' )
23 PyInit.append( ' return Index,Min,Max,Incr ' )
25 PyMoreInit.append( 'import time ' )
26 PyMoreInit.append( 'def More(Index,Min,Max,Incr) : ' )
27 PyMoreInit.append( ' time.sleep(2) ' )
28 PyMoreInit.append( ' if Index < Max : ' )
29 PyMoreInit.append( ' DoLoop = 1 ' )
30 PyMoreInit.append( ' else : ' )
31 PyMoreInit.append( ' DoLoop = 0 ' )
32 PyMoreInit.append( ' return DoLoop,Index,Min,Max,Incr ' )
34 PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' )
35 PyNextInit.append( ' Index = Index + Incr ' )
36 PyNextInit.append( ' return Index,Min,Max,Incr ' )
37 Init,EndInit = GraphLoop.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
38 EndInit.SetName( 'EndInit' )
39 EndInit.SetAuthor( '' )
40 EndInit.SetComment( 'Compute Node' )
41 EndInit.Coords( 366 , 262 )
43 EndInit.SetPyFunction( '' , PyEndInit )
44 IInitInitLoop = Init.GetInPort( 'DoLoop' )
45 IInitIndex = Init.InPort( 'Index' , 'long' )
46 IInitMin = Init.InPort( 'Min' , 'long' )
47 IInitMax = Init.InPort( 'Max' , 'long' )
48 IInitIncr = Init.InPort( 'Incr' , 'long' )
49 IInitGate = Init.GetInPort( 'Gate' )
50 OInitDoLoop = Init.GetOutPort( 'DoLoop' )
51 OInitIndex = Init.GetOutPort( 'Index' )
52 OInitMin = Init.GetOutPort( 'Min' )
53 OInitMax = Init.GetOutPort( 'Max' )
54 OInitIncr = Init.GetOutPort( 'Incr' )
55 IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
56 IEndInitIndex = EndInit.GetInPort( 'Index' )
57 IEndInitMin = EndInit.GetInPort( 'Min' )
58 IEndInitMax = EndInit.GetInPort( 'Max' )
59 IEndInitIncr = EndInit.GetInPort( 'Incr' )
60 IEndInitGate = EndInit.GetInPort( 'Gate' )
61 OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
62 OEndInitIndex = EndInit.GetOutPort( 'Index' )
63 OEndInitMin = EndInit.GetOutPort( 'Min' )
64 OEndInitMax = EndInit.GetOutPort( 'Max' )
65 OEndInitIncr = EndInit.GetOutPort( 'Incr' )
66 Init.SetName( 'Init' )
68 Init.SetComment( 'Compute Node' )
69 Init.Coords( 17 , 257 )
72 LInitIndexEndInitIndex = GraphLoop.Link( OInitIndex , IEndInitIndex )
74 LInitMinEndInitMin = GraphLoop.Link( OInitMin , IEndInitMin )
76 LInitMaxEndInitMax = GraphLoop.Link( OInitMax , IEndInitMax )
78 LInitIncrEndInitIncr = GraphLoop.Link( OInitIncr , IEndInitIncr )
86 # Output Ports of the graph
87 #OEndInitIndex = EndInit.GetOutPort( 'Index' )
88 #OEndInitMin = EndInit.GetOutPort( 'Min' )
89 #OEndInitMax = EndInit.GetOutPort( 'Max' )
90 #OEndInitIncr = EndInit.GetOutPort( 'Incr' )
94 GraphLoop = DefGraphLoop()