Salome HOME
Imported using TkCVS
[samples/datafiles.git] / Superv / Python / GraphLoopAddMemory.py
1
2 # Generated python file of Graph GraphLoopAddMemory
3
4 from SuperV import *
5
6 # Graph creation of GraphLoopAddMemory
7 def DefGraphLoopAddMemory() :
8     GraphLoopAddMemory = Graph( 'GraphLoopAddMemory' )
9     GraphLoopAddMemory.SetName( 'GraphLoopAddMemory' )
10     GraphLoopAddMemory.SetAuthor( 'JR' )
11     GraphLoopAddMemory.SetComment( 'For solving of memory leaks' )
12     GraphLoopAddMemory.Coords( 0 , 0 )
13     
14     # Creation of Factory Nodes
15     
16     AddWithoutSleep = GraphLoopAddMemory.FNode( 'AddComponent' , 'AddComponent' , 'AddWithoutSleep' )
17     AddWithoutSleep.SetName( 'AddWithoutSleep' )
18     AddWithoutSleep.SetAuthor( '' )
19     AddWithoutSleep.SetContainer( 'localhost/FactoryServer' )
20     AddWithoutSleep.SetComment( 'AddWithoutSleep from AddComponent' )
21     AddWithoutSleep.Coords( 246 , 262 )
22     IAddWithoutSleepx = AddWithoutSleep.GetInPort( 'x' )
23     IAddWithoutSleepy = AddWithoutSleep.GetInPort( 'y' )
24     IAddWithoutSleepGate = AddWithoutSleep.GetInPort( 'Gate' )
25     OAddWithoutSleepFuncValue = AddWithoutSleep.GetOutPort( 'FuncValue' )
26     OAddWithoutSleepz = AddWithoutSleep.GetOutPort( 'z' )
27     OAddWithoutSleepGate = AddWithoutSleep.GetOutPort( 'Gate' )
28     
29     # Creation of Loop Nodes
30     PyInit = []
31     PyInit.append( 'def Init(Index,Min,Max,Incr) :    ' )
32     PyInit.append( '    if Min <= Max :    ' )
33     PyInit.append( '        Index = Min    ' )
34     PyInit.append( '    else :    ' )
35     PyInit.append( '        Index = Max    ' )
36     PyInit.append( '    return Index,Min,Max,Incr    ' )
37     PyMoreInit = []
38     PyMoreInit.append( 'def More(Index,Min,Max,Incr) :    ' )
39     PyMoreInit.append( '    if Index < Max :    ' )
40     PyMoreInit.append( '        DoLoop = 1    ' )
41     PyMoreInit.append( '    else :    ' )
42     PyMoreInit.append( '        DoLoop = 0    ' )
43     PyMoreInit.append( '    return DoLoop,Index,Min,Max,Incr    ' )
44     PyNextInit = []
45     PyNextInit.append( 'def Next(Index,Min,Max,Incr) :    ' )
46     PyNextInit.append( '    Index = Index + Incr    ' )
47     PyNextInit.append( '    return Index,Min,Max,Incr   ' )
48     Init,EndInit = GraphLoopAddMemory.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
49     EndInit.SetName( 'EndInit' )
50     EndInit.SetAuthor( '' )
51     EndInit.SetComment( 'Compute Node' )
52     EndInit.Coords( 495 , 262 )
53     PyEndInit = []
54     EndInit.SetPyFunction( '' , PyEndInit )
55     IInitDoLoop = Init.GetInPort( 'DoLoop' )
56     IInitIndex = Init.InPort( 'Index' , 'long' )
57     IInitMin = Init.InPort( 'Min' , 'long' )
58     IInitMax = Init.InPort( 'Max' , 'long' )
59     IInitIncr = Init.InPort( 'Incr' , 'long' )
60     IInitGate = Init.GetInPort( 'Gate' )
61     OInitDoLoop = Init.GetOutPort( 'DoLoop' )
62     OInitIndex = Init.GetOutPort( 'Index' )
63     OInitMin = Init.GetOutPort( 'Min' )
64     OInitMax = Init.GetOutPort( 'Max' )
65     OInitIncr = Init.GetOutPort( 'Incr' )
66     IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
67     IEndInitIndex = EndInit.GetInPort( 'Index' )
68     IEndInitMin = EndInit.GetInPort( 'Min' )
69     IEndInitMax = EndInit.GetInPort( 'Max' )
70     IEndInitIncr = EndInit.GetInPort( 'Incr' )
71     IEndInitGate = EndInit.GetInPort( 'Gate' )
72     OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
73     OEndInitIndex = EndInit.GetOutPort( 'Index' )
74     OEndInitMin = EndInit.GetOutPort( 'Min' )
75     OEndInitMax = EndInit.GetOutPort( 'Max' )
76     OEndInitIncr = EndInit.GetOutPort( 'Incr' )
77     OEndInitGate = EndInit.GetOutPort( 'Gate' )
78     Init.SetName( 'Init' )
79     Init.SetAuthor( '' )
80     Init.SetComment( 'Compute Node' )
81     Init.Coords( 17 , 257 )
82     
83     # Creation of Links
84     LInitIndexEndInitIndex = GraphLoopAddMemory.Link( OInitIndex , IEndInitIndex )
85     
86     LInitIndexAddWithoutSleepx = GraphLoopAddMemory.Link( OInitIndex , IAddWithoutSleepx )
87     
88     LInitMinEndInitMin = GraphLoopAddMemory.Link( OInitMin , IEndInitMin )
89     
90     LInitMaxEndInitMax = GraphLoopAddMemory.Link( OInitMax , IEndInitMax )
91     
92     LInitMaxAddWithoutSleepy = GraphLoopAddMemory.Link( OInitMax , IAddWithoutSleepy )
93     
94     LInitIncrEndInitIncr = GraphLoopAddMemory.Link( OInitIncr , IEndInitIncr )
95     
96     LAddWithoutSleepGateEndInitGate = GraphLoopAddMemory.Link( OAddWithoutSleepGate , IEndInitGate )
97     
98     # Input datas
99     IInitIndex.Input( 0 )
100     IInitMin.Input( 5 )
101     IInitMax.Input( 100000 )
102     IInitIncr.Input( 1 )
103     
104     # Output Ports of the graph
105     #OEndInitIndex = EndInit.GetOutPort( 'Index' )
106     #OEndInitMin = EndInit.GetOutPort( 'Min' )
107     #OEndInitMax = EndInit.GetOutPort( 'Max' )
108     #OEndInitIncr = EndInit.GetOutPort( 'Incr' )
109     #OAddWithoutSleepFuncValue = AddWithoutSleep.GetOutPort( 'FuncValue' )
110     #OAddWithoutSleepz = AddWithoutSleep.GetOutPort( 'z' )
111     return GraphLoopAddMemory
112
113
114 GraphLoopAddMemory = DefGraphLoopAddMemory()