Salome HOME
fd493c0a37efcca47d1ecc3a6c72806deb28924e
[samples/datafiles.git] / Superv / Python / GraphSyrControlGUI.py
1
2 # Generated python file of Graph GraphSyrControlGUI_2
3
4 from SuperV import *
5
6 # Graph creation of GraphSyrControlGUI_2
7 def DefGraphSyrControlGUI_2() :
8     GraphSyrControlGUI_2 = Graph( 'GraphSyrControlGUI_2' )
9     GraphSyrControlGUI_2.SetName( 'GraphSyrControlGUI_2' )
10     GraphSyrControlGUI_2.SetAuthor( 'JR' )
11     GraphSyrControlGUI_2.SetComment( 'Syracuse algorithm' )
12     GraphSyrControlGUI_2.Coords( 0 , 0 )
13     
14     # Creation of Factory Nodes
15     
16     test_ISEVEN = GraphSyrControlGUI_2.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( 288 , 337 )
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 = GraphSyrControlGUI_2.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( 293 , 130 )
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 = GraphSyrControlGUI_2.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( 761 , 19 )
44     Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' )
45     Im3p1Gate = m3p1.GetInPort( 'Gate' )
46     Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' )
47     Om3p1Gate = m3p1.GetOutPort( 'Gate' )
48     
49     div2 = GraphSyrControlGUI_2.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( 770 , 384 )
55     Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' )
56     Idiv2Gate = div2.GetInPort( 'Gate' )
57     Odiv2anInteger = div2.GetOutPort( 'anInteger' )
58     Odiv2Gate = div2.GetOutPort( 'Gate' )
59     
60     incr = GraphSyrControlGUI_2.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( 764 , 179 )
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( '    return NB,KB' )
75     label_begin = GraphSyrControlGUI_2.INode( 'label_begin' , Pylabel_begin )
76     label_begin.SetName( 'label_begin' )
77     label_begin.SetAuthor( '' )
78     label_begin.SetComment( 'Python function' )
79     label_begin.Coords( 58 , 189 )
80     Ilabel_beginNB = label_begin.InPort( 'NB' , 'long' )
81     Ilabel_beginKB = label_begin.InPort( 'KB' , 'long' )
82     Ilabel_beginGate = label_begin.GetInPort( 'Gate' )
83     Olabel_beginNT = label_begin.OutPort( 'NT' , 'long' )
84     Olabel_beginKT = label_begin.OutPort( 'KT' , 'long' )
85     Olabel_beginGate = label_begin.GetOutPort( 'Gate' )
86     
87     # Creation of Switch Nodes
88     Pylabel_test = []
89     Pylabel_test.append( 'def L_OneEven( ValOne , ValEven , NT , KT ):' )
90     Pylabel_test.append( '    Finished = ValOne' )
91     Pylabel_test.append( '    if Finished == 0 :' )
92     Pylabel_test.append( '        Incr = 1' )
93     Pylabel_test.append( '        Even = ValEven' )
94     Pylabel_test.append( '        if Even == 0 :' )
95     Pylabel_test.append( '            Odd = 1' )
96     Pylabel_test.append( '        else :' )
97     Pylabel_test.append( '            Odd = 0' )
98     Pylabel_test.append( '    else :' )
99     Pylabel_test.append( '        Incr = 0' )
100     Pylabel_test.append( '        Even = 0' )
101     Pylabel_test.append( '        Odd = 0' )
102     Pylabel_test.append( '    Even = ValEven' )
103     Pylabel_test.append( '    return Finished,Incr,Even,Odd,NT,KT' )
104     label_test,EndL_OneEven = GraphSyrControlGUI_2.SNode( 'L_OneEven' , Pylabel_test )
105     EndL_OneEven.SetName( 'EndL_OneEven' )
106     EndL_OneEven.SetAuthor( '' )
107     EndL_OneEven.SetComment( 'Compute Node' )
108     EndL_OneEven.Coords( 1068 , 258 )
109     PyEndL_OneEven = []
110     EndL_OneEven.SetPyFunction( '' , PyEndL_OneEven )
111     IEndL_OneEvenDefault = EndL_OneEven.GetInPort( 'Default' )
112     OEndL_OneEvenGate = EndL_OneEven.GetOutPort( 'Gate' )
113     label_test.SetName( 'label_test' )
114     label_test.SetAuthor( '' )
115     label_test.SetComment( 'Compute Node' )
116     label_test.Coords( 516 , 175 )
117     Ilabel_testValOne = label_test.InPort( 'ValOne' , 'long' )
118     Ilabel_testValEven = label_test.InPort( 'ValEven' , 'long' )
119     Ilabel_testNT = label_test.InPort( 'NT' , 'long' )
120     Ilabel_testKT = label_test.InPort( 'KT' , 'long' )
121     Ilabel_testGate = label_test.GetInPort( 'Gate' )
122     Olabel_testFinished = label_test.OutPort( 'Finished' , 'long' )
123     Olabel_testIncr = label_test.OutPort( 'Incr' , 'long' )
124     Olabel_testEven = label_test.OutPort( 'Even' , 'long' )
125     Olabel_testOdd = label_test.OutPort( 'Odd' , 'long' )
126     Olabel_testN = label_test.OutPort( 'N' , 'long' )
127     Olabel_testK = label_test.OutPort( 'K' , 'long' )
128     Olabel_testDefault = label_test.GetOutPort( 'Default' )
129     
130     # Creation of GOTO Nodes
131     Pycontrol_m3p1 = []
132     Pycontrol_m3p1.append( 'def C_NotOneIsEven( N , K ):' )
133     Pycontrol_m3p1.append( '    return 0,1,N,K' )
134     control_m3p1 = GraphSyrControlGUI_2.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' )
135     control_m3p1.SetName( 'control_m3p1' )
136     control_m3p1.SetAuthor( '' )
137     control_m3p1.SetComment( 'Compute Node' )
138     control_m3p1.Coords( 972 , 64 )
139     Icontrol_m3p1N = control_m3p1.InPort( 'N' , 'long' )
140     Icontrol_m3p1K = control_m3p1.InPort( 'K' , 'long' )
141     Icontrol_m3p1Gate = control_m3p1.GetInPort( 'Gate' )
142     Ocontrol_m3p1ValOne = control_m3p1.OutPort( 'ValOne' , 'long' )
143     Ocontrol_m3p1ValEven = control_m3p1.OutPort( 'ValEven' , 'long' )
144     Ocontrol_m3p1NT = control_m3p1.OutPort( 'NT' , 'long' )
145     Ocontrol_m3p1KT = control_m3p1.OutPort( 'KT' , 'long' )
146     Ocontrol_m3p1Gate = control_m3p1.GetOutPort( 'Gate' )
147     
148     Pycontrol_div2 = []
149     Pycontrol_div2.append( 'def control_div2( N , K ) :' )
150     Pycontrol_div2.append( '    return N,K' )
151     control_div2 = GraphSyrControlGUI_2.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' )
152     control_div2.SetName( 'control_div2' )
153     control_div2.SetAuthor( '' )
154     control_div2.SetComment( 'Compute Node' )
155     control_div2.Coords( 972 , 430 )
156     Icontrol_div2N = control_div2.InPort( 'N' , 'long' )
157     Icontrol_div2K = control_div2.InPort( 'K' , 'long' )
158     Icontrol_div2Gate = control_div2.GetInPort( 'Gate' )
159     Ocontrol_div2NB = control_div2.OutPort( 'NB' , 'long' )
160     Ocontrol_div2KB = control_div2.OutPort( 'KB' , 'long' )
161     Ocontrol_div2Gate = control_div2.GetOutPort( 'Gate' )
162     
163     # Creation of Links
164     Ltest_ISEVENBoolEvenlabel_testValEven = GraphSyrControlGUI_2.Link( Otest_ISEVENBoolEven , Ilabel_testValEven )
165     Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 493 , 238 )
166     Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 493 , 418 )
167     
168     Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControlGUI_2.Link( Otest_ISONEBoolOne , Ilabel_testValOne )
169     
170     Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControlGUI_2.Link( Om3p1anEvenInteger , Icontrol_m3p1N )
171     
172     Ldiv2anIntegercontrol_div2N = GraphSyrControlGUI_2.Link( Odiv2anInteger , Icontrol_div2N )
173     
174     LincraNewCountcontrol_div2K = GraphSyrControlGUI_2.Link( OincraNewCount , Icontrol_div2K )
175     LincraNewCountcontrol_div2K.AddCoord( 1 , 954 , 494 )
176     LincraNewCountcontrol_div2K.AddCoord( 2 , 954 , 259 )
177     
178     LincraNewCountcontrol_m3p1K = GraphSyrControlGUI_2.Link( OincraNewCount , Icontrol_m3p1K )
179     LincraNewCountcontrol_m3p1K.AddCoord( 1 , 955 , 128 )
180     LincraNewCountcontrol_m3p1K.AddCoord( 2 , 954 , 258 )
181     
182     Llabel_beginNTtest_ISONEanInteger = GraphSyrControlGUI_2.Link( Olabel_beginNT , Itest_ISONEanInteger )
183     Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 275 , 211 )
184     Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 275 , 270 )
185     
186     Llabel_beginNTlabel_testNT = GraphSyrControlGUI_2.Link( Olabel_beginNT , Ilabel_testNT )
187     
188     Llabel_beginNTtest_ISEVENanInteger = GraphSyrControlGUI_2.Link( Olabel_beginNT , Itest_ISEVENanInteger )
189     Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 274 , 417 )
190     Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 275 , 270 )
191     
192     Llabel_beginKTlabel_testKT = GraphSyrControlGUI_2.Link( Olabel_beginKT , Ilabel_testKT )
193     Llabel_beginKTlabel_testKT.AddCoord( 1 , 476 , 294 )
194     Llabel_beginKTlabel_testKT.AddCoord( 2 , 475 , 515 )
195     Llabel_beginKTlabel_testKT.AddCoord( 3 , 260 , 515 )
196     Llabel_beginKTlabel_testKT.AddCoord( 4 , 260 , 298 )
197     
198     Llabel_testEvendiv2Gate = GraphSyrControlGUI_2.Link( Olabel_testEven , Idiv2Gate )
199     Llabel_testEvendiv2Gate.AddCoord( 1 , 724 , 498 )
200     Llabel_testEvendiv2Gate.AddCoord( 2 , 723 , 268 )
201     
202     Llabel_testOddm3p1Gate = GraphSyrControlGUI_2.Link( Olabel_testOdd , Im3p1Gate )
203     Llabel_testOddm3p1Gate.AddCoord( 1 , 698 , 132 )
204     Llabel_testOddm3p1Gate.AddCoord( 2 , 697 , 297 )
205     
206     Llabel_testNm3p1anOddInteger = GraphSyrControlGUI_2.Link( Olabel_testN , Im3p1anOddInteger )
207     Llabel_testNm3p1anOddInteger.AddCoord( 1 , 748 , 100 )
208     Llabel_testNm3p1anOddInteger.AddCoord( 2 , 747 , 325 )
209     
210     Llabel_testNdiv2anEvenInteger = GraphSyrControlGUI_2.Link( Olabel_testN , Idiv2anEvenInteger )
211     Llabel_testNdiv2anEvenInteger.AddCoord( 1 , 746 , 463 )
212     Llabel_testNdiv2anEvenInteger.AddCoord( 2 , 747 , 327 )
213     
214     Llabel_testKincraCount = GraphSyrControlGUI_2.Link( Olabel_testK , IincraCount )
215     Llabel_testKincraCount.AddCoord( 1 , 732 , 260 )
216     Llabel_testKincraCount.AddCoord( 2 , 732 , 354 )
217     
218     Llabel_testDefaultEndL_OneEvenDefault = GraphSyrControlGUI_2.Link( Olabel_testDefault , IEndL_OneEvenDefault )
219     
220     Lcontrol_m3p1Gatelabel_testGate = GraphSyrControlGUI_2.Link( Ocontrol_m3p1Gate , Ilabel_testGate )
221     Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 503 , 388 )
222     Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 505 , 5 )
223     Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1149 , 5 )
224     Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1150 , 219 )
225     
226     Lcontrol_div2Gatelabel_beginGate = GraphSyrControlGUI_2.Link( Ocontrol_div2Gate , Ilabel_beginGate )
227     Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 34 , 332 )
228     Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 34 , 592 )
229     Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1145 , 586 )
230     Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1144 , 527 )
231     
232     # Input datas
233     Ilabel_beginNB.Input( 7 )
234     Ilabel_beginKB.Input( 0 )
235     
236     # Output Ports of the graph
237     #Olabel_testFinished = label_test.GetOutPort( 'Finished' )
238     #Olabel_testIncr = label_test.GetOutPort( 'Incr' )
239     return GraphSyrControlGUI_2
240
241
242 GraphSyrControlGUI_2 = DefGraphSyrControlGUI_2()