Salome HOME
6a57142aa64a687d5a2a4bbd0e4bd6d53e9fdaf4
[samples/datafiles.git] / Superv / Python / NewGraphEssai.py
1 #  Copyright (C) 2007-2008  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 GraphEssai
23 #
24 from SuperV import *
25 # Graph creation 
26 NewGraphEssai = Graph( 'NewGraphEssai' )
27 NewGraphEssai.SetName( 'NewGraphEssai' )
28 NewGraphEssai.SetAuthor( '' )
29 NewGraphEssai.SetComment( '' )
30 NewGraphEssai.Coords( 0 , 0 )
31
32 # Creation of Factory Nodes
33
34 Sub = NewGraphEssai.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
35 Sub.SetName( 'Sub' )
36 Sub.SetAuthor( '' )
37 Sub.SetContainer( 'SubDivServer' )
38 Sub.SetComment( 'Sub from SubComponent' )
39 Sub.Coords( 413 , 74 )
40
41 Mul = NewGraphEssai.FNode( 'MulComponent' , 'MulComponent' , 'Mul' )
42 Mul.SetName( 'Mul' )
43 Mul.SetAuthor( '' )
44 Mul.SetContainer( 'MulServer' )
45 Mul.SetComment( 'Mul from MulComponent' )
46 Mul.Coords( 617 , 268 )
47
48 Div = NewGraphEssai.FNode( 'DivComponent' , 'DivComponent' , 'Div' )
49 Div.SetName( 'Div' )
50 Div.SetAuthor( '' )
51 Div.SetContainer( 'SubDivServer' )
52 Div.SetComment( 'Div from DivComponent' )
53 Div.Coords( 823 , 74 )
54
55 Addition = NewGraphEssai.FNode( 'AddComponent' , 'AddComponent' , 'Addition' )
56 Addition.SetName( 'Addition' )
57 Addition.SetAuthor( '' )
58 Addition.SetContainer( 'localhost/AddServer' )
59 Addition.SetComment( 'Addition from AddComponent' )
60 Addition.Coords( 11 , 268 )
61
62 # Creation of Computing Nodes
63 Add_ServiceinParameter = []
64 Add_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Adder' , 'Adder' ) )
65 Add_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'x' ) )
66 Add_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'y' ) )
67 Add_ServiceoutParameter = []
68 Add_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'FuncValue' ) )
69 Add_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'z' ) )
70 Add_Service = SALOME_ModuleCatalog.Service( 'Add' , Add_ServiceinParameter , Add_ServiceoutParameter , 0 )
71 Add = NewGraphEssai.CNode( Add_Service )
72 Add.SetName( 'Add' )
73 Add.SetAuthor( '' )
74 Add.SetComment( 'Compute Node' )
75 Add.Coords( 215 , 268 )
76
77 # Creation of Links
78 Subz = Sub.Port( 'z' )
79 Divx = NewGraphEssai.Link( Subz , Div.Port( 'x' ) )
80
81 Mulx = NewGraphEssai.Link( Subz , Mul.Port( 'x' ) )
82 Mulx.AddCoord( 1 , 595 , 348 )
83 Mulx.AddCoord( 2 , 595 , 154 )
84
85 Mulz = Mul.Port( 'z' )
86 Divy = NewGraphEssai.Link( Mulz , Div.Port( 'y' ) )
87 Divy.AddCoord( 1 , 805 , 183 )
88 Divy.AddCoord( 2 , 806 , 348 )
89
90 AdditionAdder = Addition.Port( 'Adder' )
91 AddAdder = NewGraphEssai.Link( AdditionAdder , Add.Port( 'Adder' ) )
92
93 AddFuncValue = Add.Port( 'FuncValue' )
94 Suby = NewGraphEssai.Link( AddFuncValue , Sub.Port( 'y' ) )
95 Suby.AddCoord( 1 , 395 , 183 )
96 Suby.AddCoord( 2 , 395 , 349 )
97
98 Addz = Add.Port( 'z' )
99 Muly = NewGraphEssai.Link( Addz , Mul.Port( 'y' ) )
100
101 # Creation of Input datas
102 Subx = Sub.Input( 'x' , 4.5)
103 Addx = Add.Input( 'x' , 1.5)
104 Addy = Add.Input( 'y' , 3)
105
106 # Creation of Output variables
107 Divz = Div.Port( 'z' )
108
109 NewGraphEssai.Run()
110
111 NewGraphEssai.DoneW()
112
113 NewGraphEssai.State()
114
115 NewGraphEssai.PrintPorts()
116