Salome HOME
80c8971581f62453ba9b9d08c253df29894f5957
[samples/datafiles.git] / Superv / Python / GraphLoopGatesNOTValid.py
1 # Copyright (C) 2007-2014  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, or (at your option) any later version.
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
23 # Generated python file of Graph GraphLoopGatesNOTValid
24 #
25 from SuperV import *
26
27 # Graph creation of GraphLoopGatesNOTValid
28 def DefGraphLoopGatesNOTValid() :
29     GraphLoopGatesNOTValid = Graph( 'GraphLoopGatesNOTValid' )
30     GraphLoopGatesNOTValid.SetName( 'GraphLoopGatesNOTValid' )
31     GraphLoopGatesNOTValid.SetAuthor( 'JR' )
32     GraphLoopGatesNOTValid.SetComment( '' )
33     GraphLoopGatesNOTValid.Coords( 0 , 0 )
34     
35     # Creation of Factory Nodes
36     
37     Add = GraphLoopGatesNOTValid.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
38     Add.SetName( 'Add' )
39     Add.SetAuthor( '' )
40     Add.SetContainer( 'localhost/FactoryServer' )
41     Add.SetComment( 'Add from AddComponent' )
42     Add.Coords( 248 , 70 )
43     IAddx = Add.GetInPort( 'x' )
44     IAddy = Add.GetInPort( 'y' )
45     IAddGate = Add.GetInPort( 'Gate' )
46     OAddFuncValue = Add.GetOutPort( 'FuncValue' )
47     OAddz = Add.GetOutPort( 'z' )
48     OAddGate = Add.GetOutPort( 'Gate' )
49     
50     Add_1 = GraphLoopGatesNOTValid.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
51     Add_1.SetName( 'Add_1' )
52     Add_1.SetAuthor( '' )
53     Add_1.SetContainer( 'localhost/FactoryServer' )
54     Add_1.SetComment( 'Add from AddComponent' )
55     Add_1.Coords( 249 , 305 )
56     IAdd_1x = Add_1.GetInPort( 'x' )
57     IAdd_1y = Add_1.GetInPort( 'y' )
58     IAdd_1Gate = Add_1.GetInPort( 'Gate' )
59     OAdd_1FuncValue = Add_1.GetOutPort( 'FuncValue' )
60     OAdd_1z = Add_1.GetOutPort( 'z' )
61     OAdd_1Gate = Add_1.GetOutPort( 'Gate' )
62     
63     Sub = GraphLoopGatesNOTValid.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
64     Sub.SetName( 'Sub' )
65     Sub.SetAuthor( '' )
66     Sub.SetContainer( 'localhost/FactoryServer' )
67     Sub.SetComment( 'Sub from SubComponent' )
68     Sub.Coords( 453 , 72 )
69     ISubx = Sub.GetInPort( 'x' )
70     ISuby = Sub.GetInPort( 'y' )
71     ISubGate = Sub.GetInPort( 'Gate' )
72     OSubz = Sub.GetOutPort( 'z' )
73     OSubGate = Sub.GetOutPort( 'Gate' )
74     
75     Sub_1 = GraphLoopGatesNOTValid.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
76     Sub_1.SetName( 'Sub_1' )
77     Sub_1.SetAuthor( '' )
78     Sub_1.SetContainer( 'localhost/FactoryServer' )
79     Sub_1.SetComment( 'Sub from SubComponent' )
80     Sub_1.Coords( 455 , 304 )
81     ISub_1x = Sub_1.GetInPort( 'x' )
82     ISub_1y = Sub_1.GetInPort( 'y' )
83     ISub_1Gate = Sub_1.GetInPort( 'Gate' )
84     OSub_1z = Sub_1.GetOutPort( 'z' )
85     OSub_1Gate = Sub_1.GetOutPort( 'Gate' )
86     
87     # Creation of InLine Nodes
88     PyGate = []
89     PyGate.append( 'from time import *  ' )
90     PyGate.append( 'def Gate(G1,G2) :  ' )
91     PyGate.append( '    sleep(1)  ' )
92     PyGate.append( '    return G1&G2  ' )
93     Gate = GraphLoopGatesNOTValid.INode( 'Gate' , PyGate )
94     Gate.SetName( 'Gate' )
95     Gate.SetAuthor( '' )
96     Gate.SetComment( 'Compute Node' )
97     Gate.Coords( 650 , 227 )
98     IGateG1 = Gate.InPort( 'G1' , 'long' )
99     IGateG2 = Gate.InPort( 'G2' , 'long' )
100     IGateGate = Gate.GetInPort( 'Gate' )
101     OGateG = Gate.OutPort( 'G' , 'long' )
102     OGateGate = Gate.GetOutPort( 'Gate' )
103     
104     # Creation of Loop Nodes
105     PyInit = []
106     PyInit.append( 'from time import *   ' )
107     PyInit.append( 'def Init(Index,Min,Max) :   ' )
108     PyInit.append( '    Index = Min   ' )
109     PyInit.append( '    sleep(1)   ' )
110     PyInit.append( '    return Index,Min,Max   ' )
111     PyMoreInit = []
112     PyMoreInit.append( 'def More(Index,Min,Max) :  ' )
113     PyMoreInit.append( '    if Index < Max :  ' )
114     PyMoreInit.append( '        DoLoop = 1  ' )
115     PyMoreInit.append( '    else :  ' )
116     PyMoreInit.append( '        DoLoop = 0 ' )
117     PyMoreInit.append( '    return DoLoop,Index,Min,Max  ' )
118     PyNextInit = []
119     PyNextInit.append( 'def Next(Index,Min,Max) :  ' )
120     PyNextInit.append( '    Index = Index + 1 ' )
121     PyNextInit.append( '    return Index,Min,Max   ' )
122     Init,EndInit = GraphLoopGatesNOTValid.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
123     EndInit.SetName( 'EndInit' )
124     EndInit.SetAuthor( '' )
125     EndInit.SetComment( 'Compute Node' )
126     EndInit.Coords( 840 , 204 )
127     PyEndInit = []
128     EndInit.SetPyFunction( 'EndInit' , PyEndInit )
129     IInitDoLoop = Init.GetInPort( 'DoLoop' )
130     IInitIndex = Init.InPort( 'Index' , 'long' )
131     IInitMin = Init.InPort( 'Min' , 'long' )
132     IInitMax = Init.InPort( 'Max' , 'long' )
133     IInitGate = Init.GetInPort( 'Gate' )
134     OInitDoLoop = Init.GetOutPort( 'DoLoop' )
135     OInitIndex = Init.GetOutPort( 'Index' )
136     OInitMin = Init.GetOutPort( 'Min' )
137     OInitMax = Init.GetOutPort( 'Max' )
138     IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
139     IEndInitIndex = EndInit.GetInPort( 'Index' )
140     IEndInitMin = EndInit.GetInPort( 'Min' )
141     IEndInitMax = EndInit.GetInPort( 'Max' )
142     IEndInitGate = EndInit.GetInPort( 'Gate' )
143     OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
144     OEndInitGate = EndInit.GetOutPort( 'Gate' )
145     OEndInitIndex = EndInit.GetOutPort( 'Index' )
146     OEndInitMin = EndInit.GetOutPort( 'Min' )
147     OEndInitMax = EndInit.GetOutPort( 'Max' )
148     Init.SetName( 'Init' )
149     Init.SetAuthor( '' )
150     Init.SetComment( 'Compute Node' )
151     Init.Coords( 10 , 181 )
152     
153     # Creation of Links
154     LInitGateAdd_1Gate = GraphLoopGatesNOTValid.Link( OInitGate , IAdd_1Gate )
155     
156     LInitGateAddGate = GraphLoopGatesNOTValid.Link( OInitGate , IAddGate )
157     
158     LInitIndexEndInitIndex = GraphLoopGatesNOTValid.Link( OInitIndex , IEndInitIndex )
159     
160     LInitMinEndInitMin = GraphLoopGatesNOTValid.Link( OInitMin , IEndInitMin )
161     
162     LInitMaxEndInitMax = GraphLoopGatesNOTValid.Link( OInitMax , IEndInitMax )
163     
164     LAddGateSubGate = GraphLoopGatesNOTValid.Link( OAddGate , ISubGate )
165     
166     LAdd_1GateSub_1Gate = GraphLoopGatesNOTValid.Link( OAdd_1Gate , ISub_1Gate )
167     
168     LSubGateGateG1 = GraphLoopGatesNOTValid.Link( OSubGate , IGateG1 )
169     
170     LSub_1GateGateG2 = GraphLoopGatesNOTValid.Link( OSub_1Gate , IGateG2 )
171     
172     LGateGEndInitGate = GraphLoopGatesNOTValid.Link( OGateG , IEndInitGate )
173     
174     # Input datas
175     IInitIndex.Input( 0 )
176     IInitMin.Input( 5 )
177     IInitMax.Input( 13 )
178     IAddx.Input( 1 )
179     IAddy.Input( 2 )
180     IAdd_1x.Input( 3 )
181     IAdd_1y.Input( 4 )
182     ISubx.Input( 5 )
183     ISuby.Input( 6 )
184     ISub_1x.Input( 7 )
185     ISub_1y.Input( 8 )
186     
187     # Output Ports of the graph
188     #OEndInitIndex = EndInit.GetOutPort( 'Index' )
189     #OEndInitMin = EndInit.GetOutPort( 'Min' )
190     #OEndInitMax = EndInit.GetOutPort( 'Max' )
191     #OAddFuncValue = Add.GetOutPort( 'FuncValue' )
192     #OAddz = Add.GetOutPort( 'z' )
193     #OAdd_1FuncValue = Add_1.GetOutPort( 'FuncValue' )
194     #OAdd_1z = Add_1.GetOutPort( 'z' )
195     #OSubz = Sub.GetOutPort( 'z' )
196     #OSub_1z = Sub_1.GetOutPort( 'z' )
197     return GraphLoopGatesNOTValid
198
199
200 GraphLoopGatesNOTValid = DefGraphLoopGatesNOTValid()