Salome HOME
9acf3f6b63fb5e28f1f71ea4426d181c21a672a1
[samples/datafiles.git] / Superv / Python / Graphs.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 Graphs
23 #
24 from SuperV import *
25 # Graph creation 
26 Graphs = Graph( 'Graphs' )
27 Graphs.SetName( 'Graphs' )
28 Graphs.SetAuthor( '' )
29 Graphs.SetComment( '' )
30 Graphs.Coords( 0 , 0 )
31
32 # Creation of Factory Nodes
33
34 Add = Graphs.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( 30 , 8 )
40
41 Sub = Graphs.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( 241 , 38 )
47
48 Mul = Graphs.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( 439 , 39 )
54
55 Div = Graphs.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( 633 , 120 )
61
62 Add_1 = Graphs.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
63 Add_1.SetName( 'Add_1' )
64 Add_1.SetAuthor( '' )
65 Add_1.SetContainer( 'localhost/FactoryServer' )
66 Add_1.SetComment( 'Add from AddComponent' )
67 Add_1.Coords( 13 , 297 )
68
69 Sub_1 = Graphs.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
70 Sub_1.SetName( 'Sub_1' )
71 Sub_1.SetAuthor( '' )
72 Sub_1.SetContainer( 'localhost/FactoryServer' )
73 Sub_1.SetComment( 'Sub from SubComponent' )
74 Sub_1.Coords( 235 , 217 )
75
76 Mul_1 = Graphs.FNode( 'MulComponent' , 'MulComponent' , 'Mul' )
77 Mul_1.SetName( 'Mul_1' )
78 Mul_1.SetAuthor( '' )
79 Mul_1.SetContainer( 'localhost/FactoryServer' )
80 Mul_1.SetComment( 'Mul from MulComponent' )
81 Mul_1.Coords( 423 , 375 )
82
83 Div_1 = Graphs.FNode( 'DivComponent' , 'DivComponent' , 'Div' )
84 Div_1.SetName( 'Div_1' )
85 Div_1.SetAuthor( '' )
86 Div_1.SetContainer( 'localhost/FactoryServer' )
87 Div_1.SetComment( 'Div from DivComponent' )
88 Div_1.Coords( 630 , 284 )
89
90 # Creation of Links
91 Addz = Add.Port( 'z' )
92 Subx = Graphs.Link( Addz , Sub.Port( 'x' ) )
93
94 Subz = Sub.Port( 'z' )
95 Divx = Graphs.Link( Subz , Div.Port( 'x' ) )
96 Divx.AddCoord( 1 , 426 , 201 )
97 Divx.AddCoord( 2 , 425 , 119 )
98
99 Mulx = Graphs.Link( Subz , Mul.Port( 'x' ) )
100
101 Mulz = Mul.Port( 'z' )
102 Divy = Graphs.Link( Mulz , Div.Port( 'y' ) )
103 Divy.AddCoord( 1 , 619 , 230 )
104 Divy.AddCoord( 2 , 620 , 120 )
105
106 Add_1FuncValue = Add_1.Port( 'FuncValue' )
107 Mul_1x = Graphs.Link( Add_1FuncValue , Mul_1.Port( 'x' ) )
108 Mul_1x.AddCoord( 1 , 396 , 455 )
109 Mul_1x.AddCoord( 2 , 395 , 378 )
110
111 Sub_1x = Graphs.Link( Add_1FuncValue , Sub_1.Port( 'x' ) )
112 Sub_1x.AddCoord( 1 , 215 , 297 )
113 Sub_1x.AddCoord( 2 , 215 , 378 )
114
115 Add_1z = Add_1.Port( 'z' )
116 Sub_1y = Graphs.Link( Add_1z , Sub_1.Port( 'y' ) )
117 Sub_1y.AddCoord( 1 , 197 , 327 )
118 Sub_1y.AddCoord( 2 , 196 , 406 )
119
120 Sub_1z = Sub_1.Port( 'z' )
121 Div_1x = Graphs.Link( Sub_1z , Div_1.Port( 'x' ) )
122 Div_1x.AddCoord( 1 , 604 , 364 )
123 Div_1x.AddCoord( 2 , 603 , 297 )
124
125 Mul_1z = Mul_1.Port( 'z' )
126 Div_1y = Graphs.Link( Mul_1z , Div_1.Port( 'y' ) )
127 Div_1y.AddCoord( 1 , 610 , 394 )
128 Div_1y.AddCoord( 2 , 610 , 455 )
129
130 # Creation of Input datas
131 Addx = Add.Input( 'x' , 3)
132 Addy = Add.Input( 'y' , 5)
133 Suby = Sub.Input( 'y' , 7)
134 Muly = Mul.Input( 'y' , 11)
135 Add_1x = Add_1.Input( 'x' , 1)
136 Add_1y = Add_1.Input( 'y' , 2)
137 Mul_1y = Mul_1.Input( 'y' , 4)
138
139 # Creation of Output variables
140 AddFuncValue = Add.Port( 'FuncValue' )
141 Divz = Div.Port( 'z' )
142 Div_1z = Div_1.Port( 'z' )
143
144 Graphs.Run()
145
146 Graphs.DoneW()
147
148 Graphs.State()
149
150 Graphs.PrintPorts()
151