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 GraphPyFunctions_1
27 # Graph creation of GraphPyFunctions_1
28 def DefGraphPyFunctions_1() :
29 GraphPyFunctions_1 = Graph( 'GraphPyFunctions_1' )
30 GraphPyFunctions_1.SetName( 'GraphPyFunctions_1' )
31 GraphPyFunctions_1.SetAuthor( '' )
32 GraphPyFunctions_1.SetComment( '' )
33 GraphPyFunctions_1.Coords( 0 , 0 )
35 # Creation of Factory Nodes
37 # Creation of InLine Nodes
39 IsOdd = GraphPyFunctions_1.INode( 'IsOdd' , PyIsOdd )
40 IsOdd.SetName( 'IsOdd' )
42 IsOdd.SetComment( 'Python function' )
43 IsOdd.Coords( 388 , 50 )
44 IIsOdda = IsOdd.InPort( 'a' , 'long' )
45 IIsOddGate = IsOdd.GetInPort( 'Gate' )
46 OIsOdda = IsOdd.OutPort( 'a' , 'long' )
47 OIsOddGate = IsOdd.GetOutPort( 'Gate' )
50 PyIsOdd_1.append( 'from time import * ' )
51 PyIsOdd_1.append( 'def IsOdd(a) : ' )
52 PyIsOdd_1.append( ' print a,"IsOdd" ' )
53 PyIsOdd_1.append( ' sleep( 1 ) ' )
54 PyIsOdd_1.append( ' return a ' )
55 IsOdd_1 = GraphPyFunctions_1.INode( 'IsOdd' , PyIsOdd_1 )
56 IsOdd_1.SetName( 'IsOdd_1' )
57 IsOdd_1.SetAuthor( '' )
58 IsOdd_1.SetComment( 'Python function' )
59 IsOdd_1.Coords( 391 , 288 )
60 IIsOdd_1a = IsOdd_1.InPort( 'a' , 'long' )
61 IIsOdd_1Gate = IsOdd_1.GetInPort( 'Gate' )
62 OIsOdd_1a = IsOdd_1.OutPort( 'a' , 'long' )
63 OIsOdd_1Gate = IsOdd_1.GetOutPort( 'Gate' )
65 # Creation of Loop Nodes
67 PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' )
68 PyInitLoop.append( ' return Index,Min,Max ' )
70 PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' )
71 PyMoreInitLoop.append( ' if Index <= Max : ' )
72 PyMoreInitLoop.append( ' DoLoop = 1 ' )
73 PyMoreInitLoop.append( ' else : ' )
74 PyMoreInitLoop.append( ' DoLoop = 0 ' )
75 PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' )
77 PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' )
78 PyNextInitLoop.append( ' Index = Index + 1 ' )
79 PyNextInitLoop.append( ' return Index,Min,Max ' )
80 InitLoop,EndOfInitLoop = GraphPyFunctions_1.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop )
81 EndOfInitLoop.SetName( 'EndOfInitLoop' )
82 EndOfInitLoop.SetAuthor( '' )
83 EndOfInitLoop.SetComment( 'Compute Node' )
84 EndOfInitLoop.Coords( 766 , 127 )
86 EndOfInitLoop.SetPyFunction( 'EndInitLoop' , PyEndOfInitLoop )
87 IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' )
88 IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
89 IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
90 IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
91 IInitLoopGate = InitLoop.GetInPort( 'Gate' )
92 OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
93 OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
94 OInitLoopMin = InitLoop.GetOutPort( 'Min' )
95 OInitLoopMax = InitLoop.GetOutPort( 'Max' )
96 IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
97 IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
98 IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
99 IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
100 IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
101 OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
102 OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
103 OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
104 OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
105 OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' )
106 InitLoop.SetName( 'InitLoop' )
107 InitLoop.SetAuthor( '' )
108 InitLoop.SetComment( 'Compute Node' )
109 InitLoop.Coords( 10 , 129 )
112 PyMoreInitLoop_1 = []
113 PyMoreInitLoop_1.append( '' )
114 PyNextInitLoop_1 = []
115 PyNextInitLoop_1.append( '' )
116 InitLoop_1,EndOfInitLoop_1 = GraphPyFunctions_1.LNode( 'InitLoop' , PyInitLoop_1 , 'MoreLoop' , PyMoreInitLoop_1 , 'NextLoop' , PyNextInitLoop_1 )
117 EndOfInitLoop_1.SetName( 'EndOfInitLoop_1' )
118 EndOfInitLoop_1.SetAuthor( '' )
119 EndOfInitLoop_1.SetComment( 'Compute Node' )
120 EndOfInitLoop_1.Coords( 784 , 361 )
121 PyEndOfInitLoop_1 = []
122 EndOfInitLoop_1.SetPyFunction( 'EndInitLoop' , PyEndOfInitLoop_1 )
123 IInitLoop_1DoLoop = InitLoop_1.GetInPort( 'DoLoop' )
124 IInitLoop_1Index = InitLoop_1.InPort( 'Index' , 'long' )
125 IInitLoop_1Min = InitLoop_1.InPort( 'Min' , 'long' )
126 IInitLoop_1Max = InitLoop_1.InPort( 'Max' , 'long' )
127 IInitLoop_1Gate = InitLoop_1.GetInPort( 'Gate' )
128 OInitLoop_1DoLoop = InitLoop_1.GetOutPort( 'DoLoop' )
129 OInitLoop_1Index = InitLoop_1.GetOutPort( 'Index' )
130 OInitLoop_1Min = InitLoop_1.GetOutPort( 'Min' )
131 OInitLoop_1Max = InitLoop_1.GetOutPort( 'Max' )
132 IEndOfInitLoop_1DoLoop = EndOfInitLoop_1.GetInPort( 'DoLoop' )
133 IEndOfInitLoop_1Index = EndOfInitLoop_1.GetInPort( 'Index' )
134 IEndOfInitLoop_1Min = EndOfInitLoop_1.GetInPort( 'Min' )
135 IEndOfInitLoop_1Max = EndOfInitLoop_1.GetInPort( 'Max' )
136 IEndOfInitLoop_1Gate = EndOfInitLoop_1.GetInPort( 'Gate' )
137 OEndOfInitLoop_1DoLoop = EndOfInitLoop_1.GetOutPort( 'DoLoop' )
138 OEndOfInitLoop_1Index = EndOfInitLoop_1.GetOutPort( 'Index' )
139 OEndOfInitLoop_1Min = EndOfInitLoop_1.GetOutPort( 'Min' )
140 OEndOfInitLoop_1Max = EndOfInitLoop_1.GetOutPort( 'Max' )
141 OEndOfInitLoop_1Gate = EndOfInitLoop_1.GetOutPort( 'Gate' )
142 InitLoop_1.SetName( 'InitLoop_1' )
143 InitLoop_1.SetAuthor( '' )
144 InitLoop_1.SetComment( 'Compute Node' )
145 InitLoop_1.Coords( 12 , 369 )
147 # Creation of Switch Nodes
149 Switch,EndOfSwitch = GraphPyFunctions_1.SNode( 'Switch' , PySwitch )
150 EndOfSwitch.SetName( 'EndOfSwitch' )
151 EndOfSwitch.SetAuthor( '' )
152 EndOfSwitch.SetComment( 'Compute Node' )
153 EndOfSwitch.Coords( 587 , 126 )
155 EndOfSwitch.SetPyFunction( 'EndOfSwitch_1' , PyEndOfSwitch )
156 IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
157 IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
158 OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
159 OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
160 Switch.SetName( 'Switch' )
161 Switch.SetAuthor( '' )
162 Switch.SetComment( 'Compute Node' )
163 Switch.Coords( 186 , 130 )
164 ISwitcha = Switch.InPort( 'a' , 'long' )
165 ISwitchGate = Switch.GetInPort( 'Gate' )
166 OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
167 OSwitchEven = Switch.OutPort( 'Even' , 'int' )
168 OSwitcha = Switch.OutPort( 'a' , 'int' )
169 OSwitchDefault = Switch.GetOutPort( 'Default' )
172 PySwitch_1.append( 'from time import * ' )
173 PySwitch_1.append( 'def Switch(a) : ' )
174 PySwitch_1.append( ' if ( a & 1 ) == 0 : ' )
175 PySwitch_1.append( ' sleep(1) ' )
176 PySwitch_1.append( ' return a & 1,1-(a&1),a ' )
177 Switch_1,EndOfSwitch_1 = GraphPyFunctions_1.SNode( 'Switch' , PySwitch_1 )
178 EndOfSwitch_1.SetName( 'EndOfSwitch_1' )
179 EndOfSwitch_1.SetAuthor( '' )
180 EndOfSwitch_1.SetComment( 'Compute Node' )
181 EndOfSwitch_1.Coords( 594 , 362 )
183 EndOfSwitch_1.SetPyFunction( 'EndOfSwitch_1' , PyEndOfSwitch_1 )
184 IEndOfSwitch_1a = EndOfSwitch_1.InPort( 'a' , 'long' )
185 IEndOfSwitch_1Default = EndOfSwitch_1.GetInPort( 'Default' )
186 OEndOfSwitch_1a = EndOfSwitch_1.OutPort( 'a' , 'long' )
187 OEndOfSwitch_1Gate = EndOfSwitch_1.GetOutPort( 'Gate' )
188 Switch_1.SetName( 'Switch_1' )
189 Switch_1.SetAuthor( '' )
190 Switch_1.SetComment( 'Compute Node' )
191 Switch_1.Coords( 185 , 368 )
192 ISwitch_1a = Switch_1.InPort( 'a' , 'long' )
193 ISwitch_1Gate = Switch_1.GetInPort( 'Gate' )
194 OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' )
195 OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' )
196 OSwitch_1a = Switch_1.OutPort( 'a' , 'int' )
197 OSwitch_1Default = Switch_1.GetOutPort( 'Default' )
200 LIsOddaEndOfSwitcha = GraphPyFunctions_1.Link( OIsOdda , IEndOfSwitcha )
201 LIsOddaEndOfSwitcha.AddCoord( 1 , 571 , 160 )
202 LIsOddaEndOfSwitcha.AddCoord( 2 , 571 , 129 )
204 LIsOdd_1aEndOfSwitch_1a = GraphPyFunctions_1.Link( OIsOdd_1a , IEndOfSwitch_1a )
205 LIsOdd_1aEndOfSwitch_1a.AddCoord( 1 , 580 , 396 )
206 LIsOdd_1aEndOfSwitch_1a.AddCoord( 2 , 580 , 368 )
208 LInitLoopIndexSwitcha = GraphPyFunctions_1.Link( OInitLoopIndex , ISwitcha )
210 LInitLoopMinEndOfInitLoopMin = GraphPyFunctions_1.Link( OInitLoopMin , IEndOfInitLoopMin )
212 LInitLoopMaxEndOfInitLoopMax = GraphPyFunctions_1.Link( OInitLoopMax , IEndOfInitLoopMax )
214 LInitLoop_1IndexSwitch_1a = GraphPyFunctions_1.Link( OInitLoop_1Index , ISwitch_1a )
216 LInitLoop_1MinEndOfInitLoop_1Min = GraphPyFunctions_1.Link( OInitLoop_1Min , IEndOfInitLoop_1Min )
218 LInitLoop_1MaxEndOfInitLoop_1Max = GraphPyFunctions_1.Link( OInitLoop_1Max , IEndOfInitLoop_1Max )
220 LSwitchOddIsOddGate = GraphPyFunctions_1.Link( OSwitchOdd , IIsOddGate )
222 LSwitchaIsOdda = GraphPyFunctions_1.Link( OSwitcha , IIsOdda )
223 LSwitchaIsOdda.AddCoord( 1 , 366 , 131 )
224 LSwitchaIsOdda.AddCoord( 2 , 365 , 223 )
226 LSwitchDefaultEndOfSwitchDefault = GraphPyFunctions_1.Link( OSwitchDefault , IEndOfSwitchDefault )
227 LSwitchDefaultEndOfSwitchDefault.AddCoord( 1 , 572 , 194 )
228 LSwitchDefaultEndOfSwitchDefault.AddCoord( 2 , 571 , 257 )
230 LEndOfSwitchaEndOfInitLoopIndex = GraphPyFunctions_1.Link( OEndOfSwitcha , IEndOfInitLoopIndex )
232 LSwitch_1OddIsOdd_1Gate = GraphPyFunctions_1.Link( OSwitch_1Odd , IIsOdd_1Gate )
234 LSwitch_1aIsOdd_1a = GraphPyFunctions_1.Link( OSwitch_1a , IIsOdd_1a )
235 LSwitch_1aIsOdd_1a.AddCoord( 1 , 368 , 368 )
236 LSwitch_1aIsOdd_1a.AddCoord( 2 , 367 , 460 )
238 LSwitch_1DefaultEndOfSwitch_1Default = GraphPyFunctions_1.Link( OSwitch_1Default , IEndOfSwitch_1Default )
240 LEndOfSwitch_1aEndOfInitLoop_1Index = GraphPyFunctions_1.Link( OEndOfSwitch_1a , IEndOfInitLoop_1Index )
243 IInitLoopIndex.Input( 0 )
244 IInitLoopMin.Input( 0 )
245 IInitLoopMax.Input( 25 )
246 IInitLoop_1Index.Input( 0 )
247 IInitLoop_1Min.Input( 0 )
248 IInitLoop_1Max.Input( 35 )
250 # Output Ports of the graph
251 #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
252 #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
253 #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
254 #OEndOfInitLoop_1Index = EndOfInitLoop_1.GetOutPort( 'Index' )
255 #OEndOfInitLoop_1Min = EndOfInitLoop_1.GetOutPort( 'Min' )
256 #OEndOfInitLoop_1Max = EndOfInitLoop_1.GetOutPort( 'Max' )
257 #OSwitchEven = Switch.GetOutPort( 'Even' )
258 #OSwitch_1Even = Switch_1.GetOutPort( 'Even' )
259 return GraphPyFunctions_1
262 GraphPyFunctions_1 = DefGraphPyFunctions_1()