Salome HOME
Imported using TkCVS
[samples/datafiles.git] / Superv / Python / GraphSwitchCheckDefault1NOTValid.py
1
2 # Generated python file of Graph GraphSwitchCheckDefault11NOTValid
3
4 from SuperV import *
5
6 # Graph creation of GraphSwitchCheckDefault11NOTValid
7 def DefGraphSwitchCheckDefault11NOTValid() :
8     GraphSwitchCheckDefault11NOTValid = Graph( 'GraphSwitchCheckDefault11NOTValid' )
9     GraphSwitchCheckDefault11NOTValid.SetName( 'GraphSwitchCheckDefault11NOTValid' )
10     GraphSwitchCheckDefault11NOTValid.SetAuthor( 'JR' )
11     GraphSwitchCheckDefault11NOTValid.SetComment( '' )
12     GraphSwitchCheckDefault11NOTValid.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 (GraphSwitch)"      ' )
21     PyIsOdd.append( '    sleep( 1 )   ' )
22     PyIsOdd.append( '    return a     ' )
23     IsOdd = GraphSwitchCheckDefault11NOTValid.INode( 'IsOdd' , PyIsOdd )
24     IsOdd.SetName( 'IsOdd' )
25     IsOdd.SetAuthor( '' )
26     IsOdd.SetComment( 'Python function' )
27     IsOdd.Coords( 415 , 7 )
28     IIsOdda = IsOdd.InPort( 'a' , 'long' )
29     IIsOddGate = IsOdd.GetInPort( 'Gate' )
30     OIsOdda = IsOdd.OutPort( 'a' , 'long' )
31     OIsOddGate = IsOdd.GetOutPort( 'Gate' )
32     
33     PyIsEven = []
34     PyIsEven.append( 'from time import *    ' )
35     PyIsEven.append( 'def IsEven(a) :        ' )
36     PyIsEven.append( '    print a,"IsEven (GraphSwitch)"       ' )
37     PyIsEven.append( '    sleep( 1 )    ' )
38     PyIsEven.append( '    return a      ' )
39     IsEven = GraphSwitchCheckDefault11NOTValid.INode( 'IsEven' , PyIsEven )
40     IsEven.SetName( 'IsEven' )
41     IsEven.SetAuthor( '' )
42     IsEven.SetComment( 'Compute Node' )
43     IsEven.Coords( 421 , 438 )
44     IIsEvena = IsEven.InPort( 'a' , 'long' )
45     IIsEvenGate = IsEven.GetInPort( 'Gate' )
46     OIsEvena = IsEven.OutPort( 'a' , 'long' )
47     OIsEvenGate = IsEven.GetOutPort( 'Gate' )
48     
49     PyPrintOdd = []
50     PyPrintOdd.append( 'from time import * ' )
51     PyPrintOdd.append( 'def Print(a,Branch) :     ' )
52     PyPrintOdd.append( '    print "Print ",a,Branch ' )
53     PyPrintOdd.append( '    sleep(1) ' )
54     PyPrintOdd.append( '    return Branch     ' )
55     PrintOdd = GraphSwitchCheckDefault11NOTValid.INode( 'Print' , PyPrintOdd )
56     PrintOdd.SetName( 'PrintOdd' )
57     PrintOdd.SetAuthor( '' )
58     PrintOdd.SetComment( 'Compute Node' )
59     PrintOdd.Coords( 415 , 130 )
60     IPrintOdda = PrintOdd.InPort( 'a' , 'long' )
61     IPrintOddBranch = PrintOdd.InPort( 'Branch' , 'string' )
62     IPrintOddGate = PrintOdd.GetInPort( 'Gate' )
63     OPrintOddBranch = PrintOdd.OutPort( 'Branch' , 'string' )
64     OPrintOddGate = PrintOdd.GetOutPort( 'Gate' )
65     
66     PyPrintEven = []
67     PyPrintEven.append( 'from time import * ' )
68     PyPrintEven.append( 'def Print_1(a,Branch) :     ' )
69     PyPrintEven.append( '    print "Print ",a,Branch ' )
70     PyPrintEven.append( '    sleep(1) ' )
71     PyPrintEven.append( '    return Branch     ' )
72     PrintEven = GraphSwitchCheckDefault11NOTValid.INode( 'Print_1' , PyPrintEven )
73     PrintEven.SetName( 'PrintEven' )
74     PrintEven.SetAuthor( '' )
75     PrintEven.SetComment( 'Compute Node' )
76     PrintEven.Coords( 423 , 289 )
77     IPrintEvena = PrintEven.InPort( 'a' , 'long' )
78     IPrintEvenBranch = PrintEven.InPort( 'Branch' , 'string' )
79     IPrintEvenGate = PrintEven.GetInPort( 'Gate' )
80     OPrintEvenBranch = PrintEven.OutPort( 'Branch' , 'string' )
81     OPrintEvenGate = PrintEven.GetOutPort( 'Gate' )
82     
83     PyEmptyNode = []
84     PyEmptyNode.append( 'from time import * ' )
85     PyEmptyNode.append( 'def EmptyNode(a,Branch) : ' )
86     PyEmptyNode.append( '    sleep(1) ' )
87     PyEmptyNode.append( '    return a,Branch  ' )
88     EmptyNode = GraphSwitchCheckDefault11NOTValid.INode( 'EmptyNode' , PyEmptyNode )
89     EmptyNode.SetName( 'EmptyNode' )
90     EmptyNode.SetAuthor( '' )
91     EmptyNode.SetComment( 'Compute Node' )
92     EmptyNode.Coords( 652 , 110 )
93     IEmptyNodea = EmptyNode.InPort( 'a' , 'long' )
94     IEmptyNodeBranch = EmptyNode.InPort( 'Branch' , 'string' )
95     IEmptyNodeGate = EmptyNode.GetInPort( 'Gate' )
96     OEmptyNodea = EmptyNode.OutPort( 'a' , 'long' )
97     OEmptyNodeBranch = EmptyNode.OutPort( 'Branch' , 'string' )
98     OEmptyNodeGate = EmptyNode.GetOutPort( 'Gate' )
99     
100     PyDefault = []
101     PyDefault.append( 'from time import * ' )
102     PyDefault.append( 'def Default(a,Branch) : ' )
103     PyDefault.append( '    sleep(1) ' )
104     PyDefault.append( '    return a,Branch ' )
105     Default = GraphSwitchCheckDefault11NOTValid.INode( 'Default' , PyDefault )
106     Default.SetName( 'Default' )
107     Default.SetAuthor( '' )
108     Default.SetComment( 'Compute Node' )
109     Default.Coords( 421 , 592 )
110     IDefaulta = Default.InPort( 'a' , 'long' )
111     IDefaultBranch = Default.InPort( 'Branch' , 'string' )
112     IDefaultGate = Default.GetInPort( 'Gate' )
113     ODefaulta = Default.OutPort( 'a' , 'long' )
114     ODefaultBranch = Default.OutPort( 'Branch' , 'string' )
115     ODefaultGate = Default.GetOutPort( 'Gate' )
116     
117     # Creation of Loop Nodes
118     PyInitLoopSwitch = []
119     PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) :        ' )
120     PyInitLoopSwitch.append( '  Index = Max  ' )
121     PyInitLoopSwitch.append( '  return Index,Min,Max       ' )
122     PyMoreInitLoopSwitch = []
123     PyMoreInitLoopSwitch.append( 'from time import * ' )
124     PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' )
125     PyMoreInitLoopSwitch.append( '      sleep(1)  ' )
126     PyMoreInitLoopSwitch.append( '      if Index >= Min :     ' )
127     PyMoreInitLoopSwitch.append( '              DoLoop = 1       ' )
128     PyMoreInitLoopSwitch.append( '      else :       ' )
129     PyMoreInitLoopSwitch.append( '              DoLoop = 0       ' )
130     PyMoreInitLoopSwitch.append( '      return DoLoop,Index,Min,Max       ' )
131     PyNextInitLoopSwitch = []
132     PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) :       ' )
133     PyNextInitLoopSwitch.append( '      Index = Index - 1       ' )
134     PyNextInitLoopSwitch.append( '      return Index,Min,Max       ' )
135     InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckDefault11NOTValid.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch )
136     EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' )
137     EndOfInitLoopSwitch.SetAuthor( '' )
138     EndOfInitLoopSwitch.SetComment( 'Compute Node' )
139     EndOfInitLoopSwitch.Coords( 1074 , 194 )
140     PyEndOfInitLoopSwitch = []
141     PyEndOfInitLoopSwitch.append( 'from time import *  ' )
142     PyEndOfInitLoopSwitch.append( 'def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) :  ' )
143     PyEndOfInitLoopSwitch.append( '    sleep(1)  ' )
144     PyEndOfInitLoopSwitch.append( '    return DoLoop,Index,Min,Max  ' )
145     EndOfInitLoopSwitch.SetPyFunction( 'EndOfInitLoopSwitch' , PyEndOfInitLoopSwitch )
146     IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' )
147     IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' )
148     IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' )
149     IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' )
150     IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' )
151     OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' )
152     OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' )
153     OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' )
154     OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' )
155     IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' )
156     IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' )
157     IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' )
158     IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' )
159     IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' )
160     OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' )
161     OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
162     OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
163     OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
164     OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' )
165     InitLoopSwitch.SetName( 'InitLoopSwitch' )
166     InitLoopSwitch.SetAuthor( '' )
167     InitLoopSwitch.SetComment( 'Compute Node' )
168     InitLoopSwitch.Coords( 10 , 129 )
169     
170     # Creation of Switch Nodes
171     PySwitch = []
172     PySwitch.append( 'from time import *        ' )
173     PySwitch.append( 'def Switch(a) : ' )
174     PySwitch.append( '    sleep(1) ' )
175     PySwitch.append( '    Branch = "Negative or null"    ' )
176     PySwitch.append( '    if a <= 0 :       ' )
177     PySwitch.append( '        return 0,0,a,Branch,1  ' )
178     PySwitch.append( '    if ( a & 1 ) == 0 :    ' )
179     PySwitch.append( '        Branch = "Even"    ' )
180     PySwitch.append( '    else :    ' )
181     PySwitch.append( '        Branch = "Odd"    ' )
182     PySwitch.append( '    return a & 1,1-(a&1),a,Branch,0  ' )
183     Switch,EndOfSwitch = GraphSwitchCheckDefault11NOTValid.SNode( 'Switch' , PySwitch )
184     EndOfSwitch.SetName( 'EndOfSwitch' )
185     EndOfSwitch.SetAuthor( '' )
186     EndOfSwitch.SetComment( 'Compute Node' )
187     EndOfSwitch.Coords( 882 , 194 )
188     PyEndOfSwitch = []
189     PyEndOfSwitch.append( 'from time import * ' )
190     PyEndOfSwitch.append( 'def EndOfSwitch(a,Branch) : ' )
191     PyEndOfSwitch.append( '    sleep(1) ' )
192     PyEndOfSwitch.append( '    return a ' )
193     EndOfSwitch.SetPyFunction( 'EndOfSwitch' , PyEndOfSwitch )
194     IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
195     IEndOfSwitchBranch = EndOfSwitch.InPort( 'Branch' , 'string' )
196     IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
197     OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
198     OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
199     Switch.SetName( 'Switch' )
200     Switch.SetAuthor( '' )
201     Switch.SetComment( 'Compute Node' )
202     Switch.Coords( 190 , 129 )
203     ISwitcha = Switch.InPort( 'a' , 'long' )
204     ISwitchGate = Switch.GetInPort( 'Gate' )
205     OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
206     OSwitchEven = Switch.OutPort( 'Even' , 'int' )
207     OSwitcha = Switch.OutPort( 'a' , 'int' )
208     OSwitchBranch = Switch.OutPort( 'Branch' , 'string' )
209     OSwitchdefault = Switch.OutPort( 'default' , 'boolean' )
210     OSwitchDefault = Switch.GetOutPort( 'Default' )
211     
212     # Creation of Links
213     LIsOddaEmptyNodea = GraphSwitchCheckDefault11NOTValid.Link( OIsOdda , IEmptyNodea )
214     LIsOddaEmptyNodea.AddCoord( 1 , 646 , 78 )
215     
216     LIsEvenaEndOfSwitcha = GraphSwitchCheckDefault11NOTValid.Link( OIsEvena , IEndOfSwitcha )
217     
218     LPrintOddBranchEmptyNodeBranch = GraphSwitchCheckDefault11NOTValid.Link( OPrintOddBranch , IEmptyNodeBranch )
219     
220     LPrintEvenBranchEndOfSwitchBranch = GraphSwitchCheckDefault11NOTValid.Link( OPrintEvenBranch , IEndOfSwitchBranch )
221     
222     LEmptyNodeaEndOfSwitcha = GraphSwitchCheckDefault11NOTValid.Link( OEmptyNodea , IEndOfSwitcha )
223     
224     LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckDefault11NOTValid.Link( OEmptyNodeBranch , IEndOfSwitchBranch )
225     
226     LDefaultBranchEndOfSwitchBranch = GraphSwitchCheckDefault11NOTValid.Link( ODefaultBranch , IEndOfSwitchBranch )
227     
228     LInitLoopSwitchIndexSwitcha = GraphSwitchCheckDefault11NOTValid.Link( OInitLoopSwitchIndex , ISwitcha )
229     
230     LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckDefault11NOTValid.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin )
231     
232     LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckDefault11NOTValid.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax )
233     
234     LSwitchOddIsOddGate = GraphSwitchCheckDefault11NOTValid.Link( OSwitchOdd , IIsOddGate )
235     LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 )
236     LSwitchOddIsOddGate.AddCoord( 2 , 401 , 160 )
237     
238     LSwitchOddPrintOddGate = GraphSwitchCheckDefault11NOTValid.Link( OSwitchOdd , IPrintOddGate )
239     LSwitchOddPrintOddGate.AddCoord( 1 , 401 , 245 )
240     LSwitchOddPrintOddGate.AddCoord( 2 , 401 , 159 )
241     
242     LSwitchEvenIsEvenGate = GraphSwitchCheckDefault11NOTValid.Link( OSwitchEven , IIsEvenGate )
243     LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 )
244     LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 182 )
245     
246     LSwitchEvenPrintEvenGate = GraphSwitchCheckDefault11NOTValid.Link( OSwitchEven , IPrintEvenGate )
247     LSwitchEvenPrintEvenGate.AddCoord( 1 , 392 , 403 )
248     LSwitchEvenPrintEvenGate.AddCoord( 2 , 392 , 181 )
249     
250     LSwitchaIsOdda = GraphSwitchCheckDefault11NOTValid.Link( OSwitcha , IIsOdda )
251     LSwitchaIsOdda.AddCoord( 1 , 382 , 78 )
252     LSwitchaIsOdda.AddCoord( 2 , 382 , 199 )
253     
254     LSwitchaIsEvena = GraphSwitchCheckDefault11NOTValid.Link( OSwitcha , IIsEvena )
255     LSwitchaIsEvena.AddCoord( 1 , 381 , 509 )
256     LSwitchaIsEvena.AddCoord( 2 , 382 , 200 )
257     
258     LSwitchaPrintOdda = GraphSwitchCheckDefault11NOTValid.Link( OSwitcha , IPrintOdda )
259     
260     LSwitchaPrintEvena = GraphSwitchCheckDefault11NOTValid.Link( OSwitcha , IPrintEvena )
261     LSwitchaPrintEvena.AddCoord( 1 , 381 , 361 )
262     LSwitchaPrintEvena.AddCoord( 2 , 382 , 200 )
263     
264     LSwitchaDefaulta = GraphSwitchCheckDefault11NOTValid.Link( OSwitcha , IDefaulta )
265     LSwitchaDefaulta.AddCoord( 1 , 382 , 663 )
266     LSwitchaDefaulta.AddCoord( 2 , 382 , 199 )
267     
268     LSwitchBranchPrintOddBranch = GraphSwitchCheckDefault11NOTValid.Link( OSwitchBranch , IPrintOddBranch )
269     
270     LSwitchBranchPrintEvenBranch = GraphSwitchCheckDefault11NOTValid.Link( OSwitchBranch , IPrintEvenBranch )
271     LSwitchBranchPrintEvenBranch.AddCoord( 1 , 369 , 381 )
272     LSwitchBranchPrintEvenBranch.AddCoord( 2 , 369 , 219 )
273     
274     LSwitchBranchDefaultBranch = GraphSwitchCheckDefault11NOTValid.Link( OSwitchBranch , IDefaultBranch )
275     LSwitchBranchDefaultBranch.AddCoord( 1 , 370 , 683 )
276     LSwitchBranchDefaultBranch.AddCoord( 2 , 370 , 220 )
277     
278     LSwitchdefaultDefaultGate = GraphSwitchCheckDefault11NOTValid.Link( OSwitchdefault , IDefaultGate )
279     LSwitchdefaultDefaultGate.AddCoord( 1 , 363 , 707 )
280     LSwitchdefaultDefaultGate.AddCoord( 2 , 362 , 239 )
281     
282     LSwitchDefaultEndOfSwitchDefault = GraphSwitchCheckDefault11NOTValid.Link( OSwitchDefault , IEndOfSwitchDefault )
283     
284     LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckDefault11NOTValid.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex )
285     
286     # Input datas
287     IInitLoopSwitchIndex.Input( 0 )
288     IInitLoopSwitchMin.Input( -5 )
289     IInitLoopSwitchMax.Input( 10 )
290     
291     # Output Ports of the graph
292     #ODefaulta = Default.GetOutPort( 'a' )
293     #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
294     #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
295     #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
296     return GraphSwitchCheckDefault11NOTValid
297
298
299 GraphSwitchCheckDefault11NOTValid = DefGraphSwitchCheckDefault11NOTValid()