2 # Generated python file of Graph GraphLoop_2
6 # Graph creation of GraphLoop_2
8 GraphLoop_2 = Graph( 'GraphLoop_2' )
9 GraphLoop_2.SetName( 'GraphLoop_2' )
10 GraphLoop_2.SetAuthor( '' )
11 GraphLoop_2.SetComment( '' )
12 GraphLoop_2.Coords( 0 , 0 )
14 # Creation of Factory Nodes
16 # Creation of InLine Nodes
18 NodeIndex = GraphLoop_2.INode( '' , PyNodeIndex )
19 NodeIndex.SetName( 'NodeIndex' )
20 NodeIndex.SetAuthor( '' )
21 NodeIndex.SetComment( 'Compute Node' )
22 NodeIndex.Coords( 281 , 215 )
23 INodeIndexIndex = NodeIndex.InPort( 'Index' , 'long' )
24 INodeIndexGate = NodeIndex.GetInPort( 'Gate' )
25 ONodeIndexIndex = NodeIndex.OutPort( 'Index' , 'long' )
26 ONodeIndexGate = NodeIndex.GetOutPort( 'Gate' )
29 NodeIncr = GraphLoop_2.INode( '' , PyNodeIncr )
30 NodeIncr.SetName( 'NodeIncr' )
31 NodeIncr.SetAuthor( '' )
32 NodeIncr.SetComment( 'Compute Node' )
33 NodeIncr.Coords( 278 , 372 )
34 INodeIncrIncr = NodeIncr.InPort( 'Incr' , 'long' )
35 INodeIncrGate = NodeIncr.GetInPort( 'Gate' )
36 ONodeIncrIncr = NodeIncr.OutPort( 'Incr' , 'long' )
37 ONodeIncrGate = NodeIncr.GetOutPort( 'Gate' )
39 # Creation of Loop Nodes
41 PyInit.append( 'def Init(Index,Min,Max,Incr) : ' )
42 PyInit.append( ' if Min <= Max : ' )
43 PyInit.append( ' Index = Min ' )
44 PyInit.append( ' else : ' )
45 PyInit.append( ' Index = Max ' )
46 PyInit.append( ' return Index,Min,Max,Incr ' )
48 PyMoreInit.append( 'import time ' )
49 PyMoreInit.append( 'def More(Index,Min,Max,Incr) : ' )
50 PyMoreInit.append( ' time.sleep(2) ' )
51 PyMoreInit.append( ' if Index < Max : ' )
52 PyMoreInit.append( ' DoLoop = 1 ' )
53 PyMoreInit.append( ' else : ' )
54 PyMoreInit.append( ' DoLoop = 0 ' )
55 PyMoreInit.append( ' return DoLoop,Index,Min,Max,Incr ' )
57 PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' )
58 PyNextInit.append( ' Index = Index + Incr ' )
59 PyNextInit.append( ' return Index,Min,Max,Incr ' )
60 Init,EndInit = GraphLoop_2.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
61 EndInit.SetName( 'EndInit' )
62 EndInit.SetAuthor( '' )
63 EndInit.SetComment( 'Compute Node' )
64 EndInit.Coords( 555 , 255 )
66 EndInit.SetPyFunction( '' , PyEndInit )
67 IInitDoLoop = Init.GetInPort( 'DoLoop' )
68 IInitIndex = Init.InPort( 'Index' , 'long' )
69 IInitMin = Init.InPort( 'Min' , 'long' )
70 IInitMax = Init.InPort( 'Max' , 'long' )
71 IInitIncr = Init.InPort( 'Incr' , 'long' )
72 IInitGate = Init.GetInPort( 'Gate' )
73 OInitDoLoop = Init.GetOutPort( 'DoLoop' )
74 OInitIndex = Init.GetOutPort( 'Index' )
75 OInitMin = Init.GetOutPort( 'Min' )
76 OInitMax = Init.GetOutPort( 'Max' )
77 OInitIncr = Init.GetOutPort( 'Incr' )
78 IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
79 IEndInitIndex = EndInit.GetInPort( 'Index' )
80 IEndInitMin = EndInit.GetInPort( 'Min' )
81 IEndInitMax = EndInit.GetInPort( 'Max' )
82 IEndInitIncr = EndInit.GetInPort( 'Incr' )
83 IEndInitGate = EndInit.GetInPort( 'Gate' )
84 OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
85 OEndInitIndex = EndInit.GetOutPort( 'Index' )
86 OEndInitMin = EndInit.GetOutPort( 'Min' )
87 OEndInitMax = EndInit.GetOutPort( 'Max' )
88 OEndInitIncr = EndInit.GetOutPort( 'Incr' )
89 OEndInitGate = EndInit.GetOutPort( 'Gate' )
90 Init.SetName( 'Init' )
92 Init.SetComment( 'Compute Node' )
93 Init.Coords( 17 , 257 )
96 LInitIndexNodeIndexIndex = GraphLoop_2.Link( OInitIndex , INodeIndexIndex )
98 LInitMinEndInitMin = GraphLoop_2.Link( OInitMin , IEndInitMin )
100 LInitMaxEndInitMax = GraphLoop_2.Link( OInitMax , IEndInitMax )
102 LInitIncrNodeIncrIncr = GraphLoop_2.Link( OInitIncr , INodeIncrIncr )
104 LNodeIndexIndexEndInitIndex = GraphLoop_2.Link( ONodeIndexIndex , IEndInitIndex )
106 LNodeIncrIncrEndInitIncr = GraphLoop_2.Link( ONodeIncrIncr , IEndInitIncr )
109 IInitIndex.Input( 0 )
114 # Output Ports of the graph
115 #OEndInitIndex = EndInit.GetOutPort( 'Index' )
116 #OEndInitMin = EndInit.GetOutPort( 'Min' )
117 #OEndInitMax = EndInit.GetOutPort( 'Max' )
118 #OEndInitIncr = EndInit.GetOutPort( 'Incr' )
122 GraphLoop_2 = DefGraphLoop_2()