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