Salome HOME
Imported using TkCVS
[samples/datafiles.git] / Superv / Python / GraphInLines.py
1
2 # Generated python file of Graph GraphInLines
3
4 from SuperV import *
5 # Graph creation 
6 GraphInLines = Graph( 'GraphInLines' )
7 GraphInLines.SetName( 'GraphInLines' )
8 GraphInLines.SetAuthor( '' )
9 GraphInLines.SetComment( '' )
10 GraphInLines.Coords( 0 , 0 )
11
12 # Creation of Factory Nodes
13
14 # Creation of InLine Nodes
15 PyAdd = []
16 PyAdd.append( 'def Add(a,b) :  ' )
17 PyAdd.append( '    return a+b  ' )
18 PyAdd.append( '' )
19 Add = GraphInLines.INode( 'Add' , PyAdd )
20 Add.InPort( 'a' , 'long' )
21 Add.InPort( 'b' , 'long' )
22 Add.OutPort( 'f' , 'long' )
23 Add.SetName( 'Add' )
24 Add.SetAuthor( '' )
25 Add.SetComment( 'Python function' )
26 Add.Coords( 351 , 77 )
27
28 PySub = []
29 PySub.append( 'def Sub(a,b) : ' )
30 PySub.append( '    return a-b ' )
31 PySub.append( '' )
32 Sub = GraphInLines.INode( 'Sub' , PySub )
33 Sub.InPort( 'a' , 'long' )
34 Sub.InPort( 'b' , 'long' )
35 Sub.OutPort( 'f' , 'long' )
36 Sub.SetName( 'Sub' )
37 Sub.SetAuthor( '' )
38 Sub.SetComment( 'Python function' )
39 Sub.Coords( 86 , 333 )
40
41 PyMul = []
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' )
48 Mul.SetName( 'Mul' )
49 Mul.SetAuthor( '' )
50 Mul.SetComment( 'Python function' )
51 Mul.Coords( 616 , 247 )
52
53 # Creation of Links
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 )
58
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 )
63
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 )
68
69 # Creation of Input datas
70 Adda = Add.Input( 'a' , 1)
71 Suba = Sub.Input( 'a' , 3)
72 Subb = Sub.Input( 'b' , 4)
73
74 # Creation of Output variables
75 MulResult = Mul.Port( 'Result' )
76
77 GraphInLines.Run()
78
79 GraphInLines.DoneW()
80
81 GraphInLines.PrintPorts()
82