Salome HOME
be65ad9b87f82d2151fba978dd8a0abb585d27d5
[samples/datafiles.git] / Superv / Python / GraphEssai3.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 GraphEssai3
23 #
24 from SuperV import *
25 # Graph creation 
26 GraphEssai3 = Graph( 'GraphEssai3' )
27 GraphEssai3.SetName( 'GraphEssai3' )
28 GraphEssai3.SetAuthor( '' )
29 GraphEssai3.SetComment( '' )
30 GraphEssai3.Coords( 0 , 0 )
31
32 # Creation of Factory Nodes
33
34 Add = GraphEssai3.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
35 Add.SetName( 'Add' )
36 Add.SetAuthor( '' )
37 Add.SetContainer( 'localhost/FactoryServer' )
38 Add.SetComment( 'Add from AddComponent' )
39 Add.Coords( 1 , 152 )
40
41 Sub = GraphEssai3.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
42 Sub.SetName( 'Sub' )
43 Sub.SetAuthor( '' )
44 Sub.SetContainer( 'localhost/FactoryServer' )
45 Sub.SetComment( 'Sub from SubComponent' )
46 Sub.Coords( 412 , 377 )
47
48 Mul = GraphEssai3.FNode( 'MulComponent' , 'MulComponent' , 'Mul' )
49 Mul.SetName( 'Mul' )
50 Mul.SetAuthor( '' )
51 Mul.SetContainer( 'localhost/FactoryServer' )
52 Mul.SetComment( 'Mul from MulComponent' )
53 Mul.Coords( 412 , 152 )
54
55 Div = GraphEssai3.FNode( 'DivComponent' , 'DivComponent' , 'Div' )
56 Div.SetName( 'Div' )
57 Div.SetAuthor( '' )
58 Div.SetContainer( 'localhost/FactoryServer' )
59 Div.SetComment( 'Div from DivComponent' )
60 Div.Coords( 622 , 124 )
61
62 Addition = GraphEssai3.FNode( 'AddComponent' , 'AddComponent' , 'Addition' )
63 Addition.SetName( 'Addition' )
64 Addition.SetAuthor( '' )
65 Addition.SetContainer( 'localhost/AdditionServer' )
66 Addition.SetComment( 'Addition from AddComponent' )
67 Addition.Coords( 0 , 0 )
68
69 Addition_1 = GraphEssai3.FNode( 'AddComponent' , 'AddComponent' , 'Addition' )
70 Addition_1.SetName( 'Addition_1' )
71 Addition_1.SetAuthor( '' )
72 Addition_1.SetContainer( 'localhost/Addition_1Server' )
73 Addition_1.SetComment( 'Addition from AddComponent' )
74 Addition_1.Coords( 4 , 327 )
75
76 # Creation of Computing Nodes
77 AddAndCompare_ServiceinParameter = []
78 AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Adder' , 'Adder' ) )
79 AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'x' ) )
80 AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'y' ) )
81 AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Adder' , 'anOtherAdder' ) )
82 AddAndCompare_ServiceoutParameter = []
83 AddAndCompare_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'FuncValue' ) )
84 AddAndCompare_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'z' ) )
85 AddAndCompare_ServiceinStreamParameter = []
86 AddAndCompare_ServiceoutStreamParameter = []
87 AddAndCompare_Service = SALOME_ModuleCatalog.Service( 'AddAndCompare' , AddAndCompare_ServiceinParameter , AddAndCompare_ServiceoutParameter , AddAndCompare_ServiceinStreamParameter , AddAndCompare_ServiceoutStreamParameter , 0 , 0 )
88 AddAndCompare = GraphEssai3.CNode( AddAndCompare_Service )
89 AddAndCompare.SetName( 'AddAndCompare' )
90 AddAndCompare.SetAuthor( '' )
91 AddAndCompare.SetComment( 'Python function' )
92 AddAndCompare.Coords( 233 , 0 )
93
94 # Creation of Links
95 AddFuncValue = Add.Port( 'FuncValue' )
96 Mulx = GraphEssai3.Link( AddFuncValue , Mul.Port( 'x' ) )
97
98 AddAndComparex = GraphEssai3.Link( AddFuncValue , AddAndCompare.Port( 'x' ) )
99 AddAndComparex.AddCoord( 1 , 195 , 108 )
100 AddAndComparex.AddCoord( 2 , 195 , 233 )
101
102 Addz = Add.Port( 'z' )
103 Subx = GraphEssai3.Link( Addz , Sub.Port( 'x' ) )
104 Subx.AddCoord( 1 , 187 , 459 )
105 Subx.AddCoord( 2 , 186 , 262 )
106
107 AddAndComparey = GraphEssai3.Link( Addz , AddAndCompare.Port( 'y' ) )
108 AddAndComparey.AddCoord( 1 , 187 , 139 )
109 AddAndComparey.AddCoord( 2 , 186 , 261 )
110
111 Subz = Sub.Port( 'z' )
112 Divx = GraphEssai3.Link( Subz , Div.Port( 'x' ) )
113 Divx.AddCoord( 1 , 598 , 203 )
114 Divx.AddCoord( 2 , 598 , 457 )
115
116 Mulz = Mul.Port( 'z' )
117 Divy = GraphEssai3.Link( Mulz , Div.Port( 'y' ) )
118
119 AdditionAdder = Addition.Port( 'Adder' )
120 AddAndCompareAdder = GraphEssai3.Link( AdditionAdder , AddAndCompare.Port( 'Adder' ) )
121
122 Addition_1Adder = Addition_1.Port( 'Adder' )
123 AddAndCompareanOtherAdder = GraphEssai3.Link( Addition_1Adder , AddAndCompare.Port( 'anOtherAdder' ) )
124 AddAndCompareanOtherAdder.AddCoord( 1 , 215 , 168 )
125 AddAndCompareanOtherAdder.AddCoord( 2 , 214 , 407 )
126
127 # Creation of Input datas
128 Addx = Add.Input( 'x' , 1)
129 Addy = Add.Input( 'y' , 2)
130 Suby = Sub.Input( 'y' , 3)
131 Muly = Mul.Input( 'y' , 4)
132
133 # Creation of Output variables
134 Divz = Div.Port( 'z' )
135 AddAndCompareFuncValue = AddAndCompare.Port( 'FuncValue' )
136 AddAndComparez = AddAndCompare.Port( 'z' )
137
138 GraphEssai3.Run()
139
140 GraphEssai3.DoneW()
141
142 print GraphEssai3.State()
143
144 GraphEssai3.PrintPorts()
145