Salome HOME
Imported using TkCVS
[samples/datafiles.git] / Superv / Python / newsupervisionexample.py
diff --git a/Superv/Python/newsupervisionexample.py b/Superv/Python/newsupervisionexample.py
new file mode 100644 (file)
index 0000000..053065e
--- /dev/null
@@ -0,0 +1,68 @@
+#  Copyright (C) 2003  CEA/DEN, EDF R&D
+#
+#
+#
+#  File   : newsupervisionexample.py
+#  Module : SuperVisionTest
+
+from SuperV import *
+# Graph creation 
+newsupervisionexample = Graph( 'newsupervisionexample' )
+newsupervisionexample.SetName( 'newsupervisionexample' )
+newsupervisionexample.SetAuthor( '' )
+newsupervisionexample.SetComment( '' )
+newsupervisionexample.Coords( 0 , 0 )
+
+# Creation of Computing Nodes
+Add = newsupervisionexample.Node( 'AddComponent' , 'AddComponent' , 'Add' )
+Add.SetName( 'Add' )
+Add.SetAuthor( '' )
+Add.SetContainer( 'FactoryServer' )
+Add.SetComment( '' )
+Add.Coords( 15 , 241 )
+Sub = newsupervisionexample.Node( 'SubComponent' , 'SubComponent' , 'Sub' )
+Sub.SetName( 'Sub' )
+Sub.SetAuthor( '' )
+Sub.SetContainer( 'FactoryServer' )
+Sub.SetComment( '' )
+Sub.Coords( 227 , 99 )
+Mul = newsupervisionexample.Node( 'MulComponent' , 'MulComponent' , 'Mul' )
+Mul.SetName( 'Mul' )
+Mul.SetAuthor( '' )
+Mul.SetContainer( 'FactoryServer' )
+Mul.SetComment( '' )
+Mul.Coords( 443 , 278 )
+Div = newsupervisionexample.Node( 'DivComponent' , 'DivComponent' , 'Div' )
+Div.SetName( 'Div' )
+Div.SetAuthor( '' )
+Div.SetContainer( 'FactoryServer' )
+Div.SetComment( '' )
+Div.Coords( 634 , 97 )
+
+# Creation of intermediate Output variables and of Computing Links
+Addz = Add.Port( 'z' )
+Suby = newsupervisionexample.Link( Addz , Sub.Port( 'y' ) )
+Muly = newsupervisionexample.Link( Addz , Mul.Port( 'y' ) )
+Subz = Sub.Port( 'z' )
+Mulx = newsupervisionexample.Link( Subz , Mul.Port( 'x' ) )
+Divx = newsupervisionexample.Link( Subz , Div.Port( 'x' ) )
+Mulz = Mul.Port( 'z' )
+Divy = newsupervisionexample.Link( Mulz , Div.Port( 'y' ) )
+
+# Creation of Input datas
+Addx = Add.Input( 'x' , 3)
+Addy = Add.Input( 'y' , 4.5)
+Subx = Sub.Input( 'x' , 1.5)
+
+# Creation of Output variables
+AddFuncValue = Add.Port( 'FuncValue' )
+Divz = Div.Port( 'z' )
+
+newsupervisionexample.Run()
+
+newsupervisionexample.DoneW()
+
+newsupervisionexample.State()
+
+newsupervisionexample.PrintPorts()
+