From f1203589661527b8d6d040f1075a4d7ffcae142d Mon Sep 17 00:00:00 2001 From: nri Date: Tue, 20 May 2003 12:59:35 +0000 Subject: [PATCH] NRI : Add Dataflow examples. --- examples/GeomGraph.py | 106 ++ examples/GeomGraph.xml | 651 +++++++++++ examples/GraphEssai.py | 74 ++ examples/GraphEssai.xml | 297 +++++ examples/GraphEssai1.py | 64 ++ examples/GraphEssai1.xml | 305 ++++++ examples/GraphEssai2.py | 66 ++ examples/GraphEssai2.xml | 309 ++++++ examples/GraphEssai3.py | 89 ++ examples/GraphEssai3.xml | 451 ++++++++ examples/GraphExample.py | 76 ++ examples/GraphFactorial.py | 33 + examples/GraphFactorial.xml | 99 ++ examples/GraphGOTO.py | 94 ++ examples/GraphGOTO.xml | 210 ++++ examples/GraphGeomEssai.xml | 401 +++++++ examples/GraphInLines.py | 78 ++ examples/GraphInLines.xml | 205 ++++ examples/GraphLoop.py | 88 ++ examples/GraphLoop.xml | 232 ++++ examples/GraphRunSyr.py | 41 + examples/GraphSwitch.py | 78 ++ examples/GraphSwitch.xml | 171 +++ examples/GraphSyrControl.py | 216 ++++ examples/GraphSyrControl.xml | 604 +++++++++++ examples/GraphSyrControlAve.py | 309 ++++++ examples/GraphSyrControlAve.xml | 978 +++++++++++++++++ examples/GraphSyrControlDefault.py | 206 ++++ examples/GraphSyrControlDefault.xml | 582 ++++++++++ examples/GraphSyrControlGUI.py | 213 ++++ examples/GraphSyrControlGUI.xml | 607 +++++++++++ examples/GraphSyracuseC.py | 149 +++ examples/GraphSyracuseC.xml | 315 ++++++ examples/GraphSyracuseCEv.py | 146 +++ examples/GraphSyracuseCEv.xml | 315 ++++++ examples/GraphSyracuseC_Gate.py | 171 +++ examples/GraphSyracuseC_Gate.xml | 415 +++++++ examples/GraphSyracuseC_Void.py | 160 +++ examples/GraphSyracuseControl.py | 125 +++ examples/GraphSyracuseCpp.py | 201 ++++ examples/GraphSyracuseCpp.xml | 457 ++++++++ examples/Graphs.py | 94 ++ examples/Graphs.xml | 561 ++++++++++ examples/NewGraphEssai.py | 67 ++ examples/NewGraphEssai.xml | 305 ++++++ examples/NewGraphGeomEssai.py | 54 + examples/NewGraphGeomEssai.xml | 332 ++++++ examples/SupervRheolefGraph.py | 189 ++++ examples/SupervRheolefGraph.xml | 1369 +++++++++++++++++++++++ examples/SyrStruct.py | 354 ++++++ examples/SyrStruct.xml | 1562 +++++++++++++++++++++++++++ examples/myFactorialPy.py | 19 + examples/newsupervisionexample.py | 55 + examples/newsupervisionexample.xml | 287 +++++ 54 files changed, 15635 insertions(+) create mode 100644 examples/GeomGraph.py create mode 100644 examples/GeomGraph.xml create mode 100644 examples/GraphEssai.py create mode 100755 examples/GraphEssai.xml create mode 100755 examples/GraphEssai1.py create mode 100644 examples/GraphEssai1.xml create mode 100755 examples/GraphEssai2.py create mode 100644 examples/GraphEssai2.xml create mode 100644 examples/GraphEssai3.py create mode 100644 examples/GraphEssai3.xml create mode 100644 examples/GraphExample.py create mode 100644 examples/GraphFactorial.py create mode 100644 examples/GraphFactorial.xml create mode 100644 examples/GraphGOTO.py create mode 100644 examples/GraphGOTO.xml create mode 100644 examples/GraphGeomEssai.xml create mode 100644 examples/GraphInLines.py create mode 100644 examples/GraphInLines.xml create mode 100644 examples/GraphLoop.py create mode 100644 examples/GraphLoop.xml create mode 100644 examples/GraphRunSyr.py create mode 100644 examples/GraphSwitch.py create mode 100644 examples/GraphSwitch.xml create mode 100644 examples/GraphSyrControl.py create mode 100644 examples/GraphSyrControl.xml create mode 100644 examples/GraphSyrControlAve.py create mode 100644 examples/GraphSyrControlAve.xml create mode 100644 examples/GraphSyrControlDefault.py create mode 100644 examples/GraphSyrControlDefault.xml create mode 100644 examples/GraphSyrControlGUI.py create mode 100644 examples/GraphSyrControlGUI.xml create mode 100644 examples/GraphSyracuseC.py create mode 100755 examples/GraphSyracuseC.xml create mode 100644 examples/GraphSyracuseCEv.py create mode 100755 examples/GraphSyracuseCEv.xml create mode 100644 examples/GraphSyracuseC_Gate.py create mode 100644 examples/GraphSyracuseC_Gate.xml create mode 100644 examples/GraphSyracuseC_Void.py create mode 100644 examples/GraphSyracuseControl.py create mode 100644 examples/GraphSyracuseCpp.py create mode 100755 examples/GraphSyracuseCpp.xml create mode 100644 examples/Graphs.py create mode 100644 examples/Graphs.xml create mode 100644 examples/NewGraphEssai.py create mode 100644 examples/NewGraphEssai.xml create mode 100644 examples/NewGraphGeomEssai.py create mode 100644 examples/NewGraphGeomEssai.xml create mode 100755 examples/SupervRheolefGraph.py create mode 100755 examples/SupervRheolefGraph.xml create mode 100644 examples/SyrStruct.py create mode 100644 examples/SyrStruct.xml create mode 100644 examples/myFactorialPy.py create mode 100644 examples/newsupervisionexample.py create mode 100644 examples/newsupervisionexample.xml diff --git a/examples/GeomGraph.py b/examples/GeomGraph.py new file mode 100644 index 0000000..673911c --- /dev/null +++ b/examples/GeomGraph.py @@ -0,0 +1,106 @@ + +# Generated python file of Graph GeomGraph + +from SuperV import * +# Graph creation +GeomGraph = Graph( 'GeomGraph' ) +GeomGraph.SetName( 'GeomGraph' ) +GeomGraph.SetAuthor( '' ) +GeomGraph.SetComment( '' ) +GeomGraph.Coords( 0 , 0 ) + +# Creation of Factory Nodes +MakeBox = GeomGraph.FNode( 'Geometry' , 'Geometry' , 'MakeBox' ) +MakeBox.SetName( 'MakeBox' ) +MakeBox.SetAuthor( '' ) +MakeBox.SetContainer( 'localhost/FactoryServer' ) +MakeBox.SetComment( 'MakeBox from Geometry' ) +MakeBox.Coords( 5 , 101 ) +MakeCopy = GeomGraph.FNode( 'Geometry' , 'Geometry' , 'MakeCopy' ) +MakeCopy.SetName( 'MakeCopy' ) +MakeCopy.SetAuthor( '' ) +MakeCopy.SetContainer( 'localhost/FactoryServer' ) +MakeCopy.SetComment( 'MakeCopy from Geometry' ) +MakeCopy.Coords( 235 , 77 ) +MakeCopy_1 = GeomGraph.FNode( 'Geometry' , 'Geometry' , 'MakeCopy' ) +MakeCopy_1.SetName( 'MakeCopy_1' ) +MakeCopy_1.SetAuthor( '' ) +MakeCopy_1.SetContainer( 'localhost/FactoryServer' ) +MakeCopy_1.SetComment( 'MakeCopy from Geometry' ) +MakeCopy_1.Coords( 232 , 332 ) +MakeTranslation = GeomGraph.FNode( 'Geometry' , 'Geometry' , 'MakeTranslation' ) +MakeTranslation.SetName( 'MakeTranslation' ) +MakeTranslation.SetAuthor( '' ) +MakeTranslation.SetContainer( 'localhost/FactoryServer' ) +MakeTranslation.SetComment( 'MakeTranslation from Geometry' ) +MakeTranslation.Coords( 449 , 86 ) +MakeFuse = GeomGraph.FNode( 'Geometry' , 'Geometry' , 'MakeFuse' ) +MakeFuse.SetName( 'MakeFuse' ) +MakeFuse.SetAuthor( '' ) +MakeFuse.SetContainer( 'localhost/FactoryServer' ) +MakeFuse.SetComment( 'MakeFuse from Geometry' ) +MakeFuse.Coords( 678 , 224 ) +MakeFuse_1 = GeomGraph.FNode( 'Geometry' , 'Geometry' , 'MakeFuse' ) +MakeFuse_1.SetName( 'MakeFuse_1' ) +MakeFuse_1.SetAuthor( '' ) +MakeFuse_1.SetContainer( 'localhost/FactoryServer' ) +MakeFuse_1.SetComment( 'MakeFuse from Geometry' ) +MakeFuse_1.Coords( 909 , 340 ) +MakeSphere = GeomGraph.FNode( 'Geometry' , 'Geometry' , 'MakeSphere' ) +MakeSphere.SetName( 'MakeSphere' ) +MakeSphere.SetAuthor( '' ) +MakeSphere.SetContainer( 'localhost/FactoryServer' ) +MakeSphere.SetComment( 'MakeSphere from Geometry' ) +MakeSphere.Coords( 5 , 449 ) + +# Creation of intermediate Output variables and of Control Links +MakeBoxshape = MakeBox.Port( 'shape' ) +MakeCopyshape1 = GeomGraph.Link( MakeBoxshape , MakeCopy.Port( 'shape1' ) ) +MakeCopyshape1.AddCoord( 1 , 198 , 184 ) +MakeCopyshape1.AddCoord( 2 , 199 , 209 ) +MakeCopy_1shape1 = GeomGraph.Link( MakeBoxshape , MakeCopy_1.Port( 'shape1' ) ) +MakeCopy_1shape1.AddCoord( 1 , 198 , 441 ) +MakeCopy_1shape1.AddCoord( 2 , 198 , 209 ) +MakeCopyshape = MakeCopy.Port( 'shape' ) +MakeTranslationshape1 = GeomGraph.Link( MakeCopyshape , MakeTranslation.Port( 'shape1' ) ) +MakeCopy_1shape = MakeCopy_1.Port( 'shape' ) +MakeFuseshape2 = GeomGraph.Link( MakeCopy_1shape , MakeFuse.Port( 'shape2' ) ) +MakeFuseshape2.AddCoord( 1 , 642 , 362 ) +MakeFuseshape2.AddCoord( 2 , 642 , 442 ) +MakeTranslationshape = MakeTranslation.Port( 'shape' ) +MakeFuseshape1 = GeomGraph.Link( MakeTranslationshape , MakeFuse.Port( 'shape1' ) ) +MakeFuseshape1.AddCoord( 1 , 643 , 330 ) +MakeFuseshape1.AddCoord( 2 , 644 , 195 ) +MakeFuseshape = MakeFuse.Port( 'shape' ) +MakeFuse_1shape1 = GeomGraph.Link( MakeFuseshape , MakeFuse_1.Port( 'shape1' ) ) +MakeFuse_1shape1.AddCoord( 1 , 872 , 445 ) +MakeFuse_1shape1.AddCoord( 2 , 874 , 333 ) +MakeSphereshape = MakeSphere.Port( 'shape' ) +MakeFuse_1shape2 = GeomGraph.Link( MakeSphereshape , MakeFuse_1.Port( 'shape2' ) ) +MakeFuse_1shape2.AddCoord( 1 , 872 , 474 ) +MakeFuse_1shape2.AddCoord( 2 , 871 , 552 ) + +# Creation of Input datas +MakeBoxx1 = MakeBox.Input( 'x1' , 0) +MakeBoxy1 = MakeBox.Input( 'y1' , 0) +MakeBoxz1 = MakeBox.Input( 'z1' , 0) +MakeBoxx2 = MakeBox.Input( 'x2' , 50) +MakeBoxy2 = MakeBox.Input( 'y2' , 50) +MakeBoxz2 = MakeBox.Input( 'z2' , 50) +MakeTranslationx1 = MakeTranslation.Input( 'x1' , 25) +MakeTranslationy1 = MakeTranslation.Input( 'y1' , 25) +MakeTranslationz1 = MakeTranslation.Input( 'z1' , 25) +MakeSpherex1 = MakeSphere.Input( 'x1' , 0) +MakeSpherey1 = MakeSphere.Input( 'y1' , 0) +MakeSpherez1 = MakeSphere.Input( 'z1' , 0) +MakeSphereradius = MakeSphere.Input( 'radius' , 12) + +# Creation of Output variables +MakeFuse_1shape = MakeFuse_1.Port( 'shape' ) + +GeomGraph.Run() + +GeomGraph.DoneW() + +GeomGraph.PrintPorts() + diff --git a/examples/GeomGraph.xml b/examples/GeomGraph.xml new file mode 100644 index 0000000..fdd4234 --- /dev/null +++ b/examples/GeomGraph.xml @@ -0,0 +1,651 @@ + + + + + + + + + ? + ? + GeomGraph + 1 + ? + + GeomGraph + + + double + MakeBox\x1 + + + double + MakeBox\y1 + + + double + MakeBox\z1 + + + double + MakeBox\x2 + + + double + MakeBox\y2 + + + double + MakeBox\z2 + + + double + MakeTranslation\x1 + + + double + MakeTranslation\y1 + + + double + MakeTranslation\z1 + + + double + MakeSphere\x1 + + + double + MakeSphere\y1 + + + double + MakeSphere\z1 + + + double + MakeSphere\radius + + + + + GEOM_Shape + MakeFuse_1\shape + + + + + + + + 13/3/2003 - 11:46:34 + 13/3/2003 - 13:49:29 + 1.04 + ? + ? + ? + 0 + 0 + + + + + + Geometry + Geometry + MakeBox + 0 + ? + + MakeBox + + + double + x1 + + + double + y1 + + + double + z1 + + + double + x2 + + + double + y2 + + + double + z2 + + + + + GEOM_Shape + shape + + + + + + + + 13/3/2003 - 11:46:45 + 13/3/2003 - 11:46:45 + 1.04 + ? + localhost/FactoryServer + MakeBox from Geometry + 5 + 101 + + + Geometry + Geometry + MakeCopy + 0 + ? + + MakeCopy + + + GEOM_Shape + shape1 + + + + + GEOM_Shape + shape + + + + + + + + 13/3/2003 - 11:46:48 + 13/3/2003 - 11:46:48 + 1.04 + ? + localhost/FactoryServer + MakeCopy from Geometry + 235 + 77 + + + Geometry + Geometry + MakeCopy_1 + 0 + ? + + MakeCopy + + + GEOM_Shape + shape1 + + + + + GEOM_Shape + shape + + + + + + + + 13/3/2003 - 11:46:49 + 13/3/2003 - 11:46:49 + 1.04 + ? + localhost/FactoryServer + MakeCopy from Geometry + 232 + 332 + + + Geometry + Geometry + MakeTranslation + 0 + ? + + MakeTranslation + + + GEOM_Shape + shape1 + + + double + x1 + + + double + y1 + + + double + z1 + + + + + GEOM_Shape + shape + + + + + + + + 13/3/2003 - 11:46:51 + 13/3/2003 - 11:46:51 + 1.04 + ? + localhost/FactoryServer + MakeTranslation from Geometry + 449 + 86 + + + Geometry + Geometry + MakeFuse + 0 + ? + + MakeFuse + + + GEOM_Shape + shape1 + + + GEOM_Shape + shape2 + + + + + GEOM_Shape + shape + + + + + + + + 13/3/2003 - 11:46:55 + 13/3/2003 - 11:46:55 + 1.04 + ? + localhost/FactoryServer + MakeFuse from Geometry + 678 + 224 + + + Geometry + Geometry + MakeFuse_1 + 0 + ? + + MakeFuse + + + GEOM_Shape + shape1 + + + GEOM_Shape + shape2 + + + + + GEOM_Shape + shape + + + + + + + + 13/3/2003 - 11:46:58 + 13/3/2003 - 11:46:58 + 1.04 + ? + localhost/FactoryServer + MakeFuse from Geometry + 909 + 340 + + + Geometry + Geometry + MakeSphere + 0 + ? + + MakeSphere + + + double + x1 + + + double + y1 + + + double + z1 + + + double + radius + + + + + GEOM_Shape + shape + + + + + + + + 13/3/2003 - 11:47:0 + 13/3/2003 - 11:47:0 + 1.04 + ? + localhost/FactoryServer + MakeSphere from Geometry + 5 + 449 + + + + + + MakeBox + shape + MakeCopy + shape1 + + + 198 + 184 + + + 199 + 209 + + + + + MakeBox + shape + MakeCopy_1 + shape1 + + + 198 + 441 + + + 198 + 209 + + + + + MakeCopy + shape + MakeTranslation + shape1 + + + + + MakeCopy_1 + shape + MakeFuse + shape2 + + + 642 + 362 + + + 642 + 442 + + + + + MakeTranslation + shape + MakeFuse + shape1 + + + 643 + 330 + + + 644 + 195 + + + + + MakeFuse + shape + MakeFuse_1 + shape1 + + + 872 + 445 + + + 874 + 333 + + + + + MakeSphere + shape + MakeFuse_1 + shape2 + + + 872 + 474 + + + 871 + 552 + + + + + + + + GeomGraph + MakeBox\x1 + MakeBox + x1 + + 3 + 0 + + + + + + GeomGraph + MakeBox\y1 + MakeBox + y1 + + 3 + 0 + + + + + + GeomGraph + MakeBox\z1 + MakeBox + z1 + + 3 + 0 + + + + + + GeomGraph + MakeBox\x2 + MakeBox + x2 + + 3 + 50 + + + + + + GeomGraph + MakeBox\y2 + MakeBox + y2 + + 3 + 50 + + + + + + GeomGraph + MakeBox\z2 + MakeBox + z2 + + 3 + 50 + + + + + + GeomGraph + MakeTranslation\x1 + MakeTranslation + x1 + + 3 + 25 + + + + + + GeomGraph + MakeTranslation\y1 + MakeTranslation + y1 + + 3 + 25 + + + + + + GeomGraph + MakeTranslation\z1 + MakeTranslation + z1 + + 3 + 25 + + + + + + GeomGraph + MakeSphere\x1 + MakeSphere + x1 + + 3 + 0 + + + + + + GeomGraph + MakeSphere\y1 + MakeSphere + y1 + + 3 + 0 + + + + + + GeomGraph + MakeSphere\z1 + MakeSphere + z1 + + 3 + 0 + + + + + + GeomGraph + MakeSphere\radius + MakeSphere + radius + + 3 + 12 + + + + + + + diff --git a/examples/GraphEssai.py b/examples/GraphEssai.py new file mode 100644 index 0000000..a60f0e3 --- /dev/null +++ b/examples/GraphEssai.py @@ -0,0 +1,74 @@ + +# Generated python file of Graph GraphEssai + +from SuperV import * +# Graph creation +GraphEssai = Graph( 'GraphEssai' ) +GraphEssai.SetAuthor( '' ) +GraphEssai.SetComment( '' ) +GraphEssai.Coords( 0 , 0 ) + +# Creation of Nodes +Add = GraphEssai.Node( 'AddComponent' , 'AddComponent' , 'Add' ) +Add.SetAuthor( '' ) +Add.SetContainer( 'FactoryServer' ) +Add.SetComment( '' ) +Add.Coords( 15 , 241 ) +Sub = GraphEssai.Node( 'SubComponent' , 'SubComponent' , 'Sub' ) +Sub.SetAuthor( '' ) +Sub.SetContainer( 'FactoryServer' ) +Sub.SetComment( '' ) +Sub.Coords( 227 , 99 ) +Mul = GraphEssai.Node( 'MulComponent' , 'MulComponent' , 'Mul' ) +Mul.SetAuthor( '' ) +Mul.SetContainer( 'FactoryServer' ) +Mul.SetComment( '' ) +Mul.Coords( 443 , 278 ) +Div = GraphEssai.Node( 'DivComponent' , 'DivComponent' , 'Div' ) +Div.SetAuthor( '' ) +Div.SetContainer( 'FactoryServer' ) +Div.SetComment( '' ) +Div.Coords( 634 , 97 ) + +# Creation of intermediate Output variables and of links +Addz = Add.Port( 'z' ) +Suby = GraphEssai.Link( Addz , Sub.Port( 'y' ) ) +Muly = GraphEssai.Link( Addz , Mul.Port( 'y' ) ) +Subz = Sub.Port( 'z' ) +Mulx = GraphEssai.Link( Subz , Mul.Port( 'x' ) ) +Divx = GraphEssai.Link( Subz , Div.Port( 'x' ) ) +Mulz = Mul.Port( 'z' ) +Divy = GraphEssai.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) + +# Missing Input datas + +# Creation of Output variables +AddFuncValue = Add.Port( 'FuncValue' ) +Divz = Div.Port( 'z' ) + +Add.Print() +Sub.Print() +Mul.Print() +Div.Print() + +GraphEssai.PrintPorts() + +nodes = GraphEssai.LevelNodes( 0 ) +i = 0 +while i < len( nodes ) : + print 'Nodes of level 0',nodes[i].Name() + i = i + 1 + +GraphEssai.Run() + +GraphEssai.DoneW() + +GraphEssai.State() + +GraphEssai.PrintPorts() + diff --git a/examples/GraphEssai.xml b/examples/GraphEssai.xml new file mode 100755 index 0000000..4dc991c --- /dev/null +++ b/examples/GraphEssai.xml @@ -0,0 +1,297 @@ + + + + + + + + + ? + ? + GraphEssai + 1 + ? + + GraphEssai + + + double + Add\x + + + double + Add\y + + + double + Sub\x + + + + + double + Add\FuncValue + + + double + Div\z + + + + + + + + 11/3/2003 - 9:58:58 + 11/3/2003 - 9:58:59 + 1.04 + ? + ? + ? + 0 + 0 + + + + + + AddComponent + AddComponent + Add + 0 + ? + + Add + + + double + x + + + double + y + + + + + double + FuncValue + + + double + z + + + + + + + + 11/3/2003 - 9:58:58 + 11/3/2003 - 9:58:58 + 1.04 + ? + FactoryServer + ? + 15 + 241 + + + SubComponent + SubComponent + Sub + 0 + ? + + Sub + + + double + x + + + double + y + + + + + double + z + + + + + + + + 11/3/2003 - 9:58:58 + 11/3/2003 - 9:58:58 + 1.04 + ? + FactoryServer + ? + 227 + 99 + + + MulComponent + MulComponent + Mul + 0 + ? + + Mul + + + double + x + + + double + y + + + + + double + z + + + + + + + + 11/3/2003 - 9:58:58 + 11/3/2003 - 9:58:58 + 1.04 + ? + FactoryServer + ? + 443 + 278 + + + DivComponent + DivComponent + Div + 0 + ? + + Div + + + double + x + + + double + y + + + + + double + z + + + + + + + + 11/3/2003 - 9:58:58 + 11/3/2003 - 9:58:58 + 1.04 + ? + FactoryServer + ? + 634 + 97 + + + + + + Add + z + Sub + y + + + + + Add + z + Mul + y + + + + + Sub + z + Mul + x + + + + + Sub + z + Div + x + + + + + Mul + z + Div + y + + + + + + + + GraphEssai + Add\x + Add + x + + 3 + 3 + + + + + + GraphEssai + Add\y + Add + y + + 7 + 4.5 + + + + + + GraphEssai + Sub\x + Sub + x + + 7 + 1.5 + + + + + + + diff --git a/examples/GraphEssai1.py b/examples/GraphEssai1.py new file mode 100755 index 0000000..4792e22 --- /dev/null +++ b/examples/GraphEssai1.py @@ -0,0 +1,64 @@ + +# Generated python file of Graph GraphEssai1 + +from SuperV import * +# Graph creation +GraphEssai1 = Graph( 'GraphEssai1' ) +GraphEssai1.SetName( 'GraphEssai1' ) +GraphEssai1.SetAuthor( '' ) +GraphEssai1.SetComment( '' ) +GraphEssai1.Coords( 0 , 0 ) + +# Creation of Computing Nodes +Add = GraphEssai1.Node( 'AddComponent' , 'AddComponent' , 'Add' ) +Add.SetName( 'Add' ) +Add.SetAuthor( '' ) +Add.SetContainer( 'localhost/FactoryServer' ) +Add.SetComment( '' ) +Add.Coords( 0 , 214 ) +Sub = GraphEssai1.Node( 'SubComponent' , 'SubComponent' , 'Sub' ) +Sub.SetName( 'Sub' ) +Sub.SetAuthor( '' ) +Sub.SetContainer( 'localhost/FactoryServer' ) +Sub.SetComment( '' ) +Sub.Coords( 192 , 51 ) +Mul = GraphEssai1.Node( 'MulComponent' , 'MulComponent' , 'Mul' ) +Mul.SetName( 'Mul' ) +Mul.SetAuthor( '' ) +Mul.SetContainer( 'localhost/FactoryServer' ) +Mul.SetComment( '' ) +Mul.Coords( 420 , 265 ) +Div = GraphEssai1.Node( 'DivComponent' , 'DivComponent' , 'Div' ) +Div.SetName( 'Div' ) +Div.SetAuthor( '' ) +Div.SetContainer( 'localhost/FactoryServer' ) +Div.SetComment( '' ) +Div.Coords( 623 , 141 ) + +# Creation of intermediate Output variables and of Computing Links +Addz = Add.Port( 'z' ) +Subx = GraphEssai1.Link( Addz , Sub.Port( 'x' ) ) +Subz = Sub.Port( 'z' ) +Mulx = GraphEssai1.Link( Subz , Mul.Port( 'x' ) ) +Divx = GraphEssai1.Link( Subz , Div.Port( 'x' ) ) +Mulz = Mul.Port( 'z' ) +Divy = GraphEssai1.Link( Mulz , Div.Port( 'y' ) ) + +# Creation of Input datas +Addx = Add.Input( 'x' , 3) +Addy = Add.Input( 'y' , 5) +Suby = Sub.Input( 'y' , 7) +Muly = Mul.Input( 'y' , 11) + +# Creation of Output variables +AddFuncValue = Add.Port( 'FuncValue' ) +Divz = Div.Port( 'z' ) + +GraphEssai1.Run() + +GraphEssai1.DoneW() + +GraphEssai1.State() + +GraphEssai1.PrintPorts() + diff --git a/examples/GraphEssai1.xml b/examples/GraphEssai1.xml new file mode 100644 index 0000000..6087d09 --- /dev/null +++ b/examples/GraphEssai1.xml @@ -0,0 +1,305 @@ + + + + + + + + + ? + ? + GraphEssai1 + 1 + ? + + GraphEssai1 + + + double + Add\x + + + double + Add\y + + + double + Sub\y + + + double + Mul\y + + + + + double + Add\FuncValue + + + double + Div\z + + + + + + + + 11/3/2003 - 10:3:19 + 11/3/2003 - 10:3:19 + 1.04 + ? + ? + ? + 0 + 0 + + + + + + AddComponent + AddComponent + Add + 0 + ? + + Add + + + double + x + + + double + y + + + + + double + FuncValue + + + double + z + + + + + + + + 11/3/2003 - 10:3:19 + 11/3/2003 - 10:3:19 + 1.04 + ? + localhost/FactoryServer + ? + 0 + 214 + + + SubComponent + SubComponent + Sub + 0 + ? + + Sub + + + double + x + + + double + y + + + + + double + z + + + + + + + + 11/3/2003 - 10:3:19 + 11/3/2003 - 10:3:19 + 1.04 + ? + localhost/FactoryServer + ? + 192 + 51 + + + MulComponent + MulComponent + Mul + 0 + ? + + Mul + + + double + x + + + double + y + + + + + double + z + + + + + + + + 11/3/2003 - 10:3:19 + 11/3/2003 - 10:3:19 + 1.04 + ? + localhost/FactoryServer + ? + 420 + 265 + + + DivComponent + DivComponent + Div + 0 + ? + + Div + + + double + x + + + double + y + + + + + double + z + + + + + + + + 11/3/2003 - 10:3:19 + 11/3/2003 - 10:3:19 + 1.04 + ? + localhost/FactoryServer + ? + 623 + 141 + + + + + + Add + z + Sub + x + + + + + Sub + z + Mul + x + + + + + Sub + z + Div + x + + + + + Mul + z + Div + y + + + + + + + + GraphEssai1 + Add\x + Add + x + + 3 + 3 + + + + + + GraphEssai1 + Add\y + Add + y + + 3 + 5 + + + + + + GraphEssai1 + Sub\y + Sub + y + + 3 + 7 + + + + + + GraphEssai1 + Mul\y + Mul + y + + 3 + 11 + + + + + + + diff --git a/examples/GraphEssai2.py b/examples/GraphEssai2.py new file mode 100755 index 0000000..aee58ba --- /dev/null +++ b/examples/GraphEssai2.py @@ -0,0 +1,66 @@ + +# Generated python file of Graph GraphEssai2 + +from SuperV import * +# Graph creation +GraphEssai2 = Graph( 'GraphEssai2' ) +GraphEssai2.SetName( 'GraphEssai2' ) +GraphEssai2.SetAuthor( '' ) +GraphEssai2.SetComment( '' ) +GraphEssai2.Coords( 0 , 0 ) + +# Creation of Computing Nodes +Add = GraphEssai2.Node( 'AddComponent' , 'AddComponent' , 'Add' ) +Add.SetName( 'Add' ) +Add.SetAuthor( '' ) +Add.SetContainer( 'localhost/FactoryServer' ) +Add.SetComment( '' ) +Add.Coords( 49 , 182 ) +Sub = GraphEssai2.Node( 'SubComponent' , 'SubComponent' , 'Sub' ) +Sub.SetName( 'Sub' ) +Sub.SetAuthor( '' ) +Sub.SetContainer( 'localhost/FactoryServer' ) +Sub.SetComment( '' ) +Sub.Coords( 300 , 270 ) +Mul = GraphEssai2.Node( 'MulComponent' , 'MulComponent' , 'Mul' ) +Mul.SetName( 'Mul' ) +Mul.SetAuthor( '' ) +Mul.SetContainer( 'localhost/FactoryServer' ) +Mul.SetComment( '' ) +Mul.Coords( 306 , 28 ) +Div = GraphEssai2.Node( 'DivComponent' , 'DivComponent' , 'Div' ) +Div.SetName( 'Div' ) +Div.SetAuthor( '' ) +Div.SetContainer( 'localhost/FactoryServer' ) +Div.SetComment( '' ) +Div.Coords( 603 , 156 ) + +# Creation of intermediate Output variables and of Computing Links +AddFuncValue = Add.Port( 'FuncValue' ) +Mulx = GraphEssai2.Link( AddFuncValue , Mul.Port( 'x' ) ) +Addz = Add.Port( 'z' ) +Subx = GraphEssai2.Link( Addz , Sub.Port( 'x' ) ) +SubOutGate = Sub.Port( 'OutGate' ) +MulInGate = GraphEssai2.Link( SubOutGate , Mul.Port( 'InGate' ) ) +Subz = Sub.Port( 'z' ) +Divx = GraphEssai2.Link( Subz , Div.Port( 'x' ) ) +Mulz = Mul.Port( 'z' ) +Divy = GraphEssai2.Link( Mulz , Div.Port( 'y' ) ) + +# Creation of Input datas +Addx = Add.Input( 'x' , 1) +Addy = Add.Input( 'y' , 2) +Suby = Sub.Input( 'y' , 3) +Muly = Mul.Input( 'y' , 4) + +# Creation of Output variables +Divz = Div.Port( 'z' ) + +GraphEssai2.Run() + +GraphEssai2.DoneW() + +GraphEssai2.State() + +GraphEssai2.PrintPorts() + diff --git a/examples/GraphEssai2.xml b/examples/GraphEssai2.xml new file mode 100644 index 0000000..dee1886 --- /dev/null +++ b/examples/GraphEssai2.xml @@ -0,0 +1,309 @@ + + + + + + + + + ? + ? + GraphEssai2 + 1 + ? + + GraphEssai2 + + + double + Add\x + + + double + Add\y + + + double + Sub\y + + + double + Mul\y + + + + + double + Div\z + + + + + + + + 11/3/2003 - 10:6:28 + 11/3/2003 - 10:6:29 + 1.04 + ? + ? + ? + 0 + 0 + + + + + + AddComponent + AddComponent + Add + 0 + ? + + Add + + + double + x + + + double + y + + + + + double + FuncValue + + + double + z + + + + + + + + 11/3/2003 - 10:6:28 + 11/3/2003 - 10:6:28 + 1.04 + ? + localhost/FactoryServer + ? + 49 + 182 + + + SubComponent + SubComponent + Sub + 0 + ? + + Sub + + + double + x + + + double + y + + + + + double + z + + + + + + + + 11/3/2003 - 10:6:28 + 11/3/2003 - 10:6:28 + 1.04 + ? + localhost/FactoryServer + ? + 300 + 270 + + + MulComponent + MulComponent + Mul + 0 + ? + + Mul + + + double + x + + + double + y + + + + + double + z + + + + + + + + 11/3/2003 - 10:6:29 + 11/3/2003 - 10:6:29 + 1.04 + ? + localhost/FactoryServer + ? + 306 + 28 + + + DivComponent + DivComponent + Div + 0 + ? + + Div + + + double + x + + + double + y + + + + + double + z + + + + + + + + 11/3/2003 - 10:6:29 + 11/3/2003 - 10:6:29 + 1.04 + ? + localhost/FactoryServer + ? + 603 + 156 + + + + + + Add + FuncValue + Mul + x + + + + + Add + z + Sub + x + + + + + Sub + OutGate + Mul + InGate + + + + + Sub + z + Div + x + + + + + Mul + z + Div + y + + + + + + + + GraphEssai2 + Add\x + Add + x + + 3 + 1 + + + + + + GraphEssai2 + Add\y + Add + y + + 3 + 2 + + + + + + GraphEssai2 + Sub\y + Sub + y + + 3 + 3 + + + + + + GraphEssai2 + Mul\y + Mul + y + + 3 + 4 + + + + + + + diff --git a/examples/GraphEssai3.py b/examples/GraphEssai3.py new file mode 100644 index 0000000..94341dd --- /dev/null +++ b/examples/GraphEssai3.py @@ -0,0 +1,89 @@ + +# Generated python file of Graph GraphEssai3 + +from SuperV import * +# Graph creation +GraphEssai3 = Graph( 'GraphEssai3' ) +GraphEssai3.SetName( 'GraphEssai3' ) +GraphEssai3.SetAuthor( '' ) +GraphEssai3.SetComment( '' ) +GraphEssai3.Coords( 0 , 0 ) + +# Creation of Computing Nodes +Add = GraphEssai3.Node( 'AddComponent' , 'AddComponent' , 'Add' ) +Add.SetName( 'Add' ) +Add.SetAuthor( '' ) +Add.SetContainer( 'localhost/FactoryServer' ) +Add.SetComment( '' ) +Add.Coords( 1 , 152 ) +Sub = GraphEssai3.Node( 'SubComponent' , 'SubComponent' , 'Sub' ) +Sub.SetName( 'Sub' ) +Sub.SetAuthor( '' ) +Sub.SetContainer( 'localhost/FactoryServer' ) +Sub.SetComment( '' ) +Sub.Coords( 410 , 84 ) +Mul = GraphEssai3.Node( 'MulComponent' , 'MulComponent' , 'Mul' ) +Mul.SetName( 'Mul' ) +Mul.SetAuthor( '' ) +Mul.SetContainer( 'localhost/FactoryServer' ) +Mul.SetComment( '' ) +Mul.Coords( 410 , 279 ) +Div = GraphEssai3.Node( 'DivComponent' , 'DivComponent' , 'Div' ) +Div.SetName( 'Div' ) +Div.SetAuthor( '' ) +Div.SetContainer( 'localhost/FactoryServer' ) +Div.SetComment( '' ) +Div.Coords( 618 , 140 ) +Addition = GraphEssai3.Node( 'AddComponent' , 'AddComponent' , 'Addition' ) +Addition.SetName( 'Addition' ) +Addition.SetAuthor( '' ) +Addition.SetContainer( 'localhost/AdditionServer' ) +Addition.SetComment( '' ) +Addition.Coords( 0 , 0 ) +Addition_1 = GraphEssai3.Node( 'AddComponent' , 'AddComponent' , 'Addition' ) +Addition_1.SetName( 'Addition_1' ) +Addition_1.SetAuthor( '' ) +Addition_1.SetContainer( 'localhost/Addition_1Server' ) +Addition_1.SetComment( '' ) +Addition_1.Coords( 4 , 327 ) +AddAndCompare = GraphEssai3.CNode( 'AddComponent' , 'Adder' , 'AddAndCompare' ) +AddAndCompare.SetName( 'AddAndCompare' ) +AddAndCompare.SetAuthor( '' ) +AddAndCompare.SetComment( '' ) +AddAndCompare.Coords( 233 , 0 ) + +# Creation of intermediate Output variables and of Computing Links +AddFuncValue = Add.Port( 'FuncValue' ) +Mulx = GraphEssai3.Link( AddFuncValue , Mul.Port( 'x' ) ) +AddAndComparex = GraphEssai3.Link( AddFuncValue , AddAndCompare.Port( 'x' ) ) +Addz = Add.Port( 'z' ) +Subx = GraphEssai3.Link( Addz , Sub.Port( 'x' ) ) +AddAndComparey = GraphEssai3.Link( Addz , AddAndCompare.Port( 'y' ) ) +Subz = Sub.Port( 'z' ) +Divx = GraphEssai3.Link( Subz , Div.Port( 'x' ) ) +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' ) ) + +# Creation of Input datas +Addx = Add.Input( 'x' , 1) +Addy = Add.Input( 'y' , 2) +Suby = Sub.Input( 'y' , 3) +Muly = Mul.Input( 'y' , 4) + +# Creation of Output variables +Divz = Div.Port( 'z' ) +AddAndCompareFuncValue = AddAndCompare.Port( 'FuncValue' ) +AddAndComparez = AddAndCompare.Port( 'z' ) + +GraphEssai3.Run() + +GraphEssai3.DoneW() + +GraphEssai3.State() + +GraphEssai3.PrintPorts() + diff --git a/examples/GraphEssai3.xml b/examples/GraphEssai3.xml new file mode 100644 index 0000000..91a4893 --- /dev/null +++ b/examples/GraphEssai3.xml @@ -0,0 +1,451 @@ + + + + + + + + + ? + ? + 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/3/2003 - 10:59:37 + 1.04 + ? + ? + ? + 0 + 0 + + + + + + AddComponent + AddComponent + Add + 0 + ? + + Add + + + double + x + + + double + y + + + + + double + FuncValue + + + double + z + + + + + + + + 11/3/2003 - 10:59:37 + 11/3/2003 - 10:59:37 + 1.04 + ? + localhost/FactoryServer + ? + 1 + 152 + + + SubComponent + SubComponent + Sub + 0 + ? + + Sub + + + double + x + + + double + y + + + + + double + z + + + + + + + + 11/3/2003 - 10:59:37 + 11/3/2003 - 10:59:37 + 1.04 + ? + localhost/FactoryServer + ? + 410 + 84 + + + MulComponent + MulComponent + Mul + 0 + ? + + Mul + + + double + x + + + double + y + + + + + double + z + + + + + + + + 11/3/2003 - 10:59:37 + 11/3/2003 - 10:59:37 + 1.04 + ? + localhost/FactoryServer + ? + 410 + 279 + + + DivComponent + DivComponent + Div + 0 + ? + + Div + + + double + x + + + double + y + + + + + double + z + + + + + + + + 11/3/2003 - 10:59:37 + 11/3/2003 - 10:59:37 + 1.04 + ? + localhost/FactoryServer + ? + 618 + 140 + + + AddComponent + AddComponent + Addition + 0 + ? + + Addition + + + + + Adder + Adder + + + + + + + + 11/3/2003 - 10:59:37 + 11/3/2003 - 10:59:37 + 1.04 + ? + localhost/AdditionServer + ? + 0 + 0 + + + AddComponent + AddComponent + Addition_1 + 0 + ? + + Addition + + + + + Adder + Adder + + + + + + + + 11/3/2003 - 10:59:37 + 11/3/2003 - 10:59:37 + 1.04 + ? + localhost/Addition_1Server + ? + 4 + 327 + + + ? + ? + AddAndCompare + 2 + ? + + AddAndCompare + + + Adder + Adder + + + double + x + + + double + y + + + Adder + anOtherAdder + + + + + double + FuncValue + + + double + z + + + + + + + + 11/3/2003 - 10:59:37 + 11/3/2003 - 10:59:37 + 1.04 + ? + ? + ? + 233 + 0 + + + + + + Add + FuncValue + Mul + x + + + + + Add + FuncValue + AddAndCompare + x + + + + + Add + z + Sub + x + + + + + Add + z + AddAndCompare + y + + + + + Sub + z + Div + x + + + + + Mul + z + Div + y + + + + + Addition + Adder + AddAndCompare + Adder + + + + + Addition_1 + Adder + AddAndCompare + anOtherAdder + + + + + + + + GraphEssai3 + Add\x + Add + x + + 3 + 1 + + + + + + GraphEssai3 + Add\y + Add + y + + 3 + 2 + + + + + + GraphEssai3 + Sub\y + Sub + y + + 3 + 3 + + + + + + GraphEssai3 + Mul\y + Mul + y + + 3 + 4 + + + + + + + diff --git a/examples/GraphExample.py b/examples/GraphExample.py new file mode 100644 index 0000000..7329474 --- /dev/null +++ b/examples/GraphExample.py @@ -0,0 +1,76 @@ +#! /usr/bin/env python + +#============================================================================== +# File : GraphExample.py +# Created : 18 déc 2001 +# Author : Jean Rahuel +# Project : SALOME +# Copyright : CEA +#============================================================================== + +#from GraphExample import * + +from SuperV import * + +myGraph = Graph( "myDataFlow" ) +print myGraph.SetContainer('FactoryServer') + +Add = myGraph.Node( "AddComponent" , "AddInterface" , "Add" ) +print Add.SetContainer('dm2s0017') +Sub = myGraph.Node( "SubComponent" , "SubInterface" , "Sub" ) +print Sub.SetContainer('dm2s0018') +Mul = myGraph.Node( "MulComponent" , "MulInterface" , "Mul" ) +print Mul.SetContainer('dm2s0019') +Div = myGraph.Node( "DivComponent" , "DivInterface" , "Div" ) +print Div.SetContainer('dm2s0020') + +PAddz = Add.Port("z") +PSuby = Sub.Port("y") +Suby = myGraph.Link( PAddz , PSuby ) +Muly = myGraph.Link( Add.Port("z") , Mul.Port("y") ) +Mulx = myGraph.Link( Sub.Port( "z" ) , Mul.Port("x") ) +Divx = myGraph.Link( Sub.Port( "z" ) , Div.Port("x") ) +Divy = myGraph.Link( Mul.Port( "z" ) , Div.Port("y") ) + +Addx = Add.Input( "x" , 3 ) +Addy = Add.Input( "y" , 4.5 ) +Subx = Sub.Input( "x" , "1.5" ) + +print "Add(x) input value : ",Addx.ToString() +print "Add(y) input value : ",Addy.ToString() +print "Sub(x) input value : ",Subx.ToString() + +Divz = Div.Port("z") + +print Divz.ToString() + +print myGraph.IsValid() +print myGraph.IsExecutable() + +print myGraph.Run() + +Addz = Add.Port( "z" ) +AddFuncValue = Add.Port( "FuncValue" ) +Subz = Sub.Port( "z" ) +Mulz = Mul.Port( "z" ) +Divz = Div.Port( "z" ) + +print AddFuncValue.Done() +print Addz.Done() +print Subz.Done() +print Mulz.Done() +print Divz.Done() +print Add.Done() +print Sub.Done() +print Mul.Done() +print Div.Done() +print myGraph.Done() +print myGraph.State() + +print AddFuncValue.ToString() +print Addz.ToString() +print Subz.ToString() +print Mulz.ToString() +print Divz.ToString() +print Divz.ToAny() + diff --git a/examples/GraphFactorial.py b/examples/GraphFactorial.py new file mode 100644 index 0000000..3551fce --- /dev/null +++ b/examples/GraphFactorial.py @@ -0,0 +1,33 @@ + +from SuperV import * + +GraphFactorial = Graph('GraphFactorial') + +eval = GraphFactorial.Node('FactorialComponent','FactorialComponent','eval') +eval.SetContainer('Server3Py') + +GraphFactorial.IsValid() + +GraphFactorial.Run( 3 ) +GraphFactorial.DoneW() +GraphFactorial.State() +print eval.GetComponentName() +print eval.GetContainer() +GraphFactorial.PrintPorts() + +eval.SetContainer('Server4Py') +GraphFactorial.Run( 4 ) +GraphFactorial.DoneW() +GraphFactorial.State() +print eval.GetComponentName() +print eval.GetContainer() +GraphFactorial.PrintPorts() + +eval.SetContainer('Server5Py') +GraphFactorial.Run( 5 ) +GraphFactorial.DoneW() +GraphFactorial.State() +print eval.GetComponentName() +print eval.GetContainer() +GraphFactorial.PrintPorts() + diff --git a/examples/GraphFactorial.xml b/examples/GraphFactorial.xml new file mode 100644 index 0000000..97ef9c8 --- /dev/null +++ b/examples/GraphFactorial.xml @@ -0,0 +1,99 @@ + + + + + + + + + ? + ? + GraphFactorial + 1 + ? + + GraphFactorial + + + long + eval\n + + + + + long + eval\f + + + + + + + + 11/3/2003 - 11:3:56 + 11/3/2003 - 11:3:56 + 1.04 + ? + ? + ? + 0 + 0 + + + + + + FactorialComponent + FactorialComponent + eval + 0 + ? + + eval + + + long + n + + + + + long + f + + + + + + + + 11/3/2003 - 11:3:56 + 11/3/2003 - 11:3:56 + 1.04 + ? + ServerPy + ? + 0 + 0 + + + + + + + + + GraphFactorial + eval\n + eval + n + + 3 + 5 + + + + + + + diff --git a/examples/GraphGOTO.py b/examples/GraphGOTO.py new file mode 100644 index 0000000..cdd8de1 --- /dev/null +++ b/examples/GraphGOTO.py @@ -0,0 +1,94 @@ + +# Generated python file of Graph GraphGOTO + +from SuperV import * +# Graph creation +GraphGOTO = Graph( 'GraphGOTO' ) +GraphGOTO.SetName( 'GraphGOTO' ) +GraphGOTO.SetAuthor( '' ) +GraphGOTO.SetComment( '' ) +GraphGOTO.Coords( 0 , 0 ) + +# Creation of Factory Nodes + +# Creation of InLine Nodes +PyIsOdd = [] +PyIsOdd.append( 'import time' ) +PyIsOdd.append( 'def IsOdd(a) : ' ) +PyIsOdd.append( ' print a,"IsOdd" ' ) +PyIsOdd.append( ' time.sleep( 1 )' ) +PyIsOdd.append( ' return a+1 ' ) +IsOdd = GraphGOTO.INode( 'IsOdd' , PyIsOdd ) +IsOdd.InPort( 'a' , 'long' ) +IsOdd.OutPort( 'a' , 'long' ) +IsOdd.SetName( 'IsOdd' ) +IsOdd.SetAuthor( '' ) +IsOdd.SetComment( 'Python function' ) +IsOdd.Coords( 296 , 249 ) + +# Creation of Switch Nodes +PySwitch = [] +PySwitch.append( 'import time' ) +PySwitch.append( 'def Switch(a) : ' ) +PySwitch.append( ' print "Switch(",a,")"' ) +PySwitch.append( ' time.sleep( 1 )' ) +PySwitch.append( ' b = a & 1' ) +PySwitch.append( ' print "Switch(",a,") ->",b,a' ) +PySwitch.append( ' return b,a ' ) +Switch,EndSwitch = GraphGOTO.SNode( 'Switch' , PySwitch ) +EndSwitch.SetName( 'EndSwitch' ) +EndSwitch.SetAuthor( '' ) +EndSwitch.SetComment( '' ) +EndSwitch.Coords( 569 , 94 ) +PyEndSwitch = [] +EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch ) +EndSwitch.InPort( 'a' , 'long' ) +EndSwitch.OutPort( 'a' , 'long' ) +Switch.InPort( 'a' , 'long' ) +Switch.OutPort( 'Odd' , 'long' ) +Switch.OutPort( 'a' , 'long' ) +Switch.SetName( 'Switch' ) +Switch.SetAuthor( '' ) +Switch.SetComment( '' ) +Switch.Coords( 25 , 94 ) + +# Creation of GOTO Nodes +PyGoTo = [] +GoTo = GraphGOTO.GNode( '' , PyGoTo , 'Switch' ) +GoTo.InPort( 'a' , 'long' ) +GoTo.OutPort( 'a' , 'long' ) +GoTo.SetName( 'GoTo' ) +GoTo.SetAuthor( '' ) +GoTo.SetComment( '' ) +GoTo.Coords( 520 , 323 ) + +# Creation of intermediate Output variables and of Control Links +IsOdda = IsOdd.Port( 'a' ) +GoToa = GraphGOTO.Link( IsOdda , GoTo.Port( 'a' ) ) +SwitchDefault = Switch.Port( 'Default' ) +EndSwitchDefault = GraphGOTO.Link( SwitchDefault , EndSwitch.Port( 'Default' ) ) +SwitchOdd = Switch.Port( 'Odd' ) +IsOddInGate = GraphGOTO.Link( SwitchOdd , IsOdd.Port( 'InGate' ) ) +IsOddInGate.AddCoord( 1 , 249 , 323 ) +IsOddInGate.AddCoord( 2 , 249 , 157 ) +IsOddInGate.AddCoord( 3 , 247 , 157 ) +Switcha = Switch.Port( 'a' ) +IsOdda = GraphGOTO.Link( Switcha , IsOdd.Port( 'a' ) ) +IsOdda.AddCoord( 1 , 196 , 357 ) +IsOdda.AddCoord( 2 , 196 , 186 ) +EndSwitcha = GraphGOTO.Link( Switcha , EndSwitch.Port( 'a' ) ) +GoToOutGate = GoTo.Port( 'OutGate' ) +SwitchInGate = GraphGOTO.Link( GoToOutGate , Switch.Port( 'InGate' ) ) + +# Creation of Input datas +Switcha = Switch.Input( 'a' , 1) + +# Creation of Output variables +EndSwitcha = EndSwitch.Port( 'a' ) + +GraphGOTO.Run() + +GraphGOTO.DoneW() + +GraphGOTO.PrintPorts() + diff --git a/examples/GraphGOTO.xml b/examples/GraphGOTO.xml new file mode 100644 index 0000000..bf36bc5 --- /dev/null +++ b/examples/GraphGOTO.xml @@ -0,0 +1,210 @@ + + + + +? + ? + GraphGOTO + 1 + ? + +GraphGOTO + + +long + Switch\a + + +long + EndSwitch\a + + + 24/3/2003 - 16:26:48 + 25/3/2003 - 9:25:23 + 1.04 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + 25/3/2003 - 9:24:50 + 25/3/2003 - 9:24:50 + 1.04 + ? + ? + Python function + 296 + 249 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + a + + +long + Odd + +long + a + + + +Switch + + + 25/3/2003 - 9:24:51 + 25/3/2003 - 9:24:51 + 1.04 + ? + ? + ? + 25 + 94 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + + 25/3/2003 - 9:24:51 + 25/3/2003 - 9:24:51 + 1.04 + ? + ? + ? + 569 + 94 + +? + ? + GoTo + 8 + Switch + +GoTo + + +long + a + + +long + a + + + + 25/3/2003 - 9:24:51 + 25/3/2003 - 9:24:51 + 1.04 + ? + ? + ? + 520 + 323 + + +IsOdd + a + GoTo + a + + +Switch + Default + EndSwitch + Default + + +Switch + Odd + IsOdd + InGate + + +249 + 323 + +249 + 157 + +247 + 157 + +Switch + a + IsOdd + a + + +196 + 357 + +196 + 186 + +Switch + a + EndSwitch + a + + +GoTo + OutGate + Switch + InGate + + + +GraphGOTO + Switch\a + Switch + a + +3 + 1 + diff --git a/examples/GraphGeomEssai.xml b/examples/GraphGeomEssai.xml new file mode 100644 index 0000000..e43924c --- /dev/null +++ b/examples/GraphGeomEssai.xml @@ -0,0 +1,401 @@ + + + + + + + + + ? + ? + GraphGeomEssai + 1 + + GraphGeomEssai + + + double + MakeSphere\x1 + + + double + MakeSphere\y1 + + + double + MakeSphere\z1 + + + double + MakeSphere\radius + + + double + MakeTranslation\x1 + + + double + MakeTranslation\y1 + + + double + MakeTranslation\z1 + + + + + GEOM_Shape + MakeFuse\shape + + + + 10/7/2002 - 14:53:2 + 10/7/2002 - 14:54:47 + 1.03 + ? + localhost/FactoryServer + ? + 0 + 0 + + + + + + Geometry + Geometry + MakeCopy + 0 + + MakeCopy + + + GEOM_Shape + shape1 + + + + + GEOM_Shape + shape + + + + 10/7/2002 - 14:53:13 + 10/7/2002 - 14:53:13 + 1.03 + ? + localhost/FactoryServer + ? + 269 + 85 + + + Geometry + Geometry + MakeFuse + 0 + + MakeFuse + + + GEOM_Shape + shape1 + + + GEOM_Shape + shape2 + + + + + GEOM_Shape + shape + + + + 10/7/2002 - 14:53:13 + 10/7/2002 - 14:53:13 + 1.03 + ? + localhost/FactoryServer + ? + 725 + 179 + + + Geometry + Geometry + MakeSphere + 0 + + MakeSphere + + + double + x1 + + + double + y1 + + + double + z1 + + + double + radius + + + + + GEOM_Shape + shape + + + + 10/7/2002 - 14:53:13 + 10/7/2002 - 14:53:13 + 1.03 + ? + localhost/FactoryServer + ? + 28 + 188 + + + Geometry + Geometry + MakeTranslation + 0 + + MakeTranslation + + + GEOM_Shape + shape1 + + + double + x1 + + + double + y1 + + + double + z1 + + + + + GEOM_Shape + shape + + + + 10/7/2002 - 14:53:13 + 10/7/2002 - 14:53:13 + 1.03 + ? + localhost/FactoryServer + ? + 493 + 85 + + + Geometry + Geometry + MakeCopy_1 + 0 + + MakeCopy + + + GEOM_Shape + shape1 + + + + + GEOM_Shape + shape + + + + 10/7/2002 - 14:53:18 + 10/7/2002 - 14:53:18 + 1.03 + ? + localhost/FactoryServer + ? + 283 + 391 + + + + + + MakeCopy + shape + MakeTranslation + shape1 + + + + + MakeSphere + shape + MakeCopy + shape1 + + + 226 + 237 + + + 226 + 340 + + + + + MakeSphere + shape + MakeCopy_1 + shape1 + + + 226 + 544 + + + 225 + 340 + + + + + MakeTranslation + shape + MakeFuse + shape1 + + + 688 + 330 + + + 689 + 237 + + + + + MakeCopy_1 + shape + MakeFuse + shape2 + + + 688 + 362 + + + 689 + 543 + + + + + + + + GraphGeomEssai + MakeSphere\x1 + MakeSphere + x1 + + 3 + 0 + + + + + + GraphGeomEssai + MakeSphere\y1 + MakeSphere + y1 + + 3 + 0 + + + + + + GraphGeomEssai + MakeSphere\z1 + MakeSphere + z1 + + 3 + 0 + + + + + + GraphGeomEssai + MakeSphere\radius + MakeSphere + radius + + 3 + 20 + + + + + + GraphGeomEssai + MakeTranslation\x1 + MakeTranslation + x1 + + 3 + 10 + + + + + + GraphGeomEssai + MakeTranslation\y1 + MakeTranslation + y1 + + 3 + 10 + + + + + + GraphGeomEssai + MakeTranslation\z1 + MakeTranslation + z1 + + 3 + 10 + + + + + + + diff --git a/examples/GraphInLines.py b/examples/GraphInLines.py new file mode 100644 index 0000000..d93576a --- /dev/null +++ b/examples/GraphInLines.py @@ -0,0 +1,78 @@ + +# Generated python file of Graph GraphInLines + +from SuperV import * +# Graph creation +GraphInLines = Graph( 'GraphInLines' ) +GraphInLines.SetName( 'GraphInLines' ) +GraphInLines.SetAuthor( '' ) +GraphInLines.SetComment( '' ) +GraphInLines.Coords( 0 , 0 ) + +# Creation of Factory Nodes + +# Creation of InLine Nodes +PyAdd = [] +PyAdd.append( 'def Add(a,b) : ' ) +PyAdd.append( ' return a+b ' ) +PyAdd.append( '' ) +Add = GraphInLines.INode( 'Add' , PyAdd ) +Add.InPort( 'a' , 'long' ) +Add.InPort( 'b' , 'long' ) +Add.OutPort( 'f' , 'long' ) +Add.SetName( 'Add' ) +Add.SetAuthor( '' ) +Add.SetComment( 'Python function' ) +Add.Coords( 351 , 77 ) +PySub = [] +PySub.append( 'def Sub(a,b) : ' ) +PySub.append( ' return a-b ' ) +PySub.append( '' ) +Sub = GraphInLines.INode( 'Sub' , PySub ) +Sub.InPort( 'a' , 'long' ) +Sub.InPort( 'b' , 'long' ) +Sub.OutPort( 'f' , 'long' ) +Sub.SetName( 'Sub' ) +Sub.SetAuthor( '' ) +Sub.SetComment( 'Python function' ) +Sub.Coords( 86 , 333 ) +PyMul = [] +PyMul.append( 'def Mul(a,b) : ' ) +PyMul.append( ' return a*b ' ) +Mul = GraphInLines.INode( 'Mul' , PyMul ) +Mul.InPort( 'a' , 'long' ) +Mul.InPort( 'b' , 'long' ) +Mul.OutPort( 'Result' , 'long' ) +Mul.SetName( 'Mul' ) +Mul.SetAuthor( '' ) +Mul.SetComment( 'Python function' ) +Mul.Coords( 616 , 247 ) + +# Creation of intermediate Output variables and of Control Links +Addf = Add.Port( 'f' ) +Mula = GraphInLines.Link( Addf , Mul.Port( 'a' ) ) +Mula.AddCoord( 1 , 570 , 356 ) +Mula.AddCoord( 2 , 570 , 186 ) +Subf = Sub.Port( 'f' ) +Mulb = GraphInLines.Link( Subf , Mul.Port( 'b' ) ) +Mulb.AddCoord( 1 , 282 , 376 ) +Mulb.AddCoord( 2 , 282 , 442 ) +Addb = GraphInLines.Link( Subf , Add.Port( 'b' ) ) +Addb.AddCoord( 1 , 283 , 209 ) +Addb.AddCoord( 2 , 283 , 374 ) +Addb.AddCoord( 3 , 283 , 442 ) + +# Creation of Input datas +Adda = Add.Input( 'a' , 1) +Suba = Sub.Input( 'a' , 3) +Subb = Sub.Input( 'b' , 4) + +# Creation of Output variables +MulResult = Mul.Port( 'Result' ) + +GraphInLines.Run() + +GraphInLines.DoneW() + +GraphInLines.PrintPorts() + diff --git a/examples/GraphInLines.xml b/examples/GraphInLines.xml new file mode 100644 index 0000000..a60665c --- /dev/null +++ b/examples/GraphInLines.xml @@ -0,0 +1,205 @@ + + + + +? + ? + GraphInLines + 1 + ? + +GraphInLines + + +long + Add\a + +long + Sub\a + +long + Sub\b + + +long + Mul\Result + + + 24/3/2003 - 10:58:41 + 25/3/2003 - 16:38:21 + 1.04 + ? + ? + ? + 0 + 0 + + +? + ? + Add + 3 + ? + +Add + + +long + a + +long + b + + +long + f + + + +Add + + + + 25/3/2003 - 16:37:21 + 25/3/2003 - 16:37:21 + 1.04 + ? + ? + Python function + 351 + 77 + +? + ? + Sub + 3 + ? + +Sub + + +long + a + +long + b + + +long + f + + + +Sub + + + + 25/3/2003 - 16:37:21 + 25/3/2003 - 16:37:21 + 1.04 + ? + ? + Python function + 86 + 333 + +? + ? + Mul + 3 + ? + +Mul + + +long + a + +long + b + + +long + Result + + + +Mul + + + 25/3/2003 - 16:37:21 + 25/3/2003 - 16:37:21 + 1.04 + ? + ? + Python function + 616 + 247 + + +Add + f + Mul + a + + +570 + 356 + +570 + 186 + +Sub + f + Mul + b + + +282 + 376 + +282 + 442 + +Sub + f + Add + b + + +283 + 209 + +283 + 374 + +283 + 442 + + +GraphInLines + Add\a + Add + a + +3 + 1 + + +GraphInLines + Sub\a + Sub + a + +3 + 3 + + +GraphInLines + Sub\b + Sub + b + +3 + 4 + diff --git a/examples/GraphLoop.py b/examples/GraphLoop.py new file mode 100644 index 0000000..782ac52 --- /dev/null +++ b/examples/GraphLoop.py @@ -0,0 +1,88 @@ + +# Generated python file of Graph GraphLoop + +from SuperV import * +# Graph creation +GraphLoop = Graph( 'GraphLoop' ) +GraphLoop.SetName( 'GraphLoop' ) +GraphLoop.SetAuthor( '' ) +GraphLoop.SetComment( '' ) +GraphLoop.Coords( 0 , 0 ) + +# Creation of Factory Nodes + +# Creation of Loop Nodes +PyInit = [] +PyInit.append( 'import time' ) +PyInit.append( 'def Init(Index,Min,Max,Incr) : ' ) +PyInit.append( ' if Min <= Max : ' ) +PyInit.append( ' Index = Min ' ) +PyInit.append( ' else : ' ) +PyInit.append( ' Index = Max ' ) +PyInit.append( ' time.sleep( 1 )' ) +PyInit.append( ' return Index,Min,Max,Incr ' ) +PyMoreInit = [] +PyMoreInit.append( 'import time' ) +PyMoreInit.append( 'def More(Index,Min,Max,Incr) : ' ) +PyMoreInit.append( ' if Index < Max : ' ) +PyMoreInit.append( ' DoLoop = 1 ' ) +PyMoreInit.append( ' else : ' ) +PyMoreInit.append( ' DoLoop = 0 ' ) +PyMoreInit.append( ' time.sleep( 1 )' ) +PyMoreInit.append( ' return DoLoop,Index,Min,Max,Incr ' ) +PyNextInit = [] +PyNextInit.append( 'import time' ) +PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' ) +PyNextInit.append( ' Index = Index + Incr ' ) +PyNextInit.append( ' time.sleep( 1 )' ) +PyNextInit.append( ' return Index,Min,Max,Incr ' ) +Init,EndInit = GraphLoop.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) +EndInit.SetName( 'EndInit' ) +EndInit.SetAuthor( '' ) +EndInit.SetComment( '' ) +EndInit.Coords( 626 , 259 ) +Init.InPort( 'Index' , 'long' ) +Init.InPort( 'Min' , 'long' ) +Init.InPort( 'Max' , 'long' ) +Init.InPort( 'Incr' , 'long' ) +Init.OutPort( 'Index' , 'long' ) +Init.OutPort( 'Min' , 'long' ) +Init.OutPort( 'Max' , 'long' ) +Init.OutPort( 'Incr' , 'long' ) +Init.SetName( 'Init' ) +Init.SetAuthor( '' ) +Init.SetComment( '' ) +Init.Coords( 17 , 257 ) + +# Creation of intermediate Output variables and of Control Links +InitDoLoop = Init.Port( 'DoLoop' ) +EndInitDoLoop = GraphLoop.Link( InitDoLoop , EndInit.Port( 'DoLoop' ) ) +InitIndex = Init.Port( 'Index' ) +EndInitIndex = GraphLoop.Link( InitIndex , EndInit.Port( 'Index' ) ) +InitMin = Init.Port( 'Min' ) +EndInitMin = GraphLoop.Link( InitMin , EndInit.Port( 'Min' ) ) +InitMax = Init.Port( 'Max' ) +EndInitMax = GraphLoop.Link( InitMax , EndInit.Port( 'Max' ) ) +InitIncr = Init.Port( 'Incr' ) +EndInitIncr = GraphLoop.Link( InitIncr , EndInit.Port( 'Incr' ) ) +EndInitDoLoop = EndInit.Port( 'DoLoop' ) +InitInitLoop = GraphLoop.Link( EndInitDoLoop , Init.Port( 'InitLoop' ) ) + +# Creation of Input datas +InitIndex = Init.Input( 'Index' , 0) +InitMin = Init.Input( 'Min' , 0) +InitMax = Init.Input( 'Max' , 10) +InitIncr = Init.Input( 'Incr' , 1) + +# Creation of Output variables +EndInitIndex = EndInit.Port( 'Index' ) +EndInitMin = EndInit.Port( 'Min' ) +EndInitMax = EndInit.Port( 'Max' ) +EndInitIncr = EndInit.Port( 'Incr' ) + +GraphLoop.Run() + +GraphLoop.DoneW() + +GraphLoop.PrintPorts() + diff --git a/examples/GraphLoop.xml b/examples/GraphLoop.xml new file mode 100644 index 0000000..57ef977 --- /dev/null +++ b/examples/GraphLoop.xml @@ -0,0 +1,232 @@ + + + + +? + ? + GraphLoop + 1 + ? + +GraphLoop + + +long + Init\Index + +long + Init\Min + +long + Init\Max + +long + Init\Incr + + +long + EndInit\Index + +long + EndInit\Min + +long + EndInit\Max + +long + EndInit\Incr + + + 24/3/2003 - 14:44:35 + 25/3/2003 - 9:50:2 + 1.04 + ? + ? + ? + 0 + 0 + + +? + ? + Init + 4 + EndInit + +Init + + +long + Index + +long + Min + +long + Max + +long + Incr + + +long + Index + +long + Min + +long + Max + +long + Incr + + + +Init + + + + + + + +More + + + + + + + +Next + + + + 25/3/2003 - 9:50:2 + 25/3/2003 - 9:50:2 + 1.04 + ? + ? + ? + 17 + 257 + +? + ? + EndInit + 5 + Init + +EndInit + + +long + Index + +long + Min + +long + Max + +long + Incr + + +long + Index + +long + Min + +long + Max + +long + Incr + + + + 25/3/2003 - 9:50:2 + 25/3/2003 - 9:50:2 + 1.04 + ? + ? + ? + 626 + 259 + + +Init + DoLoop + EndInit + DoLoop + + +Init + Index + EndInit + Index + + +Init + Min + EndInit + Min + + +Init + Max + EndInit + Max + + +Init + Incr + EndInit + Incr + + +EndInit + DoLoop + Init + InitLoop + + + +GraphLoop + Init\Index + Init + Index + +3 + 0 + + +GraphLoop + Init\Min + Init + Min + +3 + 0 + + +GraphLoop + Init\Max + Init + Max + +3 + 10 + + +GraphLoop + Init\Incr + Init + Incr + +3 + 1 + diff --git a/examples/GraphRunSyr.py b/examples/GraphRunSyr.py new file mode 100644 index 0000000..44df2e7 --- /dev/null +++ b/examples/GraphRunSyr.py @@ -0,0 +1,41 @@ + +from SuperV import * + +# Warning this script has an IOR (object reference) as Input : +# You may have to redefine it with the result of : +# SyrStruct.ComponentRef( 'FactoryServer' , 'SyrComponent' ) +# See the Input Port forN.InPort( 'SyrComponent' , 'ComponentRef' ) + +#SyrStruct = Graph('../share/salome/resources/SyrStruct.xml') +SyrStruct = Graph('/home/data/jr_HEAD/build/share/salome/resources/SyrStruct.xml') + +exec SyrStruct.ListNodes() + +forN.Input('min',5) +forN.Input('max',8) + +SyrStruct.Start() + +endforN.State() + +SyrStruct.State() + +endforN.Suspend() + +forN.State() + +N = forN.Port( 'N' ) +EndN = endwhileNotOne.Port( 'N' ) +K = endforN.Port( 'K' ) + +forN.Resume() + +while SyrStruct.IsDone() == 0 : + endforN.SuspendedW() + if SyrStruct.IsDone() == 0 : + print N.ToString(),'-->',EndN.ToString(),'with',K.ToString(),'steps' + endforN.Resume() + +SyrStruct.State() + +SyrStruct.PrintPorts() diff --git a/examples/GraphSwitch.py b/examples/GraphSwitch.py new file mode 100644 index 0000000..6e82ad3 --- /dev/null +++ b/examples/GraphSwitch.py @@ -0,0 +1,78 @@ + +# Generated python file of Graph GraphSwitch + +from SuperV import * +# Graph creation +GraphSwitch = Graph( 'GraphSwitch' ) +GraphSwitch.SetName( 'GraphSwitch' ) +GraphSwitch.SetAuthor( '' ) +GraphSwitch.SetComment( '' ) +GraphSwitch.Coords( 0 , 0 ) + +# Creation of Factory Nodes + +# Creation of InLine Nodes +PyIsOdd = [] +PyIsOdd.append( 'import time' ) +PyIsOdd.append( 'def IsOdd(a) : ' ) +PyIsOdd.append( ' print a,"IsOdd" ' ) +PyIsOdd.append( ' time.sleep( 1 )' ) +PyIsOdd.append( ' return a ' ) +IsOdd = GraphSwitch.INode( 'IsOdd' , PyIsOdd ) +IsOdd.InPort( 'a' , 'long' ) +IsOdd.OutPort( 'a' , 'long' ) +IsOdd.SetName( 'IsOdd' ) +IsOdd.SetAuthor( '' ) +IsOdd.SetComment( 'Python function' ) +IsOdd.Coords( 296 , 249 ) + +# Creation of Switch Nodes +PySwitch = [] +PySwitch.append( 'import time' ) +PySwitch.append( 'def Switch(a) : ' ) +PySwitch.append( ' time.sleep( 1 )' ) +PySwitch.append( ' return a & 1,a ' ) +Switch,EndSwitch = GraphSwitch.SNode( 'Switch' , PySwitch ) +EndSwitch.SetName( 'EndSwitch' ) +EndSwitch.SetAuthor( '' ) +EndSwitch.SetComment( '' ) +EndSwitch.Coords( 569 , 94 ) +PyEndSwitch = [] +EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch ) +EndSwitch.InPort( 'a' , 'long' ) +EndSwitch.OutPort( 'a' , 'long' ) +Switch.InPort( 'a' , 'long' ) +Switch.OutPort( 'Odd' , 'long' ) +Switch.OutPort( 'a' , 'long' ) +Switch.SetName( 'Switch' ) +Switch.SetAuthor( '' ) +Switch.SetComment( '' ) +Switch.Coords( 25 , 94 ) + +# Creation of intermediate Output variables and of Control Links +IsOdda = IsOdd.Port( 'a' ) +EndSwitcha = GraphSwitch.Link( IsOdda , EndSwitch.Port( 'a' ) ) +SwitchDefault = Switch.Port( 'Default' ) +EndSwitchDefault = GraphSwitch.Link( SwitchDefault , EndSwitch.Port( 'Default' ) ) +SwitchOdd = Switch.Port( 'Odd' ) +IsOddInGate = GraphSwitch.Link( SwitchOdd , IsOdd.Port( 'InGate' ) ) +IsOddInGate.AddCoord( 1 , 249 , 323 ) +IsOddInGate.AddCoord( 2 , 249 , 157 ) +IsOddInGate.AddCoord( 3 , 247 , 157 ) +Switcha = Switch.Port( 'a' ) +IsOdda = GraphSwitch.Link( Switcha , IsOdd.Port( 'a' ) ) +IsOdda.AddCoord( 1 , 196 , 357 ) +IsOdda.AddCoord( 2 , 196 , 186 ) + +# Creation of Input datas +Switcha = Switch.Input( 'a' , 2) + +# Creation of Output variables +EndSwitcha = EndSwitch.Port( 'a' ) + +GraphSwitch.Run() + +GraphSwitch.DoneW() + +GraphSwitch.PrintPorts() + diff --git a/examples/GraphSwitch.xml b/examples/GraphSwitch.xml new file mode 100644 index 0000000..49076f6 --- /dev/null +++ b/examples/GraphSwitch.xml @@ -0,0 +1,171 @@ + + + + +? + ? + GraphSwitch + 1 + ? + +GraphSwitch + + +long + Switch\a + + +long + EndSwitch\a + + + 24/3/2003 - 15:32:28 + 24/3/2003 - 15:35:29 + 1.04 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + 24/3/2003 - 15:34:50 + 24/3/2003 - 15:34:50 + 1.04 + ? + ? + Python function + 296 + 249 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + a + + +long + Odd + +long + a + + + +Switch + + + 24/3/2003 - 15:34:50 + 24/3/2003 - 15:34:50 + 1.04 + ? + ? + ? + 25 + 94 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + + 24/3/2003 - 15:34:50 + 24/3/2003 - 15:34:50 + 1.04 + ? + ? + ? + 569 + 94 + + +IsOdd + a + EndSwitch + a + + +Switch + Default + EndSwitch + Default + + +Switch + Odd + IsOdd + InGate + + +249 + 323 + +249 + 157 + +247 + 157 + +Switch + a + IsOdd + a + + +196 + 357 + +196 + 186 + + +GraphSwitch + Switch\a + Switch + a + +3 + 2 + diff --git a/examples/GraphSyrControl.py b/examples/GraphSyrControl.py new file mode 100644 index 0000000..0c647d2 --- /dev/null +++ b/examples/GraphSyrControl.py @@ -0,0 +1,216 @@ + +# Generated python file of Graph GraphSyrControl + +from SuperV import * +# Graph creation +GraphSyrControl = Graph( 'GraphSyrControl' ) +GraphSyrControl.SetName( 'GraphSyrControl' ) +GraphSyrControl.SetAuthor( 'JR' ) +GraphSyrControl.SetComment( 'Syracuse algorithm' ) +GraphSyrControl.Coords( 0 , 0 ) + +# Creation of Factory Nodes +test_ISEVEN = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) +test_ISEVEN.SetName( 'test_ISEVEN' ) +test_ISEVEN.SetAuthor( '' ) +test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) +test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' ) +test_ISEVEN.Coords( 190 , 338 ) +test_ISONE = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) +test_ISONE.SetName( 'test_ISONE' ) +test_ISONE.SetAuthor( '' ) +test_ISONE.SetContainer( 'localhost/FactoryServer' ) +test_ISONE.SetComment( 'C_ISONE from SyrComponent' ) +test_ISONE.Coords( 196 , 131 ) +m3p1 = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) +m3p1.SetName( 'm3p1' ) +m3p1.SetAuthor( '' ) +m3p1.SetContainer( 'localhost/FactoryServer' ) +m3p1.SetComment( 'C_M3P1 from SyrComponent' ) +m3p1.Coords( 621 , 14 ) +div2 = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) +div2.SetName( 'div2' ) +div2.SetAuthor( '' ) +div2.SetContainer( 'localhost/FactoryServer' ) +div2.SetComment( 'C_DIV2 from SyrComponent' ) +div2.Coords( 624 , 391 ) +incr = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) +incr.SetName( 'incr' ) +incr.SetAuthor( '' ) +incr.SetContainer( 'localhost/FactoryServer' ) +incr.SetComment( 'C_INCR from SyrComponent' ) +incr.Coords( 622 , 199 ) + +# Creation of InLine Nodes +Pylabel_begin = [] +Pylabel_begin.append( 'def label_begin( NB , KB ):' ) +Pylabel_begin.append( ' print "label_begin",NB,KB' ) +Pylabel_begin.append( ' return NB,KB' ) +label_begin = GraphSyrControl.INode( 'label_begin' , Pylabel_begin ) +label_begin.InPort( 'NB' , 'long' ) +label_begin.InPort( 'KB' , 'long' ) +label_begin.OutPort( 'NT' , 'long' ) +label_begin.OutPort( 'KT' , 'long' ) +label_begin.SetName( 'label_begin' ) +label_begin.SetAuthor( '' ) +label_begin.SetComment( 'Python function' ) +label_begin.Coords( 7 , 216 ) +Pylabel_test = [] +Pylabel_test.append( 'def label_test( ValEven , ValOne , NB , KB ):' ) +Pylabel_test.append( ' print "label_begin",ValEven,ValOne,NB,KB' ) +Pylabel_test.append( ' return ValEven,ValOne,NB,KB' ) +label_test = GraphSyrControl.INode( 'label_test' , Pylabel_test ) +label_test.InPort( 'ValEven' , 'long' ) +label_test.InPort( 'ValOne' , 'long' ) +label_test.InPort( 'NT' , 'long' ) +label_test.InPort( 'KT' , 'long' ) +label_test.OutPort( 'ValEven' , 'long' ) +label_test.OutPort( 'ValOne' , 'long' ) +label_test.OutPort( 'NT' , 'long' ) +label_test.OutPort( 'KT' , 'long' ) +label_test.SetName( 'label_test' ) +label_test.SetAuthor( '' ) +label_test.SetComment( 'Python function' ) +label_test.Coords( 7 , 216 ) + +# Creation of Switch Nodes +Pytest = [] +Pytest.append( 'def Switch_OneEven( ValOne , ValEven , NT , KT ) :' ) +Pytest.append( ' Finished = ValOne' ) +Pytest.append( ' if Finished == 0 :' ) +Pytest.append( ' Incr = 1' ) +Pytest.append( ' Even = ValEven' ) +Pytest.append( ' if Even == 0 :' ) +Pytest.append( ' Odd = 1' ) +Pytest.append( ' else :' ) +Pytest.append( ' Odd = 0' ) +Pytest.append( ' else :' ) +Pytest.append( ' Incr = 0' ) +Pytest.append( ' Even = 0' ) +Pytest.append( ' Odd = 0' ) +Pytest.append( ' Even = ValEven' ) +Pytest.append( ' return Finished,Incr,Even,Odd,NT,KT' ) +test,EndSwitch_OneEven = GraphSyrControl.SNode( 'Switch_OneEven' , Pytest ) +EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' ) +EndSwitch_OneEven.SetAuthor( '' ) +EndSwitch_OneEven.SetComment( '' ) +EndSwitch_OneEven.Coords( 0 , 0 ) +PyEndSwitch_OneEven = [] +PyEndSwitch_OneEven.append( 'def EndSwitch_OneEven( Finished , K ):' ) +PyEndSwitch_OneEven.append( ' print "label_begin",Finished,K' ) +PyEndSwitch_OneEven.append( ' return Finished,K' ) +EndSwitch_OneEven.SetPyFunction( 'EndSwitch_OneEven' , PyEndSwitch_OneEven ) +EndSwitch_OneEven.InPort( 'Finished' , 'long' ) +EndSwitch_OneEven.InPort( 'K' , 'long' ) +EndSwitch_OneEven.OutPort( 'Finished' , 'long' ) +EndSwitch_OneEven.OutPort( 'K' , 'long' ) +test.InPort( 'ValOne' , 'long' ) +test.InPort( 'ValEven' , 'long' ) +test.InPort( 'NT' , 'long' ) +test.InPort( 'KT' , 'long' ) +test.OutPort( 'Finished' , 'long' ) +test.OutPort( 'Incr' , 'long' ) +test.OutPort( 'Even' , 'long' ) +test.OutPort( 'Odd' , 'long' ) +test.OutPort( 'N' , 'long' ) +test.OutPort( 'K' , 'long' ) +test.SetName( 'test' ) +test.SetAuthor( '' ) +test.SetComment( '' ) +test.Coords( 399 , 176 ) + +# Creation of GOTO Nodes +Pycontrol_m3p1 = [] +Pycontrol_m3p1.append( 'def control_m3p1( N , K ):' ) +Pycontrol_m3p1.append( ' return 0,1,N,K' ) +control_m3p1 = GraphSyrControl.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' ) +control_m3p1.InPort( 'N' , 'long' ) +control_m3p1.InPort( 'K' , 'long' ) +control_m3p1.OutPort( 'ValOne' , 'long' ) +control_m3p1.OutPort( 'ValEven' , 'long' ) +control_m3p1.OutPort( 'NT' , 'long' ) +control_m3p1.OutPort( 'KT' , 'long' ) +control_m3p1.SetName( 'control_m3p1' ) +control_m3p1.SetAuthor( '' ) +control_m3p1.SetComment( '' ) +control_m3p1.Coords( 814 , 13 ) +Pycontrol_div2 = [] +Pycontrol_div2.append( 'def control_div2( N , NB ) :' ) +Pycontrol_div2.append( ' return N,NB' ) +control_div2 = GraphSyrControl.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) +control_div2.InPort( 'N' , 'long' ) +control_div2.InPort( 'K' , 'long' ) +control_div2.OutPort( 'NB' , 'long' ) +control_div2.OutPort( 'KB' , 'long' ) +control_div2.SetName( 'control_div2' ) +control_div2.SetAuthor( '' ) +control_div2.SetComment( '' ) +control_div2.Coords( 812 , 414 ) + +# Creation of intermediate Output variables and of Control Links +test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) +label_testValEven = GraphSyrControl.Link( test_ISEVENBoolEven , label_test.Port( 'ValEven' ) ) +test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) +label_testValOne = GraphSyrControl.Link( test_ISONEBoolOne , label_test.Port( 'ValOne' ) ) +m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) +control_m3p1N = GraphSyrControl.Link( m3p1anEvenInteger , control_m3p1.Port( 'N' ) ) +div2anInteger = div2.Port( 'anInteger' ) +control_div2N = GraphSyrControl.Link( div2anInteger , control_div2.Port( 'N' ) ) +incraNewCount = incr.Port( 'aNewCount' ) +control_m3p1K = GraphSyrControl.Link( incraNewCount , control_m3p1.Port( 'K' ) ) +control_div2K = GraphSyrControl.Link( incraNewCount , control_div2.Port( 'K' ) ) +label_beginNT = label_begin.Port( 'NT' ) +label_testNT = GraphSyrControl.Link( label_beginNT , label_test.Port( 'NT' ) ) +test_ISEVENanInteger = GraphSyrControl.Link( label_beginNT , test_ISEVEN.Port( 'anInteger' ) ) +test_ISONEanInteger = GraphSyrControl.Link( label_beginNT , test_ISONE.Port( 'anInteger' ) ) +label_beginKT = label_begin.Port( 'KT' ) +label_testKT = GraphSyrControl.Link( label_beginKT , label_test.Port( 'KT' ) ) +label_testValEven = label_test.Port( 'ValEven' ) +testValEven = GraphSyrControl.Link( label_testValEven , test.Port( 'ValEven' ) ) +label_testValOne = label_test.Port( 'ValOne' ) +testValOne = GraphSyrControl.Link( label_testValOne , test.Port( 'ValOne' ) ) +label_testNT = label_test.Port( 'NT' ) +testNT = GraphSyrControl.Link( label_testNT , test.Port( 'NT' ) ) +label_testKT = label_test.Port( 'KT' ) +testKT = GraphSyrControl.Link( label_testKT , test.Port( 'KT' ) ) +testDefault = test.Port( 'Default' ) +EndSwitch_OneEvenDefault = GraphSyrControl.Link( testDefault , EndSwitch_OneEven.Port( 'Default' ) ) +testFinished = test.Port( 'Finished' ) +EndSwitch_OneEvenFinished = GraphSyrControl.Link( testFinished , EndSwitch_OneEven.Port( 'Finished' ) ) +testIncr = test.Port( 'Incr' ) +incrInGate = GraphSyrControl.Link( testIncr , incr.Port( 'InGate' ) ) +testEven = test.Port( 'Even' ) +div2InGate = GraphSyrControl.Link( testEven , div2.Port( 'InGate' ) ) +testOdd = test.Port( 'Odd' ) +m3p1InGate = GraphSyrControl.Link( testOdd , m3p1.Port( 'InGate' ) ) +testN = test.Port( 'N' ) +m3p1anOddInteger = GraphSyrControl.Link( testN , m3p1.Port( 'anOddInteger' ) ) +div2anEvenInteger = GraphSyrControl.Link( testN , div2.Port( 'anEvenInteger' ) ) +testK = test.Port( 'K' ) +EndSwitch_OneEvenK = GraphSyrControl.Link( testK , EndSwitch_OneEven.Port( 'K' ) ) +incraCount = GraphSyrControl.Link( testK , incr.Port( 'aCount' ) ) + +# Creation of intermediate Output variables and of Loop Links +control_m3p1OutGate = control_m3p1.Port( 'OutGate' ) +label_testInGate = GraphSyrControl.Link( control_m3p1OutGate , label_test.Port( 'InGate' ) ) +control_div2OutGate = control_div2.Port( 'OutGate' ) +label_beginInGate = GraphSyrControl.Link( control_div2OutGate , label_begin.Port( 'InGate' ) ) + +# Creation of Input datas +label_beginNB = label_begin.Input( 'NB' , 7) +label_beginKB = label_begin.Input( 'KB' , 0) + +# Creation of Output variables +EndSwitch_OneEvenFinished = EndSwitch_OneEven.Port( 'Finished' ) +EndSwitch_OneEvenK = EndSwitch_OneEven.Port( 'K' ) + +GraphSyrControl.Run( 7 ) + +GraphSyrControl.DoneW() + +GraphSyrControl.State() + +GraphSyrControl.PrintPorts() + +label_begin.EPyFunc() + diff --git a/examples/GraphSyrControl.xml b/examples/GraphSyrControl.xml new file mode 100644 index 0000000..b8768ca --- /dev/null +++ b/examples/GraphSyrControl.xml @@ -0,0 +1,604 @@ + + + + +? + ? + GraphSyrControl + 1 + ? + +GraphSyrControl + + +long + label_begin\NB + +long + label_begin\KB + + +long + EndSwitch_OneEven\Finished + +long + EndSwitch_OneEven\K + + + 11/3/2003 - 18:34:21 + 25/3/2003 - 17:19:38 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + + +SyrComponent + SyrComponent + test_ISEVEN + 0 + ? + +C_ISEVEN + + +long + anInteger + + +long + BoolEven + + + 25/3/2003 - 17:19:38 + 25/3/2003 - 17:19:38 + 1.04 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 190 + 338 + +SyrComponent + SyrComponent + test_ISONE + 0 + ? + +C_ISONE + + +long + anInteger + + +long + BoolOne + + + 25/3/2003 - 17:19:38 + 25/3/2003 - 17:19:38 + 1.04 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 196 + 131 + +SyrComponent + SyrComponent + m3p1 + 0 + ? + +C_M3P1 + + +long + anOddInteger + + +long + anEvenInteger + + + 25/3/2003 - 17:19:38 + 25/3/2003 - 17:19:38 + 1.04 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 621 + 14 + +SyrComponent + SyrComponent + div2 + 0 + ? + +C_DIV2 + + +long + anEvenInteger + + +long + anInteger + + + 25/3/2003 - 17:19:38 + 25/3/2003 - 17:19:38 + 1.04 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 624 + 391 + +SyrComponent + SyrComponent + incr + 0 + ? + +C_INCR + + +long + aCount + + +long + aNewCount + + + 25/3/2003 - 17:19:38 + 25/3/2003 - 17:19:38 + 1.04 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 622 + 199 + +? + ? + label_begin + 3 + ? + +label_begin + + +long + NB + +long + KB + + +long + NT + +long + KT + + + +label_begin + + + + 25/3/2003 - 17:19:38 + 25/3/2003 - 17:19:38 + 1.04 + ? + ? + Python function + 7 + 216 + +? + ? + label_test + 3 + ? + +label_test + + +long + ValEven + +long + ValOne + +long + NT + +long + KT + + +long + ValEven + +long + ValOne + +long + NT + +long + KT + + + +label_test + + + + 25/3/2003 - 17:19:38 + 25/3/2003 - 17:19:38 + 1.04 + ? + ? + Python function + 7 + 216 + +? + ? + test + 6 + EndSwitch_OneEven + +test + + +long + ValOne + +long + ValEven + +long + NT + +long + KT + + +long + Finished + +long + Incr + +long + Even + +long + Odd + +long + N + +long + K + + + +Switch_OneEven + + + + + + + + + + + + + + + + 25/3/2003 - 17:19:38 + 25/3/2003 - 17:19:38 + 1.04 + ? + ? + ? + 399 + 176 + +? + ? + EndSwitch_OneEven + 7 + test + +EndSwitch_OneEven + + +long + Finished + +long + K + + +long + Finished + +long + K + + + +EndSwitch_OneEven + + + + 25/3/2003 - 17:19:38 + 25/3/2003 - 17:19:38 + 1.04 + ? + ? + ? + 0 + 0 + +? + ? + control_m3p1 + 8 + label_test + +control_m3p1 + + +long + N + +long + K + + +long + ValOne + +long + ValEven + +long + NT + +long + KT + + + +control_m3p1 + + + 25/3/2003 - 17:19:38 + 25/3/2003 - 17:19:38 + 1.04 + ? + ? + ? + 814 + 13 + +? + ? + control_div2 + 8 + label_begin + +control_div2 + + +long + N + +long + K + + +long + NB + +long + KB + + + +control_div2 + + + 25/3/2003 - 17:19:38 + 25/3/2003 - 17:19:38 + 1.04 + ? + ? + ? + 812 + 414 + + +test_ISEVEN + BoolEven + label_test + ValEven + + +test_ISONE + BoolOne + label_test + ValOne + + +m3p1 + anEvenInteger + control_m3p1 + N + + +div2 + anInteger + control_div2 + N + + +incr + aNewCount + control_m3p1 + K + + +incr + aNewCount + control_div2 + K + + +label_begin + NT + label_test + NT + + +label_begin + NT + test_ISEVEN + anInteger + + +label_begin + NT + test_ISONE + anInteger + + +label_begin + KT + label_test + KT + + +label_test + ValEven + test + ValEven + + +label_test + ValOne + test + ValOne + + +label_test + NT + test + NT + + +label_test + KT + test + KT + + +test + Default + EndSwitch_OneEven + Default + + +test + Finished + EndSwitch_OneEven + Finished + + +test + Incr + incr + InGate + + +test + Even + div2 + InGate + + +test + Odd + m3p1 + InGate + + +test + N + m3p1 + anOddInteger + + +test + N + div2 + anEvenInteger + + +test + K + EndSwitch_OneEven + K + + +test + K + incr + aCount + + +control_m3p1 + OutGate + label_test + InGate + + +control_div2 + OutGate + label_begin + InGate + + + +GraphSyrControl + label_begin\NB + label_begin + NB + +3 + 7 + + +GraphSyrControl + label_begin\KB + label_begin + KB + +3 + 0 + diff --git a/examples/GraphSyrControlAve.py b/examples/GraphSyrControlAve.py new file mode 100644 index 0000000..995dfda --- /dev/null +++ b/examples/GraphSyrControlAve.py @@ -0,0 +1,309 @@ + +# Generated python file of Graph GraphSyrControlAve + +from SuperV import * +# Graph creation +GraphSyrControlAve = Graph( 'GraphSyrControlAve' ) +GraphSyrControlAve.SetName( 'GraphSyrControlAve' ) +GraphSyrControlAve.SetAuthor( 'JR' ) +GraphSyrControlAve.SetComment( 'Syracuse algorithm' ) +GraphSyrControlAve.Coords( 0 , 0 ) + +# Creation of Factory Nodes +test_ISEVEN = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) +test_ISEVEN.SetName( 'test_ISEVEN' ) +test_ISEVEN.SetAuthor( '' ) +test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) +test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' ) +test_ISEVEN.Coords( 190 , 338 ) +test_ISONE = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) +test_ISONE.SetName( 'test_ISONE' ) +test_ISONE.SetAuthor( '' ) +test_ISONE.SetContainer( 'localhost/FactoryServer' ) +test_ISONE.SetComment( 'C_ISONE from SyrComponent' ) +test_ISONE.Coords( 196 , 131 ) +m3p1 = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) +m3p1.SetName( 'm3p1' ) +m3p1.SetAuthor( '' ) +m3p1.SetContainer( 'localhost/FactoryServer' ) +m3p1.SetComment( 'C_M3P1 from SyrComponent' ) +m3p1.Coords( 621 , 29 ) +div2 = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) +div2.SetName( 'div2' ) +div2.SetAuthor( '' ) +div2.SetContainer( 'localhost/FactoryServer' ) +div2.SetComment( 'C_DIV2 from SyrComponent' ) +div2.Coords( 624 , 391 ) +incr = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) +incr.SetName( 'incr' ) +incr.SetAuthor( '' ) +incr.SetContainer( 'localhost/FactoryServer' ) +incr.SetComment( 'C_INCR from SyrComponent' ) +incr.Coords( 623 , 206 ) +C_MIN = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_MIN' ) +C_MIN.SetName( 'C_MIN' ) +C_MIN.SetAuthor( '' ) +C_MIN.SetContainer( 'localhost/FactoryServer' ) +C_MIN.SetComment( 'C_MIN from SyrComponent' ) +C_MIN.Coords( 0 , 0 ) +C_MAX = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_MAX' ) +C_MAX.SetName( 'C_MAX' ) +C_MAX.SetAuthor( '' ) +C_MAX.SetContainer( 'localhost/FactoryServer' ) +C_MAX.SetComment( 'C_MAX from SyrComponent' ) +C_MAX.Coords( 0 , 0 ) +C_AVERAGE = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_AVERAGE' ) +C_AVERAGE.SetName( 'C_AVERAGE' ) +C_AVERAGE.SetAuthor( '' ) +C_AVERAGE.SetContainer( 'localhost/FactoryServer' ) +C_AVERAGE.SetComment( 'C_AVERAGE from SyrComponent' ) +C_AVERAGE.Coords( 0 , 0 ) +C_LISTOFSYR = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_LISTOFSYR' ) +C_LISTOFSYR.SetName( 'C_LISTOFSYR' ) +C_LISTOFSYR.SetAuthor( '' ) +C_LISTOFSYR.SetContainer( 'localhost/FactoryServer' ) +C_LISTOFSYR.SetComment( 'C_LISTOFSYR from SyrComponent' ) +C_LISTOFSYR.Coords( 0 , 0 ) + +# Creation of InLine Nodes +Pylabel_begin = [] +Pylabel_begin.append( 'def label_begin( NB , KB , MINB , MAXB , AVERAGEB , SYRLISTB ) :' ) +Pylabel_begin.append( ' return NB,KB,MINB,MAXB,AVERAGEB,SYRLISTB' ) +label_begin = GraphSyrControlAve.INode( 'label_begin' , Pylabel_begin ) +label_begin.InPort( 'NB' , 'long' ) +label_begin.InPort( 'KB' , 'long' ) +label_begin.InPort( 'MINB' , 'long' ) +label_begin.InPort( 'MAXB' , 'long' ) +label_begin.InPort( 'AVERAGEB' , 'double' ) +label_begin.InPort( 'SYRLISTB' , 'ListOfSyr' ) +label_begin.OutPort( 'NT' , 'long' ) +label_begin.OutPort( 'KT' , 'long' ) +label_begin.OutPort( 'MIN' , 'long' ) +label_begin.OutPort( 'MAX' , 'long' ) +label_begin.OutPort( 'AVERAGE' , 'double' ) +label_begin.OutPort( 'SYRLIST' , 'ListOfSyr' ) +label_begin.SetName( 'label_begin' ) +label_begin.SetAuthor( '' ) +label_begin.SetComment( 'Python function' ) +label_begin.Coords( 7 , 216 ) + +# Creation of Switch Nodes +Pylabel_test = [] +Pylabel_test.append( 'def L_OneEven( ValOne , ValEven , NT , KT , MIN , MAX , AVERAGE , SYRLIST ):' ) +Pylabel_test.append( ' Finished = ValOne' ) +Pylabel_test.append( ' if Finished == 0 :' ) +Pylabel_test.append( ' Incr = 1' ) +Pylabel_test.append( ' Even = ValEven' ) +Pylabel_test.append( ' if Even == 0 :' ) +Pylabel_test.append( ' Odd = 1' ) +Pylabel_test.append( ' else :' ) +Pylabel_test.append( ' Odd = 0' ) +Pylabel_test.append( ' else :' ) +Pylabel_test.append( ' Incr = 0' ) +Pylabel_test.append( ' Even = 0' ) +Pylabel_test.append( ' Odd = 0' ) +Pylabel_test.append( ' Even = ValEven' ) +Pylabel_test.append( ' return Finished,Incr,Even,Odd,NT,KT,MIN,MAX,AVERAGE,SYRLIST' ) +label_test,EndL_OneEven = GraphSyrControlAve.SNode( 'L_OneEven' , Pylabel_test ) +EndL_OneEven.SetName( 'EndL_OneEven' ) +EndL_OneEven.SetAuthor( '' ) +EndL_OneEven.SetComment( '' ) +EndL_OneEven.Coords( 1045 , 278 ) +PyEndL_OneEven = [] +EndL_OneEven.SetPyFunction( 'EndL_OneEven' , PyEndL_OneEven ) +label_test.InPort( 'ValOne' , 'long' ) +label_test.InPort( 'ValEven' , 'long' ) +label_test.InPort( 'NT' , 'long' ) +label_test.InPort( 'KT' , 'long' ) +label_test.InPort( 'MIN' , 'long' ) +label_test.InPort( 'MAX' , 'long' ) +label_test.InPort( 'AVERAGE' , 'double' ) +label_test.InPort( 'SYRLIST' , 'ListOfSyr' ) +label_test.OutPort( 'Finished' , 'long' ) +label_test.OutPort( 'Incr' , 'long' ) +label_test.OutPort( 'Even' , 'long' ) +label_test.OutPort( 'Odd' , 'long' ) +label_test.OutPort( 'N' , 'long' ) +label_test.OutPort( 'K' , 'long' ) +label_test.OutPort( 'MINT' , 'long' ) +label_test.OutPort( 'MAXT' , 'long' ) +label_test.OutPort( 'AVERAGET' , 'double' ) +label_test.OutPort( 'SYRLISTT' , 'ListOfSyr' ) +label_test.SetName( 'label_test' ) +label_test.SetAuthor( '' ) +label_test.SetComment( '' ) +label_test.Coords( 399 , 176 ) + +# Creation of GOTO Nodes +Pycontrol_m3p1 = [] +Pycontrol_m3p1.append( 'def C_NotOneIsEven( N , K , MINT , MAXT , AVERAGET , SYRLISTT ):' ) +Pycontrol_m3p1.append( ' return 0,1,N,K,MINT,MAXT,AVERAGET,SYRLISTT' ) +control_m3p1 = GraphSyrControlAve.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' ) +control_m3p1.InPort( 'N' , 'long' ) +control_m3p1.InPort( 'K' , 'long' ) +control_m3p1.InPort( 'MINT' , 'long' ) +control_m3p1.InPort( 'MAXT' , 'long' ) +control_m3p1.InPort( 'AVERAGET' , 'double' ) +control_m3p1.InPort( 'SYRLISTT' , 'ListOfSyr' ) +control_m3p1.OutPort( 'ValOne' , 'long' ) +control_m3p1.OutPort( 'ValEven' , 'long' ) +control_m3p1.OutPort( 'NT' , 'long' ) +control_m3p1.OutPort( 'KT' , 'long' ) +control_m3p1.OutPort( 'MIN' , 'long' ) +control_m3p1.OutPort( 'MAX' , 'long' ) +control_m3p1.OutPort( 'AVERAGE' , 'double' ) +control_m3p1.OutPort( 'SYRLIST' , 'ListOfSyr' ) +control_m3p1.SetName( 'control_m3p1' ) +control_m3p1.SetAuthor( '' ) +control_m3p1.SetComment( '' ) +control_m3p1.Coords( 808 , 29 ) +Pycontrol_div2 = [] +Pycontrol_div2.append( 'def control_div2( N , K , MINT , MAXT , AVERAGET , SYRLISTT ) :' ) +Pycontrol_div2.append( ' return N,K,MINT,MAXT,AVERAGET,SYRLISTT' ) +control_div2 = GraphSyrControlAve.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) +control_div2.InPort( 'N' , 'long' ) +control_div2.InPort( 'K' , 'long' ) +control_div2.InPort( 'MINT' , 'long' ) +control_div2.InPort( 'MAXT' , 'long' ) +control_div2.InPort( 'AVERAGET' , 'double' ) +control_div2.InPort( 'SYRLISTT' , 'ListOfSyr' ) +control_div2.OutPort( 'NB' , 'long' ) +control_div2.OutPort( 'KB' , 'long' ) +control_div2.OutPort( 'MINB' , 'long' ) +control_div2.OutPort( 'MAXB' , 'long' ) +control_div2.OutPort( 'AVERAGEB' , 'double' ) +control_div2.OutPort( 'SYRLISTB' , 'ListOfSyr' ) +control_div2.SetName( 'control_div2' ) +control_div2.SetAuthor( '' ) +control_div2.SetComment( '' ) +control_div2.Coords( 812 , 357 ) + +# Creation of intermediate Output variables and of Control Links +test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) +label_testValEven = GraphSyrControlAve.Link( test_ISEVENBoolEven , label_test.Port( 'ValEven' ) ) +label_testValEven.AddCoord( 1 , 385 , 358 ) +label_testValEven.AddCoord( 2 , 385 , 490 ) +test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) +label_testValOne = GraphSyrControlAve.Link( test_ISONEBoolOne , label_test.Port( 'ValOne' ) ) +label_testValOne.AddCoord( 1 , 385 , 328 ) +label_testValOne.AddCoord( 2 , 385 , 283 ) +m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) +control_m3p1N = GraphSyrControlAve.Link( m3p1anEvenInteger , control_m3p1.Port( 'N' ) ) +control_m3p1N.AddCoord( 1 , 786 , 181 ) +control_m3p1N.AddCoord( 2 , 786 , 182 ) +div2anInteger = div2.Port( 'anInteger' ) +control_div2N = GraphSyrControlAve.Link( div2anInteger , control_div2.Port( 'N' ) ) +control_div2N.AddCoord( 1 , 799 , 509 ) +control_div2N.AddCoord( 2 , 799 , 543 ) +incraNewCount = incr.Port( 'aNewCount' ) +control_div2K = GraphSyrControlAve.Link( incraNewCount , control_div2.Port( 'K' ) ) +control_div2K.AddCoord( 1 , 787 , 539 ) +control_div2K.AddCoord( 2 , 787 , 359 ) +control_m3p1K = GraphSyrControlAve.Link( incraNewCount , control_m3p1.Port( 'K' ) ) +control_m3p1K.AddCoord( 1 , 790 , 211 ) +control_m3p1K.AddCoord( 2 , 790 , 358 ) +C_AVERAGEaCount = GraphSyrControlAve.Link( incraNewCount , C_AVERAGE.Port( 'aCount' ) ) +label_beginNT = label_begin.Port( 'NT' ) +test_ISONEanInteger = GraphSyrControlAve.Link( label_beginNT , test_ISONE.Port( 'anInteger' ) ) +test_ISONEanInteger.AddCoord( 1 , 175 , 283 ) +test_ISONEanInteger.AddCoord( 2 , 175 , 368 ) +label_testNT = GraphSyrControlAve.Link( label_beginNT , label_test.Port( 'NT' ) ) +label_testNT.AddCoord( 1 , 367 , 388 ) +label_testNT.AddCoord( 2 , 367 , 319 ) +label_testNT.AddCoord( 3 , 175 , 321 ) +label_testNT.AddCoord( 4 , 175 , 368 ) +test_ISEVENanInteger = GraphSyrControlAve.Link( label_beginNT , test_ISEVEN.Port( 'anInteger' ) ) +test_ISEVENanInteger.AddCoord( 1 , 183 , 486 ) +test_ISEVENanInteger.AddCoord( 2 , 183 , 368 ) +label_beginKT = label_begin.Port( 'KT' ) +label_testKT = GraphSyrControlAve.Link( label_beginKT , label_test.Port( 'KT' ) ) +label_testKT.AddCoord( 1 , 373 , 418 ) +label_testKT.AddCoord( 2 , 373 , 518 ) +label_testKT.AddCoord( 3 , 176 , 519 ) +label_testKT.AddCoord( 4 , 176 , 398 ) +label_beginMIN = label_begin.Port( 'MIN' ) +label_testMIN = GraphSyrControlAve.Link( label_beginMIN , label_test.Port( 'MIN' ) ) +label_beginMAX = label_begin.Port( 'MAX' ) +label_testMAX = GraphSyrControlAve.Link( label_beginMAX , label_test.Port( 'MAX' ) ) +label_beginAVERAGE = label_begin.Port( 'AVERAGE' ) +label_testAVERAGE = GraphSyrControlAve.Link( label_beginAVERAGE , label_test.Port( 'AVERAGE' ) ) +label_beginSYRLIST = label_begin.Port( 'SYRLIST' ) +label_testSYRLIST = GraphSyrControlAve.Link( label_beginSYRLIST , label_test.Port( 'SYRLIST' ) ) +label_testDefault = label_test.Port( 'Default' ) +EndL_OneEvenDefault = GraphSyrControlAve.Link( label_testDefault , EndL_OneEven.Port( 'Default' ) ) +label_testIncr = label_test.Port( 'Incr' ) +incrInGate = GraphSyrControlAve.Link( label_testIncr , incr.Port( 'InGate' ) ) +incrInGate.AddCoord( 1 , 578 , 328 ) +incrInGate.AddCoord( 2 , 578 , 358 ) +label_testEven = label_test.Port( 'Even' ) +div2InGate = GraphSyrControlAve.Link( label_testEven , div2.Port( 'InGate' ) ) +div2InGate.AddCoord( 1 , 578 , 513 ) +div2InGate.AddCoord( 2 , 578 , 388 ) +label_testOdd = label_test.Port( 'Odd' ) +m3p1InGate = GraphSyrControlAve.Link( label_testOdd , m3p1.Port( 'InGate' ) ) +m3p1InGate.AddCoord( 1 , 565 , 151 ) +m3p1InGate.AddCoord( 2 , 565 , 418 ) +label_testN = label_test.Port( 'N' ) +m3p1anOddInteger = GraphSyrControlAve.Link( label_testN , m3p1.Port( 'anOddInteger' ) ) +m3p1anOddInteger.AddCoord( 1 , 609 , 181 ) +m3p1anOddInteger.AddCoord( 2 , 609 , 448 ) +div2anEvenInteger = GraphSyrControlAve.Link( label_testN , div2.Port( 'anEvenInteger' ) ) +div2anEvenInteger.AddCoord( 1 , 612 , 543 ) +div2anEvenInteger.AddCoord( 2 , 612 , 448 ) +C_MINanInteger = GraphSyrControlAve.Link( label_testN , C_MIN.Port( 'anInteger' ) ) +C_MAXanInteger = GraphSyrControlAve.Link( label_testN , C_MAX.Port( 'anInteger' ) ) +C_AVERAGEanInteger = GraphSyrControlAve.Link( label_testN , C_AVERAGE.Port( 'anInteger' ) ) +label_testK = label_test.Port( 'K' ) +incraCount = GraphSyrControlAve.Link( label_testK , incr.Port( 'aCount' ) ) +incraCount.AddCoord( 1 , 594 , 358 ) +incraCount.AddCoord( 2 , 594 , 478 ) +label_testMINT = label_test.Port( 'MINT' ) +C_MINaMinVal = GraphSyrControlAve.Link( label_testMINT , C_MIN.Port( 'aMinVal' ) ) +label_testMAXT = label_test.Port( 'MAXT' ) +C_MAXaMaxVal = GraphSyrControlAve.Link( label_testMAXT , C_MAX.Port( 'aMaxVal' ) ) +label_testSYRLISTT = label_test.Port( 'SYRLISTT' ) +C_AVERAGEaListOfSyr = GraphSyrControlAve.Link( label_testSYRLISTT , C_AVERAGE.Port( 'aListOfSyr' ) ) +control_m3p1OutGate = control_m3p1.Port( 'OutGate' ) +label_testInGate = GraphSyrControlAve.Link( control_m3p1OutGate , label_test.Port( 'InGate' ) ) +C_MINaNewMinVal = C_MIN.Port( 'aNewMinVal' ) +control_m3p1MINT = GraphSyrControlAve.Link( C_MINaNewMinVal , control_m3p1.Port( 'MINT' ) ) +control_div2MINT = GraphSyrControlAve.Link( C_MINaNewMinVal , control_div2.Port( 'MINT' ) ) +C_MAXaNewMaxVal = C_MAX.Port( 'aNewMaxVal' ) +control_m3p1MAXT = GraphSyrControlAve.Link( C_MAXaNewMaxVal , control_m3p1.Port( 'MAXT' ) ) +control_div2MAXT = GraphSyrControlAve.Link( C_MAXaNewMaxVal , control_div2.Port( 'MAXT' ) ) +C_AVERAGEaNewListOfSyr = C_AVERAGE.Port( 'aNewListOfSyr' ) +control_m3p1SYRLISTT = GraphSyrControlAve.Link( C_AVERAGEaNewListOfSyr , control_m3p1.Port( 'SYRLISTT' ) ) +control_div2SYRLISTT = GraphSyrControlAve.Link( C_AVERAGEaNewListOfSyr , control_div2.Port( 'SYRLISTT' ) ) +C_AVERAGEanAverage = C_AVERAGE.Port( 'anAverage' ) +control_m3p1AVERAGET = GraphSyrControlAve.Link( C_AVERAGEanAverage , control_m3p1.Port( 'AVERAGET' ) ) +control_div2AVERAGET = GraphSyrControlAve.Link( C_AVERAGEanAverage , control_div2.Port( 'AVERAGET' ) ) +C_LISTOFSYRaListOfSyr = C_LISTOFSYR.Port( 'aListOfSyr' ) +label_beginSYRLISTB = GraphSyrControlAve.Link( C_LISTOFSYRaListOfSyr , label_begin.Port( 'SYRLISTB' ) ) + +# Creation of intermediate Output variables and of Loop Links +control_div2OutGate = control_div2.Port( 'OutGate' ) +label_beginInGate = GraphSyrControlAve.Link( control_div2OutGate , label_begin.Port( 'InGate' ) ) + +# Creation of Input datas +label_beginNB = label_begin.Input( 'NB' , 7) +label_beginKB = label_begin.Input( 'KB' , 0) +label_beginMINB = label_begin.Input( 'MINB' , 0) +label_beginMAXB = label_begin.Input( 'MAXB' , 0) +label_beginAVERAGEB = label_begin.Input( 'AVERAGEB' , 0) + +# Creation of Output variables +label_testFinished = label_test.Port( 'Finished' ) +label_testAVERAGET = label_test.Port( 'AVERAGET' ) + +GraphSyrControlAve.PrintPorts() + +GraphSyrControlAve.Export('../GraphSyrControlAve') + +GraphSyrControlAve.Run( 7 ) + +GraphSyrControlAve.DoneW() + +GraphSyrControlAve.State() + +GraphSyrControlAve.PrintPorts() + diff --git a/examples/GraphSyrControlAve.xml b/examples/GraphSyrControlAve.xml new file mode 100644 index 0000000..1d8b6d6 --- /dev/null +++ b/examples/GraphSyrControlAve.xml @@ -0,0 +1,978 @@ + + + + +? + ? + GraphSyrControlAve + 1 + ? + +GraphSyrControlAve + + +long + label_begin\NB + +long + label_begin\KB + +long + label_begin\MINB + +long + label_begin\MAXB + +double + label_begin\AVERAGEB + + +long + label_test\Finished + +double + label_test\AVERAGET + + + 11/3/2003 - 17:46:14 + 25/3/2003 - 17:27:49 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + + +SyrComponent + SyrComponent + test_ISEVEN + 0 + ? + +C_ISEVEN + + +long + anInteger + + +long + BoolEven + + + 25/3/2003 - 17:27:49 + 25/3/2003 - 17:27:49 + 1.04 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 190 + 338 + +SyrComponent + SyrComponent + test_ISONE + 0 + ? + +C_ISONE + + +long + anInteger + + +long + BoolOne + + + 25/3/2003 - 17:27:49 + 25/3/2003 - 17:27:49 + 1.04 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 196 + 131 + +SyrComponent + SyrComponent + m3p1 + 0 + ? + +C_M3P1 + + +long + anOddInteger + + +long + anEvenInteger + + + 25/3/2003 - 17:27:49 + 25/3/2003 - 17:27:49 + 1.04 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 621 + 29 + +SyrComponent + SyrComponent + div2 + 0 + ? + +C_DIV2 + + +long + anEvenInteger + + +long + anInteger + + + 25/3/2003 - 17:27:49 + 25/3/2003 - 17:27:49 + 1.04 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 624 + 391 + +SyrComponent + SyrComponent + incr + 0 + ? + +C_INCR + + +long + aCount + + +long + aNewCount + + + 25/3/2003 - 17:27:49 + 25/3/2003 - 17:27:49 + 1.04 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 623 + 206 + +? + ? + label_begin + 3 + ? + +label_begin + + +long + NB + +long + KB + +long + MINB + +long + MAXB + +double + AVERAGEB + +ListOfSyr + SYRLISTB + + +long + NT + +long + KT + +long + MIN + +long + MAX + +double + AVERAGE + +ListOfSyr + SYRLIST + + + +label_begin + + + 25/3/2003 - 17:27:49 + 25/3/2003 - 17:27:49 + 1.04 + ? + ? + Python function + 7 + 216 + +? + ? + label_test + 6 + EndL_OneEven + +label_test + + +long + ValOne + +long + ValEven + +long + NT + +long + KT + +long + MIN + +long + MAX + +double + AVERAGE + +ListOfSyr + SYRLIST + + +long + Finished + +long + Incr + +long + Even + +long + Odd + +long + N + +long + K + +long + MINT + +long + MAXT + +double + AVERAGET + +ListOfSyr + SYRLISTT + + + +L_OneEven + + + + + + + + + + + + + + + + 25/3/2003 - 17:27:49 + 25/3/2003 - 17:27:49 + 1.04 + ? + ? + ? + 399 + 176 + +? + ? + EndL_OneEven + 7 + label_test + +EndL_OneEven + + + + + + 25/3/2003 - 17:27:49 + 25/3/2003 - 17:27:49 + 1.04 + ? + ? + ? + 1045 + 278 + +? + ? + control_m3p1 + 8 + label_test + +control_m3p1 + + +long + N + +long + K + +long + MINT + +long + MAXT + +double + AVERAGET + +ListOfSyr + SYRLISTT + + +long + ValOne + +long + ValEven + +long + NT + +long + KT + +long + MIN + +long + MAX + +double + AVERAGE + +ListOfSyr + SYRLIST + + + +C_NotOneIsEven + + + 25/3/2003 - 17:27:49 + 25/3/2003 - 17:27:49 + 1.04 + ? + ? + ? + 808 + 29 + +? + ? + control_div2 + 8 + label_begin + +control_div2 + + +long + N + +long + K + +long + MINT + +long + MAXT + +double + AVERAGET + +ListOfSyr + SYRLISTT + + +long + NB + +long + KB + +long + MINB + +long + MAXB + +double + AVERAGEB + +ListOfSyr + SYRLISTB + + + +control_div2 + + + 25/3/2003 - 17:27:49 + 25/3/2003 - 17:27:49 + 1.04 + ? + ? + ? + 812 + 357 + +SyrComponent + SyrComponent + C_MIN + 0 + ? + +C_MIN + + +long + aMinVal + +long + anInteger + + +long + aNewMinVal + + + 25/3/2003 - 17:27:49 + 25/3/2003 - 17:27:49 + 1.04 + ? + localhost/FactoryServer + C_MIN from SyrComponent + 0 + 0 + +SyrComponent + SyrComponent + C_MAX + 0 + ? + +C_MAX + + +long + aMaxVal + +long + anInteger + + +long + aNewMaxVal + + + 25/3/2003 - 17:27:49 + 25/3/2003 - 17:27:49 + 1.04 + ? + localhost/FactoryServer + C_MAX from SyrComponent + 0 + 0 + +SyrComponent + SyrComponent + C_AVERAGE + 0 + ? + +C_AVERAGE + + +ListOfSyr + aListOfSyr + +long + anInteger + +long + aCount + + +ListOfSyr + aNewListOfSyr + +double + anAverage + + + 25/3/2003 - 17:27:49 + 25/3/2003 - 17:27:49 + 1.04 + ? + localhost/FactoryServer + C_AVERAGE from SyrComponent + 0 + 0 + +SyrComponent + SyrComponent + C_LISTOFSYR + 0 + ? + +C_LISTOFSYR + + + +ListOfSyr + aListOfSyr + + + 25/3/2003 - 17:27:49 + 25/3/2003 - 17:27:49 + 1.04 + ? + localhost/FactoryServer + C_LISTOFSYR from SyrComponent + 0 + 0 + + +test_ISEVEN + BoolEven + label_test + ValEven + + +385 + 358 + +385 + 490 + +test_ISONE + BoolOne + label_test + ValOne + + +385 + 328 + +385 + 283 + +m3p1 + anEvenInteger + control_m3p1 + N + + +786 + 181 + +786 + 182 + +div2 + anInteger + control_div2 + N + + +799 + 509 + +799 + 543 + +incr + aNewCount + control_div2 + K + + +787 + 539 + +787 + 359 + +incr + aNewCount + control_m3p1 + K + + +790 + 211 + +790 + 358 + +incr + aNewCount + C_AVERAGE + aCount + + +label_begin + NT + test_ISONE + anInteger + + +175 + 283 + +175 + 368 + +label_begin + NT + label_test + NT + + +367 + 388 + +367 + 319 + +175 + 321 + +175 + 368 + +label_begin + NT + test_ISEVEN + anInteger + + +183 + 486 + +183 + 368 + +label_begin + KT + label_test + KT + + +373 + 418 + +373 + 518 + +176 + 519 + +176 + 398 + +label_begin + MIN + label_test + MIN + + +label_begin + MAX + label_test + MAX + + +label_begin + AVERAGE + label_test + AVERAGE + + +label_begin + SYRLIST + label_test + SYRLIST + + +label_test + Default + EndL_OneEven + Default + + +label_test + Incr + incr + InGate + + +578 + 328 + +578 + 358 + +label_test + Even + div2 + InGate + + +578 + 513 + +578 + 388 + +label_test + Odd + m3p1 + InGate + + +565 + 151 + +565 + 418 + +label_test + N + m3p1 + anOddInteger + + +609 + 181 + +609 + 448 + +label_test + N + div2 + anEvenInteger + + +612 + 543 + +612 + 448 + +label_test + N + C_MIN + anInteger + + +label_test + N + C_MAX + anInteger + + +label_test + N + C_AVERAGE + anInteger + + +label_test + K + incr + aCount + + +594 + 358 + +594 + 478 + +label_test + MINT + C_MIN + aMinVal + + +label_test + MAXT + C_MAX + aMaxVal + + +label_test + SYRLISTT + C_AVERAGE + aListOfSyr + + +control_m3p1 + OutGate + label_test + InGate + + +control_div2 + OutGate + label_begin + InGate + + +C_MIN + aNewMinVal + control_m3p1 + MINT + + +C_MIN + aNewMinVal + control_div2 + MINT + + +C_MAX + aNewMaxVal + control_m3p1 + MAXT + + +C_MAX + aNewMaxVal + control_div2 + MAXT + + +C_AVERAGE + aNewListOfSyr + control_m3p1 + SYRLISTT + + +C_AVERAGE + aNewListOfSyr + control_div2 + SYRLISTT + + +C_AVERAGE + anAverage + control_m3p1 + AVERAGET + + +C_AVERAGE + anAverage + control_div2 + AVERAGET + + +C_LISTOFSYR + aListOfSyr + label_begin + SYRLISTB + + + +GraphSyrControlAve + label_begin\NB + label_begin + NB + +3 + 7 + + +GraphSyrControlAve + label_begin\KB + label_begin + KB + +3 + 0 + + +GraphSyrControlAve + label_begin\MINB + label_begin + MINB + +3 + 0 + + +GraphSyrControlAve + label_begin\MAXB + label_begin + MAXB + +3 + 0 + + +GraphSyrControlAve + label_begin\AVERAGEB + label_begin + AVERAGEB + +3 + 0 + diff --git a/examples/GraphSyrControlDefault.py b/examples/GraphSyrControlDefault.py new file mode 100644 index 0000000..489d53e --- /dev/null +++ b/examples/GraphSyrControlDefault.py @@ -0,0 +1,206 @@ + +# Generated python file of Graph GraphSyrControlDefault + +from SuperV import * +# Graph creation +GraphSyrControlDefault = Graph( 'GraphSyrControlDefault' ) +GraphSyrControlDefault.SetName( 'GraphSyrControlDefault' ) +GraphSyrControlDefault.SetAuthor( 'JR' ) +GraphSyrControlDefault.SetComment( 'Syracuse algorithm' ) +GraphSyrControlDefault.Coords( 0 , 0 ) + +# Creation of Factory Nodes +test_ISEVEN = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) +test_ISEVEN.SetName( 'test_ISEVEN' ) +test_ISEVEN.SetAuthor( '' ) +test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) +test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' ) +test_ISEVEN.Coords( 190 , 338 ) +test_ISONE = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) +test_ISONE.SetName( 'test_ISONE' ) +test_ISONE.SetAuthor( '' ) +test_ISONE.SetContainer( 'localhost/FactoryServer' ) +test_ISONE.SetComment( 'C_ISONE from SyrComponent' ) +test_ISONE.Coords( 196 , 131 ) +m3p1 = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) +m3p1.SetName( 'm3p1' ) +m3p1.SetAuthor( '' ) +m3p1.SetContainer( 'localhost/FactoryServer' ) +m3p1.SetComment( 'C_M3P1 from SyrComponent' ) +m3p1.Coords( 621 , 14 ) +div2 = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) +div2.SetName( 'div2' ) +div2.SetAuthor( '' ) +div2.SetContainer( 'localhost/FactoryServer' ) +div2.SetComment( 'C_DIV2 from SyrComponent' ) +div2.Coords( 624 , 391 ) +incr = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) +incr.SetName( 'incr' ) +incr.SetAuthor( '' ) +incr.SetContainer( 'localhost/FactoryServer' ) +incr.SetComment( 'C_INCR from SyrComponent' ) +incr.Coords( 622 , 199 ) + +# Creation of InLine Nodes +Pylabel_begin = [] +Pylabel_begin.append( 'def label_begin( NB , KB ):' ) +Pylabel_begin.append( ' print "label_begin",NB,KB' ) +Pylabel_begin.append( ' return NB,KB' ) +label_begin = GraphSyrControlDefault.INode( 'label_begin' , Pylabel_begin ) +label_begin.InPort( 'NB' , 'long' ) +label_begin.InPort( 'KB' , 'long' ) +label_begin.OutPort( 'NT' , 'long' ) +label_begin.OutPort( 'KT' , 'long' ) +label_begin.SetName( 'label_begin' ) +label_begin.SetAuthor( '' ) +label_begin.SetComment( 'Python function' ) +label_begin.Coords( 7 , 216 ) +Pylabel_test = [] +Pylabel_test.append( 'def label_test( ValEven , ValOne , NB , KB ):' ) +Pylabel_test.append( ' print "label_begin",ValEven,ValOne,NB,KB' ) +Pylabel_test.append( ' return ValEven,ValOne,NB,KB' ) +label_test = GraphSyrControlDefault.INode( 'label_test' , Pylabel_test ) +label_test.InPort( 'ValEven' , 'long' ) +label_test.InPort( 'ValOne' , 'long' ) +label_test.InPort( 'NT' , 'long' ) +label_test.InPort( 'KT' , 'long' ) +label_test.OutPort( 'ValEven' , 'long' ) +label_test.OutPort( 'ValOne' , 'long' ) +label_test.OutPort( 'NT' , 'long' ) +label_test.OutPort( 'KT' , 'long' ) +label_test.SetName( 'label_test' ) +label_test.SetAuthor( '' ) +label_test.SetComment( 'Python function' ) +label_test.Coords( 7 , 216 ) + +# Creation of Switch Nodes +Pytest = [] +Pytest.append( 'def Switch_OneEven( ValOne , ValEven , NT , KT ) :' ) +Pytest.append( ' Finished = ValOne' ) +Pytest.append( ' if Finished == 0 :' ) +Pytest.append( ' Incr = 1' ) +Pytest.append( ' Even = ValEven' ) +Pytest.append( ' if Even == 0 :' ) +Pytest.append( ' Odd = 1' ) +Pytest.append( ' else :' ) +Pytest.append( ' Odd = 0' ) +Pytest.append( ' else :' ) +Pytest.append( ' Incr = 0' ) +Pytest.append( ' Even = 0' ) +Pytest.append( ' Odd = 0' ) +Pytest.append( ' Even = ValEven' ) +Pytest.append( ' return Incr,Even,Odd,NT,KT' ) +test,EndSwitch_OneEven = GraphSyrControlDefault.SNode( 'Switch_OneEven' , Pytest ) +EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' ) +EndSwitch_OneEven.SetAuthor( '' ) +EndSwitch_OneEven.SetComment( '' ) +EndSwitch_OneEven.Coords( 1004 , 256 ) +PyEndSwitch_OneEven = [] +EndSwitch_OneEven.SetPyFunction( 'EndSwitch_OneEven' , PyEndSwitch_OneEven ) +EndSwitch_OneEven.InPort( 'K' , 'long' ) +EndSwitch_OneEven.OutPort( 'K' , 'long' ) +test.InPort( 'ValOne' , 'long' ) +test.InPort( 'ValEven' , 'long' ) +test.InPort( 'NT' , 'long' ) +test.InPort( 'KT' , 'long' ) +test.OutPort( 'Incr' , 'long' ) +test.OutPort( 'Even' , 'long' ) +test.OutPort( 'Odd' , 'long' ) +test.OutPort( 'N' , 'long' ) +test.OutPort( 'K' , 'long' ) +test.SetName( 'test' ) +test.SetAuthor( '' ) +test.SetComment( '' ) +test.Coords( 399 , 176 ) + +# Creation of GOTO Nodes +Pycontrol_m3p1 = [] +Pycontrol_m3p1.append( 'def control_m3p1( N , K ):' ) +Pycontrol_m3p1.append( ' return 0,1,N,K' ) +control_m3p1 = GraphSyrControlDefault.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' ) +control_m3p1.InPort( 'N' , 'long' ) +control_m3p1.InPort( 'K' , 'long' ) +control_m3p1.OutPort( 'ValOne' , 'long' ) +control_m3p1.OutPort( 'ValEven' , 'long' ) +control_m3p1.OutPort( 'NT' , 'long' ) +control_m3p1.OutPort( 'KT' , 'long' ) +control_m3p1.SetName( 'control_m3p1' ) +control_m3p1.SetAuthor( '' ) +control_m3p1.SetComment( '' ) +control_m3p1.Coords( 814 , 13 ) +Pycontrol_div2 = [] +Pycontrol_div2.append( 'def control_div2( N , NB ) :' ) +Pycontrol_div2.append( ' return N,NB' ) +control_div2 = GraphSyrControlDefault.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) +control_div2.InPort( 'N' , 'long' ) +control_div2.InPort( 'K' , 'long' ) +control_div2.OutPort( 'NB' , 'long' ) +control_div2.OutPort( 'KB' , 'long' ) +control_div2.SetName( 'control_div2' ) +control_div2.SetAuthor( '' ) +control_div2.SetComment( '' ) +control_div2.Coords( 812 , 414 ) + +# Creation of intermediate Output variables and of Control Links +test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) +label_testValEven = GraphSyrControlDefault.Link( test_ISEVENBoolEven , label_test.Port( 'ValEven' ) ) +test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) +label_testValOne = GraphSyrControlDefault.Link( test_ISONEBoolOne , label_test.Port( 'ValOne' ) ) +m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) +control_m3p1N = GraphSyrControlDefault.Link( m3p1anEvenInteger , control_m3p1.Port( 'N' ) ) +div2anInteger = div2.Port( 'anInteger' ) +control_div2N = GraphSyrControlDefault.Link( div2anInteger , control_div2.Port( 'N' ) ) +incraNewCount = incr.Port( 'aNewCount' ) +control_m3p1K = GraphSyrControlDefault.Link( incraNewCount , control_m3p1.Port( 'K' ) ) +control_div2K = GraphSyrControlDefault.Link( incraNewCount , control_div2.Port( 'K' ) ) +label_beginNT = label_begin.Port( 'NT' ) +label_testNT = GraphSyrControlDefault.Link( label_beginNT , label_test.Port( 'NT' ) ) +test_ISEVENanInteger = GraphSyrControlDefault.Link( label_beginNT , test_ISEVEN.Port( 'anInteger' ) ) +test_ISONEanInteger = GraphSyrControlDefault.Link( label_beginNT , test_ISONE.Port( 'anInteger' ) ) +label_beginKT = label_begin.Port( 'KT' ) +label_testKT = GraphSyrControlDefault.Link( label_beginKT , label_test.Port( 'KT' ) ) +label_testValEven = label_test.Port( 'ValEven' ) +testValEven = GraphSyrControlDefault.Link( label_testValEven , test.Port( 'ValEven' ) ) +label_testValOne = label_test.Port( 'ValOne' ) +testValOne = GraphSyrControlDefault.Link( label_testValOne , test.Port( 'ValOne' ) ) +label_testNT = label_test.Port( 'NT' ) +testNT = GraphSyrControlDefault.Link( label_testNT , test.Port( 'NT' ) ) +label_testKT = label_test.Port( 'KT' ) +testKT = GraphSyrControlDefault.Link( label_testKT , test.Port( 'KT' ) ) +testDefault = test.Port( 'Default' ) +EndSwitch_OneEvenDefault = GraphSyrControlDefault.Link( testDefault , EndSwitch_OneEven.Port( 'Default' ) ) +testIncr = test.Port( 'Incr' ) +incrInGate = GraphSyrControlDefault.Link( testIncr , incr.Port( 'InGate' ) ) +testEven = test.Port( 'Even' ) +div2InGate = GraphSyrControlDefault.Link( testEven , div2.Port( 'InGate' ) ) +testOdd = test.Port( 'Odd' ) +m3p1InGate = GraphSyrControlDefault.Link( testOdd , m3p1.Port( 'InGate' ) ) +testN = test.Port( 'N' ) +m3p1anOddInteger = GraphSyrControlDefault.Link( testN , m3p1.Port( 'anOddInteger' ) ) +div2anEvenInteger = GraphSyrControlDefault.Link( testN , div2.Port( 'anEvenInteger' ) ) +testK = test.Port( 'K' ) +EndSwitch_OneEvenK = GraphSyrControlDefault.Link( testK , EndSwitch_OneEven.Port( 'K' ) ) +incraCount = GraphSyrControlDefault.Link( testK , incr.Port( 'aCount' ) ) + +# Creation of intermediate Output variables and of Loop Links +control_m3p1OutGate = control_m3p1.Port( 'OutGate' ) +label_testInGate = GraphSyrControlDefault.Link( control_m3p1OutGate , label_test.Port( 'InGate' ) ) +control_div2OutGate = control_div2.Port( 'OutGate' ) +label_beginInGate = GraphSyrControlDefault.Link( control_div2OutGate , label_begin.Port( 'InGate' ) ) + +# Creation of Input datas +label_beginNB = label_begin.Input( 'NB' , 7) +label_beginKB = label_begin.Input( 'KB' , 0) + +# Creation of Output variables +EndSwitch_OneEvenK = EndSwitch_OneEven.Port( 'K' ) + +GraphSyrControlDefault.Run() + +GraphSyrControlDefault.DoneW() + +GraphSyrControlDefault.State() + +GraphSyrControlDefault.PrintPorts() + +EndSwitch_OneEven.PrintPorts() diff --git a/examples/GraphSyrControlDefault.xml b/examples/GraphSyrControlDefault.xml new file mode 100644 index 0000000..259aa4b --- /dev/null +++ b/examples/GraphSyrControlDefault.xml @@ -0,0 +1,582 @@ + + + + +? + ? + GraphSyrControlDefault + 1 + ? + +GraphSyrControlDefault + + +long + label_begin\NB + +long + label_begin\KB + + +long + EndSwitch_OneEven\K + + + 19/3/2003 - 16:49:51 + 25/3/2003 - 17:36:32 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + + +SyrComponent + SyrComponent + test_ISEVEN + 0 + ? + +C_ISEVEN + + +long + anInteger + + +long + BoolEven + + + 25/3/2003 - 17:36:32 + 25/3/2003 - 17:36:32 + 1.04 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 190 + 338 + +SyrComponent + SyrComponent + test_ISONE + 0 + ? + +C_ISONE + + +long + anInteger + + +long + BoolOne + + + 25/3/2003 - 17:36:32 + 25/3/2003 - 17:36:32 + 1.04 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 196 + 131 + +SyrComponent + SyrComponent + m3p1 + 0 + ? + +C_M3P1 + + +long + anOddInteger + + +long + anEvenInteger + + + 25/3/2003 - 17:36:32 + 25/3/2003 - 17:36:32 + 1.04 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 621 + 14 + +SyrComponent + SyrComponent + div2 + 0 + ? + +C_DIV2 + + +long + anEvenInteger + + +long + anInteger + + + 25/3/2003 - 17:36:32 + 25/3/2003 - 17:36:32 + 1.04 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 624 + 391 + +SyrComponent + SyrComponent + incr + 0 + ? + +C_INCR + + +long + aCount + + +long + aNewCount + + + 25/3/2003 - 17:36:32 + 25/3/2003 - 17:36:32 + 1.04 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 622 + 199 + +? + ? + label_begin + 3 + ? + +label_begin + + +long + NB + +long + KB + + +long + NT + +long + KT + + + +label_begin + + + + 25/3/2003 - 17:36:32 + 25/3/2003 - 17:36:32 + 1.04 + ? + ? + Python function + 7 + 216 + +? + ? + label_test + 3 + ? + +label_test + + +long + ValEven + +long + ValOne + +long + NT + +long + KT + + +long + ValEven + +long + ValOne + +long + NT + +long + KT + + + +label_test + + + + 25/3/2003 - 17:36:32 + 25/3/2003 - 17:36:32 + 1.04 + ? + ? + Python function + 7 + 216 + +? + ? + test + 6 + EndSwitch_OneEven + +test + + +long + ValOne + +long + ValEven + +long + NT + +long + KT + + +long + Incr + +long + Even + +long + Odd + +long + N + +long + K + + + +Switch_OneEven + + + + + + + + + + + + + + + + 25/3/2003 - 17:36:32 + 25/3/2003 - 17:36:32 + 1.04 + ? + ? + ? + 399 + 176 + +? + ? + EndSwitch_OneEven + 7 + test + +EndSwitch_OneEven + + +long + K + + +long + K + + + + 25/3/2003 - 17:36:32 + 25/3/2003 - 17:36:32 + 1.04 + ? + ? + ? + 1004 + 256 + +? + ? + control_m3p1 + 8 + label_test + +control_m3p1 + + +long + N + +long + K + + +long + ValOne + +long + ValEven + +long + NT + +long + KT + + + +control_m3p1 + + + 25/3/2003 - 17:36:32 + 25/3/2003 - 17:36:32 + 1.04 + ? + ? + ? + 814 + 13 + +? + ? + control_div2 + 8 + label_begin + +control_div2 + + +long + N + +long + K + + +long + NB + +long + KB + + + +control_div2 + + + 25/3/2003 - 17:36:32 + 25/3/2003 - 17:36:32 + 1.04 + ? + ? + ? + 812 + 414 + + +test_ISEVEN + BoolEven + label_test + ValEven + + +test_ISONE + BoolOne + label_test + ValOne + + +m3p1 + anEvenInteger + control_m3p1 + N + + +div2 + anInteger + control_div2 + N + + +incr + aNewCount + control_m3p1 + K + + +incr + aNewCount + control_div2 + K + + +label_begin + NT + label_test + NT + + +label_begin + NT + test_ISEVEN + anInteger + + +label_begin + NT + test_ISONE + anInteger + + +label_begin + KT + label_test + KT + + +label_test + ValEven + test + ValEven + + +label_test + ValOne + test + ValOne + + +label_test + NT + test + NT + + +label_test + KT + test + KT + + +test + Default + EndSwitch_OneEven + Default + + +test + Incr + incr + InGate + + +test + Even + div2 + InGate + + +test + Odd + m3p1 + InGate + + +test + N + m3p1 + anOddInteger + + +test + N + div2 + anEvenInteger + + +test + K + EndSwitch_OneEven + K + + +test + K + incr + aCount + + +control_m3p1 + OutGate + label_test + InGate + + +control_div2 + OutGate + label_begin + InGate + + + +GraphSyrControlDefault + label_begin\NB + label_begin + NB + +3 + 7 + + +GraphSyrControlDefault + label_begin\KB + label_begin + KB + +3 + 0 + diff --git a/examples/GraphSyrControlGUI.py b/examples/GraphSyrControlGUI.py new file mode 100644 index 0000000..d2b53c5 --- /dev/null +++ b/examples/GraphSyrControlGUI.py @@ -0,0 +1,213 @@ + +# Generated python file of Graph GraphSyrControlGUI + +from SuperV import * +# Graph creation +GraphSyrControlGUI = Graph( 'GraphSyrControlGUI' ) +GraphSyrControlGUI.SetName( 'GraphSyrControlGUI' ) +GraphSyrControlGUI.SetAuthor( 'JR' ) +GraphSyrControlGUI.SetComment( 'Syracuse algorithm' ) +GraphSyrControlGUI.Coords( 0 , 0 ) + +# Creation of Factory Nodes +test_ISEVEN = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) +test_ISEVEN.SetName( 'test_ISEVEN' ) +test_ISEVEN.SetAuthor( '' ) +test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) +test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' ) +test_ISEVEN.Coords( 190 , 338 ) +test_ISONE = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) +test_ISONE.SetName( 'test_ISONE' ) +test_ISONE.SetAuthor( '' ) +test_ISONE.SetContainer( 'localhost/FactoryServer' ) +test_ISONE.SetComment( 'C_ISONE from SyrComponent' ) +test_ISONE.Coords( 196 , 131 ) +m3p1 = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) +m3p1.SetName( 'm3p1' ) +m3p1.SetAuthor( '' ) +m3p1.SetContainer( 'localhost/FactoryServer' ) +m3p1.SetComment( 'C_M3P1 from SyrComponent' ) +m3p1.Coords( 621 , 29 ) +div2 = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) +div2.SetName( 'div2' ) +div2.SetAuthor( '' ) +div2.SetContainer( 'localhost/FactoryServer' ) +div2.SetComment( 'C_DIV2 from SyrComponent' ) +div2.Coords( 624 , 391 ) +incr = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) +incr.SetName( 'incr' ) +incr.SetAuthor( '' ) +incr.SetContainer( 'localhost/FactoryServer' ) +incr.SetComment( 'C_INCR from SyrComponent' ) +incr.Coords( 623 , 206 ) + +# Creation of InLine Nodes +Pylabel_begin = [] +Pylabel_begin.append( 'def label_begin( NB , KB ) :' ) +Pylabel_begin.append( ' return NB,KB' ) +label_begin = GraphSyrControlGUI.INode( 'label_begin' , Pylabel_begin ) +label_begin.InPort( 'NB' , 'long' ) +label_begin.InPort( 'KB' , 'long' ) +label_begin.OutPort( 'NT' , 'long' ) +label_begin.OutPort( 'KT' , 'long' ) +label_begin.SetName( 'label_begin' ) +label_begin.SetAuthor( '' ) +label_begin.SetComment( 'Python function' ) +label_begin.Coords( 7 , 216 ) + +# Creation of Switch Nodes +Pylabel_test = [] +Pylabel_test.append( 'def L_OneEven( ValOne , ValEven , NT , KT ):' ) +Pylabel_test.append( ' Finished = ValOne' ) +Pylabel_test.append( ' if Finished == 0 :' ) +Pylabel_test.append( ' Incr = 1' ) +Pylabel_test.append( ' Even = ValEven' ) +Pylabel_test.append( ' if Even == 0 :' ) +Pylabel_test.append( ' Odd = 1' ) +Pylabel_test.append( ' else :' ) +Pylabel_test.append( ' Odd = 0' ) +Pylabel_test.append( ' else :' ) +Pylabel_test.append( ' Incr = 0' ) +Pylabel_test.append( ' Even = 0' ) +Pylabel_test.append( ' Odd = 0' ) +Pylabel_test.append( ' Even = ValEven' ) +Pylabel_test.append( ' return Finished,Incr,Even,Odd,NT,KT' ) +label_test,EndL_OneEven = GraphSyrControlGUI.SNode( 'L_OneEven' , Pylabel_test ) +EndL_OneEven.SetName( 'EndL_OneEven' ) +EndL_OneEven.SetAuthor( '' ) +EndL_OneEven.SetComment( '' ) +EndL_OneEven.Coords( 1034 , 252 ) +PyEndL_OneEven = [] +EndL_OneEven.SetPyFunction( 'EndL_OneEven' , PyEndL_OneEven ) +label_test.InPort( 'ValOne' , 'long' ) +label_test.InPort( 'ValEven' , 'long' ) +label_test.InPort( 'NT' , 'long' ) +label_test.InPort( 'KT' , 'long' ) +label_test.OutPort( 'Finished' , 'long' ) +label_test.OutPort( 'Incr' , 'long' ) +label_test.OutPort( 'Even' , 'long' ) +label_test.OutPort( 'Odd' , 'long' ) +label_test.OutPort( 'N' , 'long' ) +label_test.OutPort( 'K' , 'long' ) +label_test.SetName( 'label_test' ) +label_test.SetAuthor( '' ) +label_test.SetComment( '' ) +label_test.Coords( 399 , 176 ) + +# Creation of GOTO Nodes +Pycontrol_m3p1 = [] +Pycontrol_m3p1.append( 'def C_NotOneIsEven( N , K ):' ) +Pycontrol_m3p1.append( ' return 0,1,N,K' ) +control_m3p1 = GraphSyrControlGUI.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' ) +control_m3p1.InPort( 'N' , 'long' ) +control_m3p1.InPort( 'K' , 'long' ) +control_m3p1.OutPort( 'ValOne' , 'long' ) +control_m3p1.OutPort( 'ValEven' , 'long' ) +control_m3p1.OutPort( 'NT' , 'long' ) +control_m3p1.OutPort( 'KT' , 'long' ) +control_m3p1.SetName( 'control_m3p1' ) +control_m3p1.SetAuthor( '' ) +control_m3p1.SetComment( '' ) +control_m3p1.Coords( 808 , 29 ) +Pycontrol_div2 = [] +Pycontrol_div2.append( 'def control_div2( N , K ) :' ) +Pycontrol_div2.append( ' return N,K' ) +control_div2 = GraphSyrControlGUI.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) +control_div2.InPort( 'N' , 'long' ) +control_div2.InPort( 'K' , 'long' ) +control_div2.OutPort( 'NB' , 'long' ) +control_div2.OutPort( 'KB' , 'long' ) +control_div2.SetName( 'control_div2' ) +control_div2.SetAuthor( '' ) +control_div2.SetComment( '' ) +control_div2.Coords( 812 , 357 ) + +# Creation of intermediate Output variables and of Control Links +test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) +label_testValEven = GraphSyrControlGUI.Link( test_ISEVENBoolEven , label_test.Port( 'ValEven' ) ) +label_testValEven.AddCoord( 1 , 385 , 358 ) +label_testValEven.AddCoord( 2 , 385 , 490 ) +test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) +label_testValOne = GraphSyrControlGUI.Link( test_ISONEBoolOne , label_test.Port( 'ValOne' ) ) +label_testValOne.AddCoord( 1 , 385 , 328 ) +label_testValOne.AddCoord( 2 , 385 , 283 ) +m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) +control_m3p1N = GraphSyrControlGUI.Link( m3p1anEvenInteger , control_m3p1.Port( 'N' ) ) +control_m3p1N.AddCoord( 1 , 786 , 181 ) +control_m3p1N.AddCoord( 2 , 786 , 182 ) +div2anInteger = div2.Port( 'anInteger' ) +control_div2N = GraphSyrControlGUI.Link( div2anInteger , control_div2.Port( 'N' ) ) +control_div2N.AddCoord( 1 , 799 , 509 ) +control_div2N.AddCoord( 2 , 799 , 543 ) +incraNewCount = incr.Port( 'aNewCount' ) +control_div2K = GraphSyrControlGUI.Link( incraNewCount , control_div2.Port( 'K' ) ) +control_div2K.AddCoord( 1 , 787 , 539 ) +control_div2K.AddCoord( 2 , 787 , 359 ) +control_m3p1K = GraphSyrControlGUI.Link( incraNewCount , control_m3p1.Port( 'K' ) ) +control_m3p1K.AddCoord( 1 , 790 , 211 ) +control_m3p1K.AddCoord( 2 , 790 , 358 ) +label_beginNT = label_begin.Port( 'NT' ) +test_ISONEanInteger = GraphSyrControlGUI.Link( label_beginNT , test_ISONE.Port( 'anInteger' ) ) +test_ISONEanInteger.AddCoord( 1 , 175 , 283 ) +test_ISONEanInteger.AddCoord( 2 , 175 , 368 ) +label_testNT = GraphSyrControlGUI.Link( label_beginNT , label_test.Port( 'NT' ) ) +label_testNT.AddCoord( 1 , 367 , 388 ) +label_testNT.AddCoord( 2 , 367 , 319 ) +label_testNT.AddCoord( 3 , 175 , 321 ) +label_testNT.AddCoord( 4 , 175 , 368 ) +test_ISEVENanInteger = GraphSyrControlGUI.Link( label_beginNT , test_ISEVEN.Port( 'anInteger' ) ) +test_ISEVENanInteger.AddCoord( 1 , 183 , 486 ) +test_ISEVENanInteger.AddCoord( 2 , 183 , 368 ) +label_beginKT = label_begin.Port( 'KT' ) +label_testKT = GraphSyrControlGUI.Link( label_beginKT , label_test.Port( 'KT' ) ) +label_testKT.AddCoord( 1 , 373 , 418 ) +label_testKT.AddCoord( 2 , 373 , 518 ) +label_testKT.AddCoord( 3 , 176 , 519 ) +label_testKT.AddCoord( 4 , 176 , 398 ) +label_testDefault = label_test.Port( 'Default' ) +EndL_OneEvenDefault = GraphSyrControlGUI.Link( label_testDefault , EndL_OneEven.Port( 'Default' ) ) +label_testIncr = label_test.Port( 'Incr' ) +incrInGate = GraphSyrControlGUI.Link( label_testIncr , incr.Port( 'InGate' ) ) +incrInGate.AddCoord( 1 , 578 , 328 ) +incrInGate.AddCoord( 2 , 578 , 358 ) +label_testEven = label_test.Port( 'Even' ) +div2InGate = GraphSyrControlGUI.Link( label_testEven , div2.Port( 'InGate' ) ) +div2InGate.AddCoord( 1 , 578 , 513 ) +div2InGate.AddCoord( 2 , 578 , 388 ) +label_testOdd = label_test.Port( 'Odd' ) +m3p1InGate = GraphSyrControlGUI.Link( label_testOdd , m3p1.Port( 'InGate' ) ) +m3p1InGate.AddCoord( 1 , 565 , 151 ) +m3p1InGate.AddCoord( 2 , 565 , 418 ) +label_testN = label_test.Port( 'N' ) +m3p1anOddInteger = GraphSyrControlGUI.Link( label_testN , m3p1.Port( 'anOddInteger' ) ) +m3p1anOddInteger.AddCoord( 1 , 609 , 181 ) +m3p1anOddInteger.AddCoord( 2 , 609 , 448 ) +div2anEvenInteger = GraphSyrControlGUI.Link( label_testN , div2.Port( 'anEvenInteger' ) ) +div2anEvenInteger.AddCoord( 1 , 612 , 543 ) +div2anEvenInteger.AddCoord( 2 , 612 , 448 ) +label_testK = label_test.Port( 'K' ) +incraCount = GraphSyrControlGUI.Link( label_testK , incr.Port( 'aCount' ) ) +incraCount.AddCoord( 1 , 594 , 358 ) +incraCount.AddCoord( 2 , 594 , 478 ) +control_m3p1OutGate = control_m3p1.Port( 'OutGate' ) +label_testInGate = GraphSyrControlGUI.Link( control_m3p1OutGate , label_test.Port( 'InGate' ) ) + +# Creation of intermediate Output variables and of Loop Links +control_div2OutGate = control_div2.Port( 'OutGate' ) +label_beginInGate = GraphSyrControlGUI.Link( control_div2OutGate , label_begin.Port( 'InGate' ) ) + +# Creation of Input datas +label_beginNB = label_begin.Input( 'NB' , 7) +label_beginKB = label_begin.Input( 'KB' , 0) + +# Creation of Output variables +label_testFinished = label_test.Port( 'Finished' ) + +GraphSyrControlGUI.Run( 7 ) + +GraphSyrControlGUI.DoneW() + +GraphSyrControlGUI.State() + +GraphSyrControlGUI.PrintPorts() + diff --git a/examples/GraphSyrControlGUI.xml b/examples/GraphSyrControlGUI.xml new file mode 100644 index 0000000..3acb92f --- /dev/null +++ b/examples/GraphSyrControlGUI.xml @@ -0,0 +1,607 @@ + + + + +? + ? + GraphSyrControlGUI + 1 + ? + +GraphSyrControlGUI + + +long + label_begin\NB + +long + label_begin\KB + + +long + label_test\Finished + + + 11/3/2003 - 18:28:48 + 25/3/2003 - 17:42:48 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + + +SyrComponent + SyrComponent + test_ISEVEN + 0 + ? + +C_ISEVEN + + +long + anInteger + + +long + BoolEven + + + 25/3/2003 - 17:42:48 + 25/3/2003 - 17:42:48 + 1.04 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 190 + 338 + +SyrComponent + SyrComponent + test_ISONE + 0 + ? + +C_ISONE + + +long + anInteger + + +long + BoolOne + + + 25/3/2003 - 17:42:48 + 25/3/2003 - 17:42:48 + 1.04 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 196 + 131 + +SyrComponent + SyrComponent + m3p1 + 0 + ? + +C_M3P1 + + +long + anOddInteger + + +long + anEvenInteger + + + 25/3/2003 - 17:42:48 + 25/3/2003 - 17:42:48 + 1.04 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 621 + 29 + +SyrComponent + SyrComponent + div2 + 0 + ? + +C_DIV2 + + +long + anEvenInteger + + +long + anInteger + + + 25/3/2003 - 17:42:48 + 25/3/2003 - 17:42:48 + 1.04 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 624 + 391 + +SyrComponent + SyrComponent + incr + 0 + ? + +C_INCR + + +long + aCount + + +long + aNewCount + + + 25/3/2003 - 17:42:48 + 25/3/2003 - 17:42:48 + 1.04 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 623 + 206 + +? + ? + label_begin + 3 + ? + +label_begin + + +long + NB + +long + KB + + +long + NT + +long + KT + + + +label_begin + + + 25/3/2003 - 17:42:48 + 25/3/2003 - 17:42:48 + 1.04 + ? + ? + Python function + 7 + 216 + +? + ? + label_test + 6 + EndL_OneEven + +label_test + + +long + ValOne + +long + ValEven + +long + NT + +long + KT + + +long + Finished + +long + Incr + +long + Even + +long + Odd + +long + N + +long + K + + + +L_OneEven + + + + + + + + + + + + + + + + 25/3/2003 - 17:42:48 + 25/3/2003 - 17:42:48 + 1.04 + ? + ? + ? + 399 + 176 + +? + ? + EndL_OneEven + 7 + label_test + +EndL_OneEven + + + + + + 25/3/2003 - 17:42:48 + 25/3/2003 - 17:42:48 + 1.04 + ? + ? + ? + 1034 + 252 + +? + ? + control_m3p1 + 8 + label_test + +control_m3p1 + + +long + N + +long + K + + +long + ValOne + +long + ValEven + +long + NT + +long + KT + + + +C_NotOneIsEven + + + 25/3/2003 - 17:42:48 + 25/3/2003 - 17:42:48 + 1.04 + ? + ? + ? + 808 + 29 + +? + ? + control_div2 + 8 + label_begin + +control_div2 + + +long + N + +long + K + + +long + NB + +long + KB + + + +control_div2 + + + 25/3/2003 - 17:42:48 + 25/3/2003 - 17:42:48 + 1.04 + ? + ? + ? + 812 + 357 + + +test_ISEVEN + BoolEven + label_test + ValEven + + +385 + 358 + +385 + 490 + +test_ISONE + BoolOne + label_test + ValOne + + +385 + 328 + +385 + 283 + +m3p1 + anEvenInteger + control_m3p1 + N + + +786 + 181 + +786 + 182 + +div2 + anInteger + control_div2 + N + + +799 + 509 + +799 + 543 + +incr + aNewCount + control_div2 + K + + +787 + 539 + +787 + 359 + +incr + aNewCount + control_m3p1 + K + + +790 + 211 + +790 + 358 + +label_begin + NT + test_ISONE + anInteger + + +175 + 283 + +175 + 368 + +label_begin + NT + label_test + NT + + +367 + 388 + +367 + 319 + +175 + 321 + +175 + 368 + +label_begin + NT + test_ISEVEN + anInteger + + +183 + 486 + +183 + 368 + +label_begin + KT + label_test + KT + + +373 + 418 + +373 + 518 + +176 + 519 + +176 + 398 + +label_test + Default + EndL_OneEven + Default + + +label_test + Incr + incr + InGate + + +578 + 328 + +578 + 358 + +label_test + Even + div2 + InGate + + +578 + 513 + +578 + 388 + +label_test + Odd + m3p1 + InGate + + +565 + 151 + +565 + 418 + +label_test + N + m3p1 + anOddInteger + + +609 + 181 + +609 + 448 + +label_test + N + div2 + anEvenInteger + + +612 + 543 + +612 + 448 + +label_test + K + incr + aCount + + +594 + 358 + +594 + 478 + +control_m3p1 + OutGate + label_test + InGate + + +control_div2 + OutGate + label_begin + InGate + + + +GraphSyrControlGUI + label_begin\NB + label_begin + NB + +3 + 7 + + +GraphSyrControlGUI + label_begin\KB + label_begin + KB + +3 + 0 + diff --git a/examples/GraphSyracuseC.py b/examples/GraphSyracuseC.py new file mode 100644 index 0000000..efe30b4 --- /dev/null +++ b/examples/GraphSyracuseC.py @@ -0,0 +1,149 @@ + +# Generated python file of Graph GraphSyracuseC + +from SuperV import * +# Graph creation +GraphSyracuseC = Graph( 'GraphSyracuseC' ) +GraphSyracuseC.SetName( 'GraphSyracuseC' ) +GraphSyracuseC.SetAuthor( 'JR' ) +GraphSyracuseC.SetComment( 'Syracuse algorithm' ) +GraphSyracuseC.Coords( 0 , 0 ) + +# Creation of Computing Nodes +test_ISEVEN = GraphSyracuseC.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) +test_ISEVEN.SetName( 'test_ISEVEN' ) +test_ISEVEN.SetAuthor( '' ) +test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) +test_ISEVEN.SetComment( '' ) +test_ISEVEN.Coords( 252 , 266 ) +test_ISONE = GraphSyracuseC.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) +test_ISONE.SetName( 'test_ISONE' ) +test_ISONE.SetAuthor( '' ) +test_ISONE.SetContainer( 'localhost/FactoryServer' ) +test_ISONE.SetComment( '' ) +test_ISONE.Coords( 268 , 29 ) +m3p1 = GraphSyracuseC.Node( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) +m3p1.SetName( 'm3p1' ) +m3p1.SetAuthor( '' ) +m3p1.SetContainer( 'localhost/FactoryServer' ) +m3p1.SetComment( '' ) +m3p1.Coords( 644 , 410 ) +div2 = GraphSyracuseC.Node( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) +div2.SetName( 'div2' ) +div2.SetAuthor( '' ) +div2.SetContainer( 'localhost/FactoryServer' ) +div2.SetComment( '' ) +div2.Coords( 648 , 209 ) +incr = GraphSyracuseC.Node( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) +incr.SetName( 'incr' ) +incr.SetAuthor( '' ) +incr.SetContainer( 'localhost/FactoryServer' ) +incr.SetComment( '' ) +incr.Coords( 640 , 2 ) + +# Creation of Input datas +test_ISEVENanInteger = test_ISEVEN.Input( 'anInteger' , 7) +test_ISONEanInteger = test_ISONE.Input( 'anInteger' , 7) +m3p1anOddInteger = m3p1.Input( 'anOddInteger' , 7) +div2anEvenInteger = div2.Input( 'anEvenInteger' , 7) +incraCount = incr.Input( 'aCount' , 0) + +# Creation of Output variables +test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) +test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) +m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) +div2anInteger = div2.Port( 'anInteger' ) +incraNewCount = incr.Port( 'aNewCount' ) + +GraphSyracuseC.IsValid() + +GraphSyracuseC.ThreadsMax() + +GraphSyracuseC.LevelMax() + +GraphSyracuseC.GraphsNumber() + +GraphSyracuseC.IsExecutable() + +exec GraphSyracuseC.ListNodes() +test_ISEVENanInteger = test_ISEVEN.Port( 'anInteger' ) +test_ISONEanInteger = test_ISONE.Port( 'anInteger' ) +m3p1anOddInteger = m3p1.Port( 'anOddInteger' ) +div2anEvenInteger = div2.Port( 'anEvenInteger' ) +incraCount = incr.Port( 'aCount' ) + +# Creation of Output variables +test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) +test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) +m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) +div2anInteger = div2.Port( 'anInteger' ) +incraNewCount = incr.Port( 'aNewCount' ) + + +GraphSyracuseC.Start() + +test_ISEVEN.SuspendDone() +test_ISONE.SuspendDone() + +test_ISEVEN.Resume() +test_ISONE.Resume() + +# Suspend des nodes de tete des sous-graphes sauf test +m3p1.Suspend() +div2.Suspend() +incr.Suspend() + +# Attentes de suspension de m3p1, div2, incr et result. +# Puis demandes de suspension après exécution +m3p1.SuspendDone() +div2.SuspendDone() +incr.SuspendDone() + +# Attente de fin d'exécution de test +test_ISONE.DoneW() +test_ISEVEN.DoneW() + +# Etats et Threads des nodes +GraphSyracuseC.PrintThreads() + +while int( test_ISONEBoolOne.ToString() ) == 0 : + if int( test_ISEVENBoolEven.ToString() ) == 0 : + sts = m3p1.ReRun() + sts = incr.ReRun() + sts = m3p1.DoneW() + sts = test_ISEVENanInteger.Input( m3p1anEvenInteger.ToString() ) + sts = test_ISONEanInteger.Input( m3p1anEvenInteger.ToString() ) + sts = test_ISEVEN.ReRun() + sts = test_ISONE.ReRun() + sts = test_ISEVEN.DoneW() + sts = test_ISONE.DoneW() + sts = incr.DoneW() + sts = incraCount.Input( incraNewCount.ToString() ) + print incraNewCount.ToString(),"m3p1",m3p1anEvenInteger.ToString(),test_ISEVENBoolEven.ToString() + while int( test_ISEVENBoolEven.ToString() ) == 1 : + sts = div2anEvenInteger.Input( test_ISEVENanInteger.ToString() ) + sts = div2.ReRun() + sts = incr.ReRun() + sts = div2.DoneW() + sts = test_ISEVENanInteger.Input( div2anInteger.ToString() ) + sts = test_ISONEanInteger.Input( div2anInteger.ToString() ) + sts = test_ISEVEN.ReRun() + sts = test_ISONE.ReRun() + sts = test_ISEVEN.DoneW() + sts = test_ISONE.DoneW() + sts = incr.DoneW() + sts = incraCount.Input( incraNewCount.ToString() ) + print incraNewCount.ToString(),"div2",div2anInteger.ToString(),test_ISEVENBoolEven.ToString() + sts = m3p1anOddInteger.Input( div2anInteger.ToString() ) + + +GraphSyracuseC.PrintThreads() +m3p1.Resume() +div2.Resume() +incr.Resume() +test_ISONE.Resume() +test_ISEVEN.Resume() +GraphSyracuseC.DoneW() +GraphSyracuseC.PrintPorts() +GraphSyracuseC.PrintThreads() + diff --git a/examples/GraphSyracuseC.xml b/examples/GraphSyracuseC.xml new file mode 100755 index 0000000..9219318 --- /dev/null +++ b/examples/GraphSyracuseC.xml @@ -0,0 +1,315 @@ + + + + + + + + + ? + ? + GraphSyracuseC + 1 + ? + + GraphSyracuseC + + + long + test_ISEVEN\anInteger + + + long + test_ISONE\anInteger + + + long + m3p1\anOddInteger + + + long + div2\anEvenInteger + + + long + incr\aCount + + + + + long + test_ISEVEN\BoolEven + + + long + test_ISONE\BoolOne + + + long + m3p1\anEvenInteger + + + long + div2\anInteger + + + long + incr\aNewCount + + + + + + + + 11/3/2003 - 17:0:26 + 11/3/2003 - 17:0:26 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + + + + + + SyrComponent + SyrComponent + test_ISEVEN + 0 + ? + + C_ISEVEN + + + long + anInteger + + + + + long + BoolEven + + + + + + + + 11/3/2003 - 17:0:26 + 11/3/2003 - 17:0:26 + 1.04 + ? + localhost/FactoryServer + ? + 252 + 266 + + + SyrComponent + SyrComponent + test_ISONE + 0 + ? + + C_ISONE + + + long + anInteger + + + + + long + BoolOne + + + + + + + + 11/3/2003 - 17:0:26 + 11/3/2003 - 17:0:26 + 1.04 + ? + localhost/FactoryServer + ? + 268 + 29 + + + SyrComponent + SyrComponent + m3p1 + 0 + ? + + C_M3P1 + + + long + anOddInteger + + + + + long + anEvenInteger + + + + + + + + 11/3/2003 - 17:0:26 + 11/3/2003 - 17:0:26 + 1.04 + ? + localhost/FactoryServer + ? + 644 + 410 + + + SyrComponent + SyrComponent + div2 + 0 + ? + + C_DIV2 + + + long + anEvenInteger + + + + + long + anInteger + + + + + + + + 11/3/2003 - 17:0:26 + 11/3/2003 - 17:0:26 + 1.04 + ? + localhost/FactoryServer + ? + 648 + 209 + + + SyrComponent + SyrComponent + incr + 0 + ? + + C_INCR + + + long + aCount + + + + + long + aNewCount + + + + + + + + 11/3/2003 - 17:0:26 + 11/3/2003 - 17:0:26 + 1.04 + ? + localhost/FactoryServer + ? + 640 + 2 + + + + + + + + + GraphSyracuseC + test_ISEVEN\anInteger + test_ISEVEN + anInteger + + 3 + 7 + + + + + + GraphSyracuseC + test_ISONE\anInteger + test_ISONE + anInteger + + 3 + 7 + + + + + + GraphSyracuseC + m3p1\anOddInteger + m3p1 + anOddInteger + + 3 + 7 + + + + + + GraphSyracuseC + div2\anEvenInteger + div2 + anEvenInteger + + 3 + 7 + + + + + + GraphSyracuseC + incr\aCount + incr + aCount + + 3 + 0 + + + + + + + diff --git a/examples/GraphSyracuseCEv.py b/examples/GraphSyracuseCEv.py new file mode 100644 index 0000000..7706242 --- /dev/null +++ b/examples/GraphSyracuseCEv.py @@ -0,0 +1,146 @@ + +# Generated python file of Graph GraphSyracuseCEv + +from SuperV import * +import SUPERV +import SUPERV_idl + +# Graph creation +GraphSyracuseCEv = Graph( 'GraphSyracuseCEv' ) +GraphSyracuseCEv.SetName( 'GraphSyracuseCEv' ) +GraphSyracuseCEv.SetAuthor( 'JR' ) +GraphSyracuseCEv.SetComment( 'Syracuse algorithm' ) +GraphSyracuseCEv.Coords( 0 , 0 ) + +# Creation of Computing Nodes +test_ISEVEN = GraphSyracuseCEv.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) +test_ISEVEN.SetName( 'test_ISEVEN' ) +test_ISEVEN.SetAuthor( '' ) +test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) +test_ISEVEN.SetComment( '' ) +test_ISEVEN.Coords( 252 , 266 ) +test_ISONE = GraphSyracuseCEv.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) +test_ISONE.SetName( 'test_ISONE' ) +test_ISONE.SetAuthor( '' ) +test_ISONE.SetContainer( 'localhost/FactoryServer' ) +test_ISONE.SetComment( '' ) +test_ISONE.Coords( 268 , 29 ) +m3p1 = GraphSyracuseCEv.Node( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) +m3p1.SetName( 'm3p1' ) +m3p1.SetAuthor( '' ) +m3p1.SetContainer( 'localhost/FactoryServer' ) +m3p1.SetComment( '' ) +m3p1.Coords( 644 , 410 ) +div2 = GraphSyracuseCEv.Node( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) +div2.SetName( 'div2' ) +div2.SetAuthor( '' ) +div2.SetContainer( 'localhost/FactoryServer' ) +div2.SetComment( '' ) +div2.Coords( 648 , 209 ) +incr = GraphSyracuseCEv.Node( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) +incr.SetName( 'incr' ) +incr.SetAuthor( '' ) +incr.SetContainer( 'localhost/FactoryServer' ) +incr.SetComment( '' ) +incr.Coords( 640 , 2 ) + +# Creation of Input datas +test_ISEVENanInteger = test_ISEVEN.Input( 'anInteger' , 31) +test_ISONEanInteger = test_ISONE.Input( 'anInteger' , 31) +m3p1anOddInteger = m3p1.Input( 'anOddInteger' , 31) +div2anEvenInteger = div2.Input( 'anEvenInteger' , 31) +incraCount = incr.Input( 'aCount' , 0) + +GraphSyracuseCEv.IsValid() + +GraphSyracuseCEv.ThreadsMax() + +GraphSyracuseCEv.LevelMax() + +GraphSyracuseCEv.GraphsNumber() + +GraphSyracuseCEv.IsExecutable() + + + + +exec GraphSyracuseCEv.ListNodes() + +test_ISEVENanInteger = test_ISEVEN.Port( 'anInteger' ) +test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) +test_ISONEanInteger = test_ISONE.Port( 'anInteger' ) +test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) +m3p1anOddInteger = m3p1.Port( 'anOddInteger' ) +m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) +div2anEvenInteger = div2.Port( 'anEvenInteger' ) +div2anInteger = div2.Port( 'anInteger' ) +incraCount = incr.Port( 'aCount' ) +incraNewCount = incr.Port( 'aNewCount' ) + +GraphSyracuseCEv.Start() + +test_ISEVEN.SuspendDone() +test_ISONE.SuspendDone() + +test_ISEVEN.Resume() +test_ISONE.Resume() + +m3p1.SuspendDone() +div2.SuspendDone() +incr.SuspendDone() + +test_ISEVEN.DoneW() +test_ISONE.DoneW() + +aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event() +while aNode != None : + if int( test_ISONEBoolOne.ToString() ) == 0 : + if int( test_ISEVENBoolEven.ToString() ) == 0 : + while aNode != None : + if aNode.Name() == 'm3p1' : + if aState == SUPERV_idl._0_SUPERV.SuspendReadyState : + sts = m3p1.ReRun() + sts = incr.ReRun() + else : + if aState == SUPERV_idl._0_SUPERV.SuspendDoneState : + sts = test_ISEVENanInteger.Input( m3p1anEvenInteger.ToString() ) + sts = test_ISONEanInteger.Input( m3p1anEvenInteger.ToString() ) + sts = test_ISEVEN.ReRun() + sts = test_ISONE.ReRun() + else : + if ( aNode.Name() == 'incr' ) & ( aState == SUPERV_idl._0_SUPERV.SuspendDoneState ) : + sts = incraCount.Input( incraNewCount.ToString() ) + aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event() + print incraNewCount.ToString(),"m3p1",m3p1anEvenInteger.ToString() + sts = div2anEvenInteger.Input( m3p1anEvenInteger.ToString() ) + while int( test_ISEVENBoolEven.ToString() ) == 1 : + sts = div2.ReRun() + sts = incr.ReRun() + aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event() + while aNode != None : + if ( aNode.Name() == 'div2' ) & ( aState == SUPERV_idl._0_SUPERV.SuspendDoneState ) : + sts = test_ISEVENanInteger.Input( div2anInteger.ToString() ) + sts = test_ISONEanInteger.Input( div2anInteger.ToString() ) + sts = test_ISEVEN.ReRun() + sts = test_ISONE.ReRun() + aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event() + sts = incraCount.Input( incraNewCount.ToString() ) + print incraNewCount.ToString(),"div2",div2anInteger.ToString() + sts = m3p1anOddInteger.Input( div2anInteger.ToString() ) + sts = div2anEvenInteger.Input( div2anInteger.ToString() ) + if int( test_ISONEBoolOne.ToString() ) == 0 : + sts = m3p1.ReRun() + sts = incr.ReRun() + aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event() + else : + GraphSyracuseCEv.PrintThreads() + m3p1.Resume() + div2.Resume() + incr.Resume() + test_ISONE.Resume() + test_ISEVEN.Resume() + aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event() + +GraphSyracuseCEv.DoneW() +GraphSyracuseCEv.PrintThreads() +GraphSyracuseCEv.PrintPorts() diff --git a/examples/GraphSyracuseCEv.xml b/examples/GraphSyracuseCEv.xml new file mode 100755 index 0000000..3e7ee23 --- /dev/null +++ b/examples/GraphSyracuseCEv.xml @@ -0,0 +1,315 @@ + + + + + + + + + ? + ? + GraphSyracuseCEv + 1 + ? + + GraphSyracuseCEv + + + long + test_ISEVEN\anInteger + + + long + test_ISONE\anInteger + + + long + m3p1\anOddInteger + + + long + div2\anEvenInteger + + + long + incr\aCount + + + + + long + test_ISEVEN\BoolEven + + + long + test_ISONE\BoolOne + + + long + m3p1\anEvenInteger + + + long + div2\anInteger + + + long + incr\aNewCount + + + + + + + + 11/3/2003 - 15:7:39 + 11/3/2003 - 15:7:39 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + + + + + + SyrComponent + SyrComponent + test_ISEVEN + 0 + ? + + C_ISEVEN + + + long + anInteger + + + + + long + BoolEven + + + + + + + + 11/3/2003 - 15:7:39 + 11/3/2003 - 15:7:39 + 1.04 + ? + localhost/FactoryServer + ? + 252 + 266 + + + SyrComponent + SyrComponent + test_ISONE + 0 + ? + + C_ISONE + + + long + anInteger + + + + + long + BoolOne + + + + + + + + 11/3/2003 - 15:7:39 + 11/3/2003 - 15:7:39 + 1.04 + ? + localhost/FactoryServer + ? + 268 + 29 + + + SyrComponent + SyrComponent + m3p1 + 0 + ? + + C_M3P1 + + + long + anOddInteger + + + + + long + anEvenInteger + + + + + + + + 11/3/2003 - 15:7:39 + 11/3/2003 - 15:7:39 + 1.04 + ? + localhost/FactoryServer + ? + 644 + 410 + + + SyrComponent + SyrComponent + div2 + 0 + ? + + C_DIV2 + + + long + anEvenInteger + + + + + long + anInteger + + + + + + + + 11/3/2003 - 15:7:39 + 11/3/2003 - 15:7:39 + 1.04 + ? + localhost/FactoryServer + ? + 648 + 209 + + + SyrComponent + SyrComponent + incr + 0 + ? + + C_INCR + + + long + aCount + + + + + long + aNewCount + + + + + + + + 11/3/2003 - 15:7:39 + 11/3/2003 - 15:7:39 + 1.04 + ? + localhost/FactoryServer + ? + 640 + 2 + + + + + + + + + GraphSyracuseCEv + test_ISEVEN\anInteger + test_ISEVEN + anInteger + + 3 + 31 + + + + + + GraphSyracuseCEv + test_ISONE\anInteger + test_ISONE + anInteger + + 3 + 31 + + + + + + GraphSyracuseCEv + m3p1\anOddInteger + m3p1 + anOddInteger + + 3 + 31 + + + + + + GraphSyracuseCEv + div2\anEvenInteger + div2 + anEvenInteger + + 3 + 31 + + + + + + GraphSyracuseCEv + incr\aCount + incr + aCount + + 3 + 0 + + + + + + + diff --git a/examples/GraphSyracuseC_Gate.py b/examples/GraphSyracuseC_Gate.py new file mode 100644 index 0000000..4034379 --- /dev/null +++ b/examples/GraphSyracuseC_Gate.py @@ -0,0 +1,171 @@ + +# Generated python file of Graph GraphSyracuseC_Gate + +from SuperV import * +# Graph creation +GraphSyracuseC_Gate = Graph( 'GraphSyracuseC_Gate' ) +GraphSyracuseC_Gate.SetName( 'GraphSyracuseC_Gate' ) +GraphSyracuseC_Gate.SetAuthor( 'JR' ) +GraphSyracuseC_Gate.SetComment( 'Syracuse algorithm' ) +GraphSyracuseC_Gate.Coords( 0 , 0 ) + +# Creation of Computing Nodes +test_ISEVEN = GraphSyracuseC_Gate.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) +test_ISEVEN.SetName( 'test_ISEVEN' ) +test_ISEVEN.SetAuthor( '' ) +test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) +test_ISEVEN.SetComment( '' ) +test_ISEVEN.Coords( 5 , 416 ) +test_ISONE = GraphSyracuseC_Gate.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) +test_ISONE.SetName( 'test_ISONE' ) +test_ISONE.SetAuthor( '' ) +test_ISONE.SetContainer( 'localhost/FactoryServer' ) +test_ISONE.SetComment( '' ) +test_ISONE.Coords( 7 , 232 ) +m3p1 = GraphSyracuseC_Gate.Node( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) +m3p1.SetName( 'm3p1' ) +m3p1.SetAuthor( '' ) +m3p1.SetContainer( 'localhost/FactoryServer' ) +m3p1.SetComment( '' ) +m3p1.Coords( 180 , 417 ) +div2 = GraphSyracuseC_Gate.Node( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) +div2.SetName( 'div2' ) +div2.SetAuthor( '' ) +div2.SetContainer( 'localhost/FactoryServer' ) +div2.SetComment( '' ) +div2.Coords( 435 , 7 ) +div2_ISEVEN = GraphSyracuseC_Gate.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) +div2_ISEVEN.SetName( 'div2_ISEVEN' ) +div2_ISEVEN.SetAuthor( '' ) +div2_ISEVEN.SetContainer( 'localhost/FactoryServer' ) +div2_ISEVEN.SetComment( '' ) +div2_ISEVEN.Coords( 619 , 191 ) +div2_ISONE = GraphSyracuseC_Gate.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) +div2_ISONE.SetName( 'div2_ISONE' ) +div2_ISONE.SetAuthor( '' ) +div2_ISONE.SetContainer( 'localhost/FactoryServer' ) +div2_ISONE.SetComment( '' ) +div2_ISONE.Coords( 616 , 6 ) +incr = GraphSyracuseC_Gate.Node( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) +incr.SetName( 'incr' ) +incr.SetAuthor( '' ) +incr.SetContainer( 'localhost/FactoryServer' ) +incr.SetComment( '' ) +incr.Coords( 434 , 193 ) + +# Creation of intermediate Output variables and of Computing Links +test_ISEVENOutGate = test_ISEVEN.Port( 'OutGate' ) +m3p1InGate = GraphSyracuseC_Gate.Link( test_ISEVENOutGate , m3p1.Port( 'InGate' ) ) +m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) +div2anEvenInteger = GraphSyracuseC_Gate.Link( m3p1anEvenInteger , div2.Port( 'anEvenInteger' ) ) +div2anEvenInteger.AddCoord( 1 , 368 , 158 ) +div2anEvenInteger.AddCoord( 2 , 369 , 568 ) +div2anInteger = div2.Port( 'anInteger' ) +div2_ISONEanInteger = GraphSyracuseC_Gate.Link( div2anInteger , div2_ISONE.Port( 'anInteger' ) ) +div2_ISEVENanInteger = GraphSyracuseC_Gate.Link( div2anInteger , div2_ISEVEN.Port( 'anInteger' ) ) +div2_ISEVENanInteger.AddCoord( 1 , 603 , 342 ) +div2_ISEVENanInteger.AddCoord( 2 , 603 , 158 ) + +# Creation of Input datas +curM3P1 = m3p1.Input( 'anOddInteger' , 31) +curtestISEVEN = test_ISEVEN.Input( 'anInteger' , curM3P1.ToAny() ) +curtestISONE = test_ISONE.Input( 'anInteger' , curM3P1.ToAny() ) +div2InanEvenInteger = div2.Port( 'anEvenInteger' ) +incraCount = incr.Input( 'aCount' , 0) + +# Creation of Output variables +test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) +test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) +div2_ISEVENBoolEven = div2_ISEVEN.Port( 'BoolEven' ) +div2_ISONEBoolOne = div2_ISONE.Port( 'BoolOne' ) +incraNewCount = incr.Port( 'aNewCount' ) + +GraphSyracuseC_Gate.IsValid() + +GraphSyracuseC_Gate.ThreadsMax() + +GraphSyracuseC_Gate.LevelMax() + +GraphSyracuseC_Gate.GraphsNumber() + +GraphSyracuseC_Gate.IsExecutable() + +exec GraphSyracuseC_Gate.ListNodes() + +curM3P1 = m3p1.Port( 'anOddInteger' ) +m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) +curtestISEVEN = test_ISEVEN.Port( 'anInteger' ) +curtestISONE = test_ISONE.Port( 'anInteger' ) +div2anEvenInteger = div2.Port( 'anEvenInteger' ) +div2anInteger = div2.Port( 'anInteger' ) +incraCount = incr.Port( 'aCount' ) + +# Creation of Output variables +test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) +test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) +div2_ISEVENBoolEven = div2_ISEVEN.Port( 'BoolEven' ) +div2_ISONEBoolOne = div2_ISONE.Port( 'BoolOne' ) +incraNewCount = incr.Port( 'aNewCount' ) + +GraphSyracuseC_Gate.Start() + +m3p1.Suspend() + +div2_ISEVEN.SuspendDone() +div2_ISONE.SuspendDone() + +test_ISEVEN.Resume() +test_ISONE.Resume() + +# Attente de fin d'execution de test +test_ISONE.DoneW() +test_ISEVEN.DoneW() + +m3p1.SuspendedW() +incr.SuspendedW() +incr.SuspendDone() + +# Etats et Threads des nodes +GraphSyracuseC_Gate.PrintThreads() + +BoolOne = int( test_ISONEBoolOne.ToString() ) +BoolEven = int( test_ISEVENBoolEven.ToString() ) +while BoolOne == 0 : + if BoolEven == 0 : + sts = div2_ISONE.ReRunAt('m3p1') + sts = incr.ReRun() + sts = m3p1.DoneW() + sts = incr.DoneW() + sts = incraCount.Input( int( incraNewCount.ToString() ) + 1 ) + BoolEven = 1 + BoolOne = 0 + Current = int( m3p1anEvenInteger.ToString() ) + print incraNewCount.ToString(),"m3p1",Current,BoolEven + while BoolEven == 1 : + sts = incr.ReRun() + sts = div2.DoneW() + sts = div2_ISEVEN.DoneW() + sts = div2_ISONE.DoneW() + sts = incr.DoneW() + sts = incraCount.Input( incraNewCount.ToString() ) + BoolOne = int( div2_ISONEBoolOne.ToString() ) + BoolEven = int( div2_ISEVENBoolEven.ToString() ) + Current = int( div2anInteger.ToString() ) + print incraNewCount.ToString(),"div2",Current,BoolEven,BoolOne + if BoolEven == 1 : + sts = div2InanEvenInteger.Input( Current ) + sts = div2_ISONE.ReRunAt('div2') + sts = curM3P1.Input( Current ) + sts = m3p1InGate.InPort().Input( 1 ) + + +GraphSyracuseC_Gate.PrintThreads() +m3p1.Resume() +div2.Resume() +incr.Resume() +div2_ISONE.Resume() +div2_ISEVEN.Resume() +GraphSyracuseC_Gate.DoneW() +GraphSyracuseC_Gate.PrintPorts() +GraphSyracuseC_Gate.PrintThreads() + diff --git a/examples/GraphSyracuseC_Gate.xml b/examples/GraphSyracuseC_Gate.xml new file mode 100644 index 0000000..17f32df --- /dev/null +++ b/examples/GraphSyracuseC_Gate.xml @@ -0,0 +1,415 @@ + + + + + + + + + ? + ? + GraphSyracuseC_Gate + 1 + ? + + GraphSyracuseC_Gate + + + long + test_ISEVEN\anInteger + + + long + test_ISONE\anInteger + + + long + m3p1\anOddInteger + + + long + incr\aCount + + + + + long + test_ISEVEN\BoolEven + + + long + test_ISONE\BoolOne + + + long + div2_ISEVEN\BoolEven + + + long + div2_ISONE\BoolOne + + + long + incr\aNewCount + + + + + + + + 11/3/2003 - 16:25:34 + 11/3/2003 - 16:25:38 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + + + + + + SyrComponent + SyrComponent + test_ISEVEN + 0 + ? + + C_ISEVEN + + + long + anInteger + + + + + long + BoolEven + + + + + + + + 11/3/2003 - 16:25:34 + 11/3/2003 - 16:25:34 + 1.04 + ? + localhost/FactoryServer + ? + 5 + 416 + + + SyrComponent + SyrComponent + test_ISONE + 0 + ? + + C_ISONE + + + long + anInteger + + + + + long + BoolOne + + + + + + + + 11/3/2003 - 16:25:34 + 11/3/2003 - 16:25:34 + 1.04 + ? + localhost/FactoryServer + ? + 7 + 232 + + + SyrComponent + SyrComponent + m3p1 + 0 + ? + + C_M3P1 + + + long + anOddInteger + + + + + long + anEvenInteger + + + + + + + + 11/3/2003 - 16:25:34 + 11/3/2003 - 16:25:34 + 1.04 + ? + localhost/FactoryServer + ? + 180 + 417 + + + SyrComponent + SyrComponent + div2 + 0 + ? + + C_DIV2 + + + long + anEvenInteger + + + + + long + anInteger + + + + + + + + 11/3/2003 - 16:25:34 + 11/3/2003 - 16:25:34 + 1.04 + ? + localhost/FactoryServer + ? + 435 + 7 + + + SyrComponent + SyrComponent + div2_ISEVEN + 0 + ? + + C_ISEVEN + + + long + anInteger + + + + + long + BoolEven + + + + + + + + 11/3/2003 - 16:25:34 + 11/3/2003 - 16:25:34 + 1.04 + ? + localhost/FactoryServer + ? + 619 + 191 + + + SyrComponent + SyrComponent + div2_ISONE + 0 + ? + + C_ISONE + + + long + anInteger + + + + + long + BoolOne + + + + + + + + 11/3/2003 - 16:25:34 + 11/3/2003 - 16:25:34 + 1.04 + ? + localhost/FactoryServer + ? + 616 + 6 + + + SyrComponent + SyrComponent + incr + 0 + ? + + C_INCR + + + long + aCount + + + + + long + aNewCount + + + + + + + + 11/3/2003 - 16:25:35 + 11/3/2003 - 16:25:35 + 1.04 + ? + localhost/FactoryServer + ? + 434 + 193 + + + + + + test_ISEVEN + OutGate + m3p1 + InGate + + + + + m3p1 + anEvenInteger + div2 + anEvenInteger + + + 368 + 158 + + + 369 + 568 + + + + + div2 + anInteger + div2_ISONE + anInteger + + + + + div2 + anInteger + div2_ISEVEN + anInteger + + + 603 + 342 + + + 603 + 158 + + + + + + + + GraphSyracuseC_Gate + test_ISEVEN\anInteger + test_ISEVEN + anInteger + + 3 + 31 + + + + + + GraphSyracuseC_Gate + test_ISONE\anInteger + test_ISONE + anInteger + + 3 + 31 + + + + + + GraphSyracuseC_Gate + m3p1\anOddInteger + m3p1 + anOddInteger + + 3 + 31 + + + + + + GraphSyracuseC_Gate + incr\aCount + incr + aCount + + 3 + 0 + + + + + + + diff --git a/examples/GraphSyracuseC_Void.py b/examples/GraphSyracuseC_Void.py new file mode 100644 index 0000000..b4effae --- /dev/null +++ b/examples/GraphSyracuseC_Void.py @@ -0,0 +1,160 @@ + +# Generated python file of Graph GraphSyracuseC_Void + +from SuperV import * +# Graph creation +GraphSyracuseC_Void = Graph( 'GraphSyracuseC_Void' ) +print GraphSyracuseC_Void.SetName( 'GraphSyracuseC_Void' ) +print GraphSyracuseC_Void.SetAuthor( 'JR' ) +print GraphSyracuseC_Void.SetContainer( 'localhost/FactoryServer' ) +print GraphSyracuseC_Void.SetComment( 'Syracuse algorithm' ) +GraphSyracuseC_Void.Coords( 0 , 0 ) + +# Creation of Nodes +test_ISEVEN = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) +print test_ISEVEN.SetName( 'test_ISEVEN' ) +print test_ISEVEN.SetAuthor( '' ) +print test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) +print test_ISEVEN.SetComment( '' ) +test_ISEVEN.Coords( 5 , 416 ) +test_ISONE = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) +print test_ISONE.SetName( 'test_ISONE' ) +print test_ISONE.SetAuthor( '' ) +print test_ISONE.SetContainer( 'localhost/FactoryServer' ) +print test_ISONE.SetComment( '' ) +test_ISONE.Coords( 7 , 232 ) +m3p1 = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) +print m3p1.SetName( 'm3p1' ) +print m3p1.SetAuthor( '' ) +print m3p1.SetContainer( 'localhost/FactoryServer' ) +print m3p1.SetComment( '' ) +m3p1.Coords( 180 , 417 ) +div2 = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) +print div2.SetName( 'div2' ) +print div2.SetAuthor( '' ) +print div2.SetContainer( 'localhost/FactoryServer' ) +print div2.SetComment( '' ) +div2.Coords( 435 , 7 ) +div2_ISEVEN = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) +print div2_ISEVEN.SetName( 'div2_ISEVEN' ) +print div2_ISEVEN.SetAuthor( '' ) +print div2_ISEVEN.SetContainer( 'localhost/FactoryServer' ) +print div2_ISEVEN.SetComment( '' ) +div2_ISEVEN.Coords( 619 , 191 ) +div2_ISONE = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) +print div2_ISONE.SetName( 'div2_ISONE' ) +print div2_ISONE.SetAuthor( '' ) +print div2_ISONE.SetContainer( 'localhost/FactoryServer' ) +print div2_ISONE.SetComment( '' ) +div2_ISONE.Coords( 616 , 6 ) +incr = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) +print incr.SetName( 'incr' ) +print incr.SetAuthor( '' ) +print incr.SetContainer( 'localhost/FactoryServer' ) +print incr.SetComment( '' ) +incr.Coords( 434 , 193 ) + +# Creation of intermediate Output variables and of links +test_ISEVENOutVoid = test_ISEVEN.Port( 'OutVoid' ) +m3p1InVoid = GraphSyracuseC_Void.Link( test_ISEVENOutVoid , m3p1.Port( 'InVoid' ) ) +m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) +div2anEvenInteger = GraphSyracuseC_Void.Link( m3p1anEvenInteger , div2.Port( 'anEvenInteger' ) ) +print div2anEvenInteger.AddCoord( 1 , 368 , 158 ) +print div2anEvenInteger.AddCoord( 2 , 369 , 568 ) +div2anInteger = div2.Port( 'anInteger' ) +div2_ISONEanInteger = GraphSyracuseC_Void.Link( div2anInteger , div2_ISONE.Port( 'anInteger' ) ) +div2_ISEVENanInteger = GraphSyracuseC_Void.Link( div2anInteger , div2_ISEVEN.Port( 'anInteger' ) ) +print div2_ISEVENanInteger.AddCoord( 1 , 603 , 342 ) +print div2_ISEVENanInteger.AddCoord( 2 , 603 , 158 ) + +# Creation of Input datas +test_ISEVENanInteger = test_ISEVEN.Input( 'anInteger' , 31) +test_ISONEanInteger = test_ISONE.Input( 'anInteger' , 31) +m3p1anOddInteger = m3p1.Input( 'anOddInteger' , 31) +div2InanEvenInteger = div2.Port( 'anEvenInteger' ) +incraCount = incr.Input( 'aCount' , 0) + +# Missing Input datas + +# Creation of Output variables +test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) +test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) +div2_ISEVENBoolEven = div2_ISEVEN.Port( 'BoolEven' ) +div2_ISONEBoolOne = div2_ISONE.Port( 'BoolOne' ) +incraNewCount = incr.Port( 'aNewCount' ) + +GraphSyracuseC_Void.IsValid() + +GraphSyracuseC_Void.ThreadsMax() + +GraphSyracuseC_Void.LevelMax() + +GraphSyracuseC_Void.GraphsNumber() + +curM3P1 = m3p1.Input( 'anOddInteger' , 31 ) +curtestISEVEN = test_ISEVEN.Input( 'anInteger' , curM3P1.ToAny() ) +curtestISONE = test_ISONE.Input( 'anInteger' , curM3P1.ToAny() ) + +GraphSyracuseC_Void.IsExecutable() + +GraphSyracuseC_Void.Start() + +m3p1.Suspend() + +div2_ISEVEN.SuspendDone() +div2_ISONE.SuspendDone() + +test_ISEVEN.Resume() +test_ISONE.Resume() + +# Attente de fin d'exécution de test +test_ISONE.DoneW() +test_ISEVEN.DoneW() + +m3p1.SuspendedW() +incr.SuspendedW() +incr.SuspendDone() + +# Etats et Threads des nodes +GraphSyracuseC_Void.PrintThreads() + +BoolOne = int( test_ISONEBoolOne.ToString() ) +BoolEven = int( test_ISEVENBoolEven.ToString() ) +while BoolOne == 0 : + if BoolEven == 0 : + sts = div2_ISONE.ReRunAt('m3p1') + sts = incr.ReRun() + sts = m3p1.DoneW() + sts = incr.DoneW() + sts = incraCount.Input( int( incraNewCount.ToString() ) + 1 ) + BoolEven = 1 + BoolOne = 0 + Current = int( m3p1anEvenInteger.ToString() ) + print "m3p1",Current,BoolEven + while BoolEven == 1 : + sts = incr.ReRun() + sts = div2.DoneW() + sts = div2_ISEVEN.DoneW() + sts = div2_ISONE.DoneW() + sts = incr.DoneW() + sts = incraCount.Input( incraNewCount.ToString() ) + BoolOne = int( div2_ISONEBoolOne.ToString() ) + BoolEven = int( div2_ISEVENBoolEven.ToString() ) + Current = int( div2anInteger.ToString() ) + print "div2",Current,BoolEven,BoolOne + if BoolEven == 1 : + div2InanEvenInteger.Input( Current ) + sts = div2_ISONE.ReRunAt('div2') + sts = curM3P1.Input( Current ) + + +GraphSyracuseC_Void.PrintThreads() +m3p1.Resume() +div2.Resume() +incr.Resume() +div2_ISONE.Resume() +div2_ISEVEN.Resume() +GraphSyracuseC_Void.DoneW() +GraphSyracuseC_Void.PrintPorts() +GraphSyracuseC_Void.PrintThreads() + diff --git a/examples/GraphSyracuseControl.py b/examples/GraphSyracuseControl.py new file mode 100644 index 0000000..3e432a7 --- /dev/null +++ b/examples/GraphSyracuseControl.py @@ -0,0 +1,125 @@ + + +from SuperV import * + +GraphSyracuseControl = Graph( 'GraphSyracuseControl' ) +print GraphSyracuseControl.SetName( 'GraphSyracuseControl' ) +print GraphSyracuseControl.SetAuthor( 'JR' ) +print GraphSyracuseControl.SetContainer( 'localhost/FactoryServer' ) +print GraphSyracuseControl.SetComment( 'Syracuse algorithm' ) +GraphSyracuseControl.Coords( 0 , 0 ) + + +test_ISEVEN = GraphSyracuseControl.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) +print test_ISEVEN.SetName( 'test_ISEVEN' ) +print test_ISEVEN.SetAuthor( '' ) +print test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) +print test_ISEVEN.SetComment( '' ) +test_ISEVEN.Coords( 190 , 338 ) +test_ISONE = GraphSyracuseControl.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) +print test_ISONE.SetName( 'test_ISONE' ) +print test_ISONE.SetAuthor( '' ) +print test_ISONE.SetContainer( 'localhost/FactoryServer' ) +print test_ISONE.SetComment( '' ) +test_ISONE.Coords( 196 , 131 ) +m3p1 = GraphSyracuseControl.Node( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) +print m3p1.SetName( 'm3p1' ) +print m3p1.SetAuthor( '' ) +print m3p1.SetContainer( 'localhost/FactoryServer' ) +print m3p1.SetComment( '' ) +m3p1.Coords( 621 , 14 ) +div2 = GraphSyracuseControl.Node( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) +print div2.SetName( 'div2' ) +print div2.SetAuthor( '' ) +print div2.SetContainer( 'localhost/FactoryServer' ) +print div2.SetComment( '' ) +div2.Coords( 624 , 391 ) +incr = GraphSyracuseControl.Node( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) +print incr.SetName( 'incr' ) +print incr.SetAuthor( '' ) +print incr.SetContainer( 'localhost/FactoryServer' ) +print incr.SetComment( '' ) +incr.Coords( 622 , 199 ) +label_begin = GraphSyracuseControl.LNode( 'label_begin' ) +print label_begin.SetName( 'label_begin' ) +print label_begin.SetAuthor( '' ) +print label_begin.SetContainer( 'localhost/FactoryServerPy' ) +print label_begin.SetComment( '' ) +label_begin.Coords( 7 , 216 ) +label_test = GraphSyracuseControl.LService( 'SyrControlComponent' , 'SyrControlComponent' , 'L_OneEven' ) +print label_test.SetName( 'label_test' ) +print label_test.SetAuthor( '' ) +print label_test.SetContainer( 'localhost/FactoryServerPy' ) +print label_test.SetComment( '' ) +label_test.Coords( 399 , 176 ) +control_m3p1 = GraphSyracuseControl.CService( 'SyrControlComponent' , 'SyrControlComponent' , 'C_NotOneIsEven' ) +print control_m3p1.SetName( 'control_m3p1' ) +print control_m3p1.SetAuthor( '' ) +print control_m3p1.SetContainer( 'localhost/FactoryServerPy' ) +print control_m3p1.SetComment( '' ) +control_m3p1.Coords( 814 , 13 ) +control_div2 = GraphSyracuseControl.CNode( 'control_div2' ) +print control_div2.SetName( 'control_div2' ) +print control_div2.SetAuthor( '' ) +print control_div2.SetContainer( 'localhost/FactoryServerPy' ) +print control_div2.SetComment( '' ) +control_div2.Coords( 812 , 414 ) + + +label_begin.BusPorts( 'NB' , 'long' , 'NT' , 'long' ) +label_begin.BusPorts( 'KB' , 'long' , 'KT' , 'long' ) +label_test.BusPorts( 'NT' , 'long' , 'N' , 'long' ) +label_test.BusPorts( 'KT' , 'long' , 'K' , 'long' ) +control_m3p1.BusPorts( 'N' , 'long' , 'NT' , 'long' ) +control_m3p1.BusPorts( 'K' , 'long' , 'KT' , 'long' ) +control_div2.BusPorts( 'N' , 'long' , 'NB' , 'long' ) +control_div2.BusPorts( 'K' , 'long' , 'KB' , 'long' ) + + +GraphSyracuseControl.Link( label_begin.Port( 'NT' ) , label_test.Port( 'NT' ) ) +GraphSyracuseControl.Link( label_begin.Port( 'KT' ) , label_test.Port( 'KT' ) ) +GraphSyracuseControl.Link( label_begin.Port( 'NT' ) , test_ISEVEN.Port( 'anInteger' ) ) +GraphSyracuseControl.Link( label_begin.Port( 'NT' ) , test_ISONE.Port( 'anInteger' ) ) + +GraphSyracuseControl.Link( test_ISEVEN.Port( 'BoolEven' ) , label_test.Port( 'ValEven' ) ) +GraphSyracuseControl.Link( test_ISONE.Port( 'BoolOne' ) , label_test.Port( 'ValOne' ) ) +GraphSyracuseControl.Link( label_test.Port( 'N' ) , m3p1.Port( 'anOddInteger' ) ) +GraphSyracuseControl.Link( label_test.Port( 'N' ) , div2.Port( 'anEvenInteger' ) ) +GraphSyracuseControl.Link( label_test.Port( 'K' ) , incr.Port( 'aCount' ) ) +GraphSyracuseControl.Link( label_test.Port( 'Incr' ) , incr.Port( 'InGate' ) ) +GraphSyracuseControl.Link( label_test.Port( 'Even' ) , div2.Port( 'InGate' ) ) +GraphSyracuseControl.Link( label_test.Port( 'Odd' ) , m3p1.Port( 'InGate' ) ) + +GraphSyracuseControl.Link( m3p1.Port( 'anEvenInteger' ) , control_m3p1.Port( 'N' ) ) +GraphSyracuseControl.Link( div2.Port( 'anInteger' ) , control_div2.Port( 'N' ) ) +GraphSyracuseControl.Link( incr.Port( 'aNewCount' ) , control_m3p1.Port( 'K' ) ) +GraphSyracuseControl.Link( incr.Port( 'aNewCount' ) , control_div2.Port( 'K' ) ) + +GraphSyracuseControl.Link( control_m3p1.Port( 'OutGate' ) , label_test.Port( 'InGate' ) ) +GraphSyracuseControl.Link( control_div2.Port( 'OutGate' ) , label_begin.Port( 'InGate' ) ) + +GraphSyracuseControl.IsValid() + +GraphSyracuseControl.ThreadsMax() + +GraphSyracuseControl.LevelMax() + +GraphSyracuseControl.GraphsNumber() + +label_begin.Input( 'NB' , 31 ) +label_begin.Input( 'KB' , 0 ) + +GraphSyracuseControl.IsExecutable() + +GraphSyracuseControl.Export('../GraphSyrControl') + + +GraphSyracuseControl.Run() + +GraphSyracuseControl.DoneW() + +GraphSyracuseControl.State() + +GraphSyracuseControl.PrintPorts() + +label_test.PrintPorts() diff --git a/examples/GraphSyracuseCpp.py b/examples/GraphSyracuseCpp.py new file mode 100644 index 0000000..8bac3a2 --- /dev/null +++ b/examples/GraphSyracuseCpp.py @@ -0,0 +1,201 @@ + +# Generated python file of Graph GraphSyracuseCpp + +from SuperV import * +# Graph creation +GraphSyracuseCpp = Graph( 'GraphSyracuseCpp' ) +GraphSyracuseCpp.SetName( 'GraphSyracuseCpp' ) +GraphSyracuseCpp.SetAuthor( 'JR' ) +GraphSyracuseCpp.SetComment( 'Syracuse algorithm' ) +GraphSyracuseCpp.Coords( 0 , 0 ) + +# Creation of Computing Nodes +Syracuse = GraphSyracuseCpp.Node( 'SyrComponent' , 'SyrComponent' , 'Init' ) +Syracuse.SetName( 'Syracuse' ) +Syracuse.SetAuthor( '' ) +#Syracuse.SetContainer( 'localhost/FactoryServer' ) +Syracuse.SetComment( '' ) +Syracuse.Coords( 9 , 207 ) +test_IsEven = GraphSyracuseCpp.CNode( 'SyrComponent' , 'Syr' , 'IsEven' ) +test_IsEven.SetName( 'test_IsEven' ) +test_IsEven.SetAuthor( '' ) +#test_IsEven.SetContainer( 'localhost/FactoryServer' ) +test_IsEven.SetComment( '' ) +test_IsEven.Coords( 197 , 407 ) +test_IsOne = GraphSyracuseCpp.CNode( 'SyrComponent' , 'Syr' , 'IsOne' ) +test_IsOne.SetName( 'test_IsOne' ) +test_IsOne.SetAuthor( '' ) +#test_IsOne.SetContainer( 'localhost/FactoryServer' ) +test_IsOne.SetComment( '' ) +test_IsOne.Coords( 208 , 59 ) +m3p1_M3p1 = GraphSyracuseCpp.CNode( 'SyrComponent' , 'Syr' , 'M3p1' ) +m3p1_M3p1.SetName( 'm3p1_M3p1' ) +m3p1_M3p1.SetAuthor( '' ) +#m3p1_M3p1.SetContainer( 'localhost/FactoryServer' ) +m3p1_M3p1.SetComment( '' ) +m3p1_M3p1.Coords( 418 , 408 ) +div2_Div2 = GraphSyracuseCpp.CNode( 'SyrComponent' , 'Syr' , 'Div2' ) +div2_Div2.SetName( 'div2_Div2' ) +div2_Div2.SetAuthor( '' ) +#div2_Div2.SetContainer( 'localhost/FactoryServer' ) +div2_Div2.SetComment( '' ) +div2_Div2.Coords( 414 , 10 ) +incr_Incr = GraphSyracuseCpp.CNode( 'SyrComponent' , 'Syr' , 'Incr' ) +incr_Incr.SetName( 'incr_Incr' ) +incr_Incr.SetAuthor( '' ) +#incr_Incr.SetContainer( 'localhost/FactoryServer' ) +incr_Incr.SetComment( '' ) +incr_Incr.Coords( 416 , 207 ) +result_Current = GraphSyracuseCpp.CNode( 'SyrComponent' , 'Syr' , 'Current' ) +result_Current.SetName( 'result_Current' ) +result_Current.SetAuthor( '' ) +#result_Current.SetContainer( 'localhost/FactoryServer' ) +result_Current.SetComment( '' ) +result_Current.Coords( 603 , 216 ) +result_Count = GraphSyracuseCpp.CNode( 'SyrComponent' , 'Syr' , 'Count' ) +result_Count.SetName( 'result_Count' ) +result_Count.SetAuthor( '' ) +#result_Count.SetContainer( 'localhost/FactoryServer' ) +result_Count.SetComment( '' ) +result_Count.Coords( 803 , 212 ) + +# Creation of intermediate Output variables and of Computing Links +SyracuseaSyracuse = Syracuse.Port( 'aSyracuse' ) +test_IsEvenaSyracuse = GraphSyracuseCpp.Link( SyracuseaSyracuse , test_IsEven.Port( 'aSyracuse' ) ) +test_IsEvenaSyracuse.AddCoord( 1 , 175 , 559 ) +test_IsEvenaSyracuse.AddCoord( 2 , 175 , 359 ) +test_IsOneaSyracuse = GraphSyracuseCpp.Link( SyracuseaSyracuse , test_IsOne.Port( 'aSyracuse' ) ) +test_IsOneaSyracuse.AddCoord( 1 , 177 , 211 ) +test_IsOneaSyracuse.AddCoord( 2 , 177 , 359 ) +m3p1_M3p1aSyracuse = GraphSyracuseCpp.Link( SyracuseaSyracuse , m3p1_M3p1.Port( 'aSyracuse' ) ) +m3p1_M3p1aSyracuse.AddCoord( 1 , 388 , 560 ) +m3p1_M3p1aSyracuse.AddCoord( 2 , 388 , 359 ) +div2_Div2aSyracuse = GraphSyracuseCpp.Link( SyracuseaSyracuse , div2_Div2.Port( 'aSyracuse' ) ) +div2_Div2aSyracuse.AddCoord( 1 , 389 , 162 ) +div2_Div2aSyracuse.AddCoord( 2 , 389 , 359 ) +incr_IncraSyracuse = GraphSyracuseCpp.Link( SyracuseaSyracuse , incr_Incr.Port( 'aSyracuse' ) ) +result_CurrentaSyracuse = GraphSyracuseCpp.Link( SyracuseaSyracuse , result_Current.Port( 'aSyracuse' ) ) +result_CurrentaSyracuse.AddCoord( 1 , 590 , 368 ) +result_CurrentaSyracuse.AddCoord( 2 , 590 , 390 ) +result_CurrentaSyracuse.AddCoord( 3 , 388 , 390 ) +result_CurrentaSyracuse.AddCoord( 4 , 388 , 359 ) +result_CountaSyracuse = GraphSyracuseCpp.Link( SyracuseaSyracuse , result_Count.Port( 'aSyracuse' ) ) +result_CountaSyracuse.AddCoord( 1 , 785 , 364 ) +result_CountaSyracuse.AddCoord( 2 , 785 , 391 ) +result_CountaSyracuse.AddCoord( 3 , 389 , 391 ) +result_CountaSyracuse.AddCoord( 4 , 389 , 357 ) + +# Missing Input datas +SyracuseanOddInteger = Syracuse.Input( 'anOddInteger' , 7 ) + +# Creation of Output variables +test_IsEvenBoolEven = test_IsEven.Port( 'BoolEven' ) +test_IsOneBoolOne = test_IsOne.Port( 'BoolOne' ) +count_incr_Incr = incr_Incr.Port('aSyracuse') +result_CurrentaCurrent = result_Current.Port( 'aCurrent' ) + +GraphSyracuseCpp.IsValid() +GraphSyracuseCpp.LevelMax() +GraphSyracuseCpp.ThreadsMax() + +exec GraphSyracuseCpp.ListNodes() +SyracuseanOddInteger = Syracuse.Input( 'anOddInteger' , 7 ) +test_IsEvenBoolEven = test_IsEven.Port( 'BoolEven' ) +test_IsOneBoolOne = test_IsOne.Port( 'BoolOne' ) +count_incr_Incr = incr_Incr.Port('aSyracuse') +result_CurrentaCurrent = result_Current.Port( 'aCurrent' ) + + +GraphSyracuseCpp.Start( 7 ) + +# Suspend des nodes de tete de Syr +sts = test_IsOne.Suspend() +sts = test_IsEven.Suspend() +sts = m3p1_M3p1.Suspend() +sts = div2_Div2.Suspend() +sts = incr_Incr.Suspend() +sts = result_Current.Suspend() +sts = result_Count.Suspend() + +# Exécution du node de tete +sts = Syracuse.Resume() +sts = Syracuse.DoneW() + +# Attente de suspension de test et demandes de suspension après exécution +sts = test_IsOne.SuspendedW() +sts = test_IsOne.SuspendDone() +sts = test_IsEven.SuspendedW() +sts = test_IsEven.SuspendDone() + +# Exécution de test avec la valeur de départ +sts = test_IsOne.Resume() +sts = test_IsEven.Resume() + +# Attentes de suspension de m3p1, div2, incr et result. +# Puis demandes de suspension après exécution +sts = m3p1_M3p1.SuspendedW() +sts = div2_Div2.SuspendedW() +sts = incr_Incr.SuspendedW() +sts = result_Current.SuspendedW() +sts = result_Count.SuspendedW() +sts = m3p1_M3p1.SuspendDone() +sts = div2_Div2.SuspendDone() +sts = incr_Incr.SuspendDone() +sts = result_Current.SuspendDone() + +# Attente de fin d'exécution de test +sts = test_IsOne.SuspendedW() +sts = test_IsEven.SuspendedW() + +GraphSyracuseCpp.PrintThreads() + +IsOneBoolOne = test_IsOneBoolOne.ToString() +while int( IsOneBoolOne ) == 0 : + IsEvenBoolEven = test_IsEvenBoolEven.ToString() + if int( IsEvenBoolEven ) == 0 : + sts = m3p1_M3p1.ReRun() + sts = incr_Incr.ReRun() + sts = m3p1_M3p1.SuspendedW() + sts = result_Current.ReRun() + sts = test_IsOne.ReRun() + sts = test_IsEven.ReRun() + sts = test_IsOne.SuspendedW() + sts = test_IsEven.SuspendedW() + sts = incr_Incr.SuspendedW() + sts = result_Current.SuspendedW() + print "m3p1_M3p1",result_CurrentaCurrent.ToString(),IsEvenBoolEven + IsEvenBoolEven = test_IsEvenBoolEven.ToString() + while int( IsEvenBoolEven ) == 1 : + sts = div2_Div2.ReRun() + sts = incr_Incr.ReRun() + sts = div2_Div2.SuspendedW() + sts = result_Current.ReRun() + sts = test_IsOne.ReRun() + sts = test_IsEven.ReRun() + sts = test_IsOne.SuspendedW() + sts = test_IsEven.SuspendedW() + sts = incr_Incr.SuspendedW() + sts = IsEvenBoolEven = test_IsEvenBoolEven.ToString() + sts = result_Current.SuspendedW() + print "div2_Div2",result_CurrentaCurrent.ToString(),IsEvenBoolEven + IsOneBoolOne = test_IsOneBoolOne.ToString() + + + +GraphSyracuseCpp.PrintThreads() +sts = m3p1_M3p1.ControlClear() +sts = m3p1_M3p1.Resume() +sts = div2_Div2.ControlClear() +sts = div2_Div2.Resume() +sts = incr_Incr.ControlClear() +sts = incr_Incr.Resume() +sts = test_IsOne.Resume() +sts = test_IsEven.Resume() +sts = result_Current.ControlClear() +sts = result_Current.Resume() +sts = result_Count.ControlClear() +sts = result_Count.Resume() +sts = GraphSyracuseCpp.DoneW() +GraphSyracuseCpp.PrintPorts() +GraphSyracuseCpp.PrintThreads() + diff --git a/examples/GraphSyracuseCpp.xml b/examples/GraphSyracuseCpp.xml new file mode 100755 index 0000000..09d8a38 --- /dev/null +++ b/examples/GraphSyracuseCpp.xml @@ -0,0 +1,457 @@ + + + + + + + + + ? + ? + GraphSyracuseCpp + 1 + ? + + GraphSyracuseCpp + + + long + Syracuse\anOddInteger + + + + + long + test_IsEven\BoolEven + + + long + test_IsOne\BoolOne + + + long + result_Current\aCurrent + + + long + result_Count\aCount + + + + + + + + 11/3/2003 - 16:43:27 + 11/3/2003 - 16:43:37 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + + + + + + SyrComponent + SyrComponent + Syracuse + 0 + ? + + Init + + + long + anOddInteger + + + + + Syr + aSyracuse + + + + + + + + 11/3/2003 - 16:43:27 + 11/3/2003 - 16:43:27 + 1.04 + ? + localhost/FactoryServer + ? + 9 + 207 + + + ? + ? + test_IsEven + 2 + ? + + IsEven + + + Syr + aSyracuse + + + + + long + BoolEven + + + + + + + + 11/3/2003 - 16:43:27 + 11/3/2003 - 16:43:27 + 1.04 + ? + ? + ? + 197 + 407 + + + ? + ? + test_IsOne + 2 + ? + + IsOne + + + Syr + aSyracuse + + + + + long + BoolOne + + + + + + + + 11/3/2003 - 16:43:27 + 11/3/2003 - 16:43:27 + 1.04 + ? + ? + ? + 208 + 59 + + + ? + ? + m3p1_M3p1 + 2 + ? + + M3p1 + + + Syr + aSyracuse + + + + + + + + + + 11/3/2003 - 16:43:27 + 11/3/2003 - 16:43:27 + 1.04 + ? + ? + ? + 418 + 408 + + + ? + ? + div2_Div2 + 2 + ? + + Div2 + + + Syr + aSyracuse + + + + + + + + + + 11/3/2003 - 16:43:27 + 11/3/2003 - 16:43:27 + 1.04 + ? + ? + ? + 414 + 10 + + + ? + ? + incr_Incr + 2 + ? + + Incr + + + Syr + aSyracuse + + + + + + + + + + 11/3/2003 - 16:43:27 + 11/3/2003 - 16:43:27 + 1.04 + ? + ? + ? + 416 + 207 + + + ? + ? + result_Current + 2 + ? + + Current + + + Syr + aSyracuse + + + + + long + aCurrent + + + + + + + + 11/3/2003 - 16:43:27 + 11/3/2003 - 16:43:27 + 1.04 + ? + ? + ? + 603 + 216 + + + ? + ? + result_Count + 2 + ? + + Count + + + Syr + aSyracuse + + + + + long + aCount + + + + + + + + 11/3/2003 - 16:43:27 + 11/3/2003 - 16:43:27 + 1.04 + ? + ? + ? + 803 + 212 + + + + + + Syracuse + aSyracuse + test_IsEven + aSyracuse + + + 175 + 559 + + + 175 + 359 + + + + + Syracuse + aSyracuse + test_IsOne + aSyracuse + + + 177 + 211 + + + 177 + 359 + + + + + Syracuse + aSyracuse + m3p1_M3p1 + aSyracuse + + + 388 + 560 + + + 388 + 359 + + + + + Syracuse + aSyracuse + div2_Div2 + aSyracuse + + + 389 + 162 + + + 389 + 359 + + + + + Syracuse + aSyracuse + incr_Incr + aSyracuse + + + + + Syracuse + aSyracuse + result_Current + aSyracuse + + + 590 + 368 + + + 590 + 390 + + + 388 + 390 + + + 388 + 359 + + + + + Syracuse + aSyracuse + result_Count + aSyracuse + + + 785 + 364 + + + 785 + 391 + + + 389 + 391 + + + 389 + 357 + + + + + + + + GraphSyracuseCpp + Syracuse\anOddInteger + Syracuse + anOddInteger + + 3 + 31 + + + + + + + diff --git a/examples/Graphs.py b/examples/Graphs.py new file mode 100644 index 0000000..0791216 --- /dev/null +++ b/examples/Graphs.py @@ -0,0 +1,94 @@ + +# Generated python file of Graph Graphs + +from SuperV import * +# Graph creation +Graphs = Graph( 'Graphs' ) +Graphs.SetAuthor( '' ) +Graphs.SetComment( '' ) +Graphs.Coords( 0 , 0 ) + +# Creation of Nodes +Add = Graphs.Node( 'AddComponent' , 'AddComponent' , 'Add' ) +Add.SetAuthor( '' ) +Add.SetContainer( 'localhost/FactoryServer' ) +Add.SetComment( '' ) +Add.Coords( 32 , 26 ) +Sub = Graphs.Node( 'SubComponent' , 'SubComponent' , 'Sub' ) +Sub.SetAuthor( '' ) +Sub.SetContainer( 'localhost/FactoryServer' ) +Sub.SetComment( '' ) +Sub.Coords( 241 , 38 ) +Mul = Graphs.Node( 'MulComponent' , 'MulComponent' , 'Mul' ) +Mul.SetAuthor( '' ) +Mul.SetContainer( 'localhost/FactoryServer' ) +Mul.SetComment( '' ) +Mul.Coords( 445 , 0 ) +Div = Graphs.Node( 'DivComponent' , 'DivComponent' , 'Div' ) +Div.SetAuthor( '' ) +Div.SetContainer( 'localhost/FactoryServer' ) +Div.SetComment( '' ) +Div.Coords( 624 , 0 ) +Add_1 = Graphs.Node( 'AddComponent' , 'AddComponent' , 'Add' ) +Add_1.SetAuthor( '' ) +Add_1.SetContainer( 'localhost/FactoryServer' ) +Add_1.SetComment( '' ) +Add_1.Coords( 13 , 297 ) +Sub_1 = Graphs.Node( 'SubComponent' , 'SubComponent' , 'Sub' ) +Sub_1.SetAuthor( '' ) +Sub_1.SetContainer( 'localhost/FactoryServer' ) +Sub_1.SetComment( '' ) +Sub_1.Coords( 235 , 217 ) +Mul_1 = Graphs.Node( 'MulComponent' , 'MulComponent' , 'Mul' ) +Mul_1.SetAuthor( '' ) +Mul_1.SetContainer( 'localhost/FactoryServer' ) +Mul_1.SetComment( '' ) +Mul_1.Coords( 423 , 303 ) +Div_1 = Graphs.Node( 'DivComponent' , 'DivComponent' , 'Div' ) +Div_1.SetAuthor( '' ) +Div_1.SetContainer( 'localhost/FactoryServer' ) +Div_1.SetComment( '' ) +Div_1.Coords( 618 , 297 ) + +# Creation of intermediate Output variables and of links +Addz = Add.Port( 'z' ) +Subx = Graphs.Link( Addz , Sub.Port( 'x' ) ) +Subz = Sub.Port( 'z' ) +Mulx = Graphs.Link( Subz , Mul.Port( 'x' ) ) +Divx = Graphs.Link( Subz , Div.Port( 'x' ) ) +Mulz = Mul.Port( 'z' ) +Divy = Graphs.Link( Mulz , Div.Port( 'y' ) ) +Add_1FuncValue = Add_1.Port( 'FuncValue' ) +Mul_1x = Graphs.Link( Add_1FuncValue , Mul_1.Port( 'x' ) ) +Add_1z = Add_1.Port( 'z' ) +Sub_1x = Graphs.Link( Add_1z , Sub_1.Port( 'x' ) ) +Sub_1z = Sub_1.Port( 'z' ) +Div_1x = Graphs.Link( Sub_1z , Div_1.Port( 'x' ) ) +Mul_1z = Mul_1.Port( 'z' ) +Div_1y = Graphs.Link( Mul_1z , Div_1.Port( 'y' ) ) + +# Creation of Input datas +Addx = Add.Input( 'x' , 3) +Addy = Add.Input( 'y' , 5) +Suby = Sub.Input( 'y' , 7) +Muly = Mul.Input( 'y' , 11) +Add_1x = Add_1.Input( 'x' , 1) +Add_1y = Add_1.Input( 'y' , 2) +Sub_1y = Sub_1.Input( 'y' , 3) +Mul_1y = Mul_1.Input( 'y' , 4) + +# Missing Input datas + +# Creation of Output variables +AddFuncValue = Add.Port( 'FuncValue' ) +Divz = Div.Port( 'z' ) +Div_1z = Div_1.Port( 'z' ) + +Graphs.Run() + +Graphs.DoneW() + +Graphs.State() + +Graphs.PrintPorts() + diff --git a/examples/Graphs.xml b/examples/Graphs.xml new file mode 100644 index 0000000..33bed41 --- /dev/null +++ b/examples/Graphs.xml @@ -0,0 +1,561 @@ + + + + + + + + + ? + ? + Graphs + 1 + ? + + Graphs + + + double + Add\x + + + double + Add\y + + + double + Sub\y + + + double + Mul\y + + + double + Add_1\x + + + double + Add_1\y + + + double + Sub_1\y + + + double + Mul_1\y + + + + + double + Add\FuncValue + + + double + Div\z + + + double + Div_1\z + + + + + + + + 11/3/2003 - 15:3:57 + 11/3/2003 - 15:3:57 + 1.04 + ? + ? + ? + 0 + 0 + + + + + + AddComponent + AddComponent + Add + 0 + ? + + Add + + + double + x + + + double + y + + + + + double + FuncValue + + + double + z + + + + + + + + 11/3/2003 - 15:3:57 + 11/3/2003 - 15:3:57 + 1.04 + ? + localhost/FactoryServer + ? + 32 + 26 + + + SubComponent + SubComponent + Sub + 0 + ? + + Sub + + + double + x + + + double + y + + + + + double + z + + + + + + + + 11/3/2003 - 15:3:57 + 11/3/2003 - 15:3:57 + 1.04 + ? + localhost/FactoryServer + ? + 241 + 38 + + + MulComponent + MulComponent + Mul + 0 + ? + + Mul + + + double + x + + + double + y + + + + + double + z + + + + + + + + 11/3/2003 - 15:3:57 + 11/3/2003 - 15:3:57 + 1.04 + ? + localhost/FactoryServer + ? + 445 + 0 + + + DivComponent + DivComponent + Div + 0 + ? + + Div + + + double + x + + + double + y + + + + + double + z + + + + + + + + 11/3/2003 - 15:3:57 + 11/3/2003 - 15:3:57 + 1.04 + ? + localhost/FactoryServer + ? + 624 + 0 + + + AddComponent + AddComponent + Add_1 + 0 + ? + + Add + + + double + x + + + double + y + + + + + double + FuncValue + + + double + z + + + + + + + + 11/3/2003 - 15:3:57 + 11/3/2003 - 15:3:57 + 1.04 + ? + localhost/FactoryServer + ? + 13 + 297 + + + SubComponent + SubComponent + Sub_1 + 0 + ? + + Sub + + + double + x + + + double + y + + + + + double + z + + + + + + + + 11/3/2003 - 15:3:57 + 11/3/2003 - 15:3:57 + 1.04 + ? + localhost/FactoryServer + ? + 235 + 217 + + + MulComponent + MulComponent + Mul_1 + 0 + ? + + Mul + + + double + x + + + double + y + + + + + double + z + + + + + + + + 11/3/2003 - 15:3:57 + 11/3/2003 - 15:3:57 + 1.04 + ? + localhost/FactoryServer + ? + 423 + 303 + + + DivComponent + DivComponent + Div_1 + 0 + ? + + Div + + + double + x + + + double + y + + + + + double + z + + + + + + + + 11/3/2003 - 15:3:57 + 11/3/2003 - 15:3:57 + 1.04 + ? + localhost/FactoryServer + ? + 618 + 297 + + + + + + Add + z + Sub + x + + + + + Sub + z + Mul + x + + + + + Sub + z + Div + x + + + + + Mul + z + Div + y + + + + + Add_1 + FuncValue + Mul_1 + x + + + + + Add_1 + z + Sub_1 + x + + + + + Sub_1 + z + Div_1 + x + + + + + Mul_1 + z + Div_1 + y + + + + + + + + Graphs + Add\x + Add + x + + 3 + 3 + + + + + + Graphs + Add\y + Add + y + + 3 + 5 + + + + + + Graphs + Sub\y + Sub + y + + 3 + 7 + + + + + + Graphs + Mul\y + Mul + y + + 3 + 11 + + + + + + Graphs + Add_1\x + Add_1 + x + + 3 + 1 + + + + + + Graphs + Add_1\y + Add_1 + y + + 3 + 2 + + + + + + Graphs + Sub_1\y + Sub_1 + y + + 3 + 3 + + + + + + Graphs + Mul_1\y + Mul_1 + y + + 3 + 4 + + + + + + + diff --git a/examples/NewGraphEssai.py b/examples/NewGraphEssai.py new file mode 100644 index 0000000..fdb68f6 --- /dev/null +++ b/examples/NewGraphEssai.py @@ -0,0 +1,67 @@ + +# Generated python file of Graph GraphEssai + +from SuperV import * +# Graph creation +GraphEssai = Graph( 'GraphEssai' ) +print GraphEssai.SetAuthor( '' ) +print GraphEssai.SetComment( '' ) +GraphEssai.Coords( 0 , 0 ) + +# Creation of Nodes +Sub = GraphEssai.Node( 'SubComponent' , 'SubComponent' , 'Sub' ) +print Sub.SetAuthor( '' ) +print Sub.SetContainer( 'SubDivServer' ) +print Sub.SetComment( '' ) +Sub.Coords( 379 , 41 ) +Mul = GraphEssai.Node( 'MulComponent' , 'MulComponent' , 'Mul' ) +print Mul.SetAuthor( '' ) +print Mul.SetContainer( 'MulServer' ) +print Mul.SetComment( '' ) +Mul.Coords( 553 , 275 ) +Div = GraphEssai.Node( 'DivComponent' , 'DivComponent' , 'Div' ) +print Div.SetAuthor( '' ) +print Div.SetContainer( 'SubDivServer' ) +print Div.SetComment( '' ) +Div.Coords( 608 , 42 ) +Addition = GraphEssai.Node( 'AddComponent' , 'AddComponent' , 'Addition' ) +print Addition.SetAuthor( '' ) +print Addition.SetContainer( 'localhost/AddServer' ) +print Addition.SetComment( '' ) +Addition.Coords( 14 , 270 ) +Add = GraphEssai.Node( 'AddComponent' , 'Adder' , 'Add' ) +print Add.SetAuthor( '' ) +print Add.SetContainer( 'localhost/AddServer' ) +print Add.SetComment( '' ) +Add.Coords( 204 , 237 ) + +# Creation of intermediate Output variables and of links +Subz = Sub.Port( 'z' ) +Mulx = GraphEssai.Link( Subz , Mul.Port( 'x' ) ) +Divx = GraphEssai.Link( Subz , Div.Port( 'x' ) ) +Mulz = Mul.Port( 'z' ) +Divy = GraphEssai.Link( Mulz , Div.Port( 'y' ) ) +AdditionAdder = Addition.Port( 'Adder' ) +AddAdder = GraphEssai.Link( AdditionAdder , Add.Port( 'Adder' ) ) +AddFuncValue = Add.Port( 'FuncValue' ) +Suby = GraphEssai.Link( AddFuncValue , Sub.Port( 'y' ) ) +Addz = Add.Port( 'z' ) +Muly = GraphEssai.Link( Addz , Mul.Port( 'y' ) ) + +# Creation of Input datas +Subx = Sub.Input( 'x' , 4.5) +Addx = Add.Input( 'x' , 1.5) +Addy = Add.Input( 'y' , 3) + +# Missing Input datas + +# Creation of Output variables +Divz = Div.Port( 'z' ) + +GraphEssai.Run() + +GraphEssai.DoneW() + +GraphEssai.State() + +GraphEssai.PrintPorts() diff --git a/examples/NewGraphEssai.xml b/examples/NewGraphEssai.xml new file mode 100644 index 0000000..4cf7c28 --- /dev/null +++ b/examples/NewGraphEssai.xml @@ -0,0 +1,305 @@ + + + + + + + + + GraphEssai + ? + GraphEssai + 1 + + GraphEssai + + + double + Sub\x + + + double + Add\x + + + double + Add\y + + + + + double + Div\z + + + + 21/11/2001 - 17:17:23 + 27/3/2002 - 9:20:10 + 1.00 + ? + SuperVisionContainer + ? + 0 + 0 + + + + + + SubComponent + SubComponent + Sub + 0 + + Sub + + + double + x + + + double + y + + + + + double + z + + + + 27/3/2002 - 9:16:4 + 27/3/2002 - 9:16:4 + 1.00 + ? + SubDivServer + ? + 379 + 41 + + + MulComponent + MulComponent + Mul + 0 + + Mul + + + double + x + + + double + y + + + + + double + z + + + + 27/3/2002 - 9:16:4 + 27/3/2002 - 9:16:4 + 1.00 + ? + MulServer + ? + 553 + 275 + + + DivComponent + DivComponent + Div + 0 + + Div + + + double + x + + + double + y + + + + + double + z + + + + 27/3/2002 - 9:16:4 + 27/3/2002 - 9:16:4 + 1.00 + ? + SubDivServer + ? + 608 + 42 + + + AddComponent + AddComponent + Addition + 0 + + Addition + + + + + Adder + Adder + + + + 27/3/2002 - 9:16:4 + 27/3/2002 - 9:16:4 + 1.03 + ? + localhost/AddServer + ? + 14 + 270 + + + AddComponent + Adder + Add + 0 + + Add + + + Adder + Adder + + + double + x + + + double + y + + + + + double + FuncValue + + + double + z + + + + 27/3/2002 - 9:16:4 + 27/3/2002 - 9:16:4 + 1.03 + ? + localhost/AddServer + ? + 204 + 237 + + + + + + Sub + z + Mul + x + + + + + Sub + z + Div + x + + + + + Mul + z + Div + y + + + + + Addition + Adder + Add + Adder + + + + + Add + FuncValue + Sub + y + + + + + Add + z + Mul + y + + + + + + + + GraphEssai + Sub\x + Sub + x + + 7 + 4.5 + + + + + + GraphEssai + Add\x + Add + x + + 7 + 1.5 + + + + + + GraphEssai + Add\y + Add + y + + 3 + 3 + + + + + + + diff --git a/examples/NewGraphGeomEssai.py b/examples/NewGraphGeomEssai.py new file mode 100644 index 0000000..168e25b --- /dev/null +++ b/examples/NewGraphGeomEssai.py @@ -0,0 +1,54 @@ + +# Generated python file of Graph GraphGeom2Essai + +from SuperV import * +# Graph creation +GraphGeom2Essai = Graph( 'GraphGeom2Essai' ) +print GraphGeom2Essai.SetAuthor( '' ) +print GraphGeom2Essai.SetComment( '' ) +GraphGeom2Essai.Coords( 0 , 0 ) + +# Creation of Nodes +MakeSphere = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeSphere' ) +print MakeSphere.SetAuthor( '' ) +print MakeSphere.SetContainer( 'FactoryServer' ) +print MakeSphere.SetComment( '' ) +MakeSphere.Coords( 17 , 75 ) +MakeCopy = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeCopy' ) +print MakeCopy.SetAuthor( '' ) +print MakeCopy.SetContainer( 'FactoryServer' ) +print MakeCopy.SetComment( '' ) +MakeCopy.Coords( 219 , 12 ) +MakeTranslation = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeTranslation' ) +print MakeTranslation.SetAuthor( '' ) +print MakeTranslation.SetContainer( 'FactoryServer' ) +print MakeTranslation.SetComment( '' ) +MakeTranslation.Coords( 221 , 209 ) +MakeFuse = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeFuse' ) +print MakeFuse.SetAuthor( '' ) +print MakeFuse.SetContainer( 'FactoryServer' ) +print MakeFuse.SetComment( '' ) +MakeFuse.Coords( 465 , 106 ) + +# Creation of intermediate Output variables and of links +MakeSpheresphere = MakeSphere.Port( 'shape' ) +MakeCopyshape = GraphGeom2Essai.Link( MakeSpheresphere , MakeCopy.Port( 'shape1' ) ) +MakeTranslationshape = GraphGeom2Essai.Link( MakeSpheresphere , MakeTranslation.Port( 'shape1' ) ) +MakeCopycopy = MakeCopy.Port( 'shape' ) +MakeFuseshape1 = GraphGeom2Essai.Link( MakeCopycopy , MakeFuse.Port( 'shape1' ) ) +MakeTranslationtranslation = MakeTranslation.Port( 'shape' ) +MakeFuseshape2 = GraphGeom2Essai.Link( MakeTranslationtranslation , MakeFuse.Port( 'shape2' ) ) + +# Creation of Input datas +MakeSpherex1 = MakeSphere.Input( 'x1' , 0) +MakeSpherey1 = MakeSphere.Input( 'y1' , 0) +MakeSpherez1 = MakeSphere.Input( 'z1' , 0) +MakeSphereradius = MakeSphere.Input( 'radius' , 50) +MakeTranslationx1 = MakeTranslation.Input( 'x1' , 80) +MakeTranslationy1 = MakeTranslation.Input( 'y1' , 0) +MakeTranslationz1 = MakeTranslation.Input( 'z1' , 0) + +# Missing Input datas + +# Creation of Output variables +MakeFuseresult = MakeFuse.Port( 'shape' ) diff --git a/examples/NewGraphGeomEssai.xml b/examples/NewGraphGeomEssai.xml new file mode 100644 index 0000000..6027765 --- /dev/null +++ b/examples/NewGraphGeomEssai.xml @@ -0,0 +1,332 @@ + + + + + + + + + ? + ? + GraphGeom2Essai + 1 + + GraphGeom2Essai + + + double + MakeSphere\x1 + + + double + MakeSphere\y1 + + + double + MakeSphere\z1 + + + double + MakeSphere\radius + + + double + MakeTranslation\x1 + + + double + MakeTranslation\y1 + + + double + MakeTranslation\z1 + + + + + GEOM_Shape + MakeFuse\result + + + + 12/12/2001 - 15:57:26 + 28/3/2002 - 15:32:51 + 1.00 + ? + FactoryServer + ? + 0 + 0 + + + + + + Geometry + ? + MakeSphere + 0 + + MakeSphere + + + double + x1 + + + double + y1 + + + double + z1 + + + double + radius + + + + + GEOM_Shape + sphere + + + + 28/3/2002 - 15:32:51 + 28/3/2002 - 15:32:51 + 1.00 + ? + FactoryServer + ? + 17 + 75 + + + Geometry + ? + MakeCopy + 0 + + MakeCopy + + + GEOM_Shape + shape + + + + + GEOM_Shape + copy + + + + 28/3/2002 - 15:32:51 + 28/3/2002 - 15:32:51 + 1.00 + ? + FactoryServer + ? + 219 + 12 + + + Geometry + ? + MakeTranslation + 0 + + MakeTranslation + + + GEOM_Shape + shape + + + double + x1 + + + double + y1 + + + double + z1 + + + + + GEOM_Shape + translation + + + + 28/3/2002 - 15:32:51 + 28/3/2002 - 15:32:51 + 1.00 + ? + FactoryServer + ? + 221 + 209 + + + Geometry + ? + MakeFuse + 0 + + MakeFuse + + + GEOM_Shape + shape1 + + + GEOM_Shape + shape2 + + + + + GEOM_Shape + result + + + + 28/3/2002 - 15:32:51 + 28/3/2002 - 15:32:51 + 1.00 + ? + FactoryServer + ? + 465 + 106 + + + + + + MakeSphere + sphere + MakeCopy + shape + + + + + MakeSphere + sphere + MakeTranslation + shape + + + + + MakeCopy + copy + MakeFuse + shape1 + + + + + MakeTranslation + translation + MakeFuse + shape2 + + + + + + + + GraphGeom2Essai + MakeSphere\x1 + MakeSphere + x1 + + 3 + 0 + + + + + + GraphGeom2Essai + MakeSphere\y1 + MakeSphere + y1 + + 3 + 0 + + + + + + GraphGeom2Essai + MakeSphere\z1 + MakeSphere + z1 + + 3 + 0 + + + + + + GraphGeom2Essai + MakeSphere\radius + MakeSphere + radius + + 3 + 50 + + + + + + GraphGeom2Essai + MakeTranslation\x1 + MakeTranslation + x1 + + 3 + 80 + + + + + + GraphGeom2Essai + MakeTranslation\y1 + MakeTranslation + y1 + + 3 + 0 + + + + + + GraphGeom2Essai + MakeTranslation\z1 + MakeTranslation + z1 + + 3 + 0 + + + + + + + diff --git a/examples/SupervRheolefGraph.py b/examples/SupervRheolefGraph.py new file mode 100755 index 0000000..7cf5a05 --- /dev/null +++ b/examples/SupervRheolefGraph.py @@ -0,0 +1,189 @@ + +# Generated python file of Graph aNewDataFlow + +from SuperV import * +# Graph creation +aNewDataFlow = Graph( 'aNewDataFlow' ) +print aNewDataFlow.SetName( 'aNewDataFlow' ) +print aNewDataFlow.SetAuthor( '' ) +print aNewDataFlow.SetComment( '' ) +aNewDataFlow.Coords( 0 , 0 ) + +# Creation of Nodes +InitCL = aNewDataFlow.Node( 'CLRheolef' , 'CLRheolef' , 'InitCL' ) +print InitCL.SetName( 'InitCL' ) +print InitCL.SetAuthor( '' ) +print InitCL.SetContainer( 'localhost/FactoryServer' ) +print InitCL.SetComment( '' ) +InitCL.Coords( 340 , 327 ) +MakeBox = aNewDataFlow.Node( 'Geometry' , 'Geometry' , 'MakeBox' ) +print MakeBox.SetName( 'MakeBox' ) +print MakeBox.SetAuthor( '' ) +print MakeBox.SetContainer( 'localhost/FactoryServer' ) +print MakeBox.SetComment( '' ) +MakeBox.Coords( 0 , 0 ) +MeshGeomShapeSup = aNewDataFlow.Node( 'QMG' , 'QMG' , 'MeshGeomShapeSup' ) +print MeshGeomShapeSup.SetName( 'MeshGeomShapeSup' ) +print MeshGeomShapeSup.SetAuthor( '' ) +print MeshGeomShapeSup.SetContainer( 'localhost/FactoryServer' ) +print MeshGeomShapeSup.SetComment( '' ) +MeshGeomShapeSup.Coords( 339 , 0 ) +SolveSup = aNewDataFlow.Node( 'Rheolef' , 'Rheolef' , 'SolveSup' ) +print SolveSup.SetName( 'SolveSup' ) +print SolveSup.SetAuthor( '' ) +print SolveSup.SetContainer( 'localhost/FactoryServer' ) +print SolveSup.SetComment( '' ) +SolveSup.Coords( 862 , 298 ) +ModifyCL = aNewDataFlow.Node( 'CLRheolef' , 'CLRheolef' , 'ModifyCL' ) +print ModifyCL.SetName( 'ModifyCL' ) +print ModifyCL.SetAuthor( '' ) +print ModifyCL.SetContainer( 'localhost/FactoryServer' ) +print ModifyCL.SetComment( '' ) +ModifyCL.Coords( 509 , 328 ) +MakeBoolean = aNewDataFlow.Node( 'Geometry' , 'Geometry' , 'MakeBoolean' ) +print MakeBoolean.SetName( 'MakeBoolean' ) +print MakeBoolean.SetAuthor( '' ) +print MakeBoolean.SetContainer( 'localhost/FactoryServer' ) +print MakeBoolean.SetComment( '' ) +MakeBoolean.Coords( 171 , 0 ) +MakeBox_1 = aNewDataFlow.Node( 'Geometry' , 'Geometry' , 'MakeBox' ) +print MakeBox_1.SetName( 'MakeBox_1' ) +print MakeBox_1.SetAuthor( '' ) +print MakeBox_1.SetContainer( 'localhost/FactoryServer' ) +print MakeBox_1.SetComment( '' ) +MakeBox_1.Coords( 0 , 325 ) +MakeTranslation = aNewDataFlow.Node( 'Geometry' , 'Geometry' , 'MakeTranslation' ) +print MakeTranslation.SetName( 'MakeTranslation' ) +print MakeTranslation.SetAuthor( '' ) +print MakeTranslation.SetContainer( 'localhost/FactoryServer' ) +print MakeTranslation.SetComment( '' ) +MakeTranslation.Coords( 165 , 325 ) +FindNode = aNewDataFlow.Node( 'QMG' , 'QMG' , 'FindNode' ) +print FindNode.SetName( 'FindNode' ) +print FindNode.SetAuthor( '' ) +print FindNode.SetContainer( 'localhost/FactoryServer' ) +print FindNode.SetComment( '' ) +FindNode.Coords( 510 , 0 ) +ValueOf = aNewDataFlow.Node( 'Rheolef' , 'Rheolef' , 'ValueOf' ) +print ValueOf.SetName( 'ValueOf' ) +print ValueOf.SetAuthor( '' ) +print ValueOf.SetContainer( 'localhost/FactoryServer' ) +print ValueOf.SetComment( '' ) +ValueOf.Coords( 692 , 43 ) +ModifyCL_1 = aNewDataFlow.Node( 'CLRheolef' , 'CLRheolef' , 'ModifyCL' ) +print ModifyCL_1.SetName( 'ModifyCL_1' ) +print ModifyCL_1.SetAuthor( '' ) +print ModifyCL_1.SetContainer( 'localhost/FactoryServer' ) +print ModifyCL_1.SetComment( '' ) +ModifyCL_1.Coords( 674 , 328 ) +Plot = aNewDataFlow.Node( 'Rheolef' , 'Rheolef' , 'Plot' ) +print Plot.SetName( 'Plot' ) +print Plot.SetAuthor( '' ) +print Plot.SetContainer( 'localhost/FactoryServer' ) +print Plot.SetComment( '' ) +Plot.Coords( 860 , 43 ) +Add = aNewDataFlow.Node( 'AddComponent' , 'AddComponent' , 'Add' ) +print Add.SetName( 'Add' ) +print Add.SetAuthor( '' ) +print Add.SetContainer( 'localhost/FactoryServer' ) +print Add.SetComment( '' ) +Add.Coords( 0 , 650 ) + +# Creation of intermediate Output variables and of links +InitCLreturn = InitCL.Port( 'return' ) +ModifyCLmyRheolefData = aNewDataFlow.Link( InitCLreturn , ModifyCL.Port( 'myRheolefData' ) ) +MakeBoxshape = MakeBox.Port( 'shape' ) +MakeBooleanshape1 = aNewDataFlow.Link( MakeBoxshape , MakeBoolean.Port( 'shape1' ) ) +MeshGeomShapeSupreturn = MeshGeomShapeSup.Port( 'return' ) +SolveSupmyMesh = aNewDataFlow.Link( MeshGeomShapeSupreturn , SolveSup.Port( 'myMesh' ) ) +print SolveSupmyMesh.AddCoord( 1 , 836 , 509 ) +print SolveSupmyMesh.AddCoord( 2 , 835 , 320 ) +print SolveSupmyMesh.AddCoord( 3 , 499 , 321 ) +print SolveSupmyMesh.AddCoord( 4 , 498 , 152 ) +InitCLmyMesh = aNewDataFlow.Link( MeshGeomShapeSupreturn , InitCL.Port( 'myMesh' ) ) +print InitCLmyMesh.AddCoord( 1 , 333 , 570 ) +print InitCLmyMesh.AddCoord( 2 , 332 , 321 ) +print InitCLmyMesh.AddCoord( 3 , 499 , 321 ) +print InitCLmyMesh.AddCoord( 4 , 499 , 151 ) +FindNodeaMesh = aNewDataFlow.Link( MeshGeomShapeSupreturn , FindNode.Port( 'aMesh' ) ) +print FindNodeaMesh.AddCoord( 1 , 498 , 152 ) +SolveSupreturn = SolveSup.Port( 'return' ) +ValueOfaField = aNewDataFlow.Link( SolveSupreturn , ValueOf.Port( 'aField' ) ) +print ValueOfaField.AddCoord( 1 , 683 , 194 ) +print ValueOfaField.AddCoord( 2 , 682 , 16 ) +print ValueOfaField.AddCoord( 3 , 1000 , 17 ) +print ValueOfaField.AddCoord( 4 , 1001 , 450 ) +ModifyCLreturn = ModifyCL.Port( 'return' ) +ModifyCL_1myRheolefData = aNewDataFlow.Link( ModifyCLreturn , ModifyCL_1.Port( 'myRheolefData' ) ) +MakeBooleanshape = MakeBoolean.Port( 'shape' ) +MeshGeomShapeSupshape = aNewDataFlow.Link( MakeBooleanshape , MeshGeomShapeSup.Port( 'shape' ) ) +print MeshGeomShapeSupshape.AddCoord( 1 , 333 , 182 ) +print MeshGeomShapeSupshape.AddCoord( 2 , 332 , 153 ) +MakeBox_1shape = MakeBox_1.Port( 'shape' ) +MakeTranslationshape1 = aNewDataFlow.Link( MakeBox_1shape , MakeTranslation.Port( 'shape1' ) ) +MakeTranslationshape = MakeTranslation.Port( 'shape' ) +MakeBooleanshape2 = aNewDataFlow.Link( MakeTranslationshape , MakeBoolean.Port( 'shape2' ) ) +print MakeBooleanshape2.AddCoord( 1 , 163 , 182 ) +print MakeBooleanshape2.AddCoord( 2 , 163 , 321 ) +print MakeBooleanshape2.AddCoord( 3 , 326 , 321 ) +print MakeBooleanshape2.AddCoord( 4 , 327 , 477 ) +FindNodereturn = FindNode.Port( 'return' ) +ValueOfnumberOfNode = aNewDataFlow.Link( FindNodereturn , ValueOf.Port( 'numberOfNode' ) ) +print ValueOfnumberOfNode.AddCoord( 1 , 673 , 224 ) +print ValueOfnumberOfNode.AddCoord( 2 , 672 , 151 ) +ValueOfreturn = ValueOf.Port( 'return' ) +PlotValue = aNewDataFlow.Link( ValueOfreturn , Plot.Port( 'Value' ) ) +ModifyCL_1return = ModifyCL_1.Port( 'return' ) +SolveSupmyRheolefData = aNewDataFlow.Link( ModifyCL_1return , SolveSup.Port( 'myRheolefData' ) ) +Addz = Add.Port( 'z' ) +MakeTranslationy1 = aNewDataFlow.Link( Addz , MakeTranslation.Port( 'y1' ) ) +print MakeTranslationy1.AddCoord( 1 , 161 , 537 ) +print MakeTranslationy1.AddCoord( 2 , 162 , 831 ) +FindNodey = aNewDataFlow.Link( Addz , FindNode.Port( 'y' ) ) +print FindNodey.AddCoord( 1 , 504 , 209 ) +print FindNodey.AddCoord( 2 , 503 , 832 ) +PlotPosition = aNewDataFlow.Link( Addz , Plot.Port( 'Position' ) ) +print PlotPosition.AddCoord( 1 , 854 , 228 ) +print PlotPosition.AddCoord( 2 , 855 , 832 ) + +# Creation of Input datas +InitCLstudyId = InitCL.Input( 'studyId' , 1) +InitCLdataName = InitCL.Input( 'dataName' , 'BoxData') +InitCLsource = InitCL.Input( 'source' , 0) +MakeBoxx1 = MakeBox.Input( 'x1' , 0) +MakeBoxy1 = MakeBox.Input( 'y1' , 0) +MakeBoxz1 = MakeBox.Input( 'z1' , 0) +MakeBoxx2 = MakeBox.Input( 'x2' , 100) +MakeBoxy2 = MakeBox.Input( 'y2' , 500) +MakeBoxz2 = MakeBox.Input( 'z2' , 50) +MeshGeomShapeSupstudyId = MeshGeomShapeSup.Input( 'studyId' , 1) +MeshGeomShapeSupsizeControl = MeshGeomShapeSup.Input( 'sizeControl' , 999999) +MeshGeomShapeSupcurveControl = MeshGeomShapeSup.Input( 'curveControl' , 0.5) +MeshGeomShapeSuptolmesh = MeshGeomShapeSup.Input( 'tolmesh' , 1e-05) +MeshGeomShapeSuptolskin = MeshGeomShapeSup.Input( 'tolskin' , 0) +SolveSupstudyId = SolveSup.Input( 'studyId' , 1) +ModifyCLfaceToModify = ModifyCL.Input( 'faceToModify' , 3) +ModifyCLnewFaceCLtype = ModifyCL.Input( 'newFaceCLtype' , 1) +ModifyCLnewFaceValue = ModifyCL.Input( 'newFaceValue' , 0) +MakeBooleanoperation = MakeBoolean.Input( 'operation' , 2) +MakeBox_1x1 = MakeBox_1.Input( 'x1' , 0) +MakeBox_1y1 = MakeBox_1.Input( 'y1' , 0) +MakeBox_1z1 = MakeBox_1.Input( 'z1' , 0) +MakeBox_1x2 = MakeBox_1.Input( 'x2' , 40) +MakeBox_1y2 = MakeBox_1.Input( 'y2' , 40) +MakeBox_1z2 = MakeBox_1.Input( 'z2' , 70) +MakeTranslationx1 = MakeTranslation.Input( 'x1' , 30) +MakeTranslationz1 = MakeTranslation.Input( 'z1' , -10) +FindNodex = FindNode.Input( 'x' , 50) +FindNodez = FindNode.Input( 'z' , 25) +ModifyCL_1faceToModify = ModifyCL_1.Input( 'faceToModify' , 5) +ModifyCL_1newFaceCLtype = ModifyCL_1.Input( 'newFaceCLtype' , 1) +ModifyCL_1newFaceValue = ModifyCL_1.Input( 'newFaceValue' , 1) +PlotFilename = Plot.Input( 'Filename' , 'Result.plt') +Addx = Add.Input( 'x' , 0) +Addy = Add.Input( 'y' , 10) + +# Missing Input datas + +# Creation of Output variables +AddFuncValue = Add.Port( 'FuncValue' ) diff --git a/examples/SupervRheolefGraph.xml b/examples/SupervRheolefGraph.xml new file mode 100755 index 0000000..37cd036 --- /dev/null +++ b/examples/SupervRheolefGraph.xml @@ -0,0 +1,1369 @@ + + + + + + + + + ? + ? + aNewDataFlow + 1 + + aNewDataFlow + + + long + InitCL\studyId + + + string + InitCL\dataName + + + double + InitCL\source + + + double + MakeBox\x1 + + + double + MakeBox\y1 + + + double + MakeBox\z1 + + + double + MakeBox\x2 + + + double + MakeBox\y2 + + + double + MakeBox\z2 + + + long + MeshGeomShapeSup\studyId + + + double + MeshGeomShapeSup\sizeControl + + + double + MeshGeomShapeSup\curveControl + + + double + MeshGeomShapeSup\tolmesh + + + double + MeshGeomShapeSup\tolskin + + + long + SolveSup\studyId + + + long + ModifyCL\faceToModify + + + long + ModifyCL\newFaceCLtype + + + double + ModifyCL\newFaceValue + + + long + MakeBoolean\operation + + + double + MakeBox_1\x1 + + + double + MakeBox_1\y1 + + + double + MakeBox_1\z1 + + + double + MakeBox_1\x2 + + + double + MakeBox_1\y2 + + + double + MakeBox_1\z2 + + + double + MakeTranslation\x1 + + + double + MakeTranslation\z1 + + + double + FindNode\x + + + double + FindNode\z + + + long + ModifyCL_1\faceToModify + + + long + ModifyCL_1\newFaceCLtype + + + double + ModifyCL_1\newFaceValue + + + string + Plot\Filename + + + double + Add\x + + + double + Add\y + + + + + double + Add\FuncValue + + + + 14/7/2002 - 21:1:52 + 18/7/2002 - 9:38:51 + 1.03 + ? + localhost/FactoryServer + ? + 0 + 0 + + + + + + CLRheolef + CLRheolef + InitCL + 0 + + InitCL + + + long + studyId + + + string + dataName + + + double + source + + + QMG_Mesh + myMesh + + + + + Rheolef_Data + return + + + + 18/7/2002 - 9:35:30 + 18/7/2002 - 9:35:30 + 1.03 + ? + localhost/FactoryServer + ? + 340 + 327 + + + Geometry + Geometry + MakeBox + 0 + + MakeBox + + + double + x1 + + + double + y1 + + + double + z1 + + + double + x2 + + + double + y2 + + + double + z2 + + + + + GEOM_Shape + shape + + + + 18/7/2002 - 9:35:30 + 18/7/2002 - 9:35:30 + 1.03 + ? + localhost/FactoryServer + ? + 0 + 0 + + + QMG + QMG + MeshGeomShapeSup + 0 + + MeshGeomShapeSup + + + long + studyId + + + GEOM_Shape + shape + + + double + sizeControl + + + double + curveControl + + + double + tolmesh + + + double + tolskin + + + + + QMG_Mesh + return + + + + 18/7/2002 - 9:35:30 + 18/7/2002 - 9:35:30 + 1.03 + ? + localhost/FactoryServer + ? + 339 + 0 + + + Rheolef + Rheolef + SolveSup + 0 + + SolveSup + + + long + studyId + + + Rheolef_Data + myRheolefData + + + QMG_Mesh + myMesh + + + + + Rheolef_Field + return + + + + 18/7/2002 - 9:35:30 + 18/7/2002 - 9:35:30 + 1.03 + ? + localhost/FactoryServer + ? + 862 + 298 + + + CLRheolef + CLRheolef + ModifyCL + 0 + + ModifyCL + + + Rheolef_Data + myRheolefData + + + long + faceToModify + + + long + newFaceCLtype + + + double + newFaceValue + + + + + Rheolef_Data + return + + + + 18/7/2002 - 9:35:30 + 18/7/2002 - 9:35:30 + 1.03 + ? + localhost/FactoryServer + ? + 509 + 328 + + + Geometry + Geometry + MakeBoolean + 0 + + MakeBoolean + + + GEOM_Shape + shape1 + + + GEOM_Shape + shape2 + + + long + operation + + + + + GEOM_Shape + shape + + + + 18/7/2002 - 9:35:30 + 18/7/2002 - 9:35:30 + 1.03 + ? + localhost/FactoryServer + ? + 171 + 0 + + + Geometry + Geometry + MakeBox_1 + 0 + + MakeBox + + + double + x1 + + + double + y1 + + + double + z1 + + + double + x2 + + + double + y2 + + + double + z2 + + + + + GEOM_Shape + shape + + + + 18/7/2002 - 9:35:30 + 18/7/2002 - 9:35:30 + 1.03 + ? + localhost/FactoryServer + ? + 0 + 325 + + + Geometry + Geometry + MakeTranslation + 0 + + MakeTranslation + + + GEOM_Shape + shape1 + + + double + x1 + + + double + y1 + + + double + z1 + + + + + GEOM_Shape + shape + + + + 18/7/2002 - 9:35:30 + 18/7/2002 - 9:35:30 + 1.03 + ? + localhost/FactoryServer + ? + 165 + 325 + + + QMG + QMG + FindNode + 0 + + FindNode + + + QMG_Mesh + aMesh + + + double + x + + + double + y + + + double + z + + + + + long + return + + + + 18/7/2002 - 9:35:30 + 18/7/2002 - 9:35:30 + 1.03 + ? + localhost/FactoryServer + ? + 510 + 0 + + + Rheolef + Rheolef + ValueOf + 0 + + ValueOf + + + Rheolef_Field + aField + + + long + numberOfNode + + + + + double + return + + + + 18/7/2002 - 9:35:30 + 18/7/2002 - 9:35:30 + 1.03 + ? + localhost/FactoryServer + ? + 692 + 43 + + + CLRheolef + CLRheolef + ModifyCL_1 + 0 + + ModifyCL + + + Rheolef_Data + myRheolefData + + + long + faceToModify + + + long + newFaceCLtype + + + double + newFaceValue + + + + + Rheolef_Data + return + + + + 18/7/2002 - 9:35:30 + 18/7/2002 - 9:35:30 + 1.03 + ? + localhost/FactoryServer + ? + 674 + 328 + + + Rheolef + Rheolef + Plot + 0 + + Plot + + + double + Value + + + double + Position + + + string + Filename + + + + + + 18/7/2002 - 9:35:30 + 18/7/2002 - 9:35:30 + 1.03 + ? + localhost/FactoryServer + ? + 860 + 43 + + + AddComponent + AddComponent + Add + 0 + + Add + + + double + x + + + double + y + + + + + double + FuncValue + + + double + z + + + + 18/7/2002 - 9:35:55 + 18/7/2002 - 9:35:55 + 1.03 + ? + localhost/FactoryServer + ? + 0 + 650 + + + + + + InitCL + return + ModifyCL + myRheolefData + + + + + MakeBox + shape + MakeBoolean + shape1 + + + + + MeshGeomShapeSup + return + SolveSup + myMesh + + + 836 + 509 + + + 835 + 320 + + + 499 + 321 + + + 498 + 152 + + + + + MeshGeomShapeSup + return + InitCL + myMesh + + + 333 + 570 + + + 332 + 321 + + + 499 + 321 + + + 499 + 151 + + + + + MeshGeomShapeSup + return + FindNode + aMesh + + + 498 + 152 + + + + + SolveSup + return + ValueOf + aField + + + 683 + 194 + + + 682 + 16 + + + 1000 + 17 + + + 1001 + 450 + + + + + ModifyCL + return + ModifyCL_1 + myRheolefData + + + + + MakeBoolean + shape + MeshGeomShapeSup + shape + + + 333 + 182 + + + 332 + 153 + + + + + MakeBox_1 + shape + MakeTranslation + shape1 + + + + + MakeTranslation + shape + MakeBoolean + shape2 + + + 163 + 182 + + + 163 + 321 + + + 326 + 321 + + + 327 + 477 + + + + + FindNode + return + ValueOf + numberOfNode + + + 673 + 224 + + + 672 + 151 + + + + + ValueOf + return + Plot + Value + + + + + ModifyCL_1 + return + SolveSup + myRheolefData + + + + + Add + z + MakeTranslation + y1 + + + 161 + 537 + + + 162 + 831 + + + + + Add + z + FindNode + y + + + 504 + 209 + + + 503 + 832 + + + + + Add + z + Plot + Position + + + 854 + 228 + + + 855 + 832 + + + + + + + + aNewDataFlow + InitCL\studyId + InitCL + studyId + + 3 + 1 + + + + + + aNewDataFlow + InitCL\dataName + InitCL + dataName + + 18 + BoxData + + + + + + aNewDataFlow + InitCL\source + InitCL + source + + 7 + 0 + + + + + + aNewDataFlow + MakeBox\x1 + MakeBox + x1 + + 3 + 0 + + + + + + aNewDataFlow + MakeBox\y1 + MakeBox + y1 + + 3 + 0 + + + + + + aNewDataFlow + MakeBox\z1 + MakeBox + z1 + + 3 + 0 + + + + + + aNewDataFlow + MakeBox\x2 + MakeBox + x2 + + 3 + 100 + + + + + + aNewDataFlow + MakeBox\y2 + MakeBox + y2 + + 3 + 500 + + + + + + aNewDataFlow + MakeBox\z2 + MakeBox + z2 + + 3 + 50 + + + + + + aNewDataFlow + MeshGeomShapeSup\studyId + MeshGeomShapeSup + studyId + + 3 + 1 + + + + + + aNewDataFlow + MeshGeomShapeSup\sizeControl + MeshGeomShapeSup + sizeControl + + 3 + 999999 + + + + + + aNewDataFlow + MeshGeomShapeSup\curveControl + MeshGeomShapeSup + curveControl + + 7 + 0.5 + + + + + + aNewDataFlow + MeshGeomShapeSup\tolmesh + MeshGeomShapeSup + tolmesh + + 7 + 1e-05 + + + + + + aNewDataFlow + MeshGeomShapeSup\tolskin + MeshGeomShapeSup + tolskin + + 7 + 0 + + + + + + aNewDataFlow + SolveSup\studyId + SolveSup + studyId + + 3 + 1 + + + + + + aNewDataFlow + ModifyCL\faceToModify + ModifyCL + faceToModify + + 3 + 3 + + + + + + aNewDataFlow + ModifyCL\newFaceCLtype + ModifyCL + newFaceCLtype + + 3 + 1 + + + + + + aNewDataFlow + ModifyCL\newFaceValue + ModifyCL + newFaceValue + + 7 + 0 + + + + + + aNewDataFlow + MakeBoolean\operation + MakeBoolean + operation + + 3 + 2 + + + + + + aNewDataFlow + MakeBox_1\x1 + MakeBox_1 + x1 + + 3 + 0 + + + + + + aNewDataFlow + MakeBox_1\y1 + MakeBox_1 + y1 + + 3 + 0 + + + + + + aNewDataFlow + MakeBox_1\z1 + MakeBox_1 + z1 + + 3 + 0 + + + + + + aNewDataFlow + MakeBox_1\x2 + MakeBox_1 + x2 + + 3 + 40 + + + + + + aNewDataFlow + MakeBox_1\y2 + MakeBox_1 + y2 + + 3 + 40 + + + + + + aNewDataFlow + MakeBox_1\z2 + MakeBox_1 + z2 + + 3 + 70 + + + + + + aNewDataFlow + MakeTranslation\x1 + MakeTranslation + x1 + + 3 + 30 + + + + + + aNewDataFlow + MakeTranslation\z1 + MakeTranslation + z1 + + 3 + -10 + + + + + + aNewDataFlow + FindNode\x + FindNode + x + + 3 + 50 + + + + + + aNewDataFlow + FindNode\z + FindNode + z + + 3 + 25 + + + + + + aNewDataFlow + ModifyCL_1\faceToModify + ModifyCL_1 + faceToModify + + 3 + 5 + + + + + + aNewDataFlow + ModifyCL_1\newFaceCLtype + ModifyCL_1 + newFaceCLtype + + 3 + 1 + + + + + + aNewDataFlow + ModifyCL_1\newFaceValue + ModifyCL_1 + newFaceValue + + 7 + 1 + + + + + + aNewDataFlow + Plot\Filename + Plot + Filename + + 18 + Result.plt + + + + + + aNewDataFlow + Add\x + Add + x + + 3 + 0 + + + + + + aNewDataFlow + Add\y + Add + y + + 3 + 10 + + + + + + + diff --git a/examples/SyrStruct.py b/examples/SyrStruct.py new file mode 100644 index 0000000..cf52c77 --- /dev/null +++ b/examples/SyrStruct.py @@ -0,0 +1,354 @@ + +# Generated python file of Graph SyrStruct + +from SuperV import * +# Graph creation +SyrStruct = Graph( 'SyrStruct' ) +SyrStruct.SetName( 'SyrStruct' ) +SyrStruct.SetAuthor( 'JR' ) +SyrStruct.SetComment( 'Syracuse algorithm' ) +SyrStruct.Coords( 0 , 0 ) + +# Creation of Factory Nodes +m3 = SyrStruct.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3' ) +m3.SetName( 'm3' ) +m3.SetAuthor( '' ) +m3.SetContainer( 'localhost/FactoryServer' ) +m3.SetComment( '' ) +m3.Coords( 678 , 11 ) +m3incr = SyrStruct.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) +m3incr.SetName( 'm3incr' ) +m3incr.SetAuthor( '' ) +m3incr.SetContainer( 'localhost/FactoryServer' ) +m3incr.SetComment( '' ) +m3incr.Coords( 896 , 10 ) +incra = SyrStruct.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) +incra.SetName( 'incra' ) +incra.SetAuthor( '' ) +incra.SetContainer( 'localhost/FactoryServer' ) +incra.SetComment( '' ) +incra.Coords( 789 , 201 ) +div2 = SyrStruct.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) +div2.SetName( 'div2' ) +div2.SetAuthor( '' ) +div2.SetContainer( 'localhost/FactoryServer' ) +div2.SetComment( '' ) +div2.Coords( 792 , 387 ) +incrb = SyrStruct.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) +incrb.SetName( 'incrb' ) +incrb.SetAuthor( '' ) +incrb.SetContainer( 'localhost/FactoryServer' ) +incrb.SetComment( '' ) +incrb.Coords( 796 , 577 ) + +# Creation of Loop Nodes +PyforN = [] +PyforN.append( 'def InitN( NN , K , SyrComponent , min , max ) :' ) +PyforN.append( ' N = max' ) +PyforN.append( ' if min > 0 :' ) +PyforN.append( ' if min <= max :' ) +PyforN.append( ' N = min' ) +PyforN.append( ' return N,K,SyrComponent,min,max' ) +PyMoreforN = [] +PyMoreforN.append( 'def MoreN( NN , KK , SyrComponent , min , max ) :' ) +PyMoreforN.append( ' N = 0' ) +PyMoreforN.append( ' OutLoop = 0' ) +PyMoreforN.append( ' if NN < max :' ) +PyMoreforN.append( ' N = NN' ) +PyMoreforN.append( ' OutLoop = 1' ) +PyMoreforN.append( ' return OutLoop,N,0,SyrComponent,min,max' ) +PyNextforN = [] +PyNextforN.append( 'def NextN( NN , KK , SyrComponent , min , max ) :' ) +PyNextforN.append( ' N = NN + 1' ) +PyNextforN.append( ' K = KK' ) +PyNextforN.append( ' return N,K,SyrComponent,min,max' ) +forN,endforN = SyrStruct.LNode( 'InitN' , PyforN , 'MoreN' , PyMoreforN , 'NextN' , PyNextforN ) +endforN.SetName( 'endforN' ) +endforN.SetAuthor( '' ) +endforN.SetComment( '' ) +endforN.Coords( 1530 , 332 ) +forN.InPort( 'N' , 'long' ) +forN.InPort( 'K' , 'long' ) +forN.InPort( 'SyrComponent' , 'objref' ) +forN.InPort( 'min' , 'long' ) +forN.InPort( 'max' , 'long' ) +forN.OutPort( 'N' , 'long' ) +forN.OutPort( 'K' , 'long' ) +forN.OutPort( 'SyrComponent' , 'objref' ) +forN.OutPort( 'min' , 'long' ) +forN.OutPort( 'max' , 'long' ) +forN.SetName( 'forN' ) +forN.SetAuthor( '' ) +forN.SetComment( '' ) +forN.Coords( 21 , 242 ) +PywhileNotOne = [] +PywhileNotOne.append( 'import threading' ) +PywhileNotOne.append( 'import SyrComponent_idl' ) +PywhileNotOne.append( 'def InitNotOne( SyrComponent , N , K ) :' ) +PywhileNotOne.append( ' return SyrComponent,N,K' ) +PyMorewhileNotOne = [] +PyMorewhileNotOne.append( 'import SyrComponent_idl' ) +PyMorewhileNotOne.append( 'def MoreNotOne( SyrComponent , N , K ) :' ) +PyMorewhileNotOne.append( ' OutLoop = 1 - SyrComponent.C_ISONE( N )' ) +PyMorewhileNotOne.append( ' return OutLoop,SyrComponent,N,K ' ) +PyNextwhileNotOne = [] +PyNextwhileNotOne.append( 'import SyrComponent_idl' ) +PyNextwhileNotOne.append( 'def NextNotOne( SyrComponent , N , K ) :' ) +PyNextwhileNotOne.append( ' return SyrComponent,N,K' ) +whileNotOne,endwhileNotOne = SyrStruct.LNode( 'InitNotOne' , PywhileNotOne , 'MoreNotOne' , PyMorewhileNotOne , 'NextNotOne' , PyNextwhileNotOne ) +endwhileNotOne.SetName( 'endwhileNotOne' ) +endwhileNotOne.SetAuthor( '' ) +endwhileNotOne.SetComment( '' ) +endwhileNotOne.Coords( 1340 , 332 ) +whileNotOne.InPort( 'SyrComponent' , 'objref' ) +whileNotOne.InPort( 'N' , 'long' ) +whileNotOne.InPort( 'K' , 'long' ) +whileNotOne.OutPort( 'SyrComponent' , 'objref' ) +whileNotOne.OutPort( 'N' , 'long' ) +whileNotOne.OutPort( 'K' , 'long' ) +whileNotOne.SetName( 'whileNotOne' ) +whileNotOne.SetAuthor( '' ) +whileNotOne.SetComment( '' ) +whileNotOne.Coords( 210 , 297 ) +Pyfori = [] +Pyfori.append( 'def Initfori( ii , K ) :' ) +Pyfori.append( ' return 1,0,K' ) +PyMorefori = [] +PyMorefori.append( 'def Morefori( ii , K ) :' ) +PyMorefori.append( ' OutLoop = 0' ) +PyMorefori.append( ' if ii < 2 :' ) +PyMorefori.append( ' OutLoop = 1' ) +PyMorefori.append( ' return OutLoop,ii,K' ) +PyNextfori = [] +PyNextfori.append( 'def Nextfori( ii , K ) :' ) +PyNextfori.append( ' ii = ii + 1' ) +PyNextfori.append( ' return ii,K' ) +fori,endfori = SyrStruct.LNode( 'Initfori' , Pyfori , 'Morefori' , PyMorefori , 'Nextfori' , PyNextfori ) +endfori.SetName( 'endfori' ) +endfori.SetAuthor( '' ) +endfori.SetComment( '' ) +endfori.Coords( 971 , 202 ) +fori.InPort( 'i' , 'long' ) +fori.InPort( 'K' , 'long' ) +fori.OutPort( 'i' , 'long' ) +fori.OutPort( 'K' , 'long' ) +fori.SetName( 'fori' ) +fori.SetAuthor( '' ) +fori.SetComment( '' ) +fori.Coords( 605 , 202 ) +PywhileEven = [] +PywhileEven.append( 'import SyrComponent_idl' ) +PywhileEven.append( 'def InitEven( SyrComponent , N , K ) :' ) +PywhileEven.append( ' return SyrComponent,N,K' ) +PyMorewhileEven = [] +PyMorewhileEven.append( 'import SyrComponent_idl' ) +PyMorewhileEven.append( 'def MoreEven( SyrComponent , N , K ) :' ) +PyMorewhileEven.append( ' OutLoop = SyrComponent.C_ISEVEN( N )' ) +PyMorewhileEven.append( ' return OutLoop,SyrComponent,N,K ' ) +PyNextwhileEven = [] +PyNextwhileEven.append( 'import SyrComponent_idl' ) +PyNextwhileEven.append( 'def NextEven( SyrComponent , N , K ) :' ) +PyNextwhileEven.append( ' return SyrComponent,N,K' ) +whileEven,endwhileEven = SyrStruct.LNode( 'InitEven' , PywhileEven , 'MoreEven' , PyMorewhileEven , 'NextEven' , PyNextwhileEven ) +endwhileEven.SetName( 'endwhileEven' ) +endwhileEven.SetAuthor( '' ) +endwhileEven.SetComment( '' ) +endwhileEven.Coords( 974 , 450 ) +whileEven.InPort( 'SyrComponent' , 'objref' ) +whileEven.InPort( 'N' , 'long' ) +whileEven.InPort( 'K' , 'long' ) +whileEven.OutPort( 'SyrComponent' , 'objref' ) +whileEven.OutPort( 'N' , 'long' ) +whileEven.OutPort( 'K' , 'long' ) +whileEven.SetName( 'whileEven' ) +whileEven.SetAuthor( '' ) +whileEven.SetComment( '' ) +whileEven.Coords( 605 , 452 ) + +# Creation of Switch Nodes +PyifNotEven = [] +PyifNotEven.append( 'import SyrComponent_idl' ) +PyifNotEven.append( 'def ifNotEven( SyrComponent , N , K ) :' ) +PyifNotEven.append( ' Even = SyrComponent.C_ISEVEN( N )' ) +PyifNotEven.append( ' Odd = 1 - Even' ) +PyifNotEven.append( ' return Odd,Even,SyrComponent,N,K' ) +ifNotEven,endifNotEven = SyrStruct.SNode( 'ifNotEven' , PyifNotEven ) +endifNotEven.SetName( 'endifNotEven' ) +endifNotEven.SetAuthor( '' ) +endifNotEven.SetComment( '' ) +endifNotEven.Coords( 1155 , 331 ) +PyendifNotEven = [] +endifNotEven.SetPyFunction( 'EndifNotEven' , PyendifNotEven ) +endifNotEven.InPort( 'N' , 'long' ) +endifNotEven.InPort( 'K' , 'long' ) +endifNotEven.OutPort( 'N' , 'long' ) +endifNotEven.OutPort( 'K' , 'long' ) +ifNotEven.InPort( 'SyrComponent' , 'objref' ) +ifNotEven.InPort( 'N' , 'long' ) +ifNotEven.InPort( 'K' , 'long' ) +ifNotEven.OutPort( 'Odd' , 'long' ) +ifNotEven.OutPort( 'Even' , 'long' ) +ifNotEven.OutPort( 'SyrComponent' , 'objref' ) +ifNotEven.OutPort( 'N' , 'long' ) +ifNotEven.OutPort( 'K' , 'long' ) +ifNotEven.SetName( 'ifNotEven' ) +ifNotEven.SetAuthor( '' ) +ifNotEven.SetComment( '' ) +ifNotEven.Coords( 416 , 286 ) + +# Creation of intermediate Output variables and of Control Links +m3anInteger = m3.Port( 'anInteger' ) +m3incraCount = SyrStruct.Link( m3anInteger , m3incr.Port( 'aCount' ) ) +m3incraNewCount = m3incr.Port( 'aNewCount' ) +endifNotEvenN = SyrStruct.Link( m3incraNewCount , endifNotEven.Port( 'N' ) ) +incraaNewCount = incra.Port( 'aNewCount' ) +endforiK = SyrStruct.Link( incraaNewCount , endfori.Port( 'K' ) ) +endforiK.AddCoord( 1 , 953 , 414 ) +endforiK.AddCoord( 2 , 953 , 353 ) +div2anInteger = div2.Port( 'anInteger' ) +endwhileEvenN = SyrStruct.Link( div2anInteger , endwhileEven.Port( 'N' ) ) +endwhileEvenN.AddCoord( 1 , 960 , 632 ) +endwhileEvenN.AddCoord( 2 , 960 , 539 ) +incrbaNewCount = incrb.Port( 'aNewCount' ) +endwhileEvenK = SyrStruct.Link( incrbaNewCount , endwhileEven.Port( 'K' ) ) +endwhileEvenK.AddCoord( 1 , 963 , 662 ) +endwhileEvenK.AddCoord( 2 , 963 , 729 ) +forNDoLoop = forN.Port( 'DoLoop' ) +endforNDoLoop = SyrStruct.Link( forNDoLoop , endforN.Port( 'DoLoop' ) ) +forNN = forN.Port( 'N' ) +endforNN = SyrStruct.Link( forNN , endforN.Port( 'N' ) ) +endforNN.AddCoord( 1 , 1554 , 513 ) +endforNN.AddCoord( 2 , 1523 , 513 ) +endforNN.AddCoord( 3 , 1523 , 806 ) +endforNN.AddCoord( 4 , 202 , 806 ) +endforNN.AddCoord( 5 , 202 , 424 ) +whileNotOneN = SyrStruct.Link( forNN , whileNotOne.Port( 'N' ) ) +whileNotOneN.AddCoord( 1 , 200 , 479 ) +whileNotOneN.AddCoord( 2 , 200 , 424 ) +forNK = forN.Port( 'K' ) +whileNotOneK = SyrStruct.Link( forNK , whileNotOne.Port( 'K' ) ) +whileNotOneK.AddCoord( 1 , 187 , 509 ) +whileNotOneK.AddCoord( 2 , 187 , 454 ) +forNSyrComponent = forN.Port( 'SyrComponent' ) +endforNSyrComponent = SyrStruct.Link( forNSyrComponent , endforN.Port( 'SyrComponent' ) ) +whileNotOneSyrComponent = SyrStruct.Link( forNSyrComponent , whileNotOne.Port( 'SyrComponent' ) ) +forNmin = forN.Port( 'min' ) +endforNmin = SyrStruct.Link( forNmin , endforN.Port( 'min' ) ) +forNmax = forN.Port( 'max' ) +endforNmax = SyrStruct.Link( forNmax , endforN.Port( 'max' ) ) +endforNDoLoop = endforN.Port( 'DoLoop' ) +forNInitLoop = SyrStruct.Link( endforNDoLoop , forN.Port( 'InitLoop' ) ) +whileNotOneDoLoop = whileNotOne.Port( 'DoLoop' ) +endwhileNotOneDoLoop = SyrStruct.Link( whileNotOneDoLoop , endwhileNotOne.Port( 'DoLoop' ) ) +whileNotOneSyrComponent = whileNotOne.Port( 'SyrComponent' ) +endwhileNotOneSyrComponent = SyrStruct.Link( whileNotOneSyrComponent , endwhileNotOne.Port( 'SyrComponent' ) ) +ifNotEvenSyrComponent = SyrStruct.Link( whileNotOneSyrComponent , ifNotEven.Port( 'SyrComponent' ) ) +whileNotOneN = whileNotOne.Port( 'N' ) +ifNotEvenN = SyrStruct.Link( whileNotOneN , ifNotEven.Port( 'N' ) ) +ifNotEvenN.AddCoord( 1 , 378 , 438 ) +ifNotEvenN.AddCoord( 2 , 378 , 479 ) +whileNotOneK = whileNotOne.Port( 'K' ) +ifNotEvenK = SyrStruct.Link( whileNotOneK , ifNotEven.Port( 'K' ) ) +ifNotEvenK.AddCoord( 1 , 395 , 468 ) +ifNotEvenK.AddCoord( 2 , 395 , 509 ) +endwhileNotOneDoLoop = endwhileNotOne.Port( 'DoLoop' ) +whileNotOneInitLoop = SyrStruct.Link( endwhileNotOneDoLoop , whileNotOne.Port( 'InitLoop' ) ) +endwhileNotOneK = endwhileNotOne.Port( 'K' ) +endforNK = SyrStruct.Link( endwhileNotOneK , endforN.Port( 'K' ) ) +foriDoLoop = fori.Port( 'DoLoop' ) +endforiDoLoop = SyrStruct.Link( foriDoLoop , endfori.Port( 'DoLoop' ) ) +forii = fori.Port( 'i' ) +endforii = SyrStruct.Link( forii , endfori.Port( 'i' ) ) +foriK = fori.Port( 'K' ) +incraaCount = SyrStruct.Link( foriK , incra.Port( 'aCount' ) ) +incraaCount.AddCoord( 1 , 783 , 353 ) +incraaCount.AddCoord( 2 , 783 , 414 ) +endforiDoLoop = endfori.Port( 'DoLoop' ) +foriInitLoop = SyrStruct.Link( endforiDoLoop , fori.Port( 'InitLoop' ) ) +endforiK = endfori.Port( 'K' ) +endifNotEvenK = SyrStruct.Link( endforiK , endifNotEven.Port( 'K' ) ) +whileEvenDoLoop = whileEven.Port( 'DoLoop' ) +endwhileEvenDoLoop = SyrStruct.Link( whileEvenDoLoop , endwhileEven.Port( 'DoLoop' ) ) +whileEvenSyrComponent = whileEven.Port( 'SyrComponent' ) +endwhileEvenSyrComponent = SyrStruct.Link( whileEvenSyrComponent , endwhileEven.Port( 'SyrComponent' ) ) +whileEvenN = whileEven.Port( 'N' ) +div2anEvenInteger = SyrStruct.Link( whileEvenN , div2.Port( 'anEvenInteger' ) ) +div2anEvenInteger.AddCoord( 1 , 779 , 539 ) +div2anEvenInteger.AddCoord( 2 , 779 , 634 ) +whileEvenK = whileEven.Port( 'K' ) +incrbaCount = SyrStruct.Link( whileEvenK , incrb.Port( 'aCount' ) ) +incrbaCount.AddCoord( 1 , 777 , 729 ) +incrbaCount.AddCoord( 2 , 777 , 664 ) +endwhileEvenDoLoop = endwhileEven.Port( 'DoLoop' ) +whileEvenInitLoop = SyrStruct.Link( endwhileEvenDoLoop , whileEven.Port( 'InitLoop' ) ) +endwhileEvenN = endwhileEven.Port( 'N' ) +endifNotEvenN = SyrStruct.Link( endwhileEvenN , endifNotEven.Port( 'N' ) ) +endwhileEvenK = endwhileEven.Port( 'K' ) +endifNotEvenK = SyrStruct.Link( endwhileEvenK , endifNotEven.Port( 'K' ) ) +ifNotEvenDefault = ifNotEven.Port( 'Default' ) +endifNotEvenDefault = SyrStruct.Link( ifNotEvenDefault , endifNotEven.Port( 'Default' ) ) +ifNotEvenOdd = ifNotEven.Port( 'Odd' ) +m3InGate = SyrStruct.Link( ifNotEvenOdd , m3.Port( 'InGate' ) ) +m3InGate.AddCoord( 1 , 585 , 133 ) +m3InGate.AddCoord( 2 , 585 , 438 ) +foriInGate = SyrStruct.Link( ifNotEvenOdd , fori.Port( 'InGate' ) ) +foriInGate.AddCoord( 1 , 584 , 324 ) +foriInGate.AddCoord( 2 , 584 , 438 ) +ifNotEvenEven = ifNotEven.Port( 'Even' ) +whileEvenInGate = SyrStruct.Link( ifNotEvenEven , whileEven.Port( 'InGate' ) ) +whileEvenInGate.AddCoord( 1 , 593 , 574 ) +whileEvenInGate.AddCoord( 2 , 593 , 468 ) +ifNotEvenSyrComponent = ifNotEven.Port( 'SyrComponent' ) +whileEvenSyrComponent = SyrStruct.Link( ifNotEvenSyrComponent , whileEven.Port( 'SyrComponent' ) ) +ifNotEvenN = ifNotEven.Port( 'N' ) +whileEvenN = SyrStruct.Link( ifNotEvenN , whileEven.Port( 'N' ) ) +whileEvenN.AddCoord( 1 , 586 , 634 ) +whileEvenN.AddCoord( 2 , 586 , 498 ) +m3anOddInteger = SyrStruct.Link( ifNotEvenN , m3.Port( 'anOddInteger' ) ) +m3anOddInteger.AddCoord( 1 , 579 , 163 ) +m3anOddInteger.AddCoord( 2 , 579 , 498 ) +ifNotEvenK = ifNotEven.Port( 'K' ) +whileEvenK = SyrStruct.Link( ifNotEvenK , whileEven.Port( 'K' ) ) +whileEvenK.AddCoord( 1 , 580 , 664 ) +whileEvenK.AddCoord( 2 , 580 , 528 ) +foriK = SyrStruct.Link( ifNotEvenK , fori.Port( 'K' ) ) +foriK.AddCoord( 1 , 599 , 414 ) +foriK.AddCoord( 2 , 599 , 528 ) +endifNotEvenN = endifNotEven.Port( 'N' ) +endwhileNotOneN = SyrStruct.Link( endifNotEvenN , endwhileNotOne.Port( 'N' ) ) +endwhileNotOneN.AddCoord( 1 , 1324 , 514 ) +endwhileNotOneN.AddCoord( 2 , 1324 , 483 ) +endifNotEvenK = endifNotEven.Port( 'K' ) +endwhileNotOneK = SyrStruct.Link( endifNotEvenK , endwhileNotOne.Port( 'K' ) ) +endwhileNotOneK.AddCoord( 1 , 1318 , 544 ) +endwhileNotOneK.AddCoord( 2 , 1318 , 513 ) + +# Creation of Input datas +forNN = forN.Input( 'N' , 0) +forNK = forN.Input( 'K' , 0) +FactoryServerSyrComponent = SyrStruct.ComponentRef( 'FactoryServer' , 'SyrComponent' ) +forNSyrComponent.Input( FactoryServerSyrComponent ) +forNmin = forN.Input( 'min' , 5) +forNmax = forN.Input( 'max' , 9) +forii = fori.Input( 'i' , 0) + +# Creation of Output variables +endforNN = endforN.Port( 'N' ) +endforNK = endforN.Port( 'K' ) +endforNSyrComponent = endforN.Port( 'SyrComponent' ) +endforNmin = endforN.Port( 'min' ) +endforNmax = endforN.Port( 'max' ) +endwhileNotOneSyrComponent = endwhileNotOne.Port( 'SyrComponent' ) +endwhileNotOneN = endwhileNotOne.Port( 'N' ) +endforii = endfori.Port( 'i' ) +endwhileEvenSyrComponent = endwhileEven.Port( 'SyrComponent' ) + + +SyrStruct.Run() + +SyrStruct.DoneW() + +SyrStruct.State() + +SyrStruct.PrintPorts() + diff --git a/examples/SyrStruct.xml b/examples/SyrStruct.xml new file mode 100644 index 0000000..ffa8982 --- /dev/null +++ b/examples/SyrStruct.xml @@ -0,0 +1,1562 @@ + + + + + + + + + ? + ? + SyrStruct + 1 + ? + + SyrStruct + + + long + forN\N + + + long + forN\K + + + long + forN\min + + + long + forN\max + + + long + fori\i + + + string + SyrComponent\aContainer + + + string + SyrComponent\aComponent + + + + + long + endforN\N + + + long + endforN\K + + + objref + endforN\SyrComponent + + + long + endforN\min + + + long + endforN\max + + + objref + endwhileNotOne\SyrComponent + + + long + endwhileNotOne\N + + + long + endfori\i + + + objref + endwhileEven\SyrComponent + + + + + + + + 14/3/2003 - 11:15:16 + 14/3/2003 - 11:16:1 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + + + + + + SyrComponent + SyrComponent + m3 + 0 + ? + + C_M3 + + + long + anOddInteger + + + + + long + anInteger + + + + + + + + 14/3/2003 - 11:15:16 + 14/3/2003 - 11:15:16 + 1.04 + ? + localhost/FactoryServer + ? + 678 + 11 + + + SyrComponent + SyrComponent + m3incr + 0 + ? + + C_INCR + + + long + aCount + + + + + long + aNewCount + + + + + + + + 14/3/2003 - 11:15:16 + 14/3/2003 - 11:15:16 + 1.04 + ? + localhost/FactoryServer + ? + 896 + 10 + + + SyrComponent + SyrComponent + incra + 0 + ? + + C_INCR + + + long + aCount + + + + + long + aNewCount + + + + + + + + 14/3/2003 - 11:15:16 + 14/3/2003 - 11:15:16 + 1.04 + ? + localhost/FactoryServer + ? + 789 + 201 + + + SyrComponent + SyrComponent + div2 + 0 + ? + + C_DIV2 + + + long + anEvenInteger + + + + + long + anInteger + + + + + + + + 14/3/2003 - 11:15:16 + 14/3/2003 - 11:15:16 + 1.04 + ? + localhost/FactoryServer + ? + 792 + 387 + + + SyrComponent + SyrComponent + incrb + 0 + ? + + C_INCR + + + long + aCount + + + + + long + aNewCount + + + + + + + + 14/3/2003 - 11:15:16 + 14/3/2003 - 11:15:16 + 1.04 + ? + localhost/FactoryServer + ? + 796 + 577 + + + ? + ? + forN + 4 + endforN + + InitN + + + long + N + + + long + K + + + objref + SyrComponent + + + long + min + + + long + max + + + + + long + N + + + long + K + + + objref + SyrComponent + + + long + min + + + long + max + + + + + + + + InitN + def InitN( NN , K , SyrComponent , min , max ) : + N = max + if min > 0 : + if max >= min : + N = min + return N,K,SyrComponent,min,max + + + MoreN + def MoreN( NN , KK , SyrComponent , min , max ) : + N = 0 + OutLoop = 0 + if max > NN : + N = NN + OutLoop = 1 + return OutLoop,N,0,SyrComponent,min,max + + + NextN + def NextN( NN , KK , SyrComponent , min , max ) : + N = NN + 1 + K = KK + return N,K,SyrComponent,min,max + + + 14/3/2003 - 11:15:16 + 14/3/2003 - 11:15:16 + 1.04 + ? + ? + ? + 21 + 242 + + + ? + ? + endforN + 5 + forN + + EndInitN + + + long + N + + + long + K + + + objref + SyrComponent + + + long + min + + + long + max + + + + + long + N + + + long + K + + + objref + SyrComponent + + + long + min + + + long + max + + + + + + + + + + 14/3/2003 - 11:15:16 + 14/3/2003 - 11:15:16 + 1.04 + ? + ? + ? + 1530 + 332 + + + ? + ? + whileNotOne + 4 + endwhileNotOne + + InitNotOne + + + objref + SyrComponent + + + long + N + + + long + K + + + + + objref + SyrComponent + + + long + N + + + long + K + + + + + + + + InitNotOne + import threading + import SyrComponent_idl + def InitNotOne( SyrComponent , N , K ) : + return SyrComponent,N,K + + + MoreNotOne + import SyrComponent_idl + def MoreNotOne( SyrComponent , N , K ) : + OutLoop = 1 - SyrComponent.C_ISONE( N ) + return OutLoop,SyrComponent,N,K + + + NextNotOne + import SyrComponent_idl + def NextNotOne( SyrComponent , N , K ) : + return SyrComponent,N,K + + + 14/3/2003 - 11:15:26 + 14/3/2003 - 11:15:26 + 1.04 + ? + ? + ? + 210 + 297 + + + ? + ? + endwhileNotOne + 5 + whileNotOne + + EndInitNotOn + + + objref + SyrComponent + + + long + N + + + long + K + + + + + objref + SyrComponent + + + long + N + + + long + K + + + + + + + + + + 14/3/2003 - 11:15:26 + 14/3/2003 - 11:15:26 + 1.04 + ? + ? + ? + 1340 + 332 + + + ? + ? + fori + 4 + endfori + + Initfori + + + long + i + + + long + K + + + + + long + i + + + long + K + + + + + + + + Initfori + def Initfori( ii , K ) : + return 1,0,K + + + Morefori + def Morefori( ii , K ) : + OutLoop = 0 + if 2 > ii : + OutLoop = 1 + return OutLoop,ii,K + + + Nextfori + def Nextfori( ii , K ) : + ii = ii + 1 + return ii,K + + + 14/3/2003 - 11:15:26 + 14/3/2003 - 11:15:26 + 1.04 + ? + ? + ? + 605 + 202 + + + ? + ? + endfori + 5 + fori + + EndInitfori + + + long + i + + + long + K + + + + + long + i + + + long + K + + + + + + + + + + 14/3/2003 - 11:15:26 + 14/3/2003 - 11:15:26 + 1.04 + ? + ? + ? + 971 + 202 + + + ? + ? + whileEven + 4 + endwhileEven + + InitEven + + + objref + SyrComponent + + + long + N + + + long + K + + + + + objref + SyrComponent + + + long + N + + + long + K + + + + + + + + InitEven + import SyrComponent_idl + def InitEven( SyrComponent , N , K ) : + return SyrComponent,N,K + + + MoreEven + import SyrComponent_idl + def MoreEven( SyrComponent , N , K ) : + OutLoop = SyrComponent.C_ISEVEN( N ) + return OutLoop,SyrComponent,N,K + + + NextEven + import SyrComponent_idl + def NextEven( SyrComponent , N , K ) : + return SyrComponent,N,K + + + 14/3/2003 - 11:15:35 + 14/3/2003 - 11:15:35 + 1.04 + ? + ? + ? + 605 + 452 + + + ? + ? + endwhileEven + 5 + whileEven + + EndInitEven + + + objref + SyrComponent + + + long + N + + + long + K + + + + + objref + SyrComponent + + + long + N + + + long + K + + + + + + + + + + 14/3/2003 - 11:15:35 + 14/3/2003 - 11:15:35 + 1.04 + ? + ? + ? + 974 + 450 + + + ? + ? + ifNotEven + 6 + endifNotEven + + ifNotEven + + + objref + SyrComponent + + + long + N + + + long + K + + + + + long + Odd + + + long + Even + + + objref + SyrComponent + + + long + N + + + long + K + + + + + + + + ifNotEven + import SyrComponent_idl + def ifNotEven( SyrComponent , N , K ) : + Even = SyrComponent.C_ISEVEN( N ) + Odd = 1 - Even + return Odd,Even,SyrComponent,N,K + + + 14/3/2003 - 11:15:35 + 14/3/2003 - 11:15:35 + 1.04 + ? + ? + ? + 416 + 286 + + + ? + ? + endifNotEven + 7 + ifNotEven + + EndifNotEven + + + long + N + + + long + K + + + + + long + N + + + long + K + + + + + + + + + + 14/3/2003 - 11:15:35 + 14/3/2003 - 11:15:35 + 1.04 + ? + ? + ? + 1155 + 331 + + + ? + ? + SyrComponent + 3 + ? + + SyrComponent + + + string + aContainer + + + string + aComponent + + + + + objref + SyrComponentobjref + + + + + + + + SyrComponent + from LifeCycleCORBA import * + def SyrComponent( aContainer , aComponent ) : + orb = CORBA.ORB_init([], CORBA.ORB_ID) + lcc = LifeCycleCORBA(orb) + print "SyrComponent(",aContainer,",",aComponent,")" + ComponentRef = lcc.FindOrLoadComponent( aContainer , aComponent ) + print "SyrComponent(",aContainer,",",aComponent,") --> ",ComponentRef + return ComponentRef + + + 14/3/2003 - 11:16:1 + 14/3/2003 - 11:16:1 + 1.04 + ? + ? + ? + 0 + 0 + + + + + + m3 + anInteger + m3incr + aCount + + + + + m3incr + aNewCount + endifNotEven + N + + + + + incra + aNewCount + endfori + K + + + 953 + 414 + + + 953 + 353 + + + + + div2 + anInteger + endwhileEven + N + + + 960 + 632 + + + 960 + 539 + + + + + incrb + aNewCount + endwhileEven + K + + + 963 + 662 + + + 963 + 729 + + + + + forN + DoLoop + endforN + DoLoop + + + + + forN + N + endforN + N + + + 1554 + 513 + + + 1523 + 513 + + + 1523 + 806 + + + 202 + 806 + + + 202 + 424 + + + + + forN + N + whileNotOne + N + + + 200 + 479 + + + 200 + 424 + + + + + forN + K + whileNotOne + K + + + 187 + 509 + + + 187 + 454 + + + + + forN + SyrComponent + endforN + SyrComponent + + + + + forN + SyrComponent + whileNotOne + SyrComponent + + + + + forN + min + endforN + min + + + + + forN + max + endforN + max + + + + + endforN + DoLoop + forN + InitLoop + + + + + whileNotOne + DoLoop + endwhileNotOne + DoLoop + + + + + whileNotOne + SyrComponent + endwhileNotOne + SyrComponent + + + + + whileNotOne + SyrComponent + ifNotEven + SyrComponent + + + + + whileNotOne + N + ifNotEven + N + + + 378 + 438 + + + 378 + 479 + + + + + whileNotOne + K + ifNotEven + K + + + 395 + 468 + + + 395 + 509 + + + + + endwhileNotOne + DoLoop + whileNotOne + InitLoop + + + + + endwhileNotOne + K + endforN + K + + + + + fori + DoLoop + endfori + DoLoop + + + + + fori + i + endfori + i + + + + + fori + K + incra + aCount + + + 783 + 353 + + + 783 + 414 + + + + + endfori + DoLoop + fori + InitLoop + + + + + endfori + K + endifNotEven + K + + + + + whileEven + DoLoop + endwhileEven + DoLoop + + + + + whileEven + SyrComponent + endwhileEven + SyrComponent + + + + + whileEven + N + div2 + anEvenInteger + + + 779 + 539 + + + 779 + 634 + + + + + whileEven + K + incrb + aCount + + + 777 + 729 + + + 777 + 664 + + + + + endwhileEven + DoLoop + whileEven + InitLoop + + + + + endwhileEven + N + endifNotEven + N + + + + + endwhileEven + K + endifNotEven + K + + + + + ifNotEven + Default + endifNotEven + Default + + + + + ifNotEven + Odd + m3 + InGate + + + 585 + 133 + + + 585 + 438 + + + + + ifNotEven + Odd + fori + InGate + + + 584 + 324 + + + 584 + 438 + + + + + ifNotEven + Even + whileEven + InGate + + + 593 + 574 + + + 593 + 468 + + + + + ifNotEven + SyrComponent + whileEven + SyrComponent + + + + + ifNotEven + N + whileEven + N + + + 586 + 634 + + + 586 + 498 + + + + + ifNotEven + N + m3 + anOddInteger + + + 579 + 163 + + + 579 + 498 + + + + + ifNotEven + K + whileEven + K + + + 580 + 664 + + + 580 + 528 + + + + + ifNotEven + K + fori + K + + + 599 + 414 + + + 599 + 528 + + + + + endifNotEven + N + endwhileNotOne + N + + + 1324 + 514 + + + 1324 + 483 + + + + + endifNotEven + K + endwhileNotOne + K + + + 1318 + 544 + + + 1318 + 513 + + + + + SyrComponent + SyrComponentobjref + forN + SyrComponent + + + + + + + + SyrStruct + forN\N + forN + N + + 3 + 0 + + + + + + SyrStruct + forN\K + forN + K + + 3 + 0 + + + + + + SyrStruct + forN\min + forN + min + + 3 + 5 + + + + + + SyrStruct + forN\max + forN + max + + 3 + 9 + + + + + + SyrStruct + fori\i + fori + i + + 3 + 0 + + + + + + SyrStruct + SyrComponent\aContainer + SyrComponent + aContainer + + 18 + FactoryServer + + + + + + SyrStruct + SyrComponent\aComponent + SyrComponent + aComponent + + 18 + SyrComponent + + + + + + + diff --git a/examples/myFactorialPy.py b/examples/myFactorialPy.py new file mode 100644 index 0000000..e91a577 --- /dev/null +++ b/examples/myFactorialPy.py @@ -0,0 +1,19 @@ + +from SuperV import * + +myPy = Graph('myPy') + +eval = myPy.Node('FactorialComponent','FactorialComponent','eval') +eval.SetContainer('FactoryServerPy') + +myPy.IsValid() + +myPy.PrintPorts() + +myPy.Run( 3 ) + +myPy.DoneW() + +myPy.State() + +myPy.PrintPorts() diff --git a/examples/newsupervisionexample.py b/examples/newsupervisionexample.py new file mode 100644 index 0000000..79a2986 --- /dev/null +++ b/examples/newsupervisionexample.py @@ -0,0 +1,55 @@ + +# Generated python file of Graph GraphEssai + +from SuperV import * +# Graph creation +GraphEssai = Graph( 'GraphEssai' ) +GraphEssai.SetName( 'GraphEssai' ) +GraphEssai.SetAuthor( '' ) +GraphEssai.SetComment( '' ) +GraphEssai.Coords( 0 , 0 ) + +# Creation of Computing Nodes +Add = GraphEssai.Node( 'AddComponent' , 'AddComponent' , 'Add' ) +Add.SetName( 'Add' ) +Add.SetAuthor( '' ) +Add.SetContainer( 'FactoryServer' ) +Add.SetComment( '' ) +Add.Coords( 15 , 241 ) +Sub = GraphEssai.Node( 'SubComponent' , 'SubComponent' , 'Sub' ) +Sub.SetName( 'Sub' ) +Sub.SetAuthor( '' ) +Sub.SetContainer( 'FactoryServer' ) +Sub.SetComment( '' ) +Sub.Coords( 227 , 99 ) +Mul = GraphEssai.Node( 'MulComponent' , 'MulComponent' , 'Mul' ) +Mul.SetName( 'Mul' ) +Mul.SetAuthor( '' ) +Mul.SetContainer( 'FactoryServer' ) +Mul.SetComment( '' ) +Mul.Coords( 443 , 278 ) +Div = GraphEssai.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 = GraphEssai.Link( Addz , Sub.Port( 'y' ) ) +Muly = GraphEssai.Link( Addz , Mul.Port( 'y' ) ) +Subz = Sub.Port( 'z' ) +Mulx = GraphEssai.Link( Subz , Mul.Port( 'x' ) ) +Divx = GraphEssai.Link( Subz , Div.Port( 'x' ) ) +Mulz = Mul.Port( 'z' ) +Divy = GraphEssai.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' ) diff --git a/examples/newsupervisionexample.xml b/examples/newsupervisionexample.xml new file mode 100644 index 0000000..9e3ec06 --- /dev/null +++ b/examples/newsupervisionexample.xml @@ -0,0 +1,287 @@ + + + + + + + + + GraphEssai + ? + GraphEssai + 1 + ? + + GraphEssai + + + double + Add\x + + + double + Add\y + + + double + Sub\x + + + + + double + Add\FuncValue + + + double + Div\z + + + + + + 21/11/2001 - 17:17:23 + 31/7/2002 - 16:43:19 + 1.00 + ? + FactoryServer + ? + 0 + 0 + + + + + + AddComponent + AddComponent + Add + 0 + ? + + Add + + + double + x + + + double + y + + + + + double + FuncValue + + + double + z + + + + + + 31/7/2002 - 16:43:19 + 31/7/2002 - 16:43:19 + 1.00 + ? + FactoryServer + ? + 15 + 241 + + + SubComponent + SubComponent + Sub + 0 + ? + + Sub + + + double + x + + + double + y + + + + + double + z + + + + + + 31/7/2002 - 16:43:19 + 31/7/2002 - 16:43:19 + 1.00 + ? + FactoryServer + ? + 227 + 99 + + + MulComponent + MulComponent + Mul + 0 + ? + + Mul + + + double + x + + + double + y + + + + + double + z + + + + + + 31/7/2002 - 16:43:19 + 31/7/2002 - 16:43:19 + 1.00 + ? + FactoryServer + ? + 443 + 278 + + + DivComponent + DivComponent + Div + 0 + ? + + Div + + + double + x + + + double + y + + + + + double + z + + + + + + 31/7/2002 - 16:43:19 + 31/7/2002 - 16:43:19 + 1.00 + ? + FactoryServer + ? + 634 + 97 + + + + + + Add + z + Sub + y + + + + + Add + z + Mul + y + + + + + Sub + z + Mul + x + + + + + Sub + z + Div + x + + + + + Mul + z + Div + y + + + + + + + + GraphEssai + Add\x + Add + x + + 7 + 3 + + + + + + GraphEssai + Add\y + Add + y + + 7 + 4.5 + + + + + + GraphEssai + Sub\x + Sub + x + + 7 + 1.5 + + + + + + + -- 2.39.2