From: rahuel Date: Wed, 12 Jan 2005 12:45:43 +0000 (+0000) Subject: Graph with C++ Components loaded in the SuperVisionContainer X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1a8934b73bcf4593d63613a7c616555b005f0c9e;p=modules%2Fsuperv.git Graph with C++ Components loaded in the SuperVisionContainer --- diff --git a/examples/GraphEmbeddedComponents.py b/examples/GraphEmbeddedComponents.py new file mode 100644 index 0000000..01ac324 --- /dev/null +++ b/examples/GraphEmbeddedComponents.py @@ -0,0 +1,151 @@ + +# Generated python file of Graph GraphEssai3 + +from SuperV import * + +# Graph creation of GraphEssai3 +def DefGraphEssai3() : + GraphEssai3 = Graph( 'GraphEssai3' ) + GraphEssai3.SetName( 'GraphEssai3' ) + GraphEssai3.SetAuthor( '' ) + GraphEssai3.SetComment( '' ) + GraphEssai3.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + Add = GraphEssai3.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) + Add.SetName( 'Add' ) + Add.SetAuthor( '' ) + Add.SetContainer( 'localhost/FactoryServer' ) + Add.SetComment( 'Add from AddComponent' ) + Add.Coords( 1 , 152 ) + IAddx = Add.GetInPort( 'x' ) + IAddy = Add.GetInPort( 'y' ) + IAddGate = Add.GetInPort( 'Gate' ) + OAddFuncValue = Add.GetOutPort( 'FuncValue' ) + OAddz = Add.GetOutPort( 'z' ) + OAddGate = Add.GetOutPort( 'Gate' ) + + Sub = GraphEssai3.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) + Sub.SetName( 'Sub' ) + Sub.SetAuthor( '' ) + Sub.SetContainer( 'localhost/FactoryServer' ) + Sub.SetComment( 'Sub from SubComponent' ) + Sub.Coords( 412 , 377 ) + ISubx = Sub.GetInPort( 'x' ) + ISuby = Sub.GetInPort( 'y' ) + ISubGate = Sub.GetInPort( 'Gate' ) + OSubz = Sub.GetOutPort( 'z' ) + OSubGate = Sub.GetOutPort( 'Gate' ) + + Mul = GraphEssai3.FNode( 'MulComponent' , 'MulComponent' , 'Mul' ) + Mul.SetName( 'Mul' ) + Mul.SetAuthor( '' ) + Mul.SetContainer( 'localhost/FactoryServer' ) + Mul.SetComment( 'Mul from MulComponent' ) + Mul.Coords( 412 , 152 ) + IMulx = Mul.GetInPort( 'x' ) + IMuly = Mul.GetInPort( 'y' ) + IMulGate = Mul.GetInPort( 'Gate' ) + OMulz = Mul.GetOutPort( 'z' ) + OMulGate = Mul.GetOutPort( 'Gate' ) + + Div = GraphEssai3.FNode( 'DivComponent' , 'DivComponent' , 'Div' ) + Div.SetName( 'Div' ) + Div.SetAuthor( '' ) + Div.SetContainer( 'localhost/FactoryServer' ) + Div.SetComment( 'Div from DivComponent' ) + Div.Coords( 622 , 124 ) + IDivx = Div.GetInPort( 'x' ) + IDivy = Div.GetInPort( 'y' ) + IDivGate = Div.GetInPort( 'Gate' ) + ODivz = Div.GetOutPort( 'z' ) + ODivGate = Div.GetOutPort( 'Gate' ) + + Addition = GraphEssai3.FNode( 'AddComponent' , 'AddComponent' , 'Addition' ) + Addition.SetName( 'Addition' ) + Addition.SetAuthor( '' ) + Addition.SetContainer( 'localhost/AdditionServer' ) + Addition.SetComment( 'Addition from AddComponent' ) + Addition.Coords( 0 , 0 ) + IAdditionGate = Addition.GetInPort( 'Gate' ) + OAdditionAdder = Addition.GetOutPort( 'Adder' ) + OAdditionGate = Addition.GetOutPort( 'Gate' ) + + 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 from AddComponent' ) + Addition_1.Coords( 4 , 327 ) + IAddition_1Gate = Addition_1.GetInPort( 'Gate' ) + OAddition_1Adder = Addition_1.GetOutPort( 'Adder' ) + OAddition_1Gate = Addition_1.GetOutPort( 'Gate' ) + + # 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( 'Python function' ) + AddAndCompare.Coords( 233 , 0 ) + IAddAndCompareAdder = AddAndCompare.GetInPort( 'Adder' ) + IAddAndComparex = AddAndCompare.GetInPort( 'x' ) + IAddAndComparey = AddAndCompare.GetInPort( 'y' ) + IAddAndCompareanOtherAdder = AddAndCompare.GetInPort( 'anOtherAdder' ) + IAddAndCompareGate = AddAndCompare.GetInPort( 'Gate' ) + OAddAndCompareFuncValue = AddAndCompare.GetOutPort( 'FuncValue' ) + OAddAndComparez = AddAndCompare.GetOutPort( 'z' ) + OAddAndCompareGate = AddAndCompare.GetOutPort( 'Gate' ) + + # Creation of Links + LAddFuncValueMulx = GraphEssai3.Link( OAddFuncValue , IMulx ) + + LAddFuncValueAddAndComparex = GraphEssai3.Link( OAddFuncValue , IAddAndComparex ) + LAddFuncValueAddAndComparex.AddCoord( 1 , 195 , 108 ) + LAddFuncValueAddAndComparex.AddCoord( 2 , 195 , 233 ) + + LAddzSubx = GraphEssai3.Link( OAddz , ISubx ) + LAddzSubx.AddCoord( 1 , 187 , 459 ) + LAddzSubx.AddCoord( 2 , 186 , 262 ) + + LAddzAddAndComparey = GraphEssai3.Link( OAddz , IAddAndComparey ) + LAddzAddAndComparey.AddCoord( 1 , 187 , 139 ) + LAddzAddAndComparey.AddCoord( 2 , 186 , 261 ) + + LSubzDivx = GraphEssai3.Link( OSubz , IDivx ) + LSubzDivx.AddCoord( 1 , 598 , 203 ) + LSubzDivx.AddCoord( 2 , 598 , 457 ) + + LMulzDivy = GraphEssai3.Link( OMulz , IDivy ) + + LAdditionAdderAddAndCompareAdder = GraphEssai3.Link( OAdditionAdder , IAddAndCompareAdder ) + + LAddition_1AdderAddAndCompareanOtherAdder = GraphEssai3.Link( OAddition_1Adder , IAddAndCompareanOtherAdder ) + LAddition_1AdderAddAndCompareanOtherAdder.AddCoord( 1 , 215 , 168 ) + LAddition_1AdderAddAndCompareanOtherAdder.AddCoord( 2 , 214 , 407 ) + + # Input datas + IAddx.Input( 1 ) + IAddy.Input( 2 ) + ISuby.Input( 3 ) + IMuly.Input( 4 ) + + # Output Ports of the graph + #ODivz = Div.GetOutPort( 'z' ) + #OAddAndCompareFuncValue = AddAndCompare.GetOutPort( 'FuncValue' ) + #OAddAndComparez = AddAndCompare.GetOutPort( 'z' ) + return GraphEssai3 + + +GraphEssai3 = DefGraphEssai3() diff --git a/examples/GraphEmbeddedComponents.xml b/examples/GraphEmbeddedComponents.xml new file mode 100644 index 0000000..ab9c151 --- /dev/null +++ b/examples/GraphEmbeddedComponents.xml @@ -0,0 +1,365 @@ + + + + + +? + ? + GraphEssai3 + 1 + ? + +GraphEssai3 + + +double + Add__x + +double + Add__y + +double + Sub__y + +double + Mul__y + + +double + Div__z + +double + AddAndCompare__FuncValue + +double + AddAndCompare__z + + + 11/3/2003 - 10:59:37 + 11/1/2005 - 16:42:5 + 1.04 + ? + ? + ? + 0 + 0 + + +AddComponent + AddComponent + Add + 0 + ? + +Add + + +double + x + +double + y + + +double + FuncValue + +double + z + + + 11/1/2005 - 16:42:5 + 11/1/2005 - 16:42:5 + 1.04 + ? + localhost/FactoryServer + Add from AddComponent + 1 + 152 + +SubComponent + SubComponent + Sub + 0 + ? + +Sub + + +double + x + +double + y + + +double + z + + + 11/1/2005 - 16:42:5 + 11/1/2005 - 16:42:5 + 1.04 + ? + localhost/FactoryServer + Sub from SubComponent + 412 + 377 + +MulComponent + MulComponent + Mul + 0 + ? + +Mul + + +double + x + +double + y + + +double + z + + + 11/1/2005 - 16:42:5 + 11/1/2005 - 16:42:5 + 1.04 + ? + localhost/FactoryServer + Mul from MulComponent + 412 + 152 + +DivComponent + DivComponent + Div + 0 + ? + +Div + + +double + x + +double + y + + +double + z + + + 11/1/2005 - 16:42:5 + 11/1/2005 - 16:42:5 + 1.04 + ? + localhost/FactoryServer + Div from DivComponent + 622 + 124 + +AddComponent + AddComponent + Addition + 0 + ? + +Addition + + + +Adder + Adder + + + 11/1/2005 - 16:42:5 + 11/1/2005 - 16:42:5 + 1.04 + ? + localhost/AdditionServer + Addition from AddComponent + 0 + 0 + +AddComponent + AddComponent + Addition_1 + 0 + ? + +Addition + + + +Adder + Adder + + + 11/1/2005 - 16:42:5 + 11/1/2005 - 16:42:5 + 1.04 + ? + localhost/Addition_1Server + Addition from AddComponent + 4 + 327 + +? + ? + AddAndCompare + 2 + ? + +AddAndCompare + + +Adder + Adder + +double + x + +double + y + +Adder + anOtherAdder + + +double + FuncValue + +double + z + + + 11/1/2005 - 16:42:5 + 11/1/2005 - 16:42:5 + 1.04 + ? + ? + Python function + 233 + 0 + + +Add + FuncValue + Mul + x + + +Add + FuncValue + AddAndCompare + x + + +195 + 108 + +195 + 233 + +Add + z + Sub + x + + +187 + 459 + +186 + 262 + +Add + z + AddAndCompare + y + + +187 + 139 + +186 + 261 + +Sub + z + Div + x + + +598 + 203 + +598 + 457 + +Mul + z + Div + y + + +Addition + Adder + AddAndCompare + Adder + + +Addition_1 + Adder + AddAndCompare + anOtherAdder + + +215 + 168 + +214 + 407 + + +GraphEssai3 + Add__x + Add + x + +7 + 1 + + +GraphEssai3 + Add__y + Add + y + +7 + 2 + + +GraphEssai3 + Sub__y + Sub + y + +7 + 3 + + +GraphEssai3 + Mul__y + Mul + y + +7 + 4 +