2 # Generated python file of Graph GraphLoopGates
6 # Graph creation of GraphLoopGates
7 def DefGraphLoopGates() :
8 GraphLoopGates = Graph( 'GraphLoopGates' )
9 GraphLoopGates.SetName( 'GraphLoopGates' )
10 GraphLoopGates.SetAuthor( 'JR' )
11 GraphLoopGates.SetComment( '' )
12 GraphLoopGates.Coords( 0 , 0 )
14 # Creation of Factory Nodes
16 Add = GraphLoopGates.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
19 Add.SetContainer( 'localhost/FactoryServer' )
20 Add.SetComment( 'Add from AddComponent' )
21 Add.Coords( 248 , 70 )
22 IAddx = Add.GetInPort( 'x' )
23 IAddy = Add.GetInPort( 'y' )
24 IAddGate = Add.GetInPort( 'Gate' )
25 OAddFuncValue = Add.GetOutPort( 'FuncValue' )
26 OAddz = Add.GetOutPort( 'z' )
27 OAddGate = Add.GetOutPort( 'Gate' )
29 Add_1 = GraphLoopGates.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
30 Add_1.SetName( 'Add_1' )
32 Add_1.SetContainer( 'localhost/FactoryServer' )
33 Add_1.SetComment( 'Add from AddComponent' )
34 Add_1.Coords( 249 , 305 )
35 IAdd_1x = Add_1.GetInPort( 'x' )
36 IAdd_1y = Add_1.GetInPort( 'y' )
37 IAdd_1Gate = Add_1.GetInPort( 'Gate' )
38 OAdd_1FuncValue = Add_1.GetOutPort( 'FuncValue' )
39 OAdd_1z = Add_1.GetOutPort( 'z' )
40 OAdd_1Gate = Add_1.GetOutPort( 'Gate' )
42 Sub = GraphLoopGates.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
45 Sub.SetContainer( 'localhost/FactoryServer' )
46 Sub.SetComment( 'Sub from SubComponent' )
47 Sub.Coords( 453 , 72 )
48 ISubx = Sub.GetInPort( 'x' )
49 ISuby = Sub.GetInPort( 'y' )
50 ISubGate = Sub.GetInPort( 'Gate' )
51 OSubz = Sub.GetOutPort( 'z' )
52 OSubGate = Sub.GetOutPort( 'Gate' )
54 Sub_1 = GraphLoopGates.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
55 Sub_1.SetName( 'Sub_1' )
57 Sub_1.SetContainer( 'localhost/FactoryServer' )
58 Sub_1.SetComment( 'Sub from SubComponent' )
59 Sub_1.Coords( 455 , 304 )
60 ISub_1x = Sub_1.GetInPort( 'x' )
61 ISub_1y = Sub_1.GetInPort( 'y' )
62 ISub_1Gate = Sub_1.GetInPort( 'Gate' )
63 OSub_1z = Sub_1.GetOutPort( 'z' )
64 OSub_1Gate = Sub_1.GetOutPort( 'Gate' )
66 # Creation of InLine Nodes
68 PyGate.append( 'from time import * ' )
69 PyGate.append( 'def Gate(G1,G2) : ' )
70 PyGate.append( ' sleep(1) ' )
71 PyGate.append( ' return G1&G2 ' )
72 Gate = GraphLoopGates.INode( 'Gate' , PyGate )
73 Gate.SetName( 'Gate' )
75 Gate.SetComment( 'Compute Node' )
76 Gate.Coords( 650 , 227 )
77 IGateG1 = Gate.InPort( 'G1' , 'long' )
78 IGateG2 = Gate.InPort( 'G2' , 'long' )
79 IGateGate = Gate.GetInPort( 'Gate' )
80 OGateG = Gate.OutPort( 'G' , 'long' )
81 OGateGate = Gate.GetOutPort( 'Gate' )
83 # Creation of Loop Nodes
85 PyInit.append( 'from time import * ' )
86 PyInit.append( 'def Init(Index,Min,Max) : ' )
87 PyInit.append( ' Index = Min ' )
88 PyInit.append( ' sleep(1) ' )
89 PyInit.append( ' return Index,Min,Max ' )
91 PyMoreInit.append( 'def More(Index,Min,Max) : ' )
92 PyMoreInit.append( ' if Index < Max : ' )
93 PyMoreInit.append( ' DoLoop = 1 ' )
94 PyMoreInit.append( ' else : ' )
95 PyMoreInit.append( ' DoLoop = 0 ' )
96 PyMoreInit.append( ' return DoLoop,Index,Min,Max ' )
98 PyNextInit.append( 'def Next(Index,Min,Max) : ' )
99 PyNextInit.append( ' Index = Index + 1 ' )
100 PyNextInit.append( ' return Index,Min,Max ' )
101 Init,EndInit = GraphLoopGates.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
102 EndInit.SetName( 'EndInit' )
103 EndInit.SetAuthor( '' )
104 EndInit.SetComment( 'Compute Node' )
105 EndInit.Coords( 840 , 204 )
107 EndInit.SetPyFunction( 'EndInit' , PyEndInit )
108 IInitDoLoop = Init.GetInPort( 'DoLoop' )
109 IInitIndex = Init.InPort( 'Index' , 'long' )
110 IInitMin = Init.InPort( 'Min' , 'long' )
111 IInitMax = Init.InPort( 'Max' , 'long' )
112 IInitGate = Init.GetInPort( 'Gate' )
113 OInitDoLoop = Init.GetOutPort( 'DoLoop' )
114 OInitIndex = Init.GetOutPort( 'Index' )
115 OInitMin = Init.GetOutPort( 'Min' )
116 OInitMax = Init.GetOutPort( 'Max' )
117 IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
118 IEndInitIndex = EndInit.GetInPort( 'Index' )
119 IEndInitMin = EndInit.GetInPort( 'Min' )
120 IEndInitMax = EndInit.GetInPort( 'Max' )
121 IEndInitGate = EndInit.GetInPort( 'Gate' )
122 OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
123 OEndInitGate = EndInit.GetOutPort( 'Gate' )
124 OEndInitIndex = EndInit.GetOutPort( 'Index' )
125 OEndInitMin = EndInit.GetOutPort( 'Min' )
126 OEndInitMax = EndInit.GetOutPort( 'Max' )
127 Init.SetName( 'Init' )
129 Init.SetComment( 'Compute Node' )
130 Init.Coords( 10 , 181 )
133 LInitGateAdd_1Gate = GraphLoopGates.Link( OInitGate , IAdd_1Gate )
135 LInitGateAddGate = GraphLoopGates.Link( OInitGate , IAddGate )
137 LInitIndexEndInitIndex = GraphLoopGates.Link( OInitIndex , IEndInitIndex )
139 LInitMinEndInitMin = GraphLoopGates.Link( OInitMin , IEndInitMin )
141 LInitMaxEndInitMax = GraphLoopGates.Link( OInitMax , IEndInitMax )
143 LAddGateSubGate = GraphLoopGates.Link( OAddGate , ISubGate )
145 LAdd_1GateSub_1Gate = GraphLoopGates.Link( OAdd_1Gate , ISub_1Gate )
147 LSubGateGateG1 = GraphLoopGates.Link( OSubGate , IGateG1 )
149 LSub_1GateGateG2 = GraphLoopGates.Link( OSub_1Gate , IGateG2 )
151 LGateGEndInitGate = GraphLoopGates.Link( OGateG , IEndInitGate )
154 IInitIndex.Input( 0 )
166 # Output Ports of the graph
167 #OEndInitIndex = EndInit.GetOutPort( 'Index' )
168 #OEndInitMin = EndInit.GetOutPort( 'Min' )
169 #OEndInitMax = EndInit.GetOutPort( 'Max' )
170 #OAddFuncValue = Add.GetOutPort( 'FuncValue' )
171 #OAddz = Add.GetOutPort( 'z' )
172 #OAdd_1FuncValue = Add_1.GetOutPort( 'FuncValue' )
173 #OAdd_1z = Add_1.GetOutPort( 'z' )
174 #OSubz = Sub.GetOutPort( 'z' )
175 #OSub_1z = Sub_1.GetOutPort( 'z' )
176 return GraphLoopGates
179 GraphLoopGates = DefGraphLoopGates()