Salome HOME
Imported using TkCVS
[samples/datafiles.git] / Superv / Python / GraphContainer.py
1
2 # Generated python file of Graph GraphEssai
3
4 from SuperV import *
5 # Graph creation 
6 GraphEssai = Graph( 'GraphEssai' )
7 GraphEssai.SetName( 'GraphEssai' )
8 GraphEssai.SetAuthor( '' )
9 GraphEssai.SetComment( '' )
10 GraphEssai.Coords( 0 , 0 )
11
12 # Creation of Factory Nodes
13
14 Add = GraphEssai.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
21 Sub = GraphEssai.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
22 Sub.SetName( 'Sub' )
23 Sub.SetAuthor( '' )
24 Sub.SetContainer( 'FactoryServer' )
25 Sub.SetComment( 'Sub from SubComponent' )
26 Sub.Coords( 227 , 96 )
27
28 Mul = GraphEssai.FNode( 'MulComponent' , 'MulComponent' , 'Mul' )
29 Mul.SetName( 'Mul' )
30 Mul.SetAuthor( '' )
31 Mul.SetContainer( 'FactoryServer' )
32 Mul.SetComment( 'Mul from MulComponent' )
33 Mul.Coords( 435 , 242 )
34
35 Div = GraphEssai.FNode( 'DivComponent' , 'DivComponent' , 'Div' )
36 Div.SetName( 'Div' )
37 Div.SetAuthor( '' )
38 Div.SetContainer( 'FactoryServer' )
39 Div.SetComment( 'Div from DivComponent' )
40 Div.Coords( 634 , 97 )
41
42 # Creation of Links
43 Addz = Add.Port( 'z' )
44 Muly = GraphEssai.Link( Addz , Mul.Port( 'y' ) )
45
46 Suby = GraphEssai.Link( Addz , Sub.Port( 'y' ) )
47 Suby.AddCoord( 1 , 197 , 204 )
48 Suby.AddCoord( 2 , 198 , 351 )
49
50 Subz = Sub.Port( 'z' )
51 Divx = GraphEssai.Link( Subz , Div.Port( 'x' ) )
52
53 Mulx = GraphEssai.Link( Subz , Mul.Port( 'x' ) )
54 Mulx.AddCoord( 1 , 411 , 323 )
55 Mulx.AddCoord( 2 , 411 , 177 )
56
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 )
61
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)
66
67 # Creation of Output variables
68 AddFuncValue = Add.Port( 'FuncValue' )
69 Divz = Div.Port( 'z' )
70
71 Add.Print()
72 Sub.Print()
73 Mul.Print()
74 Div.Print()
75
76 GraphEssai.PrintPorts()
77
78 nodes = GraphEssai.LevelNodes( 0 )
79 i = 0
80 while i < len( nodes ) :
81     print 'Nodes of level 0',nodes[i].Name()
82     i = i + 1
83
84 GraphEssai.Run()
85
86 GraphEssai.DoneW()
87
88 GraphEssai.State()
89
90 GraphEssai.PrintPorts()
91