Salome HOME
daf2626958628e3ccf3034613e62711585a79d10
[samples/datafiles.git] / Superv / Python / GraphSyrControlDefault.py
1
2 # Generated python file of Graph GraphSyrControlDefault
3
4 from SuperV import *
5
6 # Graph creation of GraphSyrControlDefault
7 def DefGraphSyrControlDefault() :
8     GraphSyrControlDefault = Graph( 'GraphSyrControlDefault' )
9     GraphSyrControlDefault.SetName( 'GraphSyrControlDefault' )
10     GraphSyrControlDefault.SetAuthor( 'JR' )
11     GraphSyrControlDefault.SetComment( 'Syracuse algorithm' )
12     GraphSyrControlDefault.Coords( 0 , 0 )
13     
14     # Creation of Factory Nodes
15     
16     test_ISEVEN = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' )
17     test_ISEVEN.SetName( 'test_ISEVEN' )
18     test_ISEVEN.SetAuthor( '' )
19     test_ISEVEN.SetContainer( 'localhost/FactoryServer' )
20     test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' )
21     test_ISEVEN.Coords( 204 , 444 )
22     Itest_ISEVENanInteger = test_ISEVEN.GetInPort( 'anInteger' )
23     Itest_ISEVENGate = test_ISEVEN.GetInPort( 'Gate' )
24     Otest_ISEVENBoolEven = test_ISEVEN.GetOutPort( 'BoolEven' )
25     Otest_ISEVENGate = test_ISEVEN.GetOutPort( 'Gate' )
26     
27     test_ISONE = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' )
28     test_ISONE.SetName( 'test_ISONE' )
29     test_ISONE.SetAuthor( '' )
30     test_ISONE.SetContainer( 'localhost/FactoryServer' )
31     test_ISONE.SetComment( 'C_ISONE from SyrComponent' )
32     test_ISONE.Coords( 201 , 52 )
33     Itest_ISONEanInteger = test_ISONE.GetInPort( 'anInteger' )
34     Itest_ISONEGate = test_ISONE.GetInPort( 'Gate' )
35     Otest_ISONEBoolOne = test_ISONE.GetOutPort( 'BoolOne' )
36     Otest_ISONEGate = test_ISONE.GetOutPort( 'Gate' )
37     
38     m3p1 = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' )
39     m3p1.SetName( 'm3p1' )
40     m3p1.SetAuthor( '' )
41     m3p1.SetContainer( 'localhost/FactoryServer' )
42     m3p1.SetComment( 'C_M3P1 from SyrComponent' )
43     m3p1.Coords( 806 , 19 )
44     Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' )
45     Im3p1Gate = m3p1.GetInPort( 'Gate' )
46     Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' )
47     Om3p1Gate = m3p1.GetOutPort( 'Gate' )
48     
49     div2 = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' )
50     div2.SetName( 'div2' )
51     div2.SetAuthor( '' )
52     div2.SetContainer( 'localhost/FactoryServer' )
53     div2.SetComment( 'C_DIV2 from SyrComponent' )
54     div2.Coords( 803 , 451 )
55     Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' )
56     Idiv2Gate = div2.GetInPort( 'Gate' )
57     Odiv2anInteger = div2.GetOutPort( 'anInteger' )
58     Odiv2Gate = div2.GetOutPort( 'Gate' )
59     
60     incr = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' )
61     incr.SetName( 'incr' )
62     incr.SetAuthor( '' )
63     incr.SetContainer( 'localhost/FactoryServer' )
64     incr.SetComment( 'C_INCR from SyrComponent' )
65     incr.Coords( 802 , 170 )
66     IincraCount = incr.GetInPort( 'aCount' )
67     IincrGate = incr.GetInPort( 'Gate' )
68     OincraNewCount = incr.GetOutPort( 'aNewCount' )
69     OincrGate = incr.GetOutPort( 'Gate' )
70     
71     # Creation of InLine Nodes
72     Pylabel_begin = []
73     Pylabel_begin.append( 'def label_begin( NB , KB ):' )
74     Pylabel_begin.append( '    print "label_begin",NB,KB' )
75     Pylabel_begin.append( '    return NB,KB' )
76     label_begin = GraphSyrControlDefault.INode( 'label_begin' , Pylabel_begin )
77     label_begin.SetName( 'label_begin' )
78     label_begin.SetAuthor( '' )
79     label_begin.SetComment( 'Python function' )
80     label_begin.Coords( 12 , 264 )
81     Ilabel_beginNB = label_begin.InPort( 'NB' , 'long' )
82     Ilabel_beginKB = label_begin.InPort( 'KB' , 'long' )
83     Ilabel_beginGate = label_begin.GetInPort( 'Gate' )
84     Olabel_beginNT = label_begin.OutPort( 'NT' , 'long' )
85     Olabel_beginKT = label_begin.OutPort( 'KT' , 'long' )
86     Olabel_beginGate = label_begin.GetOutPort( 'Gate' )
87     
88     Pylabel_test = []
89     Pylabel_test.append( 'def label_test( ValEven , ValOne , NB , KB ):' )
90     Pylabel_test.append( '    print "label_begin",ValEven,ValOne,NB,KB' )
91     Pylabel_test.append( '    return ValEven,ValOne,NB,KB' )
92     label_test = GraphSyrControlDefault.INode( 'label_test' , Pylabel_test )
93     label_test.SetName( 'label_test' )
94     label_test.SetAuthor( '' )
95     label_test.SetComment( 'Python function' )
96     label_test.Coords( 415 , 206 )
97     Ilabel_testValEven = label_test.InPort( 'ValEven' , 'long' )
98     Ilabel_testValOne = label_test.InPort( 'ValOne' , 'long' )
99     Ilabel_testNT = label_test.InPort( 'NT' , 'long' )
100     Ilabel_testKT = label_test.InPort( 'KT' , 'long' )
101     Ilabel_testGate = label_test.GetInPort( 'Gate' )
102     Olabel_testValEven = label_test.OutPort( 'ValEven' , 'long' )
103     Olabel_testValOne = label_test.OutPort( 'ValOne' , 'long' )
104     Olabel_testNT = label_test.OutPort( 'NT' , 'long' )
105     Olabel_testKT = label_test.OutPort( 'KT' , 'long' )
106     Olabel_testGate = label_test.GetOutPort( 'Gate' )
107     
108     # Creation of Switch Nodes
109     Pytest = []
110     Pytest.append( 'def Switch_OneEven( ValOne , ValEven , NT , KT ) :' )
111     Pytest.append( '    Finished = ValOne' )
112     Pytest.append( '    if Finished == 0 :' )
113     Pytest.append( '        Incr = 1' )
114     Pytest.append( '        Even = ValEven' )
115     Pytest.append( '        if Even == 0 :' )
116     Pytest.append( '            Odd = 1' )
117     Pytest.append( '        else :' )
118     Pytest.append( '            Odd = 0' )
119     Pytest.append( '    else :' )
120     Pytest.append( '        Incr = 0' )
121     Pytest.append( '        Even = 0' )
122     Pytest.append( '        Odd = 0' )
123     Pytest.append( '    Even = ValEven' )
124     Pytest.append( '    return Incr,Even,Odd,NT,KT' )
125     test,EndSwitch_OneEven = GraphSyrControlDefault.SNode( 'Switch_OneEven' , Pytest )
126     EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' )
127     EndSwitch_OneEven.SetAuthor( '' )
128     EndSwitch_OneEven.SetComment( 'Compute Node' )
129     EndSwitch_OneEven.Coords( 1074 , 367 )
130     PyEndSwitch_OneEven = []
131     EndSwitch_OneEven.SetPyFunction( '' , PyEndSwitch_OneEven )
132     IEndSwitch_OneEvenK = EndSwitch_OneEven.InPort( 'K' , 'long' )
133     IEndSwitch_OneEvenDefault = EndSwitch_OneEven.GetInPort( 'Default' )
134     OEndSwitch_OneEvenK = EndSwitch_OneEven.OutPort( 'K' , 'long' )
135     OEndSwitch_OneEvenGate = EndSwitch_OneEven.GetOutPort( 'Gate' )
136     test.SetName( 'test' )
137     test.SetAuthor( '' )
138     test.SetComment( 'Compute Node' )
139     test.Coords( 597 , 251 )
140     ItestValOne = test.InPort( 'ValOne' , 'long' )
141     ItestValEven = test.InPort( 'ValEven' , 'long' )
142     ItestNT = test.InPort( 'NT' , 'long' )
143     ItestKT = test.InPort( 'KT' , 'long' )
144     ItestGate = test.GetInPort( 'Gate' )
145     OtestIncr = test.OutPort( 'Incr' , 'long' )
146     OtestEven = test.OutPort( 'Even' , 'long' )
147     OtestOdd = test.OutPort( 'Odd' , 'long' )
148     OtestN = test.OutPort( 'N' , 'long' )
149     OtestK = test.OutPort( 'K' , 'long' )
150     OtestDefault = test.GetOutPort( 'Default' )
151     
152     # Creation of GOTO Nodes
153     Pycontrol_m3p1 = []
154     Pycontrol_m3p1.append( 'def control_m3p1( N , K ):' )
155     Pycontrol_m3p1.append( '    return 0,1,N,K' )
156     control_m3p1 = GraphSyrControlDefault.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' )
157     control_m3p1.SetName( 'control_m3p1' )
158     control_m3p1.SetAuthor( '' )
159     control_m3p1.SetComment( 'Compute Node' )
160     control_m3p1.Coords( 1002 , 64 )
161     Icontrol_m3p1N = control_m3p1.InPort( 'N' , 'long' )
162     Icontrol_m3p1K = control_m3p1.InPort( 'K' , 'long' )
163     Icontrol_m3p1Gate = control_m3p1.GetInPort( 'Gate' )
164     Ocontrol_m3p1ValOne = control_m3p1.OutPort( 'ValOne' , 'long' )
165     Ocontrol_m3p1ValEven = control_m3p1.OutPort( 'ValEven' , 'long' )
166     Ocontrol_m3p1NT = control_m3p1.OutPort( 'NT' , 'long' )
167     Ocontrol_m3p1KT = control_m3p1.OutPort( 'KT' , 'long' )
168     Ocontrol_m3p1Gate = control_m3p1.GetOutPort( 'Gate' )
169     
170     Pycontrol_div2 = []
171     Pycontrol_div2.append( 'def control_div2( N , NB ) :' )
172     Pycontrol_div2.append( '    return N,NB' )
173     control_div2 = GraphSyrControlDefault.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' )
174     control_div2.SetName( 'control_div2' )
175     control_div2.SetAuthor( '' )
176     control_div2.SetComment( 'Compute Node' )
177     control_div2.Coords( 1013 , 496 )
178     Icontrol_div2N = control_div2.InPort( 'N' , 'long' )
179     Icontrol_div2K = control_div2.InPort( 'K' , 'long' )
180     Icontrol_div2Gate = control_div2.GetInPort( 'Gate' )
181     Ocontrol_div2NB = control_div2.OutPort( 'NB' , 'long' )
182     Ocontrol_div2KB = control_div2.OutPort( 'KB' , 'long' )
183     Ocontrol_div2Gate = control_div2.GetOutPort( 'Gate' )
184     
185     # Creation of Links
186     Ltest_ISEVENBoolEvenlabel_testValEven = GraphSyrControlDefault.Link( Otest_ISEVENBoolEven , Ilabel_testValEven )
187     Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 381 , 286 )
188     Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 382 , 524 )
189     
190     Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControlDefault.Link( Otest_ISONEBoolOne , Ilabel_testValOne )
191     Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 393 , 314 )
192     Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 393 , 133 )
193     
194     Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControlDefault.Link( Om3p1anEvenInteger , Icontrol_m3p1N )
195     
196     Ldiv2anIntegercontrol_div2N = GraphSyrControlDefault.Link( Odiv2anInteger , Icontrol_div2N )
197     
198     LincraNewCountcontrol_m3p1K = GraphSyrControlDefault.Link( OincraNewCount , Icontrol_m3p1K )
199     LincraNewCountcontrol_m3p1K.AddCoord( 1 , 985 , 128 )
200     LincraNewCountcontrol_m3p1K.AddCoord( 2 , 985 , 250 )
201     
202     LincraNewCountcontrol_div2K = GraphSyrControlDefault.Link( OincraNewCount , Icontrol_div2K )
203     LincraNewCountcontrol_div2K.AddCoord( 1 , 987 , 559 )
204     LincraNewCountcontrol_div2K.AddCoord( 2 , 985 , 250 )
205     
206     Llabel_beginNTlabel_testNT = GraphSyrControlDefault.Link( Olabel_beginNT , Ilabel_testNT )
207     
208     Llabel_beginNTtest_ISEVENanInteger = GraphSyrControlDefault.Link( Olabel_beginNT , Itest_ISEVENanInteger )
209     Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 191 , 524 )
210     Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 192 , 345 )
211     
212     Llabel_beginNTtest_ISONEanInteger = GraphSyrControlDefault.Link( Olabel_beginNT , Itest_ISONEanInteger )
213     Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 192 , 131 )
214     Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 193 , 345 )
215     
216     Llabel_beginKTlabel_testKT = GraphSyrControlDefault.Link( Olabel_beginKT , Ilabel_testKT )
217     
218     Llabel_testValEventestValEven = GraphSyrControlDefault.Link( Olabel_testValEven , ItestValEven )
219     
220     Llabel_testValOnetestValOne = GraphSyrControlDefault.Link( Olabel_testValOne , ItestValOne )
221     
222     Llabel_testNTtestNT = GraphSyrControlDefault.Link( Olabel_testNT , ItestNT )
223     
224     Llabel_testKTtestKT = GraphSyrControlDefault.Link( Olabel_testKT , ItestKT )
225     
226     LtestEvendiv2Gate = GraphSyrControlDefault.Link( OtestEven , Idiv2Gate )
227     LtestEvendiv2Gate.AddCoord( 1 , 793 , 567 )
228     LtestEvendiv2Gate.AddCoord( 2 , 792 , 314 )
229     
230     LtestOddm3p1Gate = GraphSyrControlDefault.Link( OtestOdd , Im3p1Gate )
231     LtestOddm3p1Gate.AddCoord( 1 , 786 , 132 )
232     LtestOddm3p1Gate.AddCoord( 2 , 785 , 343 )
233     
234     LtestNm3p1anOddInteger = GraphSyrControlDefault.Link( OtestN , Im3p1anOddInteger )
235     LtestNm3p1anOddInteger.AddCoord( 1 , 767 , 100 )
236     LtestNm3p1anOddInteger.AddCoord( 2 , 767 , 371 )
237     
238     LtestNdiv2anEvenInteger = GraphSyrControlDefault.Link( OtestN , Idiv2anEvenInteger )
239     LtestNdiv2anEvenInteger.AddCoord( 1 , 768 , 531 )
240     LtestNdiv2anEvenInteger.AddCoord( 2 , 767 , 371 )
241     
242     LtestKEndSwitch_OneEvenK = GraphSyrControlDefault.Link( OtestK , IEndSwitch_OneEvenK )
243     
244     LtestKincraCount = GraphSyrControlDefault.Link( OtestK , IincraCount )
245     LtestKincraCount.AddCoord( 1 , 773 , 251 )
246     LtestKincraCount.AddCoord( 2 , 774 , 400 )
247     
248     LtestDefaultEndSwitch_OneEvenDefault = GraphSyrControlDefault.Link( OtestDefault , IEndSwitch_OneEvenDefault )
249     
250     Lcontrol_m3p1Gatelabel_testGate = GraphSyrControlDefault.Link( Ocontrol_m3p1Gate , Ilabel_testGate )
251     Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 402 , 406 )
252     Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 403 , 4 )
253     Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1174 , 5 )
254     Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1175 , 219 )
255     
256     Lcontrol_div2Gatelabel_beginGate = GraphSyrControlDefault.Link( Ocontrol_div2Gate , Ilabel_beginGate )
257     Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 3 , 409 )
258     Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 2 , 671 )
259     Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1199 , 670 )
260     Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1198 , 592 )
261     
262     # Input datas
263     Ilabel_beginNB.Input( 7 )
264     Ilabel_beginKB.Input( 0 )
265     
266     # Output Ports of the graph
267     #OtestIncr = test.GetOutPort( 'Incr' )
268     #OEndSwitch_OneEvenK = EndSwitch_OneEven.GetOutPort( 'K' )
269     return GraphSyrControlDefault
270
271
272 GraphSyrControlDefault = DefGraphSyrControlDefault()