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 GraphLoopPyAddAddMemory
26 # Graph creation of GraphLoopPyAddAddMemory
27 def DefGraphLoopPyAddAddMemory() :
28 GraphLoopPyAddAddMemory = Graph( 'GraphLoopPyAddAddMemory' )
29 GraphLoopPyAddAddMemory.SetName( 'GraphLoopPyAddAddMemory' )
30 GraphLoopPyAddAddMemory.SetAuthor( 'JR' )
31 GraphLoopPyAddAddMemory.SetComment( 'For solving of memory leaks' )
32 GraphLoopPyAddAddMemory.Coords( 0 , 0 )
34 # Creation of Factory Nodes
36 AddWithoutSleep = GraphLoopPyAddAddMemory.FNode( 'AddComponent' , 'AddComponent' , 'AddWithoutSleep' )
37 AddWithoutSleep.SetName( 'AddWithoutSleep' )
38 AddWithoutSleep.SetAuthor( '' )
39 AddWithoutSleep.SetContainer( 'localhost/FactoryServer' )
40 AddWithoutSleep.SetComment( 'AddWithoutSleep from AddComponent' )
41 AddWithoutSleep.Coords( 255 , 352 )
42 IAddWithoutSleepx = AddWithoutSleep.GetInPort( 'x' )
43 IAddWithoutSleepy = AddWithoutSleep.GetInPort( 'y' )
44 IAddWithoutSleepGate = AddWithoutSleep.GetInPort( 'Gate' )
45 OAddWithoutSleepFuncValue = AddWithoutSleep.GetOutPort( 'FuncValue' )
46 OAddWithoutSleepz = AddWithoutSleep.GetOutPort( 'z' )
47 OAddWithoutSleepGate = AddWithoutSleep.GetOutPort( 'Gate' )
49 # Creation of InLine Nodes
51 PyPyAdd.append( 'def PyAdd(a,b) : ' )
52 PyPyAdd.append( ' return a,a+b ' )
53 PyAdd = GraphLoopPyAddAddMemory.INode( 'PyAdd' , PyPyAdd )
54 PyAdd.SetName( 'PyAdd' )
56 PyAdd.SetComment( 'Compute Node' )
57 PyAdd.Coords( 266 , 188 )
58 IPyAdda = PyAdd.InPort( 'a' , 'long' )
59 IPyAddb = PyAdd.InPort( 'b' , 'long' )
60 IPyAddGate = PyAdd.GetInPort( 'Gate' )
61 OPyAdda = PyAdd.OutPort( 'a' , 'long' )
62 OPyAddc = PyAdd.OutPort( 'c' , 'long' )
63 OPyAddGate = PyAdd.GetOutPort( 'Gate' )
65 # Creation of Loop Nodes
67 PyInit.append( 'def Init(Index,Min,Max,Incr) : ' )
68 PyInit.append( ' if Min <= Max : ' )
69 PyInit.append( ' Index = Min ' )
70 PyInit.append( ' else : ' )
71 PyInit.append( ' Index = Max ' )
72 PyInit.append( ' return Index,Min,Max,Incr ' )
74 PyMoreInit.append( 'def More(Index,Min,Max,Incr) : ' )
75 PyMoreInit.append( ' if Index < Max : ' )
76 PyMoreInit.append( ' DoLoop = 1 ' )
77 PyMoreInit.append( ' else : ' )
78 PyMoreInit.append( ' DoLoop = 0 ' )
79 PyMoreInit.append( ' return DoLoop,Index,Min,Max,Incr ' )
81 PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' )
82 PyNextInit.append( ' Index = Index + Incr ' )
83 PyNextInit.append( ' return Index,Min,Max,Incr ' )
84 Init,EndInit = GraphLoopPyAddAddMemory.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
85 EndInit.SetName( 'EndInit' )
86 EndInit.SetAuthor( '' )
87 EndInit.SetComment( 'Compute Node' )
88 EndInit.Coords( 495 , 262 )
90 EndInit.SetPyFunction( '' , PyEndInit )
91 IInitDoLoop = Init.GetInPort( 'DoLoop' )
92 IInitIndex = Init.InPort( 'Index' , 'long' )
93 IInitMin = Init.InPort( 'Min' , 'long' )
94 IInitMax = Init.InPort( 'Max' , 'long' )
95 IInitIncr = Init.InPort( 'Incr' , 'long' )
96 IInitGate = Init.GetInPort( 'Gate' )
97 OInitDoLoop = Init.GetOutPort( 'DoLoop' )
98 OInitIndex = Init.GetOutPort( 'Index' )
99 OInitMin = Init.GetOutPort( 'Min' )
100 OInitMax = Init.GetOutPort( 'Max' )
101 OInitIncr = Init.GetOutPort( 'Incr' )
102 IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
103 IEndInitIndex = EndInit.GetInPort( 'Index' )
104 IEndInitMin = EndInit.GetInPort( 'Min' )
105 IEndInitMax = EndInit.GetInPort( 'Max' )
106 IEndInitIncr = EndInit.GetInPort( 'Incr' )
107 IEndInitGate = EndInit.GetInPort( 'Gate' )
108 OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
109 OEndInitIndex = EndInit.GetOutPort( 'Index' )
110 OEndInitMin = EndInit.GetOutPort( 'Min' )
111 OEndInitMax = EndInit.GetOutPort( 'Max' )
112 OEndInitIncr = EndInit.GetOutPort( 'Incr' )
113 OEndInitGate = EndInit.GetOutPort( 'Gate' )
114 Init.SetName( 'Init' )
116 Init.SetComment( 'Compute Node' )
117 Init.Coords( 17 , 257 )
120 LInitIndexAddWithoutSleepx = GraphLoopPyAddAddMemory.Link( OInitIndex , IAddWithoutSleepx )
122 LInitIndexPyAdda = GraphLoopPyAddAddMemory.Link( OInitIndex , IPyAdda )
124 LInitMinEndInitMin = GraphLoopPyAddAddMemory.Link( OInitMin , IEndInitMin )
126 LInitMaxEndInitMax = GraphLoopPyAddAddMemory.Link( OInitMax , IEndInitMax )
128 LInitMaxAddWithoutSleepy = GraphLoopPyAddAddMemory.Link( OInitMax , IAddWithoutSleepy )
130 LInitMaxPyAddb = GraphLoopPyAddAddMemory.Link( OInitMax , IPyAddb )
132 LInitIncrEndInitIncr = GraphLoopPyAddAddMemory.Link( OInitIncr , IEndInitIncr )
134 LAddWithoutSleepGateEndInitGate = GraphLoopPyAddAddMemory.Link( OAddWithoutSleepGate , IEndInitGate )
136 LPyAddaEndInitIndex = GraphLoopPyAddAddMemory.Link( OPyAdda , IEndInitIndex )
139 IInitIndex.Input( 0 )
141 IInitMax.Input( 100000 )
144 # Output Ports of the graph
145 #OEndInitIndex = EndInit.GetOutPort( 'Index' )
146 #OEndInitMin = EndInit.GetOutPort( 'Min' )
147 #OEndInitMax = EndInit.GetOutPort( 'Max' )
148 #OEndInitIncr = EndInit.GetOutPort( 'Incr' )
149 #OAddWithoutSleepFuncValue = AddWithoutSleep.GetOutPort( 'FuncValue' )
150 #OAddWithoutSleepz = AddWithoutSleep.GetOutPort( 'z' )
151 #OPyAddc = PyAdd.GetOutPort( 'c' )
152 return GraphLoopPyAddAddMemory
155 GraphLoopPyAddAddMemory = DefGraphLoopPyAddAddMemory()