2 # Generated python file of Graph GraphTwoLoops
6 # Graph creation of GraphTwoLoops
7 def DefGraphTwoLoops() :
8 GraphTwoLoops = Graph( 'GraphTwoLoops' )
9 GraphTwoLoops.SetName( 'GraphTwoLoops' )
10 GraphTwoLoops.SetAuthor( 'JR' )
11 GraphTwoLoops.SetComment( '' )
12 GraphTwoLoops.Coords( 0 , 0 )
14 # Creation of Factory Nodes
16 # Creation of Loop Nodes
18 PyLoop1.append( 'def Loop1(Index,Max) : ' )
19 PyLoop1.append( ' return Index,Max ' )
22 PyMoreLoop1.append( 'import time ' )
23 PyMoreLoop1.append( 'def More(Index,Max) : ' )
24 PyMoreLoop1.append( ' time.sleep(2) ' )
25 PyMoreLoop1.append( ' DoLoop = 0 ' )
26 PyMoreLoop1.append( ' if Index < Max : ' )
27 PyMoreLoop1.append( ' DoLoop = 1 ' )
28 PyMoreLoop1.append( ' return DoLoop,Index,Max ' )
29 PyMoreLoop1.append( '' )
31 PyNextLoop1.append( 'def Next(Index,Max) : ' )
32 PyNextLoop1.append( ' Index = Index + 1 ' )
33 PyNextLoop1.append( ' return Index,Max ' )
34 PyNextLoop1.append( '' )
35 Loop1,EndLoop1 = GraphTwoLoops.LNode( 'Loop1' , PyLoop1 , 'More' , PyMoreLoop1 , 'Next' , PyNextLoop1 )
36 EndLoop1.SetName( 'EndLoop1' )
37 EndLoop1.SetAuthor( '' )
38 EndLoop1.SetComment( 'Compute Node' )
39 EndLoop1.Coords( 634 , 177 )
41 EndLoop1.SetPyFunction( 'EndLoop1' , PyEndLoop1 )
42 ILoop1DoLoop = Loop1.GetInPort( 'DoLoop' )
43 ILoop1Index = Loop1.InPort( 'Index' , 'long' )
44 ILoop1Max = Loop1.InPort( 'Max' , 'long' )
45 ILoop1Gate = Loop1.GetInPort( 'Gate' )
46 OLoop1DoLoop = Loop1.GetOutPort( 'DoLoop' )
47 OLoop1Index = Loop1.GetOutPort( 'Index' )
48 OLoop1Max = Loop1.GetOutPort( 'Max' )
49 IEndLoop1DoLoop = EndLoop1.GetInPort( 'DoLoop' )
50 IEndLoop1Index = EndLoop1.GetInPort( 'Index' )
51 IEndLoop1Max = EndLoop1.GetInPort( 'Max' )
52 IEndLoop1Gate = EndLoop1.GetInPort( 'Gate' )
53 OEndLoop1DoLoop = EndLoop1.GetOutPort( 'DoLoop' )
54 OEndLoop1Index = EndLoop1.GetOutPort( 'Index' )
55 OEndLoop1Max = EndLoop1.GetOutPort( 'Max' )
56 OEndLoop1Gate = EndLoop1.GetOutPort( 'Gate' )
57 Loop1.SetName( 'Loop1' )
59 Loop1.SetComment( 'Compute Node' )
60 Loop1.Coords( 7 , 175 )
64 PyMoreLoop.append( '' )
66 PyNextLoop.append( 'def Next(Index,Max) : ' )
67 PyNextLoop.append( ' Index = Index + 1 ' )
68 PyNextLoop.append( ' return Index,Max ' )
69 PyNextLoop.append( '' )
70 Loop,EndLoop = GraphTwoLoops.LNode( '' , PyLoop , '' , PyMoreLoop , 'Next' , PyNextLoop )
71 EndLoop.SetName( 'EndLoop' )
72 EndLoop.SetAuthor( '' )
73 EndLoop.SetComment( 'Compute Node' )
74 EndLoop.Coords( 426 , 180 )
76 PyEndLoop.append( 'import time ' )
77 PyEndLoop.append( 'def EndLoop(DoLoop,Index,Max) : ' )
78 PyEndLoop.append( ' time.sleep(1) ' )
79 PyEndLoop.append( ' DoLoop = 0 ' )
80 PyEndLoop.append( ' if Index < Max : ' )
81 PyEndLoop.append( ' DoLoop = 1 ' )
82 PyEndLoop.append( ' return DoLoop,Index,Max ' )
83 PyEndLoop.append( '' )
84 EndLoop.SetPyFunction( 'EndLoop' , PyEndLoop )
85 ILoopDoLoop = Loop.GetInPort( 'DoLoop' )
86 ILoopIndex = Loop.InPort( 'Index' , 'long' )
87 ILoopMax = Loop.InPort( 'Max' , 'long' )
88 ILoopGate = Loop.GetInPort( 'Gate' )
89 OLoopDoLoop = Loop.GetOutPort( 'DoLoop' )
90 OLoopIndex = Loop.GetOutPort( 'Index' )
91 OLoopMax = Loop.GetOutPort( 'Max' )
92 IEndLoopDoLoop = EndLoop.GetInPort( 'DoLoop' )
93 IEndLoopIndex = EndLoop.GetInPort( 'Index' )
94 IEndLoopMax = EndLoop.GetInPort( 'Max' )
95 IEndLoopGate = EndLoop.GetInPort( 'Gate' )
96 OEndLoopDoLoop = EndLoop.GetOutPort( 'DoLoop' )
97 OEndLoopIndex = EndLoop.GetOutPort( 'Index' )
98 OEndLoopMax = EndLoop.GetOutPort( 'Max' )
99 OEndLoopGate = EndLoop.GetOutPort( 'Gate' )
100 Loop.SetName( 'Loop' )
102 Loop.SetComment( 'Compute Node' )
103 Loop.Coords( 208 , 179 )
106 LLoop1IndexEndLoop1Index = GraphTwoLoops.Link( OLoop1Index , IEndLoop1Index )
108 LLoop1MaxEndLoop1Max = GraphTwoLoops.Link( OLoop1Max , IEndLoop1Max )
110 LLoop1GateLoopGate = GraphTwoLoops.Link( OLoop1Gate , ILoopGate )
112 LLoopIndexEndLoopIndex = GraphTwoLoops.Link( OLoopIndex , IEndLoopIndex )
114 LLoopMaxEndLoopMax = GraphTwoLoops.Link( OLoopMax , IEndLoopMax )
116 LEndLoopGateEndLoop1Gate = GraphTwoLoops.Link( OEndLoopGate , IEndLoop1Gate )
119 ILoop1Index.Input( 5 )
120 ILoop1Max.Input( 15 )
121 ILoopIndex.Input( 2 )
124 # Output Ports of the graph
125 #OEndLoop1Index = EndLoop1.GetOutPort( 'Index' )
126 #OEndLoop1Max = EndLoop1.GetOutPort( 'Max' )
127 #OEndLoopIndex = EndLoop.GetOutPort( 'Index' )
128 #OEndLoopMax = EndLoop.GetOutPort( 'Max' )
132 GraphTwoLoops = DefGraphTwoLoops()