1 # Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 # Generated python file of Graph GraphEditSwitchs_5
26 # Graph creation of GraphEditSwitchs_5
27 def DefGraphEditSwitchs_5() :
28 GraphEditSwitchs_5 = Graph( 'GraphEditSwitchs_5' )
29 GraphEditSwitchs_5.SetName( 'GraphEditSwitchs_5' )
30 GraphEditSwitchs_5.SetAuthor( '' )
31 GraphEditSwitchs_5.SetComment( '' )
32 GraphEditSwitchs_5.Coords( 0 , 0 )
34 # Creation of Factory Nodes
36 # Creation of InLine Nodes
38 PyIsOdd.append( 'from time import * ' )
39 PyIsOdd.append( 'def IsOdd(a) : ' )
40 PyIsOdd.append( ' print a,"IsOdd (GraphSwitchs)" ' )
41 PyIsOdd.append( ' sleep( 1 ) ' )
42 PyIsOdd.append( ' return a ' )
43 IsOdd = GraphEditSwitchs_5.INode( 'IsOdd' , PyIsOdd )
44 IsOdd.SetName( 'IsOdd' )
46 IsOdd.SetComment( 'Python function' )
47 IsOdd.Coords( 393 , 67 )
48 IIsOdda = IsOdd.InPort( 'a' , 'long' )
49 IIsOddGate = IsOdd.GetInPort( 'Gate' )
50 OIsOdda = IsOdd.OutPort( 'a' , 'long' )
51 OIsOddGate = IsOdd.GetOutPort( 'Gate' )
54 PyIsEven.append( 'from time import * ' )
55 PyIsEven.append( 'def IsEven(a) : ' )
56 PyIsEven.append( ' print a,"IsEven" ' )
57 PyIsEven.append( ' sleep( 1 ) ' )
58 PyIsEven.append( ' return a ' )
59 IsEven = GraphEditSwitchs_5.INode( 'IsEven' , PyIsEven )
60 IsEven.SetName( 'IsEven' )
61 IsEven.SetAuthor( '' )
62 IsEven.SetComment( 'Python function' )
63 IsEven.Coords( 408 , 343 )
64 IIsEvena = IsEven.InPort( 'a' , 'long' )
65 IIsEvenGate = IsEven.GetInPort( 'Gate' )
66 OIsEvena = IsEven.OutPort( 'a' , 'long' )
67 OIsEvenGate = IsEven.GetOutPort( 'Gate' )
69 # Creation of Loop Nodes
71 PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' )
72 PyInitLoop.append( ' return Index,Min,Max ' )
74 PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' )
75 PyMoreInitLoop.append( ' if Index <= Max : ' )
76 PyMoreInitLoop.append( ' DoLoop = 1 ' )
77 PyMoreInitLoop.append( ' else : ' )
78 PyMoreInitLoop.append( ' DoLoop = 0 ' )
79 PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' )
81 PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' )
82 PyNextInitLoop.append( ' Index = Index + 1 ' )
83 PyNextInitLoop.append( ' return Index,Min,Max ' )
84 InitLoop,EndOfInitLoop = GraphEditSwitchs_5.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop )
85 EndOfInitLoop.SetName( 'EndOfInitLoop' )
86 EndOfInitLoop.SetAuthor( '' )
87 EndOfInitLoop.SetComment( 'Compute Node' )
88 EndOfInitLoop.Coords( 823 , 259 )
90 EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop )
91 IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' )
92 IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
93 IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
94 IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
95 IInitLoopGate = InitLoop.GetInPort( 'Gate' )
96 OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
97 OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
98 OInitLoopMin = InitLoop.GetOutPort( 'Min' )
99 OInitLoopMax = InitLoop.GetOutPort( 'Max' )
100 IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
101 IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
102 IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
103 IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
104 IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
105 OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
106 OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
107 OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
108 OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
109 OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' )
110 InitLoop.SetName( 'InitLoop' )
111 InitLoop.SetAuthor( '' )
112 InitLoop.SetComment( 'Compute Node' )
113 InitLoop.Coords( 10 , 248 )
115 # Creation of Switch Nodes
117 PySwitch.append( 'from time import * ' )
118 PySwitch.append( 'def Switch(a) : ' )
119 PySwitch.append( ' if ( a & 1 ) == 0 : ' )
120 PySwitch.append( ' sleep(1) ' )
121 PySwitch.append( ' return a & 1,1-(a&1),a ' )
122 Switch,EndOfSwitch = GraphEditSwitchs_5.SNode( 'Switch' , PySwitch )
123 EndOfSwitch.SetName( 'EndOfSwitch' )
124 EndOfSwitch.SetAuthor( '' )
125 EndOfSwitch.SetComment( 'Compute Node' )
126 EndOfSwitch.Coords( 584 , 172 )
128 EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch )
129 IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
130 IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
131 OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
132 OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
133 Switch.SetName( 'Switch' )
134 Switch.SetAuthor( '' )
135 Switch.SetComment( 'Compute Node' )
136 Switch.Coords( 199 , 132 )
137 ISwitcha = Switch.InPort( 'a' , 'long' )
138 ISwitchGate = Switch.GetInPort( 'Gate' )
139 OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
140 OSwitchEven = Switch.OutPort( 'Even' , 'int' )
141 OSwitcha = Switch.OutPort( 'a' , 'int' )
142 OSwitchDefault = Switch.GetOutPort( 'Default' )
145 PySwitch_1.append( 'from time import * ' )
146 PySwitch_1.append( 'def Switch(a) : ' )
147 PySwitch_1.append( ' if ( a & 1 ) == 0 : ' )
148 PySwitch_1.append( ' sleep(1) ' )
149 PySwitch_1.append( ' return a & 1,1-(a&1),a ' )
150 Switch_1,EndSwitch = GraphEditSwitchs_5.SNode( 'Switch' , PySwitch_1 )
151 EndSwitch.SetName( 'EndSwitch' )
152 EndSwitch.SetAuthor( '' )
153 EndSwitch.SetComment( 'Compute Node' )
154 EndSwitch.Coords( 608 , 430 )
156 EndSwitch.SetPyFunction( '' , PyEndSwitch )
157 IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
158 IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
159 OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
160 OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
161 Switch_1.SetName( 'Switch_1' )
162 Switch_1.SetAuthor( '' )
163 Switch_1.SetComment( 'Compute Node' )
164 Switch_1.Coords( 201 , 388 )
165 ISwitch_1a = Switch_1.InPort( 'a' , 'long' )
166 ISwitch_1Gate = Switch_1.GetInPort( 'Gate' )
167 OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' )
168 OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' )
169 OSwitch_1a = Switch_1.OutPort( 'a' , 'int' )
170 OSwitch_1Default = Switch_1.GetOutPort( 'Default' )
173 LIsOddaEndOfSwitcha = GraphEditSwitchs_5.Link( OIsOdda , IEndOfSwitcha )
175 LIsEvenaEndSwitcha = GraphEditSwitchs_5.Link( OIsEvena , IEndSwitcha )
177 LInitLoopIndexSwitch_1a = GraphEditSwitchs_5.Link( OInitLoopIndex , ISwitch_1a )
179 LInitLoopIndexSwitcha = GraphEditSwitchs_5.Link( OInitLoopIndex , ISwitcha )
181 LInitLoopMinEndOfInitLoopMin = GraphEditSwitchs_5.Link( OInitLoopMin , IEndOfInitLoopMin )
183 LInitLoopMaxEndOfInitLoopMax = GraphEditSwitchs_5.Link( OInitLoopMax , IEndOfInitLoopMax )
185 LSwitchOddIsOddGate = GraphEditSwitchs_5.Link( OSwitchOdd , IIsOddGate )
187 LSwitchaIsOdda = GraphEditSwitchs_5.Link( OSwitcha , IIsOdda )
189 LSwitchDefaultEndOfSwitchDefault = GraphEditSwitchs_5.Link( OSwitchDefault , IEndOfSwitchDefault )
191 LEndOfSwitchaEndOfInitLoopIndex = GraphEditSwitchs_5.Link( OEndOfSwitcha , IEndOfInitLoopIndex )
193 LSwitch_1EvenIsEvenGate = GraphEditSwitchs_5.Link( OSwitch_1Even , IIsEvenGate )
195 LSwitch_1aIsEvena = GraphEditSwitchs_5.Link( OSwitch_1a , IIsEvena )
197 LSwitch_1DefaultEndSwitchDefault = GraphEditSwitchs_5.Link( OSwitch_1Default , IEndSwitchDefault )
199 LEndSwitchGateEndOfInitLoopGate = GraphEditSwitchs_5.Link( OEndSwitchGate , IEndOfInitLoopGate )
202 IInitLoopIndex.Input( 0 )
203 IInitLoopMin.Input( 0 )
204 IInitLoopMax.Input( 20 )
206 # Output Ports of the graph
207 #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
208 #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
209 #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
210 #OSwitchEven = Switch.GetOutPort( 'Even' )
211 #OSwitch_1Odd = Switch_1.GetOutPort( 'Odd' )
212 #OEndSwitcha = EndSwitch.GetOutPort( 'a' )
213 return GraphEditSwitchs_5
216 GraphEditSwitchs_5 = DefGraphEditSwitchs_5()