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