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