2 # Generated python file of Graph GraphEssai
6 NewGraphEssai = Graph( 'NewGraphEssai' )
7 NewGraphEssai.SetName( 'NewGraphEssai' )
8 NewGraphEssai.SetAuthor( '' )
9 NewGraphEssai.SetComment( '' )
10 NewGraphEssai.Coords( 0 , 0 )
12 # Creation of Factory Nodes
14 Sub = NewGraphEssai.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
17 Sub.SetContainer( 'SubDivServer' )
18 Sub.SetComment( 'Sub from SubComponent' )
19 Sub.Coords( 413 , 74 )
21 Mul = NewGraphEssai.FNode( 'MulComponent' , 'MulComponent' , 'Mul' )
24 Mul.SetContainer( 'MulServer' )
25 Mul.SetComment( 'Mul from MulComponent' )
26 Mul.Coords( 617 , 268 )
28 Div = NewGraphEssai.FNode( 'DivComponent' , 'DivComponent' , 'Div' )
31 Div.SetContainer( 'SubDivServer' )
32 Div.SetComment( 'Div from DivComponent' )
33 Div.Coords( 823 , 74 )
35 Addition = NewGraphEssai.FNode( 'AddComponent' , 'AddComponent' , 'Addition' )
36 Addition.SetName( 'Addition' )
37 Addition.SetAuthor( '' )
38 Addition.SetContainer( 'localhost/AddServer' )
39 Addition.SetComment( 'Addition from AddComponent' )
40 Addition.Coords( 11 , 268 )
42 # Creation of Computing Nodes
43 Add_ServiceinParameter = []
44 Add_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Adder' , 'Adder' ) )
45 Add_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'x' ) )
46 Add_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'y' ) )
47 Add_ServiceoutParameter = []
48 Add_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'FuncValue' ) )
49 Add_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'z' ) )
50 Add_Service = SALOME_ModuleCatalog.Service( 'Add' , Add_ServiceinParameter , Add_ServiceoutParameter , 0 )
51 Add = NewGraphEssai.CNode( Add_Service )
54 Add.SetComment( 'Compute Node' )
55 Add.Coords( 215 , 268 )
58 Subz = Sub.Port( 'z' )
59 Divx = NewGraphEssai.Link( Subz , Div.Port( 'x' ) )
61 Mulx = NewGraphEssai.Link( Subz , Mul.Port( 'x' ) )
62 Mulx.AddCoord( 1 , 595 , 348 )
63 Mulx.AddCoord( 2 , 595 , 154 )
65 Mulz = Mul.Port( 'z' )
66 Divy = NewGraphEssai.Link( Mulz , Div.Port( 'y' ) )
67 Divy.AddCoord( 1 , 805 , 183 )
68 Divy.AddCoord( 2 , 806 , 348 )
70 AdditionAdder = Addition.Port( 'Adder' )
71 AddAdder = NewGraphEssai.Link( AdditionAdder , Add.Port( 'Adder' ) )
73 AddFuncValue = Add.Port( 'FuncValue' )
74 Suby = NewGraphEssai.Link( AddFuncValue , Sub.Port( 'y' ) )
75 Suby.AddCoord( 1 , 395 , 183 )
76 Suby.AddCoord( 2 , 395 , 349 )
78 Addz = Add.Port( 'z' )
79 Muly = NewGraphEssai.Link( Addz , Mul.Port( 'y' ) )
81 # Creation of Input datas
82 Subx = Sub.Input( 'x' , 4.5)
83 Addx = Add.Input( 'x' , 1.5)
84 Addy = Add.Input( 'y' , 3)
86 # Creation of Output variables
87 Divz = Div.Port( 'z' )
95 NewGraphEssai.PrintPorts()