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 GraphTwoLoops1
26 # Graph creation of GraphTwoLoops1
27 def DefGraphTwoLoops1() :
28 GraphTwoLoops1 = Graph( 'GraphTwoLoops1' )
29 GraphTwoLoops1.SetName( 'GraphTwoLoops1' )
30 GraphTwoLoops1.SetAuthor( 'JR' )
31 GraphTwoLoops1.SetComment( '' )
32 GraphTwoLoops1.Coords( 0 , 0 )
34 # Creation of Factory Nodes
36 # Creation of Loop Nodes
38 PyLoop1.append( 'def Loop1(Index,Max) : ' )
39 PyLoop1.append( ' return Index,Max ' )
42 PyMoreLoop1.append( 'import time ' )
43 PyMoreLoop1.append( 'def More(Index,Max) : ' )
44 PyMoreLoop1.append( ' time.sleep(2) ' )
45 PyMoreLoop1.append( ' DoLoop = 0 ' )
46 PyMoreLoop1.append( ' if Index < Max : ' )
47 PyMoreLoop1.append( ' DoLoop = 1 ' )
48 PyMoreLoop1.append( ' return DoLoop,Index,Max ' )
49 PyMoreLoop1.append( '' )
51 PyNextLoop1.append( 'def Next(Index,Max) : ' )
52 PyNextLoop1.append( ' Index = Index + 1 ' )
53 PyNextLoop1.append( ' return Index,Max ' )
54 PyNextLoop1.append( '' )
55 Loop1,EndLoop1 = GraphTwoLoops1.LNode( 'Loop1' , PyLoop1 , 'More' , PyMoreLoop1 , 'Next' , PyNextLoop1 )
56 EndLoop1.SetName( 'EndLoop1' )
57 EndLoop1.SetAuthor( '' )
58 EndLoop1.SetComment( 'Compute Node' )
59 EndLoop1.Coords( 634 , 177 )
61 EndLoop1.SetPyFunction( 'EndLoop1' , PyEndLoop1 )
62 ILoop1DoLoop = Loop1.GetInPort( 'DoLoop' )
63 ILoop1Index = Loop1.InPort( 'Index' , 'long' )
64 ILoop1Max = Loop1.InPort( 'Max' , 'long' )
65 ILoop1Gate = Loop1.GetInPort( 'Gate' )
66 OLoop1DoLoop = Loop1.GetOutPort( 'DoLoop' )
67 OLoop1Index = Loop1.GetOutPort( 'Index' )
68 OLoop1Max = Loop1.GetOutPort( 'Max' )
69 IEndLoop1DoLoop = EndLoop1.GetInPort( 'DoLoop' )
70 IEndLoop1Index = EndLoop1.GetInPort( 'Index' )
71 IEndLoop1Max = EndLoop1.GetInPort( 'Max' )
72 IEndLoop1Gate = EndLoop1.GetInPort( 'Gate' )
73 OEndLoop1DoLoop = EndLoop1.GetOutPort( 'DoLoop' )
74 OEndLoop1Index = EndLoop1.GetOutPort( 'Index' )
75 OEndLoop1Max = EndLoop1.GetOutPort( 'Max' )
76 OEndLoop1Gate = EndLoop1.GetOutPort( 'Gate' )
77 Loop1.SetName( 'Loop1' )
79 Loop1.SetComment( 'Compute Node' )
80 Loop1.Coords( 7 , 175 )
84 PyMoreLoop.append( '' )
86 PyNextLoop.append( 'def Next(Index,Max) : ' )
87 PyNextLoop.append( ' Index = Index + 1 ' )
88 PyNextLoop.append( ' return Index,Max ' )
89 PyNextLoop.append( '' )
90 Loop,EndLoop = GraphTwoLoops1.LNode( '' , PyLoop , '' , PyMoreLoop , 'Next' , PyNextLoop )
91 EndLoop.SetName( 'EndLoop' )
92 EndLoop.SetAuthor( '' )
93 EndLoop.SetComment( 'Compute Node' )
94 EndLoop.Coords( 426 , 180 )
96 PyEndLoop.append( 'import time ' )
97 PyEndLoop.append( 'def EndLoop(DoLoop,Index,Max) : ' )
98 PyEndLoop.append( ' time.sleep(1) ' )
99 PyEndLoop.append( ' DoLoop = 0 ' )
100 PyEndLoop.append( ' if Index < Max : ' )
101 PyEndLoop.append( ' DoLoop = 1 ' )
102 PyEndLoop.append( ' return DoLoop,Index,Max ' )
103 PyEndLoop.append( '' )
104 EndLoop.SetPyFunction( 'EndLoop' , PyEndLoop )
105 ILoopDoLoop = Loop.GetInPort( 'DoLoop' )
106 ILoopIndex = Loop.InPort( 'Index' , 'long' )
107 ILoopMax = Loop.InPort( 'Max' , 'long' )
108 ILoopGate = Loop.GetInPort( 'Gate' )
109 OLoopDoLoop = Loop.GetOutPort( 'DoLoop' )
110 OLoopIndex = Loop.GetOutPort( 'Index' )
111 OLoopMax = Loop.GetOutPort( 'Max' )
112 IEndLoopDoLoop = EndLoop.GetInPort( 'DoLoop' )
113 IEndLoopIndex = EndLoop.GetInPort( 'Index' )
114 IEndLoopMax = EndLoop.GetInPort( 'Max' )
115 IEndLoopGate = EndLoop.GetInPort( 'Gate' )
116 OEndLoopDoLoop = EndLoop.GetOutPort( 'DoLoop' )
117 OEndLoopIndex = EndLoop.GetOutPort( 'Index' )
118 OEndLoopMax = EndLoop.GetOutPort( 'Max' )
119 OEndLoopGate = EndLoop.GetOutPort( 'Gate' )
120 Loop.SetName( 'Loop' )
122 Loop.SetComment( 'Compute Node' )
123 Loop.Coords( 208 , 179 )
126 LLoop1IndexEndLoop1Index = GraphTwoLoops1.Link( OLoop1Index , IEndLoop1Index )
128 LLoop1IndexLoopIndex = GraphTwoLoops1.Link( OLoop1Index , ILoopIndex )
130 LLoop1MaxEndLoop1Max = GraphTwoLoops1.Link( OLoop1Max , IEndLoop1Max )
132 LLoop1GateLoopGate = GraphTwoLoops1.Link( OLoop1Gate , ILoopGate )
134 LLoopIndexEndLoopIndex = GraphTwoLoops1.Link( OLoopIndex , IEndLoopIndex )
136 LLoopMaxEndLoopMax = GraphTwoLoops1.Link( OLoopMax , IEndLoopMax )
138 LEndLoopGateEndLoop1Gate = GraphTwoLoops1.Link( OEndLoopGate , IEndLoop1Gate )
141 ILoop1Index.Input( 5 )
142 ILoop1Max.Input( 15 )
145 # Output Ports of the graph
146 #OEndLoop1Index = EndLoop1.GetOutPort( 'Index' )
147 #OEndLoop1Max = EndLoop1.GetOutPort( 'Max' )
148 #OEndLoopIndex = EndLoop.GetOutPort( 'Index' )
149 #OEndLoopMax = EndLoop.GetOutPort( 'Max' )
150 return GraphTwoLoops1
153 GraphTwoLoops1 = DefGraphTwoLoops1()