Salome HOME
Imported using TkCVS
[samples/datafiles.git] / Superv / Python / GraphLoopsStupidCoupledSwitchs.py
1
2 # Generated python file of Graph GraphLoopsStupidCoupledSwitchs
3
4 from SuperV import *
5
6 # Graph creation of GraphLoopsStupidCoupledSwitchs
7 def DefGraphLoopsStupidCoupledSwitchs() :
8     GraphLoopsStupidCoupledSwitchs = Graph( 'GraphLoopsStupidCoupledSwitchs' )
9     GraphLoopsStupidCoupledSwitchs.SetName( 'GraphLoopsStupidCoupledSwitchs' )
10     GraphLoopsStupidCoupledSwitchs.SetAuthor( '' )
11     GraphLoopsStupidCoupledSwitchs.SetComment( '' )
12     GraphLoopsStupidCoupledSwitchs.Coords( 0 , 0 )
13     
14     # Creation of Factory Nodes
15     
16     # Creation of InLine Nodes
17     PyIsOdd = []
18     PyIsOdd.append( 'from time import *   ' )
19     PyIsOdd.append( 'def IsOdd(a) :       ' )
20     PyIsOdd.append( '    print a,"IsOdd (GraphSwitchs)"      ' )
21     PyIsOdd.append( '    sleep( 1 )   ' )
22     PyIsOdd.append( '    return a     ' )
23     IsOdd = GraphLoopsStupidCoupledSwitchs.INode( 'IsOdd' , PyIsOdd )
24     IsOdd.SetName( 'IsOdd' )
25     IsOdd.SetAuthor( '' )
26     IsOdd.SetComment( 'Python function' )
27     IsOdd.Coords( 458 , 52 )
28     IIsOdda = IsOdd.InPort( 'a' , 'long' )
29     IIsOddGate = IsOdd.GetInPort( 'Gate' )
30     OIsOdda = IsOdd.OutPort( 'a' , 'long' )
31     OIsOddGate = IsOdd.GetOutPort( 'Gate' )
32     
33     PyIsOdd_1 = []
34     PyIsOdd_1.append( 'from time import *   ' )
35     PyIsOdd_1.append( 'def IsOdd(a) :       ' )
36     PyIsOdd_1.append( '    print a,"IsOdd_1 (GraphSwitchs)"      ' )
37     PyIsOdd_1.append( '    sleep( 1 )   ' )
38     PyIsOdd_1.append( '    return a     ' )
39     IsOdd_1 = GraphLoopsStupidCoupledSwitchs.INode( 'IsOdd' , PyIsOdd_1 )
40     IsOdd_1.SetName( 'IsOdd_1' )
41     IsOdd_1.SetAuthor( '' )
42     IsOdd_1.SetComment( 'Python function' )
43     IsOdd_1.Coords( 487 , 321 )
44     IIsOdd_1a = IsOdd_1.InPort( 'a' , 'long' )
45     IIsOdd_1Gate = IsOdd_1.GetInPort( 'Gate' )
46     OIsOdd_1a = IsOdd_1.OutPort( 'a' , 'long' )
47     OIsOdd_1Gate = IsOdd_1.GetOutPort( 'Gate' )
48     
49     # Creation of Loop Nodes
50     PyInitLoopSwitch = []
51     PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) :      ' )
52     PyInitLoopSwitch.append( '  return Index,Min,Max     ' )
53     PyMoreInitLoopSwitch = []
54     PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) :     ' )
55     PyMoreInitLoopSwitch.append( '      if Index <= Max :   ' )
56     PyMoreInitLoopSwitch.append( '              DoLoop = 1     ' )
57     PyMoreInitLoopSwitch.append( '      else :     ' )
58     PyMoreInitLoopSwitch.append( '              DoLoop = 0     ' )
59     PyMoreInitLoopSwitch.append( '      return DoLoop,Index,Min,Max     ' )
60     PyNextInitLoopSwitch = []
61     PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) :     ' )
62     PyNextInitLoopSwitch.append( '      Index = Index + 1     ' )
63     PyNextInitLoopSwitch.append( '      return Index,Min,Max     ' )
64     InitLoopSwitch,EndOfInitLoopSwitch = GraphLoopsStupidCoupledSwitchs.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch )
65     EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' )
66     EndOfInitLoopSwitch.SetAuthor( '' )
67     EndOfInitLoopSwitch.SetComment( 'Compute Node' )
68     EndOfInitLoopSwitch.Coords( 955 , 122 )
69     PyEndOfInitLoopSwitch = []
70     EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch )
71     IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' )
72     IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' )
73     IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' )
74     IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' )
75     IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' )
76     OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' )
77     OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' )
78     OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' )
79     OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' )
80     IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' )
81     IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' )
82     IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' )
83     IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' )
84     IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' )
85     OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' )
86     OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
87     OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
88     OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
89     OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' )
90     InitLoopSwitch.SetName( 'InitLoopSwitch' )
91     InitLoopSwitch.SetAuthor( '' )
92     InitLoopSwitch.SetComment( 'Compute Node' )
93     InitLoopSwitch.Coords( 14 , 136 )
94     
95     PyInitLoop = []
96     PyInitLoop.append( 'def InitLoop(Index,Min,Max) :      ' )
97     PyInitLoop.append( '        return Index,Min,Max     ' )
98     PyMoreInitLoop = []
99     PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) :     ' )
100     PyMoreInitLoop.append( '    if Index <= Max :   ' )
101     PyMoreInitLoop.append( '            DoLoop = 1     ' )
102     PyMoreInitLoop.append( '    else :     ' )
103     PyMoreInitLoop.append( '            DoLoop = 0     ' )
104     PyMoreInitLoop.append( '    return DoLoop,Index,Min,Max     ' )
105     PyNextInitLoop = []
106     PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) :     ' )
107     PyNextInitLoop.append( '    Index = Index + 1     ' )
108     PyNextInitLoop.append( '    return Index,Min,Max     ' )
109     InitLoop,EndOfInitLoop = GraphLoopsStupidCoupledSwitchs.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop )
110     EndOfInitLoop.SetName( 'EndOfInitLoop' )
111     EndOfInitLoop.SetAuthor( '' )
112     EndOfInitLoop.SetComment( 'Compute Node' )
113     EndOfInitLoop.Coords( 961 , 369 )
114     PyEndOfInitLoop = []
115     EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop )
116     IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' )
117     IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
118     IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
119     IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
120     IInitLoopGate = InitLoop.GetInPort( 'Gate' )
121     OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
122     OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
123     OInitLoopMin = InitLoop.GetOutPort( 'Min' )
124     OInitLoopMax = InitLoop.GetOutPort( 'Max' )
125     IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
126     IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
127     IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
128     IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
129     IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
130     OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
131     OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
132     OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
133     OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
134     OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' )
135     InitLoop.SetName( 'InitLoop' )
136     InitLoop.SetAuthor( '' )
137     InitLoop.SetComment( 'Compute Node' )
138     InitLoop.Coords( 10 , 391 )
139     
140     # Creation of Switch Nodes
141     PySwitch = []
142     PySwitch.append( 'from time import * ' )
143     PySwitch.append( 'def Switch(a) :   ' )
144     PySwitch.append( '    if ( a & 1 ) == 0 : ' )
145     PySwitch.append( '        sleep(1)    ' )
146     PySwitch.append( '    return a & 1,1-(a&1),a    ' )
147     Switch,EndOfSwitch = GraphLoopsStupidCoupledSwitchs.SNode( 'Switch' , PySwitch )
148     EndOfSwitch.SetName( 'EndOfSwitch' )
149     EndOfSwitch.SetAuthor( '' )
150     EndOfSwitch.SetComment( 'Compute Node' )
151     EndOfSwitch.Coords( 690 , 129 )
152     PyEndOfSwitch = []
153     EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch )
154     IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
155     IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
156     OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
157     OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
158     Switch.SetName( 'Switch' )
159     Switch.SetAuthor( '' )
160     Switch.SetComment( 'Compute Node' )
161     Switch.Coords( 245 , 136 )
162     ISwitcha = Switch.InPort( 'a' , 'long' )
163     ISwitchGate = Switch.GetInPort( 'Gate' )
164     OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
165     OSwitchEven = Switch.OutPort( 'Even' , 'int' )
166     OSwitcha = Switch.OutPort( 'a' , 'int' )
167     OSwitchDefault = Switch.GetOutPort( 'Default' )
168     
169     PySwitch_1 = []
170     PySwitch_1.append( 'from time import *  ' )
171     PySwitch_1.append( 'def Switch(a) :    ' )
172     PySwitch_1.append( '    if ( a & 1 ) == 0 :  ' )
173     PySwitch_1.append( '        sleep(1)  ' )
174     PySwitch_1.append( '    return a & 1,1-(a&1),a    ' )
175     Switch_1,EndSwitch = GraphLoopsStupidCoupledSwitchs.SNode( 'Switch' , PySwitch_1 )
176     EndSwitch.SetName( 'EndSwitch' )
177     EndSwitch.SetAuthor( '' )
178     EndSwitch.SetComment( 'Compute Node' )
179     EndSwitch.Coords( 695 , 387 )
180     PyEndSwitch = []
181     EndSwitch.SetPyFunction( '' , PyEndSwitch )
182     IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
183     IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
184     OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
185     OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
186     Switch_1.SetName( 'Switch_1' )
187     Switch_1.SetAuthor( '' )
188     Switch_1.SetComment( 'Compute Node' )
189     Switch_1.Coords( 258 , 391 )
190     ISwitch_1a = Switch_1.InPort( 'a' , 'long' )
191     ISwitch_1Gate = Switch_1.GetInPort( 'Gate' )
192     OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' )
193     OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' )
194     OSwitch_1a = Switch_1.OutPort( 'a' , 'int' )
195     OSwitch_1Default = Switch_1.GetOutPort( 'Default' )
196     
197     # Creation of Links
198     LIsOddaEndOfSwitcha = GraphLoopsStupidCoupledSwitchs.Link( OIsOdda , IEndOfSwitcha )
199     
200     LIsOddGateEndOfSwitchDefault = GraphLoopsStupidCoupledSwitchs.Link( OIsOddGate , IEndOfSwitchDefault )
201     
202     LInitLoopSwitchIndexSwitcha = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopSwitchIndex , ISwitcha )
203     
204     LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin )
205     
206     LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax )
207     
208     LInitLoopSwitchGateEndSwitchDefault = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopSwitchGate , IEndSwitchDefault )
209     
210     LSwitchaIsOdda = GraphLoopsStupidCoupledSwitchs.Link( OSwitcha , IIsOdda )
211     
212     LSwitchDefaultEndSwitchDefault = GraphLoopsStupidCoupledSwitchs.Link( OSwitchDefault , IEndSwitchDefault )
213     
214     LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphLoopsStupidCoupledSwitchs.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex )
215     
216     LIsOdd_1aEndSwitcha = GraphLoopsStupidCoupledSwitchs.Link( OIsOdd_1a , IEndSwitcha )
217     
218     LIsOdd_1GateEndSwitchDefault = GraphLoopsStupidCoupledSwitchs.Link( OIsOdd_1Gate , IEndSwitchDefault )
219     
220     LIsOdd_1GateEndOfSwitchDefault = GraphLoopsStupidCoupledSwitchs.Link( OIsOdd_1Gate , IEndOfSwitchDefault )
221     
222     LInitLoopIndexSwitch_1a = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopIndex , ISwitch_1a )
223     
224     LInitLoopMinEndOfInitLoopMin = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopMin , IEndOfInitLoopMin )
225     
226     LInitLoopMaxEndOfInitLoopMax = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopMax , IEndOfInitLoopMax )
227     
228     LInitLoopGateSwitchGate = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopGate , ISwitchGate )
229     
230     LInitLoopGateSwitch_1Gate = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopGate , ISwitch_1Gate )
231     
232     LInitLoopGateIsOdd_1Gate = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopGate , IIsOdd_1Gate )
233     
234     LInitLoopGateEndOfSwitchDefault = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopGate , IEndOfSwitchDefault )
235     
236     LSwitch_1EvenEndSwitchDefault = GraphLoopsStupidCoupledSwitchs.Link( OSwitch_1Even , IEndSwitchDefault )
237     
238     LSwitch_1aIsOdd_1a = GraphLoopsStupidCoupledSwitchs.Link( OSwitch_1a , IIsOdd_1a )
239     
240     LSwitch_1DefaultIsOddGate = GraphLoopsStupidCoupledSwitchs.Link( OSwitch_1Default , IIsOddGate )
241     
242     LSwitch_1DefaultEndOfSwitchDefault = GraphLoopsStupidCoupledSwitchs.Link( OSwitch_1Default , IEndOfSwitchDefault )
243     
244     LSwitch_1DefaultEndOfInitLoopSwitchGate = GraphLoopsStupidCoupledSwitchs.Link( OSwitch_1Default , IEndOfInitLoopSwitchGate )
245     
246     LSwitch_1DefaultEndOfInitLoopGate = GraphLoopsStupidCoupledSwitchs.Link( OSwitch_1Default , IEndOfInitLoopGate )
247     
248     LSwitch_1DefaultEndSwitchDefault = GraphLoopsStupidCoupledSwitchs.Link( OSwitch_1Default , IEndSwitchDefault )
249     
250     LEndSwitchaEndOfInitLoopIndex = GraphLoopsStupidCoupledSwitchs.Link( OEndSwitcha , IEndOfInitLoopIndex )
251     
252     # Input datas
253     IInitLoopSwitchIndex.Input( 0 )
254     IInitLoopSwitchMin.Input( 0 )
255     IInitLoopSwitchMax.Input( 20 )
256     IInitLoopIndex.Input( 0 )
257     IInitLoopMin.Input( 0 )
258     IInitLoopMax.Input( 20 )
259     
260     # Output Ports of the graph
261     #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
262     #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
263     #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
264     #OSwitchOdd = Switch.GetOutPort( 'Odd' )
265     #OSwitchEven = Switch.GetOutPort( 'Even' )
266     #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
267     #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
268     #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
269     #OSwitch_1Odd = Switch_1.GetOutPort( 'Odd' )
270     return GraphLoopsStupidCoupledSwitchs
271
272
273 GraphLoopsStupidCoupledSwitchs = DefGraphLoopsStupidCoupledSwitchs()