Salome HOME
0a58550c2032d9aebeb74ebe9fb9a88cfe5e65f1
[samples/datafiles.git] / Superv / Python / GraphEssai1.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 GraphEssai1
23 #
24 from SuperV import *
25 # Graph creation 
26 GraphEssai1 = Graph( 'GraphEssai1' )
27 GraphEssai1.SetName( 'GraphEssai1' )
28 GraphEssai1.SetAuthor( '' )
29 GraphEssai1.SetComment( '' )
30 GraphEssai1.Coords( 0 , 0 )
31
32 # Creation of Factory Nodes
33
34 Add = GraphEssai1.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( 16 , 262 )
40
41 Sub = GraphEssai1.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( 219 , 54 )
47
48 Mul = GraphEssai1.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( 419 , 262 )
54
55 Div = GraphEssai1.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( 623 , 55 )
61
62 # Creation of Links
63 Addz = Add.Port( 'z' )
64 Subx = GraphEssai1.Link( Addz , Sub.Port( 'x' ) )
65 Subx.AddCoord( 1 , 193 , 135 )
66 Subx.AddCoord( 2 , 193 , 372 )
67
68 Subz = Sub.Port( 'z' )
69 Divx = GraphEssai1.Link( Subz , Div.Port( 'x' ) )
70
71 Mulx = GraphEssai1.Link( Subz , Mul.Port( 'x' ) )
72 Mulx.AddCoord( 1 , 396 , 343 )
73 Mulx.AddCoord( 2 , 397 , 136 )
74
75 Mulz = Mul.Port( 'z' )
76 Divy = GraphEssai1.Link( Mulz , Div.Port( 'y' ) )
77 Divy.AddCoord( 1 , 598 , 163 )
78 Divy.AddCoord( 2 , 598 , 343 )
79
80 # Creation of Input datas
81 Addx = Add.Input( 'x' , 3)
82 Addy = Add.Input( 'y' , 5)
83 Suby = Sub.Input( 'y' , 7)
84 Muly = Mul.Input( 'y' , 11)
85
86 # Creation of Output variables
87 AddFuncValue = Add.Port( 'FuncValue' )
88 Divz = Div.Port( 'z' )
89
90 GraphEssai1.Run()
91
92 GraphEssai1.DoneW()
93
94 GraphEssai1.State()
95
96 GraphEssai1.PrintPorts()
97