Salome HOME
The order of deletion of Ports (during the deletion of nodes) was wrong.
[modules/superv.git] / examples / GraphEssai3.py
index 94341ddba9a86bd3b3127e20a278c8393fa5cd4d..325ee695c814fcf65173a4ac6edd06c5e1cce592 100644 (file)
@@ -9,64 +9,100 @@ GraphEssai3.SetAuthor( '' )
 GraphEssai3.SetComment( '' )
 GraphEssai3.Coords( 0 , 0 )
 
-# Creation of Computing Nodes
-Add = GraphEssai3.Node( 'AddComponent' , 'AddComponent' , 'Add' )
+# Creation of Factory Nodes
+
+Add = GraphEssai3.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
 Add.SetName( 'Add' )
 Add.SetAuthor( '' )
 Add.SetContainer( 'localhost/FactoryServer' )
-Add.SetComment( '' )
+Add.SetComment( 'Add from AddComponent' )
 Add.Coords( 1 , 152 )
-Sub = GraphEssai3.Node( 'SubComponent' , 'SubComponent' , 'Sub' )
+
+Sub = GraphEssai3.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
 Sub.SetName( 'Sub' )
 Sub.SetAuthor( '' )
 Sub.SetContainer( 'localhost/FactoryServer' )
-Sub.SetComment( '' )
-Sub.Coords( 410 , 84 )
-Mul = GraphEssai3.Node( 'MulComponent' , 'MulComponent' , 'Mul' )
+Sub.SetComment( 'Sub from SubComponent' )
+Sub.Coords( 412 , 377 )
+
+Mul = GraphEssai3.FNode( 'MulComponent' , 'MulComponent' , 'Mul' )
 Mul.SetName( 'Mul' )
 Mul.SetAuthor( '' )
 Mul.SetContainer( 'localhost/FactoryServer' )
-Mul.SetComment( '' )
-Mul.Coords( 410 , 279 )
-Div = GraphEssai3.Node( 'DivComponent' , 'DivComponent' , 'Div' )
+Mul.SetComment( 'Mul from MulComponent' )
+Mul.Coords( 412 , 152 )
+
+Div = GraphEssai3.FNode( 'DivComponent' , 'DivComponent' , 'Div' )
 Div.SetName( 'Div' )
 Div.SetAuthor( '' )
 Div.SetContainer( 'localhost/FactoryServer' )
-Div.SetComment( '' )
-Div.Coords( 618 , 140 )
-Addition = GraphEssai3.Node( 'AddComponent' , 'AddComponent' , 'Addition' )
+Div.SetComment( 'Div from DivComponent' )
+Div.Coords( 622 , 124 )
+
+Addition = GraphEssai3.FNode( 'AddComponent' , 'AddComponent' , 'Addition' )
 Addition.SetName( 'Addition' )
 Addition.SetAuthor( '' )
 Addition.SetContainer( 'localhost/AdditionServer' )
-Addition.SetComment( '' )
+Addition.SetComment( 'Addition from AddComponent' )
 Addition.Coords( 0 , 0 )
-Addition_1 = GraphEssai3.Node( 'AddComponent' , 'AddComponent' , 'Addition' )
+
+Addition_1 = GraphEssai3.FNode( 'AddComponent' , 'AddComponent' , 'Addition' )
 Addition_1.SetName( 'Addition_1' )
 Addition_1.SetAuthor( '' )
 Addition_1.SetContainer( 'localhost/Addition_1Server' )
-Addition_1.SetComment( '' )
+Addition_1.SetComment( 'Addition from AddComponent' )
 Addition_1.Coords( 4 , 327 )
-AddAndCompare = GraphEssai3.CNode( 'AddComponent' , 'Adder' , 'AddAndCompare' )
+
+# Creation of Computing Nodes
+AddAndCompare_ServiceinParameter = []
+AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Adder' , 'Adder' ) )
+AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'x' ) )
+AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'y' ) )
+AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Adder' , 'anOtherAdder' ) )
+AddAndCompare_ServiceoutParameter = []
+AddAndCompare_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'FuncValue' ) )
+AddAndCompare_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'z' ) )
+AddAndCompare_ServiceinStreamParameter = []
+AddAndCompare_ServiceoutStreamParameter = []
+AddAndCompare_Service = SALOME_ModuleCatalog.Service( 'AddAndCompare' , AddAndCompare_ServiceinParameter , AddAndCompare_ServiceoutParameter , AddAndCompare_ServiceinStreamParameter , AddAndCompare_ServiceoutStreamParameter , 0 , 0 )
+AddAndCompare = GraphEssai3.CNode( AddAndCompare_Service )
 AddAndCompare.SetName( 'AddAndCompare' )
 AddAndCompare.SetAuthor( '' )
-AddAndCompare.SetComment( '' )
+AddAndCompare.SetComment( 'Python function' )
 AddAndCompare.Coords( 233 , 0 )
 
-# Creation of intermediate Output variables and of Computing Links
+# Creation of Links
 AddFuncValue = Add.Port( 'FuncValue' )
 Mulx = GraphEssai3.Link( AddFuncValue , Mul.Port( 'x' ) )
+
 AddAndComparex = GraphEssai3.Link( AddFuncValue , AddAndCompare.Port( 'x' ) )
+AddAndComparex.AddCoord( 1 , 195 , 108 )
+AddAndComparex.AddCoord( 2 , 195 , 233 )
+
 Addz = Add.Port( 'z' )
 Subx = GraphEssai3.Link( Addz , Sub.Port( 'x' ) )
+Subx.AddCoord( 1 , 187 , 459 )
+Subx.AddCoord( 2 , 186 , 262 )
+
 AddAndComparey = GraphEssai3.Link( Addz , AddAndCompare.Port( 'y' ) )
+AddAndComparey.AddCoord( 1 , 187 , 139 )
+AddAndComparey.AddCoord( 2 , 186 , 261 )
+
 Subz = Sub.Port( 'z' )
 Divx = GraphEssai3.Link( Subz , Div.Port( 'x' ) )
+Divx.AddCoord( 1 , 598 , 203 )
+Divx.AddCoord( 2 , 598 , 457 )
+
 Mulz = Mul.Port( 'z' )
 Divy = GraphEssai3.Link( Mulz , Div.Port( 'y' ) )
+
 AdditionAdder = Addition.Port( 'Adder' )
 AddAndCompareAdder = GraphEssai3.Link( AdditionAdder , AddAndCompare.Port( 'Adder' ) )
+
 Addition_1Adder = Addition_1.Port( 'Adder' )
 AddAndCompareanOtherAdder = GraphEssai3.Link( Addition_1Adder , AddAndCompare.Port( 'anOtherAdder' ) )
+AddAndCompareanOtherAdder.AddCoord( 1 , 215 , 168 )
+AddAndCompareanOtherAdder.AddCoord( 2 , 214 , 407 )
 
 # Creation of Input datas
 Addx = Add.Input( 'x' , 1)
@@ -83,7 +119,7 @@ GraphEssai3.Run()
 
 GraphEssai3.DoneW()
 
-GraphEssai3.State()
+print GraphEssai3.State()
 
 GraphEssai3.PrintPorts()