1 # Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
3 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 # File : newsupervisionexample.py
23 # Module : SuperVisionTest
27 newsupervisionexample = Graph( 'newsupervisionexample' )
28 newsupervisionexample.SetName( 'newsupervisionexample' )
29 newsupervisionexample.SetAuthor( '' )
30 newsupervisionexample.SetComment( '' )
31 newsupervisionexample.Coords( 0 , 0 )
33 # Creation of Computing Nodes
34 Add = newsupervisionexample.Node( 'AddComponent' , 'AddComponent' , 'Add' )
37 Add.SetContainer( 'FactoryServer' )
39 Add.Coords( 15 , 241 )
40 Sub = newsupervisionexample.Node( 'SubComponent' , 'SubComponent' , 'Sub' )
43 Sub.SetContainer( 'FactoryServer' )
45 Sub.Coords( 227 , 99 )
46 Mul = newsupervisionexample.Node( 'MulComponent' , 'MulComponent' , 'Mul' )
49 Mul.SetContainer( 'FactoryServer' )
51 Mul.Coords( 443 , 278 )
52 Div = newsupervisionexample.Node( 'DivComponent' , 'DivComponent' , 'Div' )
55 Div.SetContainer( 'FactoryServer' )
57 Div.Coords( 634 , 97 )
59 # Creation of intermediate Output variables and of Computing Links
60 Addz = Add.Port( 'z' )
61 Suby = newsupervisionexample.Link( Addz , Sub.Port( 'y' ) )
62 Muly = newsupervisionexample.Link( Addz , Mul.Port( 'y' ) )
63 Subz = Sub.Port( 'z' )
64 Mulx = newsupervisionexample.Link( Subz , Mul.Port( 'x' ) )
65 Divx = newsupervisionexample.Link( Subz , Div.Port( 'x' ) )
66 Mulz = Mul.Port( 'z' )
67 Divy = newsupervisionexample.Link( Mulz , Div.Port( 'y' ) )
69 # Creation of Input datas
70 Addx = Add.Input( 'x' , 3)
71 Addy = Add.Input( 'y' , 4.5)
72 Subx = Sub.Input( 'x' , 1.5)
74 # Creation of Output variables
75 AddFuncValue = Add.Port( 'FuncValue' )
76 Divz = Div.Port( 'z' )
78 newsupervisionexample.Run()
80 newsupervisionexample.DoneW()
82 newsupervisionexample.State()
84 newsupervisionexample.PrintPorts()