Salome HOME
Merge from BR_V5_DEV 17Feb09
[samples/datafiles.git] / Superv / Python / GraphLoopAddMemory.py
1 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
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.
10 #
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.
15 #
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
19 #
20 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22 # Generated python file of Graph GraphLoopAddMemory
23 #
24 from SuperV import *
25
26 # Graph creation of GraphLoopAddMemory
27 def DefGraphLoopAddMemory() :
28     GraphLoopAddMemory = Graph( 'GraphLoopAddMemory' )
29     GraphLoopAddMemory.SetName( 'GraphLoopAddMemory' )
30     GraphLoopAddMemory.SetAuthor( 'JR' )
31     GraphLoopAddMemory.SetComment( 'For solving of memory leaks' )
32     GraphLoopAddMemory.Coords( 0 , 0 )
33     
34     # Creation of Factory Nodes
35     
36     AddWithoutSleep = GraphLoopAddMemory.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( 246 , 262 )
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' )
48     
49     # Creation of Loop Nodes
50     PyInit = []
51     PyInit.append( 'def Init(Index,Min,Max,Incr) :    ' )
52     PyInit.append( '    if Min <= Max :    ' )
53     PyInit.append( '        Index = Min    ' )
54     PyInit.append( '    else :    ' )
55     PyInit.append( '        Index = Max    ' )
56     PyInit.append( '    return Index,Min,Max,Incr    ' )
57     PyMoreInit = []
58     PyMoreInit.append( 'def More(Index,Min,Max,Incr) :    ' )
59     PyMoreInit.append( '    if Index < Max :    ' )
60     PyMoreInit.append( '        DoLoop = 1    ' )
61     PyMoreInit.append( '    else :    ' )
62     PyMoreInit.append( '        DoLoop = 0    ' )
63     PyMoreInit.append( '    return DoLoop,Index,Min,Max,Incr    ' )
64     PyNextInit = []
65     PyNextInit.append( 'def Next(Index,Min,Max,Incr) :    ' )
66     PyNextInit.append( '    Index = Index + Incr    ' )
67     PyNextInit.append( '    return Index,Min,Max,Incr   ' )
68     Init,EndInit = GraphLoopAddMemory.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
69     EndInit.SetName( 'EndInit' )
70     EndInit.SetAuthor( '' )
71     EndInit.SetComment( 'Compute Node' )
72     EndInit.Coords( 495 , 262 )
73     PyEndInit = []
74     EndInit.SetPyFunction( '' , PyEndInit )
75     IInitDoLoop = Init.GetInPort( 'DoLoop' )
76     IInitIndex = Init.InPort( 'Index' , 'long' )
77     IInitMin = Init.InPort( 'Min' , 'long' )
78     IInitMax = Init.InPort( 'Max' , 'long' )
79     IInitIncr = Init.InPort( 'Incr' , 'long' )
80     IInitGate = Init.GetInPort( 'Gate' )
81     OInitDoLoop = Init.GetOutPort( 'DoLoop' )
82     OInitIndex = Init.GetOutPort( 'Index' )
83     OInitMin = Init.GetOutPort( 'Min' )
84     OInitMax = Init.GetOutPort( 'Max' )
85     OInitIncr = Init.GetOutPort( 'Incr' )
86     IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
87     IEndInitIndex = EndInit.GetInPort( 'Index' )
88     IEndInitMin = EndInit.GetInPort( 'Min' )
89     IEndInitMax = EndInit.GetInPort( 'Max' )
90     IEndInitIncr = EndInit.GetInPort( 'Incr' )
91     IEndInitGate = EndInit.GetInPort( 'Gate' )
92     OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
93     OEndInitIndex = EndInit.GetOutPort( 'Index' )
94     OEndInitMin = EndInit.GetOutPort( 'Min' )
95     OEndInitMax = EndInit.GetOutPort( 'Max' )
96     OEndInitIncr = EndInit.GetOutPort( 'Incr' )
97     OEndInitGate = EndInit.GetOutPort( 'Gate' )
98     Init.SetName( 'Init' )
99     Init.SetAuthor( '' )
100     Init.SetComment( 'Compute Node' )
101     Init.Coords( 17 , 257 )
102     
103     # Creation of Links
104     LInitIndexEndInitIndex = GraphLoopAddMemory.Link( OInitIndex , IEndInitIndex )
105     
106     LInitIndexAddWithoutSleepx = GraphLoopAddMemory.Link( OInitIndex , IAddWithoutSleepx )
107     
108     LInitMinEndInitMin = GraphLoopAddMemory.Link( OInitMin , IEndInitMin )
109     
110     LInitMaxEndInitMax = GraphLoopAddMemory.Link( OInitMax , IEndInitMax )
111     
112     LInitMaxAddWithoutSleepy = GraphLoopAddMemory.Link( OInitMax , IAddWithoutSleepy )
113     
114     LInitIncrEndInitIncr = GraphLoopAddMemory.Link( OInitIncr , IEndInitIncr )
115     
116     LAddWithoutSleepGateEndInitGate = GraphLoopAddMemory.Link( OAddWithoutSleepGate , IEndInitGate )
117     
118     # Input datas
119     IInitIndex.Input( 0 )
120     IInitMin.Input( 5 )
121     IInitMax.Input( 100000 )
122     IInitIncr.Input( 1 )
123     
124     # Output Ports of the graph
125     #OEndInitIndex = EndInit.GetOutPort( 'Index' )
126     #OEndInitMin = EndInit.GetOutPort( 'Min' )
127     #OEndInitMax = EndInit.GetOutPort( 'Max' )
128     #OEndInitIncr = EndInit.GetOutPort( 'Incr' )
129     #OAddWithoutSleepFuncValue = AddWithoutSleep.GetOutPort( 'FuncValue' )
130     #OAddWithoutSleepz = AddWithoutSleep.GetOutPort( 'z' )
131     return GraphLoopAddMemory
132
133
134 GraphLoopAddMemory = DefGraphLoopAddMemory()