2 # Generated python file of Graph GraphInLines
6 GraphInLines = Graph( 'GraphInLines' )
7 GraphInLines.SetName( 'GraphInLines' )
8 GraphInLines.SetAuthor( '' )
9 GraphInLines.SetComment( '' )
10 GraphInLines.Coords( 0 , 0 )
12 # Creation of Factory Nodes
14 # Creation of InLine Nodes
16 PyAdd.append( 'def Add(a,b) : ' )
17 PyAdd.append( ' return a+b ' )
19 Add = GraphInLines.INode( 'Add' , PyAdd )
20 Add.InPort( 'a' , 'long' )
21 Add.InPort( 'b' , 'long' )
22 Add.OutPort( 'f' , 'long' )
25 Add.SetComment( 'Python function' )
26 Add.Coords( 351 , 77 )
29 PySub.append( 'def Sub(a,b) : ' )
30 PySub.append( ' return a-b ' )
32 Sub = GraphInLines.INode( 'Sub' , PySub )
33 Sub.InPort( 'a' , 'long' )
34 Sub.InPort( 'b' , 'long' )
35 Sub.OutPort( 'f' , 'long' )
38 Sub.SetComment( 'Python function' )
39 Sub.Coords( 86 , 333 )
42 PyMul.append( 'def Mul(a,b) : ' )
43 PyMul.append( ' return a*b ' )
44 Mul = GraphInLines.INode( 'Mul' , PyMul )
45 Mul.InPort( 'a' , 'long' )
46 Mul.InPort( 'b' , 'long' )
47 Mul.OutPort( 'Result' , 'long' )
50 Mul.SetComment( 'Python function' )
51 Mul.Coords( 616 , 247 )
54 Addf = Add.Port( 'f' )
55 Mula = GraphInLines.Link( Addf , Mul.Port( 'a' ) )
56 Mula.AddCoord( 1 , 569 , 326 )
57 Mula.AddCoord( 2 , 569 , 158 )
59 Subf = Sub.Port( 'f' )
60 Mulb = GraphInLines.Link( Subf , Mul.Port( 'b' ) )
61 Mulb.AddCoord( 1 , 283 , 358 )
62 Mulb.AddCoord( 2 , 281 , 413 )
64 Addb = GraphInLines.Link( Subf , Add.Port( 'b' ) )
65 Addb.AddCoord( 1 , 283 , 187 )
66 Addb.AddCoord( 2 , 282 , 356 )
67 Addb.AddCoord( 3 , 281 , 414 )
69 # Creation of Input datas
70 Adda = Add.Input( 'a' , 1)
71 Suba = Sub.Input( 'a' , 3)
72 Subb = Sub.Input( 'b' , 4)
74 # Creation of Output variables
75 MulResult = Mul.Port( 'Result' )
81 GraphInLines.PrintPorts()