Salome HOME
4891af551aaf238285b4d2db0bcf823be472050e
[samples/datafiles.git] / Superv / Python / GraphSyrControlGUI.py
1 #  Copyright (C) 2007-2011  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 GraphSyrControlGUI_2
23 #
24 from SuperV import *
25
26 # Graph creation of GraphSyrControlGUI_2
27 def DefGraphSyrControlGUI_2() :
28     GraphSyrControlGUI_2 = Graph( 'GraphSyrControlGUI_2' )
29     GraphSyrControlGUI_2.SetName( 'GraphSyrControlGUI_2' )
30     GraphSyrControlGUI_2.SetAuthor( 'JR' )
31     GraphSyrControlGUI_2.SetComment( 'Syracuse algorithm' )
32     GraphSyrControlGUI_2.Coords( 0 , 0 )
33     
34     # Creation of Factory Nodes
35     
36     test_ISEVEN = GraphSyrControlGUI_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' )
37     test_ISEVEN.SetName( 'test_ISEVEN' )
38     test_ISEVEN.SetAuthor( '' )
39     test_ISEVEN.SetContainer( 'localhost/FactoryServer' )
40     test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' )
41     test_ISEVEN.Coords( 288 , 337 )
42     Itest_ISEVENanInteger = test_ISEVEN.GetInPort( 'anInteger' )
43     Itest_ISEVENGate = test_ISEVEN.GetInPort( 'Gate' )
44     Otest_ISEVENBoolEven = test_ISEVEN.GetOutPort( 'BoolEven' )
45     Otest_ISEVENGate = test_ISEVEN.GetOutPort( 'Gate' )
46     
47     test_ISONE = GraphSyrControlGUI_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' )
48     test_ISONE.SetName( 'test_ISONE' )
49     test_ISONE.SetAuthor( '' )
50     test_ISONE.SetContainer( 'localhost/FactoryServer' )
51     test_ISONE.SetComment( 'C_ISONE from SyrComponent' )
52     test_ISONE.Coords( 293 , 130 )
53     Itest_ISONEanInteger = test_ISONE.GetInPort( 'anInteger' )
54     Itest_ISONEGate = test_ISONE.GetInPort( 'Gate' )
55     Otest_ISONEBoolOne = test_ISONE.GetOutPort( 'BoolOne' )
56     Otest_ISONEGate = test_ISONE.GetOutPort( 'Gate' )
57     
58     m3p1 = GraphSyrControlGUI_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' )
59     m3p1.SetName( 'm3p1' )
60     m3p1.SetAuthor( '' )
61     m3p1.SetContainer( 'localhost/FactoryServer' )
62     m3p1.SetComment( 'C_M3P1 from SyrComponent' )
63     m3p1.Coords( 761 , 19 )
64     Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' )
65     Im3p1Gate = m3p1.GetInPort( 'Gate' )
66     Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' )
67     Om3p1Gate = m3p1.GetOutPort( 'Gate' )
68     
69     div2 = GraphSyrControlGUI_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' )
70     div2.SetName( 'div2' )
71     div2.SetAuthor( '' )
72     div2.SetContainer( 'localhost/FactoryServer' )
73     div2.SetComment( 'C_DIV2 from SyrComponent' )
74     div2.Coords( 770 , 384 )
75     Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' )
76     Idiv2Gate = div2.GetInPort( 'Gate' )
77     Odiv2anInteger = div2.GetOutPort( 'anInteger' )
78     Odiv2Gate = div2.GetOutPort( 'Gate' )
79     
80     incr = GraphSyrControlGUI_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' )
81     incr.SetName( 'incr' )
82     incr.SetAuthor( '' )
83     incr.SetContainer( 'localhost/FactoryServer' )
84     incr.SetComment( 'C_INCR from SyrComponent' )
85     incr.Coords( 764 , 179 )
86     IincraCount = incr.GetInPort( 'aCount' )
87     IincrGate = incr.GetInPort( 'Gate' )
88     OincraNewCount = incr.GetOutPort( 'aNewCount' )
89     OincrGate = incr.GetOutPort( 'Gate' )
90     
91     # Creation of InLine Nodes
92     Pylabel_begin = []
93     Pylabel_begin.append( 'def label_begin( NB , KB ) :' )
94     Pylabel_begin.append( '    return NB,KB' )
95     label_begin = GraphSyrControlGUI_2.INode( 'label_begin' , Pylabel_begin )
96     label_begin.SetName( 'label_begin' )
97     label_begin.SetAuthor( '' )
98     label_begin.SetComment( 'Python function' )
99     label_begin.Coords( 58 , 189 )
100     Ilabel_beginNB = label_begin.InPort( 'NB' , 'long' )
101     Ilabel_beginKB = label_begin.InPort( 'KB' , 'long' )
102     Ilabel_beginGate = label_begin.GetInPort( 'Gate' )
103     Olabel_beginNT = label_begin.OutPort( 'NT' , 'long' )
104     Olabel_beginKT = label_begin.OutPort( 'KT' , 'long' )
105     Olabel_beginGate = label_begin.GetOutPort( 'Gate' )
106     
107     # Creation of Switch Nodes
108     Pylabel_test = []
109     Pylabel_test.append( 'def L_OneEven( ValOne , ValEven , NT , KT ):' )
110     Pylabel_test.append( '    Finished = ValOne' )
111     Pylabel_test.append( '    if Finished == 0 :' )
112     Pylabel_test.append( '        Incr = 1' )
113     Pylabel_test.append( '        Even = ValEven' )
114     Pylabel_test.append( '        if Even == 0 :' )
115     Pylabel_test.append( '            Odd = 1' )
116     Pylabel_test.append( '        else :' )
117     Pylabel_test.append( '            Odd = 0' )
118     Pylabel_test.append( '    else :' )
119     Pylabel_test.append( '        Incr = 0' )
120     Pylabel_test.append( '        Even = 0' )
121     Pylabel_test.append( '        Odd = 0' )
122     Pylabel_test.append( '    Even = ValEven' )
123     Pylabel_test.append( '    return Finished,Incr,Even,Odd,NT,KT' )
124     label_test,EndL_OneEven = GraphSyrControlGUI_2.SNode( 'L_OneEven' , Pylabel_test )
125     EndL_OneEven.SetName( 'EndL_OneEven' )
126     EndL_OneEven.SetAuthor( '' )
127     EndL_OneEven.SetComment( 'Compute Node' )
128     EndL_OneEven.Coords( 1069 , 310 )
129     PyEndL_OneEven = []
130     EndL_OneEven.SetPyFunction( '' , PyEndL_OneEven )
131     IEndL_OneEvenDefault = EndL_OneEven.GetInPort( 'Default' )
132     OEndL_OneEvenGate = EndL_OneEven.GetOutPort( 'Gate' )
133     label_test.SetName( 'label_test' )
134     label_test.SetAuthor( '' )
135     label_test.SetComment( 'Compute Node' )
136     label_test.Coords( 515 , 190 )
137     Ilabel_testValOne = label_test.InPort( 'ValOne' , 'long' )
138     Ilabel_testValEven = label_test.InPort( 'ValEven' , 'long' )
139     Ilabel_testNT = label_test.InPort( 'NT' , 'long' )
140     Ilabel_testKT = label_test.InPort( 'KT' , 'long' )
141     Ilabel_testGate = label_test.GetInPort( 'Gate' )
142     Olabel_testFinished = label_test.OutPort( 'Finished' , 'long' )
143     Olabel_testIncr = label_test.OutPort( 'Incr' , 'long' )
144     Olabel_testEven = label_test.OutPort( 'Even' , 'long' )
145     Olabel_testOdd = label_test.OutPort( 'Odd' , 'long' )
146     Olabel_testN = label_test.OutPort( 'N' , 'long' )
147     Olabel_testK = label_test.OutPort( 'K' , 'long' )
148     Olabel_testDefault = label_test.GetOutPort( 'Default' )
149     
150     # Creation of GOTO Nodes
151     Pycontrol_m3p1 = []
152     Pycontrol_m3p1.append( 'def C_NotOneIsEven( N , K ):' )
153     Pycontrol_m3p1.append( '    return 0,1,N,K' )
154     control_m3p1 = GraphSyrControlGUI_2.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' )
155     control_m3p1.SetName( 'control_m3p1' )
156     control_m3p1.SetAuthor( '' )
157     control_m3p1.SetComment( 'Compute Node' )
158     control_m3p1.Coords( 973 , 59 )
159     Icontrol_m3p1N = control_m3p1.InPort( 'N' , 'long' )
160     Icontrol_m3p1K = control_m3p1.InPort( 'K' , 'long' )
161     Icontrol_m3p1Gate = control_m3p1.GetInPort( 'Gate' )
162     Ocontrol_m3p1ValOne = control_m3p1.OutPort( 'ValOne' , 'long' )
163     Ocontrol_m3p1ValEven = control_m3p1.OutPort( 'ValEven' , 'long' )
164     Ocontrol_m3p1NT = control_m3p1.OutPort( 'NT' , 'long' )
165     Ocontrol_m3p1KT = control_m3p1.OutPort( 'KT' , 'long' )
166     Ocontrol_m3p1Gate = control_m3p1.GetOutPort( 'Gate' )
167     
168     Pycontrol_div2 = []
169     Pycontrol_div2.append( 'def control_div2( N , K ) :' )
170     Pycontrol_div2.append( '    return N,K' )
171     control_div2 = GraphSyrControlGUI_2.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' )
172     control_div2.SetName( 'control_div2' )
173     control_div2.SetAuthor( '' )
174     control_div2.SetComment( 'Compute Node' )
175     control_div2.Coords( 973 , 424 )
176     Icontrol_div2N = control_div2.InPort( 'N' , 'long' )
177     Icontrol_div2K = control_div2.InPort( 'K' , 'long' )
178     Icontrol_div2Gate = control_div2.GetInPort( 'Gate' )
179     Ocontrol_div2NB = control_div2.OutPort( 'NB' , 'long' )
180     Ocontrol_div2KB = control_div2.OutPort( 'KB' , 'long' )
181     Ocontrol_div2Gate = control_div2.GetOutPort( 'Gate' )
182     
183     # Creation of Links
184     Ltest_ISEVENBoolEvenlabel_testValEven = GraphSyrControlGUI_2.Link( Otest_ISEVENBoolEven , Ilabel_testValEven )
185     Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 493 , 241 )
186     Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 492 , 405 )
187     
188     Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControlGUI_2.Link( Otest_ISONEBoolOne , Ilabel_testValOne )
189     Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 476 , 222 )
190     Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 476 , 202 )
191     
192     Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControlGUI_2.Link( Om3p1anEvenInteger , Icontrol_m3p1N )
193     
194     Ldiv2anIntegercontrol_div2N = GraphSyrControlGUI_2.Link( Odiv2anInteger , Icontrol_div2N )
195     
196     LincraNewCountcontrol_div2K = GraphSyrControlGUI_2.Link( OincraNewCount , Icontrol_div2K )
197     LincraNewCountcontrol_div2K.AddCoord( 1 , 954 , 475 )
198     LincraNewCountcontrol_div2K.AddCoord( 2 , 953 , 251 )
199     
200     LincraNewCountcontrol_m3p1K = GraphSyrControlGUI_2.Link( OincraNewCount , Icontrol_m3p1K )
201     LincraNewCountcontrol_m3p1K.AddCoord( 1 , 955 , 110 )
202     LincraNewCountcontrol_m3p1K.AddCoord( 2 , 953 , 250 )
203     
204     Llabel_beginNTtest_ISONEanInteger = GraphSyrControlGUI_2.Link( Olabel_beginNT , Itest_ISONEanInteger )
205     Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 275 , 201 )
206     Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 275 , 260 )
207     
208     Llabel_beginNTlabel_testNT = GraphSyrControlGUI_2.Link( Olabel_beginNT , Ilabel_testNT )
209     
210     Llabel_beginNTtest_ISEVENanInteger = GraphSyrControlGUI_2.Link( Olabel_beginNT , Itest_ISEVENanInteger )
211     Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 275 , 408 )
212     Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 275 , 261 )
213     
214     Llabel_beginKTlabel_testKT = GraphSyrControlGUI_2.Link( Olabel_beginKT , Ilabel_testKT )
215     Llabel_beginKTlabel_testKT.AddCoord( 1 , 476 , 282 )
216     Llabel_beginKTlabel_testKT.AddCoord( 2 , 475 , 515 )
217     Llabel_beginKTlabel_testKT.AddCoord( 3 , 260 , 515 )
218     Llabel_beginKTlabel_testKT.AddCoord( 4 , 260 , 280 )
219     
220     Llabel_testEvendiv2Gate = GraphSyrControlGUI_2.Link( Olabel_testEven , Idiv2Gate )
221     Llabel_testEvendiv2Gate.AddCoord( 1 , 722 , 480 )
222     Llabel_testEvendiv2Gate.AddCoord( 2 , 722 , 261 )
223     
224     Llabel_testOddm3p1Gate = GraphSyrControlGUI_2.Link( Olabel_testOdd , Im3p1Gate )
225     Llabel_testOddm3p1Gate.AddCoord( 1 , 698 , 114 )
226     Llabel_testOddm3p1Gate.AddCoord( 2 , 698 , 281 )
227     
228     Llabel_testNm3p1anOddInteger = GraphSyrControlGUI_2.Link( Olabel_testN , Im3p1anOddInteger )
229     Llabel_testNm3p1anOddInteger.AddCoord( 1 , 745 , 90 )
230     Llabel_testNm3p1anOddInteger.AddCoord( 2 , 747 , 301 )
231     
232     Llabel_testNdiv2anEvenInteger = GraphSyrControlGUI_2.Link( Olabel_testN , Idiv2anEvenInteger )
233     Llabel_testNdiv2anEvenInteger.AddCoord( 1 , 746 , 455 )
234     Llabel_testNdiv2anEvenInteger.AddCoord( 2 , 748 , 301 )
235     
236     Llabel_testKincraCount = GraphSyrControlGUI_2.Link( Olabel_testK , IincraCount )
237     Llabel_testKincraCount.AddCoord( 1 , 733 , 250 )
238     Llabel_testKincraCount.AddCoord( 2 , 734 , 321 )
239     
240     Llabel_testDefaultEndL_OneEvenDefault = GraphSyrControlGUI_2.Link( Olabel_testDefault , IEndL_OneEvenDefault )
241     
242     Lcontrol_m3p1Gatelabel_testGate = GraphSyrControlGUI_2.Link( Ocontrol_m3p1Gate , Ilabel_testGate )
243     Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 504 , 344 )
244     Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 505 , 5 )
245     Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1149 , 5 )
246     Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1150 , 174 )
247     
248     Lcontrol_div2Gatelabel_beginGate = GraphSyrControlGUI_2.Link( Ocontrol_div2Gate , Ilabel_beginGate )
249     Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 34 , 304 )
250     Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 34 , 592 )
251     Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1145 , 586 )
252     Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1145 , 499 )
253     
254     # Input datas
255     Ilabel_beginNB.Input( 7 )
256     Ilabel_beginKB.Input( 0 )
257     
258     # Output Ports of the graph
259     #Olabel_testFinished = label_test.GetOutPort( 'Finished' )
260     #Olabel_testIncr = label_test.GetOutPort( 'Incr' )
261     return GraphSyrControlGUI_2
262
263
264 GraphSyrControlGUI_2 = DefGraphSyrControlGUI_2()