1 # Copyright (C) 2007-2015 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, or (at your option) any later version.
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
23 # Generated python file of Graph GraphEditSwitchs_5
27 # Graph creation of GraphEditSwitchs_5
28 def DefGraphEditSwitchs_5() :
29 GraphEditSwitchs_5 = Graph( 'GraphEditSwitchs_5' )
30 GraphEditSwitchs_5.SetName( 'GraphEditSwitchs_5' )
31 GraphEditSwitchs_5.SetAuthor( '' )
32 GraphEditSwitchs_5.SetComment( '' )
33 GraphEditSwitchs_5.Coords( 0 , 0 )
35 # Creation of Factory Nodes
37 # Creation of InLine Nodes
39 PyIsOdd.append( 'from time import * ' )
40 PyIsOdd.append( 'def IsOdd(a) : ' )
41 PyIsOdd.append( ' print a,"IsOdd (GraphSwitchs)" ' )
42 PyIsOdd.append( ' sleep( 1 ) ' )
43 PyIsOdd.append( ' return a ' )
44 IsOdd = GraphEditSwitchs_5.INode( 'IsOdd' , PyIsOdd )
45 IsOdd.SetName( 'IsOdd' )
47 IsOdd.SetComment( 'Python function' )
48 IsOdd.Coords( 393 , 67 )
49 IIsOdda = IsOdd.InPort( 'a' , 'long' )
50 IIsOddGate = IsOdd.GetInPort( 'Gate' )
51 OIsOdda = IsOdd.OutPort( 'a' , 'long' )
52 OIsOddGate = IsOdd.GetOutPort( 'Gate' )
55 PyIsEven.append( 'from time import * ' )
56 PyIsEven.append( 'def IsEven(a) : ' )
57 PyIsEven.append( ' print a,"IsEven" ' )
58 PyIsEven.append( ' sleep( 1 ) ' )
59 PyIsEven.append( ' return a ' )
60 IsEven = GraphEditSwitchs_5.INode( 'IsEven' , PyIsEven )
61 IsEven.SetName( 'IsEven' )
62 IsEven.SetAuthor( '' )
63 IsEven.SetComment( 'Python function' )
64 IsEven.Coords( 408 , 343 )
65 IIsEvena = IsEven.InPort( 'a' , 'long' )
66 IIsEvenGate = IsEven.GetInPort( 'Gate' )
67 OIsEvena = IsEven.OutPort( 'a' , 'long' )
68 OIsEvenGate = IsEven.GetOutPort( 'Gate' )
70 # Creation of Loop Nodes
72 PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' )
73 PyInitLoop.append( ' return Index,Min,Max ' )
75 PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' )
76 PyMoreInitLoop.append( ' if Index <= Max : ' )
77 PyMoreInitLoop.append( ' DoLoop = 1 ' )
78 PyMoreInitLoop.append( ' else : ' )
79 PyMoreInitLoop.append( ' DoLoop = 0 ' )
80 PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' )
82 PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' )
83 PyNextInitLoop.append( ' Index = Index + 1 ' )
84 PyNextInitLoop.append( ' return Index,Min,Max ' )
85 InitLoop,EndOfInitLoop = GraphEditSwitchs_5.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop )
86 EndOfInitLoop.SetName( 'EndOfInitLoop' )
87 EndOfInitLoop.SetAuthor( '' )
88 EndOfInitLoop.SetComment( 'Compute Node' )
89 EndOfInitLoop.Coords( 823 , 259 )
91 EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop )
92 IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' )
93 IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
94 IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
95 IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
96 IInitLoopGate = InitLoop.GetInPort( 'Gate' )
97 OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
98 OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
99 OInitLoopMin = InitLoop.GetOutPort( 'Min' )
100 OInitLoopMax = InitLoop.GetOutPort( 'Max' )
101 IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
102 IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
103 IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
104 IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
105 IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
106 OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
107 OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
108 OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
109 OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
110 OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' )
111 InitLoop.SetName( 'InitLoop' )
112 InitLoop.SetAuthor( '' )
113 InitLoop.SetComment( 'Compute Node' )
114 InitLoop.Coords( 10 , 248 )
116 # Creation of Switch Nodes
118 PySwitch.append( 'from time import * ' )
119 PySwitch.append( 'def Switch(a) : ' )
120 PySwitch.append( ' if ( a & 1 ) == 0 : ' )
121 PySwitch.append( ' sleep(1) ' )
122 PySwitch.append( ' return a & 1,1-(a&1),a ' )
123 Switch,EndOfSwitch = GraphEditSwitchs_5.SNode( 'Switch' , PySwitch )
124 EndOfSwitch.SetName( 'EndOfSwitch' )
125 EndOfSwitch.SetAuthor( '' )
126 EndOfSwitch.SetComment( 'Compute Node' )
127 EndOfSwitch.Coords( 584 , 172 )
129 EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch )
130 IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
131 IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
132 OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
133 OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
134 Switch.SetName( 'Switch' )
135 Switch.SetAuthor( '' )
136 Switch.SetComment( 'Compute Node' )
137 Switch.Coords( 199 , 132 )
138 ISwitcha = Switch.InPort( 'a' , 'long' )
139 ISwitchGate = Switch.GetInPort( 'Gate' )
140 OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
141 OSwitchEven = Switch.OutPort( 'Even' , 'int' )
142 OSwitcha = Switch.OutPort( 'a' , 'int' )
143 OSwitchDefault = Switch.GetOutPort( 'Default' )
146 PySwitch_1.append( 'from time import * ' )
147 PySwitch_1.append( 'def Switch(a) : ' )
148 PySwitch_1.append( ' if ( a & 1 ) == 0 : ' )
149 PySwitch_1.append( ' sleep(1) ' )
150 PySwitch_1.append( ' return a & 1,1-(a&1),a ' )
151 Switch_1,EndSwitch = GraphEditSwitchs_5.SNode( 'Switch' , PySwitch_1 )
152 EndSwitch.SetName( 'EndSwitch' )
153 EndSwitch.SetAuthor( '' )
154 EndSwitch.SetComment( 'Compute Node' )
155 EndSwitch.Coords( 608 , 430 )
157 EndSwitch.SetPyFunction( '' , PyEndSwitch )
158 IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
159 IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
160 OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
161 OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
162 Switch_1.SetName( 'Switch_1' )
163 Switch_1.SetAuthor( '' )
164 Switch_1.SetComment( 'Compute Node' )
165 Switch_1.Coords( 201 , 388 )
166 ISwitch_1a = Switch_1.InPort( 'a' , 'long' )
167 ISwitch_1Gate = Switch_1.GetInPort( 'Gate' )
168 OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' )
169 OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' )
170 OSwitch_1a = Switch_1.OutPort( 'a' , 'int' )
171 OSwitch_1Default = Switch_1.GetOutPort( 'Default' )
174 LIsOddaEndOfSwitcha = GraphEditSwitchs_5.Link( OIsOdda , IEndOfSwitcha )
176 LIsEvenaEndSwitcha = GraphEditSwitchs_5.Link( OIsEvena , IEndSwitcha )
178 LInitLoopIndexSwitch_1a = GraphEditSwitchs_5.Link( OInitLoopIndex , ISwitch_1a )
180 LInitLoopIndexSwitcha = GraphEditSwitchs_5.Link( OInitLoopIndex , ISwitcha )
182 LInitLoopMinEndOfInitLoopMin = GraphEditSwitchs_5.Link( OInitLoopMin , IEndOfInitLoopMin )
184 LInitLoopMaxEndOfInitLoopMax = GraphEditSwitchs_5.Link( OInitLoopMax , IEndOfInitLoopMax )
186 LSwitchOddIsOddGate = GraphEditSwitchs_5.Link( OSwitchOdd , IIsOddGate )
188 LSwitchaIsOdda = GraphEditSwitchs_5.Link( OSwitcha , IIsOdda )
190 LSwitchDefaultEndOfSwitchDefault = GraphEditSwitchs_5.Link( OSwitchDefault , IEndOfSwitchDefault )
192 LEndOfSwitchaEndOfInitLoopIndex = GraphEditSwitchs_5.Link( OEndOfSwitcha , IEndOfInitLoopIndex )
194 LSwitch_1EvenIsEvenGate = GraphEditSwitchs_5.Link( OSwitch_1Even , IIsEvenGate )
196 LSwitch_1aIsEvena = GraphEditSwitchs_5.Link( OSwitch_1a , IIsEvena )
198 LSwitch_1DefaultEndSwitchDefault = GraphEditSwitchs_5.Link( OSwitch_1Default , IEndSwitchDefault )
200 LEndSwitchGateEndOfInitLoopGate = GraphEditSwitchs_5.Link( OEndSwitchGate , IEndOfInitLoopGate )
203 IInitLoopIndex.Input( 0 )
204 IInitLoopMin.Input( 0 )
205 IInitLoopMax.Input( 20 )
207 # Output Ports of the graph
208 #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
209 #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
210 #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
211 #OSwitchEven = Switch.GetOutPort( 'Even' )
212 #OSwitch_1Odd = Switch_1.GetOutPort( 'Odd' )
213 #OEndSwitcha = EndSwitch.GetOutPort( 'a' )
214 return GraphEditSwitchs_5
217 GraphEditSwitchs_5 = DefGraphEditSwitchs_5()