Salome HOME
NRI : Merge from BRANCH_Superv_DataStream.
[modules/superv.git] / examples / GraphStream.py
1
2 # Generated python file of Graph GraphStream
3
4 from SuperV import *
5 # Graph creation 
6 GraphStream = Graph( 'GraphStream' )
7 GraphStream.SetName( 'GraphStream' )
8 GraphStream.SetAuthor( '' )
9 GraphStream.SetComment( '' )
10 GraphStream.Coords( 0 , 0 )
11
12 # Creation of Factory Nodes
13
14 Add = GraphStream.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
15 Add.SetName( 'Add' )
16 Add.SetAuthor( '' )
17 Add.SetContainer( 'FactoryServer' )
18 Add.SetComment( 'Add from AddComponent' )
19 Add.Coords( 15 , 241 )
20 Add.InDataStreamPort( 'istream' , 'long' )
21 Add.OutDataStreamPort( 'ostream' , 'long' )
22 Add.OutDataStreamPort( 'Ostream' , 'long' )
23
24 Sub = GraphStream.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
25 Sub.SetName( 'Sub' )
26 Sub.SetAuthor( '' )
27 Sub.SetContainer( 'FactoryServer' )
28 Sub.SetComment( 'Sub from SubComponent' )
29 Sub.Coords( 227 , 99 )
30 Sub.InDataStreamPort( 'istream' , 'long' )
31 Sub.InDataStreamPort( 'Istream' , 'long' )
32
33 Mul = GraphStream.FNode( 'MulComponent' , 'MulComponent' , 'Mul' )
34 Mul.SetName( 'Mul' )
35 Mul.SetAuthor( '' )
36 Mul.SetContainer( 'FactoryServer' )
37 Mul.SetComment( 'Mul from MulComponent' )
38 Mul.Coords( 444 , 241 )
39
40 Div = GraphStream.FNode( 'DivComponent' , 'DivComponent' , 'Div' )
41 Div.SetName( 'Div' )
42 Div.SetAuthor( '' )
43 Div.SetContainer( 'FactoryServer' )
44 Div.SetComment( 'Div from DivComponent' )
45 Div.Coords( 634 , 98 )
46 Div.OutDataStreamPort( 'ostream' , 'long' )
47
48 # Creation of Links
49 Addz = Add.Port( 'z' )
50 Suby = GraphStream.Link( Addz , Sub.Port( 'y' ) )
51 Suby.AddCoord( 1 , 189 , 207 )
52 Suby.AddCoord( 2 , 189 , 350 )
53
54 Muly = GraphStream.Link( Addz , Mul.Port( 'y' ) )
55
56 Addostream = Add.Port( 'ostream' )
57 Subistream = GraphStream.Link( Addostream , Sub.Port( 'istream' ) )
58 Subistream.AddCoord( 1 , 201 , 237 )
59 Subistream.AddCoord( 2 , 200 , 378 )
60
61 AddOstream = Add.Port( 'Ostream' )
62 SubIstream = GraphStream.Link( AddOstream , Sub.Port( 'Istream' ) )
63 SubIstream.AddCoord( 1 , 212 , 267 )
64 SubIstream.AddCoord( 2 , 211 , 409 )
65
66 Subz = Sub.Port( 'z' )
67 Mulx = GraphStream.Link( Subz , Mul.Port( 'x' ) )
68 Mulx.AddCoord( 1 , 420 , 322 )
69 Mulx.AddCoord( 2 , 419 , 180 )
70
71 Divx = GraphStream.Link( Subz , Div.Port( 'x' ) )
72
73 Mulz = Mul.Port( 'z' )
74 Divy = GraphStream.Link( Mulz , Div.Port( 'y' ) )
75 Divy.AddCoord( 1 , 622 , 207 )
76 Divy.AddCoord( 2 , 623 , 320 )
77
78 # Creation of Input datas
79 Addx = Add.Input( 'x' , 3)
80 Addy = Add.Input( 'y' , 4.5)
81 Subx = Sub.Input( 'x' , 1.5)
82 Addistream = Add.Input( 'istream' , 1)
83
84 # Creation of Output variables
85 AddFuncValue = Add.Port( 'FuncValue' )
86 Divz = Div.Port( 'z' )
87 Divostream = Div.Port( 'ostream' )
88
89 GraphStream.Run()
90 GraphStream.DoneW()
91 GraphStream.PrintPorts()