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