Salome HOME
Imported using TkCVS
[samples/datafiles.git] / Superv / Python / GraphTwoLoops1.py
1
2 # Generated python file of Graph GraphTwoLoops1
3
4 from SuperV import *
5
6 # Graph creation of GraphTwoLoops1
7 def DefGraphTwoLoops1() :
8     GraphTwoLoops1 = Graph( 'GraphTwoLoops1' )
9     GraphTwoLoops1.SetName( 'GraphTwoLoops1' )
10     GraphTwoLoops1.SetAuthor( 'JR' )
11     GraphTwoLoops1.SetComment( '' )
12     GraphTwoLoops1.Coords( 0 , 0 )
13     
14     # Creation of Factory Nodes
15     
16     # Creation of Loop Nodes
17     PyLoop1 = []
18     PyLoop1.append( 'def Loop1(Index,Max) :      ' )
19     PyLoop1.append( '   return Index,Max        ' )
20     PyLoop1.append( '' )
21     PyMoreLoop1 = []
22     PyMoreLoop1.append( 'import time  ' )
23     PyMoreLoop1.append( 'def More(Index,Max) :   ' )
24     PyMoreLoop1.append( '       time.sleep(2)  ' )
25     PyMoreLoop1.append( '       DoLoop = 0       ' )
26     PyMoreLoop1.append( '       if Index < Max :       ' )
27     PyMoreLoop1.append( '               DoLoop = 1       ' )
28     PyMoreLoop1.append( '       return DoLoop,Index,Max       ' )
29     PyMoreLoop1.append( '' )
30     PyNextLoop1 = []
31     PyNextLoop1.append( 'def Next(Index,Max) :       ' )
32     PyNextLoop1.append( '       Index = Index + 1       ' )
33     PyNextLoop1.append( '       return Index,Max       ' )
34     PyNextLoop1.append( '' )
35     Loop1,EndLoop1 = GraphTwoLoops1.LNode( 'Loop1' , PyLoop1 , 'More' , PyMoreLoop1 , 'Next' , PyNextLoop1 )
36     EndLoop1.SetName( 'EndLoop1' )
37     EndLoop1.SetAuthor( '' )
38     EndLoop1.SetComment( 'Compute Node' )
39     EndLoop1.Coords( 634 , 177 )
40     PyEndLoop1 = []
41     EndLoop1.SetPyFunction( 'EndLoop1' , PyEndLoop1 )
42     ILoop1DoLoop = Loop1.GetInPort( 'DoLoop' )
43     ILoop1Index = Loop1.InPort( 'Index' , 'long' )
44     ILoop1Max = Loop1.InPort( 'Max' , 'long' )
45     ILoop1Gate = Loop1.GetInPort( 'Gate' )
46     OLoop1DoLoop = Loop1.GetOutPort( 'DoLoop' )
47     OLoop1Index = Loop1.GetOutPort( 'Index' )
48     OLoop1Max = Loop1.GetOutPort( 'Max' )
49     IEndLoop1DoLoop = EndLoop1.GetInPort( 'DoLoop' )
50     IEndLoop1Index = EndLoop1.GetInPort( 'Index' )
51     IEndLoop1Max = EndLoop1.GetInPort( 'Max' )
52     IEndLoop1Gate = EndLoop1.GetInPort( 'Gate' )
53     OEndLoop1DoLoop = EndLoop1.GetOutPort( 'DoLoop' )
54     OEndLoop1Index = EndLoop1.GetOutPort( 'Index' )
55     OEndLoop1Max = EndLoop1.GetOutPort( 'Max' )
56     OEndLoop1Gate = EndLoop1.GetOutPort( 'Gate' )
57     Loop1.SetName( 'Loop1' )
58     Loop1.SetAuthor( '' )
59     Loop1.SetComment( 'Compute Node' )
60     Loop1.Coords( 7 , 175 )
61     
62     PyLoop = []
63     PyMoreLoop = []
64     PyMoreLoop.append( '' )
65     PyNextLoop = []
66     PyNextLoop.append( 'def Next(Index,Max) : ' )
67     PyNextLoop.append( '        Index = Index + 1 ' )
68     PyNextLoop.append( '        return Index,Max ' )
69     PyNextLoop.append( '' )
70     Loop,EndLoop = GraphTwoLoops1.LNode( '' , PyLoop , '' , PyMoreLoop , 'Next' , PyNextLoop )
71     EndLoop.SetName( 'EndLoop' )
72     EndLoop.SetAuthor( '' )
73     EndLoop.SetComment( 'Compute Node' )
74     EndLoop.Coords( 426 , 180 )
75     PyEndLoop = []
76     PyEndLoop.append( 'import time ' )
77     PyEndLoop.append( 'def EndLoop(DoLoop,Index,Max) :  ' )
78     PyEndLoop.append( ' time.sleep(1) ' )
79     PyEndLoop.append( ' DoLoop = 0  ' )
80     PyEndLoop.append( ' if Index < Max :  ' )
81     PyEndLoop.append( '         DoLoop = 1  ' )
82     PyEndLoop.append( ' return DoLoop,Index,Max  ' )
83     PyEndLoop.append( '' )
84     EndLoop.SetPyFunction( 'EndLoop' , PyEndLoop )
85     ILoopDoLoop = Loop.GetInPort( 'DoLoop' )
86     ILoopIndex = Loop.InPort( 'Index' , 'long' )
87     ILoopMax = Loop.InPort( 'Max' , 'long' )
88     ILoopGate = Loop.GetInPort( 'Gate' )
89     OLoopDoLoop = Loop.GetOutPort( 'DoLoop' )
90     OLoopIndex = Loop.GetOutPort( 'Index' )
91     OLoopMax = Loop.GetOutPort( 'Max' )
92     IEndLoopDoLoop = EndLoop.GetInPort( 'DoLoop' )
93     IEndLoopIndex = EndLoop.GetInPort( 'Index' )
94     IEndLoopMax = EndLoop.GetInPort( 'Max' )
95     IEndLoopGate = EndLoop.GetInPort( 'Gate' )
96     OEndLoopDoLoop = EndLoop.GetOutPort( 'DoLoop' )
97     OEndLoopIndex = EndLoop.GetOutPort( 'Index' )
98     OEndLoopMax = EndLoop.GetOutPort( 'Max' )
99     OEndLoopGate = EndLoop.GetOutPort( 'Gate' )
100     Loop.SetName( 'Loop' )
101     Loop.SetAuthor( '' )
102     Loop.SetComment( 'Compute Node' )
103     Loop.Coords( 208 , 179 )
104     
105     # Creation of Links
106     LLoop1IndexEndLoop1Index = GraphTwoLoops1.Link( OLoop1Index , IEndLoop1Index )
107     
108     LLoop1IndexLoopIndex = GraphTwoLoops1.Link( OLoop1Index , ILoopIndex )
109     
110     LLoop1MaxEndLoop1Max = GraphTwoLoops1.Link( OLoop1Max , IEndLoop1Max )
111     
112     LLoop1GateLoopGate = GraphTwoLoops1.Link( OLoop1Gate , ILoopGate )
113     
114     LLoopIndexEndLoopIndex = GraphTwoLoops1.Link( OLoopIndex , IEndLoopIndex )
115     
116     LLoopMaxEndLoopMax = GraphTwoLoops1.Link( OLoopMax , IEndLoopMax )
117     
118     LEndLoopGateEndLoop1Gate = GraphTwoLoops1.Link( OEndLoopGate , IEndLoop1Gate )
119     
120     # Input datas
121     ILoop1Index.Input( 5 )
122     ILoop1Max.Input( 15 )
123     ILoopMax.Input( 20 )
124     
125     # Output Ports of the graph
126     #OEndLoop1Index = EndLoop1.GetOutPort( 'Index' )
127     #OEndLoop1Max = EndLoop1.GetOutPort( 'Max' )
128     #OEndLoopIndex = EndLoop.GetOutPort( 'Index' )
129     #OEndLoopMax = EndLoop.GetOutPort( 'Max' )
130     return GraphTwoLoops1
131
132
133 GraphTwoLoops1 = DefGraphTwoLoops1()