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 GraphLoopAddMemory
27 # Graph creation of GraphLoopAddMemory
28 def DefGraphLoopAddMemory() :
29 GraphLoopAddMemory = Graph( 'GraphLoopAddMemory' )
30 GraphLoopAddMemory.SetName( 'GraphLoopAddMemory' )
31 GraphLoopAddMemory.SetAuthor( 'JR' )
32 GraphLoopAddMemory.SetComment( 'For solving of memory leaks' )
33 GraphLoopAddMemory.Coords( 0 , 0 )
35 # Creation of Factory Nodes
37 AddWithoutSleep = GraphLoopAddMemory.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( 246 , 262 )
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 Loop Nodes
52 PyInit.append( 'def Init(Index,Min,Max,Incr) : ' )
53 PyInit.append( ' if Min <= Max : ' )
54 PyInit.append( ' Index = Min ' )
55 PyInit.append( ' else : ' )
56 PyInit.append( ' Index = Max ' )
57 PyInit.append( ' return Index,Min,Max,Incr ' )
59 PyMoreInit.append( 'def More(Index,Min,Max,Incr) : ' )
60 PyMoreInit.append( ' if Index < Max : ' )
61 PyMoreInit.append( ' DoLoop = 1 ' )
62 PyMoreInit.append( ' else : ' )
63 PyMoreInit.append( ' DoLoop = 0 ' )
64 PyMoreInit.append( ' return DoLoop,Index,Min,Max,Incr ' )
66 PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' )
67 PyNextInit.append( ' Index = Index + Incr ' )
68 PyNextInit.append( ' return Index,Min,Max,Incr ' )
69 Init,EndInit = GraphLoopAddMemory.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
70 EndInit.SetName( 'EndInit' )
71 EndInit.SetAuthor( '' )
72 EndInit.SetComment( 'Compute Node' )
73 EndInit.Coords( 495 , 262 )
75 EndInit.SetPyFunction( '' , PyEndInit )
76 IInitDoLoop = Init.GetInPort( 'DoLoop' )
77 IInitIndex = Init.InPort( 'Index' , 'long' )
78 IInitMin = Init.InPort( 'Min' , 'long' )
79 IInitMax = Init.InPort( 'Max' , 'long' )
80 IInitIncr = Init.InPort( 'Incr' , 'long' )
81 IInitGate = Init.GetInPort( 'Gate' )
82 OInitDoLoop = Init.GetOutPort( 'DoLoop' )
83 OInitIndex = Init.GetOutPort( 'Index' )
84 OInitMin = Init.GetOutPort( 'Min' )
85 OInitMax = Init.GetOutPort( 'Max' )
86 OInitIncr = Init.GetOutPort( 'Incr' )
87 IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
88 IEndInitIndex = EndInit.GetInPort( 'Index' )
89 IEndInitMin = EndInit.GetInPort( 'Min' )
90 IEndInitMax = EndInit.GetInPort( 'Max' )
91 IEndInitIncr = EndInit.GetInPort( 'Incr' )
92 IEndInitGate = EndInit.GetInPort( 'Gate' )
93 OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
94 OEndInitIndex = EndInit.GetOutPort( 'Index' )
95 OEndInitMin = EndInit.GetOutPort( 'Min' )
96 OEndInitMax = EndInit.GetOutPort( 'Max' )
97 OEndInitIncr = EndInit.GetOutPort( 'Incr' )
98 OEndInitGate = EndInit.GetOutPort( 'Gate' )
99 Init.SetName( 'Init' )
101 Init.SetComment( 'Compute Node' )
102 Init.Coords( 17 , 257 )
105 LInitIndexEndInitIndex = GraphLoopAddMemory.Link( OInitIndex , IEndInitIndex )
107 LInitIndexAddWithoutSleepx = GraphLoopAddMemory.Link( OInitIndex , IAddWithoutSleepx )
109 LInitMinEndInitMin = GraphLoopAddMemory.Link( OInitMin , IEndInitMin )
111 LInitMaxEndInitMax = GraphLoopAddMemory.Link( OInitMax , IEndInitMax )
113 LInitMaxAddWithoutSleepy = GraphLoopAddMemory.Link( OInitMax , IAddWithoutSleepy )
115 LInitIncrEndInitIncr = GraphLoopAddMemory.Link( OInitIncr , IEndInitIncr )
117 LAddWithoutSleepGateEndInitGate = GraphLoopAddMemory.Link( OAddWithoutSleepGate , IEndInitGate )
120 IInitIndex.Input( 0 )
122 IInitMax.Input( 100000 )
125 # Output Ports of the graph
126 #OEndInitIndex = EndInit.GetOutPort( 'Index' )
127 #OEndInitMin = EndInit.GetOutPort( 'Min' )
128 #OEndInitMax = EndInit.GetOutPort( 'Max' )
129 #OEndInitIncr = EndInit.GetOutPort( 'Incr' )
130 #OAddWithoutSleepFuncValue = AddWithoutSleep.GetOutPort( 'FuncValue' )
131 #OAddWithoutSleepz = AddWithoutSleep.GetOutPort( 'z' )
132 return GraphLoopAddMemory
135 GraphLoopAddMemory = DefGraphLoopAddMemory()