2 # Generated python file of Graph GraphEssai
6 GraphEssai = Graph( 'GraphEssai' )
7 GraphEssai.SetName( 'GraphEssai' )
8 GraphEssai.SetAuthor( '' )
9 GraphEssai.SetComment( '' )
10 GraphEssai.Coords( 0 , 0 )
12 # Creation of Factory Nodes
14 Add = GraphEssai.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
17 Add.SetContainer( 'FactoryServer' )
18 Add.SetComment( 'Add from AddComponent' )
19 Add.Coords( 15 , 241 )
21 Sub = GraphEssai.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
24 Sub.SetContainer( 'FactoryServer' )
25 Sub.SetComment( 'Sub from SubComponent' )
26 Sub.Coords( 227 , 96 )
28 Mul = GraphEssai.FNode( 'MulComponent' , 'MulComponent' , 'Mul' )
31 Mul.SetContainer( 'FactoryServer' )
32 Mul.SetComment( 'Mul from MulComponent' )
33 Mul.Coords( 435 , 242 )
35 Div = GraphEssai.FNode( 'DivComponent' , 'DivComponent' , 'Div' )
38 Div.SetContainer( 'FactoryServer' )
39 Div.SetComment( 'Div from DivComponent' )
40 Div.Coords( 634 , 97 )
43 Addz = Add.Port( 'z' )
44 Muly = GraphEssai.Link( Addz , Mul.Port( 'y' ) )
46 Suby = GraphEssai.Link( Addz , Sub.Port( 'y' ) )
47 Suby.AddCoord( 1 , 197 , 204 )
48 Suby.AddCoord( 2 , 198 , 351 )
50 Subz = Sub.Port( 'z' )
51 Divx = GraphEssai.Link( Subz , Div.Port( 'x' ) )
53 Mulx = GraphEssai.Link( Subz , Mul.Port( 'x' ) )
54 Mulx.AddCoord( 1 , 411 , 323 )
55 Mulx.AddCoord( 2 , 411 , 177 )
57 Mulz = Mul.Port( 'z' )
58 Divy = GraphEssai.Link( Mulz , Div.Port( 'y' ) )
59 Divy.AddCoord( 1 , 612 , 207 )
60 Divy.AddCoord( 2 , 612 , 322 )
62 # Creation of Input datas
63 Addx = Add.Input( 'x' , 3)
64 Addy = Add.Input( 'y' , 4.5)
65 Subx = Sub.Input( 'x' , 1.5)
67 # Creation of Output variables
68 AddFuncValue = Add.Port( 'FuncValue' )
69 Divz = Div.Port( 'z' )
76 GraphEssai.PrintPorts()
78 nodes = GraphEssai.LevelNodes( 0 )
80 while i < len( nodes ) :
81 print 'Nodes of level 0',nodes[i].Name()
90 GraphEssai.PrintPorts()