Salome HOME
Copyrights update 2015.
[samples/datafiles.git] / Superv / Python / GraphEmbeddedComponentsCrash.py
1 # Copyright (C) 2007-2015  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 GraphEmbeddedComponentsCrash
24 #
25 from SuperV import *
26
27 # Graph creation of GraphEmbeddedComponentsCrash
28 def DefGraphEmbeddedComponentsCrash() :
29     GraphEmbeddedComponentsCrash = Graph( 'GraphEmbeddedComponentsCrash' )
30     GraphEmbeddedComponentsCrash.SetName( 'GraphEmbeddedComponentsCrash' )
31     GraphEmbeddedComponentsCrash.SetAuthor( '' )
32     GraphEmbeddedComponentsCrash.SetComment( '' )
33     GraphEmbeddedComponentsCrash.Coords( 0 , 0 )
34     
35     # Creation of Factory Nodes
36     
37     Add = GraphEmbeddedComponentsCrash.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( 1 , 152 )
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     Sub = GraphEmbeddedComponentsCrash.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
51     Sub.SetName( 'Sub' )
52     Sub.SetAuthor( '' )
53     Sub.SetContainer( 'localhost/FactoryServer' )
54     Sub.SetComment( 'Sub from SubComponent' )
55     Sub.Coords( 477 , 381 )
56     ISubx = Sub.GetInPort( 'x' )
57     ISuby = Sub.GetInPort( 'y' )
58     ISubGate = Sub.GetInPort( 'Gate' )
59     OSubz = Sub.GetOutPort( 'z' )
60     OSubGate = Sub.GetOutPort( 'Gate' )
61     
62     Mul = GraphEmbeddedComponentsCrash.FNode( 'MulComponent' , 'MulComponent' , 'Mul' )
63     Mul.SetName( 'Mul' )
64     Mul.SetAuthor( '' )
65     Mul.SetContainer( 'localhost/FactoryServer' )
66     Mul.SetComment( 'Mul from MulComponent' )
67     Mul.Coords( 480 , 152 )
68     IMulx = Mul.GetInPort( 'x' )
69     IMuly = Mul.GetInPort( 'y' )
70     IMulGate = Mul.GetInPort( 'Gate' )
71     OMulz = Mul.GetOutPort( 'z' )
72     OMulGate = Mul.GetOutPort( 'Gate' )
73     
74     Div = GraphEmbeddedComponentsCrash.FNode( 'DivComponent' , 'DivComponent' , 'Div' )
75     Div.SetName( 'Div' )
76     Div.SetAuthor( '' )
77     Div.SetContainer( 'localhost/FactoryServer' )
78     Div.SetComment( 'Div from DivComponent' )
79     Div.Coords( 714 , 136 )
80     IDivx = Div.GetInPort( 'x' )
81     IDivy = Div.GetInPort( 'y' )
82     IDivGate = Div.GetInPort( 'Gate' )
83     ODivz = Div.GetOutPort( 'z' )
84     ODivGate = Div.GetOutPort( 'Gate' )
85     
86     Addition = GraphEmbeddedComponentsCrash.FNode( 'AddComponent' , 'AddComponent' , 'Addition' )
87     Addition.SetName( 'Addition' )
88     Addition.SetAuthor( '' )
89     Addition.SetContainer( 'localhost/AdditionServer' )
90     Addition.SetComment( 'Addition from AddComponent' )
91     Addition.Coords( 0 , 0 )
92     IAdditionGate = Addition.GetInPort( 'Gate' )
93     OAdditionAdder = Addition.GetOutPort( 'Adder' )
94     OAdditionGate = Addition.GetOutPort( 'Gate' )
95     
96     Addition_1 = GraphEmbeddedComponentsCrash.FNode( 'AddComponent' , 'AddComponent' , 'Addition' )
97     Addition_1.SetName( 'Addition_1' )
98     Addition_1.SetAuthor( '' )
99     Addition_1.SetContainer( 'localhost/Addition_1Server' )
100     Addition_1.SetComment( 'Addition from AddComponent' )
101     Addition_1.Coords( 4 , 327 )
102     IAddition_1Gate = Addition_1.GetInPort( 'Gate' )
103     OAddition_1Adder = Addition_1.GetOutPort( 'Adder' )
104     OAddition_1Gate = Addition_1.GetOutPort( 'Gate' )
105     
106     # Creation of Computing Nodes
107     AddAndCompare_ServiceinParameter = []
108     AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Adder' , 'Adder' ) )
109     AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'x' ) )
110     AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'y' ) )
111     AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Adder' , 'anOtherAdder' ) )
112     AddAndCompare_ServiceoutParameter = []
113     AddAndCompare_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'FuncValue' ) )
114     AddAndCompare_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'z' ) )
115     AddAndCompare_ServiceinStreamParameter = []
116     AddAndCompare_ServiceoutStreamParameter = []
117     AddAndCompare_Service = SALOME_ModuleCatalog.Service( 'AddAndCompare' , AddAndCompare_ServiceinParameter , AddAndCompare_ServiceoutParameter , AddAndCompare_ServiceinStreamParameter , AddAndCompare_ServiceoutStreamParameter , 0 , 0 )
118     AddAndCompare = GraphEmbeddedComponentsCrash.CNode( AddAndCompare_Service )
119     AddAndCompare.SetName( 'AddAndCompare' )
120     AddAndCompare.SetAuthor( '' )
121     AddAndCompare.SetComment( 'Python function' )
122     AddAndCompare.Coords( 233 , 0 )
123     IAddAndCompareAdder = AddAndCompare.GetInPort( 'Adder' )
124     IAddAndComparex = AddAndCompare.GetInPort( 'x' )
125     IAddAndComparey = AddAndCompare.GetInPort( 'y' )
126     IAddAndCompareanOtherAdder = AddAndCompare.GetInPort( 'anOtherAdder' )
127     IAddAndCompareGate = AddAndCompare.GetInPort( 'Gate' )
128     OAddAndCompareFuncValue = AddAndCompare.GetOutPort( 'FuncValue' )
129     OAddAndComparez = AddAndCompare.GetOutPort( 'z' )
130     OAddAndCompareGate = AddAndCompare.GetOutPort( 'Gate' )
131     
132     # Creation of Links
133     LAddFuncValueMulx = GraphEmbeddedComponentsCrash.Link( OAddFuncValue , IMulx )
134     
135     LAddFuncValueAddAndComparex = GraphEmbeddedComponentsCrash.Link( OAddFuncValue , IAddAndComparex )
136     LAddFuncValueAddAndComparex.AddCoord( 1 , 195 , 108 )
137     LAddFuncValueAddAndComparex.AddCoord( 2 , 195 , 233 )
138     
139     LAddzSubx = GraphEmbeddedComponentsCrash.Link( OAddz , ISubx )
140     LAddzSubx.AddCoord( 1 , 187 , 459 )
141     LAddzSubx.AddCoord( 2 , 186 , 262 )
142     
143     LAddzAddAndComparey = GraphEmbeddedComponentsCrash.Link( OAddz , IAddAndComparey )
144     LAddzAddAndComparey.AddCoord( 1 , 187 , 139 )
145     LAddzAddAndComparey.AddCoord( 2 , 186 , 261 )
146     
147     LSubzDivx = GraphEmbeddedComponentsCrash.Link( OSubz , IDivx )
148     LSubzDivx.AddCoord( 1 , 670 , 206 )
149     LSubzDivx.AddCoord( 2 , 680 , 447 )
150     
151     LMulzDivy = GraphEmbeddedComponentsCrash.Link( OMulz , IDivy )
152     
153     LAdditionAdderAddAndCompareAdder = GraphEmbeddedComponentsCrash.Link( OAdditionAdder , IAddAndCompareAdder )
154     
155     LAddition_1AdderAddAndCompareanOtherAdder = GraphEmbeddedComponentsCrash.Link( OAddition_1Adder , IAddAndCompareanOtherAdder )
156     LAddition_1AdderAddAndCompareanOtherAdder.AddCoord( 1 , 215 , 168 )
157     LAddition_1AdderAddAndCompareanOtherAdder.AddCoord( 2 , 214 , 407 )
158     
159     LAddAndCompareGateMulGate = GraphEmbeddedComponentsCrash.Link( OAddAndCompareGate , IMulGate )
160     
161     LAddAndCompareGateSubGate = GraphEmbeddedComponentsCrash.Link( OAddAndCompareGate , ISubGate )
162     
163     # Input datas
164     IAddx.Input( 1 )
165     IAddy.Input( 2 )
166     ISuby.Input( 3 )
167     IMuly.Input( 4 )
168     
169     # Output Ports of the graph
170     #ODivz = Div.GetOutPort( 'z' )
171     #OAddAndCompareFuncValue = AddAndCompare.GetOutPort( 'FuncValue' )
172     #OAddAndComparez = AddAndCompare.GetOutPort( 'z' )
173     return GraphEmbeddedComponentsCrash
174
175
176 GraphEmbeddedComponentsCrash = DefGraphEmbeddedComponentsCrash()
177
178 GraphEmbeddedComponentsCrash.Run()
179 GraphEmbeddedComponentsCrash.DoneW()
180 GraphEmbeddedComponentsCrash.PrintPorts()
181