Salome HOME
Imported using TkCVS
[samples/datafiles.git] / Superv / Python / GraphLoopSwitchGatesDefaultNOTValid.py
1
2 # Generated python file of Graph GraphLoopSwitchGatesDefaultNOTValid
3
4 from SuperV import *
5
6 # Graph creation of GraphLoopSwitchGatesDefaultNOTValid
7 def DefGraphLoopSwitchGatesDefaultNOTValid() :
8     GraphLoopSwitchGatesDefaultNOTValid = Graph( 'GraphLoopSwitchGatesDefaultNOTValid' )
9     GraphLoopSwitchGatesDefaultNOTValid.SetName( 'GraphLoopSwitchGatesDefaultNOTValid' )
10     GraphLoopSwitchGatesDefaultNOTValid.SetAuthor( 'JR' )
11     GraphLoopSwitchGatesDefaultNOTValid.SetComment( '' )
12     GraphLoopSwitchGatesDefaultNOTValid.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 (GraphLoopSwitch1)"        ' )
21     PyIsOdd.append( '    sleep( 1 )     ' )
22     PyIsOdd.append( '    return a       ' )
23     IsOdd = GraphLoopSwitchGatesDefaultNOTValid.INode( 'IsOdd' , PyIsOdd )
24     IsOdd.SetName( 'IsOdd' )
25     IsOdd.SetAuthor( '' )
26     IsOdd.SetComment( 'Python function' )
27     IsOdd.Coords( 397 , 1 )
28     IIsOdda = IsOdd.InPort( 'a' , 'long' )
29     IIsOddGate = IsOdd.GetInPort( 'Gate' )
30     OIsOdda = IsOdd.OutPort( 'a' , 'long' )
31     OIsOddGate = IsOdd.GetOutPort( 'Gate' )
32     
33     PyValEven = []
34     PyValEven.append( 'from time import * ' )
35     PyValEven.append( 'def ValEven(Even) : ' )
36     PyValEven.append( '    sleep(1) ' )
37     PyValEven.append( '    return Even   ' )
38     PyValEven.append( '' )
39     ValEven = GraphLoopSwitchGatesDefaultNOTValid.INode( 'ValEven' , PyValEven )
40     ValEven.SetName( 'ValEven' )
41     ValEven.SetAuthor( '' )
42     ValEven.SetComment( 'Compute Node' )
43     ValEven.Coords( 396 , 222 )
44     IValEvenEven = ValEven.InPort( 'Even' , 'long' )
45     IValEvenGate = ValEven.GetInPort( 'Gate' )
46     OValEvenEven = ValEven.OutPort( 'Even' , 'long' )
47     OValEvenGate = ValEven.GetOutPort( 'Gate' )
48     
49     # Creation of Loop Nodes
50     PyInitLoop = []
51     PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' )
52     PyInitLoop.append( '        Index = Min ' )
53     PyInitLoop.append( '        return Index,Min,Max ' )
54     PyInitLoop.append( '' )
55     PyMoreInitLoop = []
56     PyMoreInitLoop.append( '' )
57     PyNextInitLoop = []
58     PyNextInitLoop.append( '' )
59     InitLoop,EndOfInitLoop = GraphLoopSwitchGatesDefaultNOTValid.LNode( 'InitLoop' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop )
60     EndOfInitLoop.SetName( 'EndOfInitLoop' )
61     EndOfInitLoop.SetAuthor( '' )
62     EndOfInitLoop.SetComment( 'Compute Node' )
63     EndOfInitLoop.Coords( 767 , 102 )
64     PyEndOfInitLoop = []
65     PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' )
66     PyEndOfInitLoop.append( '   Index = Index + 1     ' )
67     PyEndOfInitLoop.append( '   if Index <= Max :   ' )
68     PyEndOfInitLoop.append( '           DoLoop = 1     ' )
69     PyEndOfInitLoop.append( '   else :     ' )
70     PyEndOfInitLoop.append( '           DoLoop = 0     ' )
71     PyEndOfInitLoop.append( '   return DoLoop,Index,Min,Max     ' )
72     EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
73     IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' )
74     IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
75     IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
76     IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
77     IInitLoopGate = InitLoop.GetInPort( 'Gate' )
78     OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
79     OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
80     OInitLoopMin = InitLoop.GetOutPort( 'Min' )
81     OInitLoopMax = InitLoop.GetOutPort( 'Max' )
82     IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
83     IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
84     IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
85     IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
86     IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
87     OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
88     OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
89     OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
90     OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
91     OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' )
92     InitLoop.SetName( 'InitLoop' )
93     InitLoop.SetAuthor( '' )
94     InitLoop.SetComment( 'Compute Node' )
95     InitLoop.Coords( 10 , 108 )
96     
97     # Creation of Switch Nodes
98     PySwitch = []
99     PySwitch.append( 'from time import *  ' )
100     PySwitch.append( 'def Switch(a) :    ' )
101     PySwitch.append( '    if ( a & 1 ) == 0 :  ' )
102     PySwitch.append( '        sleep(1)  ' )
103     PySwitch.append( '    return a & 1,1-(a&1),a    ' )
104     Switch,EndSwitch = GraphLoopSwitchGatesDefaultNOTValid.SNode( 'Switch' , PySwitch )
105     EndSwitch.SetName( 'EndSwitch' )
106     EndSwitch.SetAuthor( '' )
107     EndSwitch.SetComment( 'Compute Node' )
108     EndSwitch.Coords( 587 , 103 )
109     PyEndSwitch = []
110     PyEndSwitch.append( 'def EndSwitch(a,Even) : ' )
111     PyEndSwitch.append( '    sleep(1)     ' )
112     PyEndSwitch.append( '    return a       ' )
113     EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch )
114     IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
115     IEndSwitchEven = EndSwitch.InPort( 'Even' , 'long' )
116     IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
117     OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
118     OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
119     Switch.SetName( 'Switch' )
120     Switch.SetAuthor( '' )
121     Switch.SetComment( 'Compute Node' )
122     Switch.Coords( 194 , 109 )
123     ISwitcha = Switch.InPort( 'a' , 'long' )
124     ISwitchGate = Switch.GetInPort( 'Gate' )
125     OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
126     OSwitchEven = Switch.OutPort( 'Even' , 'int' )
127     OSwitcha = Switch.OutPort( 'a' , 'int' )
128     OSwitchDefault = Switch.GetOutPort( 'Default' )
129     
130     # Creation of Links
131     LIsOddaEndSwitcha = GraphLoopSwitchGatesDefaultNOTValid.Link( OIsOdda , IEndSwitcha )
132     
133     LIsOddGateEndSwitchDefault = GraphLoopSwitchGatesDefaultNOTValid.Link( OIsOddGate , IEndSwitchDefault )
134     
135     LInitLoopIndexSwitcha = GraphLoopSwitchGatesDefaultNOTValid.Link( OInitLoopIndex , ISwitcha )
136     
137     LInitLoopMinEndOfInitLoopMin = GraphLoopSwitchGatesDefaultNOTValid.Link( OInitLoopMin , IEndOfInitLoopMin )
138     
139     LInitLoopMaxEndOfInitLoopMax = GraphLoopSwitchGatesDefaultNOTValid.Link( OInitLoopMax , IEndOfInitLoopMax )
140     
141     LSwitchOddIsOddGate = GraphLoopSwitchGatesDefaultNOTValid.Link( OSwitchOdd , IIsOddGate )
142     
143     LSwitchEvenValEvenEven = GraphLoopSwitchGatesDefaultNOTValid.Link( OSwitchEven , IValEvenEven )
144     
145     LSwitchaIsOdda = GraphLoopSwitchGatesDefaultNOTValid.Link( OSwitcha , IIsOdda )
146     
147     LSwitchDefaultEndSwitchDefault = GraphLoopSwitchGatesDefaultNOTValid.Link( OSwitchDefault , IEndSwitchDefault )
148     
149     LEndSwitchaEndOfInitLoopIndex = GraphLoopSwitchGatesDefaultNOTValid.Link( OEndSwitcha , IEndOfInitLoopIndex )
150     
151     LValEvenEvenEndSwitchEven = GraphLoopSwitchGatesDefaultNOTValid.Link( OValEvenEven , IEndSwitchEven )
152     
153     LValEvenGateEndSwitchDefault = GraphLoopSwitchGatesDefaultNOTValid.Link( OValEvenGate , IEndSwitchDefault )
154     
155     # Input datas
156     IInitLoopIndex.Input( 0 )
157     IInitLoopMin.Input( 5 )
158     IInitLoopMax.Input( 23 )
159     
160     # Output Ports of the graph
161     #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
162     #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
163     #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
164     return GraphLoopSwitchGatesDefaultNOTValid
165
166
167 GraphLoopSwitchGatesDefaultNOTValid = DefGraphLoopSwitchGatesDefaultNOTValid()