1 # Copyright (C) 2003 CEA/DEN, EDF R&D
5 # File : newsupervisionexample.py
6 # Module : SuperVisionTest
10 newsupervisionexample = Graph( 'newsupervisionexample' )
11 newsupervisionexample.SetName( 'newsupervisionexample' )
12 newsupervisionexample.SetAuthor( '' )
13 newsupervisionexample.SetComment( '' )
14 newsupervisionexample.Coords( 0 , 0 )
16 # Creation of Computing Nodes
17 Add = newsupervisionexample.Node( 'AddComponent' , 'AddComponent' , 'Add' )
20 Add.SetContainer( 'FactoryServer' )
22 Add.Coords( 15 , 241 )
23 Sub = newsupervisionexample.Node( 'SubComponent' , 'SubComponent' , 'Sub' )
26 Sub.SetContainer( 'FactoryServer' )
28 Sub.Coords( 227 , 99 )
29 Mul = newsupervisionexample.Node( 'MulComponent' , 'MulComponent' , 'Mul' )
32 Mul.SetContainer( 'FactoryServer' )
34 Mul.Coords( 443 , 278 )
35 Div = newsupervisionexample.Node( 'DivComponent' , 'DivComponent' , 'Div' )
38 Div.SetContainer( 'FactoryServer' )
40 Div.Coords( 634 , 97 )
42 # Creation of intermediate Output variables and of Computing Links
43 Addz = Add.Port( 'z' )
44 Suby = newsupervisionexample.Link( Addz , Sub.Port( 'y' ) )
45 Muly = newsupervisionexample.Link( Addz , Mul.Port( 'y' ) )
46 Subz = Sub.Port( 'z' )
47 Mulx = newsupervisionexample.Link( Subz , Mul.Port( 'x' ) )
48 Divx = newsupervisionexample.Link( Subz , Div.Port( 'x' ) )
49 Mulz = Mul.Port( 'z' )
50 Divy = newsupervisionexample.Link( Mulz , Div.Port( 'y' ) )
52 # Creation of Input datas
53 Addx = Add.Input( 'x' , 3)
54 Addy = Add.Input( 'y' , 4.5)
55 Subx = Sub.Input( 'x' , 1.5)
57 # Creation of Output variables
58 AddFuncValue = Add.Port( 'FuncValue' )
59 Divz = Div.Port( 'z' )
61 newsupervisionexample.Run()
63 newsupervisionexample.DoneW()
65 newsupervisionexample.State()
67 newsupervisionexample.PrintPorts()