Salome HOME
Imported using TkCVS
[samples/datafiles.git] / Superv / Python / GraphSwitchNOTExecutable1.py
1
2 # Generated python file of Graph GraphSwitchNOTExecutable1
3
4 from SuperV import *
5
6 # Graph creation of GraphSwitchNOTExecutable1
7 def DefGraphSwitchNOTExecutable1() :
8     GraphSwitchNOTExecutable1 = Graph( 'GraphSwitchNOTExecutable1' )
9     GraphSwitchNOTExecutable1.SetName( 'GraphSwitchNOTExecutable1' )
10     GraphSwitchNOTExecutable1.SetAuthor( '' )
11     GraphSwitchNOTExecutable1.SetComment( '' )
12     GraphSwitchNOTExecutable1.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 = GraphSwitchNOTExecutable1.INode( 'IsOdd' , PyIsOdd )
24     IsOdd.SetName( 'IsOdd' )
25     IsOdd.SetAuthor( '' )
26     IsOdd.SetComment( 'Python function' )
27     IsOdd.Coords( 389 , 65 )
28     IIsOdda = IsOdd.InPort( 'a' , 'long' )
29     IIsOddGate = IsOdd.GetInPort( 'Gate' )
30     OIsOdda = IsOdd.OutPort( 'a' , 'long' )
31     OIsOddGate = IsOdd.GetOutPort( 'Gate' )
32     
33     # Creation of Loop Nodes
34     PyInitLoopSwitch = []
35     PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) :      ' )
36     PyInitLoopSwitch.append( '  return Index,Min,Max     ' )
37     PyMoreInitLoopSwitch = []
38     PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) :     ' )
39     PyMoreInitLoopSwitch.append( '      if Index <= Max :   ' )
40     PyMoreInitLoopSwitch.append( '              DoLoop = 1     ' )
41     PyMoreInitLoopSwitch.append( '      else :     ' )
42     PyMoreInitLoopSwitch.append( '              DoLoop = 0     ' )
43     PyMoreInitLoopSwitch.append( '      return DoLoop,Index,Min,Max     ' )
44     PyNextInitLoopSwitch = []
45     PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) :     ' )
46     PyNextInitLoopSwitch.append( '      Index = Index + 1     ' )
47     PyNextInitLoopSwitch.append( '      return Index,Min,Max     ' )
48     InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchNOTExecutable1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch )
49     EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' )
50     EndOfInitLoopSwitch.SetAuthor( '' )
51     EndOfInitLoopSwitch.SetComment( 'Compute Node' )
52     EndOfInitLoopSwitch.Coords( 776 , 170 )
53     PyEndOfInitLoopSwitch = []
54     EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch )
55     IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' )
56     IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' )
57     IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' )
58     IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' )
59     IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' )
60     OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' )
61     OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' )
62     OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' )
63     OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' )
64     IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' )
65     IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' )
66     IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' )
67     IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' )
68     IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' )
69     OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' )
70     OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
71     OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
72     OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
73     OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' )
74     InitLoopSwitch.SetName( 'InitLoopSwitch' )
75     InitLoopSwitch.SetAuthor( '' )
76     InitLoopSwitch.SetComment( 'Compute Node' )
77     InitLoopSwitch.Coords( 10 , 129 )
78     
79     # Creation of Switch Nodes
80     PySwitch = []
81     PySwitch.append( 'from time import * ' )
82     PySwitch.append( 'def Switch(a) :   ' )
83     PySwitch.append( '    if ( a & 1 ) == 0 : ' )
84     PySwitch.append( '        sleep(1)    ' )
85     PySwitch.append( '    return a & 1,1-(a&1),a    ' )
86     Switch,EndOfSwitch = GraphSwitchNOTExecutable1.SNode( 'Switch' , PySwitch )
87     EndOfSwitch.SetName( 'EndOfSwitch' )
88     EndOfSwitch.SetAuthor( '' )
89     EndOfSwitch.SetComment( 'Compute Node' )
90     EndOfSwitch.Coords( 582 , 170 )
91     PyEndOfSwitch = []
92     EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch )
93     IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
94     IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
95     OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
96     OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
97     Switch.SetName( 'Switch' )
98     Switch.SetAuthor( '' )
99     Switch.SetComment( 'Compute Node' )
100     Switch.Coords( 194 , 129 )
101     ISwitcha = Switch.InPort( 'a' , 'long' )
102     ISwitchGate = Switch.GetInPort( 'Gate' )
103     OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
104     OSwitchEven = Switch.OutPort( 'Even' , 'int' )
105     OSwitchn = Switch.OutPort( 'n' , 'int' )
106     OSwitchDefault = Switch.GetOutPort( 'Default' )
107     
108     # Creation of Links
109     LIsOddaEndOfSwitcha = GraphSwitchNOTExecutable1.Link( OIsOdda , IEndOfSwitcha )
110     LIsOddaEndOfSwitcha.AddCoord( 1 , 564 , 201 )
111     LIsOddaEndOfSwitcha.AddCoord( 2 , 564 , 137 )
112     
113     LInitLoopSwitchIndexSwitcha = GraphSwitchNOTExecutable1.Link( OInitLoopSwitchIndex , ISwitcha )
114     
115     LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchNOTExecutable1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin )
116     
117     LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchNOTExecutable1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax )
118     
119     LSwitchOddIsOddGate = GraphSwitchNOTExecutable1.Link( OSwitchOdd , IIsOddGate )
120     
121     LSwitchnIsOdda = GraphSwitchNOTExecutable1.Link( OSwitchn , IIsOdda )
122     LSwitchnIsOdda.AddCoord( 1 , 371 , 136 )
123     LSwitchnIsOdda.AddCoord( 2 , 371 , 200 )
124     
125     LSwitchnEndOfSwitcha = GraphSwitchNOTExecutable1.Link( OSwitchn , IEndOfSwitcha )
126     
127     LSwitchDefaultEndOfSwitchDefault = GraphSwitchNOTExecutable1.Link( OSwitchDefault , IEndOfSwitchDefault )
128     
129     LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchNOTExecutable1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex )
130     
131     # Input datas
132     IInitLoopSwitchIndex.Input( 0 )
133     IInitLoopSwitchMin.Input( 0 )
134     IInitLoopSwitchMax.Input( 100 )
135     
136     # Output Ports of the graph
137     #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
138     #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
139     #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
140     #OSwitchEven = Switch.GetOutPort( 'Even' )
141     return GraphSwitchNOTExecutable1
142
143
144 GraphSwitchNOTExecutable1 = DefGraphSwitchNOTExecutable1()