2 # Generated python file of Graph GraphSwitchManyCasesNOTValid
6 # Graph creation of GraphSwitchManyCasesNOTValid
7 def DefGraphSwitchManyCasesNOTValid() :
8 GraphSwitchManyCasesNOTValid = Graph( 'GraphSwitchManyCasesNOTValid' )
9 GraphSwitchManyCasesNOTValid.SetName( 'GraphSwitchManyCasesNOTValid' )
10 GraphSwitchManyCasesNOTValid.SetAuthor( 'JR' )
11 GraphSwitchManyCasesNOTValid.SetComment( '' )
12 GraphSwitchManyCasesNOTValid.Coords( 0 , 0 )
14 # Creation of Factory Nodes
16 # Creation of InLine Nodes
18 PyCase1.append( 'from time import * ' )
19 PyCase1.append( 'def Case1(a) : ' )
20 PyCase1.append( ' sleep(1) ' )
21 PyCase1.append( ' return a ' )
22 Case1 = GraphSwitchManyCasesNOTValid.INode( 'Case1' , PyCase1 )
23 Case1.SetName( 'Case1' )
25 Case1.SetComment( 'Compute Node' )
26 Case1.Coords( 448 , 13 )
27 ICase1a = Case1.InPort( 'a' , 'long' )
28 ICase1Gate = Case1.GetInPort( 'Gate' )
29 OCase1a = Case1.OutPort( 'a' , 'long' )
30 OCase1Gate = Case1.GetOutPort( 'Gate' )
33 PyCase3.append( 'from time import * ' )
34 PyCase3.append( 'def Case3(b) : ' )
35 PyCase3.append( ' sleep(1) ' )
36 PyCase3.append( ' return b ' )
37 Case3 = GraphSwitchManyCasesNOTValid.INode( 'Case3' , PyCase3 )
38 Case3.SetName( 'Case3' )
40 Case3.SetComment( 'Compute Node' )
41 Case3.Coords( 461 , 500 )
42 ICase3b = Case3.InPort( 'b' , 'long' )
43 ICase3Gate = Case3.GetInPort( 'Gate' )
44 OCase3b = Case3.OutPort( 'b' , 'long' )
45 OCase3Gate = Case3.GetOutPort( 'Gate' )
48 PyCase4.append( 'from time import * ' )
49 PyCase4.append( 'def Case4(c) : ' )
50 PyCase4.append( ' sleep(1) ' )
51 PyCase4.append( ' return ' )
52 Case4 = GraphSwitchManyCasesNOTValid.INode( 'Case4' , PyCase4 )
53 Case4.SetName( 'Case4' )
55 Case4.SetComment( 'Compute Node' )
56 Case4.Coords( 455 , 647 )
57 ICase4c = Case4.InPort( 'c' , 'long' )
58 ICase4Gate = Case4.GetInPort( 'Gate' )
59 OCase4Gate = Case4.GetOutPort( 'Gate' )
62 PyCase2.append( 'from time import * ' )
63 PyCase2.append( 'def Case2() : ' )
64 PyCase2.append( ' sleep(1) ' )
65 PyCase2.append( ' return ' )
66 Case2 = GraphSwitchManyCasesNOTValid.INode( 'Case2' , PyCase2 )
67 Case2.SetName( 'Case2' )
69 Case2.SetComment( 'Compute Node' )
70 Case2.Coords( 455 , 179 )
71 ICase2Gate = Case2.GetInPort( 'Gate' )
72 OCase2Gate = Case2.GetOutPort( 'Gate' )
75 PyCase2a.append( 'from time import * ' )
76 PyCase2a.append( 'def Case2a(a) : ' )
77 PyCase2a.append( ' sleep(1) ' )
78 PyCase2a.append( ' return a ' )
79 Case2a = GraphSwitchManyCasesNOTValid.INode( 'Case2a' , PyCase2a )
80 Case2a.SetName( 'Case2a' )
81 Case2a.SetAuthor( '' )
82 Case2a.SetComment( 'Compute Node' )
83 Case2a.Coords( 456 , 304 )
84 ICase2aa = Case2a.InPort( 'a' , 'long' )
85 ICase2aGate = Case2a.GetInPort( 'Gate' )
86 OCase2aa = Case2a.OutPort( 'a' , 'long' )
87 OCase2aGate = Case2a.GetOutPort( 'Gate' )
89 # Creation of Loop Nodes
91 PyLoop.append( 'def Init(Index,Max,Min) : ' )
92 PyLoop.append( ' Index = Max ' )
93 PyLoop.append( ' return Index,Max,Min ' )
95 PyMoreLoop.append( 'def More(Index,Max,Min) : ' )
96 PyMoreLoop.append( ' if Index >= Min : ' )
97 PyMoreLoop.append( ' DoLoop = 1 ' )
98 PyMoreLoop.append( ' else : ' )
99 PyMoreLoop.append( ' DoLoop = 0 ' )
100 PyMoreLoop.append( ' return DoLoop,Index,Max,Min ' )
102 PyNextLoop.append( 'def Next(Index,Max,Min) : ' )
103 PyNextLoop.append( ' Index = Index - 1 ' )
104 PyNextLoop.append( ' return Index,Max,Min ' )
105 Loop,EndLoop = GraphSwitchManyCasesNOTValid.LNode( 'Init' , PyLoop , 'More' , PyMoreLoop , 'Next' , PyNextLoop )
106 EndLoop.SetName( 'EndLoop' )
107 EndLoop.SetAuthor( '' )
108 EndLoop.SetComment( 'Compute Node' )
109 EndLoop.Coords( 972 , 344 )
111 EndLoop.SetPyFunction( 'EndLoop' , PyEndLoop )
112 ILoopDoLoop = Loop.GetInPort( 'DoLoop' )
113 ILoopIndex = Loop.InPort( 'Index' , 'long' )
114 ILoopMax = Loop.InPort( 'Max' , 'long' )
115 ILoopMin = Loop.InPort( 'Min' , 'long' )
116 ILoopGate = Loop.GetInPort( 'Gate' )
117 OLoopDoLoop = Loop.GetOutPort( 'DoLoop' )
118 OLoopIndex = Loop.GetOutPort( 'Index' )
119 OLoopMax = Loop.GetOutPort( 'Max' )
120 OLoopMin = Loop.GetOutPort( 'Min' )
121 IEndLoopDoLoop = EndLoop.GetInPort( 'DoLoop' )
122 IEndLoopIndex = EndLoop.GetInPort( 'Index' )
123 IEndLoopMax = EndLoop.GetInPort( 'Max' )
124 IEndLoopMin = EndLoop.GetInPort( 'Min' )
125 IEndLoopGate = EndLoop.GetInPort( 'Gate' )
126 OEndLoopDoLoop = EndLoop.GetOutPort( 'DoLoop' )
127 OEndLoopIndex = EndLoop.GetOutPort( 'Index' )
128 OEndLoopMax = EndLoop.GetOutPort( 'Max' )
129 OEndLoopMin = EndLoop.GetOutPort( 'Min' )
130 OEndLoopGate = EndLoop.GetOutPort( 'Gate' )
131 Loop.SetName( 'Loop' )
133 Loop.SetComment( 'Compute Node' )
134 Loop.Coords( 15 , 336 )
136 # Creation of Switch Nodes
138 PySwitch.append( 'from time import * ' )
139 PySwitch.append( 'def Switch(Index) : ' )
140 PySwitch.append( ' sleep(1) ' )
141 PySwitch.append( ' SB1 = 0 ' )
142 PySwitch.append( ' SB2 = 0 ' )
143 PySwitch.append( ' if (Index & 3) == 3 : ' )
144 PySwitch.append( ' SB1 = 1 ' )
145 PySwitch.append( ' elif (Index & 3) == 0 : ' )
146 PySwitch.append( ' SB2 = 1 ' )
147 PySwitch.append( ' return SB1,SB2,Index,Index+1,Index+2,Index+3,Index+4,Index+5 ' )
148 Switch,EndSwitch = GraphSwitchManyCasesNOTValid.SNode( 'Switch' , PySwitch )
149 EndSwitch.SetName( 'EndSwitch' )
150 EndSwitch.SetAuthor( '' )
151 EndSwitch.SetComment( 'Compute Node' )
152 EndSwitch.Coords( 732 , 344 )
154 PyEndSwitch.append( 'from time import * ' )
155 PyEndSwitch.append( 'def EndSwitch(a,b,dd,e,f) : ' )
156 PyEndSwitch.append( ' sleep(1) ' )
157 PyEndSwitch.append( ' if b != (a+1) : ' )
158 PyEndSwitch.append( ' print 'EndSwitch ERROR' ' )
159 PyEndSwitch.append( ' pass ' )
160 PyEndSwitch.append( ' if dd != (a+3) : ' )
161 PyEndSwitch.append( ' print 'EndSwitch ERROR' ' )
162 PyEndSwitch.append( ' pass ' )
163 PyEndSwitch.append( ' if e != (a+4) : ' )
164 PyEndSwitch.append( ' print 'EndSwitch ERROR' ' )
165 PyEndSwitch.append( ' pass ' )
166 PyEndSwitch.append( ' if f != (a+5) : ' )
167 PyEndSwitch.append( ' print 'EndSwitch ERROR' ' )
168 PyEndSwitch.append( ' pass ' )
169 PyEndSwitch.append( ' return a ' )
170 EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch )
171 IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
172 IEndSwitchb = EndSwitch.InPort( 'b' , 'long' )
173 IEndSwitchdd = EndSwitch.InPort( 'dd' , 'long' )
174 IEndSwitche = EndSwitch.InPort( 'e' , 'long' )
175 IEndSwitchf = EndSwitch.InPort( 'f' , 'long' )
176 IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
177 OEndSwitchIndex = EndSwitch.OutPort( 'Index' , 'long' )
178 OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
179 Switch.SetName( 'Switch' )
180 Switch.SetAuthor( '' )
181 Switch.SetComment( 'Compute Node' )
182 Switch.Coords( 232 , 285 )
183 ISwitchIndex = Switch.InPort( 'Index' , 'long' )
184 ISwitchGate = Switch.GetInPort( 'Gate' )
185 OSwitchSB1 = Switch.OutPort( 'SB1' , 'long' )
186 OSwitchSB2 = Switch.OutPort( 'SB2' , 'long' )
187 OSwitcha = Switch.OutPort( 'a' , 'long' )
188 OSwitchb = Switch.OutPort( 'b' , 'long' )
189 OSwitchc = Switch.OutPort( 'c' , 'long' )
190 OSwitchd = Switch.OutPort( 'd' , 'long' )
191 OSwitche = Switch.OutPort( 'e' , 'long' )
192 OSwitchf = Switch.OutPort( 'f' , 'long' )
193 OSwitchDefault = Switch.GetOutPort( 'Default' )
196 LLoopIndexSwitchIndex = GraphSwitchManyCasesNOTValid.Link( OLoopIndex , ISwitchIndex )
198 LLoopMaxEndLoopMax = GraphSwitchManyCasesNOTValid.Link( OLoopMax , IEndLoopMax )
200 LLoopMinEndLoopMin = GraphSwitchManyCasesNOTValid.Link( OLoopMin , IEndLoopMin )
202 LSwitchSB1Case1Gate = GraphSwitchManyCasesNOTValid.Link( OSwitchSB1 , ICase1Gate )
204 LSwitchSB2Case2Gate = GraphSwitchManyCasesNOTValid.Link( OSwitchSB2 , ICase2Gate )
206 LSwitchSB2Case2aGate = GraphSwitchManyCasesNOTValid.Link( OSwitchSB2 , ICase2aGate )
208 LSwitchaCase1a = GraphSwitchManyCasesNOTValid.Link( OSwitcha , ICase1a )
210 LSwitchaCase2aa = GraphSwitchManyCasesNOTValid.Link( OSwitcha , ICase2aa )
212 LSwitchbCase3b = GraphSwitchManyCasesNOTValid.Link( OSwitchb , ICase3b )
214 LSwitchcCase4c = GraphSwitchManyCasesNOTValid.Link( OSwitchc , ICase4c )
216 LSwitchdEndSwitchdd = GraphSwitchManyCasesNOTValid.Link( OSwitchd , IEndSwitchdd )
218 LSwitcheEndSwitche = GraphSwitchManyCasesNOTValid.Link( OSwitche , IEndSwitche )
220 LSwitchDefaultEndSwitchDefault = GraphSwitchManyCasesNOTValid.Link( OSwitchDefault , IEndSwitchDefault )
222 LEndSwitchIndexEndLoopIndex = GraphSwitchManyCasesNOTValid.Link( OEndSwitchIndex , IEndLoopIndex )
224 LCase1aEndSwitcha = GraphSwitchManyCasesNOTValid.Link( OCase1a , IEndSwitcha )
226 LCase3bEndSwitchb = GraphSwitchManyCasesNOTValid.Link( OCase3b , IEndSwitchb )
228 LCase4GateEndSwitchDefault = GraphSwitchManyCasesNOTValid.Link( OCase4Gate , IEndSwitchDefault )
230 LCase2GateEndSwitchDefault = GraphSwitchManyCasesNOTValid.Link( OCase2Gate , IEndSwitchDefault )
232 LCase2aaEndSwitcha = GraphSwitchManyCasesNOTValid.Link( OCase2aa , IEndSwitcha )
235 ILoopIndex.Input( 0 )
239 # Input Ports of the graph
240 #IEndSwitchf = EndSwitch.GetInPort( 'f' )
242 # Output Ports of the graph
243 #OEndLoopIndex = EndLoop.GetOutPort( 'Index' )
244 #OEndLoopMax = EndLoop.GetOutPort( 'Max' )
245 #OEndLoopMin = EndLoop.GetOutPort( 'Min' )
246 #OSwitchf = Switch.GetOutPort( 'f' )
247 return GraphSwitchManyCasesNOTValid
250 GraphSwitchManyCasesNOTValid = DefGraphSwitchManyCasesNOTValid()