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 )
28 PySub.append( 'def Sub(a,b) : ' )
29 PySub.append( ' return a-b ' )
31 Sub = GraphInLines.INode( 'Sub' , PySub )
32 Sub.InPort( 'a' , 'long' )
33 Sub.InPort( 'b' , 'long' )
34 Sub.OutPort( 'f' , 'long' )
37 Sub.SetComment( 'Python function' )
38 Sub.Coords( 86 , 333 )
40 PyMul.append( 'def Mul(a,b) : ' )
41 PyMul.append( ' return a*b ' )
42 Mul = GraphInLines.INode( 'Mul' , PyMul )
43 Mul.InPort( 'a' , 'long' )
44 Mul.InPort( 'b' , 'long' )
45 Mul.OutPort( 'Result' , 'long' )
48 Mul.SetComment( 'Python function' )
49 Mul.Coords( 616 , 247 )
51 # Creation of intermediate Output variables and of Control Links
52 Addf = Add.Port( 'f' )
53 Mula = GraphInLines.Link( Addf , Mul.Port( 'a' ) )
54 Mula.AddCoord( 1 , 570 , 356 )
55 Mula.AddCoord( 2 , 570 , 186 )
56 Subf = Sub.Port( 'f' )
57 Mulb = GraphInLines.Link( Subf , Mul.Port( 'b' ) )
58 Mulb.AddCoord( 1 , 282 , 376 )
59 Mulb.AddCoord( 2 , 282 , 442 )
60 Addb = GraphInLines.Link( Subf , Add.Port( 'b' ) )
61 Addb.AddCoord( 1 , 283 , 209 )
62 Addb.AddCoord( 2 , 283 , 374 )
63 Addb.AddCoord( 3 , 283 , 442 )
65 # Creation of Input datas
66 Adda = Add.Input( 'a' , 1)
67 Suba = Sub.Input( 'a' , 3)
68 Subb = Sub.Input( 'b' , 4)
70 # Creation of Output variables
71 MulResult = Mul.Port( 'Result' )
77 GraphInLines.PrintPorts()