From 25a68d55a2ff9b96c112837252221daa44a5e3f9 Mon Sep 17 00:00:00 2001 From: rahuel Date: Wed, 26 Oct 2005 13:07:30 +0000 Subject: [PATCH] New test of MacroNodes --- Superv/Graphs/GraphAdd.xml | 92 +++++ Superv/Graphs/GraphMacroNodes1.xml | 594 +++++++++++++++++++++++++++++ Superv/Graphs/GraphSub.xml | 84 ++++ Superv/Python/GraphAdd.py | 39 ++ Superv/Python/GraphMacroNodes1.py | 209 ++++++++++ Superv/Python/GraphSub.py | 37 ++ 6 files changed, 1055 insertions(+) create mode 100644 Superv/Graphs/GraphAdd.xml create mode 100644 Superv/Graphs/GraphMacroNodes1.xml create mode 100644 Superv/Graphs/GraphSub.xml create mode 100644 Superv/Python/GraphAdd.py create mode 100644 Superv/Python/GraphMacroNodes1.py create mode 100644 Superv/Python/GraphSub.py diff --git a/Superv/Graphs/GraphAdd.xml b/Superv/Graphs/GraphAdd.xml new file mode 100644 index 0000000..7ebce75 --- /dev/null +++ b/Superv/Graphs/GraphAdd.xml @@ -0,0 +1,92 @@ + + + + + + ? + ? + GraphAdd + 1 + ? + + aNewDataFlow + + + double + Add__x + + + double + Add__y + + + + + double + Add__FuncValue + + + double + Add__z + + + + + + 28/9/2005 - 16:2:26 + 28/9/2005 - 16:2:39 + 2.0 + ? + ? + ? + 0 + 0 + + + + + AddComponent + AddComponent + Add + 0 + ? + + Add + + + double + x + + + double + y + + + + + double + FuncValue + + + double + z + + + + + + 28/9/2005 - 16:2:39 + 28/9/2005 - 16:2:39 + 2.0 + ? + localhost/FactoryServer + Add from AddComponent + 55 + 61 + + + + + + + diff --git a/Superv/Graphs/GraphMacroNodes1.xml b/Superv/Graphs/GraphMacroNodes1.xml new file mode 100644 index 0000000..644d256 --- /dev/null +++ b/Superv/Graphs/GraphMacroNodes1.xml @@ -0,0 +1,594 @@ + + + + + + ? + ? + GraphMacroNodes1_1 + 1 + ? + + GraphMacroNodes1_1 + + + double + Add__x + + + double + Add__y + + + double + Sub__x + + + double + Div__x + + + double + Div__y + + + + + double + Mul__z + + + double + Div__z + + + double + Macro_GraphAdd__Add__FuncValue + + + double + Macro_GraphAdd__Add__z + + + + + + 11/3/2003 - 9:58:58 + 28/9/2005 - 16:42:9 + 1.04 + ? + ? + ? + 0 + 0 + + + + + AddComponent + AddComponent + Add + 0 + ? + + Add + + + double + x + + + double + y + + + + + double + FuncValue + + + double + z + + + + + + 28/9/2005 - 16:42:9 + 28/9/2005 - 16:42:9 + 1.04 + ? + FactoryServer + Add from AddComponent + 15 + 241 + + + SubComponent + SubComponent + Sub + 0 + ? + + Sub + + + double + x + + + double + y + + + + + double + z + + + + + + 28/9/2005 - 16:42:9 + 28/9/2005 - 16:42:9 + 1.04 + ? + FactoryServer + Sub from SubComponent + 227 + 99 + + + MulComponent + MulComponent + Mul + 0 + ? + + Mul + + + double + x + + + double + y + + + + + double + z + + + + + + 28/9/2005 - 16:42:9 + 28/9/2005 - 16:42:9 + 1.04 + ? + FactoryServer + Mul from MulComponent + 468 + 301 + + + DivComponent + DivComponent + Div + 0 + ? + + Div + + + double + x + + + double + y + + + + + double + z + + + + + + 28/9/2005 - 16:42:9 + 28/9/2005 - 16:42:9 + 1.04 + ? + FactoryServer + Div from DivComponent + 642 + 128 + + + ? + ? + Macro_GraphAdd + 10 + GraphAdd_1 + + GraphAdd + + + double + Add__x + + + double + Add__y + + + + + double + Add__FuncValue + + + double + Add__z + + + + + + + ? + + + + 28/9/2005 - 16:42:9 + 28/9/2005 - 16:42:9 + 2.0 + ? + ? + Macro Node + 434 + 128 + + + ? + ? + Macro_GraphSub + 10 + GraphSub_1 + + GraphSub + + + double + Sub__x + + + double + Sub__y + + + + + double + Sub__z + + + + + + + ? + + + + 28/9/2005 - 16:42:9 + 28/9/2005 - 16:42:9 + 2.0 + ? + ? + Macro Node + 240 + 301 + + + + + Add + FuncValue + Macro_GraphSub + Sub__x + + + + Add + FuncValue + Macro_GraphAdd + Add__y + + + + Add + z + Sub + y + + + + Add + z + Macro_GraphSub + Sub__y + + + + Sub + z + Mul + x + + + + Sub + z + Macro_GraphAdd + Add__x + + + + Macro_GraphAdd + Gate + Div + Gate + + + + Macro_GraphSub + Sub__z + Mul + y + + + + Macro_GraphSub + Gate + Mul + Gate + + + + + + GraphMacroNodes1_1 + Add__x + Add + x + + 7 + 3 + + + + + GraphMacroNodes1_1 + Add__y + Add + y + + 7 + 4.5 + + + + + GraphMacroNodes1_1 + Sub__x + Sub + x + + 7 + 1.5 + + + + + GraphMacroNodes1_1 + Div__x + Div + x + + 7 + 1 + + + + + GraphMacroNodes1_1 + Div__y + Div + y + + 7 + 2 + + + + + + + + + ? + ? + GraphAdd_1 + 1 + ? + + GraphAdd_1 + + + double + Add__x + + + double + Add__y + + + + + double + Add__FuncValue + + + double + Add__z + + + + + + 28/9/2005 - 16:2:26 + 28/9/2005 - 16:42:9 + 2.0 + ? + ? + ? + 0 + 0 + + + + + AddComponent + AddComponent + Add + 0 + ? + + Add + + + double + x + + + double + y + + + + + double + FuncValue + + + double + z + + + + + + 28/9/2005 - 16:42:9 + 28/9/2005 - 16:42:9 + 2.0 + ? + localhost/FactoryServer + Add from AddComponent + 55 + 61 + + + + + + + + + ? + ? + GraphSub_1 + 1 + ? + + GraphSub_1 + + + double + Sub__x + + + double + Sub__y + + + + + double + Sub__z + + + + + + 28/9/2005 - 16:4:7 + 28/9/2005 - 16:42:9 + 2.0 + ? + ? + ? + 0 + 0 + + + + + SubComponent + SubComponent + Sub + 0 + ? + + Sub + + + double + x + + + double + y + + + + + double + z + + + + + + 28/9/2005 - 16:42:9 + 28/9/2005 - 16:42:9 + 2.0 + ? + localhost/FactoryServer + Sub from SubComponent + 55 + 71 + + + + + + + diff --git a/Superv/Graphs/GraphSub.xml b/Superv/Graphs/GraphSub.xml new file mode 100644 index 0000000..bb916ee --- /dev/null +++ b/Superv/Graphs/GraphSub.xml @@ -0,0 +1,84 @@ + + + + + + ? + ? + GraphSub + 1 + ? + + GraphSub + + + double + Sub__x + + + double + Sub__y + + + + + double + Sub__z + + + + + + 28/9/2005 - 16:4:7 + 28/9/2005 - 16:4:20 + 2.0 + ? + ? + ? + 0 + 0 + + + + + SubComponent + SubComponent + Sub + 0 + ? + + Sub + + + double + x + + + double + y + + + + + double + z + + + + + + 28/9/2005 - 16:4:20 + 28/9/2005 - 16:4:20 + 2.0 + ? + localhost/FactoryServer + Sub from SubComponent + 55 + 71 + + + + + + + diff --git a/Superv/Python/GraphAdd.py b/Superv/Python/GraphAdd.py new file mode 100644 index 0000000..98fd731 --- /dev/null +++ b/Superv/Python/GraphAdd.py @@ -0,0 +1,39 @@ + +# Generated python file of Graph GraphAdd + +from SuperV import * + +# Graph creation of GraphAdd +def DefGraphAdd() : + GraphAdd = Graph( 'GraphAdd' ) + GraphAdd.SetName( 'GraphAdd' ) + GraphAdd.SetAuthor( '' ) + GraphAdd.SetComment( '' ) + GraphAdd.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + Add = GraphAdd.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) + Add.SetName( 'Add' ) + Add.SetAuthor( '' ) + Add.SetContainer( 'localhost/FactoryServer' ) + Add.SetComment( 'Add from AddComponent' ) + Add.Coords( 55 , 61 ) + IAddx = Add.GetInPort( 'x' ) + IAddy = Add.GetInPort( 'y' ) + IAddGate = Add.GetInPort( 'Gate' ) + OAddFuncValue = Add.GetOutPort( 'FuncValue' ) + OAddz = Add.GetOutPort( 'z' ) + OAddGate = Add.GetOutPort( 'Gate' ) + + # Input Ports of the graph + #IAddx = Add.GetInPort( 'x' ) + #IAddy = Add.GetInPort( 'y' ) + + # Output Ports of the graph + #OAddFuncValue = Add.GetOutPort( 'FuncValue' ) + #OAddz = Add.GetOutPort( 'z' ) + return GraphAdd + + +GraphAdd = DefGraphAdd() diff --git a/Superv/Python/GraphMacroNodes1.py b/Superv/Python/GraphMacroNodes1.py new file mode 100644 index 0000000..46e9adc --- /dev/null +++ b/Superv/Python/GraphMacroNodes1.py @@ -0,0 +1,209 @@ + +# Generated python file of Graph GraphMacroNodes1 + +from SuperV import * + +# Graph creation of GraphMacroNodes1 +def DefGraphMacroNodes1() : + GraphMacroNodes1 = Graph( 'GraphMacroNodes1' ) + GraphMacroNodes1.SetName( 'GraphMacroNodes1' ) + GraphMacroNodes1.SetAuthor( '' ) + GraphMacroNodes1.SetComment( '' ) + GraphMacroNodes1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + Add = GraphMacroNodes1.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) + Add.SetName( 'Add' ) + Add.SetAuthor( '' ) + Add.SetContainer( 'FactoryServer' ) + Add.SetComment( 'Add from AddComponent' ) + Add.Coords( 15 , 241 ) + 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 = GraphMacroNodes1.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) + Sub.SetName( 'Sub' ) + Sub.SetAuthor( '' ) + Sub.SetContainer( 'FactoryServer' ) + Sub.SetComment( 'Sub from SubComponent' ) + Sub.Coords( 227 , 99 ) + ISubx = Sub.GetInPort( 'x' ) + ISuby = Sub.GetInPort( 'y' ) + ISubGate = Sub.GetInPort( 'Gate' ) + OSubz = Sub.GetOutPort( 'z' ) + OSubGate = Sub.GetOutPort( 'Gate' ) + + Mul = GraphMacroNodes1.FNode( 'MulComponent' , 'MulComponent' , 'Mul' ) + Mul.SetName( 'Mul' ) + Mul.SetAuthor( '' ) + Mul.SetContainer( 'FactoryServer' ) + Mul.SetComment( 'Mul from MulComponent' ) + Mul.Coords( 469 , 304 ) + IMulx = Mul.GetInPort( 'x' ) + IMuly = Mul.GetInPort( 'y' ) + IMulGate = Mul.GetInPort( 'Gate' ) + OMulz = Mul.GetOutPort( 'z' ) + OMulGate = Mul.GetOutPort( 'Gate' ) + + Div = GraphMacroNodes1.FNode( 'DivComponent' , 'DivComponent' , 'Div' ) + Div.SetName( 'Div' ) + Div.SetAuthor( '' ) + Div.SetContainer( 'FactoryServer' ) + Div.SetComment( 'Div from DivComponent' ) + Div.Coords( 668 , 200 ) + IDivx = Div.GetInPort( 'x' ) + IDivy = Div.GetInPort( 'y' ) + IDivGate = Div.GetInPort( 'Gate' ) + ODivz = Div.GetOutPort( 'z' ) + ODivGate = Div.GetOutPort( 'Gate' ) + + # Creation of Macro Nodes + GraphAdd = DefGraphAdd() + Macro_GraphAdd = GraphMacroNodes1.GraphMNode( GraphAdd ) + Macro_GraphAdd.SetCoupled( 'GraphAdd' ) + Macro_GraphAdd.SetName( 'Macro_GraphAdd' ) + Macro_GraphAdd.SetAuthor( '' ) + Macro_GraphAdd.SetComment( 'Macro Node' ) + Macro_GraphAdd.Coords( 434 , 128 ) + IMacro_GraphAddAdd__x = Macro_GraphAdd.GetInPort( 'Add__x' ) + IMacro_GraphAddAdd__y = Macro_GraphAdd.GetInPort( 'Add__y' ) + IMacro_GraphAddGate = Macro_GraphAdd.GetInPort( 'Gate' ) + OMacro_GraphAddAdd__FuncValue = Macro_GraphAdd.GetOutPort( 'Add__FuncValue' ) + OMacro_GraphAddAdd__z = Macro_GraphAdd.GetOutPort( 'Add__z' ) + OMacro_GraphAddGate = Macro_GraphAdd.GetOutPort( 'Gate' ) + + GraphSub = DefGraphSub() + Macro_GraphSub = GraphMacroNodes1.GraphMNode( GraphSub ) + Macro_GraphSub.SetCoupled( 'GraphSub' ) + Macro_GraphSub.SetName( 'Macro_GraphSub' ) + Macro_GraphSub.SetAuthor( '' ) + Macro_GraphSub.SetComment( 'Macro Node' ) + Macro_GraphSub.Coords( 240 , 301 ) + IMacro_GraphSubSub__x = Macro_GraphSub.GetInPort( 'Sub__x' ) + IMacro_GraphSubSub__y = Macro_GraphSub.GetInPort( 'Sub__y' ) + IMacro_GraphSubGate = Macro_GraphSub.GetInPort( 'Gate' ) + OMacro_GraphSubSub__z = Macro_GraphSub.GetOutPort( 'Sub__z' ) + OMacro_GraphSubGate = Macro_GraphSub.GetOutPort( 'Gate' ) + + # Creation of Links + LAddFuncValueMacro_GraphSubSub__x = GraphMacroNodes1.Link( OAddFuncValue , IMacro_GraphSubSub__x ) + + LAddFuncValueMacro_GraphAddAdd__y = GraphMacroNodes1.Link( OAddFuncValue , IMacro_GraphAddAdd__y ) + + LAddzSuby = GraphMacroNodes1.Link( OAddz , ISuby ) + + LAddzMacro_GraphSubSub__y = GraphMacroNodes1.Link( OAddz , IMacro_GraphSubSub__y ) + + LSubzMulx = GraphMacroNodes1.Link( OSubz , IMulx ) + + LSubzMacro_GraphAddAdd__x = GraphMacroNodes1.Link( OSubz , IMacro_GraphAddAdd__x ) + + LMacro_GraphAddGateDivGate = GraphMacroNodes1.Link( OMacro_GraphAddGate , IDivGate ) + + LMacro_GraphSubSub__zMuly = GraphMacroNodes1.Link( OMacro_GraphSubSub__z , IMuly ) + + LMacro_GraphSubGateMulGate = GraphMacroNodes1.Link( OMacro_GraphSubGate , IMulGate ) + + # Input datas + IAddx.Input( 3 ) + IAddy.Input( 4.5 ) + ISubx.Input( 1.5 ) + IDivx.Input( 1 ) + IDivy.Input( 2 ) + + # Output Ports of the graph + #OMulz = Mul.GetOutPort( 'z' ) + #ODivz = Div.GetOutPort( 'z' ) + #OMacro_GraphAddAdd__FuncValue = Macro_GraphAdd.GetOutPort( 'Add__FuncValue' ) + #OMacro_GraphAddAdd__z = Macro_GraphAdd.GetOutPort( 'Add__z' ) + return GraphMacroNodes1 + +# Graph creation of GraphAdd +def DefGraphAdd() : + GraphAdd = Graph( 'GraphAdd' ) + GraphAdd.SetCoupled( 'Macro_GraphAdd' ) + GraphAdd.SetName( 'GraphAdd' ) + GraphAdd.SetAuthor( '' ) + GraphAdd.SetComment( '' ) + GraphAdd.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + Add = GraphAdd.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) + Add.SetName( 'Add' ) + Add.SetAuthor( '' ) + Add.SetContainer( 'localhost/FactoryServer' ) + Add.SetComment( 'Add from AddComponent' ) + Add.Coords( 55 , 61 ) + IAddx = Add.GetInPort( 'x' ) + IAddy = Add.GetInPort( 'y' ) + IAddGate = Add.GetInPort( 'Gate' ) + OAddFuncValue = Add.GetOutPort( 'FuncValue' ) + OAddz = Add.GetOutPort( 'z' ) + OAddGate = Add.GetOutPort( 'Gate' ) + + # Input Ports of the graph + #IAddx = Add.GetInPort( 'x' ) + #IAddy = Add.GetInPort( 'y' ) + + # Output Ports of the graph + #OAddFuncValue = Add.GetOutPort( 'FuncValue' ) + #OAddz = Add.GetOutPort( 'z' ) + return GraphAdd + +# Graph creation of GraphSub +def DefGraphSub() : + GraphSub = Graph( 'GraphSub' ) + GraphSub.SetCoupled( 'Macro_GraphSub' ) + GraphSub.SetName( 'GraphSub' ) + GraphSub.SetAuthor( '' ) + GraphSub.SetComment( '' ) + GraphSub.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + Sub = GraphSub.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) + Sub.SetName( 'Sub' ) + Sub.SetAuthor( '' ) + Sub.SetContainer( 'localhost/FactoryServer' ) + Sub.SetComment( 'Sub from SubComponent' ) + Sub.Coords( 55 , 71 ) + ISubx = Sub.GetInPort( 'x' ) + ISuby = Sub.GetInPort( 'y' ) + ISubGate = Sub.GetInPort( 'Gate' ) + OSubz = Sub.GetOutPort( 'z' ) + OSubGate = Sub.GetOutPort( 'Gate' ) + + # Input Ports of the graph + #ISubx = Sub.GetInPort( 'x' ) + #ISuby = Sub.GetInPort( 'y' ) + + # Output Ports of the graph + #OSubz = Sub.GetOutPort( 'z' ) + return GraphSub + + +GraphMacroNodes1 = DefGraphMacroNodes1() + +exec GraphMacroNodes1.ListNodes() +# Add,Sub,Mul,Div,Macro_GraphAdd,Macro_GraphSub + +GraphMacroNodes1.Run() +GraphMacroNodes1.DoneW() +print "GraphMacroNodes1",GraphMacroNodes1.State() +print "Macro_GraphAdd",Macro_GraphAdd.State() +print "Macro_GraphSub",Macro_GraphSub.State() +print "Mul",Mul.State() +print "Div",Div.State() + +Macro_GraphSub.PrintPorts() +Mul.PrintPorts() + +Macro_GraphAdd.PrintPorts() +Div.PrintPorts() + diff --git a/Superv/Python/GraphSub.py b/Superv/Python/GraphSub.py new file mode 100644 index 0000000..debcd6d --- /dev/null +++ b/Superv/Python/GraphSub.py @@ -0,0 +1,37 @@ + +# Generated python file of Graph GraphSub + +from SuperV import * + +# Graph creation of GraphSub +def DefGraphSub() : + GraphSub = Graph( 'GraphSub' ) + GraphSub.SetName( 'GraphSub' ) + GraphSub.SetAuthor( '' ) + GraphSub.SetComment( '' ) + GraphSub.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + Sub = GraphSub.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) + Sub.SetName( 'Sub' ) + Sub.SetAuthor( '' ) + Sub.SetContainer( 'localhost/FactoryServer' ) + Sub.SetComment( 'Sub from SubComponent' ) + Sub.Coords( 55 , 71 ) + ISubx = Sub.GetInPort( 'x' ) + ISuby = Sub.GetInPort( 'y' ) + ISubGate = Sub.GetInPort( 'Gate' ) + OSubz = Sub.GetOutPort( 'z' ) + OSubGate = Sub.GetOutPort( 'Gate' ) + + # Input Ports of the graph + #ISubx = Sub.GetInPort( 'x' ) + #ISuby = Sub.GetInPort( 'y' ) + + # Output Ports of the graph + #OSubz = Sub.GetOutPort( 'z' ) + return GraphSub + + +GraphSub = DefGraphSub() -- 2.30.2