1 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 # Generated python file of Graph GraphEssai
26 NewGraphEssai = Graph( 'NewGraphEssai' )
27 NewGraphEssai.SetName( 'NewGraphEssai' )
28 NewGraphEssai.SetAuthor( '' )
29 NewGraphEssai.SetComment( '' )
30 NewGraphEssai.Coords( 0 , 0 )
32 # Creation of Factory Nodes
34 Sub = NewGraphEssai.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
37 Sub.SetContainer( 'SubDivServer' )
38 Sub.SetComment( 'Sub from SubComponent' )
39 Sub.Coords( 413 , 74 )
41 Mul = NewGraphEssai.FNode( 'MulComponent' , 'MulComponent' , 'Mul' )
44 Mul.SetContainer( 'MulServer' )
45 Mul.SetComment( 'Mul from MulComponent' )
46 Mul.Coords( 617 , 268 )
48 Div = NewGraphEssai.FNode( 'DivComponent' , 'DivComponent' , 'Div' )
51 Div.SetContainer( 'SubDivServer' )
52 Div.SetComment( 'Div from DivComponent' )
53 Div.Coords( 823 , 74 )
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 )
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 )
74 Add.SetComment( 'Compute Node' )
75 Add.Coords( 215 , 268 )
78 Subz = Sub.Port( 'z' )
79 Divx = NewGraphEssai.Link( Subz , Div.Port( 'x' ) )
81 Mulx = NewGraphEssai.Link( Subz , Mul.Port( 'x' ) )
82 Mulx.AddCoord( 1 , 595 , 348 )
83 Mulx.AddCoord( 2 , 595 , 154 )
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 )
90 AdditionAdder = Addition.Port( 'Adder' )
91 AddAdder = NewGraphEssai.Link( AdditionAdder , Add.Port( 'Adder' ) )
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 )
98 Addz = Add.Port( 'z' )
99 Muly = NewGraphEssai.Link( Addz , Mul.Port( 'y' ) )
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)
106 # Creation of Output variables
107 Divz = Div.Port( 'z' )
111 NewGraphEssai.DoneW()
113 NewGraphEssai.State()
115 NewGraphEssai.PrintPorts()