2 # Generated python file of Graph GraphLoopSwitchs_1
6 # Graph creation of GraphLoopSwitchs_1
7 def DefGraphLoopSwitchs_1() :
8 GraphLoopSwitchs_1 = Graph( 'GraphLoopSwitchs_1' )
9 GraphLoopSwitchs_1.SetName( 'GraphLoopSwitchs_1' )
10 GraphLoopSwitchs_1.SetAuthor( 'JR' )
11 GraphLoopSwitchs_1.SetComment( '' )
12 GraphLoopSwitchs_1.Coords( 0 , 0 )
14 # Creation of Factory Nodes
16 # Creation of InLine Nodes
18 PyIsOdd.append( 'from time import * ' )
19 PyIsOdd.append( 'def IsOdd(a) : ' )
20 PyIsOdd.append( ' print a,"IsOdd" ' )
21 PyIsOdd.append( ' sleep( 1 ) ' )
22 PyIsOdd.append( ' return a,1 ' )
23 IsOdd = GraphLoopSwitchs_1.INode( 'IsOdd' , PyIsOdd )
24 IsOdd.SetName( 'IsOdd' )
26 IsOdd.SetComment( 'Python function' )
27 IsOdd.Coords( 476 , 50 )
28 IIsOdda = IsOdd.InPort( 'a' , 'long' )
29 IIsOddGate = IsOdd.GetInPort( 'Gate' )
30 OIsOdda = IsOdd.OutPort( 'a' , 'long' )
31 OIsOddOdd = IsOdd.OutPort( 'Odd' , 'long' )
32 OIsOddGate = IsOdd.GetOutPort( 'Gate' )
35 PyIsEven.append( 'from time import * ' )
36 PyIsEven.append( 'def IsEven(a) : ' )
37 PyIsEven.append( ' print a,"IsEven" ' )
38 PyIsEven.append( ' sleep( 1 ) ' )
39 PyIsEven.append( ' return a,1 ' )
40 IsEven = GraphLoopSwitchs_1.INode( 'IsEven' , PyIsEven )
41 IsEven.SetName( 'IsEven' )
42 IsEven.SetAuthor( '' )
43 IsEven.SetComment( 'Python function' )
44 IsEven.Coords( 482 , 292 )
45 IIsEvena = IsEven.InPort( 'a' , 'long' )
46 IIsEvenGate = IsEven.GetInPort( 'Gate' )
47 OIsEvena = IsEven.OutPort( 'a' , 'long' )
48 OIsEvenEven = IsEven.OutPort( 'Even' , 'long' )
49 OIsEvenGate = IsEven.GetOutPort( 'Gate' )
52 PySwitchsCompare.append( 'from time import * ' )
53 PySwitchsCompare.append( 'def SwitchsCompare(aOdd,Odd,aEven,Even) : ' )
54 PySwitchsCompare.append( ' sleep(1) ' )
55 PySwitchsCompare.append( ' return aOdd ' )
56 SwitchsCompare = GraphLoopSwitchs_1.INode( 'SwitchsCompare' , PySwitchsCompare )
57 SwitchsCompare.SetName( 'SwitchsCompare' )
58 SwitchsCompare.SetAuthor( '' )
59 SwitchsCompare.SetComment( 'Compute Node' )
60 SwitchsCompare.Coords( 919 , 242 )
61 ISwitchsCompareaOdd = SwitchsCompare.InPort( 'aOdd' , 'long' )
62 ISwitchsCompareOdd = SwitchsCompare.InPort( 'Odd' , 'boolean' )
63 ISwitchsCompareaEven = SwitchsCompare.InPort( 'aEven' , 'long' )
64 ISwitchsCompareEven = SwitchsCompare.InPort( 'Even' , 'boolean' )
65 ISwitchsCompareGate = SwitchsCompare.GetInPort( 'Gate' )
66 OSwitchsComparea = SwitchsCompare.OutPort( 'a' , 'long' )
67 OSwitchsCompareGate = SwitchsCompare.GetOutPort( 'Gate' )
69 # Creation of Loop Nodes
71 PyLoop.append( 'def InitLoop(Index,Min,Max) : ' )
72 PyLoop.append( ' return Index,Min,Max ' )
74 PyMoreLoop.append( 'def MoreLoop(Index,Min,Max) : ' )
75 PyMoreLoop.append( ' if Index <= Max : ' )
76 PyMoreLoop.append( ' DoLoop = 1 ' )
77 PyMoreLoop.append( ' else : ' )
78 PyMoreLoop.append( ' DoLoop = 0 ' )
79 PyMoreLoop.append( ' return DoLoop,Index,Min,Max ' )
81 PyNextLoop.append( 'def NextLoop(Index,Min,Max) : ' )
82 PyNextLoop.append( ' Index = Index + 1 ' )
83 PyNextLoop.append( ' return Index,Min,Max ' )
84 Loop,EndOfLoop = GraphLoopSwitchs_1.LNode( 'InitLoop' , PyLoop , 'MoreLoop' , PyMoreLoop , 'NextLoop' , PyNextLoop )
85 EndOfLoop.SetName( 'EndOfLoop' )
86 EndOfLoop.SetAuthor( '' )
87 EndOfLoop.SetComment( 'Compute Node' )
88 EndOfLoop.Coords( 1102 , 282 )
90 EndOfLoop.SetPyFunction( '' , PyEndOfLoop )
91 ILoopDoLoop = Loop.GetInPort( 'DoLoop' )
92 ILoopIndex = Loop.InPort( 'Index' , 'long' )
93 ILoopMin = Loop.InPort( 'Min' , 'long' )
94 ILoopMax = Loop.InPort( 'Max' , 'long' )
95 ILoopGate = Loop.GetInPort( 'Gate' )
96 OLoopDoLoop = Loop.GetOutPort( 'DoLoop' )
97 OLoopIndex = Loop.GetOutPort( 'Index' )
98 OLoopMin = Loop.GetOutPort( 'Min' )
99 OLoopMax = Loop.GetOutPort( 'Max' )
100 IEndOfLoopDoLoop = EndOfLoop.GetInPort( 'DoLoop' )
101 IEndOfLoopIndex = EndOfLoop.GetInPort( 'Index' )
102 IEndOfLoopMin = EndOfLoop.GetInPort( 'Min' )
103 IEndOfLoopMax = EndOfLoop.GetInPort( 'Max' )
104 IEndOfLoopGate = EndOfLoop.GetInPort( 'Gate' )
105 OEndOfLoopDoLoop = EndOfLoop.GetOutPort( 'DoLoop' )
106 OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' )
107 OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' )
108 OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' )
109 OEndOfLoopGate = EndOfLoop.GetOutPort( 'Gate' )
110 Loop.SetName( 'Loop' )
112 Loop.SetComment( 'Compute Node' )
113 Loop.Coords( 12 , 276 )
115 # Creation of Switch Nodes
117 PySwitchOdd.append( 'from time import * ' )
118 PySwitchOdd.append( 'def Switch(a) : ' )
119 PySwitchOdd.append( ' sleep(1) ' )
120 PySwitchOdd.append( ' return a & 1,1-(a&1),a ' )
121 SwitchOdd,EndOfSwitchOdd = GraphLoopSwitchs_1.SNode( 'Switch' , PySwitchOdd )
122 EndOfSwitchOdd.SetName( 'EndOfSwitchOdd' )
123 EndOfSwitchOdd.SetAuthor( '' )
124 EndOfSwitchOdd.SetComment( 'Compute Node' )
125 EndOfSwitchOdd.Coords( 711 , 161 )
126 PyEndOfSwitchOdd = []
127 PyEndOfSwitchOdd.append( 'from time import * ' )
128 PyEndOfSwitchOdd.append( 'def EndOfSwitchOdd(a,Odd) : ' )
129 PyEndOfSwitchOdd.append( ' sleep(1) ' )
130 PyEndOfSwitchOdd.append( ' return a,Odd ' )
131 EndOfSwitchOdd.SetPyFunction( 'EndOfSwitchOdd' , PyEndOfSwitchOdd )
132 IEndOfSwitchOdda = EndOfSwitchOdd.InPort( 'a' , 'long' )
133 IEndOfSwitchOddOdd = EndOfSwitchOdd.InPort( 'Odd' , 'boolean' )
134 IEndOfSwitchOddDefault = EndOfSwitchOdd.GetInPort( 'Default' )
135 OEndOfSwitchOdda = EndOfSwitchOdd.OutPort( 'a' , 'long' )
136 OEndOfSwitchOddOdd = EndOfSwitchOdd.OutPort( 'Odd' , 'boolean' )
137 OEndOfSwitchOddGate = EndOfSwitchOdd.GetOutPort( 'Gate' )
138 SwitchOdd.SetName( 'SwitchOdd' )
139 SwitchOdd.SetAuthor( '' )
140 SwitchOdd.SetComment( 'Compute Node' )
141 SwitchOdd.Coords( 240 , 141 )
142 ISwitchOdda = SwitchOdd.InPort( 'a' , 'long' )
143 ISwitchOddGate = SwitchOdd.GetInPort( 'Gate' )
144 OSwitchOddOdd = SwitchOdd.OutPort( 'Odd' , 'long' )
145 OSwitchOddEven = SwitchOdd.OutPort( 'Even' , 'int' )
146 OSwitchOdda = SwitchOdd.OutPort( 'a' , 'int' )
147 OSwitchOddDefault = SwitchOdd.GetOutPort( 'Default' )
150 PySwitchEven.append( 'from time import * ' )
151 PySwitchEven.append( 'def Switch(a) : ' )
152 PySwitchEven.append( ' sleep(1) ' )
153 PySwitchEven.append( ' return a & 1,1-(a&1),a ' )
154 SwitchEven,EndOfSwitchEven = GraphLoopSwitchs_1.SNode( 'Switch' , PySwitchEven )
155 EndOfSwitchEven.SetName( 'EndOfSwitchEven' )
156 EndOfSwitchEven.SetAuthor( '' )
157 EndOfSwitchEven.SetComment( 'Compute Node' )
158 EndOfSwitchEven.Coords( 718 , 361 )
159 PyEndOfSwitchEven = []
160 PyEndOfSwitchEven.append( 'from time import * ' )
161 PyEndOfSwitchEven.append( 'def EndOfSwitchEven(a,Even) : ' )
162 PyEndOfSwitchEven.append( ' sleep(1) ' )
163 PyEndOfSwitchEven.append( ' return a,Even ' )
164 EndOfSwitchEven.SetPyFunction( 'EndOfSwitchEven' , PyEndOfSwitchEven )
165 IEndOfSwitchEvena = EndOfSwitchEven.InPort( 'a' , 'long' )
166 IEndOfSwitchEvenEven = EndOfSwitchEven.InPort( 'Even' , 'boolean' )
167 IEndOfSwitchEvenDefault = EndOfSwitchEven.GetInPort( 'Default' )
168 OEndOfSwitchEvena = EndOfSwitchEven.OutPort( 'a' , 'long' )
169 OEndOfSwitchEvenEven = EndOfSwitchEven.OutPort( 'Even' , 'boolean' )
170 OEndOfSwitchEvenGate = EndOfSwitchEven.GetOutPort( 'Gate' )
171 SwitchEven.SetName( 'SwitchEven' )
172 SwitchEven.SetAuthor( '' )
173 SwitchEven.SetComment( 'Compute Node' )
174 SwitchEven.Coords( 235 , 386 )
175 ISwitchEvena = SwitchEven.InPort( 'a' , 'long' )
176 ISwitchEvenGate = SwitchEven.GetInPort( 'Gate' )
177 OSwitchEvenOdd = SwitchEven.OutPort( 'Odd' , 'long' )
178 OSwitchEvenEven = SwitchEven.OutPort( 'Even' , 'int' )
179 OSwitchEvena = SwitchEven.OutPort( 'a' , 'int' )
180 OSwitchEvenDefault = SwitchEven.GetOutPort( 'Default' )
183 LIsOddaEndOfSwitchOdda = GraphLoopSwitchs_1.Link( OIsOdda , IEndOfSwitchOdda )
185 LIsOddOddEndOfSwitchOddOdd = GraphLoopSwitchs_1.Link( OIsOddOdd , IEndOfSwitchOddOdd )
187 LSwitchOddOddIsOddGate = GraphLoopSwitchs_1.Link( OSwitchOddOdd , IIsOddGate )
189 LSwitchOddaIsOdda = GraphLoopSwitchs_1.Link( OSwitchOdda , IIsOdda )
191 LSwitchOddDefaultEndOfSwitchOddDefault = GraphLoopSwitchs_1.Link( OSwitchOddDefault , IEndOfSwitchOddDefault )
193 LEndOfSwitchOddaSwitchsCompareaOdd = GraphLoopSwitchs_1.Link( OEndOfSwitchOdda , ISwitchsCompareaOdd )
195 LEndOfSwitchOddOddSwitchsCompareOdd = GraphLoopSwitchs_1.Link( OEndOfSwitchOddOdd , ISwitchsCompareOdd )
197 LIsEvenaEndOfSwitchEvena = GraphLoopSwitchs_1.Link( OIsEvena , IEndOfSwitchEvena )
199 LIsEvenEvenEndOfSwitchEvenEven = GraphLoopSwitchs_1.Link( OIsEvenEven , IEndOfSwitchEvenEven )
201 LLoopIndexSwitchEvena = GraphLoopSwitchs_1.Link( OLoopIndex , ISwitchEvena )
203 LLoopIndexSwitchOdda = GraphLoopSwitchs_1.Link( OLoopIndex , ISwitchOdda )
205 LLoopMinEndOfLoopMin = GraphLoopSwitchs_1.Link( OLoopMin , IEndOfLoopMin )
207 LLoopMaxEndOfLoopMax = GraphLoopSwitchs_1.Link( OLoopMax , IEndOfLoopMax )
209 LSwitchEvenEvenIsEvenGate = GraphLoopSwitchs_1.Link( OSwitchEvenEven , IIsEvenGate )
211 LSwitchEvenaIsEvena = GraphLoopSwitchs_1.Link( OSwitchEvena , IIsEvena )
213 LSwitchEvenDefaultEndOfSwitchEvenDefault = GraphLoopSwitchs_1.Link( OSwitchEvenDefault , IEndOfSwitchEvenDefault )
215 LEndOfSwitchEvenaSwitchsCompareaEven = GraphLoopSwitchs_1.Link( OEndOfSwitchEvena , ISwitchsCompareaEven )
217 LEndOfSwitchEvenEvenSwitchsCompareEven = GraphLoopSwitchs_1.Link( OEndOfSwitchEvenEven , ISwitchsCompareEven )
219 LSwitchsCompareaEndOfLoopIndex = GraphLoopSwitchs_1.Link( OSwitchsComparea , IEndOfLoopIndex )
222 ILoopIndex.Input( 0 )
226 # Output Ports of the graph
227 #OSwitchOddEven = SwitchOdd.GetOutPort( 'Even' )
228 #OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' )
229 #OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' )
230 #OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' )
231 #OSwitchEvenOdd = SwitchEven.GetOutPort( 'Odd' )
232 return GraphLoopSwitchs_1
235 GraphLoopSwitchs_1 = DefGraphLoopSwitchs_1()